ehr_patient_query_algorithm
Generic EHR query algorithm for patient data access.
This module implements a generic algorithm for querying patient data from EHR systems. It provides functionality to:
- Work with NextGen's FHIR, Enterprise, and SMART on FHIR APIs
- Work with generic FHIR R4 compatible systems
Classes
EHRPatientQueryAlgorithm
class EHRPatientQueryAlgorithm(datastructure: DataStructure, **kwargs: Any):Algorithm for querying patient data from EHR systems.
Initialize the algorithm.
Arguments
datastructure: The data structure definition**kwargs: Additional keyword arguments.
Variables
- static
fields_dict : ClassVar[dict[str, marshmallow.fields.Field]]
Methods
modeller
def modeller( self, *, context: ProtocolContext, **kwargs: Any,) ‑> bitfount.federated.algorithms.ehr.ehr_patient_query_algorithm._ModellerSide:Inherited from:
BaseNonModelAlgorithmFactory.modeller :
Modeller-side of the algorithm.
worker
def worker( self, *, hub: BitfountHub | None = None, session: BitfountSession | None = None, context: ProtocolContext, **kwargs: Any,) ‑> bitfount.federated.algorithms.ehr.ehr_patient_query_algorithm._WorkerSide:Inherited from:
BaseNonModelAlgorithmFactory.worker :
Worker-side of the algorithm.
PatientQueryResults
class PatientQueryResults( codes: PatientCodeDetails, next_appointment: date | None, previous_appointments: list[EHRAppointmentEncounter] | None, id: str | None, given_name: str | None, family_name: str | None, date_of_birth: str | date | None, gender: str | None, home_numbers: list[str], cell_numbers: list[str], emails: list[str], mailing_address: str | None, medical_record_number: list[str] | None, postal_code: str | None, country: str | None, latest_practitioner_name: str | None, previous_encounters: list[EHRAppointmentEncounter] | None = None, visual_acuity: Observation | None = None,):Container indicating the results of the various queries for a given patient.
Variables
- static
cell_numbers : list[str]
- static
codes : PatientCodeDetails
- static
country : str | None
- static
date_of_birth : str | datetime.date | None
- static
emails : list[str]
- static
family_name : str | None
- static
gender : str | None
- static
given_name : str | None
- static
home_numbers : list[str]
- static
id : str | None
- static
latest_practitioner_name : str | None
- static
mailing_address : str | None
- static
medical_record_number : list[str] | None
- static
next_appointment : datetime.date | None
- static
postal_code : str | None
- static
previous_appointments : list[EHRAppointmentEncounter] | None
- static
previous_encounters : list[EHRAppointmentEncounter] | None
- static
visual_acuity : Observation | None
Methods
to_row
def to_row(self) ‑> dict[str, typing.Any]:Render these results as a flat row keyed by the canonical EHR columns.
Column names are the ophthalmology pipeline's canonical EHR vocabulary
(see ophth_algo_types); merge/build helpers in this module use the
same set.