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

/**
 * Linked to core.clinical.PatientDiagnosis business object (ID: 1003100016).
 */
public class PatientDiagnosisVo extends ims.core.vo.PatientDiagnosisListVo implements ims.vo.ImsCloneable, Comparable, ims.vo.interfaces.IClinicalCodingValue
{
	private static final long serialVersionUID = 1L;

	public PatientDiagnosisVo()
	{
	}
	public PatientDiagnosisVo(Integer id, int version)
	{
		super(id, version);
	}
	public PatientDiagnosisVo(ims.core.vo.beans.PatientDiagnosisVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.diagnosisdescription = bean.getDiagnosisDescription();
		this.diagnoseddate = bean.getDiagnosedDate() == null ? null : bean.getDiagnosedDate().buildPartialDate();
		this.currentstatus = bean.getCurrentStatus() == null ? null : bean.getCurrentStatus().buildVo();
		this.sourceofinformation = bean.getSourceofInformation() == null ? null : ims.core.vo.lookups.SourceofInformation.buildLookup(bean.getSourceofInformation());
		this.diagnosis = bean.getDiagnosis() == null ? null : bean.getDiagnosis().buildVo();
		this.carecontext = bean.getCareContext() == null ? null : bean.getCareContext().buildVo();
		this.iscomorbidity = bean.getIsComorbidity();
		this.episodeofcare = bean.getEpisodeOfCare() == null ? null : new ims.core.admin.vo.EpisodeOfCareRefVo(new Integer(bean.getEpisodeOfCare().getId()), bean.getEpisodeOfCare().getVersion());
		this.diagnosedonadmission = bean.getDiagnosedOnAdmission();
		this.iscomplication = bean.getIsComplication();
		this.dateresolved = bean.getDateResolved() == null ? null : bean.getDateResolved().buildDate();
		this.sysinfo = bean.getSysInfo() == null ? null : bean.getSysInfo().buildSystemInformation();
		this.dateonset = bean.getDateOnset() == null ? null : bean.getDateOnset().buildDate();
		this.clinicalcontact = bean.getClinicalContact() == null ? null : bean.getClinicalContact().buildVo();
		this.diaglaterality = bean.getDiagLaterality() == null ? null : ims.core.vo.lookups.LateralityLRB.buildLookup(bean.getDiagLaterality());
		this.sitetext = bean.getSiteText();
		this.ispmh = bean.getIsPMH();
		this.iscancerdiagnosis = bean.getIsCancerDiagnosis();
		this.authoringinfo = bean.getAuthoringInfo() == null ? null : bean.getAuthoringInfo().buildVo();
		this.primaryforcarespells = ims.core.vo.CSPrimaryDiagnosisVoCollection.buildFromBeanCollection(bean.getPrimaryForCareSpells());
		this.site = bean.getSite() == null ? null : ims.clinical.vo.lookups.Site.buildLookup(bean.getSite());
		this.diagnosedby = bean.getDiagnosedBy() == null ? null : bean.getDiagnosedBy().buildVo();
		this.isresolved = bean.getIsResolved();
		this.informedofdiagnosis = ims.core.vo.lookups.DiagnosisInformedOfDiagnosisCollection.buildFromBeanCollection(bean.getInformedOfDiagnosis());
		this.notes = bean.getNotes();
		this.specialty = bean.getSpecialty() == null ? null : ims.core.vo.lookups.Specialty.buildLookup(bean.getSpecialty());
		this.basisofdiagnosis = ims.core.vo.lookups.DiagnosisBasisofDiagnosisCollection.buildFromBeanCollection(bean.getBasisofDiagnosis());
		this.excludefromothers = bean.getExcludefromOthers();
		this.diagconfirmedstatus = bean.getDiagConfirmedStatus() == null ? null : ims.core.vo.lookups.ConfirmedStatus.buildLookup(bean.getDiagConfirmedStatus());
		this.diagconfirmedby = bean.getDiagConfirmedBy() == null ? null : bean.getDiagConfirmedBy().buildVo();
		this.diagconfirmeddatetime = bean.getDiagConfirmedDateTime() == null ? null : bean.getDiagConfirmedDateTime().buildDateTime();
		this.statushistory = ims.clinical.vo.PatientDiagnosisStatusVoCollection.buildFromBeanCollection(bean.getStatusHistory());
		// Interface field type not supported.
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.core.vo.beans.PatientDiagnosisVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.diagnosisdescription = bean.getDiagnosisDescription();
		this.diagnoseddate = bean.getDiagnosedDate() == null ? null : bean.getDiagnosedDate().buildPartialDate();
		this.currentstatus = bean.getCurrentStatus() == null ? null : bean.getCurrentStatus().buildVo(map);
		this.sourceofinformation = bean.getSourceofInformation() == null ? null : ims.core.vo.lookups.SourceofInformation.buildLookup(bean.getSourceofInformation());
		this.diagnosis = bean.getDiagnosis() == null ? null : bean.getDiagnosis().buildVo(map);
		this.carecontext = bean.getCareContext() == null ? null : bean.getCareContext().buildVo(map);
		this.iscomorbidity = bean.getIsComorbidity();
		this.episodeofcare = bean.getEpisodeOfCare() == null ? null : new ims.core.admin.vo.EpisodeOfCareRefVo(new Integer(bean.getEpisodeOfCare().getId()), bean.getEpisodeOfCare().getVersion());
		this.diagnosedonadmission = bean.getDiagnosedOnAdmission();
		this.iscomplication = bean.getIsComplication();
		this.dateresolved = bean.getDateResolved() == null ? null : bean.getDateResolved().buildDate();
		this.sysinfo = bean.getSysInfo() == null ? null : bean.getSysInfo().buildSystemInformation();
		this.dateonset = bean.getDateOnset() == null ? null : bean.getDateOnset().buildDate();
		this.clinicalcontact = bean.getClinicalContact() == null ? null : bean.getClinicalContact().buildVo(map);
		this.diaglaterality = bean.getDiagLaterality() == null ? null : ims.core.vo.lookups.LateralityLRB.buildLookup(bean.getDiagLaterality());
		this.sitetext = bean.getSiteText();
		this.ispmh = bean.getIsPMH();
		this.iscancerdiagnosis = bean.getIsCancerDiagnosis();
		this.authoringinfo = bean.getAuthoringInfo() == null ? null : bean.getAuthoringInfo().buildVo(map);
		this.primaryforcarespells = ims.core.vo.CSPrimaryDiagnosisVoCollection.buildFromBeanCollection(bean.getPrimaryForCareSpells());
		this.site = bean.getSite() == null ? null : ims.clinical.vo.lookups.Site.buildLookup(bean.getSite());
		this.diagnosedby = bean.getDiagnosedBy() == null ? null : bean.getDiagnosedBy().buildVo(map);
		this.isresolved = bean.getIsResolved();
		this.informedofdiagnosis = ims.core.vo.lookups.DiagnosisInformedOfDiagnosisCollection.buildFromBeanCollection(bean.getInformedOfDiagnosis());
		this.notes = bean.getNotes();
		this.specialty = bean.getSpecialty() == null ? null : ims.core.vo.lookups.Specialty.buildLookup(bean.getSpecialty());
		this.basisofdiagnosis = ims.core.vo.lookups.DiagnosisBasisofDiagnosisCollection.buildFromBeanCollection(bean.getBasisofDiagnosis());
		this.excludefromothers = bean.getExcludefromOthers();
		this.diagconfirmedstatus = bean.getDiagConfirmedStatus() == null ? null : ims.core.vo.lookups.ConfirmedStatus.buildLookup(bean.getDiagConfirmedStatus());
		this.diagconfirmedby = bean.getDiagConfirmedBy() == null ? null : bean.getDiagConfirmedBy().buildVo(map);
		this.diagconfirmeddatetime = bean.getDiagConfirmedDateTime() == null ? null : bean.getDiagConfirmedDateTime().buildDateTime();
		this.statushistory = ims.clinical.vo.PatientDiagnosisStatusVoCollection.buildFromBeanCollection(bean.getStatusHistory());
		// Interface field type not supported.
	}
	public ims.vo.ValueObjectBean getBean()
	{
		return this.getBean(new ims.vo.ValueObjectBeanMap());
	}
	public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
	{
		ims.core.vo.beans.PatientDiagnosisVoBean bean = null;
		if(map != null)
			bean = (ims.core.vo.beans.PatientDiagnosisVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.core.vo.beans.PatientDiagnosisVoBean();
			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("SITE"))
			return getSite();
		if(fieldName.equals("DIAGNOSEDBY"))
			return getDiagnosedBy();
		if(fieldName.equals("ISRESOLVED"))
			return getIsResolved();
		if(fieldName.equals("INFORMEDOFDIAGNOSIS"))
			return getInformedOfDiagnosis();
		if(fieldName.equals("NOTES"))
			return getNotes();
		if(fieldName.equals("SPECIALTY"))
			return getSpecialty();
		if(fieldName.equals("BASISOFDIAGNOSIS"))
			return getBasisofDiagnosis();
		if(fieldName.equals("EXCLUDEFROMOTHERS"))
			return getExcludefromOthers();
		if(fieldName.equals("DIAGCONFIRMEDSTATUS"))
			return getDiagConfirmedStatus();
		if(fieldName.equals("DIAGCONFIRMEDBY"))
			return getDiagConfirmedBy();
		if(fieldName.equals("DIAGCONFIRMEDDATETIME"))
			return getDiagConfirmedDateTime();
		if(fieldName.equals("STATUSHISTORY"))
			return getStatusHistory();
		if(fieldName.equals("RESOLVEDHCP"))
			return getResolvedHCP();
		return super.getFieldValueByFieldName(fieldName);
	}
	public boolean getSiteIsNotNull()
	{
		return this.site != null;
	}
	public ims.clinical.vo.lookups.Site getSite()
	{
		return this.site;
	}
	public void setSite(ims.clinical.vo.lookups.Site value)
	{
		this.isValidated = false;
		this.site = value;
	}
	public boolean getDiagnosedByIsNotNull()
	{
		return this.diagnosedby != null;
	}
	public ims.core.vo.Hcp getDiagnosedBy()
	{
		return this.diagnosedby;
	}
	public void setDiagnosedBy(ims.core.vo.Hcp value)
	{
		this.isValidated = false;
		this.diagnosedby = value;
	}
	public boolean getIsResolvedIsNotNull()
	{
		return this.isresolved != null;
	}
	public Boolean getIsResolved()
	{
		return this.isresolved;
	}
	public void setIsResolved(Boolean value)
	{
		this.isValidated = false;
		this.isresolved = value;
	}
	public boolean getInformedOfDiagnosisIsNotNull()
	{
		return this.informedofdiagnosis != null;
	}
	public ims.core.vo.lookups.DiagnosisInformedOfDiagnosisCollection getInformedOfDiagnosis()
	{
		return this.informedofdiagnosis;
	}
	public void setInformedOfDiagnosis(ims.core.vo.lookups.DiagnosisInformedOfDiagnosisCollection value)
	{
		this.isValidated = false;
		this.informedofdiagnosis = value;
	}
	public boolean getNotesIsNotNull()
	{
		return this.notes != null;
	}
	public String getNotes()
	{
		return this.notes;
	}
	public static int getNotesMaxLength()
	{
		return 500;
	}
	public void setNotes(String value)
	{
		this.isValidated = false;
		this.notes = value;
	}
	public boolean getSpecialtyIsNotNull()
	{
		return this.specialty != null;
	}
	public ims.core.vo.lookups.Specialty getSpecialty()
	{
		return this.specialty;
	}
	public void setSpecialty(ims.core.vo.lookups.Specialty value)
	{
		this.isValidated = false;
		this.specialty = value;
	}
	public boolean getBasisofDiagnosisIsNotNull()
	{
		return this.basisofdiagnosis != null;
	}
	public ims.core.vo.lookups.DiagnosisBasisofDiagnosisCollection getBasisofDiagnosis()
	{
		return this.basisofdiagnosis;
	}
	public void setBasisofDiagnosis(ims.core.vo.lookups.DiagnosisBasisofDiagnosisCollection value)
	{
		this.isValidated = false;
		this.basisofdiagnosis = value;
	}
	public boolean getExcludefromOthersIsNotNull()
	{
		return this.excludefromothers != null;
	}
	public Boolean getExcludefromOthers()
	{
		return this.excludefromothers;
	}
	public void setExcludefromOthers(Boolean value)
	{
		this.isValidated = false;
		this.excludefromothers = value;
	}
	public boolean getDiagConfirmedStatusIsNotNull()
	{
		return this.diagconfirmedstatus != null;
	}
	public ims.core.vo.lookups.ConfirmedStatus getDiagConfirmedStatus()
	{
		return this.diagconfirmedstatus;
	}
	public void setDiagConfirmedStatus(ims.core.vo.lookups.ConfirmedStatus value)
	{
		this.isValidated = false;
		this.diagconfirmedstatus = value;
	}
	public boolean getDiagConfirmedByIsNotNull()
	{
		return this.diagconfirmedby != null;
	}
	public ims.core.vo.Hcp getDiagConfirmedBy()
	{
		return this.diagconfirmedby;
	}
	public void setDiagConfirmedBy(ims.core.vo.Hcp value)
	{
		this.isValidated = false;
		this.diagconfirmedby = value;
	}
	public boolean getDiagConfirmedDateTimeIsNotNull()
	{
		return this.diagconfirmeddatetime != null;
	}
	public ims.framework.utils.DateTime getDiagConfirmedDateTime()
	{
		return this.diagconfirmeddatetime;
	}
	public void setDiagConfirmedDateTime(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.diagconfirmeddatetime = value;
	}
	public boolean getStatusHistoryIsNotNull()
	{
		return this.statushistory != null;
	}
	public ims.clinical.vo.PatientDiagnosisStatusVoCollection getStatusHistory()
	{
		return this.statushistory;
	}
	public void setStatusHistory(ims.clinical.vo.PatientDiagnosisStatusVoCollection value)
	{
		this.isValidated = false;
		this.statushistory = value;
	}
	public boolean getResolvedHCPIsNotNull()
	{
		return this.resolvedhcp != null;
	}
	public ims.vo.interfaces.IMos getResolvedHCP()
	{
		return this.resolvedhcp;
	}
	public void setResolvedHCP(ims.vo.interfaces.IMos value)
	{
		this.isValidated = false;
		this.resolvedhcp = (ims.core.vo.HcpLiteVo)value;
	}
	/**
	* IClinicalCoding methods
	*/
	public ims.vo.ValueObject getIClinicalCodingValue() 
	{
		return this.diagnosis;
	}
	public void setIClinicalCodingValue(ims.vo.ValueObject vo) 
	{
		this.diagnosis = (ims.core.vo.DiagLiteVo)vo;		
	}
	public String getIClinicalCodingValueDescription() 
	{
		return this.diagnosisdescription;
	}
	public void setIClinicalCodingValueDescription(String value) 
	{
		this.diagnosisdescription = value;
	}
	public boolean isValidated()
	{
		if(this.isBusy)
			return true;
		this.isBusy = true;
	
		if(!this.isValidated)
		{
			this.isBusy = false;
			return false;
		}
		if(this.currentstatus != null)
		{
			if(!this.currentstatus.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.diagnosis != null)
		{
			if(!this.diagnosis.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.authoringinfo != null)
		{
			if(!this.authoringinfo.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.primaryforcarespells != null)
		{
			if(!this.primaryforcarespells.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.diagnosedby != null)
		{
			if(!this.diagnosedby.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.diagconfirmedby != null)
		{
			if(!this.diagconfirmedby.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.statushistory != null)
		{
			if(!this.statushistory.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.diagnosisdescription == null || this.diagnosisdescription.length() == 0)
			listOfErrors.add("DiagnosisDescription is mandatory");
		else if(this.diagnosisdescription.length() > 255)
			listOfErrors.add("The length of the field [diagnosisdescription] in the value object [ims.core.vo.PatientDiagnosisVo] is too big. It should be less or equal to 255");
		if(this.currentstatus != null)
		{
			String[] listOfOtherErrors = this.currentstatus.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.sourceofinformation == null)
			listOfErrors.add("SourceofInformation is mandatory");
		if(this.diagnosis != null)
		{
			String[] listOfOtherErrors = this.diagnosis.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.episodeofcare == null)
			listOfErrors.add("EpisodeOfCare is mandatory");
		if(this.sitetext != null)
			if(this.sitetext.length() > 255)
				listOfErrors.add("The length of the field [sitetext] in the value object [ims.core.vo.PatientDiagnosisVo] is too big. It should be less or equal to 255");
		if(this.authoringinfo == null)
			listOfErrors.add("Authoring HCP and Date/Time are mandatory ");
		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.primaryforcarespells != null)
		{
			String[] listOfOtherErrors = this.primaryforcarespells.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.diagnosedby != null)
		{
			String[] listOfOtherErrors = this.diagnosedby.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.notes != null)
			if(this.notes.length() > 500)
				listOfErrors.add("The length of the field [notes] in the value object [ims.core.vo.PatientDiagnosisVo] is too big. It should be less or equal to 500");
		if(this.diagconfirmedby != null)
		{
			String[] listOfOtherErrors = this.diagconfirmedby.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.statushistory != null)
		{
			String[] listOfOtherErrors = this.statushistory.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;
	
		PatientDiagnosisVo clone = new PatientDiagnosisVo(this.id, this.version);
		
		clone.diagnosisdescription = this.diagnosisdescription;
		if(this.diagnoseddate == null)
			clone.diagnoseddate = null;
		else
			clone.diagnoseddate = (ims.framework.utils.PartialDate)this.diagnoseddate.clone();
		if(this.currentstatus == null)
			clone.currentstatus = null;
		else
			clone.currentstatus = (ims.clinical.vo.PatientDiagnosisStatusVo)this.currentstatus.clone();
		if(this.sourceofinformation == null)
			clone.sourceofinformation = null;
		else
			clone.sourceofinformation = (ims.core.vo.lookups.SourceofInformation)this.sourceofinformation.clone();
		if(this.diagnosis == null)
			clone.diagnosis = null;
		else
			clone.diagnosis = (ims.core.vo.DiagLiteVo)this.diagnosis.clone();
		if(this.carecontext == null)
			clone.carecontext = null;
		else
			clone.carecontext = (ims.core.vo.CareContextLiteVo)this.carecontext.clone();
		clone.iscomorbidity = this.iscomorbidity;
		clone.episodeofcare = this.episodeofcare;
		clone.diagnosedonadmission = this.diagnosedonadmission;
		clone.iscomplication = this.iscomplication;
		if(this.dateresolved == null)
			clone.dateresolved = null;
		else
			clone.dateresolved = (ims.framework.utils.Date)this.dateresolved.clone();
		if(this.sysinfo == null)
			clone.sysinfo = null;
		else
			clone.sysinfo = (ims.vo.SystemInformation)this.sysinfo.clone();
		if(this.dateonset == null)
			clone.dateonset = null;
		else
			clone.dateonset = (ims.framework.utils.Date)this.dateonset.clone();
		if(this.clinicalcontact == null)
			clone.clinicalcontact = null;
		else
			clone.clinicalcontact = (ims.core.vo.ClinicalContactShortVo)this.clinicalcontact.clone();
		if(this.diaglaterality == null)
			clone.diaglaterality = null;
		else
			clone.diaglaterality = (ims.core.vo.lookups.LateralityLRB)this.diaglaterality.clone();
		clone.sitetext = this.sitetext;
		clone.ispmh = this.ispmh;
		clone.iscancerdiagnosis = this.iscancerdiagnosis;
		if(this.authoringinfo == null)
			clone.authoringinfo = null;
		else
			clone.authoringinfo = (ims.core.vo.AuthoringInformationVo)this.authoringinfo.clone();
		if(this.primaryforcarespells == null)
			clone.primaryforcarespells = null;
		else
			clone.primaryforcarespells = (ims.core.vo.CSPrimaryDiagnosisVoCollection)this.primaryforcarespells.clone();
		if(this.site == null)
			clone.site = null;
		else
			clone.site = (ims.clinical.vo.lookups.Site)this.site.clone();
		if(this.diagnosedby == null)
			clone.diagnosedby = null;
		else
			clone.diagnosedby = (ims.core.vo.Hcp)this.diagnosedby.clone();
		clone.isresolved = this.isresolved;
		if(this.informedofdiagnosis == null)
			clone.informedofdiagnosis = null;
		else
			clone.informedofdiagnosis = (ims.core.vo.lookups.DiagnosisInformedOfDiagnosisCollection)this.informedofdiagnosis.clone();
		clone.notes = this.notes;
		if(this.specialty == null)
			clone.specialty = null;
		else
			clone.specialty = (ims.core.vo.lookups.Specialty)this.specialty.clone();
		if(this.basisofdiagnosis == null)
			clone.basisofdiagnosis = null;
		else
			clone.basisofdiagnosis = (ims.core.vo.lookups.DiagnosisBasisofDiagnosisCollection)this.basisofdiagnosis.clone();
		clone.excludefromothers = this.excludefromothers;
		if(this.diagconfirmedstatus == null)
			clone.diagconfirmedstatus = null;
		else
			clone.diagconfirmedstatus = (ims.core.vo.lookups.ConfirmedStatus)this.diagconfirmedstatus.clone();
		if(this.diagconfirmedby == null)
			clone.diagconfirmedby = null;
		else
			clone.diagconfirmedby = (ims.core.vo.Hcp)this.diagconfirmedby.clone();
		if(this.diagconfirmeddatetime == null)
			clone.diagconfirmeddatetime = null;
		else
			clone.diagconfirmeddatetime = (ims.framework.utils.DateTime)this.diagconfirmeddatetime.clone();
		if(this.statushistory == null)
			clone.statushistory = null;
		else
			clone.statushistory = (ims.clinical.vo.PatientDiagnosisStatusVoCollection)this.statushistory.clone();
		clone.resolvedhcp = this.resolvedhcp;
		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 (!(PatientDiagnosisVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A PatientDiagnosisVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		PatientDiagnosisVo compareObj = (PatientDiagnosisVo)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.site != null)
			count++;
		if(this.diagnosedby != null)
			count++;
		if(this.isresolved != null)
			count++;
		if(this.informedofdiagnosis != null)
			count++;
		if(this.notes != null)
			count++;
		if(this.specialty != null)
			count++;
		if(this.basisofdiagnosis != null)
			count++;
		if(this.excludefromothers != null)
			count++;
		if(this.diagconfirmedstatus != null)
			count++;
		if(this.diagconfirmedby != null)
			count++;
		if(this.diagconfirmeddatetime != null)
			count++;
		if(this.statushistory != null)
			count++;
		if(this.resolvedhcp != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return super.countValueObjectFields() + 13;
	}
	protected ims.clinical.vo.lookups.Site site;
	protected ims.core.vo.Hcp diagnosedby;
	protected Boolean isresolved;
	protected ims.core.vo.lookups.DiagnosisInformedOfDiagnosisCollection informedofdiagnosis;
	protected String notes;
	protected ims.core.vo.lookups.Specialty specialty;
	protected ims.core.vo.lookups.DiagnosisBasisofDiagnosisCollection basisofdiagnosis;
	protected Boolean excludefromothers;
	protected ims.core.vo.lookups.ConfirmedStatus diagconfirmedstatus;
	protected ims.core.vo.Hcp diagconfirmedby;
	protected ims.framework.utils.DateTime diagconfirmeddatetime;
	protected ims.clinical.vo.PatientDiagnosisStatusVoCollection statushistory;
	protected ims.core.vo.HcpLiteVo resolvedhcp;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
