@aehrc/smart-forms-renderer 0.9.2 → 0.10.0

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 (156) hide show
  1. package/.swcrc +11 -0
  2. package/lib/components/FormComponents/GroupItem/NextTabButtonWrapper.js +5 -5
  3. package/lib/components/FormComponents/GroupItem/NextTabButtonWrapper.js.map +1 -1
  4. package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js +1 -1
  5. package/lib/components/FormComponents/RepeatItem/RemoveItemButton.d.ts +10 -0
  6. package/lib/components/FormComponents/RepeatItem/RemoveItemButton.js +30 -0
  7. package/lib/components/FormComponents/RepeatItem/RemoveItemButton.js.map +1 -0
  8. package/lib/components/FormComponents/RepeatItem/RepeatField.js +2 -2
  9. package/lib/components/FormComponents/SingleItem/SingleItem.js +2 -2
  10. package/lib/components/FormComponents/SingleItem/SingleItem.js.map +1 -1
  11. package/lib/components/FormComponents/Tables/GroupTable.d.ts +1 -2
  12. package/lib/components/FormComponents/Tables/GroupTable.js +44 -59
  13. package/lib/components/FormComponents/Tables/GroupTable.js.map +1 -1
  14. package/lib/components/FormComponents/Tables/GroupTableBody.d.ts +17 -0
  15. package/lib/components/FormComponents/Tables/GroupTableBody.js +48 -0
  16. package/lib/components/FormComponents/Tables/GroupTableBody.js.map +1 -0
  17. package/lib/components/FormComponents/Tables/GroupTableRow.d.ts +18 -5
  18. package/lib/components/FormComponents/Tables/GroupTableRow.js +17 -25
  19. package/lib/components/FormComponents/Tables/GroupTableRow.js.map +1 -1
  20. package/lib/components/FormComponents/Tables/GroupTableRowCells.d.ts +11 -0
  21. package/lib/components/FormComponents/Tables/GroupTableRowCells.js +57 -0
  22. package/lib/components/FormComponents/Tables/GroupTableRowCells.js.map +1 -0
  23. package/lib/components/FormComponents/Tables/GroupTableRows.d.ts +17 -0
  24. package/lib/components/FormComponents/Tables/GroupTableRows.js +45 -0
  25. package/lib/components/FormComponents/Tables/GroupTableRows.js.map +1 -0
  26. package/lib/components/FormComponents/Tables/GroupTableTestRow.d.ts +22 -0
  27. package/lib/components/FormComponents/Tables/GroupTableTestRow.js +43 -0
  28. package/lib/components/FormComponents/Tables/GroupTableTestRow.js.map +1 -0
  29. package/lib/components/FormComponents/Tables/GroupTableView.d.ts +21 -0
  30. package/lib/components/FormComponents/Tables/GroupTableView.js +65 -0
  31. package/lib/components/FormComponents/Tables/GroupTableView.js.map +1 -0
  32. package/lib/components/FormComponents/Tables/RemoveRowButton.d.ts +10 -0
  33. package/lib/components/FormComponents/Tables/RemoveRowButton.js +32 -0
  34. package/lib/components/FormComponents/Tables/RemoveRowButton.js.map +1 -0
  35. package/lib/components/FormComponents/Tables/SelectRowButton.d.ts +7 -0
  36. package/lib/components/FormComponents/Tables/SelectRowButton.js +26 -0
  37. package/lib/components/FormComponents/Tables/SelectRowButton.js.map +1 -0
  38. package/lib/components/FormComponents/Tables/Table.styles.d.ts +8 -0
  39. package/lib/components/FormComponents/Tables/Table.styles.js +17 -0
  40. package/lib/components/FormComponents/Tables/Table.styles.js.map +1 -1
  41. package/lib/components/Renderer/BaseRenderer.js +5 -6
  42. package/lib/components/Renderer/BaseRenderer.js.map +1 -1
  43. package/lib/components/Renderer/FormBodyCollapsible.js +4 -4
  44. package/lib/components/Renderer/FormBodyCollapsible.js.map +1 -1
  45. package/lib/components/Renderer/FormBodyTabbed.js +3 -3
  46. package/lib/components/Renderer/FormBodyTabbed.js.map +1 -1
  47. package/lib/components/Tabs/CompleteTabButton.js +2 -2
  48. package/lib/components/Tabs/CompleteTabButton.js.map +1 -1
  49. package/lib/components/Tabs/FormBodySingleTab.js +2 -2
  50. package/lib/components/Tabs/FormBodySingleTab.js.map +1 -1
  51. package/lib/components/Tabs/FormBodyTabList.js +4 -4
  52. package/lib/components/Tabs/FormBodyTabList.js.map +1 -1
  53. package/lib/hooks/useDecimalCalculatedExpression.js +2 -2
  54. package/lib/hooks/useDecimalCalculatedExpression.js.map +1 -1
  55. package/lib/hooks/useHidden.js +4 -4
  56. package/lib/hooks/useHidden.js.map +1 -1
  57. package/lib/hooks/useInitialiseGroupTable.d.ts +2 -2
  58. package/lib/hooks/useInitialiseGroupTable.js.map +1 -1
  59. package/lib/hooks/useInitialiseRenderer.js +11 -14
  60. package/lib/hooks/useInitialiseRenderer.js.map +1 -1
  61. package/lib/hooks/useIntegerCalculatedExpression.js +2 -2
  62. package/lib/hooks/useIntegerCalculatedExpression.js.map +1 -1
  63. package/lib/hooks/useMinimalStringCalculatedExpression.js +25 -13
  64. package/lib/hooks/useStringCalculatedExpression.js +2 -2
  65. package/lib/hooks/useStringCalculatedExpression.js.map +1 -1
  66. package/lib/hooks/useTerminologyServerQuery.js +3 -4
  67. package/lib/hooks/useTerminologyServerQuery.js.map +1 -1
  68. package/lib/hooks/useValueSetCodings.js +10 -12
  69. package/lib/hooks/useValueSetCodings.js.map +1 -1
  70. package/lib/index.js +19 -20
  71. package/lib/index.js.map +1 -1
  72. package/lib/interfaces/groupTable.interface.d.ts +1 -1
  73. package/lib/setup-jest.js +1 -0
  74. package/lib/setup-jest.js.map +1 -0
  75. package/lib/stores/index.d.ts +4 -3
  76. package/lib/stores/index.js +4 -3
  77. package/lib/stores/index.js.map +1 -1
  78. package/lib/stores/questionnaireResponseStore.d.ts +28 -0
  79. package/lib/stores/questionnaireResponseStore.js +64 -0
  80. package/lib/stores/questionnaireResponseStore.js.map +1 -0
  81. package/lib/stores/questionnaireStore.d.ts +65 -0
  82. package/lib/stores/questionnaireStore.js +172 -0
  83. package/lib/stores/questionnaireStore.js.map +1 -0
  84. package/lib/stores/smartConfigStore.d.ts +25 -0
  85. package/lib/stores/smartConfigStore.js +30 -0
  86. package/lib/stores/smartConfigStore.js.map +1 -0
  87. package/lib/stores/terminologyServerStore.d.ts +14 -0
  88. package/lib/stores/terminologyServerStore.js +26 -0
  89. package/lib/stores/terminologyServerStore.js.map +1 -0
  90. package/lib/stores/useQuestionnaireResponseStore.d.ts +14 -2
  91. package/lib/stores/useQuestionnaireResponseStore.js +4 -2
  92. package/lib/stores/useQuestionnaireResponseStore.js.map +1 -1
  93. package/lib/stores/useQuestionnaireStore.d.ts +30 -2
  94. package/lib/stores/useQuestionnaireStore.js +4 -2
  95. package/lib/stores/useQuestionnaireStore.js.map +1 -1
  96. package/lib/stories/MedicalHistoryTable.stories.js +49 -0
  97. package/lib/stories/MedicalHistoryTable.stories.js.map +1 -0
  98. package/lib/stories/SmartFormsRenderer.stories.js +103 -0
  99. package/lib/stories/SmartFormsRenderer.stories.js.map +1 -0
  100. package/lib/theme/overrides/Table.d.ts +1 -0
  101. package/lib/theme/overrides/Table.js +2 -1
  102. package/lib/theme/overrides/Table.js.map +1 -1
  103. package/lib/utils/calculatedExpression.js +1 -2
  104. package/lib/utils/calculatedExpression.js.map +1 -1
  105. package/lib/utils/groupTable.d.ts +3 -0
  106. package/lib/utils/groupTable.js +29 -0
  107. package/lib/utils/groupTable.js.map +1 -0
  108. package/package.json +10 -5
  109. package/src/components/FormComponents/GroupItem/NextTabButtonWrapper.tsx +5 -5
  110. package/src/components/FormComponents/RepeatGroup/DeleteItemButton.tsx +1 -1
  111. package/src/components/FormComponents/RepeatItem/{DeleteItemButton.tsx → RemoveItemButton.tsx} +4 -4
  112. package/src/components/FormComponents/RepeatItem/RepeatField.tsx +2 -2
  113. package/src/components/FormComponents/SingleItem/SingleItem.tsx +2 -2
  114. package/src/components/FormComponents/Tables/GroupTable.tsx +71 -120
  115. package/src/components/FormComponents/Tables/GroupTableBody.tsx +116 -0
  116. package/src/components/FormComponents/Tables/GroupTableRow.tsx +89 -49
  117. package/src/components/FormComponents/Tables/GroupTableRowCells.tsx +87 -0
  118. package/src/components/FormComponents/Tables/GroupTableView.tsx +169 -0
  119. package/src/components/FormComponents/Tables/{DeleteRowButton.tsx → RemoveRowButton.tsx} +7 -7
  120. package/src/components/FormComponents/Tables/SelectRowButton.tsx +37 -0
  121. package/src/components/FormComponents/Tables/Table.styles.tsx +25 -0
  122. package/src/components/Renderer/BaseRenderer.tsx +5 -6
  123. package/src/components/Renderer/FormBodyCollapsible.tsx +4 -5
  124. package/src/components/Renderer/FormBodyTabbed.tsx +3 -3
  125. package/src/components/Tabs/CompleteTabButton.tsx +2 -2
  126. package/src/components/Tabs/FormBodySingleTab.tsx +2 -3
  127. package/src/components/Tabs/FormBodyTabList.tsx +4 -4
  128. package/src/hooks/useDecimalCalculatedExpression.ts +2 -2
  129. package/src/hooks/useHidden.ts +4 -4
  130. package/src/hooks/useInitialiseGroupTable.ts +3 -3
  131. package/src/hooks/useInitialiseRenderer.ts +17 -18
  132. package/src/hooks/useIntegerCalculatedExpression.ts +2 -2
  133. package/src/hooks/useStringCalculatedExpression.ts +2 -2
  134. package/src/hooks/useTerminologyServerQuery.ts +3 -4
  135. package/src/hooks/useValueSetCodings.ts +10 -12
  136. package/src/index.ts +19 -20
  137. package/src/interfaces/groupTable.interface.ts +1 -1
  138. package/src/stores/index.ts +7 -3
  139. package/src/stores/questionnaireResponseStore.ts +83 -0
  140. package/src/stores/{useQuestionnaireStore.ts → questionnaireStore.ts} +7 -6
  141. package/src/stores/smartConfigStore.ts +45 -0
  142. package/src/stores/{useTerminologyServerStore.ts → terminologyServerStore.ts} +5 -4
  143. package/src/stories/MedicalHistoryTable.stories.tsx +61 -0
  144. package/src/stories/SmartFormsRenderer.stories.ts +15 -5
  145. package/src/stories/assets/QItems-and-QRItems/QR_GTableMedicalHistory.json +80 -0
  146. package/src/stories/assets/QItems-and-QRItems/Q_GTableMedicalHistory.json +109 -0
  147. package/src/stories/assets/Qs-and-QRs/QDev715.json +16081 -0
  148. package/src/theme/overrides/Table.ts +2 -1
  149. package/src/utils/calculatedExpression.ts +1 -2
  150. package/src/utils/groupTable.ts +37 -0
  151. package/src/stores/useQuestionnaireResponseStore.ts +0 -63
  152. package/src/stores/useSmartConfigStore.ts +0 -27
  153. /package/src/stories/assets/{Q715.json → Qs-and-QRs/Q715.json} +0 -0
  154. /package/src/stories/assets/{QTestGrid.json → Qs-and-QRs/QTestGrid.json} +0 -0
  155. /package/src/stories/assets/{R715.json → Qs-and-QRs/R715.json} +0 -0
  156. /package/src/stories/assets/{RTestGrid.json → Qs-and-QRs/RTestGrid.json} +0 -0
