@aehrc/smart-forms-renderer 0.6.1 → 0.6.3

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 (177) hide show
  1. package/README.md +59 -0
  2. package/lib/index.d.ts +1 -1
  3. package/lib/index.js +1 -1
  4. package/lib/index.js.map +1 -1
  5. package/package.json +15 -4
  6. package/src/index.ts +1 -1
  7. package/lib/api/populate.d.ts +0 -8
  8. package/lib/api/populate.js +0 -63
  9. package/lib/api/populate.js.map +0 -1
  10. package/lib/components/FormComponents/ChoiceItems/ChoiceRadio.d.ts +0 -8
  11. package/lib/components/FormComponents/ChoiceItems/ChoiceRadio.js +0 -25
  12. package/lib/components/FormComponents/ChoiceItems/ChoiceRadio.js.map +0 -1
  13. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioButton.d.ts +0 -8
  14. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioButton.js +0 -25
  15. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioButton.js.map +0 -1
  16. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioSingleItem.d.ts +0 -8
  17. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioSingleItem.js +0 -25
  18. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioSingleItem.js.map +0 -1
  19. package/lib/components/FormComponents/ChoiceItems/QItemChoice.d.ts +0 -9
  20. package/lib/components/FormComponents/ChoiceItems/QItemChoice.js +0 -61
  21. package/lib/components/FormComponents/ChoiceItems/QItemChoice.js.map +0 -1
  22. package/lib/components/FormComponents/ChoiceItems/QItemChoiceAutocomplete.d.ts +0 -9
  23. package/lib/components/FormComponents/ChoiceItems/QItemChoiceAutocomplete.js +0 -89
  24. package/lib/components/FormComponents/ChoiceItems/QItemChoiceAutocomplete.js.map +0 -1
  25. package/lib/components/FormComponents/ChoiceItems/QItemChoiceCheckboxAnswerOption.d.ts +0 -11
  26. package/lib/components/FormComponents/ChoiceItems/QItemChoiceCheckboxAnswerOption.js +0 -70
  27. package/lib/components/FormComponents/ChoiceItems/QItemChoiceCheckboxAnswerOption.js.map +0 -1
  28. package/lib/components/FormComponents/ChoiceItems/QItemChoiceCheckboxAnswerValueSet.d.ts +0 -11
  29. package/lib/components/FormComponents/ChoiceItems/QItemChoiceCheckboxAnswerValueSet.js +0 -67
  30. package/lib/components/FormComponents/ChoiceItems/QItemChoiceCheckboxAnswerValueSet.js.map +0 -1
  31. package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioAnswerOption.d.ts +0 -11
  32. package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioAnswerOption.js +0 -70
  33. package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioAnswerOption.js.map +0 -1
  34. package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioAnswerValueSet.d.ts +0 -11
  35. package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioAnswerValueSet.js +0 -72
  36. package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioAnswerValueSet.js.map +0 -1
  37. package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioSingle.d.ts +0 -8
  38. package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioSingle.js +0 -25
  39. package/lib/components/FormComponents/ChoiceItems/QItemChoiceRadioSingle.js.map +0 -1
  40. package/lib/components/FormComponents/ChoiceItems/QItemChoiceSelectAnswerOption.d.ts +0 -9
  41. package/lib/components/FormComponents/ChoiceItems/QItemChoiceSelectAnswerOption.js +0 -73
  42. package/lib/components/FormComponents/ChoiceItems/QItemChoiceSelectAnswerOption.js.map +0 -1
  43. package/lib/components/FormComponents/ChoiceItems/QItemChoiceSelectAnswerValueSet.d.ts +0 -9
  44. package/lib/components/FormComponents/ChoiceItems/QItemChoiceSelectAnswerValueSet.js +0 -82
  45. package/lib/components/FormComponents/ChoiceItems/QItemChoiceSelectAnswerValueSet.js.map +0 -1
  46. package/lib/components/FormComponents/ItemParts/CheckboxWithOpenLabel.d.ts +0 -10
  47. package/lib/components/FormComponents/ItemParts/CheckboxWithOpenLabel.js +0 -35
  48. package/lib/components/FormComponents/ItemParts/CheckboxWithOpenLabel.js.map +0 -1
  49. package/lib/components/FormComponents/ItemParts/QItemCheckboxSingle.d.ts +0 -10
  50. package/lib/components/FormComponents/ItemParts/QItemCheckboxSingle.js +0 -25
  51. package/lib/components/FormComponents/ItemParts/QItemCheckboxSingle.js.map +0 -1
  52. package/lib/components/FormComponents/ItemParts/QItemCheckboxSingleWithOpenLabel.d.ts +0 -10
  53. package/lib/components/FormComponents/ItemParts/QItemCheckboxSingleWithOpenLabel.js +0 -35
  54. package/lib/components/FormComponents/ItemParts/QItemCheckboxSingleWithOpenLabel.js.map +0 -1
  55. package/lib/components/FormComponents/ItemParts/QItemRadioButtonWithOpenLabel.d.ts +0 -10
  56. package/lib/components/FormComponents/ItemParts/QItemRadioButtonWithOpenLabel.js +0 -31
  57. package/lib/components/FormComponents/ItemParts/QItemRadioButtonWithOpenLabel.js.map +0 -1
  58. package/lib/components/FormComponents/ItemParts/RadioButtonItemWithOpenLabel.d.ts +0 -10
  59. package/lib/components/FormComponents/ItemParts/RadioButtonItemWithOpenLabel.js +0 -31
  60. package/lib/components/FormComponents/ItemParts/RadioButtonItemWithOpenLabel.js.map +0 -1
  61. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoice.d.ts +0 -9
  62. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoice.js +0 -49
  63. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoice.js.map +0 -1
  64. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceAutocomplete.d.ts +0 -9
  65. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceAutocomplete.js +0 -109
  66. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceAutocomplete.js.map +0 -1
  67. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceCheckboxAnswerOption.d.ts +0 -11
  68. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceCheckboxAnswerOption.js +0 -105
  69. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceCheckboxAnswerOption.js.map +0 -1
  70. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceRadioAnswerOption.d.ts +0 -11
  71. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceRadioAnswerOption.js +0 -116
  72. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceRadioAnswerOption.js.map +0 -1
  73. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceSelectAnswerOption.d.ts +0 -9
  74. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceSelectAnswerOption.js +0 -75
  75. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceSelectAnswerOption.js.map +0 -1
  76. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceSelectAnswerValueSet.d.ts +0 -9
  77. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceSelectAnswerValueSet.js +0 -68
  78. package/lib/components/FormComponents/OpenChoiceItems/QItemOpenChoiceSelectAnswerValueSet.js.map +0 -1
  79. package/lib/components/FormComponents/QItemChoice/QItemChoice.d.ts +0 -9
  80. package/lib/components/FormComponents/QItemChoice/QItemChoice.js +0 -61
  81. package/lib/components/FormComponents/QItemChoice/QItemChoice.js.map +0 -1
  82. package/lib/components/FormComponents/QItemChoice/QItemChoiceAutocomplete.d.ts +0 -9
  83. package/lib/components/FormComponents/QItemChoice/QItemChoiceAutocomplete.js +0 -89
  84. package/lib/components/FormComponents/QItemChoice/QItemChoiceAutocomplete.js.map +0 -1
  85. package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerOption.d.ts +0 -11
  86. package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerOption.js +0 -70
  87. package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerOption.js.map +0 -1
  88. package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerValueSet.d.ts +0 -11
  89. package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerValueSet.js +0 -67
  90. package/lib/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerValueSet.js.map +0 -1
  91. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerOption.d.ts +0 -11
  92. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerOption.js +0 -70
  93. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerOption.js.map +0 -1
  94. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerValueSet.d.ts +0 -11
  95. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerValueSet.js +0 -72
  96. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerValueSet.js.map +0 -1
  97. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioSingle.d.ts +0 -8
  98. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioSingle.js +0 -25
  99. package/lib/components/FormComponents/QItemChoice/QItemChoiceRadioSingle.js.map +0 -1
  100. package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerOption.d.ts +0 -9
  101. package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerOption.js +0 -73
  102. package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerOption.js.map +0 -1
  103. package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerValueSet.d.ts +0 -9
  104. package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerValueSet.js +0 -82
  105. package/lib/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerValueSet.js.map +0 -1
  106. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoice.d.ts +0 -9
  107. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoice.js +0 -49
  108. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoice.js.map +0 -1
  109. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceAutocomplete.d.ts +0 -9
  110. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceAutocomplete.js +0 -109
  111. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceAutocomplete.js.map +0 -1
  112. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceCheckboxAnswerOption.d.ts +0 -11
  113. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceCheckboxAnswerOption.js +0 -105
  114. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceCheckboxAnswerOption.js.map +0 -1
  115. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceRadioAnswerOption.d.ts +0 -11
  116. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceRadioAnswerOption.js +0 -116
  117. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceRadioAnswerOption.js.map +0 -1
  118. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerOption.d.ts +0 -9
  119. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerOption.js +0 -75
  120. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerOption.js.map +0 -1
  121. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.d.ts +0 -9
  122. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.js +0 -68
  123. package/lib/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.js.map +0 -1
  124. package/lib/components/FormRenderer/BaseRenderer.d.ts +0 -3
  125. package/lib/components/FormRenderer/BaseRenderer.js +0 -54
  126. package/lib/components/FormRenderer/BaseRenderer.js.map +0 -1
  127. package/lib/components/FormRenderer/FormBodyCollapsible.d.ts +0 -9
  128. package/lib/components/FormRenderer/FormBodyCollapsible.js +0 -57
  129. package/lib/components/FormRenderer/FormBodyCollapsible.js.map +0 -1
  130. package/lib/components/FormRenderer/FormBodySingleCollapsible.d.ts +0 -12
  131. package/lib/components/FormRenderer/FormBodySingleCollapsible.js +0 -39
  132. package/lib/components/FormRenderer/FormBodySingleCollapsible.js.map +0 -1
  133. package/lib/components/FormRenderer/FormBodySingleCollapsibleWrapper.d.ts +0 -12
  134. package/lib/components/FormRenderer/FormBodySingleCollapsibleWrapper.js +0 -31
  135. package/lib/components/FormRenderer/FormBodySingleCollapsibleWrapper.js.map +0 -1
  136. package/lib/components/FormRenderer/FormBodyTabbed.d.ts +0 -9
  137. package/lib/components/FormRenderer/FormBodyTabbed.js +0 -60
  138. package/lib/components/FormRenderer/FormBodyTabbed.js.map +0 -1
  139. package/lib/components/FormRenderer/FormRenderer.d.ts +0 -3
  140. package/lib/components/FormRenderer/FormRenderer.js +0 -54
  141. package/lib/components/FormRenderer/FormRenderer.js.map +0 -1
  142. package/lib/components/FormRenderer/FormTitle.d.ts +0 -7
  143. package/lib/components/FormRenderer/FormTitle.js +0 -30
  144. package/lib/components/FormRenderer/FormTitle.js.map +0 -1
  145. package/lib/components/FormRenderer/FormTopLevelItem.d.ts +0 -9
  146. package/lib/components/FormRenderer/FormTopLevelItem.js +0 -45
  147. package/lib/components/FormRenderer/FormTopLevelItem.js.map +0 -1
  148. package/lib/components/FormRenderer/SmartFormsRenderer.d.ts +0 -9
  149. package/lib/components/FormRenderer/SmartFormsRenderer.js +0 -39
  150. package/lib/components/FormRenderer/SmartFormsRenderer.js.map +0 -1
  151. package/lib/components/FormRenderer/index.d.ts +0 -2
  152. package/lib/components/FormRenderer/index.js +0 -19
  153. package/lib/components/FormRenderer/index.js.map +0 -1
  154. package/lib/contexts/TestContext.d.ts +0 -11
  155. package/lib/contexts/TestContext.js +0 -32
  156. package/lib/contexts/TestContext.js.map +0 -1
  157. package/lib/contexts/index.d.ts +0 -1
  158. package/lib/contexts/index.js +0 -2
  159. package/lib/contexts/index.js.map +0 -1
  160. package/lib/hooks/useTestContext.d.ts +0 -5
  161. package/lib/hooks/useTestContext.js +0 -27
  162. package/lib/hooks/useTestContext.js.map +0 -1
  163. package/lib/stores/useConfigStore.d.ts +0 -18
  164. package/lib/stores/useConfigStore.js +0 -17
  165. package/lib/stores/useConfigStore.js.map +0 -1
  166. package/lib/stores/useSmartClientStore.d.ts +0 -7
  167. package/lib/stores/useSmartClientStore.js +0 -7
  168. package/lib/stores/useSmartClientStore.js.map +0 -1
  169. package/lib/theme/globalStyles.d.ts +0 -2
  170. package/lib/theme/globalStyles.js +0 -64
  171. package/lib/theme/globalStyles.js.map +0 -1
  172. package/lib/utils/populate.d.ts +0 -16
  173. package/lib/utils/populate.js +0 -78
  174. package/lib/utils/populate.js.map +0 -1
  175. package/lib/utils/populateCallback.d.ts +0 -6
  176. package/lib/utils/populateCallback.js +0 -40
  177. package/lib/utils/populateCallback.js.map +0 -1
