@aehrc/smart-forms-renderer 0.36.0 → 0.37.2

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 (106) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/lib/components/FormComponents/Button.styles.d.ts +4 -0
  3. package/lib/components/FormComponents/Button.styles.js +10 -0
  4. package/lib/components/FormComponents/Button.styles.js.map +1 -0
  5. package/lib/components/FormComponents/GroupItem/GroupHeading.d.ts +1 -0
  6. package/lib/components/FormComponents/GroupItem/GroupHeading.js +3 -2
  7. package/lib/components/FormComponents/GroupItem/GroupHeading.js.map +1 -1
  8. package/lib/components/FormComponents/GroupItem/GroupItem.d.ts +4 -0
  9. package/lib/components/FormComponents/GroupItem/GroupItem.js +3 -3
  10. package/lib/components/FormComponents/GroupItem/GroupItem.js.map +1 -1
  11. package/lib/components/FormComponents/GroupItem/GroupItemView.d.ts +4 -0
  12. package/lib/components/FormComponents/GroupItem/GroupItemView.js +8 -5
  13. package/lib/components/FormComponents/GroupItem/GroupItemView.js.map +1 -1
  14. package/lib/components/FormComponents/GroupItem/NextPageButton.d.ts +7 -0
  15. package/lib/components/FormComponents/GroupItem/NextPageButton.js +26 -0
  16. package/lib/components/FormComponents/GroupItem/NextPageButton.js.map +1 -0
  17. package/lib/components/FormComponents/GroupItem/PageButtonWrapper.d.ts +8 -0
  18. package/lib/components/FormComponents/GroupItem/PageButtonWrapper.js +46 -0
  19. package/lib/components/FormComponents/GroupItem/PageButtonWrapper.js.map +1 -0
  20. package/lib/components/FormComponents/GroupItem/PreviousPageButton.d.ts +7 -0
  21. package/lib/components/FormComponents/GroupItem/PreviousPageButton.js +26 -0
  22. package/lib/components/FormComponents/GroupItem/PreviousPageButton.js.map +1 -0
  23. package/lib/components/Renderer/BaseRenderer.js +8 -0
  24. package/lib/components/Renderer/BaseRenderer.js.map +1 -1
  25. package/lib/components/Renderer/FormBodyPage.d.ts +9 -0
  26. package/lib/components/Renderer/FormBodyPage.js +43 -0
  27. package/lib/components/Renderer/FormBodyPage.js.map +1 -0
  28. package/lib/components/Renderer/FormTopLevelItem.js +7 -0
  29. package/lib/components/Renderer/FormTopLevelItem.js.map +1 -1
  30. package/lib/components/Renderer/FormTopLevelPage.d.ts +9 -0
  31. package/lib/components/Renderer/FormTopLevelPage.js +29 -0
  32. package/lib/components/Renderer/FormTopLevelPage.js.map +1 -0
  33. package/lib/hooks/useCodingCalculatedExpression.js +11 -0
  34. package/lib/hooks/useCodingCalculatedExpression.js.map +1 -1
  35. package/lib/hooks/useNextAndPreviousVisiblePages.d.ts +7 -0
  36. package/lib/hooks/useNextAndPreviousVisiblePages.js +47 -0
  37. package/lib/hooks/useNextAndPreviousVisiblePages.js.map +1 -0
  38. package/lib/interfaces/page.interface.d.ts +16 -0
  39. package/lib/interfaces/page.interface.js +2 -0
  40. package/lib/interfaces/page.interface.js.map +1 -0
  41. package/lib/interfaces/questionnaireStore.interface.d.ts +2 -0
  42. package/lib/stores/questionnaireStore.d.ts +13 -0
  43. package/lib/stores/questionnaireStore.js +19 -3
  44. package/lib/stores/questionnaireStore.js.map +1 -1
  45. package/lib/utils/calculatedExpression.js +1 -1
  46. package/lib/utils/calculatedExpression.js.map +1 -1
  47. package/lib/utils/fhirpath.js +0 -4
  48. package/lib/utils/fhirpath.js.map +1 -1
  49. package/lib/utils/initialise.d.ts +3 -0
  50. package/lib/utils/initialise.js +6 -1
  51. package/lib/utils/initialise.js.map +1 -1
  52. package/lib/utils/page.d.ts +43 -0
  53. package/lib/utils/page.js +101 -0
  54. package/lib/utils/page.js.map +1 -0
  55. package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js +4 -0
  56. package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js.map +1 -1
  57. package/lib/utils/questionnaireStoreUtils/extractPages.d.ts +3 -0
  58. package/lib/utils/questionnaireStoreUtils/extractPages.js +18 -0
  59. package/lib/utils/questionnaireStoreUtils/extractPages.js.map +1 -0
  60. package/package.json +4 -4
  61. package/src/components/FormComponents/Button.styles.ts +10 -0
  62. package/src/components/FormComponents/GroupItem/GroupHeading.tsx +5 -3
  63. package/src/components/FormComponents/GroupItem/GroupItem.tsx +11 -1
  64. package/src/components/FormComponents/GroupItem/GroupItemView.tsx +12 -0
  65. package/src/components/FormComponents/GroupItem/NextPageButton.tsx +37 -0
  66. package/src/components/FormComponents/GroupItem/PageButtonWrapper.tsx +78 -0
  67. package/src/components/FormComponents/GroupItem/PreviousPageButton.tsx +41 -0
  68. package/src/components/Renderer/BaseRenderer.tsx +21 -0
  69. package/src/components/Renderer/FormBodyPage.tsx +93 -0
  70. package/src/components/Renderer/FormTopLevelItem.tsx +17 -0
  71. package/src/components/Renderer/FormTopLevelPage.tsx +70 -0
  72. package/src/hooks/useCodingCalculatedExpression.ts +14 -1
  73. package/src/hooks/useNextAndPreviousVisiblePages.ts +69 -0
  74. package/src/interfaces/page.interface.ts +13 -0
  75. package/src/interfaces/questionnaireStore.interface.ts +2 -0
  76. package/src/stores/questionnaireStore.ts +33 -2
  77. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreAllergyIntolerance.json +209 -0
  78. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreCondition.json +220 -0
  79. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreEncounter.json +299 -0
  80. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreImmunization.json +175 -0
  81. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreMedicationRequest.json +229 -0
  82. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationBP.json +359 -0
  83. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationBodyHeight.json +195 -0
  84. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationBodyWeight.json +195 -0
  85. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationHeartRate.json +195 -0
  86. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationSmokingStatus.json +174 -0
  87. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCorePatient.json +495 -0
  88. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCorePractitioner.json +139 -0
  89. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCorePractitionerRole.json +216 -0
  90. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreProcedure.json +199 -0
  91. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreRespirationRate.json +195 -0
  92. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreWaistCircumference.json +195 -0
  93. package/src/stories/assets/questionnaires/QAuCoreTesting.ts +3796 -0
  94. package/src/stories/assets/questionnaires/QItemControlGroup.ts +673 -0
  95. package/src/stories/assets/questionnaires/QPrePopTester.ts +266 -71
  96. package/src/stories/sdc/ItemControlGroup.stories.tsx +22 -1
  97. package/src/stories/testing/AuCoreTester.stories.tsx +196 -0
  98. package/src/utils/calculatedExpression.ts +1 -1
  99. package/src/utils/fhirpath.ts +0 -5
  100. package/src/utils/initialise.ts +11 -0
  101. package/src/utils/page.ts +134 -0
  102. package/src/utils/questionnaireStoreUtils/createQuestionaireModel.ts +5 -0
  103. package/src/utils/questionnaireStoreUtils/extractPages.ts +24 -0
  104. package/stats.html +0 -4842
  105. package/stats1.html +0 -4842
  106. package/stats3.html +0 -4842
