/**
  * Copy one ValueObject to another
  *
  * @param valueObjectDest to be updated
  * @param valueObjectSrc to copy values from
  */
 public static ims.clinicaladmin.vo.TumourGroupListForPrimaryTumourDetailsVo copy(
     ims.clinicaladmin.vo.TumourGroupListForPrimaryTumourDetailsVo valueObjectDest,
     ims.clinicaladmin.vo.TumourGroupListForPrimaryTumourDetailsVo valueObjectSrc) {
   if (null == valueObjectSrc) {
     return valueObjectSrc;
   }
   valueObjectDest.setID_TumourGroup(valueObjectSrc.getID_TumourGroup());
   valueObjectDest.setIsRIE(valueObjectSrc.getIsRIE());
   // GroupName
   valueObjectDest.setGroupName(valueObjectSrc.getGroupName());
   // Sites
   valueObjectDest.setSites(valueObjectSrc.getSites());
   // TnmRequiresOver45
   valueObjectDest.setTnmRequiresOver45(valueObjectSrc.getTnmRequiresOver45());
   // isActive
   valueObjectDest.setIsActive(valueObjectSrc.getIsActive());
   // TNMValues
   valueObjectDest.setTNMValues(valueObjectSrc.getTNMValues());
   // SerumMarkers
   valueObjectDest.setSerumMarkers(valueObjectSrc.getSerumMarkers());
   // OtherClassifications
   valueObjectDest.setOtherClassifications(valueObjectSrc.getOtherClassifications());
   // AssociatedSpecialties
   valueObjectDest.setAssociatedSpecialties(valueObjectSrc.getAssociatedSpecialties());
   // hasTNM
   valueObjectDest.setHasTNM(valueObjectSrc.getHasTNM());
   // Histologies
   valueObjectDest.setHistologies(valueObjectSrc.getHistologies());
   // HistopathologicGrades
   valueObjectDest.setHistopathologicGrades(valueObjectSrc.getHistopathologicGrades());
   // Assessment
   valueObjectDest.setAssessment(valueObjectSrc.getAssessment());
   // isPrognosticGroupingRelevant
   valueObjectDest.setIsPrognosticGroupingRelevant(
       valueObjectSrc.getIsPrognosticGroupingRelevant());
   // PrognosticGroupingConfig
   valueObjectDest.setPrognosticGroupingConfig(valueObjectSrc.getPrognosticGroupingConfig());
   // TnmRequiresDiff
   valueObjectDest.setTnmRequiresDiff(valueObjectSrc.getTnmRequiresDiff());
   // TnmRequiresHisto
   valueObjectDest.setTnmRequiresHisto(valueObjectSrc.getTnmRequiresHisto());
   // TnmRequiresSMarkers
   valueObjectDest.setTnmRequiresSMarkers(valueObjectSrc.getTnmRequiresSMarkers());
   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.oncology.configuration.domain.objects.TumourGroup
   */
  public static ims.clinicaladmin.vo.TumourGroupListForPrimaryTumourDetailsVo insert(
      DomainObjectMap map,
      ims.clinicaladmin.vo.TumourGroupListForPrimaryTumourDetailsVo valueObject,
      ims.oncology.configuration.domain.objects.TumourGroup domainObject) {
    if (null == domainObject) {
      return valueObject;
    }
    if (null == map) {
      map = new DomainObjectMap();
    }

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

    // GroupName
    valueObject.setGroupName(domainObject.getGroupName());
    // Sites
    valueObject.setSites(
        ims.clinicaladmin.vo.domain.TumourSiteLiteVoAssembler
            .createTumourSiteLiteVoCollectionFromTumourSite(map, domainObject.getSites()));
    // TnmRequiresOver45
    valueObject.setTnmRequiresOver45(domainObject.isTnmRequiresOver45());
    // isActive
    valueObject.setIsActive(domainObject.isIsActive());
    // TNMValues
    valueObject.setTNMValues(
        ims.clinicaladmin.vo.domain.TumourGroupSiteTNMValueListVoAssembler
            .createTumourGroupSiteTNMValueListVoCollectionFromTumourGroupSiteTNMValue(
                map, domainObject.getTNMValues()));
    // SerumMarkers
    valueObject.setSerumMarkers(
        ims.clinicaladmin.vo.domain.TumourSerumMarkersVoAssembler
            .createTumourSerumMarkersVoCollectionFromTumourSerumMarker(
                map, domainObject.getSerumMarkers()));
    // OtherClassifications
    valueObject.setOtherClassifications(
        ims.oncology.vo.domain.TumourGroupClassificationVoAssembler
            .createTumourGroupClassificationVoCollectionFromTumourGroupClassification(
                map, domainObject.getOtherClassifications()));
    // AssociatedSpecialties
    valueObject.setAssociatedSpecialties(
        ims.oncology.vo.domain.TumourGroupSpecialtyVoAssembler
            .createTumourGroupSpecialtyVoCollectionFromTumourGroupSpecialty(
                map, domainObject.getAssociatedSpecialties()));
    // hasTNM
    valueObject.setHasTNM(domainObject.isHasTNM());
    // Histologies
    valueObject.setHistologies(
        ims.clinicaladmin.vo.domain.TumourGroupHistologyVoAssembler
            .createTumourGroupHistologyVoCollectionFromTumourGroupHistology(
                map, domainObject.getHistologies()));
    // HistopathologicGrades
    valueObject.setHistopathologicGrades(
        ims.clinicaladmin.vo.domain.TumourGroupHistopathologyGradeVoAssembler
            .createTumourGroupHistopathologyGradeVoCollectionFromTumourGroupHistopathologicGrade(
                map, domainObject.getHistopathologicGrades()));
    // Assessment
    if (domainObject.getAssessment() != null) {
      if (domainObject.getAssessment()
          instanceof
          HibernateProxy) // If the proxy is set, there is no need to lazy load, the proxy knows the
      // id already.
      {
        HibernateProxy p = (HibernateProxy) domainObject.getAssessment();
        int id = Integer.parseInt(p.getHibernateLazyInitializer().getIdentifier().toString());
        valueObject.setAssessment(new ims.assessment.configuration.vo.UserAssessmentRefVo(id, -1));
      } else {
        valueObject.setAssessment(
            new ims.assessment.configuration.vo.UserAssessmentRefVo(
                domainObject.getAssessment().getId(), domainObject.getAssessment().getVersion()));
      }
    }
    // isPrognosticGroupingRelevant
    valueObject.setIsPrognosticGroupingRelevant(domainObject.isIsPrognosticGroupingRelevant());
    // PrognosticGroupingConfig
    valueObject.setPrognosticGroupingConfig(
        ims.clinicaladmin.vo.domain.PrognosticGroupingCongfigVoAssembler.create(
            map, domainObject.getPrognosticGroupingConfig()));
    // TnmRequiresDiff
    valueObject.setTnmRequiresDiff(domainObject.isTnmRequiresDiff());
    // TnmRequiresHisto
    valueObject.setTnmRequiresHisto(domainObject.isTnmRequiresHisto());
    // TnmRequiresSMarkers
    valueObject.setTnmRequiresSMarkers(domainObject.isTnmRequiresSMarkers());
    return valueObject;
  }