/** * @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; }
/** * @see DelegatingCrudResource#getRepresentationDescription(Representation) */ @Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof DefaultRepresentation) { DelegatingResourceDescription description = super.getRepresentationDescription(rep); description.removeProperty("doseStrength"); description.removeProperty("units"); description.removeProperty("route"); return description; } else if (rep instanceof FullRepresentation) { DelegatingResourceDescription description = super.getRepresentationDescription(rep); description.removeProperty("doseStrength"); description.removeProperty("units"); description.removeProperty("route"); return description; } return null; }
/** * @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#getRepresentationDescription(org.openmrs.module.webservices.rest.web.representation.Representation) */ @Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { DelegatingResourceDescription description = super.getRepresentationDescription(rep); if (description != null) { description.removeProperty("checkDigit"); } 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("patient"); return description; }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource#getRepresentationDescription(org.openmrs.module.webservices.rest.web.representation.Representation) */ @Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { DelegatingResourceDescription description = super.getRepresentationDescription(rep); if (description != null) { description.removeProperty("secretQuestion"); } return description; }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource#getCreatableProperties() */ @Override public DelegatingResourceDescription getCreatableProperties() { DelegatingResourceDescription description = super.getCreatableProperties(); if (description != null) { description.removeProperty("checkDigit"); } return description; }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource#getUpdatableProperties() */ @Override public DelegatingResourceDescription getUpdatableProperties() throws ResourceDoesNotSupportOperationException { DelegatingResourceDescription description = getCreatableProperties(); description.removeProperty("property"); 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; }
/** * It is used internally for the fullchildren representation. Contrary to the fullchildren * handler it does not check for cycles. * * @param delegate * @return * @throws ConversionException */ @RepHandler(value = NamedRepresentation.class, name = "fullchildreninternal") public SimpleObject asFullChildrenInternal(Concept delegate) throws ConversionException { DelegatingResourceDescription description = fullRepresentationDescription(delegate); description.removeProperty("setMembers"); description.addProperty("setMembers", new NamedRepresentation("fullchildreninternal")); description.removeProperty("answers"); description.addProperty("answers", Representation.FULL); return convertDelegateToRepresentation(delegate, description); }
/** * @see DelegatingCrudResource#getRepresentationDescription(Representation) */ @Override public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof DefaultRepresentation) { DelegatingResourceDescription description = super.getRepresentationDescription(rep); description.addProperty("visit", Representation.REF); description.removeProperty("provider"); description.addProperty("encounterProviders", Representation.REF); return description; } else if (rep instanceof FullRepresentation) { DelegatingResourceDescription description = super.getRepresentationDescription(rep); description.addProperty("visit", Representation.DEFAULT); description.removeProperty("provider"); description.addProperty("encounterProviders", Representation.DEFAULT); return description; } return null; }
/** * @see DelegatingCrudResource#fullRepresentationDescription(Concept) */ @Override protected DelegatingResourceDescription fullRepresentationDescription(Concept delegate) { DelegatingResourceDescription description = super.fullRepresentationDescription(delegate); if (delegate.isNumeric()) { description.removeProperty("precise"); description.addProperty("allowDecimal"); description.addProperty("displayPrecision"); } 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#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.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; }