Skip to main content

enrichment

Rebuild the supplied-observations frame from a patient_enrichment cache.

The patient_enrichment step runs in the background, so criteria matching receives its .cache accessor rather than in-memory rows. This turns those rows into the patient-grain frame the patient_data channel merges: one row per patient, carrying that patient's supplied observation entries.

Module

Functions

supplied_observations_from_cache

def supplied_observations_from_cache(accessor: Any)> pandas.core.frame.DataFrame:

Build the patient-grain supplied-observations frame.

The patient id is emitted under EHR_BITFOUNT_PATIENT_ID_COL so the existing patient_data merge renames and joins it unchanged.

Arguments

  • accessor: A CacheAccessor for the patient_enrichment partition.

Returns A frame with one row per patient: the bitfount patient id and that patient's list of observation entries. Empty (with both columns present) when the partition holds no rows.