/FileExtraction/Java_unseen/IMS-MAXIMS_openMAXIMS/Source Library/openmaxims_workspace/ValueObjects/src/ims/ocrr/vo/InvestigationVo.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 OCRR.Configuration.Investigation business object (ID: 1058100001).
 */
public class InvestigationVo extends ims.ocrr.vo.InvestigationShortVo implements ims.vo.ImsCloneable, Comparable
{
	private static final long serialVersionUID = 1L;

	public InvestigationVo()
	{
	}
	public InvestigationVo(Integer id, int version)
	{
		super(id, version);
	}
	public InvestigationVo(ims.ocrr.vo.beans.InvestigationVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.activestatus = bean.getActiveStatus() == null ? null : ims.core.vo.lookups.PreActiveActiveInactiveStatus.buildLookup(bean.getActiveStatus());
		this.investigationindex = bean.getInvestigationIndex() == null ? null : bean.getInvestigationIndex().buildVo();
		this.colour = bean.getColour() == null ? null : bean.getColour().buildColor();
		this.providerinvcode = bean.getProviderInvCode();
		this.pathinvdetails = bean.getPathInvDetails() == null ? null : bean.getPathInvDetails().buildVo();
		this.clinimaginvdetails = bean.getClinImagInvDetails() == null ? null : bean.getClinImagInvDetails().buildVo();
		this.assocquestions = ims.ocrr.vo.InvestigationQuestionVoCollection.buildFromBeanCollection(bean.getAssocQuestions());
		this.helptext = ims.ocrr.vo.HelpTextVoCollection.buildFromBeanCollection(bean.getHelpText());
		this.providerservice = bean.getProviderService() == null ? null : bean.getProviderService().buildVo();
		this.associnvestigations = ims.ocrr.vo.InvestShortVoCollection.buildFromBeanCollection(bean.getAssocInvestigations());
		this.separateorder = bean.getSeparateOrder();
		this.isaddon = bean.getIsAddon();
		this.minreorderperiodval = bean.getMinReorderPeriodVal();
		this.minreorderperiodunit = bean.getMinReorderPeriodUnit() == null ? null : ims.ocrr.vo.lookups.MinReorderPeriod.buildLookup(bean.getMinReorderPeriodUnit());
		this.femaleminreorderperiodval = bean.getFemaleMinReorderPeriodVal();
		this.femaleminreorderperiodunit = bean.getFemaleMinReorderPeriodUnit() == null ? null : ims.ocrr.vo.lookups.MinReorderPeriod.buildLookup(bean.getFemaleMinReorderPeriodUnit());
		this.sysinfo = bean.getSysInfo() == null ? null : bean.getSysInfo().buildSystemInformation();
		this.type = bean.getType() == null ? null : ims.ocrr.vo.lookups.InvType.buildLookup(bean.getType());
		this.eventtype = bean.getEventType() == null ? null : ims.ocrr.vo.lookups.InvEventType.buildLookup(bean.getEventType());
		this.nolabelsets = bean.getNoLabelSets();
		this.turnaroundmeasure = bean.getTurnaroundMeasure() == null ? null : ims.ocrr.vo.lookups.MinReorderPeriod.buildLookup(bean.getTurnaroundMeasure());
		this.expectedturnaround = bean.getExpectedTurnaround();
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.ocrr.vo.beans.InvestigationVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.activestatus = bean.getActiveStatus() == null ? null : ims.core.vo.lookups.PreActiveActiveInactiveStatus.buildLookup(bean.getActiveStatus());
		this.investigationindex = bean.getInvestigationIndex() == null ? null : bean.getInvestigationIndex().buildVo(map);
		this.colour = bean.getColour() == null ? null : bean.getColour().buildColor();
		this.providerinvcode = bean.getProviderInvCode();
		this.pathinvdetails = bean.getPathInvDetails() == null ? null : bean.getPathInvDetails().buildVo(map);
		this.clinimaginvdetails = bean.getClinImagInvDetails() == null ? null : bean.getClinImagInvDetails().buildVo(map);
		this.assocquestions = ims.ocrr.vo.InvestigationQuestionVoCollection.buildFromBeanCollection(bean.getAssocQuestions());
		this.helptext = ims.ocrr.vo.HelpTextVoCollection.buildFromBeanCollection(bean.getHelpText());
		this.providerservice = bean.getProviderService() == null ? null : bean.getProviderService().buildVo(map);
		this.associnvestigations = ims.ocrr.vo.InvestShortVoCollection.buildFromBeanCollection(bean.getAssocInvestigations());
		this.separateorder = bean.getSeparateOrder();
		this.isaddon = bean.getIsAddon();
		this.minreorderperiodval = bean.getMinReorderPeriodVal();
		this.minreorderperiodunit = bean.getMinReorderPeriodUnit() == null ? null : ims.ocrr.vo.lookups.MinReorderPeriod.buildLookup(bean.getMinReorderPeriodUnit());
		this.femaleminreorderperiodval = bean.getFemaleMinReorderPeriodVal();
		this.femaleminreorderperiodunit = bean.getFemaleMinReorderPeriodUnit() == null ? null : ims.ocrr.vo.lookups.MinReorderPeriod.buildLookup(bean.getFemaleMinReorderPeriodUnit());
		this.sysinfo = bean.getSysInfo() == null ? null : bean.getSysInfo().buildSystemInformation();
		this.type = bean.getType() == null ? null : ims.ocrr.vo.lookups.InvType.buildLookup(bean.getType());
		this.eventtype = bean.getEventType() == null ? null : ims.ocrr.vo.lookups.InvEventType.buildLookup(bean.getEventType());
		this.nolabelsets = bean.getNoLabelSets();
		this.turnaroundmeasure = bean.getTurnaroundMeasure() == null ? null : ims.ocrr.vo.lookups.MinReorderPeriod.buildLookup(bean.getTurnaroundMeasure());
		this.expectedturnaround = bean.getExpectedTurnaround();
	}
	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.InvestigationVoBean bean = null;
		if(map != null)
			bean = (ims.ocrr.vo.beans.InvestigationVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.ocrr.vo.beans.InvestigationVoBean();
			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("COLOUR"))
			return getColour();
		if(fieldName.equals("PROVIDERINVCODE"))
			return getProviderInvCode();
		if(fieldName.equals("PATHINVDETAILS"))
			return getPathInvDetails();
		if(fieldName.equals("CLINIMAGINVDETAILS"))
			return getClinImagInvDetails();
		if(fieldName.equals("ASSOCQUESTIONS"))
			return getAssocQuestions();
		if(fieldName.equals("HELPTEXT"))
			return getHelpText();
		if(fieldName.equals("PROVIDERSERVICE"))
			return getProviderService();
		if(fieldName.equals("ASSOCINVESTIGATIONS"))
			return getAssocInvestigations();
		if(fieldName.equals("SEPARATEORDER"))
			return getSeparateOrder();
		if(fieldName.equals("ISADDON"))
			return getIsAddon();
		if(fieldName.equals("MINREORDERPERIODVAL"))
			return getMinReorderPeriodVal();
		if(fieldName.equals("MINREORDERPERIODUNIT"))
			return getMinReorderPeriodUnit();
		if(fieldName.equals("FEMALEMINREORDERPERIODVAL"))
			return getFemaleMinReorderPeriodVal();
		if(fieldName.equals("FEMALEMINREORDERPERIODUNIT"))
			return getFemaleMinReorderPeriodUnit();
		if(fieldName.equals("SYSINFO"))
			return getSysInfo();
		if(fieldName.equals("TYPE"))
			return getType();
		if(fieldName.equals("EVENTTYPE"))
			return getEventType();
		if(fieldName.equals("NOLABELSETS"))
			return getNoLabelSets();
		if(fieldName.equals("TURNAROUNDMEASURE"))
			return getTurnaroundMeasure();
		if(fieldName.equals("EXPECTEDTURNAROUND"))
			return getExpectedTurnaround();
		return super.getFieldValueByFieldName(fieldName);
	}
	public boolean getColourIsNotNull()
	{
		return this.colour != null;
	}
	public ims.framework.utils.Color getColour()
	{
		return this.colour;
	}
	public void setColour(ims.framework.utils.Color value)
	{
		this.isValidated = false;
		this.colour = value;
	}
	public boolean getProviderInvCodeIsNotNull()
	{
		return this.providerinvcode != null;
	}
	public String getProviderInvCode()
	{
		return this.providerinvcode;
	}
	public static int getProviderInvCodeMaxLength()
	{
		return 255;
	}
	public void setProviderInvCode(String value)
	{
		this.isValidated = false;
		this.providerinvcode = value;
	}
	public boolean getPathInvDetailsIsNotNull()
	{
		return this.pathinvdetails != null;
	}
	public ims.ocrr.vo.PathInvDetailsVo getPathInvDetails()
	{
		return this.pathinvdetails;
	}
	public void setPathInvDetails(ims.ocrr.vo.PathInvDetailsVo value)
	{
		this.isValidated = false;
		this.pathinvdetails = value;
	}
	public boolean getClinImagInvDetailsIsNotNull()
	{
		return this.clinimaginvdetails != null;
	}
	public ims.ocrr.vo.ClinImagInvDetailsVo getClinImagInvDetails()
	{
		return this.clinimaginvdetails;
	}
	public void setClinImagInvDetails(ims.ocrr.vo.ClinImagInvDetailsVo value)
	{
		this.isValidated = false;
		this.clinimaginvdetails = value;
	}
	public boolean getAssocQuestionsIsNotNull()
	{
		return this.assocquestions != null;
	}
	public ims.ocrr.vo.InvestigationQuestionVoCollection getAssocQuestions()
	{
		return this.assocquestions;
	}
	public void setAssocQuestions(ims.ocrr.vo.InvestigationQuestionVoCollection value)
	{
		this.isValidated = false;
		this.assocquestions = value;
	}
	public boolean getHelpTextIsNotNull()
	{
		return this.helptext != null;
	}
	public ims.ocrr.vo.HelpTextVoCollection getHelpText()
	{
		return this.helptext;
	}
	public void setHelpText(ims.ocrr.vo.HelpTextVoCollection value)
	{
		this.isValidated = false;
		this.helptext = value;
	}
	public boolean getProviderServiceIsNotNull()
	{
		return this.providerservice != null;
	}
	public ims.ocrr.vo.LocSvcProviderSysVo getProviderService()
	{
		return this.providerservice;
	}
	public void setProviderService(ims.ocrr.vo.LocSvcProviderSysVo value)
	{
		this.isValidated = false;
		this.providerservice = value;
	}
	public boolean getAssocInvestigationsIsNotNull()
	{
		return this.associnvestigations != null;
	}
	public ims.ocrr.vo.InvestShortVoCollection getAssocInvestigations()
	{
		return this.associnvestigations;
	}
	public void setAssocInvestigations(ims.ocrr.vo.InvestShortVoCollection value)
	{
		this.isValidated = false;
		this.associnvestigations = value;
	}
	public boolean getSeparateOrderIsNotNull()
	{
		return this.separateorder != null;
	}
	public Boolean getSeparateOrder()
	{
		return this.separateorder;
	}
	public void setSeparateOrder(Boolean value)
	{
		this.isValidated = false;
		this.separateorder = value;
	}
	public boolean getIsAddonIsNotNull()
	{
		return this.isaddon != null;
	}
	public Boolean getIsAddon()
	{
		return this.isaddon;
	}
	public void setIsAddon(Boolean value)
	{
		this.isValidated = false;
		this.isaddon = value;
	}
	public boolean getMinReorderPeriodValIsNotNull()
	{
		return this.minreorderperiodval != null;
	}
	public Integer getMinReorderPeriodVal()
	{
		return this.minreorderperiodval;
	}
	public void setMinReorderPeriodVal(Integer value)
	{
		this.isValidated = false;
		this.minreorderperiodval = value;
	}
	public boolean getMinReorderPeriodUnitIsNotNull()
	{
		return this.minreorderperiodunit != null;
	}
	public ims.ocrr.vo.lookups.MinReorderPeriod getMinReorderPeriodUnit()
	{
		return this.minreorderperiodunit;
	}
	public void setMinReorderPeriodUnit(ims.ocrr.vo.lookups.MinReorderPeriod value)
	{
		this.isValidated = false;
		this.minreorderperiodunit = value;
	}
	public boolean getFemaleMinReorderPeriodValIsNotNull()
	{
		return this.femaleminreorderperiodval != null;
	}
	public Integer getFemaleMinReorderPeriodVal()
	{
		return this.femaleminreorderperiodval;
	}
	public void setFemaleMinReorderPeriodVal(Integer value)
	{
		this.isValidated = false;
		this.femaleminreorderperiodval = value;
	}
	public boolean getFemaleMinReorderPeriodUnitIsNotNull()
	{
		return this.femaleminreorderperiodunit != null;
	}
	public ims.ocrr.vo.lookups.MinReorderPeriod getFemaleMinReorderPeriodUnit()
	{
		return this.femaleminreorderperiodunit;
	}
	public void setFemaleMinReorderPeriodUnit(ims.ocrr.vo.lookups.MinReorderPeriod value)
	{
		this.isValidated = false;
		this.femaleminreorderperiodunit = value;
	}
	public boolean getSysInfoIsNotNull()
	{
		return this.sysinfo != null;
	}
	public ims.vo.SystemInformation getSysInfo()
	{
		return this.sysinfo;
	}
	public void setSysInfo(ims.vo.SystemInformation value)
	{
		this.isValidated = false;
		this.sysinfo = value;
	}
	public boolean getTypeIsNotNull()
	{
		return this.type != null;
	}
	public ims.ocrr.vo.lookups.InvType getType()
	{
		return this.type;
	}
	public void setType(ims.ocrr.vo.lookups.InvType value)
	{
		this.isValidated = false;
		this.type = value;
	}
	public boolean getEventTypeIsNotNull()
	{
		return this.eventtype != null;
	}
	public ims.ocrr.vo.lookups.InvEventType getEventType()
	{
		return this.eventtype;
	}
	public void setEventType(ims.ocrr.vo.lookups.InvEventType value)
	{
		this.isValidated = false;
		this.eventtype = value;
	}
	public boolean getNoLabelSetsIsNotNull()
	{
		return this.nolabelsets != null;
	}
	public Integer getNoLabelSets()
	{
		return this.nolabelsets;
	}
	public void setNoLabelSets(Integer value)
	{
		this.isValidated = false;
		this.nolabelsets = value;
	}
	public boolean getTurnaroundMeasureIsNotNull()
	{
		return this.turnaroundmeasure != null;
	}
	public ims.ocrr.vo.lookups.MinReorderPeriod getTurnaroundMeasure()
	{
		return this.turnaroundmeasure;
	}
	public void setTurnaroundMeasure(ims.ocrr.vo.lookups.MinReorderPeriod value)
	{
		this.isValidated = false;
		this.turnaroundmeasure = value;
	}
	public boolean getExpectedTurnaroundIsNotNull()
	{
		return this.expectedturnaround != null;
	}
	public Integer getExpectedTurnaround()
	{
		return this.expectedturnaround;
	}
	public void setExpectedTurnaround(Integer value)
	{
		this.isValidated = false;
		this.expectedturnaround = value;
	}
	public boolean isValidated()
	{
		if(this.isBusy)
			return true;
		this.isBusy = true;
	
		if(!this.isValidated)
		{
			this.isBusy = false;
			return false;
		}
		if(this.investigationindex != null)
		{
			if(!this.investigationindex.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.pathinvdetails != null)
		{
			if(!this.pathinvdetails.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.clinimaginvdetails != null)
		{
			if(!this.clinimaginvdetails.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.assocquestions != null)
		{
			if(!this.assocquestions.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.helptext != null)
		{
			if(!this.helptext.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.providerservice != null)
		{
			if(!this.providerservice.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.associnvestigations != null)
		{
			if(!this.associnvestigations.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.activestatus == null)
			listOfErrors.add("Status is mandatory");
		if(this.investigationindex == null)
			listOfErrors.add("InvestigationIndex is mandatory");
		if(this.investigationindex != null)
		{
			String[] listOfOtherErrors = this.investigationindex.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.providerinvcode != null)
			if(this.providerinvcode.length() > 255)
				listOfErrors.add("The length of the field [providerinvcode] in the value object [ims.ocrr.vo.InvestigationVo] is too big. It should be less or equal to 255");
		if(this.pathinvdetails != null)
		{
			String[] listOfOtherErrors = this.pathinvdetails.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.clinimaginvdetails != null)
		{
			String[] listOfOtherErrors = this.clinimaginvdetails.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.assocquestions != null)
		{
			String[] listOfOtherErrors = this.assocquestions.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.helptext != null)
		{
			String[] listOfOtherErrors = this.helptext.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.providerservice != null)
		{
			String[] listOfOtherErrors = this.providerservice.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.associnvestigations != null)
		{
			String[] listOfOtherErrors = this.associnvestigations.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.type == null)
			listOfErrors.add("Type is mandatory");
		if(this.eventtype == null)
			listOfErrors.add("EventType 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;
	
		InvestigationVo clone = new InvestigationVo(this.id, this.version);
		
		if(this.activestatus == null)
			clone.activestatus = null;
		else
			clone.activestatus = (ims.core.vo.lookups.PreActiveActiveInactiveStatus)this.activestatus.clone();
		if(this.investigationindex == null)
			clone.investigationindex = null;
		else
			clone.investigationindex = (ims.ocrr.vo.InvestigationIndexVo)this.investigationindex.clone();
		if(this.colour == null)
			clone.colour = null;
		else
			clone.colour = (ims.framework.utils.Color)this.colour.clone();
		clone.providerinvcode = this.providerinvcode;
		if(this.pathinvdetails == null)
			clone.pathinvdetails = null;
		else
			clone.pathinvdetails = (ims.ocrr.vo.PathInvDetailsVo)this.pathinvdetails.clone();
		if(this.clinimaginvdetails == null)
			clone.clinimaginvdetails = null;
		else
			clone.clinimaginvdetails = (ims.ocrr.vo.ClinImagInvDetailsVo)this.clinimaginvdetails.clone();
		if(this.assocquestions == null)
			clone.assocquestions = null;
		else
			clone.assocquestions = (ims.ocrr.vo.InvestigationQuestionVoCollection)this.assocquestions.clone();
		if(this.helptext == null)
			clone.helptext = null;
		else
			clone.helptext = (ims.ocrr.vo.HelpTextVoCollection)this.helptext.clone();
		if(this.providerservice == null)
			clone.providerservice = null;
		else
			clone.providerservice = (ims.ocrr.vo.LocSvcProviderSysVo)this.providerservice.clone();
		if(this.associnvestigations == null)
			clone.associnvestigations = null;
		else
			clone.associnvestigations = (ims.ocrr.vo.InvestShortVoCollection)this.associnvestigations.clone();
		clone.separateorder = this.separateorder;
		clone.isaddon = this.isaddon;
		clone.minreorderperiodval = this.minreorderperiodval;
		if(this.minreorderperiodunit == null)
			clone.minreorderperiodunit = null;
		else
			clone.minreorderperiodunit = (ims.ocrr.vo.lookups.MinReorderPeriod)this.minreorderperiodunit.clone();
		clone.femaleminreorderperiodval = this.femaleminreorderperiodval;
		if(this.femaleminreorderperiodunit == null)
			clone.femaleminreorderperiodunit = null;
		else
			clone.femaleminreorderperiodunit = (ims.ocrr.vo.lookups.MinReorderPeriod)this.femaleminreorderperiodunit.clone();
		if(this.sysinfo == null)
			clone.sysinfo = null;
		else
			clone.sysinfo = (ims.vo.SystemInformation)this.sysinfo.clone();
		if(this.type == null)
			clone.type = null;
		else
			clone.type = (ims.ocrr.vo.lookups.InvType)this.type.clone();
		if(this.eventtype == null)
			clone.eventtype = null;
		else
			clone.eventtype = (ims.ocrr.vo.lookups.InvEventType)this.eventtype.clone();
		clone.nolabelsets = this.nolabelsets;
		if(this.turnaroundmeasure == null)
			clone.turnaroundmeasure = null;
		else
			clone.turnaroundmeasure = (ims.ocrr.vo.lookups.MinReorderPeriod)this.turnaroundmeasure.clone();
		clone.expectedturnaround = this.expectedturnaround;
		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 (!(InvestigationVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A InvestigationVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		InvestigationVo compareObj = (InvestigationVo)obj;
		int retVal = 0;
		if (retVal == 0)
		{
			if(this.getSysInfo() == null && compareObj.getSysInfo() != null)
				return -1;
			if(this.getSysInfo() != null && compareObj.getSysInfo() == null)
				return 1;
			if(this.getSysInfo() != null && compareObj.getSysInfo() != null)
				retVal = this.getSysInfo().compareTo(compareObj.getSysInfo());
		}
		return retVal;
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = super.countFieldsWithValue();
		if(this.colour != null)
			count++;
		if(this.providerinvcode != null)
			count++;
		if(this.pathinvdetails != null)
			count++;
		if(this.clinimaginvdetails != null)
			count++;
		if(this.assocquestions != null)
			count++;
		if(this.helptext != null)
			count++;
		if(this.providerservice != null)
			count++;
		if(this.associnvestigations != null)
			count++;
		if(this.separateorder != null)
			count++;
		if(this.isaddon != null)
			count++;
		if(this.minreorderperiodval != null)
			count++;
		if(this.minreorderperiodunit != null)
			count++;
		if(this.femaleminreorderperiodval != null)
			count++;
		if(this.femaleminreorderperiodunit != null)
			count++;
		if(this.sysinfo != null)
			count++;
		if(this.type != null)
			count++;
		if(this.eventtype != null)
			count++;
		if(this.nolabelsets != null)
			count++;
		if(this.turnaroundmeasure != null)
			count++;
		if(this.expectedturnaround != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return super.countValueObjectFields() + 20;
	}
	protected ims.framework.utils.Color colour;
	protected String providerinvcode;
	protected ims.ocrr.vo.PathInvDetailsVo pathinvdetails;
	protected ims.ocrr.vo.ClinImagInvDetailsVo clinimaginvdetails;
	protected ims.ocrr.vo.InvestigationQuestionVoCollection assocquestions;
	protected ims.ocrr.vo.HelpTextVoCollection helptext;
	protected ims.ocrr.vo.LocSvcProviderSysVo providerservice;
	protected ims.ocrr.vo.InvestShortVoCollection associnvestigations;
	protected Boolean separateorder;
	protected Boolean isaddon;
	protected Integer minreorderperiodval;
	protected ims.ocrr.vo.lookups.MinReorderPeriod minreorderperiodunit;
	protected Integer femaleminreorderperiodval;
	protected ims.ocrr.vo.lookups.MinReorderPeriod femaleminreorderperiodunit;
	protected ims.vo.SystemInformation sysinfo;
	protected ims.ocrr.vo.lookups.InvType type;
	protected ims.ocrr.vo.lookups.InvEventType eventtype;
	protected Integer nolabelsets;
	protected ims.ocrr.vo.lookups.MinReorderPeriod turnaroundmeasure;
	protected Integer expectedturnaround;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
