Skip to content

Getting HbA1c lab results from Epic

Contributed by OpenDQM maintainers · OpenDQMVerified Oct 2026Measures: CMS122FHIR R4

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.

  • A backend app registered with Epic and activated by the health system, with read access to Patient and Observation.
  • 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.
  1. For each patient, search Observation with patient set to the patient’s FHIR id, code set to the HbA1c codes (comma-separated), and date covering the measurement period.
  2. Follow every next link in the returned Bundle until there are none.
  3. Keep only observations whose code matches a code in the HbA1c value set.
  4. Keep only observations with a final status (final, amended or corrected). Drop preliminary, cancelled and entered-in-error.
  5. For each kept observation record the numeric valueQuantity and the date from effectiveDateTime (or the start of effectivePeriod).
  6. Use the most recent result in the period for the measure logic.
  • A test with no result. An ordered test that was never resulted may still come back as an Observation with no value. Do not count it as a result.
  • Results recorded as text. Some results arrive as valueString (“7.2%”, “>14”) instead of valueQuantity. 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.
  • 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.