Skip to content

Commit

Permalink
Merge branch 'main' into O3-4065
Browse files Browse the repository at this point in the history
  • Loading branch information
ynurmahomed authored Oct 16, 2024
2 parents 16b36c3 + d5c2f3e commit 287a237
Show file tree
Hide file tree
Showing 81 changed files with 1,571 additions and 1,236 deletions.
26 changes: 11 additions & 15 deletions packages/esm-appointments-app/src/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
"backendDependencies": {
"webservices.rest": "^2.2.0"
},
"modals": [
{
"name": "end-appointment-modal",
"component": "endAppointmentModal"
}
],
"extensions": [
{
"name": "home-appointments",
Expand Down Expand Up @@ -36,11 +30,7 @@
"slot": "calendar-dashboard-slot",
"component": "appointmentsCalendarDashboardLink"
},
{
"name": "check-in-appointment-modal",
"slot": "todays-appointment-slot",
"component": "checkInModal"
},

{
"name": "todays-appointments-dashboard",
"slot": "todays-appointment-slot",
Expand Down Expand Up @@ -111,10 +101,6 @@
"component": "patientUpcomingAppointmentsWidget",
"slot": "upcoming-appointment-slot"
},
{
"name": "patient-appointment-cancel-confirmation-dialog",
"component": "patientAppointmentsCancelConfirmationDialog"
},
{
"name": "edit-appointments-form",
"component": "appointmentsForm",
Expand Down Expand Up @@ -154,5 +140,15 @@
"slot": "home-metrics-tiles-slot",
"component": "homeAppointmentsTile"
}
],
"modals": [
{
"name": "end-appointment-modal",
"component": "endAppointmentModal"
},
{
"name": "patient-appointment-cancel-confirmation-dialog",
"component": "patientAppointmentsCancelConfirmationDialog"
}
]
}
61 changes: 32 additions & 29 deletions packages/esm-service-queues-app/src/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@
"name": "service-queues-dashboard",
"slot": "service-queues-dashboard-slot"
},
{
"name": "edit-queue-entry-status-modal",
"component": "editQueueEntryStatusModal"
},
{
"name": "patient-info-banner-slot",
"component": "patientInfoBannerSlot"
Expand All @@ -57,55 +53,62 @@
"component": "clearAllQueueEntries"
},
{
"name": "add-visit-to-queue-modal",
"component": "addVisitToQueueModal"
"name": "previous-visit-summary-widget",
"component": "pastVisitSummary",
"slot": "previous-visit-summary-slot"
},

