Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OHRI-2122 Add Program Management under the TPT Program #1779

Merged
merged 3 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion packages/esm-tb-app/src/dashboard.meta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,18 @@ export const tbCasesDashboardMeta = {
config: { columns: 1, type: 'grid', programme: 'tb', dashboardTitle: 'TB Treatment', icon: PillsAdd },
title: 'TB Treatment',
dashboardIcon: PillsAdd,
};
};

export const tptPatientChartMeta = {
title: 'TPT Program',
slotName: 'ohri-tpt-slot',
isExpanded: false,
};

export const tptProgramManagementDashboardMeta = {
slot: 'tpt-program-management-summary-slot',
columns: 1,
title: 'Program Management',
path: 'tpt-program-management',
layoutMode: 'anchored',
};
14 changes: 14 additions & 0 deletions packages/esm-tb-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
tbTreatmentFollowUpDashboardMeta,
tbClinicalViewDashboardMeta,
tbCasesDashboardMeta,
tptProgramManagementDashboardMeta,
tptPatientChartMeta,
} from './dashboard.meta';
import { configSchema } from './config-schema';
import TBSummaryOverviewList from './views/patient-summary/tb-patient-summary.component';
Expand All @@ -17,6 +19,7 @@ import TbTreatmentFollowUpList from './views/treatment-and-follow-up/tb-treatmen
import TbContactTracingList from './views/tb-contact-listing/tb-contact-list.component';
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';

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

Expand All @@ -35,6 +38,8 @@ export function startupApp() {

export const patientChartTbDashboard = getSyncLifecycle(createDashboardGroup(tbPatientChartMeta), options);

export const patientChartTptDashboard = getSyncLifecycle(createDashboardGroup(tptPatientChartMeta), options);

export const tbPatientSummaryDashboardLink = getSyncLifecycle(
createDashboardLink({ ...tbPatientSummaryDashboardMeta, moduleName }),
options,
Expand Down Expand Up @@ -84,6 +89,15 @@ export const tbDashboardTabs = getSyncLifecycle(TbHomePatientTabs, {
moduleName,
});

export const tptProgramManagementDashboardLink = getSyncLifecycle(
createDashboardLink({ ...tptProgramManagementDashboardMeta, moduleName }),
options,
);
export const tptProgramManagementDashboard = getSyncLifecycle(tptProgramManagementSummary, {
featureName: 'tpt-program-management-summary',
moduleName,
});

// OHRI HOME
export const tbClinicalViewDashboardLink = getSyncLifecycle(
createOHRIDashboardLink(tbClinicalViewDashboardMeta),
Expand Down
34 changes: 34 additions & 0 deletions packages/esm-tb-app/src/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,23 @@
"component": "patientChartTbDashboard",
"order": 24
},

{
"name": "tpt-dashboard-link",
"slot": "dashboard-slot",
"component": "tptFolderLink",
"meta": {
"slot": "ohri-tpt-dashboard-slot",
"isFolder": true,
"title": "TPT Program"
}
},
{
"name": "ohri-tpt",
"slot": "patient-chart-dashboard-slot",
"component": "patientChartTptDashboard",
"order": 24
},

{
"name": "tb-summary-dashboard",
Expand Down Expand Up @@ -57,6 +74,23 @@
"component": "tbProgramManagementDashboard"
},

{
"name": "tpt-program-management-summary",
"slot": "ohri-tpt-slot",
"component": "tptProgramManagementDashboardLink",
"meta": {
"slot": "tpt-program-management-summary-slot",
"columns": 1,
"path": "tpt-program-management",
"layoutMode": "anchored"
}
},
{
"name": "tpt-program-management-summary-ext",
"slot": "tpt-program-management-summary-slot",
"component": "tptProgramManagementDashboard"
},

{
"name": "tb-treatment-follow-up-summary",
"slot": "ohri-tb-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 TptEnrolmentListProps {
patientUuid: string;
}

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

const headerTitle = t('tptEnrolment');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a default value for ur translations in here and the other files as well for example

t('tptEnrolment', 'TPT Enrolement')


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

export default TptEnrolmentList;
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 TptTreatmentListProps {
patientUuid: string;
}

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

const headerTitle = t('tptTreatment');

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

export default TptTreatmentList;
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react';
import { Tabs, Tab, TabList, TabPanels, TabPanel } from '@carbon/react';
import styles from '../../common.scss';
import { useTranslation } from 'react-i18next';
import TptTreatmentList from './tabs/tpt-treatment.component copy';
import TptEnrolmentList from './tabs/tpt-enrolment.component';
import { PatientChartProps } from '@ohri/openmrs-esm-ohri-commons-lib';

const TptProgramManagementSummary: React.FC<PatientChartProps> = ({ patientUuid }) => {
const { t } = useTranslation();
return (
<div className={styles.tabContainer}>
<Tabs>
<TabList contained>
<Tab>{t('tptEnrolment')}</Tab>
<Tab>{t('tptTreatment')}</Tab>
</TabList>
<TabPanels>
<TabPanel>
<TptEnrolmentList patientUuid={patientUuid} />
</TabPanel>
<TabPanel>
<TptTreatmentList patientUuid={patientUuid} />
</TabPanel>
</TabPanels>
</Tabs>
</div>
);
};

export default TptProgramManagementSummary;
4 changes: 3 additions & 1 deletion packages/esm-tb-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@
"nextAppointment": "Next Appointment",
"siteOfTb": "Site of TB",
"appointmentDate": "Appointment Date",
"editFollowUpForm": "Edit TB Follow-up Form"
"editFollowUpForm": "Edit TB Follow-up Form",
"tptEnrolment": "TPT Enrolment",
"tptTreatment": "TPT Treatment"
}