Add openEHR-to-FHIR R4 mapping library (fhir-facade module)#3
Open
devin-ai-integration[bot] wants to merge 2 commits intodevelopfrom
Open
Add openEHR-to-FHIR R4 mapping library (fhir-facade module)#3devin-ai-integration[bot] wants to merge 2 commits intodevelopfrom
devin-ai-integration[bot] wants to merge 2 commits intodevelopfrom
Conversation
Adds a new fhir-facade Maven module that provides a configuration-driven mapping layer between openEHR RM objects and FHIR R4 resources. Features: - YAML-based mapping configuration (Patient, Observation, Condition) - Read direction: openEHR -> FHIR (EhrStatus->Patient, Composition->Observation/Condition) - Write direction: FHIR -> openEHR (Observation/Condition->Composition JSON) - Composite FHIR ID encoding/decoding (ehrId.compositionId.version) - 17 unit tests covering all mapping paths, config loading, and round-trips Dependencies: HAPI FHIR R4 7.6.0, Jackson YAML, EHRbase API module Co-Authored-By: Arjun Mishra <arjunsaxmishra@gmail.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
When path segments include archetype node IDs (e.g. items[at0004]), the method now creates JSON array elements with archetype_node_id fields instead of collapsing them to plain object nodes. This prevents data loss when multiple sibling elements share the same node name but differ by archetype node ID (e.g. systolic vs diastolic blood pressure readings). The reverse mapping JSON structure now mirrors what extractFromCompositionJson expects, enabling proper round-trip mapping. Co-Authored-By: Arjun Mishra <arjunsaxmishra@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
fhir-facadeMaven module providing a configuration-driven mapping layer between openEHR RM objects and FHIR R4 resourcesMappingConfiguration,ResourceMapping,OpenEhrMappingConfig,FieldMappingclasses for deserializing YAML mapping definitionsOpenEhrTypeenum (EHR_STATUS,COMPOSITION) for specifying the openEHR source typeOpenEhrFhirMappingService):mapToPatient(),mapToObservation(),mapToCondition()mapFromObservation(),mapFromCondition()encodeFhirId()/decodeFhirId()using{ehrId}.{compositionId}.{version}formatInputStreamor directoryPathsetJsonValueAtPathcreates JSON arrays witharchetype_node_idfields when path segments include bracket notation, preserving distinct sibling elementsapimodule, Archie openEHR RMfhir-facadeto rootpom.xmlmodules and BOM dependency managementRelated issue
N/A — New feature module for openEHR-to-FHIR interoperability.
Additional information
Design decisions:
JsonNodetree walking to extract values from serialized Composition JSONarchetype_node_idfields when path segments include archetype node IDs, preserving distinct sibling elements and enabling proper round-trip mappingEhrStatus(no archetype paths needed); Observation and Condition map fromCompositionusing template-specific archetype pathsBuild verification:
mvn compile -pl fhir-facade -am -DskipTests— compiles successfullymvn test -pl fhir-facade— 17 tests passmvn spotless:apply -pl fhir-facade— Palantir Java Format appliedPre-Merge checklist
Link to Devin session: https://app.devin.ai/sessions/7e2f093f3476479e97b568d432dc865b
Requested by: @Colhodm