@@ -1,70 +0,0 @@
1
- /*
2
- * Copyright 2023 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
- import React from 'react';
18
- import Grid from '@mui/material/Grid';
19
- import { QItemChoiceOrientation } from '../../../interfaces/choice.enum';
20
- import { findInAnswerOptions, getQrChoiceValue } from '../../../utils/choice';
21
- import QItemChoiceRadioSingle from './QItemChoiceRadioSingle';
22
- import { createEmptyQrItem } from '../../../utils/qrItem';
23
- import { QRadioGroup } from '../Item.styles';
24
- import { FullWidthFormComponentBox } from '../../Box.styles';
25
- import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
26
- import DisplayInstructions from '../DisplayItem/DisplayInstructions';
27
- import LabelWrapper from '../ItemParts/ItemLabelWrapper';
28
- function QItemChoiceRadioAnswerOption(props) {
29
- var _a;
30
- const { qItem, qrItem, isRepeated, onQrItemChange, orientation } = props;
31
- // Init input value
32
- const qrChoiceRadio = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem);
33
- const valueRadio = getQrChoiceValue(qrChoiceRadio);
34
- // Get additional rendering extensions
35
- const { displayInstructions, readOnly } = useRenderingExtensions(qItem);
36
- // Event handlers
37
- function handleChange(e) {
38
- if (qItem.answerOption) {
39
- const qrAnswer = findInAnswerOptions(qItem.answerOption, e.target.value);
40
- if (qrAnswer) {
41
- onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [qrAnswer] }));
42
- }
43
- }
44
- }
45
- const choiceRadio = (React.createElement(QRadioGroup, { row: orientation === QItemChoiceOrientation.Horizontal, name: qItem.text, id: qItem.id, onChange: handleChange, value: valueRadio, "data-test": "q-item-radio-group" }, (_a = qItem.answerOption) === null || _a === void 0 ? void 0 : _a.map((option) => {
46
- var _a, _b, _c;
47
- if (option['valueCoding']) {
48
- return (React.createElement(QItemChoiceRadioSingle, { key: (_a = option.valueCoding.code) !== null && _a !== void 0 ? _a : '', value: (_b = option.valueCoding.code) !== null && _b !== void 0 ? _b : '', label: (_c = option.valueCoding.display) !== null && _c !== void 0 ? _c : `${option.valueCoding.code}`, readOnly: readOnly }));
49
- }
50
- else if (option['valueString']) {
51
- return (React.createElement(QItemChoiceRadioSingle, { key: option.valueString, value: option.valueString, label: option.valueString, readOnly: readOnly }));
52
- }
53
- else if (option['valueInteger']) {
54
- return (React.createElement(QItemChoiceRadioSingle, { key: option.valueInteger, value: option.valueInteger.toString(), label: option.valueInteger.toString(), readOnly: readOnly }));
55
- }
56
- else {
57
- return null;
58
- }
59
- })));
60
- const renderQItemChoiceRadio = isRepeated ? (React.createElement(React.Fragment, null, choiceRadio)) : (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-choice-radio-answer-option-box" },
61
- React.createElement(Grid, { container: true, columnSpacing: 6 },
62
- React.createElement(Grid, { item: true, xs: 5 },
63
- React.createElement(LabelWrapper, { qItem: qItem })),
64
- React.createElement(Grid, { item: true, xs: 7 },
65
- choiceRadio,
66
- React.createElement(DisplayInstructions, { displayInstructions: displayInstructions })))));
67
- return React.createElement(React.Fragment, null, renderQItemChoiceRadio);
68
- }
69
- export default QItemChoiceRadioAnswerOption;
70
- //# sourceMappingURL=QItemChoiceRadioAnswerOption.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QItemChoiceRadioAnswerOption.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerOption.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAK3E,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,YAAY,MAAM,+BAA+B,CAAC;AAUzD,SAAS,4BAA4B,CAAC,KAAY;;IAChD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAEzE,mBAAmB;IACnB,MAAM,aAAa,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACzD,M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AE,MAAM,CAAC,WAAW,EACvB,KAAK,EAAE,MAAM,CAAC,WAAW,EACzB,KAAK,EAAE,MAAM,CAAC,WAAW,EACzB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;SACH;aAAM,IAAI,MAAM,CAAC,cAAc,CAAC,EAAE;YACjC,OAAO,CACL,oBAAC,sBAAsB,IACrB,GAAG,EAAE,MAAM,CAAC,YAAY,EACxB,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,EACrC,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,EACrC,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;SACH;aAAM;YACL,OAAO,IAAI,CAAC;SACb;IACH,CAAC,CAAC,CACU,CACf,CAAC;IAEF,MAAM,sBAAsB,GAAG,UAAU,CAAC,CAAC,CAAC,CAC1C,0CAAG,WAAW,CAAI,CACnB,CAAC,CAAC,CAAC,CACF,oBAAC,yBAAyB,iBAAW,uCAAuC;QAC1E,oBAAC,IAAI,IAAC,SAAS,QAAC,aAAa,EAAE,CAAC;YAC9B,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;gBACd,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,GAAI,CACzB;YACP,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;gBACb,WAAW;gBACZ,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,GAAI,CAC5D,CACF,CACmB,CAC7B,CAAC;IACF,OAAO,0CAAG,sBAAsB,CAAI,CAAC;AACvC,CAAC;AAED,eAAe,4BAA4B,CAAC"}
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { QItemChoiceOrientation } from '../../../interfaces/choice.enum';
3
- import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
4
- import type { PropsWithIsRepeatedAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
5
- interface Props extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute {
6
- qItem: QuestionnaireItem;
7
- qrItem: QuestionnaireResponseItem;
8
- orientation: QItemChoiceOrientation;
9
- }
10
- declare function QItemChoiceRadioAnswerValueSet(props: Props): React.JSX.Element;
11
- export default QItemChoiceRadioAnswerValueSet;
@@ -1,72 +0,0 @@
1
- /*
2
- * Copyright 2023 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
- import React from 'react';
18
- import Grid from '@mui/material/Grid';
19
- import Typography from '@mui/material/Typography';
20
- import { QItemChoiceOrientation } from '../../../interfaces/choice.enum';
21
- import { findInAnswerValueSetCodings } from '../../../utils/choice';
22
- import QItemChoiceRadioSingle from './QItemChoiceRadioSingle';
23
- import { createEmptyQrItem } from '../../../utils/qrItem';
24
- import { QRadioGroup } from '../Item.styles';
25
- import { FullWidthFormComponentBox } from '../../Box.styles';
26
- import useValueSetCodings from '../../../hooks/useValueSetCodings';
27
- import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
28
- import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
29
- import { StyledAlert } from '../../Alert.styles';
30
- import DisplayInstructions from '../DisplayItem/DisplayInstructions';
31
- import LabelWrapper from '../ItemParts/ItemLabelWrapper';
32
- function QItemChoiceRadioAnswerValueSet(props) {
33
- var _a;
34
- const { qItem, qrItem, isRepeated, onQrItemChange, orientation } = props;
35
- // Init input value
36
- const qrChoiceRadio = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem);
37
- let valueRadio;
38
- if (qrChoiceRadio.answer) {
39
- valueRadio = (_a = qrChoiceRadio.answer[0].valueCoding) === null || _a === void 0 ? void 0 : _a.code;
40
- }
41
- // Get additional rendering extensions
42
- const { displayInstructions, readOnly } = useRenderingExtensions(qItem);
43
- console.log(qItem);
44
- // Get codings/options from valueSet
45
- const { codings, serverError } = useValueSetCodings(qItem);
46
- function handleChange(event) {
47
- if (codings.length > 0) {
48
- const qrAnswer = findInAnswerValueSetCodings(codings, event.target.value);
49
- if (qrAnswer) {
50
- onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueCoding: qrAnswer }] }));
51
- }
52
- }
53
- }
54
- const choiceRadio = codings.length > 0 ? (React.createElement(QRadioGroup, { row: orientation === QItemChoiceOrientation.Horizontal, name: qItem.text, id: qItem.id, onChange: handleChange, value: valueRadio !== null && valueRadio !== void 0 ? valueRadio : null }, codings.map((coding) => {
55
- var _a, _b, _c;
56
- return (React.createElement(QItemChoiceRadioSingle, { key: (_a = coding.code) !== null && _a !== void 0 ? _a : '', value: (_b = coding.code) !== null && _b !== void 0 ? _b : '', label: (_c = coding.display) !== null && _c !== void 0 ? _c : `${coding.code}`, readOnly: readOnly }));
57
- }))) : serverError ? (React.createElement(StyledAlert, { color: "error" },
58
- React.createElement(ErrorOutlineIcon, { color: "error", sx: { pr: 0.75 } }),
59
- React.createElement(Typography, { variant: "subtitle2" }, "There was an error fetching options from the terminology server"))) : (React.createElement(StyledAlert, { color: "error" },
60
- React.createElement(ErrorOutlineIcon, { color: "error", sx: { pr: 0.75 } }),
61
- React.createElement(Typography, { variant: "subtitle2" }, "Unable to fetch options from the questionnaire or launch context")));
62
- const renderQItemChoiceRadio = isRepeated ? (React.createElement(React.Fragment, null, choiceRadio)) : (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-choice-radio-answer-value-set-box" },
63
- React.createElement(Grid, { container: true, columnSpacing: 6 },
64
- React.createElement(Grid, { item: true, xs: 5 },
65
- React.createElement(LabelWrapper, { qItem: qItem })),
66
- React.createElement(Grid, { item: true, xs: 7 },
67
- choiceRadio,
68
- React.createElement(DisplayInstructions, { displayInstructions: displayInstructions })))));
69
- return React.createElement(React.Fragment, null, renderQItemChoiceRadio);
70
- }
71
- export default QItemChoiceRadioAnswerValueSet;
72
- //# sourceMappingURL=QItemChoiceRadioAnswerValueSet.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QItemChoiceRadioAnswerValueSet.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerValueSet.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AACnE,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAKhE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,YAAY,MAAM,+BAA+B,CAAC;AAUzD,SAAS,8BAA8B,CAAC,KAAY;;IAClD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;I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CAAC;AACvC,CAAC;AAED,eAAe,8BAA8B,CAAC"}
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- interface Props {
3
- value: string;
4
- label: string;
5
- readOnly: boolean;
6
- }
7
- declare function QItemChoiceRadioSingle(props: Props): React.JSX.Element;
8
- export default QItemChoiceRadioSingle;
@@ -1,25 +0,0 @@
1
- /*
2
- * Copyright 2023 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
- import React from 'react';
18
- import FormControlLabel from '@mui/material/FormControlLabel';
19
- import Radio from '@mui/material/Radio';
20
- function QItemChoiceRadioSingle(props) {
21
- const { value, label, readOnly } = props;
22
- return (React.createElement(FormControlLabel, { disabled: readOnly, value: value, control: React.createElement(Radio, { size: "small" }), label: label, sx: { mr: 3 } }));
23
- }
24
- export default QItemChoiceRadioSingle;
25
- //# sourceMappingURL=QItemChoiceRadioSingle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QItemChoiceRadioSingle.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/QItemChoice/QItemChoiceRadioSingle.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,MAAM,qBAAqB,CAAC;AAQxC,SAAS,sBAAsB,CAAC,KAAY;IAC1C,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEzC,OAAO,CACL,oBAAC,gBAAgB,IACf,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,oBAAC,KAAK,IAAC,IAAI,EAAC,OAAO,GAAG,EAC/B,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GACb,CACH,CAAC;AACJ,CAAC;AAED,eAAe,sBAAsB,CAAC"}
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
- import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
4
- interface Props extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute {
5
- qItem: QuestionnaireItem;
6
- qrItem: QuestionnaireResponseItem;
7
- }
8
- declare function QItemChoiceSelectAnswerOption(props: Props): React.JSX.Element;
9
- export default QItemChoiceSelectAnswerOption;
@@ -1,73 +0,0 @@
1
- /*
2
- * Copyright 2023 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
- import React, { Fragment } from 'react';
18
- import Grid from '@mui/material/Grid';
19
- import InputAdornment from '@mui/material/InputAdornment';
20
- import MenuItem from '@mui/material/MenuItem';
21
- import Select from '@mui/material/Select';
22
- import { findInAnswerOptions, getQrChoiceValue } from '../../../utils/choice';
23
- import { createEmptyQrItem } from '../../../utils/qrItem';
24
- import { FullWidthFormComponentBox } from '../../Box.styles';
25
- import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
26
- import DisplayInstructions from '../DisplayItem/DisplayInstructions';
27
- import LabelWrapper from '../ItemParts/ItemLabelWrapper';
28
- function QItemChoiceSelectAnswerOption(props) {
29
- var _a;
30
- const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
31
- // Init input value
32
- const qrChoiceSelect = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem);
33
- let valueSelect = getQrChoiceValue(qrChoiceSelect);
34
- if (valueSelect === null) {
35
- valueSelect = '';
36
- }
37
- // Get additional rendering extensions
38
- const { displayUnit, displayPrompt, displayInstructions, readOnly, entryFormat } = useRenderingExtensions(qItem);
39
- // Event handlers
40
- function handleChange(e) {
41
- if (qItem.answerOption) {
42
- const qrAnswer = findInAnswerOptions(qItem.answerOption, e.target.value);
43
- if (qrAnswer) {
44
- onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [qrAnswer] }));
45
- return;
46
- }
47
- }
48
- onQrItemChange(createEmptyQrItem(qItem));
49
- }
50
- const choiceSelectAnswerOption = (React.createElement(Select, { id: qItem.id, name: qItem.text, value: valueSelect, disabled: readOnly, fullWidth: true, placeholder: entryFormat, label: displayPrompt, endAdornment: React.createElement(InputAdornment, { position: 'end' }, displayUnit), sx: { maxWidth: !isTabled ? 280 : 3000, minWidth: 160 }, size: "small", onChange: handleChange }, (_a = qItem.answerOption) === null || _a === void 0 ? void 0 : _a.map((option, index) => {
51
- var _a;
52
- if (option['valueCoding']) {
53
- return (React.createElement(MenuItem, { key: option.valueCoding.code, value: option.valueCoding.code }, (_a = option.valueCoding.display) !== null && _a !== void 0 ? _a : option.valueCoding.code));
54
- }
55
- if (option['valueString']) {
56
- return (React.createElement(MenuItem, { key: option.valueString, value: option.valueString }, option.valueString));
57
- }
58
- if (option['valueInteger']) {
59
- return (React.createElement(MenuItem, { key: option.valueInteger, value: option.valueInteger.toString() }, option.valueInteger));
60
- }
61
- return React.createElement(Fragment, { key: index });
62
- })));
63
- const renderQItemChoiceSelectAnswerOption = isRepeated ? (React.createElement(React.Fragment, null, choiceSelectAnswerOption)) : (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-choice-select-answer-option-box" },
64
- React.createElement(Grid, { container: true, columnSpacing: 6 },
65
- React.createElement(Grid, { item: true, xs: 5 },
66
- React.createElement(LabelWrapper, { qItem: qItem })),
67
- React.createElement(Grid, { item: true, xs: 7 },
68
- choiceSelectAnswerOption,
69
- React.createElement(DisplayInstructions, { displayInstructions: displayInstructions })))));
70
- return React.createElement(React.Fragment, null, renderQItemChoiceSelectAnswerOption);
71
- }
72
- export default QItemChoiceSelectAnswerOption;
73
- //# sourceMappingURL=QItemChoiceSelectAnswerOption.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QItemChoiceSelectAnswerOption.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerOption.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAE9C,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAG1C,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAM3E,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,YAAY,MAAM,+BAA+B,CAAC;AAUzD,SAAS,6BAA6B,CAAC,KAA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;gBACd,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,GAAI,CACzB;YACP,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;gBACb,wBAAwB;gBACzB,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,GAAI,CAC5D,CACF,CACmB,CAC7B,CAAC;IACF,OAAO,0CAAG,mCAAmC,CAAI,CAAC;AACpD,CAAC;AAED,eAAe,6BAA6B,CAAC"}
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
- import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
4
- interface Props extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute {
5
- qItem: QuestionnaireItem;
6
- qrItem: QuestionnaireResponseItem;
7
- }
8
- declare function QItemChoiceSelectAnswerValueSet(props: Props): React.JSX.Element;
9
- export default QItemChoiceSelectAnswerValueSet;
@@ -1,82 +0,0 @@
1
- /*
2
- * Copyright 2023 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
- import React, { useEffect, useMemo } from 'react';
18
- import Autocomplete from '@mui/material/Autocomplete';
19
- import Grid from '@mui/material/Grid';
20
- import Typography from '@mui/material/Typography';
21
- import { createEmptyQrItem } from '../../../utils/qrItem';
22
- import { StandardTextField } from '../Textfield.styles';
23
- import { FullWidthFormComponentBox } from '../../Box.styles';
24
- import useValueSetCodings from '../../../hooks/useValueSetCodings';
25
- import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
26
- import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
27
- import { StyledAlert } from '../../Alert.styles';
28
- import DisplayInstructions from '../DisplayItem/DisplayInstructions';
29
- import LabelWrapper from '../ItemParts/ItemLabelWrapper';
30
- function QItemChoiceSelectAnswerValueSet(props) {
31
- const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
32
- // Init input value
33
- const qrChoiceSelect = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem);
34
- let valueCoding;
35
- if (qrChoiceSelect.answer) {
36
- valueCoding = qrChoiceSelect.answer[0].valueCoding;
37
- }
38
- // Get additional rendering extensions
39
- const { displayUnit, displayPrompt, displayInstructions, readOnly, entryFormat } = useRenderingExtensions(qItem);
40
- // Get codings/options from valueSet
41
- const { codings, serverError } = useValueSetCodings(qItem);
42
- valueCoding = useMemo(() => {
43
- const updatedValueCoding = codings.find((queriedCoding) => queriedCoding.code === (valueCoding === null || valueCoding === void 0 ? void 0 : valueCoding.code));
44
- return updatedValueCoding !== null && updatedValueCoding !== void 0 ? updatedValueCoding : valueCoding;
45
- }, [codings, valueCoding]);
46
- // Check and remove populated answer if it is a string
47
- // NOTE: $populate will try to populate answer as valueCoding,
48
- // but will fail if answer provided is not within options
49
- useEffect(() => {
50
- if (qrChoiceSelect.answer && qrChoiceSelect.answer[0].valueString) {
51
- onQrItemChange(createEmptyQrItem(qItem));
52
- }
53
- },
54
- // Only run effect once - on populate
55
- // eslint-disable-next-line react-hooks/exhaustive-deps
56
- []);
57
- // Event handlers
58
- function handleChange(_, newValue) {
59
- if (newValue) {
60
- onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueCoding: newValue }] }));
61
- return;
62
- }
63
- onQrItemChange(createEmptyQrItem(qItem));
64
- }
65
- const choiceSelectAnswerValueSet = codings.length > 0 ? (React.createElement(Autocomplete, { id: qItem.id, options: codings, getOptionLabel: (option) => `${option.display}`, value: valueCoding !== null && valueCoding !== void 0 ? valueCoding : null, onChange: handleChange, openOnFocus: true, autoHighlight: true, sx: { maxWidth: !isTabled ? 280 : 3000, minWidth: 160, flexGrow: 1 }, size: "small", disabled: readOnly, placeholder: entryFormat, renderInput: (params) => (React.createElement(StandardTextField, Object.assign({ isTabled: isTabled, label: displayPrompt }, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { endAdornment: (React.createElement(React.Fragment, null,
66
- params.InputProps.endAdornment,
67
- displayUnit)) }), "data-test": "q-item-choice-dropdown-answer-value-set-field" }))) })) : serverError ? (React.createElement(StyledAlert, { color: "error" },
68
- React.createElement(ErrorOutlineIcon, { color: "error", sx: { pr: 0.75 } }),
69
- React.createElement(Typography, { variant: "subtitle2" }, "There was an error fetching options from the terminology server"))) : (React.createElement(StyledAlert, { color: "error" },
70
- React.createElement(ErrorOutlineIcon, { color: "error", sx: { pr: 0.75 } }),
71
- React.createElement(Typography, { variant: "subtitle2" }, "Unable to fetch options from the questionnaire or launch context")));
72
- const renderQItemChoiceSelectAnswerValueSet = isRepeated ? (React.createElement(React.Fragment, null, choiceSelectAnswerValueSet)) : (React.createElement(FullWidthFormComponentBox, { "data-test": "q-item-choice-dropdown-answer-value-set-box" },
73
- React.createElement(Grid, { container: true, columnSpacing: 6 },
74
- React.createElement(Grid, { item: true, xs: 5 },
75
- React.createElement(LabelWrapper, { qItem: qItem })),
76
- React.createElement(Grid, { item: true, xs: 7 },
77
- choiceSelectAnswerValueSet,
78
- React.createElement(DisplayInstructions, { displayInstructions: displayInstructions })))));
79
- return React.createElement(React.Fragment, null, renderQItemChoiceSelectAnswerValueSet);
80
- }
81
- export default QItemChoiceSelectAnswerValueSet;
82
- //# sourceMappingURL=QItemChoiceSelectAnswerValueSet.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QItemChoiceSelectAnswerValueSet.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,yBAAyB,iBAAW,6CAA6C;QAChF,oBAAC,IAAI,IAAC,SAAS,QAAC,aAAa,EAAE,CAAC;YAC9B,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;gBACd,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,GAAI,CACzB;YACP,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC;gBACb,0BAA0B;gBAC3B,oBAAC,mBAAmB,IAAC,mBAAmB,EAAE,mBAAmB,GAAI,CAC5D,CACF,CACmB,CAC7B,CAAC;IACF,OAAO,0CAAG,qCAAqC,CAAI,CAAC;AACtD,CAAC;AAED,eAAe,+BAA+B,CAAC"}
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
- import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
4
- interface Props extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute {
5
- qItem: QuestionnaireItem;
6
- qrItem: QuestionnaireResponseItem;
7
- }
8
- declare function QItemOpenChoice(props: Props): React.JSX.Element | null;
9
- export default QItemOpenChoice;
@@ -1,49 +0,0 @@
1
- /*
2
- * Copyright 2023 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
- import React from 'react';
18
- import { QItemOpenChoiceControl } from '../../../interfaces/choice.enum';
19
- import QItemOpenChoiceSelectAnswerOption from './QItemOpenChoiceSelectAnswerOption';
20
- import QItemOpenChoiceSelectAnswerValueSet from './QItemOpenChoiceSelectAnswerValueSet';
21
- import QItemOpenChoiceAutocomplete from './QItemOpenChoiceAutocomplete';
22
- import { getOpenChoiceControlType } from '../../../utils/openChoice';
23
- import { getChoiceOrientation } from '../../../utils/choice';
24
- import QItemOpenChoiceCheckboxAnswerOption from './QItemOpenChoiceCheckboxAnswerOption';
25
- import QItemOpenChoiceRadioAnswerOption from './QItemOpenChoiceRadioAnswerOption';
26
- function QItemOpenChoice(props) {
27
- var _a, _b;
28
- const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
29
- const orientation = getChoiceOrientation(qItem);
30
- switch (getOpenChoiceControlType(qItem)) {
31
- case QItemOpenChoiceControl.Checkbox:
32
- return (React.createElement(QItemOpenChoiceCheckboxAnswerOption, { qItem: qItem, qrItem: qrItem, isRepeated: (_a = qItem['repeats']) !== null && _a !== void 0 ? _a : false, onQrItemChange: onQrItemChange, orientation: orientation }));
33
- case QItemOpenChoiceControl.Radio:
34
- return (React.createElement(QItemOpenChoiceRadioAnswerOption, { qItem: qItem, qrItem: qrItem, isRepeated: (_b = qItem['repeats']) !== null && _b !== void 0 ? _b : false, onQrItemChange: onQrItemChange, orientation: orientation }));
35
- case QItemOpenChoiceControl.Autocomplete:
36
- return (React.createElement(QItemOpenChoiceAutocomplete, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: onQrItemChange }));
37
- case QItemOpenChoiceControl.Select:
38
- if (qItem.answerValueSet) {
39
- return (React.createElement(QItemOpenChoiceSelectAnswerValueSet, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: onQrItemChange }));
40
- }
41
- else {
42
- return (React.createElement(QItemOpenChoiceSelectAnswerOption, { qItem: qItem, qrItem: qrItem, isRepeated: isRepeated, isTabled: isTabled, onQrItemChange: onQrItemChange }));
43
- }
44
- default:
45
- return null;
46
- }
47
- }
48
- export default QItemOpenChoice;
49
- //# sourceMappingURL=QItemOpenChoice.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QItemOpenChoice.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/QItemOpenChoice/QItemOpenChoice.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,OAAO,iCAAiC,MAAM,qCAAqC,CAAC;AACpF,OAAO,mCAAmC,MAAM,uCAAuC,CAAC;AACxF,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,mCAAmC,MAAM,uCAAuC,CAAC;AACxF,OAAO,gCAAgC,MAAM,oCAAoC,CAAC;AAelF,SAAS,eAAe,CAAC,KAAY;;IACnC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IACtE,MAAM,WAAW,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAEhD,QAAQ,wBAAwB,CAAC,KAAK,CAAC,EAAE;QACvC,KAAK,sBAAsB,CAAC,QAAQ;YAClC,OAAO,CACL,oBAAC,mCAAmC,IAClC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAA,KAAK,CAAC,SAAS,CAAC,mCAAI,KAAK,EACrC,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,GACxB,CACH,CAAC;QACJ,KAAK,sBAAsB,CAAC,KAAK;YAC/B,OAAO,CACL,oBAAC,gCAAgC,IAC/B,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAA,KAAK,CAAC,SAAS,CAAC,mCAAI,KAAK,EACrC,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,GACxB,CACH,CAAC;QACJ,KAAK,sBAAsB,CAAC,YAAY;YACtC,OAAO,CACL,oBAAC,2BAA2B,IAC1B,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;QACJ,KAAK,sBAAsB,CAAC,MAAM;YAChC,IAAI,KAAK,CAAC,cAAc,EAAE;gBACxB,OAAO,CACL,oBAAC,mCAAmC,IAClC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;aACH;iBAAM;gBACL,OAAO,CACL,oBAAC,iCAAiC,IAChC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;aACH;QACH;YACE,OAAO,IAAI,CAAC;KACf;AACH,CAAC;AAED,eAAe,eAAe,CAAC"}
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
- import type { PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithQrItemChangeHandler } from '../../../interfaces/renderProps.interface';
4
- interface QItemOpenChoiceAutocompleteProps extends PropsWithQrItemChangeHandler<QuestionnaireResponseItem>, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute {
5
- qItem: QuestionnaireItem;
6
- qrItem: QuestionnaireResponseItem;
7
- }
8
- declare function QItemOpenChoiceAutocomplete(props: QItemOpenChoiceAutocompleteProps): React.JSX.Element | null;
9
- export default QItemOpenChoiceAutocomplete;
@@ -1,109 +0,0 @@
1
- /*
2
- * Copyright 2023 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
- import React, { useState } from 'react';
18
- import Autocomplete from '@mui/material/Autocomplete';
19
- import Box from '@mui/material/Box';
20
- import CircularProgress from '@mui/material/CircularProgress';
21
- import Fade from '@mui/material/Fade';
22
- import Grid from '@mui/material/Grid';
23
- import Tooltip from '@mui/material/Tooltip';
24
- import { createEmptyQrItem } from '../../../utils/qrItem';
25
- import { StandardTextField } from '../Textfield.styles';
26
- import { FullWidthFormComponentBox } from '../../Box.styles';
27
- import SearchIcon from '@mui/icons-material/Search';
28
- import useDebounce from '../../../hooks/useDebounce';
29
- import useTerminologyServerQuery from '../../../hooks/useTerminologyServerQuery';
30
- import WarningAmberIcon from '@mui/icons-material/WarningAmber';
31
- import InfoIcon from '@mui/icons-material/Info';
32
- import DoneIcon from '@mui/icons-material/Done';
33
- import ErrorIcon from '@mui/icons-material/Error';
34
- import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
35
- import { getTerminologyServerUrl } from '../../../utils/valueSet';
36
- import { AUTOCOMPLETE_DEBOUNCE_DURATION } from '../../../utils/debounce';
37
- import DisplayInstructions from '../DisplayItem/DisplayInstructions';
38
- import LabelWrapper from '../ItemParts/ItemLabelWrapper';
39
- function QItemOpenChoiceAutocomplete(props) {
40
- const { qItem, qrItem, isRepeated, isTabled, onQrItemChange } = props;
41
- const qrOpenChoice = qrItem !== null && qrItem !== void 0 ? qrItem : createEmptyQrItem(qItem);
42
- // Init input value
43
- let valueAutocomplete;
44
- if (qrOpenChoice.answer) {
45
- const answer = qrOpenChoice.answer[0];
46
- valueAutocomplete = answer.valueCoding ? answer.valueCoding : answer.valueString;
47
- }
48
- if (!valueAutocomplete) {
49
- valueAutocomplete = '';
50
- }
51
- // Get additional rendering extensions
52
- const { displayUnit, displayPrompt, displayInstructions, readOnly, entryFormat } = useRenderingExtensions(qItem);
53
- // Query ontoserver for options
54
- const maxList = 10;
55
- const [input, setInput] = useState('');
56
- const debouncedInput = useDebounce(input, AUTOCOMPLETE_DEBOUNCE_DURATION);
57
- const answerValueSetUrl = qItem.answerValueSet;
58
- const terminologyServerUrl = getTerminologyServerUrl(qItem);
59
- const { options, loading, feedback } = useTerminologyServerQuery(answerValueSetUrl, maxList, input, debouncedInput, terminologyServerUrl);
60
- if (!answerValueSetUrl)
61
- return null;
62
- // Event handlers
63
- function handleValueChange(_, newValue) {
64
- if (newValue === null) {
65
- setInput('');
66
- newValue = '';
67
- }
68
- if (typeof newValue === 'string') {
69
- if (newValue !== '') {
70
- onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueString: newValue }] }));
71
- }
72
- else {
73
- onQrItemChange(createEmptyQrItem(qItem));
74
- }
75
- }
76
- else {
77
- onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueCoding: newValue }] }));
78
- }
79
- }
80
- const openChoiceAutocomplete = (React.createElement(React.Fragment, null,
81
- React.createElement(Box, { display: "flex" },
82
- React.createElement(Autocomplete, { id: qItem.id, value: valueAutocomplete, options: options, getOptionLabel: (option) => (typeof option === 'string' ? option : `${option.display}`), loading: loading, loadingText: 'Fetching results...', clearOnEscape: true, freeSolo: true, autoHighlight: true, sx: { maxWidth: !isTabled ? 280 : 3000, minWidth: 220, flexGrow: 1 }, placeholder: entryFormat, onChange: handleValueChange, filterOptions: (x) => x, renderInput: (params) => (React.createElement(StandardTextField, Object.assign({}, params, { value: input, onBlur: () => {
83
- // set answer to current input when text field is unfocused
84
- if (!valueAutocomplete && input !== '') {
85
- onQrItemChange(Object.assign(Object.assign({}, createEmptyQrItem(qItem)), { answer: [{ valueString: input }] }));
86
- }
87
- }, onChange: (e) => setInput(e.target.value), isTabled: isTabled, disabled: readOnly, label: displayPrompt, size: "small", InputProps: Object.assign(Object.assign({}, params.InputProps), { startAdornment: (React.createElement(React.Fragment, null,
88
- !valueAutocomplete || valueAutocomplete === '' ? (React.createElement(SearchIcon, { fontSize: "small", sx: { ml: 0.5 } })) : null,
89
- params.InputProps.startAdornment)), endAdornment: (React.createElement(React.Fragment, null,
90
- loading ? (React.createElement(CircularProgress, { color: "inherit", size: 16 })) : feedback ? (React.createElement(Fade, { in: !!feedback, timeout: 300 },
91
- React.createElement(Tooltip, { title: feedback.message, arrow: true, sx: { ml: 1 } }, {
92
- info: React.createElement(InfoIcon, { fontSize: "small", color: "info" }),
93
- warning: React.createElement(WarningAmberIcon, { fontSize: "small", color: "warning" }),
94
- success: React.createElement(DoneIcon, { fontSize: "small", color: "success" }),
95
- error: React.createElement(ErrorIcon, { fontSize: "small", color: "error" })
96
- }[feedback.color]))) : null,
97
- params.InputProps.endAdornment,
98
- displayUnit)) }), "data-test": "q-item-open-choice-autocomplete-field" }))) }))));
99
- const renderQItemOpenChoiceAutocomplete = isRepeated ? (React.createElement(React.Fragment, null, openChoiceAutocomplete)) : (React.createElement(FullWidthFormComponentBox, null,
100
- React.createElement(Grid, { container: true, columnSpacing: 6 },
101
- React.createElement(Grid, { item: true, xs: 5 },
102
- React.createElement(LabelWrapper, { qItem: qItem })),
103
- React.createElement(Grid, { item: true, xs: 7 },
104
- openChoiceAutocomplete,
105
- React.createElement(DisplayInstructions, { displayInstructions: displayInstructions })))));
106
- return React.createElement(React.Fragment, null, renderQItemOpenChoiceAutocomplete);
107
- }
108
- export default QItemOpenChoiceAutocomplete;
109
- //# sourceMappingURL=QItemOpenChoiceAutocomplete.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QItemOpenChoiceAutocomplete.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceAutocomplete.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAI5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,UAAU,MAAM,4BAA4B,CAAC;AACpD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,yBAAyB,MAAM,0CAA0C,CAAC;AACjF,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAMlE,OAAO,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,YAAY,MAAM,+BAA+B,CAAC;AAUzD,SAAS,2BAA2B,CAAC,KAAuC;IAC1E,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ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