medications
The patient's medications, from the four FHIR R4 medication resource types.
Classes
MedicationsReader
class MedicationsReader():Reads the patient's medications across the four medication resource types.
Subclasses
Methods
get_patient_medications
def get_patient_medications(self) ‑> list[Medication]:Get medication-related information for this patient.
This method queries MedicationRequest, MedicationStatement,
MedicationDispense, and MedicationAdministration in sequence.
This matches every other resource type this querier fetches. A
server may support only some of these four resource types. If so,
that server still gives us whatever it has. The whole call does
not fail just because one of the four resource types is absent.
A resource whose status is entered-in-error is left out.
Returns A list of Medication objects for the patient, sorted by date.
Raises
FHIRR4MedicationsUnsupportedError: Every resource type came backUNSUPPORTED. None processed, and none errored. This exception is aFHIRR4GetPatientInfoErrorsubclass. It is the only case that means "this server structurally does not support medications".FHIRR4GetPatientInfoError: At least one resource type genuinely failed (a network error or a deserialisation error), and none processed successfully. This result is too uncertain to report as the more specific "unsupported" signal above.