Package org.openmrs.module.webservices.rest.web.resource.impl

Examples of org.openmrs.module.webservices.rest.web.resource.impl.DelegatingResourceDescription


  }
 
  @Override
  public DelegatingResourceDescription getRepresentationDescription(Representation rep) {
    if (rep instanceof DefaultRepresentation) {
      DelegatingResourceDescription description = new DelegatingResourceDescription();
      description.addProperty("uuid");
      description.addProperty("display", findMethod("getDisplayString"));
      description.addProperty("name");
      description.addProperty("price");
      description.addProperty("cost");
      description.addProperty("description");
      description.addProperty("retired");
      description.addSelfLink();
      description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL);
      return description;
    } else if (rep instanceof FullRepresentation) {
      DelegatingResourceDescription description = new DelegatingResourceDescription();
      description.addProperty("uuid");
      description.addProperty("display", findMethod("getDisplayString"));
      description.addProperty("name");
      description.addProperty("description");
      description.addProperty("price");
      description.addProperty("cost");
      description.addProperty("retired");
      description.addProperty("auditInfo", findMethod("getAuditInfo"));
      description.addSelfLink();
      return description;
    }
    return null;
  }
View Full Code Here


    return null;
  }
 
  @Override
  public DelegatingResourceDescription getCreatableProperties() {
    DelegatingResourceDescription description = new DelegatingResourceDescription();
    description.addRequiredProperty("drug_id");
    description.addRequiredProperty("name");
    description.addRequiredProperty("description");
    return description;
  }
View Full Code Here

    return description;
  }
 
  @Override
  public DelegatingResourceDescription getUpdatableProperties() throws ResourceDoesNotSupportOperationException {
    DelegatingResourceDescription description = new DelegatingResourceDescription();
    description.addProperty("description");
    return description;
  }
View Full Code Here

 
  @Override
  public DelegatingResourceDescription getRepresentationDescription(Representation rep) {
    // TODO Auto-generated method stub
    if (rep instanceof DefaultRepresentation) {
      DelegatingResourceDescription description = new DelegatingResourceDescription();
      description.addProperty("uuid");
      description.addProperty("druId");
      description.addProperty("quantity");
      description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL);
      return description;
    } else if (rep instanceof FullRepresentation) {
      DelegatingResourceDescription description = new DelegatingResourceDescription();
      description.addProperty("uuid");
      description.addProperty("drugId");
      description.addProperty("quantity");
     
      return description;
    }
    return null;
  }
View Full Code Here

    return null;
  }
 
  @Override
  public DelegatingResourceDescription getCreatableProperties() {
    DelegatingResourceDescription description = new DelegatingResourceDescription();
    description.addRequiredProperty("drugId");
    description.addRequiredProperty("quantity");
    return description;
  }
View Full Code Here

   * org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource#getRepresentationDescription(org.openmrs.module.webservices.rest.web.representation.Representation)
   */
  @Override
  public DelegatingResourceDescription getRepresentationDescription(Representation rep) {
    if (rep instanceof DefaultRepresentation) {
      DelegatingResourceDescription description = new DelegatingResourceDescription();
      description.addProperty("uuid");
      description.addProperty("display", findMethod("getDisplayString"));
      description.addProperty("name");
      description.addProperty("description");
      description.addProperty("drugs", Representation.REF);
      description.addProperty("retired");
      description.addSelfLink();
      description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL);
      return description;
    } else if (rep instanceof FullRepresentation) {
      DelegatingResourceDescription description = new DelegatingResourceDescription();
      description.addProperty("uuid");
      description.addProperty("display", findMethod("getDisplayString"));
      description.addProperty("name");
      description.addProperty("description");
      description.addProperty("drugs", Representation.DEFAULT);
      description.addProperty("retired");
      description.addProperty("auditInfo", findMethod("getAuditInfo"));
      description.addSelfLink();
      return description;
    }
    return null;
  }
View Full Code Here

   * @see
   * org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource#getCreatableProperties()
   */
  @Override
  public DelegatingResourceDescription getCreatableProperties() {
    DelegatingResourceDescription description = new DelegatingResourceDescription();
    description.addRequiredProperty("drug_group_id");
    description.addRequiredProperty("name");
    description.addRequiredProperty("description");
    return description;
  }
View Full Code Here

   * @see
   * org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource#getUpdatableProperties()
   */
  @Override
  public DelegatingResourceDescription getUpdatableProperties() throws ResourceDoesNotSupportOperationException {
    DelegatingResourceDescription description = new DelegatingResourceDescription();
    description.addProperty("description");
    return description;
  }
View Full Code Here

   * @see DelegatingCrudResource#getRepresentationDescription(Representation)
   */
  @Override
  public DelegatingResourceDescription getRepresentationDescription(Representation rep) {
    if (rep instanceof DefaultRepresentation) {
      DelegatingResourceDescription description = new DelegatingResourceDescription();
      description.addProperty("uuid");
      description.addProperty("display", findMethod("getDisplayString"));
      description.addProperty("name");
      description.addProperty("description");
      description.addProperty("patient", Representation.REF);
      description.addProperty("seen");
      description.addProperty("alertType");
      description.addProperty("time");
      description.addProperty("defaultTask");
      description.addProperty("providerSent", Representation.REF);
      description.addProperty("providerRecipient", Representation.REF);
      //cannot add 'voided' property as a bug exists in OpenMRS: tickets.openmrs.org/browse/TRUNK-2205
      //description.addProperty("voided");
      description.addSelfLink();
      description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL);
      return description;
    } else if (rep instanceof FullRepresentation) {
      DelegatingResourceDescription description = new DelegatingResourceDescription();
      description.addProperty("uuid");
      description.addProperty("display", findMethod("getDisplayString"));
      description.addProperty("name");
      description.addProperty("description");
      description.addProperty("patient");
      description.addProperty("seen");
      description.addProperty("alertType");
      description.addProperty("time");
      description.addProperty("defaultTask");
      description.addProperty("providerSent");
      description.addProperty("providerRecipient");
      //cannot add 'voided' property as a bug exists in OpenMRS: tickets.openmrs.org/browse/TRUNK-2205
      //description.addProperty("voided");
      description.addProperty("auditInfo", findMethod("getAuditInfo"));
      description.addSelfLink();
      return description;
    }
    return null;
  }
View Full Code Here

  /**
   * @see org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource#getCreatableProperties()
   */
  @Override
  public DelegatingResourceDescription getCreatableProperties() {
    DelegatingResourceDescription description = new DelegatingResourceDescription();
   
    description.addRequiredProperty("patient");
    description.addRequiredProperty("providerSent");
    description.addRequiredProperty("providerRecipient");
   
    description.addProperty("alertType");
    description.addProperty("name");
    description.addProperty("time");
    description.addProperty("defaultTask");
    return description;
  }
View Full Code Here

TOP

Related Classes of org.openmrs.module.webservices.rest.web.resource.impl.DelegatingResourceDescription

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.