4. The QuestionnaireResponse is used to create a Coverage resource with $extract

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

With a completed QuestionnaireResponse, we’ll invoke the extended operation, QuestionnaireResponse/$extract. This operation uses the answers in the QuestionnaireResponse to generate the resource(s) specified by the original Questionnaire.

While the questions in the Questionnaire for this scenario were designed to correspond simply with the fields of a Coverage resource, a generic mechanism for extracting structured data while maintaining the flexibility and control possible with Questionnaire is significantly more compelling in practice.

Note that as a final step, the client application must submit the transaction Bundle that this operation returns to store the extracted Coverage resource.

Request Body

{"resourceType"=>"Parameters", "parameter"=>[{"name"=>"questionnaire-response", "resource"=>{"resourceType"=>"QuestionnaireResponse", "questionnaire"=>"https://commure.com/fhir/Questionnaire/insurance|1.0.0", "status"=>"in-progress", "subject"=>{"reference"=>"Patient/{{patient-id}}"}, "item"=>[{"linkId"=>"coverage", "item"=>[{"linkId"=>"subscriber-id", "definition"=>"http://hl7.org/fhir/StructureDefinition/Coverage#Coverage.subscriberId", "text"=>"Insurance Id Number", "answer"=>[{"valueString"=>"123-456-789"}]}, {"linkId"=>"payor", "definition"=>"http://hl7.org/fhir/StructureDefinition/Coverage#Coverage.payor", "text"=>"Insurance company name", "answer"=>[{"valueReference"=>{"reference"=>"Organization/{{organization-id}}"}}]}, {"linkId"=>"status", "definition"=>"http://hl7.org/fhir/StructureDefinition/Coverage#Coverage.status", "text"=>"Status of coverage", "answer"=>[{"valueCoding"=>{"system"=>"http://hl7.org/fhir/ValueSet/fm-status", "code"=>"active"}}]}, {"linkId"=>"beneficiary-reference", "definition"=>"http://hl7.org/fhir/StructureDefinition/Coverage#Coverage.beneficiary.reference", "answer"=>[{"valueString"=>"Patient/{{patient-id}}"}]}, {"linkId"=>"coverage-id", "definition"=>"http://hl7.org/fhir/StructureDefinition/Coverage#Coverage.id"}]}]}}]}