Quality measure logic, explained with sources. Every exclusion traced to its line.
A healthcare quality team made every operational quality measure explainable: numerator, denominator and exclusions linked to the specification, the SQL and the data dictionary, with gaps between reported and recomputed rates explained step by step.
- Customer
- A healthcare quality team
- Scope
- Private cloud · quality reporting warehouse
- Published
What was in the way
The team reports dozens of operational quality measures to internal committees and external programmes. Each measure is defined in a specification document, computed by SQL in the reporting warehouse, and depends on fields described in a data dictionary. Those three drift apart as each is updated on its own schedule.
When a committee asked why a rate had moved, the answer took days. An analyst had to read the specification, find the right version of the SQL, check the dictionary for code changes and recompute by hand. The reasoning lived in an email thread.
The scope was operational only: measure logic and reporting, not clinical decisions. The team needed every explanation to be checkable by a second analyst without redoing the work.
How Agent Hive was set up
- 01
Connect the three sources
Specification documents, the reporting warehouse and the data dictionary were connected read-only. Access follows the warehouse’s existing roles, and runs stay inside the private cloud. - 02
A reviewed page per measure
Agents drafted a page for each measure with its numerator, denominator and exclusions, each linked to the specification section, the SQL clause and the dictionary entry. Analysts approved every page. - 03
Record disagreements, do not resolve them
Where sources disagreed, the page holds both readings and names the owner who decides. The agent says which reading an answer used. - 04
Explain rate changes step by step
For a question about a rate, the agent recomputes it from the measure page, compares each step with the production SQL and reports exactly where and why the two diverge, with record counts. - 05
Fixes go through owners
Corrections to SQL or code lists are raised as proposals to the data engineering owner. Nothing in the warehouse changes without their approval.
What changed
- Measures with reviewed pages
- 48
- numerator, denominator, exclusions
- To explain a rate change
- 2 h
- was several days
- Source disagreements found
- 7
- each with a named owner
- Explanations with sources
- 100%
- spec, SQL, dictionary
One measure, three sources
Every quality measure has three descriptions that should agree and often do not: the specification document, the SQL that computes it, and the data dictionary that says what each field means. The team’s first step was to put all three for each measure into a reviewed page: the numerator, the denominator, every exclusion, and where each one comes from in each source.
How the Agent Hive wiki is built. A knowledge factory line: SOP PDFs, Tables, Runs · notes, Connected → Draft → Link → Resolve → Type → Approve → Commit → Context. Every item waits at the human approval gate; rejected ones leave the line. So far: 11 ingested, 22 extracted, 7 merged as duplicates, 16 passed approve, 1 rejected, 16 published, 10 served as context. The followed item (page “Late delivery”) is at: Approve · pending.
Drafting was done by agents; approval was not. A quality analyst reviewed each page against the specification and signed it off. Where the SQL and the specification disagreed, the page recorded the disagreement instead of resolving it, and named the person who could.
Explaining a gap between two rates
The question that started the project was simple: why did a reported rate differ from the one an analyst recomputed by hand? The agent recomputed the rate from the measure page, then compared each step with the production SQL. The difference came from one exclusion. The specification excluded records with a particular discharge status, while the SQL filtered on a code list that had not been updated when the dictionary added a new status value.
Provenance trail. Provenance of “on-time rate = 0.874”: on-time rate = 0.874 ← query run ← metric definition ← delivery policy §4 (read right to left: the fact was derived from each step in turn). Every step: entity “on-time rate = 0.874” (the fact in the answer); wasGeneratedBy query run. activity “query run” (2026-10-21 · 09:14); wasAssociatedWith analyst agent, used orders dataset, used metric definition. agent “analyst agent” (ran the query). entity “orders dataset” (snapshot 2026-10-20); wasDerivedFrom ERP export. entity “metric definition” (v3 of 3), versions v1 first draft; v2 excludes cancelled lines; v3 late = after promised date; wasDerivedFrom delivery policy §4, wasAttributedTo data steward. entity “ERP export” (nightly load). entity “delivery policy §4” (source document). agent “data steward” (approved v3).
The answer named the exclusion, linked the specification page, the line of SQL and the dictionary entry, and counted how many records the difference touched. The fix went to the data engineering owner as a proposal. It was not applied until they approved it, and the measure page now records which code list version each reported rate used.
Now when a committee asks why a rate moved, I can send them the exclusion, the line of SQL and the dictionary entry in one answer.