@Override public Model getCREATEModel(Representation rep) { return super.getGETModel(rep); } }
/** * @see SubResource#update(java.lang.String, java.lang.String, SimpleObject, RequestContext) */ @Override public Object update(String parentUniqueId, String uuid, SimpleObject propertiesToUpdate, RequestContext context) throws ResponseException { T delegate = getByUniqueId(uuid); if (delegate == null) throw new ObjectNotFoundException(); testParent(delegate, parentUniqueId); setConvertedProperties(delegate, propertiesToUpdate, getUpdatableProperties(), false); delegate = save(delegate); return ConversionUtil.convertToRepresentation(delegate, Representation.DEFAULT); }
/** * @see SubResource#retrieve(java.lang.String, java.lang.String, RequestContext) */ @Override public Object retrieve(String parentUniqueId, String uuid, RequestContext context) throws ResponseException { T delegate = getByUniqueId(uuid); if (delegate == null) throw new ObjectNotFoundException(); testParent(delegate, parentUniqueId); return asRepresentation(delegate, context.getRepresentation()); }
/** * @see org.openmrs.module.webservices.rest.web.resource.api.SubResource#delete(java.lang.String, * java.lang.String, java.lang.String, * org.openmrs.module.webservices.rest.web.RequestContext) */ @Override public void delete(String parentUniqueId, String uuid, String reason, RequestContext context) throws ResponseException { T delegate = getByUniqueId(uuid); if (delegate == null) throw new ObjectNotFoundException(); testParent(delegate, parentUniqueId); delete(delegate, reason, context); }
@Override public DelegatingResourceDescription getUpdatableProperties() throws ResourceDoesNotSupportOperationException { DelegatingResourceDescription updatableProperties = super.getUpdatableProperties(); updatableProperties.addProperty("startDate"); updatableProperties.addProperty("endDate"); updatableProperties.addProperty("voided"); return updatableProperties; }
return convertDelegateToRepresentation(delegate, description);
@Override public Model getGETModel(Representation rep) { ModelImpl model = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { model .property("uuid", new StringProperty()) .property("handlerClassname", new StringProperty()) .property("display", new StringProperty()); //FIXME delegate property name } return model; }
@Override public Model getGETModel(Representation rep) { ModelImpl model = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { model .property("display", new StringProperty()) .property("uuid", new StringProperty()) .property("attributeType", new StringProperty()) //FIXME type .property("value", new StringProperty()) //FIXME type .property("voided", new BooleanProperty()); } return model; }
@Override public Model getGETModel(Representation rep) { ModelImpl model = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { model .property("uuid", new StringProperty()) .property("display", new StringProperty()) .property("startDate", new DateProperty()) .property("endDate", new DateProperty()) .property("patientUuid", new StringProperty()); } //FIXME missing props return model; }
public Model getGETModel(Representation rep) { ModelImpl modelImpl = (ModelImpl) super.getGETModel(rep); if (rep instanceof RefRepresentation) { modelImpl .property("display", new StringProperty()); } else if (rep instanceof DefaultRepresentation) { modelImpl .property("display", new StringProperty()) .property("patient", new RefProperty("#/definitions/PatientGetRef")); } else if (rep instanceof FullRepresentation) { modelImpl .property("display", new StringProperty()) .property("patient", new RefProperty("#/definitions/PatientGetRef")); } return modelImpl; }
public Model getGETModel(Representation rep) { ModelImpl model = ((ModelImpl) super.getGETModel(rep)) .property("uuid", new StringProperty()) .property("display", new StringProperty()); if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { model .property("name", new StringProperty()) .property("locale", new StringProperty().example("en")) .property("localePreferred", new BooleanProperty()) .property("conceptNameType", new EnumProperty(ConceptNameType.class)); } return model; }
@Override public Model getGETModel(Representation rep) { ModelImpl model = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { model .property("uuid", new StringProperty()) .property("provider", new RefProperty("#/definitions/ProviderGetRef")) .property("encounterRole", new RefProperty("#/definitions/EncounterroleGetRef")) .property("voided", new BooleanProperty()); } if (rep instanceof FullRepresentation) { model .property("provider", new RefProperty("#/definitions/ProviderGet")) .property("encounterRole", new RefProperty("#/definitions/EncounterroleGet")); } return model; }
@Override public Model getGETModel(Representation rep) { ModelImpl modelImpl = ((ModelImpl) super.getGETModel(rep)) .property("uuid", new StringProperty()) .property("display", new StringProperty()); if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { modelImpl .property("name", new StringProperty()) .property("valueReference", new StringProperty()); } if (rep instanceof FullRepresentation) { modelImpl .property("dataType", new StringProperty()) .property("handler", new StringProperty()) .property("handlerConfig", new StringProperty()); } return modelImpl; }
@Override public Model getGETModel(Representation rep) { ModelImpl modelImpl = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { modelImpl .property("uuid", new StringProperty()) .property("display", new StringProperty()) .property("strength", new DoubleProperty()); } if (rep instanceof DefaultRepresentation) { modelImpl .property("ingredient", new RefProperty("#/definitions/ConceptGetRef")) .property("units", new RefProperty("#/definitions/ConceptGetRef")); } else if (rep instanceof FullRepresentation) { modelImpl .property("ingredient", new RefProperty("#/definitions/ConceptGet")) .property("units", new RefProperty("#/definitions/ConceptGet")); } return modelImpl; }
public Model getGETModel(Representation rep) { ModelImpl modelImpl = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation) { modelImpl .property("uuid", new StringProperty()) .property("display", new StringProperty()) .property("concept", new RefProperty("#/definitions/ConceptGetRef")) .property("field", new RefProperty("#/definitions/FieldGetRef")); } else if (rep instanceof FullRepresentation) { modelImpl .property("uuid", new StringProperty()) .property("display", new StringProperty()) .property("concept", new RefProperty("#/definitions/ConceptGet")) .property("field", new RefProperty("#/definitions/FieldGet")); } return modelImpl; }
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("sourceCode", new StringProperty()); } else if (rep instanceof FullRepresentation) { modelImpl .property("display", new StringProperty()) .property("uuid", new StringProperty()) .property("source", new StringProperty()) //FIXME .property("sourceCode", new StringProperty()) .property("comment", new StringProperty()); } return modelImpl; }
@Override public Model getGETModel(Representation rep) { ModelImpl model = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { model .property("uuid", new StringProperty()) .property("display", new StringProperty()) .property("identifier", new StringProperty()) .property("preferred", new BooleanProperty()._default(false)) .property("voided", new BooleanProperty()); } if (rep instanceof DefaultRepresentation) { model .property("identifierType", new RefProperty("#/definitions/PatientidentifiertypeGetRef")) .property("location", new RefProperty("#/definitions/LocationGetRef")); } else if (rep instanceof FullRepresentation) { model .property("identifierType", new RefProperty("#/definitions/PatientidentifiertypeGet")) .property("location", new RefProperty("#/definitions/LocationGet")); } return model; }
@Override public Model getGETModel(Representation rep) { ModelImpl modelImpl = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { modelImpl .property("uuid", new StringProperty()) .property("display", new StringProperty()) .property("retired", new BooleanProperty()) .property("orderTemplate", new StringProperty()) .property("orderTemplateType", new StringProperty()); } if (rep instanceof DefaultRepresentation) { modelImpl .property("orderType", new RefProperty("#/definitions/OrdertypeGetRef")) .property("concept", new RefProperty("#/definitions/ConceptGetRef")); } else if (rep instanceof FullRepresentation) { modelImpl .property("orderType", new RefProperty("#/definitions/OrdertypeGet")) .property("concept", new RefProperty("#/definitions/ConceptGet")); } return modelImpl; }
@Override public Model getGETModel(Representation rep) { ModelImpl model = (ModelImpl) super.getGETModel(rep); if (rep instanceof RefRepresentation || rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { model .property("uuid", new StringProperty()) .property("startDate", new DateProperty()) .property("endDate", new DateProperty()) .property("voided", new BooleanProperty()); } if (rep instanceof DefaultRepresentation) { model .property("state", new RefProperty("#/definitions/WorkflowStateGet")); } else if (rep instanceof RefRepresentation) { model .property("state", new RefProperty("#/definitions/WorkflowStateGetRef")) .property("patientProgram", new ObjectProperty()); //FIXME type } else if (rep instanceof FullRepresentation) { model .property("state", new RefProperty("#/definitions/WorkflowStateGetRef")) .property("patientProgram", new ObjectProperty()); //FIXME type } return model; }
public Model getGETModel(Representation rep) { ModelImpl modelImpl = (ModelImpl) super.getGETModel(rep); if (rep instanceof RefRepresentation) { modelImpl .property("uuid", new StringProperty()) .property("display", new StringProperty()); } else if (rep instanceof DefaultRepresentation) { modelImpl .property("uuid", new StringProperty()) .property("display", new StringProperty()) .property("description", new StringProperty()) .property("locale", new StringProperty()); } else if (rep instanceof FullRepresentation) { modelImpl .property("uuid", new StringProperty()) .property("display", new StringProperty()) .property("description", new StringProperty()) .property("locale", new StringProperty()); } return modelImpl; }