Understanding and Modeling Lab Data in FHIR – the Right Way

by: Dr. Uri Lerner

Laboratory data is central to healthcare, shaping diagnostic decisions, treatment plans, and patient monitoring. However, the diversity of lab workflows and test formats creates challenges for seamless data exchange. Here, we will delve into the complexities of representing lab results using FHIR, focusing on its advantages over traditional standards like HL7 v2, and highlighting how it addresses the needs of modern healthcare systems.

Laboratory workflows encompass several key stages:

  1. Test Ordering: Clinicians initiate orders specifying tests, priorities, and relevant clinical information.
  2. Specimen Collection: Samples are collected, labeled, and documented, ensuring accurate identification and handling.
  3. Sample Processing and Analysis: Laboratories process specimens using various methodologies, sometimes creating new specimens for the same lab order from the existing ones or omitting flawed ones. Eventually, raw data from various analytical methods is interpreted into meaningful results.
  4. Result Reporting: Interpreted results are compiled into reports, often including reference ranges, units, and interpretative comments. 
  5. Result Delivery and Integration: Reports are delivered to ordering clinicians and integrated into electronic health records (EHRs) for decision-making.

Each step involves intricate data handling, requiring meticulous documentation and seamless information flow. Traditional formats like HL7 v2 struggle with these complexities due to limited standardization and lack of modularity. This is where FHIR excels.

 


Why FHIR is Superior to HL7 v2

FHIR provides a modern, flexible framework for representing laboratory data with several clear advantages over HL7 v2:

  1. Well-Defined Data Models: FHIR uses resources with standardized structures and terminologies, ensuring consistency across implementations.
  2. Interoperability and Modularity: Its API-driven architecture supports real-time data exchange and incremental adoption, making it easier to integrate with existing systems.
  3. Enhanced Data Traceability: Relationships between resources, such as linking Observation to DiagnosticReport and ServiceRequest, enable robust tracking and context preservation, important both for clinical workflows and for research, a crucial component in the medical-analytical world.
  4. Readable and Extensible Format: FHIR’s JSON and XML formats are more human-readable and adaptable compared to the rigid structure of HL7 v2.

By addressing the limitations of HL7 v2, FHIR supports scalable and interoperable solutions for modern healthcare systems.
For more information about FHIR vs HL7 V2, visit our post 
here.

 


Modeling Lab Data with FHIR

FHIR’s modular framework enables accurate representation of laboratory workflows and results. Core resources include:

  • Observation: Captures atomic test results with attributes such as LOINC codes, measured values, and units. For panels, hasMember links multiple Observation resources.
  • DiagnosticReport: Summarizes findings and integrates related Observation resources, offering clinicians a cohesive view.
  • ServiceRequest: Represents lab orders, ensuring traceability from the order to results.
  • Specimen: Tracks sample details, including collection methods, processing, and status.

For example, a metabolic panel can be represented using a ServiceRequest to order the test, a “general” Observation resource for the panel and linked Observation resources for individual results (e.g., glucose, sodium), and a DiagnosticReport summarizing the panel’s findings.


Best Practices for FHIR Implementation

Adopting FHIR for laboratory data requires adherence to established standards and thoughtful design. Key practices include:

  • Standardized Coding: Use LOINC for test identification, SNOMED CT for result classification and UCUM for units. Remember to regard national profiles (usually termed “observation-lab” vs “observation”) when designing organizational FHIR representation.
  • Metadata Enrichment: Include timestamps, collection details, and test methods to provide context.
  • Resource Relationships: Leverage links like hasMember to organize panels and maintain logical connections. When modelling orders with multiple specimens and tests, make sure to model all the different resources correctly.
  • Validation and Testing: Employ implementation guides to ensure data consistency and validate resource interactions.

 

Example of a FHIR Implementation – End-to-End Lab Workflow:

A ServiceRequest initiates a panel with 4 tests for a given sample and 3 more for a second one. Results are captured in Observation resources, organized via hasMember (when under a panel), and summarized in a DiagnosticReport together with the Specimen, all grouped in a Transaction Bundle resource.

Modeling lab data
Figure 1- Visualization of sample bundle, created using clinFHIR® Bundle Visualizer.

On the left, a specimen with 3 surrounding pairs of ServiceRequest and Observation.
On the right, also one specimen but with 4 result panels, one “father” observation describing the panel, and one ServiceRequest.

 

Addressing Challenges and Opportunities

Despite its advantages, implementing FHIR for laboratory data involves challenges such as:

  • Incomplete Data: Systems must handle partial updates routinely as lab results vary over time, re-analyzed or omitted for various reasons. and the logic behind these processes must be taken into account, and elements should be mapped effectively.
  • Performance Considerations: FHIR’s verbose JSON format requires optimization for large-scale data and high number of conversions from source system.
  • Implementation Variability: Standardized use of implementation guides and a “habit” of following regulated profiles, common ValueSets etc. should minimize discrepancies between systems.

Looking forward, FHIR’s modularity and API-driven structure position it as a cornerstone for advancing laboratory data interoperability, enabling seamless integration and improved scalability.

Conclusion

FHIR transforms the way laboratory data is represented, addressing the limitations of HL7 v2 with its modularity, extensibility, and interoperability. Accurate modeling of lab workflows and results enhances healthcare delivery, ensuring better data traceability and scalability. By adopting best practices and leveraging implementation guides, organizations can unlock the full potential of FHIR to revolutionize laboratory data exchange and analysis. 

More To Explore