practitioner
The patient's associated practitioner, from FHIR R4 resources.
Classes
PractitionerReader
class PractitionerReader():Finds the patient's associated practitioner.
Prefers Patient.generalPractitioner, then falls back to the previous
appointments and encounters it reads as an AppointmentsReader.
Ancestors
Subclasses
Methods
get_next_appointment
def get_next_appointment(self) ‑> datetime.date | None:Inherited from:
AppointmentsReader.get_next_appointment :
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_patient_associated_medical_practitioner
def get_patient_associated_medical_practitioner(self) ‑> str | None:Retrieve an associated medical practitioner for the patient.
This prefers a practitioner referenced on the Patient resource via
generalPractitioner. If none is available there, it falls back to
the practitioner on the latest appointment or encounter.
Returns The practitioner's name, or None if no associated practitioner can be resolved.
Raises
FHIRR4GetPatientInfoError: If unable to retrieve patient encounter information.
get_previous_appointment_details
def get_previous_appointment_details( self, include_maybe_attended: bool = True,) ‑> list[EHRAppointmentEncounter]:Inherited from:
AppointmentsReader.get_previous_appointment_details :
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]:Inherited from:
AppointmentsReader.get_previous_encounter_details :
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.