@aehrc/smart-forms-renderer 0.37.2 → 0.38.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.
Files changed (104) hide show
  1. package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js +6 -2
  2. package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js.map +1 -1
  3. package/lib/components/FormComponents/QuantityItem/QuantityComparatorField.d.ts +12 -0
  4. package/lib/components/FormComponents/QuantityItem/QuantityComparatorField.js +13 -0
  5. package/lib/components/FormComponents/QuantityItem/QuantityComparatorField.js.map +1 -0
  6. package/lib/components/FormComponents/QuantityItem/QuantityField.d.ts +15 -0
  7. package/lib/components/FormComponents/QuantityItem/QuantityField.js +14 -0
  8. package/lib/components/FormComponents/QuantityItem/QuantityField.js.map +1 -0
  9. package/lib/components/FormComponents/QuantityItem/QuantityItem.d.ts +9 -0
  10. package/lib/components/FormComponents/QuantityItem/QuantityItem.js +144 -0
  11. package/lib/components/FormComponents/QuantityItem/QuantityItem.js.map +1 -0
  12. package/lib/components/FormComponents/QuantityItem/QuantityUnitField.d.ts +12 -0
  13. package/lib/components/FormComponents/QuantityItem/QuantityUnitField.js +10 -0
  14. package/lib/components/FormComponents/QuantityItem/QuantityUnitField.js.map +1 -0
  15. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js +2 -1
  16. package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +1 -1
  17. package/lib/components/FormComponents/Tables/GroupTable.d.ts +2 -2
  18. package/lib/components/FormComponents/Tables/GroupTable.js +2 -2
  19. package/lib/components/FormComponents/Tables/GroupTable.js.map +1 -1
  20. package/lib/components/FormComponents/Tables/GroupTableBody.d.ts +2 -2
  21. package/lib/components/FormComponents/Tables/GroupTableBody.js +2 -2
  22. package/lib/components/FormComponents/Tables/GroupTableBody.js.map +1 -1
  23. package/lib/components/FormComponents/Tables/GroupTableRow.d.ts +3 -2
  24. package/lib/components/FormComponents/Tables/GroupTableRow.js +16 -5
  25. package/lib/components/FormComponents/Tables/GroupTableRow.js.map +1 -1
  26. package/lib/components/FormComponents/Tables/GroupTableView.d.ts +2 -2
  27. package/lib/components/FormComponents/Tables/GroupTableView.js +10 -10
  28. package/lib/components/FormComponents/Tables/GroupTableView.js.map +1 -1
  29. package/lib/components/Renderer/FormTopLevelItem.js +6 -0
  30. package/lib/components/Renderer/FormTopLevelItem.js.map +1 -1
  31. package/lib/hooks/useDecimalCalculatedExpression.d.ts +2 -2
  32. package/lib/hooks/useQuantityCalculatedExpression.d.ts +14 -0
  33. package/lib/hooks/useQuantityCalculatedExpression.js +105 -0
  34. package/lib/hooks/useQuantityCalculatedExpression.js.map +1 -0
  35. package/lib/hooks/useRenderingExtensions.d.ts +2 -1
  36. package/lib/hooks/useRenderingExtensions.js +3 -2
  37. package/lib/hooks/useRenderingExtensions.js.map +1 -1
  38. package/lib/hooks/useStringInput.js +1 -0
  39. package/lib/hooks/useStringInput.js.map +1 -1
  40. package/lib/interfaces/valueSet.interface.d.ts +15 -0
  41. package/lib/tests/test-data/initialValueSample.d.ts +2 -0
  42. package/lib/tests/test-data/initialValueSample.js +802 -0
  43. package/lib/tests/test-data/initialValueSample.js.map +1 -0
  44. package/lib/utils/answerExpression.d.ts +18 -0
  45. package/lib/utils/answerExpression.js +133 -0
  46. package/lib/utils/answerExpression.js.map +1 -0
  47. package/lib/utils/calculatedExpression.js +5 -2
  48. package/lib/utils/calculatedExpression.js.map +1 -1
  49. package/lib/utils/dynamicValueSet.d.ts +5 -0
  50. package/lib/utils/dynamicValueSet.js +96 -0
  51. package/lib/utils/dynamicValueSet.js.map +1 -0
  52. package/lib/utils/fhirpathAsyncUtils/fhirpath-async.d.ts +14 -0
  53. package/lib/utils/fhirpathAsyncUtils/fhirpath-async.js +639 -0
  54. package/lib/utils/fhirpathAsyncUtils/fhirpath-async.js.map +1 -0
  55. package/lib/utils/fhirpathAsyncUtils/outcome-utils.d.ts +3 -0
  56. package/lib/utils/fhirpathAsyncUtils/outcome-utils.js +41 -0
  57. package/lib/utils/fhirpathAsyncUtils/outcome-utils.js.map +1 -0
  58. package/lib/utils/genericRecursive.d.ts +17 -0
  59. package/lib/utils/genericRecursive.js +82 -0
  60. package/lib/utils/genericRecursive.js.map +1 -0
  61. package/lib/utils/initialise.js +47 -57
  62. package/lib/utils/initialise.js.map +1 -1
  63. package/lib/utils/itemControl.d.ts +7 -1
  64. package/lib/utils/itemControl.js +14 -0
  65. package/lib/utils/itemControl.js.map +1 -1
  66. package/lib/utils/quantity.d.ts +4 -0
  67. package/lib/utils/quantity.js +49 -0
  68. package/lib/utils/quantity.js.map +1 -0
  69. package/lib/utils/repopulateIntoResponse.js +1 -1
  70. package/lib/utils/repopulateIntoResponse.js.map +1 -1
  71. package/lib/utils/valueSet.d.ts +2 -1
  72. package/lib/utils/valueSet.js +22 -0
  73. package/lib/utils/valueSet.js.map +1 -1
  74. package/package.json +1 -1
  75. package/src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx +16 -0
  76. package/src/components/FormComponents/QuantityItem/QuantityComparatorField.tsx +40 -0
  77. package/src/components/FormComponents/QuantityItem/QuantityField.tsx +60 -0
  78. package/src/components/FormComponents/QuantityItem/QuantityItem.tsx +286 -0
  79. package/src/components/FormComponents/QuantityItem/QuantityUnitField.tsx +38 -0
  80. package/src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx +2 -1
  81. package/src/components/FormComponents/Tables/GroupTable.tsx +4 -0
  82. package/src/components/FormComponents/Tables/GroupTableBody.tsx +5 -1
  83. package/src/components/FormComponents/Tables/GroupTableRow.tsx +98 -46
  84. package/src/components/FormComponents/Tables/GroupTableView.tsx +30 -26
  85. package/src/components/Renderer/FormTopLevelItem.tsx +17 -0
  86. package/src/hooks/useDecimalCalculatedExpression.ts +2 -2
  87. package/src/hooks/useQuantityCalculatedExpression.ts +177 -0
  88. package/src/hooks/useRenderingExtensions.ts +5 -2
  89. package/src/hooks/useStringInput.ts +1 -0
  90. package/src/interfaces/valueSet.interface.ts +19 -0
  91. package/src/stories/assets/questionnaires/QItemControlGroup.ts +229 -5
  92. package/src/stories/assets/questionnaires/QPrePopTester.ts +30 -0
  93. package/src/stories/assets/questionnaires/QQuantity.ts +283 -1
  94. package/src/stories/itemTypes/Quantity.stories.tsx +33 -1
  95. package/src/stories/sdc/ItemControlGroup.stories.tsx +10 -3
  96. package/src/tests/initial.test.ts +34 -0
  97. package/src/tests/test-data/initialValueSample.ts +826 -0
  98. package/src/utils/calculatedExpression.ts +6 -2
  99. package/src/utils/{updateQr.ts → genericRecursive.ts} +47 -2
  100. package/src/utils/initialise.ts +67 -73
  101. package/src/utils/itemControl.ts +19 -1
  102. package/src/utils/quantity.ts +62 -0
  103. package/src/utils/repopulateIntoResponse.ts +1 -1
  104. package/src/utils/valueSet.ts +32 -1
