private Location getHospital(Location doLocation) {
    if (doLocation == null) return null;

    if (doLocation instanceof Location
        && doLocation.getType().equals(getDomLookup(LocationType.HOSP))) return doLocation;

    while (doLocation.getParentLocation() != null) {
      doLocation = doLocation.getParentLocation();
      if (doLocation instanceof Location
          && doLocation.getType().equals(getDomLookup(LocationType.HOSP))) return doLocation;
    }

    return null;
  }
  /**
   * 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.resource.place.domain.objects.Location
   */
  public static ims.admin.vo.LocationShortVo insert(
      DomainObjectMap map,
      ims.admin.vo.LocationShortVo valueObject,
      ims.core.resource.place.domain.objects.Location domainObject) {
    if (null == domainObject) {
      return valueObject;
    }
    if (null == map) {
      map = new DomainObjectMap();
    }

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

    // UpperName
    valueObject.setUpperName(domainObject.getUpperName());
    // Name
    valueObject.setName(domainObject.getName());
    // isActive
    valueObject.setIsActive(domainObject.isIsActive());
    // IsVirtual
    valueObject.setIsVirtual(domainObject.isIsVirtual());
    // Type
    ims.domain.lookups.LookupInstance instance5 = domainObject.getType();
    if (null != instance5) {
      ims.framework.utils.ImagePath img = null;
      ims.framework.utils.Color color = null;
      img = null;
      if (instance5.getImage() != null) {
        img =
            new ims.framework.utils.ImagePath(
                instance5.getImage().getImageId(), instance5.getImage().getImagePath());
      }
      color = instance5.getColor();
      if (color != null) color.getValue();

      ims.core.vo.lookups.LocationType voLookup5 =
          new ims.core.vo.lookups.LocationType(
              instance5.getId(), instance5.getText(), instance5.isActive(), null, img, color);
      ims.core.vo.lookups.LocationType parentVoLookup5 = voLookup5;
      ims.domain.lookups.LookupInstance parent5 = instance5.getParent();
      while (parent5 != null) {
        if (parent5.getImage() != null) {
          img =
              new ims.framework.utils.ImagePath(
                  parent5.getImage().getImageId(), parent5.getImage().getImagePath());
        } else {
          img = null;
        }
        color = parent5.getColor();
        if (color != null) color.getValue();
        parentVoLookup5.setParent(
            new ims.core.vo.lookups.LocationType(
                parent5.getId(), parent5.getText(), parent5.isActive(), null, img, color));
        parentVoLookup5 = parentVoLookup5.getParent();
        parent5 = parent5.getParent();
      }
      valueObject.setType(voLookup5);
    }
    // DisplayInEDTracking
    valueObject.setDisplayInEDTracking(domainObject.isDisplayInEDTracking());
    // CaseNoteFolderLocation
    valueObject.setCaseNoteFolderLocation(domainObject.isCaseNoteFolderLocation());
    return valueObject;
  }