@aehrc/smart-forms-renderer 0.13.0 → 0.13.2

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 (104) hide show
  1. package/lib/components/Box.styles.d.ts +0 -6
  2. package/lib/components/Box.styles.js +1 -29
  3. package/lib/components/Box.styles.js.map +1 -1
  4. package/lib/components/FormComponents/BooleanItem/BooleanItem.js +1 -3
  5. package/lib/components/FormComponents/BooleanItem/BooleanItem.js.map +1 -1
  6. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js +1 -3
  7. package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js.map +1 -1
  8. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js +2 -2
  9. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js.map +1 -1
  10. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js +2 -2
  11. package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js.map +1 -1
  12. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js +1 -3
  13. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js.map +1 -1
  14. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js +1 -3
  15. package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js.map +1 -1
  16. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js +1 -3
  17. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js.map +1 -1
  18. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js +1 -3
  19. package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js.map +1 -1
  20. package/lib/components/FormComponents/CustomDateItem/CustomDateItem.js +2 -2
  21. package/lib/components/FormComponents/CustomDateItem/CustomDateItem.js.map +1 -1
  22. package/lib/components/FormComponents/DateItem/DateItem.js +2 -2
  23. package/lib/components/FormComponents/DateItem/DateItem.js.map +1 -1
  24. package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js +2 -2
  25. package/lib/components/FormComponents/DateTimeItem/DateTimeItem.js.map +1 -1
  26. package/lib/components/FormComponents/DecimalItem/DecimalItem.js +2 -2
  27. package/lib/components/FormComponents/DecimalItem/DecimalItem.js.map +1 -1
  28. package/lib/components/FormComponents/IntegerItem/IntegerItem.js +2 -2
  29. package/lib/components/FormComponents/IntegerItem/IntegerItem.js.map +1 -1
  30. package/lib/components/FormComponents/ItemParts/ItemFieldGrid.d.ts +1 -3
  31. package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js +9 -10
  32. package/lib/components/FormComponents/ItemParts/ItemFieldGrid.js.map +1 -1
  33. package/lib/components/FormComponents/ItemParts/ItemLabelText.js +1 -1
  34. package/lib/components/FormComponents/ItemParts/ItemLabelText.js.map +1 -1
  35. package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js +20 -1
  36. package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js.map +1 -1
  37. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js +1 -3
  38. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js.map +1 -1
  39. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js +2 -2
  40. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js.map +1 -1
  41. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js +1 -3
  42. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js.map +1 -1
  43. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js +1 -3
  44. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js.map +1 -1
  45. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js +1 -3
  46. package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js.map +1 -1
  47. package/lib/components/FormComponents/RepeatItem/RepeatItem.js +1 -3
  48. package/lib/components/FormComponents/RepeatItem/RepeatItem.js.map +1 -1
  49. package/lib/components/FormComponents/SliderItem/SliderItem.js +1 -3
  50. package/lib/components/FormComponents/SliderItem/SliderItem.js.map +1 -1
  51. package/lib/components/FormComponents/StringItem/StringItem.js +2 -2
  52. package/lib/components/FormComponents/StringItem/StringItem.js.map +1 -1
  53. package/lib/components/FormComponents/TextItem/TextItem.js +2 -2
  54. package/lib/components/FormComponents/TextItem/TextItem.js.map +1 -1
  55. package/lib/components/FormComponents/TimeItem/TimeItem.js +2 -2
  56. package/lib/components/FormComponents/TimeItem/TimeItem.js.map +1 -1
  57. package/lib/components/FormComponents/UrlItem/UrlItem.js +2 -2
  58. package/lib/components/FormComponents/UrlItem/UrlItem.js.map +1 -1
  59. package/lib/components/Renderer/BaseRenderer.js +0 -4
  60. package/lib/components/Renderer/BaseRenderer.js.map +1 -1
  61. package/lib/hooks/useRenderingExtensions.d.ts +1 -0
  62. package/lib/hooks/useRenderingExtensions.js +2 -1
  63. package/lib/hooks/useRenderingExtensions.js.map +1 -1
  64. package/lib/setup-jest.js +1 -0
  65. package/lib/stories/MedicalHistoryTable.stories.js +45 -0
  66. package/lib/stories/SmartFormsRenderer.stories.js +117 -0
  67. package/lib/utils/itemControl.d.ts +6 -0
  68. package/lib/utils/itemControl.js +15 -0
  69. package/lib/utils/itemControl.js.map +1 -1
  70. package/package.json +1 -1
  71. package/src/components/Box.styles.ts +1 -31
  72. package/src/components/FormComponents/BooleanItem/BooleanItem.tsx +1 -7
  73. package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx +1 -7
  74. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx +2 -6
  75. package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +2 -6
  76. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +1 -7
  77. package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +1 -7
  78. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +1 -7
  79. package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx +1 -7
  80. package/src/components/FormComponents/CustomDateItem/CustomDateItem.tsx +2 -7
  81. package/src/components/FormComponents/DateItem/DateItem.tsx +2 -7
  82. package/src/components/FormComponents/DateTimeItem/DateTimeItem.tsx +2 -7
  83. package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +3 -15
  84. package/src/components/FormComponents/IntegerItem/IntegerItem.tsx +3 -15
  85. package/src/components/FormComponents/ItemParts/ItemFieldGrid.tsx +13 -16
  86. package/src/components/FormComponents/ItemParts/ItemLabelText.tsx +1 -1
  87. package/src/components/FormComponents/ItemParts/ItemLabelWrapper.tsx +30 -1
  88. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.tsx +1 -7
  89. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx +2 -6
  90. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx +1 -7
  91. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.tsx +1 -7
  92. package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.tsx +1 -7
  93. package/src/components/FormComponents/RepeatItem/RepeatItem.tsx +1 -7
  94. package/src/components/FormComponents/SliderItem/SliderItem.tsx +1 -7
  95. package/src/components/FormComponents/StringItem/StringItem.tsx +3 -15
  96. package/src/components/FormComponents/TextItem/TextItem.tsx +3 -15
  97. package/src/components/FormComponents/TimeItem/TimeItem.tsx +2 -7
  98. package/src/components/FormComponents/UrlItem/UrlItem.tsx +3 -15
  99. package/src/components/Renderer/BaseRenderer.tsx +0 -6
  100. package/src/hooks/useRenderingExtensions.ts +3 -0
  101. package/src/utils/itemControl.ts +16 -0
  102. package/lib/components/FormComponents/ItemParts/ItemExtensionLabels.js +0 -30
  103. package/lib/components/FormComponents/ItemParts/ItemExtensionLabels.js.map +0 -1
  104. package/src/components/FormComponents/ItemParts/ItemExtensionLabels.tsx +0 -42
