@openmrs/esm-form-engine-lib 2.1.0-pre.1362
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/.editorconfig +12 -0
- package/.eslintignore +2 -0
- package/.eslintrc +58 -0
- package/.husky/pre-commit +6 -0
- package/.husky/pre-push +6 -0
- package/.prettierignore +4 -0
- package/LICENSE.txt +401 -0
- package/README.md +136 -0
- package/__mocks__/concepts.mock.json +140 -0
- package/__mocks__/forms/afe-forms/component_art.json +38 -0
- package/__mocks__/forms/afe-forms/component_preclinic-review.json +38 -0
- package/__mocks__/forms/afe-forms/demo_hts-form.json +62 -0
- package/__mocks__/forms/afe-forms/form-component.json +38 -0
- package/__mocks__/forms/afe-forms/mini-form.json +31 -0
- package/__mocks__/forms/afe-forms/nested-form1.json +38 -0
- package/__mocks__/forms/afe-forms/nested-form2.json +38 -0
- package/__mocks__/forms/afe-forms/test-orders.json +72 -0
- package/__mocks__/forms/afe-forms/test-schema-transformer-form.json +88 -0
- package/__mocks__/forms/rfe-forms/age-validation-form.json +58 -0
- package/__mocks__/forms/rfe-forms/bmi-test-form.json +69 -0
- package/__mocks__/forms/rfe-forms/bsa-test-form.json +69 -0
- package/__mocks__/forms/rfe-forms/component_art.json +1705 -0
- package/__mocks__/forms/rfe-forms/component_preclinic-review.json +480 -0
- package/__mocks__/forms/rfe-forms/conditional-answered-form.json +97 -0
- package/__mocks__/forms/rfe-forms/conditional-required-form.json +281 -0
- package/__mocks__/forms/rfe-forms/demo_hts-form.json +346 -0
- package/__mocks__/forms/rfe-forms/edd-test-form.json +88 -0
- package/__mocks__/forms/rfe-forms/external_data_source_form.json +43 -0
- package/__mocks__/forms/rfe-forms/filter-answer-options-test-form.json +87 -0
- package/__mocks__/forms/rfe-forms/form-component.json +43 -0
- package/__mocks__/forms/rfe-forms/forms-loader.test.schema.ts +209 -0
- package/__mocks__/forms/rfe-forms/historical-expressions-form.json +170 -0
- package/__mocks__/forms/rfe-forms/labour_and_delivery_test_form.json +374 -0
- package/__mocks__/forms/rfe-forms/mini-form.json +29 -0
- package/__mocks__/forms/rfe-forms/mockHistoricalvisitsEncounter.json +89 -0
- package/__mocks__/forms/rfe-forms/months-on-art-form.json +90 -0
- package/__mocks__/forms/rfe-forms/multi-select-form.json +86 -0
- package/__mocks__/forms/rfe-forms/nested-form1.json +43 -0
- package/__mocks__/forms/rfe-forms/nested-form2.json +43 -0
- package/__mocks__/forms/rfe-forms/next-visit-test-form.json +78 -0
- package/__mocks__/forms/rfe-forms/obs-group-test_form.json +137 -0
- package/__mocks__/forms/rfe-forms/obs-list-data.ts +37 -0
- package/__mocks__/forms/rfe-forms/post-submission-test-form.json +116 -0
- package/__mocks__/forms/rfe-forms/reference-by-mapping-form.json +54 -0
- package/__mocks__/forms/rfe-forms/required-form.json +50 -0
- package/__mocks__/forms/rfe-forms/sample_fields.json +36 -0
- package/__mocks__/forms/rfe-forms/test-enrolment-form.json +241 -0
- package/__mocks__/forms/rfe-forms/treatment-end-date-test-form.json +121 -0
- package/__mocks__/forms/rfe-forms/viral-load-status-form.json +75 -0
- package/__mocks__/forms/rfe-forms/zscore-bmi-for-age-form.json +79 -0
- package/__mocks__/forms/rfe-forms/zscore-height-for-age-form.json +79 -0
- package/__mocks__/forms/rfe-forms/zscore-weight-height-form.json +77 -0
- package/__mocks__/packages/hiv/forms/hts_poc/1.0.json +8 -0
- package/__mocks__/packages/hiv/forms/hts_poc/1.1.json +91 -0
- package/__mocks__/packages/test-forms-registry.ts +12 -0
- package/__mocks__/patient.mock.ts +173 -0
- package/__mocks__/react-i18next.js +49 -0
- package/__mocks__/react-markdown.tsx +5 -0
- package/__mocks__/session.mock.ts +117 -0
- package/__mocks__/single-spa-react.js +11 -0
- package/__mocks__/use-initial-values/encounter.mock.json +963 -0
- package/__mocks__/use-initial-values/patient.mock.json +73 -0
- package/__mocks__/visit.mock.ts +19 -0
- package/dist/openmrs-esm-form-engine-lib.js +1 -0
- package/jest.config.js +30 -0
- package/package.json +104 -0
- package/prettier.config.js +8 -0
- package/readme/form-engine.jpeg +0 -0
- package/src/adapters/control-adapter.ts +29 -0
- package/src/adapters/encounter-datetime-adapter.ts +38 -0
- package/src/adapters/encounter-location-adapter.ts +39 -0
- package/src/adapters/encounter-provider-adapter.ts +48 -0
- package/src/adapters/encounter-role-adapter.ts +54 -0
- package/src/adapters/inline-date-adapter.ts +58 -0
- package/src/adapters/obs-adapter.ts +280 -0
- package/src/adapters/obs-comment-adapter.ts +60 -0
- package/src/adapters/orders-adapter.ts +75 -0
- package/src/adapters/patient-identifier-adapter.ts +40 -0
- package/src/adapters/program-state-adapter.ts +52 -0
- package/src/api/index.ts +178 -0
- package/src/components/error/error-modal.component.tsx +37 -0
- package/src/components/error/error.scss +4 -0
- package/src/components/extension/extension-parcel.component.tsx +32 -0
- package/src/components/field-label/field-label.component.tsx +32 -0
- package/src/components/field-label/field-label.scss +11 -0
- package/src/components/group/obs-group.component.tsx +29 -0
- package/src/components/group/obs-group.scss +12 -0
- package/src/components/inputs/content-switcher/content-switcher.component.tsx +71 -0
- package/src/components/inputs/content-switcher/content-switcher.scss +55 -0
- package/src/components/inputs/date/date.component.tsx +149 -0
- package/src/components/inputs/date/date.scss +36 -0
- package/src/components/inputs/file/camera/camera.component.tsx +34 -0
- package/src/components/inputs/file/camera/camera.scss +3 -0
- package/src/components/inputs/file/file.component.tsx +159 -0
- package/src/components/inputs/file/file.scss +101 -0
- package/src/components/inputs/fixed-value/fixed-value.component.tsx +19 -0
- package/src/components/inputs/markdown/markdown-wrapper.component.tsx +14 -0
- package/src/components/inputs/markdown/markdown.component.tsx +8 -0
- package/src/components/inputs/multi-select/multi-select.component.tsx +151 -0
- package/src/components/inputs/multi-select/multi-select.scss +25 -0
- package/src/components/inputs/multi-select/multi-select.test.tsx +90 -0
- package/src/components/inputs/number/number.component.tsx +69 -0
- package/src/components/inputs/number/number.scss +15 -0
- package/src/components/inputs/radio/radio.component.tsx +79 -0
- package/src/components/inputs/radio/radio.scss +36 -0
- package/src/components/inputs/select/dropdown.component.tsx +73 -0
- package/src/components/inputs/select/dropdown.scss +11 -0
- package/src/components/inputs/select/dropdown.test.tsx +120 -0
- package/src/components/inputs/text/text.component.tsx +65 -0
- package/src/components/inputs/text/text.scss +15 -0
- package/src/components/inputs/text/text.test.tsx +104 -0
- package/src/components/inputs/text-area/text-area.component.tsx +63 -0
- package/src/components/inputs/text-area/text-area.scss +11 -0
- package/src/components/inputs/toggle/toggle.component.tsx +66 -0
- package/src/components/inputs/toggle/toggle.scss +12 -0
- package/src/components/inputs/tooltip/tooltip.component.tsx +23 -0
- package/src/components/inputs/tooltip/tooltip.scss +8 -0
- package/src/components/inputs/ui-select-extended/ui-select-extended.component.tsx +187 -0
- package/src/components/inputs/ui-select-extended/ui-select-extended.scss +15 -0
- package/src/components/inputs/ui-select-extended/ui-select-extended.test.tsx +211 -0
- package/src/components/inputs/unspecified/unspecified.component.tsx +74 -0
- package/src/components/inputs/unspecified/unspecified.scss +7 -0
- package/src/components/inputs/unspecified/unspecified.test.tsx +95 -0
- package/src/components/inputs/workspace-launcher/workspace-launcher.component.tsx +35 -0
- package/src/components/inputs/workspace-launcher/workspace-launcher.scss +15 -0
- package/src/components/label/label.component.tsx +20 -0
- package/src/components/label/label.scss +11 -0
- package/src/components/loaders/loader.component.tsx +16 -0
- package/src/components/loaders/loader.scss +20 -0
- package/src/components/patient-banner/patient-banner.component.tsx +20 -0
- package/src/components/patient-banner/patient-banner.scss +12 -0
- package/src/components/previous-value-review/previous-value-review.component.tsx +49 -0
- package/src/components/previous-value-review/previous-value-review.scss +36 -0
- package/src/components/processor-factory/form-processor-factory.component.tsx +127 -0
- package/src/components/renderer/custom-hooks-renderer.component.tsx +30 -0
- package/src/components/renderer/field/fieldLogic.ts +214 -0
- package/src/components/renderer/field/form-field-renderer.component.tsx +281 -0
- package/src/components/renderer/field/form-field-renderer.scss +5 -0
- package/src/components/renderer/form/form-renderer.component.tsx +89 -0
- package/src/components/renderer/form/state.ts +54 -0
- package/src/components/renderer/page/page.renderer.component.tsx +50 -0
- package/src/components/renderer/page/page.renderer.scss +36 -0
- package/src/components/renderer/section/section-renderer.component.tsx +21 -0
- package/src/components/renderer/section/section-renderer.scss +19 -0
- package/src/components/repeat/helpers.test.ts +29 -0
- package/src/components/repeat/helpers.ts +68 -0
- package/src/components/repeat/repeat-controls.component.tsx +38 -0
- package/src/components/repeat/repeat-controls.scss +7 -0
- package/src/components/repeat/repeat.component.tsx +201 -0
- package/src/components/repeat/repeat.scss +30 -0
- package/src/components/repeat/repeat.test.ts +29 -0
- package/src/components/sidebar/sidebar.component.tsx +134 -0
- package/src/components/sidebar/sidebar.scss +121 -0
- package/src/components/value/value.component.tsx +27 -0
- package/src/components/value/value.scss +17 -0
- package/src/components/value/view/field-value-view.component.tsx +33 -0
- package/src/components/value/view/field-value-view.scss +31 -0
- package/src/constants.ts +12 -0
- package/src/datasources/concept-data-source.ts +42 -0
- package/src/datasources/data-source.ts +23 -0
- package/src/datasources/encounter-role-datasource.ts +15 -0
- package/src/datasources/historical-data-source.ts +11 -0
- package/src/datasources/location-data-source.ts +27 -0
- package/src/datasources/provider-datasource.ts +15 -0
- package/src/datasources/select-concept-answers-datasource.ts +15 -0
- package/src/declarations.d.ts +4 -0
- package/src/external-function-context.tsx +8 -0
- package/src/form-context.tsx +42 -0
- package/src/form-engine.component.tsx +178 -0
- package/src/form-engine.scss +140 -0
- package/src/form-engine.test.tsx +817 -0
- package/src/globals.ts +1 -0
- package/src/hooks/useClobData.tsx +21 -0
- package/src/hooks/useConcepts.tsx +55 -0
- package/src/hooks/useDatasourceDependentValue.ts +16 -0
- package/src/hooks/useEncounter.tsx +32 -0
- package/src/hooks/useEncounterRole.tsx +15 -0
- package/src/hooks/useEvaluateFormFieldExpressions.ts +138 -0
- package/src/hooks/useFieldValidationResults.ts +18 -0
- package/src/hooks/useFormCollapse.tsx +36 -0
- package/src/hooks/useFormFieldValidators.ts +22 -0
- package/src/hooks/useFormFieldValueAdapters.ts +24 -0
- package/src/hooks/useFormFields.ts +37 -0
- package/src/hooks/useFormFieldsMeta.ts +48 -0
- package/src/hooks/useFormJson.test.tsx +173 -0
- package/src/hooks/useFormJson.tsx +237 -0
- package/src/hooks/useFormStateHelpers.ts +50 -0
- package/src/hooks/useFormsConfig.tsx +27 -0
- package/src/hooks/useInitialValues.ts +38 -0
- package/src/hooks/usePatientData.tsx +32 -0
- package/src/hooks/usePatientPrograms.ts +32 -0
- package/src/hooks/usePostSubmissionActions.test.tsx +42 -0
- package/src/hooks/usePostSubmissionActions.ts +31 -0
- package/src/hooks/useProcessorDependencies.ts +30 -0
- package/src/hooks/useRestMaxResultsCount.ts +5 -0
- package/src/hooks/useSystemSetting.ts +36 -0
- package/src/hooks/useWorkspaceLayout.ts +29 -0
- package/src/index.ts +12 -0
- package/src/lifecycle.ts +33 -0
- package/src/post-submission-actions/program-enrollment-action.ts +138 -0
- package/src/processors/encounter/encounter-form-processor.ts +337 -0
- package/src/processors/encounter/encounter-processor-helper.ts +320 -0
- package/src/processors/form-processor.ts +41 -0
- package/src/provider/form-factory-helper.ts +100 -0
- package/src/provider/form-factory-provider.tsx +169 -0
- package/src/provider/form-provider.tsx +37 -0
- package/src/registry/inbuilt-components/InbuiltPostSubmissionActions.ts +9 -0
- package/src/registry/inbuilt-components/control-templates.ts +57 -0
- package/src/registry/inbuilt-components/inbuiltControls.ts +99 -0
- package/src/registry/inbuilt-components/inbuiltDataSources.ts +41 -0
- package/src/registry/inbuilt-components/inbuiltFieldValueAdapters.ts +64 -0
- package/src/registry/inbuilt-components/inbuiltTransformers.ts +10 -0
- package/src/registry/inbuilt-components/inbuiltValidators.ts +33 -0
- package/src/registry/inbuilt-components/template-component-map.ts +28 -0
- package/src/registry/registry.test.ts +20 -0
- package/src/registry/registry.ts +261 -0
- package/src/routes.json +1 -0
- package/src/setupI18n.ts +16 -0
- package/src/setupTests.ts +5 -0
- package/src/transformers/default-schema-transformer.test.ts +155 -0
- package/src/transformers/default-schema-transformer.ts +239 -0
- package/src/types/domain.ts +129 -0
- package/src/types/index.ts +130 -0
- package/src/types/schema.ts +238 -0
- package/src/typings.d.ts +9 -0
- package/src/utils/boolean-utils.ts +25 -0
- package/src/utils/common-expression-helpers.ts +503 -0
- package/src/utils/common-utils.test.ts +136 -0
- package/src/utils/common-utils.ts +55 -0
- package/src/utils/error-utils.ts +37 -0
- package/src/utils/expression-parser.test.ts +308 -0
- package/src/utils/expression-parser.ts +158 -0
- package/src/utils/expression-runner.test.ts +387 -0
- package/src/utils/expression-runner.ts +219 -0
- package/src/utils/form-helper.test.ts +482 -0
- package/src/utils/form-helper.ts +210 -0
- package/src/utils/form-page-utils.ts +13 -0
- package/src/utils/forms-loader.test.ts +323 -0
- package/src/utils/forms-loader.ts +306 -0
- package/src/utils/post-submission-action-helper.ts +71 -0
- package/src/utils/test-utils.ts +54 -0
- package/src/utils/zscore-service.ts +59 -0
- package/src/validators/conditional-answered-validator.test.ts +61 -0
- package/src/validators/conditional-answered-validator.ts +17 -0
- package/src/validators/date-validator.test.ts +46 -0
- package/src/validators/date-validator.ts +19 -0
- package/src/validators/default-value-validator.test.ts +90 -0
- package/src/validators/default-value-validator.ts +36 -0
- package/src/validators/form-validator.test.ts +188 -0
- package/src/validators/form-validator.ts +95 -0
- package/src/validators/js-expression-validator.test.ts +118 -0
- package/src/validators/js-expression-validator.ts +44 -0
- package/src/validators/schema.ts +34 -0
- package/src/zscore/bfa_boys_5_above.json +2522 -0
- package/src/zscore/bfa_girls_5_above.json +2522 -0
- package/src/zscore/hfa_boys_5_above.json +2186 -0
- package/src/zscore/hfa_boys_below5.json +22286 -0
- package/src/zscore/hfa_girls_5_above.json +2186 -0
- package/src/zscore/hfa_girls_below5.json +22286 -0
- package/src/zscore/wfl_boys_below5.json +7814 -0
- package/src/zscore/wfl_girls_below5.json +7814 -0
- package/src/zscore-tests/bmi-age.test.tsx +88 -0
- package/src/zscore-tests/height-age.test.tsx +96 -0
- package/src/zscore-tests/weight-height.test.tsx +87 -0
- package/tools/i18next-parser.config.js +93 -0
- package/translations/en.json +47 -0
- package/translations/es.json +38 -0
- package/translations/fr.json +38 -0
- package/translations/km.json +38 -0
- package/tsconfig.json +19 -0
- package/turbo.json +15 -0
- package/webpack.config.js +1 -0
@@ -0,0 +1,88 @@
|
|
1
|
+
{
|
2
|
+
"name": "",
|
3
|
+
"pages": [
|
4
|
+
{
|
5
|
+
"label": "POC Test EDD",
|
6
|
+
"sections": [
|
7
|
+
{
|
8
|
+
"label": "Test EDD",
|
9
|
+
"isExpanded": "true",
|
10
|
+
"questions": [
|
11
|
+
{
|
12
|
+
"label": "LMP",
|
13
|
+
"type": "obs",
|
14
|
+
"questionOptions": {
|
15
|
+
"rendering": "date",
|
16
|
+
"concept": "166079AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
17
|
+
"weeksList": "",
|
18
|
+
"conceptMappings": [
|
19
|
+
{
|
20
|
+
"type": "CIEL",
|
21
|
+
"value": "166079"
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"type": "SNOMED-CT",
|
25
|
+
"value": "248993009"
|
26
|
+
}
|
27
|
+
]
|
28
|
+
},
|
29
|
+
"required": "true",
|
30
|
+
"unspecified": "true",
|
31
|
+
"hide": {
|
32
|
+
"hideWhenExpression": "false"
|
33
|
+
},
|
34
|
+
"validators": [],
|
35
|
+
"id": "LMP"
|
36
|
+
},
|
37
|
+
{
|
38
|
+
"label": "EDD",
|
39
|
+
"type": "obs",
|
40
|
+
"questionOptions": {
|
41
|
+
"rendering": "date",
|
42
|
+
"calculate": {
|
43
|
+
"calculateExpression": "calcEDD('LMP')"
|
44
|
+
},
|
45
|
+
"concept": "5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
46
|
+
"weeksList": "",
|
47
|
+
"conceptMappings": [
|
48
|
+
{
|
49
|
+
"type": "AMPATH",
|
50
|
+
"value": "1854"
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"type": "SNOMED-CT",
|
54
|
+
"value": "366322004"
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"type": "AMPATH",
|
58
|
+
"value": "5596"
|
59
|
+
},
|
60
|
+
{
|
61
|
+
"type": "CIEL",
|
62
|
+
"value": "5596"
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"type": "LOINC",
|
66
|
+
"value": "11779-6"
|
67
|
+
}
|
68
|
+
]
|
69
|
+
},
|
70
|
+
"required": "true",
|
71
|
+
"unspecified": "true",
|
72
|
+
"hide": {
|
73
|
+
"hideWhenExpression": "false"
|
74
|
+
},
|
75
|
+
"validators": [],
|
76
|
+
"id": "EDD"
|
77
|
+
}
|
78
|
+
]
|
79
|
+
}
|
80
|
+
]
|
81
|
+
}
|
82
|
+
],
|
83
|
+
"availableIntents": [],
|
84
|
+
"processor": "EncounterFormProcessor",
|
85
|
+
"uuid": "da24c540-cc83-43bc-978f-c1ef180a497f",
|
86
|
+
"referencedForms": [],
|
87
|
+
"encounterType": "79c1f50f-f77d-42e2-ad2a-d29304dde2fe"
|
88
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
{
|
2
|
+
"name": "",
|
3
|
+
"pages": [
|
4
|
+
{
|
5
|
+
"label": "Page 1",
|
6
|
+
"sections": [
|
7
|
+
{
|
8
|
+
"label": "Section 1",
|
9
|
+
"isExpanded": "true",
|
10
|
+
"questions": [
|
11
|
+
{
|
12
|
+
"label": "Body Weight",
|
13
|
+
"type": "obs",
|
14
|
+
"questionOptions": {
|
15
|
+
"rendering": "number",
|
16
|
+
"concept": "560555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
17
|
+
"calculate": {
|
18
|
+
"calculateExpression": "resolve(api.getLatestObs('50512033-e047-4855-b2d3-1a6d9e889ff4', '560555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA')).valueNumeric"
|
19
|
+
},
|
20
|
+
"conceptMappings": [
|
21
|
+
{
|
22
|
+
"type": "CIEL",
|
23
|
+
"value": "160555"
|
24
|
+
}
|
25
|
+
]
|
26
|
+
|
27
|
+
},
|
28
|
+
"id": "bodyWeight",
|
29
|
+
"validators": [],
|
30
|
+
"required": "true",
|
31
|
+
"unspecified": "true"
|
32
|
+
}
|
33
|
+
]
|
34
|
+
}
|
35
|
+
]
|
36
|
+
}
|
37
|
+
],
|
38
|
+
"availableIntents": [],
|
39
|
+
"processor": "EncounterFormProcessor",
|
40
|
+
"uuid": "na24c540-cc83-43bc-978f-c1ef180a597f",
|
41
|
+
"referencedForms": [],
|
42
|
+
"encounterType": "b9c1f50f-f77d-42e2-ad2a-d29304dde2fv"
|
43
|
+
}
|
@@ -0,0 +1,87 @@
|
|
1
|
+
{
|
2
|
+
"name": "Test Form",
|
3
|
+
"pages": [
|
4
|
+
{
|
5
|
+
"label": "Testing",
|
6
|
+
"sections": [
|
7
|
+
{
|
8
|
+
"label": "Testing history",
|
9
|
+
"isExpanded": "true",
|
10
|
+
"questions": [
|
11
|
+
{
|
12
|
+
"label": "How many times have you tested in the past?",
|
13
|
+
"type": "obs",
|
14
|
+
"id": "test_count",
|
15
|
+
"questionOptions": {
|
16
|
+
"concept": "5624AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
17
|
+
"rendering": "number"
|
18
|
+
},
|
19
|
+
"behaviours": [
|
20
|
+
{
|
21
|
+
"intent": "*",
|
22
|
+
"required": "true",
|
23
|
+
"unspecified": "true",
|
24
|
+
"hide": {
|
25
|
+
"hideWhenExpression": "false"
|
26
|
+
},
|
27
|
+
"validators": []
|
28
|
+
}
|
29
|
+
]
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"label": "Testing Recommendations",
|
33
|
+
"type": "obs",
|
34
|
+
"id": "recommendation",
|
35
|
+
"questionOptions": {
|
36
|
+
"concept": "efc87cd5-2fd8-411c-ba52-b0d858f541e7",
|
37
|
+
"rendering": "select",
|
38
|
+
"answers": [
|
39
|
+
{
|
40
|
+
"concept": "160036AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
41
|
+
"label": "Perfect testing",
|
42
|
+
"hide": {
|
43
|
+
"hideWhenExpression": "test_count > 5"
|
44
|
+
}
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"concept": "163266AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
48
|
+
"label": "Minimal testing",
|
49
|
+
"hide": {
|
50
|
+
"hideWhenExpression": "test_count > 5"
|
51
|
+
}
|
52
|
+
},
|
53
|
+
{
|
54
|
+
"concept": "52f7fc03-611b-4b62-8498-37beb2fa99ed",
|
55
|
+
"label": "Not ideal",
|
56
|
+
"hide": {
|
57
|
+
"hideWhenExpression": "false"
|
58
|
+
}
|
59
|
+
},
|
60
|
+
{
|
61
|
+
"concept": "54b96458-6585-4c4c-a5b1-b3ca7f1be351",
|
62
|
+
"label": "Un-decisive"
|
63
|
+
}
|
64
|
+
]
|
65
|
+
},
|
66
|
+
"behaviours": [
|
67
|
+
{
|
68
|
+
"intent": "*",
|
69
|
+
"required": "true",
|
70
|
+
"hide": {
|
71
|
+
"hideWhenExpression": "false"
|
72
|
+
},
|
73
|
+
"validators": []
|
74
|
+
}
|
75
|
+
]
|
76
|
+
}
|
77
|
+
]
|
78
|
+
}
|
79
|
+
]
|
80
|
+
}
|
81
|
+
],
|
82
|
+
"availableIntents": [],
|
83
|
+
"processor": "EncounterFormProcessor",
|
84
|
+
"uuid": "da24c540-cc83-43bc-978f-c1ef180a497f",
|
85
|
+
"referencedForms": [],
|
86
|
+
"encounterType": "79c1f50f-f77d-42e2-ad2a-d29304dde2fe"
|
87
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
{
|
2
|
+
"name": "Form Component",
|
3
|
+
"referencedForms": [
|
4
|
+
{
|
5
|
+
"formName": "component_preclinic-review",
|
6
|
+
"alias": "pcr"
|
7
|
+
},
|
8
|
+
{
|
9
|
+
"formName": "component_art",
|
10
|
+
"alias": "art"
|
11
|
+
}
|
12
|
+
],
|
13
|
+
"pages": [
|
14
|
+
{
|
15
|
+
"label": "Pre-Clinic Review",
|
16
|
+
"sections": [
|
17
|
+
{
|
18
|
+
"reference": {
|
19
|
+
"form": "pcr",
|
20
|
+
"page": "Pre-clinic Review",
|
21
|
+
"section": "Pre-clinic Review"
|
22
|
+
}
|
23
|
+
}
|
24
|
+
]
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"label": "ART History",
|
28
|
+
"sections": [
|
29
|
+
{
|
30
|
+
"reference": {
|
31
|
+
"form": "art",
|
32
|
+
"page": "ART ",
|
33
|
+
"section": "ART History",
|
34
|
+
"excludeQuestions": ["current_art_regimen_ped"]
|
35
|
+
}
|
36
|
+
}
|
37
|
+
]
|
38
|
+
}
|
39
|
+
],
|
40
|
+
"processor": "EncounterFormProcessor",
|
41
|
+
"uuid": "af7c1fe6-d669-414e-b066-e9733f0de7b8",
|
42
|
+
"encounterType": "79c1f50f-f77d-42e2-ad2a-d29304dde2fe"
|
43
|
+
}
|
@@ -0,0 +1,209 @@
|
|
1
|
+
export const testSchemaV2 = {
|
2
|
+
name: 'Test HTS POC',
|
3
|
+
pages: [
|
4
|
+
{
|
5
|
+
label: 'Screening',
|
6
|
+
sections: [
|
7
|
+
{
|
8
|
+
label: 'Testing history',
|
9
|
+
isExpanded: 'true',
|
10
|
+
questions: [
|
11
|
+
{
|
12
|
+
label: 'When was the HIV test conducted?',
|
13
|
+
type: 'obs',
|
14
|
+
questionOptions: {
|
15
|
+
rendering: 'date',
|
16
|
+
concept: '164400AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
17
|
+
weeksList: '',
|
18
|
+
},
|
19
|
+
required: 'true',
|
20
|
+
unspecified: 'true',
|
21
|
+
hide: {
|
22
|
+
hideWhenExpression: 'false',
|
23
|
+
},
|
24
|
+
validators: [
|
25
|
+
{
|
26
|
+
type: 'date',
|
27
|
+
allowFutureDates: 'false',
|
28
|
+
},
|
29
|
+
{
|
30
|
+
type: 'js_expression',
|
31
|
+
failsWhenExpression: "myValue < '1/1/1980' || myValue > today()",
|
32
|
+
},
|
33
|
+
],
|
34
|
+
behaviours: [
|
35
|
+
{
|
36
|
+
intent: 'HTS_RETROSPECTIVE',
|
37
|
+
required: 'true',
|
38
|
+
unspecified: 'true',
|
39
|
+
hide: {
|
40
|
+
hideWhenExpression: 'false',
|
41
|
+
},
|
42
|
+
validators: [
|
43
|
+
{
|
44
|
+
type: 'date',
|
45
|
+
allowFutureDates: 'false',
|
46
|
+
},
|
47
|
+
{
|
48
|
+
type: 'js_expression',
|
49
|
+
failsWhenExpression: "myValue < '1/1/1980' || myValue > today()",
|
50
|
+
},
|
51
|
+
],
|
52
|
+
},
|
53
|
+
{
|
54
|
+
intent: 'HTS_HIVTEST',
|
55
|
+
required: 'true',
|
56
|
+
},
|
57
|
+
{
|
58
|
+
intent: '*',
|
59
|
+
required: 'false',
|
60
|
+
hide: {
|
61
|
+
hideWhenExpression: "hivTestConducted !== 'cf82933b-3f3f-45e7-a5ab-5d31aaee3da3'",
|
62
|
+
},
|
63
|
+
validators: [
|
64
|
+
{
|
65
|
+
type: 'date',
|
66
|
+
allowFutureDates: 'false',
|
67
|
+
},
|
68
|
+
{
|
69
|
+
type: 'js_expression',
|
70
|
+
failsWhenExpression: "myValue < '1/1/1980' || myValue > today()",
|
71
|
+
},
|
72
|
+
],
|
73
|
+
},
|
74
|
+
],
|
75
|
+
id: 'dateTestPerformed',
|
76
|
+
},
|
77
|
+
],
|
78
|
+
},
|
79
|
+
],
|
80
|
+
},
|
81
|
+
],
|
82
|
+
processor: 'EncounterFormProcessor',
|
83
|
+
uuid: 'da24c540-cc83-43bc-978f-c1ef180a497f',
|
84
|
+
referencedForms: [],
|
85
|
+
encounterType: '79c1f50f-f77d-42e2-ad2a-d29304dde2fe',
|
86
|
+
};
|
87
|
+
|
88
|
+
export const htsRetrospectiveResultingSchemaV2 = {
|
89
|
+
name: 'Test HTS POC',
|
90
|
+
pages: [
|
91
|
+
{
|
92
|
+
label: 'Screening',
|
93
|
+
sections: [
|
94
|
+
{
|
95
|
+
label: 'Testing history',
|
96
|
+
isExpanded: 'true',
|
97
|
+
questions: [
|
98
|
+
{
|
99
|
+
label: 'When was the HIV test conducted?',
|
100
|
+
type: 'obs',
|
101
|
+
questionOptions: {
|
102
|
+
rendering: 'date',
|
103
|
+
concept: '164400AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
104
|
+
weeksList: '',
|
105
|
+
},
|
106
|
+
required: 'true',
|
107
|
+
unspecified: 'true',
|
108
|
+
hide: {
|
109
|
+
hideWhenExpression: 'false',
|
110
|
+
},
|
111
|
+
validators: [
|
112
|
+
{
|
113
|
+
type: 'date',
|
114
|
+
allowFutureDates: 'false',
|
115
|
+
},
|
116
|
+
{
|
117
|
+
type: 'js_expression',
|
118
|
+
failsWhenExpression: "myValue < '1/1/1980' || myValue > today()",
|
119
|
+
},
|
120
|
+
],
|
121
|
+
id: 'dateTestPerformed',
|
122
|
+
},
|
123
|
+
],
|
124
|
+
},
|
125
|
+
],
|
126
|
+
},
|
127
|
+
],
|
128
|
+
processor: 'EncounterFormProcessor',
|
129
|
+
uuid: 'da24c540-cc83-43bc-978f-c1ef180a497f',
|
130
|
+
referencedForms: [],
|
131
|
+
encounterType: '79c1f50f-f77d-42e2-ad2a-d29304dde2fe',
|
132
|
+
};
|
133
|
+
|
134
|
+
export const htsHivtestResultingSchemaV2 = {
|
135
|
+
name: 'Test HTS POC',
|
136
|
+
pages: [
|
137
|
+
{
|
138
|
+
label: 'Screening',
|
139
|
+
sections: [
|
140
|
+
{
|
141
|
+
label: 'Testing history',
|
142
|
+
isExpanded: 'true',
|
143
|
+
questions: [
|
144
|
+
{
|
145
|
+
label: 'When was the HIV test conducted?',
|
146
|
+
type: 'obs',
|
147
|
+
questionOptions: {
|
148
|
+
rendering: 'date',
|
149
|
+
concept: '164400AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
150
|
+
weeksList: '',
|
151
|
+
},
|
152
|
+
required: 'true',
|
153
|
+
id: 'dateTestPerformed',
|
154
|
+
},
|
155
|
+
],
|
156
|
+
},
|
157
|
+
],
|
158
|
+
},
|
159
|
+
],
|
160
|
+
processor: 'EncounterFormProcessor',
|
161
|
+
uuid: 'da24c540-cc83-43bc-978f-c1ef180a497f',
|
162
|
+
referencedForms: [],
|
163
|
+
encounterType: '79c1f50f-f77d-42e2-ad2a-d29304dde2fe',
|
164
|
+
};
|
165
|
+
|
166
|
+
export const htsWildcardResultingSchemaV2 = {
|
167
|
+
name: 'Test HTS POC',
|
168
|
+
pages: [
|
169
|
+
{
|
170
|
+
label: 'Screening',
|
171
|
+
sections: [
|
172
|
+
{
|
173
|
+
label: 'Testing history',
|
174
|
+
isExpanded: 'true',
|
175
|
+
questions: [
|
176
|
+
{
|
177
|
+
label: 'When was the HIV test conducted?',
|
178
|
+
type: 'obs',
|
179
|
+
questionOptions: {
|
180
|
+
rendering: 'date',
|
181
|
+
concept: '164400AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
182
|
+
weeksList: '',
|
183
|
+
},
|
184
|
+
required: 'false',
|
185
|
+
hide: {
|
186
|
+
hideWhenExpression: "hivTestConducted !== 'cf82933b-3f3f-45e7-a5ab-5d31aaee3da3'",
|
187
|
+
},
|
188
|
+
validators: [
|
189
|
+
{
|
190
|
+
type: 'date',
|
191
|
+
allowFutureDates: 'false',
|
192
|
+
},
|
193
|
+
{
|
194
|
+
type: 'js_expression',
|
195
|
+
failsWhenExpression: "myValue < '1/1/1980' || myValue > today()",
|
196
|
+
},
|
197
|
+
],
|
198
|
+
id: 'dateTestPerformed',
|
199
|
+
},
|
200
|
+
],
|
201
|
+
},
|
202
|
+
],
|
203
|
+
},
|
204
|
+
],
|
205
|
+
processor: 'EncounterFormProcessor',
|
206
|
+
uuid: 'da24c540-cc83-43bc-978f-c1ef180a497f',
|
207
|
+
referencedForms: [],
|
208
|
+
encounterType: '79c1f50f-f77d-42e2-ad2a-d29304dde2fe',
|
209
|
+
};
|
@@ -0,0 +1,170 @@
|
|
1
|
+
{
|
2
|
+
"name": "COVID Assessment Form",
|
3
|
+
"version": "1",
|
4
|
+
"published": true,
|
5
|
+
"retired": false,
|
6
|
+
"pages": [
|
7
|
+
{
|
8
|
+
"label": "COVID Assessment",
|
9
|
+
"sections": [
|
10
|
+
{
|
11
|
+
"label": "Assessment Details",
|
12
|
+
"isExpanded": "true",
|
13
|
+
"questions": [
|
14
|
+
{
|
15
|
+
"label": "Reasons for assessment",
|
16
|
+
"type": "obs",
|
17
|
+
"historicalExpression": "HD.getObject('prevEnc').getValue('ae46f4b1-c15d-4bba-ab41-b9157b82b0ce')",
|
18
|
+
"questionOptions": {
|
19
|
+
"rendering": "checkbox",
|
20
|
+
"concept": "ae46f4b1-c15d-4bba-ab41-b9157b82b0ce",
|
21
|
+
"answers": [
|
22
|
+
{
|
23
|
+
"concept": "1068AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
24
|
+
"label": "Symptomatic",
|
25
|
+
"conceptMappings": [
|
26
|
+
{
|
27
|
+
"type": "AMPATH",
|
28
|
+
"value": "1068"
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"type": "SNOMED-CT",
|
32
|
+
"value": "264931009"
|
33
|
+
}
|
34
|
+
]
|
35
|
+
},
|
36
|
+
{
|
37
|
+
"concept": "0ed2e3ca-b9a6-4ff6-ac74-4d4cd9520acc",
|
38
|
+
"label": "RDT confirmatory",
|
39
|
+
"conceptMappings": []
|
40
|
+
},
|
41
|
+
{
|
42
|
+
"concept": "f974e267-feeb-42be-9d37-61554dad16b1",
|
43
|
+
"label": "Voluntary",
|
44
|
+
"conceptMappings": []
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"concept": "1cee0ab3-bf06-49e9-a49c-baf261620c67",
|
48
|
+
"label": "Post-mortem",
|
49
|
+
"conceptMappings": []
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"concept": "e0f1584a-cc8b-48e9-980f-64d9f724caf8",
|
53
|
+
"label": "Quarantine",
|
54
|
+
"conceptMappings": []
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"concept": "ad8be6bf-ced7-4390-a6af-c5acebeac216",
|
58
|
+
"label": "Follow-up",
|
59
|
+
"conceptMappings": []
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"concept": "30320fb8-b29b-443f-98cf-f3ef491f8947",
|
63
|
+
"label": "Health worker",
|
64
|
+
"conceptMappings": []
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"concept": "38769c82-a3d3-4714-97b7-015726cdb209",
|
68
|
+
"label": "Other frontline worker",
|
69
|
+
"conceptMappings": []
|
70
|
+
},
|
71
|
+
{
|
72
|
+
"concept": "f8c9c2cc-3070-444e-8818-26fb8100bb78",
|
73
|
+
"label": "Travel out of country",
|
74
|
+
"conceptMappings": []
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"concept": "677f4d21-7293-4810-abe6-57a192acde57",
|
78
|
+
"label": "Entry into a country",
|
79
|
+
"conceptMappings": []
|
80
|
+
},
|
81
|
+
{
|
82
|
+
"concept": "8a6ab892-1b1d-4ad9-82da-c6c38ee8fcfb",
|
83
|
+
"label": "Surveillance",
|
84
|
+
"conceptMappings": []
|
85
|
+
},
|
86
|
+
{
|
87
|
+
"concept": "5340f478-ec5d-41e6-bc62-961c52014d4d",
|
88
|
+
"label": "Contact of a case",
|
89
|
+
"conceptMappings": []
|
90
|
+
},
|
91
|
+
{
|
92
|
+
"concept": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
93
|
+
"label": "Other",
|
94
|
+
"conceptMappings": [
|
95
|
+
{
|
96
|
+
"type": "PIH-Malawi",
|
97
|
+
"value": "6408"
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"type": "org.openmrs.module.mdrtb",
|
101
|
+
"value": "OTHER"
|
102
|
+
},
|
103
|
+
{
|
104
|
+
"type": "CIEL",
|
105
|
+
"value": "5622"
|
106
|
+
},
|
107
|
+
{
|
108
|
+
"type": "SNOMED-MVP",
|
109
|
+
"value": "56221000105001"
|
110
|
+
},
|
111
|
+
{
|
112
|
+
"type": "PIH",
|
113
|
+
"value": "5622"
|
114
|
+
},
|
115
|
+
{
|
116
|
+
"type": "AMPATH",
|
117
|
+
"value": "5622"
|
118
|
+
},
|
119
|
+
{
|
120
|
+
"type": "SNOMED-CT",
|
121
|
+
"value": "74964007"
|
122
|
+
}
|
123
|
+
]
|
124
|
+
}
|
125
|
+
]
|
126
|
+
},
|
127
|
+
"id": "reasonsForTesting",
|
128
|
+
"behaviours": [
|
129
|
+
{
|
130
|
+
"intent": "*",
|
131
|
+
"required": "true",
|
132
|
+
"unspecified": "true",
|
133
|
+
"hide": {
|
134
|
+
"hideWhenExpression": "false"
|
135
|
+
},
|
136
|
+
"validators": []
|
137
|
+
},
|
138
|
+
{
|
139
|
+
"intent": "COVID_LAB_ASSESSMENT_EMBED",
|
140
|
+
"required": "true",
|
141
|
+
"unspecified": "true",
|
142
|
+
"hide": {
|
143
|
+
"hideWhenExpression": "false"
|
144
|
+
},
|
145
|
+
"validators": []
|
146
|
+
}
|
147
|
+
]
|
148
|
+
}
|
149
|
+
]
|
150
|
+
}
|
151
|
+
]
|
152
|
+
}
|
153
|
+
],
|
154
|
+
"availableIntents": [
|
155
|
+
{
|
156
|
+
"intent": "*",
|
157
|
+
"display": "COVID Assessment"
|
158
|
+
},
|
159
|
+
{
|
160
|
+
"intent": "COVID_LAB_ASSESSMENT_EMBED",
|
161
|
+
"display": "Covid Case Form"
|
162
|
+
}
|
163
|
+
],
|
164
|
+
"processor": "EncounterFormProcessor",
|
165
|
+
"uuid": "f5fb6bc4-6fc3-3462-a191-2fff0896bab3",
|
166
|
+
"referencedForms": [],
|
167
|
+
"encounterType": "253a43d3-c99e-415c-8b78-ee7d4d3c1d54",
|
168
|
+
"encounter": "COVID Case Assessment",
|
169
|
+
"allowUnspecifiedAll": true
|
170
|
+
}
|