Blog

    Medical Coding and Interoperability: Code Mapping in EHR Integration

    By GauravNovember 27, 20269 mins read
    On this page

    Every EHR interface carries codes: lab tests, diagnoses, medications, orders and results. Few of those codes start out standard. A reference lab sends its own test numbers, a legacy system keeps its own diagnosis list, and a pharmacy feed uses product identifiers the receiving EHR does not know.

    This post is for integration engineers and health IT teams who move coded data between systems. It explains where local codes come from, how FHIR ConceptMap and terminology services handle translation, what to do with codes that have no match, and how to keep maps current as code sets change.

    How does medical coding work across EHR interfaces?

    Connecting systems that use different codes?

    Our EHR integration services include interface builds, code mapping and the terminology work behind clean data.

    Medical coding across EHR interfaces means translating each system's local codes for labs, diagnoses, medications and orders into the standard codes the receiving system expects, and keeping those translations current. Agnotic Technologies builds the code maps, terminology services and update checks that sit inside these interfaces.

    Mapping is not a one-time task. Codes are added on both sides, standards publish new releases, and a map that was right at go-live drifts unless someone owns it.

    Where do local codes come from?

    Local codes come from any system that needed a code before a standard one was available or affordable. Most organizations carry several layers of them.

    • Lab compendiums: each performing lab's own test and result codes, often with LOINC added later or not at all.
    • Order catalogs: local orderable codes for tests, imaging and procedures.
    • Problem and diagnosis lists: legacy pick lists that predate ICD-10-CM or SNOMED CT coding.
    • Medication files: pharmacy or formulary identifiers that need RxNorm for exchange.
    • Custom documentation rows: flowsheet and form items invented by each department.

    Inventory them per interface before mapping anything. The same local code can mean different things in two source systems, so the map key must include the source as well as the code. Record who owns each source's code list, too.

    What is a FHIR ConceptMap?

    A ConceptMap is the FHIR resource for a statement of relationships from one set of concepts to another. It records each source code, its target code and how closely they match.

    • Source and target: the code systems or value sets being mapped from and to.
    • Equivalence: whether the target is equivalent, wider, narrower or unmatched, so consumers know how much meaning was kept.
    • Unmapped handling: what the map does when a source code has no entry.
    • Version: the map's own version, so each translated message can record which map it used.

    Storing maps as ConceptMap resources, even if the interface engine uses them as lookup tables, gives you a standard format that other teams and tools can read and review.

    Equivalence matters downstream. A result mapped as equivalent can be trended with confidence, while a wider mapping may merge tests that should not share a chart line, so reports should read the equivalence before grouping.

    Should mapping live in the interface engine or a terminology service?

    Small, stable maps can live in the interface engine. Shared or frequently changing maps belong in a terminology service that every interface calls, so one correction fixes every feed.

    Code mapping path from a source system local code through the interface engine, which calls a terminology service holding versioned ConceptMaps, to the receiving EHR with both original and standard codes, with an unmapped queue lane for codes that have no match

    HL7 FHIR R4 defines the ConceptMap $translate operation to translate a code from one value set to another, based on the existing value sets and ConceptMap resources and any other knowledge available to the terminology server.

    • Interface engine tables: fast and simple, but copied per interface and easy to let drift.
    • Terminology service: one source of truth, with $translate for mapping, $validate-code for checking and $lookup for display names.
    • Hybrid: the engine caches results from the terminology service and refreshes them when the map version changes.

    Whichever you choose, keep the terminology service off the critical path for urgent results. If it is unreachable, the engine should pass the message with the local code and flag it, not stop the feed.

    How do you handle codes with no match?

    Never guess. An unmapped code should go to a review queue, and the message should carry the original code so nothing is lost while the map catches up.

    • Send both codings: the original local code and the standard code side by side, in a FHIR CodeableConcept or the alternate identifier of an HL7 v2 coded field.
    • Hold or pass: decide per data type whether an unmapped code blocks the message or passes with the local code only.
    • Review queue: each new unmapped code listed with its source, frequency and sample messages.
    • Feedback loop: once a mapping is approved, reprocess the held messages.

    Sort the queue by volume as well as age. One unmapped code that appears in hundreds of messages a day matters more than many rare ones.

    Keeping maps current when code sets change

    Standard code sets change on regular schedules, and maps must follow. Each release can add, retire or redefine codes on the target side of your maps.

    CMS and CDC released new ICD-10-PCS and ICD-10-CM codes effective October 1, 2026, to be used for discharges and encounters from October 1, 2026 to March 31, 2027.

    The National Library of Medicine publishes RxNorm as a full monthly release, with weekly updates between monthly releases.

    LOINC and SNOMED CT publish their own releases as well. Load each release into a test environment, list the codes your maps point to that were retired or changed, and fix the maps before the release reaches production.

    Record the code system version on each translated code where the format allows it, so later readers know which release a code came from, even years later.

    How should maps be versioned and released?

    Treat a map like code: version it, review each change and release it through a test environment before production. Every translated message should be traceable to the map version that produced it.

    • Change request: who asked, which codes and why.
    • Review: a second informaticist approves mappings that affect results, problems or medications.
    • Test run: recent messages replayed through the new version, with every difference listed.
    • Release note: what changed, the effective date and how to roll back.

    Where code mapping goes wrong

    Mapping failures rarely stop an interface. They let wrong or vague codes flow quietly into charts, reports and claims.

    • Source ignored: the same local code from two labs mapped to one target, although the tests differ.
    • Forced matches: a narrower or wider code marked as equivalent to clear the unmapped queue.
    • Stale targets: maps pointing to retired codes after an annual update.
    • Lost originals: the local code dropped after translation, so nobody can recheck the mapping.
    • No owner: the unmapped queue grows because nobody is assigned to review it.

    These problems often show up first in reports rather than in the chart: a lab trend that jumps when a new performing lab starts, or a quality measure that drops after an annual code update.

    A worked example: a reference lab's local test codes

    A health system adds a new reference lab whose results arrive with the lab's own test codes. The integration team loads the lab's compendium, and a terminologist maps each result code to LOINC, marking a few as narrower where the lab's test is more specific.

    The interface engine calls the terminology service for each result and sends the EHR both the local code and the LOINC code. A new test the lab adds later arrives unmapped, goes to the review queue with sample results, and is mapped within the agreed review cycle.

    When the next LOINC release arrives, a test run shows no mapped codes were deprecated, and the map version moves forward with a change note.

    Who owns what?

    Code maps need clinical, technical and operational owners, because a mapping is a clinical decision carried out by software.

    • Terminologist or informaticist: mapping decisions, equivalence choices and release reviews.
    • Integration team: calling the terminology service, sending both codings and holding unmapped messages.
    • Source system owners: notice of new local codes before they appear in production.
    • Clinical reviewers: sign-off for maps that affect results, problems or medications.

    Agree a review cycle for the unmapped queue, faster for results than for less urgent data, and report against it each month.

    How do you test code maps?

    Test maps with real messages, not just the map table. A map can be correct in isolation and still fail when the source sends a code in an unexpected field or format.

    • Coverage: the share of distinct local codes in recent traffic that have a mapping.
    • Accuracy sample: a reviewer checks a random set of translated messages against the source meaning.
    • Release check: every target code in the map validated against the current code system version.
    • Round trip: original codes survive through the interface to the receiving system.
    • Queue age: how long unmapped codes wait for review, tracked over time.

    What are code mapping best practices?

    Key every map on source system and code, store maps as versioned ConceptMap resources, and send the original code alongside the standard one. Route unmapped codes to a queue with a named reviewer.

    Centralize shared maps in a terminology service, test every code set release before production, and measure coverage and queue age so drift shows up early.

    How Agnotic can help

    Agnotic builds code mapping for EHR integrations: source code inventories, ConceptMap-based maps, terminology service integration, unmapped code queues and release checks for ICD-10-CM, LOINC, SNOMED CT and RxNorm. We work with your informaticists so the clinical decisions stay with clinicians.

    Plan your interoperability work

    We build HL7 v2 and FHIR interfaces, terminology services and data exchange between EHRs, labs and payers.

    Sources

    Frequently Asked Questions

    Translating a source system's local codes into the standard codes the receiving system expects, such as LOINC for lab results or RxNorm for medications, and keeping those translations current.

    Talk to an engineer about your project

    Share a sample of the codes your interfaces carry. We will outline the mapping, terminology service and update checks you need.

    Go deeper

    Services and solutions on this topic