• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openmrs / openmrs-core / 27660627112
64%
master: 65%

Build:
Build:
LAST BUILD BRANCH: 2.9.x
DEFAULT BRANCH: master
Ran 17 Jun 2026 02:04AM UTC
Jobs 1
Files 852
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Jun 2026 01:57AM UTC coverage: 63.664% (+0.2%) from 63.512%
27660627112

push

github

web-flow
mergePatients does not reassign Conditions, Allergies, or MedicationDispenses to the surviving patient (#6198)

* mergePatients now reassigns Conditions, Allergies and MedicationDispenses to the surviving patient

PatientServiceImpl.mergePatients had no reassignment helpers for the
patient-scoped Conditions, Allergies and MedicationDispenses tables, which
were added to core after the merge logic was written. After a merge these
clinical records stayed attached to the now-voided non-preferred patient and
silently disappeared from the surviving patient's record - a clinical-data-loss
and patient-safety concern (e.g. a hidden allergy).

Add mergeConditions, mergeAllergies and mergeMedicationDispenses helpers that
move each non-voided record from the non-preferred to the preferred patient via
the corresponding services, mirroring the existing
mergeObservationsNotContainedInEncounters pattern. Saving through the services
keeps the changes audited and emits the normal save events. The moves are
recorded in new PersonMergeLogData collections so they appear in the
PersonMergeLog.

Allergies are deduplicated by allergen: an allergy whose allergen the preferred
patient already records is not moved, because a patient cannot hold two
allergies for the same allergen and a duplicate would make the survivor's
allergy list fail to load afterwards.

Fixes #6194

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Keep @since on the new PersonMergeLogData accessors only, not the private fields

The moved* fields are private (not API and not rendered by Javadoc), so the
field-level @since 2.9.0 tags were redundant. The public getters/adders keep
@since 2.9.0, matching the codebase convention (Patient, Condition, Allergy
attach @since to accessors, not backing fields).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

52 of 55 new or added lines in 2 files covered. (94.55%)

3 existing lines in 2 files now uncovered.

23909 of 37555 relevant lines covered (63.66%)

0.64 hits per line

Uncovered Changes

Lines Coverage ∆ File
3
93.48
-1.39% api/src/main/java/org/openmrs/person/PersonMergeLogData.java

Coverage Regressions

Lines Coverage ∆ File
2
42.55
-4.26% api/src/main/java/org/openmrs/ConceptAnswer.java
1
85.29
-1.47% api/src/main/java/org/openmrs/util/HandlerUtil.java
Jobs
ID Job ID Ran Files Coverage
1 27660627112.1 17 Jun 2026 02:04AM UTC 852
63.66
Source Files on build 27660627112
  • Tree
  • List 852
  • Changed 7
  • Source Changed 3
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #27660627112
  • 51422097 on github
  • Prev Build on 2.9.x (#27437461033)
  • Next Build on 2.9.x (#27688009154)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc