@aehrc/smart-forms-renderer 0.40.3 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/FormComponents/AttachmentItem/AttachmentItem.js +2 -3
- package/lib/components/FormComponents/AttachmentItem/AttachmentItem.js.map +1 -1
- package/lib/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateItem.js +1 -2
- package/lib/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateItem.js.map +1 -1
- package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.js +3 -4
- package/lib/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.js.map +1 -1
- package/lib/components/FormComponents/DecimalItem/DecimalItem.js +2 -3
- package/lib/components/FormComponents/DecimalItem/DecimalItem.js.map +1 -1
- package/lib/components/FormComponents/IntegerItem/IntegerItem.js +2 -3
- package/lib/components/FormComponents/IntegerItem/IntegerItem.js.map +1 -1
- package/lib/components/FormComponents/QuantityItem/QuantityItem.js +1 -2
- package/lib/components/FormComponents/QuantityItem/QuantityItem.js.map +1 -1
- package/lib/components/FormComponents/RepeatGroup/AddItemButton.d.ts +2 -2
- package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js +2 -3
- package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js.map +1 -1
- package/lib/components/FormComponents/RepeatGroup/RepeatGroupView.d.ts +2 -2
- package/lib/components/FormComponents/StringItem/StringItem.js +2 -3
- package/lib/components/FormComponents/StringItem/StringItem.js.map +1 -1
- package/lib/components/FormComponents/Tables/AddRowButton.d.ts +2 -2
- package/lib/components/FormComponents/Tables/GroupTable.js +3 -1
- package/lib/components/FormComponents/Tables/GroupTable.js.map +1 -1
- package/lib/components/FormComponents/TextItem/TextItem.js +2 -3
- package/lib/components/FormComponents/TextItem/TextItem.js.map +1 -1
- package/lib/components/FormComponents/UrlItem/UrlItem.js +2 -3
- package/lib/components/FormComponents/UrlItem/UrlItem.js.map +1 -1
- package/lib/components/Renderer/BaseRenderer.js +4 -3
- package/lib/components/Renderer/BaseRenderer.js.map +1 -1
- package/lib/hooks/useGroupTableRows.d.ts +4 -4
- package/lib/hooks/useGroupTableRows.js +3 -5
- package/lib/hooks/useGroupTableRows.js.map +1 -1
- package/lib/hooks/useInitialiseGroupTableRows.d.ts +4 -0
- package/lib/hooks/{useNumberInput.js → useInitialiseGroupTableRows.js} +16 -13
- package/lib/hooks/useInitialiseGroupTableRows.js.map +1 -0
- package/lib/hooks/useInitialiseRepeatGroups.d.ts +2 -2
- package/lib/interfaces/repeatGroup.interface.d.ts +1 -1
- package/lib/stores/questionnaireResponseStore.d.ts +3 -0
- package/lib/stores/questionnaireResponseStore.js +5 -0
- package/lib/stores/questionnaireResponseStore.js.map +1 -1
- package/lib/tests/test-data/removeIdSample.d.ts +3 -0
- package/lib/tests/test-data/removeIdSample.js +99 -0
- package/lib/tests/test-data/removeIdSample.js.map +1 -0
- package/lib/theme/Theme.js +0 -2
- package/lib/theme/Theme.js.map +1 -1
- package/lib/utils/calculatedExpression.js +4 -4
- package/lib/utils/calculatedExpression.js.map +1 -1
- package/lib/utils/extractObservation.d.ts +1 -0
- package/lib/utils/extractObservation.js +1 -1
- package/lib/utils/extractObservation.js.map +1 -1
- package/lib/utils/initialise.js +0 -3
- package/lib/utils/initialise.js.map +1 -1
- package/lib/utils/openChoice.js +3 -3
- package/lib/utils/openChoice.js.map +1 -1
- package/lib/utils/repopulateItems.js +8 -8
- package/lib/utils/repopulateItems.js.map +1 -1
- package/package.json +6 -2
- package/src/components/FormComponents/AttachmentItem/AttachmentItem.tsx +2 -3
- package/src/components/FormComponents/DateTimeItems/CustomDateItem/CustomDateItem.tsx +1 -2
- package/src/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.tsx +3 -4
- package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +2 -3
- package/src/components/FormComponents/IntegerItem/IntegerItem.tsx +2 -3
- package/src/components/FormComponents/QuantityItem/QuantityItem.tsx +1 -2
- package/src/components/FormComponents/RepeatGroup/AddItemButton.tsx +2 -2
- package/src/components/FormComponents/RepeatGroup/RepeatGroup.tsx +2 -3
- package/src/components/FormComponents/RepeatGroup/RepeatGroupView.tsx +2 -2
- package/src/components/FormComponents/StringItem/StringItem.tsx +2 -3
- package/src/components/FormComponents/Tables/AddRowButton.tsx +2 -2
- package/src/components/FormComponents/Tables/GroupTable.tsx +5 -5
- package/src/components/FormComponents/TextItem/TextItem.tsx +2 -3
- package/src/components/FormComponents/UrlItem/UrlItem.tsx +2 -3
- package/src/components/Renderer/BaseRenderer.tsx +4 -3
- package/src/hooks/useGroupTableRows.ts +4 -9
- package/src/hooks/{useInitialiseGroupTable.ts → useInitialiseGroupTableRows.ts} +15 -11
- package/src/hooks/useInitialiseRepeatGroups.ts +2 -2
- package/src/interfaces/repeatGroup.interface.ts +1 -1
- package/src/stores/questionnaireResponseStore.ts +7 -0
- package/src/stories/assets/questionnaires/QButtonTester.ts +117 -0
- package/src/stories/storybookWrappers/IdRemoverButtonForStorybook.tsx +3 -5
- package/{lib/hooks/useInitialiseGroupTable.js → src/tests/removeId.test.ts} +11 -14
- package/src/tests/test-data/removeIdSample.ts +101 -0
- package/src/theme/Theme.tsx +0 -2
- package/src/utils/calculatedExpression.ts +4 -4
- package/src/utils/extractObservation.ts +1 -1
- package/src/utils/initialise.ts +0 -4
- package/src/utils/openChoice.ts +3 -3
- package/src/utils/repopulateItems.ts +8 -8
- package/lib/hooks/useInitialiseGroupTable.d.ts +0 -4
- package/lib/hooks/useInitialiseGroupTable.js.map +0 -1
- package/lib/hooks/useNumberInput.d.ts +0 -3
- package/lib/hooks/useNumberInput.js.map +0 -1
- package/lib/hooks/useRepeatGroups.d.ts +0 -4
- package/lib/hooks/useRepeatGroups.js +0 -38
- package/lib/hooks/useRepeatGroups.js.map +0 -1
- package/lib/hooks/useStringInput.d.ts +0 -3
- package/lib/hooks/useStringInput.js +0 -32
- package/lib/hooks/useStringInput.js.map +0 -1
- package/src/hooks/useNumberInput.ts +0 -38
- package/src/hooks/useRepeatGroups.ts +0 -51
- package/src/hooks/useStringInput.ts +0 -39
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repopulateItems.js","sourceRoot":"","sources":["../../src/utils/repopulateItems.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC3E,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,kCAAkC,EAAE,MAAM,0DAA0D,CAAC;AAC9G,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAqCjE;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,iBAAwC;IAChF,MAAM,mBAAmB,GAAG,kBAAkB,CAAC,QAAQ,EAAE,CAAC,mBAAmB,CAAC;IAC9E,MAAM,IAAI,GAAG,kBAAkB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC;IAChD,MAAM,iBAAiB,GAAG,0BAA0B,CAAC,QAAQ,EAAE,CAAC,iBAAiB,CAAC;IAClF,MAAM,sBAAsB,GAAG,0BAA0B,CAAC,QAAQ,EAAE,CAAC,sBAAsB,CAAC;IAC5F,MAAM,qBAAqB,GAAG,kBAAkB,CAAC,QAAQ,EAAE,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AI,OAAO,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,EAAE;YACnD,qBAAqB,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;SACrD;aAAM;YACL,mBAAmB,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;SAC9C;KACF;IAED,MAAM,+BAA+B,GAAG,CAAC,GAAG,qBAAqB,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5E,2CAA2C;IAC3C,IAAI,+BAA+B,CAAC,MAAM,KAAK,CAAC,EAAE;QAChD,OAAO,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACvC,OAAO;KACR;IAED,iDAAiD;IACjD,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,SAAS,GAAG;QAC1C,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,IAAI,EAAE,+BAA+B;KACtC,CAAC;IACF,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,SAAS,GAAG;QAC1C,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,IAAI,EAAE,mBAAmB;KAC1B,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aehrc/smart-forms-renderer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"description": "FHIR Structured Data Captured (SDC) rendering engine for Smart Forms",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"lodash.debounce": "^4.0.8",
|
|
40
40
|
"lodash.difference": "^4.5.0",
|
|
41
41
|
"lodash.intersection": "^4.4.0",
|
|
42
|
+
"lodash.isequal": "^4.5.0",
|
|
42
43
|
"nanoid": "^5.0.7",
|
|
43
44
|
"react-beautiful-dnd": "^13.1.1",
|
|
44
45
|
"react-dnd": "^16.0.1",
|
|
@@ -79,7 +80,10 @@
|
|
|
79
80
|
"@types/fhir": "^0.0.38",
|
|
80
81
|
"@types/jest": "^29.5.12",
|
|
81
82
|
"@types/lodash.clonedeep": "^4.5.9",
|
|
82
|
-
"@types/lodash.debounce": "^4.0.
|
|
83
|
+
"@types/lodash.debounce": "^4.0.9",
|
|
84
|
+
"@types/lodash.difference": "^4.5.9",
|
|
85
|
+
"@types/lodash.intersection": "^4.4.9",
|
|
86
|
+
"@types/lodash.isequal": "^4.5.8",
|
|
83
87
|
"@types/react": ">=17.0.0",
|
|
84
88
|
"@types/react-beautiful-dnd": "^13.1.7",
|
|
85
89
|
"@types/react-dom": ">=18.2.22",
|
|
@@ -26,7 +26,6 @@ import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
|
26
26
|
import debounce from 'lodash.debounce';
|
|
27
27
|
import { createEmptyQrItem } from '../../../utils/qrItem';
|
|
28
28
|
import { DEBOUNCE_DURATION } from '../../../utils/debounce';
|
|
29
|
-
import useStringInput from '../../../hooks/useStringInput';
|
|
30
29
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
31
30
|
import AttachmentFieldWrapper from './AttachmentFieldWrapper';
|
|
32
31
|
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
@@ -61,8 +60,8 @@ function AttachmentItem(props: AttachmentItemProps) {
|
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
const [uploadedFile, setUploadedFile] = useState<File | null>(null);
|
|
64
|
-
const [url, setUrl] =
|
|
65
|
-
const [fileName, setFileName] =
|
|
63
|
+
const [url, setUrl] = useState(valueString);
|
|
64
|
+
const [fileName, setFileName] = useState(valueString);
|
|
66
65
|
|
|
67
66
|
// Event handlers
|
|
68
67
|
async function handleUploadFile(newUploadedFile: File | null) {
|
|
@@ -36,7 +36,6 @@ import { createEmptyQrItem } from '../../../../utils/qrItem';
|
|
|
36
36
|
import useDateValidation from '../../../../hooks/useDateValidation';
|
|
37
37
|
import CustomDateField from './CustomDateField';
|
|
38
38
|
import { useQuestionnaireStore } from '../../../../stores';
|
|
39
|
-
import useStringInput from '../../../../hooks/useStringInput';
|
|
40
39
|
|
|
41
40
|
interface CustomDateItemProps
|
|
42
41
|
extends PropsWithQrItemChangeHandler,
|
|
@@ -70,7 +69,7 @@ function CustomDateItem(props: CustomDateItemProps) {
|
|
|
70
69
|
|
|
71
70
|
const { displayDate, dateParseFail } = parseFhirDateToDisplayDate(valueDate);
|
|
72
71
|
|
|
73
|
-
const [input, setInput] =
|
|
72
|
+
const [input, setInput] = useState(displayDate);
|
|
74
73
|
const [focused, setFocused] = useState(false);
|
|
75
74
|
|
|
76
75
|
// Perform validation checks
|
package/src/components/FormComponents/DateTimeItems/CustomDateTimeItem/CustomDateTimeItem.tsx
CHANGED
|
@@ -43,7 +43,6 @@ import {
|
|
|
43
43
|
import useTimeValidation from '../../../../hooks/useTimeValidation';
|
|
44
44
|
import useDateNonEmptyValidation from '../../../../hooks/useDateTimeNonEmpty';
|
|
45
45
|
import DateTimeField from './DateTimeField';
|
|
46
|
-
import useStringInput from '../../../../hooks/useStringInput';
|
|
47
46
|
|
|
48
47
|
interface CustomDateTimeItemProps
|
|
49
48
|
extends PropsWithQrItemChangeHandler,
|
|
@@ -88,9 +87,9 @@ function CustomDateTimeItem(props: CustomDateTimeItemProps) {
|
|
|
88
87
|
const { displayDate, dateParseFail } = parseFhirDateToDisplayDate(valueDate);
|
|
89
88
|
const { displayTime, displayPeriod, timeParseFail } = parseDateTimeToDisplayTime(dateTimeDayJs);
|
|
90
89
|
|
|
91
|
-
const [dateInput, setDateInput] =
|
|
92
|
-
const [timeInput, setTimeInput] =
|
|
93
|
-
const [periodInput, setPeriodInput] =
|
|
90
|
+
const [dateInput, setDateInput] = useState(displayDate);
|
|
91
|
+
const [timeInput, setTimeInput] = useState(displayTime);
|
|
92
|
+
const [periodInput, setPeriodInput] = useState(displayPeriod);
|
|
94
93
|
const [dateFocused, setDateFocused] = useState(false);
|
|
95
94
|
|
|
96
95
|
// Perform validation checks
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import React, { useCallback } from 'react';
|
|
18
|
+
import React, { useCallback, useState } from 'react';
|
|
19
19
|
import type {
|
|
20
20
|
PropsWithIsRepeatedAttribute,
|
|
21
21
|
PropsWithIsTabledAttribute,
|
|
@@ -37,7 +37,6 @@ import {
|
|
|
37
37
|
} from '../../../utils/parseInputs';
|
|
38
38
|
import { getDecimalPrecision } from '../../../utils/itemControl';
|
|
39
39
|
import useDecimalCalculatedExpression from '../../../hooks/useDecimalCalculatedExpression';
|
|
40
|
-
import useStringInput from '../../../hooks/useStringInput';
|
|
41
40
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
42
41
|
import { useQuestionnaireStore } from '../../../stores';
|
|
43
42
|
import Box from '@mui/material/Box';
|
|
@@ -76,7 +75,7 @@ function DecimalItem(props: DecimalItemProps) {
|
|
|
76
75
|
initialInput = precision ? valueDecimal.toFixed(precision) : valueDecimal.toString();
|
|
77
76
|
}
|
|
78
77
|
|
|
79
|
-
const [input, setInput] =
|
|
78
|
+
const [input, setInput] = useState(initialInput);
|
|
80
79
|
|
|
81
80
|
// Perform validation checks
|
|
82
81
|
const feedback = useValidationFeedback(qItem, input);
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import React, { useCallback } from 'react';
|
|
18
|
+
import React, { useCallback, useState } from 'react';
|
|
19
19
|
import type {
|
|
20
20
|
PropsWithIsRepeatedAttribute,
|
|
21
21
|
PropsWithIsTabledAttribute,
|
|
@@ -35,7 +35,6 @@ import { parseIntegerString } from '../../../utils/parseInputs';
|
|
|
35
35
|
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
36
36
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
37
37
|
import { useQuestionnaireStore } from '../../../stores';
|
|
38
|
-
import useStringInput from '../../../hooks/useStringInput';
|
|
39
38
|
|
|
40
39
|
interface IntegerItemProps
|
|
41
40
|
extends PropsWithQrItemChangeHandler,
|
|
@@ -70,7 +69,7 @@ function IntegerItem(props: IntegerItemProps) {
|
|
|
70
69
|
initialInput = valueInteger.toString();
|
|
71
70
|
}
|
|
72
71
|
|
|
73
|
-
const [input, setInput] =
|
|
72
|
+
const [input, setInput] = useState(initialInput);
|
|
74
73
|
|
|
75
74
|
// Perform validation checks
|
|
76
75
|
const feedback = useValidationFeedback(qItem, input);
|
|
@@ -20,7 +20,6 @@ import { createEmptyQrItem } from '../../../utils/qrItem';
|
|
|
20
20
|
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
21
21
|
import { parseDecimalStringWithPrecision } from '../../../utils/parseInputs';
|
|
22
22
|
import { getDecimalPrecision } from '../../../utils/itemControl';
|
|
23
|
-
import useStringInput from '../../../hooks/useStringInput';
|
|
24
23
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
25
24
|
import { useQuestionnaireStore } from '../../../stores';
|
|
26
25
|
import Box from '@mui/material/Box';
|
|
@@ -92,7 +91,7 @@ function QuantityItem(props: QuantityItemProps) {
|
|
|
92
91
|
}
|
|
93
92
|
|
|
94
93
|
// input states
|
|
95
|
-
const [valueInput, setValueInput] =
|
|
94
|
+
const [valueInput, setValueInput] = useState(initialValueInput);
|
|
96
95
|
const [comparatorInput, setComparatorInput] = useState<Quantity['comparator'] | null>(
|
|
97
96
|
initialComparatorInput
|
|
98
97
|
);
|
|
@@ -19,10 +19,10 @@ import React from 'react';
|
|
|
19
19
|
import Box from '@mui/material/Box';
|
|
20
20
|
import Button from '@mui/material/Button';
|
|
21
21
|
import AddIcon from '@mui/icons-material/Add';
|
|
22
|
-
import type {
|
|
22
|
+
import type { RepeatGroupSingleModel } from '../../../interfaces/repeatGroup.interface';
|
|
23
23
|
|
|
24
24
|
interface AddItemButtonProps {
|
|
25
|
-
repeatGroups:
|
|
25
|
+
repeatGroups: RepeatGroupSingleModel[];
|
|
26
26
|
readOnly: boolean;
|
|
27
27
|
onAddItem: () => void;
|
|
28
28
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import React from 'react';
|
|
18
|
+
import React, { useState } from 'react';
|
|
19
19
|
import type {
|
|
20
20
|
PropsWithParentIsReadOnlyAttribute,
|
|
21
21
|
PropsWithParentIsRepeatGroupAttribute,
|
|
@@ -26,7 +26,6 @@ import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
|
|
|
26
26
|
import useInitialiseRepeatGroups from '../../../hooks/useInitialiseRepeatGroups';
|
|
27
27
|
import cloneDeep from 'lodash.clonedeep';
|
|
28
28
|
import { useQuestionnaireStore } from '../../../stores';
|
|
29
|
-
import useRepeatGroups from '../../../hooks/useRepeatGroups';
|
|
30
29
|
import RepeatGroupView from './RepeatGroupView';
|
|
31
30
|
import { generateNewRepeatId } from '../../../utils/repeatId';
|
|
32
31
|
|
|
@@ -60,7 +59,7 @@ function RepeatGroup(props: RepeatGroupProps) {
|
|
|
60
59
|
|
|
61
60
|
const initialRepeatGroups = useInitialiseRepeatGroups(qItem.linkId, qrItems);
|
|
62
61
|
|
|
63
|
-
const [repeatGroups, setRepeatGroups] =
|
|
62
|
+
const [repeatGroups, setRepeatGroups] = useState(initialRepeatGroups);
|
|
64
63
|
|
|
65
64
|
function handleAnswerChange(newQrItem: QuestionnaireResponseItem, index: number) {
|
|
66
65
|
const updatedRepeatGroups = [...repeatGroups];
|
|
@@ -32,7 +32,7 @@ import RepeatGroupItem from './RepeatGroupItem';
|
|
|
32
32
|
import AddItemButton from './AddItemButton';
|
|
33
33
|
import LabelWrapper from '../ItemParts/ItemLabelWrapper';
|
|
34
34
|
import Typography from '@mui/material/Typography';
|
|
35
|
-
import type {
|
|
35
|
+
import type { RepeatGroupSingleModel } from '../../../interfaces/repeatGroup.interface';
|
|
36
36
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
37
37
|
import { getGroupCollapsible } from '../../../utils/qItem';
|
|
38
38
|
import { GroupAccordion } from '../GroupItem/GroupAccordion.styles';
|
|
@@ -45,7 +45,7 @@ interface RepeatGroupViewProps
|
|
|
45
45
|
PropsWithParentIsReadOnlyAttribute,
|
|
46
46
|
PropsWithParentIsRepeatGroupAttribute {
|
|
47
47
|
qItem: QuestionnaireItem;
|
|
48
|
-
repeatGroups:
|
|
48
|
+
repeatGroups: RepeatGroupSingleModel[];
|
|
49
49
|
groupCardElevation: number;
|
|
50
50
|
onAnswerChange: (newQrItem: QuestionnaireResponseItem, index: number) => void;
|
|
51
51
|
onAddItem: () => void;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import React, { useCallback } from 'react';
|
|
18
|
+
import React, { useCallback, useState } from 'react';
|
|
19
19
|
import type {
|
|
20
20
|
PropsWithIsRepeatedAttribute,
|
|
21
21
|
PropsWithIsTabledAttribute,
|
|
@@ -32,7 +32,6 @@ import { FullWidthFormComponentBox } from '../../Box.styles';
|
|
|
32
32
|
import StringField from './StringField';
|
|
33
33
|
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
34
34
|
import useStringCalculatedExpression from '../../../hooks/useStringCalculatedExpression';
|
|
35
|
-
import useStringInput from '../../../hooks/useStringInput';
|
|
36
35
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
37
36
|
import { useQuestionnaireStore } from '../../../stores';
|
|
38
37
|
|
|
@@ -59,7 +58,7 @@ function StringItem(props: StringItemProps) {
|
|
|
59
58
|
valueString = qrItem.answer[0].valueString;
|
|
60
59
|
}
|
|
61
60
|
|
|
62
|
-
const [input, setInput] =
|
|
61
|
+
const [input, setInput] = useState(valueString);
|
|
63
62
|
|
|
64
63
|
// Perform validation checks
|
|
65
64
|
const feedback = useValidationFeedback(qItem, input);
|
|
@@ -19,10 +19,10 @@ import React from 'react';
|
|
|
19
19
|
import Box from '@mui/material/Box';
|
|
20
20
|
import Button from '@mui/material/Button';
|
|
21
21
|
import AddIcon from '@mui/icons-material/Add';
|
|
22
|
-
import type {
|
|
22
|
+
import type { RepeatGroupSingleModel } from '../../../interfaces/repeatGroup.interface';
|
|
23
23
|
|
|
24
24
|
interface AddItemButtonProps {
|
|
25
|
-
repeatGroups:
|
|
25
|
+
repeatGroups: RepeatGroupSingleModel[];
|
|
26
26
|
readOnly: boolean;
|
|
27
27
|
onAddItem: () => void;
|
|
28
28
|
}
|
|
@@ -32,6 +32,7 @@ import { getGroupTableItemsToUpdate } from '../../../utils/groupTable';
|
|
|
32
32
|
import useGroupTableRows from '../../../hooks/useGroupTableRows';
|
|
33
33
|
import { flushSync } from 'react-dom';
|
|
34
34
|
import { generateNewRepeatId } from '../../../utils/repeatId';
|
|
35
|
+
import useInitialiseGroupTableRows from '../../../hooks/useInitialiseGroupTableRows';
|
|
35
36
|
|
|
36
37
|
interface GroupTableProps
|
|
37
38
|
extends PropsWithQrRepeatGroupChangeHandler,
|
|
@@ -60,12 +61,11 @@ function GroupTable(props: GroupTableProps) {
|
|
|
60
61
|
onQrRepeatGroupChange
|
|
61
62
|
} = props;
|
|
62
63
|
|
|
63
|
-
const
|
|
64
|
+
const initialGroupTableRows = useInitialiseGroupTableRows(qItem.linkId, qrItems);
|
|
65
|
+
const { tableRows, selectedIds, setTableRows, setSelectedIds } =
|
|
66
|
+
useGroupTableRows(initialGroupTableRows);
|
|
64
67
|
|
|
65
|
-
const
|
|
66
|
-
qItem.linkId,
|
|
67
|
-
qrItems
|
|
68
|
-
);
|
|
68
|
+
const readOnly = useReadOnly(qItem, parentIsReadOnly);
|
|
69
69
|
|
|
70
70
|
// Generate item labels as table headers
|
|
71
71
|
const qItems = qItem.item;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import React, { useCallback } from 'react';
|
|
18
|
+
import React, { useCallback, useState } from 'react';
|
|
19
19
|
import type {
|
|
20
20
|
PropsWithIsRepeatedAttribute,
|
|
21
21
|
PropsWithParentIsReadOnlyAttribute,
|
|
@@ -31,7 +31,6 @@ import { FullWidthFormComponentBox } from '../../Box.styles';
|
|
|
31
31
|
import TextField from './TextField';
|
|
32
32
|
import useStringCalculatedExpression from '../../../hooks/useStringCalculatedExpression';
|
|
33
33
|
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
34
|
-
import useStringInput from '../../../hooks/useStringInput';
|
|
35
34
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
36
35
|
import { useQuestionnaireStore } from '../../../stores';
|
|
37
36
|
|
|
@@ -58,7 +57,7 @@ function TextItem(props: TextItemProps) {
|
|
|
58
57
|
valueText = qrItem.answer[0].valueString;
|
|
59
58
|
}
|
|
60
59
|
|
|
61
|
-
const [input, setInput] =
|
|
60
|
+
const [input, setInput] = useState(valueText);
|
|
62
61
|
|
|
63
62
|
// Perform validation checks
|
|
64
63
|
const feedback = useValidationFeedback(qItem, input);
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import React, { useCallback } from 'react';
|
|
18
|
+
import React, { useCallback, useState } from 'react';
|
|
19
19
|
import type {
|
|
20
20
|
PropsWithIsRepeatedAttribute,
|
|
21
21
|
PropsWithIsTabledAttribute,
|
|
@@ -33,7 +33,6 @@ import UrlField from './UrlField';
|
|
|
33
33
|
import ItemFieldGrid from '../ItemParts/ItemFieldGrid';
|
|
34
34
|
import useReadOnly from '../../../hooks/useReadOnly';
|
|
35
35
|
import { useQuestionnaireStore } from '../../../stores';
|
|
36
|
-
import useStringInput from '../../../hooks/useStringInput';
|
|
37
36
|
|
|
38
37
|
interface UrlItemProps
|
|
39
38
|
extends PropsWithQrItemChangeHandler,
|
|
@@ -58,7 +57,7 @@ function UrlItem(props: UrlItemProps) {
|
|
|
58
57
|
valueUri = qrItem.answer[0].valueUri;
|
|
59
58
|
}
|
|
60
59
|
|
|
61
|
-
const [input, setInput] =
|
|
60
|
+
const [input, setInput] = useState(valueUri);
|
|
62
61
|
|
|
63
62
|
// Perform validation checks
|
|
64
63
|
const feedback = useValidationFeedback(qItem, input);
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import React, { useMemo } from 'react';
|
|
19
|
-
import Container from '@mui/material/Container';
|
|
20
19
|
import Fade from '@mui/material/Fade';
|
|
21
20
|
import FormTopLevelItem from './FormTopLevelItem';
|
|
22
21
|
import type { QuestionnaireResponse, QuestionnaireResponseItem } from 'fhir/r4';
|
|
@@ -27,6 +26,7 @@ import { updateQrItemsInGroup } from '../../utils/qrItem';
|
|
|
27
26
|
import { everyIsPages } from '../../utils/page';
|
|
28
27
|
import type { QrRepeatGroup } from '../../interfaces/repeatGroup.interface';
|
|
29
28
|
import FormTopLevelPage from './FormTopLevelPage';
|
|
29
|
+
import { Container } from '@mui/material';
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Main component of the form-rendering engine.
|
|
@@ -40,6 +40,7 @@ function BaseRenderer() {
|
|
|
40
40
|
const updateExpressions = useQuestionnaireStore.use.updateExpressions();
|
|
41
41
|
const readOnly = useQuestionnaireStore.use.readOnly();
|
|
42
42
|
|
|
43
|
+
const responseKey = useQuestionnaireResponseStore.use.key();
|
|
43
44
|
const updatableResponse = useQuestionnaireResponseStore.use.updatableResponse();
|
|
44
45
|
const validateQuestionnaire = useQuestionnaireResponseStore.use.validateQuestionnaire();
|
|
45
46
|
const updateResponse = useQuestionnaireResponseStore.use.updateResponse();
|
|
@@ -81,7 +82,7 @@ function BaseRenderer() {
|
|
|
81
82
|
if (everyItemIsPage) {
|
|
82
83
|
return (
|
|
83
84
|
<Fade in={true} timeout={500}>
|
|
84
|
-
<Container maxWidth="xl">
|
|
85
|
+
<Container disableGutters maxWidth="xl" key={responseKey}>
|
|
85
86
|
<FormTopLevelPage
|
|
86
87
|
topLevelQItems={topLevelQItems}
|
|
87
88
|
topLevelQRItems={topLevelQRItemsByIndex}
|
|
@@ -97,7 +98,7 @@ function BaseRenderer() {
|
|
|
97
98
|
|
|
98
99
|
return (
|
|
99
100
|
<Fade in={true} timeout={500}>
|
|
100
|
-
<Container maxWidth="xl">
|
|
101
|
+
<Container disableGutters maxWidth="xl" key={responseKey}>
|
|
101
102
|
{topLevelQItems.map((qItem, index) => {
|
|
102
103
|
const qrItemOrItems = topLevelQRItemsByIndex[index];
|
|
103
104
|
|
|
@@ -16,16 +16,11 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import { useState } from 'react';
|
|
19
|
-
import
|
|
20
|
-
import type { QuestionnaireResponseItem } from 'fhir/r4';
|
|
19
|
+
import type { GroupTableRowModel } from '../interfaces/groupTable.interface';
|
|
21
20
|
|
|
22
|
-
function useGroupTableRows(
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
const [tableRows, setTableRows] = useState(initialisedGroupTableRows);
|
|
26
|
-
const [selectedIds, setSelectedIds] = useState<string[]>(
|
|
27
|
-
initialisedGroupTableRows.map((row) => row.id)
|
|
28
|
-
);
|
|
21
|
+
function useGroupTableRows(valueFromProps: GroupTableRowModel[]) {
|
|
22
|
+
const [tableRows, setTableRows] = useState(valueFromProps);
|
|
23
|
+
const [selectedIds, setSelectedIds] = useState<string[]>(valueFromProps.map((row) => row.id));
|
|
29
24
|
|
|
30
25
|
return { tableRows, selectedIds, setTableRows, setSelectedIds };
|
|
31
26
|
}
|
|
@@ -18,21 +18,25 @@
|
|
|
18
18
|
import type { QuestionnaireResponseItem } from 'fhir/r4';
|
|
19
19
|
import type { GroupTableRowModel } from '../interfaces/groupTable.interface';
|
|
20
20
|
import { generateExistingRepeatId, generateNewRepeatId } from '../utils/repeatId';
|
|
21
|
+
import { useMemo } from 'react';
|
|
21
22
|
|
|
22
|
-
function
|
|
23
|
+
function useInitialiseGroupTableRows(
|
|
23
24
|
linkId: string,
|
|
24
25
|
qrItems: QuestionnaireResponseItem[]
|
|
25
26
|
): GroupTableRowModel[] {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
return useMemo(() => {
|
|
28
|
+
if (qrItems.length === 0) {
|
|
29
|
+
return [{ id: generateNewRepeatId(linkId), qrItem: null, isSelected: true }];
|
|
30
|
+
}
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
return qrItems.map((qrItem, index) => {
|
|
33
|
+
return {
|
|
34
|
+
id: generateExistingRepeatId(linkId, index),
|
|
35
|
+
qrItem: qrItem,
|
|
36
|
+
isSelected: true
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
}, [linkId, qrItems]);
|
|
36
40
|
}
|
|
37
41
|
|
|
38
|
-
export default
|
|
42
|
+
export default useInitialiseGroupTableRows;
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { QuestionnaireResponseItem } from 'fhir/r4';
|
|
19
|
-
import type {
|
|
19
|
+
import type { RepeatGroupSingleModel } from '../interfaces/repeatGroup.interface';
|
|
20
20
|
import { useMemo } from 'react';
|
|
21
21
|
import { generateExistingRepeatId, generateNewRepeatId } from '../utils/repeatId';
|
|
22
22
|
|
|
23
23
|
function useInitialiseRepeatGroups(
|
|
24
24
|
linkId: string,
|
|
25
25
|
qrItems: QuestionnaireResponseItem[]
|
|
26
|
-
):
|
|
26
|
+
): RepeatGroupSingleModel[] {
|
|
27
27
|
return useMemo(() => {
|
|
28
28
|
if (qrItems.length === 0) {
|
|
29
29
|
return [{ id: generateNewRepeatId(linkId), qrItem: null }];
|
|
@@ -30,12 +30,14 @@ import { createSelectors } from './selector';
|
|
|
30
30
|
import { validateQuestionnaire } from '../utils/validateQuestionnaire';
|
|
31
31
|
import { questionnaireStore } from './questionnaireStore';
|
|
32
32
|
import { createQuestionnaireResponseItemMap } from '../utils/questionnaireResponseStoreUtils/updatableResponseItems';
|
|
33
|
+
import { generateUniqueId } from '../utils/extractObservation';
|
|
33
34
|
|
|
34
35
|
/**
|
|
35
36
|
* QuestionnaireResponseStore properties and methods
|
|
36
37
|
* Properties can be accessed for fine-grain details.
|
|
37
38
|
* Methods are usually used internally, using them from an external source is not recommended.
|
|
38
39
|
*
|
|
40
|
+
* @property key - The React key of the questionnaireResponse, used internally for refreshing the BaseRenderer
|
|
39
41
|
* @property sourceResponse - The original response created when the form is first initialised i.e. empty, pre-populated, opened saved draft
|
|
40
42
|
* @property updatableResponse - The current state of the response that is being updated via form fields
|
|
41
43
|
* @property updatableResponseItems - Key-value pair of updatableResponse items `Record<linkId, QR.item(s)>`
|
|
@@ -53,6 +55,7 @@ import { createQuestionnaireResponseItemMap } from '../utils/questionnaireRespon
|
|
|
53
55
|
* @author Sean Fong
|
|
54
56
|
*/
|
|
55
57
|
export interface QuestionnaireResponseStoreType {
|
|
58
|
+
key: string;
|
|
56
59
|
sourceResponse: QuestionnaireResponse;
|
|
57
60
|
updatableResponse: QuestionnaireResponse;
|
|
58
61
|
updatableResponseItems: Record<string, QuestionnaireResponseItem[]>;
|
|
@@ -80,6 +83,7 @@ export interface QuestionnaireResponseStoreType {
|
|
|
80
83
|
*/
|
|
81
84
|
export const questionnaireResponseStore = createStore<QuestionnaireResponseStoreType>()(
|
|
82
85
|
(set, get) => ({
|
|
86
|
+
key: 'QR-initial-key',
|
|
83
87
|
sourceResponse: cloneDeep(emptyResponse),
|
|
84
88
|
updatableResponse: cloneDeep(emptyResponse),
|
|
85
89
|
updatableResponseItems: {},
|
|
@@ -108,6 +112,7 @@ export const questionnaireResponseStore = createStore<QuestionnaireResponseStore
|
|
|
108
112
|
});
|
|
109
113
|
|
|
110
114
|
set(() => ({
|
|
115
|
+
key: generateUniqueId('QR'),
|
|
111
116
|
sourceResponse: questionnaireResponse,
|
|
112
117
|
updatableResponse: questionnaireResponse,
|
|
113
118
|
updatableResponseItems: createQuestionnaireResponseItemMap(questionnaireResponse),
|
|
@@ -153,6 +158,7 @@ export const questionnaireResponseStore = createStore<QuestionnaireResponseStore
|
|
|
153
158
|
});
|
|
154
159
|
|
|
155
160
|
set(() => ({
|
|
161
|
+
key: generateUniqueId('QR'),
|
|
156
162
|
sourceResponse: savedResponse,
|
|
157
163
|
updatableResponse: savedResponse,
|
|
158
164
|
updatableResponseItems: createQuestionnaireResponseItemMap(savedResponse),
|
|
@@ -178,6 +184,7 @@ export const questionnaireResponseStore = createStore<QuestionnaireResponseStore
|
|
|
178
184
|
},
|
|
179
185
|
destroySourceResponse: () =>
|
|
180
186
|
set(() => ({
|
|
187
|
+
key: generateUniqueId('QR'),
|
|
181
188
|
sourceResponse: cloneDeep(emptyResponse),
|
|
182
189
|
updatableResponse: cloneDeep(emptyResponse),
|
|
183
190
|
updatableResponseItems: createQuestionnaireResponseItemMap(cloneDeep(emptyResponse)),
|