Skip to content

Commit

Permalink
Merge pull request #812 from aehrc/issue/692
Browse files Browse the repository at this point in the history
Issue/692
  • Loading branch information
fongsean authored May 24, 2024
2 parents d851143 + e3fc903 commit 7ea8db3
Show file tree
Hide file tree
Showing 30 changed files with 79 additions and 78 deletions.
2 changes: 1 addition & 1 deletion documentation/docs/components/choice.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ With Response
/>
</IframeContainer>

There are SDC advanced form rendering usages in the SDC [Question Rendering](/smart-forms/docs/sdc/advanced/question) section.
There are SDC advanced form rendering usages in the SDC [Question Rendering](/docs/sdc/advanced/question) section.

If there are any advanced usage scenarios you'd like to see, feel free to [let us know](https://github.com/aehrc/smart-forms/issues/new).

Expand Down
4 changes: 2 additions & 2 deletions documentation/docs/components/display.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import IframeContainer from '../../src/react/IframeContainer';

### Advanced usage

#### Calculations with [cqf-expression](/smart-forms/docs/sdc/calculations#cqf-expression)
#### Calculations with [cqf-expression](/docs/sdc/calculations#cqf-expression)

<IframeContainer storyUrl="https://smartforms.csiro.au/storybook/index.html?path=/story/component-itemtype-display--display-calculation">
<iframe
Expand All @@ -30,7 +30,7 @@ import IframeContainer from '../../src/react/IframeContainer';
/>
</IframeContainer>

