@aehrc/smart-forms-renderer 0.35.8 → 0.36.1

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 (77) hide show
  1. package/README.md +1 -1
  2. package/lib/components/FormComponents/DateTimeItem/DateTimeField.d.ts +12 -0
  3. package/lib/components/FormComponents/DateTimeItem/DateTimeField.js +34 -0
  4. package/lib/components/FormComponents/DateTimeItem/DateTimeField.js.map +1 -0
  5. package/lib/components/FormComponents/DateTimeItem/DateTimeItem.d.ts +9 -0
  6. package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js +60 -0
  7. package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js.map +1 -0
  8. package/lib/hooks/useCodingCalculatedExpression.js +11 -0
  9. package/lib/hooks/useCodingCalculatedExpression.js.map +1 -1
  10. package/lib/hooks/useDisplayCalculatedExpression.d.ts +3 -0
  11. package/lib/hooks/useDisplayCalculatedExpression.js +40 -0
  12. package/lib/hooks/useDisplayCalculatedExpression.js.map +1 -0
  13. package/lib/hooks/useInitialiseRenderer.d.ts +4 -0
  14. package/lib/hooks/useInitialiseRenderer.js +85 -0
  15. package/lib/hooks/useInitialiseRenderer.js.map +1 -0
  16. package/lib/hooks/useQueryClient.d.ts +3 -0
  17. package/lib/hooks/useQueryClient.js +29 -0
  18. package/lib/hooks/useQueryClient.js.map +1 -0
  19. package/lib/utils/buildForm.d.ts +8 -0
  20. package/lib/utils/buildForm.js +26 -0
  21. package/lib/utils/buildForm.js.map +1 -0
  22. package/lib/utils/calculatedExpression.js +15 -43
  23. package/lib/utils/calculatedExpression.js.map +1 -1
  24. package/lib/utils/fhirpath.js +0 -4
  25. package/lib/utils/fhirpath.js.map +1 -1
  26. package/lib/utils/manageForm.d.ts +7 -1
  27. package/lib/utils/manageForm.js +9 -0
  28. package/lib/utils/manageForm.js.map +1 -1
  29. package/lib/utils/questionnaireStoreUtils/resolveValueSets.js +8 -3
  30. package/lib/utils/questionnaireStoreUtils/resolveValueSets.js.map +1 -1
  31. package/lib/utils/removeEmptyAnswers.js +19 -6
  32. package/lib/utils/removeEmptyAnswers.js.map +1 -1
  33. package/lib/utils/repopulateIntoResponse.d.ts +1 -3
  34. package/lib/utils/repopulateIntoResponse.js +2 -31
  35. package/lib/utils/repopulateIntoResponse.js.map +1 -1
  36. package/lib/utils/tabs.js +6 -4
  37. package/lib/utils/tabs.js.map +1 -1
  38. package/lib/utils/updateQr.d.ts +9 -0
  39. package/lib/utils/updateQr.js +55 -0
  40. package/lib/utils/updateQr.js.map +1 -0
  41. package/lib/utils/valueSet.js +4 -2
  42. package/lib/utils/valueSet.js.map +1 -1
  43. package/package.json +5 -4
  44. package/src/hooks/useCodingCalculatedExpression.ts +14 -1
  45. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreAllergyIntolerance.json +209 -0
  46. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreCondition.json +220 -0
  47. package/src/stories/assets/questionnaires/AuCoreTestingJson/AuCoreEncounter.json +220 -0
  48. package/src/stories/assets/questionnaires/QAuCoreTesting.ts +455 -0
  49. package/src/stories/assets/questionnaires/QPrePopTester.ts +266 -71
  50. package/src/stories/testing/AuCoreTester.stories.tsx +57 -0
  51. package/src/utils/calculatedExpression.ts +25 -59
  52. package/src/utils/fhirpath.ts +0 -5
  53. package/src/utils/manageForm.ts +11 -1
  54. package/src/utils/questionnaireStoreUtils/resolveValueSets.ts +10 -6
  55. package/src/utils/removeEmptyAnswers.ts +22 -6
  56. package/src/utils/repopulateIntoResponse.ts +5 -58
  57. package/src/utils/tabs.ts +6 -4
  58. package/src/utils/updateQr.ts +88 -0
  59. package/src/utils/valueSet.ts +4 -2
  60. package/stats.html +4842 -0
  61. package/stats1.html +4842 -0
  62. package/stats3.html +4842 -0
  63. package/lib/utils/answerExpression.d.ts +0 -5
  64. package/lib/utils/answerExpression.js +0 -52
  65. package/lib/utils/answerExpression.js.map +0 -1
  66. package/lib/utils/dynamicValueSet.d.ts +0 -5
  67. package/lib/utils/dynamicValueSet.js +0 -96
  68. package/lib/utils/dynamicValueSet.js.map +0 -1
  69. package/lib/utils/fhirpathAsyncUtils/fhirpath-async.d.ts +0 -14
  70. package/lib/utils/fhirpathAsyncUtils/fhirpath-async.js +0 -431
  71. package/lib/utils/fhirpathAsyncUtils/fhirpath-async.js.map +0 -1
  72. package/lib/utils/fhirpathAsyncUtils/outcome-utils.d.ts +0 -3
  73. package/lib/utils/fhirpathAsyncUtils/outcome-utils.js +0 -41
  74. package/lib/utils/fhirpathAsyncUtils/outcome-utils.js.map +0 -1
  75. package/lib/utils/fhirpathAsyncUtils/test-questionnaire.d.ts +0 -1
  76. package/lib/utils/fhirpathAsyncUtils/test-questionnaire.js +0 -379
  77. package/lib/utils/fhirpathAsyncUtils/test-questionnaire.js.map +0 -1
