Getting HbA1c lab results from Epic
Get every hemoglobin A1c (HbA1c) result in the measurement period for the patients in a diabetes control measure’s initial population, with the result value and the date it was taken.
Prerequisites
Section titled “Prerequisites”- A backend app registered with Epic and activated by the health system, with read access to
PatientandObservation. - The list of patients in the measure’s initial population (from your encounter and diagnosis extraction).
- The HbA1c value set from the measure’s eCQM specification. Use the value set, not a single LOINC code: health systems code A1c tests in more than one way.
- For each patient, search
Observationwithpatientset to the patient’s FHIR id,codeset to the HbA1c codes (comma-separated), anddatecovering the measurement period. - Follow every
nextlink in the returnedBundleuntil there are none. - Keep only observations whose
codematches a code in the HbA1c value set. - Keep only observations with a final status (
final,amendedorcorrected). Droppreliminary,cancelledandentered-in-error. - For each kept observation record the numeric
valueQuantityand the date fromeffectiveDateTime(or the start ofeffectivePeriod). - Use the most recent result in the period for the measure logic.
Gotchas
Section titled “Gotchas”- A test with no result. An ordered test that was never resulted may still come back as an
Observationwith no value. Do not count it as a result. - Results recorded as text. Some results arrive as
valueString(“7.2%”, “>14”) instead ofvalueQuantity. Decide how you parse these and apply the rule consistently. - Results from outside labs. Results received from other organisations may carry different codes. Check them against the full value set before discarding anything.
How to verify
Section titled “How to verify”- Pick a handful of patients and compare your extracted results with what clinicians see in the chart for the same period.
- Compare the share of patients with at least one A1c result against the previous reporting period. A sharp drop usually means a paging or coding problem, not a change in care.