diff --git a/omod-1.10/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_10/OrderResource1_10.java b/omod-1.10/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_10/OrderResource1_10.java index d9da69039..440bb8332 100644 --- a/omod-1.10/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_10/OrderResource1_10.java +++ b/omod-1.10/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_10/OrderResource1_10.java @@ -9,11 +9,12 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_10; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.DateProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.Date; +import java.util.List; + import org.apache.commons.lang.StringUtils; import org.openmrs.CareSetting; import org.openmrs.Order; @@ -39,11 +40,11 @@ import org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8.OrderResource1_8; import org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8.PatientResource1_8; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.List; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.DateProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; /** * {@link org.openmrs.module.webservices.rest.web.annotation.Resource} for {@link org.openmrs.Order} @@ -145,9 +146,10 @@ public Model getCREATEModel(Representation rep) { .property("concept", new RefProperty("#/definitions/ConceptCreate")) .property("orderer", new RefProperty("#/definitions/UserCreate")) .property("previousOrder", new RefProperty("#/definitions/OrderCreate")) - .property("orderReason", new RefProperty("#/definitions/ConceptCreate")); + .property("orderReason", new RefProperty("#/definitions/ConceptCreate")) + .property("careSetting", new RefProperty("#/definitions/CareSettingCreate")); } - //FIXME missing prop: type + return model; } diff --git a/omod-1.10/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_10/OrderTypeResource1_10.java b/omod-1.10/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_10/OrderTypeResource1_10.java index d644f63d3..1604c068c 100644 --- a/omod-1.10/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_10/OrderTypeResource1_10.java +++ b/omod-1.10/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_10/OrderTypeResource1_10.java @@ -13,11 +13,6 @@ import java.util.List; import java.util.regex.Pattern; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; import org.openmrs.OrderType; import org.openmrs.api.context.Context; import org.openmrs.module.webservices.rest.web.RequestContext; @@ -32,6 +27,12 @@ import org.openmrs.module.webservices.rest.web.resource.impl.NeedsPaging; import org.openmrs.module.webservices.rest.web.response.ResponseException; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.ArrayProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; + /** * {@link Resource} for {@link org.openmrs.OrderType}, supporting standard CRUD operations */ @@ -175,7 +176,7 @@ public Model getGETModel(Representation rep) { public Model getCREATEModel(Representation rep) { return ((ModelImpl) super.getCREATEModel(rep)) .property("javaClassName", new StringProperty()) - .property("parent", new StringProperty().example("uuid")) //FIXME type + .property("parent", new StringProperty().example("uuid")) .property("conceptClasses", new ArrayProperty(new StringProperty().example("uuid"))) .required("javaClassName"); diff --git a/omod-1.10/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_10/ProgramEnrollmentResource1_10.java b/omod-1.10/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_10/ProgramEnrollmentResource1_10.java index ffec734fd..983dc98a8 100644 --- a/omod-1.10/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_10/ProgramEnrollmentResource1_10.java +++ b/omod-1.10/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_10/ProgramEnrollmentResource1_10.java @@ -9,12 +9,12 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_10; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.BooleanProperty; -import io.swagger.models.properties.DateProperty; -import io.swagger.models.properties.RefProperty; +import java.util.Collections; +import java.util.Comparator; +import java.util.Date; +import java.util.List; +import java.util.Set; + import org.openmrs.PatientProgram; import org.openmrs.PatientState; import org.openmrs.api.context.Context; @@ -29,11 +29,12 @@ import org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8.ProgramEnrollmentResource1_8; import org.openmrs.util.OpenmrsUtil; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.List; -import java.util.Set; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.ArrayProperty; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.DateProperty; +import io.swagger.models.properties.RefProperty; @Resource(name = RestConstants.VERSION_1 + "/programenrollment", supportedClass = PatientProgram.class, supportedOpenmrsVersions = { "1.10.*", "1.11.*", "1.12.*", "2.0.*", "2.1.*", "2.2.*", "2.3.*" }) @@ -113,7 +114,7 @@ public Model getCREATEModel(Representation rep) { @Override public Model getUPDATEModel(Representation rep) { - return new ModelImpl() //FIXME use super. + return ((ModelImpl) super.getUPDATEModel(rep)) .property("dateEnrolled", new DateProperty()) .property("states", new ArrayProperty(new RefProperty("#/definitions/ProgramenrollmentStateCreate"))) .property("outcome", new RefProperty("#/definitions/ConceptCreate")) diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/BaseActiveListItemResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/BaseActiveListItemResource1_8.java index 9ef1b74c0..ca3828c8a 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/BaseActiveListItemResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/BaseActiveListItemResource1_8.java @@ -9,12 +9,6 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.BooleanProperty; -import io.swagger.models.properties.DateProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; import org.openmrs.activelist.ActiveListItem; import org.openmrs.api.context.Context; import org.openmrs.module.webservices.rest.web.RequestContext; @@ -26,6 +20,13 @@ import org.openmrs.module.webservices.rest.web.resource.impl.DelegatingResourceDescription; import org.openmrs.module.webservices.rest.web.response.ResponseException; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.DateProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; + /** * Subclass of {@link DataDelegatingCrudResource} with helper methods specific to * {@link ActiveListItem} @@ -90,6 +91,7 @@ public DelegatingResourceDescription getRepresentationDescription(Representation return null; } + @Override public Model getGETModel(Representation rep) { ModelImpl model = ((ModelImpl) super.getGETModel(rep)) .property("uuid", new StringProperty()) @@ -101,13 +103,13 @@ public Model getGETModel(Representation rep) { if (rep instanceof DefaultRepresentation) { model .property("person", new RefProperty("#/definitions/PersonGet")) - .property("activeListType", new StringProperty()) //FIXME type + .property("activeListType", new RefProperty("#/definitionsActiveListType/Ref")) .property("startObs", new RefProperty("#/definitions/ObsGet")) .property("stopObs", new RefProperty("#/definitions/ObsGetRef")); } else if (rep instanceof FullRepresentation) { model .property("person", new RefProperty("#/definitions/PersonGetRef")) - .property("activeListType", new StringProperty()) //FIXME type + .property("activeListType", new RefProperty("#/definitionsActiveListType/Ref")) .property("startObs", new RefProperty("#/definitions/ObsGetRef")) .property("stopObs", new RefProperty("#/definitions/ObsGetRef")); } diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/CohortResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/CohortResource1_8.java index e0b9fb97b..919abe9cf 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/CohortResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/CohortResource1_8.java @@ -11,11 +11,6 @@ import java.util.List; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.IntegerProperty; -import io.swagger.models.properties.StringProperty; import org.openmrs.Cohort; import org.openmrs.api.context.Context; import org.openmrs.module.webservices.rest.web.RequestContext; @@ -30,6 +25,12 @@ import org.openmrs.module.webservices.rest.web.resource.impl.NeedsPaging; import org.openmrs.module.webservices.rest.web.response.ResponseException; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.ArrayProperty; +import io.swagger.models.properties.IntegerProperty; +import io.swagger.models.properties.StringProperty; + /** * {@link Resource} for Cohorts, supporting standard CRUD operations */ @@ -92,6 +93,7 @@ public DelegatingResourceDescription getRepresentationDescription(Representation return null; } + @Override public Model getGETModel(Representation rep) { ModelImpl model = ((ModelImpl) super.getGETModel(rep)); if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { @@ -101,7 +103,7 @@ public Model getGETModel(Representation rep) { .property("name", new StringProperty()) .property("description", new StringProperty()) .property("voided", new StringProperty()) - .property("memberIds", new ArrayProperty(new IntegerProperty())); //FIXME + .property("memberIds", new ArrayProperty(new IntegerProperty())); } return model; } @@ -111,7 +113,7 @@ public Model getCREATEModel(Representation rep) { return new ModelImpl() .property("name", new StringProperty()) .property("description", new StringProperty()) - .property("memberIds", new ArrayProperty(new IntegerProperty())) //FIXME + .property("memberIds", new ArrayProperty(new IntegerProperty())) .required("name").required("description").required("memberIds"); } diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ConceptMapResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ConceptMapResource1_8.java index 798d54364..c4bd9a92e 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ConceptMapResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ConceptMapResource1_8.java @@ -12,9 +12,6 @@ import java.util.ArrayList; import java.util.List; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.StringProperty; import org.openmrs.Concept; import org.openmrs.ConceptMap; import org.openmrs.api.context.Context; @@ -34,6 +31,10 @@ import org.openmrs.module.webservices.rest.web.response.ResourceDoesNotSupportOperationException; import org.openmrs.module.webservices.rest.web.response.ResponseException; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.StringProperty; + /** * {@link Resource} for ConceptMaps, supporting standard CRUD operations */ @@ -65,19 +66,20 @@ public DelegatingResourceDescription getRepresentationDescription(Representation return null; } + @Override public Model getGETModel(Representation rep) { ModelImpl modelImpl = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation) { modelImpl .property("display", new StringProperty()) .property("uuid", new StringProperty()) - .property("source", new StringProperty()) //FIXME + .property("source", new StringProperty()) .property("sourceCode", new StringProperty()); } else if (rep instanceof FullRepresentation) { modelImpl .property("display", new StringProperty()) .property("uuid", new StringProperty()) - .property("source", new StringProperty()) //FIXME + .property("source", new StringProperty()) .property("sourceCode", new StringProperty()) .property("comment", new StringProperty()); } diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ConceptNameResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ConceptNameResource1_8.java index 8088f9f54..996cd5fcd 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ConceptNameResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ConceptNameResource1_8.java @@ -13,10 +13,6 @@ import java.util.Date; import java.util.List; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.BooleanProperty; -import io.swagger.models.properties.StringProperty; import org.openmrs.Concept; import org.openmrs.ConceptName; import org.openmrs.api.ConceptNameType; @@ -35,6 +31,11 @@ import org.openmrs.module.webservices.rest.web.resource.impl.NeedsPaging; import org.openmrs.module.webservices.rest.web.response.ResponseException; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.StringProperty; + /** * {@link Resource} for ConceptNames, supporting standard CRUD operations */ @@ -70,6 +71,7 @@ public DelegatingResourceDescription getRepresentationDescription(Representation return null; } + @Override public Model getGETModel(Representation rep) { ModelImpl model = ((ModelImpl) super.getGETModel(rep)) .property("uuid", new StringProperty()) @@ -98,7 +100,11 @@ public Model getCREATEModel(Representation rep) { @Override public Model getUPDATEModel(Representation representation) { return new ModelImpl() - .property("name", new StringProperty()); //FIXME missing props + + + .property("name", new StringProperty()) + .property("localePreferred", new BooleanProperty()) + .property("locale", new StringProperty().example("en")); } /** diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ConceptResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ConceptResource1_8.java index 75596867a..1787e2a6c 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ConceptResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ConceptResource1_8.java @@ -9,13 +9,19 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.BooleanProperty; -import io.swagger.models.properties.ObjectProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Objects; +import java.util.Set; + import org.apache.commons.lang.StringUtils; import org.openmrs.Concept; import org.openmrs.ConceptAnswer; @@ -53,18 +59,13 @@ import org.openmrs.module.webservices.rest.web.response.ResponseException; import org.openmrs.util.LocaleUtility; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Locale; -import java.util.Objects; -import java.util.Set; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.ArrayProperty; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.ObjectProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; /** * {@link Resource} for {@link Concept}, supporting standard CRUD operations @@ -216,6 +217,7 @@ public DelegatingResourceDescription getRepresentationDescription(Representation return null; } + @Override public Model getGETModel(Representation rep) { ModelImpl modelImpl = ((ModelImpl) super.getGETModel(rep)) .property("uuid", new StringProperty()) @@ -228,11 +230,11 @@ public Model getGETModel(Representation rep) { .property("set", new BooleanProperty()) .property("version", new StringProperty()) .property("retired", new BooleanProperty()) - .property("names", new ArrayProperty(new RefProperty("#/definitions/ConceptNameGetRef"))) //FIXME - .property("descriptions", new ArrayProperty(new RefProperty("#/definitions/ConceptDescriptionGetRef"))) //FIXME - .property("mappings", new ArrayProperty(new RefProperty("#/definitions/ConceptMappingGetRef"))) //FIXME - .property("answers", new ArrayProperty(new ObjectProperty())) //FIXME - .property("setMembers", new ArrayProperty(new ObjectProperty())); //FIXME + .property("names", new ArrayProperty(new RefProperty("#/definitions/ConceptNameGetRef"))) + .property("descriptions", new ArrayProperty(new RefProperty("#/definitions/ConceptDescriptionGetRef"))) + .property("mappings", new ArrayProperty(new RefProperty("#/definitions/ConceptMappingGetRef"))) + .property("answers", new ArrayProperty(new RefProperty("#/definitions/ConceptAnswersGetRef"))) + .property("setMembers", new ArrayProperty(new ObjectProperty())); } return modelImpl; } diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/DrugResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/DrugResource1_8.java index eaff899a9..7da634fd7 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/DrugResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/DrugResource1_8.java @@ -9,12 +9,8 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.BooleanProperty; -import io.swagger.models.properties.DoubleProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; +import java.util.List; + import org.openmrs.Drug; import org.openmrs.api.context.Context; import org.openmrs.module.webservices.rest.web.RequestContext; @@ -30,7 +26,12 @@ import org.openmrs.module.webservices.rest.web.resource.impl.NeedsPaging; import org.openmrs.module.webservices.rest.web.response.ResponseException; -import java.util.List; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.DoubleProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; /** * {@link Resource} for {@link Drug}, supporting standard CRUD operations @@ -120,6 +121,7 @@ public DelegatingResourceDescription getRepresentationDescription(Representation return null; } + @Override public Model getGETModel(Representation rep) { ModelImpl modelImpl = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { @@ -168,7 +170,7 @@ public Model getCREATEModel(Representation rep) { @Override public Model getUPDATEModel(Representation rep) { - return getCREATEModel(rep); //FIXME no updatableProperties() + return getCREATEModel(rep); } /** diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/EncounterResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/EncounterResource1_8.java index cbc189762..71cef1adc 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/EncounterResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/EncounterResource1_8.java @@ -9,13 +9,11 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.BooleanProperty; -import io.swagger.models.properties.DateProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; +import java.util.Date; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; + import org.openmrs.Encounter; import org.openmrs.Obs; import org.openmrs.Order; @@ -39,12 +37,13 @@ import org.openmrs.module.webservices.rest.web.resource.impl.ServiceSearcher; import org.openmrs.module.webservices.rest.web.response.ResponseException; -import java.util.Date; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; - -import static org.hibernate.criterion.Projections.property; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.ArrayProperty; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.DateProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; /** * Resource for Encounters, supporting standard CRUD operations @@ -93,6 +92,7 @@ public DelegatingResourceDescription getRepresentationDescription(Representation return null; } + @Override public Model getGETModel(Representation rep) { ModelImpl modelImpl = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { @@ -105,20 +105,20 @@ public Model getGETModel(Representation rep) { } if (rep instanceof DefaultRepresentation) { modelImpl - .property("patient", new RefProperty("#/definitions/PatientGetRef")) //FIXME - .property("location", new RefProperty("#/definitions/LocationGetRef")) //FIXME - .property("form", new RefProperty("#/definitions/FormGetRef")) //FIXME - .property("encounterType", new RefProperty("#/definitions/EncountertypeGetRef")) //FIXME - .property("obs", new ArrayProperty(new RefProperty("#/definitions/ObsGetRef"))) //FIXME - .property("orders", new ArrayProperty(new RefProperty("#/definitions/OrderGetRef"))); //FIXME + .property("patient", new RefProperty("#/definitions/PatientGetRef")) + .property("location", new RefProperty("#/definitions/LocationGetRef")) // + .property("form", new RefProperty("#/definitions/FormGetRef")) + .property("encounterType", new RefProperty("#/definitions/EncountertypeGetRef")) + .property("obs", new ArrayProperty(new RefProperty("#/definitions/ObsGetRef"))) + .property("orders", new ArrayProperty(new RefProperty("#/definitions/OrderGetRef"))); } else if (rep instanceof FullRepresentation) { modelImpl - .property("patient", new RefProperty("#/definitions/PatientGet")) //FIXME - .property("location", new RefProperty("#/definitions/LocationGet")) //FIXME - .property("form", new RefProperty("#/definitions/FormGet")) //FIXME - .property("encounterType", new RefProperty("#/definitions/EncountertypeGet")) //FIXME - .property("obs", new ArrayProperty(new RefProperty("#/definitions/ObsGet"))) //FIXME - .property("orders", new ArrayProperty(new RefProperty("#/definitions/OrderGet"))); //FIXME + .property("patient", new RefProperty("#/definitions/PatientGet")) + .property("location", new RefProperty("#/definitions/LocationGet")) + .property("form", new RefProperty("#/definitions/FormGet")) + .property("encounterType", new RefProperty("#/definitions/EncountertypeGet")) + .property("obs", new ArrayProperty(new RefProperty("#/definitions/ObsGet"))) + .property("orders", new ArrayProperty(new RefProperty("#/definitions/OrderGet"))); } return modelImpl; } diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/FieldResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/FieldResource1_8.java index a3a628c3b..5bc97ba74 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/FieldResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/FieldResource1_8.java @@ -9,11 +9,9 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.BooleanProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; +import java.util.Arrays; +import java.util.List; + import org.openmrs.Field; import org.openmrs.api.context.Context; import org.openmrs.module.webservices.rest.web.RequestContext; @@ -27,8 +25,11 @@ import org.openmrs.module.webservices.rest.web.resource.impl.NeedsPaging; import org.openmrs.module.webservices.rest.web.response.ResponseException; -import java.util.Arrays; -import java.util.List; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; /** * {@link Resource} for {@link Field}, supporting standard CRUD operations @@ -37,6 +38,7 @@ "1.9.*", "1.10.*", "1.11.*", "1.12.*", "2.0.*", "2.1.*", "2.2.*", "2.3.*" }) public class FieldResource1_8 extends MetadataDelegatingCrudResource { + @Override public Model getGETModel(Representation rep) { ModelImpl modelImpl = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { @@ -73,7 +75,17 @@ public Model getCREATEModel(Representation rep) { @Override public Model getUPDATEModel(Representation representation) { - return new ModelImpl(); //FIXME missing props + return new ModelImpl() + + .property("fieldType", new RefProperty("#/definitions/FieldtypeCreate")) + .property("selectMultiple", new BooleanProperty()._default(false)) + .property("concept", new RefProperty("#/definitions/ConceptCreate")) + .property("tableName", new StringProperty()) + + .property("attributeName", new StringProperty()) + .property("defaultValue", new StringProperty()) + + .required("fieldType").required("selectMultiple"); } /** diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/FieldTypeResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/FieldTypeResource1_8.java index 93a5b59fd..05b0ab79e 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/FieldTypeResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/FieldTypeResource1_8.java @@ -9,9 +9,6 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.BooleanProperty; import org.openmrs.FieldType; import org.openmrs.api.context.Context; import org.openmrs.module.webservices.rest.web.RequestContext; @@ -25,6 +22,10 @@ import org.openmrs.module.webservices.rest.web.resource.impl.NeedsPaging; import org.openmrs.module.webservices.rest.web.response.ResponseException; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.BooleanProperty; + /** * {@link Resource} for {@link FieldType}, supporting standard CRUD operations */ @@ -32,6 +33,7 @@ "1.8.*", "1.9.*", "1.10.*", "1.11.*", "1.12.*", "2.0.*", "2.1.*", "2.2.*", "2.3.*" }) public class FieldTypeResource1_8 extends MetadataDelegatingCrudResource { + @Override public Model getGETModel(Representation rep) { ModelImpl modelImpl = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { @@ -43,12 +45,15 @@ public Model getGETModel(Representation rep) { @Override public Model getCREATEModel(Representation rep) { - return super.getCREATEModel(rep); //FIXME missing props + return ((ModelImpl) super.getCREATEModel(rep)) + .property("isSet", new BooleanProperty()._default(false)); } @Override public Model getUPDATEModel(Representation rep) { - return new ModelImpl(); //FIXME missing props + return new ModelImpl() + + .property("isSet", new BooleanProperty()._default(false)); } /** diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/FormFieldResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/FormFieldResource1_8.java index 0c983d1a1..c88aeddc0 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/FormFieldResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/FormFieldResource1_8.java @@ -12,13 +12,6 @@ import java.util.ArrayList; import java.util.List; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.BooleanProperty; -import io.swagger.models.properties.FloatProperty; -import io.swagger.models.properties.IntegerProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; import org.openmrs.Form; import org.openmrs.FormField; import org.openmrs.api.context.Context; @@ -35,6 +28,14 @@ import org.openmrs.module.webservices.rest.web.resource.impl.NeedsPaging; import org.openmrs.module.webservices.rest.web.response.ResponseException; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.FloatProperty; +import io.swagger.models.properties.IntegerProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; + /** * {@link Resource} for {@link FormField}, supporting standard CRUD operations */ @@ -42,6 +43,7 @@ "1.8.*", "1.9.*", "1.10.*", "1.11.*", "1.12.*", "2.0.*", "2.1.*", "2.2.*", "2.3.*" }) public class FormFieldResource1_8 extends DelegatingSubResource { + @Override public Model getGETModel(Representation rep) { ModelImpl modelImpl = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { @@ -55,7 +57,7 @@ public Model getGETModel(Representation rep) { .property("maxOccurs", new IntegerProperty()) .property("required", new BooleanProperty()._default(false)) .property("sortWeight", new FloatProperty()) - .property("retired", new BooleanProperty()); //FIXME + .property("retired", new BooleanProperty()._default(false)); } if (rep instanceof DefaultRepresentation) { modelImpl @@ -73,7 +75,7 @@ public Model getGETModel(Representation rep) { @Override public Model getCREATEModel(Representation rep) { - ModelImpl model = new ModelImpl() //FIXME validate if correct + ModelImpl model = new ModelImpl() .property("form", new StringProperty().example("uuid")) .property("field", new StringProperty().example("uuid")) .property("required", new BooleanProperty()._default(false)) @@ -97,7 +99,12 @@ public Model getCREATEModel(Representation rep) { @Override public Model getUPDATEModel(Representation rep) { - return new ModelImpl(); //FIXME missing props + return new ModelImpl() + + .property("form", new StringProperty().example("uuid")) + .property("field", new StringProperty().example("uuid")).property("fieldNumber", new IntegerProperty()) + .property("fieldPart", new StringProperty()).property("minOccurs", new IntegerProperty()) + .property("maxOccurs", new IntegerProperty()).property("sortWeight", new BooleanProperty()._default(false)); } /** diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/HL7MessageResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/HL7MessageResource1_8.java index ae4dfcbff..8a06d2ec7 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/HL7MessageResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/HL7MessageResource1_8.java @@ -9,11 +9,8 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.IntegerProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; +import java.util.Map; + import org.openmrs.api.context.Context; import org.openmrs.module.webservices.rest.web.RequestContext; import org.openmrs.module.webservices.rest.web.RestConstants; @@ -30,7 +27,11 @@ import org.openmrs.module.webservices.rest.web.v1_0.controller.openmrs1_8.HL7MessageController1_8; import org.openmrs.module.webservices.rest.web.v1_0.wrapper.openmrs1_8.IncomingHl7Message1_8; -import java.util.Map; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.IntegerProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; /** * {@link Resource} for {@link IncomingHl7Message1_8}, supporting standard CRUD operations @@ -118,7 +119,7 @@ public Model getGETModel(Representation rep) { @Override public Model getCREATEModel(Representation rep) { return new ModelImpl() - .property("hl7", new StringProperty()) //FIXME TYPE + .property("hl7", new StringProperty()) .required("hl7"); } diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ModuleResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ModuleResource1_8.java index 5af5283a8..ff4857919 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ModuleResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ModuleResource1_8.java @@ -9,11 +9,14 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.BooleanProperty; -import io.swagger.models.properties.StringProperty; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import javax.servlet.ServletContext; + import org.apache.commons.io.FileUtils; import org.openmrs.module.Module; import org.openmrs.module.ModuleException; @@ -34,12 +37,11 @@ import org.openmrs.web.WebUtil; import org.springframework.web.multipart.MultipartFile; -import javax.servlet.ServletContext; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.ArrayProperty; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.StringProperty; @Resource(name = RestConstants.VERSION_1 + "/module", supportedClass = Module.class, supportedOpenmrsVersions = { "1.8.*", "1.9.*", "1.10.*", "1.11.*", "1.12.*", "2.0.*", "2.1.*", "2.2.*", "2.3.*" }) @@ -117,8 +119,8 @@ public Model getGETModel(Representation rep) { .property("display", new StringProperty()) .property("name", new StringProperty()) .property("description", new StringProperty()) - .property("started", new BooleanProperty()) //FIXME check type - .property("startupErrorMessage", new StringProperty()); //FIXME add-link: action + .property("started", new BooleanProperty()._default(false)) + .property("startupErrorMessage", new StringProperty()); } if (rep instanceof FullRepresentation) { model @@ -126,7 +128,7 @@ public Model getGETModel(Representation rep) { .property("author", new StringProperty()) .property("version", new StringProperty()) .property("requireOpenmrsVersion", new StringProperty()) - .property("awareOfModules", new ArrayProperty(new StringProperty())) //FIXME check type + .property("awareOfModules", new ArrayProperty(new StringProperty())) .property("requiredModules", new ArrayProperty(new StringProperty())); } else if (rep instanceof RefRepresentation) { model diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ObsResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ObsResource1_8.java index 098f808c7..ede8473c3 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ObsResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ObsResource1_8.java @@ -227,7 +227,16 @@ public Model getCREATEModel(Representation rep) { @Override public Model getUPDATEModel(Representation rep) { - return new ModelImpl(); //FIXME missing props + return new ModelImpl().property("obsDatetime", new DateTimeProperty()) + .property("concept", new StringProperty().example("uuid")).property("location", new StringProperty()) + .property("order", new StringProperty()).property("encounter", new StringProperty()) + .property("accessionNumber", new StringProperty()) + .property("groupMembers", new ArrayProperty(new StringProperty())) + .property("valueCodedName", new StringProperty()).property("comment", new StringProperty()) + .property("voided", new BooleanProperty()).property("value", new StringProperty()) + .property("valueModifier", new StringProperty()) + + .required("person").required("obsDatetime").required("concept"); } /** diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/OrderResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/OrderResource1_8.java index 312830fb4..e8545d27b 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/OrderResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/OrderResource1_8.java @@ -11,12 +11,6 @@ import java.util.List; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.BooleanProperty; -import io.swagger.models.properties.DateProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; import org.openmrs.Order; import org.openmrs.Patient; import org.openmrs.api.OrderService.ORDER_STATUS; @@ -36,6 +30,13 @@ import org.openmrs.module.webservices.rest.web.resource.impl.NeedsPaging; import org.openmrs.module.webservices.rest.web.response.ResponseException; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.DateProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; + /** * Resource for {@link Order} and all of its subclasses */ @@ -275,13 +276,13 @@ public Model getCREATEModel(Representation rep) { .property("discontinuedBy", new RefProperty("#/definitions/UserCreate")) .property("discontinuedReason", new RefProperty("#/definitions/ConceptCreate")); } - //FIXME missing prop: type + return model; } @Override public Model getUPDATEModel(Representation rep) { - return new ModelImpl(); //FIXME missing props + return getCREATEModel(rep); } /** diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/PatientIdentifierTypeResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/PatientIdentifierTypeResource1_8.java index 3bb2f5dff..785be8083 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/PatientIdentifierTypeResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/PatientIdentifierTypeResource1_8.java @@ -9,10 +9,6 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.BooleanProperty; -import io.swagger.models.properties.StringProperty; import org.openmrs.PatientIdentifierType; import org.openmrs.api.PatientService; import org.openmrs.api.context.Context; @@ -28,6 +24,11 @@ import org.openmrs.module.webservices.rest.web.resource.impl.NeedsPaging; import org.openmrs.module.webservices.rest.web.response.ResponseException; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.StringProperty; + /** * Allows standard CRUD for the {@link PatientIdentifierType} domain object */ @@ -79,7 +80,6 @@ public DelegatingResourceDescription getRepresentationDescription(Representation description.addProperty("validator"); description.addProperty("locationBehavior"); description.addProperty("uniquenessBehavior"); - description.addProperty("validator"); //FIXME duplicate description.addProperty("retired"); description.addProperty("auditInfo"); description.addSelfLink(); @@ -126,7 +126,7 @@ public Model getGETModel(Representation rep) { .property("checkDigit", new BooleanProperty()) .property("validator", new StringProperty()) .property("locationBehavior", new EnumProperty(PatientIdentifierType.LocationBehavior.class)) - .property("uniquenessBehavior", new StringProperty()); //FIXME check type + .property("uniquenessBehavior", new EnumProperty(PatientIdentifierType.LocationBehavior.class)); } return model; } @@ -140,7 +140,7 @@ public Model getCREATEModel(Representation rep) { .property("checkDigit", new BooleanProperty()) .property("validator", new StringProperty()) .property("locationBehavior", new EnumProperty(PatientIdentifierType.LocationBehavior.class)) - .property("uniquenessBehavior", new StringProperty()); //FIXME check type + .property("uniquenessBehavior", new EnumProperty(PatientIdentifierType.LocationBehavior.class)); } @Override diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/PatientResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/PatientResource1_8.java index 10f64b9c2..b10cd35b9 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/PatientResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/PatientResource1_8.java @@ -9,12 +9,12 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.BooleanProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + import org.openmrs.Patient; import org.openmrs.PatientIdentifier; import org.openmrs.Person; @@ -40,11 +40,12 @@ import org.openmrs.module.webservices.rest.web.response.ResponseException; import org.openmrs.module.webservices.validation.ValidateUtil; -import java.util.Arrays; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.ArrayProperty; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; /** * {@link Resource} for Patients, supporting standard CRUD operations @@ -145,7 +146,7 @@ public DelegatingResourceDescription getRepresentationDescription(Representation @Override public Model getGETModel(Representation rep) { ModelImpl model = (ModelImpl) super.getGETModel(rep); - //FIXME check uuid, display in ref rep + if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { model .property("uuid", new StringProperty()) diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/PatientStateResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/PatientStateResource1_8.java index 28d20306b..4808f8eb0 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/PatientStateResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/PatientStateResource1_8.java @@ -9,13 +9,11 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.BooleanProperty; -import io.swagger.models.properties.DateProperty; -import io.swagger.models.properties.ObjectProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + import org.openmrs.PatientProgram; import org.openmrs.PatientState; import org.openmrs.ProgramWorkflow; @@ -35,10 +33,12 @@ import org.openmrs.module.webservices.rest.web.response.ResponseException; import org.openmrs.util.OpenmrsUtil; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.DateProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; /** * {@link Resource} for PatientState, supporting standard CRUD operations @@ -194,11 +194,11 @@ public Model getGETModel(Representation rep) { } else if (rep instanceof RefRepresentation) { model .property("state", new RefProperty("#/definitions/WorkflowStateGetRef")) - .property("patientProgram", new ObjectProperty()); //FIXME type + .property("patientProgram", new RefProperty("#/definitions/PatientProgramGetRef")); } else if (rep instanceof FullRepresentation) { model .property("state", new RefProperty("#/definitions/WorkflowStateGetRef")) - .property("patientProgram", new ObjectProperty()); //FIXME type + .property("patientProgram", new RefProperty("#/definitions/PatientProgramGetRef")); } return model; } diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/PrivilegeResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/PrivilegeResource1_8.java index d195a39b9..5ee1c2b81 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/PrivilegeResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/PrivilegeResource1_8.java @@ -9,9 +9,6 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.StringProperty; import org.apache.commons.lang.StringUtils; import org.openmrs.Privilege; import org.openmrs.api.context.Context; @@ -26,6 +23,10 @@ import org.openmrs.module.webservices.rest.web.resource.impl.NeedsPaging; import org.openmrs.module.webservices.rest.web.response.ResponseException; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.StringProperty; + /** * {@link Resource} for Privilege, supporting standard CRUD operations */ @@ -95,7 +96,7 @@ public DelegatingResourceDescription getUpdatableProperties() { @Override public Model getGETModel(Representation rep) { - return super.getGETModel(rep); //FIXME + return super.getGETModel(rep); } @Override diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ProgramEnrollmentResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ProgramEnrollmentResource1_8.java index 6320563c7..8e8f465b2 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ProgramEnrollmentResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ProgramEnrollmentResource1_8.java @@ -9,12 +9,8 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.BooleanProperty; -import io.swagger.models.properties.DateProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; +import java.util.List; + import org.openmrs.Patient; import org.openmrs.PatientProgram; import org.openmrs.api.PatientService; @@ -33,7 +29,12 @@ import org.openmrs.module.webservices.rest.web.resource.impl.NeedsPaging; import org.openmrs.module.webservices.rest.web.response.ResponseException; -import java.util.List; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.DateProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; @Resource(name = RestConstants.VERSION_1 + "/programenrollment", supportedClass = PatientProgram.class, supportedOpenmrsVersions = { "1.8.*, 1.9.*" }, order = 1) public class ProgramEnrollmentResource1_8 extends DataDelegatingCrudResource { @@ -175,7 +176,11 @@ public Model getCREATEModel(Representation rep) { public Model getUPDATEModel(Representation rep) { return new ModelImpl() .property("dateEnrolled", new DateProperty()) - .property("dateCompleted", new DateProperty()); //FIXME missing props + .property("dateCompleted", new DateProperty()) + + .property("patient", new StringProperty().example("uuid")) + .property("program", new StringProperty().example("uuid")) + .property("location", new StringProperty().example("uuid")); } diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ProgramResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ProgramResource1_8.java index 51969f826..2a819962e 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ProgramResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ProgramResource1_8.java @@ -9,12 +9,8 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.BooleanProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; +import java.util.List; + import org.openmrs.Program; import org.openmrs.api.context.Context; import org.openmrs.module.webservices.rest.web.RequestContext; @@ -31,7 +27,12 @@ import org.openmrs.module.webservices.rest.web.resource.impl.NeedsPaging; import org.openmrs.module.webservices.rest.web.response.ResponseException; -import java.util.List; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.ArrayProperty; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; @Resource(name = RestConstants.VERSION_1 + "/program", supportedClass = Program.class, supportedOpenmrsVersions = { "1.8.*, 1.9.*" }, order = 1) public class ProgramResource1_8 extends MetadataDelegatingCrudResource { @@ -151,7 +152,13 @@ public Model getCREATEModel(Representation rep) { @Override public Model getUPDATEModel(Representation rep) { - return new ModelImpl(); //FIXME missing props + return new ModelImpl() + + + .property("concept", new StringProperty().example("uuid")) + .property("retired", new BooleanProperty()) + .required("concept").required("description"); + } @Override diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ProgramWorkflowResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ProgramWorkflowResource1_8.java index 541846d22..b8f0d565e 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ProgramWorkflowResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ProgramWorkflowResource1_8.java @@ -9,10 +9,8 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.RefProperty; +import java.util.Set; + import org.openmrs.Program; import org.openmrs.ProgramWorkflow; import org.openmrs.ProgramWorkflowState; @@ -30,7 +28,10 @@ import org.openmrs.module.webservices.rest.web.response.ResourceDoesNotSupportOperationException; import org.openmrs.module.webservices.rest.web.response.ResponseException; -import java.util.Set; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.ArrayProperty; +import io.swagger.models.properties.RefProperty; @Resource(name = RestConstants.VERSION_1 + "/workflow", supportedClass = ProgramWorkflow.class, supportedOpenmrsVersions = { "1.8.*", "1.9.*", "1.10.*", "1.11.*", "1.12.*", "2.0.*", "2.1.*", "2.2.*", "2.3.*" }, order = 1) @@ -86,7 +87,7 @@ public Model getGETModel(Representation rep) { model .property("concept", new RefProperty("#/definitions/ConceptGet")) .property("states", new ArrayProperty(new RefProperty("#/definitions/WorkflowStateGet"))); - //FIXME should remove 'description'? + } return model; } diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ProgramWorkflowStateResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ProgramWorkflowStateResource1_8.java index c5ca17868..bc1287f97 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ProgramWorkflowStateResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ProgramWorkflowStateResource1_8.java @@ -9,11 +9,9 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.BooleanProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; +import java.util.ArrayList; +import java.util.List; + import org.openmrs.Program; import org.openmrs.ProgramWorkflow; import org.openmrs.ProgramWorkflowState; @@ -32,8 +30,11 @@ import org.openmrs.module.webservices.rest.web.response.ResourceDoesNotSupportOperationException; import org.openmrs.module.webservices.rest.web.response.ResponseException; -import java.util.ArrayList; -import java.util.List; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; @SubResource(parent = ProgramWorkflowResource1_8.class, path = "state", supportedClass = ProgramWorkflowState.class, supportedOpenmrsVersions = { "1.8.*", "1.9.*", "1.10.*", "1.11.*", "1.12.*", "2.0.*", "2.1.*", "2.2.*", "2.3.*" }) @@ -146,6 +147,11 @@ public Model getGETModel(Representation rep) { @Override public Model getCREATEModel(Representation rep) { - return new ModelImpl(); //FIXME missing props + return new ModelImpl() + + .property("uuid", new StringProperty()) + + .property("concept", new RefProperty("#/definitions/ConceptGetRef")) + .property("retired", new BooleanProperty()); } } diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/RelationShipTypeResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/RelationShipTypeResource1_8.java index 4dcb5953c..06d196f38 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/RelationShipTypeResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/RelationShipTypeResource1_8.java @@ -9,11 +9,10 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8; +import java.util.ArrayList; +import java.util.List; + import org.apache.commons.lang.StringUtils; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.IntegerProperty; -import io.swagger.models.properties.StringProperty; import org.openmrs.RelationshipType; import org.openmrs.api.context.Context; import org.openmrs.module.webservices.rest.web.RequestContext; @@ -28,8 +27,10 @@ import org.openmrs.module.webservices.rest.web.resource.impl.NeedsPaging; import org.openmrs.module.webservices.rest.web.response.ResponseException; -import java.util.ArrayList; -import java.util.List; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.IntegerProperty; +import io.swagger.models.properties.StringProperty; @Resource(name = RestConstants.VERSION_1 + "/relationshiptype", supportedClass = RelationshipType.class, supportedOpenmrsVersions = { "1.8.*", "1.9.*", "1.10.*", "1.11.*", "1.12.*", "2.0.*", "2.1.*", "2.2.*", "2.3.*" }) @@ -152,7 +153,7 @@ public Model getCREATEModel(Representation rep) { @Override public Model getUPDATEModel(Representation rep) { - return new ModelImpl(); //FIXME missing props + return getCREATEModel(rep); } /** diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/RelationshipResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/RelationshipResource1_8.java index a004176ba..ad9f4bd7a 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/RelationshipResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/RelationshipResource1_8.java @@ -9,12 +9,6 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.BooleanProperty; -import io.swagger.models.properties.DateProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; import org.openmrs.Person; import org.openmrs.Relationship; import org.openmrs.api.context.Context; @@ -31,6 +25,13 @@ import org.openmrs.module.webservices.rest.web.response.ResourceDoesNotSupportOperationException; import org.openmrs.module.webservices.rest.web.response.ResponseException; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.DateProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; + /** * {@link org.openmrs.module.webservices.rest.web.annotation.Resource} for Provider, supporting * standard CRUD operations @@ -206,6 +207,9 @@ public Model getCREATEModel(Representation rep) { @Override public Model getUPDATEModel(Representation rep) { return new ModelImpl() - .property("voided", new BooleanProperty()); //FIXME missing properties + + .property("voided", new BooleanProperty()).property("startDate", new DateProperty()) + .property("endDate", new DateProperty()) + .property("relationshipType", new RefProperty("#/definitions/RelationshiptypeCreate")); } } diff --git a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/UserResource1_8.java b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/UserResource1_8.java index 4a00e2a76..3eb45bf7c 100644 --- a/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/UserResource1_8.java +++ b/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/UserResource1_8.java @@ -16,13 +16,6 @@ import java.util.List; import java.util.Set; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.MapProperty; -import io.swagger.models.properties.ObjectProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; import org.apache.commons.beanutils.PropertyUtils; import org.apache.commons.lang.StringUtils; import org.openmrs.Role; @@ -47,6 +40,14 @@ import org.openmrs.module.webservices.rest.web.response.ResponseException; import org.openmrs.module.webservices.rest.web.v1_0.wrapper.openmrs1_8.UserAndPassword1_8; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.ArrayProperty; +import io.swagger.models.properties.MapProperty; +import io.swagger.models.properties.ObjectProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; + /** * {@link Resource} for User, supporting standard CRUD operations */ @@ -142,7 +143,7 @@ public Model getGETModel(Representation rep) { model .property("username", new StringProperty()) .property("systemId", new StringProperty()) - .property("userProperties", new MapProperty()); //FIXME type + .property("userProperties", new MapProperty()); } if (rep instanceof DefaultRepresentation) { model @@ -168,7 +169,7 @@ public Model getCREATEModel(Representation rep) { .property("password", new StringProperty()) .property("person", new RefProperty("#/definitions/PersonCreate")) .property("systemId", new StringProperty()) - .property("userProperties", new MapProperty()) //FIXME type + .property("userProperties", new MapProperty()) .property("roles", new ArrayProperty(new RefProperty("#/definitions/RoleCreate"))) .property("proficientLocales", new ArrayProperty(new ObjectProperty())) .property("secretQuestion", new StringProperty()) diff --git a/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/BaseAttributeCrudResource1_9.java b/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/BaseAttributeCrudResource1_9.java index d9f0b6ab1..e17cc9d69 100644 --- a/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/BaseAttributeCrudResource1_9.java +++ b/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/BaseAttributeCrudResource1_9.java @@ -12,10 +12,6 @@ import java.util.Arrays; import java.util.List; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.BooleanProperty; -import io.swagger.models.properties.StringProperty; import org.apache.commons.lang.StringUtils; import org.openmrs.attribute.Attribute; import org.openmrs.customdatatype.CustomDatatype; @@ -31,6 +27,11 @@ import org.openmrs.module.webservices.rest.web.resource.impl.DelegatingResourceDescription; import org.openmrs.module.webservices.rest.web.resource.impl.DelegatingSubResource; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.StringProperty; + /** * Subclass of {@link DelegatingSubResource} with helper methods specific to {@link Attribute} * @@ -124,8 +125,9 @@ public Model getGETModel(Representation rep) { model .property("display", new StringProperty()) .property("uuid", new StringProperty()) - .property("attributeType", new StringProperty()) //FIXME type - .property("value", new StringProperty()) //FIXME type + .property("attributeType", new StringProperty().example("uuid")) + + .property("value", new StringProperty()) .property("voided", new BooleanProperty()); } return model; diff --git a/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/ConceptMapResource1_9.java b/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/ConceptMapResource1_9.java index 8847602ef..698144e51 100644 --- a/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/ConceptMapResource1_9.java +++ b/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/ConceptMapResource1_9.java @@ -9,9 +9,6 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_9; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.RefProperty; import org.apache.commons.lang.StringUtils; import org.openmrs.ConceptMap; import org.openmrs.module.webservices.rest.web.RestConstants; @@ -25,6 +22,10 @@ import org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8.ConceptMapResource1_8; import org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8.ConceptResource1_8; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.RefProperty; + /** * {@link Resource} for {@link ConceptMap}, supporting standard CRUD operations */ @@ -68,7 +69,7 @@ public Model getGETModel(Representation rep) { .property("conceptReferenceTerm", new RefProperty("#/definitions/ConceptreferencetermGet")) .property("conceptMapType", new RefProperty("#/definitions/ConceptmaptypeGet")); } - model.getProperties().remove("source"); //FIXME check + model.getProperties().remove("source"); model.getProperties().remove("sourceCode"); model.getProperties().remove("comment"); return model; diff --git a/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/ConceptReferenceTermMapResource1_9.java b/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/ConceptReferenceTermMapResource1_9.java index ed20c53d5..2deb956d8 100644 --- a/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/ConceptReferenceTermMapResource1_9.java +++ b/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/ConceptReferenceTermMapResource1_9.java @@ -9,9 +9,6 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_9; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.RefProperty; import org.openmrs.ConceptReferenceTerm; import org.openmrs.ConceptReferenceTermMap; import org.openmrs.api.context.Context; @@ -31,6 +28,10 @@ import org.openmrs.module.webservices.rest.web.response.ResourceDoesNotSupportOperationException; import org.openmrs.module.webservices.rest.web.response.ResponseException; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.RefProperty; + /** * {@link Resource} for {@link ConceptReferenceTermMap}, supporting standard CRUD operations */ @@ -116,7 +117,11 @@ public Model getCREATEModel(Representation rep) { @Override public Model getUPDATEModel(Representation rep) { - return new ModelImpl(); //FIXME missing props + return new ModelImpl() + + .property("termA", new RefProperty("#/definitions/ConceptreferencetermCreate")) + .property("termB", new RefProperty("#/definitions/ConceptreferencetermCreate")) + .property("conceptMapType", new RefProperty("#/definitions/ConceptmaptypeCreate")); } /** diff --git a/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/ConceptReferenceTermResource1_9.java b/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/ConceptReferenceTermResource1_9.java index 4cb1cc155..824e00566 100644 --- a/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/ConceptReferenceTermResource1_9.java +++ b/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/ConceptReferenceTermResource1_9.java @@ -9,11 +9,8 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_9; -import com.sun.org.apache.xpath.internal.operations.Mod; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; +import java.util.List; + import org.apache.commons.lang3.StringUtils; import org.openmrs.ConceptReferenceTerm; import org.openmrs.api.ConceptService; @@ -34,7 +31,10 @@ import org.openmrs.module.webservices.rest.web.resource.impl.NeedsPaging; import org.openmrs.module.webservices.rest.web.response.ResponseException; -import java.util.List; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; /** * {@link Resource} for {@link ConceptReferenceTerm}, supporting standard CRUD operations @@ -125,7 +125,12 @@ public Model getCREATEModel(Representation rep) { @Override public Model getUPDATEModel(Representation rep) { - return new ModelImpl(); //FIXME missing props + return new ModelImpl() + + .property("code", new StringProperty()) + + .property("conceptSource", new StringProperty()) + .property("version", new StringProperty()); } /** diff --git a/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/ConceptStopwordResource1_9.java b/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/ConceptStopwordResource1_9.java index f9b121a76..628d7d4b0 100644 --- a/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/ConceptStopwordResource1_9.java +++ b/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/ConceptStopwordResource1_9.java @@ -9,25 +9,29 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_9; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.StringProperty; +import java.util.List; + import org.apache.commons.lang.StringUtils; +import org.openmrs.ConceptStopWord; import org.openmrs.api.context.Context; import org.openmrs.module.webservices.rest.web.RequestContext; import org.openmrs.module.webservices.rest.web.RestConstants; import org.openmrs.module.webservices.rest.web.annotation.PropertyGetter; import org.openmrs.module.webservices.rest.web.annotation.Resource; -import org.openmrs.module.webservices.rest.web.representation.*; +import org.openmrs.module.webservices.rest.web.representation.DefaultRepresentation; +import org.openmrs.module.webservices.rest.web.representation.FullRepresentation; +import org.openmrs.module.webservices.rest.web.representation.RefRepresentation; +import org.openmrs.module.webservices.rest.web.representation.Representation; import org.openmrs.module.webservices.rest.web.resource.api.PageableResult; import org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource; import org.openmrs.module.webservices.rest.web.resource.impl.DelegatingResourceDescription; import org.openmrs.module.webservices.rest.web.resource.impl.NeedsPaging; import org.openmrs.module.webservices.rest.web.response.ResourceDoesNotSupportOperationException; import org.openmrs.module.webservices.rest.web.response.ResponseException; -import org.openmrs.ConceptStopWord; -import java.util.List; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.StringProperty; /** * {@link Resource} for {@link ConceptStopWord}, supporting standard CRUD operations @@ -93,7 +97,7 @@ public Model getGETModel(Representation rep) { if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { modelImpl .property("value", new StringProperty()) - .property("locale", new StringProperty().example("en")); //FIXME type + .property("locale", new StringProperty().example("en")); } return modelImpl; } diff --git a/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/CustomDatatypeHandlerResource1_9.java b/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/CustomDatatypeHandlerResource1_9.java index 6193e58c0..e62a28847 100644 --- a/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/CustomDatatypeHandlerResource1_9.java +++ b/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/CustomDatatypeHandlerResource1_9.java @@ -9,9 +9,6 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_9; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.StringProperty; import org.openmrs.module.webservices.rest.web.RequestContext; import org.openmrs.module.webservices.rest.web.RestConstants; import org.openmrs.module.webservices.rest.web.annotation.SubResource; @@ -25,6 +22,10 @@ import org.openmrs.module.webservices.rest.web.response.ResourceDoesNotSupportOperationException; import org.openmrs.module.webservices.rest.web.response.ResponseException; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.StringProperty; + @SubResource(parent = CustomDatatypeResource1_9.class, path = "handlers", supportedClass = CustomDatatypeHandlerRepresentation.class, supportedOpenmrsVersions = { "1.9.*", "1.10.*", "1.11.*", "1.12.*", "2.0.*", "2.1.*", "2.2.*", "2.3.*" }) public class CustomDatatypeHandlerResource1_9 extends DelegatingSubResource { @@ -47,7 +48,7 @@ public Model getGETModel(Representation rep) { model .property("uuid", new StringProperty()) .property("handlerClassname", new StringProperty()) - .property("display", new StringProperty()); //FIXME delegate property name + .property("display", new StringProperty()); } return model; } diff --git a/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/EncounterProviderResource1_9.java b/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/EncounterProviderResource1_9.java index 49e62db80..b07500db6 100644 --- a/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/EncounterProviderResource1_9.java +++ b/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/EncounterProviderResource1_9.java @@ -9,11 +9,11 @@ */ package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_9; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.BooleanProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; +import java.util.ArrayList; +import java.util.Date; +import java.util.Iterator; +import java.util.List; + import org.openmrs.Encounter; import org.openmrs.EncounterProvider; import org.openmrs.EncounterRole; @@ -35,10 +35,11 @@ import org.openmrs.module.webservices.rest.web.response.ResourceDoesNotSupportOperationException; import org.openmrs.module.webservices.rest.web.response.ResponseException; -import java.util.ArrayList; -import java.util.Date; -import java.util.Iterator; -import java.util.List; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; /** * {@link org.openmrs.module.webservices.rest.web.annotation.Resource} for EncounterProvider, @@ -113,7 +114,7 @@ public Model getCREATEModel(Representation rep) { ModelImpl model = new ModelImpl() .property("provider", new StringProperty().example("uuid")) .property("encounterRole", new StringProperty().example("uuid")) - .property("encounter", new StringProperty()); //FIXME remove if not needed + .property("encounter", new StringProperty()); if (rep instanceof FullRepresentation) { model .property("provider", new RefProperty("#/definitions/ProviderCreate")) diff --git a/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/VisitResource1_9.java b/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/VisitResource1_9.java index 1459f64fd..96f241a4f 100644 --- a/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/VisitResource1_9.java +++ b/omod-1.9/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_9/VisitResource1_9.java @@ -12,11 +12,12 @@ import java.util.Arrays; import java.util.Collection; import java.util.Date; -import java.util.Set; import java.util.Iterator; +import java.util.Set; + +import org.openmrs.Encounter; import org.openmrs.Location; import org.openmrs.Patient; -import org.openmrs.Encounter; import org.openmrs.Visit; import org.openmrs.VisitAttribute; import org.openmrs.api.context.Context; @@ -170,7 +171,7 @@ public Model getGETModel(Representation rep) { if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { modelImpl.property("uuid", new StringProperty()).property("display", new StringProperty()) .property("startDatetime", new DateProperty()).property("stopDatetime", new DateProperty()) - .property("attributes", new ArrayProperty(new StringProperty())) //FIXME type + .property("attributes", new ArrayProperty(new RefProperty("#/definitions/VisitAttributeCreate"))) .property("voided", new BooleanProperty()); } if (rep instanceof DefaultRepresentation) { @@ -217,7 +218,7 @@ public Model getUPDATEModel(Representation rep) { .property("indication", new RefProperty("#/definitions/ConceptCreate")) .property("stopDatetime", new DateProperty()) .property("encounters", new ArrayProperty(new RefProperty("#/definitions/EncounterCreate"))) - .property("attributes", new ArrayProperty(new StringProperty())); //FIXME type + .property("attributes", new ArrayProperty(new RefProperty("#/definitions/VisitAttributeCreate"))); } /** diff --git a/omod-2.0/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs2_0/PatientAllergyResource2_0.java b/omod-2.0/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs2_0/PatientAllergyResource2_0.java index ea2b2cfc8..661d309f6 100644 --- a/omod-2.0/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs2_0/PatientAllergyResource2_0.java +++ b/omod-2.0/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs2_0/PatientAllergyResource2_0.java @@ -12,14 +12,8 @@ import java.util.ArrayList; import java.util.List; -import io.swagger.models.Model; -import io.swagger.models.ModelImpl; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.ObjectProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; -import org.openmrs.Allergy; import org.openmrs.Allergies; +import org.openmrs.Allergy; import org.openmrs.AllergyReaction; import org.openmrs.Patient; import org.openmrs.api.context.Context; @@ -39,6 +33,13 @@ import org.openmrs.module.webservices.rest.web.response.ResponseException; import org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_9.PatientResource1_9; +import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.ArrayProperty; +import io.swagger.models.properties.ObjectProperty; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; + @SubResource(parent = PatientResource1_9.class, path = "allergy", supportedClass = Allergy.class, supportedOpenmrsVersions = { "2.0.*", "2.1.*", "2.2.*", "2.3.*" }) public class PatientAllergyResource2_0 extends DelegatingSubResource { @@ -102,7 +103,7 @@ public Model getGETModel(Representation rep) { model .property("display", new StringProperty()) .property("uuid", new StringProperty()) - .property("allergen", new ObjectProperty()) //FIXME type + .property("allergen", new RefProperty("#/definitions/AllergenGetRef")) .property("severity", new RefProperty("#/definitions/ConceptGetRef")) .property("comment", new StringProperty()) .property("reactions", new ArrayProperty(new RefProperty("#/definitions/ConceptGetRef"))) @@ -120,7 +121,7 @@ public Model getGETModel(Representation rep) { @Override public Model getCREATEModel(Representation rep) { return new ModelImpl() - .property("allergen", new ObjectProperty()) //FIXME type + .property("allergen", new ObjectProperty()) .property("severity", new ObjectProperty() .property("uuid", new StringProperty())) .property("comment", new StringProperty())