Skip to content

Commit

Permalink
(feat) O3-3157: Appointments App should open patient chart visit form (
Browse files Browse the repository at this point in the history
…#1128)

O3-3147: Appointments: Checking in a Patient should change appointment status to checked in
  • Loading branch information
mogoodrich authored May 8, 2024
1 parent 110aa7b commit b402b04
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 734 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const AppointmentsActions: React.FC<AppointmentsActionsProps> = ({ appointment }
(visit) => visit?.patient?.uuid === patientUuid && visit?.startDatetime && !visit?.stopDatetime,
);
const isTodaysAppointment = visitDate.isToday();
const isCheckedIn = appointment.status === AppointmentStatus.CHECKEDIN;
const isCompleted = appointment.status === AppointmentStatus.COMPLETED;
const isCancelled = appointment.status === AppointmentStatus.CANCELLED;

Expand Down Expand Up @@ -61,7 +62,7 @@ const AppointmentsActions: React.FC<AppointmentsActionsProps> = ({ appointment }
{t('checkedOut', 'Checked out')}
</Button>
);
case checkOutButton.enabled && hasActiveVisitToday && isTodaysAppointment:
case checkOutButton.enabled && isCheckedIn:
return (
<Button onClick={handleCheckout} kind="danger--tertiary" size="sm">
{t('checkOut', 'Check out')}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import React from 'react';
import { Button } from '@carbon/react';
import { useTranslation } from 'react-i18next';
import { launchOverlay } from '../../hooks/useOverlay';
import VisitForm from '../../patient-queue/visit-form/visit-form.component';
import { type Appointment } from '../../types';
import dayjs from 'dayjs';
import isToday from 'dayjs/plugin/isToday';
import utc from 'dayjs/plugin/utc';
import { navigate, useConfig } from '@openmrs/esm-framework';
import { navigate, useConfig, launchWorkspace } from '@openmrs/esm-framework';
import { type ConfigObject } from '../../config-schema';
dayjs.extend(utc);
dayjs.extend(isToday);
Expand All @@ -33,10 +31,7 @@ const CheckInButton: React.FC<CheckInButtonProps> = ({ appointment, patientUuid
to: checkInButton.customUrl,
templateParams: { patientUuid: appointment.patient.uuid, appointmentUuid: appointment.uuid },
})
: launchOverlay(
t('patientSearch', 'Patient search'),
<VisitForm patientUuid={patientUuid} appointment={appointment} />,
)
: launchWorkspace('start-visit-workspace-form', { patientUuid: patientUuid })
}>
{t('checkIn', 'Check in')}
</Button>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit b402b04

Please sign in to comment.