/**
   * Update the ValueObject with the Domain Object.
   *
   * @param map DomainObjectMap of DomainObjects to already created ValueObjects.
   * @param valueObject to be updated
   * @param domainObject ims.ocrr.orderingresults.domain.objects.OrderChangeResponseQueue
   */
  public static ims.ocs_if.vo.OrderChangeResponseVo insert(
      DomainObjectMap map,
      ims.ocs_if.vo.OrderChangeResponseVo valueObject,
      ims.ocrr.orderingresults.domain.objects.OrderChangeResponseQueue domainObject) {
    if (null == domainObject) {
      return valueObject;
    }
    if (null == map) {
      map = new DomainObjectMap();
    }

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

    // ProviderSystem
    valueObject.setProviderSystem(
        ims.ocrr.vo.domain.ProviderSystemVoAssembler.create(map, domainObject.getProviderSystem()));
    // wasProcessed
    valueObject.setWasProcessed(domainObject.isWasProcessed());
    // wasDiscarded
    valueObject.setWasDiscarded(domainObject.isWasDiscarded());
    // msgText
    valueObject.setMsgText(domainObject.getMsgText());
    // ackText
    valueObject.setAckText(domainObject.getAckText());
    // failureMsg
    valueObject.setFailureMsg(domainObject.getFailureMsg());
    // messageStatus
    ims.domain.lookups.LookupInstance instance7 = domainObject.getMessageStatus();
    if (null != instance7) {
      ims.framework.utils.ImagePath img = null;
      ims.framework.utils.Color color = null;
      img = null;
      if (instance7.getImage() != null) {
        img =
            new ims.framework.utils.ImagePath(
                instance7.getImage().getImageId(), instance7.getImage().getImagePath());
      }
      color = instance7.getColor();
      if (color != null) color.getValue();

      ims.ocrr.vo.lookups.OrderMessageStatus voLookup7 =
          new ims.ocrr.vo.lookups.OrderMessageStatus(
              instance7.getId(), instance7.getText(), instance7.isActive(), null, img, color);
      ims.ocrr.vo.lookups.OrderMessageStatus parentVoLookup7 = voLookup7;
      ims.domain.lookups.LookupInstance parent7 = instance7.getParent();
      while (parent7 != null) {
        if (parent7.getImage() != null) {
          img =
              new ims.framework.utils.ImagePath(
                  parent7.getImage().getImageId(), parent7.getImage().getImagePath());
        } else {
          img = null;
        }
        color = parent7.getColor();
        if (color != null) color.getValue();
        parentVoLookup7.setParent(
            new ims.ocrr.vo.lookups.OrderMessageStatus(
                parent7.getId(), parent7.getText(), parent7.isActive(), null, img, color));
        parentVoLookup7 = parentVoLookup7.getParent();
        parent7 = parent7.getParent();
      }
      valueObject.setMessageStatus(voLookup7);
    }
    // msgType
    ims.domain.lookups.LookupInstance instance8 = domainObject.getMsgType();
    if (null != instance8) {
      ims.framework.utils.ImagePath img = null;
      ims.framework.utils.Color color = null;
      img = null;
      if (instance8.getImage() != null) {
        img =
            new ims.framework.utils.ImagePath(
                instance8.getImage().getImageId(), instance8.getImage().getImagePath());
      }
      color = instance8.getColor();
      if (color != null) color.getValue();

      ims.core.vo.lookups.MsgEventType voLookup8 =
          new ims.core.vo.lookups.MsgEventType(
              instance8.getId(), instance8.getText(), instance8.isActive(), null, img, color);
      ims.core.vo.lookups.MsgEventType parentVoLookup8 = voLookup8;
      ims.domain.lookups.LookupInstance parent8 = instance8.getParent();
      while (parent8 != null) {
        if (parent8.getImage() != null) {
          img =
              new ims.framework.utils.ImagePath(
                  parent8.getImage().getImageId(), parent8.getImage().getImagePath());
        } else {
          img = null;
        }
        color = parent8.getColor();
        if (color != null) color.getValue();
        parentVoLookup8.setParent(
            new ims.core.vo.lookups.MsgEventType(
                parent8.getId(), parent8.getText(), parent8.isActive(), null, img, color));
        parentVoLookup8 = parentVoLookup8.getParent();
        parent8 = parent8.getParent();
      }
      valueObject.setMsgType(voLookup8);
    }
    // queueType
    ims.domain.lookups.LookupInstance instance9 = domainObject.getQueueType();
    if (null != instance9) {
      ims.framework.utils.ImagePath img = null;
      ims.framework.utils.Color color = null;
      img = null;
      if (instance9.getImage() != null) {
        img =
            new ims.framework.utils.ImagePath(
                instance9.getImage().getImageId(), instance9.getImage().getImagePath());
      }
      color = instance9.getColor();
      if (color != null) color.getValue();

      ims.core.vo.lookups.QueueType voLookup9 =
          new ims.core.vo.lookups.QueueType(
              instance9.getId(), instance9.getText(), instance9.isActive(), null, img, color);
      ims.core.vo.lookups.QueueType parentVoLookup9 = voLookup9;
      ims.domain.lookups.LookupInstance parent9 = instance9.getParent();
      while (parent9 != null) {
        if (parent9.getImage() != null) {
          img =
              new ims.framework.utils.ImagePath(
                  parent9.getImage().getImageId(), parent9.getImage().getImagePath());
        } else {
          img = null;
        }
        color = parent9.getColor();
        if (color != null) color.getValue();
        parentVoLookup9.setParent(
            new ims.core.vo.lookups.QueueType(
                parent9.getId(), parent9.getText(), parent9.isActive(), null, img, color));
        parentVoLookup9 = parentVoLookup9.getParent();
        parent9 = parent9.getParent();
      }
      valueObject.setQueueType(voLookup9);
    }
    // Investigation
    if (domainObject.getInvestigation() != null) {
      if (domainObject.getInvestigation()
          instanceof
          HibernateProxy) // If the proxy is set, there is no need to lazy load, the proxy knows the
                          // id already.
      {
        HibernateProxy p = (HibernateProxy) domainObject.getInvestigation();
        int id = Integer.parseInt(p.getHibernateLazyInitializer().getIdentifier().toString());
        valueObject.setInvestigation(
            new ims.ocrr.orderingresults.vo.OrderInvestigationRefVo(id, -1));
      } else {
        valueObject.setInvestigation(
            new ims.ocrr.orderingresults.vo.OrderInvestigationRefVo(
                domainObject.getInvestigation().getId(),
                domainObject.getInvestigation().getVersion()));
      }
    }
    // StatusReason
    valueObject.setStatusReason(domainObject.getStatusReason());
    // CausingStatus
    ims.domain.lookups.LookupInstance instance12 = domainObject.getCausingStatus();
    if (null != instance12) {
      ims.framework.utils.ImagePath img = null;
      ims.framework.utils.Color color = null;
      img = null;
      if (instance12.getImage() != null) {
        img =
            new ims.framework.utils.ImagePath(
                instance12.getImage().getImageId(), instance12.getImage().getImagePath());
      }
      color = instance12.getColor();
      if (color != null) color.getValue();

      ims.ocrr.vo.lookups.OrderInvStatus voLookup12 =
          new ims.ocrr.vo.lookups.OrderInvStatus(
              instance12.getId(), instance12.getText(), instance12.isActive(), null, img, color);
      ims.ocrr.vo.lookups.OrderInvStatus parentVoLookup12 = voLookup12;
      ims.domain.lookups.LookupInstance parent12 = instance12.getParent();
      while (parent12 != null) {
        if (parent12.getImage() != null) {
          img =
              new ims.framework.utils.ImagePath(
                  parent12.getImage().getImageId(), parent12.getImage().getImagePath());
        } else {
          img = null;
        }
        color = parent12.getColor();
        if (color != null) color.getValue();
        parentVoLookup12.setParent(
            new ims.ocrr.vo.lookups.OrderInvStatus(
                parent12.getId(), parent12.getText(), parent12.isActive(), null, img, color));
        parentVoLookup12 = parentVoLookup12.getParent();
        parent12 = parent12.getParent();
      }
      valueObject.setCausingStatus(voLookup12);
    }
    // systemInformation
    // set system information
    valueObject.setSystemInformation(
        ims.vo.domain.SystemInformationAssembler.create(domainObject.getSystemInformation()));
    return valueObject;
  }