Skip to content

Commit

Permalink
Merge pull request #909 from aehrc/fix/docs
Browse files Browse the repository at this point in the history
Add populate and assemble operation docs
  • Loading branch information
fongsean authored Jul 10, 2024
2 parents b76be27 + 70409d7 commit a45eaca
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 15 deletions.
33 changes: 33 additions & 0 deletions documentation/docs/operations/assemble.mdx
Original file line number Diff line number Diff line change
@@ -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

[<img src="https://run.pstmn.io/button.svg" alt="Run In Postman"/>](https://elements.getpostman.com/redirect?entityId=22885901-2af2cfbb-3a0a-49c6-8404-105ef0751415&entityType=collection)
31 changes: 16 additions & 15 deletions documentation/docs/operations/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
47 changes: 47 additions & 0 deletions documentation/docs/operations/populate.mdx
Original file line number Diff line number Diff line change
@@ -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

[<img src="https://run.pstmn.io/button.svg" alt="Run In Postman"/>](https://elements.getpostman.com/redirect?entityId=22885901-2af2cfbb-3a0a-49c6-8404-105ef0751415&entityType=collection)

0 comments on commit a45eaca

Please sign in to comment.