@aehrc/smart-forms-renderer 0.26.3 → 0.27.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 (60) hide show
  1. package/lib/components/FormComponents/BooleanItem/BooleanField.js +1 -2
  2. package/lib/components/FormComponents/BooleanItem/BooleanField.js.map +1 -1
  3. package/lib/components/FormComponents/ChoiceItems/CheckboxFields.d.ts +11 -0
  4. package/lib/components/FormComponents/ChoiceItems/CheckboxFields.js +41 -0
  5. package/lib/components/FormComponents/ChoiceItems/CheckboxFields.js.map +1 -0
  6. package/lib/components/FormComponents/ChoiceItems/CheckboxOptionFields.d.ts +11 -0
  7. package/lib/components/FormComponents/ChoiceItems/CheckboxOptionFields.js +41 -0
  8. package/lib/components/FormComponents/ChoiceItems/CheckboxOptionFields.js.map +1 -0
  9. package/lib/components/FormComponents/ChoiceItems/CheckboxOptionList.d.ts +10 -0
  10. package/lib/components/FormComponents/ChoiceItems/CheckboxOptionList.js +36 -0
  11. package/lib/components/FormComponents/ChoiceItems/CheckboxOptionList.js.map +1 -0
  12. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetView.d.ts +13 -0
  13. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetView.js +46 -0
  14. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetView.js.map +1 -0
  15. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxFields.d.ts +11 -0
  16. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxFields.js +41 -0
  17. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxFields.js.map +1 -0
  18. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js +1 -2
  19. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js.map +1 -1
  20. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js +1 -2
  21. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js.map +1 -1
  22. package/lib/components/FormComponents/ItemParts/RadioOptionList.d.ts +8 -0
  23. package/lib/components/FormComponents/ItemParts/RadioOptionList.js +36 -0
  24. package/lib/components/FormComponents/ItemParts/RadioOptionList.js.map +1 -0
  25. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetFields.d.ts +18 -0
  26. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetFields.js +48 -0
  27. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetFields.js.map +1 -0
  28. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.d.ts +9 -0
  29. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.js +93 -0
  30. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetItem.js.map +1 -0
  31. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxFields.d.ts +18 -0
  32. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxFields.js +48 -0
  33. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxFields.js.map +1 -0
  34. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetFields.d.ts +16 -0
  35. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetFields.js +48 -0
  36. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetFields.js.map +1 -0
  37. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetItem.d.ts +9 -0
  38. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetItem.js +95 -0
  39. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerValueSetItem.js.map +1 -0
  40. package/lib/hooks/useOpenLabel.d.ts +9 -0
  41. package/lib/hooks/useOpenLabel.js +34 -0
  42. package/lib/hooks/useOpenLabel.js.map +1 -0
  43. package/lib/utils/calculatedExpression.js +1 -1
  44. package/lib/utils/calculatedExpression.js.map +1 -1
  45. package/lib/utils/enableWhenExpression.d.ts +1 -0
  46. package/lib/utils/enableWhenExpression.js +4 -4
  47. package/lib/utils/enableWhenExpression.js.map +1 -1
  48. package/lib/utils/fhirpath.d.ts +1 -1
  49. package/lib/utils/fhirpath.js +3 -3
  50. package/lib/utils/fhirpath.js.map +1 -1
  51. package/lib/utils/initialise.js +5 -4
  52. package/lib/utils/initialise.js.map +1 -1
  53. package/package.json +1 -1
  54. package/src/components/FormComponents/BooleanItem/BooleanField.tsx +1 -5
  55. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.tsx +1 -5
  56. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx +1 -5
  57. package/src/utils/calculatedExpression.ts +2 -1
  58. package/src/utils/enableWhenExpression.ts +13 -4
  59. package/src/utils/fhirpath.ts +8 -3
  60. package/src/utils/initialise.ts +6 -4
@@ -15,7 +15,6 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import React, { memo } from 'react';
18
- import { TEXT_FIELD_WIDTH } from '../Textfield.styles';
19
18
  import Box from '@mui/material/Box';
20
19
  import Button from '@mui/material/Button';
21
20
  import { grey } from '@mui/material/colors';
