diff --git a/packages/esm-commons-lib/src/utils/summary-card-config-builder.ts b/packages/esm-commons-lib/src/utils/summary-card-config-builder.ts index c0d2ac72c..2d64cc0df 100644 --- a/packages/esm-commons-lib/src/utils/summary-card-config-builder.ts +++ b/packages/esm-commons-lib/src/utils/summary-card-config-builder.ts @@ -1,7 +1,10 @@ import { getObsFromEncounter, getConditionalConceptValue } from './encounter-list-utils'; +import { extractSchemaValues, replaceWithConfigDefaults } from './schema-manipulation'; -export const getSummaryCardProps = (schemaConfig) => { - const columns = schemaConfig.columns?.map((column) => ({ +export const getSummaryCardProps = (schemaConfig, config = null) => { + const configDefaults = extractSchemaValues(config); + const transformedSchemaConfig = replaceWithConfigDefaults(schemaConfig, configDefaults); + const columns = transformedSchemaConfig.columns?.map((column) => ({ key: column.id, header: column.title, concept: column.concept, diff --git a/packages/esm-tb-app/src/config-schema.ts b/packages/esm-tb-app/src/config-schema.ts index b0c9fc217..f9edc80cf 100644 --- a/packages/esm-tb-app/src/config-schema.ts +++ b/packages/esm-tb-app/src/config-schema.ts @@ -80,6 +80,7 @@ export const configSchema = { tbfollowUpForm: 'TB Follow-up Form', tbPatientTracingForm: 'TB Patient Tracing Form', tbContactListingForm: 'TB Contact Listing', + TbCaseEnrolmentFormName: 'TB Case Enrollment Form', }, }, formUuids: { @@ -92,6 +93,7 @@ export const configSchema = { tbFollowUpFormUuid: '79b05c37-0def-4482-a345-c63b99fbd565', tbPatientTracingFormUuid: 'ac3cbd10-1939-3797-9de6-2a39dfb68441', tbContactListingFormUuid: 'cb16d920-62f1-3696-b781-e6a4f5e80de1', + tbCaseEnrolmentFormUuid: '554b2017-e512-3fc8-9c6e-7baf9e69db9d', }, }, }; diff --git a/packages/esm-tb-app/src/views/patient-summary/recent-tb-config.json b/packages/esm-tb-app/src/views/patient-summary/recent-tb-config.json index 74bea31a3..f75f42454 100644 --- a/packages/esm-tb-app/src/views/patient-summary/recent-tb-config.json +++ b/packages/esm-tb-app/src/views/patient-summary/recent-tb-config.json @@ -6,72 +6,72 @@ "id": "caseID", "title": "Case ID", "encounterTypes": [ - "9a199b59-b185-485b-b9b3-a9754e65ae57" + "tbProgramEnrollment" ], - "concept": "162576AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "caseID" }, { "id": "enrollmentDate", "isDate": true, "title": "Enrollment Date", "encounterTypes": [ - "9a199b59-b185-485b-b9b3-a9754e65ae57" + "tbProgramEnrollment" ], - "concept": "161552AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "enrollmentDate" }, { "id": "type", "title": "Type", "encounterTypes": [ - "9a199b59-b185-485b-b9b3-a9754e65ae57" + "tbProgramEnrollment" ], - "concept": "159990AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "type" }, { "id": "site", "title": "Site", "encounterTypes": [ - "9a199b59-b185-485b-b9b3-a9754e65ae57" + "tbProgramEnrollment" ], - "concept": "160040AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "site" }, { "id": "drugSensitivity", "title": "Drug Sensitivity", "encounterTypes": [ - "9a199b59-b185-485b-b9b3-a9754e65ae57" + "tbProgramEnrollment" ], - "concept": "164368AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "drugSensitivity" }, { "id": "regimen", "title": "Regimen", "encounterTypes": [ - "9a199b59-b185-485b-b9b3-a9754e65ae57" + "tbProgramEnrollment" ], "isConditionalConcept": true, "conditionalConceptMappings": { - "trueConcept": "16fd7307-0b26-4c8b-afa3-8362baff4042", - "nonTrueConcept": "159909AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "dependantConcept": "163775AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "conditionalConcept": "160541AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "trueConcept": "dSregimen", + "nonTrueConcept": "dRregimen", + "dependantConcept": "tBEnrollmentType", + "conditionalConcept": "dsTBEnrollment" } }, { "id": "hivStatus", "title": "HIV Status", "encounterTypes": [ - "9a199b59-b185-485b-b9b3-a9754e65ae57" + "tbProgramEnrollment" ], - "concept": "159576AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "hivStatus" }, { "id": "outcome", "title": "Outcome", "encounterTypes": [ - "9a199b59-b185-485b-b9b3-a9754e65ae57" + "tbProgramEnrollment" ], - "concept": "159786AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "outcome" } ] } \ No newline at end of file diff --git a/packages/esm-tb-app/src/views/patient-summary/tb-patient-summary.component.tsx b/packages/esm-tb-app/src/views/patient-summary/tb-patient-summary.component.tsx index ff5920860..a410ac49b 100644 --- a/packages/esm-tb-app/src/views/patient-summary/tb-patient-summary.component.tsx +++ b/packages/esm-tb-app/src/views/patient-summary/tb-patient-summary.component.tsx @@ -5,6 +5,7 @@ import { getSummaryCardProps, } from '@ohri/openmrs-esm-ohri-commons-lib'; import React from 'react'; +import { useConfig } from '@openmrs/esm-framework'; import previousCasesConfigSchema from './previous-cases-config.json'; import tbVisitsConfigSchema from './visits-config.json'; import recentTuberculosisConfigSchema from './recent-tb-config.json'; @@ -14,9 +15,10 @@ interface OverviewListProps { } const TBSummaryOverviewList: React.FC = ({ patientUuid }) => { - const previousCaseTabs = getMenuItemTabConfiguration(previousCasesConfigSchema); - const tbVisitsTabs = getMenuItemTabConfiguration(tbVisitsConfigSchema); - const summaryCardColumns = getSummaryCardProps(recentTuberculosisConfigSchema); + const config = useConfig(); + const previousCaseTabs = getMenuItemTabConfiguration(previousCasesConfigSchema, config); + const tbVisitsTabs = getMenuItemTabConfiguration(tbVisitsConfigSchema, config); + const summaryCardColumns = getSummaryCardProps(recentTuberculosisConfigSchema, config); return ( <> diff --git a/packages/esm-tb-app/src/views/patient-summary/visits-config.json b/packages/esm-tb-app/src/views/patient-summary/visits-config.json index e7347e2d5..5b1980f25 100644 --- a/packages/esm-tb-app/src/views/patient-summary/visits-config.json +++ b/packages/esm-tb-app/src/views/patient-summary/visits-config.json @@ -5,39 +5,39 @@ "tabName": "Visits", "headerTitle": "Visits", "displayText": "Visits", - "encounterType": "1881304a-4854-4927-b0b1-a6231d61e43c", + "encounterType": "tbTreatmentAndFollowUp", "columns": [ { "id": "caseID", "title": "Case ID", - "concept": "162576AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "caseID" }, { "id": "dateOfVisit", "isDate": true, "title": "Date of Visit", - "concept": "160753AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "visitDate" }, { "id": "monthOfVisit", "title": "Month of Visit", - "concept": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "monthOfTreatment" }, { "id": "adherence", "title": "Adherence", - "concept": "164075AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "adherenceAssessment" }, { "id": "adverseDrugReaction", "title": "Adverse Drug Reaction", - "concept": "160646AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "ADR" }, { "id": "nextAppointment", "isDate": true, "title": "Next Appointment", - "concept": "5096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptAppointmentDate" } ], "launchOptions": { @@ -47,8 +47,8 @@ }, "formList": [ { - "name": "TPT Followup & Treatment form", - "uuid": "6212bb87-766e-33d0-b37b-79f019008492" + "name": "TptTreatmentFormName", + "uuid": "tptTreatmentFormUuid" } ] } diff --git a/packages/esm-tb-app/src/views/program-management/tb-program-management-config.json b/packages/esm-tb-app/src/views/program-management/tb-program-management-config.json index e06c9fb74..6b3e92cc8 100644 --- a/packages/esm-tb-app/src/views/program-management/tb-program-management-config.json +++ b/packages/esm-tb-app/src/views/program-management/tb-program-management-config.json @@ -5,28 +5,28 @@ "tabName": "TB/MDR TB Enrolment", "headerTitle": "TB/MDR TB Enrolment", "displayText": "TB/MDR TB Enrolment", - "encounterType": "9a199b59-b185-485b-b9b3-a9754e65ae57", + "encounterType": "tbProgramEnrollment", "columns": [ { "id": "enrollmentDate", "isDate": true, "title": "Enrollment Date", - "concept": "161552AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "enrollmentDate" }, { "id": "caseID", "title": "Case ID", - "concept": "162576AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "caseID" }, { "id": "tbTreatmentId", "title": "TB Treatment ID", "isConditionalConcept": true, "conditionalConceptMappings": { - "trueConcept": "161654AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "nonTrueConcept": "164415AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "dependantConcept": "163775AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "conditionalConcept": "160541AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "trueConcept": "dSTreatmentId", + "nonTrueConcept": "dRTreatmentId", + "dependantConcept": "tBEnrollmentType", + "conditionalConcept": "dsTBEnrollment" } }, { @@ -35,10 +35,10 @@ "title": "Treatment Start Date", "isConditionalConcept": true, "conditionalConceptMappings": { - "trueConcept": "1113AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "nonTrueConcept": "164416AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "dependantConcept": "163775AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "conditionalConcept": "160541AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "trueConcept": "dSTreatmentStartDate", + "nonTrueConcept": "dRTreatmentStartDate", + "dependantConcept": "tBEnrollmentType", + "conditionalConcept": "dsTBEnrollment" } }, { @@ -46,35 +46,35 @@ "title": "Regimen", "isConditionalConcept": true, "conditionalConceptMappings": { - "trueConcept": "16fd7307-0b26-4c8b-afa3-8362baff4042", - "nonTrueConcept": "159909AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "dependantConcept": "163775AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "conditionalConcept": "160541AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "trueConcept": "dSregimen", + "nonTrueConcept": "dRregimen", + "dependantConcept": "tBEnrollmentType", + "conditionalConcept": "dsTBEnrollment" } }, { "id": "treatmentOutcome", "title": "Treatment Outcome", - "concept": "159786AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "outcome" }, { "id": "dateOfTreatmentOutcome", "isDate": true, "title": "Date of Treatment Outcome", - "concept": "159787AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "DateOfTreatmentOutcome" }, { "id": "actions", "title": "Actions", "actionOptions": [ { - "formName": "TB Case Enrollment Form", + "formName": "TbCaseEnrolmentFormName", "package": "tb", "label": "View Details", "mode": "view" }, { - "formName": "TB Case Enrollment Form", + "formName": "TbCaseEnrolmentFormName", "package": "tb", "label": "Edit Form", "mode": "edit" @@ -88,8 +88,8 @@ }, "formList": [ { - "name": "TB Case Enrollment Form", - "uuid": "554b2017-e512-3fc8-9c6e-7baf9e69db9d" + "name": "TbCaseEnrolmentFormName", + "uuid": "tbCaseEnrolmentFormUuid" } ] }, @@ -97,31 +97,31 @@ "tabName": "Patient Tracing", "headerTitle": "Patient Tracing", "displayText": "Patient Tracing", - "encounterType": "98c938e9-fb3e-4982-ae22-0305cbd12f8c", + "encounterType": "tbPatientTracing", "columns": [ { "id": "contactDate", "isDate": true, "title": "Contact Date", - "concept": "160753AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "dateContacted" }, { "id": "contactMethod", "title": "Contact Method", - "concept": "166456AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "modeOfContact" }, { "id": "actions", "title": "Actions", "actionOptions": [ { - "formName": "TB Patient Tracing Form", + "formName": "tbPatientTracingForm", "package": "tpt", "label": "View Details", "mode": "view" }, { - "formName": "TB Patient Tracing Form", + "formName": "tbPatientTracingForm", "package": "tpt", "label": "Edit Forms", "mode": "edit" @@ -135,8 +135,8 @@ }, "formList": [ { - "name": "TB Patient Tracing Form", - "uuid": "ac3cbd10-1939-3797-9de6-2a39dfb68441" + "name": "tbPatientTracingForm", + "uuid": "tbPatientTracingFormUuid" } ] } diff --git a/packages/esm-tb-app/src/views/program-management/tb-program-management.tsx b/packages/esm-tb-app/src/views/program-management/tb-program-management.tsx index 5b8d02bcc..618843b75 100644 --- a/packages/esm-tb-app/src/views/program-management/tb-program-management.tsx +++ b/packages/esm-tb-app/src/views/program-management/tb-program-management.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import { useConfig } from '@openmrs/esm-framework'; import { Tabs, Tab, TabList, TabPanels, TabPanel } from '@carbon/react'; import styles from '../common.scss'; import { PatientChartProps, getMenuItemTabConfiguration, EncounterList } from '@ohri/openmrs-esm-ohri-commons-lib'; @@ -8,7 +9,8 @@ interface OverviewListProps { } const ProgramManagementSummary: React.FC = ({ patientUuid }) => { - const tabs = getMenuItemTabConfiguration(tptProgramManagemetConfigSchema); + const config = useConfig(); + const tabs = getMenuItemTabConfiguration(tptProgramManagemetConfigSchema, config); return (
diff --git a/packages/esm-tb-app/src/views/tb-contact-listing/tb-contact-list.component.tsx b/packages/esm-tb-app/src/views/tb-contact-listing/tb-contact-list.component.tsx index c2f235210..ccb49ec86 100644 --- a/packages/esm-tb-app/src/views/tb-contact-listing/tb-contact-list.component.tsx +++ b/packages/esm-tb-app/src/views/tb-contact-listing/tb-contact-list.component.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import { useConfig } from '@openmrs/esm-framework'; import { EncounterList, getMenuItemTabConfiguration } from '@ohri/openmrs-esm-ohri-commons-lib'; import tbFollowupConfigSchema from './tb-contact-listing-config.json'; @@ -7,7 +8,8 @@ interface OverviewListProps { } const TbContactTracingList: React.FC = ({ patientUuid }) => { - const tabs = getMenuItemTabConfiguration(tbFollowupConfigSchema); + const config = useConfig(); + const tabs = getMenuItemTabConfiguration(tbFollowupConfigSchema, config); return ( <> diff --git a/packages/esm-tb-app/src/views/tb-contact-listing/tb-contact-listing-config.json b/packages/esm-tb-app/src/views/tb-contact-listing/tb-contact-listing-config.json index 5635e2e99..edbba5767 100644 --- a/packages/esm-tb-app/src/views/tb-contact-listing/tb-contact-listing-config.json +++ b/packages/esm-tb-app/src/views/tb-contact-listing/tb-contact-listing-config.json @@ -5,18 +5,18 @@ "tabName": "TB Contact Listing", "headerTitle": "TB Contact Listing", "displayText": "TB Contact Listing", - "encounterType": "70d2b2f6-860b-438c-994b-c28e863dca34", + "encounterType": "tbContactListing", "columns": [ { "id": "caseID", "title": "Case ID", - "concept": "162576AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "caseID" }, { "id": "dateContactListed", "isDate": true, "title": "Date Contact Listed", - "concept": "160753AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "dateContacted" }, { "id": "location", @@ -28,13 +28,13 @@ "title": "Actions", "actionOptions": [ { - "formName": "TB Contact Listing", + "formName": "tbContactListingForm", "package": "tb", "label": "View Details", "mode": "view" }, { - "formName": "TB Contact Listing", + "formName": "tbContactListingForm", "package": "tb", "label": "Edit Form", "mode": "edit" @@ -48,8 +48,8 @@ }, "formList": [ { - "name": "TB Contact Listing", - "uuid": "cb16d920-62f1-3696-b781-e6a4f5e80de1" + "name": "tbContactListingForm", + "uuid": "tbContactListingFormUuid" } ] } diff --git a/packages/esm-tb-app/src/views/tpt/patient-summary/patient-summary.component.tsx b/packages/esm-tb-app/src/views/tpt/patient-summary/patient-summary.component.tsx index 619ad30d5..4c5ce14c2 100644 --- a/packages/esm-tb-app/src/views/tpt/patient-summary/patient-summary.component.tsx +++ b/packages/esm-tb-app/src/views/tpt/patient-summary/patient-summary.component.tsx @@ -5,6 +5,7 @@ import { getSummaryCardProps, } from '@ohri/openmrs-esm-ohri-commons-lib'; import React from 'react'; +import { useConfig } from '@openmrs/esm-framework'; import tptPreviousCasesConfigSchema from './tpt-previous-cases-config.json'; import tptVisitsConfigSchema from './tpt-visits-config.json'; import recentTptConfigSchema from './recent-tpt-config.json'; @@ -14,9 +15,10 @@ interface OverviewListProps { } const TptPatientSummary: React.FC = ({ patientUuid }) => { - const previousCaseTabs = getMenuItemTabConfiguration(tptPreviousCasesConfigSchema); - const tbVisitsTabs = getMenuItemTabConfiguration(tptVisitsConfigSchema); - const summaryCardColumns = getSummaryCardProps(recentTptConfigSchema); + const config = useConfig(); + const previousCaseTabs = getMenuItemTabConfiguration(tptPreviousCasesConfigSchema, config); + const tbVisitsTabs = getMenuItemTabConfiguration(tptVisitsConfigSchema, config); + const summaryCardColumns = getSummaryCardProps(recentTptConfigSchema, config); return ( <> diff --git a/packages/esm-tb-app/src/views/tpt/patient-summary/recent-tpt-config.json b/packages/esm-tb-app/src/views/tpt/patient-summary/recent-tpt-config.json index 09db5ec0e..46b596aea 100644 --- a/packages/esm-tb-app/src/views/tpt/patient-summary/recent-tpt-config.json +++ b/packages/esm-tb-app/src/views/tpt/patient-summary/recent-tpt-config.json @@ -6,51 +6,51 @@ "id": "tptTreatmentId", "title": "TPT Treatment ID", "encounterTypes": [ - "dc6ce80c-83f8-4ace-a638-21df78542551" + "tptCaseEnrollment" ], - "concept": "162727AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptTreatmentId" }, { "id": "tptEnrollmentDate", "isDate": true, "title": "Enrollment Date", "encounterTypes": [ - "dc6ce80c-83f8-4ace-a638-21df78542551" + "tptCaseEnrollment" ], - "concept": "164852AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptEnrollmentDate" }, { "id": "tptIndication", "title": "Indication", "encounterTypes": [ - "dc6ce80c-83f8-4ace-a638-21df78542551" + "tptCaseEnrollment" ], - "concept": "162276AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptIndication" }, { "id": "tptRegimen", "title": "Regimen", "encounterTypes": [ - "dc6ce80c-83f8-4ace-a638-21df78542551" + "tptCaseEnrollment" ], - "concept": "1264AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptRegimen" }, { "id": "tptAdherence", "title": "Adherence", "encounterTypes": [ - "1ac3de3f-8fc2-43a7-addb-e805c393ecae" + "tptTreatmentAndFollowUp" ], - "concept": "164075AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "adherenceAssessment" }, { "id": "tptAppointmentDate", "isDate": true, "title": "Next Appointment Date", "encounterTypes": [ - "1ac3de3f-8fc2-43a7-addb-e805c393ecae" + "tptTreatmentAndFollowUp" ], - "concept": "5096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "nextAppointmentDate" } ] } diff --git a/packages/esm-tb-app/src/views/tpt/patient-summary/tpt-previous-cases-config.json b/packages/esm-tb-app/src/views/tpt/patient-summary/tpt-previous-cases-config.json index 376bdb030..31cc8a2c7 100644 --- a/packages/esm-tb-app/src/views/tpt/patient-summary/tpt-previous-cases-config.json +++ b/packages/esm-tb-app/src/views/tpt/patient-summary/tpt-previous-cases-config.json @@ -5,39 +5,39 @@ "tabName": "Previous TPT Cases", "headerTitle": "Previous TPT Cases", "displayText": "Previous TPT Cases", - "encounterType": "dc6ce80c-83f8-4ace-a638-21df78542551", + "encounterType": "tptCaseEnrollment", "columns": [ { "id": "tptTreatmentId", "title": "TPT Treatment ID", - "concept": "162727AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptTreatmentId" }, { "id": "tptEnrollmentDate", "isDate": true, "title": "Enrollment Date", - "concept": "164852AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptEnrollmentDate" }, { "id": "indication", "title": "Indication", - "concept": "162276AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptIndication" }, { "id": "tptRegimen", "title": "Regimen", - "concept": "1264AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptRegimen" }, { "id": "tptOutcome", "title": "Outcome", - "concept": "1266AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptOutcome" }, { "id": "tptDateOutcome", "isDate": true, "title": "Date of Outcome", - "concept": "163284AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptOutcomeDate" } ], "launchOptions": { @@ -47,8 +47,8 @@ }, "formList": [ { - "name": "TPT Case Enrolment form", - "uuid": "71080512-07e6-345f-864f-93e892420258" + "name": "TptCaseEnrolmentFormName", + "uuid": "tptCaseEnrolmentFormUuid" } ] } diff --git a/packages/esm-tb-app/src/views/tpt/patient-summary/tpt-visits-config.json b/packages/esm-tb-app/src/views/tpt/patient-summary/tpt-visits-config.json index a87f57de9..2b98fb8f5 100644 --- a/packages/esm-tb-app/src/views/tpt/patient-summary/tpt-visits-config.json +++ b/packages/esm-tb-app/src/views/tpt/patient-summary/tpt-visits-config.json @@ -5,34 +5,34 @@ "tabName": "Visits", "headerTitle": "Visits", "displayText": "Visits", - "encounterType": "dc6ce80c-83f8-4ace-a638-21df78542551", + "encounterType": "tptCaseEnrollment", "columns": [ { "id": "tptTreatmentId", "title": "TPT Treatment ID", - "concept": "162727AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptTreatmentId" }, { "id": "dateOfVisit", "isDate": true, "title": "Date of Visit", - "concept": "164852AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptEnrollmentDate" }, { "id": "tptIndication", "title": "Indication", - "concept": "162276AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptIndication" }, { "id": "adherence", "title": "Adherence", - "concept": "164075AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptAdherence" }, { "id": "nextAppointmentDate", "isDate": true, "title": "Next Appointment Date", - "concept": "5096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptAppointmentDate" } ], "launchOptions": { @@ -42,8 +42,8 @@ }, "formList": [ { - "name": "TPT Case Enrolment form", - "uuid": "71080512-07e6-345f-864f-93e892420258" + "name": "TptCaseEnrolmentFormName", + "uuid": "tptCaseEnrolmentFormUuid" } ] } diff --git a/packages/esm-tb-app/src/views/tpt/program-management/tpt-program-management-config.json b/packages/esm-tb-app/src/views/tpt/program-management/tpt-program-management-config.json index 14a486add..51d1c1acc 100644 --- a/packages/esm-tb-app/src/views/tpt/program-management/tpt-program-management-config.json +++ b/packages/esm-tb-app/src/views/tpt/program-management/tpt-program-management-config.json @@ -5,58 +5,58 @@ "tabName": "TPT Enrolment", "headerTitle": "TPT Enrolment", "displayText": "TPT Enrolment", - "encounterType": "dc6ce80c-83f8-4ace-a638-21df78542551", + "encounterType": "tptCaseEnrollment", "columns": [ { "id": "enrollmentDate", "isDate": true, "title": "Enrollment Date", - "concept": "164852AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptEnrollmentDate" }, { "id": "tptTreatmentID", "title": "TPT Treatment ID", - "concept": "162727AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptTreatmentId" }, { "id": "indication", "title": "Indication", - "concept": "162276AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptIndication" }, { "id": "treatmentStartDate", "isDate": true, "title": "Treatment start Date", - "concept": "162320AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptTreatmentStartDate" }, { "id": "regimen", "title": "Regimen", - "concept": "1264AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptRegimen" }, { "id": "tptOutcome", "title": "Outcome", - "concept": "1266AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptOutcome" }, { "id": "dateOfOutcome", "isDate": true, "title": "Date of Outcome", - "concept": "163284AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptOutcomeDate" }, { "id": "actions", "title": "Actions", "actionOptions": [ { - "formName": "TPT Case Enrolment form", + "formName": "TptCaseEnrolmentFormName", "package": "tpt", "label": "View Details", "mode": "view" }, { - "formName": "TPT Case Enrolment form", + "formName": "TptCaseEnrolmentFormName", "package": "tpt", "label": "Edit Form", "mode": "edit" @@ -70,8 +70,8 @@ }, "formList": [ { - "name": "TPT Case Enrolment form", - "uuid": "1ac3de3f-8fc2-43a7-addb-e805c393ecae" + "name": "TptCaseEnrolmentFormName", + "uuid": "tptTreatmentAndFollowUp" } ] }, @@ -79,41 +79,41 @@ "tabName": "TPT Treatment", "headerTitle": "TPT Treatment", "displayText": "TPT Treatment", - "encounterType": "1ac3de3f-8fc2-43a7-addb-e805c393ecae", + "encounterType": "tptTreatmentAndFollowUp", "columns": [ { "id": "caseId", "title": "Case ID", - "concept": "162576AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "caseID" }, { "id": "Adherence", "title": "Adherence", - "concept": "164075AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "adherenceAssessment" }, { "id": "treatmentPlan", "title": "Treatment Plan", - "concept": "1265AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "treatmentPlan" }, { "id": "nextAppointment", "isDate": true, "title": "Next Appointment", - "concept": "5096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "tptAppointmentDate" }, { "id": "actions", "title": "Actions", "actionOptions": [ { - "formName": "TPT Followup & Treatment form", + "formName": "TptTreatmentFormName", "package": "tpt", "label": "View Details", "mode": "view" }, { - "formName": "TPT Followup & Treatment form", + "formName": "TptTreatmentFormName", "package": "tpt", "label": "Edit Forms", "mode": "edit" @@ -127,8 +127,8 @@ }, "formList": [ { - "name": "TPT Followup & Treatment form", - "uuid": "6212bb87-766e-33d0-b37b-79f019008492" + "name": "TptTreatmentFormName", + "uuid": "tptTreatmentFormUuid" } ] } diff --git a/packages/esm-tb-app/src/views/tpt/program-management/tpt-program-management.tsx b/packages/esm-tb-app/src/views/tpt/program-management/tpt-program-management.tsx index b5e9a32e9..815275757 100644 --- a/packages/esm-tb-app/src/views/tpt/program-management/tpt-program-management.tsx +++ b/packages/esm-tb-app/src/views/tpt/program-management/tpt-program-management.tsx @@ -1,14 +1,17 @@ import React from 'react'; +import { useConfig } from '@openmrs/esm-framework'; import { Tabs, Tab, TabList, TabPanels, TabPanel } from '@carbon/react'; import styles from '../../common.scss'; import { EncounterList, getMenuItemTabConfiguration } from '@ohri/openmrs-esm-ohri-commons-lib'; import tptProgramManagemetConfigSchema from './tpt-program-management-config.json'; + interface OverviewListProps { patientUuid: string; } const TptProgramManagementSummary: React.FC = ({ patientUuid }) => { - const tabs = getMenuItemTabConfiguration(tptProgramManagemetConfigSchema); + const config = useConfig(); + const tabs = getMenuItemTabConfiguration(tptProgramManagemetConfigSchema, config); return (
diff --git a/packages/esm-tb-app/src/views/treatment-and-follow-up/tb-treatment-follow-up.component.tsx b/packages/esm-tb-app/src/views/treatment-and-follow-up/tb-treatment-follow-up.component.tsx index ef3097596..ebb2b9548 100644 --- a/packages/esm-tb-app/src/views/treatment-and-follow-up/tb-treatment-follow-up.component.tsx +++ b/packages/esm-tb-app/src/views/treatment-and-follow-up/tb-treatment-follow-up.component.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import { useConfig } from '@openmrs/esm-framework'; import { EncounterList, getMenuItemTabConfiguration } from '@ohri/openmrs-esm-ohri-commons-lib'; import tbFollowupConfigSchema from './tb-treatment-followup-config.json'; @@ -7,7 +8,8 @@ interface OverviewListProps { } const TbTreatmentFollowUpList: React.FC = ({ patientUuid }) => { - const tabs = getMenuItemTabConfiguration(tbFollowupConfigSchema); + const config = useConfig(); + const tabs = getMenuItemTabConfiguration(tbFollowupConfigSchema, config); return ( <> diff --git a/packages/esm-tb-app/src/views/treatment-and-follow-up/tb-treatment-followup-config.json b/packages/esm-tb-app/src/views/treatment-and-follow-up/tb-treatment-followup-config.json index a09e1d47c..fa22093a0 100644 --- a/packages/esm-tb-app/src/views/treatment-and-follow-up/tb-treatment-followup-config.json +++ b/packages/esm-tb-app/src/views/treatment-and-follow-up/tb-treatment-followup-config.json @@ -5,47 +5,47 @@ "tabName": "TB Follow-up", "headerTitle": "TB Follow-up", "displayText": "TB Follow-up", - "encounterType": "1881304a-4854-4927-b0b1-a6231d61e43c", + "encounterType": "tbTreatmentAndFollowUp", "columns": [ { "id": "visitDate", "isDate": true, "title": "Visit Date", - "concept": "160753AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "visitDate" }, { "id": "caseID", "title": "Case ID", - "concept": "162576AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "followUpCaseId" }, { "id": "monthOfTreatment", "title": "Month of Rx", - "concept": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "monthOfTreatment" }, { "id": "adherenceAssessment", "title": "Adherence", - "concept": "164075AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "adherenceAssessment" }, { "id": "nextAppointment", "isDate": true, "title": "Next Appointment", - "concept": "5096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "nextAppointmentDate" }, { "id": "actions", "title": "Actions", "actionOptions": [ { - "formName": "TB Follow-up Form", + "formName": "tbfollowUpForm", "package": "tb", "label": "View Details", "mode": "view" }, { - "formName": "TB Follow-up Form", + "formName": "tbfollowUpForm", "package": "tb", "label": "Edit Form", "mode": "edit" @@ -59,8 +59,8 @@ }, "formList": [ { - "name": "TB Follow-up Form", - "uuid": "79b05c37-0def-4482-a345-c63b99fbd565" + "name": "tbfollowUpForm", + "uuid": "tbFollowUpFormUuid" } ] }