In short
- To sync lab results into an EHR, send each result as a structured report, either an HL7 v2 result message or a FHIR DiagnosticReport with Observation results, matched to the right patient and order, with LOINC codes, units and reference ranges, and treat every correction as an update to the original.
- Notes go in as documents: US Core uses DocumentReference for narratives broader than one report and DiagnosticReport for discrete results, and Epic describes filing plain text notes through DocumentReference or PDF and RTF notes through Incoming Transcriptions.
- Federal lab rules require the lab itself to report critical values immediately to whoever ordered the test, so keep that alert out of the sync.
To sync lab results and notes into an EHR, send each item as a structured record the EHR can file: a lab result as an HL7 v2 result message or a FHIR DiagnosticReport that references Observation results, and a note as a document such as a FHIR DocumentReference. Most of the work goes into matching every item to the right patient and order, mapping codes and units, and treating corrections as updates instead of new results.
The same rules apply whether you build a lab platform, a diagnostics service, a remote care tool or a documentation product: the output has to appear correctly in a clinician's EHR, and corrections and critical values need their own handling.
What does a lab result have to contain?
If the result comes from a laboratory regulated under CLIA, the test report rules at 42 CFR 493.1291 set the content. The report must identify the patient by name and identification number, or by a unique patient identifier and identification number. It must include the name and address of the laboratory, the test report date, the test performed, the specimen source when appropriate, and the result with units of measurement or interpretation. It must note when a specimen did not meet the lab's criteria for acceptability.
The same section requires that results be sent accurately and reliably from the point of data entry to the final report destination, including interfaced reports. For your integration, that means whatever sits between the lab and the EHR has to preserve the result exactly. Reference intervals must be available to the person who ordered the test.
How does FHIR represent a lab result?
FHIR R4 splits a result into a report and its parts. A DiagnosticReport holds the findings and interpretation of a diagnostic test, for laboratory, pathology, imaging and other services. Its result element references Observation resources that hold the atomic results. Its basedOn element points to what was ordered, such as a ServiceRequest. It can carry the full report as issued in presentedForm, a summary in conclusion, and the specimens in specimen.
US Core narrows each Observation further. Its Laboratory Result Observation profile requires a category of laboratory, a code bound to laboratory test codes, a status and a subject. It marks the value, effective time, interpretation, reference range and specimen as must support. Numeric results need UCUM units, and an Observation without a value must say why the data is absent.
- One DiagnosticReport per report the lab issues, with status, patient, code and issued time.
- One Observation per analyte, each with a LOINC code where one exists, a value with UCUM units, and a reference range.
- A link from the report to the order through basedOn, so the EHR can close the loop.
- The issued report as a PDF or text attachment in presentedForm, when clinicians need to see the lab's layout.
Should you send results as HL7 v2 or FHIR?
Use whatever the receiving EHR accepts for results, and expect HL7 v2 in many places. The HL7 FHIR comparison describes v2 as one of HL7's most widely adopted standards, prominent in inpatient settings, built from reusable segments in which most data elements are optional. It notes that v2 is extended with Z-segments whose meaning is opaque without explanation from the sender.
That optionality is why every v2 interface needs its own specification. The comparison also says consistent mapping rules between v2 and FHIR are impractical, so mappings are done implementation by implementation, and one v2 message can become tens or even hundreds of FHIR resources. If you run both, keep one internal result model and map at the edges.
How do you match a result to the right patient and order?
A result filed to the wrong patient is a serious failure, because a clinician can act on it. Match on identifiers, never on names alone.
- Carry the EHR's patient identifier and the order identifier from the order through to the result.
- Reject or hold any result whose patient or order does not match, and route it to a person to resolve.
- Never create a new patient in the EHR from a result message.
- Keep a record of every result received, where it was filed and when.
What happens when a result is corrected?
Labs correct results, and your sync must handle it. Under 42 CFR 493.1291(k), when a lab finds an error in a reported result it must promptly notify the people who ordered or use the result, issue a corrected report, and keep copies of both the original and the corrected report.
In FHIR, status carries this. US Core lab Observations use status values such as registered, preliminary, final and amended, and DiagnosticReport has its own status. A corrected result should update the record the EHR already has, identified by your stable result identifier, so the clinician sees a single result with its history.
- Give every report and analyte a stable identifier that survives corrections.
- Send corrections as updates to that identifier, with the new status.
- Keep the original in your own system, as the lab must keep it.
- Before go-live, test the whole path from preliminary to final to amended.
Who alerts the clinician about a critical value?
The lab does. Under 42 CFR 493.1291(g), the lab must immediately alert the individual or entity requesting the test when a result indicates an imminently life-threatening condition or a panic or alert value. An interface can be delayed by a queue, an outage or an unmatched patient, so do not design your sync as the channel for that alert. File the critical result normally, flag it as abnormal through its interpretation, and leave the immediate notification to the lab's own process.
How do notes get into the EHR?
Notes are documents, and US Core says which resource to use. DocumentReference is the best choice when the narrative is broader than a specific order or report. DiagnosticReport is the best choice when you share discrete information or coded interpretations. US Core requires servers to support at least ten common clinical notes, including consultation notes, discharge summaries, history and physical notes, procedure notes and progress notes, each identified by a LOINC code.
For scanned or narrative-only reports, US Core requires servers to expose them through both DiagnosticReport and DocumentReference, using the same attachment URL, and it warns clients to query both. If you read notes back for reconciliation, query both resources.
Vendors add their own routes. Epic's documentation, for example, says an app can write PDF or RTF note information through Incoming Transcriptions, or plain text note information through the DocumentReference FHIR API. Measurements that belong in flowsheets, rather than notes, are often filed through Observation.Create.
- Agree the note type and LOINC code with the customer.
- Decide whether the note needs a signature or review before it becomes part of the record.
- Keep notes and discrete results separate. A number buried in a note cannot be graphed or checked against a range.
What should you test before go-live?
- A normal result, an abnormal result, and a result with no value and a stated reason.
- Preliminary, final and corrected versions of the same report.
- A result for an unknown patient and a result for an unknown order.
- Units that need conversion, and tests with no LOINC code.
- A note of each type you send, as text and as PDF if you use both.
- Duplicate delivery: the same message sent twice must not create two results.
Run these in the customer's test environment with its configuration, and have a clinician confirm each one looks right in the chart.
We have shipped Epic and athenahealth integrations, and for HL7 v2 and FHIR work on any vendor platform we work from the vendor's documentation and sandbox. If you are planning a results or notes interface, talk to one of our engineers. Our free five-day technical audit ends with a written report covering formats, mapping and the test plan.