Skip to content

Conformance documentation mm #1335

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

Open
wants to merge 3 commits into
base: alpha
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions Conformance.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ The list can be found here: http://hl7.org/fhir/R4/valueset-item-type.html
- [x] time
- [x] string
- [x] text
- [ ] url (partial implementation - using string UI component currently)
- [x] url
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still don't have a "real" working URL - it's still a partial implementation using the string UI component

- [x] choice
- [x] open-choice
- [x] attachment
- [ ] reference (partial implementation - using string UI component currently)
- [ ] quantity (partial implementation - using decimal UI component currently)
- [x] quantity

### Using Expressions
View the source here: http://hl7.org/fhir/uv/sdc/expressions.html
Expand Down Expand Up @@ -123,8 +123,8 @@ View the source here: http://hl7.org/fhir/uv/sdc/behavior.html
- [x] regex
- [x] minValue
- [x] maxValue
- [ ] minQuantity
- [ ] maxQuantity
- [x] minQuantity
- [x] maxQuantity
- [x] maxDecimalPlaces
- [ ] mimeType
- [ ] maxSize
Expand Down
8 changes: 3 additions & 5 deletions documentation/docs/components/quantity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ There is an extension "http://hl7.org/fhir/StructureDefinition/questionnaire-uni

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.

:::
The Quantity component provides full support for quantity values with units, comparators, and validation constraints including minimum and maximum quantity limits.

### Basic usage

Expand Down Expand Up @@ -62,3 +58,5 @@ This component is not thoroughly tested yet. Please use it with caution.
| enableBehavior | item.enableBehavior |
| text | item.text |
| unitOption | http://hl7.org/fhir/R4/extension-questionnaire-unitoption.html |
| minQuantity | http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-minQuantity |
| maxQuantity | http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-maxQuantity |
10 changes: 3 additions & 7 deletions documentation/docs/components/url.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@ import IframeContainer from '../../src/react/IframeContainer';

