/FileExtraction/Java_unseen/IMS-MAXIMS_openMAXIMS/Source Library/openmaxims_workspace/ValueObjects/src/ims/core/vo/PatientProcedureWebServiceVo.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.PatientProcedure business object (ID: 1003100017).
 */
public class PatientProcedureWebServiceVo extends ims.core.vo.PatientProcedureWebServiceListVo implements ims.vo.ImsCloneable, Comparable
{
	private static final long serialVersionUID = 1L;

	public PatientProcedureWebServiceVo()
	{
	}
	public PatientProcedureWebServiceVo(Integer id, int version)
	{
		super(id, version);
	}
	public PatientProcedureWebServiceVo(ims.core.vo.beans.PatientProcedureWebServiceVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.procedure = bean.getProcedure() == null ? null : bean.getProcedure().buildVo();
		this.proceduredescription = bean.getProcedureDescription();
		this.procedurestatus = bean.getProcedureStatus() == null ? null : ims.core.vo.lookups.PatientProcedureStatus.buildLookup(bean.getProcedureStatus());
		this.dateplanned = bean.getDatePlanned() == null ? null : bean.getDatePlanned().buildPartialDate();
		this.procedureurgency = bean.getProcedureUrgency() == null ? null : ims.core.vo.lookups.ProcedureUrgency.buildLookup(bean.getProcedureUrgency());
		this.sitetext = bean.getSiteText();
		this.procedureoutcome = bean.getProcedureOutcome() == null ? null : ims.clinical.vo.lookups.PatientProcedureOutcome.buildLookup(bean.getProcedureOutcome());
		this.peformedby = bean.getPeformedBy() == null ? null : bean.getPeformedBy().buildVo();
		this.surgeonsgrade = bean.getSurgeonsGrade() == null ? null : ims.core.vo.lookups.MedicGrade.buildLookup(bean.getSurgeonsGrade());
		this.location = bean.getLocation();
		this.specialty = bean.getSpecialty() == null ? null : ims.core.vo.lookups.Specialty.buildLookup(bean.getSpecialty());
		this.infosource = bean.getInfoSource() == null ? null : ims.core.vo.lookups.SourceofInformation.buildLookup(bean.getInfoSource());
		this.confirmedstatus = bean.getConfirmedStatus() == null ? null : ims.core.vo.lookups.ConfirmedStatus.buildLookup(bean.getConfirmedStatus());
		this.confirmedby = bean.getConfirmedBy() == null ? null : bean.getConfirmedBy().buildVo();
		this.confirmeddatetime = bean.getConfirmedDateTime() == null ? null : bean.getConfirmedDateTime().buildDateTime();
		this.authoringinformation = bean.getAuthoringInformation() == null ? null : bean.getAuthoringInformation().buildVo();
		this.procsite = bean.getProcSite() == null ? null : ims.core.vo.lookups.MedicalHistoryProcedureSite.buildLookup(bean.getProcSite());
		this.proclaterality = bean.getProcLaterality() == null ? null : ims.core.vo.lookups.LateralityLRB.buildLookup(bean.getProcLaterality());
		this.procdate = bean.getProcDate() == null ? null : bean.getProcDate().buildPartialDate();
		this.proctime = bean.getProcTime() == null ? null : bean.getProcTime().buildTime();
		this.cancelleddate = bean.getCancelledDate() == null ? null : bean.getCancelledDate().buildDate();
		this.cancelledreason = bean.getCancelledReason();
		this.notes = bean.getNotes();
		this.hcppresent = ims.core.vo.HcpLiteVoCollection.buildFromBeanCollection(bean.getHCPPresent());
		this.procenddate = bean.getProcEndDate() == null ? null : bean.getProcEndDate().buildPartialDate();
		this.procendtime = bean.getProcEndTime() == null ? null : bean.getProcEndTime().buildTime();
		this.procedureintent = bean.getProcedureIntent() == null ? null : ims.core.vo.lookups.ProcedureIntent.buildLookup(bean.getProcedureIntent());
		this.uniquelinerefno = bean.getUniqueLineRefNo();
		this.plannedproc = bean.getPlannedProc() == null ? null : new ims.core.clinical.vo.PatientProcedureRefVo(new Integer(bean.getPlannedProc().getId()), bean.getPlannedProc().getVersion());
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.core.vo.beans.PatientProcedureWebServiceVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.procedure = bean.getProcedure() == null ? null : bean.getProcedure().buildVo(map);
		this.proceduredescription = bean.getProcedureDescription();
		this.procedurestatus = bean.getProcedureStatus() == null ? null : ims.core.vo.lookups.PatientProcedureStatus.buildLookup(bean.getProcedureStatus());
		this.dateplanned = bean.getDatePlanned() == null ? null : bean.getDatePlanned().buildPartialDate();
		this.procedureurgency = bean.getProcedureUrgency() == null ? null : ims.core.vo.lookups.ProcedureUrgency.buildLookup(bean.getProcedureUrgency());
		this.sitetext = bean.getSiteText();
		this.procedureoutcome = bean.getProcedureOutcome() == null ? null : ims.clinical.vo.lookups.PatientProcedureOutcome.buildLookup(bean.getProcedureOutcome());
		this.peformedby = bean.getPeformedBy() == null ? null : bean.getPeformedBy().buildVo(map);
		this.surgeonsgrade = bean.getSurgeonsGrade() == null ? null : ims.core.vo.lookups.MedicGrade.buildLookup(bean.getSurgeonsGrade());
		this.location = bean.getLocation();
		this.specialty = bean.getSpecialty() == null ? null : ims.core.vo.lookups.Specialty.buildLookup(bean.getSpecialty());
		this.infosource = bean.getInfoSource() == null ? null : ims.core.vo.lookups.SourceofInformation.buildLookup(bean.getInfoSource());
		this.confirmedstatus = bean.getConfirmedStatus() == null ? null : ims.core.vo.lookups.ConfirmedStatus.buildLookup(bean.getConfirmedStatus());
		this.confirmedby = bean.getConfirmedBy() == null ? null : bean.getConfirmedBy().buildVo(map);
		this.confirmeddatetime = bean.getConfirmedDateTime() == null ? null : bean.getConfirmedDateTime().buildDateTime();
		this.authoringinformation = bean.getAuthoringInformation() == null ? null : bean.getAuthoringInformation().buildVo(map);
		this.procsite = bean.getProcSite() == null ? null : ims.core.vo.lookups.MedicalHistoryProcedureSite.buildLookup(bean.getProcSite());
		this.proclaterality = bean.getProcLaterality() == null ? null : ims.core.vo.lookups.LateralityLRB.buildLookup(bean.getProcLaterality());
		this.procdate = bean.getProcDate() == null ? null : bean.getProcDate().buildPartialDate();
		this.proctime = bean.getProcTime() == null ? null : bean.getProcTime().buildTime();
		this.cancelleddate = bean.getCancelledDate() == null ? null : bean.getCancelledDate().buildDate();
		this.cancelledreason = bean.getCancelledReason();
		this.notes = bean.getNotes();
		this.hcppresent = ims.core.vo.HcpLiteVoCollection.buildFromBeanCollection(bean.getHCPPresent());
		this.procenddate = bean.getProcEndDate() == null ? null : bean.getProcEndDate().buildPartialDate();
		this.procendtime = bean.getProcEndTime() == null ? null : bean.getProcEndTime().buildTime();
		this.procedureintent = bean.getProcedureIntent() == null ? null : ims.core.vo.lookups.ProcedureIntent.buildLookup(bean.getProcedureIntent());
		this.uniquelinerefno = bean.getUniqueLineRefNo();
		this.plannedproc = bean.getPlannedProc() == null ? null : new ims.core.clinical.vo.PatientProcedureRefVo(new Integer(bean.getPlannedProc().getId()), bean.getPlannedProc().getVersion());
	}
	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.PatientProcedureWebServiceVoBean bean = null;
		if(map != null)
			bean = (ims.core.vo.beans.PatientProcedureWebServiceVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.core.vo.beans.PatientProcedureWebServiceVoBean();
			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("SITETEXT"))
			return getSiteText();
		if(fieldName.equals("PROCEDUREOUTCOME"))
			return getProcedureOutcome();
		if(fieldName.equals("PEFORMEDBY"))
			return getPeformedBy();
		if(fieldName.equals("SURGEONSGRADE"))
			return getSurgeonsGrade();
		if(fieldName.equals("LOCATION"))
			return getLocation();
		if(fieldName.equals("SPECIALTY"))
			return getSpecialty();
		if(fieldName.equals("INFOSOURCE"))
			return getInfoSource();
		if(fieldName.equals("CONFIRMEDSTATUS"))
			return getConfirmedStatus();
		if(fieldName.equals("CONFIRMEDBY"))
			return getConfirmedBy();
		if(fieldName.equals("CONFIRMEDDATETIME"))
			return getConfirmedDateTime();
		if(fieldName.equals("AUTHORINGINFORMATION"))
			return getAuthoringInformation();
		if(fieldName.equals("PROCSITE"))
			return getProcSite();
		if(fieldName.equals("PROCLATERALITY"))
			return getProcLaterality();
		if(fieldName.equals("PROCDATE"))
			return getProcDate();
		if(fieldName.equals("PROCTIME"))
			return getProcTime();
		if(fieldName.equals("CANCELLEDDATE"))
			return getCancelledDate();
		if(fieldName.equals("CANCELLEDREASON"))
			return getCancelledReason();
		if(fieldName.equals("NOTES"))
			return getNotes();
		if(fieldName.equals("HCPPRESENT"))
			return getHCPPresent();
		if(fieldName.equals("PROCENDDATE"))
			return getProcEndDate();
		if(fieldName.equals("PROCENDTIME"))
			return getProcEndTime();
		if(fieldName.equals("PROCEDUREINTENT"))
			return getProcedureIntent();
		if(fieldName.equals("UNIQUELINEREFNO"))
			return getUniqueLineRefNo();
		if(fieldName.equals("PLANNEDPROC"))
			return getPlannedProc();
		return super.getFieldValueByFieldName(fieldName);
	}
	public boolean getSiteTextIsNotNull()
	{
		return this.sitetext != null;
	}
	public String getSiteText()
	{
		return this.sitetext;
	}
	public static int getSiteTextMaxLength()
	{
		return 255;
	}
	public void setSiteText(String value)
	{
		this.isValidated = false;
		this.sitetext = value;
	}
	public boolean getProcedureOutcomeIsNotNull()
	{
		return this.procedureoutcome != null;
	}
	public ims.clinical.vo.lookups.PatientProcedureOutcome getProcedureOutcome()
	{
		return this.procedureoutcome;
	}
	public void setProcedureOutcome(ims.clinical.vo.lookups.PatientProcedureOutcome value)
	{
		this.isValidated = false;
		this.procedureoutcome = value;
	}
	public boolean getPeformedByIsNotNull()
	{
		return this.peformedby != null;
	}
	public ims.core.vo.HcpLiteVo getPeformedBy()
	{
		return this.peformedby;
	}
	public void setPeformedBy(ims.core.vo.HcpLiteVo value)
	{
		this.isValidated = false;
		this.peformedby = value;
	}
	public boolean getSurgeonsGradeIsNotNull()
	{
		return this.surgeonsgrade != null;
	}
	public ims.core.vo.lookups.MedicGrade getSurgeonsGrade()
	{
		return this.surgeonsgrade;
	}
	public void setSurgeonsGrade(ims.core.vo.lookups.MedicGrade value)
	{
		this.isValidated = false;
		this.surgeonsgrade = value;
	}
	public boolean getLocationIsNotNull()
	{
		return this.location != null;
	}
	public String getLocation()
	{
		return this.location;
	}
	public static int getLocationMaxLength()
	{
		return 255;
	}
	public void setLocation(String value)
	{
		this.isValidated = false;
		this.location = 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 getInfoSourceIsNotNull()
	{
		return this.infosource != null;
	}
	public ims.core.vo.lookups.SourceofInformation getInfoSource()
	{
		return this.infosource;
	}
	public void setInfoSource(ims.core.vo.lookups.SourceofInformation value)
	{
		this.isValidated = false;
		this.infosource = value;
	}
	public boolean getConfirmedStatusIsNotNull()
	{
		return this.confirmedstatus != null;
	}
	public ims.core.vo.lookups.ConfirmedStatus getConfirmedStatus()
	{
		return this.confirmedstatus;
	}
	public void setConfirmedStatus(ims.core.vo.lookups.ConfirmedStatus value)
	{
		this.isValidated = false;
		this.confirmedstatus = value;
	}
	public boolean getConfirmedByIsNotNull()
	{
		return this.confirmedby != null;
	}
	public ims.core.vo.HcpLiteVo getConfirmedBy()
	{
		return this.confirmedby;
	}
	public void setConfirmedBy(ims.core.vo.HcpLiteVo value)
	{
		this.isValidated = false;
		this.confirmedby = value;
	}
	public boolean getConfirmedDateTimeIsNotNull()
	{
		return this.confirmeddatetime != null;
	}
	public ims.framework.utils.DateTime getConfirmedDateTime()
	{
		return this.confirmeddatetime;
	}
	public void setConfirmedDateTime(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.confirmeddatetime = 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 getProcSiteIsNotNull()
	{
		return this.procsite != null;
	}
	public ims.core.vo.lookups.MedicalHistoryProcedureSite getProcSite()
	{
		return this.procsite;
	}
	public void setProcSite(ims.core.vo.lookups.MedicalHistoryProcedureSite value)
	{
		this.isValidated = false;
		this.procsite = value;
	}
	public boolean getProcLateralityIsNotNull()
	{
		return this.proclaterality != null;
	}
	public ims.core.vo.lookups.LateralityLRB getProcLaterality()
	{
		return this.proclaterality;
	}
	public void setProcLaterality(ims.core.vo.lookups.LateralityLRB value)
	{
		this.isValidated = false;
		this.proclaterality = value;
	}
	public boolean getProcDateIsNotNull()
	{
		return this.procdate != null;
	}
	public ims.framework.utils.PartialDate getProcDate()
	{
		return this.procdate;
	}
	public void setProcDate(ims.framework.utils.PartialDate value)
	{
		this.isValidated = false;
		this.procdate = value;
	}
	public boolean getProcTimeIsNotNull()
	{
		return this.proctime != null;
	}
	public ims.framework.utils.Time getProcTime()
	{
		return this.proctime;
	}
	public void setProcTime(ims.framework.utils.Time value)
	{
		this.isValidated = false;
		this.proctime = value;
	}
	public boolean getCancelledDateIsNotNull()
	{
		return this.cancelleddate != null;
	}
	public ims.framework.utils.Date getCancelledDate()
	{
		return this.cancelleddate;
	}
	public void setCancelledDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.cancelleddate = value;
	}
	public boolean getCancelledReasonIsNotNull()
	{
		return this.cancelledreason != null;
	}
	public String getCancelledReason()
	{
		return this.cancelledreason;
	}
	public static int getCancelledReasonMaxLength()
	{
		return 255;
	}
	public void setCancelledReason(String value)
	{
		this.isValidated = false;
		this.cancelledreason = 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 getHCPPresentIsNotNull()
	{
		return this.hcppresent != null;
	}
	public ims.core.vo.HcpLiteVoCollection getHCPPresent()
	{
		return this.hcppresent;
	}
	public void setHCPPresent(ims.core.vo.HcpLiteVoCollection value)
	{
		this.isValidated = false;
		this.hcppresent = value;
	}
	public boolean getProcEndDateIsNotNull()
	{
		return this.procenddate != null;
	}
	public ims.framework.utils.PartialDate getProcEndDate()
	{
		return this.procenddate;
	}
	public void setProcEndDate(ims.framework.utils.PartialDate value)
	{
		this.isValidated = false;
		this.procenddate = value;
	}
	public boolean getProcEndTimeIsNotNull()
	{
		return this.procendtime != null;
	}
	public ims.framework.utils.Time getProcEndTime()
	{
		return this.procendtime;
	}
	public void setProcEndTime(ims.framework.utils.Time value)
	{
		this.isValidated = false;
		this.procendtime = value;
	}
	public boolean getProcedureIntentIsNotNull()
	{
		return this.procedureintent != null;
	}
	public ims.core.vo.lookups.ProcedureIntent getProcedureIntent()
	{
		return this.procedureintent;
	}
	public void setProcedureIntent(ims.core.vo.lookups.ProcedureIntent value)
	{
		this.isValidated = false;
		this.procedureintent = value;
	}
	public boolean getUniqueLineRefNoIsNotNull()
	{
		return this.uniquelinerefno != null;
	}
	public String getUniqueLineRefNo()
	{
		return this.uniquelinerefno;
	}
	public static int getUniqueLineRefNoMaxLength()
	{
		return 8;
	}
	public void setUniqueLineRefNo(String value)
	{
		this.isValidated = false;
		this.uniquelinerefno = value;
	}
	public boolean getPlannedProcIsNotNull()
	{
		return this.plannedproc != null;
	}
	public ims.core.clinical.vo.PatientProcedureRefVo getPlannedProc()
	{
		return this.plannedproc;
	}
	public void setPlannedProc(ims.core.clinical.vo.PatientProcedureRefVo value)
	{
		this.isValidated = false;
		this.plannedproc = value;
	}
	public boolean isValidated()
	{
		if(this.isBusy)
			return true;
		this.isBusy = true;
	
		if(!this.isValidated)
		{
			this.isBusy = false;
			return false;
		}
		if(this.peformedby != null)
		{
			if(!this.peformedby.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.confirmedby != null)
		{
			if(!this.confirmedby.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.authoringinformation != null)
		{
			if(!this.authoringinformation.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.proceduredescription == null || this.proceduredescription.length() == 0)
			listOfErrors.add("ProcedureDescription is mandatory");
		else if(this.proceduredescription.length() > 255)
			listOfErrors.add("The length of the field [proceduredescription] in the value object [ims.core.vo.PatientProcedureWebServiceVo] is too big. It should be less or equal to 255");
		if(this.sitetext != null)
			if(this.sitetext.length() > 255)
				listOfErrors.add("The length of the field [sitetext] in the value object [ims.core.vo.PatientProcedureWebServiceVo] is too big. It should be less or equal to 255");
		if(this.peformedby != null)
		{
			String[] listOfOtherErrors = this.peformedby.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.location != null)
			if(this.location.length() > 255)
				listOfErrors.add("The length of the field [location] in the value object [ims.core.vo.PatientProcedureWebServiceVo] is too big. It should be less or equal to 255");
		if(this.infosource == null)
			listOfErrors.add("InfoSource is mandatory");
		if(this.confirmedby != null)
		{
			String[] listOfOtherErrors = this.confirmedby.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.cancelledreason != null)
			if(this.cancelledreason.length() > 255)
				listOfErrors.add("The length of the field [cancelledreason] in the value object [ims.core.vo.PatientProcedureWebServiceVo] is too big. It should be less or equal to 255");
		if(this.notes != null)
			if(this.notes.length() > 500)
				listOfErrors.add("The length of the field [notes] in the value object [ims.core.vo.PatientProcedureWebServiceVo] is too big. It should be less or equal to 500");
		if(this.uniquelinerefno != null)
			if(this.uniquelinerefno.length() > 8)
				listOfErrors.add("The length of the field [uniquelinerefno] in the value object [ims.core.vo.PatientProcedureWebServiceVo] is too big. It should be less or equal to 8");
		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;
	
		PatientProcedureWebServiceVo clone = new PatientProcedureWebServiceVo(this.id, this.version);
		
		if(this.procedure == null)
			clone.procedure = null;
		else
			clone.procedure = (ims.core.vo.ProcedureLiteVo)this.procedure.clone();
		clone.proceduredescription = this.proceduredescription;
		if(this.procedurestatus == null)
			clone.procedurestatus = null;
		else
			clone.procedurestatus = (ims.core.vo.lookups.PatientProcedureStatus)this.procedurestatus.clone();
		if(this.dateplanned == null)
			clone.dateplanned = null;
		else
			clone.dateplanned = (ims.framework.utils.PartialDate)this.dateplanned.clone();
		if(this.procedureurgency == null)
			clone.procedureurgency = null;
		else
			clone.procedureurgency = (ims.core.vo.lookups.ProcedureUrgency)this.procedureurgency.clone();
		clone.sitetext = this.sitetext;
		if(this.procedureoutcome == null)
			clone.procedureoutcome = null;
		else
			clone.procedureoutcome = (ims.clinical.vo.lookups.PatientProcedureOutcome)this.procedureoutcome.clone();
		if(this.peformedby == null)
			clone.peformedby = null;
		else
			clone.peformedby = (ims.core.vo.HcpLiteVo)this.peformedby.clone();
		if(this.surgeonsgrade == null)
			clone.surgeonsgrade = null;
		else
			clone.surgeonsgrade = (ims.core.vo.lookups.MedicGrade)this.surgeonsgrade.clone();
		clone.location = this.location;
		if(this.specialty == null)
			clone.specialty = null;
		else
			clone.specialty = (ims.core.vo.lookups.Specialty)this.specialty.clone();
		if(this.infosource == null)
			clone.infosource = null;
		else
			clone.infosource = (ims.core.vo.lookups.SourceofInformation)this.infosource.clone();
		if(this.confirmedstatus == null)
			clone.confirmedstatus = null;
		else
			clone.confirmedstatus = (ims.core.vo.lookups.ConfirmedStatus)this.confirmedstatus.clone();
		if(this.confirmedby == null)
			clone.confirmedby = null;
		else
			clone.confirmedby = (ims.core.vo.HcpLiteVo)this.confirmedby.clone();
		if(this.confirmeddatetime == null)
			clone.confirmeddatetime = null;
		else
			clone.confirmeddatetime = (ims.framework.utils.DateTime)this.confirmeddatetime.clone();
		if(this.authoringinformation == null)
			clone.authoringinformation = null;
		else
			clone.authoringinformation = (ims.core.vo.AuthoringInformationVo)this.authoringinformation.clone();
		if(this.procsite == null)
			clone.procsite = null;
		else
			clone.procsite = (ims.core.vo.lookups.MedicalHistoryProcedureSite)this.procsite.clone();
		if(this.proclaterality == null)
			clone.proclaterality = null;
		else
			clone.proclaterality = (ims.core.vo.lookups.LateralityLRB)this.proclaterality.clone();
		if(this.procdate == null)
			clone.procdate = null;
		else
			clone.procdate = (ims.framework.utils.PartialDate)this.procdate.clone();
		if(this.proctime == null)
			clone.proctime = null;
		else
			clone.proctime = (ims.framework.utils.Time)this.proctime.clone();
		if(this.cancelleddate == null)
			clone.cancelleddate = null;
		else
			clone.cancelleddate = (ims.framework.utils.Date)this.cancelleddate.clone();
		clone.cancelledreason = this.cancelledreason;
		clone.notes = this.notes;
		if(this.hcppresent == null)
			clone.hcppresent = null;
		else
			clone.hcppresent = (ims.core.vo.HcpLiteVoCollection)this.hcppresent.clone();
		if(this.procenddate == null)
			clone.procenddate = null;
		else
			clone.procenddate = (ims.framework.utils.PartialDate)this.procenddate.clone();
		if(this.procendtime == null)
			clone.procendtime = null;
		else
			clone.procendtime = (ims.framework.utils.Time)this.procendtime.clone();
		if(this.procedureintent == null)
			clone.procedureintent = null;
		else
			clone.procedureintent = (ims.core.vo.lookups.ProcedureIntent)this.procedureintent.clone();
		clone.uniquelinerefno = this.uniquelinerefno;
		clone.plannedproc = this.plannedproc;
		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 (!(PatientProcedureWebServiceVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A PatientProcedureWebServiceVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		if (this.id == null)
			return 1;
		if (((PatientProcedureWebServiceVo)obj).getBoId() == null)
			return -1;
		return this.id.compareTo(((PatientProcedureWebServiceVo)obj).getBoId());
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = super.countFieldsWithValue();
		if(this.sitetext != null)
			count++;
		if(this.procedureoutcome != null)
			count++;
		if(this.peformedby != null)
			count++;
		if(this.surgeonsgrade != null)
			count++;
		if(this.location != null)
			count++;
		if(this.specialty != null)
			count++;
		if(this.infosource != null)
			count++;
		if(this.confirmedstatus != null)
			count++;
		if(this.confirmedby != null)
			count++;
		if(this.confirmeddatetime != null)
			count++;
		if(this.authoringinformation != null)
			count++;
		if(this.procsite != null)
			count++;
		if(this.proclaterality != null)
			count++;
		if(this.procdate != null)
			count++;
		if(this.proctime != null)
			count++;
		if(this.cancelleddate != null)
			count++;
		if(this.cancelledreason != null)
			count++;
		if(this.notes != null)
			count++;
		if(this.hcppresent != null)
			count++;
		if(this.procenddate != null)
			count++;
		if(this.procendtime != null)
			count++;
		if(this.procedureintent != null)
			count++;
		if(this.uniquelinerefno != null)
			count++;
		if(this.plannedproc != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return super.countValueObjectFields() + 24;
	}
	protected String sitetext;
	protected ims.clinical.vo.lookups.PatientProcedureOutcome procedureoutcome;
	protected ims.core.vo.HcpLiteVo peformedby;
	protected ims.core.vo.lookups.MedicGrade surgeonsgrade;
	protected String location;
	protected ims.core.vo.lookups.Specialty specialty;
	protected ims.core.vo.lookups.SourceofInformation infosource;
	protected ims.core.vo.lookups.ConfirmedStatus confirmedstatus;
	protected ims.core.vo.HcpLiteVo confirmedby;
	protected ims.framework.utils.DateTime confirmeddatetime;
	protected ims.core.vo.AuthoringInformationVo authoringinformation;
	protected ims.core.vo.lookups.MedicalHistoryProcedureSite procsite;
	protected ims.core.vo.lookups.LateralityLRB proclaterality;
	protected ims.framework.utils.PartialDate procdate;
	protected ims.framework.utils.Time proctime;
	protected ims.framework.utils.Date cancelleddate;
	protected String cancelledreason;
	protected String notes;
	protected ims.core.vo.HcpLiteVoCollection hcppresent;
	protected ims.framework.utils.PartialDate procenddate;
	protected ims.framework.utils.Time procendtime;
	protected ims.core.vo.lookups.ProcedureIntent procedureintent;
	protected String uniquelinerefno;
	protected ims.core.clinical.vo.PatientProcedureRefVo plannedproc;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
