@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.
- package/CHANGELOG.md +40 -0
- package/lib/components/FormComponents/Button.styles.d.ts +4 -0
- package/lib/components/FormComponents/Button.styles.js +10 -0
- package/lib/components/FormComponents/Button.styles.js.map +1 -0
- package/lib/components/FormComponents/GroupItem/GroupHeading.d.ts +1 -0
- package/lib/components/FormComponents/GroupItem/GroupHeading.js +3 -2
- package/lib/components/FormComponents/GroupItem/GroupHeading.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/GroupItem.d.ts +4 -0
- package/lib/components/FormComponents/GroupItem/GroupItem.js +3 -3
- package/lib/components/FormComponents/GroupItem/GroupItem.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/GroupItemView.d.ts +4 -0
- package/lib/components/FormComponents/GroupItem/GroupItemView.js +8 -5
- package/lib/components/FormComponents/GroupItem/GroupItemView.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/NextPageButton.d.ts +7 -0
- package/lib/components/FormComponents/GroupItem/NextPageButton.js +26 -0
- package/lib/components/FormComponents/GroupItem/NextPageButton.js.map +1 -0
- package/lib/components/FormComponents/GroupItem/PageButtonWrapper.d.ts +8 -0
- package/lib/components/FormComponents/GroupItem/PageButtonWrapper.js +46 -0
- package/lib/components/FormComponents/GroupItem/PageButtonWrapper.js.map +1 -0
- package/lib/components/FormComponents/GroupItem/PreviousPageButton.d.ts +7 -0
- package/lib/components/FormComponents/GroupItem/PreviousPageButton.js +26 -0
- package/lib/components/FormComponents/GroupItem/PreviousPageButton.js.map +1 -0
- package/lib/components/Renderer/BaseRenderer.js +8 -0
- package/lib/components/Renderer/BaseRenderer.js.map +1 -1
- package/lib/components/Renderer/FormBodyPage.d.ts +9 -0
- package/lib/components/Renderer/FormBodyPage.js +43 -0
- package/lib/components/Renderer/FormBodyPage.js.map +1 -0
- package/lib/components/Renderer/FormTopLevelItem.js +7 -0
- package/lib/components/Renderer/FormTopLevelItem.js.map +1 -1
- package/lib/components/Renderer/FormTopLevelPage.d.ts +9 -0
- package/lib/components/Renderer/FormTopLevelPage.js +29 -0
- package/lib/components/Renderer/FormTopLevelPage.js.map +1 -0
- package/lib/hooks/useCodingCalculatedExpression.js +11 -0
- package/lib/hooks/useCodingCalculatedExpression.js.map +1 -1
- package/lib/hooks/useNextAndPreviousVisiblePages.d.ts +7 -0
- package/lib/hooks/useNextAndPreviousVisiblePages.js +47 -0
- package/lib/hooks/useNextAndPreviousVisiblePages.js.map +1 -0
- package/lib/interfaces/page.interface.d.ts +16 -0
- package/lib/interfaces/page.interface.js +2 -0
- package/lib/interfaces/page.interface.js.map +1 -0
- package/lib/interfaces/questionnaireStore.interface.d.ts +2 -0
- package/lib/stores/questionnaireStore.d.ts +13 -0
- package/lib/stores/questionnaireStore.js +19 -3
- package/lib/stores/questionnaireStore.js.map +1 -1
- package/lib/utils/calculatedExpression.js +1 -1
- package/lib/utils/calculatedExpression.js.map +1 -1
- package/lib/utils/fhirpath.js +0 -4
- package/lib/utils/fhirpath.js.map +1 -1
- package/lib/utils/initialise.d.ts +3 -0
- package/lib/utils/initialise.js +6 -1
- package/lib/utils/initialise.js.map +1 -1
- package/lib/utils/page.d.ts +43 -0
- package/lib/utils/page.js +101 -0
- package/lib/utils/page.js.map +1 -0
- package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js +4 -0
- package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js.map +1 -1
- package/lib/utils/questionnaireStoreUtils/extractPages.d.ts +3 -0
- package/lib/utils/questionnaireStoreUtils/extractPages.js +18 -0
- package/lib/utils/questionnaireStoreUtils/extractPages.js.map +1 -0
- package/package.json +4 -4
- package/src/components/FormComponents/Button.styles.ts +10 -0
- package/src/components/FormComponents/GroupItem/GroupHeading.tsx +5 -3
- package/src/components/FormComponents/GroupItem/GroupItem.tsx +11 -1
- package/src/components/FormComponents/GroupItem/GroupItemView.tsx +12 -0
- package/src/components/FormComponents/GroupItem/NextPageButton.tsx +37 -0
- package/src/components/FormComponents/GroupItem/PageButtonWrapper.tsx +78 -0
- package/src/components/FormComponents/GroupItem/PreviousPageButton.tsx +41 -0
- package/src/components/Renderer/BaseRenderer.tsx +21 -0
- package/src/components/Renderer/FormBodyPage.tsx +93 -0
- package/src/components/Renderer/FormTopLevelItem.tsx +17 -0
- package/src/components/Renderer/FormTopLevelPage.tsx +70 -0
- package/src/hooks/useCodingCalculatedExpression.ts +14 -1
- package/src/hooks/useNextAndPreviousVisiblePages.ts +69 -0
- package/src/interfaces/page.interface.ts +13 -0
- package/src/interfaces/questionnaireStore.interface.ts +2 -0
- package/src/stores/questionnaireStore.ts +33 -2
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreAllergyIntolerance.json +209 -0
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreCondition.json +220 -0
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreEncounter.json +299 -0
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreImmunization.json +175 -0
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreMedicationRequest.json +229 -0
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationBP.json +359 -0
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationBodyHeight.json +195 -0
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationBodyWeight.json +195 -0
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationHeartRate.json +195 -0
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationSmokingStatus.json +174 -0
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCorePatient.json +495 -0
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCorePractitioner.json +139 -0
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCorePractitionerRole.json +216 -0
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreProcedure.json +199 -0
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreRespirationRate.json +195 -0
- package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreWaistCircumference.json +195 -0
- package/src/stories/assets/questionnaires/QAuCoreTesting.ts +3796 -0
- package/src/stories/assets/questionnaires/QItemControlGroup.ts +673 -0
- package/src/stories/assets/questionnaires/QPrePopTester.ts +266 -71
- package/src/stories/sdc/ItemControlGroup.stories.tsx +22 -1
- package/src/stories/testing/AuCoreTester.stories.tsx +196 -0
- package/src/utils/calculatedExpression.ts +1 -1
- package/src/utils/fhirpath.ts +0 -5
- package/src/utils/initialise.ts +11 -0
- package/src/utils/page.ts +134 -0
- package/src/utils/questionnaireStoreUtils/createQuestionaireModel.ts +5 -0
- package/src/utils/questionnaireStoreUtils/extractPages.ts +24 -0
- package/stats.html +0 -4842
- package/stats1.html +0 -4842
- package/stats3.html +0 -4842
|
@@ -183,108 +183,246 @@ export const qSelectivePrePopTester: Questionnaire = {
|
|
|
183
183
|
valueString: 'The patient that is to be used to pre-populate the form'
|
|
184
184
|
}
|
|
185
185
|
]
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
url: 'http://hl7.org/fhir/StructureDefinition/variable',
|
|
189
|
+
valueExpression: {
|
|
190
|
+
name: 'ObsTobaccoSmokingStatus',
|
|
191
|
+
language: 'application/x-fhir-query',
|
|
192
|
+
expression: 'Observation?code=72166-2&_count=1&_sort=-date&patient={{%patient.id}}'
|
|
193
|
+
}
|
|
186
194
|
}
|
|
187
195
|
],
|
|
188
196
|
item: [
|
|
189
197
|
{
|
|
190
|
-
linkId: '
|
|
198
|
+
linkId: 'container',
|
|
191
199
|
extension: [
|
|
192
200
|
{
|
|
193
|
-
url: 'http://hl7.org/fhir/StructureDefinition/
|
|
194
|
-
valueString:
|
|
195
|
-
'<div xmlns="http://www.w3.org/1999/xhtml">\r\n <div style="font-size:0.875em"> This questionnaire is used by Playwright to do regression testing of the <pre style="display: inline">@aehrc/sdc-populate</pre> library\'s pre-population logic. Items will be incrementally added as needed.</div><br/></div>'
|
|
196
|
-
}
|
|
197
|
-
],
|
|
198
|
-
text: "This questionnaire is used by Playwright to do regression testing of the @aehrc/sdc-populate library's pre-population logic. Items will be incrementally added as needed.",
|
|
199
|
-
type: 'display',
|
|
200
|
-
repeats: false
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
extension: [
|
|
204
|
-
{
|
|
205
|
-
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression',
|
|
201
|
+
url: 'http://hl7.org/fhir/StructureDefinition/variable',
|
|
206
202
|
valueExpression: {
|
|
203
|
+
name: 'sex',
|
|
207
204
|
language: 'text/fhirpath',
|
|
208
|
-
expression: '
|
|
205
|
+
expression: "item.where(linkId='sex-at-birth-initial-expression').answer.value"
|
|
209
206
|
}
|
|
210
|
-
}
|
|
211
|
-
],
|
|
212
|
-
linkId: 'gender-avs-url',
|
|
213
|
-
text: 'Administrative gender (answerValueSet url)',
|
|
214
|
-
type: 'choice',
|
|
215
|
-
repeats: false,
|
|
216
|
-
answerValueSet: 'http://hl7.org/fhir/ValueSet/administrative-gender'
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
extension: [
|
|
207
|
+
},
|
|
220
208
|
{
|
|
221
|
-
url: 'http://hl7.org/fhir/
|
|
209
|
+
url: 'http://hl7.org/fhir/StructureDefinition/variable',
|
|
222
210
|
valueExpression: {
|
|
211
|
+
name: 'smoker',
|
|
223
212
|
language: 'text/fhirpath',
|
|
224
|
-
expression: '
|
|
213
|
+
expression: "item.where(linkId='smoking-status-initial-expression').answer.value"
|
|
225
214
|
}
|
|
226
215
|
}
|
|
227
216
|
],
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
repeats: false,
|
|
232
|
-
answerValueSet: 'http://hl7.org/fhir/ValueSet/administrative-gender'
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
extension: [
|
|
217
|
+
text: '',
|
|
218
|
+
type: 'group',
|
|
219
|
+
item: [
|
|
236
220
|
{
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
221
|
+
linkId: 'display-description',
|
|
222
|
+
extension: [
|
|
223
|
+
{
|
|
224
|
+
url: 'http://hl7.org/fhir/StructureDefinition/rendering-xhtml',
|
|
225
|
+
valueString:
|
|
226
|
+
'<div xmlns="http://www.w3.org/1999/xhtml">\r\n <div style="font-size:0.875em"> This questionnaire is used by Playwright to do regression testing of the <pre style="display: inline">@aehrc/sdc-populate</pre> library\'s pre-population logic. Items will be incrementally added as needed.</div><br/></div>'
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
text: "This questionnaire is used by Playwright to do regression testing of the @aehrc/sdc-populate library's pre-population logic. Items will be incrementally added as needed.",
|
|
230
|
+
type: 'display',
|
|
231
|
+
repeats: false
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
extension: [
|
|
235
|
+
{
|
|
236
|
+
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression',
|
|
237
|
+
valueExpression: {
|
|
238
|
+
language: 'text/fhirpath',
|
|
239
|
+
expression: '%patient.gender'
|
|
243
240
|
}
|
|
244
|
-
|
|
245
|
-
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
linkId: 'gender-avs-url',
|
|
244
|
+
text: 'Administrative gender (answerValueSet url)',
|
|
245
|
+
type: 'choice',
|
|
246
|
+
repeats: false,
|
|
247
|
+
answerValueSet: 'http://hl7.org/fhir/ValueSet/administrative-gender'
|
|
246
248
|
},
|
|
247
249
|
{
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
250
|
+
extension: [
|
|
251
|
+
{
|
|
252
|
+
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression',
|
|
253
|
+
valueExpression: {
|
|
254
|
+
language: 'text/fhirpath',
|
|
255
|
+
expression: '%patient.gender'
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
],
|
|
259
|
+
linkId: 'gender-avs-contained',
|
|
260
|
+
text: 'Administrative gender (answerValueSet contained)',
|
|
261
|
+
type: 'choice',
|
|
262
|
+
repeats: false,
|
|
263
|
+
answerValueSet: 'http://hl7.org/fhir/ValueSet/administrative-gender'
|
|
264
|
+
},
|
|
262
265
|
{
|
|
263
266
|
extension: [
|
|
267
|
+
{
|
|
268
|
+
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression',
|
|
269
|
+
valueExpression: {
|
|
270
|
+
language: 'text/fhirpath',
|
|
271
|
+
expression:
|
|
272
|
+
"%patient.extension.where(exists(url='http://hl7.org/fhir/StructureDefinition/individual-recordedSexOrGender' and extension.where(exists(url='type' and value.coding.code='1515311000168102')) and extension.where(url='effectivePeriod').value.end.empty())).extension.where(url='value').value.coding"
|
|
273
|
+
}
|
|
274
|
+
},
|
|
264
275
|
{
|
|
265
276
|
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
|
|
266
277
|
valueCodeableConcept: {
|
|
267
278
|
coding: [
|
|
268
279
|
{
|
|
269
280
|
system: 'http://hl7.org/fhir/questionnaire-item-control',
|
|
270
|
-
code: '
|
|
281
|
+
code: 'drop-down'
|
|
271
282
|
}
|
|
272
283
|
]
|
|
273
284
|
}
|
|
274
|
-
}
|
|
285
|
+
}
|
|
286
|
+
],
|
|
287
|
+
linkId: 'sex-at-birth-initial-expression',
|
|
288
|
+
text: 'Sex assigned at birth (initialExpression)',
|
|
289
|
+
type: 'choice',
|
|
290
|
+
repeats: false,
|
|
291
|
+
answerValueSet: 'https://healthterminologies.gov.au/fhir/ValueSet/biological-sex-1'
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
extension: [
|
|
295
|
+
{
|
|
296
|
+
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression',
|
|
297
|
+
valueExpression: {
|
|
298
|
+
description: 'Calculated Sex At Birth',
|
|
299
|
+
language: 'text/fhirpath',
|
|
300
|
+
expression: '%sex'
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
],
|
|
304
|
+
linkId: 'sex-at-birth-calculated',
|
|
305
|
+
text: 'Sex assigned at birth (calculatedExpression)',
|
|
306
|
+
type: 'choice',
|
|
307
|
+
repeats: false,
|
|
308
|
+
readOnly: true,
|
|
309
|
+
answerValueSet: 'https://healthterminologies.gov.au/fhir/ValueSet/biological-sex-1'
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
extension: [
|
|
275
313
|
{
|
|
276
314
|
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression',
|
|
277
315
|
valueExpression: {
|
|
278
316
|
language: 'text/fhirpath',
|
|
279
317
|
expression:
|
|
280
|
-
"%
|
|
318
|
+
"%ObsTobaccoSmokingStatus.entry.resource.value.coding.where(system='http://snomed.info/sct')"
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
|
|
323
|
+
valueCodeableConcept: {
|
|
324
|
+
coding: [
|
|
325
|
+
{
|
|
326
|
+
system: 'http://hl7.org/fhir/questionnaire-item-control',
|
|
327
|
+
code: 'radio-button'
|
|
328
|
+
}
|
|
329
|
+
]
|
|
281
330
|
}
|
|
282
331
|
}
|
|
283
332
|
],
|
|
284
|
-
linkId: '
|
|
285
|
-
text: '
|
|
286
|
-
type: '
|
|
287
|
-
|
|
333
|
+
linkId: 'smoking-status-initial-expression',
|
|
334
|
+
text: 'Smoking status (initialExpression)',
|
|
335
|
+
type: 'choice',
|
|
336
|
+
repeats: false,
|
|
337
|
+
answerOption: [
|
|
338
|
+
{
|
|
339
|
+
valueCoding: {
|
|
340
|
+
system: 'http://snomed.info/sct',
|
|
341
|
+
code: '266919005',
|
|
342
|
+
display: 'Never smoked'
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
valueCoding: {
|
|
347
|
+
system: 'http://snomed.info/sct',
|
|
348
|
+
code: '77176002',
|
|
349
|
+
display: 'Smoker'
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
valueCoding: {
|
|
354
|
+
system: 'http://snomed.info/sct',
|
|
355
|
+
code: '8517006',
|
|
356
|
+
display: 'Ex-smoker'
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
valueCoding: {
|
|
361
|
+
system: 'http://snomed.info/sct',
|
|
362
|
+
code: '16090371000119103',
|
|
363
|
+
display: 'Exposure to second hand tobacco smoke'
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
valueString: 'Wants to quit'
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
valueString: 'Other tobacco use'
|
|
371
|
+
}
|
|
372
|
+
]
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
extension: [
|
|
376
|
+
{
|
|
377
|
+
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression',
|
|
378
|
+
valueExpression: {
|
|
379
|
+
description: 'Calculated Smoking Status',
|
|
380
|
+
language: 'text/fhirpath',
|
|
381
|
+
expression: '%smoker'
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
],
|
|
385
|
+
linkId: 'smoking-status-calculated',
|
|
386
|
+
text: 'Smoking status (calculatedExpression)',
|
|
387
|
+
type: 'choice',
|
|
388
|
+
repeats: false,
|
|
389
|
+
readOnly: true,
|
|
390
|
+
answerOption: [
|
|
391
|
+
{
|
|
392
|
+
valueCoding: {
|
|
393
|
+
system: 'http://snomed.info/sct',
|
|
394
|
+
code: '266919005',
|
|
395
|
+
display: 'Never smoked'
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
valueCoding: {
|
|
400
|
+
system: 'http://snomed.info/sct',
|
|
401
|
+
code: '77176002',
|
|
402
|
+
display: 'Smoker'
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
valueCoding: {
|
|
407
|
+
system: 'http://snomed.info/sct',
|
|
408
|
+
code: '8517006',
|
|
409
|
+
display: 'Ex-smoker'
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
valueCoding: {
|
|
414
|
+
system: 'http://snomed.info/sct',
|
|
415
|
+
code: '16090371000119103',
|
|
416
|
+
display: 'Exposure to second hand tobacco smoke'
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
valueString: 'Wants to quit'
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
valueString: 'Other tobacco use'
|
|
424
|
+
}
|
|
425
|
+
]
|
|
288
426
|
},
|
|
289
427
|
{
|
|
290
428
|
extension: [
|
|
@@ -294,23 +432,80 @@ export const qSelectivePrePopTester: Questionnaire = {
|
|
|
294
432
|
coding: [
|
|
295
433
|
{
|
|
296
434
|
system: 'http://hl7.org/fhir/questionnaire-item-control',
|
|
297
|
-
code: '
|
|
435
|
+
code: 'gtable'
|
|
298
436
|
}
|
|
299
437
|
]
|
|
300
438
|
}
|
|
301
439
|
},
|
|
302
440
|
{
|
|
303
|
-
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-
|
|
441
|
+
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemPopulationContext',
|
|
304
442
|
valueExpression: {
|
|
443
|
+
name: 'ConditionRepeat',
|
|
305
444
|
language: 'text/fhirpath',
|
|
306
|
-
expression:
|
|
445
|
+
expression:
|
|
446
|
+
"%Condition.entry.resource.where(category.coding.exists(code='problem-list-item'))"
|
|
307
447
|
}
|
|
308
448
|
}
|
|
309
449
|
],
|
|
310
|
-
linkId: 'medical-history
|
|
311
|
-
text: '
|
|
312
|
-
type: '
|
|
313
|
-
|
|
450
|
+
linkId: 'medical-history',
|
|
451
|
+
text: 'Medical history and current problems list',
|
|
452
|
+
type: 'group',
|
|
453
|
+
repeats: true,
|
|
454
|
+
item: [
|
|
455
|
+
{
|
|
456
|
+
extension: [
|
|
457
|
+
{
|
|
458
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
|
|
459
|
+
valueCodeableConcept: {
|
|
460
|
+
coding: [
|
|
461
|
+
{
|
|
462
|
+
system: 'http://hl7.org/fhir/questionnaire-item-control',
|
|
463
|
+
code: 'autocomplete'
|
|
464
|
+
}
|
|
465
|
+
]
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression',
|
|
470
|
+
valueExpression: {
|
|
471
|
+
language: 'text/fhirpath',
|
|
472
|
+
expression:
|
|
473
|
+
"%ConditionRepeat.code.select((coding.where(system='http://snomed.info/sct') | coding.where(system!='http://snomed.info/sct').first() | text ).first())"
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
],
|
|
477
|
+
linkId: 'medical-history-condition',
|
|
478
|
+
text: 'Condition',
|
|
479
|
+
type: 'open-choice',
|
|
480
|
+
answerValueSet: '#MedicalHistory'
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
extension: [
|
|
484
|
+
{
|
|
485
|
+
url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
|
|
486
|
+
valueCodeableConcept: {
|
|
487
|
+
coding: [
|
|
488
|
+
{
|
|
489
|
+
system: 'http://hl7.org/fhir/questionnaire-item-control',
|
|
490
|
+
code: 'drop-down'
|
|
491
|
+
}
|
|
492
|
+
]
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression',
|
|
497
|
+
valueExpression: {
|
|
498
|
+
language: 'text/fhirpath',
|
|
499
|
+
expression: '%ConditionRepeat.clinicalStatus.coding'
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
],
|
|
503
|
+
linkId: 'medical-history-status',
|
|
504
|
+
text: 'Clinical Status',
|
|
505
|
+
type: 'choice',
|
|
506
|
+
answerValueSet: 'http://hl7.org/fhir/ValueSet/condition-clinical'
|
|
507
|
+
}
|
|
508
|
+
]
|
|
314
509
|
}
|
|
315
510
|
]
|
|
316
511
|
}
|
|
@@ -21,7 +21,10 @@ import {
|
|
|
21
21
|
qItemControlDisplayTabContainer,
|
|
22
22
|
qItemControlGroupGridMultiRow,
|
|
23
23
|
qItemControlGroupGridSingleRow,
|
|
24
|
-
qItemControlGroupGTable
|
|
24
|
+
qItemControlGroupGTable,
|
|
25
|
+
qItemControlGroupPage,
|
|
26
|
+
qItemControlGroupPageContainer,
|
|
27
|
+
qItemControlGroupPageNonTopLevelPageContainer
|
|
25
28
|
} from '../assets/questionnaires';
|
|
26
29
|
|
|
27
30
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
@@ -60,3 +63,21 @@ export const TabContainer: Story = {
|
|
|
60
63
|
questionnaire: qItemControlDisplayTabContainer
|
|
61
64
|
}
|
|
62
65
|
};
|
|
66
|
+
|
|
67
|
+
export const Page: Story = {
|
|
68
|
+
args: {
|
|
69
|
+
questionnaire: qItemControlGroupPage
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const PageContainer: Story = {
|
|
74
|
+
args: {
|
|
75
|
+
questionnaire: qItemControlGroupPageContainer
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const PageContainerNonSingleTopLevel: Story = {
|
|
80
|
+
args: {
|
|
81
|
+
questionnaire: qItemControlGroupPageNonTopLevelPageContainer
|
|
82
|
+
}
|
|
83
|
+
};
|
|
@@ -0,0 +1,196 @@
|
|
|
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 { Meta, StoryObj } from '@storybook/react';
|
|
19
|
+
import PrePopWrapperForStorybook from '../storybookWrappers/PrePopWrapperForStorybook';
|
|
20
|
+
import { mockFhirClient } from '../assets/fhirClient/mockFhirClient';
|
|
21
|
+
import { patSmartForm } from '../assets/patients/PatSmartForm';
|
|
22
|
+
import { pracPrimaryPeter } from '../assets/practitioners/PracPrimaryPeter';
|
|
23
|
+
import {
|
|
24
|
+
QAuCoreAllergyIntolerance,
|
|
25
|
+
QAuCoreCondition,
|
|
26
|
+
QAuCoreEncounter,
|
|
27
|
+
QAuCoreImmunization,
|
|
28
|
+
QAuCoreMedicationRequest,
|
|
29
|
+
QAuCoreObservationBodyHeight,
|
|
30
|
+
QAuCoreObservationBodyWeight,
|
|
31
|
+
QAuCoreObservationBP,
|
|
32
|
+
QAuCoreObservationHeartRate,
|
|
33
|
+
QAuCoreObservationRespirationRate,
|
|
34
|
+
QAuCoreObservationSmokingStatus,
|
|
35
|
+
QAuCoreObservationWaistCircumference,
|
|
36
|
+
QAuCorePatient,
|
|
37
|
+
QAuCorePractitioner,
|
|
38
|
+
QAuCorePractitionerRole,
|
|
39
|
+
QAuCoreProcedure
|
|
40
|
+
} from '../assets/questionnaires/QAuCoreTesting';
|
|
41
|
+
|
|
42
|
+
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
43
|
+
const meta = {
|
|
44
|
+
title: 'Component/Testing/AU Core Tester',
|
|
45
|
+
component: PrePopWrapperForStorybook,
|
|
46
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
47
|
+
tags: []
|
|
48
|
+
} satisfies Meta<typeof PrePopWrapperForStorybook>;
|
|
49
|
+
|
|
50
|
+
export default meta;
|
|
51
|
+
type Story = StoryObj<typeof meta>;
|
|
52
|
+
|
|
53
|
+
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
54
|
+
|
|
55
|
+
export const AuCoreAllergyIntolerance: Story = {
|
|
56
|
+
args: {
|
|
57
|
+
questionnaire: QAuCoreAllergyIntolerance,
|
|
58
|
+
fhirClient: mockFhirClient,
|
|
59
|
+
patient: patSmartForm,
|
|
60
|
+
user: pracPrimaryPeter
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const AuCoreCondition: Story = {
|
|
65
|
+
args: {
|
|
66
|
+
questionnaire: QAuCoreCondition,
|
|
67
|
+
fhirClient: mockFhirClient,
|
|
68
|
+
patient: patSmartForm,
|
|
69
|
+
user: pracPrimaryPeter
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const AuCoreEncounter: Story = {
|
|
74
|
+
args: {
|
|
75
|
+
questionnaire: QAuCoreEncounter,
|
|
76
|
+
fhirClient: mockFhirClient,
|
|
77
|
+
patient: patSmartForm,
|
|
78
|
+
user: pracPrimaryPeter
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const AuCoreImmunization: Story = {
|
|
83
|
+
args: {
|
|
84
|
+
questionnaire: QAuCoreImmunization,
|
|
85
|
+
fhirClient: mockFhirClient,
|
|
86
|
+
patient: patSmartForm,
|
|
87
|
+
user: pracPrimaryPeter
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export const AuCoreMedicationRequest: Story = {
|
|
92
|
+
args: {
|
|
93
|
+
questionnaire: QAuCoreMedicationRequest,
|
|
94
|
+
fhirClient: mockFhirClient,
|
|
95
|
+
patient: patSmartForm,
|
|
96
|
+
user: pracPrimaryPeter
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export const AuCorePatient: Story = {
|
|
101
|
+
args: {
|
|
102
|
+
questionnaire: QAuCorePatient,
|
|
103
|
+
fhirClient: mockFhirClient,
|
|
104
|
+
patient: patSmartForm,
|
|
105
|
+
user: pracPrimaryPeter
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const AuCorePractitioner: Story = {
|
|
110
|
+
args: {
|
|
111
|
+
questionnaire: QAuCorePractitioner,
|
|
112
|
+
fhirClient: mockFhirClient,
|
|
113
|
+
patient: patSmartForm,
|
|
114
|
+
user: pracPrimaryPeter
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const AuCorePractitionerRole: Story = {
|
|
119
|
+
args: {
|
|
120
|
+
questionnaire: QAuCorePractitionerRole,
|
|
121
|
+
fhirClient: mockFhirClient,
|
|
122
|
+
patient: patSmartForm,
|
|
123
|
+
user: pracPrimaryPeter
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export const AuCoreProcedure: Story = {
|
|
128
|
+
args: {
|
|
129
|
+
questionnaire: QAuCoreProcedure,
|
|
130
|
+
fhirClient: mockFhirClient,
|
|
131
|
+
patient: patSmartForm,
|
|
132
|
+
user: pracPrimaryPeter
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const AuCoreObservationBP: Story = {
|
|
137
|
+
args: {
|
|
138
|
+
questionnaire: QAuCoreObservationBP,
|
|
139
|
+
fhirClient: mockFhirClient,
|
|
140
|
+
patient: patSmartForm,
|
|
141
|
+
user: pracPrimaryPeter
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export const AuCoreObservationBodyHeight: Story = {
|
|
146
|
+
args: {
|
|
147
|
+
questionnaire: QAuCoreObservationBodyHeight,
|
|
148
|
+
fhirClient: mockFhirClient,
|
|
149
|
+
patient: patSmartForm,
|
|
150
|
+
user: pracPrimaryPeter
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export const AuCoreObservationBodyWeight: Story = {
|
|
155
|
+
args: {
|
|
156
|
+
questionnaire: QAuCoreObservationBodyWeight,
|
|
157
|
+
fhirClient: mockFhirClient,
|
|
158
|
+
patient: patSmartForm,
|
|
159
|
+
user: pracPrimaryPeter
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export const AuCoreObservationHeartRate: Story = {
|
|
164
|
+
args: {
|
|
165
|
+
questionnaire: QAuCoreObservationHeartRate,
|
|
166
|
+
fhirClient: mockFhirClient,
|
|
167
|
+
patient: patSmartForm,
|
|
168
|
+
user: pracPrimaryPeter
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
export const AuCoreObservationRespirationRate: Story = {
|
|
172
|
+
args: {
|
|
173
|
+
questionnaire: QAuCoreObservationRespirationRate,
|
|
174
|
+
fhirClient: mockFhirClient,
|
|
175
|
+
patient: patSmartForm,
|
|
176
|
+
user: pracPrimaryPeter
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
export const AuCoreObservationSmokingStatus: Story = {
|
|
181
|
+
args: {
|
|
182
|
+
questionnaire: QAuCoreObservationSmokingStatus,
|
|
183
|
+
fhirClient: mockFhirClient,
|
|
184
|
+
patient: patSmartForm,
|
|
185
|
+
user: pracPrimaryPeter
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export const AuCoreObservationWaistCircumference: Story = {
|
|
190
|
+
args: {
|
|
191
|
+
questionnaire: QAuCoreObservationWaistCircumference,
|
|
192
|
+
fhirClient: mockFhirClient,
|
|
193
|
+
patient: patSmartForm,
|
|
194
|
+
user: pracPrimaryPeter
|
|
195
|
+
}
|
|
196
|
+
};
|
|
@@ -224,7 +224,7 @@ function initialiseItemCalculatedExpressionValueRecursive(
|
|
|
224
224
|
updateQrItemsInGroup(
|
|
225
225
|
updatedChildQRItem,
|
|
226
226
|
null,
|
|
227
|
-
|
|
227
|
+
qrItem ?? { linkId: qItem.linkId, text: qItem.text, item: [] },
|
|
228
228
|
indexMap
|
|
229
229
|
);
|
|
230
230
|
}
|
package/src/utils/fhirpath.ts
CHANGED
|
@@ -101,11 +101,6 @@ export function createFhirPathContext(
|
|
|
101
101
|
rootResource: questionnaireResponse
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
// Exit early if there are no QR items
|
|
105
|
-
if (!questionnaireResponse.item) {
|
|
106
|
-
return fhirPathContext;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
104
|
// Evaluate resource-level variables
|
|
110
105
|
fhirPathContext = evaluateQuestionnaireLevelVariables(
|
|
111
106
|
questionnaireResponse,
|