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

Add TB Prevention link under Tuberculosis program in the clinical perspectives #1780

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
13 changes: 11 additions & 2 deletions packages/esm-tb-app/src/dashboard.meta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,17 @@ export const tbClinicalViewDashboardMeta = {
export const tbCasesDashboardMeta = {
name: 'tb-cases',
slot: 'tb-cases-dashboard-slot',
config: { columns: 1, type: 'grid', programme: 'tb', dashboardTitle: 'TB Treatment', icon: PillsAdd },
config: { columns: 1, type: 'grid', programme: 'tb', dashboardTitle: 'TB Treatment' },
title: 'TB Treatment',
dashboardIcon: PillsAdd,

};

export const tbPreventionCasesDashboardMeta = {
name: 'tb-prevention-cases',
slot: 'tb-prevention-dashboard-slot',
config: { columns: 1, type: 'grid', programme: 'tpt', dashboardTitle: 'TB Prevention' },
title: 'TB Prevention',

};

export const tptPatientChartMeta = {
Expand All @@ -65,4 +73,5 @@ export const tptProgramManagementDashboardMeta = {
title: 'Program Management',
path: 'tpt-program-management',
layoutMode: 'anchored',

};
24 changes: 23 additions & 1 deletion packages/esm-tb-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ import {
tbTreatmentFollowUpDashboardMeta,
tbClinicalViewDashboardMeta,
tbCasesDashboardMeta,
tbPreventionCasesDashboardMeta,
tptProgramManagementDashboardMeta,
tptPatientChartMeta,

} from './dashboard.meta';
import { configSchema } from './config-schema';
import TBSummaryOverviewList from './views/patient-summary/tb-patient-summary.component';
Expand All @@ -19,8 +21,9 @@ 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 TbPreventionSummaryTiles from './views/dashboard/summary-tiles/tb-prevention-patient-list.component';
import TbPreventionPatientListTabs from './views/dashboard/patient-list-tabs/tb-prevention-patient-list.component';
import tptProgramManagementSummary from './views/tpt/program-management/tpt-program-management';

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

require('./root.scss');
Expand Down Expand Up @@ -88,6 +91,16 @@ export const tbDashboardTabs = getSyncLifecycle(TbHomePatientTabs, {
featureName: 'tb-home-tabs',
moduleName,
});
export const tbPreventionDashboardTiles = getSyncLifecycle(TbPreventionSummaryTiles, {
featureName: 'tb-prevention-home-tiles',
moduleName,
});

export const tbPreventionDashboardTabs = getSyncLifecycle(TbPreventionPatientListTabs, {
featureName: 'tb-prevention-home-tabs',
moduleName,
});


export const tptProgramManagementDashboardLink = getSyncLifecycle(
createDashboardLink({ ...tptProgramManagementDashboardMeta, moduleName }),
Expand All @@ -108,3 +121,12 @@ export const tbCasesDashboard = getSyncLifecycle(OHRIHome, {
featureName: 'tb cases dashboard',
moduleName,
});

export const tbPreventionCasesDashboardLink = getSyncLifecycle(
createOHRIDashboardLink(tbPreventionCasesDashboardMeta),
options,
);
export const tbPreventionCasesDashboard = getSyncLifecycle(OHRIHome, {
featureName: 'tb Prevention dashboard',
moduleName,
});
44 changes: 42 additions & 2 deletions packages/esm-tb-app/src/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"component": "patientChartTbDashboard",
"order": 24
},

{
"name": "tpt-dashboard-link",
"slot": "dashboard-slot",
Expand Down Expand Up @@ -165,6 +164,37 @@
"title": "TB Treatment"
}
},
{
"name": "tb-prevention-cases-dashboard-ext",
"slot": "tb-clinical-dashboard-slot",
"component": "tbPreventionCasesDashboardLink",
"meta": {
"name": "tb-prevention-cases",
"slot": "tb-prevention-dashboard-slot",
"config": {
"columns": 1,
"type": "grid",
"programme": "tpt",
"dashboardTitle": "TB Prevention"
},
"title": "TB Prevention"
}
},
{
"name": "tb-prevention-cases-dashboard",
"slot": "tb-prevention-dashboard-slot",
"component": "tbPreventionCasesDashboard",
"meta": {
"name": "tb-prevention-cases",
"slot": "tb-prevention-dashboard-slot",
"config": {
"columns": 1,
"programme": "tpt",
"dashboardTitle": "TB Prevention"
},
"title": "TB Prevention"
}
},
{
"name": "tb-home-header-ext",
"slot": "tb-home-header-slot",
Expand All @@ -179,6 +209,16 @@
"name": "tb-home-tabs-ext",
"slot": "tb-home-tabs-slot",
"component": "tbDashboardTabs"
}
},
{
"name": "tb-prevention-home-tiles-ext",
"slot": "tb-prevention-home-tiles-slot",
"component": "tbPreventionDashboardTiles"
},
{
"name": "tb-prevention-home-tabs-ext",
"slot": "tb-prevention-home-tabs-slot",
"component": "tbPreventionDashboardTabs"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import { Tabs, Tab, TabPanels, TabPanel, TabList } from '@carbon/react';
import { useTranslation } from 'react-i18next';

interface OverviewListProps {
patientUuid: string;
}

const TbPreventionPatientListTabs: React.FC<OverviewListProps> = ({ patientUuid }) => {
lucyjemutai marked this conversation as resolved.
Show resolved Hide resolved
const { t } = useTranslation();
return (
<Tabs>
<TabList contained>
<Tab>{t('allTptClients', 'All TPT Clients')}</Tab>
</TabList>
<TabPanels>
<TabPanel>
</TabPanel>
</TabPanels>
</Tabs>
);
};

export default TbPreventionPatientListTabs;
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { OHRIProgrammeSummaryTiles } from '@ohri/openmrs-esm-ohri-commons-lib';
import React, { useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';

function TbPreventionSummaryTiles({ launchWorkSpace }) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The launchWorkspace prop is unused

const { t } = useTranslation();
const [activeDSClientsCount] = useState(78);
const tiles = useMemo(
() => [
{
title: t('allTptClients', 'All TPT Clients'),
linkAddress: '#',
subTitle: t('currentTptClients', 'Clients Currently on TPT'),
value: activeDSClientsCount,
},
],
[],
);
return <OHRIProgrammeSummaryTiles tiles={tiles} />;
}

export default TbPreventionSummaryTiles;
2 changes: 2 additions & 0 deletions packages/esm-tb-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"activeDrCases": "Active DR Cases",
"activeDsCases": "Active DS Cases",
"allTbClients": "All TB Clients",
"allTptClients": "All TPT Clients",
"caseID": "Case ID",
"currentTptClients": "Clients Currently on TPT",
"dateContactListed": "Date Contact Listed",
"drugResistant": "Cases with drug resistant TB",
"drugSensitive": "Cases with drug sesnsitive TB",
Expand Down