diff --git a/api/src/main/java/org/openmrs/module/queue/model/QueueEntry.java b/api/src/main/java/org/openmrs/module/queue/model/QueueEntry.java index 9592ffb..28b9e38 100644 --- a/api/src/main/java/org/openmrs/module/queue/model/QueueEntry.java +++ b/api/src/main/java/org/openmrs/module/queue/model/QueueEntry.java @@ -81,10 +81,10 @@ public class QueueEntry extends BaseChangeableOpenmrsData { @JoinColumn(name = "provider_waiting_for", referencedColumnName = "provider_id") private Provider providerWaitingFor; - //The Location the patient is coming from, if any. + //The queue the patient is coming from, if any. @OneToOne - @JoinColumn(name = "location_coming_from", referencedColumnName = "queue_id") - private Queue locationComingFrom; + @JoinColumn(name = "queue_coming_from", referencedColumnName = "queue_id") + private Queue queueComingFrom; @Column(name = "started_at", nullable = false) private Date startedAt; diff --git a/api/src/main/resources/liquibase.xml b/api/src/main/resources/liquibase.xml index 650d168..6da55a7 100644 --- a/api/src/main/resources/liquibase.xml +++ b/api/src/main/resources/liquibase.xml @@ -349,4 +349,27 @@ + + + + + + Rename location_coming_from to queue_coming_from + + + + + + + + Dropping foreign key on location_coming_from in queue_entry table + + + + + + + + + diff --git a/omod/src/main/java/org/openmrs/module/queue/web/resources/QueueEntrySubResource.java b/omod/src/main/java/org/openmrs/module/queue/web/resources/QueueEntrySubResource.java index 596db2a..1b6b450 100644 --- a/omod/src/main/java/org/openmrs/module/queue/web/resources/QueueEntrySubResource.java +++ b/omod/src/main/java/org/openmrs/module/queue/web/resources/QueueEntrySubResource.java @@ -96,7 +96,7 @@ public DelegatingResourceDescription getCreatableProperties() throws ResourceDoe description.addProperty("sortWeight"); description.addProperty("startedAt"); description.addProperty("locationWaitingFor"); - description.addProperty("locationComingFrom"); + description.addProperty("queueComingFrom"); description.addProperty("providerWaitingFor"); return description; } @@ -120,7 +120,7 @@ public DelegatingResourceDescription getRepresentationDescription(Representation resourceDescription.addProperty("patient", Representation.REF); resourceDescription.addProperty("priority", Representation.REF); resourceDescription.addProperty("locationWaitingFor", Representation.REF); - resourceDescription.addProperty("locationComingFrom", Representation.REF); + resourceDescription.addProperty("queueComingFrom", Representation.REF); resourceDescription.addProperty("providerWaitingFor", Representation.REF); resourceDescription.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); } else if (representation instanceof DefaultRepresentation) { @@ -130,7 +130,7 @@ public DelegatingResourceDescription getRepresentationDescription(Representation resourceDescription.addProperty("patient", Representation.DEFAULT); resourceDescription.addProperty("priority", Representation.DEFAULT); resourceDescription.addProperty("locationWaitingFor", Representation.DEFAULT); - resourceDescription.addProperty("locationComingFrom", Representation.DEFAULT); + resourceDescription.addProperty("queueComingFrom", Representation.DEFAULT); resourceDescription.addProperty("providerWaitingFor", Representation.DEFAULT); resourceDescription.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); } else if (representation instanceof FullRepresentation) { @@ -143,7 +143,7 @@ public DelegatingResourceDescription getRepresentationDescription(Representation resourceDescription.addProperty("patient", Representation.FULL); resourceDescription.addProperty("priority", Representation.FULL); resourceDescription.addProperty("locationWaitingFor", Representation.FULL); - resourceDescription.addProperty("locationComingFrom", Representation.FULL); + resourceDescription.addProperty("queueComingFrom", Representation.FULL); resourceDescription.addProperty("providerWaitingFor", Representation.FULL); } else if (representation instanceof CustomRepresentation) { //Let the user decide