Skip to main content

appointments

The patient's appointments and encounters, from FHIR R4 resources.

Classes​

AppointmentsReader​

class AppointmentsReader():

Reads the patient's next and previous appointments and encounters.

Methods​


get_next_appointment​

def get_next_appointment(self) ‑> datetime.date | None:

Get the next appointment date for the patient.

Falls back to encounters if appointments are not available or empty.

Returns The next appointment date for the patient from today, or None if they have no future appointment. Any cancelled or errored appointments are ignored.

Raises

  • FHIRR4GetPatientInfoError: If unable to retrieve patient information.

get_previous_appointment_details​

def get_previous_appointment_details(    self, include_maybe_attended: bool = True,) ‑> list[EHRAppointmentEncounter]:

Get list of previous appointments for the patient.

A cancelled, no-show or entered-in-error appointment is left out, and so is one only booked or proposed (waitlist, booked, pending, proposed) unless include_maybe_attended is true.

Returns A list of EHRAppointmentEncounter for the patient, sorted chronologically (oldest first), or an empty list if they have no previous appointments.

Raises

  • FHIRR4GetPatientInfoError: If unable to retrieve patient information.

get_previous_encounter_details​

def get_previous_encounter_details(    self, include_maybe_attended: bool = True,) ‑> list[EHRAppointmentEncounter]:

Get list of previous encounters for the patient.

A cancelled, on-leave or entered-in-error encounter is left out, and so is one not yet known to have happened (planned, in-progress, triaged, unknown) unless include_maybe_attended is true.

Returns A list of EHRAppointmentEncounter for the patient, sorted chronologically (oldest first), or an empty list if they have no previous appointments.

Raises

  • FHIRR4GetPatientInfoError: If unable to retrieve patient information.