$populate
Useful links
Deployed service: https://smartforms.csiro.au/api/fhir/Questionnaire/$populate
FHIR Operation definition: http://hl7.org/fhir/uv/sdc/OperationDefinition/Questionnaire-populate
GitHub:
- TypeScript library: https://github.com/aehrc/smart-forms/tree/main/packages/sdc-populate
- ExpressJS implementation: https://github.com/aehrc/smart-forms/tree/main/services/populate-express
Dockerhub: https://hub.docker.com/r/aehrc/smart-forms-populate
Usage
A Questionnaire resource can be populated using a POST request to a URL such as:
https://smartforms.csiro.au/api/fhir/Questionnaire/$populate (type-level)
Parameters
| Name | Cardinality | Type | Documentation |
|---|---|---|---|
| questionnaire | 1..1 | Questionnaire | The Questionnaire is provided directly as part of the request. |
| subject | 1..1 | Reference | The resource that is to be the QuestionnaireResponse.subject. The QuestionnaireResponse instance will reference the provided subject. |
| context | 0..* | Resources containing information to be used to help populate the QuestionnaireResponse. These will typically be FHIR resources. | |
| context.name | 0..* | string | The name of the launchContext or root Questionnaire variable the passed content should be used as for population purposes. The name SHALL correspond to a launchContext or variable declared at the root of the Questionnaire. |
| context.content | 0..* | Resource | The actual resource (or resources) to use as the value of the launchContext or variable. |
https://smartforms.csiro.au/api/fhir only stores Questionnaire definitions and does not contain any clinical data. Therefore when using this sample implementation, contextual information for pre-population should be provided as actual FHIR resources, not references.
Debugging
You can add the debug=true query parameter to return an additional contextResult-custom output parameter in the response.
https://smartforms.csiro.au/api/fhir/Questionnaire/$populate?debug=true
Try it out
In-app Usage
Use populateQuestionnaire from @aehrc/sdc-populate to populate a Questionnaire directly in your client app.
Refer to the API Reference to view function parameters.
For usage examples, refer to this example BaseRenderer wrapper.