forked from openmrs/openmrs-module-appointmentscheduling
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HUM-1173, serialize appointment status type
- Loading branch information
Showing
2 changed files
with
35 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 34 additions & 39 deletions
73
...dule/appointmentscheduling/rest/resource/openmrs1_9/AppointmentStatusTypeResource1_9.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,34 @@ | ||
package org.openmrs.module.appointmentscheduling.rest.resource.openmrs1_9; | ||
|
||
import org.openmrs.module.appointmentscheduling.rest.controller.AppointmentRestController; | ||
import org.openmrs.module.webservices.rest.SimpleObject; | ||
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.resource.api.Listable; | ||
import org.openmrs.module.webservices.rest.web.resource.api.Searchable; | ||
import org.openmrs.module.webservices.rest.web.response.ResponseException; | ||
|
||
import static org.openmrs.module.appointmentscheduling.Appointment.AppointmentStatusType; | ||
|
||
@Resource(name = RestConstants.VERSION_1 | ||
+ AppointmentRestController.APPOINTMENT_SCHEDULING_REST_NAMESPACE | ||
+ "/appointmentstatustype", supportedClass = AppointmentStatusTypeResource1_9.class, supportedOpenmrsVersions = "1.9.*") | ||
public class AppointmentStatusTypeResource1_9 implements Listable, Searchable { | ||
|
||
@Override | ||
public SimpleObject getAll(RequestContext requestContext) | ||
throws ResponseException { | ||
AppointmentStatusType[] appointmentStatusType = AppointmentStatusType | ||
.values(); | ||
SimpleObject simpleObject = new SimpleObject().add("results", | ||
appointmentStatusType); | ||
return simpleObject; | ||
} | ||
|
||
@Override | ||
public String getUri(Object o) { | ||
return RestConstants.URI_PREFIX + "/appointmentscheduling/appointmentstatustype"; | ||
} | ||
|
||
@Override | ||
public SimpleObject search(RequestContext requestContext) | ||
throws ResponseException { | ||
return null; | ||
} | ||
} | ||
package org.openmrs.module.appointmentscheduling.rest.resource.openmrs1_9; | ||
|
||
import org.openmrs.module.appointmentscheduling.Appointment; | ||
import org.openmrs.module.appointmentscheduling.rest.controller.AppointmentRestController; | ||
import org.openmrs.module.webservices.rest.SimpleObject; | ||
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.resource.api.Listable; | ||
import org.openmrs.module.webservices.rest.web.resource.api.Searchable; | ||
import org.openmrs.module.webservices.rest.web.response.ResponseException; | ||
|
||
@Resource(name = RestConstants.VERSION_1 + AppointmentRestController.APPOINTMENT_SCHEDULING_REST_NAMESPACE | ||
+ "/appointmentstatustype", supportedClass = AppointmentStatusTypeResource1_9.class, supportedOpenmrsVersions = "1.9.*") | ||
public class AppointmentStatusTypeResource1_9 implements Listable, Searchable { | ||
|
||
@Override | ||
public SimpleObject getAll(RequestContext requestContext) throws ResponseException { | ||
Appointment.AppointmentStatusType[] appointmentStatusType = Appointment.AppointmentStatusType.values(); | ||
SimpleObject simpleObject = new SimpleObject().add("results", appointmentStatusType); | ||
return simpleObject; | ||
} | ||
|
||
@Override | ||
public String getUri(Object o) { | ||
return RestConstants.URI_PREFIX + "/appointmentscheduling/appointmentstatustype/" | ||
+ ((Appointment.AppointmentStatusType) o); | ||
} | ||
|
||
@Override | ||
public SimpleObject search(RequestContext requestContext) throws ResponseException { | ||
return null; | ||
} | ||
} |