3. A partially-filled QuestionnaireResponse is generated with $populate

POST https://api-{{tenant-id}}.developer.commure.com/api/v1/r4/Questionnaire/$populate

Next, the healthcare provider will select to start a new response to the “Patient Insurance” Questionnaire in the context of the previously selected Patient. The selected Questionnaire resource’s questions serve as a template for a new QuestionnaireResponse resource that will contain the provider’s responses to questions, as its name suggests.

Client applications can avoid much of the complexity involved in deriving a QuestionnaireResponse from a Questionnaire by taking advantage of the extended operation, Questionnaire/$populate. In the process of creating a new QuestionnaireResponse, the operation fills in answers to questions wherever possible.

Extended operations, denoted with names that start with a dollar sign ($), provide additional functionality beyond the basic CRUD operations defined in the FHIR REST API specification. The inputs of extended operations are often provided as a collection of key-value pairs in a Parameters resource, as shown in this request.

Omitted from this request is the use of the optional parameter, content, which is used to provide additional context during the populate process. The Questionnaire in this scenario is written such that an existing Coverage resource in the content parameter can potentially populate the entirety of the QuestionnaireResponse.

Request Body

{"resourceType"=>"Parameters", "parameter"=>[{"name"=>"identifier", "valueUri"=>"https://commure.com/fhir/Questionnaire/insurance"}, {"name"=>"subject", "valueReference"=>{"reference"=>"Patient/{{patient-id}}"}}, {"name"=>"local", "valueBoolean"=>true}]}

RESPONSES

status: OK

{"resourceType":"Bundle","type":"searchset","link":[{"relation":"self","url":"Encounter?status=in-progress\u0026_include=Encounter%3Asubject\u0026subject=cca00185-bc2e-435f-af0b-eecb8d4af9c2\u0026_count=50"}],"entry":[{"fullUrl":"https://api-53914125.developer.commure.com/api/v1/r4/Encounter/c85827b1-13e5-401c-89c5-774c77102346","resource":{"resourceType":"Encounter","id":"c85827b1-13e5-401c-89c5-774c77102346","meta":{"extension":[{"extension":[{"url":"clientname","valueString":"data_uploader"},{"url":"person","valueReference":{"reference":"Person/bea178a0-6ea4-4b47-99af-e4021bba8f99"}}],"url":"https://commure.com/fhir/provenance/StructureDefinition/creator-structure-map"}],"versionId":"2ac36db1-f3fb-49da-8ee4-ca3d8518ca9d","lastUpdated":"2020-10-21T16:16:33.805923+00:00"},"status":"in-progress","class":{"system":"http://terminology.hl7.org/CodeSystem/v3-ActCode","code":"PRENC","display":"pre-admission"},"subject":{"reference":"Patient/cca00185-bc2e-435f-af0b-eecb8d4af9c2","type":"Patient"},"period":{"start":"2020-10-20T01:45:32.00-05:00"}},"search":{"mode":"match"}},{"fullUrl":"https://api-53914125.developer.commure.com/api/v1/r4/Patient/cca00185-bc2e-435f-af0b-eecb8d4af9c2","resource":{"resourceType":"Patient","id":"cca00185-bc2e-435f-af0b-eecb8d4af9c2","meta":{"extension":[{"extension":[{"url":"clientname","valueString":"data_uploader"},{"url":"person","valueReference":{"reference":"Person/bea178a0-6ea4-4b47-99af-e4021bba8f99"}}],"url":"https://commure.com/fhir/provenance/StructureDefinition/creator-structure-map"}],"versionId":"bd250ec1-2d24-49ec-9c52-5c7573d7b520","lastUpdated":"2020-10-21T16:16:33.711007+00:00"},"name":[{"family":"Patient","given":["Test"]}]},"search":{"mode":"include"}}]}