@aehrc/smart-forms-renderer 0.27.3 → 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.
Files changed (193) hide show
  1. package/.storybook/main.ts +2 -1
  2. package/.storybook/preview.ts +6 -1
  3. package/.swcrc +2 -2
  4. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.d.ts +3 -2
  5. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.js +9 -17
  6. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.js.map +1 -1
  7. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js +12 -9
  8. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js.map +1 -1
  9. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.d.ts +2 -2
  10. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js +7 -9
  11. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js.map +1 -1
  12. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js +12 -8
  13. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js.map +1 -1
  14. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.d.ts +3 -1
  15. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js +14 -4
  16. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js.map +1 -1
  17. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js +9 -4
  18. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js.map +1 -1
  19. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionView.d.ts +3 -1
  20. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionView.js +3 -3
  21. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionView.js.map +1 -1
  22. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.d.ts +3 -2
  23. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js +16 -8
  24. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js.map +1 -1
  25. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js +7 -4
  26. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js.map +1 -1
  27. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.d.ts +2 -1
  28. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js +2 -3
  29. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js.map +1 -1
  30. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js +8 -3
  31. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js.map +1 -1
  32. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionView.d.ts +3 -1
  33. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionView.js +3 -3
  34. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionView.js.map +1 -1
  35. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/DateTimeField.d.ts +2 -1
  36. package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/DateTimeField.js.map +1 -1
  37. package/lib/components/FormComponents/DecimalItem/DecimalItem.js +3 -1
  38. package/lib/components/FormComponents/DecimalItem/DecimalItem.js.map +1 -1
  39. package/lib/components/FormComponents/GroupItem/TabButtonsWrapper.js +20 -20
  40. package/lib/components/FormComponents/GroupItem/TabButtonsWrapper.js.map +1 -1
  41. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.d.ts +3 -2
  42. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.js +7 -19
  43. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.js.map +1 -1
  44. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js +40 -40
  45. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js.map +1 -1
  46. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js +15 -3
  47. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js.map +1 -1
  48. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.d.ts +2 -1
  49. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js +3 -3
  50. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js.map +1 -1
  51. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js +27 -26
  52. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js.map +1 -1
  53. package/lib/components/FormComponents/StringItem/StringField.js +1 -1
  54. package/lib/components/FormComponents/StringItem/StringField.js.map +1 -1
  55. package/lib/hooks/useInitialiseRenderer.js +1 -1
  56. package/lib/hooks/useInitialiseRenderer.js.map +1 -1
  57. package/lib/hooks/useNextAndPreviousVisibleTabs.d.ts +7 -0
  58. package/lib/hooks/useNextAndPreviousVisibleTabs.js +63 -0
  59. package/lib/hooks/useNextAndPreviousVisibleTabs.js.map +1 -0
  60. package/lib/hooks/useNextPreviousVisibleTabs.d.ts +6 -0
  61. package/lib/hooks/useNextPreviousVisibleTabs.js +63 -0
  62. package/lib/hooks/useNextPreviousVisibleTabs.js.map +1 -0
  63. package/lib/hooks/useValidationFeedback.js +1 -1
  64. package/lib/index.d.ts +0 -7
  65. package/lib/index.js +0 -24
  66. package/lib/index.js.map +1 -1
  67. package/lib/utils/choice.d.ts +1 -7
  68. package/lib/utils/choice.js +10 -20
  69. package/lib/utils/choice.js.map +1 -1
  70. package/lib/utils/enableWhen.js +5 -7
  71. package/lib/utils/enableWhen.js.map +1 -1
  72. package/lib/utils/index.d.ts +1 -0
  73. package/lib/utils/index.js +1 -0
  74. package/lib/utils/index.js.map +1 -1
  75. package/lib/utils/openChoice.d.ts +9 -4
  76. package/lib/utils/openChoice.js +47 -78
  77. package/lib/utils/openChoice.js.map +1 -1
  78. package/lib/utils/tabs.d.ts +0 -21
  79. package/lib/utils/tabs.js +0 -51
  80. package/lib/utils/tabs.js.map +1 -1
  81. package/lib/utils/validateQuestionnaire.js.map +1 -1
  82. package/package.json +9 -6
  83. package/src/components/FormComponents/ChoiceItems/CheckboxOptionList.tsx +82 -0
  84. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.tsx +23 -52
  85. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx +15 -9
  86. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.tsx +17 -19
  87. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +13 -8
  88. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.tsx +32 -4
  89. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +12 -2
  90. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionView.tsx +10 -2
  91. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx +29 -17
  92. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +10 -4
  93. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.tsx +4 -3
  94. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +10 -2
  95. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionView.tsx +8 -2
  96. package/src/components/FormComponents/DateTimeItems/CustomDateTimeItem/DateTimeField.tsx +2 -1
  97. package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +15 -12
  98. package/src/components/FormComponents/GroupItem/TabButtonsWrapper.tsx +28 -25
  99. package/src/components/FormComponents/ItemParts/{RadioAnswerOptionButtons.tsx → RadioOptionList.tsx} +7 -7
  100. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.tsx +18 -50
  101. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx +70 -68
  102. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetFields.tsx +110 -0
  103. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.tsx +188 -0
  104. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.tsx +46 -19
  105. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.tsx +5 -3
  106. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx +37 -29
  107. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetFields.tsx +104 -0
  108. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetItem.tsx +156 -0
  109. package/src/components/FormComponents/StringItem/StringField.tsx +1 -1
  110. package/src/hooks/useInitialiseRenderer.ts +1 -1
  111. package/src/hooks/useNextAndPreviousVisibleTabs.ts +86 -0
  112. package/src/hooks/useOpenLabel.ts +43 -0
  113. package/src/hooks/useValidationFeedback.ts +1 -1
  114. package/src/index.ts +0 -21
  115. package/src/stories/BuildFormWrapper.tsx +57 -0
  116. package/src/stories/assets/questionnaires/QAdvancedAdditionalDisplayContent.ts +113 -0
  117. package/src/stories/assets/questionnaires/QAdvancedControlAppearance.ts +294 -0
  118. package/src/stories/assets/questionnaires/QAdvancedOther.ts +494 -0
  119. package/src/stories/assets/questionnaires/QAdvancedTextApperance.ts +216 -0
  120. package/src/stories/assets/questionnaires/QAttachment.ts +38 -0
  121. package/src/stories/assets/questionnaires/QBehaviorCalculations.ts +645 -0
  122. package/src/stories/assets/questionnaires/QBehaviorChoiceRestriction.ts +281 -0
  123. package/src/stories/assets/questionnaires/QBehaviorOther.ts +1149 -0
  124. package/src/stories/assets/questionnaires/QBehaviorValueConstraints.ts +508 -0
  125. package/src/stories/assets/questionnaires/QBoolean.ts +130 -0
  126. package/src/stories/assets/questionnaires/QChoice.ts +493 -0
  127. package/src/stories/assets/questionnaires/QDate.ts +56 -0
  128. package/src/stories/assets/questionnaires/QDateTime.ts +56 -0
  129. package/src/stories/assets/questionnaires/QDecimal.ts +56 -0
  130. package/src/stories/assets/questionnaires/QDisplay.ts +38 -0
  131. package/src/stories/assets/questionnaires/QGroup.ts +52 -0
  132. package/src/stories/assets/questionnaires/QInteger.ts +119 -0
  133. package/src/stories/assets/questionnaires/QItemControlDisplay.ts +557 -0
  134. package/src/stories/assets/questionnaires/QItemControlGroup.ts +633 -0
  135. package/src/stories/assets/questionnaires/QItemControlQuestion.ts +1271 -0
  136. package/src/stories/assets/questionnaires/QOpenChoice.ts +151 -0
  137. package/src/stories/assets/questionnaires/QQuantity.ts +44 -0
  138. package/src/stories/assets/questionnaires/QReference.ts +38 -0
  139. package/src/stories/assets/questionnaires/QSingleItems.ts +251 -0
  140. package/src/stories/assets/questionnaires/QString.ts +131 -0
  141. package/src/stories/assets/questionnaires/QText.ts +169 -0
  142. package/src/stories/assets/questionnaires/QTime.ts +38 -0
  143. package/src/stories/assets/questionnaires/QUrl.ts +38 -0
  144. package/src/stories/assets/questionnaires/index.ts +44 -0
  145. package/src/stories/itemTypes/Attachment.stories.tsx +39 -0
  146. package/src/stories/{MedicalHistoryTable.stories.tsx → itemTypes/Boolean.stories.tsx} +24 -26
  147. package/src/stories/itemTypes/Choice.stories.tsx +78 -0
  148. package/src/stories/itemTypes/Date.stories.tsx +46 -0
  149. package/src/stories/itemTypes/DateTime.stories.tsx +45 -0
  150. package/src/stories/itemTypes/Decimal.stories.tsx +56 -0
  151. package/src/stories/itemTypes/Display.stories.tsx +39 -0
  152. package/src/stories/itemTypes/Group.stories.tsx +39 -0
  153. package/src/stories/itemTypes/Integer.stories.tsx +55 -0
  154. package/src/stories/itemTypes/OpenChoice.stories.tsx +64 -0
  155. package/src/stories/itemTypes/Quantity.stories.tsx +39 -0
  156. package/src/stories/itemTypes/Reference.stories.tsx +39 -0
  157. package/src/stories/itemTypes/String.stories.tsx +51 -0
  158. package/src/stories/itemTypes/Text.stories.tsx +51 -0
  159. package/src/stories/itemTypes/Time.stories.tsx +39 -0
  160. package/src/stories/itemTypes/Url.stories.tsx +39 -0
  161. package/src/stories/sdc/AdvancedAdditionalDisplayContent.stories.tsx +51 -0
  162. package/src/stories/sdc/AdvancedControlAppearance.stories.tsx +51 -0
  163. package/src/stories/sdc/AdvancedOther.stories.tsx +76 -0
  164. package/src/stories/sdc/AdvancedTextAppearance.stories.tsx +76 -0
  165. package/src/stories/sdc/BehaviorCalculations.stories.tsx +69 -0
  166. package/src/stories/sdc/BehaviorChoiceRestriction.stories.tsx +76 -0
  167. package/src/stories/sdc/BehaviorOther.stories.tsx +90 -0
  168. package/src/stories/sdc/BehaviorValueConstraints.stories.tsx +88 -0
  169. package/src/stories/sdc/ItemControlDisplay.stories.tsx +69 -0
  170. package/src/stories/sdc/ItemControlGroup.stories.tsx +62 -0
  171. package/src/stories/sdc/ItemControlQuestion.stories.tsx +118 -0
  172. package/src/tests/enableWhen.test.ts +112 -0
  173. package/src/tests/test-data/enable-when-items-sample.json +3848 -0
  174. package/src/tests/test-data/initial-answers-sample.json +16 -0
  175. package/src/tests/test-data/linked-questions-map.json +217 -0
  176. package/src/tests/test-data/questionnaire-response-sample.json +650 -0
  177. package/src/utils/buildForm.ts +23 -0
  178. package/src/utils/choice.ts +16 -23
  179. package/src/utils/enableWhen.ts +5 -7
  180. package/src/utils/index.ts +1 -0
  181. package/src/utils/openChoice.ts +83 -98
  182. package/src/utils/tabs.ts +0 -75
  183. package/src/utils/validateQuestionnaire.ts +18 -6
  184. package/vite.config.ts +23 -0
  185. package/doctor-storybook.log +0 -18
  186. package/src/stories/SmartFormsRenderer.stories.ts +0 -139
  187. package/src/stories/assets/QItems-and-QRItems/QR_GTableMedicalHistory.json +0 -80
  188. package/src/stories/assets/QItems-and-QRItems/Q_GTableMedicalHistory.json +0 -109
  189. package/src/stories/assets/Qs-and-QRs/Q715.json +0 -15086
  190. package/src/stories/assets/Qs-and-QRs/QDev715.json +0 -16081
  191. package/src/stories/assets/Qs-and-QRs/QTestGrid.json +0 -411
  192. package/src/stories/assets/Qs-and-QRs/R715.json +0 -311
  193. package/src/stories/assets/Qs-and-QRs/RTestGrid.json +0 -34
