Skip to main content

v1

ehr_data record, v1 — canonical aliases.

Consumers and the record registry import from here and never touch the inner module names, mirroring steps/*/v1/__init__.py.

Module

Submodules

Classes

ORM

class ORM(**kwargs):

SQLAlchemy model for the ehr_data cache table.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships.

Variables

  • bitfount_patient_id : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • cell_numbers : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • condition_codes_json : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • country : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • date_of_birth : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • ehr_patient_id : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • emails : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • error : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • family_name : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • file_ids_json : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • gender : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • given_name : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • home_numbers : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • last_accessed_at : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • mailing_address : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • medical_record_number : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • patient_id : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • patient_metadata_json : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • postal_code : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • procedure_codes_json : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • processed_at : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • row_number : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • run_id : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • tags : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • task_hash : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]

Record

class Record(**data: Any):

Stored EHR data record for a single patient.

The background flow extracts patient demographic and code data from the EHR datasource and stores it here. The interactive flow applies code filters against the stored diagnosis_codes, condition_codes, and procedure_codes lists to determine EHR eligibility.

file_ids_json holds all imaging file IDs associated with this patient in the batch. Multiple files for the same patient are accumulated into the list before the row is written, so no file ID is ever silently overwritten. It is None for EHR-only tasks that have no associated imaging files.

error is non-None when EHR extraction failed for this patient.

run_id is the UUID of the run that produced this record (for provenance).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static bitfount_patient_id : str
  • static cell_numbers : list[str]
  • static condition_codes_json : list[dict[str, str | None | datetime.datetime | dict[str, str]]] | None
  • static country : str | None
  • static ehr_patient_id : str
  • static emails : list[str]
  • static error : str | None
  • static family_name : str | None
  • static file_ids_json : list[str] | None
  • static gender : str | None
  • static given_name : str | None
  • static home_numbers : list[str]
  • static mailing_address : str | None
  • static medical_record_number : list[str] | None
  • static model_config
  • static patient_id : str | None
  • static patient_metadata_json : dict[str, typing.Any] | None
  • static postal_code : str | None
  • static procedure_codes_json : list[dict[str, str | None | datetime.datetime | dict[str, str]]] | None
  • static row_number : int | None
  • static run_id : str | None
  • static task_hash : str