Skip to content

Commit

Permalink
Merge branch 'dev' into ohri-1996
Browse files Browse the repository at this point in the history
  • Loading branch information
ODORA0 authored Nov 28, 2023
2 parents dedd2cb + 7b45ac7 commit f1aa557
Show file tree
Hide file tree
Showing 7 changed files with 170 additions and 5 deletions.
17 changes: 17 additions & 0 deletions packages/esm-tb-app/src/dashboard.meta.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { PillsAdd } from '@carbon/react/icons';

export const tbPatientChartMeta = {
title: 'TB Program',
slotName: 'ohri-tb-slot',
Expand Down Expand Up @@ -35,3 +37,18 @@ export const tbContactListingDashboardMeta = {
path: 'tb-contact-listing',
layoutMode: 'anchored',
};
// Clinical Dashboards
export const tbClinicalViewDashboardMeta = {
slot: 'tb-clinical-dashboard-slot',
config: { columns: 1, type: 'grid', icon: PillsAdd },
isFolder: true,
title: 'Tuberculosis',
};

export const tbCasesDashboardMeta = {
name: 'tb-cases',
slot: 'tb-cases-dashboard-slot',
config: { columns: 1, type: 'grid', programme: 'tb', dashboardTitle: 'TB Treatment', icon: PillsAdd },
title: 'TB Treatment',
dashboardIcon: PillsAdd,
};
33 changes: 33 additions & 0 deletions packages/esm-tb-app/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { defineConfigSchema, getAsyncLifecycle, getSyncLifecycle } from '@openmrs/esm-framework';
import { createOHRIDashboardLink, OHRIHome, OHRIWelcomeSection } from '@ohri/openmrs-esm-ohri-commons-lib';
import { createDashboardGroup, createDashboardLink } from '@openmrs/esm-patient-common-lib';
import {
tbPatientChartMeta,
tbContactListingDashboardMeta,
tbPatientSummaryDashboardMeta,
tbProgramManagementDashboardMeta,
tbTreatmentFollowUpDashboardMeta,
tbClinicalViewDashboardMeta,
tbCasesDashboardMeta,
} from './dashboard.meta';

export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');
Expand Down Expand Up @@ -72,3 +75,33 @@ export const tbContactListingDashboard = getAsyncLifecycle(
moduleName,
},
);
export const tbDashboardHeader = getSyncLifecycle(OHRIWelcomeSection, {
featureName: 'tb-home-header',
moduleName,
});

export const tbDashboardTiles = getAsyncLifecycle(
() => import('./views/dashboard/summary-tiles/tb-summary-tiles.component'),
{
featureName: 'tb-home-tiles',
moduleName,
},
);
export const tbDashboardTabs = getAsyncLifecycle(
() => import('./views/dashboard/patient-list-tabs/tb-patient-list-tabs.component'),
{
featureName: 'tb-home-tabs',
moduleName,
},
);

