When an unaffiliated practice sends a lab result, make it part of the trusted record in Epic — provider verification, LOINC normalization, patient matching, and FHIR publication. Clinical chart ingestion, not public-health case reporting.
Clinical Lab Ingestion: External Results HL7v2 to Epic FHIR
Objective: A health system receives a laboratory result from an unaffiliated physician practice. Before that result can become part of the patient's clinical record, the organization has to determine whether the sending provider is recognized, normalize external coding standards, identify the patient accurately, validate demographic changes, and fold the information into a trusted enterprise record. Once validated, the result is made available in Epic so care teams can act with confidence. This is clinical chart ingestion — not notifiable-disease reporting to a public health agency.
What's Getting Built
- /lab-results (System API) — inbound clinical results ingestion ·
MLLP LISTEN, POST /hl7v2, POST /fhir
- /validate (Process API) — provider verification and LOINC normalization ·
POST /normalize
- /patients (Process API) — identity resolution against the golden record ·
GET /match, PUT /{id}/demographics
- Epic FHIR R4 DiagnosticReport (target System API) — publish the validated result ·
POST /DiagnosticReport
1. Business requirements
- Accept results from unaffiliated practices and external clinical facilities.
- Verify the sending provider is recognized before the result is trusted.
- Normalize external coding to the standards the enterprise reports on.
- Identify the patient accurately, distinguishing existing patients from new ones.
- Validate demographic changes rather than letting them overwrite the record.
- Publish only validated results, with no manual intervention in the happy path.
2. Processing stages
- Step 1 — External lab. Results are generated at an unaffiliated physician practice or external clinical facility.
- Step 2 — Receive lab result. Ingest clinical data over whichever standard the sender supports: HL7v2, FHIR, API, or files.
- Step 3 — Validate and normalize. Enforce strict data standards and quality: provider verification, data-quality rules, procedure codes, and LOINC mapping.
- Step 4 — Identify the patient. Match to an existing patient or establish a new one, and validate demographic changes before applying them.
- Step 5 — Create the trusted record. Consolidate across sources through identity resolution, a golden record, and enterprise master data integration.
- Step 6 — Publish trusted data. Deliver validated results to Epic and care teams for quick action, and to analytics and AI for business intelligence.
3. Ingestion
- Receive HL7v2 messages over MLLP as the primary inbound channel.
- Accept FHIR resources, REST API calls, and batch files for senders that cannot use MLLP.
- Acknowledge HL7v2 messages per the standard so senders know the delivery outcome.
- Preserve the raw inbound payload for audit and replay before any transformation.
- Carry a correlation ID that survives the whole pipeline.
4. Validation and normalization
- Verify the sending provider against the provider registry, and reject unrecognized senders explicitly.
- Apply data-quality rules to required segments and fields before processing.
- Map local procedure codes to LOINC, and flag codes with no mapping for review.
- Normalize units, reference ranges, and abnormal flags across senders.
- Quarantine failures for human review instead of dropping them.
5. Patient identification
- Match on the agreed demographic set, not on name alone.
- Distinguish a confident match, a probable match needing review, and a genuinely new patient.
- Validate demographic changes against the existing record before applying them.
- Route ambiguous matches to a stewardship queue rather than guessing.
- Never create a duplicate patient just to make a message flow.
6. Trusted enterprise record
- Resolve identity across sources and maintain the golden record.
- Integrate with enterprise master data so the record is shared, not local to this flow.
- Keep source attribution and survivorship rules explicit and auditable.
- Version the record so a demographic change can be traced to the message that caused it.
7. Publication
- Publish diagnostic reports to Epic so care teams act inside their own workflow.
- Publish to analytics and AI platforms for business intelligence and model use.
- Make publication idempotent so a replay does not duplicate results.
- Guarantee delivery for clinically significant results, and alert when it fails.
8. Error handling and operations
- Retry transient connectivity failures with a bounded backoff.
- Route unknown providers, unmapped codes, and unmatched patients to distinct queues.
- Treat a critical result that failed to publish as a patient-safety event, not a log line.
- Track volume, match rate, mapping coverage, and end-to-end latency per sender.
9. Security and compliance
- Encrypt PHI in transit and at rest.
- Audit-log every access to and modification of patient data.
- Enforce minimum-necessary access for integration operators and support users.
For additional HIPAA controls, API policies, and reference security patterns, see the MuleSoft Accelerator for Healthcare on Anypoint Exchange.
10. Implementation starting point
Build from the Anypoint Exchange template rather than an empty project, and keep the template's structure and conventions:
Create a MuleSoft integration based on the Anypoint Exchange template "HL7v2 to FHIR System API Implementation Template". Download and use that template as the starting point for the implementation.
Configure the input to use the "HL7v2 MLLP connector" so the solution can receive HL7v2 messages over MLLP.
Configure the output to use the API "Epic FHIR R4 Diagnostic Reports" as the target system API.
Make sure the implementation includes the necessary connectivity, message transformation, and mapping so inbound HL7v2 data is translated appropriately for the Epic FHIR R4 Diagnostic Reports API. Keep the solution aligned with the downloaded template structure and conventions.
Deliverable: An end-to-end mule application transforming an HL7v2 ORM to a FHIR Order Bundle