/FileExtraction/Java_unseen/IMS-MAXIMS_openMAXIMS/Source Library/openmaxims_workspace/ValueObjects/src/ims/clinicaladmin/vo/PathologyDetailsVo.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.clinicaladmin.vo;

/**
 * Linked to Oncology.PathologyDetails business object (ID: 1074100015).
 */
public class PathologyDetailsVo extends ims.clinicaladmin.vo.PathologyDetailsListVo implements ims.vo.ImsCloneable, Comparable
{
	private static final long serialVersionUID = 1L;

	public PathologyDetailsVo()
	{
	}
	public PathologyDetailsVo(Integer id, int version)
	{
		super(id, version);
	}
	public PathologyDetailsVo(ims.clinicaladmin.vo.beans.PathologyDetailsVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.investigationtype = bean.getInvestigationType() == null ? null : ims.oncology.vo.lookups.InvestigationType.buildLookup(bean.getInvestigationType());
		this.samplereceiptdate = bean.getSampleReceiptDate() == null ? null : bean.getSampleReceiptDate().buildDate();
		this.investigationresultdate = bean.getInvestigationResultDate() == null ? null : bean.getInvestigationResultDate().buildDate();
		// Interface field type not supported.
		this.reportingorganisation = bean.getReportingOrganisation() == null ? null : bean.getReportingOrganisation().buildVo();
		this.carecontext = bean.getCareContext() == null ? null : new ims.core.admin.vo.CareContextRefVo(new Integer(bean.getCareContext().getId()), bean.getCareContext().getVersion());
		this.previousversion = bean.getPreviousVersion() == null ? null : new ims.oncology.vo.PathologyDetailsRefVo(new Integer(bean.getPreviousVersion().getId()), bean.getPreviousVersion().getVersion());
		this.invasivelesionsize = bean.getInvasiveLesionSize();
		this.synchronoustumourindicator = bean.getSynchronousTumourIndicator() == null ? null : ims.oncology.vo.lookups.SynchronousTumourIndicator.buildLookup(bean.getSynchronousTumourIndicator());
		this.histology = ims.clinicaladmin.vo.TumourHistologyLiteVoCollection.buildFromBeanCollection(bean.getHistology());
		this.vascularlymphinvasion = bean.getVascularLymphInvasion() == null ? null : ims.oncology.vo.lookups.VascularLymphInvasion.buildLookup(bean.getVascularLymphInvasion());
		this.excisionmargin = bean.getExcisionMargin() == null ? null : ims.oncology.vo.lookups.ExcisionMargin.buildLookup(bean.getExcisionMargin());
		this.numbernodesexamined = bean.getNumberNodesExamined();
		this.nodespositivenumber = bean.getNodesPositiveNumber();
		this.pathologicaltval = bean.getPathologicalTVal() == null ? null : bean.getPathologicalTVal().buildVo();
		this.pathologicalnval = bean.getPathologicalNVal() == null ? null : bean.getPathologicalNVal().buildVo();
		this.pathologicalmval = bean.getPathologicalMVal() == null ? null : bean.getPathologicalMVal().buildVo();
		this.pathologicaloverall = bean.getPathologicalOverall() == null ? null : bean.getPathologicalOverall().buildVo();
		this.servicereportid = bean.getServiceReportId();
		this.servicereportstatus = bean.getServiceReportStatus() == null ? null : ims.oncology.vo.lookups.ServiceReportStatus.buildLookup(bean.getServiceReportStatus());
		this.specimennature = bean.getSpecimenNature() == null ? null : ims.oncology.vo.lookups.SpecimenNature.buildLookup(bean.getSpecimenNature());
		this.orgacoderequester = bean.getOrgaCodeRequester() == null ? null : bean.getOrgaCodeRequester().buildVo();
		// Interface field type not supported.
		this.tcategoryextended = ims.clinicaladmin.vo.TumourGroupSiteTNMValueVoCollection.buildFromBeanCollection(bean.getTCategoryExtended());
		this.mcategoryextended = ims.clinicaladmin.vo.TumourGroupSiteTNMValueVoCollection.buildFromBeanCollection(bean.getMCategoryExtended());
		this.status = bean.getStatus() == null ? null : ims.oncology.vo.lookups.HistopathologyReportStatus.buildLookup(bean.getStatus());
		this.authoringinformation = bean.getAuthoringInformation() == null ? null : bean.getAuthoringInformation().buildVo();
		this.associatedquestions = bean.getAssociatedQuestions() == null ? null : bean.getAssociatedQuestions().buildVo();
		this.associatiatedtumourdetails = bean.getAssociatiatedTumourDetails() == null ? null : bean.getAssociatiatedTumourDetails().buildVo();
		this.gradeofdifferentation = bean.getGradeOfDifferentation() == null ? null : bean.getGradeOfDifferentation().buildVo();
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.clinicaladmin.vo.beans.PathologyDetailsVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.investigationtype = bean.getInvestigationType() == null ? null : ims.oncology.vo.lookups.InvestigationType.buildLookup(bean.getInvestigationType());
		this.samplereceiptdate = bean.getSampleReceiptDate() == null ? null : bean.getSampleReceiptDate().buildDate();
		this.investigationresultdate = bean.getInvestigationResultDate() == null ? null : bean.getInvestigationResultDate().buildDate();
		// Interface field type not supported.
		this.reportingorganisation = bean.getReportingOrganisation() == null ? null : bean.getReportingOrganisation().buildVo(map);
		this.carecontext = bean.getCareContext() == null ? null : new ims.core.admin.vo.CareContextRefVo(new Integer(bean.getCareContext().getId()), bean.getCareContext().getVersion());
		this.previousversion = bean.getPreviousVersion() == null ? null : new ims.oncology.vo.PathologyDetailsRefVo(new Integer(bean.getPreviousVersion().getId()), bean.getPreviousVersion().getVersion());
		this.invasivelesionsize = bean.getInvasiveLesionSize();
		this.synchronoustumourindicator = bean.getSynchronousTumourIndicator() == null ? null : ims.oncology.vo.lookups.SynchronousTumourIndicator.buildLookup(bean.getSynchronousTumourIndicator());
		this.histology = ims.clinicaladmin.vo.TumourHistologyLiteVoCollection.buildFromBeanCollection(bean.getHistology());
		this.vascularlymphinvasion = bean.getVascularLymphInvasion() == null ? null : ims.oncology.vo.lookups.VascularLymphInvasion.buildLookup(bean.getVascularLymphInvasion());
		this.excisionmargin = bean.getExcisionMargin() == null ? null : ims.oncology.vo.lookups.ExcisionMargin.buildLookup(bean.getExcisionMargin());
		this.numbernodesexamined = bean.getNumberNodesExamined();
		this.nodespositivenumber = bean.getNodesPositiveNumber();
		this.pathologicaltval = bean.getPathologicalTVal() == null ? null : bean.getPathologicalTVal().buildVo(map);
		this.pathologicalnval = bean.getPathologicalNVal() == null ? null : bean.getPathologicalNVal().buildVo(map);
		this.pathologicalmval = bean.getPathologicalMVal() == null ? null : bean.getPathologicalMVal().buildVo(map);
		this.pathologicaloverall = bean.getPathologicalOverall() == null ? null : bean.getPathologicalOverall().buildVo(map);
		this.servicereportid = bean.getServiceReportId();
		this.servicereportstatus = bean.getServiceReportStatus() == null ? null : ims.oncology.vo.lookups.ServiceReportStatus.buildLookup(bean.getServiceReportStatus());
		this.specimennature = bean.getSpecimenNature() == null ? null : ims.oncology.vo.lookups.SpecimenNature.buildLookup(bean.getSpecimenNature());
		this.orgacoderequester = bean.getOrgaCodeRequester() == null ? null : bean.getOrgaCodeRequester().buildVo(map);
		// Interface field type not supported.
		this.tcategoryextended = ims.clinicaladmin.vo.TumourGroupSiteTNMValueVoCollection.buildFromBeanCollection(bean.getTCategoryExtended());
		this.mcategoryextended = ims.clinicaladmin.vo.TumourGroupSiteTNMValueVoCollection.buildFromBeanCollection(bean.getMCategoryExtended());
		this.status = bean.getStatus() == null ? null : ims.oncology.vo.lookups.HistopathologyReportStatus.buildLookup(bean.getStatus());
		this.authoringinformation = bean.getAuthoringInformation() == null ? null : bean.getAuthoringInformation().buildVo(map);
		this.associatedquestions = bean.getAssociatedQuestions() == null ? null : bean.getAssociatedQuestions().buildVo(map);
		this.associatiatedtumourdetails = bean.getAssociatiatedTumourDetails() == null ? null : bean.getAssociatiatedTumourDetails().buildVo(map);
		this.gradeofdifferentation = bean.getGradeOfDifferentation() == null ? null : bean.getGradeOfDifferentation().buildVo(map);
	}
	public ims.vo.ValueObjectBean getBean()
	{
		return this.getBean(new ims.vo.ValueObjectBeanMap());
	}
	public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
	{
		ims.clinicaladmin.vo.beans.PathologyDetailsVoBean bean = null;
		if(map != null)
			bean = (ims.clinicaladmin.vo.beans.PathologyDetailsVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.clinicaladmin.vo.beans.PathologyDetailsVoBean();
			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("INVASIVELESIONSIZE"))
			return getInvasiveLesionSize();
		if(fieldName.equals("SYNCHRONOUSTUMOURINDICATOR"))
			return getSynchronousTumourIndicator();
		if(fieldName.equals("HISTOLOGY"))
			return getHistology();
		if(fieldName.equals("VASCULARLYMPHINVASION"))
			return getVascularLymphInvasion();
		if(fieldName.equals("EXCISIONMARGIN"))
			return getExcisionMargin();
		if(fieldName.equals("NUMBERNODESEXAMINED"))
			return getNumberNodesExamined();
		if(fieldName.equals("NODESPOSITIVENUMBER"))
			return getNodesPositiveNumber();
		if(fieldName.equals("PATHOLOGICALTVAL"))
			return getPathologicalTVal();
		if(fieldName.equals("PATHOLOGICALNVAL"))
			return getPathologicalNVal();
		if(fieldName.equals("PATHOLOGICALMVAL"))
			return getPathologicalMVal();
		if(fieldName.equals("PATHOLOGICALOVERALL"))
			return getPathologicalOverall();
		if(fieldName.equals("SERVICEREPORTID"))
			return getServiceReportId();
		if(fieldName.equals("SERVICEREPORTSTATUS"))
			return getServiceReportStatus();
		if(fieldName.equals("SPECIMENNATURE"))
			return getSpecimenNature();
		if(fieldName.equals("ORGACODEREQUESTER"))
			return getOrgaCodeRequester();
		if(fieldName.equals("CAREPROFCODEREQUESTER"))
			return getCareProfCodeRequester();
		if(fieldName.equals("TCATEGORYEXTENDED"))
			return getTCategoryExtended();
		if(fieldName.equals("MCATEGORYEXTENDED"))
			return getMCategoryExtended();
		if(fieldName.equals("STATUS"))
			return getStatus();
		if(fieldName.equals("AUTHORINGINFORMATION"))
			return getAuthoringInformation();
		if(fieldName.equals("ASSOCIATEDQUESTIONS"))
			return getAssociatedQuestions();
		if(fieldName.equals("ASSOCIATIATEDTUMOURDETAILS"))
			return getAssociatiatedTumourDetails();
		if(fieldName.equals("GRADEOFDIFFERENTATION"))
			return getGradeOfDifferentation();
		return super.getFieldValueByFieldName(fieldName);
	}
	public boolean getInvasiveLesionSizeIsNotNull()
	{
		return this.invasivelesionsize != null;
	}
	public Integer getInvasiveLesionSize()
	{
		return this.invasivelesionsize;
	}
	public void setInvasiveLesionSize(Integer value)
	{
		this.isValidated = false;
		this.invasivelesionsize = value;
	}
	public boolean getSynchronousTumourIndicatorIsNotNull()
	{
		return this.synchronoustumourindicator != null;
	}
	public ims.oncology.vo.lookups.SynchronousTumourIndicator getSynchronousTumourIndicator()
	{
		return this.synchronoustumourindicator;
	}
	public void setSynchronousTumourIndicator(ims.oncology.vo.lookups.SynchronousTumourIndicator value)
	{
		this.isValidated = false;
		this.synchronoustumourindicator = value;
	}
	public boolean getHistologyIsNotNull()
	{
		return this.histology != null;
	}
	public ims.clinicaladmin.vo.TumourHistologyLiteVoCollection getHistology()
	{
		return this.histology;
	}
	public void setHistology(ims.clinicaladmin.vo.TumourHistologyLiteVoCollection value)
	{
		this.isValidated = false;
		this.histology = value;
	}
	public boolean getVascularLymphInvasionIsNotNull()
	{
		return this.vascularlymphinvasion != null;
	}
	public ims.oncology.vo.lookups.VascularLymphInvasion getVascularLymphInvasion()
	{
		return this.vascularlymphinvasion;
	}
	public void setVascularLymphInvasion(ims.oncology.vo.lookups.VascularLymphInvasion value)
	{
		this.isValidated = false;
		this.vascularlymphinvasion = value;
	}
	public boolean getExcisionMarginIsNotNull()
	{
		return this.excisionmargin != null;
	}
	public ims.oncology.vo.lookups.ExcisionMargin getExcisionMargin()
	{
		return this.excisionmargin;
	}
	public void setExcisionMargin(ims.oncology.vo.lookups.ExcisionMargin value)
	{
		this.isValidated = false;
		this.excisionmargin = value;
	}
	public boolean getNumberNodesExaminedIsNotNull()
	{
		return this.numbernodesexamined != null;
	}
	public Integer getNumberNodesExamined()
	{
		return this.numbernodesexamined;
	}
	public void setNumberNodesExamined(Integer value)
	{
		this.isValidated = false;
		this.numbernodesexamined = value;
	}
	public boolean getNodesPositiveNumberIsNotNull()
	{
		return this.nodespositivenumber != null;
	}
	public Integer getNodesPositiveNumber()
	{
		return this.nodespositivenumber;
	}
	public void setNodesPositiveNumber(Integer value)
	{
		this.isValidated = false;
		this.nodespositivenumber = value;
	}
	public boolean getPathologicalTValIsNotNull()
	{
		return this.pathologicaltval != null;
	}
	public ims.clinicaladmin.vo.TumourGroupSiteTNMValueVo getPathologicalTVal()
	{
		return this.pathologicaltval;
	}
	public void setPathologicalTVal(ims.clinicaladmin.vo.TumourGroupSiteTNMValueVo value)
	{
		this.isValidated = false;
		this.pathologicaltval = value;
	}
	public boolean getPathologicalNValIsNotNull()
	{
		return this.pathologicalnval != null;
	}
	public ims.clinicaladmin.vo.TumourGroupSiteTNMValueVo getPathologicalNVal()
	{
		return this.pathologicalnval;
	}
	public void setPathologicalNVal(ims.clinicaladmin.vo.TumourGroupSiteTNMValueVo value)
	{
		this.isValidated = false;
		this.pathologicalnval = value;
	}
	public boolean getPathologicalMValIsNotNull()
	{
		return this.pathologicalmval != null;
	}
	public ims.clinicaladmin.vo.TumourGroupSiteTNMValueVo getPathologicalMVal()
	{
		return this.pathologicalmval;
	}
	public void setPathologicalMVal(ims.clinicaladmin.vo.TumourGroupSiteTNMValueVo value)
	{
		this.isValidated = false;
		this.pathologicalmval = value;
	}
	public boolean getPathologicalOverallIsNotNull()
	{
		return this.pathologicaloverall != null;
	}
	public ims.clinicaladmin.vo.TumourGroupSiteOverallStagingVo getPathologicalOverall()
	{
		return this.pathologicaloverall;
	}
	public void setPathologicalOverall(ims.clinicaladmin.vo.TumourGroupSiteOverallStagingVo value)
	{
		this.isValidated = false;
		this.pathologicaloverall = value;
	}
	public boolean getServiceReportIdIsNotNull()
	{
		return this.servicereportid != null;
	}
	public String getServiceReportId()
	{
		return this.servicereportid;
	}
	public static int getServiceReportIdMaxLength()
	{
		return 255;
	}
	public void setServiceReportId(String value)
	{
		this.isValidated = false;
		this.servicereportid = value;
	}
	public boolean getServiceReportStatusIsNotNull()
	{
		return this.servicereportstatus != null;
	}
	public ims.oncology.vo.lookups.ServiceReportStatus getServiceReportStatus()
	{
		return this.servicereportstatus;
	}
	public void setServiceReportStatus(ims.oncology.vo.lookups.ServiceReportStatus value)
	{
		this.isValidated = false;
		this.servicereportstatus = value;
	}
	public boolean getSpecimenNatureIsNotNull()
	{
		return this.specimennature != null;
	}
	public ims.oncology.vo.lookups.SpecimenNature getSpecimenNature()
	{
		return this.specimennature;
	}
	public void setSpecimenNature(ims.oncology.vo.lookups.SpecimenNature value)
	{
		this.isValidated = false;
		this.specimennature = value;
	}
	public boolean getOrgaCodeRequesterIsNotNull()
	{
		return this.orgacoderequester != null;
	}
	public ims.core.vo.OrgLiteVo getOrgaCodeRequester()
	{
		return this.orgacoderequester;
	}
	public void setOrgaCodeRequester(ims.core.vo.OrgLiteVo value)
	{
		this.isValidated = false;
		this.orgacoderequester = value;
	}
	public boolean getCareProfCodeRequesterIsNotNull()
	{
		return this.careprofcoderequester != null;
	}
	public ims.vo.interfaces.IMos getCareProfCodeRequester()
	{
		return this.careprofcoderequester;
	}
	public void setCareProfCodeRequester(ims.vo.interfaces.IMos value)
	{
		this.isValidated = false;
		this.careprofcoderequester = (ims.core.vo.HcpLiteVo)value;
	}
	public boolean getTCategoryExtendedIsNotNull()
	{
		return this.tcategoryextended != null;
	}
	public ims.clinicaladmin.vo.TumourGroupSiteTNMValueVoCollection getTCategoryExtended()
	{
		return this.tcategoryextended;
	}
	public void setTCategoryExtended(ims.clinicaladmin.vo.TumourGroupSiteTNMValueVoCollection value)
	{
		this.isValidated = false;
		this.tcategoryextended = value;
	}
	public boolean getMCategoryExtendedIsNotNull()
	{
		return this.mcategoryextended != null;
	}
	public ims.clinicaladmin.vo.TumourGroupSiteTNMValueVoCollection getMCategoryExtended()
	{
		return this.mcategoryextended;
	}
	public void setMCategoryExtended(ims.clinicaladmin.vo.TumourGroupSiteTNMValueVoCollection value)
	{
		this.isValidated = false;
		this.mcategoryextended = value;
	}
	public boolean getStatusIsNotNull()
	{
		return this.status != null;
	}
	public ims.oncology.vo.lookups.HistopathologyReportStatus getStatus()
	{
		return this.status;
	}
	public void setStatus(ims.oncology.vo.lookups.HistopathologyReportStatus value)
	{
		this.isValidated = false;
		this.status = value;
	}
	public boolean getAuthoringInformationIsNotNull()
	{
		return this.authoringinformation != null;
	}
	public ims.core.vo.AuthoringInformationVo getAuthoringInformation()
	{
		return this.authoringinformation;
	}
	public void setAuthoringInformation(ims.core.vo.AuthoringInformationVo value)
	{
		this.isValidated = false;
		this.authoringinformation = value;
	}
	public boolean getAssociatedQuestionsIsNotNull()
	{
		return this.associatedquestions != null;
	}
	public ims.assessment.vo.PatientAssessmentVo getAssociatedQuestions()
	{
		return this.associatedquestions;
	}
	public void setAssociatedQuestions(ims.assessment.vo.PatientAssessmentVo value)
	{
		this.isValidated = false;
		this.associatedquestions = value;
	}
	public boolean getAssociatiatedTumourDetailsIsNotNull()
	{
		return this.associatiatedtumourdetails != null;
	}
	public ims.oncology.vo.PrimaryTumourDetailsShortVo getAssociatiatedTumourDetails()
	{
		return this.associatiatedtumourdetails;
	}
	public void setAssociatiatedTumourDetails(ims.oncology.vo.PrimaryTumourDetailsShortVo value)
	{
		this.isValidated = false;
		this.associatiatedtumourdetails = value;
	}
	public boolean getGradeOfDifferentationIsNotNull()
	{
		return this.gradeofdifferentation != null;
	}
	public ims.clinicaladmin.vo.TumourGroupHistopathologyGradeVo getGradeOfDifferentation()
	{
		return this.gradeofdifferentation;
	}
	public void setGradeOfDifferentation(ims.clinicaladmin.vo.TumourGroupHistopathologyGradeVo value)
	{
		this.isValidated = false;
		this.gradeofdifferentation = value;
	}
	public boolean isValidated()
	{
		if(this.isBusy)
			return true;
		this.isBusy = true;
	
		if(!this.isValidated)
		{
			this.isBusy = false;
			return false;
		}
		if(this.reportingorganisation != null)
		{
			if(!this.reportingorganisation.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.histology != null)
		{
			if(!this.histology.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.pathologicaltval != null)
		{
			if(!this.pathologicaltval.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.pathologicalnval != null)
		{
			if(!this.pathologicalnval.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.pathologicalmval != null)
		{
			if(!this.pathologicalmval.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.pathologicaloverall != null)
		{
			if(!this.pathologicaloverall.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.orgacoderequester != null)
		{
			if(!this.orgacoderequester.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.tcategoryextended != null)
		{
			if(!this.tcategoryextended.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.mcategoryextended != null)
		{
			if(!this.mcategoryextended.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.authoringinformation != null)
		{
			if(!this.authoringinformation.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.associatedquestions != null)
		{
			if(!this.associatedquestions.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.associatiatedtumourdetails != null)
		{
			if(!this.associatiatedtumourdetails.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.gradeofdifferentation != null)
		{
			if(!this.gradeofdifferentation.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.investigationtype == null)
			listOfErrors.add("InvestigationType is mandatory");
		if(this.samplereceiptdate == null)
			listOfErrors.add("SampleReceiptDate is mandatory");
		if(this.reportingorganisation != null)
		{
			String[] listOfOtherErrors = this.reportingorganisation.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.carecontext == null)
			listOfErrors.add("CareContext is mandatory");
		if(this.histology != null)
		{
			String[] listOfOtherErrors = this.histology.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.pathologicaltval != null)
		{
			String[] listOfOtherErrors = this.pathologicaltval.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.pathologicalnval != null)
		{
			String[] listOfOtherErrors = this.pathologicalnval.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.pathologicalmval != null)
		{
			String[] listOfOtherErrors = this.pathologicalmval.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.pathologicaloverall != null)
		{
			String[] listOfOtherErrors = this.pathologicaloverall.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.orgacoderequester != null)
		{
			String[] listOfOtherErrors = this.orgacoderequester.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.tcategoryextended != null)
		{
			String[] listOfOtherErrors = this.tcategoryextended.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.mcategoryextended != null)
		{
			String[] listOfOtherErrors = this.mcategoryextended.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.authoringinformation != null)
		{
			String[] listOfOtherErrors = this.authoringinformation.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.associatedquestions != null)
		{
			String[] listOfOtherErrors = this.associatedquestions.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.associatiatedtumourdetails != null)
		{
			String[] listOfOtherErrors = this.associatiatedtumourdetails.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.gradeofdifferentation != null)
		{
			String[] listOfOtherErrors = this.gradeofdifferentation.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		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;
	
		PathologyDetailsVo clone = new PathologyDetailsVo(this.id, this.version);
		
		if(this.investigationtype == null)
			clone.investigationtype = null;
		else
			clone.investigationtype = (ims.oncology.vo.lookups.InvestigationType)this.investigationtype.clone();
		if(this.samplereceiptdate == null)
			clone.samplereceiptdate = null;
		else
			clone.samplereceiptdate = (ims.framework.utils.Date)this.samplereceiptdate.clone();
		if(this.investigationresultdate == null)
			clone.investigationresultdate = null;
		else
			clone.investigationresultdate = (ims.framework.utils.Date)this.investigationresultdate.clone();
		clone.reportingconsultantcode = this.reportingconsultantcode;
		if(this.reportingorganisation == null)
			clone.reportingorganisation = null;
		else
			clone.reportingorganisation = (ims.core.vo.OrgLiteVo)this.reportingorganisation.clone();
		clone.carecontext = this.carecontext;
		clone.previousversion = this.previousversion;
		clone.invasivelesionsize = this.invasivelesionsize;
		if(this.synchronoustumourindicator == null)
			clone.synchronoustumourindicator = null;
		else
			clone.synchronoustumourindicator = (ims.oncology.vo.lookups.SynchronousTumourIndicator)this.synchronoustumourindicator.clone();
		if(this.histology == null)
			clone.histology = null;
		else
			clone.histology = (ims.clinicaladmin.vo.TumourHistologyLiteVoCollection)this.histology.clone();
		if(this.vascularlymphinvasion == null)
			clone.vascularlymphinvasion = null;
		else
			clone.vascularlymphinvasion = (ims.oncology.vo.lookups.VascularLymphInvasion)this.vascularlymphinvasion.clone();
		if(this.excisionmargin == null)
			clone.excisionmargin = null;
		else
			clone.excisionmargin = (ims.oncology.vo.lookups.ExcisionMargin)this.excisionmargin.clone();
		clone.numbernodesexamined = this.numbernodesexamined;
		clone.nodespositivenumber = this.nodespositivenumber;
		if(this.pathologicaltval == null)
			clone.pathologicaltval = null;
		else
			clone.pathologicaltval = (ims.clinicaladmin.vo.TumourGroupSiteTNMValueVo)this.pathologicaltval.clone();
		if(this.pathologicalnval == null)
			clone.pathologicalnval = null;
		else
			clone.pathologicalnval = (ims.clinicaladmin.vo.TumourGroupSiteTNMValueVo)this.pathologicalnval.clone();
		if(this.pathologicalmval == null)
			clone.pathologicalmval = null;
		else
			clone.pathologicalmval = (ims.clinicaladmin.vo.TumourGroupSiteTNMValueVo)this.pathologicalmval.clone();
		if(this.pathologicaloverall == null)
			clone.pathologicaloverall = null;
		else
			clone.pathologicaloverall = (ims.clinicaladmin.vo.TumourGroupSiteOverallStagingVo)this.pathologicaloverall.clone();
		clone.servicereportid = this.servicereportid;
		if(this.servicereportstatus == null)
			clone.servicereportstatus = null;
		else
			clone.servicereportstatus = (ims.oncology.vo.lookups.ServiceReportStatus)this.servicereportstatus.clone();
		if(this.specimennature == null)
			clone.specimennature = null;
		else
			clone.specimennature = (ims.oncology.vo.lookups.SpecimenNature)this.specimennature.clone();
		if(this.orgacoderequester == null)
			clone.orgacoderequester = null;
		else
			clone.orgacoderequester = (ims.core.vo.OrgLiteVo)this.orgacoderequester.clone();
		clone.careprofcoderequester = this.careprofcoderequester;
		if(this.tcategoryextended == null)
			clone.tcategoryextended = null;
		else
			clone.tcategoryextended = (ims.clinicaladmin.vo.TumourGroupSiteTNMValueVoCollection)this.tcategoryextended.clone();
		if(this.mcategoryextended == null)
			clone.mcategoryextended = null;
		else
			clone.mcategoryextended = (ims.clinicaladmin.vo.TumourGroupSiteTNMValueVoCollection)this.mcategoryextended.clone();
		if(this.status == null)
			clone.status = null;
		else
			clone.status = (ims.oncology.vo.lookups.HistopathologyReportStatus)this.status.clone();
		if(this.authoringinformation == null)
			clone.authoringinformation = null;
		else
			clone.authoringinformation = (ims.core.vo.AuthoringInformationVo)this.authoringinformation.clone();
		if(this.associatedquestions == null)
			clone.associatedquestions = null;
		else
			clone.associatedquestions = (ims.assessment.vo.PatientAssessmentVo)this.associatedquestions.clone();
		if(this.associatiatedtumourdetails == null)
			clone.associatiatedtumourdetails = null;
		else
			clone.associatiatedtumourdetails = (ims.oncology.vo.PrimaryTumourDetailsShortVo)this.associatiatedtumourdetails.clone();
		if(this.gradeofdifferentation == null)
			clone.gradeofdifferentation = null;
		else
			clone.gradeofdifferentation = (ims.clinicaladmin.vo.TumourGroupHistopathologyGradeVo)this.gradeofdifferentation.clone();
		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 (!(PathologyDetailsVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A PathologyDetailsVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		PathologyDetailsVo compareObj = (PathologyDetailsVo)obj;
		int retVal = 0;
		if (retVal == 0)
		{
			if(this.getPreviousVersion() == null && compareObj.getPreviousVersion() != null)
				return -1;
			if(this.getPreviousVersion() != null && compareObj.getPreviousVersion() == null)
				return 1;
			if(this.getPreviousVersion() != null && compareObj.getPreviousVersion() != null)
				retVal = this.getPreviousVersion().compareTo(compareObj.getPreviousVersion());
		}
		return retVal;
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = super.countFieldsWithValue();
		if(this.invasivelesionsize != null)
			count++;
		if(this.synchronoustumourindicator != null)
			count++;
		if(this.histology != null)
			count++;
		if(this.vascularlymphinvasion != null)
			count++;
		if(this.excisionmargin != null)
			count++;
		if(this.numbernodesexamined != null)
			count++;
		if(this.nodespositivenumber != null)
			count++;
		if(this.pathologicaltval != null)
			count++;
		if(this.pathologicalnval != null)
			count++;
		if(this.pathologicalmval != null)
			count++;
		if(this.pathologicaloverall != null)
			count++;
		if(this.servicereportid != null)
			count++;
		if(this.servicereportstatus != null)
			count++;
		if(this.specimennature != null)
			count++;
		if(this.orgacoderequester != null)
			count++;
		if(this.careprofcoderequester != null)
			count++;
		if(this.tcategoryextended != null)
			count++;
		if(this.mcategoryextended != null)
			count++;
		if(this.status != null)
			count++;
		if(this.authoringinformation != null)
			count++;
		if(this.associatedquestions != null)
			count++;
		if(this.associatiatedtumourdetails != null)
			count++;
		if(this.gradeofdifferentation != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return super.countValueObjectFields() + 23;
	}
	protected Integer invasivelesionsize;
	protected ims.oncology.vo.lookups.SynchronousTumourIndicator synchronoustumourindicator;
	protected ims.clinicaladmin.vo.TumourHistologyLiteVoCollection histology;
	protected ims.oncology.vo.lookups.VascularLymphInvasion vascularlymphinvasion;
	protected ims.oncology.vo.lookups.ExcisionMargin excisionmargin;
	protected Integer numbernodesexamined;
	protected Integer nodespositivenumber;
	protected ims.clinicaladmin.vo.TumourGroupSiteTNMValueVo pathologicaltval;
	protected ims.clinicaladmin.vo.TumourGroupSiteTNMValueVo pathologicalnval;
	protected ims.clinicaladmin.vo.TumourGroupSiteTNMValueVo pathologicalmval;
	protected ims.clinicaladmin.vo.TumourGroupSiteOverallStagingVo pathologicaloverall;
	protected String servicereportid;
	protected ims.oncology.vo.lookups.ServiceReportStatus servicereportstatus;
	protected ims.oncology.vo.lookups.SpecimenNature specimennature;
	protected ims.core.vo.OrgLiteVo orgacoderequester;
	protected ims.core.vo.HcpLiteVo careprofcoderequester;
	protected ims.clinicaladmin.vo.TumourGroupSiteTNMValueVoCollection tcategoryextended;
	protected ims.clinicaladmin.vo.TumourGroupSiteTNMValueVoCollection mcategoryextended;
	protected ims.oncology.vo.lookups.HistopathologyReportStatus status;
	protected ims.core.vo.AuthoringInformationVo authoringinformation;
	protected ims.assessment.vo.PatientAssessmentVo associatedquestions;
	protected ims.oncology.vo.PrimaryTumourDetailsShortVo associatiatedtumourdetails;
	protected ims.clinicaladmin.vo.TumourGroupHistopathologyGradeVo gradeofdifferentation;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
