Skip to content

Commit

Permalink
Merge pull request #129 from Collins-Rop/main
Browse files Browse the repository at this point in the history
(Chore)Labour and delivery mapping
  • Loading branch information
Rugute authored Jul 29, 2024
2 parents 3e9ac05 + a2094b7 commit 599ca5f
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 188 deletions.
6 changes: 0 additions & 6 deletions packages/esm-hts-app/src/dashboard.meta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ export const htsDashboardMeta = {
dashboardIcon: Coronavirus,
};

export const htsPatientClinicalChartMeta = {
title: 'HTS Services',
slotName: 'ohri-hts-slot',
isExpanded: false,
};

export const htsPatientSummaryMeta = {
slot: 'hts-patient-summary-slot',
columns: 1,
Expand Down
45 changes: 45 additions & 0 deletions packages/esm-hts-app/src/hts.component.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,48 @@
import React from 'react';
import useSWR from 'swr';
import { useTranslation } from 'react-i18next';
import HTSHomePatientTabs from './views/dashboard/patient-list-tabs/hts-patient-list-tabs.component';
import HTSSummaryTile from './views/dashboard/summary-tiles/hts-summary-tiles.component';
import HTSSummaryTileOverallUptake from './views/dashboard/summary-tiles/hts-summary-tiles-overall-uptake.component';
import { HTSHeader } from './header/hts-header.component';
import styles from './hts.scss';
import { openmrsFetch } from '@openmrs/esm-framework';

// export const BASE_URL = '/ws/rest/v1/amrscore';

// const fetcher = async (url) => {
// try {
// const response = await openmrsFetch(url);
// if (!response.ok) {
// throw new Error('Failed to fetch data: ${response.statusText}');
// }
// return response.json();
// } catch (error) {
// throw new Error('An error occurred while fetching data: ${error.message}')
// }
// };

// export const useHTSData = () => {
// const {data, error} = useSWR('$BASE_URL/hts-data', fetcher);
// if (error) {
// console.error('Failed to fetch HTS data:', error);
// }
// return {
// data,
// isLoading: !data && !error,
// error,
// };
// };

const HTSDashboard: React.FC = () => {
const { t } = useTranslation();
// const {data, isLoading, error} = useHTSData();
// if (isLoading) {
// return <div>Loading...</div>;
// }
// if (error) {
// return <div>Error: {error.message}</div>;
// }

return (
<React.Fragment>
Expand All @@ -29,3 +64,13 @@ const HTSDashboard: React.FC = () => {
};

export default HTSDashboard;

{
/* <HTSSummaryTile headerTitle={t('totalScreened', 'Total Screened')} value={data.totalScreened}/>
<HTSSummaryTile headerTitle={t('totalEligible', 'Total Eligible')} value={data.totalEligible}/>
<HTSSummaryTile headerTitle={t('totalTested', 'Total Tested')} value={data.totalTested}/>
<HTSSummaryTile headerTitle={t('totalPositive', 'Total Positive')} value={data.totalPositive}/>
<HTSSummaryTile headerTitle={t('totalNegative', 'Total Negative')} value={data.totalNegative}/>
<HTSSummaryTile headerTitle={t('totalInvalid', 'Total Invalid')} value={data.totalInvalid}/>
<HTSSummaryTileOverallUptake headerTitle={t('overallUptake', 'Overall Uptake')} value={data.overallUptake}/> */
}
10 changes: 2 additions & 8 deletions packages/esm-hts-app/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { defineConfigSchema, getSyncLifecycle } from '@openmrs/esm-framework';
import { configSchema } from './config-schema';
import Root from './root.component';
import {
htsPatientClinicalChartMeta,
htsPatientSummaryMeta,
htsProgramManagementDashboardMeta,
} from './dashboard.meta';
import { createDashboardGroup, createDashboardLink } from '@openmrs/esm-patient-common-lib';
import { htsPatientSummaryMeta, htsProgramManagementDashboardMeta } from './dashboard.meta';
import { createDashboardLink } from '@openmrs/esm-patient-common-lib';
import HTSHomePatientTabs from './views/dashboard/patient-list-tabs/hts-patient-list-tabs.component';
import { createLeftPanelLink } from './left-panel-link.component';
import HTSSummaryTiles from './views/dashboard/summary-tiles/hts-summary-tiles.component';
Expand All @@ -28,8 +24,6 @@ export function startupApp() {
defineConfigSchema(moduleName, configSchema);
}

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

export const htsLeftPanelLink = getSyncLifecycle(
createLeftPanelLink({
name: 'hts',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Tile } from '@carbon/react';
import styles from './hts-summary-tile.scss';
interface SummaryTileProps {
headerTitle: string;
// value: any;
}

const HTSSummaryTileOverallUptake: React.FC<SummaryTileProps> = ({ headerTitle }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Tile } from '@carbon/react';
import styles from './hts-summary-tile.scss';
interface SummaryTileProps {
headerTitle: string;
// value: any;
}

const HTSSummaryTile: React.FC<SummaryTileProps> = ({ headerTitle }) => {
Expand Down
Loading

0 comments on commit 599ca5f

Please sign in to comment.