Skip to main content

v2

patient_eligibility record, v2 — canonical aliases.

v2 adds the nullable eligibility_score column to v1 — see schema.py. Consumers and the record registry import from here and never touch the inner module names.

Module​

Submodules​

Functions​

downgrade​

def downgrade(op: Operations) ‑> None:

Migrate patient_eligibility v2 -> v1 (see the module docstring).

upgrade​

def upgrade(op: Operations) ‑> None:

Migrate patient_eligibility v1 -> v2 (see the module docstring).

Classes​

ORM​

class ORM(**kwargs):

SQLAlchemy model for the patient_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.

Variables​

  • bitfount_patient_id : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • created_date : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • determined_by_scan : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • eligibility_score : 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]
  • 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 rolled-up per-patient eligibility record (one per patient, trial).

Attributes

  • task_hash: Partition key (config-change isolation).
  • bitfount_patient_id: The Bitfount patient ID (part of the composite key).
  • project_id: The trial (project) ID (part of the composite key).
  • status: Rolled-up patient verdict.
  • evidence: Coherent rollup evidence (scan-level criteria all from the determining scan), shaped {"criteria": {criterion: entry}} where each entry is CriterionEvidence-shaped (see bitfount.cache.types._eligibility_shared).
  • determined_by_scan: The scan that determined the verdict, if any.
  • created_date: When the rollup was created.
  • processed_at: When this row was written.
  • run_id: Provenance — the run ID.
  • tags: Arbitrary flat metadata.
  • eligibility_score: The criteria_tree's resolved root score (see the v2 schema module docstring), or a status-derived fallback for a trial with no ranked branch; None only for a row written before this column existed. A ranking signal only, entirely separate from status.

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 determined_by_scan : str | None
  • static eligibility_score : float | None
  • static model_config
  • static project_id : str
  • static run_id : str | None
  • static status : bitfount.cache.types._eligibility_shared.EligibilityStatus
  • static task_hash : str