From 70409d77800359a57f87e014af289d5c1ea9aa88 Mon Sep 17 00:00:00 2001 From: Sean Fong Date: Tue, 9 Jul 2024 19:17:39 +0930 Subject: [PATCH] Add populate and assemble operation docs --- documentation/docs/operations/assemble.mdx | 33 +++++++++++++++ documentation/docs/operations/index.mdx | 31 +++++++------- documentation/docs/operations/populate.mdx | 47 ++++++++++++++++++++++ 3 files changed, 96 insertions(+), 15 deletions(-) create mode 100644 documentation/docs/operations/assemble.mdx create mode 100644 documentation/docs/operations/populate.mdx diff --git a/documentation/docs/operations/assemble.mdx b/documentation/docs/operations/assemble.mdx new file mode 100644 index 00000000..b6129b29 --- /dev/null +++ b/documentation/docs/operations/assemble.mdx @@ -0,0 +1,33 @@ +--- +sidebar_position: 3 +--- + +# $assemble + +## Useful links + +**Deployed service: https://smartforms.csiro.au/api/fhir/Questionnaire/$assemble** + +FHIR Operation definition: http://hl7.org/fhir/uv/sdc/OperationDefinition/Questionnaire-assemble + +Github: https://github.com/aehrc/smart-forms/tree/main/services/assemble-express + +Dockerhub: https://hub.docker.com/r/aehrc/smart-forms-assemble + +## Usage + +A Questionnaire resource can be assembled using a **POST** request to a URL such as: + +```http request +https://smartforms.csiro.au/api/fhir/Questionnaire/$assemble (type-level) +``` + +#### Parameters + +| Name | Cardinality | Type | Documentation | +| ------------- | ----------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| questionnaire | 1..1 | Questionnaire | The [Modular Questionnaire](https://hl7.org/fhir/uv/sdc/StructureDefinition-sdc-questionnaire-modular.html) to assemble the content of. | + +#### Try it out + +[Run In Postman](https://elements.getpostman.com/redirect?entityId=22885901-2af2cfbb-3a0a-49c6-8404-105ef0751415&entityType=collection) diff --git a/documentation/docs/operations/index.mdx b/documentation/docs/operations/index.mdx index 7c36fa14..a0a6dfd1 100644 --- a/documentation/docs/operations/index.mdx +++ b/documentation/docs/operations/index.mdx @@ -8,18 +8,19 @@ sidebar_label: Introduction Smart Forms provides reference implementations for `$populate` and `$assemble` operations as [ExpressJS](https://expressjs.com/) services to complement the FHIR Questionnaire renderer. These operations are available as Docker images and can be deployed as microservices. -[//]: # '1. **`$populate`**' -[//]: # ' Operation definition: [SDCPopulateQuestionnaire](http://hl7.org/fhir/uv/sdc/OperationDefinition/Questionnaire-populate)' -[//]: # ' Github repository:' -[//]: # -[//]: # ' A React-based library that contains the rendering engine. It acts as a reference implementation for the [SDC Form Filler](https://hl7.org/fhir/uv/sdc/CapabilityStatement-sdc-form-filler.html).' -[//]: # -[//]: # '2. **`$assemble`** ([@aehrc/sdc-populate](https://www.npmjs.com/package/@aehrc/sdc-populate))' -[//]: # -[//]: # ' A reference implementation of the [SDC Populate Questionnaire](https://hl7.org/fhir/uv/sdc/OperationDefinition-Questionnaire-populate.html) operation, also known as $populate.' -[//]: # ' Currently, there are no written documentation available for this library. Please refer to the [API](/docs/api/sdc-populate) for more information.' -[//]: # -[//]: # '3. **SDC Assemble** ([@aehrc/sdc-assemble](https://www.npmjs.com/package/@aehrc/sdc-assemble))' -[//]: # -[//]: # ' A reference implementation of the [SDC Assemble Questionnaire](https://hl7.org/fhir/uv/sdc/OperationDefinition-Questionnaire-assemble.html) operation, also known as $assemble.' -[//]: # ' Currently, there are no written documentation available for this library. Please refer to the [API](/docs/api/sdc-assemble) for more information.' +1. **$populate** (https://smartforms.csiro.au/api/fhir/Questionnaire/$populate) + + A reference implementation of the [SDC Populate Questionnaire](https://hl7.org/fhir/uv/sdc/OperationDefinition-Questionnaire-populate.html) operation, also known as $populate. + It builds on the [@aehrc/sdc-populate](https://www.npmjs.com/package/@aehrc/sdc-populate) library. + +2. **$assemble** (https://smartforms.csiro.au/api/fhir/Questionnaire/$assemble) + + A reference implementation of the [SDC Assemble](https://hl7.org/fhir/uv/sdc/OperationDefinition-Questionnaire-assemble.html) operation, also known as $assemble. + It builds on the [@aehrc/sdc-assemble](https://www.npmjs.com/package/@aehrc/sdc-assemble) library. + +3. **$extract** (https://proxy.smartforms.io/fhir/QuestionnaireResponse/$extract) + + A **proof-of-concept** reference implementation of the [SDC QuestionnaireResponse Extract](https://hl7.org/fhir/uv/sdc/OperationDefinition-QuestionnaireResponse-extract.html) operation, also known as $extract. + + This $extract POC reference implementation is an abstraction on top of an existing StructureMap $transform operation. + We leveraged Brian Postlethwaite's [.NET FHIR Mapping Language engine](https://github.com/brianpos/fhir-net-mappinglanguage/tree/main/demo-map-server) to expose a StructureMap $transform operation on https://proxy.smartforms.io/fhir/StructureMap/$transform. diff --git a/documentation/docs/operations/populate.mdx b/documentation/docs/operations/populate.mdx new file mode 100644 index 00000000..7f4b9fca --- /dev/null +++ b/documentation/docs/operations/populate.mdx @@ -0,0 +1,47 @@ +--- +sidebar_position: 2 +--- + +# $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: 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: + +```http request +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. + +```http request +https://smartforms.csiro.au/api/fhir/Questionnaire/$populate?debug=true +``` + +#### Try it out + +[Run In Postman](https://elements.getpostman.com/redirect?entityId=22885901-2af2cfbb-3a0a-49c6-8404-105ef0751415&entityType=collection)