From c6a165aa23bd8127cec694083e4301a43b8c4eb5 Mon Sep 17 00:00:00 2001 From: Michael Seaton Date: Wed, 3 Jan 2024 12:43:32 -0500 Subject: [PATCH] O3-2446 - Update Queue resource to support the new priorityConceptSet and statusConceptSet properties, and also to retrieve the allowedPriorities and allowedStatuses concepts. --- .../queue/web/resources/QueueResource.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/omod/src/main/java/org/openmrs/module/queue/web/resources/QueueResource.java b/omod/src/main/java/org/openmrs/module/queue/web/resources/QueueResource.java index 54fb03d..c8e0618 100644 --- a/omod/src/main/java/org/openmrs/module/queue/web/resources/QueueResource.java +++ b/omod/src/main/java/org/openmrs/module/queue/web/resources/QueueResource.java @@ -105,11 +105,19 @@ public DelegatingResourceDescription getRepresentationDescription(Representation this.addSharedResourceDescriptionProperties(resourceDescription); resourceDescription.addProperty("location", Representation.REF); resourceDescription.addProperty("service", Representation.REF); + resourceDescription.addProperty("priorityConceptSet", Representation.REF); + resourceDescription.addProperty("statusConceptSet", Representation.REF); + resourceDescription.addProperty("allowedPriorities", Representation.REF); + resourceDescription.addProperty("allowedStatuses", Representation.REF); resourceDescription.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); } else if (representation instanceof FullRepresentation) { this.addSharedResourceDescriptionProperties(resourceDescription); resourceDescription.addProperty("location", Representation.FULL); resourceDescription.addProperty("service", Representation.FULL); + resourceDescription.addProperty("priorityConceptSet", Representation.REF); + resourceDescription.addProperty("statusConceptSet", Representation.REF); + resourceDescription.addProperty("allowedPriorities", Representation.REF); + resourceDescription.addProperty("allowedStatuses", Representation.REF); resourceDescription.addProperty("auditInfo"); } else if (representation instanceof CustomRepresentation) { //For custom representation, must be null @@ -134,6 +142,8 @@ public DelegatingResourceDescription getCreatableProperties() throws ResourceDoe resourceDescription.addProperty("description"); resourceDescription.addProperty("location"); resourceDescription.addProperty("service"); + resourceDescription.addProperty("priorityConceptSet"); + resourceDescription.addProperty("statusConceptSet"); return resourceDescription; } @@ -156,6 +166,16 @@ public String getDisplay(Queue queue) { return queue.getName(); } + @PropertyGetter("allowedPriorities") + public Object getAllowedPriorities(Queue delegate) { + return services.getAllowedPriorities(delegate); + } + + @PropertyGetter("allowedStatuses") + public Object getAllowedStatuses(Queue delegate) { + return services.getAllowedStatuses(delegate); + } + @Override public String getResourceVersion() { return "2.3";