QuestionnaireResponse Extract
Extracts data from a questionnaire response into templated resources. It implements the template-based extraction flow from the draft Structured Data Capture v4 IG. See Structured Data Capture for more information.
[baseUrl]/QuestionnaireResponse/$extract
[baseUrl]/QuestionnaireResponse/[id]/$extract
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
questionnaire-response | QuestionnaireResponse | The response to parse | No1 |
questionnaire | Questionnaire | The Questionnaire to use for parsing the response | No2 |
1 If not called on a specific QuestionnaireResponse by ID, the response must be specified via the questionnaire-response parameter.
2 If QuestionnaireResponse.questionnaire is not specified in the resource, it must be passed in via the questionnaire parameter; otherwise it can be used to override the Questionnaire used for parsing.
Output
The operation returns a Bundle resource containing the resources populated from templates in the Questionnaire, derived from values in the QuestionnaireResponse.
Request:
Given a QuestionnaireResponse with an associated Questionnaire, e.g.`
{
"resourceType": "QuestionnaireResponse",
"id": "1c503f4e-a08c-4b7d-8ebd-bfc67b0ab761",
"status": "completed",
"questionnaire": "Questionnaire/f80e508b-9aaa-41e3-aa8e-0e4817c86b44"
// ...
}
GET https://api.medplum.com/fhir/R4/QuestionnaireResponse/1c503f4e-a08c-4b7d-8ebd-bfc67b0ab761/$extract
curl 'https://api.medplum.com/fhir/R4/QuestionnaireResponse/1c503f4e-a08c-4b7d-8ebd-bfc67b0ab761/$extract' \
-H "Authorization: Bearer $MY_ACCESS_TOKEN"
Response (200 OK):
{
"resourceType": "Bundle",
"type": "transaction",
"entry": [
// Populated template resources
]
}