diff --git a/packages/esm-commons-lib/src/utils/encounter-list-component-util.tsx b/packages/esm-commons-lib/src/utils/encounter-list-component-util.tsx index 41c55de83..b375cd59a 100644 --- a/packages/esm-commons-lib/src/utils/encounter-list-component-util.tsx +++ b/packages/esm-commons-lib/src/utils/encounter-list-component-util.tsx @@ -5,6 +5,7 @@ import { getObsFromEncounter, findObs } from './encounter-list-utils'; export const renderTag = (encounter, concept, statusColorMappings) => { const columnStatus = getObsFromEncounter(encounter, concept); const columnStatusObs = findObs(encounter, concept); + if (columnStatus == '--') { return '--'; } else { diff --git a/packages/esm-commons-lib/src/utils/encounter-list-config-builder.ts b/packages/esm-commons-lib/src/utils/encounter-list-config-builder.ts index bb69d6329..9fd483494 100644 --- a/packages/esm-commons-lib/src/utils/encounter-list-config-builder.ts +++ b/packages/esm-commons-lib/src/utils/encounter-list-config-builder.ts @@ -5,6 +5,11 @@ import { getConceptFromMappings, } from './encounter-list-utils'; import { renderTag } from './encounter-list-component-util'; +import { extractSchemaValues, replaceWithConfigDefaults } from './schema-manipulation'; + +interface ConfigSchema { + [key: string]: { [key: string]: string | Array }; +} interface MenuProps { menuId: string; @@ -142,8 +147,13 @@ export const getTabColumns = (columnsDefinition: Array) => { return columns; }; -export const getMenuItemTabConfiguration = (schemaConfig: MenuProps) => { - const tabs = schemaConfig.tabDefinitions.map((tab) => { +export const getMenuItemTabConfiguration = (schemaConfig: MenuProps, configSchema?: ConfigSchema) => { + // gonna make the configSchema optional for now until we implement it everywher + const configDefaults = extractSchemaValues(configSchema); + + const transformedSchemaConfig = replaceWithConfigDefaults(schemaConfig, configDefaults); + + const tabs = (configSchema ? transformedSchemaConfig.tabDefinitions : schemaConfig.tabDefinitions).map((tab) => { return { name: tab.tabName, hasFilter: tab.hasFilter || false, diff --git a/packages/esm-commons-lib/src/utils/encounter-list-utils.ts b/packages/esm-commons-lib/src/utils/encounter-list-utils.ts index 448591810..09f696714 100644 --- a/packages/esm-commons-lib/src/utils/encounter-list-utils.ts +++ b/packages/esm-commons-lib/src/utils/encounter-list-utils.ts @@ -31,7 +31,12 @@ export function getObsFromEncounters(encounters, obsConcept) { export function resolveValueUsingMappings(encounter, concept, mappings) { const obs = findObs(encounter, concept); - return obs ? mappings[obs.value.uuid] || obs.value : '--'; + for (const key in mappings) { + if (mappings[key] === obs?.value?.uuid) { + return key; + } + } + return '--'; } export function getConceptFromMappings(encounter, concepts) { @@ -77,10 +82,15 @@ export function getObsFromEncounter( let obs = findObs(encounter, obsConcept); if (isTrueFalseConcept) { - if (obs?.value?.uuid == 'cf82933b-3f3f-45e7-a5ab-5d31aaee3da3') { + if ( + (obs?.value?.uuid != 'cf82933b-3f3f-45e7-a5ab-5d31aaee3da3' && obs?.value?.name?.name !== 'Unknown') || + obs?.value?.name?.name === 'FALSE' + ) { + return 'No'; + } else if (obs?.value?.uuid == 'cf82933b-3f3f-45e7-a5ab-5d31aaee3da3') { return 'Yes'; } else { - return 'No'; + return obs?.value?.name?.name; } } diff --git a/packages/esm-commons-lib/src/utils/schema-manipulation.ts b/packages/esm-commons-lib/src/utils/schema-manipulation.ts new file mode 100644 index 000000000..3c68a1ec2 --- /dev/null +++ b/packages/esm-commons-lib/src/utils/schema-manipulation.ts @@ -0,0 +1,47 @@ +export function extractSchemaValues(schema) { + const result = {}; + function traverse(obj) { + Object.entries(obj).forEach(([key, value]) => { + if (typeof value === 'object' && !Array.isArray(value)) { + traverse(value); + } else { + result[key] = value; + } + }); + } + + traverse(schema); + return result; +} + +export function replaceWithConfigDefaults(obj, configDefaults) { + if (Array.isArray(obj)) { + return obj.map((item) => { + if (typeof item === 'string' && configDefaults.hasOwnProperty(item)) { + return configDefaults[item]; + } else { + return replaceWithConfigDefaults(item, configDefaults); + } + }); + } else if (typeof obj === 'object' && obj !== null) { + const newObj = {}; + for (const key in obj) { + if (typeof obj[key] === 'string') { + if (configDefaults.hasOwnProperty(key)) { + // Case where UUID is the value + newObj[configDefaults[key]] = obj[key]; + } else if (configDefaults.hasOwnProperty(obj[key])) { + // Case where UUID is the key + newObj[key] = configDefaults[obj[key]]; + } else { + newObj[key] = obj[key]; + } + } else { + newObj[key] = replaceWithConfigDefaults(obj[key], configDefaults); + } + } + return newObj; + } else { + return obj; + } +} diff --git a/packages/esm-covid-app/src/config-schema.ts b/packages/esm-covid-app/src/config-schema.ts index 853afe612..17535f111 100644 --- a/packages/esm-covid-app/src/config-schema.ts +++ b/packages/esm-covid-app/src/config-schema.ts @@ -21,10 +21,7 @@ export const configSchema = { covidTypeofTestConcept_UUID: '069f6dfe-88c1-4a45-a894-0d99549c8718', covidSpecimenCollectionDate_UUID: '159951AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', covidOutcomeUUID: 'a845f3e6-4432-4de4-9fff-37fa270b1a06', - covidTestType: '069f6dfe-88c1-4a45-a894-0d99549c8718', - covidOutcome: 'a845f3e6-4432-4de4-9fff-37fa270b1a06', rapidAntigenResultDate: 'af159c77-bc5d-46dd-90d9-bcbffb22267f', - covidTreatementOutConcept_UUID: 'a845f3e6-4432-4de4-9fff-37fa270b1a06', covidRapidTestResultDate_UUID: 'af159c77-bc5d-46dd-90d9-bcbffb22267f', pcrTestResultDate: '4a77ab44-0323-490e-96be-e168c0e5c9de', finalCovid19Result: '5da5c21b-969f-41bd-9091-e40d4c707544', @@ -32,9 +29,7 @@ export const configSchema = { covidDiagnorticPcrResultDate_UUID: '4a77ab44-0323-490e-96be-e168c0e5c9de', htsRetrospectiveEncounterType: '79c1f50f-f77d-42e2-ad2a-d29304dde2fe', htsRetrospectiveType: '79c1f50f-f77d-42e2-ad2a-d29304dde2fe', - pcrTestResult: '3f4ee14b-b4ab-4597-9fe9-406883b63d76', covidReasonsForTestingConcep_UUID: 'ae46f4b1-c15d-4bba-ab41-b9157b82b0ce', - covidDiagnosticPcrResult_UUID: '3f4ee14b-b4ab-4597-9fe9-406883b63d76', covidTestResultUUID: '3f4ee14b-b4ab-4597-9fe9-406883b63d76', covidPatientStatusUUID: 'de3bc9b7-05b5-41b6-a38d-8d2eec646c4f', covidSARS_TestResultConcept_UUID: '89feed9c-1dd9-477a-ab1c-86f5f75f6762', @@ -66,6 +61,10 @@ export const configSchema = { covidVaccineAdministeredConcept_UUID: 'e41fbe17-4aee-4a44-950b-6676d6e0ede2', covidVaccineConcept_UUID: '0cc868bd-e9dd-4b59-b278-f923afe22d82', covidVaccineSeriesConcept_UUID: '45b3959d-f897-4e01-b6e5-16ef6ae0a687', + covidNotDoneStatus: '1118AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', + covidCompletedStatus: '1267AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', + covidCancelledStatus: '165170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', + covidPendingStatus: '162866AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', }, }, cohorts: { @@ -109,7 +108,6 @@ export const configSchema = { covidLabResultFormUuid: 'cf8cd756-baef-38df-b84d-92968b42c113', covidLabCancellationFormUuid: 'd38bc949-c95b-39eb-a2c5-08b82a36409c', covidSampleCollectionFormUuid: '371d19b6-485f-11ec-99cc-1fdd2d4e9d88', - covidLabOrderFormUuid: 'f5fb6bc4-6fc3-3462-a191-2fff0896bab3', }, }, }; diff --git a/packages/esm-covid-app/src/views/patient chart/case-assessment-schema-config.json b/packages/esm-covid-app/src/views/patient chart/case-assessment-schema-config.json index 6a3440817..4639fc315 100644 --- a/packages/esm-covid-app/src/views/patient chart/case-assessment-schema-config.json +++ b/packages/esm-covid-app/src/views/patient chart/case-assessment-schema-config.json @@ -5,60 +5,60 @@ "tabName": "COVID Assessment", "headerTitle": "COVID Assessment", "displayText": "COVID Assessment", - "encounterType": "253a43d3-c99e-415c-8b78-ee7d4d3c1d54", + "encounterType": "covid_Assessment_EncounterUUID", "columns": [ { "id": "encounterDate", "isDate": true, "title": "Date of Assessment", - "concept": "160753AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "concept": "covidEncounterDateTime_UUID", "isLink": true }, { "id": "reasonsForTesting", "title": "Reason for testing", - "concept": "ae46f4b1-c15d-4bba-ab41-b9157b82b0ce" + "concept": "covidReasonsForTestingConcep_UUID" }, { "id": "symptomatic", "title": "Presentation", - "concept": "de3bc9b7-05b5-41b6-a38d-8d2eec646c4f" + "concept": "covidPatientStatusUUID" }, { "id": "outcome", "title": "Outcome", - "concept": "a845f3e6-4432-4de4-9fff-37fa270b1a06" + "concept": "covidOutcomeUUID" }, { "id": "actions", "title": "Actions", "actionOptions": [ { - "formName": "COVID Case Form", + "formName": "CovidCaseFormName", "package": "covid", "label": "View Case", "mode": "view" }, { - "formName": "COVID Assessment Form", + "formName": "CovidAssessmentFormName", "package": "covid", "label": "View Assessment", "mode": "view" }, { - "formName": "COVID Assessment Form", + "formName": "CovidAssessmentFormName", "package": "covid", "label": "Edit Assessment", "mode": "edit" }, { - "formName": "COVID Case Form", + "formName": "CovidCaseFormName", "package": "covid", "label": "Edit Case", "mode": "edit" }, { - "formName": "COVID Outcome Form", + "formName": "CovidOutcomeFormName", "package": "covid", "label": "Add/Edit Outcome", "mode": "edit" @@ -72,18 +72,18 @@ }, "formList": [ { - "name": "COVID Assessment Form", + "name": "CovidAssessmentFormName", "excludedIntents": ["COVID_LAB_ASSESSMENT_EMBED"], - "uuid": "f5fb6bc4-6fc3-3462-a191-2fff0896bab3" + "uuid": "covidAssessmentFormUuid" }, { - "name": "COVID Case Form", - "uuid": "c0fd71bd-37bc-3c8d-b2ff-149c0ff4d6f0" + "name": "CovidCaseFormName", + "uuid": "covidCaseFormUuid" }, { - "name": "COVID Outcome Form", + "name": "CovidOutcomeFormName", "excludedIntents": ["COVID_OUTCOME_EMBED", "*"], - "uuid": "6515d898-439c-11ec-9103-238295f2dfd7" + "uuid": "covidOutcomeFormUuid" } ] } diff --git a/packages/esm-covid-app/src/views/patient chart/case-assessment.component.tsx b/packages/esm-covid-app/src/views/patient chart/case-assessment.component.tsx index 0b21446b9..db0e3f577 100644 --- a/packages/esm-covid-app/src/views/patient chart/case-assessment.component.tsx +++ b/packages/esm-covid-app/src/views/patient chart/case-assessment.component.tsx @@ -1,6 +1,8 @@ import React from 'react'; +import { useConfig } from '@openmrs/esm-framework'; import { EncounterList, getMenuItemTabConfiguration } from '@ohri/openmrs-esm-ohri-commons-lib'; import caseAssessmentSchemaConfig from './case-assessment-schema-config.json'; +import { configSchema } from '../../config-schema'; export const covidFormSlot = 'hts-encounter-form-slot'; export const covidEncounterRepresentation = @@ -13,7 +15,8 @@ interface CovidAssessmentWidgetProps { } const CovidAssessment: React.FC = ({ patientUuid }) => { - const tabs = getMenuItemTabConfiguration(caseAssessmentSchemaConfig); + const config = useConfig(); + const tabs = getMenuItemTabConfiguration(caseAssessmentSchemaConfig, config); return ( <> diff --git a/packages/esm-covid-app/src/views/patient chart/covid-vaccinations-schema.json b/packages/esm-covid-app/src/views/patient chart/covid-vaccinations-schema.json index a407b2dd7..73be320a0 100644 --- a/packages/esm-covid-app/src/views/patient chart/covid-vaccinations-schema.json +++ b/packages/esm-covid-app/src/views/patient chart/covid-vaccinations-schema.json @@ -5,42 +5,42 @@ "tabName": "Vaccinations", "headerTitle": "Vaccinations", "displayText": "Vaccinations", - "encounterType": "5b37ce7a-c55e-4226-bdc8-5af04025a6de", + "encounterType": "covidVaccinationEncounterUUID", "columns": [ { "id": "vaccinationDate", "isDate": true, "title": "Vaccination Date", - "concept": "1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "covidVaccinationAdministeredConcept_UUID" }, { "id": "doseAdministered", "title": "Vaccine Dose", - "concept": "6ec64cb3-e710-4d3e-9db4-38c135966a45" + "concept": "covidVaccinationDose_UUID" }, { "id": "vaccineSeries", "title": "Vaccine Series", - "concept": "45b3959d-f897-4e01-b6e5-16ef6ae0a687" + "concept": "covidVaccineSeriesConcept_UUID" }, { "id": "covidVaccineType", "title": "Vaccine Administered", - "concept": "e41fbe17-4aee-4a44-950b-6676d6e0ede2", - "secondaryConcept": "0cc868bd-e9dd-4b59-b278-f923afe22d82" + "concept": "covidVaccineAdministeredConcept_UUID", + "secondaryConcept": "covidVaccineConcept_UUID" }, { "id": "actions", "title": "Actions", "actionOptions": [ { - "formName": "COVID Vaccination Form", + "formName": "CovidVaccinationFormName", "package": "covid", "label": "View Details", "mode": "view" }, { - "formName": "COVID Vaccination Form", + "formName": "CovidVaccinationFormName", "package": "covid", "label": "Edit Form", "mode": "edit" @@ -54,8 +54,8 @@ }, "formList": [ { - "name": "COVID Vaccination Form", - "uuid": "3ae3a031-2e24-357d-81b3-205d5187090a" + "name": "CovidVaccinationFormName", + "uuid": "covidVaccinationFormUuid" } ] } diff --git a/packages/esm-covid-app/src/views/patient chart/covid-vaccinations.component.tsx b/packages/esm-covid-app/src/views/patient chart/covid-vaccinations.component.tsx index 11de826dc..0c46bf90d 100644 --- a/packages/esm-covid-app/src/views/patient chart/covid-vaccinations.component.tsx +++ b/packages/esm-covid-app/src/views/patient chart/covid-vaccinations.component.tsx @@ -1,7 +1,9 @@ import React from 'react'; +import { useConfig } from '@openmrs/esm-framework'; import { EncounterList, getMenuItemTabConfiguration } from '@ohri/openmrs-esm-ohri-commons-lib'; import covidVaccinationsSchemaConfig from './covid-vaccinations-schema.json'; +import { configSchema } from '../../config-schema'; interface CovidVaccinationsWidgetProps { patientUuid: string; @@ -10,7 +12,8 @@ interface CovidVaccinationsWidgetProps { export const covidFormSlot = 'hts-encounter-form-slot'; const CovidVaccinations: React.FC = ({ patientUuid }) => { - const tabs = getMenuItemTabConfiguration(covidVaccinationsSchemaConfig); + const config = useConfig(); + const tabs = getMenuItemTabConfiguration(covidVaccinationsSchemaConfig, config); return ( <> diff --git a/packages/esm-covid-app/src/views/patient chart/lab-results-schema-config.json b/packages/esm-covid-app/src/views/patient chart/lab-results-schema-config.json index ba77b5266..520529e9c 100644 --- a/packages/esm-covid-app/src/views/patient chart/lab-results-schema-config.json +++ b/packages/esm-covid-app/src/views/patient chart/lab-results-schema-config.json @@ -5,47 +5,47 @@ "tabName": "Lab Tests", "headerTitle": "Lab Tests", "displayText": "Lab Tests", - "encounterType": "a77d3e7f-5c8f-4074-a207-77a70e197b0c", + "encounterType": "covidLabOrderEncounterType_UUID", "columns": [ { "id": "orderDate", "isDate": true, "title": "Date of Order", - "concept": "162078AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "covidLabOrderDate_UUID" }, { "id": "reasonsForTesting", "title": "Reason for testing", - "concept": "ae46f4b1-c15d-4bba-ab41-b9157b82b0ce" + "concept": "covidReasonsForTestingConcep_UUID" }, { "id": "testType", "title": "Test Type", - "concept": "069f6dfe-88c1-4a45-a894-0d99549c8718" + "concept": "covidTypeofTestConcept_UUID" }, { "id": "labStatus", "title": "Status", - "concept": "6681366c-2174-489a-b951-13a1404935bf", + "concept": "covidTestStatusConcept_UUID", "type": "tag", "statusColorMappings": { - "1118AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA": "green", - "1267AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA": "green", - "165170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA": "purple", - "162866AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA": "blue" + "covidNotDoneStatus": "green", + "covidCompletedStatus": "green", + "covidCancelledStatus": "purple", + "covidPendingStatus": "blue" } }, { "id": "labTestResult", "title": "Test Result", - "concept": "3f4ee14b-b4ab-4597-9fe9-406883b63d76", - "fallbackConcepts": ["cbcbb029-f11f-4437-9d53-1d0f0a170433"] + "concept": "covidTestResultUUID", + "fallbackConcepts": ["rapidTestResult"] }, { "id": "testResultDate", "isDate": true, "title": "Date of Test Result", - "concept": "163724AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "covidTestResultDate_UUID" }, { @@ -53,13 +53,13 @@ "title": "Actions", "actionOptions": [ { - "formName": "COVID Lab Test", + "formName": "CovidLabTestFormName", "package": "covid", "label": "View Details", "mode": "view" }, { - "formName": "COVID Lab Test", + "formName": "CovidLabTestFormName", "package": "covid", "label": "Add/Edit Lab Result", "mode": "edit" @@ -67,20 +67,20 @@ ], "conditionalActionOptions": [ { - "formName": "Lab Order Cancellation", + "formName": "CovidLabCancellationFormName", "package": "covid", "label": "Cancel Lab order", "mode": "edit", "dependsOn": "Pending", - "dependantConcept": "6681366c-2174-489a-b951-13a1404935bf" + "dependantConcept": "covidTestStatusConcept_UUID" }, { - "formName": "Sample Collection", + "formName": "CovidSampleCollectionFormName", "package": "covid", "label": "Collect Sample", "mode": "edit", "dependsOn": "Pending", - "dependantConcept": "6681366c-2174-489a-b951-13a1404935bf" + "dependantConcept": "covidTestStatusConcept_UUID" } ] } @@ -91,29 +91,29 @@ }, "formList": [ { - "name": "COVID Lab Order Form", + "name": "CovidLabOrderFormName", "excludedIntents": ["COVID_LAB_ORDER_EMBED"], - "uuid": "f5fb6bc4-6fc3-3462-a191-2fff0896bab3" + "uuid": "covidAssessmentFormUuid" }, { - "name": "COVID Lab Result Form", + "name": "CovidLabResultFormName", "excludedIntents": ["COVID_LAB_RESULT_EMBED"], - "uuid": "cf8cd756-baef-38df-b84d-92968b42c113" + "uuid": "covidLabResultFormUuid" }, { - "name": "COVID Lab Test", + "name": "CovidLabTestFormName", "excludedIntents": ["*"], - "uuid": "e92fe922-4863-11ec-99cc-1fdd2d4e9d88" + "uuid": "covidLabTestFormUuid" }, { - "name": "Lab Order Cancellation", + "name": "CovidLabCancellationFormName", "excludedIntents": ["*", "COVID_LAB_CANCELLATION_EMBED"], - "uuid": "d38bc949-c95b-39eb-a2c5-08b82a36409c" + "uuid": "covidLabCancellationFormUuid" }, { - "name": "Sample Collection", + "name": "CovidSampleCollectionFormName", "excludedIntents": ["*", "COVID_SAMPLE_COLLECTION_EMBED"], - "uuid": "371d19b6-485f-11ec-99cc-1fdd2d4e9d88" + "uuid": "covidSampleCollectionFormUuid" } ] }, @@ -121,34 +121,34 @@ "tabName": "Pending Lab Orders", "headerTitle": "Pending Lab Orders", "displayText": "Pending Lab Orders", - "encounterType": "a77d3e7f-5c8f-4074-a207-77a70e197b0c", + "encounterType": "covidLabOrderEncounterType_UUID", "columns": [ { "id": "orderDate", "isDate": true, "title": "Date of Order", - "concept": "162078AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "covidLabOrderDate_UUID" }, { "id": "testType", "title": "Test Type", - "concept": "069f6dfe-88c1-4a45-a894-0d99549c8718" + "concept": "covidTypeofTestConcept_UUID" }, { "id": "fowardLabreference", "title": "Fowarded to Reference Lab", - "concept": "161934AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "covidTestResultConcept_UUID" }, { "id": "labStatus", "title": "Status", - "concept": "6681366c-2174-489a-b951-13a1404935bf", + "concept": "covidTestStatusConcept_UUID", "type": "tag", "statusColorMappings": { - "1118AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA": "green", - "1267AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA": "green", - "165170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA": "purple", - "162866AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA": "blue" + "covidNotDoneStatus": "green", + "covidCompletedStatus": "green", + "covidCancelledStatus": "purple", + "covidPendingStatus": "blue" } }, { @@ -156,19 +156,19 @@ "title": "Actions", "actionOptions": [ { - "formName": "COVID Lab Test", + "formName": "CovidLabTestFormName", "package": "covid", "label": "View Details", "mode": "view" }, { - "formName": "Sample Collection", + "formName": "CovidSampleCollectionFormName", "package": "covid", "label": "Collect Sample", "mode": "edit" }, { - "formName": "COVID Lab Result Form", + "formName": "CovidLabResultFormName", "package": "covid", "label": "Add/Edit Lab Result", "mode": "edit" @@ -178,29 +178,29 @@ ], "launchOptions": { "displayText": "Add", - "moduleName": "@ohri/openmrs-esm-covid-app", + "moduleName": "@ohri/openmrs-esm-ohri-covid-app", "hideFormLauncher": true }, "formList": [ { - "name": "COVID Lab Test", - "uuid": "e92fe922-4863-11ec-99cc-1fdd2d4e9d88" + "name": "CovidLabTestFormName", + "uuid": "covidLabTestFormUuid" }, { - "name": "COVID Lab Result Form", - "uuid": "cf8cd756-baef-38df-b84d-92968b42c113" + "name": "CovidLabResultFormName", + "uuid": "covidLabResultFormUuid" }, { - "name": "Lab Order Cancellation", - "uuid": "d38bc949-c95b-39eb-a2c5-08b82a36409c" + "name": "CovidLabCancellationFormName", + "uuid": "covidLabCancellationFormUuid" }, { - "name": "Sample Collection", - "uuid": "371d19b6-485f-11ec-99cc-1fdd2d4e9d88" + "name": "CovidSampleCollectionFormName", + "uuid": "covidSampleCollectionFormUuid" }, { - "name": "COVID Lab Order Form", - "uuid": "f5fb6bc4-6fc3-3462-a191-2fff0896bab3" + "name": "CovidLabOrderFormName", + "uuid": "covidAssessmentFormUuid" } ], "hasFilter": true diff --git a/packages/esm-covid-app/src/views/patient chart/lab-results.component.tsx b/packages/esm-covid-app/src/views/patient chart/lab-results.component.tsx index 84ee08630..f40b70ac6 100644 --- a/packages/esm-covid-app/src/views/patient chart/lab-results.component.tsx +++ b/packages/esm-covid-app/src/views/patient chart/lab-results.component.tsx @@ -1,10 +1,11 @@ import React from 'react'; -import styles from './covid.scss'; import { Tabs, Tab, TabList, TabPanels, TabPanel } from '@carbon/react'; import { EncounterList, getObsFromEncounter, getMenuItemTabConfiguration } from '@ohri/openmrs-esm-ohri-commons-lib'; import { useConfig } from '@openmrs/esm-framework'; import covidLabTestSchemaConfig from './lab-results-schema-config.json'; +import styles from './covid.scss'; + export const covidFormSlot = 'hts-encounter-form-slot'; export const covidEncounterRepresentation = 'custom:(uuid,encounterDatetime,location:(uuid,name),' + @@ -18,7 +19,7 @@ interface CovidLabWidgetProps { const CovidLabResults: React.FC = ({ patientUuid }) => { const config = useConfig(); - const tabs = getMenuItemTabConfiguration(covidLabTestSchemaConfig); + const tabs = getMenuItemTabConfiguration(covidLabTestSchemaConfig, config); let pendingLabOrdersFilter = (encounter) => { return getObsFromEncounter(encounter, config.obsConcepts.covidTestStatusConcept_UUID) === 'Pending'; diff --git a/packages/esm-hiv-care-treatment-app/src/config-schema.ts b/packages/esm-hiv-care-treatment-app/src/config-schema.ts index fcc648714..3d28834b5 100644 --- a/packages/esm-hiv-care-treatment-app/src/config-schema.ts +++ b/packages/esm-hiv-care-treatment-app/src/config-schema.ts @@ -95,6 +95,13 @@ export const configSchema = { computedHIV_StatusConcept: 'a5261998-c635-4e27-870c-e837faf6cf9a', linkedToCareCodeConcept: 'e8e8fe71-adbb-48e7-b531-589985094d30', linkedToCareYesValueConcept: '1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', + startART: '1256AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', + substituteART: '1258AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', + switchART: '1259AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', + stopART: '1260AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', + restartART: '3e69cb60-2943-410f-83d4-b359ae83fefd', + hivGrayStatus: '664AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', + hivPurpleStatus: '1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', }, }, cohorts: { diff --git a/packages/esm-hiv-care-treatment-app/src/views/general-counselling/general-conselling-config.json b/packages/esm-hiv-care-treatment-app/src/views/general-counselling/general-conselling-config.json index 6e73a72fd..e46432ec3 100644 --- a/packages/esm-hiv-care-treatment-app/src/views/general-counselling/general-conselling-config.json +++ b/packages/esm-hiv-care-treatment-app/src/views/general-counselling/general-conselling-config.json @@ -5,46 +5,46 @@ "tabName": "Mental Health Assessment", "headerTitle": "Mental Health Assessment", "displayText": "Mental Health Assessment", - "encounterType": "36db5123-0ad5-41c0-9037-625b46e0ceef", + "encounterType": "MentalHealthAssessmentEncounter_UUID", "columns": [ { "id": "screeningDate", "isDate": true, "title": "Screening Date", - "concept": "160753AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "dateOfEventConcept" }, { "id": "littleInterest", "title": "Disinterested in Things", - "concept": "167006AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "LittleInterestConcept_UUID" }, { "id": "depressed", "title": "Depressed", - "concept": "167007AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "DepressionConcept_UUID" }, { "id": "appetite", "title": "Poor Appetite", - "concept": "167070AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "PoorAppetiteConcept_UUID" }, { "id": "concentration", "title": "Concentration Problems", - "concept": "167072AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "PoorConcentrationConcept_UUID" }, { "id": "actions", "title": "Actions", "actionOptions": [ { - "formName": "Mental Health Assessment Form", + "formName": "MentalHealthFormName", "package": "hiv-care-treatment", "label": "View Details", "mode": "view" }, { - "formName": "Mental Health Assessment Form", + "formName": "MentalHealthFormName", "package": "hiv-care-treatment", "label": "Edit Form", "mode": "edit" @@ -54,12 +54,12 @@ ], "launchOptions": { "displayText": "Add", - "moduleName": "@ohri/openmrs-esm-ohri-hiv-app" + "moduleName": "@ohri/openmrs-esm-ohri-hiv-care-treatment-app" }, "formList": [ { - "name": "Mental Health Assessment Form", - "uuid": "2069bd57-d534-3de9-ae24-f1d4e4b2de83" + "name": "MentalHealthFormName", + "uuid": "mentalHealthFormUuid" } ] }, @@ -67,44 +67,44 @@ "tabName": "Intimate Partner Violence", "headerTitle": "Intimate Partner Violence", "displayText": "Intimate Partner Violence", - "encounterType": "881fff34-b4a9-4d11-b2f5-a8a23a9f402b", + "encounterType": "IntimatePartnerEncounterType_UUID", "columns": [ { "id": "screeningDate", "isDate": true, "title": "Screening Date", - "concept": "160753AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "dateOfEventConcept" }, { "id": "physicalAbuse", "title": "Physical Abuse", "isTrueFalseConcept": true, - "concept": "2a228c6a-1575-43d7-9d42-9b68d0629f46" + "concept": "PhysicalAbuse_UUID" }, { "id": "emotionalAbuse", "title": "Emotional Abuse", "isTrueFalseConcept": true, - "concept": "bd86f7ee-1d5f-4f5d-aa0f-4680aa6e65cb" + "concept": "EmotionalAbuse_UUID" }, { "id": "sexualAbuse", "title": "Sexual Abuse", "isTrueFalseConcept": true, - "concept": "1246AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "SexualAbuse_UUID" }, { "id": "actions", "title": "Actions", "actionOptions": [ { - "formName": "Intimate Partner Violence Form", + "formName": "IntimatePartnerFormName", "package": "hiv-care-treatment", "label": "View Details", "mode": "view" }, { - "formName": "Intimate Partner Violence Form", + "formName": "IntimatePartnerFormName", "package": "hiv-care-treatment", "label": "Edit Forms", "mode": "edit" @@ -114,12 +114,12 @@ ], "launchOptions": { "displayText": "Add", - "moduleName": "@ohri/openmrs-esm-ohri-hiv-app" + "moduleName": "@ohri/openmrs-esm-ohri-hiv-care-treatment-app" }, "formList": [ { - "name": "Intimate Partner Violence Form", - "uuid": "f99fadd8-feb7-321c-ab58-7569805668e7" + "name": "IntimatePartnerFormName", + "uuid": "intimatePartnerFormUuid" } ] }, @@ -127,31 +127,31 @@ "tabName": "Disclosure", "headerTitle": "Disclosure", "displayText": "Disclosure", - "encounterType": "390c2f21-c1c4-4246-94ca-a026157cd1db", + "encounterType": "PeadsDisclosureEncounterType_UUID", "columns": [ { "id": "disclosureDate", "isDate": true, "title": "Disclosure Date", - "concept": "85fbdcc8-8dbc-40a9-b85f-5d1bfe1ab63d" + "concept": "DisclosureDate_UUID" }, { "id": "disclosureStage", "title": "Disclosure Stage", - "concept": "573f93e2-12f6-483e-aa6e-14e9b76b311a" + "concept": "DisclosureStage_UUID" }, { "id": "actions", "title": "Actions", "actionOptions": [ { - "formName": "Age Appropriate Disclosure Form", + "formName": "DisclosureFormName", "package": "hiv", "label": "View Details", "mode": "view" }, { - "formName": "Age Appropriate Disclosure Form", + "formName": "DisclosureFormName", "package": "hiv", "label": "Edit Forms", "mode": "edit" @@ -165,8 +165,8 @@ }, "formList": [ { - "name": "Age Appropriate Disclosure Form", - "uuid": "cb30cea5-3166-3e88-befb-9141e5f3769d" + "name": "DisclosureFormName", + "uuid": "disclosureFormUuid" } ] } diff --git a/packages/esm-hiv-care-treatment-app/src/views/general-counselling/general-counselling-summary.component.tsx b/packages/esm-hiv-care-treatment-app/src/views/general-counselling/general-counselling-summary.component.tsx index 7b3bab3a4..5c0cd7506 100644 --- a/packages/esm-hiv-care-treatment-app/src/views/general-counselling/general-counselling-summary.component.tsx +++ b/packages/esm-hiv-care-treatment-app/src/views/general-counselling/general-counselling-summary.component.tsx @@ -1,5 +1,6 @@ import React from 'react'; import { Tabs, Tab, TabList, TabPanels, TabPanel } from '@carbon/react'; +import { useConfig } from '@openmrs/esm-framework'; import { EncounterList, getMenuItemTabConfiguration } from '@ohri/openmrs-esm-ohri-commons-lib'; import generalConsellingConfigSchema from './general-conselling-config.json'; @@ -10,7 +11,8 @@ interface OverviewListProps { } const GeneralCounsellingSummary: React.FC = ({ patientUuid }) => { - const tabs = getMenuItemTabConfiguration(generalConsellingConfigSchema); + const config = useConfig(); + const tabs = getMenuItemTabConfiguration(generalConsellingConfigSchema, config); const tabFilter = (encounter, formName) => { return encounter?.form?.name === formName; diff --git a/packages/esm-hiv-care-treatment-app/src/views/partner-notification-services/partner-notification-services.component.tsx b/packages/esm-hiv-care-treatment-app/src/views/partner-notification-services/partner-notification-services.component.tsx index dfec35de1..ac41990af 100644 --- a/packages/esm-hiv-care-treatment-app/src/views/partner-notification-services/partner-notification-services.component.tsx +++ b/packages/esm-hiv-care-treatment-app/src/views/partner-notification-services/partner-notification-services.component.tsx @@ -1,11 +1,7 @@ import React from 'react'; import { Tabs, Tab, TabList, TabPanels, TabPanel, Tag } from '@carbon/react'; -import { - EncounterList, - getMenuItemTabConfiguration, - getObsFromEncounter, - findObs, -} from '@ohri/openmrs-esm-ohri-commons-lib'; +import { useConfig } from '@openmrs/esm-framework'; +import { EncounterList, getMenuItemTabConfiguration } from '@ohri/openmrs-esm-ohri-commons-lib'; import partnerNotificationsConfigSchema from './patner-notification-config.json'; import styles from '../common.scss'; @@ -15,7 +11,8 @@ interface OverviewListProps { } const PartnerNotificationServices: React.FC = ({ patientUuid }) => { - const tabs = getMenuItemTabConfiguration(partnerNotificationsConfigSchema); + const config = useConfig(); + const tabs = getMenuItemTabConfiguration(partnerNotificationsConfigSchema, config); const tabFilter = (encounter, formName) => { return encounter?.form?.name === formName; diff --git a/packages/esm-hiv-care-treatment-app/src/views/partner-notification-services/patner-notification-config.json b/packages/esm-hiv-care-treatment-app/src/views/partner-notification-services/patner-notification-config.json index e75565c5d..77918b3a0 100644 --- a/packages/esm-hiv-care-treatment-app/src/views/partner-notification-services/patner-notification-config.json +++ b/packages/esm-hiv-care-treatment-app/src/views/partner-notification-services/patner-notification-config.json @@ -6,33 +6,33 @@ "hasFilter": true, "headerTitle": "Partner Notification", "displayText": "Partner Notification", - "encounterType": "4dd0ee63-805f-43e9-833c-6386ba97fdc1", + "encounterType": "PatnerNotificationEncounterType_UUID", "columns": [ { "id": "contactDate", "isDate": true, "title": "Contact Date", - "concept": "160753AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "dateOfEventConcept" }, { "id": "name", "title": "Name", - "concept": "166102AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "FirstName_UUID" }, { "id": "relationship", "title": "Relationship", - "concept": "85d3b4fe-c1a9-4e27-a86b-dcc1e30c8a93" + "concept": "Relationship_UUID" }, { "id": "hivStatus", "title": "Status", - "concept": "1436AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "concept": "IndexHIVStatus_UUID", "type": "hivStatus", "statusColorMappings": { - "703AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA": "red", - "664AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA": "gray", - "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA": "purple" + "finalPositiveHIVValueConcept": "red", + "hivGrayStatus": "gray", + "hivPurpleStatus": "purple" } }, { @@ -40,13 +40,13 @@ "title": "Actions", "actionOptions": [ { - "formName": "Partner Notification Form", + "formName": "PartnerNotificationFormName", "package": "hiv-care-treatment", "label": "View Details", "mode": "view" }, { - "formName": "Partner Notification Form", + "formName": "PartnerNotificationFormName", "package": "hiv-care-treatment", "label": "Edit Form", "mode": "edit" @@ -56,12 +56,12 @@ ], "launchOptions": { "displayText": "Add", - "moduleName": "@ohri/openmrs-esm-ohri-hiv-app" + "moduleName": "@ohri/openmrs-esm-ohri-hiv-care-treatment-app" }, "formList": [ { - "name": "Partner Notification Form", - "uuid": "8c48efc5-dd85-3795-9f58-8eb436a4edcc" + "name": "PartnerNotificationFormName", + "uuid": "partnerNotificationFormUuid" } ] }, @@ -70,36 +70,36 @@ "hasFilter": false, "headerTitle": "Contact Tracing", "displayText": "Contact Tracing", - "encounterType": "570e9e42-4306-41dc-9bf8-634bbc70a524", + "encounterType": "ContactTracingEncounterType_UUID", "columns": [ { "id": "contactDate", "isDate": true, "title": "Contact Date", - "concept": "160753AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "dateOfEventConcept" }, { "id": "contactMethod", "title": "Contact Method", - "concept": "59c023dd-eed2-4b11-8c34-b88e9439db3c" + "concept": "contactMethodConcept" }, { "id": "contactOutcome", "title": "Contact Outcome", - "concept": "36a3e671-9d60-4109-b41f-046f44f4b389" + "concept": "ContactTracingOutcome_UUID" }, { "id": "actions", "title": "Actions", "actionOptions": [ { - "formName": "Contact Tracing Form", + "formName": "ContactTracingFormName", "package": "hiv-care-treatment", "label": "View Details", "mode": "view" }, { - "formName": "Contact Tracing Form", + "formName": "ContactTracingFormName", "package": "hiv-care-treatment", "label": "Edit Forms", "mode": "edit" @@ -113,8 +113,8 @@ }, "formList": [ { - "name": "Contact Tracing Form", - "uuid": "94a911a8-8da1-3c12-b696-2f3e78c2e87c" + "name": "ContactTracingFormName", + "uuid": "contactTracingFormUuid" } ] } diff --git a/packages/esm-hiv-care-treatment-app/src/views/program-management/program-management-config.json b/packages/esm-hiv-care-treatment-app/src/views/program-management/program-management-config.json index 103cf29cd..ff1af17f4 100644 --- a/packages/esm-hiv-care-treatment-app/src/views/program-management/program-management-config.json +++ b/packages/esm-hiv-care-treatment-app/src/views/program-management/program-management-config.json @@ -5,50 +5,48 @@ "tabName": "HIV Enrolment", "headerTitle": "HIV Enrolment", "displayText": "HIV Enrolment", - "encounterType": "7e54cd64-f9c3-11eb-8e6a-57478ce139b0", + "encounterType": "careAndTreatmentEncounterType", "columns": [ { "id": "date", "isDate": true, "title": "Enrollment/Re-enrollment Date", - "concept": "20efadf9-86d3-4498-b3ab-7da4dad9c429", - "fallbackConcepts": [ - "160555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - ] + "concept": "re_enrolmentDateConcept", + "fallbackConcepts": ["enrolmentDate"] }, { "id": "clientDescription", "title": "Patient Type at Enrollment", - "concept": "83e40f2c-c316-43e6-a12e-20a338100281" + "concept": "patientTypeEnrollmentConcept" }, { "id": "dateConfirmedPositive", "isDate": true, "title": "Date Confirmed HIV+", - "concept": "160554AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "dateOfHIVDiagnosisConcept" }, { "id": "entryPoint", "title": "Entry Point", - "concept": "160540AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "entryPointConcept" }, { "id": "populationCategory", "title": "Population Category", - "concept": "166432AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "populationCategoryConcept" }, { "id": "actions", "title": "Actions", "actionOptions": [ { - "formName": "Service Enrolment Form", + "formName": "ServiceEnrolmentFormName", "package": "hiv-care-treatment", "label": "View Details", "mode": "view" }, { - "formName": "Service Enrolment Form", + "formName": "ServiceEnrolmentFormName", "package": "hiv-care-treatment", "label": "Edit Form", "mode": "edit" @@ -58,12 +56,12 @@ ], "launchOptions": { "displayText": "Add", - "moduleName": "@ohri/openmrs-esm-ohri-hiv-app" + "moduleName": "@ohri/openmrs-esm-ohri-hiv-care-treatment-app" }, "formList": [ { - "name": "Service Enrolment Form", - "uuid": "8f713e0e-94a0-3c57-9024-69520933802a" + "name": "ServiceEnrolmentFormName", + "uuid": "serviceEnrolmentFormUuid" } ] }, @@ -71,7 +69,7 @@ "tabName": "ART Therapy", "headerTitle": "ART Therapy", "displayText": "ART Therapy", - "encounterType": "74bf4fe6-8fdb-4228-be39-680a93a9cf6d", + "encounterType": "art_Therapy_EncounterUUID", "columns": [ { "id": "initiationDate", @@ -79,45 +77,47 @@ "title": "Date", "type": "artDate", "conceptMappings": [ - "159599AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "162572AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "164516AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "164431AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "160738AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "artTherapyDateTime_UUID", + "artStopDateUUID", + "switchDateUUID", + "substitutionDateUUID", + "dateRestartedUUID" ] }, { "id": "therapyPlan", "title": "Therapy Plan", "type": "artTherapy", - "concept": "7557d77c-172b-4673-9335-67a38657dd01", + "concept": "therapyPlanConcept", "valueMappings": { - "1256AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA": "Start ART", - "1258AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA": "Substitute ART Regimen", - "1259AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA": "Switch ART Regimen Line", - "1260AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA": "Stop ART", - "3e69cb60-2943-410f-83d4-b359ae83fefd": "Restart ART therapy" + "Start ART": "startART", + "Substitute ART Regimen": "substituteART", + "Switch ART Regimen Line": "switchART", + "Stop ART": "stopART", + "Restart ART therapy": "restartART" } + }, { "id": "regimen", "title": "Regimen", - "concept": "dfbe256e-30ba-4033-837a-2e8477f2e7cd" + "concept": "regimenConcept" }, { "id": "regimenInitiated", "title": "Regimen line", - "concept": "164515AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "regimenLine_UUID" }, { "id": "reason", "title": "Reason", "conceptMappings": [ - "160568AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "160562AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "163513AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "161011AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "switchReasonUUID", + "substituteReasonUUID", + "stopReasonUUID", + "freeTextCommentConcept" ], + "concept": "artTherapyDateTime_UUID", "type": "artReason" }, { @@ -125,13 +125,13 @@ "title": "Actions", "actionOptions": [ { - "formName": "ART Therapy Form", + "formName": "ARTTherapyFormName", "package": "hiv", "label": "View Details", "mode": "view" }, { - "formName": "ART Therapy Form", + "formName": "ARTTherapyFormName", "package": "hiv", "label": "Edit Forms", "mode": "edit" @@ -141,12 +141,12 @@ ], "launchOptions": { "displayText": "Add", - "moduleName": "@ohri/openmrs-esm-ohri-hiv-app" + "moduleName": "@ohri/openmrs-esm-ohri-hiv-care-treatment-app" }, "formList": [ { - "name": "ART Therapy Form", - "uuid": "f99fadd8-feb7-321c-ab58-7569805668e7" + "name": "ARTTherapyFormName", + "uuid": "artTherapyFormUuid" } ] }, @@ -154,36 +154,36 @@ "tabName": "Service Delivery Model", "headerTitle": "Service Delivery Model", "displayText": "Service Delivery Model", - "encounterType": "62ee5922-a229-48d3-a1da-875c1ffa9436", + "encounterType": "ServiceDeliveryEncounterType_UUID", "columns": [ { "id": "vlDate", "isDate": true, "title": "Date", - "concept": "160753AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "dateOfEventConcept" }, { "id": "dsdStatus", "title": "Status", - "concept": "8742967d-8107-4cbb-a17e-9a8c7f624673" + "concept": "DSDStatus_UUID" }, { "id": "dsdModel", "title": "DSD Model", - "concept": "52824cbe-0e4d-4c18-8179-80b5799f34ed" + "concept": "CommunityDSDModel_UUID" }, { "id": "actions", "title": "Actions", "actionOptions": [ { - "formName": "Service Delivery Model Form", + "formName": "ServiceDeliveryFormName", "package": "hiv", "label": "View Details", "mode": "view" }, { - "formName": "Service Delivery Model Form", + "formName": "ServiceDeliveryFormName", "package": "hiv", "label": "Edit Forms", "mode": "edit" @@ -193,12 +193,12 @@ ], "launchOptions": { "displayText": "Add", - "moduleName": "@ohri/openmrs-esm-ohri-hiv-app" + "moduleName": "@ohri/openmrs-esm-ohri-hiv-care-treatment-app" }, "formList": [ { - "name": "Service Delivery Model Form", - "uuid": "1e14f841-b42b-3273-93db-807927ca9a82" + "name": "ServiceDeliveryFormName", + "uuid": "serviceDeliveryFormUuid" } ] }, @@ -206,42 +206,43 @@ "tabName": "Transfer Out", "headerTitle": "Transfer Out", "displayText": "Transfer Out", - "encounterType": "3044916a-7e5f-478b-9091-803233f27f91", + "encounterType": "transferOutEncounterType_UUID", "columns": [ { "id": "visitDate", "isDate": true, "title": "Visit Date", - "concept": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "dateOfEncounterConcept" }, { "id": "reasonsForTesting", "title": "Receiving Facility", - "concept": "162724AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "receivingFacility_UUID" }, { "id": "tranferOutDate", "title": "Transfer-Out Date", "isDate": true, - "concept": "160649AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "TransferOutDate_UUID" }, { "id": "verified", "title": "Verified", - "concept": "797e0073-1f3f-46b1-8b1a-8cdad134d2b3" + "isTrueFalseConcept": true, + "concept": "verified_UUID" }, { "id": "actions", "title": "Actions", "actionOptions": [ { - "formName": "Transfer Out Form", + "formName": "TransferOutFormName", "package": "hiv", "label": "View Details", "mode": "view" }, { - "formName": "Transfer Out Form", + "formName": "TransferOutFormName", "package": "hiv", "label": "Edit Forms", "mode": "edit" @@ -251,12 +252,12 @@ ], "launchOptions": { "displayText": "Add", - "moduleName": "@ohri/openmrs-esm-ohri-hiv-app" + "moduleName": "@ohri/openmrs-esm-ohri-hiv-care-treatment-app" }, "formList": [ { - "name": "Transfer Out Form", - "uuid": "a969288d-6605-361b-b01c-42f6ef25c0f5" + "name": "TransferOutFormName", + "uuid": "transferOutFormUuid" } ] }, @@ -264,36 +265,36 @@ "tabName": "Patient Tracing", "headerTitle": "Patient Tracing", "displayText": "Patient Tracing", - "encounterType": "0cd5d4cb-204e-419a-9dd7-1e18e939ce4c", + "encounterType": "PatientTracingEncounterType_UUID", "columns": [ { "id": "contactDate", "isDate": true, "title": "Contact Date", - "concept": "160753AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "dateOfEventConcept" }, { "id": "contactMethod", "title": "Contact Method", - "concept": "59c023dd-eed2-4b11-8c34-b88e9439db3c" + "concept": "contactMethodConcept" }, { "id": "contactOutcome", "title": "Contact Outcome", - "concept": "bc45edbd-11e7-4888-ad7d-4ec3dd8cdcf6" + "concept": "ContactOutcome_UUID" }, { "id": "actions", "title": "Actions", "actionOptions": [ { - "formName": "Patient Tracing Form", + "formName": "PatientTracingFormName", "package": "hiv", "label": "View Details", "mode": "view" }, { - "formName": "Patient Tracing Form", + "formName": "PatientTracingFormName", "package": "hiv", "label": "Edit Forms", "mode": "edit" @@ -303,12 +304,12 @@ ], "launchOptions": { "displayText": "Add", - "moduleName": "@ohri/openmrs-esm-ohri-hiv-app" + "moduleName": "@ohri/openmrs-esm-ohri-hiv-care-treatment-app" }, "formList": [ { - "name": "Patient Tracing Form", - "uuid": "71f3febd-dd11-322b-9c18-2a8a07d87af1" + "name": "PatientTracingFormName", + "uuid": "patientTracingFormUuid" } ] }, @@ -316,41 +317,41 @@ "tabName": "Death", "headerTitle": "Death", "displayText": "Death", - "encounterType": "15272be5-ae9c-4278-a303-4b8907eae73b", + "encounterType": "hivLabResultsEncounterType_UUID", "columns": [ { "id": "deathDate", "isDate": true, "title": "Death Date", - "concept": "1543AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "hivDeathDate_UUID" }, { "id": "deathCause", "title": "Cause of Death", - "concept": "ef973f1f-557f-4620-acf5-9c4c18bf1eda" + "concept": "causeOFDeath_UUID" }, { "id": "specificDeathCause", "title": "Specific cause of Death", - "concept": "e329cdf4-4eeb-4821-85ec-80ec4b503de0" + "concept": "deathSpecific_UUID" }, { "id": "regimenInitiated", "title": "Regimen line", - "concept": "164515AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "regimenLine_UUID" }, { "id": "actions", "title": "Actions", "actionOptions": [ { - "formName": "Death Form", + "formName": "deathFormName", "package": "hiv", "label": "View Details", "mode": "view" }, { - "formName": "Death Form", + "formName": "deathFormName", "package": "hiv", "label": "Edit Forms", "mode": "edit" @@ -364,8 +365,8 @@ }, "formList": [ { - "name": "Death Form", - "uuid": "41af2def-841d-38b7-8d2e-df25bdd0b73f" + "name": "deathFormName", + "uuid": "deathFormUuid" } ] } diff --git a/packages/esm-hiv-care-treatment-app/src/views/program-management/program-management-summary.component.tsx b/packages/esm-hiv-care-treatment-app/src/views/program-management/program-management-summary.component.tsx index fd783cb65..bf425d6c0 100644 --- a/packages/esm-hiv-care-treatment-app/src/views/program-management/program-management-summary.component.tsx +++ b/packages/esm-hiv-care-treatment-app/src/views/program-management/program-management-summary.component.tsx @@ -1,15 +1,18 @@ import React from 'react'; import { Tabs, Tab, TabList, TabPanels, TabPanel } from '@carbon/react'; -import styles from '../common.scss'; +import { useConfig } from '@openmrs/esm-framework'; import { EncounterList, getMenuItemTabConfiguration } from '@ohri/openmrs-esm-ohri-commons-lib'; import programManagementTabConfigSchema from './program-management-config.json'; +import styles from '../common.scss'; + interface OverviewListProps { patientUuid: string; } const ProgramManagementSummary: React.FC = ({ patientUuid }) => { - const tabs = getMenuItemTabConfiguration(programManagementTabConfigSchema); + const config = useConfig(); + const tabs = getMenuItemTabConfiguration(programManagementTabConfigSchema, config); return (
diff --git a/packages/esm-hiv-care-treatment-app/src/views/visits/clinical-visit-config.json b/packages/esm-hiv-care-treatment-app/src/views/visits/clinical-visit-config.json index 735889be8..5795c95b2 100644 --- a/packages/esm-hiv-care-treatment-app/src/views/visits/clinical-visit-config.json +++ b/packages/esm-hiv-care-treatment-app/src/views/visits/clinical-visit-config.json @@ -5,43 +5,43 @@ "tabName": "Clinical Visit", "headerTitle": "Clinical Visit", "displayText": "clinical visit encounters", - "encounterType": "cb0a65a7-0587-477e-89b9-cf2fd144f1d4", + "encounterType": "clinicalVisitEncounterType", "columns": [ { "id": "clinicalVisitDate", "isDate": true, "title": "Visit Date", - "concept": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "concept": "dateOfEncounterConcept", "isLink": true }, { "id": "clinicalVisitType", "title": "Visit Type", - "concept": "8a9809e9-8a0b-4e0e-b1f6-80b0cbbe361b" + "concept": "visitTypeConcept" }, { "id": "clinicalScreeningOutcome", "title": "TB Screening Outcome", - "concept": "160108AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tbScreeningOutcome" }, { "id": "clinicalNextAppointmentDate", "title": "Next Appointment Date", "isDate": true, - "concept": "5096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "returnVisitDateConcept" }, { "id": "actions", "title": "Actions", "actionOptions": [ { - "formName": "POC Clinical Visit Form v2", + "formName": "ClinicalVisitFormName", "package": "hiv-care-treatment", "label": "View Details", "mode": "view" }, { - "formName": "POC Clinical Visit Form v2", + "formName": "ClinicalVisitFormName", "package": "hiv-care-treatment", "label": "Edit Form", "mode": "edit" @@ -55,8 +55,8 @@ }, "formList": [ { - "name": "POC Clinical Visit Form v2", - "uuid": "b3abc4ce-c5ac-3c40-b8e7-442b163670f1" + "name": "ClinicalVisitFormName", + "uuid": "clinicalVisitFormUuid" } ] } diff --git a/packages/esm-hiv-care-treatment-app/src/views/visits/visits-summary.component.tsx b/packages/esm-hiv-care-treatment-app/src/views/visits/visits-summary.component.tsx index c81f0ab70..7c6d96805 100644 --- a/packages/esm-hiv-care-treatment-app/src/views/visits/visits-summary.component.tsx +++ b/packages/esm-hiv-care-treatment-app/src/views/visits/visits-summary.component.tsx @@ -1,5 +1,6 @@ import React from 'react'; import { Tabs, Tab, TabList, TabPanels, TabPanel } from '@carbon/react'; +import { useConfig } from '@openmrs/esm-framework'; import { EncounterList, getMenuItemTabConfiguration } from '@ohri/openmrs-esm-ohri-commons-lib'; import clinicalVisitConfigSchema from './clinical-visit-config.json'; @@ -10,7 +11,9 @@ interface OverviewListProps { } const VisitsSummary: React.FC = ({ patientUuid }) => { - const tabs = getMenuItemTabConfiguration(clinicalVisitConfigSchema); + const config = useConfig(); + const tabs = getMenuItemTabConfiguration(clinicalVisitConfigSchema, config); + return (
diff --git a/packages/esm-hiv-prevention-app/src/views/hiv-testing-services/hts-prevention-schema-config.json b/packages/esm-hiv-prevention-app/src/views/hiv-testing-services/hts-prevention-schema-config.json index 3c96055d8..0f563ad7f 100644 --- a/packages/esm-hiv-prevention-app/src/views/hiv-testing-services/hts-prevention-schema-config.json +++ b/packages/esm-hiv-prevention-app/src/views/hiv-testing-services/hts-prevention-schema-config.json @@ -5,13 +5,13 @@ "tabName": "HIV Testing", "headerTitle": "HIV Testing", "displayText": "HIV Testing", - "encounterType": "79c1f50f-f77d-42e2-ad2a-d29304dde2fe", + "encounterType": "htsRetrospectiveEncounterType", "columns": [ { "id": "date", "isDate": true, "title": "Date of HIV Test", - "concept": "164400AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "dateOfHIVTestingConceptUUID" }, { "id": "location", @@ -21,7 +21,7 @@ { "id": "hivTestResult", "title": "HIV Test result", - "concept": "e16b0068-b6a2-46b7-aba9-e3be00a7b4ab" + "concept": "hivTestResultConceptUUID" }, { "id": "provider", @@ -33,13 +33,13 @@ "title": "Actions", "actionOptions": [ { - "formName": "HIV Testing", + "formName": "HIVTestingFormName", "package": "hiv-prevention", "label": "View Details", "mode": "view" }, { - "formName": "HIV Testing", + "formName": "HIVTestingFormName", "package": "hiv-prevention", "label": "Edit Form", "mode": "edit" @@ -53,8 +53,8 @@ }, "formList": [ { - "name": "HIV Testing", - "uuid": "43ffea77-49dc-3ebd-8d83-c2aedb654030", + "name": "HIVTestingFormName", + "uuid": "hivTestingFormUuid", "excludedIntents": ["HTS_PRE_TEST", "HTS_TEST", "HTS_POST_TEST"], "fixedIntent": "*" } diff --git a/packages/esm-hiv-prevention-app/src/views/hiv-testing-services/hts-prevention-summary.component.tsx b/packages/esm-hiv-prevention-app/src/views/hiv-testing-services/hts-prevention-summary.component.tsx index f82a67c1b..dff33912d 100644 --- a/packages/esm-hiv-prevention-app/src/views/hiv-testing-services/hts-prevention-summary.component.tsx +++ b/packages/esm-hiv-prevention-app/src/views/hiv-testing-services/hts-prevention-summary.component.tsx @@ -1,5 +1,6 @@ import React from 'react'; import { Tabs, Tab, TabList, TabPanels, TabPanel } from '@carbon/react'; +import { useConfig } from '@openmrs/esm-framework'; import { EncounterList, getMenuItemTabConfiguration } from '@ohri/openmrs-esm-ohri-commons-lib'; import htsTestingSchemaConfig from './hts-prevention-schema-config.json'; @@ -10,7 +11,8 @@ interface OverviewListProps { } const HTSPreventionSummary: React.FC = ({ patientUuid }) => { - const tabs = getMenuItemTabConfiguration(htsTestingSchemaConfig); + const config = useConfig(); + const tabs = getMenuItemTabConfiguration(htsTestingSchemaConfig, config); return (