It started with a referral. A 62-year-old with atrial fibrillation was seen in the emergency department, started on apixaban, and discharged with an AI-generated after-visit summary that read like pure Hemingway. "Patient tolerating Eliquis well. Continue current dose. No known drug allergies." The note was clean, paragraphs, not junk. It routed through the health information exchange and landed in our EHR exactly as it should.
Three days later, I nearly added a contraindicated antiplatelet because the discrete allergy field was blank. The AI summary said "no known drug allergies," but nobody noticed the structured allergy list had dropped the old "NSAID, hives" entry that was supposed to transfer. The AI summary looked right; the codes didn't.
That's the moment I stopped trusting narrative summaries to drive patient safety. Here's how to fix it before an interop error turns into a sentinel event.
Why AI Summaries Fail Interop: Narrative ≠ Data
Interoperability doesn't care about beautiful prose. It needs discrete, computable elements, problems with SNOMED EPCS codes, medications with RxNorm CUIs, allergies with substance and reaction concepts, labs with LOINC codes, vital signs with UCUM units. When an AI model churns out a free-text summary, it's telling a story. When the EHR tries to populate structured fields from that story, it's guessing. And it's usually wrong in ways that cascade silently.
I've catalogued the most common failure modes. They're predictable and dangerous:
- Hallucinated certainty: the summary asserts a medication dose that was never prescribed, but the phrasing is so confident that the structured mapper treats it as a source of truth.
- Omitted negatives: "No known allergies" in the narrative erases a historical allergy record because the interop parser maps the negative statement as "none" instead of preserving the original discrete entry.
- Attribute drift: medication route changes ("take orally" becomes "PO" which gets lost in mapping), frequency gets simplified, or units flip from mmol/L to mg/dL without conversion.
- Status flips: an allergy record marked as "inactive" or "intolerance" in the source gets back to "active" because the AI summary restated it without context.
- Temporal confusion: a medication stop date is missing, so a drug appears active when it was discontinued six months ago.
Each of these creates a chain reaction. Downstream clinical decision support (CDS) fires the wrong alert, or misses a critical one. Medication reconciliation tools propose outdated meds. Lab result routing misattributes values because the order placer code is wrong. Public health reporting sends dirty data. Once a mistake gets baked into discrete fields inside one EHR, it multiplies across every system that ingests those fields.
The pattern is always the same: narrative is a nice output, but it's not a data structure. Treating it like one is asking for trouble.
The Design Rule: Use AI for Drafting, Not for Defining the Record
I'm not anti-AI. I'm pro-safety. AI models are brilliant at generating first passes, summaries, suggested impressions, even proposed problem lists. But the golden rule is this: the AI can draft; human-validated structured inputs populate the record.
My shop implemented a simple, enforceable policy: any system that uses AI to generate clinical content must route discrete fields through a validation gate before storage. No free-text field ever becomes a problem-list entry or an active medication order without passing a checklist. That means:
- The AI proposes additions or changes, but the EHR only commits to structured data once a clinician (or an automated rules engine) signs off.
- The AI summary is always stored as a narrative note attachment, not as the source of truth for problems/meds/allergies/labs.
- We define a data contract for every integration: which exact discrete fields must be present, what code systems are allowed, what value sets are permitted, and what happens when something is missing or ambiguous.
This isn't theoretical. I've seen teams skip the data contract because "the mapping seems to work fine during pilot." Then the first upgrade breaks a dozen value sets, and suddenly every allergy from that vendor shows up as "miscellaneous" in the CDS module. That's a patient safety event waiting to happen.
Build the pipeline so that AI feeds the drafting step, not the final record. The record is a computable asset, treat it like one.
Step-by-Step Fix Protocol: Prevent Errors Before They Leave the Source System
You don't need an army of informaticists. You need a disciplined process. Here's the one we built after two near-misses taught me that "the summary looked fine" is the worst thing a safety officer can hear.
Step 1: Inventory what must be discrete. Every downstream workflow (CDS, med rec, reporting) depends on a specific set of structured elements. At minimum: problem list with diagnosis codes, medications with dose/route/frequency/start-stop, allergies with substance/reaction/severity/status, immunizations with CVX codes, lab results with LOINC codes and UCUM units, vital signs with trend context. Document the mandatory fields for your ecosystem. You can't test what you haven't named.
Step 2: Require explicit code/value set mapping. For every safety-critical field, lock down allowed terminologies: RxNorm for meds, SNOMED CT for problems, LOINC for labs. No free-text fallback. If the AI or the parser can't produce a valid code, the field stays blank and triggers a review, end of story. I've seen teams let free-text pass "temporarily," and those entries still haunt the CDS rules three years later.
Step 3: Add validation gates that run before storage. Build or buy a layer that checks three things in sequence:
- Schema validation: does the record conform to your FHIR/HL7 structure? No missing required elements.
- Terminology validation: do all codes resolve and belong to approved value sets? No garbage codes.
- Unit normalization and temporal consistency: convert everything to standard units (e.g., all weights to kg, all temperatures to Celsius) and flag impossible date sequences (med stop before start, lab collected after death, etc.).
Fail any of these, and the record routes to a queue, not into the live chart.
Step 4: Implement mismatch detection between AI narrative and discrete fields. This is your safety net. A parser extracts key clinical facts from the AI summary text (using deterministic rules, not another black-box model) and compares them to the discrete fields. If the summary says "penicillin allergy persists" but the structured allergy list shows no penicillin entry, flag it. If the summary mentions "lisinopril 10mg daily" but the medication order shows 5mg, flag it. Anything safety-critical gets blocked until a human resolves the conflict.
Step 5: Audit everything, always. For every discrete field populated via AI, store provenance: which model version, which source document span, confidence score, reviewer identity. Log the transformation steps. When an error does slip through (and it will), you'll have the trail needed to fix not just the record but the upstream process that created it.
Run this workflow inbound on every interop transfer. You'll catch most failures before they replicate.
Interoperability Testing That Actually Catches Spread: Use Failure-Mode Test Suites
"It loads" isn't a test. I've reviewed too many go-live checklists that tick a box because the EHR didn't crash when receiving an AI-generated CCD. That's like checking a plane's engine by seeing if it turns over once.
Instead, define success as: all mandatory discrete fields arrive with correct codes, units, statuses, and temporal sequences in the downstream consumer. To prove that, you need test suites explicitly designed to break things.
Build a failure-mode test suite that includes these scenarios:
- Missing fields: an allergy reaction type is absent; a medication dose is absent; a problem list code is absent.
- Wrong units: a lab result with unit "mg/dL" when the source system uses "mmol/L"; a weight in pounds sent as kg without conversion.
- Code mismatches: a medication with an RxNorm code that maps to a generic when the brand-specific code was intended; a problem SNOMED code from an outdated version.
- Negation errors: an allergy status flips from "inactive" to "active" after transfer; a family history entry becomes a personal history.
- Temporal sequencing: a medication with a start date after the stop date; a procedure dated in the future; a lab ordered after discharge.
Run these suites not just at initial integration, but as regression tests. Every AI model update, every EHR upgrade, every terminology version change, re-run the full battery. I've seen a single RxNorm update silently switch several medication codes, causing "aspirin" to show up as "acetaminophen" in a downstream CDS rule. Without versioned regression testing, that would have gone unnoticed for months.
For additional assurance, implement end-to-end tracing: inject synthetic records with known discrete fields, pass them through the full interop chain, and validate that what comes out the other end matches. This catches errors that only surface when you consider the entire pipeline, not just individual API responses.
The numbers I see in real-world pilots back this up. Before adding these gates, we routinely saw 13-18% of AI-influenced records with at least one discrete-field defect. After implementing mismatch detection and schema/terminology gates, that dropped below 5%. Most importantly, the defects that remained were caught before reaching a live patient context.
Deployment Playbook: Governance, Safety Nets, and Stakeholder Alignment
Technology fixes are necessary but insufficient. You need people, process, and politics aligned.
Governance: Don't let anyone say "the vendor handles it." Establish clear ownership: the clinical safety committee (or informatics governance) owns the data contract. Validation rules and escalation pathways must be signed off by both clinical and technical leadership. When a novel mismatch fires, there needs to be a named owner who can say "release the record" or "block it."
Safety nets: Never roll out AI-driven discrete mapping to everyone on day one. Use feature flags, start with a pilot clinic, a limited set of providers. Automate rollback triggers: if the mismatch-detection queue spikes above a threshold, or if the proportion of reviewer-approved corrections exceeds X%, the system automatically reverts to a conservative manual-only mode until you diagnose the drift.
Operational training: Clinicians don't need a deep dive on HL7. They need to know exactly two things: (1) the AI summary is a draft, not the record; (2) they must approve or correct the discrete fields the system proposes. A simple 10-minute microlearning plus a laminated job aid next to the workstation prevents most "I thought the system did it" errors.
Vendor alignment: Every vendor participating in the data flow must accept the same discrete-field requirements and provide test evidence that their AI outputs meet those specs. I've written "interop conformance clauses" into contracts that require quarterly testing reports. If a vendor can't produce them, we don't go live.
QA Checklists for Common "AI vs Discrete" Breakpoints (Med, Allergies, Labs)
When you're reviewing a flagged mismatch or auditing a batch of records, these checklists keep you focused on the highest-risk elements.
Medication breakpoints
- Dose, route, frequency all present and correct (no ellipsis, no "as directed")
- Start and stop dates present and logically ordered
- Formulation matches (e.g., extended-release vs immediate)
- Active vs historical status correctly populated
Allergy breakpoints
- Reaction separated from severity (e.g., "hives" vs "anaphylaxis")
- Allergy status explicitly marked (active, inactive, intolerance)
- Negation handling: if the source says "no known allergies," the discrete field mirrors that with a proper nullFlavor or specific entry, not an empty list that could be misinterpreted as "no data recorded"
Lab breakpoints
- Result value and units correctly transformed to standard UCUM
- Reference range included but not confused with result
- LOINC code maps to the correct test, not a related panel
- Specimen type and collection timestamp linked to the correct order
Quick triage rule: If the mismatch could affect a safety-critical workflow, CDS alerting, medication reconciliation, allergy checking, or high-risk lab routing, do not auto-store. Require manual approval. No exceptions.