HealthRecordCommunity
FHIR🌏 International🏛 OpenMRS Global Support TeamEnriched

Migration to FHIR2 3.0.0: Changes and Technical Deep Dive for the DAO Layer

FHIR2 3.0.0 Data Access - FHIR - OpenMRS Talk

November 13, 2025OpenMRS Global Support Team

Summary

OpenMRS has updated its FHIR2 module, evolving it to version 3.0.0. The primary change involves migrating the Data Access Object (DAO) layer from the Hibernate Criteria API to the more standardized JPA Criteria API. Consequently, developers must utilize a new custom context called `OpenmrsFhirCriteriaContext` for query construction.

Details

This article details the future evolution of the FHIR2 module and the technical changes introduced in version 3.0.0. The most significant change is the necessity to transition from the Hibernate Criteria API, previously used in the data access layer, to the more standardized JPA Criteria API, as support for the former is being dropped by Hibernate itself. This migration required changing the DAO implementation signatures (method parameters). Instead of passing a simple Criteria object, developers must now use a custom context object called `OpenmrsFhirCriteriaContext`. This context provides access to multiple elements necessary for query construction in JPA Criteria API, such as the current EntityManager and CriteriaQuery. It is designed so that developers can continue writing complex search logic (e.g., generating subqueries via the `handleIngredientCode` function) in a way similar to before. Furthermore, helper methods previously residing in BaseDao have been refactored and moved into a new class called `FhirSearchQueryHelper`, aiming to improve the manageability of the base DAO classes. These changes are aimed at enhancing compliance with FHIR standards and improving long-term maintainability.

📰
Read Original Article
talk.openmrs.org

Original content copyright by respective publishers