@aehrc/smart-forms-renderer 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/hooks/useCalculatedExpressionUpdated.js +3 -1
- package/lib/hooks/useCalculatedExpressionUpdated.js.map +1 -1
- package/package.json +1 -1
- package/src/hooks/useCalculatedExpressionUpdated.ts +3 -1
- package/lib/components/FormComponents/ItemParts/FadingCheckIcon.d.ts +0 -7
- package/lib/components/FormComponents/ItemParts/FadingCheckIcon.js +0 -26
- package/lib/components/FormComponents/ItemParts/FadingCheckIcon.js.map +0 -1
- package/lib/components/FormComponents/ItemParts/ItemLabelText.d.ts +0 -8
- package/lib/components/FormComponents/ItemParts/ItemLabelText.js +0 -63
- package/lib/components/FormComponents/ItemParts/ItemLabelText.js.map +0 -1
- package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.d.ts +0 -8
- package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js +0 -53
- package/lib/components/FormComponents/ItemParts/ItemLabelWrapper.js.map +0 -1
- package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.d.ts +0 -10
- package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js +0 -30
- package/lib/components/FormComponents/RepeatGroup/DeleteItemButton.js.map +0 -1
- package/lib/components/Iconify/Iconify.d.ts +0 -10
- package/lib/components/Iconify/Iconify.js +0 -26
- package/lib/components/Iconify/Iconify.js.map +0 -1
- package/lib/components/Renderer/FormBodyPage.d.ts +0 -9
- package/lib/components/Renderer/FormBodyPage.js +0 -43
- package/lib/components/Renderer/FormBodyPage.js.map +0 -1
- package/lib/components/Renderer/FormTitle.d.ts +0 -7
- package/lib/components/Renderer/FormTitle.js +0 -30
- package/lib/components/Renderer/FormTitle.js.map +0 -1
- package/lib/components/Renderer/FormTopLevelPage.d.ts +0 -9
- package/lib/components/Renderer/FormTopLevelPage.js +0 -29
- package/lib/components/Renderer/FormTopLevelPage.js.map +0 -1
- package/lib/hooks/useBooleanCalculatedExpression.d.ts +0 -12
- package/lib/hooks/useBooleanCalculatedExpression.js +0 -53
- package/lib/hooks/useBooleanCalculatedExpression.js.map +0 -1
- package/lib/hooks/useDecimalCalculatedExpression.d.ts +0 -13
- package/lib/hooks/useDecimalCalculatedExpression.js +0 -59
- package/lib/hooks/useDecimalCalculatedExpression.js.map +0 -1
- package/lib/hooks/useIntegerCalculatedExpression.d.ts +0 -12
- package/lib/hooks/useIntegerCalculatedExpression.js +0 -56
- package/lib/hooks/useIntegerCalculatedExpression.js.map +0 -1
- package/lib/hooks/useQuantityCalculatedExpression.d.ts +0 -14
- package/lib/hooks/useQuantityCalculatedExpression.js +0 -107
- package/lib/hooks/useQuantityCalculatedExpression.js.map +0 -1
- package/lib/hooks/useStringCalculatedExpression.d.ts +0 -12
- package/lib/hooks/useStringCalculatedExpression.js +0 -58
- package/lib/hooks/useStringCalculatedExpression.js.map +0 -1
- package/lib/stories/storybookWrappers/InitialiseFormWrapperForStorybook.d.ts +0 -31
- package/lib/stories/storybookWrappers/InitialiseFormWrapperForStorybook.js +0 -67
- package/lib/stories/storybookWrappers/InitialiseFormWrapperForStorybook.js.map +0 -1
- package/lib/stories/storybookWrappers/index.d.ts +0 -2
- package/lib/stories/storybookWrappers/index.js +0 -18
- package/lib/stories/storybookWrappers/index.js.map +0 -1
- package/lib/theme/Theme.d.ts +0 -44
- package/lib/theme/Theme.js +0 -43
- package/lib/theme/Theme.js.map +0 -1
- package/lib/theme/customGlobalStyles.d.ts +0 -2
- package/lib/theme/customGlobalStyles.js +0 -61
- package/lib/theme/customGlobalStyles.js.map +0 -1
- package/lib/theme/overrides/Accordion.d.ts +0 -14
- package/lib/theme/overrides/Accordion.js +0 -32
- package/lib/theme/overrides/Accordion.js.map +0 -1
- package/lib/theme/overrides/Autocomplete.d.ts +0 -10
- package/lib/theme/overrides/Autocomplete.js +0 -28
- package/lib/theme/overrides/Autocomplete.js.map +0 -1
- package/lib/theme/overrides/Button.d.ts +0 -33
- package/lib/theme/overrides/Button.js +0 -52
- package/lib/theme/overrides/Button.js.map +0 -1
- package/lib/theme/overrides/Card.d.ts +0 -35
- package/lib/theme/overrides/Card.js +0 -49
- package/lib/theme/overrides/Card.js.map +0 -1
- package/lib/theme/overrides/Input.d.ts +0 -64
- package/lib/theme/overrides/Input.js +0 -81
- package/lib/theme/overrides/Input.js.map +0 -1
- package/lib/theme/overrides/Overrides.d.ts +0 -3
- package/lib/theme/overrides/Overrides.js +0 -29
- package/lib/theme/overrides/Overrides.js.map +0 -1
- package/lib/theme/overrides/Paper.d.ts +0 -12
- package/lib/theme/overrides/Paper.js +0 -31
- package/lib/theme/overrides/Paper.js.map +0 -1
- package/lib/theme/overrides/SpeedDial.d.ts +0 -16
- package/lib/theme/overrides/SpeedDial.js +0 -34
- package/lib/theme/overrides/SpeedDial.js.map +0 -1
- package/lib/theme/overrides/Table.d.ts +0 -12
- package/lib/theme/overrides/Table.js +0 -30
- package/lib/theme/overrides/Table.js.map +0 -1
- package/lib/theme/palette.d.ts +0 -27
- package/lib/theme/palette.js +0 -63
- package/lib/theme/palette.js.map +0 -1
- package/lib/theme/shadows.d.ts +0 -2
- package/lib/theme/shadows.js +0 -52
- package/lib/theme/shadows.js.map +0 -1
- package/lib/utils/dayjsExtend.d.ts +0 -1
- package/lib/utils/dayjsExtend.js +0 -22
- package/lib/utils/dayjsExtend.js.map +0 -1
- package/lib/utils/itemControl.d.ts +0 -103
- package/lib/utils/itemControl.js +0 -350
- package/lib/utils/itemControl.js.map +0 -1
- package/lib/utils/questionnaireStoreUtils/addAdditionalVariables.d.ts +0 -2
- package/lib/utils/questionnaireStoreUtils/addAdditionalVariables.js +0 -43
- package/lib/utils/questionnaireStoreUtils/addAdditionalVariables.js.map +0 -1
- package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.d.ts +0 -3
- package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js +0 -101
- package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js.map +0 -1
- package/lib/utils/validateQuestionnaire.d.ts +0 -66
- package/lib/utils/validateQuestionnaire.js +0 -559
- package/lib/utils/validateQuestionnaire.js.map +0 -1
|
@@ -1,30 +0,0 @@
|
|
|
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
|
-
export default function Table(theme) {
|
|
18
|
-
return {
|
|
19
|
-
MuiTableCell: {
|
|
20
|
-
styleOverrides: {
|
|
21
|
-
head: {
|
|
22
|
-
color: theme.palette.text.secondary,
|
|
23
|
-
backgroundColor: theme.palette.customBackground.neutral,
|
|
24
|
-
borderBottom: '1px solid #e5e7eb'
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=Table.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","sourceRoot":"","sources":["../../../src/theme/overrides/Table.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,KAAY;IACxC,OAAO;QACL,YAAY,EAAE;YACZ,cAAc,EAAE;gBACd,IAAI,EAAE;oBACJ,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS;oBACnC,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO;oBACvD,YAAY,EAAE,mBAAmB;iBAClC;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
|
package/lib/theme/palette.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { PaletteColor, PaletteColorOptions, PaletteOptions } from '@mui/material/styles';
|
|
2
|
-
declare module '@mui/material/styles' {
|
|
3
|
-
interface Palette {
|
|
4
|
-
accent1: PaletteColor;
|
|
5
|
-
accent2: PaletteColor;
|
|
6
|
-
pale: {
|
|
7
|
-
primary: string;
|
|
8
|
-
secondary: string;
|
|
9
|
-
};
|
|
10
|
-
customBackground: {
|
|
11
|
-
neutral: string;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
interface PaletteOptions {
|
|
15
|
-
accent1?: PaletteColorOptions;
|
|
16
|
-
accent2?: PaletteColorOptions;
|
|
17
|
-
pale?: {
|
|
18
|
-
primary: string;
|
|
19
|
-
secondary: string;
|
|
20
|
-
};
|
|
21
|
-
customBackground?: {
|
|
22
|
-
neutral: string;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
declare const palette: PaletteOptions;
|
|
27
|
-
export default palette;
|
package/lib/theme/palette.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
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 { alpha } from '@mui/material/styles';
|
|
18
|
-
import { grey } from '@mui/material/colors';
|
|
19
|
-
const SECONDARY = {
|
|
20
|
-
light: '#7ac298',
|
|
21
|
-
main: '#229954',
|
|
22
|
-
dark: '#145c32',
|
|
23
|
-
contrastText: '#fff'
|
|
24
|
-
};
|
|
25
|
-
const palette = {
|
|
26
|
-
common: { black: '#000', white: '#fff' },
|
|
27
|
-
secondary: SECONDARY,
|
|
28
|
-
accent1: {
|
|
29
|
-
main: '#d2e0f6',
|
|
30
|
-
light: '#e9f0fa',
|
|
31
|
-
dark: '#bcd1f1'
|
|
32
|
-
},
|
|
33
|
-
accent2: {
|
|
34
|
-
main: '#d5f5e3',
|
|
35
|
-
light: '#eafaf1',
|
|
36
|
-
dark: '#abebc6'
|
|
37
|
-
},
|
|
38
|
-
pale: {
|
|
39
|
-
primary: '#D6EBFC',
|
|
40
|
-
secondary: '#D3EBDD'
|
|
41
|
-
},
|
|
42
|
-
divider: alpha(grey['500'], 0.24),
|
|
43
|
-
text: {
|
|
44
|
-
primary: grey['800'],
|
|
45
|
-
secondary: grey['600'],
|
|
46
|
-
disabled: grey['500']
|
|
47
|
-
},
|
|
48
|
-
customBackground: {
|
|
49
|
-
neutral: '#F4F6F8'
|
|
50
|
-
},
|
|
51
|
-
action: {
|
|
52
|
-
active: grey['600'],
|
|
53
|
-
hover: alpha(grey['500'], 0.08),
|
|
54
|
-
selected: alpha(grey['500'], 0.16),
|
|
55
|
-
disabled: alpha(grey['500'], 0.8),
|
|
56
|
-
disabledBackground: alpha(grey['500'], 0.24),
|
|
57
|
-
focus: alpha(grey['500'], 0.24),
|
|
58
|
-
hoverOpacity: 0.08,
|
|
59
|
-
disabledOpacity: 0.48
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
export default palette;
|
|
63
|
-
//# sourceMappingURL=palette.js.map
|
package/lib/theme/palette.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"palette.js","sourceRoot":"","sources":["../../src/theme/palette.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AA8B5C,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,SAAS;IACf,YAAY,EAAE,MAAM;CACrB,CAAC;AAEF,MAAM,OAAO,GAAmB;IAC9B,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;IACxC,SAAS,EAAE,SAAS;IACpB,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB;IACD,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,SAAS;QAClB,SAAS,EAAE,SAAS;KACrB;IACD,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC;IACjC,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC;QACpB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC;QACtB,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC;KACtB;IACD,gBAAgB,EAAE;QAChB,OAAO,EAAE,SAAS;KACnB;IACD,MAAM,EAAE;QACN,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC;QACnB,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC;QAC/B,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC;QAClC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC;QACjC,kBAAkB,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC;QAC5C,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC;QAC/B,YAAY,EAAE,IAAI;QAClB,eAAe,EAAE,IAAI;KACtB;CACF,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/lib/theme/shadows.d.ts
DELETED
package/lib/theme/shadows.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
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 { alpha } from '@mui/material/styles';
|
|
18
|
-
import { grey } from '@mui/material/colors';
|
|
19
|
-
function shadows() {
|
|
20
|
-
const transparent1 = alpha(grey['500'], 0.2);
|
|
21
|
-
const transparent2 = alpha(grey['500'], 0.14);
|
|
22
|
-
const transparent3 = alpha(grey['500'], 0.12);
|
|
23
|
-
return [
|
|
24
|
-
'none',
|
|
25
|
-
`0px 2px 1px -1px ${transparent1},0px 1px 1px 0px ${transparent2},0px 1px 3px 0px ${transparent3}`,
|
|
26
|
-
`0px 3px 1px -2px ${transparent1},0px 2px 2px 0px ${transparent2},0px 1px 5px 0px ${transparent3}`,
|
|
27
|
-
`0px 3px 3px -2px ${transparent1},0px 3px 4px 0px ${transparent2},0px 1px 8px 0px ${transparent3}`,
|
|
28
|
-
`0px 2px 4px -1px ${transparent1},0px 4px 5px 0px ${transparent2},0px 1px 10px 0px ${transparent3}`,
|
|
29
|
-
`0px 3px 5px -1px ${transparent1},0px 5px 8px 0px ${transparent2},0px 1px 14px 0px ${transparent3}`,
|
|
30
|
-
`0px 3px 5px -1px ${transparent1},0px 6px 10px 0px ${transparent2},0px 1px 18px 0px ${transparent3}`,
|
|
31
|
-
`0px 4px 5px -2px ${transparent1},0px 7px 10px 1px ${transparent2},0px 2px 16px 1px ${transparent3}`,
|
|
32
|
-
`0px 5px 5px -3px ${transparent1},0px 8px 10px 1px ${transparent2},0px 3px 14px 2px ${transparent3}`,
|
|
33
|
-
`0px 5px 6px -3px ${transparent1},0px 9px 12px 1px ${transparent2},0px 3px 16px 2px ${transparent3}`,
|
|
34
|
-
`0px 6px 6px -3px ${transparent1},0px 10px 14px 1px ${transparent2},0px 4px 18px 3px ${transparent3}`,
|
|
35
|
-
`0px 6px 7px -4px ${transparent1},0px 11px 15px 1px ${transparent2},0px 4px 20px 3px ${transparent3}`,
|
|
36
|
-
`0px 7px 8px -4px ${transparent1},0px 12px 17px 2px ${transparent2},0px 5px 22px 4px ${transparent3}`,
|
|
37
|
-
`0px 7px 8px -4px ${transparent1},0px 13px 19px 2px ${transparent2},0px 5px 24px 4px ${transparent3}`,
|
|
38
|
-
`0px 7px 9px -4px ${transparent1},0px 14px 21px 2px ${transparent2},0px 5px 26px 4px ${transparent3}`,
|
|
39
|
-
`0px 8px 9px -5px ${transparent1},0px 15px 22px 2px ${transparent2},0px 6px 28px 5px ${transparent3}`,
|
|
40
|
-
`0px 8px 10px -5px ${transparent1},0px 16px 24px 2px ${transparent2},0px 6px 30px 5px ${transparent3}`,
|
|
41
|
-
`0px 8px 11px -5px ${transparent1},0px 17px 26px 2px ${transparent2},0px 6px 32px 5px ${transparent3}`,
|
|
42
|
-
`0px 9px 11px -5px ${transparent1},0px 18px 28px 2px ${transparent2},0px 7px 34px 6px ${transparent3}`,
|
|
43
|
-
`0px 9px 12px -6px ${transparent1},0px 19px 29px 2px ${transparent2},0px 7px 36px 6px ${transparent3}`,
|
|
44
|
-
`0px 10px 13px -6px ${transparent1},0px 20px 31px 3px ${transparent2},0px 8px 38px 7px ${transparent3}`,
|
|
45
|
-
`0px 10px 13px -6px ${transparent1},0px 21px 33px 3px ${transparent2},0px 8px 40px 7px ${transparent3}`,
|
|
46
|
-
`0px 10px 14px -6px ${transparent1},0px 22px 35px 3px ${transparent2},0px 8px 42px 7px ${transparent3}`,
|
|
47
|
-
`0px 11px 14px -7px ${transparent1},0px 23px 36px 3px ${transparent2},0px 9px 44px 8px ${transparent3}`,
|
|
48
|
-
`0px 11px 15px -7px ${transparent1},0px 24px 38px 3px ${transparent2},0px 9px 46px 8px ${transparent3}`
|
|
49
|
-
];
|
|
50
|
-
}
|
|
51
|
-
export default shadows();
|
|
52
|
-
//# sourceMappingURL=shadows.js.map
|
package/lib/theme/shadows.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shadows.js","sourceRoot":"","sources":["../../src/theme/shadows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,SAAS,OAAO;IACd,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;IAC7C,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;IAC9C,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;IAC9C,OAAO;QACL,MAAM;QACN,oBAAoB,YAAY,oBAAoB,YAAY,oBAAoB,YAAY,EAAE;QAClG,oBAAoB,YAAY,oBAAoB,YAAY,oBAAoB,YAAY,EAAE;QAClG,oBAAoB,YAAY,oBAAoB,YAAY,oBAAoB,YAAY,EAAE;QAClG,oBAAoB,YAAY,oBAAoB,YAAY,qBAAqB,YAAY,EAAE;QACnG,oBAAoB,YAAY,oBAAoB,YAAY,qBAAqB,YAAY,EAAE;QACnG,oBAAoB,YAAY,qBAAqB,YAAY,qBAAqB,YAAY,EAAE;QACpG,oBAAoB,YAAY,qBAAqB,YAAY,qBAAqB,YAAY,EAAE;QACpG,oBAAoB,YAAY,qBAAqB,YAAY,qBAAqB,YAAY,EAAE;QACpG,oBAAoB,YAAY,qBAAqB,YAAY,qBAAqB,YAAY,EAAE;QACpG,oBAAoB,YAAY,sBAAsB,YAAY,qBAAqB,YAAY,EAAE;QACrG,oBAAoB,YAAY,sBAAsB,YAAY,qBAAqB,YAAY,EAAE;QACrG,oBAAoB,YAAY,sBAAsB,YAAY,qBAAqB,YAAY,EAAE;QACrG,oBAAoB,YAAY,sBAAsB,YAAY,qBAAqB,YAAY,EAAE;QACrG,oBAAoB,YAAY,sBAAsB,YAAY,qBAAqB,YAAY,EAAE;QACrG,oBAAoB,YAAY,sBAAsB,YAAY,qBAAqB,YAAY,EAAE;QACrG,qBAAqB,YAAY,sBAAsB,YAAY,qBAAqB,YAAY,EAAE;QACtG,qBAAqB,YAAY,sBAAsB,YAAY,qBAAqB,YAAY,EAAE;QACtG,qBAAqB,YAAY,sBAAsB,YAAY,qBAAqB,YAAY,EAAE;QACtG,qBAAqB,YAAY,sBAAsB,YAAY,qBAAqB,YAAY,EAAE;QACtG,sBAAsB,YAAY,sBAAsB,YAAY,qBAAqB,YAAY,EAAE;QACvG,sBAAsB,YAAY,sBAAsB,YAAY,qBAAqB,YAAY,EAAE;QACvG,sBAAsB,YAAY,sBAAsB,YAAY,qBAAqB,YAAY,EAAE;QACvG,sBAAsB,YAAY,sBAAsB,YAAY,qBAAqB,YAAY,EAAE;QACvG,sBAAsB,YAAY,sBAAsB,YAAY,qBAAqB,YAAY,EAAE;KACxG,CAAC;AACJ,CAAC;AAED,eAAe,OAAO,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/utils/dayjsExtend.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
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 dayjs from 'dayjs';
|
|
18
|
-
import localizedFormat from 'dayjs/plugin/localizedFormat';
|
|
19
|
-
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
20
|
-
dayjs.extend(localizedFormat);
|
|
21
|
-
dayjs.extend(customParseFormat);
|
|
22
|
-
//# sourceMappingURL=dayjsExtend.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dayjsExtend.js","sourceRoot":"","sources":["../../src/utils/dayjsExtend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,iBAAiB,MAAM,gCAAgC,CAAC;AAE/D,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;AAC9B,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import type { Extension, QuestionnaireItem, QuestionnaireItemAnswerOption } from 'fhir/r4';
|
|
2
|
-
import type { RegexValidation } from '../interfaces/regex.interface';
|
|
3
|
-
export declare function shouldRenderNestedItems(qItem: QuestionnaireItem): boolean;
|
|
4
|
-
/**
|
|
5
|
-
* Check if the extension has an itemControl code equal to the given itemControlCode
|
|
6
|
-
*
|
|
7
|
-
* @author Sean Fong
|
|
8
|
-
*/
|
|
9
|
-
export declare function isSpecificItemControl(qItem: QuestionnaireItem, itemControlCode: string): boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Check if the extension has an displayCategory code equal to the given displayCategory
|
|
12
|
-
*
|
|
13
|
-
* @author Sean Fong
|
|
14
|
-
*/
|
|
15
|
-
export declare function isSpecificDisplayCategory(qItem: QuestionnaireItem, itemControlCode: string): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Check if the extension has url for items that use shortText
|
|
18
|
-
*
|
|
19
|
-
* @author Sean Fong
|
|
20
|
-
*/
|
|
21
|
-
export declare function getShortText(qItem: QuestionnaireItem): string | null;
|
|
22
|
-
/**
|
|
23
|
-
* Check if the extension has url for hidden questions
|
|
24
|
-
*
|
|
25
|
-
* @author Sean Fong
|
|
26
|
-
*/
|
|
27
|
-
export declare function hasHiddenExtension(qItem: QuestionnaireItem): boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Check if the extension has url for items that use open label
|
|
30
|
-
*
|
|
31
|
-
* @author Sean Fong
|
|
32
|
-
*/
|
|
33
|
-
export declare function getOpenLabelText(qItem: QuestionnaireItem): string | null;
|
|
34
|
-
/**
|
|
35
|
-
* Check if the decimal value has a quantity precision for the decimal value
|
|
36
|
-
*
|
|
37
|
-
* @author Sean Fong
|
|
38
|
-
*/
|
|
39
|
-
export declare function getDecimalPrecision(qItem: QuestionnaireItem): number | null;
|
|
40
|
-
/**
|
|
41
|
-
* Check if the extension has a url for xhtml rendering
|
|
42
|
-
*
|
|
43
|
-
* @author Sean Fong
|
|
44
|
-
*/
|
|
45
|
-
export declare function getXHtmlString(qItem: QuestionnaireItem): string | null;
|
|
46
|
-
export declare function getXHtmlStringFromExtension(extensions: Extension[]): string | null;
|
|
47
|
-
/**
|
|
48
|
-
* Check if the item label (text) has a valueMarkdown extension
|
|
49
|
-
*
|
|
50
|
-
* @author Sean Fong
|
|
51
|
-
*/
|
|
52
|
-
export declare function getMarkdownString(qItem: QuestionnaireItem): string | null;
|
|
53
|
-
/**
|
|
54
|
-
* Get text display prompt for items with itemControlCode prompt and has a prompt childItem
|
|
55
|
-
*
|
|
56
|
-
* @author Sean Fong
|
|
57
|
-
*/
|
|
58
|
-
export declare function getTextDisplayPrompt(qItem: QuestionnaireItem): string;
|
|
59
|
-
/**
|
|
60
|
-
* Get Quantity unit for items with itemControlCode unit and has a unit childItem
|
|
61
|
-
*
|
|
62
|
-
* @author Sean Fong
|
|
63
|
-
*/
|
|
64
|
-
export declare function getQuantityUnit(qItem: QuestionnaireItem): QuestionnaireItemAnswerOption | null;
|
|
65
|
-
/**
|
|
66
|
-
* Get decimal text display unit for items with itemControlCode unit and has a unit childItem
|
|
67
|
-
*
|
|
68
|
-
* @author Sean Fong
|
|
69
|
-
*/
|
|
70
|
-
export declare function getTextDisplayUnit(qItem: QuestionnaireItem): string;
|
|
71
|
-
/**
|
|
72
|
-
* Get text display lower bound for items with itemControlCode "lower" and has a "lower" childItem
|
|
73
|
-
*
|
|
74
|
-
* @author Sean Fong
|
|
75
|
-
*/
|
|
76
|
-
export declare function getTextDisplayLower(qItem: QuestionnaireItem): string;
|
|
77
|
-
/**
|
|
78
|
-
* Get text display upper bound for items with itemControlCode "upper" and has a "upper" childItem
|
|
79
|
-
*
|
|
80
|
-
* @author Sean Fong
|
|
81
|
-
*/
|
|
82
|
-
export declare function getTextDisplayUpper(qItem: QuestionnaireItem): string;
|
|
83
|
-
/**
|
|
84
|
-
* Get text display instructions for items with itemControlCode instructions and has an instructions childItem
|
|
85
|
-
*
|
|
86
|
-
* @author Sean Fong
|
|
87
|
-
*/
|
|
88
|
-
export declare function getTextDisplayInstructions(qItem: QuestionnaireItem): string;
|
|
89
|
-
/**
|
|
90
|
-
* Get text display flyover for items with itemControlCode flyover and has an flyover childItem
|
|
91
|
-
*
|
|
92
|
-
* @author Sean Fong
|
|
93
|
-
*/
|
|
94
|
-
export declare function getTextDisplayFlyover(qItem: QuestionnaireItem): string;
|
|
95
|
-
/**
|
|
96
|
-
* Get regex validation for items with regex extensions
|
|
97
|
-
*
|
|
98
|
-
* @author Sean Fong
|
|
99
|
-
*/
|
|
100
|
-
export declare function getRegexValidation(qItem: QuestionnaireItem): RegexValidation | undefined;
|
|
101
|
-
export declare function getRegexString(qItem: QuestionnaireItem): string | null;
|
|
102
|
-
export declare function getMinValue(qItem: QuestionnaireItem): string | number | undefined;
|
|
103
|
-
export declare function getMaxValue(qItem: QuestionnaireItem): string | number | undefined;
|
package/lib/utils/itemControl.js
DELETED
|
@@ -1,350 +0,0 @@
|
|
|
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 { structuredDataCapture } from 'fhir-sdc-helpers';
|
|
18
|
-
function hasDisplayCategory(qItem) {
|
|
19
|
-
var _a;
|
|
20
|
-
return !!((_a = qItem.extension) === null || _a === void 0 ? void 0 : _a.some((extension) => extension.url === 'http://hl7.org/fhir/StructureDefinition/questionnaire-displayCategory'));
|
|
21
|
-
}
|
|
22
|
-
function hasItemControl(qItem) {
|
|
23
|
-
var _a;
|
|
24
|
-
return !!((_a = qItem.extension) === null || _a === void 0 ? void 0 : _a.some((extension) => extension.url === 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl'));
|
|
25
|
-
}
|
|
26
|
-
// If all nested items are of type display and have itemControl, then they should not be rendered
|
|
27
|
-
export function shouldRenderNestedItems(qItem) {
|
|
28
|
-
var _a;
|
|
29
|
-
return !((_a = qItem.item) === null || _a === void 0 ? void 0 : _a.every((childItem) => childItem.type === 'display' && (hasDisplayCategory(childItem) || hasItemControl(childItem))));
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Check if the extension has an itemControl code equal to the given itemControlCode
|
|
33
|
-
*
|
|
34
|
-
* @author Sean Fong
|
|
35
|
-
*/
|
|
36
|
-
export function isSpecificItemControl(qItem, itemControlCode) {
|
|
37
|
-
var _a, _b, _c;
|
|
38
|
-
const itemControl = (_a = qItem === null || qItem === void 0 ? void 0 : qItem.extension) === null || _a === void 0 ? void 0 : _a.find((extension) => extension.url === 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl');
|
|
39
|
-
if (itemControl) {
|
|
40
|
-
const code = (_c = (_b = itemControl.valueCodeableConcept) === null || _b === void 0 ? void 0 : _b.coding) === null || _c === void 0 ? void 0 : _c.find((coding) => coding.code === itemControlCode);
|
|
41
|
-
if (code) {
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Check if the extension has an displayCategory code equal to the given displayCategory
|
|
49
|
-
*
|
|
50
|
-
* @author Sean Fong
|
|
51
|
-
*/
|
|
52
|
-
export function isSpecificDisplayCategory(qItem, itemControlCode) {
|
|
53
|
-
var _a, _b, _c;
|
|
54
|
-
const displayCategory = (_a = qItem.extension) === null || _a === void 0 ? void 0 : _a.find((extension) => extension.url === 'http://hl7.org/fhir/StructureDefinition/questionnaire-displayCategory');
|
|
55
|
-
if (displayCategory) {
|
|
56
|
-
const code = (_c = (_b = displayCategory.valueCodeableConcept) === null || _b === void 0 ? void 0 : _b.coding) === null || _c === void 0 ? void 0 : _c.find((coding) => coding.code === itemControlCode);
|
|
57
|
-
if (code) {
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Check if the extension has url for items that use shortText
|
|
65
|
-
*
|
|
66
|
-
* @author Sean Fong
|
|
67
|
-
*/
|
|
68
|
-
export function getShortText(qItem) {
|
|
69
|
-
var _a;
|
|
70
|
-
const itemControl = (_a = qItem.extension) === null || _a === void 0 ? void 0 : _a.find((extension) => extension.url === 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-shortText');
|
|
71
|
-
if (itemControl) {
|
|
72
|
-
if (itemControl.valueString) {
|
|
73
|
-
return itemControl.valueString;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return null;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Check if the extension has url for hidden questions
|
|
80
|
-
*
|
|
81
|
-
* @author Sean Fong
|
|
82
|
-
*/
|
|
83
|
-
export function hasHiddenExtension(qItem) {
|
|
84
|
-
var _a;
|
|
85
|
-
const itemControl = (_a = qItem.extension) === null || _a === void 0 ? void 0 : _a.find((extension) => extension.url === 'http://hl7.org/fhir/StructureDefinition/questionnaire-hidden');
|
|
86
|
-
if (itemControl) {
|
|
87
|
-
if (itemControl.valueBoolean) {
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Check if the extension has url for items that use open label
|
|
95
|
-
*
|
|
96
|
-
* @author Sean Fong
|
|
97
|
-
*/
|
|
98
|
-
export function getOpenLabelText(qItem) {
|
|
99
|
-
var _a;
|
|
100
|
-
const itemControl = (_a = qItem.extension) === null || _a === void 0 ? void 0 : _a.find((extension) => extension.url === 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-openLabel');
|
|
101
|
-
if (itemControl) {
|
|
102
|
-
if (itemControl.valueString) {
|
|
103
|
-
return itemControl.valueString;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Check if the decimal value has a quantity precision for the decimal value
|
|
110
|
-
*
|
|
111
|
-
* @author Sean Fong
|
|
112
|
-
*/
|
|
113
|
-
export function getDecimalPrecision(qItem) {
|
|
114
|
-
var _a;
|
|
115
|
-
const itemControl = (_a = qItem.extension) === null || _a === void 0 ? void 0 : _a.find((extension) => extension.url === 'http://hl7.org/fhir/StructureDefinition/quantity-precision');
|
|
116
|
-
if (itemControl) {
|
|
117
|
-
if (itemControl.valueInteger) {
|
|
118
|
-
return itemControl.valueInteger;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return null;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Check if the extension has a url for xhtml rendering
|
|
125
|
-
*
|
|
126
|
-
* @author Sean Fong
|
|
127
|
-
*/
|
|
128
|
-
export function getXHtmlString(qItem) {
|
|
129
|
-
var _a, _b;
|
|
130
|
-
let xHtmlString = null;
|
|
131
|
-
if (qItem.extension) {
|
|
132
|
-
xHtmlString = getXHtmlStringFromExtension(qItem.extension);
|
|
133
|
-
if (xHtmlString) {
|
|
134
|
-
return xHtmlString;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
if ((_a = qItem._text) === null || _a === void 0 ? void 0 : _a.extension) {
|
|
138
|
-
xHtmlString = getXHtmlStringFromExtension((_b = qItem._text) === null || _b === void 0 ? void 0 : _b.extension);
|
|
139
|
-
if (xHtmlString) {
|
|
140
|
-
return xHtmlString;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return null;
|
|
144
|
-
}
|
|
145
|
-
export function getXHtmlStringFromExtension(extensions) {
|
|
146
|
-
const itemControl = extensions === null || extensions === void 0 ? void 0 : extensions.find((extension) => extension.url === 'http://hl7.org/fhir/StructureDefinition/rendering-xhtml');
|
|
147
|
-
if (itemControl) {
|
|
148
|
-
if (itemControl.valueString) {
|
|
149
|
-
return itemControl.valueString;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
return null;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Check if the item label (text) has a valueMarkdown extension
|
|
156
|
-
*
|
|
157
|
-
* @author Sean Fong
|
|
158
|
-
*/
|
|
159
|
-
export function getMarkdownString(qItem) {
|
|
160
|
-
var _a, _b;
|
|
161
|
-
const itemControl = (_b = (_a = qItem._text) === null || _a === void 0 ? void 0 : _a.extension) === null || _b === void 0 ? void 0 : _b.find((extension) => extension.url === 'http://hl7.org/fhir/StructureDefinition/rendering-markdown');
|
|
162
|
-
if (itemControl) {
|
|
163
|
-
if (itemControl.valueMarkdown) {
|
|
164
|
-
return itemControl.valueMarkdown;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
return null;
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Get text display prompt for items with itemControlCode prompt and has a prompt childItem
|
|
171
|
-
*
|
|
172
|
-
* @author Sean Fong
|
|
173
|
-
*/
|
|
174
|
-
export function getTextDisplayPrompt(qItem) {
|
|
175
|
-
if (qItem.item) {
|
|
176
|
-
for (const childItem of qItem.item) {
|
|
177
|
-
if (childItem.type === 'display' && isSpecificItemControl(childItem, 'prompt')) {
|
|
178
|
-
const promptText = `${childItem.text}`;
|
|
179
|
-
return promptText[0].toUpperCase() + promptText.substring(1);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
return '';
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Get Quantity unit for items with itemControlCode unit and has a unit childItem
|
|
187
|
-
*
|
|
188
|
-
* @author Sean Fong
|
|
189
|
-
*/
|
|
190
|
-
export function getQuantityUnit(qItem) {
|
|
191
|
-
var _a;
|
|
192
|
-
// Otherwise, check if the item has a unit extension
|
|
193
|
-
const itemControl = (_a = qItem.extension) === null || _a === void 0 ? void 0 : _a.find((extension) => extension.url === 'http://hl7.org/fhir/StructureDefinition/questionnaire-unit');
|
|
194
|
-
if (itemControl && itemControl.valueCoding) {
|
|
195
|
-
return itemControl;
|
|
196
|
-
}
|
|
197
|
-
return null;
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Get decimal text display unit for items with itemControlCode unit and has a unit childItem
|
|
201
|
-
*
|
|
202
|
-
* @author Sean Fong
|
|
203
|
-
*/
|
|
204
|
-
export function getTextDisplayUnit(qItem) {
|
|
205
|
-
var _a, _b;
|
|
206
|
-
// Check if the item has a display unit childItem
|
|
207
|
-
if (qItem.item) {
|
|
208
|
-
for (const childItem of qItem.item) {
|
|
209
|
-
if (childItem.type === 'display' && isSpecificItemControl(childItem, 'unit')) {
|
|
210
|
-
return `${childItem.text}`;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
// Otherwise, check if the item has a unit extension
|
|
215
|
-
const itemControl = (_a = qItem.extension) === null || _a === void 0 ? void 0 : _a.find((extension) => extension.url === 'http://hl7.org/fhir/StructureDefinition/questionnaire-unit');
|
|
216
|
-
if (itemControl && itemControl.valueCoding) {
|
|
217
|
-
return (_b = itemControl.valueCoding.display) !== null && _b !== void 0 ? _b : '';
|
|
218
|
-
}
|
|
219
|
-
return '';
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Get text display lower bound for items with itemControlCode "lower" and has a "lower" childItem
|
|
223
|
-
*
|
|
224
|
-
* @author Sean Fong
|
|
225
|
-
*/
|
|
226
|
-
export function getTextDisplayLower(qItem) {
|
|
227
|
-
if (qItem.item) {
|
|
228
|
-
for (const childItem of qItem.item) {
|
|
229
|
-
if (childItem.type === 'display' && isSpecificItemControl(childItem, 'lower')) {
|
|
230
|
-
return `${childItem.text}`;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
return '';
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Get text display upper bound for items with itemControlCode "upper" and has a "upper" childItem
|
|
238
|
-
*
|
|
239
|
-
* @author Sean Fong
|
|
240
|
-
*/
|
|
241
|
-
export function getTextDisplayUpper(qItem) {
|
|
242
|
-
if (qItem.item) {
|
|
243
|
-
for (const childItem of qItem.item) {
|
|
244
|
-
if (childItem.type === 'display' && isSpecificItemControl(childItem, 'upper')) {
|
|
245
|
-
return `${childItem.text}`;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
return '';
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Get text display instructions for items with itemControlCode instructions and has an instructions childItem
|
|
253
|
-
*
|
|
254
|
-
* @author Sean Fong
|
|
255
|
-
*/
|
|
256
|
-
export function getTextDisplayInstructions(qItem) {
|
|
257
|
-
if (qItem.item) {
|
|
258
|
-
for (const childItem of qItem.item) {
|
|
259
|
-
if (childItem.type === 'display' && isSpecificDisplayCategory(childItem, 'instructions')) {
|
|
260
|
-
return `${childItem.text}`;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
return '';
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Get text display flyover for items with itemControlCode flyover and has an flyover childItem
|
|
268
|
-
*
|
|
269
|
-
* @author Sean Fong
|
|
270
|
-
*/
|
|
271
|
-
export function getTextDisplayFlyover(qItem) {
|
|
272
|
-
if (qItem.item) {
|
|
273
|
-
for (const childItem of qItem.item) {
|
|
274
|
-
if (childItem.type === 'display' && isSpecificItemControl(childItem, 'flyover')) {
|
|
275
|
-
return `${childItem.text}`;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
return '';
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Get regex validation for items with regex extensions
|
|
283
|
-
*
|
|
284
|
-
* @author Sean Fong
|
|
285
|
-
*/
|
|
286
|
-
export function getRegexValidation(qItem) {
|
|
287
|
-
// Get regex expression from extension
|
|
288
|
-
const regexString = getRegexString(qItem);
|
|
289
|
-
if (regexString) {
|
|
290
|
-
return { expression: new RegExp(regexString), feedback: null };
|
|
291
|
-
}
|
|
292
|
-
// Get regex expression from item types if regex extensions not present
|
|
293
|
-
if (qItem.type === 'url') {
|
|
294
|
-
return { expression: new RegExp(/^\S*$/), feedback: 'URLs should not contain any whitespaces' };
|
|
295
|
-
}
|
|
296
|
-
return undefined;
|
|
297
|
-
}
|
|
298
|
-
export function getRegexString(qItem) {
|
|
299
|
-
var _a;
|
|
300
|
-
const itemControl = (_a = qItem.extension) === null || _a === void 0 ? void 0 : _a.find((extension) => extension.url === 'http://hl7.org/fhir/StructureDefinition/regex');
|
|
301
|
-
if (itemControl) {
|
|
302
|
-
const extensionString = itemControl.valueString;
|
|
303
|
-
if (extensionString) {
|
|
304
|
-
let regexString;
|
|
305
|
-
if (extensionString.includes('matches(')) {
|
|
306
|
-
regexString = extensionString.substring(extensionString.indexOf("matches('") + "matches('".length, extensionString.lastIndexOf("')"));
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
regexString = extensionString;
|
|
310
|
-
}
|
|
311
|
-
return regexString;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
return null;
|
|
315
|
-
}
|
|
316
|
-
export function getMinValue(qItem) {
|
|
317
|
-
var _a, _b;
|
|
318
|
-
switch (qItem.type) {
|
|
319
|
-
case 'integer':
|
|
320
|
-
return structuredDataCapture.getMinValueAsInteger(qItem);
|
|
321
|
-
case 'decimal':
|
|
322
|
-
// In the case for decimals, permit minValue to be a decimal or integer
|
|
323
|
-
return ((_a = structuredDataCapture.getMinValueAsDecimal(qItem)) !== null && _a !== void 0 ? _a : structuredDataCapture.getMinValueAsInteger(qItem));
|
|
324
|
-
case 'date':
|
|
325
|
-
return structuredDataCapture.getMinValueAsDate(qItem);
|
|
326
|
-
case 'dateTime':
|
|
327
|
-
// In the case for dateTime, permit minValue to be a dateTime or date
|
|
328
|
-
return ((_b = structuredDataCapture.getMinValueAsDateTime(qItem)) !== null && _b !== void 0 ? _b : structuredDataCapture.getMinValueAsDate(qItem));
|
|
329
|
-
default:
|
|
330
|
-
return undefined;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
export function getMaxValue(qItem) {
|
|
334
|
-
var _a, _b;
|
|
335
|
-
switch (qItem.type) {
|
|
336
|
-
case 'integer':
|
|
337
|
-
return structuredDataCapture.getMaxValueAsInteger(qItem);
|
|
338
|
-
case 'decimal':
|
|
339
|
-
// In the case for decimals, permit maxValue to be a decimal or integer
|
|
340
|
-
return ((_a = structuredDataCapture.getMaxValueAsDecimal(qItem)) !== null && _a !== void 0 ? _a : structuredDataCapture.getMaxValueAsInteger(qItem));
|
|
341
|
-
case 'date':
|
|
342
|
-
return structuredDataCapture.getMaxValueAsDate(qItem);
|
|
343
|
-
case 'dateTime':
|
|
344
|
-
// In the case for dateTime, permit maxValue to be a dateTime or date
|
|
345
|
-
return ((_b = structuredDataCapture.getMaxValueAsDateTime(qItem)) !== null && _b !== void 0 ? _b : structuredDataCapture.getMaxValueAsDate(qItem));
|
|
346
|
-
default:
|
|
347
|
-
return undefined;
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
//# sourceMappingURL=itemControl.js.map
|