Skip to main content

schema

SQLAlchemy ORM for the scan_eligibility cache table (v1).

One row per (scan, trial), keyed by task_hash so a criteria/config change lands in a fresh partition and reads never mix task hashes. evidence_json holds every criterion for the scan (imaging criteria evaluated, patient-level criteria of scan provenance (e.g. DICOM age). file_path is the original scan-file path, captured so a later file-serving endpoint can return the file. Declares its own local Base (isolated MetaData) carrying the shared nullable tags JSON column.

The PHI-bearing columns (evidence_json — clinical values; study_date — a date is a HIPAA identifier; file_path — leaks name/MRN) are stored plaintext. They use the Migrating* decorators, so a legacy enc:v1: value written while encryption was enabled still decrypts on read and converges to plaintext on rewrite.

Classes

Base

class Base(**kwargs: Any):

Local declarative base for scan_eligibility v1.

Owns an isolated MetaData and carries the shared nullable tags JSON column that every ORM in this version inherits.

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.

Subclasses

Variables

  • static metadata
  • static registry
  • static tags : sqlalchemy.orm.base.Mapped[dict[str, typing.Any] | None]

ScanEligibility

class ScanEligibility(**kwargs):

SQLAlchemy model for the scan_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]
  • evidence_json : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • file_path : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • file_path_digest : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • laterality : 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]
  • scan_id : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • status : Union[sqlalchemy.orm.attributes.InstrumentedAttribute[+_T_co], +_T_co]
  • study_date : 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]