/**
   * Create the ValueObject collection to hold the set of DomainObjects.
   *
   * @param map - maps DomainObjects to created ValueObjects
   * @param domainObjectSet - Set of
   *     ims.assessment.configuration.domain.objects.PatientAssessmentFolder objects.
   */
  public static ims.assessment.vo.PatientAssessmentFolderVoCollection
      createPatientAssessmentFolderVoCollectionFromPatientAssessmentFolder(
          DomainObjectMap map, java.util.Set domainObjectSet) {
    ims.assessment.vo.PatientAssessmentFolderVoCollection voList =
        new ims.assessment.vo.PatientAssessmentFolderVoCollection();
    if (null == domainObjectSet) {
      return voList;
    }
    int rieCount = 0;
    int activeCount = 0;
    java.util.Iterator iterator = domainObjectSet.iterator();
    while (iterator.hasNext()) {
      ims.assessment.configuration.domain.objects.PatientAssessmentFolder domainObject =
          (ims.assessment.configuration.domain.objects.PatientAssessmentFolder) iterator.next();
      ims.assessment.vo.PatientAssessmentFolderVo vo = create(map, domainObject);

      if (vo != null) voList.add(vo);

      if (domainObject != null) {
        if (domainObject.getIsRIE() != null && domainObject.getIsRIE().booleanValue() == true)
          rieCount++;
        else activeCount++;
      }
    }
    voList.setRieCount(rieCount);
    voList.setActiveCount(activeCount);
    return voList;
  }
  /**
   * Create the ValueObject collection to hold the list of DomainObjects.
   *
   * @param map - maps DomainObjects to created ValueObjects
   * @param domainObjectList - List of
   *     ims.assessment.configuration.domain.objects.PatientAssessmentFolder objects.
   */
  public static ims.assessment.vo.PatientAssessmentFolderVoCollection
      createPatientAssessmentFolderVoCollectionFromPatientAssessmentFolder(
          DomainObjectMap map, java.util.List domainObjectList) {
    ims.assessment.vo.PatientAssessmentFolderVoCollection voList =
        new ims.assessment.vo.PatientAssessmentFolderVoCollection();
    if (null == domainObjectList) {
      return voList;
    }
    int rieCount = 0;
    int activeCount = 0;
    for (int i = 0; i < domainObjectList.size(); i++) {
      ims.assessment.configuration.domain.objects.PatientAssessmentFolder domainObject =
          (ims.assessment.configuration.domain.objects.PatientAssessmentFolder)
              domainObjectList.get(i);
      ims.assessment.vo.PatientAssessmentFolderVo vo = create(map, domainObject);

      if (vo != null) voList.add(vo);

      if (domainObject != null) {
        if (domainObject.getIsRIE() != null && domainObject.getIsRIE().booleanValue() == true)
          rieCount++;
        else activeCount++;
      }
    }

    voList.setRieCount(rieCount);
    voList.setActiveCount(activeCount);
    return voList;
  }
  /**
   * Update the ValueObject with the Domain Object.
   *
   * @param map DomainObjectMap of DomainObjects to already created ValueObjects.
   * @param valueObject to be updated
   * @param domainObject ims.assessment.configuration.domain.objects.PatientAssessmentFolder
   */
  public static ims.assessment.vo.PatientAssessmentFolderVo insert(
      DomainObjectMap map,
      ims.assessment.vo.PatientAssessmentFolderVo valueObject,
      ims.assessment.configuration.domain.objects.PatientAssessmentFolder domainObject) {
    if (null == domainObject) {
      return valueObject;
    }
    if (null == map) {
      map = new DomainObjectMap();
    }

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

    // FolderName
    valueObject.setFolderName(domainObject.getFolderName());
    // PatientAssessments
    valueObject.setPatientAssessments(
        ims.assessment.vo.domain.UserAssessmentShortVoAssembler
            .createUserAssessmentShortVoCollectionFromUserAssessment(
                map, domainObject.getPatientAssessments()));
    // GraphicAssessments
    valueObject.setGraphicAssessments(
        ims.assessment.vo.domain.GraphicAssessmentShortVoAssembler
            .createGraphicAssessmentShortVoCollectionFromGraphicAssessment(
                map, domainObject.getGraphicAssessments()));
    return valueObject;
  }