@Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("handlerClassname"); description.addProperty("display", "textToDisplay"); description.addSelfLink(); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description; }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource#getCreatableProperties() */ @Override public DelegatingResourceDescription getCreatableProperties() { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addRequiredProperty("name"); description.addRequiredProperty("locale"); description.addProperty("localePreferred"); description.addProperty("conceptNameType"); return description; }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource#getUpdatableProperties() */ @Override public DelegatingResourceDescription getUpdatableProperties() { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("condition"); description.removeProperty("patient"); description.addProperty("clinicalStatus"); description.addProperty("verificationStatus"); description.addProperty("onsetDate"); description.addProperty("endDate"); description.addProperty("additionalDetail"); description.addProperty("voided"); return description; }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource#getUpdatableProperties() */ @Override public DelegatingResourceDescription getUpdatableProperties() { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addRequiredProperty("person"); return description; }
@Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof RefRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("display"); description.addProperty("description"); description.addProperty("retired"); description.addSelfLink(); return description; } return super.getRepresentationDescription(rep); }
@Override public DelegatingResourceDescription getCreatableProperties() { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("provider"); description.addProperty("encounter"); description.addProperty("encounterRole"); return description; }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource#getUpdatableProperties() */ @Override public DelegatingResourceDescription getUpdatableProperties() throws ResourceDoesNotSupportOperationException { DelegatingResourceDescription description = super.getUpdatableProperties(); //shouldn't be editing the patient description.removeProperty("personA"); description.removeProperty("personB"); description.addProperty("voided"); return description; }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource#getUpdatableProperties() */ @Override public DelegatingResourceDescription getUpdatableProperties() throws ResourceDoesNotSupportOperationException { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addRequiredProperty("diagnosis"); description.addRequiredProperty("condition"); description.addRequiredProperty("rank"); description.removeProperty("patient"); description.addRequiredProperty("voided"); description.addRequiredProperty("certainty"); description.addRequiredProperty("encounter"); return description; }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource#getCreatableProperties() */ @Override public DelegatingResourceDescription getCreatableProperties() { DelegatingResourceDescription description = super.getCreatableProperties(); description.addRequiredProperty("allergyType"); description.addRequiredProperty("allergen"); description.addProperty("reaction"); description.addProperty("severity"); return description; }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.DelegatingResourceHandler#getCreatableProperties() */ @Override public DelegatingResourceDescription getCreatableProperties() { OrderResource1_8 orderResource = (OrderResource1_8) Context.getService(RestService.class) .getResourceBySupportedClass(Order.class); DelegatingResourceDescription d = orderResource.getCreatableProperties(); d.addProperty("dose"); d.addProperty("units"); d.addProperty("frequency"); d.addProperty("prn"); d.addProperty("complex"); d.addProperty("quantity"); d.addRequiredProperty("drug"); // DrugOrders have a specific hardcoded value for this property d.removeProperty("orderType"); return d; }
private void addValueLink(DelegatingResourceDescription rep, FormResource delegate) { rep.addLink("value", "./value"); } }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource#getCreatableProperties() */ @Override public DelegatingResourceDescription getCreatableProperties() { DelegatingResourceDescription description = super.getCreatableProperties(); description.removeProperty("doseStrength"); description.removeProperty("units"); description.removeProperty("route"); return description; }
@Override public DelegatingResourceDescription getCreatableProperties() { DelegatingResourceDescription resourceDescription = super.getCreatableProperties(); resourceDescription.getProperties().get("familyName").setRequired(false); return resourceDescription; }
throw new NullPointerException(); SimpleObject ret = new SimpleObject(); for (Map.Entry<String, DelegatingResourceDescription.Property> e : rep.getProperties().entrySet()) { ret.put(e.getKey(), e.getValue().evaluate(this, delegate)); for (Hyperlink link : rep.getLinks()) { if (link.getUri().startsWith(".")) { link = new Hyperlink(link.getRel(), getUri(delegate) + link.getUri().substring(1));
@RepHandler(FullRepresentation.class) public SimpleObject asFullRep(T delegate) throws Exception { DelegatingResourceDescription rep = new DelegatingResourceDescription(); rep.addProperty("uuid"); rep.addProperty("display"); rep.addProperty("name"); rep.addProperty("description"); rep.addProperty("retired"); rep.addProperty("auditInfo"); rep.addSelfLink(); return convertDelegateToRepresentation(delegate, rep); }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource#getCreatableProperties() */ @Override public DelegatingResourceDescription getCreatableProperties() { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addRequiredProperty("source"); description.addRequiredProperty("sourceCode"); return description; }
@Override public DelegatingResourceDescription getUpdatableProperties() { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("encounterRole"); description.addProperty("voided"); description.addProperty("voidReason"); return description; }
@Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { DelegatingResourceDescription description = super.getRepresentationDescription(rep); if (rep instanceof DefaultRepresentation) { description.addProperty("resources", Representation.REF); return description; } else if (rep instanceof FullRepresentation) { description.removeProperty("xslt"); description.removeProperty("template"); description.addProperty("resources"); return description; } return null; }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource#getCreatableProperties() */ @Override public DelegatingResourceDescription getCreatableProperties() { DelegatingResourceDescription description = super.getCreatableProperties(); description.addRequiredProperty("problem"); description.addProperty("modifier"); description.addProperty("sortWeight"); return description; }
public DelegatingResourceDescription addSelfLink() { return addLink("self", "."); }