@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,480 @@
|
|
1
|
+
{
|
2
|
+
"name": "component_preclinic-review",
|
3
|
+
"uuid": "2f063f32-7f8a-11ee-b962-0242ac120004",
|
4
|
+
"processor": "EncounterFormProcessor",
|
5
|
+
"pages": [
|
6
|
+
{
|
7
|
+
"label": "Pre-clinic Review",
|
8
|
+
"sections": [
|
9
|
+
{
|
10
|
+
"label": "Pre-clinic Review",
|
11
|
+
"isExpanded": "true",
|
12
|
+
"questions": [
|
13
|
+
{
|
14
|
+
"type": "obsGroup",
|
15
|
+
"label": "Transfer in from other centre, detailed",
|
16
|
+
"questionOptions": {
|
17
|
+
"concept": "0f8b7f4e-1656-46b7-bc93-d1fe4f193f5d",
|
18
|
+
"rendering": "group"
|
19
|
+
},
|
20
|
+
"questions": [
|
21
|
+
{
|
22
|
+
"label": "Transfer in from other centre:",
|
23
|
+
"id": "transferIn",
|
24
|
+
"questionOptions": {
|
25
|
+
"rendering": "select",
|
26
|
+
"concept": "35ed8aad-d6fa-429e-961a-c877e1ad4953",
|
27
|
+
"answers": [
|
28
|
+
{
|
29
|
+
"concept": "a89c2f42-1350-11df-a1f1-0026b9348838",
|
30
|
+
"label": "Ampath"
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"concept": "a89c301e-1350-11df-a1f1-0026b9348838",
|
34
|
+
"label": "Non-Ampath"
|
35
|
+
}
|
36
|
+
]
|
37
|
+
},
|
38
|
+
"type": "obs",
|
39
|
+
"validators": []
|
40
|
+
},
|
41
|
+
{
|
42
|
+
"type": "personAttribute",
|
43
|
+
"label": "If transfer in from other AMPATH clinic (specify):",
|
44
|
+
"id": "transfered_in_to_ampath",
|
45
|
+
"required": "false",
|
46
|
+
"default": "",
|
47
|
+
"questionOptions": {
|
48
|
+
"rendering": "ui-select-extended",
|
49
|
+
"attributeType": "7ef225db-94db-4e40-9dd8-fb121d9dc370"
|
50
|
+
},
|
51
|
+
"hide": {
|
52
|
+
"hideWhenExpression": "transferIn !== 'a89c2f42-1350-11df-a1f1-0026b9348838'"
|
53
|
+
}
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"type": "obs",
|
57
|
+
"label": "If non-Ampath, specify:",
|
58
|
+
"id": "nonAmpathSpecify",
|
59
|
+
"questionOptions": {
|
60
|
+
"concept": "a8a06fc6-1350-11df-a1f1-0026b9348838",
|
61
|
+
"rendering": "text"
|
62
|
+
},
|
63
|
+
"validators": [],
|
64
|
+
"hide": {
|
65
|
+
"hideWhenExpression": "transferIn !== 'a89c301e-1350-11df-a1f1-0026b9348838'"
|
66
|
+
}
|
67
|
+
}
|
68
|
+
]
|
69
|
+
},
|
70
|
+
{
|
71
|
+
"label": "Was this visit scheduled?",
|
72
|
+
"id": "scheduledVisit",
|
73
|
+
"questionOptions": {
|
74
|
+
"rendering": "select",
|
75
|
+
"concept": "a89ff9a6-1350-11df-a1f1-0026b9348838",
|
76
|
+
"answers": [
|
77
|
+
{
|
78
|
+
"concept": "a89b6440-1350-11df-a1f1-0026b9348838",
|
79
|
+
"label": "Scheduled visit"
|
80
|
+
},
|
81
|
+
{
|
82
|
+
"concept": "a89ff816-1350-11df-a1f1-0026b9348838",
|
83
|
+
"label": "Unscheduled Visit Early"
|
84
|
+
},
|
85
|
+
{
|
86
|
+
"concept": "a89ff8de-1350-11df-a1f1-0026b9348838",
|
87
|
+
"label": "Unscheduled Visit Late"
|
88
|
+
}
|
89
|
+
]
|
90
|
+
},
|
91
|
+
"type": "obs",
|
92
|
+
"validators": []
|
93
|
+
},
|
94
|
+
{
|
95
|
+
"label": "If Unscheduled, actual scheduled date",
|
96
|
+
"id": "actualDate",
|
97
|
+
"type": "obs",
|
98
|
+
"required": {
|
99
|
+
"type": "conditionalRequired",
|
100
|
+
"message": "Patient visit marked as unscheduled. Please provide the scheduled date.",
|
101
|
+
"referenceQuestionId": "scheduledVisit",
|
102
|
+
"referenceQuestionAnswers": [
|
103
|
+
"a89ff816-1350-11df-a1f1-0026b9348838",
|
104
|
+
"a89ff8de-1350-11df-a1f1-0026b9348838"
|
105
|
+
]
|
106
|
+
},
|
107
|
+
"questionOptions": {
|
108
|
+
"rendering": "date",
|
109
|
+
"concept": "dc1942b2-5e50-4adc-949d-ad6c905f054e"
|
110
|
+
},
|
111
|
+
"validators": [
|
112
|
+
{
|
113
|
+
"type": "date",
|
114
|
+
"allowFutureDates": "true"
|
115
|
+
},
|
116
|
+
{
|
117
|
+
"type": "js_expression",
|
118
|
+
"failsWhenExpression": "!isEmpty(scheduledVisit) && arrayContains(['a89ff816-1350-11df-a1f1-0026b9348838','a89ff8de-1350-11df-a1f1-0026b9348838'], scheduledVisit) && isEmpty(myValue)",
|
119
|
+
"message": "Patient visit marked as unscheduled. Please provide the scheduled date."
|
120
|
+
}
|
121
|
+
],
|
122
|
+
"hide": {
|
123
|
+
"hideWhenExpression": "!arrayContains(['a89ff816-1350-11df-a1f1-0026b9348838','a89ff8de-1350-11df-a1f1-0026b9348838'], scheduledVisit)"
|
124
|
+
}
|
125
|
+
},
|
126
|
+
{
|
127
|
+
"label": "Patient covered by NHIF:",
|
128
|
+
"questionOptions": {
|
129
|
+
"rendering": "select",
|
130
|
+
"concept": "a8b02524-1350-11df-a1f1-0026b9348838",
|
131
|
+
"answers": [
|
132
|
+
{
|
133
|
+
"concept": "8b715fed-97f6-4e38-8f6a-c167a42f8923",
|
134
|
+
"label": "Yes"
|
135
|
+
},
|
136
|
+
{
|
137
|
+
"concept": "a899e0ac-1350-11df-a1f1-0026b9348838",
|
138
|
+
"label": "No"
|
139
|
+
}
|
140
|
+
]
|
141
|
+
},
|
142
|
+
"type": "obs",
|
143
|
+
"validators": []
|
144
|
+
}
|
145
|
+
]
|
146
|
+
},
|
147
|
+
{
|
148
|
+
"label": "Social History",
|
149
|
+
"questions": [
|
150
|
+
{
|
151
|
+
"label": "Civil status:",
|
152
|
+
"id": "civil_status_question",
|
153
|
+
"type": "obs",
|
154
|
+
"questionOptions": {
|
155
|
+
"rendering": "select",
|
156
|
+
"concept": "a899a9f2-1350-11df-a1f1-0026b9348838",
|
157
|
+
"answers": [
|
158
|
+
{
|
159
|
+
"concept": "a899af10-1350-11df-a1f1-0026b9348838",
|
160
|
+
"label": "Cohabitating"
|
161
|
+
},
|
162
|
+
{
|
163
|
+
"concept": "a899ad58-1350-11df-a1f1-0026b9348838",
|
164
|
+
"label": "Divorced"
|
165
|
+
},
|
166
|
+
{
|
167
|
+
"concept": "a8aa76b0-1350-11df-a1f1-0026b9348838",
|
168
|
+
"label": "Married monogamous"
|
169
|
+
},
|
170
|
+
{
|
171
|
+
"concept": "a8b03712-1350-11df-a1f1-0026b9348838",
|
172
|
+
"label": "Married polygamous"
|
173
|
+
},
|
174
|
+
{
|
175
|
+
"concept": "a899aba0-1350-11df-a1f1-0026b9348838",
|
176
|
+
"label": "Separated"
|
177
|
+
},
|
178
|
+
{
|
179
|
+
"concept": "a899ac7c-1350-11df-a1f1-0026b9348838",
|
180
|
+
"label": "Single"
|
181
|
+
},
|
182
|
+
{
|
183
|
+
"concept": "a899ae34-1350-11df-a1f1-0026b9348838",
|
184
|
+
"label": "Widowed"
|
185
|
+
}
|
186
|
+
]
|
187
|
+
},
|
188
|
+
"validators": []
|
189
|
+
},
|
190
|
+
{
|
191
|
+
"label": "Discordant couple:",
|
192
|
+
"questionOptions": {
|
193
|
+
"answers": [
|
194
|
+
{
|
195
|
+
"concept": "a899b35c-1350-11df-a1f1-0026b9348838",
|
196
|
+
"label": "Yes"
|
197
|
+
},
|
198
|
+
{
|
199
|
+
"concept": "a899b42e-1350-11df-a1f1-0026b9348838",
|
200
|
+
"label": "No"
|
201
|
+
},
|
202
|
+
{
|
203
|
+
"concept": "a899b50a-1350-11df-a1f1-0026b9348838",
|
204
|
+
"label": "Unknown"
|
205
|
+
},
|
206
|
+
{
|
207
|
+
"concept": "a89ad3a4-1350-11df-a1f1-0026b9348838",
|
208
|
+
"label": "N/A"
|
209
|
+
}
|
210
|
+
],
|
211
|
+
"concept": "a8af49d8-1350-11df-a1f1-0026b9348838",
|
212
|
+
"rendering": "select"
|
213
|
+
},
|
214
|
+
"type": "obs",
|
215
|
+
"validators": []
|
216
|
+
}
|
217
|
+
]
|
218
|
+
},
|
219
|
+
{
|
220
|
+
"label": "Prevention With Positives",
|
221
|
+
"questions": [
|
222
|
+
{
|
223
|
+
"label": "Prevention with positives: At risk population:",
|
224
|
+
"required": "true",
|
225
|
+
"questionOptions": {
|
226
|
+
"rendering": "select",
|
227
|
+
"concept": "93aa3f1d-1c39-4196-b5e6-8adc916cd5d6",
|
228
|
+
"answers": [
|
229
|
+
{
|
230
|
+
"concept": "5da55301-e28e-4fdf-8b64-02622dedc8b0",
|
231
|
+
"label": "Client of sex worker"
|
232
|
+
},
|
233
|
+
{
|
234
|
+
"concept": "a89ff438-1350-11df-a1f1-0026b9348838",
|
235
|
+
"label": "Commercial sex worker"
|
236
|
+
},
|
237
|
+
{
|
238
|
+
"concept": "a8af49d8-1350-11df-a1f1-0026b9348838",
|
239
|
+
"label": "Discordant couple"
|
240
|
+
},
|
241
|
+
{
|
242
|
+
"concept": "a890d57a-1350-11df-a1f1-0026b9348838",
|
243
|
+
"label": "IV drug use"
|
244
|
+
},
|
245
|
+
{
|
246
|
+
"concept": "e19c35f0-12f0-46c2-94ea-97050f37b811",
|
247
|
+
"label": "MSM"
|
248
|
+
},
|
249
|
+
{
|
250
|
+
"concept": "a89ad3a4-1350-11df-a1f1-0026b9348838",
|
251
|
+
"label": "N/A"
|
252
|
+
}
|
253
|
+
]
|
254
|
+
},
|
255
|
+
"type": "obs",
|
256
|
+
"validators": []
|
257
|
+
},
|
258
|
+
{
|
259
|
+
"label": "Prevention with positives: PWP services:",
|
260
|
+
"required": "true",
|
261
|
+
"questionOptions": {
|
262
|
+
"rendering": "select",
|
263
|
+
"concept": "9ce5dbf0-a141-4ad8-8c9d-cd2bf84fe72b",
|
264
|
+
"answers": [
|
265
|
+
{
|
266
|
+
"concept": "f0a280e8-eb88-41a8-837a-f9949ed1b9cd",
|
267
|
+
"label": "Condom promotion/provision"
|
268
|
+
},
|
269
|
+
{
|
270
|
+
"concept": "bf51f71e-937c-4da5-ae07-654acf59f5bb",
|
271
|
+
"label": "Couple counseling"
|
272
|
+
},
|
273
|
+
{
|
274
|
+
"concept": "91f43249-73c7-427c-8300-2038fc0d6be8",
|
275
|
+
"label": "Needle exchange"
|
276
|
+
},
|
277
|
+
{
|
278
|
+
"concept": "05656545-86be-4605-9527-34fb580534b1",
|
279
|
+
"label": "Targeted risk reduction"
|
280
|
+
},
|
281
|
+
{
|
282
|
+
"concept": "a89ad3a4-1350-11df-a1f1-0026b9348838",
|
283
|
+
"label": "N/A"
|
284
|
+
}
|
285
|
+
]
|
286
|
+
},
|
287
|
+
"type": "obs",
|
288
|
+
"validators": []
|
289
|
+
}
|
290
|
+
]
|
291
|
+
},
|
292
|
+
{
|
293
|
+
"label": "Enrollment History",
|
294
|
+
"questions": [
|
295
|
+
{
|
296
|
+
"label": "Ampath Catchment Area:",
|
297
|
+
"questionOptions": {
|
298
|
+
"concept": "65c5071a-0cf8-49d4-99d1-5f7da6ef6503",
|
299
|
+
"answers": [
|
300
|
+
{
|
301
|
+
"concept": "a899b50a-1350-11df-a1f1-0026b9348838",
|
302
|
+
"label": "Unknown"
|
303
|
+
},
|
304
|
+
{
|
305
|
+
"concept": "5066b630-842b-4105-a66d-74f8aa50aacb",
|
306
|
+
"label": "In Ampath catchment area"
|
307
|
+
},
|
308
|
+
{
|
309
|
+
"concept": "83df5f26-f97a-4cda-9c05-d0bdc6e4ebee",
|
310
|
+
"label": "Out of Ampath catchment area"
|
311
|
+
}
|
312
|
+
],
|
313
|
+
"rendering": "select"
|
314
|
+
},
|
315
|
+
"type": "obs",
|
316
|
+
"validators": []
|
317
|
+
},
|
318
|
+
{
|
319
|
+
"label": "Source of prior HIV care and treatment:",
|
320
|
+
"questionOptions": {
|
321
|
+
"concept": "42ad95d4-ad13-49cb-a870-d3208e339e36",
|
322
|
+
"answers": [
|
323
|
+
{
|
324
|
+
"concept": "a899e0ac-1350-11df-a1f1-0026b9348838",
|
325
|
+
"label": "None"
|
326
|
+
},
|
327
|
+
{
|
328
|
+
"concept": "a8aaf3e2-1350-11df-a1f1-0026b9348838",
|
329
|
+
"label": "Other"
|
330
|
+
}
|
331
|
+
],
|
332
|
+
"rendering": "select"
|
333
|
+
},
|
334
|
+
"type": "obs",
|
335
|
+
"validators": []
|
336
|
+
},
|
337
|
+
{
|
338
|
+
"label": "Point of HIV Testing:",
|
339
|
+
"questionOptions": {
|
340
|
+
"concept": "a8a17e48-1350-11df-a1f1-0026b9348838",
|
341
|
+
"answers": [
|
342
|
+
{
|
343
|
+
"concept": "a89fbedc-1350-11df-a1f1-0026b9348838",
|
344
|
+
"label": "pMTCT"
|
345
|
+
},
|
346
|
+
{
|
347
|
+
"concept": "a8a17b3c-1350-11df-a1f1-0026b9348838",
|
348
|
+
"label": "VCT"
|
349
|
+
},
|
350
|
+
{
|
351
|
+
"concept": "f6dd6114-a212-4187-b76c-5b6fd8a9e7ba",
|
352
|
+
"label": "PHCT"
|
353
|
+
},
|
354
|
+
{
|
355
|
+
"concept": "a8a359a2-1350-11df-a1f1-0026b9348838",
|
356
|
+
"label": "DTC/PITC"
|
357
|
+
},
|
358
|
+
{
|
359
|
+
"concept": "a890a96a-1350-11df-a1f1-0026b9348838",
|
360
|
+
"label": "TB Clinic"
|
361
|
+
},
|
362
|
+
{
|
363
|
+
"concept": "ff3243bf-05f6-426d-aa49-969034962e45",
|
364
|
+
"label": "Adult Inpatient"
|
365
|
+
},
|
366
|
+
{
|
367
|
+
"concept": "3e5ad07b-2ced-4925-8264-cc4d8d1438d4",
|
368
|
+
"label": "Pediatric Inpatient"
|
369
|
+
},
|
370
|
+
{
|
371
|
+
"concept": "a8a17d80-1350-11df-a1f1-0026b9348838",
|
372
|
+
"label": "MCH"
|
373
|
+
},
|
374
|
+
{
|
375
|
+
"concept": "a8a09ac8-1350-11df-a1f1-0026b9348838",
|
376
|
+
"label": "OPD"
|
377
|
+
},
|
378
|
+
{
|
379
|
+
"concept": "a8934292-1350-11df-a1f1-0026b9348838",
|
380
|
+
"label": "STI"
|
381
|
+
},
|
382
|
+
{
|
383
|
+
"concept": "3ddd3de4-dbf1-4ae9-8caf-aca6383bfd5e",
|
384
|
+
"label": "OSCAR"
|
385
|
+
},
|
386
|
+
{
|
387
|
+
"concept": "7d2c77f9-091b-41d7-8608-aff8985fd708",
|
388
|
+
"label": "Tumaini"
|
389
|
+
},
|
390
|
+
{
|
391
|
+
"concept": "a8aaf3e2-1350-11df-a1f1-0026b9348838",
|
392
|
+
"label": "Other"
|
393
|
+
}
|
394
|
+
],
|
395
|
+
"rendering": "select"
|
396
|
+
},
|
397
|
+
"type": "obs",
|
398
|
+
"validators": []
|
399
|
+
},
|
400
|
+
{
|
401
|
+
"label": "Date Confirmed HIV Positive:",
|
402
|
+
"id": "dateConfHiv+",
|
403
|
+
"questionOptions": {
|
404
|
+
"concept": "6d557eec-82f7-4840-a865-a02ac69d93a5",
|
405
|
+
"rendering": "date"
|
406
|
+
},
|
407
|
+
"type": "obs",
|
408
|
+
"validators": [
|
409
|
+
{
|
410
|
+
"type": "date",
|
411
|
+
"allowFutureDates": "false"
|
412
|
+
}
|
413
|
+
]
|
414
|
+
},
|
415
|
+
{
|
416
|
+
"label": "Date enrolled in HIV Care:",
|
417
|
+
"questionOptions": {
|
418
|
+
"concept": "edda0fe9-73ba-4dbe-8739-dd8d0a8f1700",
|
419
|
+
"rendering": "date"
|
420
|
+
},
|
421
|
+
"type": "obs",
|
422
|
+
"validators": [
|
423
|
+
{
|
424
|
+
"type": "date",
|
425
|
+
"allowFutureDates": "false"
|
426
|
+
}
|
427
|
+
]
|
428
|
+
},
|
429
|
+
{
|
430
|
+
"label": "Where was the test done?",
|
431
|
+
"id": "testDone",
|
432
|
+
"questionOptions": {
|
433
|
+
"concept": "12fa8c7d-0e51-42d0-a381-4db7d34b1fcb",
|
434
|
+
"rendering": "text"
|
435
|
+
},
|
436
|
+
"type": "obs",
|
437
|
+
"validators": []
|
438
|
+
},
|
439
|
+
{
|
440
|
+
"label": "WHO stage at Enrollment",
|
441
|
+
"id": "whoStageEnrol",
|
442
|
+
"type": "obs",
|
443
|
+
"questionOptions": {
|
444
|
+
"concept": "1ea9d6ba-2084-4bc0-97a6-46fe677d40e5",
|
445
|
+
"answers": [
|
446
|
+
{
|
447
|
+
"label": "1",
|
448
|
+
"concept": "a89b33d0-1350-11df-a1f1-0026b9348838"
|
449
|
+
},
|
450
|
+
{
|
451
|
+
"label": "2",
|
452
|
+
"concept": "a89b34ac-1350-11df-a1f1-0026b9348838"
|
453
|
+
},
|
454
|
+
{
|
455
|
+
"label": "3",
|
456
|
+
"concept": "a89b3588-1350-11df-a1f1-0026b9348838"
|
457
|
+
},
|
458
|
+
{
|
459
|
+
"label": "4",
|
460
|
+
"concept": "a89b3664-1350-11df-a1f1-0026b9348838"
|
461
|
+
}
|
462
|
+
],
|
463
|
+
"rendering": "select"
|
464
|
+
}
|
465
|
+
},
|
466
|
+
{
|
467
|
+
"label": "Transfer in District:",
|
468
|
+
"questionOptions": {
|
469
|
+
"concept": "10bca44a-930f-46ae-b686-63ddb36a713f",
|
470
|
+
"rendering": "text"
|
471
|
+
},
|
472
|
+
"type": "obs",
|
473
|
+
"validators": []
|
474
|
+
}
|
475
|
+
]
|
476
|
+
}
|
477
|
+
]
|
478
|
+
}
|
479
|
+
]
|
480
|
+
}
|
@@ -0,0 +1,97 @@
|
|
1
|
+
{
|
2
|
+
"name": "ampath_poc_adult_return_visit_form_v1.9",
|
3
|
+
"uuid": "xxxx",
|
4
|
+
"EncounterType": "xxxx",
|
5
|
+
"referencedForms": [],
|
6
|
+
"processor": "EncounterFormProcessor",
|
7
|
+
"pages": [
|
8
|
+
{
|
9
|
+
"label": "Encounter Details",
|
10
|
+
"sections": [
|
11
|
+
{
|
12
|
+
"label": "Hospitalization History",
|
13
|
+
"questions": [
|
14
|
+
{
|
15
|
+
"type": "obsGroup",
|
16
|
+
"label": "Recent hospitalizations",
|
17
|
+
"questionOptions": {
|
18
|
+
"rendering": "group",
|
19
|
+
"concept": "a8a003a6-1350-11df-a1f1-0026b9348838"
|
20
|
+
},
|
21
|
+
"questions": [
|
22
|
+
{
|
23
|
+
"label": "Was the patient hospitalized since last visit?",
|
24
|
+
"id": "wasHospitalized",
|
25
|
+
"questionOptions": {
|
26
|
+
"concept": "a898c56e-1350-11df-a1f1-0026b9348838",
|
27
|
+
"answers": [
|
28
|
+
{
|
29
|
+
"concept": "a899b35c-1350-11df-a1f1-0026b9348838",
|
30
|
+
"label": "Yes"
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"concept": "a899b42e-1350-11df-a1f1-0026b9348838",
|
34
|
+
"label": "No"
|
35
|
+
}
|
36
|
+
],
|
37
|
+
"rendering": "select"
|
38
|
+
},
|
39
|
+
"type": "obs",
|
40
|
+
"validators": []
|
41
|
+
}
|
42
|
+
],
|
43
|
+
"id": "__qLKuwyDMu"
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"type": "obsGroup",
|
47
|
+
"label": "If yes reason for hospitalization:",
|
48
|
+
"questionOptions": {
|
49
|
+
"concept": "a8a003a6-1350-11df-a1f1-0026b9348838",
|
50
|
+
"rendering": "repeating"
|
51
|
+
},
|
52
|
+
"questions": [
|
53
|
+
{
|
54
|
+
"label": "Reason for hospitalization:",
|
55
|
+
"id": "hospReason",
|
56
|
+
"questionOptions": {
|
57
|
+
"concept": "a8a07a48-1350-11df-a1f1-0026b9348838",
|
58
|
+
"rendering": "select",
|
59
|
+
"answers": [
|
60
|
+
{
|
61
|
+
"concept": "a89b6440-1350-11df-a1f1-0026b9348838",
|
62
|
+
"label": "Maternal visit"
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"concept": "a89ff816-1350-11df-a1f1-0026b9348838",
|
66
|
+
"label": "Emergency visit"
|
67
|
+
},
|
68
|
+
{
|
69
|
+
"concept": "a89ff8de-1350-11df-a1f1-0026b9348838",
|
70
|
+
"label": "Unscheduled visit late"
|
71
|
+
}
|
72
|
+
]
|
73
|
+
},
|
74
|
+
"type": "obs",
|
75
|
+
"validators": [
|
76
|
+
{
|
77
|
+
"type": "conditionalAnswered",
|
78
|
+
"message": "Providing diagnosis but didn't answer that patient was hospitalized in question",
|
79
|
+
"referenceQuestionId": "wasHospitalized",
|
80
|
+
"referenceQuestionAnswers": ["a899b35c-1350-11df-a1f1-0026b9348838"]
|
81
|
+
},
|
82
|
+
{
|
83
|
+
"type": "js_expression",
|
84
|
+
"failsWhenExpression": "isEmpty(myValue) && !isEmpty(wasHospitalized) && wasHospitalized === 'a899b35c-1350-11df-a1f1-0026b9348838'",
|
85
|
+
"message": "Patient previously marked as hospitalized. Please provide hospitalization reason."
|
86
|
+
}
|
87
|
+
]
|
88
|
+
}
|
89
|
+
],
|
90
|
+
"id": "__wIytMGq5E"
|
91
|
+
}
|
92
|
+
]
|
93
|
+
}
|
94
|
+
]
|
95
|
+
}
|
96
|
+
]
|
97
|
+
}
|