Skip to content

Commit

Permalink
OHRI-2117 Add TPT program menu (#1781)
Browse files Browse the repository at this point in the history
  • Loading branch information
ODORA0 authored Jan 23, 2024
1 parent e236785 commit 33319e4
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/esm-tb-app/src/dashboard.meta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ export const tptPatientChartMeta = {
isExpanded: false,
};

export const tptPatientSummaryMeta = {
slot: 'tpt-patient-summary-slot',
columns: 1,
title: 'Patient Summary',
path: 'tpt-patient-summary',
layoutMode: 'anchored',
};

export const tptProgramManagementDashboardMeta = {
slot: 'tpt-program-management-summary-slot',
columns: 1,
Expand Down
12 changes: 12 additions & 0 deletions packages/esm-tb-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
tbCasesDashboardMeta,
tptProgramManagementDashboardMeta,
tptPatientChartMeta,
tptPatientSummaryMeta,
} from './dashboard.meta';
import { configSchema } from './config-schema';
import TBSummaryOverviewList from './views/patient-summary/tb-patient-summary.component';
Expand All @@ -20,6 +21,7 @@ import TbContactTracingList from './views/tb-contact-listing/tb-contact-list.com
import TbSummaryTiles from './views/dashboard/summary-tiles/tb-summary-tiles.component';
import TbHomePatientTabs from './views/dashboard/patient-list-tabs/tb-patient-list-tabs.component';
import tptProgramManagementSummary from './views/tpt/program-management/tpt-program-management';
import tptPatientSummary from './views/tpt/patient-summary/patient-summary.component';

export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');

Expand Down Expand Up @@ -89,6 +91,16 @@ export const tbDashboardTabs = getSyncLifecycle(TbHomePatientTabs, {
moduleName,
});


export const tptPatientSummaryDashboardLink = getSyncLifecycle(
createDashboardLink({ ...tptPatientSummaryMeta, moduleName }),
options,
);
export const tptPatientSummaryDashboard = getSyncLifecycle(tptPatientSummary, {
featureName: 'tpt-patient-summary',
moduleName,
});

export const tptProgramManagementDashboardLink = getSyncLifecycle(
createDashboardLink({ ...tptProgramManagementDashboardMeta, moduleName }),
options,
Expand Down
18 changes: 18 additions & 0 deletions packages/esm-tb-app/src/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,24 @@
"component": "tbProgramManagementDashboard"
},


{
"name": "tpt-patient-summary",
"slot": "ohri-tpt-slot",
"component": "tptPatientSummaryDashboardLink",
"meta": {
"slot": "tpt-patient-summary-slot",
"columns": 1,
"path": "tpt-patient-summary",
"layoutMode": "anchored"
}
},
{
"name": "tpt-patient-summary-ext",
"slot": "tpt-patient-summary-slot",
"component": "tptPatientSummaryDashboard"
},

{
"name": "tpt-program-management-summary",
"slot": "ohri-tpt-slot",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { EmptyStateComingSoon } from '@ohri/openmrs-esm-ohri-commons-lib';

interface TptPatientSummaryProps {
patientUuid: string;
}

const TptPatientSummary: React.FC<TptPatientSummaryProps> = ({ patientUuid }) => {
const { t } = useTranslation();

const headerTitle = t('patientSummary', 'Patient Summary');

return (
<>
<EmptyStateComingSoon displayText={headerTitle} headerTitle={headerTitle} />
</>
);
};

export default TptPatientSummary;
3 changes: 2 additions & 1 deletion packages/esm-tb-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
"appointmentDate": "Appointment Date",
"editFollowUpForm": "Edit TB Follow-up Form",
"tptEnrolment": "TPT Enrolment",
"tptTreatment": "TPT Treatment"
"tptTreatment": "TPT Treatment",
"patientSummary": "Patient Summary"
}

0 comments on commit 33319e4

Please sign in to comment.