Skip to content

Commit

Permalink
uuid should be a uuidschema
Browse files Browse the repository at this point in the history
  • Loading branch information
mherman22 committed Oct 30, 2024
1 parent 70dbaf0 commit 9b0b984
Show file tree
Hide file tree
Showing 23 changed files with 54 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import io.swagger.v3.oas.models.media.ObjectSchema;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.media.UUIDSchema;
import org.openmrs.Concept;
import org.openmrs.Drug;
import org.openmrs.DrugIngredient;
Expand Down Expand Up @@ -91,7 +92,7 @@ public Schema<?> getGETSchema(Representation rep) {
Schema<?> schema = super.getGETSchema(rep);
if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) {
schema
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("display", new StringSchema())
.addProperty("strength", new NumberSchema().format("double"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.media.ObjectSchema;
import io.swagger.v3.oas.models.media.UUIDSchema;
import org.openmrs.Patient;
import org.openmrs.activelist.Allergy;
import org.openmrs.activelist.AllergySeverity;
Expand Down Expand Up @@ -88,7 +89,7 @@ public Schema<?> getCREATESchema(Representation rep) {
return new ObjectSchema()
.addProperty("allergyType", new Schema<AllergyType>().type("string")._enum(Arrays.asList(AllergyType.values())))
.addProperty("reaction", new ObjectSchema())
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("severity", new Schema<AllergySeverity>().type("string")._enum(Arrays.asList(AllergySeverity.values())))
.addProperty("allergen", new StringSchema());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import io.swagger.v3.oas.models.media.DateTimeSchema;
import io.swagger.v3.oas.models.media.BooleanSchema;
import io.swagger.v3.oas.models.media.ObjectSchema;
import io.swagger.v3.oas.models.media.UUIDSchema;
import org.openmrs.Obs;
import org.openmrs.Person;
import org.openmrs.activelist.ActiveListItem;
Expand All @@ -39,7 +40,7 @@ public abstract class BaseActiveListItemResource1_8<T extends ActiveListItem> ex
@Override
public Schema<?> getGETSchema(Representation rep) {
Schema<?> schema = new ObjectSchema()
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("display", new StringSchema())
.addProperty("startDate", new DateTimeSchema())
.addProperty("endDate", new DateTimeSchema())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.swagger.v3.oas.models.media.IntegerSchema;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.media.BooleanSchema;
import io.swagger.v3.oas.models.media.UUIDSchema;
import org.openmrs.Cohort;
import org.openmrs.api.context.Context;
import org.openmrs.module.webservices.rest.web.RequestContext;
Expand Down Expand Up @@ -99,7 +100,7 @@ public Schema<?> getGETSchema(Representation rep) {
Schema<?> schema = super.getGETSchema(rep);
if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) {
schema
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("display", new StringSchema())
.addProperty("name", new StringSchema())
.addProperty("description", new StringSchema())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.media.BooleanSchema;
import io.swagger.v3.oas.models.media.UUIDSchema;
import org.openmrs.ConceptDatatype;
import org.openmrs.api.context.Context;
import org.openmrs.module.webservices.rest.SimpleObject;
Expand Down Expand Up @@ -71,7 +72,7 @@ public Schema<?> getGETSchema(Representation rep) {
Schema<?> schema = super.getGETSchema(rep);
if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) {
schema
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("display", new StringSchema())
.addProperty("name", new StringSchema())
.addProperty("description", new StringSchema())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.media.ObjectSchema;
import io.swagger.v3.oas.models.media.UUIDSchema;
import org.openmrs.Concept;
import org.openmrs.ConceptDescription;
import org.openmrs.api.context.Context;
Expand Down Expand Up @@ -73,17 +74,17 @@ public Schema<?> getGETSchema(Representation rep) {
Schema<?> schema = new ObjectSchema();
if (rep instanceof RefRepresentation) {
schema
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("display", new StringSchema());
} else if (rep instanceof DefaultRepresentation) {
schema
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("display", new StringSchema())
.addProperty("description", new StringSchema())
.addProperty("locale", new StringSchema());
} else if (rep instanceof FullRepresentation) {
schema
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("display", new StringSchema())
.addProperty("description", new StringSchema())
.addProperty("locale", new StringSchema());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.media.ObjectSchema;
import io.swagger.v3.oas.models.media.UUIDSchema;
import org.openmrs.Concept;
import org.openmrs.ConceptMap;
import org.openmrs.api.context.Context;
Expand Down Expand Up @@ -72,13 +73,13 @@ public Schema<?> getGETSchema(Representation rep) {
if (rep instanceof DefaultRepresentation) {
schema
.addProperty("display", new StringSchema())
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("source", new Schema<Object>().$ref("#/components/schemas/ConceptSourceGetRef"))
.addProperty("sourceCode", new StringSchema());
} else if (rep instanceof FullRepresentation) {
schema
.addProperty("display", new StringSchema())
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("source", new Schema<Object>().$ref("#/components/schemas/ConceptSourceGet"))
.addProperty("sourceCode", new StringSchema())
.addProperty("comment", new StringSchema());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.media.BooleanSchema;
import io.swagger.v3.oas.models.media.DateTimeSchema;
import io.swagger.v3.oas.models.media.UUIDSchema;
import org.openmrs.Concept;
import org.openmrs.ConceptName;
import org.openmrs.api.ConceptNameType;
Expand Down Expand Up @@ -83,11 +84,11 @@ public Schema<?> getGETSchema(Representation rep) {
Schema<?> schema = new ObjectSchema();
if (rep instanceof RefRepresentation) {
schema
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("display", new StringSchema());
} else if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) {
schema
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("display", new StringSchema())
.addProperty("name", new StringSchema())
.addProperty("locale", new StringSchema().example("en"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import io.swagger.v3.oas.models.media.BooleanSchema;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.media.ObjectSchema;
import io.swagger.v3.oas.models.media.UUIDSchema;
import org.apache.commons.lang.StringUtils;
import org.openmrs.Concept;
import org.openmrs.ConceptAnswer;
Expand Down Expand Up @@ -219,7 +220,7 @@ public Schema<?> getGETSchema(Representation rep) {
Schema<?> schema = new ObjectSchema();
if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) {
schema
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("display", new StringSchema())
.addProperty("name", new Schema<Object>().$ref("#/components/schemas/ConceptNameGet"))
.addProperty("datatype", new Schema<Object>().$ref("#/components/schemas/ConceptdatatypeGetRef"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.media.BooleanSchema;
import io.swagger.v3.oas.models.media.UUIDSchema;
import org.openmrs.ConceptSource;
import org.openmrs.api.context.Context;
import org.openmrs.module.webservices.rest.web.RequestContext;
Expand Down Expand Up @@ -76,7 +77,7 @@ public Schema<?> getGETSchema(Representation rep) {
Schema<?> schema = super.getGETSchema(rep);
if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) {
schema
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("display", new StringSchema())
.addProperty("name", new StringSchema())
.addProperty("description", new StringSchema())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import io.swagger.v3.oas.models.media.BooleanSchema;
import io.swagger.v3.oas.models.media.NumberSchema;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.media.UUIDSchema;
import org.openmrs.Drug;
import org.openmrs.api.context.Context;
import org.openmrs.module.webservices.rest.web.RequestContext;
Expand Down Expand Up @@ -123,7 +124,7 @@ public Schema<?> getGETSchema(Representation rep) {
if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) {
schema
.addProperty("display", new StringSchema())
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("name", new StringSchema())
.addProperty("description", new StringSchema())
.addProperty("retired", new BooleanSchema())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.swagger.v3.oas.models.media.ObjectSchema;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.media.UUIDSchema;
import org.openmrs.Field;
import org.openmrs.Form;
import org.openmrs.FormField;
Expand Down Expand Up @@ -47,7 +48,7 @@ public Schema<?> getGETSchema(Representation rep) {
Schema<?> modelImpl = super.getGETSchema(rep);
if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) {
modelImpl
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("display", new StringSchema())
.addProperty("fieldNumber", new IntegerSchema())
.addProperty("fieldPart", new StringSchema())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import io.swagger.v3.oas.models.media.ObjectSchema;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.media.UUIDSchema;
import org.openmrs.api.context.Context;
import org.openmrs.hl7.HL7Source;
import org.openmrs.module.webservices.rest.web.RequestContext;
Expand Down Expand Up @@ -103,12 +104,12 @@ public Schema<?> getGETSchema(Representation rep) {
ObjectSchema objectSchema = (ObjectSchema) schema;
if (rep instanceof DefaultRepresentation) {
objectSchema
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("display", new StringSchema())
.addProperty("messageState", new IntegerSchema());
} else if (rep instanceof FullRepresentation) {
objectSchema
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("display", new StringSchema())
.addProperty("source", new Schema<HL7Source>().$ref("#/components/schemas/Hl7sourceGet"))
.addProperty("sourceKey", new StringSchema())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import io.swagger.v3.oas.models.media.ObjectSchema;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.media.UUIDSchema;
import org.apache.commons.io.FileUtils;
import org.openmrs.module.Module;
import org.openmrs.module.ModuleException;
Expand Down Expand Up @@ -112,7 +113,7 @@ public Schema<?> getGETSchema(Representation rep) {
Schema<?> model = super.getGETSchema(rep);
if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) {
model
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("display", new StringSchema())
.addProperty("name", new StringSchema())
.addProperty("description", new StringSchema())
Expand All @@ -129,7 +130,7 @@ public Schema<?> getGETSchema(Representation rep) {
.addProperty("requiredModules", new ArraySchema().items(new StringSchema()));
} else if (rep instanceof RefRepresentation) {
model
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("display", new StringSchema());
}
return model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import io.swagger.v3.oas.models.media.ObjectSchema;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.media.UUIDSchema;
import org.openmrs.Concept;
import org.openmrs.Encounter;
import org.openmrs.Order;
Expand Down Expand Up @@ -218,7 +219,7 @@ public Schema<?> getGETSchema(Representation rep) {
Schema<?> model = super.getGETSchema(rep);
if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) {
model
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("display", new StringSchema())
.addProperty("instructions", new StringSchema())
.addProperty("startDate", new DateSchema())
Expand All @@ -236,7 +237,7 @@ public Schema<?> getGETSchema(Representation rep) {
.addProperty("encounter", new Schema<Encounter>().$ref("#/components/schemas/EncounterGet"))
.addProperty("orderer", new Schema<User>().$ref("#/components/schemas/UserGet"))
.addProperty("discontinuedBy", new Schema<User>().$ref("#/components/schemas/UserGet"))
.addProperty("discontinuedReason", new Schema<Concept>().$ref("#/components/schemas.ConceptGet"));
.addProperty("discontinuedReason", new Schema<Concept>().$ref("#/components/schemas/ConceptGet"));
} else if (rep instanceof FullRepresentation) {
model
.addProperty("orderType", new Schema<OrderType>().$ref("#/components/schemas/OrdertypeGetFull"))
Expand All @@ -245,7 +246,7 @@ public Schema<?> getGETSchema(Representation rep) {
.addProperty("encounter", new Schema<Encounter>().$ref("#/components/schemas/EncounterGetFull"))
.addProperty("orderer", new Schema<User>().$ref("#/components/schemas/UserGetFull"))
.addProperty("discontinuedBy", new Schema<User>().$ref("#/components/schemas/UserGetFull"))
.addProperty("discontinuedReason", new Schema<Concept>().$ref("#/components/schemas.ConceptGetFull"));
.addProperty("discontinuedReason", new Schema<Concept>().$ref("#/components/schemas/ConceptGetFull"));
}
return model;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import io.swagger.v3.oas.models.media.ObjectSchema;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.media.UUIDSchema;
import org.apache.commons.lang3.StringUtils;
import org.openmrs.Location;
import org.openmrs.Patient;
Expand Down Expand Up @@ -139,7 +140,7 @@ public Schema<?> getGETSchema(Representation rep) {
Schema<?> model = super.getGETSchema(rep);
if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) {
model
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("display", new StringSchema())
.addProperty("identifier", new StringSchema())
.addProperty("preferred", new BooleanSchema()._default(false))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import io.swagger.v3.oas.models.media.BooleanSchema;
import io.swagger.v3.oas.models.media.ArraySchema;
import io.swagger.v3.oas.models.media.ObjectSchema;
import io.swagger.v3.oas.models.media.UUIDSchema;
import org.openmrs.Patient;
import org.openmrs.PatientIdentifier;
import org.openmrs.Person;
Expand Down Expand Up @@ -149,7 +150,7 @@ public Schema<?> getGETSchema(Representation rep) {
if (schema instanceof ObjectSchema && (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation)) {
ObjectSchema objectSchema = (ObjectSchema) schema;
objectSchema
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("display", new StringSchema())
.addProperty("identifiers", new ArraySchema().items(new Schema<Object>().$ref("#/components/schemas/PatientIdentifierGetRef")))
.addProperty("preferred", new BooleanSchema()._default(false))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import io.swagger.v3.oas.models.media.ObjectSchema;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.media.UUIDSchema;
import org.openmrs.PatientProgram;
import org.openmrs.PatientState;
import org.openmrs.ProgramWorkflow;
Expand Down Expand Up @@ -177,7 +178,7 @@ public Schema<?> getGETSchema(Representation rep) {
Schema<?> model = super.getGETSchema(rep);
if (rep instanceof RefRepresentation || rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) {
model
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("startDate", new DateSchema())
.addProperty("endDate", new DateSchema())
.addProperty("voided", new BooleanSchema());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import io.swagger.v3.oas.models.media.ObjectSchema;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.media.UUIDSchema;
import org.openmrs.Attributable;
import org.openmrs.Location;
import org.openmrs.Person;
Expand Down Expand Up @@ -159,14 +160,14 @@ public Schema<?> getGETSchema(Representation rep) {
if (rep instanceof DefaultRepresentation) {
model
.addProperty("display", new StringSchema())
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("value", new StringSchema())
.addProperty("attributeType", new Schema<PersonAttributeType>().$ref("#/components/schemas/PersonattributetypeGet"))
.addProperty("voided", new BooleanSchema());
} else if (rep instanceof FullRepresentation) {
model
.addProperty("display", new StringSchema())
.addProperty("uuid", new StringSchema())
.addProperty("uuid", new UUIDSchema())
.addProperty("value", new StringSchema())
.addProperty("attributeType", new Schema<PersonAttributeType>().$ref("#/components/schemas/PersonattributetypeGetFull"))
.addProperty("voided", new BooleanSchema())
Expand Down
Loading

0 comments on commit 9b0b984

Please sign in to comment.