Skip to content

Commit 633205a

Browse files
committed
chore
1 parent f696623 commit 633205a

File tree

5 files changed

+65
-84
lines changed

5 files changed

+65
-84
lines changed

packages/esm-patient-queues-app/src/active-visits/print-action-menu.components.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { Printer } from '@carbon/react/icons';
44
import { useTranslation } from 'react-i18next';
55
import { useReactToPrint } from 'react-to-print';
66
import VisitCardToPrint from './active-visits-print/active-visits-print.component';
7-
import { MappedPatientQueueEntry } from './patient-queues.resource';
87
import { PatientQueue } from '../types/patient-queues';
98

109
interface PrintActionsMenuProps {
@@ -40,9 +39,7 @@ const PrintActionsMenu: React.FC<PrintActionsMenuProps> = ({ patient }) => {
4039

4140
return (
4241
<div>
43-
<div ref={contentToPrintRef}>
44-
{/* <VisitCardToPrint queueEntry={patient} /> */}
45-
</div>
42+
<div ref={contentToPrintRef}>{/* <VisitCardToPrint queueEntry={patient} /> */}</div>
4643
<Button
4744
kind="ghost"
4845
onClick={handlePrint}

packages/esm-patient-queues-app/src/components/patient-queue-metrics/metrics-header.component.tsx

Lines changed: 0 additions & 35 deletions
This file was deleted.

packages/esm-patient-queues-app/src/components/patient-queue-metrics/metrics-header.scss

Lines changed: 0 additions & 22 deletions
This file was deleted.

packages/esm-patient-queues-app/src/queue-clinical-room-home.component.tsx

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,42 @@
1-
import React from 'react';
1+
import React, { useState } from 'react';
22

33
import PatientQueueHeader from './components/patient-queue-header/patient-queue-header.component';
4-
import ActiveClinicalVisitsTabs from './active-visits/active-visits-clinical-tab.component';
4+
import { useTranslation } from 'react-i18next';
5+
import { QueueStatus } from './utils/utils';
6+
import ActiveClinicalVisitsTable from './active-visits/active-visits-patients-clinical/active-visits-clinical-table.component';
7+
import styles from './active-visits/active-visits-table.scss';
8+
import { Tabs, TabPanel, TabList, Tab, TabPanels } from '@carbon/react';
59

610
const ClinicalRoomHome: React.FC = () => {
11+
const { t } = useTranslation();
12+
const [selectedTab, setSelectedTab] = useState(0);
13+
14+
const getTabStatus = (selectedIndex) => {
15+
return selectedIndex === 0 ? '' : QueueStatus.Completed;
16+
};
717
return (
818
<div>
919
<PatientQueueHeader title="Clinical Room" />
10-
<ActiveClinicalVisitsTabs />
20+
<div className={styles.container}>
21+
<Tabs
22+
selectedIndex={selectedTab}
23+
onChange={({ selectedIndex }) => setSelectedTab(selectedIndex)}
24+
className={styles.tabs}
25+
>
26+
<TabList style={{ paddingLeft: '1rem' }} aria-label="clinical outpatient tabs" contained>
27+
<Tab style={{ width: '150px' }}>{t('pending', 'In Queue')}</Tab>
28+
<Tab style={{ width: '150px' }}>{t('completed', 'Completed')}</Tab>
29+
</TabList>
30+
<TabPanels>
31+
<TabPanel style={{ padding: 0 }}>
32+
<ActiveClinicalVisitsTable status={getTabStatus(selectedTab)} />
33+
</TabPanel>
34+
<TabPanel style={{ padding: 0 }}>
35+
<ActiveClinicalVisitsTable status={getTabStatus(selectedTab)} />
36+
</TabPanel>
37+
</TabPanels>
38+
</Tabs>
39+
</div>
1140
</div>
1241
);
1342
};

packages/esm-patient-queues-app/src/queue-triage-home.component.tsx

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,59 @@
1-
import React from 'react';
1+
import React, { useState } from 'react';
22

33
import PatientQueueHeader from './components/patient-queue-header/patient-queue-header.component';
44
import MetricsCard from './components/patient-queue-metrics/metrics-card.component';
55
import { useTranslation } from 'react-i18next';
66
import { useSession } from '@openmrs/esm-framework';
77
import styles from './components/patient-queue-metrics/clinic-metrics.scss';
88
import { useParentLocation } from './active-visits/patient-queues.resource';
9-
import { usePatientQueuesList } from './active-visits/active-visits-patients-reception/active-visits-reception.resource';
10-
import { usePatientsBeingServed, usePatientsServed } from './components/patient-queue-metrics/clinic-metrics.resource';
11-
import ActiveTriageVisitsTabs from './active-visits/active-visits-triage-tab.component';
9+
import { QueueStatus } from './utils/utils';
10+
import { Tabs, TabPanel, TabList, Tab, TabPanels } from '@carbon/react';
11+
import ActiveTriageVisitsTable from './active-visits/active-visits-patients-triage/active-visits-triage-table.component';
1212

1313
const TriageHome: React.FC = () => {
1414
const { t } = useTranslation();
1515

16-
const session = useSession();
16+
const [selectedTab, setSelectedTab] = useState(0);
1717

18-
const { location } = useParentLocation(session?.sessionLocation?.uuid);
19-
const { servedCount } = usePatientsServed(session?.sessionLocation?.uuid, 'picked');
20-
const { patientQueueCount: pendingCount } = usePatientQueuesList(location?.parentLocation?.uuid);
21-
const { patientQueueCount } = usePatientsBeingServed(
22-
session?.sessionLocation?.uuid,
23-
'pending',
24-
session?.user?.person?.display,
25-
);
18+
const getTabStatus = (selectedIndex) => {
19+
return selectedIndex === 0 ? '' : QueueStatus.Completed;
20+
};
2621

2722
return (
2823
<div>
2924
<PatientQueueHeader title="Triage" />
3025
<div className={styles.cardContainer}>
26+
<MetricsCard values={[{ label: 'In Queue', value: 0 }]} headerLabel={t('inQueueTriage', 'Patients Waiting')} />
3127
<MetricsCard
32-
values={[{ label: 'In Queue', value: pendingCount }]}
33-
headerLabel={t('inQueueTriage', 'Patients Waiting')}
34-
/>
35-
<MetricsCard
36-
values={[{ label: t('byTriage', 'By you'), value: patientQueueCount }]}
28+
values={[{ label: t('byTriage', 'By you'), value: 0 }]}
3729
headerLabel={t('pendingTriageServing', 'Patients waiting to be Served')}
3830
/>
3931
<MetricsCard
40-
values={[{ label: 'Patients Served', value: servedCount }]}
32+
values={[{ label: 'Patients Served', value: 0 }]}
4133
headerLabel={t('noOfPatientsServed', 'No. of Patients Served')}
4234
/>
4335
</div>
44-
<ActiveTriageVisitsTabs />
36+
37+
<div className={styles.container}>
38+
<Tabs
39+
selectedIndex={selectedTab}
40+
onChange={({ selectedIndex }) => setSelectedTab(selectedIndex)}
41+
className={styles.tabs}
42+
>
43+
<TabList style={{ paddingLeft: '1rem' }} aria-label="triage outpatient tabs" contained>
44+
<Tab style={{ width: '150px' }}>{t('pending', 'In Queue')}</Tab>
45+
<Tab style={{ width: '150px' }}>{t('completed', 'Completed')}</Tab>
46+
</TabList>
47+
<TabPanels>
48+
<TabPanel style={{ padding: 0 }}>
49+
<ActiveTriageVisitsTable status={getTabStatus(selectedTab)} />
50+
</TabPanel>
51+
<TabPanel style={{ padding: 0 }}>
52+
<ActiveTriageVisitsTable status={getTabStatus(selectedTab)} />
53+
</TabPanel>
54+
</TabPanels>
55+
</Tabs>
56+
</div>
4557
</div>
4658
);
4759
};

0 commit comments

Comments
 (0)