// OHRI HOME
export const tbClinicalViewDashboardLink = getSyncLifecycle(
createOHRIDashboardLink(tbClinicalViewDashboardMeta),
options,
);
export const tbCasesDashboardLink = getSyncLifecycle(createOHRIDashboardLink(tbCasesDashboardMeta), options);
export const tbCasesDashboard = getSyncLifecycle(OHRIHome, {
featureName: 'tb cases dashboard',
moduleName,
});
58 changes: 57 additions & 1 deletion packages/esm-tb-app/src/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,62 @@
"name": "tb-contact-listing-summary-ext",
"slot": "tb-contact-listing-summary-slot",
"component": "tbContactListingDashboard"
}
},
{
"name": "tb-dashboard-link",
"slot": "tb-dashboard-slot",
"component": "tbClinicalViewDashboardLink",
"meta": {
"slot": "tb-clinical-dashboard-slot",
"isFolder": true,
"title": "Tuberculosis"
}
},
{
"name": "tb-cases-dashboard-ext",
"slot": "tb-clinical-dashboard-slot",
"component": "tbCasesDashboardLink",
"meta": {
"name": "tb-cases",
"slot": "tb-cases-dashboard-slot",
"config": {
"columns": 1,
"type": "grid",
"programme": "tb",
"dashboardTitle": "TB Treatment"
},
"title": "TB Treatment"
}
},
{
"name": "tb-cases-dashboard",
"slot": "tb-cases-dashboard-slot",
"component": "tbCasesDashboard",
"meta": {
"name": "tb-cases",
"slot": "tb-cases-dashboard-slot",
"config": {
"columns": 1,
"programme": "tb",
"dashboardTitle": "TB Treatment"
},
"title": "TB Treatment"
}
},
{
"name": "tb-home-header-ext",
"slot": "tb-home-header-slot",
"component": "tbDashboardHeader"
},
{
"name": "tb-home-tiles-ext",
"slot": "tb-home-tiles-slot",
"component": "tbDashboardTiles"
},
{
"name": "tb-home-tabs-ext",
"slot": "tb-home-tabs-slot",
"component": "tbDashboardTabs"
}
]
}
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 TbHomePatientTabs: React.FC<OverviewListProps> = ({ patientUuid }) => {
const { t } = useTranslation();
return (
<Tabs >
<TabList contained>
<Tab>{t('allTbClients', 'All TB Clients')}</Tab>
</TabList>
<TabPanels>
<TabPanel>
</TabPanel>
</TabPanels>
</Tabs>
);
};

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

function TbSummaryTiles({ launchWorkSpace }) {
const { t } = useTranslation();
const [activeDSClientsCount, setActiveDSClientsCount] = useState(35);
const [activeDRClientsCount, setActiveDRClientsCount] = useState(5);
const tiles = useMemo(
() => [
{
title: t('activeDsCases', 'Active DS Cases'),
linkAddress: '#',
subTitle: t('drugSensitive', 'Cases with drug sesnsitive TB'),
value: activeDSClientsCount,
},
{
title: t('activeDrCases', 'Active DR Cases'),
linkAddress: '#',
subTitle: t('drugResistant', 'Cases with drug resistant TB'),
value: activeDRClientsCount,
}
],
[],
);
return <OHRIProgrammeSummaryTiles tiles={tiles} />;
}

export default TbSummaryTiles;
8 changes: 7 additions & 1 deletion packages/esm-tb-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@
"TbContactListing": "TB Contact Listing",
"recentTuberculosis": "Recent Tuberculosis",
"previousCases": "Previous Cases",
"visits": "Visits"
"visits": "Visits",
"allTbClients": "All TB Clients",
"activeDrCases": "Active DR Cases",
"activeDsCases": "Active DS Cases",
"drugResistant": "Cases with drug resistant TB",
"drugSensitive": "Cases with drug sesnsitive TB"

}
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4108,8 +4108,8 @@ __metadata:
linkType: hard

"@openmrs/openmrs-form-engine-lib@npm:next":
version: 1.0.0-pre.463
resolution: "@openmrs/openmrs-form-engine-lib@npm:1.0.0-pre.463"
version: 1.0.0-pre.465
resolution: "@openmrs/openmrs-form-engine-lib@npm:1.0.0-pre.465"
dependencies:
ace-builds: ^1.4.12
enzyme: ^3.11.0
Expand All @@ -4132,7 +4132,7 @@ __metadata:
react: 18.x
react-i18next: 11.x
rxjs: 6.x
checksum: ce4a7fc4c846e73ab9c280abd286c5c49790ff150445d419cbe9418cb8dede9e119c262725b99939429b4add72555e1e7e4ba6d7b92bf67a4e8088eb48519d80
checksum: 22c349ed661c228c1adb779706c84056e771b560f43cccd2ea230009a90bd391b1d54813d9da92130fe51db517ce207298aa2d8c20bb6ff9559bf743477da6b3
languageName: node
linkType: hard

Expand Down

0 comments on commit f1aa557

Please sign in to comment.