From 49dc6ac093d16808594482665e28f04d8023045a Mon Sep 17 00:00:00 2001 From: AJAL ODORA JONATHAN <43242517+ODORA0@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:04:22 +0300 Subject: [PATCH] Add configs to PMTCT --- .../src/components/banner-tags/patientHivStatus.ts | 10 ++++++---- packages/esm-ohri-pmtct-app/src/config-schema.ts | 3 +++ packages/esm-ohri-pmtct-app/src/index.ts | 3 +++ packages/esm-ohri-pmtct-app/src/routes.json | 5 +++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/packages/esm-commons-lib/src/components/banner-tags/patientHivStatus.ts b/packages/esm-commons-lib/src/components/banner-tags/patientHivStatus.ts index 2336607cb..87b17715a 100644 --- a/packages/esm-commons-lib/src/components/banner-tags/patientHivStatus.ts +++ b/packages/esm-commons-lib/src/components/banner-tags/patientHivStatus.ts @@ -14,7 +14,8 @@ const usePatientHtsEncounters = (patientUuid: string) => { 'custom:(uuid,encounterDatetime,location:(uuid,name),' + 'encounterProviders:(uuid,provider:(uuid,name)),' + 'obs:(uuid,obsDatetime,concept:(uuid,name:(uuid,name)),value:(uuid,name:(uuid,name))))'; - const antenatalEncounterType = config.encounterTypes.antenatalEncounterType; + const antenatalEncounterType = + config.encounterTypes.antenatalEncounterType || '677d1a80-dbbe-4399-be34-aa7f54f11405'; if (!antenatalEncounterType) { setIsError(true); @@ -51,9 +52,10 @@ const usePatientHivStatus = (patientUuid: string) => { useEffect(() => { const fetchHivStatus = async () => { - const hivTestResultConceptUUID = config.obsConcepts.hivTestResultConceptUUID; - const positiveUUID = config.obsConcepts.positiveUUID; - const negativeUUID = config.obsConcepts.negativeUUID; + const hivTestResultConceptUUID = + config.obsConcepts.hivTestResultConceptUUID || '159427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'; + const positiveUUID = config.obsConcepts.positiveUUID || '138571AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'; + const negativeUUID = config.obsConcepts.negativeUUID || '664AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'; let hivStatus = ''; diff --git a/packages/esm-ohri-pmtct-app/src/config-schema.ts b/packages/esm-ohri-pmtct-app/src/config-schema.ts index 136b6775c..044731508 100644 --- a/packages/esm-ohri-pmtct-app/src/config-schema.ts +++ b/packages/esm-ohri-pmtct-app/src/config-schema.ts @@ -81,6 +81,9 @@ export const configSchema = { outcomeStatus: '160433AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', infantVisitDate: '159599AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', finalTestResults: '164460AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', + hivTestResultConceptUUID: '159427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', + positiveUUID: '138571AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', + negativeUUID: '664AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', visitDateConcept: '163260AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', hivTestResultConcept: '159427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', artNoConcept: '164402AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', diff --git a/packages/esm-ohri-pmtct-app/src/index.ts b/packages/esm-ohri-pmtct-app/src/index.ts index c00bd64e0..e021d3b47 100644 --- a/packages/esm-ohri-pmtct-app/src/index.ts +++ b/packages/esm-ohri-pmtct-app/src/index.ts @@ -14,6 +14,7 @@ import { createNewOHRIDashboardLink, OHRIHome, createConditionalDashboardGroup, + PatientStatusBannerTag, } from '@ohri/openmrs-esm-ohri-commons-lib'; import { configSchema } from './config-schema'; import rootComponent from './root.component'; @@ -98,3 +99,5 @@ export const maternalChildDashboard = getSyncLifecycle(OHRIHome, { }); export const ptrackerReportNavLink = getSyncLifecycle(ptrackerdashboardPath, options); + +export const patientStatusBannerTagExtension = getSyncLifecycle(PatientStatusBannerTag, options); diff --git a/packages/esm-ohri-pmtct-app/src/routes.json b/packages/esm-ohri-pmtct-app/src/routes.json index 9d14b18e1..1db566250 100644 --- a/packages/esm-ohri-pmtct-app/src/routes.json +++ b/packages/esm-ohri-pmtct-app/src/routes.json @@ -5,6 +5,11 @@ }, "pages": [], "extensions": [ + { + "name": "patient-status-banner-tag", + "slot": "patient-banner-tags-slot", + "component": "patientStatusBannerTagExtension" + }, { "name": "maternal-child-health-results-summary", "slot": "homepage-dashboard-slot",