Repository navigation
fix(export): PUT patient by id instead of conditional-update so EMR writes reach OpenCR - #74
Merged
Merged
Conversation
…404s on PUT /Patient?identifier=...); fixes the EMR->Client Registry write path
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.
Problem
The real-time EMR → Client Registry (OpenCR) write path is broken. When a patient is saved,
exportPatientissues a FHIR conditional update:OpenCR does not support conditional update and responds 404 with
Cannot PUT /fhir/Patient, so the patient never reaches the registry in real time (it only lands later via the consolidated batch feed).Verified directly against the live OpenCR:
PUT /Patient?identifier=...(conditional) → 404Cannot PUT /fhir/PatientPUT /Patient/{id}(by id) → 200 OK, and OpenCR runs matching and creates the golden record.Fix
Write by a stable id (the patient uuid) instead of a conditional update:
OpenCR matches/dedupes on the in-resource source-key identifier (still added above), so this is idempotent and converges with the consolidated batch feed — which already PUTs by id via the fhir-router mediator. This mirrors that mediator's documented approach ("OpenCR does NOT support FHIR conditional-update, so we PUT by id").
Testing
mvn clean packagegreen.Builds on #73 (resilient search translation), which remains intact.