@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,137 @@
|
|
|
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 qChoiceAnswerOptionBasic: Questionnaire = {
|
|
21
|
+
resourceType: 'Questionnaire',
|
|
22
|
+
id: 'ChoiceAnswerOptionBasic',
|
|
23
|
+
name: 'ChoiceAnswerOptionBasic',
|
|
24
|
+
title: '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/choice/answeroption-basic',
|
|
30
|
+
item: [
|
|
31
|
+
{
|
|
32
|
+
linkId: 'smoking-status',
|
|
33
|
+
text: 'Smoking status',
|
|
34
|
+
type: 'choice',
|
|
35
|
+
repeats: false,
|
|
36
|
+
answerOption: [
|
|
37
|
+
{
|
|
38
|
+
valueCoding: {
|
|
39
|
+
system: 'http://snomed.info/sct',
|
|
40
|
+
code: '266919005',
|
|
41
|
+
display: 'Never smoked'
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
valueCoding: {
|
|
46
|
+
system: 'http://snomed.info/sct',
|
|
47
|
+
code: '77176002',
|
|
48
|
+
display: 'Smoker'
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
valueCoding: {
|
|
53
|
+
system: 'http://snomed.info/sct',
|
|
54
|
+
code: '8517006',
|
|
55
|
+
display: 'Ex-smoker'
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
valueCoding: {
|
|
60
|
+
system: 'http://snomed.info/sct',
|
|
61
|
+
code: '16090371000119103',
|
|
62
|
+
display: 'Exposure to second hand tobacco smoke'
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
valueString: 'Wants to quit'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
valueString: 'Other tobacco use'
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const qrChoiceAnswerOptionBasicResponse: QuestionnaireResponse = {
|
|
77
|
+
resourceType: 'QuestionnaireResponse',
|
|
78
|
+
status: 'in-progress',
|
|
79
|
+
item: [
|
|
80
|
+
{
|
|
81
|
+
linkId: 'smoking-status',
|
|
82
|
+
text: 'Smoking status',
|
|
83
|
+
answer: [
|
|
84
|
+
{
|
|
85
|
+
valueCoding: {
|
|
86
|
+
system: 'http://snomed.info/sct',
|
|
87
|
+
code: '16090371000119103',
|
|
88
|
+
display: 'Exposure to second hand tobacco smoke'
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
questionnaire: 'https://smartforms.csiro.au/docs/components/choice/answeroption-basic'
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const qChoiceAnswerValueSetBasic: Questionnaire = {
|
|
98
|
+
resourceType: 'Questionnaire',
|
|
99
|
+
id: 'ChoiceAnswerValueSetBasic',
|
|
100
|
+
name: 'ChoiceAnswerValueSetBasic',
|
|
101
|
+
title: '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/choice/answervalueset-basic',
|
|
107
|
+
item: [
|
|
108
|
+
{
|
|
109
|
+
linkId: 'gender',
|
|
110
|
+
text: 'Gender',
|
|
111
|
+
type: 'choice',
|
|
112
|
+
repeats: false,
|
|
113
|
+
answerValueSet: 'http://hl7.org/fhir/ValueSet/administrative-gender'
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const qrChoiceAnswerValueSetBasicResponse: QuestionnaireResponse = {
|
|
119
|
+
resourceType: 'QuestionnaireResponse',
|
|
120
|
+
status: 'in-progress',
|
|
121
|
+
item: [
|
|
122
|
+
{
|
|
123
|
+
linkId: 'gender',
|
|
124
|
+
text: 'Gender',
|
|
125
|
+
answer: [
|
|
126
|
+
{
|
|
127
|
+
valueCoding: {
|
|
128
|
+
system: 'http://hl7.org/fhir/administrative-gender',
|
|
129
|
+
code: 'female',
|
|
130
|
+
display: 'Female'
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
questionnaire: 'https://smartforms.csiro.au/docs/components/choice/answervalueset-basic'
|
|
137
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
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 qDateBasic: Questionnaire = {
|
|
22
|
+
resourceType: 'Questionnaire',
|
|
23
|
+
id: 'DateBasic',
|
|
24
|
+
name: 'DateBasic',
|
|
25
|
+
title: 'Date 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/date/basic',
|
|
31
|
+
item: [
|
|
32
|
+
{
|
|
33
|
+
linkId: 'dob',
|
|
34
|
+
type: 'date',
|
|
35
|
+
repeats: false,
|
|
36
|
+
text: 'Date of birth'
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const qrDateBasicResponse: QuestionnaireResponse = {
|
|
42
|
+
resourceType: 'QuestionnaireResponse',
|
|
43
|
+
status: 'in-progress',
|
|
44
|
+
item: [
|
|
45
|
+
{
|
|
46
|
+
linkId: 'dob',
|
|
47
|
+
text: 'Date of birth',
|
|
48
|
+
answer: [
|
|
49
|
+
{
|
|
50
|
+
valueDate: '1990-01-01'
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
questionnaire: 'https://smartforms.csiro.au/docs/components/date/basic'
|
|
56
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
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 qDateTimeBasic: Questionnaire = {
|
|
22
|
+
resourceType: 'Questionnaire',
|
|
23
|
+
id: 'DateTimeBasic',
|
|
24
|
+
name: 'DateTimeBasic',
|
|
25
|
+
title: 'DateTime 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/datetime/basic',
|
|
31
|
+
item: [
|
|
32
|
+
{
|
|
33
|
+
linkId: 'dob',
|
|
34
|
+
type: 'dateTime',
|
|
35
|
+
repeats: false,
|
|
36
|
+
text: 'Datetime of birth'
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const qrDateTimeBasicResponse: QuestionnaireResponse = {
|
|
42
|
+
resourceType: 'QuestionnaireResponse',
|
|
43
|
+
status: 'in-progress',
|
|
44
|
+
item: [
|
|
45
|
+
{
|
|
46
|
+
linkId: 'dob',
|
|
47
|
+
text: 'Date of birth',
|
|
48
|
+
answer: [
|
|
49
|
+
{
|
|
50
|
+
valueDateTime: '1990-01-01T00:53:00Z'
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
questionnaire: 'https://smartforms.csiro.au/docs/components/datetime/basic'
|
|
56
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
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 qDecimalBasic: Questionnaire = {
|
|
22
|
+
resourceType: 'Questionnaire',
|
|
23
|
+
id: 'DecimalBasic',
|
|
24
|
+
name: 'DecimalBasic',
|
|
25
|
+
title: 'Decimal 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/decimal/basic',
|
|
31
|
+
item: [
|
|
32
|
+
{
|
|
33
|
+
linkId: 'weight',
|
|
34
|
+
type: 'decimal',
|
|
35
|
+
repeats: false,
|
|
36
|
+
text: 'Weight in kg'
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const qrDecimalBasicResponse: QuestionnaireResponse = {
|
|
42
|
+
resourceType: 'QuestionnaireResponse',
|
|
43
|
+
status: 'in-progress',
|
|
44
|
+
item: [
|
|
45
|
+
{
|
|
46
|
+
linkId: 'weight',
|
|
47
|
+
text: 'Weight in kg',
|
|
48
|
+
answer: [
|
|
49
|
+
{
|
|
50
|
+
valueDecimal: 80.3
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
questionnaire: 'https://smartforms.csiro.au/docs/components/decimal/basic'
|
|
56
|
+
};
|
|
@@ -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 qDisplayBasic: Questionnaire = {
|
|
21
|
+
resourceType: 'Questionnaire',
|
|
22
|
+
id: 'DisplayBasic',
|
|
23
|
+
name: 'DisplayBasic',
|
|
24
|
+
title: 'Display 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/display/basic',
|
|
30
|
+
item: [
|
|
31
|
+
{
|
|
32
|
+
linkId: 'information-display',
|
|
33
|
+
type: 'display',
|
|
34
|
+
repeats: false,
|
|
35
|
+
text: 'You can use the display item to show information to the user.'
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
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 qGroupBasic: Questionnaire = {
|
|
21
|
+
resourceType: 'Questionnaire',
|
|
22
|
+
id: 'GroupBasic',
|
|
23
|
+
name: 'GroupBasic',
|
|
24
|
+
title: 'Group 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/group/basic',
|
|
30
|
+
item: [
|
|
31
|
+
{
|
|
32
|
+
linkId: 'patient-details-group',
|
|
33
|
+
type: 'group',
|
|
34
|
+
repeats: false,
|
|
35
|
+
text: 'Patient Details',
|
|
36
|
+
item: [
|
|
37
|
+
{
|
|
38
|
+
linkId: 'name',
|
|
39
|
+
type: 'string',
|
|
40
|
+
repeats: false,
|
|
41
|
+
text: 'Name'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
linkId: 'age',
|
|
45
|
+
type: 'integer',
|
|
46
|
+
repeats: false,
|
|
47
|
+
text: 'Age'
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
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 qIntegerBasic: Questionnaire = {
|
|
22
|
+
resourceType: 'Questionnaire',
|
|
23
|
+
id: 'IntegerBasic',
|
|
24
|
+
name: 'IntegerBasic',
|
|
25
|
+
title: 'Integer 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/integer/basic',
|
|
31
|
+
item: [
|
|
32
|
+
{
|
|
33
|
+
linkId: 'age',
|
|
34
|
+
type: 'integer',
|
|
35
|
+
repeats: false,
|
|
36
|
+
text: 'Age'
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const qrIntegerBasicResponse: QuestionnaireResponse = {
|
|
42
|
+
resourceType: 'QuestionnaireResponse',
|
|
43
|
+
status: 'in-progress',
|
|
44
|
+
item: [
|
|
45
|
+
{
|
|
46
|
+
linkId: 'age',
|
|
47
|
+
text: 'Age',
|
|
48
|
+
answer: [
|
|
49
|
+
{
|
|
50
|
+
valueInteger: 40
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
questionnaire: 'https://smartforms.csiro.au/docs/components/integer/basic'
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const qIntegerCalculation: Questionnaire = {
|
|
59
|
+
resourceType: 'Questionnaire',
|
|
60
|
+
id: 'IntegerCalculation',
|
|
61
|
+
name: 'IntegerCalculation',
|
|
62
|
+
title: 'Integer 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/integer/calculation',
|
|
68
|
+
extension: [
|
|
69
|
+
{
|
|
70
|
+
url: 'http://hl7.org/fhir/StructureDefinition/variable',
|
|
71
|
+
valueExpression: {
|
|
72
|
+
name: 'length',
|
|
73
|
+
language: 'text/fhirpath',
|
|
74
|
+
expression: "item.where(linkId = 'length-controller').answer.value"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
item: [
|
|
79
|
+
{
|
|
80
|
+
extension: [
|
|
81
|
+
{
|
|
82
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-unit',
|
|
83
|
+
valueCoding: {
|
|
84
|
+
system: 'http://unitsofmeasure.org',
|
|
85
|
+
code: 'cm',
|
|
86
|
+
display: 'cm'
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
linkId: 'length-controller',
|
|
91
|
+
text: 'Length (cm)',
|
|
92
|
+
type: 'integer',
|
|
93
|
+
repeats: false
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
extension: [
|
|
97
|
+
{
|
|
98
|
+
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression',
|
|
99
|
+
valueExpression: {
|
|
100
|
+
language: 'text/fhirpath',
|
|
101
|
+
expression: '%length.power(2)'
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-unit',
|
|
106
|
+
valueCoding: {
|
|
107
|
+
system: 'http://unitsofmeasure.org',
|
|
108
|
+
code: 'cm2',
|
|
109
|
+
display: 'cm^2'
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
linkId: 'length-squared',
|
|
114
|
+
text: 'Length squared (cm^2)',
|
|
115
|
+
type: 'integer',
|
|
116
|
+
readOnly: true
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
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
|
+
/*
|
|
19
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
20
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
21
|
+
*
|
|
22
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
23
|
+
* you may not use this file except in compliance with the License.
|
|
24
|
+
* You may obtain a copy of the License at
|
|
25
|
+
*
|
|
26
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
27
|
+
*
|
|
28
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
29
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
30
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
31
|
+
* See the License for the specific language governing permissions and
|
|
32
|
+
* limitations under the License.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
import type { Questionnaire } from 'fhir/r4';
|
|
36
|
+
|
|
37
|
+
export const qItemControlDisplayLowerAndUpper: Questionnaire = {
|
|
38
|
+
resourceType: 'Questionnaire',
|
|
39
|
+
id: 'ItemControlDisplayLowerAndUpper',
|
|
40
|
+
name: 'ItemControlDisplayLowerAndUpper',
|
|
41
|
+
title: 'Item Control Display Lower & Upper',
|
|
42
|
+
version: '0.1.0',
|
|
43
|
+
status: 'draft',
|
|
44
|
+
publisher: 'AEHRC CSIRO',
|
|
45
|
+
date: '2024-05-01',
|
|
46
|
+
url: 'https://smartforms.csiro.au/docs/advanced/control/item-control-display-lower-and-upper',
|
|
47
|
+
item: [
|
|
48
|
+
{
|
|
49
|
+
extension: [
|
|
50
|
+
{
|
|
51
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
|
|
52
|
+
valueCodeableConcept: {
|
|
53
|
+
coding: [
|
|
54
|
+
{
|
|
55
|
+
system: 'http://hl7.org/fhir/questionnaire-item-control',
|
|
56
|
+
code: 'slider'
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
url: 'http://hl7.org/fhir/StructureDefinition/minValue',
|
|
63
|
+
valueInteger: 0
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
url: 'http://hl7.org/fhir/StructureDefinition/maxValue',
|
|
67
|
+
valueInteger: 10
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
linkId: 'pain-measure',
|
|
71
|
+
text: 'Pain measure',
|
|
72
|
+
type: 'integer',
|
|
73
|
+
repeats: false,
|
|
74
|
+
item: [
|
|
75
|
+
{
|
|
76
|
+
extension: [
|
|
77
|
+
{
|
|
78
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
|
|
79
|
+
valueCodeableConcept: {
|
|
80
|
+
coding: [
|
|
81
|
+
{
|
|
82
|
+
system: 'http://hl7.org/fhir/questionnaire-item-control',
|
|
83
|
+
code: 'lower'
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
linkId: 'pain-measure-lower',
|
|
90
|
+
text: 'No pain',
|
|
91
|
+
type: 'display'
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
extension: [
|
|
95
|
+
{
|
|
96
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
|
|
97
|
+
valueCodeableConcept: {
|
|
98
|
+
coding: [
|
|
99
|
+
{
|
|
100
|
+
system: 'http://hl7.org/fhir/questionnaire-item-control',
|
|
101
|
+
code: 'upper'
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
linkId: 'pain-measure-upper',
|
|
108
|
+
text: 'Unbearable pain',
|
|
109
|
+
type: 'display'
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
};
|