/**
  * Copy one ValueObject to another
  *
  * @param valueObjectDest to be updated
  * @param valueObjectSrc to copy values from
  */
 public static ims.clinical.vo.PatientAbsentProcedureVo copy(
     ims.clinical.vo.PatientAbsentProcedureVo valueObjectDest,
     ims.clinical.vo.PatientAbsentProcedureVo valueObjectSrc) {
   if (null == valueObjectSrc) {
     return valueObjectSrc;
   }
   valueObjectDest.setID_PatientAbsentProcedure(valueObjectSrc.getID_PatientAbsentProcedure());
   valueObjectDest.setIsRIE(valueObjectSrc.getIsRIE());
   // Procedure
   valueObjectDest.setProcedure(valueObjectSrc.getProcedure());
   // Selected
   valueObjectDest.setSelected(valueObjectSrc.getSelected());
   // SourceofInformation
   valueObjectDest.setSourceofInformation(valueObjectSrc.getSourceofInformation());
   return valueObjectDest;
 }
  /**
   * Update the ValueObject with the Domain Object.
   *
   * @param map DomainObjectMap of DomainObjects to already created ValueObjects.
   * @param valueObject to be updated
   * @param domainObject ims.clinical.domain.objects.PatientAbsentProcedure
   */
  public static ims.clinical.vo.PatientAbsentProcedureVo insert(
      DomainObjectMap map,
      ims.clinical.vo.PatientAbsentProcedureVo valueObject,
      ims.clinical.domain.objects.PatientAbsentProcedure domainObject) {
    if (null == domainObject) {
      return valueObject;
    }
    if (null == map) {
      map = new DomainObjectMap();
    }

    valueObject.setID_PatientAbsentProcedure(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;

    // Procedure
    valueObject.setProcedure(
        ims.core.vo.domain.ProcedureLiteVoAssembler.create(map, domainObject.getProcedure()));
    // Selected
    ims.domain.lookups.LookupInstance instance2 = domainObject.getSelected();
    if (null != instance2) {
      ims.framework.utils.ImagePath img = null;
      ims.framework.utils.Color color = null;
      img = null;
      if (instance2.getImage() != null) {
        img =
            new ims.framework.utils.ImagePath(
                instance2.getImage().getImageId(), instance2.getImage().getImagePath());
      }
      color = instance2.getColor();
      if (color != null) color.getValue();

      ims.clinical.vo.lookups.PresentAbsentUnknown voLookup2 =
          new ims.clinical.vo.lookups.PresentAbsentUnknown(
              instance2.getId(), instance2.getText(), instance2.isActive(), null, img, color);
      ims.clinical.vo.lookups.PresentAbsentUnknown parentVoLookup2 = voLookup2;
      ims.domain.lookups.LookupInstance parent2 = instance2.getParent();
      while (parent2 != null) {
        if (parent2.getImage() != null) {
          img =
              new ims.framework.utils.ImagePath(
                  parent2.getImage().getImageId(), parent2.getImage().getImagePath());
        } else {
          img = null;
        }
        color = parent2.getColor();
        if (color != null) color.getValue();
        parentVoLookup2.setParent(
            new ims.clinical.vo.lookups.PresentAbsentUnknown(
                parent2.getId(), parent2.getText(), parent2.isActive(), null, img, color));
        parentVoLookup2 = parentVoLookup2.getParent();
        parent2 = parent2.getParent();
      }
      valueObject.setSelected(voLookup2);
    }
    // SourceofInformation
    ims.domain.lookups.LookupInstance instance3 = domainObject.getSourceofInformation();
    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.SourceofInformation voLookup3 =
          new ims.core.vo.lookups.SourceofInformation(
              instance3.getId(), instance3.getText(), instance3.isActive(), null, img, color);
      ims.core.vo.lookups.SourceofInformation 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.SourceofInformation(
                parent3.getId(), parent3.getText(), parent3.isActive(), null, img, color));
        parentVoLookup3 = parentVoLookup3.getParent();
        parent3 = parent3.getParent();
      }
      valueObject.setSourceofInformation(voLookup3);
    }
    return valueObject;
  }