v3
patient_level_eligibility record, v3 — canonical aliases.
v3 adds the nullable score column to v2 — see schema.py. Consumers and
the record registry import from here and never touch the inner module names.
Module
Submodules
- bitfount.cache.types.patient_level_eligibility.v3.migrations - Autogenerated migration for
patient_level_eligibilityv2 -> v3. - bitfount.cache.types.patient_level_eligibility.v3.model - Pydantic record for the
patient_level_eligibilitycache table (v3). - bitfount.cache.types.patient_level_eligibility.v3.schema - SQLAlchemy ORM for the
patient_level_eligibilitycache table (v3). - bitfount.cache.types.patient_level_eligibility.v3.store - Store for the
patient_level_eligibilitytable (v3).
Functions
downgrade
def downgrade(op: Operations) ‑> None:Migrate patient_level_eligibility v3 -> v2 (see the module docstring).
upgrade
def upgrade(op: Operations) ‑> None:Migrate patient_level_eligibility v2 -> v3 (see the module docstring).
Classes
ORM
class ORM(**kwargs):SQLAlchemy model for the patient_level_eligibility 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.
Ancestors
Variables
-
bitfount_patient_id : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
ehr_retrieved_at : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
evidence_json : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
processed_at : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
project_id : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
run_id : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
score : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
-
status : 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 per-patient EHR eligibility record (one per patient, trial).
Carries the shared eligibility-evidence fields (see
EligibilityEvidenceRecord) plus the columns this table adds. EHR
eligibility is patient-level, so it adds no scan-specific columns; its
per-criterion detail (matched codes and values) lives in evidence.
Attributes
ehr_retrieved_at: When the EHR data behind this verdict was retrieved — the servedehr_datarow's ownprocessed_at, carried through unchanged and never recomputed.Nonemeans not recorded: no EHR row for this patient, a stored row with no usableprocessed_at, or a row written before v2 added the column. Those are deliberately indistinguishable; see the schema docstring for why the value is copied here rather than read fromehr_data.score: This patient's own patient-levelcriteria_treeroot score, orNonewhen not recorded. A ranking signal only, entirely separate fromstatus.
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
ehr_retrieved_at : datetime.datetime | None
- static
model_config
- static
score : float | None