From 7ce0acf6b7974d6a965383cbb1433733fe5e4e66 Mon Sep 17 00:00:00 2001 From: Mark Goodrich Date: Fri, 24 May 2024 16:48:32 -0400 Subject: [PATCH] HTML-842: Add Appointments Tag --- .../openmrs/module/htmlformentry/AppointmentsTagTest.java | 8 ++++---- .../module/htmlformentry/widget/AppointmentsWidget.java | 2 +- .../module/htmlformentry/data/appointmentCheckInTest.xml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api-tests/src/test/java/org/openmrs/module/htmlformentry/AppointmentsTagTest.java b/api-tests/src/test/java/org/openmrs/module/htmlformentry/AppointmentsTagTest.java index f259de28c..5307eb8ee 100644 --- a/api-tests/src/test/java/org/openmrs/module/htmlformentry/AppointmentsTagTest.java +++ b/api-tests/src/test/java/org/openmrs/module/htmlformentry/AppointmentsTagTest.java @@ -107,8 +107,8 @@ public void setupRequest(MockHttpServletRequest request, Map wid request.setParameter(widgets.get("Location:"), "2"); request.setParameter(widgets.get("Provider:"), "502"); request.setParameter(widgets.get("Appointments:"), "05f2ad92-1cc8-4cec-bf54-9cac0200746d"); - request.setParameter(widgets.get("Appointments:").replace("_05f2ad92-1cc8-4cec-bf54-9cac0200746d", - "_75504r42-3ca8-11e3-bf2b-0800271c1111"), "75504r42-3ca8-11e3-bf2b-0800271c1111"); + request.setParameter(widgets.get("Appointments:").replace("_1", + "_2"), "75504r42-3ca8-11e3-bf2b-0800271c1111"); } @Override @@ -167,8 +167,8 @@ public String[] widgetLabelsForEdit() { public void setupEditRequest(MockHttpServletRequest request, Map widgets) { request.setParameter(widgets.get("Appointments:"), ""); - request.setParameter(widgets.get("Appointments:").replace("_05f2ad92-1cc8-4cec-bf54-9cac0200746d", - "_75504r42-3ca8-11e3-bf2b-0800271c1111"), "75504r42-3ca8-11e3-bf2b-0800271c1111"); + request.setParameter(widgets.get("Appointments:").replace("_1", + "_2"), "75504r42-3ca8-11e3-bf2b-0800271c1111"); } @Override diff --git a/api/src/main/java/org/openmrs/module/htmlformentry/widget/AppointmentsWidget.java b/api/src/main/java/org/openmrs/module/htmlformentry/widget/AppointmentsWidget.java index d8a0d2b1e..b4c163b45 100644 --- a/api/src/main/java/org/openmrs/module/htmlformentry/widget/AppointmentsWidget.java +++ b/api/src/main/java/org/openmrs/module/htmlformentry/widget/AppointmentsWidget.java @@ -50,7 +50,7 @@ && new DateTime(appointment.getStartDateTime()).withTimeAtStartOfDay() && appointment.getFulfillingEncounters().contains(context.getExistingEncounter())) { checkboxWidget.setInitialValue(appointment.getUuid()); } - context.registerWidget(checkboxWidget, fieldName + "_" + appointment.getUuid()); + context.registerWidget(checkboxWidget, fieldName + "_" + appointment.getId()); checkboxWidgets.add(checkboxWidget); } diff --git a/api/src/test/resources/org/openmrs/module/htmlformentry/data/appointmentCheckInTest.xml b/api/src/test/resources/org/openmrs/module/htmlformentry/data/appointmentCheckInTest.xml index 6484483c4..e4641a9bf 100644 --- a/api/src/test/resources/org/openmrs/module/htmlformentry/data/appointmentCheckInTest.xml +++ b/api/src/test/resources/org/openmrs/module/htmlformentry/data/appointmentCheckInTest.xml @@ -3,8 +3,8 @@ - - - + + +