{
"name": "transition-queue-entry-status-modal",
"component": "transitionQueueEntryStatusModal"
"name": "active-visits-row-actions",
"component": "activeVisitsRowActions",
"slot": "queue-table-serve-patient-slot"
},
{
"name": "previous-visit-summary-widget",
"component": "pastVisitSummary",
"slot": "previous-visit-summary-slot"
"name": "visit-form-queue-fields",
"component": "visitFormQueueFields",
"slot":"visit-form-queue-slot"
}
],
"modals": [
{
"name": "add-visit-to-queue-modal",
"component": "addVisitToQueueModal"
},
{
"name": "add-provider-to-room-modal",
"component": "addProviderToRoomModal"
},
{
"name": "transition-queue-entry-modal",
"component": "transitionQueueEntryModal"
"name": "edit-queue-entry-modal",
"component": "editQueueEntryModal"
},
{
"name": "transition-patient-to-latest-queue-modal",
"component": "transitionPatientToLatestQueue"
"name": "edit-queue-entry-status-modal",
"component": "editQueueEntryStatusModal"
},
{
"name": "edit-queue-entry-modal",
"component": "editQueueEntryModal"
"name": "end-queue-entry-modal",
"component": "endQueueEntryModal"
},
{
"name": "undo-transition-queue-entry-modal",
"component": "undoTransitionQueueEntryModal"
"name": "transition-patient-to-latest-queue-modal",
"component": "transitionPatientToLatestQueue"
},
{
"name": "void-queue-entry-modal",
"component": "voidQueueEntryModal"
"name": "transition-queue-entry-modal",
"component": "transitionQueueEntryModal"
},
{
"name": "end-queue-entry-modal",
"component": "endQueueEntryModal"
"name": "transition-queue-entry-status-modal",
"component": "transitionQueueEntryStatusModal"
},
{
"name": "active-visits-row-actions",
"component": "activeVisitsRowActions",
"slot": "queue-table-serve-patient-slot"
"name": "undo-transition-queue-entry-modal",
"component": "undoTransitionQueueEntryModal"
},
{
"name": "visit-form-queue-fields",
"component": "visitFormQueueFields",
"slot":"visit-form-queue-slot"
"name": "void-queue-entry-modal",
"component": "voidQueueEntryModal"
}
],
"workspaces": [
Expand Down
8 changes: 8 additions & 0 deletions packages/esm-ward-app/mock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { useInpatientAdmission } from './src/hooks/useInpatientAdmission';
import { createAndGetWardPatientGrouping } from './src/ward-view/ward-view.resource';
import { useInpatientRequest } from './src/hooks/useInpatientRequest';
import { useWardPatientGrouping } from './src/hooks/useWardPatientGrouping';
import { type WardViewContext } from './src/types';
import DefaultWardPatientCardHeader from './src/ward-view/default-ward/default-ward-patient-card-header.component';

jest.mock('./src/hooks/useAdmissionLocation', () => ({
useAdmissionLocation: jest.fn(),
Expand Down Expand Up @@ -51,4 +53,10 @@ export const mockWardPatientGroupDetails = jest.mocked(useWardPatientGrouping).m
inpatientAdmissionResponse: mockInpatientAdmissionResponse(),
inpatientRequestResponse: mockInpatientRequestResponse(),
...createAndGetWardPatientGrouping(mockInpatientAdmissions, mockAdmissionLocation, mockInpatientRequest),
isLoading: false,
});

export const mockWardViewContext: WardViewContext = {
wardPatientGroupDetails: mockWardPatientGroupDetails(),
WardPatientHeader: DefaultWardPatientCardHeader,
};
6 changes: 3 additions & 3 deletions packages/esm-ward-app/src/beds/empty-bed-skeleton.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { SkeletonIcon } from '@carbon/react';
import React from 'react';
import styles from './empty-bed.scss';
import WardPatientSkeletonText from '../ward-patient-card/row-elements/ward-pateint-skeleton-text';
import styles from './ward-bed.scss';
import WardPatientSkeletonText from '../ward-patient-card/row-elements/ward-patient-skeleton-text';

const EmptyBedSkeleton = () => {
return (
<div className={styles.container + ' ' + styles.skeleton}>
<div className={styles.emptyBed + ' ' + styles.skeleton}>
<SkeletonIcon />
<WardPatientSkeletonText />
</div>
Expand Down
6 changes: 3 additions & 3 deletions packages/esm-ward-app/src/beds/empty-bed.component.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import styles from './empty-bed.scss';
import styles from './ward-bed.scss';
import wardPatientCardStyles from '../ward-patient-card/ward-patient-card.scss';
import { type Bed } from '../types';
import { useTranslation } from 'react-i18next';
Expand All @@ -12,11 +12,11 @@ const EmptyBed: React.FC<EmptyBedProps> = ({ bed }) => {
const { t } = useTranslation();

return (
<div className={styles.container}>
<div className={styles.emptyBed}>
<span className={`${wardPatientCardStyles.wardPatientBedNumber} ${wardPatientCardStyles.empty}`}>
{bed.bedNumber}
</span>
<p className={styles.emptyBed}>{t('emptyBed', 'Empty bed')}</p>
<p className={styles.emptyBedText}>{t('emptyBed', 'Empty bed')}</p>
</div>
);
};
Expand Down
24 changes: 0 additions & 24 deletions packages/esm-ward-app/src/beds/empty-bed.scss

This file was deleted.

35 changes: 0 additions & 35 deletions packages/esm-ward-app/src/beds/occupied-bed.component.tsx

This file was deleted.

24 changes: 0 additions & 24 deletions packages/esm-ward-app/src/beds/occupied-bed.scss

This file was deleted.

20 changes: 0 additions & 20 deletions packages/esm-ward-app/src/beds/unassigned-patient.component.tsx

This file was deleted.

6 changes: 0 additions & 6 deletions packages/esm-ward-app/src/beds/unassigned-patient.scss

This file was deleted.

41 changes: 41 additions & 0 deletions packages/esm-ward-app/src/beds/ward-bed.component.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React, { type ReactNode } from 'react';
import { type Bed } from '../types';
import EmptyBed from './empty-bed.component';
import styles from './ward-bed.scss';
import { useTranslation } from 'react-i18next';
import { Tag } from '@carbon/react';

export interface WardBedProps {
patientCards: Array<ReactNode>;
bed: Bed;
}

const WardBed: React.FC<WardBedProps> = ({ bed, patientCards }) => {
return patientCards?.length > 0 ? <OccupiedBed bed={bed} patientCards={patientCards} /> : <EmptyBed bed={bed} />;
};

const OccupiedBed: React.FC<WardBedProps> = ({ patientCards }) => {
// interlace patient card with bed dividers between each of them
const patientCardsWithDividers = patientCards.flatMap((patientCard, index) => {
if (index == 0) {
return [patientCard];
} else {
return [<BedShareDivider key={'divider-' + index} />, patientCard];
}
});

return <div className={styles.occupiedBed}>{patientCardsWithDividers}</div>;
};

const BedShareDivider = () => {
const { t } = useTranslation();
return (
<div className={styles.bedDivider}>
<div className={styles.bedDividerLine}></div>
<Tag>{t('bedShare', 'Bed share')}</Tag>
<div className={styles.bedDividerLine}></div>
</div>
);
};

export default WardBed;
Loading

0 comments on commit 287a237

Please sign in to comment.