@@ -0,0 +1,633 @@
1
+ import type { Questionnaire } from 'fhir/r4';
2
+
3
+ export const qItemControlGroupGTable: Questionnaire = {
4
+ resourceType: 'Questionnaire',
5
+ id: 'ItemControlGroupGTable',
6
+ name: 'ItemControlGroupGTable',
7
+ title: 'Item Control Group GTable',
8
+ version: '0.1.0',
9
+ status: 'draft',
10
+ publisher: 'AEHRC CSIRO',
11
+ date: '2024-05-01',
12
+ url: 'https://smartforms.csiro.au/docs/advanced/control/item-control-group-gtable',
13
+ contained: [
14
+ {
15
+ resourceType: 'ValueSet',
16
+ id: 'MedicalHistory',
17
+ url: 'https://smartforms.csiro.au/ig/ValueSet/MedicalHistory',
18
+ name: 'MedicalHistory',
19
+ title: 'Medical History',
20
+ status: 'draft',
21
+ experimental: false,
22
+ description:
23
+ 'The Medical History value set includes values that may be used to represent medical history, operations and hospital admissions.',
24
+ compose: {
25
+ include: [
26
+ {
27
+ system: 'http://snomed.info/sct',
28
+ filter: [
29
+ {
30
+ property: 'constraint',
31
+ op: '=',
32
+ value:
33
+ '^32570581000036105|Problem/Diagnosis reference set| OR ^32570141000036105|Procedure foundation reference set|'
34
+ }
35
+ ]
36
+ }
37
+ ]
38
+ }
39
+ },
40
+ {
41
+ resourceType: 'ValueSet',
42
+ id: 'condition-clinical',
43
+ extension: [
44
+ {
45
+ url: 'http://hl7.org/fhir/StructureDefinition/structuredefinition-wg',
46
+ valueCode: 'pc'
47
+ },
48
+ {
49
+ url: 'http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status',
50
+ valueCode: 'trial-use'
51
+ },
52
+ {
53
+ url: 'http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm',
54
+ valueInteger: 3
55
+ }
56
+ ],
57
+ url: 'http://hl7.org/fhir/ValueSet/condition-clinical',
58
+ identifier: [
59
+ {
60
+ system: 'urn:ietf:rfc:3986',
61
+ value: 'urn:oid:2.16.840.1.113883.4.642.3.164'
62
+ }
63
+ ],
64
+ version: '4.0.1',
65
+ name: 'ConditionClinicalStatusCodes',
66
+ title: 'Condition Clinical Status Codes',
67
+ status: 'draft',
68
+ experimental: false,
69
+ publisher: 'FHIR Project team',
70
+ contact: [
71
+ {
72
+ telecom: [
73
+ {
74
+ system: 'url',
75
+ value: 'http://hl7.org/fhir'
76
+ }
77
+ ]
78
+ }
79
+ ],
80
+ description: 'Preferred value set for Condition Clinical Status.',
81
+ copyright: 'Copyright © 2011+ HL7. Licensed under Creative Commons "No Rights Reserved".',
82
+ compose: {
83
+ include: [
84
+ {
85
+ system: 'http://terminology.hl7.org/CodeSystem/condition-clinical'
86
+ }
87
+ ]
88
+ },
89
+ expansion: {
90
+ identifier: 'urn:uuid:79d21cca-9f34-4cfa-9020-17eee95eeed8',
91
+ timestamp: '2024-04-02T14:17:12+10:00',
92
+ total: 6,
93
+ parameter: [
94
+ {
95
+ name: 'version',
96
+ valueUri: 'http://terminology.hl7.org/CodeSystem/condition-clinical|4.0.1'
97
+ },
98
+ {
99
+ name: 'used-codesystem',
100
+ valueUri: 'http://terminology.hl7.org/CodeSystem/condition-clinical|4.0.1'
101
+ },
102
+ {
103
+ name: 'warning-draft',
104
+ valueUri: 'http://hl7.org/fhir/ValueSet/condition-clinical|4.0.1'
105
+ },
106
+ {
107
+ name: 'warning-trial-use',
108
+ valueUri: 'http://hl7.org/fhir/ValueSet/condition-clinical|4.0.1'
109
+ },
110
+ {
111
+ name: 'warning-trial-use',
112
+ valueUri: 'http://terminology.hl7.org/CodeSystem/condition-clinical|4.0.1'
113
+ },
114
+ {
115
+ name: 'warning-draft',
116
+ valueUri: 'http://terminology.hl7.org/CodeSystem/condition-clinical|4.0.1'
117
+ }
118
+ ],
119
+ contains: [
120
+ {
121
+ system: 'http://terminology.hl7.org/CodeSystem/condition-clinical',
122
+ code: 'active',
123
+ display: 'Active'
124
+ },
125
+ {
126
+ system: 'http://terminology.hl7.org/CodeSystem/condition-clinical',
127
+ code: 'inactive',
128
+ display: 'Inactive'
129
+ },
130
+ {
131
+ system: 'http://terminology.hl7.org/CodeSystem/condition-clinical',
132
+ code: 'recurrence',
133
+ display: 'Recurrence'
134
+ },
135
+ {
136
+ system: 'http://terminology.hl7.org/CodeSystem/condition-clinical',
137
+ code: 'relapse',
138
+ display: 'Relapse'
139
+ },
140
+ {
141
+ system: 'http://terminology.hl7.org/CodeSystem/condition-clinical',
142
+ code: 'remission',
143
+ display: 'Remission'
144
+ },
145
+ {
146
+ system: 'http://terminology.hl7.org/CodeSystem/condition-clinical',
147
+ code: 'resolved',
148
+ display: 'Resolved'
149
+ }
150
+ ]
151
+ }
152
+ }
153
+ ],
154
+ item: [
155
+ {
156
+ extension: [
157
+ {
158
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
159
+ valueCodeableConcept: {
160
+ coding: [
161
+ {
162
+ system: 'http://hl7.org/fhir/questionnaire-item-control',
163
+ code: 'gtable'
164
+ }
165
+ ]
166
+ }
167
+ }
168
+ ],
169
+ linkId: 'medical-history',
170
+ text: 'Medical history and current problems list',
171
+ type: 'group',
172
+ repeats: true,
173
+ item: [
174
+ {
175
+ extension: [
176
+ {
177
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
178
+ valueCodeableConcept: {
179
+ coding: [
180
+ {
181
+ system: 'http://hl7.org/fhir/questionnaire-item-control',
182
+ code: 'autocomplete'
183
+ }
184
+ ]
185
+ }
186
+ }
187
+ ],
188
+ linkId: 'medical-history-condition',
189
+ text: 'Condition',
190
+ type: 'open-choice',
191
+ answerValueSet: '#MedicalHistory'
192
+ },
193
+ {
194
+ extension: [
195
+ {
196
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
197
+ valueCodeableConcept: {
198
+ coding: [
199
+ {
200
+ system: 'http://hl7.org/fhir/questionnaire-item-control',
201
+ code: 'drop-down'
202
+ }
203
+ ]
204
+ }
205
+ }
206
+ ],
207
+ linkId: 'medical-history-status',
208
+ text: 'Clinical Status',
209
+ type: 'choice',
210
+ answerValueSet: '#condition-clinical'
211
+ },
212
+ {
213
+ linkId: 'medical-history-onset',
214
+ text: 'Onset Date',
215
+ type: 'date'
216
+ },
217
+ {
218
+ linkId: 'medical-history-recorded',
219
+ text: 'Recorded Date',
220
+ type: 'date'
221
+ }
222
+ ]
223
+ }
224
+ ]
225
+ };
226
+
227
+ export const qItemControlGroupGridSingleRow: Questionnaire = {
228
+ resourceType: 'Questionnaire',
229
+ id: 'ItemControlGroupGridSingleRow',
230
+ name: 'ItemControlGroupGridSingleRow',
231
+ title: 'Item Control Group Grid - Single Row',
232
+ version: '0.1.0',
233
+ status: 'draft',
234
+ publisher: 'AEHRC CSIRO',
235
+ date: '2024-05-01',
236
+ url: 'https://smartforms.csiro.au/docs/advanced/control/item-control-group-grid-1',
237
+ item: [
238
+ {
239
+ linkId: 'parent-container',
240
+ type: 'group',
241
+ repeats: false,
242
+ item: [
243
+ {
244
+ extension: [
245
+ {
246
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
247
+ valueCodeableConcept: {
248
+ coding: [
249
+ {
250
+ system: 'http://hl7.org/fhir/questionnaire-item-control',
251
+ version: '1.0.0',
252
+ code: 'grid'
253
+ }
254
+ ]
255
+ }
256
+ }
257
+ ],
258
+ linkId: 'blood-pressure-grid',
259
+ type: 'group',
260
+ repeats: false,
261
+ item: [
262
+ {
263
+ linkId: 'blood-pressure-group',
264
+ text: 'Blood pressure',
265
+ type: 'group',
266
+ repeats: false,
267
+ item: [
268
+ {
269
+ extension: [
270
+ {
271
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-unit',
272
+ valueCoding: {
273
+ system: 'http://unitsofmeasure.org',
274
+ code: 'mm[Hg]',
275
+ display: 'mm Hg'
276
+ }
277
+ }
278
+ ],
279
+ linkId: 'blood-pressure-systolic',
280
+ text: 'Systolic',
281
+ type: 'integer',
282
+ repeats: false
283
+ },
284
+ {
285
+ extension: [
286
+ {
287
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-unit',
288
+ valueCoding: {
289
+ system: 'http://unitsofmeasure.org',
290
+ code: 'mm[Hg]',
291
+ display: 'mm Hg'
292
+ }
293
+ }
294
+ ],
295
+ linkId: 'blood-pressure-diastolic',
296
+ text: 'Diastolic',
297
+ type: 'integer',
298
+ repeats: false
299
+ },
300
+ {
301
+ linkId: 'blood-pressure-date',
302
+ text: 'Date performed',
303
+ type: 'date',
304
+ repeats: false
305
+ }
306
+ ]
307
+ }
308
+ ]
309
+ }
310
+ ]
311
+ }
312
+ ]
313
+ };
314
+
315
+ export const qItemControlGroupGridMultiRow: Questionnaire = {
316
+ resourceType: 'Questionnaire',
317
+ id: 'ItemControlGroupGridMultiRow',
318
+ name: 'ItemControlGroupGridMultiRow',
319
+ title: 'Item Control Group Grid - Multi Row',
320
+ version: '0.1.0',
321
+ status: 'draft',
322
+ publisher: 'AEHRC CSIRO',
323
+ date: '2024-05-01',
324
+ url: 'https://smartforms.csiro.au/docs/advanced/control/item-control-group-grid-2',
325
+ item: [
326
+ {
327
+ linkId: 'parent-container',
328
+ text: '',
329
+ type: 'group',
330
+ repeats: false,
331
+ item: [
332
+ {
333
+ extension: [
334
+ {
335
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
336
+ valueCodeableConcept: {
337
+ coding: [
338
+ {
339
+ system: 'http://hl7.org/fhir/questionnaire-item-control',
340
+ version: '1.0.0',
341
+ code: 'grid'
342
+ }
343
+ ]
344
+ }
345
+ }
346
+ ],
347
+ linkId: 'grid-group',
348
+ type: 'group',
349
+ repeats: false,
350
+ item: [
351
+ {
352
+ linkId: 'height-row',
353
+ text: 'Height',
354
+ type: 'group',
355
+ repeats: false,
356
+ item: [
357
+ {
358
+ extension: [
359
+ {
360
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-unit',
361
+ valueCoding: {
362
+ system: 'http://unitsofmeasure.org',
363
+ code: 'cm',
364
+ display: 'cm'
365
+ }
366
+ }
367
+ ],
368
+ linkId: 'height-value',
369
+ text: 'Value',
370
+ type: 'decimal',
371
+ repeats: false
372
+ },
373
+ {
374
+ linkId: 'height-date-performed',
375
+ text: 'Date performed',
376
+ type: 'date',
377
+ repeats: false
378
+ }
379
+ ]
380
+ },
381
+ {
382
+ linkId: 'weight-row',
383
+ text: 'Weight',
384
+ type: 'group',
385
+ repeats: false,
386
+ item: [
387
+ {
388
+ extension: [
389
+ {
390
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-unit',
391
+ valueCoding: {
392
+ system: 'http://unitsofmeasure.org',
393
+ code: 'kg',
394
+ display: 'kg'
395
+ }
396
+ }
397
+ ],
398
+ linkId: 'weight-value',
399
+ text: 'Value',
400
+ type: 'decimal',
401
+ repeats: false
402
+ },
403
+ {
404
+ linkId: 'weight-date-performed',
405
+ text: 'Date performed',
406
+ type: 'date',
407
+ repeats: false
408
+ }
409
+ ]
410
+ },
411
+ {
412
+ linkId: 'bmi-row',
413
+ text: 'BMI',
414
+ type: 'group',
415
+ repeats: false,
416
+ item: [
417
+ {
418
+ extension: [
419
+ {
420
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression',
421
+ valueExpression: {
422
+ description: 'BMI calculation',
423
+ language: 'text/fhirpath',
424
+ expression: '(%weight/((%height/100).power(2))).round(1)'
425
+ }
426
+ },
427
+ {
428
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-unit',
429
+ valueCoding: {
430
+ system: 'http://unitsofmeasure.org',
431
+ code: 'kg/m2',
432
+ display: 'kg/m2'
433
+ }
434
+ }
435
+ ],
436
+ linkId: 'bmi-value',
437
+ text: 'Value',
438
+ type: 'decimal',
439
+ repeats: false,
440
+ readOnly: false
441
+ }
442
+ ]
443
+ },
444
+ {
445
+ linkId: 'heart-rate-row',
446
+ text: 'Heart rate',
447
+ type: 'group',
448
+ repeats: false,
449
+ item: [
450
+ {
451
+ extension: [
452
+ {
453
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-unit',
454
+ valueCoding: {
455
+ system: 'http://unitsofmeasure.org',
456
+ code: '/min',
457
+ display: '/min'
458
+ }
459
+ }
460
+ ],
461
+ linkId: 'heart-rate-value',
462
+ text: 'Value',
463
+ type: 'integer',
464
+ repeats: false
465
+ },
466
+ {
467
+ linkId: 'heart-rate-date-performed',
468
+ text: 'Date performed',
469
+ type: 'date',
470
+ repeats: false
471
+ }
472
+ ]
473
+ },
474
+ {
475
+ linkId: 'heart-rhythm-row',
476
+ text: 'Heart rhythm',
477
+ type: 'group',
478
+ repeats: false,
479
+ item: [
480
+ {
481
+ extension: [
482
+ {
483
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
484
+ valueCodeableConcept: {
485
+ coding: [
486
+ {
487
+ system: 'http://hl7.org/fhir/questionnaire-item-control',
488
+ code: 'radio-button'
489
+ }
490
+ ]
491
+ }
492
+ }
493
+ ],
494
+ linkId: 'heart-rhythm-value',
495
+ text: 'Value',
496
+ type: 'choice',
497
+ repeats: false,
498
+ answerOption: [
499
+ {
500
+ valueCoding: {
501
+ system: 'http://snomed.info/sct',
502
+ code: '271636001',
503
+ display: 'Pulse regular'
504
+ }
505
+ },
506
+ {
507
+ valueCoding: {
508
+ system: 'http://snomed.info/sct',
509
+ code: '61086009',
510
+ display: 'Pulse irregular'
511
+ }
512
+ }
513
+ ]
514
+ },
515
+ {
516
+ linkId: 'heart-rhythm-date-performed',
517
+ text: 'Date performed',
518
+ type: 'date',
519
+ repeats: false
520
+ }
521
+ ]
522
+ }
523
+ ]
524
+ }
525
+ ]
526
+ }
527
+ ]
528
+ };
529
+
530
+ export const qItemControlDisplayTabContainer: Questionnaire = {
531
+ resourceType: 'Questionnaire',
532
+ id: 'ItemControlGroupTabContainer',
533
+ name: 'ItemControlGroupTabContainer',
534
+ title: 'Item Control Group Tab Container',
535
+ version: '0.1.0',
536
+ status: 'draft',
537
+ publisher: 'AEHRC CSIRO',
538
+ date: '2024-05-01',
539
+ url: 'https://smartforms.csiro.au/docs/advanced/control/item-control-group-tab-container',
540
+ item: [
541
+ {
542
+ extension: [
543
+ {
544
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
545
+ valueCodeableConcept: {
546
+ coding: [
547
+ {
548
+ system: 'http://hl7.org/fhir/questionnaire-item-control',
549
+ version: '1.0.0',
550
+ code: 'tab-container'
551
+ }
552
+ ]
553
+ }
554
+ }
555
+ ],
556
+ linkId: 'tab-container',
557
+ type: 'group',
558
+ repeats: false,
559
+ item: [
560
+ {
561
+ linkId: 'tab-about-health-check',
562
+ text: 'About the health check',
563
+ type: 'group',
564
+ repeats: false,
565
+ item: [
566
+ {
567
+ linkId: 'health-check-eligible',
568
+ text: 'Eligible for health check',
569
+ type: 'boolean',
570
+ repeats: false
571
+ },
572
+ {
573
+ linkId: 'health-check-in-progress',
574
+ text: 'Health check already in progress?',
575
+ type: 'boolean',
576
+ repeats: false
577
+ },
578
+ {
579
+ linkId: 'health-check-last-completed',
580
+ text: 'Date of last completed health check',
581
+ type: 'date',
582
+ repeats: false
583
+ },
584
+ {
585
+ linkId: 'health-check-this-commenced',
586
+ text: 'Date and time this health check commenced',
587
+ type: 'dateTime',
588
+ repeats: false
589
+ }
590
+ ]
591
+ },
592
+ {
593
+ extension: [
594
+ {
595
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-shortText',
596
+ valueString: 'Current priorities'
597
+ }
598
+ ],
599
+ linkId: 'tab-current-priorities',
600
+ text: 'Current health/patient priorities',
601
+ type: 'group',
602
+ repeats: false,
603
+ item: [
604
+ {
605
+ extension: [
606
+ {
607
+ url: 'http://hl7.org/fhir/StructureDefinition/entryFormat',
608
+ valueString: 'Enter details'
609
+ }
610
+ ],
611
+ linkId: 'current-priorities-important-things',
612
+ text: 'What are the important things for you in this health check today?',
613
+ type: 'text',
614
+ repeats: false
615
+ },
616
+ {
617
+ extension: [
618
+ {
619
+ url: 'http://hl7.org/fhir/StructureDefinition/entryFormat',
620
+ valueString: 'Enter details'
621
+ }
622
+ ],
623
+ linkId: 'current-priorities-worried-things',
624
+ text: 'Is there anything you are worried about?',
625
+ type: 'text',
626
+ repeats: false
627
+ }
628
+ ]
629
+ }
630
+ ]
631
+ }
632
+ ]
633
+ };