@@ -0,0 +1,80 @@
1
+ [
2
+ {
3
+ "linkId": "92bd7d05-9b5e-4cf9-900b-703f361dad9d",
4
+ "text": "Medical history and current problems list",
5
+ "item": [
6
+ {
7
+ "linkId": "59b1900a-4f85-4a8c-b9cd-3fe2fd76f27e",
8
+ "text": "Condition",
9
+ "answer": [
10
+ {
11
+ "valueString": "Large diffuse B-cell lymphoma of the brain"
12
+ }
13
+ ]
14
+ },
15
+ {
16
+ "linkId": "88bcfad7-386b-4d87-b34b-2e50482e4d2c",
17
+ "text": "Clinical Status",
18
+ "answer": [
19
+ {
20
+ "valueCoding": {
21
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
22
+ "code": "active",
23
+ "display": "Active"
24
+ }
25
+ }
26
+ ]
27
+ },
28
+ {
29
+ "linkId": "18b9e159-2ed7-4047-82b7-deb2a171de4f",
30
+ "text": "Recorded Date",
31
+ "answer": [
32
+ {
33
+ "valueDate": "2021-02-01"
34
+ }
35
+ ]
36
+ }
37
+ ]
38
+ },
39
+ {
40
+ "linkId": "92bd7d05-9b5e-4cf9-900b-703f361dad9d",
41
+ "text": "Medical history and current problems list",
42
+ "item": [
43
+ {
44
+ "linkId": "59b1900a-4f85-4a8c-b9cd-3fe2fd76f27e",
45
+ "text": "Condition",
46
+ "answer": [
47
+ {
48
+ "valueCoding": {
49
+ "system": "http://snomed.info/sct",
50
+ "code": "56731001",
51
+ "display": "Hypertonia"
52
+ }
53
+ }
54
+ ]
55
+ },
56
+ {
57
+ "linkId": "88bcfad7-386b-4d87-b34b-2e50482e4d2c",
58
+ "text": "Clinical Status",
59
+ "answer": [
60
+ {
61
+ "valueCoding": {
62
+ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
63
+ "code": "inactive",
64
+ "display": "Inactive"
65
+ }
66
+ }
67
+ ]
68
+ },
69
+ {
70
+ "linkId": "18b9e159-2ed7-4047-82b7-deb2a171de4f",
71
+ "text": "Recorded Date",
72
+ "answer": [
73
+ {
74
+ "valueDate": "2023-11-08"
75
+ }
76
+ ]
77
+ }
78
+ ]
79
+ }
80
+ ]
@@ -0,0 +1,109 @@
1
+ {
2
+ "extension": [
3
+ {
4
+ "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
5
+ "valueCodeableConcept": {
6
+ "coding": [
7
+ {
8
+ "system": "http://hl7.org/fhir/questionnaire-item-control",
9
+ "code": "gtable"
10
+ }
11
+ ]
12
+ }
13
+ },
14
+ {
15
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemPopulationContext",
16
+ "valueExpression": {
17
+ "name": "ConditionRepeat",
18
+ "language": "text/fhirpath",
19
+ "expression": "%Condition.entry.resource"
20
+ }
21
+ }
22
+ ],
23
+ "linkId": "92bd7d05-9b5e-4cf9-900b-703f361dad9d",
24
+ "text": "Medical history and current problems list",
25
+ "type": "group",
26
+ "repeats": true,
27
+ "item": [
28
+ {
29
+ "extension": [
30
+ {
31
+ "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
32
+ "valueCodeableConcept": {
33
+ "coding": [
34
+ {
35
+ "system": "http://hl7.org/fhir/questionnaire-item-control",
36
+ "code": "autocomplete"
37
+ }
38
+ ]
39
+ }
40
+ },
41
+ {
42
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
43
+ "valueExpression": {
44
+ "language": "text/fhirpath",
45
+ "expression": "%ConditionRepeat.code.select((coding.where(system='http://snomed.info/sct') | coding.where(system!='http://snomed.info/sct').first() | text ).first())"
46
+ }
47
+ }
48
+ ],
49
+ "linkId": "59b1900a-4f85-4a8c-b9cd-3fe2fd76f27e",
50
+ "text": "Condition",
51
+ "type": "open-choice",
52
+ "answerValueSet": "https://smartforms.csiro.au/ig/ValueSet/MedicalHistory"
53
+ },
54
+ {
55
+ "extension": [
56
+ {
57
+ "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
58
+ "valueCodeableConcept": {
59
+ "coding": [
60
+ {
61
+ "system": "http://hl7.org/fhir/questionnaire-item-control",
62
+ "code": "drop-down"
63
+ }
64
+ ]
65
+ }
66
+ },
67
+ {
68
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
69
+ "valueExpression": {
70
+ "language": "text/fhirpath",
71
+ "expression": "%ConditionRepeat.clinicalStatus.coding"
72
+ }
73
+ }
74
+ ],
75
+ "linkId": "88bcfad7-386b-4d87-b34b-2e50482e4d2c",
76
+ "text": "Clinical Status",
77
+ "type": "choice",
78
+ "answerValueSet": "http://hl7.org/fhir/ValueSet/condition-clinical"
79
+ },
80
+ {
81
+ "extension": [
82
+ {
83
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
84
+ "valueExpression": {
85
+ "language": "text/fhirpath",
86
+ "expression": "%ConditionRepeat.onset.ofType(dateTime)"
87
+ }
88
+ }
89
+ ],
90
+ "linkId": "6ae641ad-95bb-4cdc-8910-5a52077e492c",
91
+ "text": "Onset Date",
92
+ "type": "date"
93
+ },
94
+ {
95
+ "extension": [
96
+ {
97
+ "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
98
+ "valueExpression": {
99
+ "language": "text/fhirpath",
100
+ "expression": "%ConditionRepeat.recordedDate"
101
+ }
102
+ }
103
+ ],
104
+ "linkId": "18b9e159-2ed7-4047-82b7-deb2a171de4f",
105
+ "text": "Recorded Date",
106
+ "type": "date"
107
+ }
108
+ ]
109
+ }