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

/**
 * Linked to clinical.SurgicalAuditPreOpChecks business object (ID: 1072100101).
 */
public class SurgicalAuditPreOpChecksVo extends ims.clinical.vo.SurgicalAuditPreOpChecksRefVo implements ims.vo.ImsCloneable, Comparable
{
	private static final long serialVersionUID = 1L;

	public SurgicalAuditPreOpChecksVo()
	{
	}
	public SurgicalAuditPreOpChecksVo(Integer id, int version)
	{
		super(id, version);
	}
	public SurgicalAuditPreOpChecksVo(ims.clinical.vo.beans.SurgicalAuditPreOpChecksVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.patient = bean.getPatient() == null ? null : new ims.core.patient.vo.PatientRefVo(new Integer(bean.getPatient().getId()), bean.getPatient().getVersion());
		this.carecontext = bean.getCareContext() == null ? null : new ims.core.admin.vo.CareContextRefVo(new Integer(bean.getCareContext().getId()), bean.getCareContext().getVersion());
		this.authoringinformation = bean.getAuthoringInformation() == null ? null : bean.getAuthoringInformation().buildVo();
		this.plannedprocedures = ims.clinical.vo.PatientProcedureForSurgicalAuditPreOpChecksVoCollection.buildFromBeanCollection(bean.getPlannedProcedures());
		this.consultant = bean.getConsultant() == null ? null : bean.getConsultant().buildVo();
		this.sentfortime = bean.getSentForTime() == null ? null : bean.getSentForTime().buildDateTime();
		this.arrivaltime = bean.getArrivalTime() == null ? null : bean.getArrivalTime().buildDateTime();
		this.leaveholdingtime = bean.getLeaveHoldingTime() == null ? null : bean.getLeaveHoldingTime().buildDateTime();
		this.accompanyingnurse = bean.getAccompanyingNurse() == null ? null : bean.getAccompanyingNurse().buildVo();
		this.transferredfrom = bean.getTransferredFrom() == null ? null : bean.getTransferredFrom().buildVo();
		this.asagrade = bean.getASAGrade() == null ? null : ims.core.vo.lookups.SurgeryASAGrade.buildLookup(bean.getASAGrade());
		this.consentreceived = bean.getConsentReceived() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getConsentReceived());
		this.consentauthby = bean.getConsentAuthBy();
		this.bmi = bean.getBMI() == null ? null : bean.getBMI().buildVo();
		this.sitemarked = bean.getSiteMarked() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getSiteMarked());
		this.actiontaken = bean.getActionTaken() == null ? null : ims.clinical.vo.lookups.SiteMarkedActionTaken.buildLookup(bean.getActionTaken());
		this.confirmpatientdetails = bean.getConfirmPatientDetails() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getConfirmPatientDetails());
		this.preopcheckdone = bean.getPreOpCheckDone() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getPreOpCheckDone());
		this.accompanyinglocumbool = bean.getAccompanyingLocumBool();
		this.accompanyinglocumnurse = bean.getAccompanyingLocumNurse();
		this.theatrenurse = bean.getTheatreNurse() == null ? null : bean.getTheatreNurse().buildVo();
		this.theatrenurselocumbool = bean.getTheatreNurseLocumBool();
		this.theatrenurselocumnurse = bean.getTheatreNurseLocumNurse();
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.clinical.vo.beans.SurgicalAuditPreOpChecksVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.patient = bean.getPatient() == null ? null : new ims.core.patient.vo.PatientRefVo(new Integer(bean.getPatient().getId()), bean.getPatient().getVersion());
		this.carecontext = bean.getCareContext() == null ? null : new ims.core.admin.vo.CareContextRefVo(new Integer(bean.getCareContext().getId()), bean.getCareContext().getVersion());
		this.authoringinformation = bean.getAuthoringInformation() == null ? null : bean.getAuthoringInformation().buildVo(map);
		this.plannedprocedures = ims.clinical.vo.PatientProcedureForSurgicalAuditPreOpChecksVoCollection.buildFromBeanCollection(bean.getPlannedProcedures());
		this.consultant = bean.getConsultant() == null ? null : bean.getConsultant().buildVo(map);
		this.sentfortime = bean.getSentForTime() == null ? null : bean.getSentForTime().buildDateTime();
		this.arrivaltime = bean.getArrivalTime() == null ? null : bean.getArrivalTime().buildDateTime();
		this.leaveholdingtime = bean.getLeaveHoldingTime() == null ? null : bean.getLeaveHoldingTime().buildDateTime();
		this.accompanyingnurse = bean.getAccompanyingNurse() == null ? null : bean.getAccompanyingNurse().buildVo(map);
		this.transferredfrom = bean.getTransferredFrom() == null ? null : bean.getTransferredFrom().buildVo(map);
		this.asagrade = bean.getASAGrade() == null ? null : ims.core.vo.lookups.SurgeryASAGrade.buildLookup(bean.getASAGrade());
		this.consentreceived = bean.getConsentReceived() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getConsentReceived());
		this.consentauthby = bean.getConsentAuthBy();
		this.bmi = bean.getBMI() == null ? null : bean.getBMI().buildVo(map);
		this.sitemarked = bean.getSiteMarked() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getSiteMarked());
		this.actiontaken = bean.getActionTaken() == null ? null : ims.clinical.vo.lookups.SiteMarkedActionTaken.buildLookup(bean.getActionTaken());
		this.confirmpatientdetails = bean.getConfirmPatientDetails() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getConfirmPatientDetails());
		this.preopcheckdone = bean.getPreOpCheckDone() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getPreOpCheckDone());
		this.accompanyinglocumbool = bean.getAccompanyingLocumBool();
		this.accompanyinglocumnurse = bean.getAccompanyingLocumNurse();
		this.theatrenurse = bean.getTheatreNurse() == null ? null : bean.getTheatreNurse().buildVo(map);
		this.theatrenurselocumbool = bean.getTheatreNurseLocumBool();
		this.theatrenurselocumnurse = bean.getTheatreNurseLocumNurse();
	}
	public ims.vo.ValueObjectBean getBean()
	{
		return this.getBean(new ims.vo.ValueObjectBeanMap());
	}
	public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
	{
		ims.clinical.vo.beans.SurgicalAuditPreOpChecksVoBean bean = null;
		if(map != null)
			bean = (ims.clinical.vo.beans.SurgicalAuditPreOpChecksVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.clinical.vo.beans.SurgicalAuditPreOpChecksVoBean();
			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("PATIENT"))
			return getPatient();
		if(fieldName.equals("CARECONTEXT"))
			return getCareContext();
		if(fieldName.equals("AUTHORINGINFORMATION"))
			return getAuthoringInformation();
		if(fieldName.equals("PLANNEDPROCEDURES"))
			return getPlannedProcedures();
		if(fieldName.equals("CONSULTANT"))
			return getConsultant();
		if(fieldName.equals("SENTFORTIME"))
			return getSentForTime();
		if(fieldName.equals("ARRIVALTIME"))
			return getArrivalTime();
		if(fieldName.equals("LEAVEHOLDINGTIME"))
			return getLeaveHoldingTime();
		if(fieldName.equals("ACCOMPANYINGNURSE"))
			return getAccompanyingNurse();
		if(fieldName.equals("TRANSFERREDFROM"))
			return getTransferredFrom();
		if(fieldName.equals("ASAGRADE"))
			return getASAGrade();
		if(fieldName.equals("CONSENTRECEIVED"))
			return getConsentReceived();
		if(fieldName.equals("CONSENTAUTHBY"))
			return getConsentAuthBy();
		if(fieldName.equals("BMI"))
			return getBMI();
		if(fieldName.equals("SITEMARKED"))
			return getSiteMarked();
		if(fieldName.equals("ACTIONTAKEN"))
			return getActionTaken();
		if(fieldName.equals("CONFIRMPATIENTDETAILS"))
			return getConfirmPatientDetails();
		if(fieldName.equals("PREOPCHECKDONE"))
			return getPreOpCheckDone();
		if(fieldName.equals("ACCOMPANYINGLOCUMBOOL"))
			return getAccompanyingLocumBool();
		if(fieldName.equals("ACCOMPANYINGLOCUMNURSE"))
			return getAccompanyingLocumNurse();
		if(fieldName.equals("THEATRENURSE"))
			return getTheatreNurse();
		if(fieldName.equals("THEATRENURSELOCUMBOOL"))
			return getTheatreNurseLocumBool();
		if(fieldName.equals("THEATRENURSELOCUMNURSE"))
			return getTheatreNurseLocumNurse();
		return super.getFieldValueByFieldName(fieldName);
	}
	public boolean getPatientIsNotNull()
	{
		return this.patient != null;
	}
	public ims.core.patient.vo.PatientRefVo getPatient()
	{
		return this.patient;
	}
	public void setPatient(ims.core.patient.vo.PatientRefVo value)
	{
		this.isValidated = false;
		this.patient = value;
	}
	public boolean getCareContextIsNotNull()
	{
		return this.carecontext != null;
	}
	public ims.core.admin.vo.CareContextRefVo getCareContext()
	{
		return this.carecontext;
	}
	public void setCareContext(ims.core.admin.vo.CareContextRefVo value)
	{
		this.isValidated = false;
		this.carecontext = 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 getPlannedProceduresIsNotNull()
	{
		return this.plannedprocedures != null;
	}
	public ims.clinical.vo.PatientProcedureForSurgicalAuditPreOpChecksVoCollection getPlannedProcedures()
	{
		return this.plannedprocedures;
	}
	public void setPlannedProcedures(ims.clinical.vo.PatientProcedureForSurgicalAuditPreOpChecksVoCollection value)
	{
		this.isValidated = false;
		this.plannedprocedures = value;
	}
	public boolean getConsultantIsNotNull()
	{
		return this.consultant != null;
	}
	public ims.core.vo.MedicVo getConsultant()
	{
		return this.consultant;
	}
	public void setConsultant(ims.core.vo.MedicVo value)
	{
		this.isValidated = false;
		this.consultant = value;
	}
	public boolean getSentForTimeIsNotNull()
	{
		return this.sentfortime != null;
	}
	public ims.framework.utils.DateTime getSentForTime()
	{
		return this.sentfortime;
	}
	public void setSentForTime(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.sentfortime = value;
	}
	public boolean getArrivalTimeIsNotNull()
	{
		return this.arrivaltime != null;
	}
	public ims.framework.utils.DateTime getArrivalTime()
	{
		return this.arrivaltime;
	}
	public void setArrivalTime(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.arrivaltime = value;
	}
	public boolean getLeaveHoldingTimeIsNotNull()
	{
		return this.leaveholdingtime != null;
	}
	public ims.framework.utils.DateTime getLeaveHoldingTime()
	{
		return this.leaveholdingtime;
	}
	public void setLeaveHoldingTime(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.leaveholdingtime = value;
	}
	public boolean getAccompanyingNurseIsNotNull()
	{
		return this.accompanyingnurse != null;
	}
	public ims.core.vo.NurseVo getAccompanyingNurse()
	{
		return this.accompanyingnurse;
	}
	public void setAccompanyingNurse(ims.core.vo.NurseVo value)
	{
		this.isValidated = false;
		this.accompanyingnurse = value;
	}
	public boolean getTransferredFromIsNotNull()
	{
		return this.transferredfrom != null;
	}
	public ims.core.vo.LocationLiteVo getTransferredFrom()
	{
		return this.transferredfrom;
	}
	public void setTransferredFrom(ims.core.vo.LocationLiteVo value)
	{
		this.isValidated = false;
		this.transferredfrom = value;
	}
	public boolean getASAGradeIsNotNull()
	{
		return this.asagrade != null;
	}
	public ims.core.vo.lookups.SurgeryASAGrade getASAGrade()
	{
		return this.asagrade;
	}
	public void setASAGrade(ims.core.vo.lookups.SurgeryASAGrade value)
	{
		this.isValidated = false;
		this.asagrade = value;
	}
	public boolean getConsentReceivedIsNotNull()
	{
		return this.consentreceived != null;
	}
	public ims.core.vo.lookups.YesNo getConsentReceived()
	{
		return this.consentreceived;
	}
	public void setConsentReceived(ims.core.vo.lookups.YesNo value)
	{
		this.isValidated = false;
		this.consentreceived = value;
	}
	public boolean getConsentAuthByIsNotNull()
	{
		return this.consentauthby != null;
	}
	public String getConsentAuthBy()
	{
		return this.consentauthby;
	}
	public static int getConsentAuthByMaxLength()
	{
		return 250;
	}
	public void setConsentAuthBy(String value)
	{
		this.isValidated = false;
		this.consentauthby = value;
	}
	public boolean getBMIIsNotNull()
	{
		return this.bmi != null;
	}
	public ims.clinical.vo.VitalSignsForSurgicalAuditPreOpChecksVo getBMI()
	{
		return this.bmi;
	}
	public void setBMI(ims.clinical.vo.VitalSignsForSurgicalAuditPreOpChecksVo value)
	{
		this.isValidated = false;
		this.bmi = value;
	}
	public boolean getSiteMarkedIsNotNull()
	{
		return this.sitemarked != null;
	}
	public ims.core.vo.lookups.YesNo getSiteMarked()
	{
		return this.sitemarked;
	}
	public void setSiteMarked(ims.core.vo.lookups.YesNo value)
	{
		this.isValidated = false;
		this.sitemarked = value;
	}
	public boolean getActionTakenIsNotNull()
	{
		return this.actiontaken != null;
	}
	public ims.clinical.vo.lookups.SiteMarkedActionTaken getActionTaken()
	{
		return this.actiontaken;
	}
	public void setActionTaken(ims.clinical.vo.lookups.SiteMarkedActionTaken value)
	{
		this.isValidated = false;
		this.actiontaken = value;
	}
	public boolean getConfirmPatientDetailsIsNotNull()
	{
		return this.confirmpatientdetails != null;
	}
	public ims.core.vo.lookups.YesNo getConfirmPatientDetails()
	{
		return this.confirmpatientdetails;
	}
	public void setConfirmPatientDetails(ims.core.vo.lookups.YesNo value)
	{
		this.isValidated = false;
		this.confirmpatientdetails = value;
	}
	public boolean getPreOpCheckDoneIsNotNull()
	{
		return this.preopcheckdone != null;
	}
	public ims.core.vo.lookups.YesNo getPreOpCheckDone()
	{
		return this.preopcheckdone;
	}
	public void setPreOpCheckDone(ims.core.vo.lookups.YesNo value)
	{
		this.isValidated = false;
		this.preopcheckdone = value;
	}
	public boolean getAccompanyingLocumBoolIsNotNull()
	{
		return this.accompanyinglocumbool != null;
	}
	public Boolean getAccompanyingLocumBool()
	{
		return this.accompanyinglocumbool;
	}
	public void setAccompanyingLocumBool(Boolean value)
	{
		this.isValidated = false;
		this.accompanyinglocumbool = value;
	}
	public boolean getAccompanyingLocumNurseIsNotNull()
	{
		return this.accompanyinglocumnurse != null;
	}
	public String getAccompanyingLocumNurse()
	{
		return this.accompanyinglocumnurse;
	}
	public static int getAccompanyingLocumNurseMaxLength()
	{
		return 100;
	}
	public void setAccompanyingLocumNurse(String value)
	{
		this.isValidated = false;
		this.accompanyinglocumnurse = value;
	}
	public boolean getTheatreNurseIsNotNull()
	{
		return this.theatrenurse != null;
	}
	public ims.core.vo.NurseVo getTheatreNurse()
	{
		return this.theatrenurse;
	}
	public void setTheatreNurse(ims.core.vo.NurseVo value)
	{
		this.isValidated = false;
		this.theatrenurse = value;
	}
	public boolean getTheatreNurseLocumBoolIsNotNull()
	{
		return this.theatrenurselocumbool != null;
	}
	public Boolean getTheatreNurseLocumBool()
	{
		return this.theatrenurselocumbool;
	}
	public void setTheatreNurseLocumBool(Boolean value)
	{
		this.isValidated = false;
		this.theatrenurselocumbool = value;
	}
	public boolean getTheatreNurseLocumNurseIsNotNull()
	{
		return this.theatrenurselocumnurse != null;
	}
	public String getTheatreNurseLocumNurse()
	{
		return this.theatrenurselocumnurse;
	}
	public static int getTheatreNurseLocumNurseMaxLength()
	{
		return 100;
	}
	public void setTheatreNurseLocumNurse(String value)
	{
		this.isValidated = false;
		this.theatrenurselocumnurse = value;
	}
	public boolean isValidated()
	{
		if(this.isBusy)
			return true;
		this.isBusy = true;
	
		if(!this.isValidated)
		{
			this.isBusy = false;
			return false;
		}
		if(this.authoringinformation != null)
		{
			if(!this.authoringinformation.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.plannedprocedures != null)
		{
			if(!this.plannedprocedures.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.bmi != null)
		{
			if(!this.bmi.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.patient == null)
			listOfErrors.add("Patient is mandatory");
		if(this.carecontext == null)
			listOfErrors.add("CareContext is mandatory");
		if(this.authoringinformation == null)
			listOfErrors.add("AuthoringInformation is mandatory");
		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.plannedprocedures == null || this.plannedprocedures.size() == 0)
			listOfErrors.add("PlannedProcedures are mandatory");
		if(this.plannedprocedures != null)
		{
			String[] listOfOtherErrors = this.plannedprocedures.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.consultant == null)
			listOfErrors.add("Consultant is mandatory");
		if(this.arrivaltime == null)
			listOfErrors.add("ArrivalTime is mandatory");
		if(this.leaveholdingtime == null)
			listOfErrors.add("LeaveHoldingTime is mandatory");
		if(this.transferredfrom == null)
			listOfErrors.add("TransferredFrom is mandatory");
		if(this.consentreceived == null)
			listOfErrors.add("ConsentReceived is mandatory");
		if(this.consentauthby != null)
			if(this.consentauthby.length() > 250)
				listOfErrors.add("The length of the field [consentauthby] in the value object [ims.clinical.vo.SurgicalAuditPreOpChecksVo] is too big. It should be less or equal to 250");
		if(this.bmi != null)
		{
			String[] listOfOtherErrors = this.bmi.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.sitemarked == null)
			listOfErrors.add("SiteMarked is mandatory");
		if(this.confirmpatientdetails == null)
			listOfErrors.add("ConfirmPatientDetails is mandatory");
		if(this.preopcheckdone == null)
			listOfErrors.add("PreOpCheckDone is mandatory");
		if(this.accompanyinglocumnurse != null)
			if(this.accompanyinglocumnurse.length() > 100)
				listOfErrors.add("The length of the field [accompanyinglocumnurse] in the value object [ims.clinical.vo.SurgicalAuditPreOpChecksVo] is too big. It should be less or equal to 100");
		if(this.theatrenurselocumnurse != null)
			if(this.theatrenurselocumnurse.length() > 100)
				listOfErrors.add("The length of the field [theatrenurselocumnurse] in the value object [ims.clinical.vo.SurgicalAuditPreOpChecksVo] is too big. It should be less or equal to 100");
		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;
	
		SurgicalAuditPreOpChecksVo clone = new SurgicalAuditPreOpChecksVo(this.id, this.version);
		
		clone.patient = this.patient;
		clone.carecontext = this.carecontext;
		if(this.authoringinformation == null)
			clone.authoringinformation = null;
		else
			clone.authoringinformation = (ims.core.vo.AuthoringInformationVo)this.authoringinformation.clone();
		if(this.plannedprocedures == null)
			clone.plannedprocedures = null;
		else
			clone.plannedprocedures = (ims.clinical.vo.PatientProcedureForSurgicalAuditPreOpChecksVoCollection)this.plannedprocedures.clone();
		if(this.consultant == null)
			clone.consultant = null;
		else
			clone.consultant = (ims.core.vo.MedicVo)this.consultant.clone();
		if(this.sentfortime == null)
			clone.sentfortime = null;
		else
			clone.sentfortime = (ims.framework.utils.DateTime)this.sentfortime.clone();
		if(this.arrivaltime == null)
			clone.arrivaltime = null;
		else
			clone.arrivaltime = (ims.framework.utils.DateTime)this.arrivaltime.clone();
		if(this.leaveholdingtime == null)
			clone.leaveholdingtime = null;
		else
			clone.leaveholdingtime = (ims.framework.utils.DateTime)this.leaveholdingtime.clone();
		if(this.accompanyingnurse == null)
			clone.accompanyingnurse = null;
		else
			clone.accompanyingnurse = (ims.core.vo.NurseVo)this.accompanyingnurse.clone();
		if(this.transferredfrom == null)
			clone.transferredfrom = null;
		else
			clone.transferredfrom = (ims.core.vo.LocationLiteVo)this.transferredfrom.clone();
		if(this.asagrade == null)
			clone.asagrade = null;
		else
			clone.asagrade = (ims.core.vo.lookups.SurgeryASAGrade)this.asagrade.clone();
		if(this.consentreceived == null)
			clone.consentreceived = null;
		else
			clone.consentreceived = (ims.core.vo.lookups.YesNo)this.consentreceived.clone();
		clone.consentauthby = this.consentauthby;
		if(this.bmi == null)
			clone.bmi = null;
		else
			clone.bmi = (ims.clinical.vo.VitalSignsForSurgicalAuditPreOpChecksVo)this.bmi.clone();
		if(this.sitemarked == null)
			clone.sitemarked = null;
		else
			clone.sitemarked = (ims.core.vo.lookups.YesNo)this.sitemarked.clone();
		if(this.actiontaken == null)
			clone.actiontaken = null;
		else
			clone.actiontaken = (ims.clinical.vo.lookups.SiteMarkedActionTaken)this.actiontaken.clone();
		if(this.confirmpatientdetails == null)
			clone.confirmpatientdetails = null;
		else
			clone.confirmpatientdetails = (ims.core.vo.lookups.YesNo)this.confirmpatientdetails.clone();
		if(this.preopcheckdone == null)
			clone.preopcheckdone = null;
		else
			clone.preopcheckdone = (ims.core.vo.lookups.YesNo)this.preopcheckdone.clone();
		clone.accompanyinglocumbool = this.accompanyinglocumbool;
		clone.accompanyinglocumnurse = this.accompanyinglocumnurse;
		if(this.theatrenurse == null)
			clone.theatrenurse = null;
		else
			clone.theatrenurse = (ims.core.vo.NurseVo)this.theatrenurse.clone();
		clone.theatrenurselocumbool = this.theatrenurselocumbool;
		clone.theatrenurselocumnurse = this.theatrenurselocumnurse;
		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 (!(SurgicalAuditPreOpChecksVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A SurgicalAuditPreOpChecksVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		if (this.id == null)
			return 1;
		if (((SurgicalAuditPreOpChecksVo)obj).getBoId() == null)
			return -1;
		return this.id.compareTo(((SurgicalAuditPreOpChecksVo)obj).getBoId());
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = 0;
		if(this.patient != null)
			count++;
		if(this.carecontext != null)
			count++;
		if(this.authoringinformation != null)
			count++;
		if(this.plannedprocedures != null)
			count++;
		if(this.consultant != null)
			count++;
		if(this.sentfortime != null)
			count++;
		if(this.arrivaltime != null)
			count++;
		if(this.leaveholdingtime != null)
			count++;
		if(this.accompanyingnurse != null)
			count++;
		if(this.transferredfrom != null)
			count++;
		if(this.asagrade != null)
			count++;
		if(this.consentreceived != null)
			count++;
		if(this.consentauthby != null)
			count++;
		if(this.bmi != null)
			count++;
		if(this.sitemarked != null)
			count++;
		if(this.actiontaken != null)
			count++;
		if(this.confirmpatientdetails != null)
			count++;
		if(this.preopcheckdone != null)
			count++;
		if(this.accompanyinglocumbool != null)
			count++;
		if(this.accompanyinglocumnurse != null)
			count++;
		if(this.theatrenurse != null)
			count++;
		if(this.theatrenurselocumbool != null)
			count++;
		if(this.theatrenurselocumnurse != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return 23;
	}
	protected ims.core.patient.vo.PatientRefVo patient;
	protected ims.core.admin.vo.CareContextRefVo carecontext;
	protected ims.core.vo.AuthoringInformationVo authoringinformation;
	protected ims.clinical.vo.PatientProcedureForSurgicalAuditPreOpChecksVoCollection plannedprocedures;
	protected ims.core.vo.MedicVo consultant;
	protected ims.framework.utils.DateTime sentfortime;
	protected ims.framework.utils.DateTime arrivaltime;
	protected ims.framework.utils.DateTime leaveholdingtime;
	protected ims.core.vo.NurseVo accompanyingnurse;
	protected ims.core.vo.LocationLiteVo transferredfrom;
	protected ims.core.vo.lookups.SurgeryASAGrade asagrade;
	protected ims.core.vo.lookups.YesNo consentreceived;
	protected String consentauthby;
	protected ims.clinical.vo.VitalSignsForSurgicalAuditPreOpChecksVo bmi;
	protected ims.core.vo.lookups.YesNo sitemarked;
	protected ims.clinical.vo.lookups.SiteMarkedActionTaken actiontaken;
	protected ims.core.vo.lookups.YesNo confirmpatientdetails;
	protected ims.core.vo.lookups.YesNo preopcheckdone;
	protected Boolean accompanyinglocumbool;
	protected String accompanyinglocumnurse;
	protected ims.core.vo.NurseVo theatrenurse;
	protected Boolean theatrenurselocumbool;
	protected String theatrenurselocumnurse;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
