ehr_dataset
Progress events for a preprocessing pass over an EHR dataset.
An EHR dataset's preprocessing pass is the listing of its EHR's patients into a snapshot. A listing is per EHR rather than per dataset, so the pod relays each of its events once for every dataset that reads that EHR.
Classes
EhrDatasetEventReporter
class EhrDatasetEventReporter( sender: ProgressEventSender | None, *, dataset_id: str, dataset_owner_id: str, preprocessing_id: str,):Reports the progress of one preprocessing pass over an EHR dataset.
Arguments
sender: Delivers the events. None makes the reporter a no-op.dataset_id: The dataset being preprocessed.dataset_owner_id: The username of the dataset's owner, which must be the user the sender authenticates as.preprocessing_id: The UUIDv7 identifying this preprocessing pass, fromuuid6.uuid7().
Ancestors
Variables
next_sequence_number : int- The sequence number the next event will carry.
-
sender : ProgressEventSender | None- The sender this reporter hands its events to, if any.Read-only: a caller composing a second reporter for the same run shares this one rather than holding the sender separately.
Methods
error
def error(self, reason: LiteralString, exc: BaseException | None = None) ‑> None:Report that the preprocessing pass failed.
Arguments
reason: A fixed description of what failed. Must be a string literal, so no data can reach it.exc: The exception behind the failure. Only its class name is sent.
patient_listing_completed
def patient_listing_completed(self, patients_listed_count: int) ‑> None:Report that the patient listing step has completed.
Arguments
patients_listed_count: The distinct patients the listing stored. Zero is a valid listing of an empty EHR.
patient_listing_started
def patient_listing_started(self) ‑> None:Report that the patient listing step has started.
preprocessing_started
def preprocessing_started( self, trigger: DatasetPreprocessingStartTrigger.ValueType,) ‑> None:Report that the preprocessing pass has started.
Arguments
trigger: What started the pass.