@@ -0,0 +1,220 @@
1
+ {
2
+ "resourceType": "Questionnaire",
3
+ "id": "AuCoreCondition",
4
+ "extension": [
5
+ {
6
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext",
7
+ "extension": [
8
+ {
9
+ "url": "name",
10
+ "valueCoding": {
11
+ "system": "http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext",
12
+ "code": "patient"
13
+ }
14
+ },
15
+ {
16
+ "url": "type",
17
+ "valueCode": "Patient"
18
+ },
19
+ {
20
+ "url": "description",
21
+ "valueString": "The patient that is to be used to pre-populate the form"
22
+ }
23
+ ]
24
+ },
25
+ {
26
+ "url": "http://hl7.org/fhir/StructureDefinition/variable",
27
+ "valueExpression": {
28
+ "name": "Condition",
29
+ "language": "application/x-fhir-query",
30
+ "expression": "Condition?patient={{%patient.id}}"
31
+ }
32
+ }
33
+ ],
34
+ "version": "0.1.0",
35
+ "name": "AU Core Condition",
36
+ "title": "AU Core Condition",
37
+ "status": "draft",
38
+ "date": "2024-07-15",
39
+ "item": [
40
+ {
41
+ "linkId": "condition",
42
+ "text": "AU Core Condition",
43
+ "type": "group",
44
+ "repeats": false,
45
+ "item": [
46
+ {
47
+ "linkId": "patient-details",
48
+ "text": "Patient Details",
49
+ "type": "group",
50
+ "item": [
51
+ {
52
+ "extension": [
53
+ {
54
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
55
+ "valueExpression": {
56
+ "language": "text/fhirpath",
57
+ "expression": "%patient.id"
58
+ }
59
+ }
60
+ ],
61
+ "linkId": "patient-id",
62
+ "text": "Patient ID",
63
+ "type": "string",
64
+ "required": true,
65
+ "readOnly": true
66
+ },
67
+ {
68
+ "extension": [
69
+ {
70
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
71
+ "valueExpression": {
72
+ "language": "text/fhirpath",
73
+ "expression": "(%patient.name.where(use='official').select((family | (given\n| prefix).join(' ')).join(', ').where($this != '') | text)).first()"
74
+ }
75
+ }
76
+ ],
77
+ "linkId": "patient-name",
78
+ "text": "Patient Name",
79
+ "type": "string",
80
+ "required": true,
81
+ "readOnly": true
82
+ }
83
+ ]
84
+ },
85
+ {
86
+ "linkId": "first-condition-note",
87
+ "text": "This questionnaire only uses the first Condition resource of a referenced patient.",
88
+ "_text": {
89
+ "extension": [
90
+ {
91
+ "url": "http://hl7.org/fhir/StructureDefinition/rendering-xhtml",
92
+ "valueString": "<div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"padding-bottom:\n8px;\">\r\n <b>This questionnaire only uses the first Condition resource of a referenced patient.</b>\r\n</div>"
93
+ }
94
+ ]
95
+ },
96
+ "type": "display"
97
+ },
98
+ {
99
+ "linkId": "clinical-status",
100
+ "text": "Clinical Status",
101
+ "type": "choice",
102
+ "answerValueSet": "http://hl7.org/fhir/ValueSet/condition-clinical",
103
+ "extension": [
104
+ {
105
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
106
+ "valueExpression": {
107
+ "language": "text/fhirpath",
108
+ "expression": "%Condition.entry[0].resource.clinicalStatus.coding"
109
+ }
110
+ }
111
+ ]
112
+ },
113
+ {
114
+ "linkId": "verification-status",
115
+ "text": "Verification Status",
116
+ "type": "choice",
117
+ "answerValueSet": "http://hl7.org/fhir/ValueSet/condition-ver-status",
118
+ "extension": [
119
+ {
120
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
121
+ "valueExpression": {
122
+ "language": "text/fhirpath",
123
+ "expression": "%Condition.entry[0].resource.verificationStatus.coding"
124
+ }
125
+ }
126
+ ]
127
+ },
128
+ {
129
+ "linkId": "category",
130
+ "text": "Category",
131
+ "type": "choice",
132
+ "required": true,
133
+ "answerValueSet": "http://hl7.org/fhir/ValueSet/condition-category",
134
+ "extension": [
135
+ {
136
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
137
+ "valueExpression": {
138
+ "language": "text/fhirpath",
139
+ "expression": "%Condition.entry[0].resource.category.coding"
140
+ }
141
+ }
142
+ ]
143
+ },
144
+ {
145
+ "linkId": "severity",
146
+ "text": "Severity",
147
+ "type": "choice",
148
+ "answerValueSet": "http://hl7.org/fhir/ValueSet/condition-severity",
149
+ "extension": [
150
+ {
151
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
152
+ "valueExpression": {
153
+ "language": "text/fhirpath",
154
+ "expression": "%Condition.entry[0].resource.severity.coding"
155
+ }
156
+ }
157
+ ]
158
+ },
159
+ {
160
+ "linkId": "code",
161
+ "text": "Code",
162
+ "type": "choice",
163
+ "required": true,
164
+ "answerValueSet": "http://hl7.org/fhir/ValueSet/condition-code",
165
+ "extension": [
166
+ {
167
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
168
+ "valueExpression": {
169
+ "language": "text/fhirpath",
170
+ "expression": "%Condition.entry[0].resource.code.coding"
171
+ }
172
+ }
173
+ ]
174
+ },
175
+ {
176
+ "extension": [
177
+ {
178
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
179
+ "valueExpression": {
180
+ "language": "text/fhirpath",
181
+ "expression": "%Condition.entry[0].resource.onset.value"
182
+ }
183
+ }
184
+ ],
185
+ "linkId": "onset",
186
+ "text": "Onset[x]",
187
+ "type": "string"
188
+ },
189
+ {
190
+ "extension": [
191
+ {
192
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
193
+ "valueExpression": {
194
+ "language": "text/fhirpath",
195
+ "expression": "%Condition.entry[0].resource.abatement.value"
196
+ }
197
+ }
198
+ ],
199
+ "linkId": "abatement",
200
+ "text": "Abatement[x]",
201
+ "type": "string"
202
+ },
203
+ {
204
+ "linkId": "note",
205
+ "text": "Note",
206
+ "type": "string",
207
+ "extension": [
208
+ {
209
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
210
+ "valueExpression": {
211
+ "language": "text/fhirpath",
212
+ "expression": "%Condition.entry[0].resource.note.text"
213
+ }
214
+ }
215
+ ]
216
+ }
217
+ ]
218
+ }
219
+ ]
220
+ }
@@ -0,0 +1,220 @@
1
+ {
2
+ "resourceType": "Questionnaire",
3
+ "id": "AuCoreCondition",
4
+ "extension": [
5
+ {
6
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext",
7
+ "extension": [
8
+ {
9
+ "url": "name",
10
+ "valueCoding": {
11
+ "system": "http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext",
12
+ "code": "patient"
13
+ }
14
+ },
15
+ {
16
+ "url": "type",
17
+ "valueCode": "Patient"
18
+ },
19
+ {
20
+ "url": "description",
21
+ "valueString": "The patient that is to be used to pre-populate the form"
22
+ }
23
+ ]
24
+ },
25
+ {
26
+ "url": "http://hl7.org/fhir/StructureDefinition/variable",
27
+ "valueExpression": {
28
+ "name": "Condition",
29
+ "language": "application/x-fhir-query",
30
+ "expression": "Condition?patient={{%patient.id}}"
31
+ }
32
+ }
33
+ ],
34
+ "version": "0.1.0",
35
+ "name": "AU Core Condition",
36
+ "title": "AU Core Condition",
37
+ "status": "draft",
38
+ "date": "2024-07-15",
39
+ "item": [
40
+ {
41
+ "linkId": "condition",
42
+ "text": "AU Core Condition",
43
+ "type": "group",
44
+ "repeats": false,
45
+ "item": [
46
+ {
47
+ "linkId": "patient-details",
48
+ "text": "Patient Details",
49
+ "type": "group",
50
+ "item": [
51
+ {
52
+ "extension": [
53
+ {
54
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
55
+ "valueExpression": {
56
+ "language": "text/fhirpath",
57
+ "expression": "%patient.id"
58
+ }
59
+ }
60
+ ],
61
+ "linkId": "patient-id",
62
+ "text": "Patient ID",
63
+ "type": "string",
64
+ "required": true,
65
+ "readOnly": true
66
+ },
67
+ {
68
+ "extension": [
69
+ {
70
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
71
+ "valueExpression": {
72
+ "language": "text/fhirpath",
73
+ "expression": "(%patient.name.where(use='official').select((family | (given\n| prefix).join(' ')).join(', ').where($this != '') | text)).first()"
74
+ }
75
+ }
76
+ ],
77
+ "linkId": "patient-name",
78
+ "text": "Patient Name",
79
+ "type": "string",
80
+ "required": true,
81
+ "readOnly": true
82
+ }
83
+ ]
84
+ },
85
+ {
86
+ "linkId": "first-condition-note",
87
+ "text": "This questionnaire only uses the first Condition resource of a referenced patient.",
88
+ "_text": {
89
+ "extension": [
90
+ {
91
+ "url": "http://hl7.org/fhir/StructureDefinition/rendering-xhtml",
92
+ "valueString": "<div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"padding-bottom:\n8px;\">\r\n <b>This questionnaire only uses the first Condition resource of a referenced patient.</b>\r\n</div>"
93
+ }
94
+ ]
95
+ },
96
+ "type": "display"
97
+ },
98
+ {
99
+ "linkId": "clinical-status",
100
+ "text": "Clinical Status",
101
+ "type": "choice",
102
+ "answerValueSet": "http://hl7.org/fhir/ValueSet/condition-clinical",
103
+ "extension": [
104
+ {
105
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
106
+ "valueExpression": {
107
+ "language": "text/fhirpath",
108
+ "expression": "%Condition.entry[0].resource.clinicalStatus.coding"
109
+ }
110
+ }
111
+ ]
112
+ },
113
+ {
114
+ "linkId": "verification-status",
115
+ "text": "Verification Status",
116
+ "type": "choice",
117
+ "answerValueSet": "http://hl7.org/fhir/ValueSet/condition-ver-status",
118
+ "extension": [
119
+ {
120
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
121
+ "valueExpression": {
122
+ "language": "text/fhirpath",
123
+ "expression": "%Condition.entry[0].resource.verificationStatus.coding"
124
+ }
125
+ }
126
+ ]
127
+ },
128
+ {
129
+ "linkId": "category",
130
+ "text": "Category",
131
+ "type": "choice",
132
+ "required": true,
133
+ "answerValueSet": "http://hl7.org/fhir/ValueSet/condition-category",
134
+ "extension": [
135
+ {
136
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
137
+ "valueExpression": {
138
+ "language": "text/fhirpath",
139
+ "expression": "%Condition.entry[0].resource.category.coding"
140
+ }
141
+ }
142
+ ]
143
+ },
144
+ {
145
+ "linkId": "severity",
146
+ "text": "Severity",
147
+ "type": "choice",
148
+ "answerValueSet": "http://hl7.org/fhir/ValueSet/condition-severity",
149
+ "extension": [
150
+ {
151
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
152
+ "valueExpression": {
153
+ "language": "text/fhirpath",
154
+ "expression": "%Condition.entry[0].resource.severity.coding"
155
+ }
156
+ }
157
+ ]
158
+ },
159
+ {
160
+ "linkId": "code",
161
+ "text": "Code",
162
+ "type": "choice",
163
+ "required": true,
164
+ "answerValueSet": "http://hl7.org/fhir/ValueSet/condition-code",
165
+ "extension": [
166
+ {
167
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
168
+ "valueExpression": {
169
+ "language": "text/fhirpath",
170
+ "expression": "%Condition.entry[0].resource.code.coding"
171
+ }
172
+ }
173
+ ]
174
+ },
175
+ {
176
+ "extension": [
177
+ {
178
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
179
+ "valueExpression": {
180
+ "language": "text/fhirpath",
181
+ "expression": "%Condition.entry[0].resource.onset.value"
182
+ }
183
+ }
184
+ ],
185
+ "linkId": "onset",
186
+ "text": "Onset[x]",
187
+ "type": "string"
188
+ },
189
+ {
190
+ "extension": [
191
+ {
192
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
193
+ "valueExpression": {
194
+ "language": "text/fhirpath",
195
+ "expression": "%Condition.entry[0].resource.abatement.value"
196
+ }
197
+ }
198
+ ],
199
+ "linkId": "abatement",
200
+ "text": "Abatement[x]",
201
+ "type": "string"
202
+ },
203
+ {
204
+ "linkId": "note",
205
+ "text": "Note",
206
+ "type": "string",
207
+ "extension": [
208
+ {
209
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
210
+ "valueExpression": {
211
+ "language": "text/fhirpath",
212
+ "expression": "%Condition.entry[0].resource.note.text"
213
+ }
214
+ }
215
+ ]
216
+ }
217
+ ]
218
+ }
219
+ ]
220
+ }