/FileExtraction/Java_unseen/IMS-MAXIMS_openMAXIMS/Source Library/openmaxims_workspace/ValueObjects/src/ims/ocrr/vo/ChemotherapyDetailsVo.java
//#############################################################################
//#                                                                           #
//#  Copyright (C) <2015>  <IMS MAXIMS>                                       #
//#                                                                           #
//#  This program is free software: you can redistribute it and/or modify     #
//#  it under the terms of the GNU Affero General Public License as           #
//#  published by the Free Software Foundation, either version 3 of the       #
//#  License, or (at your option) any later version.                          # 
//#                                                                           #
//#  This program is distributed in the hope that it will be useful,          #
//#  but WITHOUT ANY WARRANTY; without even the implied warranty of           #
//#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
//#  GNU Affero General Public License for more details.                      #
//#                                                                           #
//#  You should have received a copy of the GNU Affero General Public License #
//#  along with this program.  If not, see <http://www.gnu.org/licenses/>.    #
//#                                                                           #
//#  IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of    #
//#  this program.  Users of this software do so entirely at their own risk.  #
//#  IMS MAXIMS only ensures the Clinical Safety of unaltered run-time        #
//#  software that it builds, deploys and maintains.                          #
//#                                                                           #
//#############################################################################
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5589.25814)
// Copyright (C) 1995-2015 IMS MAXIMS. All rights reserved.
// WARNING: DO NOT MODIFY the content of this file

package ims.ocrr.vo;

/**
 * Linked to Oncology.ChemotherapyDetails business object (ID: 1074100004).
 */
public class ChemotherapyDetailsVo extends ims.ocrr.vo.ChemotherapyDetailsShortVo implements ims.vo.ImsCloneable, Comparable
{
	private static final long serialVersionUID = 1L;

