From 0f9e11ef3b2568126da51f58a1a795b10ec56790 Mon Sep 17 00:00:00 2001 From: Michael Seaton Date: Mon, 6 May 2024 14:52:11 -0400 Subject: [PATCH] Attempt to fix intermittent error with transient object saving --- .../module/emrapi/visit/VisitDomainWrapperComponentTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/test/java/org/openmrs/module/emrapi/visit/VisitDomainWrapperComponentTest.java b/api/src/test/java/org/openmrs/module/emrapi/visit/VisitDomainWrapperComponentTest.java index 3ef658e7..201f5c1e 100644 --- a/api/src/test/java/org/openmrs/module/emrapi/visit/VisitDomainWrapperComponentTest.java +++ b/api/src/test/java/org/openmrs/module/emrapi/visit/VisitDomainWrapperComponentTest.java @@ -234,6 +234,7 @@ protected List createRandomEncountersWithDiagnoses(int count, double lastTime = obs.getObsDatetime().getTime(); } } + Context.getEncounterService().saveEncounter(e); encounters.add(e); } @@ -272,7 +273,6 @@ public void getUniqueDiagnoses_shouldConvergeWithLegacyImpl() throws ParseExcept List encounters = createRandomEncountersWithDiagnoses(50, 0.15, 2, visit, patient, emrApiProperties.getVisitNoteEncounterType(), sampleDiagnoses); for (Encounter e : encounters) { visit.addEncounter(e); - Context.getEncounterService().saveEncounter(e); } visit = Context.getVisitService().saveVisit(visit); VisitDomainWrapper visitDomainWrapper = factory.newVisitDomainWrapper( visit );