@aehrc/smart-forms-renderer 1.0.0-alpha.42.dev2 → 1.0.0-alpha.42.dev3

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 (114) hide show
  1. package/package.json +1 -1
  2. package/.storybook/main.ts +0 -34
  3. package/.storybook/preview.tsx +0 -40
  4. package/src/stories/assets/fhirClient/mockFhirClient.ts +0 -52
  5. package/src/stories/assets/patients/PatSmartForm.ts +0 -281
  6. package/src/stories/assets/practitioners/PracPrimaryPeter.ts +0 -38
  7. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreAllergyIntolerance.json +0 -209
  8. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreCondition.json +0 -220
  9. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreEncounter.json +0 -299
  10. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreImmunization.json +0 -175
  11. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreMedicationRequest.json +0 -229
  12. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationBP.json +0 -359
  13. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationBodyHeight.json +0 -195
  14. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationBodyWeight.json +0 -195
  15. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationHeartRate.json +0 -195
  16. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreObservationSmokingStatus.json +0 -174
  17. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCorePatient.json +0 -495
  18. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCorePractitioner.json +0 -139
  19. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCorePractitionerRole.json +0 -216
  20. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreProcedure.json +0 -199
  21. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreRespirationRate.json +0 -195
  22. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreWaistCircumference.json +0 -195
  23. package/src/stories/assets/questionnaires/QAdvancedAdditionalDisplayContent.ts +0 -113
  24. package/src/stories/assets/questionnaires/QAdvancedControlAppearance.ts +0 -865
  25. package/src/stories/assets/questionnaires/QAdvancedOther.ts +0 -494
  26. package/src/stories/assets/questionnaires/QAdvancedTextApperance.ts +0 -503
  27. package/src/stories/assets/questionnaires/QAttachment.ts +0 -38
  28. package/src/stories/assets/questionnaires/QAuCoreTesting.ts +0 -3796
  29. package/src/stories/assets/questionnaires/QBehaviorCalculations.ts +0 -643
  30. package/src/stories/assets/questionnaires/QBehaviorChoiceRestriction.ts +0 -281
  31. package/src/stories/assets/questionnaires/QBehaviorOther.ts +0 -1241
  32. package/src/stories/assets/questionnaires/QBehaviorValueConstraints.ts +0 -508
  33. package/src/stories/assets/questionnaires/QBoolean.ts +0 -180
  34. package/src/stories/assets/questionnaires/QButtonTester.ts +0 -497
  35. package/src/stories/assets/questionnaires/QChoice.ts +0 -493
  36. package/src/stories/assets/questionnaires/QDate.ts +0 -56
  37. package/src/stories/assets/questionnaires/QDateTime.ts +0 -56
  38. package/src/stories/assets/questionnaires/QDecimal.ts +0 -56
  39. package/src/stories/assets/questionnaires/QDisplay.ts +0 -197
  40. package/src/stories/assets/questionnaires/QFormPopulation.ts +0 -1349
  41. package/src/stories/assets/questionnaires/QGroup.ts +0 -52
  42. package/src/stories/assets/questionnaires/QGroupTableTester.ts +0 -461
  43. package/src/stories/assets/questionnaires/QIdRemoverDebugger.ts +0 -161
  44. package/src/stories/assets/questionnaires/QInteger.ts +0 -119
  45. package/src/stories/assets/questionnaires/QItemControlDisplay.ts +0 -558
  46. package/src/stories/assets/questionnaires/QItemControlGroup.ts +0 -1530
  47. package/src/stories/assets/questionnaires/QItemControlQuestion.ts +0 -1271
  48. package/src/stories/assets/questionnaires/QMbs715Tester.ts +0 -32888
  49. package/src/stories/assets/questionnaires/QOpenChoice.ts +0 -151
  50. package/src/stories/assets/questionnaires/QParameterisedValueSets.ts +0 -312
  51. package/src/stories/assets/questionnaires/QPrePopTester.ts +0 -543
  52. package/src/stories/assets/questionnaires/QQuantity.ts +0 -365
  53. package/src/stories/assets/questionnaires/QReference.ts +0 -38
  54. package/src/stories/assets/questionnaires/QSingleItems.ts +0 -251
  55. package/src/stories/assets/questionnaires/QString.ts +0 -131
  56. package/src/stories/assets/questionnaires/QTerminologyControl.ts +0 -59
  57. package/src/stories/assets/questionnaires/QText.ts +0 -169
  58. package/src/stories/assets/questionnaires/QTime.ts +0 -38
  59. package/src/stories/assets/questionnaires/QUrl.ts +0 -38
  60. package/src/stories/assets/questionnaires/QValidateTester.ts +0 -118
  61. package/src/stories/assets/questionnaires/index.ts +0 -43
  62. package/src/stories/itemTypes/Attachment.stories.tsx +0 -39
  63. package/src/stories/itemTypes/Boolean.stories.tsx +0 -65
  64. package/src/stories/itemTypes/Choice.stories.tsx +0 -78
  65. package/src/stories/itemTypes/Date.stories.tsx +0 -46
  66. package/src/stories/itemTypes/DateTime.stories.tsx +0 -45
  67. package/src/stories/itemTypes/Decimal.stories.tsx +0 -56
  68. package/src/stories/itemTypes/Display.stories.tsx +0 -55
  69. package/src/stories/itemTypes/Group.stories.tsx +0 -39
  70. package/src/stories/itemTypes/Integer.stories.tsx +0 -55
  71. package/src/stories/itemTypes/OpenChoice.stories.tsx +0 -64
  72. package/src/stories/itemTypes/Quantity.stories.tsx +0 -71
  73. package/src/stories/itemTypes/Reference.stories.tsx +0 -39
  74. package/src/stories/itemTypes/String.stories.tsx +0 -51
  75. package/src/stories/itemTypes/Text.stories.tsx +0 -51
  76. package/src/stories/itemTypes/Time.stories.tsx +0 -39
  77. package/src/stories/itemTypes/Url.stories.tsx +0 -39
  78. package/src/stories/sdc/AdvancedAdditionalDisplayContent.stories.tsx +0 -51
  79. package/src/stories/sdc/AdvancedControlAppearance.stories.tsx +0 -90
  80. package/src/stories/sdc/AdvancedOther.stories.tsx +0 -76
  81. package/src/stories/sdc/AdvancedTextAppearance.stories.tsx +0 -104
  82. package/src/stories/sdc/BehaviorCalculations.stories.tsx +0 -69
  83. package/src/stories/sdc/BehaviorChoiceRestriction.stories.tsx +0 -76
  84. package/src/stories/sdc/BehaviorOther.stories.tsx +0 -97
  85. package/src/stories/sdc/BehaviorValueConstraints.stories.tsx +0 -88
  86. package/src/stories/sdc/FormPopulation.stories.tsx +0 -97
  87. package/src/stories/sdc/ItemControlDisplay.stories.tsx +0 -69
  88. package/src/stories/sdc/ItemControlGroup.stories.tsx +0 -90
  89. package/src/stories/sdc/ItemControlQuestion.stories.tsx +0 -118
  90. package/src/stories/sdc/OtherExtensions.stories.tsx +0 -39
  91. package/src/stories/sdc/ParameterisedValueSets.stories.tsx +0 -48
  92. package/src/stories/storybookWrappers/BuildFormButtonForStorybook.tsx +0 -54
  93. package/src/stories/storybookWrappers/BuildFormButtonTesterWrapperForStorybook.tsx +0 -76
  94. package/src/stories/storybookWrappers/BuildFormWrapperForStorybook.tsx +0 -61
  95. package/src/stories/storybookWrappers/FormValidationTesterWrapperForStorybook.tsx +0 -70
  96. package/src/stories/storybookWrappers/FormValidationViewerForStorybook.tsx +0 -28
  97. package/src/stories/storybookWrappers/IdRemoverButtonForStorybook.tsx +0 -49
  98. package/src/stories/storybookWrappers/IdRemoverDebuggerWrapperForStorybook.tsx +0 -84
  99. package/src/stories/storybookWrappers/InitialiseFormWrapperForStorybook.tsx +0 -105
  100. package/src/stories/storybookWrappers/PrePopButtonForStorybook.tsx +0 -56
  101. package/src/stories/storybookWrappers/PrePopWrapperForStorybook.tsx +0 -114
  102. package/src/stories/storybookWrappers/TestCssSheet.css +0 -17
  103. package/src/stories/storybookWrappers/ValidateFormButtonForStorybook.tsx +0 -41
  104. package/src/stories/storybookWrappers/globals.ts +0 -18
  105. package/src/stories/storybookWrappers/iframeResizerChild.js +0 -1063
  106. package/src/stories/storybookWrappers/index.ts +0 -19
  107. package/src/stories/storybookWrappers/populateCallbackForStorybook.ts +0 -55
  108. package/src/stories/testing/AuCoreTester.stories.tsx +0 -196
  109. package/src/stories/testing/BuildFormButtonTesterWrapper.stories.tsx +0 -40
  110. package/src/stories/testing/GroupTableTester.stories.tsx +0 -39
  111. package/src/stories/testing/IdRemoverDebuggerWrapper.stories.tsx +0 -39
  112. package/src/stories/testing/Mbs715Tester.stories.tsx +0 -57
  113. package/src/stories/testing/PrePopButtonTesterWrapper.stories.tsx +0 -55
  114. package/src/stories/testing/ValidateFormTesterWrapper.stories.tsx +0 -39
@@ -1,508 +0,0 @@
1
- /*
2
- * Copyright 2024 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
-
18
- import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
19
-
20
- // TODO Add docs on validation is exposed as operationOutcomes
21
-
22
- // MaxLength
23
- export const qMaxLength: Questionnaire = {
24
- resourceType: 'Questionnaire',
25
- id: 'MaxLength',
26
- name: 'MaxLength',
27
- title: 'Max Length',
28
- version: '0.1.0',
29
- status: 'draft',
30
- publisher: 'AEHRC CSIRO',
31
- date: '2024-05-01',
32
- url: 'https://smartforms.csiro.au/docs/behavior/value-constraints/max-length',
33
- item: [
34
- {
35
- linkId: 'pensioner-card-number-empty',
36
- text: 'Pensioner Card Number (empty)',
37
- type: 'string',
38
- repeats: false,
39
- maxLength: 10
40
- },
41
- {
42
- linkId: 'pensioner-card-number-filled',
43
- text: 'Pensioner Card Number (filled)',
44
- type: 'string',
45
- repeats: false,
46
- maxLength: 10
47
- },
48
- {
49
- linkId: 'pensioner-card-number-feedback',
50
- text: 'Pensioner Card Number (with feedback)',
51
- type: 'string',
52
- repeats: false,
53
- maxLength: 10
54
- }
55
- ]
56
- };
57
-
58
- export const qrMaxLength: QuestionnaireResponse = {
59
- resourceType: 'QuestionnaireResponse',
60
- status: 'in-progress',
61
- item: [
62
- {
63
- linkId: 'pensioner-card-number-filled',
64
- text: 'Pensioner Card Number (filled)',
65
- answer: [
66
- {
67
- valueString: '111111111A'
68
- }
69
- ]
70
- },
71
- {
72
- linkId: 'pensioner-card-number-feedback',
73
- text: 'Pensioner Card Number (with feedback)',
74
- answer: [
75
- {
76
- valueString: '111111111AA'
77
- }
78
- ]
79
- }
80
- ],
81
- questionnaire: 'https://smartforms.csiro.au/docs/validation/maxLength|0.1.0'
82
- };
83
-
84
- // MinLength
85
- export const qMinLength: Questionnaire = {
86
- resourceType: 'Questionnaire',
87
- id: 'MinLength',
88
- name: 'MinLength',
89
- title: 'Min Length',
90
- version: '0.1.0',
91
- status: 'draft',
92
- publisher: 'AEHRC CSIRO',
93
- date: '2024-05-01',
94
- url: 'https://smartforms.csiro.au/docs/behavior/value-constraints/min-length',
95
- item: [
96
- {
97
- extension: [
98
- {
99
- url: 'http://hl7.org/fhir/StructureDefinition/minLength',
100
- valueInteger: 10
101
- }
102
- ],
103
- linkId: 'phone-empty',
104
- text: 'Phone/mobile number (empty)',
105
- type: 'string',
106
- repeats: false
107
- },
108
- {
109
- extension: [
110
- {
111
- url: 'http://hl7.org/fhir/StructureDefinition/minLength',
112
- valueInteger: 10
113
- }
114
- ],
115
- linkId: 'phone-filled',
116
- text: 'Phone/mobile (filled)',
117
- type: 'string',
118
- repeats: false
119
- },
120
- {
121
- extension: [
122
- {
123
- url: 'http://hl7.org/fhir/StructureDefinition/minLength',
124
- valueInteger: 10
125
- }
126
- ],
127
- linkId: 'phone-feedback',
128
- text: 'Phone/mobile (with feedback)',
129
- type: 'string',
130
- repeats: false
131
- }
132
- ]
133
- };
134
-
135
- export const qrMinLength: QuestionnaireResponse = {
136
- resourceType: 'QuestionnaireResponse',
137
- status: 'in-progress',
138
- item: [
139
- {
140
- linkId: 'phone-filled',
141
- text: 'Phone/mobile number (filled)',
142
- answer: [
143
- {
144
- valueString: '0112345678'
145
- }
146
- ]
147
- },
148
- {
149
- linkId: 'phone-feedback',
150
- text: 'Phone/mobile number (with feedback)',
151
- answer: [
152
- {
153
- valueString: '0112345'
154
- }
155
- ]
156
- }
157
- ],
158
- questionnaire: 'https://smartforms.csiro.au/docs/behavior/value-constraints/min-length|0.1.0'
159
- };
160
-
161
- // Regex
162
- export const qRegex: Questionnaire = {
163
- resourceType: 'Questionnaire',
164
- id: 'Regex',
165
- name: 'Regex',
166
- title: 'Regex',
167
- version: '0.1.0',
168
- status: 'draft',
169
- publisher: 'AEHRC CSIRO',
170
- date: '2024-05-01',
171
- url: 'https://smartforms.csiro.au/docs/behavior/value-constraints/regex',
172
- item: [
173
- {
174
- extension: [
175
- {
176
- url: 'http://hl7.org/fhir/StructureDefinition/regex',
177
- valueString: "matches('^[0-9]{4}$')"
178
- },
179
- {
180
- url: 'http://hl7.org/fhir/StructureDefinition/entryFormat',
181
- valueString: '####'
182
- }
183
- ],
184
- linkId: 'postcode-au-empty',
185
- definition: 'http://hl7.org.au/fhir/StructureDefinition/au-address#Address.postalCode',
186
- text: 'Postcode (empty)',
187
- type: 'string',
188
- repeats: false
189
- },
190
- {
191
- extension: [
192
- {
193
- url: 'http://hl7.org/fhir/StructureDefinition/regex',
194
- valueString: "matches('^[0-9]{4}$')"
195
- },
196
- {
197
- url: 'http://hl7.org/fhir/StructureDefinition/entryFormat',
198
- valueString: '####'
199
- }
200
- ],
201
- linkId: 'postcode-au-filled',
202
- definition: 'http://hl7.org.au/fhir/StructureDefinition/au-address#Address.postalCode',
203
- text: 'Postcode (filled)',
204
- type: 'string',
205
- repeats: false
206
- },
207
- {
208
- extension: [
209
- {
210
- url: 'http://hl7.org/fhir/StructureDefinition/regex',
211
- valueString: "matches('^[0-9]{4}$')"
212
- },
213
- {
214
- url: 'http://hl7.org/fhir/StructureDefinition/entryFormat',
215
- valueString: '####'
216
- }
217
- ],
218
- linkId: 'postcode-au-feedback',
219
- definition: 'http://hl7.org.au/fhir/StructureDefinition/au-address#Address.postalCode',
220
- text: 'Postcode (with feedback)',
221
- type: 'string',
222
- repeats: false
223
- }
224
- ]
225
- };
226
-
227
- export const qrRegex: QuestionnaireResponse = {
228
- resourceType: 'QuestionnaireResponse',
229
- status: 'in-progress',
230
- item: [
231
- {
232
- linkId: 'postcode-au-filled',
233
- text: 'Postcode (filled)',
234
- answer: [
235
- {
236
- valueString: '2000'
237
- }
238
- ]
239
- },
240
- {
241
- linkId: 'postcode-au-feedback',
242
- text: 'Postcode (with feedback)',
243
- answer: [
244
- {
245
- valueString: '20000'
246
- }
247
- ]
248
- }
249
- ],
250
- questionnaire: 'https://smartforms.csiro.au/docs/behavior/value-constraints/regex|0.1.0'
251
- };
252
-
253
- // MinValue
254
- // TODO need to add more examples question (where type='date', 'dateTime', 'time', 'decimal', 'integer')
255
- export const qMinValue: Questionnaire = {
256
- resourceType: 'Questionnaire',
257
- id: 'MinValue',
258
- name: 'MinValue',
259
- title: 'Min Value',
260
- version: '0.1.0',
261
- status: 'draft',
262
- publisher: 'AEHRC CSIRO',
263
- date: '2024-05-01',
264
- url: 'https://smartforms.csiro.au/docs/behavior/value-constraints/min-value',
265
- item: [
266
- {
267
- extension: [
268
- {
269
- url: 'http://hl7.org/fhir/StructureDefinition/minValue',
270
- valueInteger: 18
271
- }
272
- ],
273
- linkId: 'age-empty',
274
- text: 'Age (>=18) (empty)',
275
- type: 'integer',
276
- repeats: false
277
- },
278
- {
279
- extension: [
280
- {
281
- url: 'http://hl7.org/fhir/StructureDefinition/minValue',
282
- valueInteger: 18
283
- }
284
- ],
285
- linkId: 'age-filled',
286
- text: 'Age (>=18) (filled)',
287
- type: 'integer',
288
- repeats: false
289
- },
290
- {
291
- extension: [
292
- {
293
- url: 'http://hl7.org/fhir/StructureDefinition/minValue',
294
- valueInteger: 18
295
- }
296
- ],
297
- linkId: 'age-feedback',
298
- text: 'Age (>=18) (with feedback)',
299
- type: 'integer',
300
- repeats: false
301
- }
302
- ]
303
- };
304
-
305
- export const qrMinValue: QuestionnaireResponse = {
306
- resourceType: 'QuestionnaireResponse',
307
- status: 'in-progress',
308
- item: [
309
- {
310
- linkId: 'age-filled',
311
- text: 'Age (>=18) (filled)',
312
- answer: [
313
- {
314
- valueInteger: 25
315
- }
316
- ]
317
- },
318
- {
319
- linkId: 'age-feedback',
320
- text: 'Age (>=18) (with feedback)',
321
- answer: [
322
- {
323
- valueInteger: 15
324
- }
325
- ]
326
- }
327
- ],
328
- questionnaire: 'https://smartforms.csiro.au/docs/behavior/value-constraints/min-value|0.1.0'
329
- };
330
-
331
- // MaxValue
332
- export const qMaxValue: Questionnaire = {
333
- resourceType: 'Questionnaire',
334
- id: 'MaxValueValidation',
335
- name: 'MaxValueValidation',
336
- title: 'Max Value Validation for Integer',
337
- version: '0.1.0',
338
- status: 'draft',
339
- publisher: 'AEHRC CSIRO',
340
- date: '2024-05-01',
341
- url: 'https://smartforms.csiro.au/docs/behavior/value-constraints/max-value',
342
- item: [
343
- {
344
- extension: [
345
- {
346
- url: 'http://hl7.org/fhir/StructureDefinition/maxValue',
347
- valueInteger: 65
348
- }
349
- ],
350
- linkId: 'age-empty',
351
- text: 'Age (<=65) (empty)',
352
- type: 'integer',
353
- repeats: false
354
- },
355
- {
356
- extension: [
357
- {
358
- url: 'http://hl7.org/fhir/StructureDefinition/maxValue',
359
- valueInteger: 65 // Example: Maximum age requirement
360
- }
361
- ],
362
- linkId: 'age-filled',
363
- text: 'Age (<=65) (filled)',
364
- type: 'integer',
365
- repeats: false
366
- },
367
- {
368
- extension: [
369
- {
370
- url: 'http://hl7.org/fhir/StructureDefinition/maxValue',
371
- valueInteger: 65
372
- }
373
- ],
374
- linkId: 'age-feedback',
375
- text: 'Age (<=65) (with feedback)',
376
- type: 'integer',
377
- repeats: false
378
- }
379
- ]
380
- };
381
-
382
- export const qrMaxValue: QuestionnaireResponse = {
383
- resourceType: 'QuestionnaireResponse',
384
- status: 'in-progress',
385
- item: [
386
- {
387
- linkId: 'age-filled',
388
- text: 'Age (<=65) (filled)',
389
- answer: [
390
- {
391
- valueInteger: 60
392
- }
393
- ]
394
- },
395
- {
396
- linkId: 'age-feedback',
397
- text: 'Age (<=65) (with feedback)',
398
- answer: [
399
- {
400
- valueInteger: 70
401
- }
402
- ]
403
- }
404
- ],
405
- questionnaire: 'https://smartforms.csiro.au/docs/behavior/value-constraints/max-value|0.1.0'
406
- };
407
-
408
- // MaxDecimalPlaces
409
- export const qMaxDecimalPlaces: Questionnaire = {
410
- resourceType: 'Questionnaire',
411
- id: 'MaxDecimalPlaces',
412
- name: 'MaxDecimalPlaces',
413
- title: 'Max Decimal Places',
414
- version: '0.1.0',
415
- status: 'draft',
416
- publisher: 'AEHRC CSIRO',
417
- date: '2024-05-01',
418
- url: 'https://smartforms.csiro.au/docs/behavior/value-constraints/max-decimal-places',
419
- item: [
420
- {
421
- extension: [
422
- {
423
- url: 'http://hl7.org/fhir/StructureDefinition/maxDecimalPlaces',
424
- valueInteger: 2
425
- },
426
- {
427
- url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-unit',
428
- valueCoding: {
429
- system: 'http://unitsofmeasure.org',
430
- code: 'kg',
431
- display: 'kg'
432
- }
433
- }
434
- ],
435
- linkId: 'weight-empty',
436
- text: 'Weight (kg) (empty)',
437
- type: 'decimal',
438
- repeats: false
439
- },
440
- {
441
- extension: [
442
- {
443
- url: 'http://hl7.org/fhir/StructureDefinition/maxDecimalPlaces',
444
- valueInteger: 2
445
- },
446
- {
447
- url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-unit',
448
- valueCoding: {
449
- system: 'http://unitsofmeasure.org',
450
- code: 'kg',
451
- display: 'kg'
452
- }
453
- }
454
- ],
455
- linkId: 'weight-filled',
456
- text: 'Weight (kg) (filled)',
457
- type: 'decimal',
458
- repeats: false
459
- },
460
- {
461
- extension: [
462
- {
463
- url: 'http://hl7.org/fhir/StructureDefinition/maxDecimalPlaces',
464
- valueInteger: 2
465
- },
466
- {
467
- url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-unit',
468
- valueCoding: {
469
- system: 'http://unitsofmeasure.org',
470
- code: 'kg',
471
- display: 'kg'
472
- }
473
- }
474
- ],
475
- linkId: 'weight-feedback',
476
- text: 'Weight (kg) (with feedback)',
477
- type: 'decimal',
478
- repeats: false
479
- }
480
- ]
481
- };
482
-
483
- export const qrMaxDecimalPlaces: QuestionnaireResponse = {
484
- resourceType: 'QuestionnaireResponse',
485
- status: 'in-progress',
486
- item: [
487
- {
488
- linkId: 'weight-filled',
489
- text: 'Weight (kg) (filled)',
490
- answer: [
491
- {
492
- valueDecimal: 72.34
493
- }
494
- ]
495
- },
496
- {
497
- linkId: 'weight-feedback',
498
- text: 'Weight (kg) (with feedback)',
499
- answer: [
500
- {
501
- valueDecimal: 72.345
502
- }
503
- ]
504
- }
505
- ],
506
- questionnaire:
507
- 'https://smartforms.csiro.au/docs/behavior/value-constraints/max-decimal-places|0.1.0'
508
- };
@@ -1,180 +0,0 @@
1
- /*
2
- * Copyright 2024 Commonwealth Scientific and Industrial Research
3
- * Organisation (CSIRO) ABN 41 687 119 230.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
-
18
- import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
19
-
20
- export const qBooleanBasic: Questionnaire = {
21
- resourceType: 'Questionnaire',
22
- id: 'BooleanBasic',
23
- name: 'BooleanBasic',
24
- title: 'Boolean Basic',
25
- version: '0.1.0',
26
- status: 'draft',
27
- publisher: 'AEHRC CSIRO',
28
- date: '2024-05-01',
29
- url: 'https://smartforms.csiro.au/docs/components/boolean/basic',
30
- item: [
31
- {
32
- linkId: 'eaten',
33
- type: 'boolean',
34
- repeats: false,
35
- text: 'Have you eaten yet?'
36
- }
37
- ]
38
- };
39
-
40
- export const qrBooleanBasicResponse: QuestionnaireResponse = {
41
- resourceType: 'QuestionnaireResponse',
42
- status: 'in-progress',
43
- item: [
44
- {
45
- linkId: 'eaten',
46
- text: 'Have you eaten yet?',
47
- answer: [
48
- {
49
- valueBoolean: true
50
- }
51
- ]
52
- }
53
- ],
54
- questionnaire: 'https://smartforms.csiro.au/docs/components/boolean/basic'
55
- };
56
-
57
- export const qBooleanCheckbox: Questionnaire = {
58
- resourceType: 'Questionnaire',
59
- id: 'BooleanCheckbox',
60
- name: 'BooleanCheckbox',
61
- title: 'Boolean Checkbox',
62
- version: '0.1.0',
63
- status: 'draft',
64
- publisher: 'AEHRC CSIRO',
65
- date: '2024-05-01',
66
- url: 'https://smartforms.csiro.au/docs/components/boolean/checkbox',
67
- item: [
68
- {
69
- extension: [
70
- {
71
- url: 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl',
72
- valueCodeableConcept: {
73
- coding: [
74
- {
75
- system: 'http://hl7.org/fhir/questionnaire-item-control',
76
- code: 'check-box'
77
- }
78
- ]
79
- }
80
- }
81
- ],
82
- linkId: 'eaten',
83
- type: 'boolean',
84
- repeats: false,
85
- text: 'Have you eaten yet?'
86
- }
87
- ]
88
- };
89
-
90
- export const qrBooleanCheckboxResponse: QuestionnaireResponse = {
91
- resourceType: 'QuestionnaireResponse',
92
- status: 'in-progress',
93
- item: [
94
- {
95
- linkId: 'eaten',
96
- text: 'Have you eaten yet?',
97
- answer: [
98
- {
99
- valueBoolean: true
100
- }
101
- ]
102
- }
103
- ],
104
- questionnaire: 'https://smartforms.csiro.au/docs/components/boolean/checkbox'
105
- };
106
-
107
- export const qBooleanCalculation: Questionnaire = {
108
- resourceType: 'Questionnaire',
109
- id: 'BooleanCalculation',
110
- name: 'BooleanCalculation',
111
- title: 'Boolean Calculation',
112
- version: '0.1.0',
113
- status: 'draft',
114
- publisher: 'AEHRC CSIRO',
115
- date: '2024-05-01',
116
- url: 'https://smartforms.csiro.au/docs/components/boolean/calculation',
117
- extension: [
118
- {
119
- url: 'http://hl7.org/fhir/StructureDefinition/variable',
120
- valueExpression: {
121
- name: 'gender',
122
- language: 'text/fhirpath',
123
- expression: "item.where(linkId = 'gender-controller').answer.valueCoding.code"
124
- }
125
- }
126
- ],
127
- item: [
128
- {
129
- linkId: 'gender-controller',
130
- text: 'Gender',
131
- type: 'choice',
132
- repeats: false,
133
- answerOption: [
134
- {
135
- valueCoding: {
136
- system: 'http://hl7.org/fhir/administrative-gender',
137
- code: 'female',
138
- display: 'Female'
139
- }
140
- },
141
- {
142
- valueCoding: {
143
- system: 'http://hl7.org/fhir/administrative-gender',
144
- code: 'male',
145
- display: 'Male'
146
- }
147
- },
148
- {
149
- valueCoding: {
150
- system: 'http://hl7.org/fhir/administrative-gender',
151
- code: 'other',
152
- display: 'Other'
153
- }
154
- },
155
- {
156
- valueCoding: {
157
- system: 'http://hl7.org/fhir/administrative-gender',
158
- code: 'unknown',
159
- display: 'Unknown'
160
- }
161
- }
162
- ]
163
- },
164
- {
165
- extension: [
166
- {
167
- url: 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression',
168
- valueExpression: {
169
- language: 'text/fhirpath',
170
- expression: "%gender = 'female'"
171
- }
172
- }
173
- ],
174
- linkId: 'gender-is-female',
175
- text: 'Gender is female?',
176
- type: 'boolean',
177
- readOnly: true
178
- }
179
- ]
180
- };