Suppress MPI sync AOP during patient import to prevent duplicates - #49
Merged
mherman22 merged 4 commits intoApr 15, 2026
Merged
Conversation
When importMpiPatient() saves a patient via createImportedMpiPatient(), the mpi-client PatientSynchronizationAdvice AOP fires and spawns a PatientUpdateWorker. This worker re-queries the MPI, discovers golden record seealso links, and triggers a second import — creating a duplicate local patient. Wrap the savePatient() call with PatientSynchronizationAdvice.SUPPRESS to skip the AOP during import. The export back to MPI is already handled explicitly by exportPatient() at the end of importMpiPatient(), so the AOP-triggered export is redundant anyway. Depends on IsantePlus/openmrs-module-mpi-client#60 which adds the SUPPRESS ThreadLocal flag.
mherman22
added a commit
to mherman22/sedish
that referenced
this pull request
Apr 10, 2026
…e patient import - santedb-mpiclient-1.1.5-SNAPSHOT.omod: adds SUPPRESS ThreadLocal flag to PatientSynchronizationAdvice, dedup lock on PatientUpdateWorker, and proxy privileges for background threads (IsantePlus/openmrs-module-mpi-client#60) - registrationcore-2.2.0.omod: sets SUPPRESS=true around savePatient() in createImportedMpiPatient() to prevent AOP from spawning PatientUpdateWorker during MPI import (IsantePlus/openmrs-module-registrationcore#49) - Dockerfile: copies patched registrationcore to distribution path to override the base image's unpatched version
mherman22
added a commit
to mherman22/sedish
that referenced
this pull request
Apr 10, 2026
…e patient import - santedb-mpiclient-1.1.5-SNAPSHOT.omod: adds SUPPRESS ThreadLocal flag to PatientSynchronizationAdvice, dedup lock on PatientUpdateWorker, and proxy privileges for background threads (IsantePlus/openmrs-module-mpi-client#60) - registrationcore-2.2.0.omod: sets SUPPRESS=true around savePatient() in createImportedMpiPatient() to prevent AOP from spawning PatientUpdateWorker during MPI import (IsantePlus/openmrs-module-registrationcore#49) - Dockerfile: copies patched registrationcore to distribution path to override the base image's unpatched version
mherman22
added a commit
to mherman22/iSantePlus
that referenced
this pull request
Apr 10, 2026
- mpi-client: updated to 1.1.5-SNAPSHOT from fix/duplicate-patient-on-mpi-import branch (IsantePlus/openmrs-module-mpi-client#60) — adds SUPPRESS ThreadLocal, dedup lock, proxy privileges, CI fixes - registrationcore: updated from fix/suppress-mpi-sync-on-import branch (IsantePlus/openmrs-module-registrationcore#49) — sets SUPPRESS=true around savePatient() during MPI import, bumps mpiClientVersion to 1.1.5-SNAPSHOT - Fixed dead repo references and github-packages profile in registrationcore POM - Aligned xdsSenderVersion to 2.5.9 in registrationcore
mherman22
added a commit
to mherman22/iSantePlus
that referenced
this pull request
Apr 10, 2026
- Add 'Adding a New Module' guide: importing from external repo, creating from scratch, vendoring dependencies - Add 'Contributing' section with workflow - Add 'Downloading OMODs from CI' section - Expand build instructions with install command - Update mpi-client to 1.1.5-SNAPSHOT with SUPPRESS flag, dedup lock, and proxy privileges (IsantePlus/openmrs-module-mpi-client#60) - Update registrationcore with SUPPRESS during MPI import (IsantePlus/openmrs-module-registrationcore#49) - Fix dead repo references in registrationcore POM - Align registrationcore xdsSenderVersion to 2.5.9
mherman22
force-pushed
the
fix/suppress-mpi-sync-on-import
branch
from
April 11, 2026 16:05
afe00d4 to
6f14f63
Compare
6 tasks
ibacher
approved these changes
Apr 14, 2026
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| <xdsSenderVersion>2.2.1</xdsSenderVersion> | ||
| <mpiClientVersion>1.1.0</mpiClientVersion> | ||
| <mpiClientVersion>1.1.5-SNAPSHOT</mpiClientVersion> |
There was a problem hiding this comment.
We should finalize this version number before merging
Author
There was a problem hiding this comment.
i have been able to get 1.1.8 released so i am changing this to that
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.
Summary
When
importMpiPatient()saves a patient viacreateImportedMpiPatient(), the mpi-clientPatientSynchronizationAdviceAOP fires and spawns aPatientUpdateWorker. This worker re-queries the MPI, discovers golden recordseealsolinks, and triggers a second import — creating a duplicate local patient.savePatient()call increateImportedMpiPatient()withPatientSynchronizationAdvice.SUPPRESSto skip the AOP during importexportPatient()at the end ofimportMpiPatient(), so the AOP-triggered export is redundant anywaympiClientVersionfrom1.1.0to1.1.5-SNAPSHOTto pick up theSUPPRESSThreadLocal flagDepends on IsantePlus/openmrs-module-mpi-client#60.