@aehrc/smart-forms-renderer 0.27.4 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.swcrc +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.d.ts +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js +12 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js +5 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionView.d.ts +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionView.js +3 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionView.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.d.ts +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js +12 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js +5 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js +4 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionView.d.ts +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionView.js +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionView.js.map +1 -1
- package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/DateTimeField.d.ts +2 -1
- package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/DateTimeField.js.map +1 -1
- package/lib/components/FormComponents/DecimalItem/DecimalItem.js +3 -1
- package/lib/components/FormComponents/DecimalItem/DecimalItem.js.map +1 -1
- package/lib/hooks/useValidationFeedback.js +1 -1
- package/lib/utils/validateQuestionnaire.js.map +1 -1
- package/package.json +6 -3
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.tsx +28 -1
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +6 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionView.tsx +5 -1
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx +20 -1
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +6 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +5 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionView.tsx +3 -1
- package/src/components/FormComponents/DateTimeItems/CustomDateTimeItem/DateTimeField.tsx +2 -1
- package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +15 -12
- package/src/hooks/useValidationFeedback.ts +1 -1
- package/src/stories/assets/questionnaires/QAdvancedAdditionalDisplayContent.ts +30 -0
- package/src/stories/assets/questionnaires/QAdvancedOther.ts +1 -2
- package/src/stories/assets/questionnaires/QAdvancedTextApperance.ts +28 -0
- package/src/stories/assets/questionnaires/QBehaviorValueConstraints.ts +1 -1
- package/src/stories/assets/questionnaires/QBoolean.ts +1 -1
- package/src/stories/assets/questionnaires/QChoice.ts +357 -1
- package/src/stories/assets/questionnaires/QDate.ts +1 -1
- package/src/stories/assets/questionnaires/QDateTime.ts +1 -1
- package/src/stories/assets/questionnaires/QDecimal.ts +1 -1
- package/src/stories/assets/questionnaires/QInteger.ts +1 -1
- package/src/stories/assets/questionnaires/QItemControlDisplay.ts +460 -17
- package/src/stories/assets/questionnaires/QItemControlGroup.ts +220 -6
- package/src/stories/assets/questionnaires/QOpenChoice.ts +1 -1
- package/src/stories/assets/questionnaires/QQuantity.ts +6 -0
- package/src/stories/assets/questionnaires/QString.ts +1 -1
- package/src/stories/assets/questionnaires/QText.ts +2 -2
- package/src/stories/itemTypes/Boolean.stories.tsx +0 -17
- package/src/stories/itemTypes/Choice.stories.tsx +15 -0
- package/src/stories/itemTypes/Url.stories.tsx +2 -2
- package/src/stories/sdc/AdvancedAdditionalDisplayContent.stories.tsx +7 -1
- package/src/stories/sdc/AdvancedTextAppearance.stories.tsx +7 -0
- package/src/stories/sdc/BehaviorChoiceRestriction.stories.tsx +1 -1
- package/src/stories/sdc/ItemControlDisplay.stories.tsx +31 -1
- package/src/stories/sdc/ItemControlGroup.stories.tsx +10 -3
- package/src/tests/enableWhen.test.ts +112 -0
- package/src/tests/test-data/enable-when-items-sample.json +3848 -0
- package/src/tests/test-data/initial-answers-sample.json +16 -0
- package/src/tests/test-data/linked-questions-map.json +217 -0
- package/src/tests/test-data/questionnaire-response-sample.json +650 -0
- package/src/utils/validateQuestionnaire.ts +18 -6
|
@@ -82,6 +82,10 @@ function ChoiceRadioAnswerValueSetItem(props: ChoiceRadioAnswerValueSetItemProps
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
function handleClear() {
|
|
86
|
+
onQrItemChange(createEmptyQrItem(qItem));
|
|
87
|
+
}
|
|
88
|
+
|
|
85
89
|
if (isRepeated) {
|
|
86
90
|
return (
|
|
87
91
|
<ChoiceRadioAnswerValueSetFields
|
|
@@ -93,6 +97,7 @@ function ChoiceRadioAnswerValueSetItem(props: ChoiceRadioAnswerValueSetItemProps
|
|
|
93
97
|
terminologyError={terminologyError}
|
|
94
98
|
isTabled={isTabled}
|
|
95
99
|
onCheckedChange={handleChange}
|
|
100
|
+
onClear={handleClear}
|
|
96
101
|
/>
|
|
97
102
|
);
|
|
98
103
|
}
|
|
@@ -112,6 +117,7 @@ function ChoiceRadioAnswerValueSetItem(props: ChoiceRadioAnswerValueSetItemProps
|
|
|
112
117
|
terminologyError={terminologyError}
|
|
113
118
|
isTabled={isTabled}
|
|
114
119
|
onCheckedChange={handleChange}
|
|
120
|
+
onClear={handleClear}
|
|
115
121
|
/>
|
|
116
122
|
</ItemFieldGrid>
|
|
117
123
|
</FullWidthFormComponentBox>
|
|
@@ -79,6 +79,10 @@ function ChoiceSelectAnswerOptionItem(props: ChoiceSelectAnswerOptionItemProps)
|
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
function handleClear() {
|
|
83
|
+
onQrItemChange(createEmptyQrItem(qItem));
|
|
84
|
+
}
|
|
85
|
+
|
|
82
86
|
return (
|
|
83
87
|
<ChoiceSelectAnswerOptionView
|
|
84
88
|
qItem={qItem}
|
|
@@ -90,6 +94,7 @@ function ChoiceSelectAnswerOptionItem(props: ChoiceSelectAnswerOptionItemProps)
|
|
|
90
94
|
isTabled={isTabled}
|
|
91
95
|
onFocusLinkId={() => onFocusLinkId(qItem.linkId)}
|
|
92
96
|
onSelectChange={handleChange}
|
|
97
|
+
onClear={handleClear}
|
|
93
98
|
/>
|
|
94
99
|
);
|
|
95
100
|
}
|
|
@@ -35,6 +35,7 @@ interface ChoiceSelectAnswerOptionViewProps
|
|
|
35
35
|
calcExpUpdated: boolean;
|
|
36
36
|
onSelectChange: (linkId: string) => void;
|
|
37
37
|
onFocusLinkId: () => void;
|
|
38
|
+
onClear: () => void;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
function ChoiceSelectAnswerOptionView(props: ChoiceSelectAnswerOptionViewProps) {
|
|
@@ -47,7 +48,8 @@ function ChoiceSelectAnswerOptionView(props: ChoiceSelectAnswerOptionViewProps)
|
|
|
47
48
|
readOnly,
|
|
48
49
|
calcExpUpdated,
|
|
49
50
|
onFocusLinkId,
|
|
50
|
-
onSelectChange
|
|
51
|
+
onSelectChange,
|
|
52
|
+
onClear
|
|
51
53
|
} = props;
|
|
52
54
|
|
|
53
55
|
if (isRepeated) {
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import
|
|
18
|
+
import type { Dispatch, SetStateAction } from 'react';
|
|
19
|
+
import React from 'react';
|
|
19
20
|
import type { PropsWithIsTabledAttribute } from '../../../../interfaces/renderProps.interface';
|
|
20
21
|
import CustomDateField from '../CustomDateItem/CustomDateField';
|
|
21
22
|
import CustomTimeField from './CustomTimeField';
|
|
@@ -40,6 +40,7 @@ import useDecimalCalculatedExpression from '../../../hooks/useDecimalCalculatedE
|
|
|
40
40
|
import useStringInput from '../../../hooks/useStringInput';
|
|
41
41
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
42
42
|
import { useQuestionnaireStore } from '../../../stores';
|
|
43
|
+
import Box from '@mui/material/Box';
|
|
43
44
|
|
|
44
45
|
interface DecimalItemProps
|
|
45
46
|
extends PropsWithQrItemChangeHandler,
|
|
@@ -127,18 +128,20 @@ function DecimalItem(props: DecimalItemProps) {
|
|
|
127
128
|
|
|
128
129
|
if (isRepeated) {
|
|
129
130
|
return (
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
131
|
+
<Box data-test="q-item-decimal-box">
|
|
132
|
+
<DecimalField
|
|
133
|
+
linkId={qItem.linkId}
|
|
134
|
+
input={input}
|
|
135
|
+
feedback={feedback}
|
|
136
|
+
displayPrompt={displayPrompt}
|
|
137
|
+
displayUnit={displayUnit}
|
|
138
|
+
entryFormat={entryFormat}
|
|
139
|
+
readOnly={readOnly}
|
|
140
|
+
calcExpUpdated={calcExpUpdated}
|
|
141
|
+
isTabled={isTabled}
|
|
142
|
+
onInputChange={handleInputChange}
|
|
143
|
+
/>
|
|
144
|
+
</Box>
|
|
142
145
|
);
|
|
143
146
|
}
|
|
144
147
|
|
|
@@ -70,7 +70,7 @@ function useValidationFeedback(qItem: QuestionnaireItem, input: string): string
|
|
|
70
70
|
return `Input is lower than the expected minimum value of ${minValue}.`;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
// Test
|
|
73
|
+
// Test max value
|
|
74
74
|
if (
|
|
75
75
|
invalidType === ValidationResult.maxValue &&
|
|
76
76
|
(typeof maxValue === 'string' || typeof maxValue === 'number')
|
|
@@ -81,3 +81,33 @@ export const qShortText: Questionnaire = {
|
|
|
81
81
|
}
|
|
82
82
|
]
|
|
83
83
|
};
|
|
84
|
+
|
|
85
|
+
export const qQuestionnaireUnit: Questionnaire = {
|
|
86
|
+
resourceType: 'Questionnaire',
|
|
87
|
+
id: 'QuestionnaireUnit',
|
|
88
|
+
name: 'QuestionnaireUnit',
|
|
89
|
+
title: 'Questionnaire Unit',
|
|
90
|
+
version: '0.1.0',
|
|
91
|
+
status: 'draft',
|
|
92
|
+
publisher: 'AEHRC CSIRO',
|
|
93
|
+
date: '2024-05-01',
|
|
94
|
+
url: 'https://smartforms.csiro.au/docs/advanced/additional-display/questionnaire-unit',
|
|
95
|
+
item: [
|
|
96
|
+
{
|
|
97
|
+
extension: [
|
|
98
|
+
{
|
|
99
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-unit',
|
|
100
|
+
valueCoding: {
|
|
101
|
+
system: 'http://unitsofmeasure.org',
|
|
102
|
+
code: 'cm',
|
|
103
|
+
display: 'cm'
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
linkId: 'height',
|
|
108
|
+
text: 'Height',
|
|
109
|
+
type: 'decimal',
|
|
110
|
+
repeats: false
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
};
|
|
@@ -21,7 +21,6 @@ export const qRequired: Questionnaire = {
|
|
|
21
21
|
]
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
// FIXME requires a parent container
|
|
25
24
|
export const qRepeatsAutocomplete: Questionnaire = {
|
|
26
25
|
resourceType: 'Questionnaire',
|
|
27
26
|
id: 'RepeatsAutocomplete',
|
|
@@ -35,7 +34,7 @@ export const qRepeatsAutocomplete: Questionnaire = {
|
|
|
35
34
|
item: [
|
|
36
35
|
{
|
|
37
36
|
linkId: 'parent-container',
|
|
38
|
-
text: '
|
|
37
|
+
text: '',
|
|
39
38
|
type: 'group',
|
|
40
39
|
repeats: false,
|
|
41
40
|
item: [
|
|
@@ -57,6 +57,34 @@ export const qRenderingXhtmlDisplayListItem: Questionnaire = {
|
|
|
57
57
|
]
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
+
export const qRenderingXhtmlDisplayBase64ImageItem: Questionnaire = {
|
|
61
|
+
resourceType: 'Questionnaire',
|
|
62
|
+
id: 'RenderingXhtml-3',
|
|
63
|
+
name: 'RenderingXhtml-3',
|
|
64
|
+
title: 'Rendering XHTML 3',
|
|
65
|
+
version: '0.1.0',
|
|
66
|
+
status: 'draft',
|
|
67
|
+
publisher: 'AEHRC CSIRO',
|
|
68
|
+
date: '2024-05-01',
|
|
69
|
+
url: 'https://smartforms.csiro.au/docs/advanced/text/rendering-xhtml-3',
|
|
70
|
+
item: [
|
|
71
|
+
{
|
|
72
|
+
linkId: 'CD-in-progress-1',
|
|
73
|
+
text: 'In progress',
|
|
74
|
+
_text: {
|
|
75
|
+
extension: [
|
|
76
|
+
{
|
|
77
|
+
url: 'http://hl7.org/fhir/StructureDefinition/rendering-xhtml',
|
|
78
|
+
valueString:
|
|
79
|
+
'<div title="Section completed" xmlns="http://www.w3.org/1999/xhtml">\r\n\t<div style="display: flex; flex-direction: row;">\r\n\t\t<img width=\'64\' height=\'64\' src=\'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxZW0iIGhlaWdodD0iMWVtIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGZpbGw9IiMyZTdkMzIiIGQ9Ik0yMCAxMmE4IDggMCAwIDEtOCA4YTggOCAwIDAgMS04LThhOCA4IDAgMCAxIDgtOGMuNzYgMCAxLjUuMTEgMi4yLjMxbDEuNTctMS41N0E5LjgyMiA5LjgyMiAwIDAgMCAxMiAyQTEwIDEwIDAgMCAwIDIgMTJhMTAgMTAgMCAwIDAgMTAgMTBhMTAgMTAgMCAwIDAgMTAtMTBNNy45MSAxMC4wOEw2LjUgMTEuNUwxMSAxNkwyMSA2bC0xLjQxLTEuNDJMMTEgMTMuMTdsLTMuMDktMy4wOVoiLz48L3N2Zz4=\'\r\n\t\tstyle="align-self: center;"/>\r\n\t</div>\r\n</div>'
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
type: 'display'
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
};
|
|
87
|
+
|
|
60
88
|
export const qDisplayCategoryInstructions: Questionnaire = {
|
|
61
89
|
resourceType: 'Questionnaire',
|
|
62
90
|
id: 'DisplayCategoryInstructions',
|
|
@@ -63,7 +63,7 @@ export const qBooleanCalculation: Questionnaire = {
|
|
|
63
63
|
status: 'draft',
|
|
64
64
|
publisher: 'AEHRC CSIRO',
|
|
65
65
|
date: '2024-05-01',
|
|
66
|
-
url: 'https://smartforms.csiro.au/docs/components/boolean',
|
|
66
|
+
url: 'https://smartforms.csiro.au/docs/components/boolean/calculation',
|
|
67
67
|
extension: [
|
|
68
68
|
{
|
|
69
69
|
url: 'http://hl7.org/fhir/StructureDefinition/variable',
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
|
|
18
|
+
import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
|
|
19
19
|
|
|
20
20
|
export const qChoiceAnswerOptionBasic: Questionnaire = {
|
|
21
21
|
resourceType: 'Questionnaire',
|
|
@@ -135,3 +135,359 @@ export const qrChoiceAnswerValueSetBasicResponse: QuestionnaireResponse = {
|
|
|
135
135
|
],
|
|
136
136
|
questionnaire: 'https://smartforms.csiro.au/docs/components/choice/answervalueset-basic'
|
|
137
137
|
};
|
|
138
|
+
|
|
139
|
+
export const qChoiceAnswerOptionCalculation: Questionnaire = {
|
|
140
|
+
resourceType: 'Questionnaire',
|
|
141
|
+
id: 'ChoiceAnswerOptionCalculation',
|
|
142
|
+
name: 'ChoiceAnswerOptionCalculation',
|
|
143
|
+
title: 'Choice AnswerOption Calculation',
|
|
144
|
+
version: '0.1.0',
|
|
145
|
+
status: 'draft',
|
|
146
|
+
publisher: 'AEHRC CSIRO',
|
|
147
|
+
date: '2024-05-01',
|
|
148
|
+
url: 'https://smartforms.csiro.au/docs/components/choice/answeroption-calculation',
|
|
149
|
+
extension: [
|
|
150
|
+
{
|
|
151
|
+
url: 'http://hl7.org/fhir/StructureDefinition/variable',
|
|
152
|
+
valueExpression: {
|
|
153
|
+
name: 'painLevel',
|
|
154
|
+
language: 'text/fhirpath',
|
|
155
|
+
expression: "item.where(linkId = 'pain-level').answer.value"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
item: [
|
|
160
|
+
{
|
|
161
|
+
extension: [
|
|
162
|
+
{
|
|
163
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
|
|
164
|
+
valueCodeableConcept: {
|
|
165
|
+
coding: [
|
|
166
|
+
{
|
|
167
|
+
system: 'http://hl7.org/fhir/questionnaire-item-control',
|
|
168
|
+
code: 'slider'
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-sliderStepValue',
|
|
175
|
+
valueInteger: 1
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
url: 'http://hl7.org/fhir/StructureDefinition/minValue',
|
|
179
|
+
valueInteger: 0
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
url: 'http://hl7.org/fhir/StructureDefinition/maxValue',
|
|
183
|
+
valueInteger: 10
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
linkId: 'pain-level',
|
|
187
|
+
text: 'Pain level',
|
|
188
|
+
type: 'integer',
|
|
189
|
+
repeats: false,
|
|
190
|
+
item: [
|
|
191
|
+
{
|
|
192
|
+
extension: [
|
|
193
|
+
{
|
|
194
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
|
|
195
|
+
valueCodeableConcept: {
|
|
196
|
+
coding: [
|
|
197
|
+
{
|
|
198
|
+
system: 'http://hl7.org/fhir/questionnaire-item-control',
|
|
199
|
+
code: 'lower'
|
|
200
|
+
}
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
linkId: 'pain-level-lower',
|
|
206
|
+
text: 'No pain',
|
|
207
|
+
type: 'display'
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
extension: [
|
|
211
|
+
{
|
|
212
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
|
|
213
|
+
valueCodeableConcept: {
|
|
214
|
+
coding: [
|
|
215
|
+
{
|
|
216
|
+
system: 'http://hl7.org/fhir/questionnaire-item-control',
|
|
217
|
+
code: 'upper'
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
],
|
|
223
|
+
linkId: 'pain-level-upper',
|
|
224
|
+
text: 'Unbearable pain',
|
|
225
|
+
type: 'display'
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
extension: [
|
|
231
|
+
{
|
|
232
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
|
|
233
|
+
valueCodeableConcept: {
|
|
234
|
+
coding: [
|
|
235
|
+
{
|
|
236
|
+
system: 'http://hl7.org/fhir/questionnaire-item-control',
|
|
237
|
+
code: 'radio-button'
|
|
238
|
+
}
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-choiceOrientation',
|
|
244
|
+
valueCode: 'horizontal'
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression',
|
|
248
|
+
valueExpression: {
|
|
249
|
+
language: 'text/fhirpath',
|
|
250
|
+
expression: "iif(%painLevel.empty(), '', iif(%painLevel < 5, 'Y', 'N'))"
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
],
|
|
254
|
+
linkId: 'pain-low',
|
|
255
|
+
text: 'Low pain (Level < 5)',
|
|
256
|
+
type: 'choice',
|
|
257
|
+
repeats: false,
|
|
258
|
+
readOnly: true,
|
|
259
|
+
answerOption: [
|
|
260
|
+
{
|
|
261
|
+
valueCoding: {
|
|
262
|
+
system: 'http://terminology.hl7.org/CodeSystem/v2-0532',
|
|
263
|
+
code: 'Y',
|
|
264
|
+
display: 'Yes'
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
valueCoding: {
|
|
269
|
+
system: 'http://terminology.hl7.org/CodeSystem/v2-0532',
|
|
270
|
+
code: 'N',
|
|
271
|
+
display: 'No'
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
]
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
export const qChoiceAnswerValueSetCalculation: Questionnaire = {
|
|
280
|
+
resourceType: 'Questionnaire',
|
|
281
|
+
id: 'ChoiceAnswerValueSetCalculation',
|
|
282
|
+
name: 'ChoiceAnswerValueSetCalculation',
|
|
283
|
+
title: 'Choice AnswerValueSet Calculation',
|
|
284
|
+
version: '0.1.0',
|
|
285
|
+
status: 'draft',
|
|
286
|
+
publisher: 'AEHRC CSIRO',
|
|
287
|
+
date: '2024-05-01',
|
|
288
|
+
url: 'https://smartforms.csiro.au/docs/components/choice/answervalueset-calculation',
|
|
289
|
+
contained: [
|
|
290
|
+
{
|
|
291
|
+
resourceType: 'ValueSet',
|
|
292
|
+
id: 'australian-states-territories-2',
|
|
293
|
+
meta: {
|
|
294
|
+
profile: [
|
|
295
|
+
'http://hl7.org/fhir/StructureDefinition/shareablevalueset',
|
|
296
|
+
'https://healthterminologies.gov.au/fhir/StructureDefinition/composed-value-set-4'
|
|
297
|
+
]
|
|
298
|
+
},
|
|
299
|
+
url: 'https://healthterminologies.gov.au/fhir/ValueSet/australian-states-territories-2',
|
|
300
|
+
identifier: [
|
|
301
|
+
{
|
|
302
|
+
system: 'urn:ietf:rfc:3986',
|
|
303
|
+
value: 'urn:oid:1.2.36.1.2001.1004.201.10026'
|
|
304
|
+
}
|
|
305
|
+
],
|
|
306
|
+
version: '2.0.2',
|
|
307
|
+
name: 'AustralianStatesAndTerritories',
|
|
308
|
+
title: 'Australian States and Territories',
|
|
309
|
+
status: 'active',
|
|
310
|
+
experimental: false,
|
|
311
|
+
date: '2020-05-31',
|
|
312
|
+
publisher: 'Australian Digital Health Agency',
|
|
313
|
+
contact: [
|
|
314
|
+
{
|
|
315
|
+
telecom: [
|
|
316
|
+
{
|
|
317
|
+
system: 'email',
|
|
318
|
+
value: 'help@digitalhealth.gov.au'
|
|
319
|
+
}
|
|
320
|
+
]
|
|
321
|
+
}
|
|
322
|
+
],
|
|
323
|
+
description:
|
|
324
|
+
'The Australian States and Territories value set includes values that represent the Australian states and territories.',
|
|
325
|
+
copyright:
|
|
326
|
+
'Copyright © 2018 Australian Digital Health Agency - All rights reserved. Except for the material identified below, this content is licensed under a Creative Commons Attribution 4.0 International License. See https://creativecommons.org/licenses/by/4.0/. \n\nThis resource includes material that is based on Australian Institute of Health and Welfare material. \n\nAll copies of this resource must include this copyright statement and all information contained in this statement.',
|
|
327
|
+
compose: {
|
|
328
|
+
include: [
|
|
329
|
+
{
|
|
330
|
+
system:
|
|
331
|
+
'https://healthterminologies.gov.au/fhir/CodeSystem/australian-states-territories-1',
|
|
332
|
+
concept: [
|
|
333
|
+
{
|
|
334
|
+
code: 'ACT'
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
code: 'NSW'
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
code: 'NT'
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
code: 'OTHER'
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
code: 'QLD'
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
code: 'SA'
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
code: 'TAS'
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
code: 'VIC'
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
code: 'WA'
|
|
359
|
+
}
|
|
360
|
+
]
|
|
361
|
+
}
|
|
362
|
+
]
|
|
363
|
+
},
|
|
364
|
+
expansion: {
|
|
365
|
+
identifier: 'e9439195-c1d8-4069-a349-98c1d552a351',
|
|
366
|
+
timestamp: '2023-06-20T04:20:58+00:00',
|
|
367
|
+
total: 9,
|
|
368
|
+
offset: 0,
|
|
369
|
+
parameter: [
|
|
370
|
+
{
|
|
371
|
+
name: 'version',
|
|
372
|
+
valueUri:
|
|
373
|
+
'https://healthterminologies.gov.au/fhir/CodeSystem/australian-states-territories-1|1.1.3'
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
name: 'count',
|
|
377
|
+
valueInteger: 2147483647
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
name: 'offset',
|
|
381
|
+
valueInteger: 0
|
|
382
|
+
}
|
|
383
|
+
],
|
|
384
|
+
contains: [
|
|
385
|
+
{
|
|
386
|
+
system:
|
|
387
|
+
'https://healthterminologies.gov.au/fhir/CodeSystem/australian-states-territories-1',
|
|
388
|
+
code: 'ACT',
|
|
389
|
+
display: 'Australian Capital Territory'
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
system:
|
|
393
|
+
'https://healthterminologies.gov.au/fhir/CodeSystem/australian-states-territories-1',
|
|
394
|
+
code: 'NSW',
|
|
395
|
+
display: 'New South Wales'
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
system:
|
|
399
|
+
'https://healthterminologies.gov.au/fhir/CodeSystem/australian-states-territories-1',
|
|
400
|
+
code: 'NT',
|
|
401
|
+
display: 'Northern Territory'
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
system:
|
|
405
|
+
'https://healthterminologies.gov.au/fhir/CodeSystem/australian-states-territories-1',
|
|
406
|
+
code: 'OTHER',
|
|
407
|
+
display: 'Other territories'
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
system:
|
|
411
|
+
'https://healthterminologies.gov.au/fhir/CodeSystem/australian-states-territories-1',
|
|
412
|
+
code: 'QLD',
|
|
413
|
+
display: 'Queensland'
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
system:
|
|
417
|
+
'https://healthterminologies.gov.au/fhir/CodeSystem/australian-states-territories-1',
|
|
418
|
+
code: 'SA',
|
|
419
|
+
display: 'South Australia'
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
system:
|
|
423
|
+
'https://healthterminologies.gov.au/fhir/CodeSystem/australian-states-territories-1',
|
|
424
|
+
code: 'TAS',
|
|
425
|
+
display: 'Tasmania'
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
system:
|
|
429
|
+
'https://healthterminologies.gov.au/fhir/CodeSystem/australian-states-territories-1',
|
|
430
|
+
code: 'VIC',
|
|
431
|
+
display: 'Victoria'
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
system:
|
|
435
|
+
'https://healthterminologies.gov.au/fhir/CodeSystem/australian-states-territories-1',
|
|
436
|
+
code: 'WA',
|
|
437
|
+
display: 'Western Australia'
|
|
438
|
+
}
|
|
439
|
+
]
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
],
|
|
443
|
+
extension: [
|
|
444
|
+
{
|
|
445
|
+
url: 'http://hl7.org/fhir/StructureDefinition/variable',
|
|
446
|
+
valueExpression: {
|
|
447
|
+
name: 'stateCode',
|
|
448
|
+
language: 'text/fhirpath',
|
|
449
|
+
expression: "item.where(linkId = 'state-controller').answer.value"
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
],
|
|
453
|
+
item: [
|
|
454
|
+
{
|
|
455
|
+
linkId: 'state-controller-instructions',
|
|
456
|
+
text: 'Feel free to play around with the following state codes: ACT, NSW, NT, OTHER, QLD, SA, TAS, VIC, WA',
|
|
457
|
+
_text: {
|
|
458
|
+
extension: [
|
|
459
|
+
{
|
|
460
|
+
url: 'http://hl7.org/fhir/StructureDefinition/rendering-xhtml',
|
|
461
|
+
valueString:
|
|
462
|
+
'<div xmlns="http://www.w3.org/1999/xhtml">\r\n <div style="font-size:0.875em">Feel free to play around with the following state codes:</div>\r\n <ul style="font-size:0.875em">\r\n <li>ACT</li>\r\n <li>NSW</li>\r\n <li>NT</li>\r\n <li>OTHER</li>\r\n <li>QLD</li>\r\n <li>SA</li>\r\n <li>TAS</li>\r\n <li>VIC</li>\r\n <li>WA</li>\r\n </ul>\r\n </div>'
|
|
463
|
+
}
|
|
464
|
+
]
|
|
465
|
+
},
|
|
466
|
+
type: 'display',
|
|
467
|
+
repeats: false
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
linkId: 'state-controller',
|
|
471
|
+
text: 'State (string)',
|
|
472
|
+
type: 'string',
|
|
473
|
+
repeats: false
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
extension: [
|
|
477
|
+
{
|
|
478
|
+
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression',
|
|
479
|
+
valueExpression: {
|
|
480
|
+
language: 'text/fhirpath',
|
|
481
|
+
expression: '%stateCode'
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
],
|
|
485
|
+
linkId: 'state-choice',
|
|
486
|
+
text: 'State (choice)',
|
|
487
|
+
type: 'choice',
|
|
488
|
+
repeats: false,
|
|
489
|
+
readOnly: true,
|
|
490
|
+
answerValueSet: '#australian-states-territories-2'
|
|
491
|
+
}
|
|
492
|
+
]
|
|
493
|
+
};
|