コード例 #1
0
 /**
  * Copy one ValueObject to another
  *
  * @param valueObjectDest to be updated
  * @param valueObjectSrc to copy values from
  */
 public static ims.core.vo.ConsultantStayMinVo copy(
     ims.core.vo.ConsultantStayMinVo valueObjectDest,
     ims.core.vo.ConsultantStayMinVo valueObjectSrc) {
   if (null == valueObjectSrc) {
     return valueObjectSrc;
   }
   valueObjectDest.setID_ConsultantStay(valueObjectSrc.getID_ConsultantStay());
   valueObjectDest.setIsRIE(valueObjectSrc.getIsRIE());
   // transferDateTime
   valueObjectDest.setTransferDateTime(valueObjectSrc.getTransferDateTime());
   // endDateTime
   valueObjectDest.setEndDateTime(valueObjectSrc.getEndDateTime());
   // PatientStatus
   valueObjectDest.setPatientStatus(valueObjectSrc.getPatientStatus());
   return valueObjectDest;
 }
コード例 #2
0
  /**
   * Update the ValueObject with the Domain Object.
   *
   * @param map DomainObjectMap of DomainObjects to already created ValueObjects.
   * @param valueObject to be updated
   * @param domainObject ims.core.admin.pas.domain.objects.ConsultantStay
   */
  public static ims.core.vo.ConsultantStayMinVo insert(
      DomainObjectMap map,
      ims.core.vo.ConsultantStayMinVo valueObject,
      ims.core.admin.pas.domain.objects.ConsultantStay domainObject) {
    if (null == domainObject) {
      return valueObject;
    }
    if (null == map) {
      map = new DomainObjectMap();
    }

    valueObject.setID_ConsultantStay(domainObject.getId());
    valueObject.setIsRIE(domainObject.getIsRIE());

    // If this is a recordedInError record, and the domainObject
    // value isIncludeRecord has not been set, then we return null and
    // not the value object
    if (valueObject.getIsRIE() != null
        && valueObject.getIsRIE().booleanValue() == true
        && !domainObject.isIncludeRecord()) return null;

    // If this is not a recordedInError record, and the domainObject
    // value isIncludeRecord has been set, then we return null and
    // not the value object
    if ((valueObject.getIsRIE() == null || valueObject.getIsRIE().booleanValue() == false)
        && domainObject.isIncludeRecord()) return null;

    // transferDateTime
    java.util.Date transferDateTime = domainObject.getTransferDateTime();
    if (null != transferDateTime) {
      valueObject.setTransferDateTime(new ims.framework.utils.DateTime(transferDateTime));
    }
    // endDateTime
    java.util.Date endDateTime = domainObject.getEndDateTime();
    if (null != endDateTime) {
      valueObject.setEndDateTime(new ims.framework.utils.DateTime(endDateTime));
    }
    // PatientStatus
    ims.domain.lookups.LookupInstance instance3 = domainObject.getPatientStatus();
    if (null != instance3) {
      ims.framework.utils.ImagePath img = null;
      ims.framework.utils.Color color = null;
      img = null;
      if (instance3.getImage() != null) {
        img =
            new ims.framework.utils.ImagePath(
                instance3.getImage().getImageId(), instance3.getImage().getImagePath());
      }
      color = instance3.getColor();
      if (color != null) color.getValue();

      ims.core.vo.lookups.PatientStatus voLookup3 =
          new ims.core.vo.lookups.PatientStatus(
              instance3.getId(), instance3.getText(), instance3.isActive(), null, img, color);
      ims.core.vo.lookups.PatientStatus parentVoLookup3 = voLookup3;
      ims.domain.lookups.LookupInstance parent3 = instance3.getParent();
      while (parent3 != null) {
        if (parent3.getImage() != null) {
          img =
              new ims.framework.utils.ImagePath(
                  parent3.getImage().getImageId(), parent3.getImage().getImagePath());
        } else {
          img = null;
        }
        color = parent3.getColor();
        if (color != null) color.getValue();
        parentVoLookup3.setParent(
            new ims.core.vo.lookups.PatientStatus(
                parent3.getId(), parent3.getText(), parent3.isActive(), null, img, color));
        parentVoLookup3 = parentVoLookup3.getParent();
        parent3 = parent3.getParent();
      }
      valueObject.setPatientStatus(voLookup3);
    }
    return valueObject;
  }