There are SDC advanced form rendering usages in the SDC [Display/Text Rendering](http://localhost:3000/smart-forms/docs/sdc/advanced/display) section.
There are SDC advanced form rendering usages in the SDC [Display/Text Rendering](/docs/sdc/advanced/display) section.

If there are any advanced usage scenarios you'd like to see, feel free to [let us know](https://github.com/aehrc/smart-forms/issues/new).

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/components/group.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import IframeContainer from '../../src/react/IframeContainer';

### Advanced usage

There are SDC advanced form rendering usages in the SDC [Group Rendering](http://localhost:3000/smart-forms/docs/sdc/advanced/group) section.
There are SDC advanced form rendering usages in the SDC [Group Rendering](/docs/sdc/advanced/group) section.

If there are any advanced usage scenarios you'd like to see, feel free to [let us know](https://github.com/aehrc/smart-forms/issues/new).

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/components/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Refer to https://www.hl7.org/fhir/r4/codesystem-item-type.html for the source of

### Usage examples guide

The following section showcases usage basic and advanced examples. Some of the advanced examples can be explored further in the [SDC](/smart-forms/docs/sdc) section.
The following section showcases usage basic and advanced examples. Some of the advanced examples can be explored further in the [SDC](/docs/sdc) section.

Usage examples come with a "Open in Storybook" button, which takes you to the source component defined in [Storybook](https://storybook.js.org/). It provides a live playground to experiment with the component via the "Controls" tab.

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/components/integer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import IframeContainer from '../../src/react/IframeContainer';
/>
</IframeContainer>

There are SDC advanced form rendering usages in the SDC [Question Rendering](/smart-forms/docs/sdc/advanced/question) section.
There are SDC advanced form rendering usages in the SDC [Question Rendering](/docs/sdc/advanced/question) section.

If there are any advanced usage scenarios you'd like to see, feel free to [let us know](https://github.com/aehrc/smart-forms/issues/new).

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/components/open-choice.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ With Response
/>
</IframeContainer>

There are SDC advanced form rendering usages in the SDC [Question Rendering](/smart-forms/docs/sdc/advanced/question) section.
There are SDC advanced form rendering usages in the SDC [Question Rendering](/docs/sdc/advanced/question) section.

If there are any advanced usage scenarios you'd like to see, feel free to [let us know](https://github.com/aehrc/smart-forms/issues/new).

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/components/quantity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ There is an extension "http://hl7.org/fhir/StructureDefinition/questionnaire-uni

:::warning

This component is not thoroughly tested yet. It is currently using the same exact UI component as **[decimal](/smart-forms/docs/components/decimal)**. Please use it with caution.
This component is not thoroughly tested yet. It is currently using the same exact UI component as **[decimal](/docs/components/decimal)**. Please use it with caution.

:::

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/components/reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import IframeContainer from '../../src/react/IframeContainer';

:::warning

This component is not thoroughly tested yet. It is currently using the same exact UI component as **[string](/smart-forms/docs/components/string)**. Please use it with caution.
This component is not thoroughly tested yet. It is currently using the same exact UI component as **[string](/docs/components/string)**. Please use it with caution.

:::

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/components/url.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import IframeContainer from '../../src/react/IframeContainer';

:::warning

This component is not thoroughly tested yet. It is currently using the same exact UI component as **[string](/smart-forms/docs/components/string)**. Please use it with caution.
This component is not thoroughly tested yet. It is currently using the same exact UI component as **[string](/docs/components/string)**. Please use it with caution.

:::

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/devUsage/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Smart Forms provides the following open-source TypeScript libraries:
2. **SDC Populate** ([@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](/smart-forms/docs/api/sdc-populate) for more information.
Currently, there are no written documentation available for this library. Please refer to the [API](/docs/api/sdc-populate) for more information.
2 changes: 1 addition & 1 deletion documentation/docs/devUsage/renderer-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ You would need to further define `fetchResourceCallback` and `PrePopButton` but
- `PrePopButton` is a button component similar to the BuildFormButton above, but it uses a callback to `handlePrepopulate()` defined in the wrapper component.

Again, this example is only for demo purposes. Your wrapper component props might be entirely different from the ones used here, or you might have your own custom pre-population logic.
If you are interested if using the `@aehrc/sdc-populate` library, you can refer to the [API](/smart-forms/docs/api/sdc-populate) for more details.
If you are interested if using the `@aehrc/sdc-populate` library, you can refer to the [API](/docs/api/sdc-populate) for more details.

Below is the output of the above modified code.

Expand Down
34 changes: 17 additions & 17 deletions documentation/docs/devUsage/renderer-utilities.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@ The renderer provides a set of utilities to build and interact with the form.

#### Functions

- [buildForm](/smart-forms/docs/devUsage/renderer-utilities#buildform)
- [destroyForm](/smart-forms/docs/devUsage/renderer-utilities#destroyform)
- [getResponse](/smart-forms/docs/devUsage/renderer-utilities#getresponse)
- [removeEmptyAnswersFromResponse](/smart-forms/docs/devUsage/renderer-utilities#removeemptyanswersfromresponse)
- [buildForm](/docs/devUsage/renderer-utilities#buildform)
- [destroyForm](/docs/devUsage/renderer-utilities#destroyform)
- [getResponse](/docs/devUsage/renderer-utilities#getresponse)
- [removeEmptyAnswersFromResponse](/docs/devUsage/renderer-utilities#removeemptyanswersfromresponse)

#### Components

- [BaseRenderer](/smart-forms/docs/devUsage/renderer-utilities#baserenderer)
- [SmartFormsRenderer](/smart-forms/docs/devUsage/renderer-utilities#smartformsrenderer) (to be deprecated)
- [RendererThemeProvider](/smart-forms/docs/devUsage/renderer-utilities#rendererthemeprovider)
- [BaseRenderer](/docs/devUsage/renderer-utilities#baserenderer)
- [SmartFormsRenderer](/docs/devUsage/renderer-utilities#smartformsrenderer) (to be deprecated)
- [RendererThemeProvider](/docs/devUsage/renderer-utilities#rendererthemeprovider)

#### Hooks

- [useBuildForm](/smart-forms/docs/devUsage/renderer-utilities#usebuildform)
- [useRendererQueryClient](/smart-forms/docs/devUsage/renderer-utilities#userendererqueryclient)
- [**QuestionnaireStore** state management hooks](/smart-forms/docs/devUsage/storehooks/questionnaire-store)
- [**QuestionnaireResponseStore** state management properties](/smart-forms/docs/devUsage/storehooks/questionnaire-response-store)
- [**SmartConfigStore state** management properties](/smart-forms/docs/devUsage/storehooks/smart-config-store)
- [**TerminologyServerStore** state management properties](/smart-forms/docs/devUsage/storehooks/terminology-server-store)
- [useBuildForm](/docs/devUsage/renderer-utilities#usebuildform)
- [useRendererQueryClient](/docs/devUsage/renderer-utilities#userendererqueryclient)
- [**QuestionnaireStore** state management hooks](/docs/devUsage/storehooks/questionnaire-store)
- [**QuestionnaireResponseStore** state management properties](/docs/devUsage/storehooks/questionnaire-response-store)
- [**SmartConfigStore state** management properties](/docs/devUsage/storehooks/smart-config-store)
- [**TerminologyServerStore** state management properties](/docs/devUsage/storehooks/terminology-server-store)

:::note

There are other utilities exposed by the renderer but are not intended for direct use, i.e internal UI components and controls which requires advanced setup.
These are used in the Smart Forms app for it's re-population mechanism.

If you are interested, refer to the [API Reference](/smart-forms/docs/api/smart-forms-renderer) section.
If you are interested, refer to the [API Reference](/docs/api/smart-forms-renderer) section.

:::

Expand Down Expand Up @@ -61,7 +61,7 @@ If no changes have been made to the form, the initial QuestionnaireResponse is r

Use this if you are planning to use a button click to get the QuestionnaireResponse.

If you want to get the latest QuestionnaireResponse every time the form is changed, use the [QuestionnaireResponseStore `updatableResponse`](/smart-forms/docs/devUsage/storehooks/questionnaire-response-store/updatable-response) hook.
If you want to get the latest QuestionnaireResponse every time the form is changed, use the [QuestionnaireResponseStore `updatableResponse`](/docs/devUsage/storehooks/questionnaire-response-store/updatable-response) hook.

### RemoveEmptyAnswersFromResponse

Expand All @@ -83,7 +83,7 @@ The `BaseRenderer` component is the main component that renders the form.

It renders the Questionnaire and QuestionnaireResponse defined in the QuestionnaireStore and QuestionnaireResponseStore state management stores respectively.

[`buildForm()`](/smart-forms/docs/devUsage/renderer-utilities#buildform) used be used in your wrapping component or in an event handler to initialise the form before React renders the `BaseRenderer`.
[`buildForm()`](/docs/devUsage/renderer-utilities#buildform) used be used in your wrapping component or in an event handler to initialise the form before React renders the `BaseRenderer`.

### SmartFormsRenderer

Expand Down Expand Up @@ -137,4 +137,4 @@ If you want to customise the renderer to use your own query client, refer to the

### State Management Hooks

Refer to the [Renderer Store Hooks](/smart-forms/docs/devUsage/storehooks) section for more information on the state management hooks provided by the renderer.
Refer to the [Renderer Store Hooks](/docs/devUsage/storehooks) section for more information on the state management hooks provided by the renderer.
2 changes: 1 addition & 1 deletion documentation/docs/devUsage/storehooks/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The renderer uses four state management stores, each for a different purpose:
- **SmartConfigStore**: Manages a FHIRClient instance for further FHIR calls if needed i.e. `answerExpression` extensions.
- **TerminologyServerStore**: Manages the terminology server url to fetch terminology resources.

The usage examples provided in this section uses the BMI Calculator as its input questionnaire, with the exception of [TerminologyServerStore](/smart-forms/docs/devUsage/storehooks/terminology-server-store).
The usage examples provided in this section uses the BMI Calculator as its input questionnaire, with the exception of [TerminologyServerStore](/docs/devUsage/storehooks/terminology-server-store).
As the BMI Calculator does not use all of the available properties, only properties relevant to the questionnaire are shown as examples.

You can use [Playground](https://smartforms.csiro.au/playground) to try them out in real-time.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function App() {

There are some live examples on the following pages that demonstrate how to use the hooks.

Refer to the [API Reference](/smart-forms/docs/api/smart-forms-renderer/interfaces/QuestionnaireResponseStoreType) for more information on each property.
Refer to the [API Reference](/docs/api/smart-forms-renderer/interfaces/QuestionnaireResponseStoreType) for more information on each property.

:::note

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_position: 6

The invalidItems object is a `Record<linkId, OperationOutcome>` of the items that has a specified value constraint that is not satisfied.

For all supported value constraints, refer to the [Value Constraints](/smart-forms/docs/sdc/advanced/constraint) section.
For all supported value constraints, refer to the [Value Constraints](/docs/sdc/advanced/constraint) section.

```tsx live
function App() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_position: 2

The sourceResponse is the first QuestionnaireResponse being passed into the renderer. If no response is passed in, an empty sourceResponse will be initialized by the renderer.

The sourceResponse does not change when the form gets edited - that is where the [`updatableResponse`](/smart-forms/docs/devUsage/storehooks/questionnaire-response-store/updatable-response) comes in.
The sourceResponse does not change when the form gets edited - that is where the [`updatableResponse`](/docs/devUsage/storehooks/questionnaire-response-store/updatable-response) comes in.

```tsx live
function App() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function App() {

There are some live examples on the following pages that demonstrate how to use the hooks.

Refer to the [API Reference](/smart-forms/docs/api/smart-forms-renderer/interfaces/QuestionnaireStoreType) for more information on each property.
Refer to the [API Reference](/docs/api/smart-forms-renderer/interfaces/QuestionnaireStoreType) for more information on each property.

:::note

Expand Down
4 changes: 2 additions & 2 deletions documentation/docs/devUsage/storehooks/smart-config-store.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ function App() {
}
```

Refer to the [API Reference](/smart-forms/docs/api/smart-forms-renderer/interfaces/SmartConfigStoreType) for more information on each property.
Refer to the [API Reference](/docs/api/smart-forms-renderer/interfaces/SmartConfigStoreType) for more information on each property.

:::warning

The SmartConfigStore doesn't actually do much within the renderer at the moment. It is not tested thoroughly and is retained for backward compatibility purposes.

Terminology endpoints are managed in [TerminologyServerStore](/smart-forms/docs/devUsage/storehooks/terminology-server-store).
Terminology endpoints are managed in [TerminologyServerStore](/docs/devUsage/storehooks/terminology-server-store).
If there is a need to expand on functionality of making FHIR calls within the renderer, feel free to [let us know](https://github.com/aehrc/smart-forms/issues/new).

From a best practice perspective, it is recommended to perform FHIR calls outside of the renderer and pass the pre-populated QuestionnaireResponse into the renderer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ function App() {

There are some live examples on the following pages that demonstrate how to use the hooks.

Refer to the [API Reference](/smart-forms/docs/api/smart-forms-renderer/interfaces/TerminologyServerStoreType) for more information on each property.
Refer to the [API Reference](/docs/api/smart-forms-renderer/interfaces/TerminologyServerStoreType) for more information on each property.
6 changes: 3 additions & 3 deletions documentation/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ It is intended to demonstrate the use of [HL7 FHIR](https://hl7.org/fhir/) speci
### Getting Started

This documentation is intended to provide a guide on how to use Smart Forms. It is divided into the following sections:
- [Components](/smart-forms/docs/components): A showcase of supported Questionnaire form components.
- [SDC](/smart-forms/docs/sdc): A section around the conformance and usage of functionalities defined in the SDC specification.
- [Developer Usage](/smart-forms/docs/devUsage): A guide on how to use the form renderer in your own application.
- [Components](/docs/components): A showcase of supported Questionnaire form components.
- [SDC](/docs/sdc): A section around the conformance and usage of functionalities defined in the SDC specification.
- [Developer Usage](/docs/devUsage): A guide on how to use the form renderer in your own application.

### Referenced FHIR Specifications

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/sdc/advanced/constraint.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ For more information, refer to developer usage.

An indication, if true, that the item must be present in a "completed" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire.

Also appears in the [Fundamental Elements](/smart-forms/docs/sdc/advanced/fundamental) subsection.
Also appears in the [Fundamental Elements](/docs/sdc/advanced/fundamental) subsection.

#### Basic Usage

Expand Down
8 changes: 4 additions & 4 deletions documentation/docs/sdc/advanced/display.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ It continues to hover above the field, even when the field is not empty.

**[Deprecation Note - Use the http://hl7.org/fhir/StructureDefinition/entryFormat extension instead](https://hl7.org/fhir/extensions/CodeSystem-questionnaire-item-control.html).**

**entryFormat** is available in the [Question Rendering](/smart-forms/docs/sdc/advanced/question#entryformat) section.
**entryFormat** is available in the [Question Rendering](/docs/sdc/advanced/question#entryformat) section.

:::

Expand All @@ -61,7 +61,7 @@ Displays a unit of measurement at the right end of the field. This is useful whe

**[Deprecation Note - The display element of the http://hl7.org/fhir/StructureDefinition/questionnaire-unit extension should be used instead](https://hl7.org/fhir/extensions/CodeSystem-questionnaire-item-control.html).**

**questionnaire-unit** is available in the [Question Rendering](/smart-forms/docs/sdc/advanced/question#entryformat) section.
**questionnaire-unit** is available in the [Question Rendering](/docs/sdc/advanced/question#entryformat) section.

:::

Expand All @@ -77,7 +77,7 @@ Displays a unit of measurement at the right end of the field. This is useful whe

### Lower-bound

Displays the lower-bound label of a [slider](/smart-forms/docs/sdc/advanced/question#slider) control question.
Displays the lower-bound label of a [slider](/docs/sdc/advanced/question#slider) control question.

The usage example below is same as the [upper-bound](#upper-bound) extension.

Expand All @@ -93,7 +93,7 @@ The usage example below is same as the [upper-bound](#upper-bound) extension.

### Upper-bound

Displays the upper-bound label of a [slider](/smart-forms/docs/sdc/advanced/question#slider) control question.
Displays the upper-bound label of a [slider](/docs/sdc/advanced/question#slider) control question.

The usage example below is same as the [lower-bound](#lower-bound) extension.

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/sdc/advanced/fundamental.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The elements/extensions that fall under this subsection are:

An indication, if true, that the item must be present in a "completed" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire.

Also appears in the [Value Constraints](/smart-forms/docs/sdc/advanced/constraint) subsection.
Also appears in the [Value Constraints](/docs/sdc/advanced/constraint) subsection.

#### Basic Usage

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/sdc/advanced/group.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Indicates that the group represents a collection of tabs.

This can be used to create a "tabbed" form, with clickable tabs on the left and the form sections on the right.

[Conditional rendering](/smart-forms/docs/sdc/conditional) can be used to show/hide tabs based on form answers or a pre-filled value i.e. a patient's age.
[Conditional rendering](/docs/sdc/conditional) can be used to show/hide tabs based on form answers or a pre-filled value i.e. a patient's age.

#### Basic Usage

Expand Down
Loading

0 comments on commit 7ea8db3

Please sign in to comment.