Skip to content

Commit

Permalink
(fix) appointment list does not handle location properly (#1021)
Browse files Browse the repository at this point in the history
* Fix to appointment location interface to correctly represent rest response data

* Gracefully handle missing appointment locations
  • Loading branch information
mseaton authored Mar 10, 2024
1 parent d277bf4 commit 38a56ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ const AppointmentsBaseTable = () => {
sortKey: appointment.patient.identifier,
},
location: {
content: <span className={styles.statusContainer}>{appointment.location.display}</span>,
sortKey: appointment.location,
content: <span className={styles.statusContainer}>{appointment.location?.name}</span>,
sortKey: appointment.location?.name,
},
service: {
content: <span className={styles.serviceContainer}>{appointment.service.name}</span>,
Expand Down
7 changes: 6 additions & 1 deletion packages/esm-appointments-app/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ export enum SearchTypes {
SCHEDULED_VISITS = 'scheduled-visits',
}

export interface AppointmentLocation {
uuid: string;
name: string;
}

export interface Appointment {
appointmentKind: string;
appointmentNumber: string;
comments: string;
endDateTime: Date | number | any;
location: OpenmrsResource;
location: AppointmentLocation;
patient: {
identifier: string;
identifiers: Array<Identifier>;
Expand Down

0 comments on commit 38a56ac

Please sign in to comment.