	public ChemotherapyDetailsVo()
	{
	}
	public ChemotherapyDetailsVo(Integer id, int version)
	{
		super(id, version);
	}
	public ChemotherapyDetailsVo(ims.ocrr.vo.beans.ChemotherapyDetailsVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.episodeofcare = bean.getEpisodeOfCare() == null ? null : new ims.core.admin.vo.EpisodeOfCareRefVo(new Integer(bean.getEpisodeOfCare().getId()), bean.getEpisodeOfCare().getVersion());
		this.carecontext = bean.getCareContext() == null ? null : new ims.core.admin.vo.CareContextRefVo(new Integer(bean.getCareContext().getId()), bean.getCareContext().getVersion());
		this.startdate = bean.getStartDate() == null ? null : bean.getStartDate().buildDate();
		this.datedecisiontotreat = bean.getDateDecisionToTreat() == null ? null : bean.getDateDecisionToTreat().buildDate();
		this.drugtherapytype = bean.getDrugTherapyType() == null ? null : ims.oncology.vo.lookups.DrugTherapyType.buildLookup(bean.getDrugTherapyType());
		this.regimenacronym = bean.getRegimenAcronym() == null ? null : ims.oncology.vo.lookups.RegimenAcronym.buildLookup(bean.getRegimenAcronym());
		this.cancertreatementintent = bean.getCancerTreatementIntent() == null ? null : ims.oncology.vo.lookups.CancerTreatmentIntent.buildLookup(bean.getCancerTreatementIntent());
		this.treatmentresponse = bean.getTreatmentResponse() == null ? null : ims.oncology.vo.lookups.DrugProgramResponse.buildLookup(bean.getTreatmentResponse());
		this.treatingconsultant = bean.getTreatingConsultant() == null ? null : bean.getTreatingConsultant().buildVo();
		this.txchangereason = bean.getTxChangeReason() == null ? null : ims.oncology.vo.lookups.ChemoTxChangeReason.buildLookup(bean.getTxChangeReason());
		this.pretreatsurfacearea = bean.getPreTreatSurfaceArea();
		this.creatinineclearance = bean.getCreatinineClearance();
		this.heightvaluecm = bean.getHeightValueCM();
		this.weightvaluekg = bean.getWeightValueKG();
		this.status = bean.getStatus() == null ? null : ims.core.vo.lookups.PreActiveActiveInactiveStatus.buildLookup(bean.getStatus());
		this.cycledetails = ims.oncology.vo.ChemotherapyCycleDetailsVoCollection.buildFromBeanCollection(bean.getCycleDetails());
		this.authoringinfo = bean.getAuthoringInfo() == null ? null : bean.getAuthoringInfo().buildVo();
		this.ccocycledetails = ims.oncology.vo.ChemoCycleDetailsCCOVoCollection.buildFromBeanCollection(bean.getCCOCycleDetails());
		this.performancestatus = bean.getPerformanceStatus() == null ? null : ims.medicaloncology.vo.lookups.PerformanceStatus.buildLookup(bean.getPerformanceStatus());
		this.delayreason1 = bean.getDelayReason1() == null ? null : ims.medicaloncology.vo.lookups.SurgeryReasonForDelay.buildLookup(bean.getDelayReason1());
		this.delayreason2 = bean.getDelayReason2() == null ? null : ims.medicaloncology.vo.lookups.SurgeryReasonForDelay.buildLookup(bean.getDelayReason2());
		this.treatmentsite = bean.getTreatmentSite() == null ? null : ims.oncology.vo.lookups.TreatmentHospital.buildLookup(bean.getTreatmentSite());
		this.enddate = bean.getEndDate() == null ? null : bean.getEndDate().buildDate();
		this.programmenr = bean.getProgrammeNr();
		this.regimennr = bean.getRegimenNr();
		this.comorbidityadjustment = bean.getComorbidityAdjustment() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getComorbidityAdjustment());
		this.chemoradiation = bean.getChemoRadiation() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getChemoRadiation());
		this.clinicaltrial = bean.getClinicalTrial() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getClinicalTrial());
		this.plannedcycles = bean.getPlannedCycles();
		this.outcomedosereduction = bean.getOutcomeDoseReduction() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getOutcomeDoseReduction());
		this.outcometimedelay = bean.getOutcomeTimeDelay() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getOutcomeTimeDelay());
		this.outcomestoppedearly = bean.getOutcomeStoppedEarly() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getOutcomeStoppedEarly());
		this.outcomesummary = bean.getOutcomeSummary() == null ? null : ims.oncology.vo.lookups.RegimenOutcomeSummary.buildLookup(bean.getOutcomeSummary());
		this.prescribinghcp = bean.getPrescribingHCP() == null ? null : bean.getPrescribingHCP().buildVo();
		this.prescribeddate = bean.getPrescribedDate() == null ? null : bean.getPrescribedDate().buildDate();
		this.associatedtreatmentplanaction = bean.getAssociatedTreatmentPlanAction() == null ? null : new ims.oncology.vo.PatActionRefVo(new Integer(bean.getAssociatedTreatmentPlanAction().getId()), bean.getAssociatedTreatmentPlanAction().getVersion());
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.ocrr.vo.beans.ChemotherapyDetailsVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.episodeofcare = bean.getEpisodeOfCare() == null ? null : new ims.core.admin.vo.EpisodeOfCareRefVo(new Integer(bean.getEpisodeOfCare().getId()), bean.getEpisodeOfCare().getVersion());
		this.carecontext = bean.getCareContext() == null ? null : new ims.core.admin.vo.CareContextRefVo(new Integer(bean.getCareContext().getId()), bean.getCareContext().getVersion());
		this.startdate = bean.getStartDate() == null ? null : bean.getStartDate().buildDate();
		this.datedecisiontotreat = bean.getDateDecisionToTreat() == null ? null : bean.getDateDecisionToTreat().buildDate();
		this.drugtherapytype = bean.getDrugTherapyType() == null ? null : ims.oncology.vo.lookups.DrugTherapyType.buildLookup(bean.getDrugTherapyType());
		this.regimenacronym = bean.getRegimenAcronym() == null ? null : ims.oncology.vo.lookups.RegimenAcronym.buildLookup(bean.getRegimenAcronym());
		this.cancertreatementintent = bean.getCancerTreatementIntent() == null ? null : ims.oncology.vo.lookups.CancerTreatmentIntent.buildLookup(bean.getCancerTreatementIntent());
		this.treatmentresponse = bean.getTreatmentResponse() == null ? null : ims.oncology.vo.lookups.DrugProgramResponse.buildLookup(bean.getTreatmentResponse());
		this.treatingconsultant = bean.getTreatingConsultant() == null ? null : bean.getTreatingConsultant().buildVo(map);
		this.txchangereason = bean.getTxChangeReason() == null ? null : ims.oncology.vo.lookups.ChemoTxChangeReason.buildLookup(bean.getTxChangeReason());
		this.pretreatsurfacearea = bean.getPreTreatSurfaceArea();
		this.creatinineclearance = bean.getCreatinineClearance();
		this.heightvaluecm = bean.getHeightValueCM();
		this.weightvaluekg = bean.getWeightValueKG();
		this.status = bean.getStatus() == null ? null : ims.core.vo.lookups.PreActiveActiveInactiveStatus.buildLookup(bean.getStatus());
		this.cycledetails = ims.oncology.vo.ChemotherapyCycleDetailsVoCollection.buildFromBeanCollection(bean.getCycleDetails());
		this.authoringinfo = bean.getAuthoringInfo() == null ? null : bean.getAuthoringInfo().buildVo(map);
		this.ccocycledetails = ims.oncology.vo.ChemoCycleDetailsCCOVoCollection.buildFromBeanCollection(bean.getCCOCycleDetails());
		this.performancestatus = bean.getPerformanceStatus() == null ? null : ims.medicaloncology.vo.lookups.PerformanceStatus.buildLookup(bean.getPerformanceStatus());
		this.delayreason1 = bean.getDelayReason1() == null ? null : ims.medicaloncology.vo.lookups.SurgeryReasonForDelay.buildLookup(bean.getDelayReason1());
		this.delayreason2 = bean.getDelayReason2() == null ? null : ims.medicaloncology.vo.lookups.SurgeryReasonForDelay.buildLookup(bean.getDelayReason2());
		this.treatmentsite = bean.getTreatmentSite() == null ? null : ims.oncology.vo.lookups.TreatmentHospital.buildLookup(bean.getTreatmentSite());
		this.enddate = bean.getEndDate() == null ? null : bean.getEndDate().buildDate();
		this.programmenr = bean.getProgrammeNr();
		this.regimennr = bean.getRegimenNr();
		this.comorbidityadjustment = bean.getComorbidityAdjustment() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getComorbidityAdjustment());
		this.chemoradiation = bean.getChemoRadiation() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getChemoRadiation());
		this.clinicaltrial = bean.getClinicalTrial() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getClinicalTrial());
		this.plannedcycles = bean.getPlannedCycles();
		this.outcomedosereduction = bean.getOutcomeDoseReduction() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getOutcomeDoseReduction());
		this.outcometimedelay = bean.getOutcomeTimeDelay() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getOutcomeTimeDelay());
		this.outcomestoppedearly = bean.getOutcomeStoppedEarly() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getOutcomeStoppedEarly());
		this.outcomesummary = bean.getOutcomeSummary() == null ? null : ims.oncology.vo.lookups.RegimenOutcomeSummary.buildLookup(bean.getOutcomeSummary());
		this.prescribinghcp = bean.getPrescribingHCP() == null ? null : bean.getPrescribingHCP().buildVo(map);
		this.prescribeddate = bean.getPrescribedDate() == null ? null : bean.getPrescribedDate().buildDate();
		this.associatedtreatmentplanaction = bean.getAssociatedTreatmentPlanAction() == null ? null : new ims.oncology.vo.PatActionRefVo(new Integer(bean.getAssociatedTreatmentPlanAction().getId()), bean.getAssociatedTreatmentPlanAction().getVersion());
	}
	public ims.vo.ValueObjectBean getBean()
	{
		return this.getBean(new ims.vo.ValueObjectBeanMap());
	}
	public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
	{
		ims.ocrr.vo.beans.ChemotherapyDetailsVoBean bean = null;
		if(map != null)
			bean = (ims.ocrr.vo.beans.ChemotherapyDetailsVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.ocrr.vo.beans.ChemotherapyDetailsVoBean();
			map.addValueObjectBean(this, bean);
			bean.populate(map, this);
		}
		return bean;
	}
	public Object getFieldValueByFieldName(String fieldName)
	{
		if(fieldName == null)
			throw new ims.framework.exceptions.CodingRuntimeException("Invalid field name");
		fieldName = fieldName.toUpperCase();
		if(fieldName.equals("CYCLEDETAILS"))
			return getCycleDetails();
		if(fieldName.equals("AUTHORINGINFO"))
			return getAuthoringInfo();
		if(fieldName.equals("CCOCYCLEDETAILS"))
			return getCCOCycleDetails();
		if(fieldName.equals("PERFORMANCESTATUS"))
			return getPerformanceStatus();
		if(fieldName.equals("DELAYREASON1"))
			return getDelayReason1();
		if(fieldName.equals("DELAYREASON2"))
			return getDelayReason2();
		if(fieldName.equals("TREATMENTSITE"))
			return getTreatmentSite();
		if(fieldName.equals("ENDDATE"))
			return getEndDate();
		if(fieldName.equals("PROGRAMMENR"))
			return getProgrammeNr();
		if(fieldName.equals("REGIMENNR"))
			return getRegimenNr();
		if(fieldName.equals("COMORBIDITYADJUSTMENT"))
			return getComorbidityAdjustment();
		if(fieldName.equals("CHEMORADIATION"))
			return getChemoRadiation();
		if(fieldName.equals("CLINICALTRIAL"))
			return getClinicalTrial();
		if(fieldName.equals("PLANNEDCYCLES"))
			return getPlannedCycles();
		if(fieldName.equals("OUTCOMEDOSEREDUCTION"))
			return getOutcomeDoseReduction();
		if(fieldName.equals("OUTCOMETIMEDELAY"))
			return getOutcomeTimeDelay();
		if(fieldName.equals("OUTCOMESTOPPEDEARLY"))
			return getOutcomeStoppedEarly();
		if(fieldName.equals("OUTCOMESUMMARY"))
			return getOutcomeSummary();
		if(fieldName.equals("PRESCRIBINGHCP"))
			return getPrescribingHCP();
		if(fieldName.equals("PRESCRIBEDDATE"))
			return getPrescribedDate();
		if(fieldName.equals("ASSOCIATEDTREATMENTPLANACTION"))
			return getAssociatedTreatmentPlanAction();
		return super.getFieldValueByFieldName(fieldName);
	}
	public boolean getCycleDetailsIsNotNull()
	{
		return this.cycledetails != null;
	}
	public ims.oncology.vo.ChemotherapyCycleDetailsVoCollection getCycleDetails()
	{
		return this.cycledetails;
	}
	public void setCycleDetails(ims.oncology.vo.ChemotherapyCycleDetailsVoCollection value)
	{
		this.isValidated = false;
		this.cycledetails = value;
	}
	public boolean getAuthoringInfoIsNotNull()
	{
		return this.authoringinfo != null;
	}
	public ims.core.vo.AuthoringInformationVo getAuthoringInfo()
	{
		return this.authoringinfo;
	}
	public void setAuthoringInfo(ims.core.vo.AuthoringInformationVo value)
	{
		this.isValidated = false;
		this.authoringinfo = value;
	}
	public boolean getCCOCycleDetailsIsNotNull()
	{
		return this.ccocycledetails != null;
	}
	public ims.oncology.vo.ChemoCycleDetailsCCOVoCollection getCCOCycleDetails()
	{
		return this.ccocycledetails;
	}
	public void setCCOCycleDetails(ims.oncology.vo.ChemoCycleDetailsCCOVoCollection value)
	{
		this.isValidated = false;
		this.ccocycledetails = value;
	}
	public boolean getPerformanceStatusIsNotNull()
	{
		return this.performancestatus != null;
	}
	public ims.medicaloncology.vo.lookups.PerformanceStatus getPerformanceStatus()
	{
		return this.performancestatus;
	}
	public void setPerformanceStatus(ims.medicaloncology.vo.lookups.PerformanceStatus value)
	{
		this.isValidated = false;
		this.performancestatus = value;
	}
	public boolean getDelayReason1IsNotNull()
	{
		return this.delayreason1 != null;
	}
	public ims.medicaloncology.vo.lookups.SurgeryReasonForDelay getDelayReason1()
	{
		return this.delayreason1;
	}
	public void setDelayReason1(ims.medicaloncology.vo.lookups.SurgeryReasonForDelay value)
	{
		this.isValidated = false;
		this.delayreason1 = value;
	}
	public boolean getDelayReason2IsNotNull()
	{
		return this.delayreason2 != null;
	}
	public ims.medicaloncology.vo.lookups.SurgeryReasonForDelay getDelayReason2()
	{
		return this.delayreason2;
	}
	public void setDelayReason2(ims.medicaloncology.vo.lookups.SurgeryReasonForDelay value)
	{
		this.isValidated = false;
		this.delayreason2 = value;
	}
	public boolean getTreatmentSiteIsNotNull()
	{
		return this.treatmentsite != null;
	}
	public ims.oncology.vo.lookups.TreatmentHospital getTreatmentSite()
	{
		return this.treatmentsite;
	}
	public void setTreatmentSite(ims.oncology.vo.lookups.TreatmentHospital value)
	{
		this.isValidated = false;
		this.treatmentsite = value;
	}
	public boolean getEndDateIsNotNull()
	{
		return this.enddate != null;
	}
	public ims.framework.utils.Date getEndDate()
	{
		return this.enddate;
	}
	public void setEndDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.enddate = value;
	}
	public boolean getProgrammeNrIsNotNull()
	{
		return this.programmenr != null;
	}
	public Integer getProgrammeNr()
	{
		return this.programmenr;
	}
	public void setProgrammeNr(Integer value)
	{
		this.isValidated = false;
		this.programmenr = value;
	}
	public boolean getRegimenNrIsNotNull()
	{
		return this.regimennr != null;
	}
	public Integer getRegimenNr()
	{
		return this.regimennr;
	}
	public void setRegimenNr(Integer value)
	{
		this.isValidated = false;
		this.regimennr = value;
	}
	public boolean getComorbidityAdjustmentIsNotNull()
	{
		return this.comorbidityadjustment != null;
	}
	public ims.core.vo.lookups.YesNo getComorbidityAdjustment()
	{
		return this.comorbidityadjustment;
	}
	public void setComorbidityAdjustment(ims.core.vo.lookups.YesNo value)
	{
		this.isValidated = false;
		this.comorbidityadjustment = value;
	}
	public boolean getChemoRadiationIsNotNull()
	{
		return this.chemoradiation != null;
	}
	public ims.core.vo.lookups.YesNo getChemoRadiation()
	{
		return this.chemoradiation;
	}
	public void setChemoRadiation(ims.core.vo.lookups.YesNo value)
	{
		this.isValidated = false;
		this.chemoradiation = value;
	}
	public boolean getClinicalTrialIsNotNull()
	{
		return this.clinicaltrial != null;
	}
	public ims.core.vo.lookups.YesNo getClinicalTrial()
	{
		return this.clinicaltrial;
	}
	public void setClinicalTrial(ims.core.vo.lookups.YesNo value)
	{
		this.isValidated = false;
		this.clinicaltrial = value;
	}
	public boolean getPlannedCyclesIsNotNull()
	{
		return this.plannedcycles != null;
	}
	public Integer getPlannedCycles()
	{
		return this.plannedcycles;
	}
	public void setPlannedCycles(Integer value)
	{
		this.isValidated = false;
		this.plannedcycles = value;
	}
	public boolean getOutcomeDoseReductionIsNotNull()
	{
		return this.outcomedosereduction != null;
	}
	public ims.core.vo.lookups.YesNo getOutcomeDoseReduction()
	{
		return this.outcomedosereduction;
	}
	public void setOutcomeDoseReduction(ims.core.vo.lookups.YesNo value)
	{
		this.isValidated = false;
		this.outcomedosereduction = value;
	}
	public boolean getOutcomeTimeDelayIsNotNull()
	{
		return this.outcometimedelay != null;
	}
	public ims.core.vo.lookups.YesNo getOutcomeTimeDelay()
	{
		return this.outcometimedelay;
	}
	public void setOutcomeTimeDelay(ims.core.vo.lookups.YesNo value)
	{
		this.isValidated = false;
		this.outcometimedelay = value;
	}
	public boolean getOutcomeStoppedEarlyIsNotNull()
	{
		return this.outcomestoppedearly != null;
	}
	public ims.core.vo.lookups.YesNo getOutcomeStoppedEarly()
	{
		return this.outcomestoppedearly;
	}
	public void setOutcomeStoppedEarly(ims.core.vo.lookups.YesNo value)
	{
		this.isValidated = false;
		this.outcomestoppedearly = value;
	}
	public boolean getOutcomeSummaryIsNotNull()
	{
		return this.outcomesummary != null;
	}
	public ims.oncology.vo.lookups.RegimenOutcomeSummary getOutcomeSummary()
	{
		return this.outcomesummary;
	}
	public void setOutcomeSummary(ims.oncology.vo.lookups.RegimenOutcomeSummary value)
	{
		this.isValidated = false;
		this.outcomesummary = value;
	}
	public boolean getPrescribingHCPIsNotNull()
	{
		return this.prescribinghcp != null;
	}
	public ims.core.vo.MedicVo getPrescribingHCP()
	{
		return this.prescribinghcp;
	}
	public void setPrescribingHCP(ims.core.vo.MedicVo value)
	{
		this.isValidated = false;
		this.prescribinghcp = value;
	}
	public boolean getPrescribedDateIsNotNull()
	{
		return this.prescribeddate != null;
	}
	public ims.framework.utils.Date getPrescribedDate()
	{
		return this.prescribeddate;
	}
	public void setPrescribedDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.prescribeddate = value;
	}
	public boolean getAssociatedTreatmentPlanActionIsNotNull()
	{
		return this.associatedtreatmentplanaction != null;
	}
	public ims.oncology.vo.PatActionRefVo getAssociatedTreatmentPlanAction()
	{
		return this.associatedtreatmentplanaction;
	}
	public void setAssociatedTreatmentPlanAction(ims.oncology.vo.PatActionRefVo value)
	{
		this.isValidated = false;
		this.associatedtreatmentplanaction = value;
	}
	public boolean isValidated()
	{
		if(this.isBusy)
			return true;
		this.isBusy = true;
	
		if(!this.isValidated)
		{
			this.isBusy = false;
			return false;
		}
		if(this.cycledetails != null)
		{
			if(!this.cycledetails.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.authoringinfo != null)
		{
			if(!this.authoringinfo.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.ccocycledetails != null)
		{
			if(!this.ccocycledetails.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		this.isBusy = false;
		return true;
	}
	public String[] validate()
	{
		return validate(null);
	}
	public String[] validate(String[] existingErrors)
	{
		if(this.isBusy)
			return null;
		this.isBusy = true;
	
		java.util.ArrayList<String> listOfErrors = new java.util.ArrayList<String>();
		if(existingErrors != null)
		{
			for(int x = 0; x < existingErrors.length; x++)
			{
				listOfErrors.add(existingErrors[x]);
			}
		}
		if(this.episodeofcare == null)
			listOfErrors.add("Episode Of Care is mandatory");
		if(this.drugtherapytype == null)
			listOfErrors.add("Drug Therapy Type is mandatory");
		if(this.regimenacronym == null)
			listOfErrors.add("Regimen Acronym is mandatory");
		if(this.treatingconsultant == null)
			listOfErrors.add("Treating Consultant is mandatory");
		if(this.cycledetails != null)
		{
			String[] listOfOtherErrors = this.cycledetails.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.authoringinfo != null)
		{
			String[] listOfOtherErrors = this.authoringinfo.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.ccocycledetails != null)
		{
			String[] listOfOtherErrors = this.ccocycledetails.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.treatmentsite == null)
			listOfErrors.add("TreatmentSite is mandatory");
		int errorCount = listOfErrors.size();
		if(errorCount == 0)
		{
			this.isBusy = false;
			this.isValidated = true;
			return null;
		}
		String[] result = new String[errorCount];
		for(int x = 0; x < errorCount; x++)
			result[x] = (String)listOfErrors.get(x);
		this.isBusy = false;
		this.isValidated = false;
		return result;
	}
	public void clearIDAndVersion()
	{
		this.id = null;
		this.version = 0;
	}
	public Object clone()
	{
		if(this.isBusy)
			return this;
		this.isBusy = true;
	
		ChemotherapyDetailsVo clone = new ChemotherapyDetailsVo(this.id, this.version);
		
		clone.episodeofcare = this.episodeofcare;
		clone.carecontext = this.carecontext;
		if(this.startdate == null)
			clone.startdate = null;
		else
			clone.startdate = (ims.framework.utils.Date)this.startdate.clone();
		if(this.datedecisiontotreat == null)
			clone.datedecisiontotreat = null;
		else
			clone.datedecisiontotreat = (ims.framework.utils.Date)this.datedecisiontotreat.clone();
		if(this.drugtherapytype == null)
			clone.drugtherapytype = null;
		else
			clone.drugtherapytype = (ims.oncology.vo.lookups.DrugTherapyType)this.drugtherapytype.clone();
		if(this.regimenacronym == null)
			clone.regimenacronym = null;
		else
			clone.regimenacronym = (ims.oncology.vo.lookups.RegimenAcronym)this.regimenacronym.clone();
		if(this.cancertreatementintent == null)
			clone.cancertreatementintent = null;
		else
			clone.cancertreatementintent = (ims.oncology.vo.lookups.CancerTreatmentIntent)this.cancertreatementintent.clone();
		if(this.treatmentresponse == null)
			clone.treatmentresponse = null;
		else
			clone.treatmentresponse = (ims.oncology.vo.lookups.DrugProgramResponse)this.treatmentresponse.clone();
		if(this.treatingconsultant == null)
			clone.treatingconsultant = null;
		else
			clone.treatingconsultant = (ims.core.vo.HcpLiteVo)this.treatingconsultant.clone();
		if(this.txchangereason == null)
			clone.txchangereason = null;
		else
			clone.txchangereason = (ims.oncology.vo.lookups.ChemoTxChangeReason)this.txchangereason.clone();
		clone.pretreatsurfacearea = this.pretreatsurfacearea;
		clone.creatinineclearance = this.creatinineclearance;
		clone.heightvaluecm = this.heightvaluecm;
		clone.weightvaluekg = this.weightvaluekg;
		if(this.status == null)
			clone.status = null;
		else
			clone.status = (ims.core.vo.lookups.PreActiveActiveInactiveStatus)this.status.clone();
		if(this.cycledetails == null)
			clone.cycledetails = null;
		else
			clone.cycledetails = (ims.oncology.vo.ChemotherapyCycleDetailsVoCollection)this.cycledetails.clone();
		if(this.authoringinfo == null)
			clone.authoringinfo = null;
		else
			clone.authoringinfo = (ims.core.vo.AuthoringInformationVo)this.authoringinfo.clone();
		if(this.ccocycledetails == null)
			clone.ccocycledetails = null;
		else
			clone.ccocycledetails = (ims.oncology.vo.ChemoCycleDetailsCCOVoCollection)this.ccocycledetails.clone();
		if(this.performancestatus == null)
			clone.performancestatus = null;
		else
			clone.performancestatus = (ims.medicaloncology.vo.lookups.PerformanceStatus)this.performancestatus.clone();
		if(this.delayreason1 == null)
			clone.delayreason1 = null;
		else
			clone.delayreason1 = (ims.medicaloncology.vo.lookups.SurgeryReasonForDelay)this.delayreason1.clone();
		if(this.delayreason2 == null)
			clone.delayreason2 = null;
		else
			clone.delayreason2 = (ims.medicaloncology.vo.lookups.SurgeryReasonForDelay)this.delayreason2.clone();
		if(this.treatmentsite == null)
			clone.treatmentsite = null;
		else
			clone.treatmentsite = (ims.oncology.vo.lookups.TreatmentHospital)this.treatmentsite.clone();
		if(this.enddate == null)
			clone.enddate = null;
		else
			clone.enddate = (ims.framework.utils.Date)this.enddate.clone();
		clone.programmenr = this.programmenr;
		clone.regimennr = this.regimennr;
		if(this.comorbidityadjustment == null)
			clone.comorbidityadjustment = null;
		else
			clone.comorbidityadjustment = (ims.core.vo.lookups.YesNo)this.comorbidityadjustment.clone();
		if(this.chemoradiation == null)
			clone.chemoradiation = null;
		else
			clone.chemoradiation = (ims.core.vo.lookups.YesNo)this.chemoradiation.clone();
		if(this.clinicaltrial == null)
			clone.clinicaltrial = null;
		else
			clone.clinicaltrial = (ims.core.vo.lookups.YesNo)this.clinicaltrial.clone();
		clone.plannedcycles = this.plannedcycles;
		if(this.outcomedosereduction == null)
			clone.outcomedosereduction = null;
		else
			clone.outcomedosereduction = (ims.core.vo.lookups.YesNo)this.outcomedosereduction.clone();
		if(this.outcometimedelay == null)
			clone.outcometimedelay = null;
		else
			clone.outcometimedelay = (ims.core.vo.lookups.YesNo)this.outcometimedelay.clone();
		if(this.outcomestoppedearly == null)
			clone.outcomestoppedearly = null;
		else
			clone.outcomestoppedearly = (ims.core.vo.lookups.YesNo)this.outcomestoppedearly.clone();
		if(this.outcomesummary == null)
			clone.outcomesummary = null;
		else
			clone.outcomesummary = (ims.oncology.vo.lookups.RegimenOutcomeSummary)this.outcomesummary.clone();
		if(this.prescribinghcp == null)
			clone.prescribinghcp = null;
		else
			clone.prescribinghcp = (ims.core.vo.MedicVo)this.prescribinghcp.clone();
		if(this.prescribeddate == null)
			clone.prescribeddate = null;
		else
			clone.prescribeddate = (ims.framework.utils.Date)this.prescribeddate.clone();
		clone.associatedtreatmentplanaction = this.associatedtreatmentplanaction;
		clone.isValidated = this.isValidated;
		
		this.isBusy = false;
		return clone;
	}
	public int compareTo(Object obj)
	{
		return compareTo(obj, true);
	}
	public int compareTo(Object obj, boolean caseInsensitive)
	{
		if (obj == null)
		{
			return -1;
		}
		if(caseInsensitive); // this is to avoid eclipse warning only.
		if (!(ChemotherapyDetailsVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A ChemotherapyDetailsVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		if (this.id == null)
			return 1;
		if (((ChemotherapyDetailsVo)obj).getBoId() == null)
			return -1;
		return this.id.compareTo(((ChemotherapyDetailsVo)obj).getBoId());
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = super.countFieldsWithValue();
		if(this.cycledetails != null)
			count++;
		if(this.authoringinfo != null)
			count++;
		if(this.ccocycledetails != null)
			count++;
		if(this.performancestatus != null)
			count++;
		if(this.delayreason1 != null)
			count++;
		if(this.delayreason2 != null)
			count++;
		if(this.treatmentsite != null)
			count++;
		if(this.enddate != null)
			count++;
		if(this.programmenr != null)
			count++;
		if(this.regimennr != null)
			count++;
		if(this.comorbidityadjustment != null)
			count++;
		if(this.chemoradiation != null)
			count++;
		if(this.clinicaltrial != null)
			count++;
		if(this.plannedcycles != null)
			count++;
		if(this.outcomedosereduction != null)
			count++;
		if(this.outcometimedelay != null)
			count++;
		if(this.outcomestoppedearly != null)
			count++;
		if(this.outcomesummary != null)
			count++;
		if(this.prescribinghcp != null)
			count++;
		if(this.prescribeddate != null)
			count++;
		if(this.associatedtreatmentplanaction != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return super.countValueObjectFields() + 21;
	}
	protected ims.oncology.vo.ChemotherapyCycleDetailsVoCollection cycledetails;
	protected ims.core.vo.AuthoringInformationVo authoringinfo;
	protected ims.oncology.vo.ChemoCycleDetailsCCOVoCollection ccocycledetails;
	protected ims.medicaloncology.vo.lookups.PerformanceStatus performancestatus;
	protected ims.medicaloncology.vo.lookups.SurgeryReasonForDelay delayreason1;
	protected ims.medicaloncology.vo.lookups.SurgeryReasonForDelay delayreason2;
	protected ims.oncology.vo.lookups.TreatmentHospital treatmentsite;
	protected ims.framework.utils.Date enddate;
	protected Integer programmenr;
	protected Integer regimennr;
	protected ims.core.vo.lookups.YesNo comorbidityadjustment;
	protected ims.core.vo.lookups.YesNo chemoradiation;
	protected ims.core.vo.lookups.YesNo clinicaltrial;
	protected Integer plannedcycles;
	protected ims.core.vo.lookups.YesNo outcomedosereduction;
	protected ims.core.vo.lookups.YesNo outcometimedelay;
	protected ims.core.vo.lookups.YesNo outcomestoppedearly;
	protected ims.oncology.vo.lookups.RegimenOutcomeSummary outcomesummary;
	protected ims.core.vo.MedicVo prescribinghcp;
	protected ims.framework.utils.Date prescribeddate;
	protected ims.oncology.vo.PatActionRefVo associatedtreatmentplanaction;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
