Skip to main content

patient_enrichment

Datadog telemetry for the patient_enrichment step.

Module​

Functions​

report_enrichment_source​

def report_enrichment_source(    *,    source: str,    outcome: str,    task_hash: str,    rows_stored: int = 0,    row_counts: Mapping[str, int] | None = None,    stored_rows: int | None = None,    stored_patients: int | None = None,    codes: Mapping[str, int] | None = None,    missing_columns: list[str] | None = None,    header_columns: int | None = None,) ‑> None:

Send a PatientEnrichmentSourceEvent for one source.

Warns when the source could not be read, or when every row that stated an identity failed to resolve one, since either leaves the source's criteria with nothing to read. Never raises.

Arguments

  • source: The source's configured name.
  • outcome: What this run did with the source's file.
  • task_hash: The step's partition.
  • rows_stored: Facts this run wrote.
  • row_counts: rows_with_identity and rows_unresolved_identity from the ingest, when the file was read this run.
  • stored_rows: Facts the source serves after this run.
  • stored_patients: Distinct patients those facts belong to.
  • codes: Facts per "<system>|<code>"; only the most frequent ENRICHMENT_CODES_LIMIT are sent.
  • missing_columns: The configured columns an unreadable file's header lacks. Configured names only, never the header's own.
  • header_columns: How many columns an unreadable file's header has.