Skip to main content

code_systems

Canonical code-system identifiers, shared across EHR backends.

Coding.system is compared by exact string equality wherever criteria are matched (see _build_code_matcher in bitfount.steps.criteria_matching.functions) — there is no normalisation step. A criterion pinned to a code_system therefore only matches entries whose querier emitted that same string, so every backend has to agree on one spelling per system or the same criterion silently fails against one of them.

These URIs are the agreed spelling. FHIR R4 servers emit them natively, so a FHIR-backed querier gets them for free by passing Coding.system through; a non-FHIR backend (NextGen Enterprise, whose JSON carries no system URI at all) maps its own fields onto them instead.

NextGenPatientQuerier.get_patient_conditions and get_patient_allergies both emit ICD_10_SYSTEM_IDENTIFIER (rather than the short form "icd10"), so a criterion pinned to a code_system matches the same condition or allergy from either NextGen or a FHIR R4 server.

Module​

Global variables​

  • CODE_SYSTEM_TO_IDENTIFIER : dict[str, str] - Short name to canonical URI, for callers that accept a short name.

    Used to build FHIR system|code search parameters, and to resolve a short-form code_system supplied in task config. Not applied to codings a querier emits — those carry the URI directly.

  • NDC_SYSTEM_IDENTIFIER : Final[str] - FDA National Drug Code.

    A code identifies one package of one product from one labeler, so a drug has many, and they churn: a product relisted under a new labeler gets new ones and the old codes leave the FDA directory (NextGen's FDB catalogue still carries some of those). Prefer RXNORM_SYSTEM_IDENTIFIER, whose concept for a given drug and strength is stable, and treat NDC as a last resort for an entry carrying nothing else.

    NextGen emits the 11-digit normalised form without hyphens (00378718505); the FDA directory publishes hyphenated segments (0378-7185-05). Codes are passed through as the source gives them — the original segmentation cannot be recovered from an 11-digit string — so a consumer comparing across the two forms must normalise first.