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.
AM-159: Add domain object to capure an Appointment Request
Added liquibase script, refactored TimeFrameUnits
- Loading branch information
1 parent
297d0e0
commit 5d424db
Showing
9 changed files
with
181 additions
and
12 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
5 changes: 5 additions & 0 deletions
5
api/src/main/java/org/openmrs/module/appointmentscheduling/TimeFrameUnits.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.openmrs.module.appointmentscheduling; | ||
|
||
public enum TimeFrameUnits { | ||
DAYS, WEEKS, MONTHS, YEARS | ||
} |
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
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
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
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
35 changes: 35 additions & 0 deletions
35
...e/appointmentscheduling/rest/resource/openmrs1_9/AppointmentRequestStatusResource1_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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.openmrs.module.appointmentscheduling.rest.resource.openmrs1_9; | ||
|
||
import org.openmrs.module.appointmentscheduling.AppointmentRequest; | ||
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 | ||
+ "/appointmenttrequeststatus", supportedClass = AppointmentRequest.AppointmentRequestStatus.class, supportedOpenmrsVersions = "1.9.*") | ||
public class AppointmentRequestStatusResource1_9 implements Listable, Searchable { | ||
|
||
@Override | ||
public SimpleObject getAll(RequestContext requestContext) throws ResponseException { | ||
AppointmentRequest.AppointmentRequestStatus[] appointmentRequestStatuses = AppointmentRequest.AppointmentRequestStatus.values(); | ||
SimpleObject simpleObject = new SimpleObject().add("results", appointmentRequestStatuses); | ||
return simpleObject; | ||
} | ||
|
||
@Override | ||
public String getUri(Object o) { | ||
return RestConstants.URI_PREFIX + "/appointmentscheduling/appointmentrequeststatus/" | ||
+ ((AppointmentRequest.AppointmentRequestStatus) o); | ||
} | ||
|
||
@Override | ||
public SimpleObject search(RequestContext requestContext) throws ResponseException { | ||
return null; | ||
} | ||
|
||
} |
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
36 changes: 36 additions & 0 deletions
36
...nmrs/module/appointmentscheduling/rest/resource/openmrs1_9/TimeFrameUnitsResource1_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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.openmrs.module.appointmentscheduling.rest.resource.openmrs1_9; | ||
|
||
import org.openmrs.module.appointmentscheduling.AppointmentRequest; | ||
import org.openmrs.module.appointmentscheduling.TimeFrameUnits; | ||
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 | ||
+ "/timeframeunits", supportedClass = TimeFrameUnits.class, supportedOpenmrsVersions = "1.9.*") | ||
public class TimeFrameUnitsResource1_9 implements Listable, Searchable { | ||
|
||
@Override | ||
public SimpleObject getAll(RequestContext requestContext) throws ResponseException { | ||
TimeFrameUnits[] timeFrameUnits = TimeFrameUnits.values(); | ||
SimpleObject simpleObject = new SimpleObject().add("results", timeFrameUnits); | ||
return simpleObject; | ||
} | ||
|
||
@Override | ||
public String getUri(Object o) { | ||
return RestConstants.URI_PREFIX + "/appointmentscheduling/timeframeunits/" | ||
+ ((AppointmentRequest.AppointmentRequestStatus) o); | ||
} | ||
|
||
@Override | ||
public SimpleObject search(RequestContext requestContext) throws ResponseException { | ||
return null; | ||
} | ||
|
||
} |