Source:
public Model getCREATEModel(Representation rep) { ModelImpl model = new ModelImpl() .property("encounter", new StringProperty().example("uuid")) .property("action", new StringProperty() ._enum(EnumProperty.getEnumsAsList(Order.Action.class))) .property("accessionNumber", new StringProperty()) .property("dateActivated", new DateProperty()) .property("scheduledDate", new DateProperty()) .property("patient", new StringProperty().example("uuid")) .property("concept", new StringProperty().example("uuid")) .property("careSetting", new StringProperty().example("uuid")) .property("dateStopped", new DateProperty()) .property("autoExpireDate", new DateProperty()) .property("orderer", new StringProperty().example("uuid")) .property("previousOrder", new StringProperty().example("uuid")) .property("urgency", new StringProperty() ._enum(EnumProperty.getEnumsAsList(Order.Urgency.class))) .property("orderReason", new StringProperty().example("uuid")) .property("orderReasonNonCoded", new StringProperty()) .property("instructions", new StringProperty()) .property("commentToFulfiller", new StringProperty()) .required("orderType").required("patient").required("concept"); if (rep instanceof FullRepresentation) { model .property("encounter", new RefProperty("#/definitions/EncounterCreate")) .property("patient", new RefProperty("#/definitions/PatientCreate")) .property("concept", new RefProperty("#/definitions/ConceptCreate")) .property("orderer", new RefProperty("#/definitions/UserCreate")) .property("previousOrder", new RefProperty("#/definitions/OrderCreate")) .property("orderReason", new RefProperty("#/definitions/ConceptCreate")); } return model; }

Target:
public Model getCREATEModel(Representation rep) { ModelImpl model = new ModelImpl() .property("encounter", new StringProperty().example("uuid")) .property("action", new StringProperty() ._enum(SwaggerSpecificationCreator.getEnumsAsList(Order.Action.class))) .property("accessionNumber", new StringProperty()) .property("dateActivated", new DateProperty()) .property("scheduledDate", new DateProperty()) .property("patient", new StringProperty().example("uuid")) .property("concept", new StringProperty().example("uuid")) .property("careSetting", new StringProperty().example("uuid")) .property("dateStopped", new DateProperty()) .property("autoExpireDate", new DateProperty()) .property("orderer", new StringProperty().example("uuid")) .property("previousOrder", new StringProperty().example("uuid")) .property("urgency", new StringProperty() ._enum(SwaggerSpecificationCreator.getEnumsAsList(Order.Urgency.class))) .property("orderReason", new StringProperty().example("uuid")) .property("orderReasonNonCoded", new StringProperty()) .property("instructions", new StringProperty()) .property("commentToFulfiller", new StringProperty()) .required("orderType").required("patient").required("concept"); if (rep instanceof FullRepresentation) { model .property("encounter", new RefProperty("#/definitions/EncounterCreate")) .property("patient", new RefProperty("#/definitions/PatientCreate")) .property("concept", new RefProperty("#/definitions/ConceptCreate")) .property("orderer", new RefProperty("#/definitions/UserCreate")) .property("previousOrder", new RefProperty("#/definitions/OrderCreate")) .property("orderReason", new RefProperty("#/definitions/ConceptCreate")); } return model; }