@aehrc/smart-forms-renderer 0.27.2 → 0.27.4
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/.storybook/main.ts +2 -1
- package/.storybook/preview.ts +6 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.d.ts +3 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.js +9 -17
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js +12 -9
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js +7 -9
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js +12 -8
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.d.ts +2 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js +3 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js +6 -4
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionView.d.ts +2 -1
- 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 +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js +5 -7
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js +4 -4
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.d.ts +2 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js +2 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js +5 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionView.d.ts +2 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionView.js +3 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionView.js.map +1 -1
- package/lib/components/FormComponents/DecimalItem/DecimalItem.js +1 -1
- package/lib/components/FormComponents/GroupItem/TabButtonsWrapper.js +20 -20
- package/lib/components/FormComponents/GroupItem/TabButtonsWrapper.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.d.ts +3 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.js +7 -19
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js +40 -40
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js +15 -3
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.d.ts +2 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js +3 -3
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js +27 -26
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/StringItem/StringField.js +1 -1
- package/lib/components/FormComponents/StringItem/StringField.js.map +1 -1
- package/lib/hooks/useInitialiseRenderer.js +1 -1
- package/lib/hooks/useInitialiseRenderer.js.map +1 -1
- package/lib/hooks/useNextAndPreviousVisibleTabs.d.ts +7 -0
- package/lib/hooks/useNextAndPreviousVisibleTabs.js +63 -0
- package/lib/hooks/useNextAndPreviousVisibleTabs.js.map +1 -0
- package/lib/hooks/useNextPreviousVisibleTabs.d.ts +6 -0
- package/lib/hooks/useNextPreviousVisibleTabs.js +63 -0
- package/lib/hooks/useNextPreviousVisibleTabs.js.map +1 -0
- package/lib/index.d.ts +0 -7
- package/lib/index.js +0 -24
- package/lib/index.js.map +1 -1
- package/lib/utils/choice.d.ts +1 -7
- package/lib/utils/choice.js +10 -20
- package/lib/utils/choice.js.map +1 -1
- package/lib/utils/enableWhen.js +5 -7
- package/lib/utils/enableWhen.js.map +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/openChoice.d.ts +9 -4
- package/lib/utils/openChoice.js +47 -78
- package/lib/utils/openChoice.js.map +1 -1
- package/lib/utils/tabs.d.ts +0 -21
- package/lib/utils/tabs.js +0 -51
- package/lib/utils/tabs.js.map +1 -1
- package/package.json +4 -4
- package/src/components/FormComponents/ChoiceItems/CheckboxOptionList.tsx +82 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.tsx +23 -52
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx +15 -9
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.tsx +17 -19
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +13 -8
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.tsx +5 -4
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +6 -2
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionView.tsx +5 -1
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx +9 -16
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +4 -4
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.tsx +4 -3
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +5 -2
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionView.tsx +5 -1
- package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +1 -1
- package/src/components/FormComponents/GroupItem/TabButtonsWrapper.tsx +28 -25
- package/src/components/FormComponents/ItemParts/{RadioAnswerOptionButtons.tsx → RadioOptionList.tsx} +7 -7
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.tsx +18 -50
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx +70 -68
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetFields.tsx +110 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.tsx +188 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.tsx +46 -19
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.tsx +5 -3
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx +37 -29
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetFields.tsx +104 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetItem.tsx +156 -0
- package/src/components/FormComponents/StringItem/StringField.tsx +1 -1
- package/src/hooks/useInitialiseRenderer.ts +1 -1
- package/src/hooks/useNextAndPreviousVisibleTabs.ts +86 -0
- package/src/hooks/useOpenLabel.ts +43 -0
- package/src/index.ts +0 -21
- package/src/stories/BuildFormWrapper.tsx +57 -0
- package/src/stories/assets/questionnaires/QAdvancedAdditionalDisplayContent.ts +83 -0
- package/src/stories/assets/questionnaires/QAdvancedControlAppearance.ts +294 -0
- package/src/stories/assets/questionnaires/QAdvancedOther.ts +495 -0
- package/src/stories/assets/questionnaires/QAdvancedTextApperance.ts +188 -0
- package/src/stories/assets/questionnaires/QAttachment.ts +38 -0
- package/src/stories/assets/questionnaires/QBehaviorCalculations.ts +645 -0
- package/src/stories/assets/questionnaires/QBehaviorChoiceRestriction.ts +281 -0
- package/src/stories/assets/questionnaires/QBehaviorOther.ts +1149 -0
- package/src/stories/assets/questionnaires/QBehaviorValueConstraints.ts +508 -0
- package/src/stories/assets/questionnaires/QBoolean.ts +130 -0
- package/src/stories/assets/questionnaires/QChoice.ts +137 -0
- package/src/stories/assets/questionnaires/QDate.ts +56 -0
- package/src/stories/assets/questionnaires/QDateTime.ts +56 -0
- package/src/stories/assets/questionnaires/QDecimal.ts +56 -0
- package/src/stories/assets/questionnaires/QDisplay.ts +38 -0
- package/src/stories/assets/questionnaires/QGroup.ts +52 -0
- package/src/stories/assets/questionnaires/QInteger.ts +119 -0
- package/src/stories/assets/questionnaires/QItemControlDisplay.ts +114 -0
- package/src/stories/assets/questionnaires/QItemControlGroup.ts +419 -0
- package/src/stories/assets/questionnaires/QItemControlQuestion.ts +1271 -0
- package/src/stories/assets/questionnaires/QOpenChoice.ts +151 -0
- package/src/stories/assets/questionnaires/QQuantity.ts +38 -0
- package/src/stories/assets/questionnaires/QReference.ts +38 -0
- package/src/stories/assets/questionnaires/QSingleItems.ts +251 -0
- package/src/stories/assets/questionnaires/QString.ts +131 -0
- package/src/stories/assets/questionnaires/QText.ts +169 -0
- package/src/stories/assets/questionnaires/QTime.ts +38 -0
- package/src/stories/assets/questionnaires/QUrl.ts +38 -0
- package/src/stories/assets/questionnaires/index.ts +44 -0
- package/src/stories/itemTypes/Attachment.stories.tsx +39 -0
- package/src/stories/itemTypes/Boolean.stories.tsx +72 -0
- package/src/stories/{MedicalHistoryTable.stories.tsx → itemTypes/Choice.stories.tsx} +32 -26
- package/src/stories/itemTypes/Date.stories.tsx +46 -0
- package/src/stories/itemTypes/DateTime.stories.tsx +45 -0
- package/src/stories/itemTypes/Decimal.stories.tsx +56 -0
- package/src/stories/itemTypes/Display.stories.tsx +39 -0
- package/src/stories/itemTypes/Group.stories.tsx +39 -0
- package/src/stories/itemTypes/Integer.stories.tsx +55 -0
- package/src/stories/itemTypes/OpenChoice.stories.tsx +64 -0
- package/src/stories/itemTypes/Quantity.stories.tsx +39 -0
- package/src/stories/itemTypes/Reference.stories.tsx +39 -0
- package/src/stories/itemTypes/String.stories.tsx +51 -0
- package/src/stories/itemTypes/Text.stories.tsx +51 -0
- package/src/stories/itemTypes/Time.stories.tsx +39 -0
- package/src/stories/itemTypes/Url.stories.tsx +39 -0
- package/src/stories/sdc/AdvancedAdditionalDisplayContent.stories.tsx +45 -0
- package/src/stories/sdc/AdvancedControlAppearance.stories.tsx +51 -0
- package/src/stories/sdc/AdvancedOther.stories.tsx +76 -0
- package/src/stories/sdc/AdvancedTextAppearance.stories.tsx +69 -0
- package/src/stories/sdc/BehaviorCalculations.stories.tsx +69 -0
- package/src/stories/sdc/BehaviorChoiceRestriction.stories.tsx +76 -0
- package/src/stories/sdc/BehaviorOther.stories.tsx +90 -0
- package/src/stories/sdc/BehaviorValueConstraints.stories.tsx +88 -0
- package/src/stories/sdc/ItemControlDisplay.stories.tsx +39 -0
- package/src/stories/sdc/ItemControlGroup.stories.tsx +55 -0
- package/src/stories/sdc/ItemControlQuestion.stories.tsx +118 -0
- package/src/utils/buildForm.ts +23 -0
- package/src/utils/choice.ts +16 -23
- package/src/utils/enableWhen.ts +5 -7
- package/src/utils/index.ts +1 -0
- package/src/utils/openChoice.ts +83 -98
- package/src/utils/tabs.ts +0 -75
- package/vite.config.ts +23 -0
- package/doctor-storybook.log +0 -18
- package/src/stories/SmartFormsRenderer.stories.ts +0 -139
- package/src/stories/assets/QItems-and-QRItems/QR_GTableMedicalHistory.json +0 -80
- package/src/stories/assets/QItems-and-QRItems/Q_GTableMedicalHistory.json +0 -109
- package/src/stories/assets/Qs-and-QRs/Q715.json +0 -15086
- package/src/stories/assets/Qs-and-QRs/QDev715.json +0 -16081
- package/src/stories/assets/Qs-and-QRs/QTestGrid.json +0 -411
- package/src/stories/assets/Qs-and-QRs/R715.json +0 -311
- package/src/stories/assets/Qs-and-QRs/RTestGrid.json +0 -34
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
|
|
19
|
+
|
|
20
|
+
export const qOpenChoiceAnswerOptionBasic: Questionnaire = {
|
|
21
|
+
resourceType: 'Questionnaire',
|
|
22
|
+
id: 'OpenChoiceAnswerOptionBasic',
|
|
23
|
+
name: 'OpenChoiceAnswerOptionBasic',
|
|
24
|
+
title: 'Open Choice AnswerOption Basic',
|
|
25
|
+
version: '0.1.0',
|
|
26
|
+
status: 'draft',
|
|
27
|
+
publisher: 'AEHRC CSIRO',
|
|
28
|
+
date: '2024-05-01',
|
|
29
|
+
url: 'https://smartforms.csiro.au/docs/components/open-choice/answeroption-basic',
|
|
30
|
+
item: [
|
|
31
|
+
{
|
|
32
|
+
extension: [
|
|
33
|
+
{
|
|
34
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
|
|
35
|
+
valueCodeableConcept: {
|
|
36
|
+
coding: [
|
|
37
|
+
{
|
|
38
|
+
system: 'http://hl7.org/fhir/questionnaire-item-control',
|
|
39
|
+
code: 'radio-button'
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-openLabel',
|
|
46
|
+
valueString: 'Other, please specify'
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
linkId: 'health-check-location',
|
|
50
|
+
text: 'Location of health check',
|
|
51
|
+
type: 'open-choice',
|
|
52
|
+
repeats: false,
|
|
53
|
+
answerOption: [
|
|
54
|
+
{
|
|
55
|
+
valueCoding: {
|
|
56
|
+
system: 'http://snomed.info/sct',
|
|
57
|
+
code: '257585005',
|
|
58
|
+
display: 'Clinic'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
valueCoding: {
|
|
63
|
+
system: 'http://snomed.info/sct',
|
|
64
|
+
code: '264362003',
|
|
65
|
+
display: 'Home'
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
valueCoding: {
|
|
70
|
+
system: 'http://snomed.info/sct',
|
|
71
|
+
code: '257698009',
|
|
72
|
+
display: 'School'
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const qrOpenChoiceAnswerOptionBasicResponse: QuestionnaireResponse = {
|
|
81
|
+
resourceType: 'QuestionnaireResponse',
|
|
82
|
+
status: 'in-progress',
|
|
83
|
+
item: [
|
|
84
|
+
{
|
|
85
|
+
linkId: 'health-check-location',
|
|
86
|
+
text: 'Location of health check',
|
|
87
|
+
answer: [
|
|
88
|
+
{
|
|
89
|
+
valueString: 'Pharmacy'
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
questionnaire: 'https://smartforms.csiro.au/docs/components/open-choice/answeroption-basic'
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const qOpenChoiceAnswerValueSetBasic: Questionnaire = {
|
|
98
|
+
resourceType: 'Questionnaire',
|
|
99
|
+
id: 'OpenChoiceAnswerValueSetBasic',
|
|
100
|
+
name: 'OpenChoiceAnswerValueSetBasic',
|
|
101
|
+
title: 'Open Choice AnswerValueSet Basic',
|
|
102
|
+
version: '0.1.0',
|
|
103
|
+
status: 'draft',
|
|
104
|
+
publisher: 'AEHRC CSIRO',
|
|
105
|
+
date: '2024-05-01',
|
|
106
|
+
url: 'https://smartforms.csiro.au/docs/components/display/open-choice/answervalueset-basic',
|
|
107
|
+
item: [
|
|
108
|
+
{
|
|
109
|
+
extension: [
|
|
110
|
+
{
|
|
111
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
|
|
112
|
+
valueCodeableConcept: {
|
|
113
|
+
coding: [
|
|
114
|
+
{
|
|
115
|
+
system: 'http://hl7.org/fhir/questionnaire-item-control',
|
|
116
|
+
code: 'radio-button'
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-openLabel',
|
|
123
|
+
valueString: 'Overseas state, please specify'
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
linkId: 'state',
|
|
127
|
+
text: 'State',
|
|
128
|
+
type: 'open-choice',
|
|
129
|
+
repeats: false,
|
|
130
|
+
answerValueSet:
|
|
131
|
+
'https://healthterminologies.gov.au/fhir/ValueSet/australian-states-territories-2'
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const qrOpenChoiceAnswerValueSetBasicResponse: QuestionnaireResponse = {
|
|
137
|
+
resourceType: 'QuestionnaireResponse',
|
|
138
|
+
status: 'in-progress',
|
|
139
|
+
item: [
|
|
140
|
+
{
|
|
141
|
+
linkId: 'state',
|
|
142
|
+
text: 'State',
|
|
143
|
+
answer: [
|
|
144
|
+
{
|
|
145
|
+
valueString: 'Branbendurg'
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
questionnaire: 'https://smartforms.csiro.au/docs/components/open-choice/answervalueset-basic'
|
|
151
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import type { Questionnaire } from 'fhir/r4';
|
|
19
|
+
|
|
20
|
+
export const qQuantityBasic: Questionnaire = {
|
|
21
|
+
resourceType: 'Questionnaire',
|
|
22
|
+
id: 'QuantityBasic',
|
|
23
|
+
name: 'QuantityBasic',
|
|
24
|
+
title: 'Quantity Basic',
|
|
25
|
+
version: '0.1.0',
|
|
26
|
+
status: 'draft',
|
|
27
|
+
publisher: 'AEHRC CSIRO',
|
|
28
|
+
date: '2024-05-01',
|
|
29
|
+
url: 'https://smartforms.csiro.au/docs/components/quantity/basic',
|
|
30
|
+
item: [
|
|
31
|
+
{
|
|
32
|
+
linkId: 'body-weight',
|
|
33
|
+
type: 'quantity',
|
|
34
|
+
repeats: false,
|
|
35
|
+
text: 'Body Weight'
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import type { Questionnaire } from 'fhir/r4';
|
|
19
|
+
|
|
20
|
+
export const qReferenceBasic: Questionnaire = {
|
|
21
|
+
resourceType: 'Questionnaire',
|
|
22
|
+
id: 'ReferenceBasic',
|
|
23
|
+
name: 'ReferenceBasic',
|
|
24
|
+
title: 'Reference Basic',
|
|
25
|
+
version: '0.1.0',
|
|
26
|
+
status: 'draft',
|
|
27
|
+
publisher: 'AEHRC CSIRO',
|
|
28
|
+
date: '2024-05-01',
|
|
29
|
+
url: 'https://smartforms.csiro.au/docs/components/reference/basic',
|
|
30
|
+
item: [
|
|
31
|
+
{
|
|
32
|
+
linkId: 'patient-reference',
|
|
33
|
+
type: 'reference',
|
|
34
|
+
repeats: false,
|
|
35
|
+
text: 'Patient Reference'
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
};
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import type { Questionnaire } from 'fhir/r4';
|
|
2
|
+
|
|
3
|
+
export const qBooleanItem: Questionnaire = {
|
|
4
|
+
resourceType: 'Questionnaire',
|
|
5
|
+
id: 'BooleanBasic',
|
|
6
|
+
name: 'BooleanBasic',
|
|
7
|
+
title: 'Boolean Basic',
|
|
8
|
+
version: '0.1.0',
|
|
9
|
+
status: 'draft',
|
|
10
|
+
publisher: 'AEHRC CSIRO',
|
|
11
|
+
date: '2024-05-01',
|
|
12
|
+
url: 'https://smartforms.csiro.au/docs/components/boolean',
|
|
13
|
+
item: [
|
|
14
|
+
{
|
|
15
|
+
linkId: 'eaten-boolean',
|
|
16
|
+
type: 'boolean',
|
|
17
|
+
repeats: false,
|
|
18
|
+
text: 'Have you eaten yet?'
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const qDecimalItem: Questionnaire = {
|
|
24
|
+
resourceType: 'Questionnaire',
|
|
25
|
+
id: 'DecimalBasic',
|
|
26
|
+
name: 'DecimalBasic',
|
|
27
|
+
title: 'Decimal Basic',
|
|
28
|
+
version: '0.1.0',
|
|
29
|
+
status: 'draft',
|
|
30
|
+
publisher: 'AEHRC CSIRO',
|
|
31
|
+
date: '2024-05-01',
|
|
32
|
+
url: 'https://smartforms.csiro.au/docs/components/decimal',
|
|
33
|
+
item: [
|
|
34
|
+
{
|
|
35
|
+
linkId: 'weight-decimal',
|
|
36
|
+
type: 'decimal',
|
|
37
|
+
repeats: false,
|
|
38
|
+
text: 'Weight in kg'
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const qIntegerItem: Questionnaire = {
|
|
44
|
+
resourceType: 'Questionnaire',
|
|
45
|
+
id: 'IntegerBasic',
|
|
46
|
+
name: 'IntegerBasic',
|
|
47
|
+
title: 'Integer Basic',
|
|
48
|
+
version: '0.1.0',
|
|
49
|
+
status: 'draft',
|
|
50
|
+
publisher: 'AEHRC CSIRO',
|
|
51
|
+
date: '2024-05-01',
|
|
52
|
+
url: 'https://smartforms.csiro.au/docs/components/integer',
|
|
53
|
+
item: [
|
|
54
|
+
{
|
|
55
|
+
linkId: 'age',
|
|
56
|
+
type: 'integer',
|
|
57
|
+
repeats: false,
|
|
58
|
+
text: 'Age'
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const qDateItem: Questionnaire = {
|
|
64
|
+
resourceType: 'Questionnaire',
|
|
65
|
+
id: 'DateBasic',
|
|
66
|
+
name: 'DateBasic',
|
|
67
|
+
title: 'Date Basic',
|
|
68
|
+
version: '0.1.0',
|
|
69
|
+
status: 'draft',
|
|
70
|
+
publisher: 'AEHRC CSIRO',
|
|
71
|
+
date: '2024-05-01',
|
|
72
|
+
url: 'https://smartforms.csiro.au/docs/components/date',
|
|
73
|
+
item: [
|
|
74
|
+
{
|
|
75
|
+
linkId: 'dob-date',
|
|
76
|
+
type: 'date',
|
|
77
|
+
repeats: false,
|
|
78
|
+
text: 'Date of birth'
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const qDateTimeItem: Questionnaire = {
|
|
84
|
+
resourceType: 'Questionnaire',
|
|
85
|
+
id: 'DateTimeBasic',
|
|
86
|
+
name: 'DateTimeBasic',
|
|
87
|
+
title: 'DateTime Basic',
|
|
88
|
+
version: '0.1.0',
|
|
89
|
+
status: 'draft',
|
|
90
|
+
publisher: 'AEHRC CSIRO',
|
|
91
|
+
date: '2024-05-01',
|
|
92
|
+
url: 'https://smartforms.csiro.au/docs/components/datetime',
|
|
93
|
+
item: [
|
|
94
|
+
{
|
|
95
|
+
linkId: 'dob-datetime',
|
|
96
|
+
type: 'dateTime',
|
|
97
|
+
repeats: false,
|
|
98
|
+
text: 'Datetime of birth'
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const qTimeItem: Questionnaire = {
|
|
104
|
+
resourceType: 'Questionnaire',
|
|
105
|
+
id: 'TimeBasic',
|
|
106
|
+
name: 'TimeBasic',
|
|
107
|
+
title: 'Time Basic',
|
|
108
|
+
version: '0.1.0',
|
|
109
|
+
status: 'draft',
|
|
110
|
+
publisher: 'AEHRC CSIRO',
|
|
111
|
+
date: '2024-05-01',
|
|
112
|
+
url: 'https://smartforms.csiro.au/docs/components/time',
|
|
113
|
+
item: [
|
|
114
|
+
{
|
|
115
|
+
linkId: 'last-meal-time',
|
|
116
|
+
type: 'time',
|
|
117
|
+
repeats: false,
|
|
118
|
+
text: 'Time of last meal'
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export const QSingleItems: Questionnaire = {
|
|
124
|
+
resourceType: 'Questionnaire',
|
|
125
|
+
id: 'StringBasic',
|
|
126
|
+
name: 'StringBasic',
|
|
127
|
+
title: 'String Basic',
|
|
128
|
+
version: '0.1.0',
|
|
129
|
+
status: 'draft',
|
|
130
|
+
publisher: 'AEHRC CSIRO',
|
|
131
|
+
date: '2024-05-01',
|
|
132
|
+
url: 'https://smartforms.csiro.au/docs/components/string',
|
|
133
|
+
item: [
|
|
134
|
+
{
|
|
135
|
+
linkId: 'container',
|
|
136
|
+
type: 'group',
|
|
137
|
+
repeats: false,
|
|
138
|
+
item: [
|
|
139
|
+
{
|
|
140
|
+
linkId: 'name-string',
|
|
141
|
+
type: 'string',
|
|
142
|
+
repeats: false,
|
|
143
|
+
text: 'Name'
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export const qTextItem: Questionnaire = {
|
|
151
|
+
resourceType: 'Questionnaire',
|
|
152
|
+
id: 'TextBasic',
|
|
153
|
+
name: 'TextBasic',
|
|
154
|
+
title: 'Text Basic',
|
|
155
|
+
version: '0.1.0',
|
|
156
|
+
status: 'draft',
|
|
157
|
+
publisher: 'AEHRC CSIRO',
|
|
158
|
+
date: '2024-05-01',
|
|
159
|
+
url: 'https://smartforms.csiro.au/docs/components/text',
|
|
160
|
+
item: [
|
|
161
|
+
{
|
|
162
|
+
linkId: 'details-text',
|
|
163
|
+
type: 'text',
|
|
164
|
+
repeats: false,
|
|
165
|
+
text: 'Details of intermittent fasting'
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export const qUrlItem: Questionnaire = {
|
|
171
|
+
resourceType: 'Questionnaire',
|
|
172
|
+
id: 'UrlBasic',
|
|
173
|
+
name: 'UrlBasic',
|
|
174
|
+
title: 'URL Basic',
|
|
175
|
+
version: '0.1.0',
|
|
176
|
+
status: 'draft',
|
|
177
|
+
publisher: 'AEHRC CSIRO',
|
|
178
|
+
date: '2024-05-01',
|
|
179
|
+
url: 'https://smartforms.csiro.au/docs/components/url',
|
|
180
|
+
item: [
|
|
181
|
+
{
|
|
182
|
+
linkId: 'website-url',
|
|
183
|
+
type: 'url',
|
|
184
|
+
repeats: false,
|
|
185
|
+
text: 'Website URL'
|
|
186
|
+
}
|
|
187
|
+
]
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
export const qAttachmentItem: Questionnaire = {
|
|
191
|
+
resourceType: 'Questionnaire',
|
|
192
|
+
id: 'AttachmentBasic',
|
|
193
|
+
name: 'AttachmentBasic',
|
|
194
|
+
title: 'Attachment Basic',
|
|
195
|
+
version: '0.1.0',
|
|
196
|
+
status: 'draft',
|
|
197
|
+
publisher: 'AEHRC CSIRO',
|
|
198
|
+
date: '2024-05-01',
|
|
199
|
+
url: 'https://smartforms.csiro.au/docs/components/attachment',
|
|
200
|
+
item: [
|
|
201
|
+
{
|
|
202
|
+
linkId: 'file-attachment',
|
|
203
|
+
type: 'attachment',
|
|
204
|
+
repeats: false,
|
|
205
|
+
text: 'File Attachment'
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
export const qReferenceItem: Questionnaire = {
|
|
211
|
+
resourceType: 'Questionnaire',
|
|
212
|
+
id: 'ReferenceBasic',
|
|
213
|
+
name: 'ReferenceBasic',
|
|
214
|
+
title: 'Reference Basic',
|
|
215
|
+
version: '0.1.0',
|
|
216
|
+
status: 'draft',
|
|
217
|
+
publisher: 'AEHRC CSIRO',
|
|
218
|
+
date: '2024-05-01',
|
|
219
|
+
url: 'https://smartforms.csiro.au/docs/components/reference',
|
|
220
|
+
item: [
|
|
221
|
+
{
|
|
222
|
+
linkId: 'patient-reference',
|
|
223
|
+
type: 'reference',
|
|
224
|
+
repeats: false,
|
|
225
|
+
text: 'Patient Reference'
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export const qQuantityItem: Questionnaire = {
|
|
231
|
+
resourceType: 'Questionnaire',
|
|
232
|
+
id: 'QuantityBasic',
|
|
233
|
+
name: 'QuantityBasic',
|
|
234
|
+
title: 'Quantity Basic',
|
|
235
|
+
version: '0.1.0',
|
|
236
|
+
status: 'draft',
|
|
237
|
+
publisher: 'AEHRC CSIRO',
|
|
238
|
+
date: '2024-05-01',
|
|
239
|
+
url: 'https://smartforms.csiro.au/docs/components/quantity',
|
|
240
|
+
item: [
|
|
241
|
+
{
|
|
242
|
+
linkId: 'body-weight',
|
|
243
|
+
type: 'quantity',
|
|
244
|
+
repeats: false,
|
|
245
|
+
text: 'Body Weight'
|
|
246
|
+
}
|
|
247
|
+
]
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
// choice
|
|
251
|
+
// open-choice
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import type { Questionnaire } from 'fhir/r4';
|
|
19
|
+
import { QuestionnaireResponse } from 'fhir/r4';
|
|
20
|
+
|
|
21
|
+
export const qStringBasic: Questionnaire = {
|
|
22
|
+
resourceType: 'Questionnaire',
|
|
23
|
+
id: 'StringBasic',
|
|
24
|
+
name: 'StringBasic',
|
|
25
|
+
title: 'String Basic',
|
|
26
|
+
version: '0.1.0',
|
|
27
|
+
status: 'draft',
|
|
28
|
+
publisher: 'AEHRC CSIRO',
|
|
29
|
+
date: '2024-05-01',
|
|
30
|
+
url: 'https://smartforms.csiro.au/docs/components/string/basic',
|
|
31
|
+
item: [
|
|
32
|
+
{
|
|
33
|
+
linkId: 'name',
|
|
34
|
+
type: 'string',
|
|
35
|
+
repeats: false,
|
|
36
|
+
text: 'Name'
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const qrStringBasicResponse: QuestionnaireResponse = {
|
|
42
|
+
resourceType: 'QuestionnaireResponse',
|
|
43
|
+
status: 'in-progress',
|
|
44
|
+
item: [
|
|
45
|
+
{
|
|
46
|
+
linkId: 'name',
|
|
47
|
+
text: 'Name',
|
|
48
|
+
answer: [
|
|
49
|
+
{
|
|
50
|
+
valueString: 'John Doe'
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
questionnaire: 'https://smartforms.csiro.au/docs/components/string/basic'
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const qStringCalculation: Questionnaire = {
|
|
59
|
+
resourceType: 'Questionnaire',
|
|
60
|
+
id: 'StringCalculation',
|
|
61
|
+
name: 'StringCalculation',
|
|
62
|
+
title: 'String Calculation',
|
|
63
|
+
version: '0.1.0',
|
|
64
|
+
status: 'draft',
|
|
65
|
+
publisher: 'AEHRC CSIRO',
|
|
66
|
+
date: '2024-05-01',
|
|
67
|
+
url: 'https://smartforms.csiro.au/docs/components/string/calculation',
|
|
68
|
+
extension: [
|
|
69
|
+
{
|
|
70
|
+
url: 'http://hl7.org/fhir/StructureDefinition/variable',
|
|
71
|
+
valueExpression: {
|
|
72
|
+
name: 'gender',
|
|
73
|
+
language: 'text/fhirpath',
|
|
74
|
+
expression: "item.where(linkId = 'gender-controller').answer.valueCoding.code"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
item: [
|
|
79
|
+
{
|
|
80
|
+
linkId: 'gender-controller',
|
|
81
|
+
text: 'Gender',
|
|
82
|
+
type: 'choice',
|
|
83
|
+
repeats: false,
|
|
84
|
+
answerOption: [
|
|
85
|
+
{
|
|
86
|
+
valueCoding: {
|
|
87
|
+
system: 'http://hl7.org/fhir/administrative-gender',
|
|
88
|
+
code: 'female',
|
|
89
|
+
display: 'Female'
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
valueCoding: {
|
|
94
|
+
system: 'http://hl7.org/fhir/administrative-gender',
|
|
95
|
+
code: 'male',
|
|
96
|
+
display: 'Male'
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
valueCoding: {
|
|
101
|
+
system: 'http://hl7.org/fhir/administrative-gender',
|
|
102
|
+
code: 'other',
|
|
103
|
+
display: 'Other'
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
valueCoding: {
|
|
108
|
+
system: 'http://hl7.org/fhir/administrative-gender',
|
|
109
|
+
code: 'unknown',
|
|
110
|
+
display: 'Unknown'
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
extension: [
|
|
117
|
+
{
|
|
118
|
+
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression',
|
|
119
|
+
valueExpression: {
|
|
120
|
+
language: 'text/fhirpath',
|
|
121
|
+
expression: '%gender'
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
linkId: 'gender-string',
|
|
126
|
+
text: 'Gender code',
|
|
127
|
+
type: 'string',
|
|
128
|
+
readOnly: true
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
};
|