@@ -0,0 +1,826 @@
1
+ import type { Questionnaire } from 'fhir/r4';
2
+
3
+ export const qInitialValueSample: Questionnaire = {
4
+ resourceType: 'Questionnaire',
5
+ id: 'RadiologyTerminologyPOCTesting5',
6
+ meta: {
7
+ versionId: '4',
8
+ lastUpdated: '2024-08-27T05:59:51.989+00:00',
9
+ source: '#q1g1OHfA2KYNPtmK',
10
+ profile: [
11
+ 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-pop-exp',
12
+ 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-render'
13
+ ]
14
+ },
15
+ extension: [
16
+ {
17
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext',
18
+ extension: [
19
+ {
20
+ url: 'name',
21
+ valueCoding: {
22
+ system: 'http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext',
23
+ code: 'patient'
24
+ }
25
+ },
26
+ {
27
+ url: 'type',
28
+ valueCode: 'Patient'
29
+ },
30
+ {
31
+ url: 'description',
32
+ valueString: 'The patient that is to be used to pre-populate the form'
33
+ }
34
+ ]
35
+ },
36
+ {
37
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext',
38
+ extension: [
39
+ {
40
+ url: 'name',
41
+ valueCoding: {
42
+ system: 'http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext',
43
+ code: 'user'
44
+ }
45
+ },
46
+ {
47
+ url: 'type',
48
+ valueCode: 'Practitioner'
49
+ },
50
+ {
51
+ url: 'description',
52
+ valueString: 'The practitioner user that is to be used to pre-populate the form'
53
+ }
54
+ ]
55
+ },
56
+ {
57
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext',
58
+ extension: [
59
+ {
60
+ url: 'name',
61
+ valueCoding: {
62
+ system: 'http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext',
63
+ code: 'encounter'
64
+ }
65
+ },
66
+ {
67
+ url: 'type',
68
+ valueCode: 'Encounter'
69
+ },
70
+ {
71
+ url: 'description',
72
+ valueString: 'The encounter that is to be used to pre-populate the form'
73
+ }
74
+ ]
75
+ },
76
+ {
77
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
78
+ valueExpression: {
79
+ name: 'PractitionerRole',
80
+ language: 'application/x-fhir-query',
81
+ expression: 'PractitionerRole?practitioner={{%user.id}}'
82
+ }
83
+ }
84
+ ],
85
+ url: 'https://smartforms.csiro.au/ig/Questionnaire/RadiologyTerminologyPOCTesting5',
86
+ name: 'RadiologyTerminologyPOCTesting5',
87
+ title: 'Radiology Terminology POC Testing 5',
88
+ status: 'draft',
89
+ experimental: true,
90
+ subjectType: ['Patient'],
91
+ date: '2024-08-16',
92
+ description: 'Radiology Terminology POC Testing 5.',
93
+ jurisdiction: [
94
+ {
95
+ coding: [
96
+ {
97
+ system: 'urn:iso:std:iso:3166',
98
+ code: 'AU'
99
+ }
100
+ ]
101
+ }
102
+ ],
103
+ item: [
104
+ {
105
+ extension: [
106
+ {
107
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemPopulationContext',
108
+ valueExpression: {
109
+ name: 'PractitionerRoleRepeat',
110
+ language: 'text/fhirpath',
111
+ expression: '%PractitionerRole.entry.resource'
112
+ }
113
+ }
114
+ ],
115
+ linkId: 'radiology-order',
116
+ text: 'Order details',
117
+ type: 'group',
118
+ required: true,
119
+ repeats: false,
120
+ item: [
121
+ {
122
+ extension: [
123
+ {
124
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression',
125
+ valueExpression: {
126
+ language: 'text/fhirpath',
127
+ expression: 'now().toString()'
128
+ }
129
+ }
130
+ ],
131
+ linkId: 'radiology-order-number',
132
+ text: 'Order number',
133
+ type: 'string',
134
+ required: true,
135
+ repeats: false
136
+ },
137
+ {
138
+ extension: [
139
+ {
140
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression',
141
+ valueExpression: {
142
+ language: 'text/fhirpath',
143
+ expression: "'PractitionerRole/' + %PractitionerRoleRepeat.id"
144
+ }
145
+ },
146
+ {
147
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-hidden',
148
+ valueBoolean: true
149
+ }
150
+ ],
151
+ linkId: 'radiology-order-requesterreference',
152
+ text: 'Requester reference',
153
+ type: 'string',
154
+ repeats: false
155
+ },
156
+ {
157
+ extension: [
158
+ {
159
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression',
160
+ valueExpression: {
161
+ language: 'text/fhirpath',
162
+ expression:
163
+ "%PractitionerRoleRepeat.identifier.where(system='http://ns.electronichealth.net.au/id/medicare-provider-number').value"
164
+ }
165
+ },
166
+ {
167
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-hidden',
168
+ valueBoolean: true
169
+ }
170
+ ],
171
+ linkId: 'radiology-order-requesterdisplay',
172
+ text: 'Requester display',
173
+ type: 'string',
174
+ repeats: false
175
+ }
176
+ ]
177
+ },
178
+ {
179
+ linkId: 'radiology-service',
180
+ text: 'Service details',
181
+ type: 'group',
182
+ required: true,
183
+ repeats: true,
184
+ item: [
185
+ {
186
+ extension: [
187
+ {
188
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
189
+ valueExpression: {
190
+ name: 'procedureFocus',
191
+ language: 'text/fhirpath',
192
+ expression:
193
+ "item.repeat(item).where(linkId='radiology-service-examination-components-modality').answer.value"
194
+ }
195
+ },
196
+ {
197
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
198
+ valueExpression: {
199
+ name: 'procedureFocusCode',
200
+ language: 'text/fhirpath',
201
+ expression: '%procedureFocus.code'
202
+ }
203
+ },
204
+ {
205
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
206
+ valueExpression: {
207
+ name: 'procedureFocusDisplay',
208
+ language: 'text/fhirpath',
209
+ expression: '%procedureFocus.display'
210
+ }
211
+ },
212
+ {
213
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
214
+ valueExpression: {
215
+ name: 'bodySite',
216
+ language: 'text/fhirpath',
217
+ expression:
218
+ "item.repeat(item).where(linkId='radiology-service-examination-components-bodysite').answer.value"
219
+ }
220
+ },
221
+ {
222
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
223
+ valueExpression: {
224
+ name: 'bodySiteCode',
225
+ language: 'text/fhirpath',
226
+ expression: '%bodySite.code'
227
+ }
228
+ },
229
+ {
230
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
231
+ valueExpression: {
232
+ name: 'bodySiteDisplay',
233
+ language: 'text/fhirpath',
234
+ expression: '%bodySite.display'
235
+ }
236
+ },
237
+ {
238
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
239
+ valueExpression: {
240
+ name: 'laterality',
241
+ language: 'text/fhirpath',
242
+ expression:
243
+ "item.repeat(item).where(linkId='radiology-service-examination-components-laterality').answer.value"
244
+ }
245
+ },
246
+ {
247
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
248
+ valueExpression: {
249
+ name: 'lateralityCode',
250
+ language: 'text/fhirpath',
251
+ expression: '%laterality.code'
252
+ }
253
+ },
254
+ {
255
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
256
+ valueExpression: {
257
+ name: 'lateralityDisplay',
258
+ language: 'text/fhirpath',
259
+ expression: '%laterality.display'
260
+ }
261
+ },
262
+ {
263
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
264
+ valueExpression: {
265
+ name: 'contrast',
266
+ language: 'text/fhirpath',
267
+ expression:
268
+ "item.repeat(item).where(linkId='radiology-service-examination-components-contrast').answer.value"
269
+ }
270
+ },
271
+ {
272
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
273
+ valueExpression: {
274
+ name: 'contrastCode',
275
+ language: 'text/fhirpath',
276
+ expression: '%contrast.code'
277
+ }
278
+ },
279
+ {
280
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
281
+ valueExpression: {
282
+ name: 'contrastDisplay',
283
+ language: 'text/fhirpath',
284
+ expression: '%contrast.display'
285
+ }
286
+ },
287
+ {
288
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
289
+ valueExpression: {
290
+ name: 'lateralityEnabled',
291
+ language: 'text/fhirpath',
292
+ expression:
293
+ "iif(%bodySiteCode.exists(), %bodySiteCode.memberOf('http://snomed.info/sct?fhir_vs=refset/723264001'), false )"
294
+ }
295
+ },
296
+ {
297
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
298
+ valueExpression: {
299
+ name: 'bodySiteDependency',
300
+ language: 'text/fhirpath',
301
+ expression:
302
+ "iif(%bodySiteCode.exists(), 'dependency.element=BodySite&dependency.concept.coding.system=http://snomed.info/sct&dependency.concept.coding.code=' + %bodySiteCode + '&', 'dependency.element=BodySite&dependency.concept.coding.system=http://terminology.hl7.org/CodeSystem/data-absent-reason&dependency.concept.coding.code=unknown&')"
303
+ }
304
+ },
305
+ {
306
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
307
+ valueExpression: {
308
+ name: 'lateralityDependency',
309
+ language: 'text/fhirpath',
310
+ expression:
311
+ "iif(%lateralityCode.exists(), 'dependency.element=Laterality&dependency.concept.coding.system=http://snomed.info/sct&dependency.concept.coding.code=' + %lateralityCode + '&', 'dependency.element=Laterality&dependency.concept.coding.system=http://terminology.hl7.org/CodeSystem/data-absent-reason&dependency.concept.coding.code=unknown&')"
312
+ }
313
+ },
314
+ {
315
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
316
+ valueExpression: {
317
+ name: 'contrastDependency',
318
+ language: 'text/fhirpath',
319
+ expression:
320
+ "iif(%contrastCode.empty() and %procedureFocusCode='27483000', 'dependency.element=Contrast&dependency.concept.coding.system=http://snomed.info/sct&dependency.concept.coding.code=373066001&', iif(%contrastCode.exists() and %procedureFocusCode!='27483000', 'dependency.element=Contrast&dependency.concept.coding.system=http://snomed.info/sct&dependency.concept.coding.code=' + %contrastCode + '&', 'dependency.element=Contrast&dependency.concept.coding.system=http://terminology.hl7.org/CodeSystem/data-absent-reason&dependency.concept.coding.code=unknown&'))"
321
+ }
322
+ },
323
+ {
324
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
325
+ valueExpression: {
326
+ name: 'translateAdditionalParams',
327
+ language: 'text/fhirpath',
328
+ expression: '%bodySiteDependency+%lateralityDependency+%contrastDependency'
329
+ }
330
+ },
331
+ {
332
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
333
+ valueExpression: {
334
+ name: 'procedureRequest',
335
+ language: 'text/fhirpath',
336
+ expression:
337
+ "iif(%procedureFocus.exists(), %terminologies.translate('http://erequestingexample.org.au/ConceptMap/radiology-services-map-1', %procedureFocus, %translateAdditionalParams).parameter.where(exists(name='match' and part.where(exists(name='equivalence' and value='equivalent')))).part.where(name='concept').value, {})"
338
+ }
339
+ },
340
+ {
341
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
342
+ valueExpression: {
343
+ name: 'bodySitesXray',
344
+ language: 'text/fhirpath',
345
+ expression:
346
+ "%terminologies.expand('https://smartforms.csiro.au/ig/ValueSet/radiologypoc-bodysite-xray-1').expansion.contains"
347
+ }
348
+ },
349
+ {
350
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
351
+ valueExpression: {
352
+ name: 'bodySitesPlainXray',
353
+ language: 'text/fhirpath',
354
+ expression:
355
+ "%terminologies.expand('https://smartforms.csiro.au/ig/ValueSet/radiologypoc-bodysite-plainxray-1').expansion.contains"
356
+ }
357
+ },
358
+ {
359
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
360
+ valueExpression: {
361
+ name: 'bodySitesUS',
362
+ language: 'text/fhirpath',
363
+ expression:
364
+ "%terminologies.expand('https://smartforms.csiro.au/ig/ValueSet/radiologypoc-bodysite-us-1').expansion.contains"
365
+ }
366
+ },
367
+ {
368
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
369
+ valueExpression: {
370
+ name: 'bodySitesDiagRad',
371
+ language: 'text/fhirpath',
372
+ expression:
373
+ "%terminologies.expand('https://smartforms.csiro.au/ig/ValueSet/radiologypoc-bodysite-diagrad-1').expansion.contains"
374
+ }
375
+ },
376
+ {
377
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
378
+ valueExpression: {
379
+ name: 'bodySitesAngio',
380
+ language: 'text/fhirpath',
381
+ expression:
382
+ "%terminologies.expand('https://smartforms.csiro.au/ig/ValueSet/radiologypoc-bodysite-angio-1').expansion.contains"
383
+ }
384
+ },
385
+ {
386
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
387
+ valueExpression: {
388
+ name: 'bodySitesFluoro',
389
+ language: 'text/fhirpath',
390
+ expression:
391
+ "%terminologies.expand('https://smartforms.csiro.au/ig/ValueSet/radiologypoc-bodysite-fluoro-1').expansion.contains"
392
+ }
393
+ },
394
+ {
395
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
396
+ valueExpression: {
397
+ name: 'bodySitesAll',
398
+ language: 'text/fhirpath',
399
+ expression:
400
+ "%terminologies.expand('http://erequestingexample.org.au/fhir/ValueSet/radiology-body-structure-1').expansion.contains"
401
+ }
402
+ }
403
+ ],
404
+ linkId: 'radiology-service-examination',
405
+ text: 'Examination',
406
+ type: 'group',
407
+ required: true,
408
+ repeats: false,
409
+ item: [
410
+ {
411
+ extension: [
412
+ {
413
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
414
+ valueExpression: {
415
+ name: 'bodySiteOptions',
416
+ language: 'text/fhirpath',
417
+ expression:
418
+ "iif(%procedureFocusCode='363680008', %bodySitesXray, iif(%procedureFocusCode='168537006', %bodySitesPlainXray, iif(%procedureFocusCode='16310003', %bodySitesUS, iif(%procedureFocusCode='27483000', %bodySitesDiagRad, iif(%procedureFocusCode='77343006', %bodySitesAngio, iif(%procedureFocusCode='44491008', %bodySitesFluoro, %bodySitesAll))))))"
419
+ }
420
+ }
421
+ ],
422
+ linkId: 'radiology-service-examination-components',
423
+ text: 'Procedure components',
424
+ type: 'group',
425
+ required: false,
426
+ repeats: false,
427
+ item: [
428
+ {
429
+ extension: [
430
+ {
431
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
432
+ valueCodeableConcept: {
433
+ coding: [
434
+ {
435
+ system: 'http://hl7.org/fhir/questionnaire-item-control',
436
+ code: 'drop-down'
437
+ }
438
+ ]
439
+ }
440
+ }
441
+ ],
442
+ linkId: 'radiology-service-examination-components-modality',
443
+ text: 'Procedure focus',
444
+ type: 'choice',
445
+ required: true,
446
+ repeats: false,
447
+ answerValueSet:
448
+ 'http://erequestingexample.org.au/fhir/ValueSet/radiology-procedure-1'
449
+ },
450
+ {
451
+ extension: [
452
+ {
453
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
454
+ valueCodeableConcept: {
455
+ coding: [
456
+ {
457
+ system: 'http://hl7.org/fhir/questionnaire-item-control',
458
+ code: 'drop-down'
459
+ }
460
+ ]
461
+ }
462
+ },
463
+ {
464
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression',
465
+ valueExpression: {
466
+ language: 'text/fhirpath',
467
+ expression: '%procedureFocus.empty()'
468
+ }
469
+ }
470
+ ],
471
+ linkId: 'radiology-service-examination-components-bodysite-all',
472
+ text: 'Body site',
473
+ type: 'choice',
474
+ repeats: false,
475
+ readOnly: true,
476
+ answerValueSet:
477
+ 'http://erequestingexample.org.au/fhir/ValueSet/radiology-body-structure-1',
478
+ item: [
479
+ {
480
+ extension: [
481
+ {
482
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-displayCategory',
483
+ valueCodeableConcept: {
484
+ coding: [
485
+ {
486
+ system: 'http://hl7.org/fhir/questionnaire-display-category',
487
+ code: 'instructions'
488
+ }
489
+ ]
490
+ }
491
+ }
492
+ ],
493
+ linkId: 'radiology-service-examination-components-bodysite-all-instructions',
494
+ text: 'Select procedure focus',
495
+ type: 'display'
496
+ }
497
+ ]
498
+ },
499
+ {
500
+ extension: [
501
+ {
502
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
503
+ valueCodeableConcept: {
504
+ coding: [
505
+ {
506
+ system: 'http://hl7.org/fhir/questionnaire-item-control',
507
+ code: 'drop-down'
508
+ }
509
+ ]
510
+ }
511
+ },
512
+ {
513
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression',
514
+ valueExpression: {
515
+ language: 'text/fhirpath',
516
+ expression: '%procedureFocus.exists()'
517
+ }
518
+ },
519
+ {
520
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-answerExpression',
521
+ valueExpression: {
522
+ language: 'text/fhirpath',
523
+ expression: '%bodySiteOptions'
524
+ }
525
+ }
526
+ ],
527
+ linkId: 'radiology-service-examination-components-bodysite',
528
+ text: 'Body site',
529
+ type: 'choice',
530
+ repeats: false
531
+ },
532
+ {
533
+ extension: [
534
+ {
535
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
536
+ valueCodeableConcept: {
537
+ coding: [
538
+ {
539
+ system: 'http://hl7.org/fhir/questionnaire-item-control',
540
+ code: 'radio-button'
541
+ }
542
+ ]
543
+ }
544
+ },
545
+ {
546
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression',
547
+ valueExpression: {
548
+ language: 'text/fhirpath',
549
+ expression: '%lateralityEnabled'
550
+ }
551
+ }
552
+ ],
553
+ linkId: 'radiology-service-examination-components-laterality',
554
+ text: 'Laterality',
555
+ type: 'choice',
556
+ repeats: false,
557
+ answerValueSet:
558
+ 'http://erequestingexample.org.au/fhir/ValueSet/radiology-laterality-1'
559
+ },
560
+ {
561
+ extension: [
562
+ {
563
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
564
+ valueCodeableConcept: {
565
+ coding: [
566
+ {
567
+ system: 'http://hl7.org/fhir/questionnaire-item-control',
568
+ code: 'radio-button'
569
+ }
570
+ ]
571
+ }
572
+ },
573
+ {
574
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression',
575
+ valueExpression: {
576
+ language: 'text/fhirpath',
577
+ expression: "%procedureFocusCode!='27483000'"
578
+ }
579
+ }
580
+ ],
581
+ linkId: 'radiology-service-examination-components-contrast',
582
+ text: 'Contrast',
583
+ type: 'choice',
584
+ repeats: false,
585
+ answerValueSet:
586
+ 'http://erequestingexample.org.au/fhir/ValueSet/radiology-contrast-1'
587
+ },
588
+ {
589
+ extension: [
590
+ {
591
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
592
+ valueCodeableConcept: {
593
+ coding: [
594
+ {
595
+ system: 'http://hl7.org/fhir/questionnaire-item-control',
596
+ code: 'radio-button'
597
+ }
598
+ ]
599
+ }
600
+ },
601
+ {
602
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression',
603
+ valueExpression: {
604
+ language: 'text/fhirpath',
605
+ expression: "%procedureFocusCode='27483000'"
606
+ }
607
+ }
608
+ ],
609
+ linkId: 'radiology-service-examination-components-contrast-yes',
610
+ text: 'Contrast',
611
+ type: 'choice',
612
+ repeats: false,
613
+ readOnly: true,
614
+ answerOption: [
615
+ {
616
+ valueCoding: {
617
+ system: 'http://snomed.info/sct',
618
+ code: '373066001'
619
+ },
620
+ initialSelected: true
621
+ },
622
+ {
623
+ valueCoding: {
624
+ system: 'http://snomed.info/sct',
625
+ code: '373067005'
626
+ }
627
+ }
628
+ ]
629
+ }
630
+ ]
631
+ },
632
+ {
633
+ extension: [
634
+ {
635
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
636
+ valueCodeableConcept: {
637
+ coding: [
638
+ {
639
+ system: 'http://hl7.org/fhir/questionnaire-item-control',
640
+ code: 'autocomplete'
641
+ }
642
+ ]
643
+ }
644
+ },
645
+ {
646
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression',
647
+ valueExpression: {
648
+ language: 'text/fhirpath',
649
+ expression: '%procedureFocus.empty()'
650
+ }
651
+ }
652
+ ],
653
+ linkId: 'radiology-service-examination-procedure-all',
654
+ text: 'Procedure for request',
655
+ type: 'choice',
656
+ required: false,
657
+ repeats: false,
658
+ answerValueSet: 'http://erequestingexample.org.au/fhir/ValueSet/radiology-services-1'
659
+ },
660
+ {
661
+ extension: [
662
+ {
663
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
664
+ valueCodeableConcept: {
665
+ coding: [
666
+ {
667
+ system: 'http://hl7.org/fhir/questionnaire-item-control',
668
+ code: 'radio-button'
669
+ }
670
+ ]
671
+ }
672
+ },
673
+ {
674
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression',
675
+ valueExpression: {
676
+ language: 'text/fhirpath',
677
+ expression: '%procedureFocus.exists() and %procedureRequest.exists()'
678
+ }
679
+ },
680
+ {
681
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-answerExpression',
682
+ valueExpression: {
683
+ language: 'text/fhirpath',
684
+ expression: '%procedureRequest'
685
+ }
686
+ }
687
+ ],
688
+ linkId: 'radiology-service-examination-procedure',
689
+ text: 'Procedure for request',
690
+ type: 'choice',
691
+ required: false,
692
+ repeats: false
693
+ },
694
+ {
695
+ extension: [
696
+ {
697
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression',
698
+ valueExpression: {
699
+ language: 'text/fhirpath',
700
+ expression: '%procedureFocus.exists() and %procedureRequest.empty()'
701
+ }
702
+ },
703
+ {
704
+ url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression',
705
+ valueExpression: {
706
+ language: 'text/fhirpath',
707
+ expression:
708
+ "(%procedureFocusDisplay)&(iif(%bodySiteDisplay.exists(), ', '&%bodySiteDisplay, ''))&(iif(%lateralityDisplay.exists(), ' ('&%lateralityDisplay&')', ''))&(iif(%contrastCode='373066001', ', with contrast', iif(%contrastCode='373067005', ', without contrast', '')))"
709
+ }
710
+ }
711
+ ],
712
+ linkId: 'radiology-service-examination-procedure-text',
713
+ text: 'Procedure for request',
714
+ type: 'text',
715
+ required: false,
716
+ repeats: false,
717
+ item: [
718
+ {
719
+ extension: [
720
+ {
721
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-displayCategory',
722
+ valueCodeableConcept: {
723
+ coding: [
724
+ {
725
+ system: 'http://hl7.org/fhir/questionnaire-display-category',
726
+ code: 'instructions'
727
+ }
728
+ ]
729
+ }
730
+ }
731
+ ],
732
+ linkId: 'radiology-service-examination-procedure-text-instructions',
733
+ text: 'No matching catalogue request item. This is free text.',
734
+ type: 'display'
735
+ }
736
+ ]
737
+ },
738
+ {
739
+ extension: [
740
+ {
741
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
742
+ valueCodeableConcept: {
743
+ coding: [
744
+ {
745
+ system: 'http://hl7.org/fhir/questionnaire-item-control',
746
+ code: 'drop-down'
747
+ }
748
+ ]
749
+ }
750
+ }
751
+ ],
752
+ linkId: 'radiology-service-examination-priority',
753
+ text: 'Urgency',
754
+ type: 'choice',
755
+ repeats: false,
756
+ answerOption: [
757
+ {
758
+ valueCoding: {
759
+ system: 'http://hl7.org/fhir/request-priority',
760
+ version: '4.0.1',
761
+ code: 'stat',
762
+ display: 'Emergency'
763
+ }
764
+ },
765
+ {
766
+ valueCoding: {
767
+ system: 'http://hl7.org/fhir/request-priority',
768
+ version: '4.0.1',
769
+ code: 'urgent',
770
+ display: 'Urgent'
771
+ }
772
+ },
773
+ {
774
+ valueCoding: {
775
+ system: 'http://hl7.org/fhir/request-priority',
776
+ version: '4.0.1',
777
+ code: 'routine',
778
+ display: 'Routine'
779
+ }
780
+ }
781
+ ]
782
+ },
783
+ {
784
+ linkId: 'radiology-service-examination-timing',
785
+ text: 'Service due',
786
+ type: 'dateTime',
787
+ repeats: false
788
+ }
789
+ ]
790
+ },
791
+ {
792
+ extension: [
793
+ {
794
+ url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
795
+ valueCodeableConcept: {
796
+ coding: [
797
+ {
798
+ system: 'http://hl7.org/fhir/questionnaire-item-control',
799
+ code: 'autocomplete'
800
+ }
801
+ ]
802
+ }
803
+ }
804
+ ],
805
+ linkId: 'radiology-service-clinicalindication',
806
+ text: 'Clinical indication',
807
+ type: 'open-choice',
808
+ repeats: true,
809
+ answerValueSet: 'https://healthterminologies.gov.au/fhir/ValueSet/reason-for-request-1'
810
+ },
811
+ {
812
+ linkId: 'radiology-service-clinicalnotes',
813
+ text: 'Clinical context',
814
+ type: 'text',
815
+ repeats: false
816
+ },
817
+ {
818
+ linkId: 'radiology-service-comment',
819
+ text: 'Comment',
820
+ type: 'text',
821
+ repeats: false
822
+ }
823
+ ]
824
+ }
825
+ ]
826
+ };