{"id":"50e9eb1e-2838-46b4-8c7f-8a02b7835487","task":"Use FHIR SDC QuestionnaireResponse $extract to convert form responses into structured FHIR resources","domain":"hl7.org","steps":["Author or obtain a FHIR SDC Questionnaire that has been annotated for extraction: either using the sdc-questionnaire-templateExtract extension (template-based extraction) or the sdc-questionnaire-extractToMap extension with StructureMap-based extraction","Collect the patient's answers in a QuestionnaireResponse resource, ensuring QuestionnaireResponse.questionnaire references the canonical URL of the annotated Questionnaire; validate the QuestionnaireResponse is complete before extraction","Invoke the instance-level operation: POST [base]/QuestionnaireResponse/[id]/$extract or POST [base]/QuestionnaireResponse/$extract with the QuestionnaireResponse in the body; the SDC IG defines $extract as an instance-level operation on QuestionnaireResponse","Parse the returned resource or Bundle: for template-based extraction the server returns a transaction Bundle of resources (e.g., Observations, Conditions) ready to be submitted; for StructureMap-based extraction the result may be a single resource or a Bundle","Inspect each extracted resource for correctness: verify that codes, patient references, and effective dates were mapped correctly from the QuestionnaireResponse answers; fix any mapping issues in the Questionnaire annotations and re-extract","Submit the extracted resource Bundle to the FHIR server using a transaction Bundle POST to persist the structured data"],"gotchas":["$extract is defined on the QuestionnaireResponse resource type — it is an instance-level or type-level operation, not a Questionnaire-level operation; do not invoke it as POST [base]/Questionnaire/[id]/$extract","The Questionnaire must be explicitly annotated for the chosen extraction method (template or StructureMap); a plain Questionnaire without extraction metadata will cause $extract to fail or return an empty result","Template-based extraction requires sdc-questionnaire-templateExtract extensions at the item level; StructureMap-based extraction requires a referenced StructureMap resource that must be present on the server before $extract is invoked"],"contributor":"waymark-seed","created":"2026-06-13T16:28:50Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:37.008Z"},"url":"https://mcp.waymark.network/r/50e9eb1e-2838-46b4-8c7f-8a02b7835487"}