@@ -0,0 +1,45 @@
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
+ */ import ThemeProvider from '../theme/Theme';
17
+ import { GroupTable } from '../components';
18
+ import GTableMedicalHistoryItemJson from './assets/QItems-and-QRItems/Q_GTableMedicalHistory.json';
19
+ import GTableMedicalHistoryAnswersJson from './assets/QItems-and-QRItems/QR_GTableMedicalHistory.json';
20
+ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
21
+ // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
22
+ const meta = {
23
+ title: 'Component/GroupTable',
24
+ component: GroupTable,
25
+ // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
26
+ tags: [],
27
+ decorators: [
28
+ (Story)=>/*#__PURE__*/ React.createElement(ThemeProvider, null, /*#__PURE__*/ React.createElement(QueryClientProvider, {
29
+ client: new QueryClient()
30
+ }, Story()))
31
+ ]
32
+ };
33
+ const GTableMedicalHistoryItem = GTableMedicalHistoryItemJson;
34
+ const GTableMedicalHistoryAnswers = GTableMedicalHistoryAnswersJson;
35
+ export default meta;
36
+ // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
37
+ export const MedicalHistoryTable = {
38
+ args: {
39
+ qItem: GTableMedicalHistoryItem,
40
+ qrItems: GTableMedicalHistoryAnswers,
41
+ groupCardElevation: 1,
42
+ parentIsReadOnly: false,
43
+ onQrRepeatGroupChange: ()=>{}
44
+ }
45
+ };
@@ -0,0 +1,117 @@
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
+ */ import { SmartFormsRenderer } from '../components';
17
+ import Q715Json from './assets/Qs-and-QRs/Q715.json';
18
+ import R715Json from './assets/Qs-and-QRs/R715.json';
19
+ import QTestGridJson from './assets/Qs-and-QRs/QTestGrid.json';
20
+ import RTestGridJson from './assets/Qs-and-QRs/RTestGrid.json';
21
+ import QDev715Json from './assets/Qs-and-QRs/QDev715.json';
22
+ // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
23
+ const meta = {
24
+ title: 'Component/SmartFormsRenderer',
25
+ component: SmartFormsRenderer,
26
+ // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
27
+ tags: []
28
+ };
29
+ const Q715 = Q715Json;
30
+ const R715 = R715Json;
31
+ const QTestGrid = QTestGridJson;
32
+ const RTestGrid = RTestGridJson;
33
+ const QDev715 = QDev715Json;
34
+ export default meta;
35
+ // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
36
+ export const Form715 = {
37
+ args: {
38
+ questionnaire: Q715
39
+ }
40
+ };
41
+ export const Form715WithResponse = {
42
+ args: {
43
+ questionnaire: Q715,
44
+ questionnaireResponse: R715
45
+ }
46
+ };
47
+ export const FormDev715 = {
48
+ args: {
49
+ questionnaire: QDev715
50
+ }
51
+ };
52
+ export const FormTestGrid = {
53
+ args: {
54
+ questionnaire: QTestGrid
55
+ }
56
+ };
57
+ export const FormTestGridWithResponse = {
58
+ args: {
59
+ questionnaire: QTestGrid,
60
+ questionnaireResponse: RTestGrid,
61
+ additionalVariables: {}
62
+ }
63
+ };
64
+ export const QTestGridWithResponseAddFhirPath = {
65
+ args: {
66
+ questionnaire: QTestGrid,
67
+ questionnaireResponse: RTestGrid,
68
+ additionalVariables: {
69
+ addVar1: {
70
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
71
+ valueExpression: {
72
+ name: 'addVar1',
73
+ language: 'text/fhirpath',
74
+ expression: "%resource.item.where(linkId='grid').item.where(linkId='1').item.where(linkId='1.1').item.where(linkId='1.1.1').answer.value"
75
+ }
76
+ }
77
+ }
78
+ }
79
+ };
80
+ export const QTestGridWithResponseAddXFhirQuery = {
81
+ args: {
82
+ questionnaire: QTestGrid,
83
+ questionnaireResponse: RTestGrid,
84
+ additionalVariables: {
85
+ addVar1: {
86
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
87
+ valueExpression: {
88
+ name: 'addVar1',
89
+ language: 'text/fhirpath',
90
+ expression: "%resource.item.where(linkId='grid').item.where(linkId='1').item.where(linkId='1.1').item.where(linkId='1.1.1').answer.value"
91
+ }
92
+ },
93
+ addVar2: {
94
+ url: 'http://hl7.org/fhir/StructureDefinition/variable',
95
+ valueExpression: {
96
+ name: 'addVar2',
97
+ language: 'application/x-fhir-query',
98
+ expression: 'Condition?patient={{%patient.id}}'
99
+ }
100
+ }
101
+ }
102
+ }
103
+ };
104
+ export const QTestGridWithResponseReadOnly = {
105
+ args: {
106
+ questionnaire: QTestGrid,
107
+ questionnaireResponse: RTestGrid,
108
+ readOnly: true
109
+ }
110
+ };
111
+ export const Form715WithResponseReadOnly = {
112
+ args: {
113
+ questionnaire: Q715,
114
+ questionnaireResponse: R715,
115
+ readOnly: true
116
+ }
117
+ };
@@ -85,6 +85,12 @@ export declare function getTextDisplayUpper(qItem: QuestionnaireItem): string;
85
85
  * @author Sean Fong
