Details
-
Bug
-
Status: Closed
-
Should
-
Resolution: Fixed
-
2.0
-
None
-
None
Description
Based on the discussion here - https://groups.google.com/a/openmrs.org/forum/#!searchin/dev-archive/Get$20Active$20visit$20via$20REST$20API/dev-archive/2FAgTbT5-c8/4FIo5Tsm2tAJ , it is important that all active visits be added to the VisitResource.
This is also available in the reference application, by clicking on Active Visits after login and the user is able to see all active visits.
This should be available in the /visit endpoint as has been mentioned in the documentation (https://wiki.openmrs.org/display/docs/REST+Web+Service+Resources+in+OpenMRS+1.9#RESTWebServiceResourcesinOpenMRS1.9-Visit), but hasnt been implemented in the resource. The bug fix should be able to retrieve all active visits, but when using the parameter includeinactive=true, then should be able to retrieve non-active visits as well
It should work as follows:
.../visit?patient=uuid => all visits for the patient (with pagination, of course)
.../visit?patient=uuid&active=true => active visits for the patient
.../visit?active=true => all active visits
.../visit? => bad request, not allowed to fetch all visits in the system with no query parameters