Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix quantity docs #969

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Conformance.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ View the source here: http://hl7.org/fhir/uv/sdc/behavior.html
- [ ] minOccurs
- [ ] maxOccurs
- [ ] optionExclusive
- [ ] unitOption
- [x] unitOption
- [ ] unitValueSet
- [ ] unitOpen
- [ ] unitSupplementalSystem
Expand Down
11 changes: 7 additions & 4 deletions documentation/docs/components/quantity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import IframeContainer from '../../src/react/IframeContainer';

There is an extension "http://hl7.org/fhir/StructureDefinition/questionnaire-unit" that can be used to define what unit should be captured (or the unit that has a ucum conversion from the provided unit).

You can use the [UnitOption](/docs/sdc/terminology#unitoption) extension to specify a list of options for the unit of a quantity item.

:::warning

This component is not thoroughly tested yet. Please use it with caution.
Expand All @@ -24,7 +26,7 @@ This component is not thoroughly tested yet. Please use it with caution.
<iframe
src="https://smartforms.csiro.au/storybook/iframe.html?args=&id=component-itemtype-quantity--quantity-basic"
width="100%"
height="100"
height="270"
/>
</IframeContainer>

Expand All @@ -34,7 +36,7 @@ This component is not thoroughly tested yet. Please use it with caution.
<iframe
src="https://smartforms.csiro.au/storybook/iframe.html?args=&id=component-itemtype-quantity--quantity-basic-response"
width="100%"
height="100"
height="270"
/>
</IframeContainer>

Expand All @@ -46,7 +48,7 @@ This component is not thoroughly tested yet. Please use it with caution.
<iframe
src="https://smartforms.csiro.au/storybook/iframe.html?args=&id=component-itemtype-quantity--quantity-unit-option-response"
width="100%"
height="100"
height="270"
/>
</IframeContainer>

Expand All @@ -56,7 +58,7 @@ This component is not thoroughly tested yet. Please use it with caution.
<iframe
src="https://smartforms.csiro.au/storybook/iframe.html?args=&id=component-itemtype-quantity--quantity-calculation"
width="100%"
height="100"
height="270"
/>
</IframeContainer>

Expand All @@ -83,3 +85,4 @@ This component is not thoroughly tested yet. Please use it with caution.
| enableWhen | item.enableWhen |
| enableBehavior | item.enableBehavior |
| text | item.text |
| unitOption | http://hl7.org/fhir/R4/extension-questionnaire-unitoption.html |
34 changes: 27 additions & 7 deletions documentation/docs/sdc/terminology.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,22 @@ The elements/extensions that fall under this category are:
- [answerValueSet](http://hl7.org/fhir/uv/sdc/behavior.html#answerValueSet)
- [answerExpression](http://hl7.org/fhir/uv/sdc/expressions.html#answerExpression)

There is also another extension that can be used to define the unit of a quantity item:

- [unitOption](https://hl7.org/fhir/uv/sdc/behavior.html#unitOption)

:::note

These three mechanisms are mutually exclusive. Only one should appear on the same item.
The three mechanisms (answerOption, answerValueSet and answerExpression) are mutually exclusive. Only one should appear on the same item.

:::
Not all components support terminology binding. Only the following components support terminology binding:

Not all components support terminology binding. The following components support Not all components support calculated expressions. The following components support calculated expressions::

| Components |
| ----------- |
| choice |
| open-choice |
| Components |
| ------------------------- |
| choice |
| open-choice |
| quantity (via unitOption) |

### AnswerOption

Expand Down Expand Up @@ -155,3 +159,19 @@ Support for this extension is not thoroughly tested yet.
height="500"
/>
</IframeContainer>

### UnitOption

UnitOption is used to specify a list of possible units to a [Quantity](/docs/components/quantity) question.

This can be used when the unit is not fixed, and allows the user to choose from a list of units.

#### Basic usage

<IframeContainer storyUrl="https://smartforms.csiro.au/storybook/index.html?path=/story/component-itemtype-quantity--quantity-unit-option-response">
<iframe
src="https://smartforms.csiro.au/storybook/iframe.html?args=&id=component-itemtype-quantity--quantity-unit-option-response"
width="100%"
height="270"
/>
</IframeContainer>
Loading