diff --git a/Conformance.md b/Conformance.md index 4715d3414..06519d5cf 100644 --- a/Conformance.md +++ b/Conformance.md @@ -1,6 +1,8 @@ -# Smart Forms Questionnaire & SDC conformance +# Questionnaire & SDC conformance -Smart Forms is based on FHIR R4. +Smart Forms is based on FHIR R4. The checklist below is a summary of the Questionnaire item types and SDC extensions supported by Smart Forms. + +For specific details of each item types/extensions, refer to the [docs](https://smartforms.csiro.au/docs). ## Supported item types The list can be found here: http://hl7.org/fhir/R4/valueset-item-type.html @@ -157,16 +159,7 @@ View the source here: http://hl7.org/fhir/uv/sdc/behavior.html - [x] initialExpression - [x] calculatedExpression - [ ] cqf-calculatedValue -- [ ] cqf-expression - -| Item types that support calculations
(refer https://www.hl7.org/fhir/r4/codesystem-item-type.html) | -|---------------------------------------------------------------------------------------------------------| -| integer | -| decimal | -| string | -| text | -| boolean | -| choice (limited to the below)
- radio item control
- dropdown item control | +- [x] cqf-expression #### [Other Control](http://hl7.org/fhir/uv/sdc/behavior.html#other-control) diff --git a/README.md b/README.md index 9ff78dfc5..3a90640ab 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,9 @@

Powered by SMART on FHIR and Structured Data Capture, Smart Forms allow you to easily integrate forms into your existing healthcare system.

-

Show me the app ➡️

+

Show me the app ➡️

+ +

Check out the documentation 📚

--- Smart Forms is a Typescript-based [React](https://reactjs.org/) forms web application currently ongoing development by [CSIRO's Australian e-Health Research Centre](https://aehrc.csiro.au/) as part of the Primary Care Data Quality project funded by the Australian Government Department of Health. @@ -13,8 +15,7 @@ The web app is intended to demonstrate the use of [HL7 FHIR](https://hl7.org/fhi This project was bootstrapped with [Vite](https://vitejs.dev/).
-**If you are interested in using the rendering engine in your projects, a standalone package is published on NPM as [@aehrc/smart-forms-renderer](https://www.npmjs.com/package/@aehrc/smart-forms-renderer).** - +**If you are interested in using the form renderer in your React app, a standalone package is published on NPM as [@aehrc/smart-forms-renderer](https://www.npmjs.com/package/@aehrc/smart-forms-renderer).** ## Functionalities @@ -46,7 +47,7 @@ NOTE: The patients featured in the screenshots are synthetic and do not represen 2. Implemented operations from the [Structured Data Capture (SDC)](http://hl7.org/fhir/uv/sdc/) specification: - [$populate](https://hl7.org/fhir/uv/sdc/OperationDefinition/Questionnaire-populate) - [$assemble](https://hl7.org/fhir/uv/sdc/OperationDefinition/Questionnaire-assemble) -3. A standalone component of the questionnaire-rendering engine published on NPM as [@aehrc/smart-forms-renderer](https://www.npmjs.com/package/@aehrc/smart-forms-renderer). +3. A standalone component of the questionnaire renderer published on NPM as [@aehrc/smart-forms-renderer](https://www.npmjs.com/package/@aehrc/smart-forms-renderer). ## Conformance @@ -134,7 +135,7 @@ We are also accepting contributions to make the product better! Please read [CON ## Discussions -We encourage having discussions on [chat.fhir.org](chat.fhir.org). +We encourage having discussions on [chat.fhir.org](https://chat.fhir.org/). Smart Forms-related discussions can be raised in the Smart Forms's stream: https://chat.fhir.org/#narrow/stream/425534-smart-forms. diff --git a/packages/sdc-populate/README.md b/packages/sdc-populate/README.md index d12aa2d73..a430aae32 100644 --- a/packages/sdc-populate/README.md +++ b/packages/sdc-populate/README.md @@ -2,8 +2,7 @@ A Typescript reference implementation of the [$populate](http://hl7.org/fhir/uv/sdc/OperationDefinition-Questionnaire-populate.html) operation from the [HL7 FHIR Structured Data Capture Specification](http://hl7.org/fhir/uv/sdc/ImplementationGuide/hl7.fhir.uv.sdc) designed for [Form Population](http://hl7.org/fhir/uv/sdc/populate.html). -## Usage -Not written yet... +Check out the [API Reference](https://smartforms.csiro.au/docs/api/sdc-populate) for technical specifications. ### Note for Vite users (or if you facing CommonJS/ESM issues) If you are using Vite, you might need to add the following to your ```vite.config.ts``` file: diff --git a/packages/smart-forms-renderer/README.md b/packages/smart-forms-renderer/README.md index 41e0bb5c2..ad28ce43e 100644 --- a/packages/smart-forms-renderer/README.md +++ b/packages/smart-forms-renderer/README.md @@ -1,108 +1,10 @@ # Smart Forms Renderer -This React-based package acts as the rendering engine for the [Smart Forms app](https://github.com/aehrc/smart-forms). -Try out a minimal demo here: https://smartforms.csiro.au/standalone. +A React-based library that contains the Questionnaire renderer used in the Smart Forms app. +It acts as a reference implementation for the [SDC Form Filler](https://hl7.org/fhir/uv/sdc/CapabilityStatement-sdc-form-filler.html). -## Installation -```bash -npm install @aehrc/smart-forms-renderer -``` +

Check out the documentation 📚

-## Basic Usage - -```typescript jsx -import React from 'react'; -import { SmartFormsRenderer, getResponse } from '@aehrc/smart-forms-renderer'; - -export default function App () { - const questionnaire = {...} // FHIR R4.Questionnaire - - return ( -
- -
- ) -} -``` -Note: The SmartFormsRenderer component trades customisability for simplicity. If you need more control over the rendering engine, refer to the Advanced Usage section. - - -### SmartFormsRenderer Props - - -| Name | Type | Description | Required? | -|-----------------------|-------------------------------|---------------------------------------------------------------------------------------------------------------------|-----------| -| questionnaire | FHIR R4.Questionnaire | Questionnaire to be rendered | Required | -| questionnaireResponse | FHIR R4.QuestionnaireResponse | Pre-populated QuestionnaireResponse to be rendered | Optional | -| additionalVariables | `Record` | Key-value pair of [SDC variables](http://hl7.org/fhir/R4/extension-variable.html) `Record` | Optional | -| terminologyServerUrl | string | Terminology server url to fetch terminology | Optional | - -The below props are not supported at the moment, but will be in the future. - -| Name | Type | Description | -|----------------------|------------------------------------------------------|---------------------------------------------| -| fhirClient | [Client](https://github.com/smart-on-fhir/client-js) | FhirClient to perform further FHIR calls | - -### Functions - -```javascript -/** - * Get the filled QuestionnaireResponse at its current state. - * If no changes have been made to the form, the initial or an empty QuestionnaireResponse is returned. - * - * @returns {FHIR R4.QuestionnaireResponse} The filled QuestionnaireResponse - */ -function getResponse() {} -``` - - -## Advanced Usage (If basic usage does not suffice) - -```typescript -/* Components */ -// A self-initialising wrapper around the rendering engine. This is sufficient for most use cases. - -function SmartFormsRenderer(props: { - questionnaire: Questionnaire, - questionnaireResponse?: QuestionnaireResponse, - additionalVariables?: Record, - terminologyServerUrl?: string, -}): JSX.Element {} - -// BaseRenderer underneath the SmartFormsRenderer wrapper. Requires buildForm() to initialise form. -function BaseRenderer(): JSX.Element {} - -/* Functions */ -// Get the filled QuestionnaireResponse at its current state. -// If no changes have been made to the form, the initial QuestionnaireResponse is returned. -function getResponse(): QuestionnaireResponse {} - -// Build the form with an initial Questionnaire and an optional filled QuestionnaireResponse. -// If a QuestionnaireResponse is not provided, an empty QuestionnaireResponse is set as the initial QuestionnaireResponse. -async function buildForm( - questionnaire: Questionnaire, - questionnaireResponse?: QuestionnaireResponse -): Promise {} - -// Destroy the form to clean up the questionnaire and questionnaireResponse stores. -function destroyForm(): void {} - -// Remove all hidden answers from the filled QuestionnaireResponse. -// This takes into account the questionnaire-hidden extension, enableWhens and enableWhenExpressions. -function removeHiddenAnswersFromResponse( - questionnaire: Questionnaire, - questionnaireResponse: QuestionnaireResponse -): QuestionnaireResponse {} -``` - -The Smart Forms app uses a even finer-grained control which directly interacts with the state management stores. - -At the moment there are no plans to document state management methods, but happy to do so if there is demand for it. -Raise a request in https://github.com/aehrc/smart-forms/issues if you want to see it happen! ---