@@ -0,0 +1,359 @@
1
+ {
2
+ "resourceType": "Questionnaire",
3
+ "id": "BloodPressureObservation",
4
+ "version": "0.1.0",
5
+ "name": "BloodPressureObservation",
6
+ "title": "Blood Pressure Observation",
7
+ "status": "draft",
8
+ "date": "2024-07-15",
9
+ "extension": [
10
+ {
11
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext",
12
+ "extension": [
13
+ {
14
+ "url": "name",
15
+ "valueCoding": {
16
+ "system": "http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext",
17
+ "code": "patient"
18
+ }
19
+ },
20
+ {
21
+ "url": "type",
22
+ "valueCode": "Patient"
23
+ },
24
+ {
25
+ "url": "description",
26
+ "valueString": "The patient that is to be used to pre-populate the form"
27
+ }
28
+ ]
29
+ },
30
+ {
31
+ "url": "http://hl7.org/fhir/StructureDefinition/variable",
32
+ "valueExpression": {
33
+ "name": "ObservationBP",
34
+ "language": "application/x-fhir-query",
35
+ "expression": "Observation?code=75367002&_count=1&_sort=-date&patient={{%patient.id}}"
36
+ }
37
+ }
38
+ ],
39
+ "item": [
40
+ {
41
+ "linkId": "observation",
42
+ "text": "AU Core Observation - Blood Pressure",
43
+ "type": "group",
44
+ "item": [
45
+ {
46
+ "linkId": "patient-details",
47
+ "text": "Patient Details",
48
+ "type": "group",
49
+ "item": [
50
+ {
51
+ "extension": [
52
+ {
53
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
54
+ "valueExpression": {
55
+ "language": "text/fhirpath",
56
+ "expression": "%patient.id"
57
+ }
58
+ }
59
+ ],
60
+ "linkId": "patient-id",
61
+ "text": "Patient ID",
62
+ "type": "string",
63
+ "required": true,
64
+ "readOnly": true
65
+ },
66
+ {
67
+ "extension": [
68
+ {
69
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
70
+ "valueExpression": {
71
+ "language": "text/fhirpath",
72
+ "expression": "(%patient.name.where(use='official').select((family | (given\n| prefix).join(' ')).join(', ').where($this != '') | text)).first()"
73
+ }
74
+ }
75
+ ],
76
+ "linkId": "patient-name",
77
+ "text": "Patient Name",
78
+ "type": "string",
79
+ "required": true,
80
+ "readOnly": true
81
+ }
82
+ ]
83
+ },
84
+ {
85
+ "linkId": "first-observation-note",
86
+ "text": "This questionnaire only uses the first Observation resource with LOINC code 85354-9 (Blood pressure) of a referenced\npatient.",
87
+ "_text": {
88
+ "extension": [
89
+ {
90
+ "url": "http://hl7.org/fhir/StructureDefinition/rendering-xhtml",
91
+ "valueString": "<div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"padding-bottom:\n8px;\">\r\n\n <b>This questionnaire only uses the first Observation resource with LOINC code 85354-9 (Blood pressure) of a referenced\npatient.</b>\r\n</div>"
92
+ }
93
+ ]
94
+ },
95
+ "type": "display"
96
+ },
97
+ {
98
+ "linkId": "observation-status",
99
+ "text": "Observation Status",
100
+ "answerValueSet": "http://hl7.org/fhir/ValueSet/observation-status",
101
+ "type": "choice",
102
+ "extension": [
103
+ {
104
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
105
+ "valueExpression": {
106
+ "language": "text/fhirpath",
107
+ "expression": "%ObservationBP.entry[0].resource.status"
108
+ }
109
+ }
110
+ ]
111
+ },
112
+ {
113
+ "linkId": "observation-category",
114
+ "text": "Observation Category",
115
+ "type": "choice",
116
+ "answerValueSet": "http://hl7.org/fhir/ValueSet/observation-category",
117
+ "extension": [
118
+ {
119
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
120
+ "valueExpression": {
121
+ "language": "text/fhirpath",
122
+ "expression": "%ObservationBP.entry[0].resource.category.coding"
123
+ }
124
+ }
125
+ ]
126
+ },
127
+ {
128
+ "linkId": "observation-category-vscat-boolean",
129
+ "text": "Observation Category is VSCat?",
130
+ "type": "boolean",
131
+ "extension": [
132
+ {
133
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
134
+ "valueExpression": {
135
+ "language": "text/fhirpath",
136
+ "expression": "%ObservationBP.entry[0].resource.category.coding.code = 'vital-signs'"
137
+ }
138
+ }
139
+ ]
140
+ },
141
+ {
142
+ "linkId": "observation-code-loinc",
143
+ "text": "Observation Code (LOINC)",
144
+ "type": "choice",
145
+ "answerValueSet": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult",
146
+ "extension": [
147
+ {
148
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
149
+ "valueExpression": {
150
+ "language": "text/fhirpath",
151
+ "expression": "%ObservationBP.entry[0].resource.code.coding.where(system='http://loinc.org' and code='85354-9')"
152
+ }
153
+ }
154
+ ]
155
+ },
156
+ {
157
+ "linkId": "observation-code-snomed",
158
+ "text": "Observation Code (SNOMED)",
159
+ "type": "choice",
160
+ "answerValueSet": "http://snomed.info/sct/32506021000036107",
161
+ "extension": [
162
+ {
163
+ "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
164
+ "valueCodeableConcept": {
165
+ "coding": [
166
+ {
167
+ "system": "http://hl7.org/fhir/questionnaire-item-control",
168
+ "code": "autocomplete"
169
+ }
170
+ ]
171
+ }
172
+ },
173
+ {
174
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
175
+ "valueExpression": {
176
+ "language": "text/fhirpath",
177
+ "expression": "%ObservationBP.entry[0].resource.code.coding.where(system='http://snomed.info/sct' and code='75367002')"
178
+ }
179
+ }
180
+ ]
181
+ },
182
+ {
183
+ "linkId": "Observation.effectivedateTime",
184
+ "text": "Effective Date Time",
185
+ "type": "dateTime",
186
+ "extension": [
187
+ {
188
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
189
+ "valueExpression": {
190
+ "language": "text/fhirpath",
191
+ "expression": "%ObservationBP.entry[0].resource.effectiveDateTime"
192
+ }
193
+ }
194
+ ]
195
+ },
196
+ {
197
+ "linkId": "component-systolic-bp",
198
+ "text": "SystolicBP Component",
199
+ "type": "group",
200
+ "extension": [
201
+ {
202
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemPopulationContext",
203
+ "valueExpression": {
204
+ "name": "ComponentSystolic",
205
+ "language": "text/fhirpath",
206
+ "expression": "%ObservationBP.entry[0].resource.component[0]"
207
+ }
208
+ }
209
+ ],
210
+ "item": [
211
+ {
212
+ "linkId": "component-systolic-bp-code-loinc",
213
+ "text": "Code (LOINC)",
214
+ "type": "choice",
215
+ "answerValueSet": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult",
216
+ "extension": [
217
+ {
218
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
219
+ "valueExpression": {
220
+ "language": "text/fhirpath",
221
+ "expression": "%ComponentSystolic.code.coding.where(system='http://loinc.org' and code='8480-6')"
222
+ }
223
+ }
224
+ ]
225
+ },
226
+ {
227
+ "linkId": "component-systolic-bp-code-snomed",
228
+ "text": "Code (SNOMED)",
229
+ "type": "choice",
230
+ "answerValueSet": "http://snomed.info/sct/32506021000036107",
231
+ "extension": [
232
+ {
233
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
234
+ "valueExpression": {
235
+ "language": "text/fhirpath",
236
+ "expression": "%ComponentSystolic.code.coding.where(system='http://snomed.info/sct' and code='271649006')"
237
+ }
238
+ },
239
+ {
240
+ "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
241
+ "valueCodeableConcept": {
242
+ "coding": [
243
+ {
244
+ "system": "http://hl7.org/fhir/questionnaire-item-control",
245
+ "code": "autocomplete"
246
+ }
247
+ ]
248
+ }
249
+ }
250
+ ]
251
+ },
252
+ {
253
+ "linkId": "component-systolic-bp-value",
254
+ "text": "Value",
255
+ "type": "decimal",
256
+ "extension": [
257
+ {
258
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
259
+ "valueExpression": {
260
+ "language": "text/fhirpath",
261
+ "expression": "%ComponentSystolic.value.value"
262
+ }
263
+ },
264
+ {
265
+ "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unit",
266
+ "valueCoding": {
267
+ "system": "http://unitsofmeasure.org",
268
+ "code": "mm[Hg]",
269
+ "display": "mmHg"
270
+ }
271
+ }
272
+ ]
273
+ }
274
+ ]
275
+ },
276
+ {
277
+ "linkId": "component-diastolic-bp",
278
+ "text": "DiastolicBP Component",
279
+ "type": "group",
280
+ "extension": [
281
+ {
282
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemPopulationContext",
283
+ "valueExpression": {
284
+ "name": "ComponentDiastolic",
285
+ "language": "text/fhirpath",
286
+ "expression": "%ObservationBP.entry[0].resource.component[1]"
287
+ }
288
+ }
289
+ ],
290
+ "item": [
291
+ {
292
+ "linkId": "component-diastolic-bp-code-loinc",
293
+ "text": "Code (LOINC)",
294
+ "type": "choice",
295
+ "answerValueSet": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult",
296
+ "extension": [
297
+ {
298
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
299
+ "valueExpression": {
300
+ "language": "text/fhirpath",
301
+ "expression": "%ComponentDiastolic.code.coding.where(system='http://loinc.org' and code='8462-4')"
302
+ }
303
+ }
304
+ ]
305
+ },
306
+ {
307
+ "linkId": "component-diastolic-bp-code-snomed",
308
+ "text": "Code (SNOMED)",
309
+ "type": "choice",
310
+ "answerValueSet": "http://snomed.info/sct/32506021000036107",
311
+ "extension": [
312
+ {
313
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
314
+ "valueExpression": {
315
+ "language": "text/fhirpath",
316
+ "expression": "%ComponentDiastolic.code.coding.where(system='http://snomed.info/sct' and code='271650006')"
317
+ }
318
+ },
319
+ {
320
+ "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
321
+ "valueCodeableConcept": {
322
+ "coding": [
323
+ {
324
+ "system": "http://hl7.org/fhir/questionnaire-item-control",
325
+ "code": "autocomplete"
326
+ }
327
+ ]
328
+ }
329
+ }
330
+ ]
331
+ },
332
+ {
333
+ "linkId": "component-diastolic-bp-value",
334
+ "text": "Value",
335
+ "type": "decimal",
336
+ "extension": [
337
+ {
338
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
339
+ "valueExpression": {
340
+ "language": "text/fhirpath",
341
+ "expression": "%ComponentDiastolic.value.value"
342
+ }
343
+ },
344
+ {
345
+ "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unit",
346
+ "valueCoding": {
347
+ "system": "http://unitsofmeasure.org",
348
+ "code": "mm[Hg]",
349
+ "display": "mmHg"
350
+ }
351
+ }
352
+ ]
353
+ }
354
+ ]
355
+ }
356
+ ]
357
+ }
358
+ ]
359
+ }
@@ -0,0 +1,195 @@
1
+ {
2
+ "resourceType": "Questionnaire",
3
+ "id": "BodyHeightObservation",
4
+ "version": "0.1.0",
5
+ "name": "BodyHeightObservation",
6
+ "title": "Body Height Observation",
7
+ "status": "draft",
8
+ "date": "2024-07-15",
9
+ "extension": [
10
+ {
11
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext",
12
+ "extension": [
13
+ {
14
+ "url": "name",
15
+ "valueCoding": {
16
+ "system": "http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext",
17
+ "code": "patient"
18
+ }
19
+ },
20
+ {
21
+ "url": "type",
22
+ "valueCode": "Patient"
23
+ },
24
+ {
25
+ "url": "description",
26
+ "valueString": "The patient that is to be used to pre-populate the form"
27
+ }
28
+ ]
29
+ },
30
+ {
31
+ "url": "http://hl7.org/fhir/StructureDefinition/variable",
32
+ "valueExpression": {
33
+ "name": "ObservationHeight",
34
+ "language": "application/x-fhir-query",
35
+ "expression": "Observation?code=8302-2&_count=1&_sort=-date&patient={{%patient.id}}"
36
+ }
37
+ }
38
+ ],
39
+ "item": [
40
+ {
41
+ "linkId": "observation",
42
+ "text": "AU Core Observation - Body Height",
43
+ "type": "group",
44
+ "item": [
45
+ {
46
+ "linkId": "patient-details",
47
+ "text": "Patient Details",
48
+ "type": "group",
49
+ "item": [
50
+ {
51
+ "extension": [
52
+ {
53
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
54
+ "valueExpression": {
55
+ "language": "text/fhirpath",
56
+ "expression": "%patient.id"
57
+ }
58
+ }
59
+ ],
60
+ "linkId": "patient-id",
61
+ "text": "Patient ID",
62
+ "type": "string",
63
+ "required": true,
64
+ "readOnly": true
65
+ },
66
+ {
67
+ "extension": [
68
+ {
69
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
70
+ "valueExpression": {
71
+ "language": "text/fhirpath",
72
+ "expression": "(%patient.name.where(use='official').select((family | (given\n| prefix).join(' ')).join(', ').where($this != '') | text)).first()"
73
+ }
74
+ }
75
+ ],
76
+ "linkId": "patient-name",
77
+ "text": "Patient Name",
78
+ "type": "string",
79
+ "required": true,
80
+ "readOnly": true
81
+ }
82
+ ]
83
+ },
84
+ {
85
+ "linkId": "first-observation-note",
86
+ "text": "This questionnaire only uses the first Observation resource with LOINC code 8302-2 (Body height) of a referenced\npatient.",
87
+ "_text": {
88
+ "extension": [
89
+ {
90
+ "url": "http://hl7.org/fhir/StructureDefinition/rendering-xhtml",
91
+ "valueString": "<div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"padding-bottom:\n8px;\">\r\n\n <b>This questionnaire only uses the first Observation resource with LOINC code 8302-2 (Body height) of a referenced\npatient.</b>\r\n</div>"
92
+ }
93
+ ]
94
+ },
95
+ "type": "display"
96
+ },
97
+ {
98
+ "linkId": "observation-status",
99
+ "text": "Observation Status",
100
+ "answerValueSet": "http://hl7.org/fhir/ValueSet/observation-status",
101
+ "type": "choice",
102
+ "extension": [
103
+ {
104
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
105
+ "valueExpression": {
106
+ "language": "text/fhirpath",
107
+ "expression": "%ObservationHeight.entry[0].resource.status"
108
+ }
109
+ }
110
+ ]
111
+ },
112
+ {
113
+ "linkId": "observation-category",
114
+ "text": "Observation Category",
115
+ "type": "choice",
116
+ "answerValueSet": "http://hl7.org/fhir/ValueSet/observation-category",
117
+ "extension": [
118
+ {
119
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
120
+ "valueExpression": {
121
+ "language": "text/fhirpath",
122
+ "expression": "%ObservationHeight.entry[0].resource.category.coding"
123
+ }
124
+ }
125
+ ]
126
+ },
127
+ {
128
+ "linkId": "observation-category-vscat-boolean",
129
+ "text": "Observation Category is VSCat?",
130
+ "type": "boolean",
131
+ "extension": [
132
+ {
133
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
134
+ "valueExpression": {
135
+ "language": "text/fhirpath",
136
+ "expression": "%ObservationHeight.entry[0].resource.category.coding.code = 'vital-signs'"
137
+ }
138
+ }
139
+ ]
140
+ },
141
+ {
142
+ "linkId": "observation-code-loinc",
143
+ "text": "Observation Code (LOINC)",
144
+ "type": "choice",
145
+ "answerValueSet": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult",
146
+ "extension": [
147
+ {
148
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
149
+ "valueExpression": {
150
+ "language": "text/fhirpath",
151
+ "expression": "%ObservationHeight.entry[0].resource.code.coding.where(system='http://loinc.org' and code='8302-2')"
152
+ }
153
+ }
154
+ ]
155
+ },
156
+ {
157
+ "linkId": "Observation.effectivedateTime",
158
+ "text": "Effective Date Time",
159
+ "type": "dateTime",
160
+ "extension": [
161
+ {
162
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
163
+ "valueExpression": {
164
+ "language": "text/fhirpath",
165
+ "expression": "%ObservationHeight.entry[0].resource.effectiveDateTime"
166
+ }
167
+ }
168
+ ]
169
+ },
170
+ {
171
+ "linkId": "observation-value",
172
+ "text": "Observation Value",
173
+ "type": "decimal",
174
+ "extension": [
175
+ {
176
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
177
+ "valueExpression": {
178
+ "language": "text/fhirpath",
179
+ "expression": "%ObservationHeight.entry[0].resource.valueQuantity.value"
180
+ }
181
+ },
182
+ {
183
+ "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unit",
184
+ "valueCoding": {
185
+ "system": "http://unitsofmeasure.org",
186
+ "code": "cm",
187
+ "display": "cm"
188
+ }
189
+ }
190
+ ]
191
+ }
192
+ ]
193
+ }
194
+ ]
195
+ }