Skip to content

Commit 460a832

Browse files
Merge from main repo: Release Version 5.0.14 (#8360)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 649541d commit 460a832

16 files changed

+1252
-232
lines changed

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "medplum-provider",
3-
"version": "5.0.13",
3+
"version": "5.0.14",
44
"private": true,
55
"type": "module",
66
"scripts": {
@@ -22,31 +22,31 @@
2222
"@mantine/hooks": "8.3.13",
2323
"@mantine/notifications": "8.3.13",
2424
"@mantine/spotlight": "8.3.13",
25-
"@medplum/core": "5.0.13",
26-
"@medplum/dosespot-react": "5.0.13",
27-
"@medplum/eslint-config": "5.0.13",
28-
"@medplum/fhirtypes": "5.0.13",
29-
"@medplum/health-gorilla-core": "5.0.13",
30-
"@medplum/health-gorilla-react": "5.0.13",
31-
"@medplum/react": "5.0.13",
25+
"@medplum/core": "5.0.14",
26+
"@medplum/dosespot-react": "5.0.14",
27+
"@medplum/eslint-config": "5.0.14",
28+
"@medplum/fhirtypes": "5.0.14",
29+
"@medplum/health-gorilla-core": "5.0.14",
30+
"@medplum/health-gorilla-react": "5.0.14",
31+
"@medplum/react": "5.0.14",
3232
"@tabler/icons-react": "3.36.1",
3333
"@testing-library/dom": "10.4.1",
3434
"@testing-library/jest-dom": "6.9.1",
3535
"@testing-library/react": "16.3.2",
3636
"@testing-library/user-event": "14.6.1",
3737
"@types/node": "22.19.7",
38-
"@types/react": "19.2.9",
38+
"@types/react": "19.2.10",
3939
"@types/react-big-calendar": "1.16.3",
4040
"@types/react-dom": "19.2.3",
4141
"@vitejs/plugin-react": "5.1.2",
4242
"dayjs": "1.11.19",
4343
"jsdom": "27.4.0",
4444
"postcss": "8.5.6",
4545
"postcss-preset-mantine": "1.18.0",
46-
"react": "19.2.3",
46+
"react": "19.2.4",
4747
"react-big-calendar": "1.19.4",
48-
"react-dom": "19.2.3",
49-
"react-router": "7.12.0",
48+
"react-dom": "19.2.4",
49+
"react-router": "7.13.0",
5050
"typescript": "5.9.3",
5151
"uuid": "11.1.0",
5252
"vite": "7.3.1",

src/components/Calendar.test.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ describe('Calendar', () => {
204204
expect(screen.getByText(/John Doe/)).toBeInTheDocument();
205205
});
206206

207+
test('renders appointments without a patient', async () => {
208+
const appointment = { ...createAppointment(), participant: [] };
209+
setup({ appointments: [appointment] });
210+
expect(screen.getByText(/No Patient/)).toBeInTheDocument();
211+
});
212+
207213
test('filters out cancelled appointments', async () => {
208214
const cancelledAppointment = createAppointment({
209215
id: 'cancelled-1',
@@ -291,6 +297,22 @@ describe('Calendar', () => {
291297
expect(screen.getByText('Available')).toBeInTheDocument();
292298
});
293299

300+
test('clicking on a $find slots', async () => {
301+
const onSelectAppointment = vi.fn();
302+
const onSelectInterval = vi.fn();
303+
const onSelectSlot = vi.fn();
304+
const slot = createSlot({
305+
identifier: [{ system: 'https://medplum.com/fhir/scheduling-transient-id', value: 'abcde', use: 'temp' }],
306+
});
307+
setup({ onSelectAppointment, onSelectInterval, onSelectSlot, slots: [slot] });
308+
309+
expect(screen.getByText('Available')).toBeInTheDocument();
310+
await userEvent.click(screen.getByText('Available'));
311+
expect(onSelectSlot).toHaveBeenCalledWith(slot);
312+
expect(onSelectAppointment).not.toHaveBeenCalled();
313+
expect(onSelectInterval).not.toHaveBeenCalled();
314+
});
315+
294316
test('renders multiple slots', async () => {
295317
const slot1 = createSlot({ id: 'slot-1', status: 'free' });
296318
const slot2 = createSlot({

src/components/Calendar.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import utc from 'dayjs/plugin/utc';
1212
import { IconChevronLeft, IconChevronRight } from '@tabler/icons-react';
1313
import 'react-big-calendar/lib/css/react-big-calendar.css';
1414
import type { Range } from '../types/scheduling';
15+
import { SchedulingTransientIdentifier } from '../utils/scheduling';
1516

1617
dayjs.extend(utc);
1718
dayjs.extend(timezone);
@@ -76,10 +77,12 @@ function appointmentsToEvents(appointments: Appointment[]): AppointmentEvent[] {
7677
? ` (${appointment.status})`
7778
: '';
7879

80+
const name = patientParticipant ? patientParticipant.actor?.display : 'No Patient';
81+
7982
return {
8083
type: 'appointment',
8184
appointment,
82-
title: `${patientParticipant?.actor?.display} ${status}`,
85+
title: `${name} ${status}`,
8386
start: new Date(appointment.start as string),
8487
end: new Date(appointment.end as string),
8588
resource: appointment,
@@ -178,15 +181,22 @@ export function Calendar(props: {
178181
[onSelectAppointment, onSelectSlot]
179182
);
180183

184+
const events = [
185+
...appointmentsToEvents(props.appointments),
186+
...slotsToEvents(props.slots.filter((slot) => SchedulingTransientIdentifier.get(slot))),
187+
];
188+
189+
const backgroundEvents = slotsToEvents(props.slots.filter((slot) => !SchedulingTransientIdentifier.get(slot)));
190+
181191
return (
182192
<ReactBigCalendar
183193
components={{ toolbar: CalendarToolbar }}
184194
view={view}
185195
date={date}
186196
localizer={dayjsLocalizer(dayjs)}
187-
events={appointmentsToEvents(props.appointments)}
197+
events={events}
188198
// Background events don't show in the month view
189-
backgroundEvents={slotsToEvents(props.slots)}
199+
backgroundEvents={backgroundEvents}
190200
onNavigate={(newDate: Date, newView: View) => {
191201
setDate(newDate);
192202
setView(newView);

src/components/encounter/BillingTab.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import type {
1313
Coverage,
1414
Encounter,
1515
EncounterDiagnosis,
16+
Media,
1617
Patient,
1718
Practitioner,
1819
} from '@medplum/fhirtypes';
@@ -109,7 +110,7 @@ export const BillingTab = (props: BillingTabProps): JSX.Element => {
109110
diagnosis: diagnosisArray,
110111
};
111112

112-
const response = await medplum.post(medplum.fhirUrl('Claim', '$export'), {
113+
const response = await medplum.post<Media>(medplum.fhirUrl('Claim', '$export'), {
113114
resourceType: 'Parameters',
114115
parameter: [{ name: 'resource', resource: claimToExport }],
115116
});

0 commit comments

Comments
 (0)