From 9b0618c6a17b84ae2202d79f0eaae4f0fd848d47 Mon Sep 17 00:00:00 2001 From: sudhanshu_raj Date: Thu, 12 Feb 2026 13:59:23 +0530 Subject: [PATCH 1/2] AM-233 Changed openmrs version to 1.11.6 --- .../rest/resource/openmrs1_9/AppointmentResource1_9.java | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentResource1_9.java b/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentResource1_9.java index 232dc9a1..3f9a9ea2 100644 --- a/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentResource1_9.java +++ b/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentResource1_9.java @@ -24,7 +24,7 @@ import org.openmrs.module.webservices.rest.web.resource.impl.DelegatingResourceDescription; import org.openmrs.module.webservices.rest.web.resource.impl.NeedsPaging; import org.openmrs.module.webservices.rest.web.response.ResponseException; -import org.openmrs.module.webservices.validation.ValidationException; +import org.openmrs.api.ValidationException; import org.springframework.validation.BindException; import org.springframework.validation.Errors; diff --git a/pom.xml b/pom.xml index 285c491d..8010e91d 100644 --- a/pom.xml +++ b/pom.xml @@ -47,7 +47,7 @@ - 1.9.9 + 1.11.6 2.5 0.2.7 1.0 From 9d1786b3f31e4fd7393ffb913ecc9456298447dc Mon Sep 17 00:00:00 2001 From: sudhanshu_raj Date: Sat, 21 Feb 2026 18:17:10 +0530 Subject: [PATCH 2/2] AM-233: Migrate OpenMRS from 1.9.6 to 1.11.6 --- ...PatientToAppointmentDataEvaluatorTest.java | 1 - .../PersonToAppointmentDataEvaluatorTest.java | 1 - .../standardAppointmentTestDataset.xml | 6 +- omod/pom.xml | 2 +- .../AppointmentBlockResource1_9.java | 29 +++++++--- .../AppointmentRequestResource1_9.java | 2 + .../openmrs1_9/AppointmentResource1_9.java | 12 ++-- .../AppointmentStatusHistoryResource1_9.java | 2 + .../ProviderScheduleResource1_9.java | 2 + .../openmrs1_9/TimeSlotResource1_9.java | 16 +++++- ...intmentBlockResource1_9ControllerTest.java | 2 +- ...tmentRequestResource1_9ControllerTest.java | 2 +- .../AppointmentResource1_9ControllerTest.java | 2 +- ...ointmentTypeResource1_9ControllerTest.java | 2 +- .../TimeSlotResource1_9ControllerTest.java | 2 +- ...tmentBlockWithTimeSlotResource1_9Test.java | 8 +-- .../standardWebAppointmentTestDataset.xml | 57 ++++++++++--------- pom.xml | 2 +- 18 files changed, 96 insertions(+), 54 deletions(-) diff --git a/api/src/test/java/org/openmrs/module/appointmentscheduling/reporting/data/evaluator/PatientToAppointmentDataEvaluatorTest.java b/api/src/test/java/org/openmrs/module/appointmentscheduling/reporting/data/evaluator/PatientToAppointmentDataEvaluatorTest.java index a74ccd2e..4ac2dc60 100644 --- a/api/src/test/java/org/openmrs/module/appointmentscheduling/reporting/data/evaluator/PatientToAppointmentDataEvaluatorTest.java +++ b/api/src/test/java/org/openmrs/module/appointmentscheduling/reporting/data/evaluator/PatientToAppointmentDataEvaluatorTest.java @@ -42,7 +42,6 @@ public void evaluate_shouldReturnPatientDataForEachAppointmentInThePassedContext } @Test - @DirtiesContext public void evaluate_shouldReturnPatientDataForNonConfidentialAppointments() throws Exception { Context.becomeUser("butch"); diff --git a/api/src/test/java/org/openmrs/module/appointmentscheduling/reporting/data/evaluator/PersonToAppointmentDataEvaluatorTest.java b/api/src/test/java/org/openmrs/module/appointmentscheduling/reporting/data/evaluator/PersonToAppointmentDataEvaluatorTest.java index b9b12261..b39c0f6c 100644 --- a/api/src/test/java/org/openmrs/module/appointmentscheduling/reporting/data/evaluator/PersonToAppointmentDataEvaluatorTest.java +++ b/api/src/test/java/org/openmrs/module/appointmentscheduling/reporting/data/evaluator/PersonToAppointmentDataEvaluatorTest.java @@ -41,7 +41,6 @@ public void evaluate_shouldReturnPersonDataForEachAppointmentInThePassedContext( } @Test - @DirtiesContext public void evaluate_shouldReturnPersonDataForNonConfidentialAppointments() throws Exception { Context.becomeUser("butch"); diff --git a/api/src/test/resources/standardAppointmentTestDataset.xml b/api/src/test/resources/standardAppointmentTestDataset.xml index d32c0600..76b87844 100644 --- a/api/src/test/resources/standardAppointmentTestDataset.xml +++ b/api/src/test/resources/standardAppointmentTestDataset.xml @@ -1,5 +1,9 @@ + + + + @@ -54,7 +58,7 @@ - + diff --git a/omod/pom.xml b/omod/pom.xml index 95b17900..1d950b2d 100644 --- a/omod/pom.xml +++ b/omod/pom.xml @@ -43,7 +43,7 @@ org.openmrs.module - webservices.rest-omod + webservices.rest-omod-1.11 ${webservicesRestVersion} provided diff --git a/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentBlockResource1_9.java b/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentBlockResource1_9.java index 9c2362d5..7f728f9c 100644 --- a/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentBlockResource1_9.java +++ b/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentBlockResource1_9.java @@ -7,10 +7,11 @@ import org.openmrs.module.appointmentscheduling.api.AppointmentService; import org.openmrs.module.appointmentscheduling.rest.controller.AppointmentRestController; import org.openmrs.module.appointmentscheduling.rest.resource.openmrs1_9.util.AppointmentRestUtils; -import org.openmrs.module.webservices.rest.web.ConversionUtil; -import org.openmrs.module.webservices.rest.web.RequestContext; -import org.openmrs.module.webservices.rest.web.RestConstants; -import org.openmrs.module.webservices.rest.web.annotation.Resource; +import org.openmrs.module.webservices.rest.web.ConversionUtil; +import org.openmrs.module.webservices.rest.web.RequestContext; +import org.openmrs.module.webservices.rest.web.RestConstants; +import org.openmrs.module.webservices.rest.web.annotation.PropertyGetter; +import org.openmrs.module.webservices.rest.web.annotation.Resource; import org.openmrs.module.webservices.rest.web.representation.DefaultRepresentation; import org.openmrs.module.webservices.rest.web.representation.FullRepresentation; import org.openmrs.module.webservices.rest.web.representation.Representation; @@ -145,9 +146,21 @@ protected PageableResult doSearch(RequestContext context) { } - public String getDisplayString(AppointmentBlock appointmentBlock) { - return appointmentBlock.getProvider() + ", " + appointmentBlock.getLocation() + ": " - + appointmentBlock.getStartDate() + " - " + appointmentBlock.getEndDate(); - } + @PropertyGetter("display") + public String getDisplayString(AppointmentBlock appointmentBlock) { + String providerName = ""; + if (appointmentBlock.getProvider() != null && appointmentBlock.getProvider().getPerson() != null + && appointmentBlock.getProvider().getPerson().getPersonName() != null) { + String fullName = appointmentBlock.getProvider().getPerson().getPersonName().getFullName(); + String suffix = appointmentBlock.getProvider().getPerson().getPersonName().getFamilyNameSuffix(); + if (suffix != null && suffix.trim().length() > 0) { + providerName = fullName + " " + suffix.trim(); + } else { + providerName = fullName; + } + } + return providerName + ", " + appointmentBlock.getLocation() + ": " + + appointmentBlock.getStartDate() + " - " + appointmentBlock.getEndDate(); + } } diff --git a/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentRequestResource1_9.java b/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentRequestResource1_9.java index 8f0666c5..d80e9ce3 100644 --- a/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentRequestResource1_9.java +++ b/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentRequestResource1_9.java @@ -9,6 +9,7 @@ import org.openmrs.module.appointmentscheduling.rest.controller.AppointmentRestController; import org.openmrs.module.webservices.rest.web.RequestContext; import org.openmrs.module.webservices.rest.web.RestConstants; +import org.openmrs.module.webservices.rest.web.annotation.PropertyGetter; import org.openmrs.module.webservices.rest.web.annotation.Resource; import org.openmrs.module.webservices.rest.web.representation.DefaultRepresentation; import org.openmrs.module.webservices.rest.web.representation.FullRepresentation; @@ -160,6 +161,7 @@ protected NeedsPaging doGetAll(RequestContext context) { context.getIncludeAll()), context); } + @PropertyGetter("display") public String getDisplayString(AppointmentRequest appointmentRequest) { return appointmentRequest.getAppointmentType().getName() + " : " + appointmentRequest.getStatus(); } diff --git a/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentResource1_9.java b/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentResource1_9.java index 3f9a9ea2..a29178ec 100644 --- a/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentResource1_9.java +++ b/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentResource1_9.java @@ -15,7 +15,8 @@ import org.openmrs.module.webservices.rest.web.ConversionUtil; import org.openmrs.module.webservices.rest.web.RequestContext; import org.openmrs.module.webservices.rest.web.RestConstants; -import org.openmrs.module.webservices.rest.web.annotation.Resource; +import org.openmrs.module.webservices.rest.web.annotation.Resource; +import org.openmrs.module.webservices.rest.web.annotation.PropertyGetter; import org.openmrs.module.webservices.rest.web.representation.DefaultRepresentation; import org.openmrs.module.webservices.rest.web.representation.FullRepresentation; import org.openmrs.module.webservices.rest.web.representation.Representation; @@ -253,7 +254,8 @@ private List getStatusList(String[] statuses) { return statusList; } - public String getDisplayString(PatientAppointment appointment) { - return appointment.getAppointmentType().getName() + " : " + appointment.getStatus(); - } -} + @PropertyGetter("display") + public String getDisplayString(PatientAppointment appointment) { + return appointment.getAppointmentType().getName() + " : " + appointment.getStatus(); + } +} diff --git a/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentStatusHistoryResource1_9.java b/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentStatusHistoryResource1_9.java index ba5edc38..361ed120 100644 --- a/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentStatusHistoryResource1_9.java +++ b/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentStatusHistoryResource1_9.java @@ -7,6 +7,7 @@ import org.openmrs.module.appointmentscheduling.rest.controller.AppointmentRestController; import org.openmrs.module.webservices.rest.web.RequestContext; import org.openmrs.module.webservices.rest.web.RestConstants; +import org.openmrs.module.webservices.rest.web.annotation.PropertyGetter; import org.openmrs.module.webservices.rest.web.annotation.Resource; import org.openmrs.module.webservices.rest.web.representation.DefaultRepresentation; import org.openmrs.module.webservices.rest.web.representation.FullRepresentation; @@ -82,6 +83,7 @@ protected PageableResult doSearch(RequestContext context) { return new NeedsPaging(Context.getService(AppointmentService.class).getAppointmentStatusHistories(appointment), context); } + @PropertyGetter("display") public String getDisplayString(AppointmentStatusHistory statusHistory) { return statusHistory.getStartDate() + " "+statusHistory.getEndDate(); } diff --git a/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/ProviderScheduleResource1_9.java b/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/ProviderScheduleResource1_9.java index 76763b1f..8c2786f7 100644 --- a/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/ProviderScheduleResource1_9.java +++ b/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/ProviderScheduleResource1_9.java @@ -10,6 +10,7 @@ import org.openmrs.module.appointmentscheduling.rest.resource.openmrs1_9.util.AppointmentRestUtils; import org.openmrs.module.webservices.rest.web.RequestContext; import org.openmrs.module.webservices.rest.web.RestConstants; +import org.openmrs.module.webservices.rest.web.annotation.PropertyGetter; import org.openmrs.module.webservices.rest.web.annotation.Resource; import org.openmrs.module.webservices.rest.web.representation.DefaultRepresentation; import org.openmrs.module.webservices.rest.web.representation.FullRepresentation; @@ -131,6 +132,7 @@ protected PageableResult doSearch(RequestContext context) { } + @PropertyGetter("display") public String getDisplayString(ProviderSchedule schedule) { return schedule.getLocation() + ": " + schedule.getStartTime() + " - " + schedule.getEndTime(); diff --git a/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/TimeSlotResource1_9.java b/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/TimeSlotResource1_9.java index c2ca7d48..a538ac7d 100644 --- a/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/TimeSlotResource1_9.java +++ b/omod/src/main/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/TimeSlotResource1_9.java @@ -11,6 +11,7 @@ import org.openmrs.module.webservices.rest.web.ConversionUtil; import org.openmrs.module.webservices.rest.web.RequestContext; import org.openmrs.module.webservices.rest.web.RestConstants; +import org.openmrs.module.webservices.rest.web.annotation.PropertyGetter; import org.openmrs.module.webservices.rest.web.annotation.Resource; import org.openmrs.module.webservices.rest.web.representation.DefaultRepresentation; import org.openmrs.module.webservices.rest.web.representation.FullRepresentation; @@ -157,8 +158,21 @@ protected PageableResult doSearch(RequestContext context) { } + @PropertyGetter("display") public String getDisplayString(TimeSlot timeSlot) { - return timeSlot.getAppointmentBlock().getProvider() + ", " + timeSlot.getAppointmentBlock().getLocation() + ": " + String providerName = ""; + if (timeSlot.getAppointmentBlock().getProvider() != null + && timeSlot.getAppointmentBlock().getProvider().getPerson() != null + && timeSlot.getAppointmentBlock().getProvider().getPerson().getPersonName() != null) { + String fullName = timeSlot.getAppointmentBlock().getProvider().getPerson().getPersonName().getFullName(); + String suffix = timeSlot.getAppointmentBlock().getProvider().getPerson().getPersonName().getFamilyNameSuffix(); + if (suffix != null && suffix.trim().length() > 0) { + providerName = fullName + " " + suffix.trim(); + } else { + providerName = fullName; + } + } + return providerName + ", " + timeSlot.getAppointmentBlock().getLocation() + ": " + timeSlot.getStartDate() + " - " + timeSlot.getEndDate(); } diff --git a/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/AppointmentBlockResource1_9ControllerTest.java b/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/AppointmentBlockResource1_9ControllerTest.java index 440e0322..3a960243 100644 --- a/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/AppointmentBlockResource1_9ControllerTest.java +++ b/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/AppointmentBlockResource1_9ControllerTest.java @@ -149,7 +149,7 @@ public void shouldPurgeAnAppointmentBlock() throws Exception { int originalCount = 5; MockHttpServletRequest req = request(RequestMethod.DELETE, getURI() + "/759799ab-c9a5-435e-b671-77773ada7410"); - req.addParameter("purge", ""); + req.addParameter("purge", "true"); req.addParameter("reason", "really ridiculous random reason"); handle(req); diff --git a/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/AppointmentRequestResource1_9ControllerTest.java b/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/AppointmentRequestResource1_9ControllerTest.java index 6a7d19e8..8d2c205c 100644 --- a/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/AppointmentRequestResource1_9ControllerTest.java +++ b/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/AppointmentRequestResource1_9ControllerTest.java @@ -138,7 +138,7 @@ public void shouldVoidAnAppointment() throws Exception { public void shouldPurgeAnAppointment() throws Exception { MockHttpServletRequest req = request(RequestMethod.DELETE, getURI() + "/" + getUuid()); - req.addParameter("purge", ""); + req.addParameter("purge", "true"); req.addParameter("reason", "really ridiculous random reason"); handle(req); diff --git a/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/AppointmentResource1_9ControllerTest.java b/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/AppointmentResource1_9ControllerTest.java index 1c29a689..ac592f46 100644 --- a/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/AppointmentResource1_9ControllerTest.java +++ b/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/AppointmentResource1_9ControllerTest.java @@ -168,7 +168,7 @@ public void shouldPurgeAnAppointment() throws Exception { MockHttpServletRequest req = request(RequestMethod.DELETE, getURI() + "/" + getUuid()); - req.addParameter("purge", ""); + req.addParameter("purge", "true"); req.addParameter("reason", "really ridiculous random reason"); handle(req); diff --git a/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/AppointmentTypeResource1_9ControllerTest.java b/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/AppointmentTypeResource1_9ControllerTest.java index 93809860..96ac22a0 100644 --- a/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/AppointmentTypeResource1_9ControllerTest.java +++ b/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/AppointmentTypeResource1_9ControllerTest.java @@ -108,7 +108,7 @@ public void shouldPurgeAnAppointmentType() throws Exception { int originalCount = 4; MockHttpServletRequest req = request(RequestMethod.DELETE, getURI() + "/759799ab-c9a5-435e-b671-77373ada74e6"); - req.addParameter("purge", ""); + req.addParameter("purge", "true"); req.addParameter("reason", "really ridiculous random reason"); handle(req); diff --git a/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/TimeSlotResource1_9ControllerTest.java b/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/TimeSlotResource1_9ControllerTest.java index c0ca9bb3..d6a2daf4 100644 --- a/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/TimeSlotResource1_9ControllerTest.java +++ b/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/controller/TimeSlotResource1_9ControllerTest.java @@ -131,7 +131,7 @@ public void shouldPurgeATimeSlot() throws Exception { int originalCount = 8; MockHttpServletRequest req = request(RequestMethod.DELETE, getURI() + "/c0c579b0-8e59-401d-8a4a-976a0b183607"); - req.addParameter("purge", ""); + req.addParameter("purge", "true"); req.addParameter("reason", "really ridiculous random reason"); handle(req); diff --git a/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentBlockWithTimeSlotResource1_9Test.java b/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentBlockWithTimeSlotResource1_9Test.java index 37295246..7cd21769 100644 --- a/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentBlockWithTimeSlotResource1_9Test.java +++ b/omod/src/test/java/org/openmrs/module/appointmentscheduling/rest/resource/openmrs1_9/AppointmentBlockWithTimeSlotResource1_9Test.java @@ -48,10 +48,10 @@ public void validateFullRepresentation() throws Exception { assertPropPresent("auditInfo"); } - @Override - public String getDisplayProperty() { - return "Mr. Horatio Test Hornblower Esq., Xanadu: 2005-01-03 00:00:00.0 - 2005-01-03 11:00:00.0"; - } + @Override + public String getDisplayProperty() { + return "Mr. Horatio Test Hornblower Esq., Xanadu: 2005-01-03 00:00:00.0 - 2005-01-03 11:00:00.0"; + } @Override public String getUuidProperty() { diff --git a/omod/src/test/resources/standardWebAppointmentTestDataset.xml b/omod/src/test/resources/standardWebAppointmentTestDataset.xml index 82f9cfd0..35655264 100644 --- a/omod/src/test/resources/standardWebAppointmentTestDataset.xml +++ b/omod/src/test/resources/standardWebAppointmentTestDataset.xml @@ -1,5 +1,22 @@ + + + + + + + + + + + + + + + + + @@ -8,43 +25,34 @@ - - + + + - - - - - + - + - - + + - - - - + + + + - - - - - - @@ -58,13 +66,10 @@ - - - + + + - - - diff --git a/pom.xml b/pom.xml index 8010e91d..655d87f6 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,7 @@ 1.11.6 - 2.5 + 2.23.0 0.2.7 1.0 0.9.2