[Question with a URL (website, FTP site, etc.) answer (valueUri)](https://hl7.org/fhir/r4/codesystem-item-type.html#item-type-url).

:::warning

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.

:::
The URL component provides full URL validation and input handling, ensuring that entered values conform to valid URL formats.

### Basic usage

#### Questionnaire-only
#### Questionnaire with validation examples

<IframeContainer storyId="itemtype-url--url-basic" initialHeight={120} />
<IframeContainer storyId="itemtype-url--url-basic" initialHeight={320} />

### SDC Supported extensions

Expand Down
28 changes: 28 additions & 0 deletions documentation/docs/sdc/advanced/constraint.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ The elements/extensions that fall under this subsection are:
- [minValue](http://hl7.org/fhir/uv/sdc/behavior.html#minValue)
- [maxValue](http://hl7.org/fhir/uv/sdc/behavior.html#maxValue)
- [maxDecimalPlaces](http://hl7.org/fhir/uv/sdc/behavior.html#maxDecimalPlaces)
- [minQuantity](http://hl7.org/fhir/uv/sdc/behavior.html#minQuantity)
- [maxQuantity](http://hl7.org/fhir/uv/sdc/behavior.html#maxQuantity)

:::tip
Elements/extensions in this subsection invokes form validation in the renderer. OperationOutcome resources are generated when the current state of the form does not meet the constraints defined in the Questionnaire.
Expand Down Expand Up @@ -114,3 +116,29 @@ MaxDecimalPlaces is only supported on **decimal** items.
storyId="sdc-9-1-1-form-behavior-value-constraints--max-decimal-places"
initialHeight={272}
/>

### MinQuantity

The minimum quantity value allowed for the answer to this question.

MinQuantity is only supported on **quantity** items and provides validation against the specified minimum quantity constraint.

#### Basic Usage

<IframeContainer
storyId="sdc-9-1-1-form-behavior-value-constraints--min-quantity"
initialHeight={272}
/>

### MaxQuantity

The maximum quantity value allowed for the answer to this question.

MaxQuantity is only supported on **quantity** items and provides validation against the specified maximum quantity constraint.

#### Basic Usage

<IframeContainer
storyId="sdc-9-1-1-form-behavior-value-constraints--max-quantity"
initialHeight={272}
/>
Original file line number Diff line number Diff line change
Expand Up @@ -506,3 +506,207 @@ export const qrMaxDecimalPlaces: QuestionnaireResponse = {
questionnaire:
'https://smartforms.csiro.au/docs/behavior/value-constraints/max-decimal-places|0.1.0'
};

// MinQuantity
export const qMinQuantity: Questionnaire = {
resourceType: 'Questionnaire',
id: 'MinQuantity',
name: 'MinQuantity',
title: 'Min Quantity',
version: '0.1.0',
status: 'draft',
publisher: 'AEHRC CSIRO',
date: '2024-05-01',
url: 'https://smartforms.csiro.au/docs/behavior/value-constraints/min-quantity',
item: [
{
extension: [
{
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-minQuantity',
valueQuantity: {
value: 50,
unit: 'kg',
system: 'http://unitsofmeasure.org',
code: 'kg'
}
}
],
linkId: 'weight-min-empty',
text: 'Weight (>=50kg) (empty)',
type: 'quantity',
repeats: false
},
{
extension: [
{
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-minQuantity',
valueQuantity: {
value: 50,
unit: 'kg',
system: 'http://unitsofmeasure.org',
code: 'kg'
}
}
],
linkId: 'weight-min-filled',
text: 'Weight (>=50kg) (filled)',
type: 'quantity',
repeats: false
},
{
extension: [
{
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-minQuantity',
valueQuantity: {
value: 50,
unit: 'kg',
system: 'http://unitsofmeasure.org',
code: 'kg'
}
}
],
linkId: 'weight-min-feedback',
text: 'Weight (>=50kg) (with feedback)',
type: 'quantity',
repeats: false
}
]
};

export const qrMinQuantity: QuestionnaireResponse = {
resourceType: 'QuestionnaireResponse',
status: 'in-progress',
item: [
{
linkId: 'weight-min-filled',
text: 'Weight (>=50kg) (filled)',
answer: [
{
valueQuantity: {
value: 75,
unit: 'kg',
system: 'http://unitsofmeasure.org',
code: 'kg'
}
}
]
},
{
linkId: 'weight-min-feedback',
text: 'Weight (>=50kg) (with feedback)',
answer: [
{
valueQuantity: {
value: 40,
unit: 'kg',
system: 'http://unitsofmeasure.org',
code: 'kg'
}
}
]
}
],
questionnaire: 'https://smartforms.csiro.au/docs/behavior/value-constraints/min-quantity|0.1.0'
};

// MaxQuantity
export const qMaxQuantity: Questionnaire = {
resourceType: 'Questionnaire',
id: 'MaxQuantity',
name: 'MaxQuantity',
title: 'Max Quantity',
version: '0.1.0',
status: 'draft',
publisher: 'AEHRC CSIRO',
date: '2024-05-01',
url: 'https://smartforms.csiro.au/docs/behavior/value-constraints/max-quantity',
item: [
{
extension: [
{
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-maxQuantity',
valueQuantity: {
value: 150,
unit: 'kg',
system: 'http://unitsofmeasure.org',
code: 'kg'
}
}
],
linkId: 'weight-max-empty',
text: 'Weight (<=150kg) (empty)',
type: 'quantity',
repeats: false
},
{
extension: [
{
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-maxQuantity',
valueQuantity: {
value: 150,
unit: 'kg',
system: 'http://unitsofmeasure.org',
code: 'kg'
}
}
],
linkId: 'weight-max-filled',
text: 'Weight (<=150kg) (filled)',
type: 'quantity',
repeats: false
},
{
extension: [
{
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-maxQuantity',
valueQuantity: {
value: 150,
unit: 'kg',
system: 'http://unitsofmeasure.org',
code: 'kg'
}
}
],
linkId: 'weight-max-feedback',
text: 'Weight (<=150kg) (with feedback)',
type: 'quantity',
repeats: false
}
]
};

export const qrMaxQuantity: QuestionnaireResponse = {
resourceType: 'QuestionnaireResponse',
status: 'in-progress',
item: [
{
linkId: 'weight-max-filled',
text: 'Weight (<=150kg) (filled)',
answer: [
{
valueQuantity: {
value: 120,
unit: 'kg',
system: 'http://unitsofmeasure.org',
code: 'kg'
}
}
]
},
{
linkId: 'weight-max-feedback',
text: 'Weight (<=150kg) (with feedback)',
answer: [
{
valueQuantity: {
value: 180,
unit: 'kg',
system: 'http://unitsofmeasure.org',
code: 'kg'
}
}
]
}
],
questionnaire: 'https://smartforms.csiro.au/docs/behavior/value-constraints/max-quantity|0.1.0'
};
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,74 @@ export const qBooleanCalculation: Questionnaire = {
}
]
};

export const qBooleanCombined: Questionnaire = {
resourceType: 'Questionnaire',
id: 'BooleanCombined',
name: 'BooleanCombined',
title: 'Boolean Combined Examples',
version: '0.1.0',
status: 'draft',
publisher: 'AEHRC CSIRO',
date: '2024-05-01',
url: 'https://smartforms.csiro.au/docs/components/boolean/combined',
item: [
{
linkId: 'boolean-empty',
type: 'boolean',
repeats: false,
text: 'Boolean (empty state)'
},
{
linkId: 'boolean-filled',
type: 'boolean',
repeats: false,
text: 'Boolean (filled state)'
},
{
extension: [
{
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
valueCodeableConcept: {
coding: [
{
system: 'http://hl7.org/fhir/questionnaire-item-control',
code: 'check-box'
}
]
}
}
],
linkId: 'boolean-checkbox',
type: 'boolean',
repeats: false,
text: 'Boolean (checkbox style)'
}
]
};

export const qrBooleanCombined: QuestionnaireResponse = {
resourceType: 'QuestionnaireResponse',
status: 'in-progress',
item: [
{
linkId: 'boolean-filled',
text: 'Boolean (filled state)',
answer: [
{
valueBoolean: true
}
]
},
{
linkId: 'boolean-checkbox',
text: 'Boolean (checkbox style)',
answer: [
{
valueBoolean: false
}
]
}
],
questionnaire: 'https://smartforms.csiro.au/docs/components/boolean/combined'
};
Loading
Loading