@@ -32,7 +31,7 @@ const BooleanField = memo(function BooleanField(props) {
32
31
  // defaults to horizontal, only set to vertical if explicitly set
33
32
  const orientation = (_a = getChoiceOrientation(qItem)) !== null && _a !== void 0 ? _a : ChoiceItemOrientation.Horizontal;
34
33
  const selection = valueBoolean === undefined ? null : valueBoolean.toString();
35
- return (React.createElement(Box, { display: "flex", alignItems: "center", sx: { maxWidth: !isTabled ? TEXT_FIELD_WIDTH : 3000, minWidth: 160 } },
34
+ return (React.createElement(Box, { display: "flex", alignItems: "center" },
36
35
  React.createElement(StyledRadioGroup, { row: orientation === ChoiceItemOrientation.Horizontal, name: qItem.text, id: qItem.id, onChange: (e) => onCheckedChange(e.target.value), value: selection },
37
36
  React.createElement(ChoiceRadioSingle, { value: "true", label: "Yes", readOnly: readOnly }),
38
37
  React.createElement(ChoiceRadioSingle, { value: "false", label: "No", readOnly: readOnly })),
@@ -1 +1 @@
1
- {"version":3,"file":"BooleanField.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/BooleanItem/BooleanField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAW3D,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,YAAY,CAAC,KAAwB;;IACtE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,GACzF,KAAK,CAAC;IAER,iEAAiE;IACjE,MAAM,WAAW,GAAG,MAAA,oBAAoB,CAAC,KAAK,CAAC,mCAAI,qBAAqB,CAAC,UAAU,CAAC;IAEpF,MAAM,SAAS,GAAG,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,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K,CAAC,EAAE,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAChD,KAAK,EAAE,SAAS;YAChB,oBAAC,iBAAiB,IAAC,KAAK,EAAC,MAAM,EAAC,KAAK,EAAC,KAAK,EAAC,QAAQ,EAAE,QAAQ,GAAI;YAClE,oBAAC,iBAAiB,IAAC,KAAK,EAAC,OAAO,EAAC,KAAK,EAAC,IAAI,EAAC,QAAQ,EAAE,QAAQ,GAAI,CACjD;QAEnB,oBAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,GAAI;QAEpB,oBAAC,eAAe,IAAC,MAAM,EAAE,cAAc,GAAI;QAC3C,oBAAC,IAAI,IAAC,EAAE,EAAE,YAAY,KAAK,SAAS,EAAE,OAAO,EAAE,GAAG;YAChD,oBAAC,OAAO,IAAC,KAAK,EAAC,4BAA4B;gBACzC,oBAAC,MAAM,IACL,EAAE,EAAE;wBACF,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC;wBAClB,SAAS,EAAE,EAAE,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE;qBAC5C,EACD,OAAO,EAAE,OAAO,YAET,CACD,CACL,CACH,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,YAAY,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { QuestionnaireItem, QuestionnaireItemAnswerOption, QuestionnaireResponseItemAnswer } from 'fhir/r4';
3
+ interface ChoiceCheckboxFieldsProps {
4
+ qItem: QuestionnaireItem;
5
+ options: QuestionnaireItemAnswerOption[];
6
+ answers: QuestionnaireResponseItemAnswer[];
7
+ readOnly: boolean;
8
+ onCheckedChange: (newValue: string) => void;
9
+ }
10
+ declare function ChoiceCheckboxFields(props: ChoiceCheckboxFieldsProps): React.JSX.Element;
11
+ export default ChoiceCheckboxFields;
@@ -0,0 +1,41 @@
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
+ import React from 'react';
18
+ import { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
19
+ import QItemChoiceCheckboxSingle from '../ItemParts/CheckboxSingle';
20
+ import { StyledFormGroup } from '../Item.styles';
21
+ import { getChoiceOrientation } from '../../../utils/choice';
22
+ function ChoiceCheckboxFields(props) {
23
+ var _a;
24
+ const { qItem, options, answers, readOnly, onCheckedChange } = props;
25
+ const orientation = (_a = getChoiceOrientation(qItem)) !== null && _a !== void 0 ? _a : ChoiceItemOrientation.Vertical;
26
+ return (React.createElement(StyledFormGroup, { row: orientation === ChoiceItemOrientation.Horizontal }, options.map((option) => {
27
+ var _a, _b, _c;
28
+ if (option['valueCoding']) {
29
+ return (React.createElement(QItemChoiceCheckboxSingle, { 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, isChecked: answers.some((answer) => JSON.stringify(answer) === JSON.stringify(option)), onCheckedChange: onCheckedChange }));
30
+ }
31
+ if (option['valueString']) {
32
+ return (React.createElement(QItemChoiceCheckboxSingle, { key: option.valueString, value: option.valueString, label: option.valueString, readOnly: readOnly, isChecked: answers.some((answer) => answer.valueString === option.valueString), onCheckedChange: onCheckedChange }));
33
+ }
34
+ if (option['valueInteger']) {
35
+ return (React.createElement(QItemChoiceCheckboxSingle, { key: option.valueInteger, value: option.valueInteger.toString(), label: option.valueInteger.toString(), readOnly: readOnly, isChecked: answers.some((answer) => answer.valueInteger === option.valueInteger), onCheckedChange: onCheckedChange }));
36
+ }
37
+ return null;
38
+ })));
39
+ }
40
+ export default ChoiceCheckboxFields;
41
+ //# sourceMappingURL=CheckboxFields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckboxFields.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/CheckboxFields.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAMxE,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAU7D,SAAS,oBAAoB,CAAC,KAAgC;;IAC5D,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAErE,MAAM,WAAW,GAAG,MAAA,oBAAoB,CAAC,KAAK,CAAC,mCAAI,qBAAqB,CAAC,QAAQ,CAAC;IAElF,OAAO,CACL,oBAAC,eAAe,IAAC,GAAG,EAAE,WAAW,KAAK,qBAAqB,CAAC,UAAU,IACnE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;;QACtB,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE;YACzB,OAAO,CACL,oBAAC,yBAAyB,IACxB,GAAG,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,IAAI,mCAAI,EAAE,EAClC,KAAK,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,IAAI,mCAAI,EAAE,EACpC,KAAK,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,OAAO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swerOption, QuestionnaireResponseItemAnswer } from 'fhir/r4';
3
+ interface CheckboxFieldsProps {
4
+ qItem: QuestionnaireItem;
5
+ options: QuestionnaireItemAnswerOption[];
6
+ answers: QuestionnaireResponseItemAnswer[];
7
+ readOnly: boolean;
8
+ onCheckedChange: (newValue: string) => void;
9
+ }
10
+ declare function CheckboxOptionFields(props: CheckboxFieldsProps): React.JSX.Element;
11
+ export default CheckboxOptionFields;
@@ -0,0 +1,41 @@
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
+ import React from 'react';
18
+ import { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
19
+ import CheckboxSingle from '../ItemParts/CheckboxSingle';
20
+ import { StyledFormGroup } from '../Item.styles';
21
+ import { getChoiceOrientation } from '../../../utils/choice';
22
+ function CheckboxOptionFields(props) {
23
+ var _a;
24
+ const { qItem, options, answers, readOnly, onCheckedChange } = props;
25
+ const orientation = (_a = getChoiceOrientation(qItem)) !== null && _a !== void 0 ? _a : ChoiceItemOrientation.Vertical;
26
+ return (React.createElement(StyledFormGroup, { row: orientation === ChoiceItemOrientation.Horizontal }, options.map((option) => {
27
+ var _a, _b, _c;
28
+ if (option['valueCoding']) {
29
+ return (React.createElement(CheckboxSingle, { 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, isChecked: answers.some((answer) => JSON.stringify(answer) === JSON.stringify(option)), onCheckedChange: onCheckedChange }));
30
+ }
31
+ if (option['valueString']) {
32
+ return (React.createElement(CheckboxSingle, { key: option.valueString, value: option.valueString, label: option.valueString, readOnly: readOnly, isChecked: answers.some((answer) => answer.valueString === option.valueString), onCheckedChange: onCheckedChange }));
33
+ }
34
+ if (option['valueInteger']) {
35
+ return (React.createElement(CheckboxSingle, { key: option.valueInteger, value: option.valueInteger.toString(), label: option.valueInteger.toString(), readOnly: readOnly, isChecked: answers.some((answer) => answer.valueInteger === option.valueInteger), onCheckedChange: onCheckedChange }));
36
+ }
37
+ return null;
38
+ })));
39
+ }
40
+ export default CheckboxOptionFields;
41
+ //# sourceMappingURL=CheckboxOptionFields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckboxOptionFields.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/CheckboxOptionFields.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAMxE,OAAO,cAAc,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAU7D,SAAS,oBAAoB,CAAC,KAA0B;;IACtD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAErE,MAAM,WAAW,GAAG,MAAA,oBAAoB,CAAC,KAAK,CAAC,mCAAI,qBAAqB,CAAC,QAAQ,CAAC;IAElF,OAAO,CACL,oBAAC,eAAe,IAAC,GAAG,EAAE,WAAW,KAAK,qBAAqB,CAAC,UAAU,IACnE,OAAO,CAAC,GAAG,CAAC,CAAC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E,EAAE,CAAC,MAAM,CAAC,YAAY,KAAK,MAAM,CAAC,YAAY,CAAC,EAChF,eAAe,EAAE,eAAe,GAChC,CACH,CAAC;SACH;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CACc,CACnB,CAAC;AACJ,CAAC;AAED,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { QuestionnaireItemAnswerOption, QuestionnaireResponseItemAnswer } from 'fhir/r4';
3
+ interface CheckboxOptionListProps {
4
+ options: QuestionnaireItemAnswerOption[];
5
+ answers: QuestionnaireResponseItemAnswer[];
6
+ readOnly: boolean;
7
+ onCheckedChange: (newValue: string) => void;
8
+ }
9
+ declare function CheckboxOptionList(props: CheckboxOptionListProps): React.JSX.Element;
10
+ export default CheckboxOptionList;
@@ -0,0 +1,36 @@
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
+ import React from 'react';
18
+ import CheckboxSingle from '../ItemParts/CheckboxSingle';
19
+ function CheckboxOptionList(props) {
20
+ const { options, answers, readOnly, onCheckedChange } = props;
21
+ return (React.createElement(React.Fragment, null, options.map((option) => {
22
+ var _a, _b, _c;
23
+ if (option['valueCoding']) {
24
+ return (React.createElement(CheckboxSingle, { 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, isChecked: answers.some((answer) => JSON.stringify(answer) === JSON.stringify(option)), onCheckedChange: onCheckedChange }));
25
+ }
26
+ if (option['valueString']) {
27
+ return (React.createElement(CheckboxSingle, { key: option.valueString, value: option.valueString, label: option.valueString, readOnly: readOnly, isChecked: answers.some((answer) => answer.valueString === option.valueString), onCheckedChange: onCheckedChange }));
28
+ }
29
+ if (option['valueInteger']) {
30
+ return (React.createElement(CheckboxSingle, { key: option.valueInteger, value: option.valueInteger.toString(), label: option.valueInteger.toString(), readOnly: readOnly, isChecked: answers.some((answer) => answer.valueInteger === option.valueInteger), onCheckedChange: onCheckedChange }));
31
+ }
32
+ return null;
33
+ })));
34
+ }
35
+ export default CheckboxOptionList;
36
+ //# sourceMappingURL=CheckboxOptionList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckboxOptionList.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/CheckboxOptionList.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAc,MAAM,6BAA6B,CAAC;AASzD,SAAS,kBAAkB,CAAC,KAA8B;IACxD,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAE9D,OAAO,CACL,0CACG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;;QACtB,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE;YACzB,OAAO,CACL,oBAAC,cAAc,IACb,GAAG,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,IAAI,mCAAI,EAAE,EAClC,KAAK,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,IAAI,mCAAI,EAAE,EACpC,KAAK,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,OAAO,mCAAI,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,EACjE,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,OAAO,CAAC,IAAI,CACrB,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAC9D,EACD,eAAe,EAAE,eAAe,GAChC,CACH,CAAC;SACH;QAED,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE;YACzB,OAAO,CACL,oBAAC,cAAc,IACb,GAAG,EAAE,MAAM,CAAC,WAAW,EACvB,KAAK,EAAE,MAAM,CAAC,WAAW,EACzB,KAAK,EAAE,MAAM,CAAC,WAAW,EACzB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,KAAK,MAAM,CAAC,WAAW,CAAC,EAC9E,eAAe,EAAE,eAAe,GAChC,CACH,CAAC;SACH;QAED,IAAI,MAAM,CAAC,cAAc,CAAC,EAAE;YAC1B,OAAO,CACL,oBAAC,cAAc,IACb,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,EAClB,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,KAAK,MAAM,CAAC,YAAY,CAAC,EAChF,eAAe,EAAE,eAAe,GAChC,CACH,CAAC;SACH;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CACD,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { QuestionnaireItem, QuestionnaireItemAnswerOption, QuestionnaireResponseItemAnswer } from 'fhir/r4';
3
+ import type { TerminologyError } from '../../../hooks/useValueSetCodings';
4
+ interface ChoiceCheckboxAnswerValueSetViewProps {
5
+ qItem: QuestionnaireItem;
6
+ options: QuestionnaireItemAnswerOption[];
7
+ answers: QuestionnaireResponseItemAnswer[];
8
+ readOnly: boolean;
9
+ terminologyError: TerminologyError;
10
+ onCheckedChange: (newValue: string) => void;
11
+ }
12
+ declare function ChoiceCheckboxAnswerValueSetView(props: ChoiceCheckboxAnswerValueSetViewProps): React.JSX.Element;
13
+ export default ChoiceCheckboxAnswerValueSetView;
@@ -0,0 +1,46 @@
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
+ import React from 'react';
18
+ import { StyledAlert } from '../../Alert.styles';
19
+ import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
20
+ import Typography from '@mui/material/Typography';
21
+ import { getChoiceOrientation } from '../../../utils/choice';
22
+ import { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
23
+ import CheckboxOptionList from './CheckboxOptionList';
24
+ import { StyledFormGroup } from '../Item.styles';
25
+ function ChoiceCheckboxAnswerValueSetView(props) {
26
+ var _a;
27
+ const { qItem, options, answers, readOnly, terminologyError, onCheckedChange } = props;
28
+ const orientation = (_a = getChoiceOrientation(qItem)) !== null && _a !== void 0 ? _a : ChoiceItemOrientation.Vertical;
29
+ if (options.length > 0) {
30
+ return (React.createElement(StyledFormGroup, { row: orientation === ChoiceItemOrientation.Horizontal },
31
+ React.createElement(CheckboxOptionList, { options: options, answers: answers, readOnly: readOnly, onCheckedChange: onCheckedChange })));
32
+ }
33
+ if (terminologyError.error) {
34
+ return (React.createElement(StyledAlert, { color: "error" },
35
+ React.createElement(ErrorOutlineIcon, { color: "error", sx: { pr: 0.75 } }),
36
+ React.createElement(Typography, { variant: "subtitle2" },
37
+ "There was an error fetching options from the terminology server for",
38
+ ' ',
39
+ terminologyError.answerValueSet)));
40
+ }
41
+ return (React.createElement(StyledAlert, { color: "error" },
42
+ React.createElement(ErrorOutlineIcon, { color: "error", sx: { pr: 0.75 } }),
43
+ React.createElement(Typography, { variant: "subtitle2" }, "Unable to fetch options from the questionnaire or launch context")));
44
+ }
45
+ export default ChoiceCheckboxAnswerValueSetView;
46
+ //# sourceMappingURL=ChoiceCheckboxAnswerValueSetView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChoiceCheckboxAnswerValueSetView.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAWjD,SAAS,gCAAgC,CAAC,KAA4C;;IACpF,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAEvF,MAAM,WAAW,GAAG,MAAA,oBAAoB,CAAC,KAAK,CAAC,mCAAI,qBAAqB,CAAC,QAAQ,CAAC;IAElF,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;QACtB,OAAO,CACL,oBAAC,eAAe,IAAC,GAAG,EAAE,WAAW,KAAK,qBAAqB,CAAC,UAAU;YACpE,oBAAC,kBAAkB,IACjB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,GAChC,CACc,CACnB,CAAC;KACH;IAED,IAAI,gBAAgB,CAAC,KAAK,EAAE;QAC1B,OAAO,CACL,oBAAC,WAAW,IAAC,KAAK,EAAC,OAAO;YACxB,oBAAC,gBAAgB,IAAC,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAI;YACpD,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW;;gBACuC,GAAG;gBACtE,gBAAgB,CAAC,cAAc,CACrB,CACD,CACf,CAAC;KACH;IAED,OAAO,CACL,oBAAC,WAAW,IAAC,KAAK,EAAC,OAAO;QACxB,oBAAC,gBAAgB,IAAC,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAI;QACpD,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW,uEAElB,CACD,CACf,CAAC;AACJ,CAAC;AAED,eAAe,gCAAgC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { QuestionnaireItem, QuestionnaireItemAnswerOption, QuestionnaireResponseItemAnswer } from 'fhir/r4';
3
+ interface ChoiceCheckboxFieldsProps {
4
+ qItem: QuestionnaireItem;
5
+ options: QuestionnaireItemAnswerOption[];
6
+ answers: QuestionnaireResponseItemAnswer[];
7
+ readOnly: boolean;
8
+ onCheckedChange: (newValue: string) => void;
9
+ }
10
+ declare function ChoiceCheckboxFields(props: ChoiceCheckboxFieldsProps): React.JSX.Element;
11
+ export default ChoiceCheckboxFields;
@@ -0,0 +1,41 @@
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
+ import React from 'react';
18
+ import { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
19
+ import CheckboxSingle from '../ItemParts/CheckboxSingle';
20
+ import { StyledFormGroup } from '../Item.styles';
21
+ import { getChoiceOrientation } from '../../../utils/choice';
22
+ function ChoiceCheckboxFields(props) {
23
+ var _a;
24
+ const { qItem, options, answers, readOnly, onCheckedChange } = props;
25
+ const orientation = (_a = getChoiceOrientation(qItem)) !== null && _a !== void 0 ? _a : ChoiceItemOrientation.Vertical;
26
+ return (React.createElement(StyledFormGroup, { row: orientation === ChoiceItemOrientation.Horizontal }, options.map((option) => {
27
+ var _a, _b, _c;
28
+ if (option['valueCoding']) {
29
+ return (React.createElement(CheckboxSingle, { 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, isChecked: answers.some((answer) => JSON.stringify(answer) === JSON.stringify(option)), onCheckedChange: onCheckedChange }));
30
+ }
31
+ if (option['valueString']) {
32
+ return (React.createElement(CheckboxSingle, { key: option.valueString, value: option.valueString, label: option.valueString, readOnly: readOnly, isChecked: answers.some((answer) => answer.valueString === option.valueString), onCheckedChange: onCheckedChange }));
33
+ }
34
+ if (option['valueInteger']) {
35
+ return (React.createElement(CheckboxSingle, { key: option.valueInteger, value: option.valueInteger.toString(), label: option.valueInteger.toString(), readOnly: readOnly, isChecked: answers.some((answer) => answer.valueInteger === option.valueInteger), onCheckedChange: onCheckedChange }));
36
+ }
37
+ return null;
38
+ })));
39
+ }
40
+ export default ChoiceCheckboxFields;
41
+ //# sourceMappingURL=ChoiceCheckboxFields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChoiceCheckboxFields.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceCheckboxFields.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAMxE,OAAO,cAAc,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAU7D,SAAS,oBAAoB,CAAC,KAAgC;;IAC5D,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAErE,MAAM,WAAW,GAAG,MAAA,oBAAoB,CAAC,KAAK,CAAC,mCAAI,qBAAqB,CAAC,QAAQ,CAAC;IAElF,OAAO,CACL,oBAAC,eAAe,IAAC,GAAG,EAAE,WAAW,KAAK,qBAAqB,CAAC,UAAU,IACnE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;;QACtB,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE;YACzB,OAAO,CACL,oBAAC,cAAc,IACb,GAAG,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,IAAI,mCAAI,EAAE,EAClC,KAAK,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,IAAI,mCAAI,EAAE,EACpC,KAAK,EAAE,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../../interfaces/choice.enum';
19
19
  import RadioAnswerOptionButtons from '../ItemParts/RadioAnswerOptionButtons';
20
20
  import { StyledRadioGroup } from '../Item.styles';
21
21
  import { getChoiceOrientation } from '../../../utils/choice';
22
- import { TEXT_FIELD_WIDTH } from '../Textfield.styles';
23
22
  import Box from '@mui/material/Box';
24
23
  import FadingCheckIcon from '../ItemParts/FadingCheckIcon';
25
24
  function ChoiceRadioAnswerOptionFields(props) {
26
25
  var _a;
27
26
  const { qItem, valueRadio, readOnly, calcExpUpdated, isTabled, onCheckedChange } = props;
28
27
  const orientation = (_a = getChoiceOrientation(qItem)) !== null && _a !== void 0 ? _a : ChoiceItemOrientation.Vertical;
29
- return (React.createElement(Box, { display: "flex", alignItems: "center", sx: { maxWidth: !isTabled ? TEXT_FIELD_WIDTH : 3000, minWidth: 160 } },
28
+ return (React.createElement(Box, { display: "flex", alignItems: "center" },
30
29
  React.createElement(StyledRadioGroup, { row: orientation === ChoiceItemOrientation.Horizontal, name: qItem.text, id: qItem.id, onChange: (e) => onCheckedChange(e.target.value), value: valueRadio, "data-test": "q-item-radio-group" },
31
30
  React.createElement(RadioAnswerOptionButtons, { qItem: qItem, readOnly: readOnly })),
32
31
  React.createElement(Box, { flexGrow: 1 }),
@@ -1 +1 @@
1
- {"version":3,"file":"ChoiceRadioAnswerOptionFields.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,wBAAwB,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;A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ledAlert } from '../../Alert.styles';
24
24
  import { getChoiceOrientation } from '../../../utils/choice';
25
- import { TEXT_FIELD_WIDTH } from '../Textfield.styles';
26
25
  import FadingCheckIcon from '../ItemParts/FadingCheckIcon';
27
26
  import Box from '@mui/material/Box';
28
27
  function ChoiceRadioAnswerValueSetFields(props) {
@@ -30,7 +29,7 @@ function ChoiceRadioAnswerValueSetFields(props) {
30
29
  const { qItem, codings, valueRadio, readOnly, calcExpUpdated, terminologyError, isTabled, onCheckedChange } = props;
31
30
  const orientation = (_a = getChoiceOrientation(qItem)) !== null && _a !== void 0 ? _a : ChoiceItemOrientation.Vertical;
32
31
  if (codings.length > 0) {
33
- return (React.createElement(Box, { display: "flex", alignItems: "center", sx: { maxWidth: !isTabled ? TEXT_FIELD_WIDTH : 3000, minWidth: 160 } },
32
+ return (React.createElement(Box, { display: "flex", alignItems: "center" },
34
33
  React.createElement(StyledRadioGroup, { row: orientation === ChoiceItemOrientation.Horizontal, name: qItem.text, id: qItem.id, onChange: (e) => onCheckedChange(e.target.value), value: valueRadio !== null && valueRadio !== void 0 ? valueRadio : null }, codings.map((coding) => {
35
34
  var _a, _b, _c;
36
35
  return (React.createElement(ChoiceRadioSingle, { 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 }));
@@ -1 +1 @@
1
- {"version":3,"file":"ChoiceRadioAnswerValueSetFields.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE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EAAE,MAAA,MAAM,CAAC,IAAI,mCAAI,EAAE,EACtB,KAAK,EAAE,MAAA,MAAM,CAAC,IAAI,mCAAI,EAAE,EACxB,KAAK,EAAE,MAAA,MAAM,CAAC,OAAO,mCAAI,GAAG,MAAM,CAAC,IAAI,EAAE,EACzC,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;YACJ,CAAC,CAAC,CACe;YACnB,oBAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,GAAI;YAEpB,oBAAC,eAAe,IAAC,MAAM,EAAE,cAAc,GAAI,CACvC,CACP,CAAC;KACH;IAED,IAAI,gBAAgB,CAAC,KAAK,EAAE;QAC1B,OAAO,CACL,oBAAC,WAAW,IAAC,KAAK,EAAC,OAAO;YACxB,oBAAC,gBAAgB,IAAC,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAI;YACpD,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW;;gBACuC,GAAG;gBACtE,gBAAgB,CAAC,cAAc,CACrB,CACD,CACf,CAAC;KACH;IAED,OAAO,CACL,oBAAC,WAAW,IAAC,KAAK,EAAC,OAAO;QACxB,oBAAC,gBAAgB,IAAC,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAI;QACpD,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW,uEAElB,CACD,CACf,CAAC;AACJ,CAAC;AAED,eAAe,+BAA+B,CAAC"}
1
+ {"version":3,"file":"ChoiceRadioAnswerValueSetFields.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,iBAAi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AAI,GAAG,MAAM,CAAC,IAAI,EAAE,EACzC,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;YACJ,CAAC,CAAC,CACe;YACnB,oBAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,GAAI;YAEpB,oBAAC,eAAe,IAAC,MAAM,EAAE,cAAc,GAAI,CACvC,CACP,CAAC;KACH;IAED,IAAI,gBAAgB,CAAC,KAAK,EAAE;QAC1B,OAAO,CACL,oBAAC,WAAW,IAAC,KAAK,EAAC,OAAO;YACxB,oBAAC,gBAAgB,IAAC,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAI;YACpD,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW;;gBACuC,GAAG;gBACtE,gBAAgB,CAAC,cAAc,CACrB,CACD,CACf,CAAC;KACH;IAED,OAAO,CACL,oBAAC,WAAW,IAAC,KAAK,EAAC,OAAO;QACxB,oBAAC,gBAAgB,IAAC,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAI;QACpD,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW,uEAElB,CACD,CACf,CAAC;AACJ,CAAC;AAED,eAAe,+BAA+B,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { QuestionnaireItemAnswerOption } from 'fhir/r4';
3
+ interface RadioOptionListProps {
4
+ options: QuestionnaireItemAnswerOption[];
5
+ readOnly: boolean;
6
+ }
7
+ declare function RadioOptionList(props: RadioOptionListProps): React.JSX.Element;
8
+ export default RadioOptionList;
@@ -0,0 +1,36 @@
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
+ import React from 'react';
18
+ import ChoiceRadioSingle from '../ChoiceItems/ChoiceRadioSingle';
19
+ function RadioOptionList(props) {
20
+ const { options, readOnly } = props;
21
+ return (React.createElement(React.Fragment, null, options.map((option) => {
22
+ var _a, _b, _c;
23
+ if (option['valueCoding']) {
24
+ return (React.createElement(ChoiceRadioSingle, { 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 }));
25
+ }
26
+ if (option['valueString']) {
27
+ return (React.createElement(ChoiceRadioSingle, { key: option.valueString, value: option.valueString, label: option.valueString, readOnly: readOnly }));
28
+ }
29
+ if (option['valueInteger']) {
30
+ return (React.createElement(ChoiceRadioSingle, { key: option.valueInteger, value: option.valueInteger.toString(), label: option.valueInteger.toString(), readOnly: readOnly }));
31
+ }
32
+ return null;
33
+ })));
34
+ }
35
+ export default RadioOptionList;
36
+ //# sourceMappingURL=RadioOptionList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioOptionList.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/ItemParts/RadioOptionList.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAQjE,SAAS,eAAe,CAAC,KAA2B;IAClD,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEpC,OAAO,CACL,0CACG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;;QACtB,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE;YACzB,OAAO,CACL,oBAAC,iBAAiB,IAChB,GAAG,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,IAAI,mCAAI,EAAE,EAClC,KAAK,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,IAAI,mCAAI,EAAE,EACpC,KAAK,EAAE,MAAA,MAAM,CAAC,WAAW,CAAC,OAAO,mCAAI,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,EACjE,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;SACH;QAED,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE;YACzB,OAAO,CACL,oBAAC,iBAAiB,IAChB,GAAG,EAAE,MAAM,CAAC,WAAW,EACvB,KAAK,EAAE,MAAM,CAAC,WAAW,EACzB,KAAK,EAAE,MAAM,CAAC,WAAW,EACzB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;SACH;QAED,IAAI,MAAM,CAAC,cAAc,CAAC,EAAE;YAC1B,OAAO,CACL,oBAAC,iBAAiB,IAChB,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;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CACD,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC"}
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import type { QuestionnaireItem, QuestionnaireItemAnswerOption, QuestionnaireResponseItemAnswer } from 'fhir/r4';
3
+ import type { TerminologyError } from '../../../hooks/useValueSetCodings';
4
+ interface OpenChoiceCheckboxFieldsProps {
5
+ qItem: QuestionnaireItem;
6
+ options: QuestionnaireItemAnswerOption[];
7
+ answers: QuestionnaireResponseItemAnswer[];
8
+ openLabelText: string | null;
9
+ openLabelValue: string;
10
+ openLabelChecked: boolean;
11
+ readOnly: boolean;
12
+ terminologyError: TerminologyError;
13
+ onOptionChange: (changedOptionValue: string) => void;
14
+ onOpenLabelCheckedChange: (checked: boolean) => void;
15
+ onOpenLabelInputChange: (input: string) => void;
16
+ }
17
+ declare function OpenChoiceCheckboxAnswerValueSetFields(props: OpenChoiceCheckboxFieldsProps): React.JSX.Element;
18
+ export default OpenChoiceCheckboxAnswerValueSetFields;
@@ -0,0 +1,48 @@
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
+ import React from 'react';
18
+ import { ChoiceItemOrientation } from '../../../interfaces/choice.enum';
19
+ import CheckboxSingleWithOpenLabel from '../ItemParts/CheckboxSingleWithOpenLabel';
20
+ import { getChoiceOrientation } from '../../../utils/choice';
21
+ import { StyledFormGroup } from '../Item.styles';
22
+ import CheckboxOptionList from '../ChoiceItems/CheckboxOptionList';
23
+ import { StyledAlert } from '../../Alert.styles';
24
+ import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
25
+ import Typography from '@mui/material/Typography';
26
+ function OpenChoiceCheckboxAnswerValueSetFields(props) {
27
+ var _a;
28
+ const { qItem, options, answers, openLabelText, openLabelValue, openLabelChecked, readOnly, terminologyError, onOptionChange, onOpenLabelCheckedChange, onOpenLabelInputChange } = props;
29
+ const orientation = (_a = getChoiceOrientation(qItem)) !== null && _a !== void 0 ? _a : ChoiceItemOrientation.Vertical;
30
+ if (options.length > 0) {
31
+ return (React.createElement(StyledFormGroup, { row: orientation === ChoiceItemOrientation.Horizontal },
32
+ React.createElement(CheckboxOptionList, { options: options, answers: answers, readOnly: readOnly, onCheckedChange: onOptionChange }),
33
+ openLabelText !== null ? (React.createElement(CheckboxSingleWithOpenLabel, { value: openLabelValue, label: openLabelText, isChecked: openLabelChecked, onCheckedChange: onOpenLabelCheckedChange, onInputChange: onOpenLabelInputChange })) : null));
34
+ }
35
+ if (terminologyError.error) {
36
+ return (React.createElement(StyledAlert, { color: "error" },
37
+ React.createElement(ErrorOutlineIcon, { color: "error", sx: { pr: 0.75 } }),
38
+ React.createElement(Typography, { variant: "subtitle2" },
39
+ "There was an error fetching options from the terminology server for",
40
+ ' ',
41
+ terminologyError.answerValueSet)));
42
+ }
43
+ return (React.createElement(StyledAlert, { color: "error" },
44
+ React.createElement(ErrorOutlineIcon, { color: "error", sx: { pr: 0.75 } }),
45
+ React.createElement(Typography, { variant: "subtitle2" }, "Unable to fetch options from the questionnaire or launch context")));
46
+ }
47
+ export default OpenChoiceCheckboxAnswerValueSetFields;
48
+ //# sourceMappingURL=OpenChoiceCheckboxAnswerValueSetFields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenChoiceCheckboxAnswerValueSetFields.js","sourceRoot":"","sources":["../../../../src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerValueSetFields.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,2BAA2B,MAAM,0CAA0C,CAAC;AAMnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,kBAAkB,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,C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AK,EAAC,OAAO;QACxB,oBAAC,gBAAgB,IAAC,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAI;QACpD,oBAAC,UAAU,IAAC,OAAO,EAAC,WAAW,uEAElB,CACD,CACf,CAAC;AACJ,CAAC;AAED,eAAe,sCAAsC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
3
+ import type { PropsWithIsRepeatedAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithQrItemChangeHandler, PropsWithShowMinimalViewAttribute } from '../../../interfaces/renderProps.interface';
4
+ interface OpenChoiceCheckboxAnswerValueSetItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithShowMinimalViewAttribute, PropsWithParentIsReadOnlyAttribute {
5
+ qItem: QuestionnaireItem;
6
+ qrItem: QuestionnaireResponseItem | null;
7
+ }
8
+ declare function OpenChoiceCheckboxAnswerValueSetItem(props: OpenChoiceCheckboxAnswerValueSetItemProps): React.JSX.Element;
9
+ export default OpenChoiceCheckboxAnswerValueSetItem;