86
86
  */
87
87
  export declare function getTextDisplayInstructions(qItem: QuestionnaireItem): string;
88
+ /**
89
+ * Get text display flyover for items with itemControlCode flyover and has an flyover childItem
90
+ *
91
+ * @author Sean Fong
92
+ */
93
+ export declare function getTextDisplayFlyover(qItem: QuestionnaireItem): string;
88
94
  /**
89
95
  * Get entry format if its extension is present
90
96
  * i.e. DD-MM-YYYY for dates, HH:MM for times etc.
@@ -248,6 +248,21 @@ export function getTextDisplayInstructions(qItem) {
248
248
  }
249
249
  return '';
250
250
  }
251
+ /**
252
+ * Get text display flyover for items with itemControlCode flyover and has an flyover childItem
253
+ *
254
+ * @author Sean Fong
255
+ */
256
+ export function getTextDisplayFlyover(qItem) {
257
+ if (qItem.item) {
258
+ for (const childItem of qItem.item) {
259
+ if (childItem.type === 'display' && isSpecificItemControl(childItem, 'flyover')) {
260
+ return `${childItem.text}`;
261
+ }
262
+ }
263
+ }
264
+ return '';
265
+ }
251
266
  /**
252
267
  * Get entry format if its extension is present
253
268
  * i.e. DD-MM-YYYY for dates, HH:MM for times etc.
@@ -1 +1 @@
1
- {"version":3,"file":"itemControl.js","sourceRoot":"","sources":["../../src/utils/itemControl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAwB,EAAE,eAAuB;;IACrF,MAAM,WAAW,GAAG,MAAA,KAAK,CAAC,SAAS,0CAAE,IAAI,CACvC,CAAC,SAAoB,EAAE,EAAE,CACvB,SAAS,CAAC,G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": "0.13.2",
4
4
  "description": "FHIR Structured Data Captured (SDC) rendering engine for Smart Forms",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -16,7 +16,7 @@
16
16
  */
17
17
 
18
18
  import Box from '@mui/material/Box';
19
- import { alpha, styled } from '@mui/material/styles';
19
+ import { styled } from '@mui/material/styles';
20
20
  import FormControlLabel from '@mui/material/FormControlLabel';
21
21
 
22
22
  export const QGroupContainerBox = styled(Box, {
@@ -37,33 +37,3 @@ export const FormTitleWrapper = styled(Box)(() => ({
37
37
  export const StyledFormControlLabel = styled(FormControlLabel)(() => ({
38
38
  height: 34
39
39
  }));
40
-
41
- export const RequiredLabel = styled(Box)(({ theme }) => ({
42
- height: 12,
43
- minWidth: 20,
44
- lineHeight: 0,
45
- borderRadius: 6,
46
- alignItems: 'center',
47
- whiteSpace: 'nowrap',
48
- justifyContent: 'center',
49
- padding: theme.spacing(1),
50
- fontSize: theme.typography.caption.fontSize,
51
- color: theme.palette.error.dark,
52
- backgroundColor: alpha(theme.palette.error.main, 0.16),
53
- fontWeight: theme.typography.fontWeightBold
54
- }));
55
-
56
- export const ReadOnlyLabel = styled(Box)(({ theme }) => ({
57
- height: 12,
58
- minWidth: 20,
59
- lineHeight: 0,
60
- borderRadius: 6,
61
- alignItems: 'center',
62
- whiteSpace: 'nowrap',
63
- justifyContent: 'center',
64
- padding: theme.spacing(1),
65
- fontSize: theme.typography.caption.fontSize,
66
- color: theme.palette.text.primary,
67
- backgroundColor: theme.palette.grey['300'],
68
- fontWeight: theme.typography.fontWeightBold
69
- }));
@@ -23,7 +23,6 @@ import type {
23
23
  PropsWithQrItemChangeHandler
24
24
  } from '../../../interfaces/renderProps.interface';
25
25
  import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
26
- import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
27
26
  import { createEmptyQrItem } from '../../../utils/qrItem';
28
27
  import { FullWidthFormComponentBox } from '../../Box.styles';
29
28
  import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
@@ -44,7 +43,6 @@ function BooleanItem(props: BooleanItemProps) {
44
43
  const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
45
44
 
46
45
  const readOnly = useReadOnly(qItem, parentIsReadOnly);
47
- const { displayInstructions, required } = useRenderingExtensions(qItem);
48
46
 
49
47
  // Init input value
50
48
  let checked = false;
@@ -75,11 +73,7 @@ function BooleanItem(props: BooleanItemProps) {
75
73
  }
76
74
  return (
77
75
  <FullWidthFormComponentBox data-test="q-item-boolean-box">
78
- <ItemFieldGrid
79
- qItem={qItem}
80
- displayInstructions={displayInstructions}
81
- required={required}
82
- readOnly={readOnly}>
76
+ <ItemFieldGrid qItem={qItem} readOnly={readOnly}>
83
77
  <BooleanField checked={checked} readOnly={readOnly} onCheckedChange={handleCheckedChange} />
84
78
  </ItemFieldGrid>
85
79
  </FullWidthFormComponentBox>
@@ -22,7 +22,6 @@ import { createEmptyQrItem } from '../../../utils/qrItem';
22
22
  import { FullWidthFormComponentBox } from '../../Box.styles';
23
23
  import useDebounce from '../../../hooks/useDebounce';
24
24
  import useTerminologyServerQuery from '../../../hooks/useTerminologyServerQuery';
25
- import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
26
25
  import type {
27
26
  PropsWithIsRepeatedAttribute,
28
27
  PropsWithIsTabledAttribute,
@@ -54,7 +53,6 @@ function ChoiceAutocompleteItem(props: ChoiceAutocompleteItemProps) {
54
53
  }
55
54
 
56
55
  const readOnly = useReadOnly(qItem, parentIsReadOnly);
57
- const { displayInstructions, required } = useRenderingExtensions(qItem);
58
56
 
59
57
  const maxList = 10;
60
58
 
@@ -104,11 +102,7 @@ function ChoiceAutocompleteItem(props: ChoiceAutocompleteItemProps) {
104
102
 
105
103
  return (
106
104
  <FullWidthFormComponentBox>
107
- <ItemFieldGrid
108
- qItem={qItem}
109
- displayInstructions={displayInstructions}
110
- required={required}
111
- readOnly={readOnly}>
105
+ <ItemFieldGrid qItem={qItem} readOnly={readOnly}>
112
106
  <ChoiceAutocompleteField
113
107
  qItem={qItem}
114
108
  options={options}
@@ -59,7 +59,7 @@ function ChoiceCheckboxAnswerOptionItem(props: ChoiceCheckboxAnswerOptionItemPro
59
59
  const answers = qrChoiceCheckbox.answer ? qrChoiceCheckbox.answer : [];
60
60
 
61
61
  const readOnly = useReadOnly(qItem, parentIsReadOnly);
62
- const { displayInstructions, required } = useRenderingExtensions(qItem);
62
+ const { displayInstructions } = useRenderingExtensions(qItem);
63
63
 
64
64
  // Event handlers
65
65
  function handleCheckedChange(changedValue: string) {
@@ -96,11 +96,7 @@ function ChoiceCheckboxAnswerOptionItem(props: ChoiceCheckboxAnswerOptionItemPro
96
96
 
97
97
  return (
98
98
  <FullWidthFormComponentBox data-test="q-item-choice-checkbox-answer-option-box">
99
- <ItemFieldGrid
100
- qItem={qItem}
101
- displayInstructions={displayInstructions}
102
- required={required}
103
- readOnly={readOnly}>
99
+ <ItemFieldGrid qItem={qItem} readOnly={readOnly}>
104
100
  <ChoiceCheckboxAnswerValueSetFields
105
101
  qItem={qItem}
106
102
  answers={answers}
@@ -61,7 +61,7 @@ function ChoiceCheckboxAnswerValueSetItem(props: ChoiceCheckboxAnswerValueSetIte
61
61
  const answers = qrChoiceCheckbox.answer ? qrChoiceCheckbox.answer : [];
62
62
 
63
63
  const readOnly = useReadOnly(qItem, parentIsReadOnly);
64
- const { displayInstructions, required } = useRenderingExtensions(qItem);
64
+ const { displayInstructions } = useRenderingExtensions(qItem);
65
65
 
66
66
  // Get codings/options from valueSet
67
67
  const { codings, serverError } = useValueSetCodings(qItem);
@@ -101,11 +101,7 @@ function ChoiceCheckboxAnswerValueSetItem(props: ChoiceCheckboxAnswerValueSetIte
101
101
 
102
102
  return (
103
103
  <FullWidthFormComponentBox data-test="q-item-choice-checkbox-answer-value-set-box">
104
- <ItemFieldGrid
105
- qItem={qItem}
106
- displayInstructions={displayInstructions}
107
- required={required}
108
- readOnly={readOnly}>
104
+ <ItemFieldGrid qItem={qItem} readOnly={readOnly}>
109
105
  <ChoiceCheckboxAnswerValueSetFields
110
106
  codings={codings}
111
107
  answers={answers}
@@ -21,7 +21,6 @@ import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
21
21
  import { findInAnswerOptions, getQrChoiceValue } from '../../../utils/choice';
22
22
  import { createEmptyQrItem } from '../../../utils/qrItem';
23
23
  import { FullWidthFormComponentBox } from '../../Box.styles';
24
- import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
25
24
  import type {
26
25
  PropsWithIsRepeatedAttribute,
27
26
  PropsWithParentIsReadOnlyAttribute,
@@ -48,7 +47,6 @@ function ChoiceRadioAnswerOptionItem(props: ChoiceRadioAnswerOptionItemProps) {
48
47
  const valueRadio = getQrChoiceValue(qrChoiceRadio);
49
48
 
50
49
  const readOnly = useReadOnly(qItem, parentIsReadOnly);
51
- const { displayInstructions, required } = useRenderingExtensions(qItem);
52
50
 
53
51
  // Event handlers
54
52
  function handleChange(newValue: string) {
@@ -74,11 +72,7 @@ function ChoiceRadioAnswerOptionItem(props: ChoiceRadioAnswerOptionItemProps) {
74
72
 
75
73
  return (
76
74
  <FullWidthFormComponentBox data-test="q-item-choice-radio-answer-option-box">
77
- <ItemFieldGrid
78
- qItem={qItem}
79
- displayInstructions={displayInstructions}
80
- required={required}
81
- readOnly={readOnly}>
75
+ <ItemFieldGrid qItem={qItem} readOnly={readOnly}>
82
76
  <ChoiceRadioAnswerOptionFields
83
77
  qItem={qItem}
84
78
  valueRadio={valueRadio}
@@ -22,7 +22,6 @@ import { findInAnswerValueSetCodings } from '../../../utils/choice';
22
22
  import { createEmptyQrItem } from '../../../utils/qrItem';
23
23
  import { FullWidthFormComponentBox } from '../../Box.styles';
24
24
  import useValueSetCodings from '../../../hooks/useValueSetCodings';
25
- import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
26
25
  import type {
27
26
  PropsWithIsRepeatedAttribute,
28
27
  PropsWithParentIsReadOnlyAttribute,
@@ -45,7 +44,6 @@ function ChoiceRadioAnswerValueSetItem(props: ChoiceRadioAnswerValueSetItemProps
45
44
  const { qItem, qrItem, orientation, isRepeated, parentIsReadOnly, onQrItemChange } = props;
46
45
 
47
46
  const readOnly = useReadOnly(qItem, parentIsReadOnly);
48
- const { displayInstructions, required } = useRenderingExtensions(qItem);
49
47
 
50
48
  // Init input value
51
49
  const qrChoiceRadio = qrItem ?? createEmptyQrItem(qItem);
@@ -86,11 +84,7 @@ function ChoiceRadioAnswerValueSetItem(props: ChoiceRadioAnswerValueSetItemProps
86
84
 
87
85
  return (
88
86
  <FullWidthFormComponentBox data-test="q-item-choice-radio-answer-value-set-box">
89
- <ItemFieldGrid
90
- qItem={qItem}
91
- displayInstructions={displayInstructions}
92
- required={required}
93
- readOnly={readOnly}>
87
+ <ItemFieldGrid qItem={qItem} readOnly={readOnly}>
94
88
  <ChoiceRadioAnswerValueSetFields
95
89
  qItem={qItem}
96
90
  codings={codings}
@@ -21,7 +21,6 @@ import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
21
21
  import { findInAnswerOptions, getQrChoiceValue } from '../../../utils/choice';
22
22
  import { createEmptyQrItem } from '../../../utils/qrItem';
23
23
  import { FullWidthFormComponentBox } from '../../Box.styles';
24
- import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
25
24
  import type {
26
25
  PropsWithIsRepeatedAttribute,
27
26
  PropsWithIsTabledAttribute,
@@ -45,7 +44,6 @@ function ChoiceSelectAnswerOptionItem(props: ChoiceSelectAnswerOptionItemProps)
45
44
  const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
46
45
 
47
46
  const readOnly = useReadOnly(qItem, parentIsReadOnly);
48
- const { displayInstructions, required } = useRenderingExtensions(qItem);
49
47
 
50
48
  // Init input value
51
49
  const qrChoiceSelect = qrItem ?? createEmptyQrItem(qItem);
@@ -80,11 +78,7 @@ function ChoiceSelectAnswerOptionItem(props: ChoiceSelectAnswerOptionItemProps)
80
78
 
81
79
  return (
82
80
  <FullWidthFormComponentBox data-test="q-item-choice-select-answer-option-box">
83
- <ItemFieldGrid
84
- qItem={qItem}
85
- displayInstructions={displayInstructions}
86
- required={required}
87
- readOnly={readOnly}>
81
+ <ItemFieldGrid qItem={qItem} readOnly={readOnly}>
88
82
  <ChoiceSelectAnswerOptionFields
89
83
  qItem={qItem}
90
84
  valueSelect={valueSelect}
@@ -21,7 +21,6 @@ import type { Coding, QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/
21
21
  import { createEmptyQrItem } from '../../../utils/qrItem';
22
22
  import { FullWidthFormComponentBox } from '../../Box.styles';
23
23
  import useValueSetCodings from '../../../hooks/useValueSetCodings';
24
- import useRenderingExtensions from '../../../hooks/useRenderingExtensions';
25
24
  import type {
26
25
  PropsWithIsRepeatedAttribute,
27
26
  PropsWithIsTabledAttribute,
@@ -45,7 +44,6 @@ function ChoiceSelectAnswerValueSetItem(props: ChoiceSelectAnswerValueSetItemPro
45
44
  const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
46
45
 
47
46
  const readOnly = useReadOnly(qItem, parentIsReadOnly);
48
- const { displayInstructions, required } = useRenderingExtensions(qItem);
49
47
 
50
48
  // Init input value
51
49
  const qrChoiceSelect = qrItem ?? createEmptyQrItem(qItem);
@@ -106,11 +104,7 @@ function ChoiceSelectAnswerValueSetItem(props: ChoiceSelectAnswerValueSetItemPro
106
104
 
107
105
  return (
108
106
  <FullWidthFormComponentBox data-test="q-item-choice-dropdown-answer-value-set-box">
109
- <ItemFieldGrid
110
- qItem={qItem}
111
- displayInstructions={displayInstructions}
112
- required={required}
113
- readOnly={readOnly}>
107
+ <ItemFieldGrid qItem={qItem} readOnly={readOnly}>
114
108
  <ChoiceSelectAnswerValueSetFields
115
109
  qItem={qItem}
116
110
  codings={codings}
@@ -49,8 +49,7 @@ function CustomDateItem(props: CustomDateItemProps) {
49
49
  const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
50
50
 
51
51
  const readOnly = useReadOnly(qItem, parentIsReadOnly);
52
- const { displayPrompt, displayInstructions, entryFormat, required } =
53
- useRenderingExtensions(qItem);
52
+ const { displayPrompt, entryFormat } = useRenderingExtensions(qItem);
54
53
 
55
54
  const qrDate = qrItem ?? createEmptyQrItem(qItem);
56
55
 
@@ -118,11 +117,7 @@ function CustomDateItem(props: CustomDateItemProps) {
118
117
 
119
118
  return (
120
119
  <FullWidthFormComponentBox data-test="q-item-date-box">
121
- <ItemFieldGrid
122
- qItem={qItem}
123
- displayInstructions={displayInstructions}
124
- required={required}
125
- readOnly={readOnly}>
120
+ <ItemFieldGrid qItem={qItem} readOnly={readOnly}>
126
121
  <CustomDateField
127
122
  linkId={qItem.linkId}
128
123
  valueDate={displayDate}
@@ -45,8 +45,7 @@ function DateItem(props: DateItemProps) {
45
45
  const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
46
46
 
47
47
  const readOnly = useReadOnly(qItem, parentIsReadOnly);
48
- const { displayPrompt, displayInstructions, entryFormat, required } =
49
- useRenderingExtensions(qItem);
48
+ const { displayPrompt, entryFormat } = useRenderingExtensions(qItem);
50
49
 
51
50
  // Init input value
52
51
  let dateString: string | null = null;
@@ -86,11 +85,7 @@ function DateItem(props: DateItemProps) {
86
85
 
87
86
  return (
88
87
  <FullWidthFormComponentBox data-test="q-item-date-box">
89
- <ItemFieldGrid
90
- qItem={qItem}
91
- displayInstructions={displayInstructions}
92
- required={required}
93
- readOnly={readOnly}>
88
+ <ItemFieldGrid qItem={qItem} readOnly={readOnly}>
94
89
  <DateField
95
90
  value={dateDayJs}
96
91
  displayPrompt={displayPrompt}
@@ -45,8 +45,7 @@ function DateTimeItem(props: DateTimeItemProps) {
45
45
  const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
46
46
 
47
47
  const readOnly = useReadOnly(qItem, parentIsReadOnly);
48
- const { displayPrompt, displayInstructions, entryFormat, required } =
49
- useRenderingExtensions(qItem);
48
+ const { displayPrompt, entryFormat } = useRenderingExtensions(qItem);
50
49
 
51
50
  // Init input value
52
51
  let dateTimeString: string | null = null;
@@ -84,11 +83,7 @@ function DateTimeItem(props: DateTimeItemProps) {
84
83
 
85
84
  return (
86
85
  <FullWidthFormComponentBox data-test="q-item-date-time-box">
87
- <ItemFieldGrid
88
- qItem={qItem}
89
- displayInstructions={displayInstructions}
90
- required={required}
91
- readOnly={readOnly}>
86
+ <ItemFieldGrid qItem={qItem} readOnly={readOnly}>
92
87
  <DateTimeField
93
88
  value={dateTimeDayJs}
94
89
  displayPrompt={displayPrompt}
@@ -54,16 +54,8 @@ function DecimalItem(props: DecimalItemProps) {
54
54
 
55
55
  const readOnly = useReadOnly(qItem, parentIsReadOnly);
56
56
  const precision = getDecimalPrecision(qItem);
57
- const {
58
- displayUnit,
59
- displayPrompt,
60
- displayInstructions,
61
- entryFormat,
62
- required,
63
- regexValidation,
64
- minLength,
65
- maxLength
66
- } = useRenderingExtensions(qItem);
57
+ const { displayUnit, displayPrompt, entryFormat, regexValidation, minLength, maxLength } =
58
+ useRenderingExtensions(qItem);
67
59
 
68
60
  // Init input value
69
61
  let valueDecimal = 0.0;
@@ -135,11 +127,7 @@ function DecimalItem(props: DecimalItemProps) {
135
127
 
136
128
  return (
137
129
  <FullWidthFormComponentBox data-test="q-item-decimal-box">
138
- <ItemFieldGrid
139
- qItem={qItem}
140
- displayInstructions={displayInstructions}
141
- required={required}
142
- readOnly={readOnly}>
130
+ <ItemFieldGrid qItem={qItem} readOnly={readOnly}>
143
131
  <DecimalField
144
132
  linkId={qItem.linkId}
145
133
  input={input}
@@ -49,16 +49,8 @@ function IntegerItem(props: IntegerItemProps) {
49
49
  const { qItem, qrItem, isRepeated, isTabled, parentIsReadOnly, onQrItemChange } = props;
50
50
 
51
51
  const readOnly = useReadOnly(qItem, parentIsReadOnly);
52
- const {
53
- displayUnit,
54
- displayPrompt,
55
- displayInstructions,
56
- entryFormat,
57
- required,
58
- regexValidation,
59
- minLength,
60
- maxLength
61
- } = useRenderingExtensions(qItem);
52
+ const { displayUnit, displayPrompt, entryFormat, regexValidation, minLength, maxLength } =
53
+ useRenderingExtensions(qItem);
62
54
 
63
55
  // Init input value
64
56
  let valueInteger = 0;
@@ -123,11 +115,7 @@ function IntegerItem(props: IntegerItemProps) {
123
115
 
124
116
  return (
125
117
  <FullWidthFormComponentBox data-test="q-item-integer-box">
126
- <ItemFieldGrid
127
- qItem={qItem}
128
- displayInstructions={displayInstructions}
129
- required={required}
130
- readOnly={readOnly}>
118
+ <ItemFieldGrid qItem={qItem} readOnly={readOnly}>
131
119
  <IntegerField
132
120
  linkId={qItem.linkId}
133
121
  value={value}