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

	public SurgicalAuditProcedureDetailsVo()
	{
	}
	public SurgicalAuditProcedureDetailsVo(Integer id, int version)
	{
		super(id, version);
	}
	public SurgicalAuditProcedureDetailsVo(ims.clinical.vo.beans.SurgicalAuditProcedureDetailsVoBean 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.anaesthetistnotrequired = bean.getAnaesthetistNotRequired();
		this.anaesthetists = ims.core.vo.MedicLiteVoCollection.buildFromBeanCollection(bean.getAnaesthetists());
		this.anaesthetistassistnotrequired = bean.getAnaesthetistAssistNotRequired();
		this.anaesthetistassistedby = ims.core.vo.MedicLiteVoCollection.buildFromBeanCollection(bean.getAnaesthetistAssistedBy());
		this.opperformedby = ims.core.vo.MedicLiteVoCollection.buildFromBeanCollection(bean.getOpPerformedBy());
		this.consultantassistedby = ims.core.vo.MedicLiteVoCollection.buildFromBeanCollection(bean.getConsultantAssistedBy());
		this.anaestheticnurse = ims.core.vo.NurseVoCollection.buildFromBeanCollection(bean.getAnaestheticNurse());
		this.scrubnurse = ims.core.vo.NurseVoCollection.buildFromBeanCollection(bean.getScrubNurse());
		this.circulatingnurse = ims.core.vo.NurseVoCollection.buildFromBeanCollection(bean.getCirculatingNurse());
		this.other = bean.getOther();
		this.surgicalchecklistperformed = bean.getSurgicalCheckListPerformed() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getSurgicalCheckListPerformed());
		this.checklistnotperformedreason = bean.getCheckListNotPerformedReason() == null ? null : ims.clinical.vo.lookups.SurgicalCheckListNotPerformedReason.buildLookup(bean.getCheckListNotPerformedReason());
		this.locumanaestnurse = bean.getLocumAnaestNurse();
		this.locumscrubnurse = bean.getLocumScrubNurse();
		this.locumcirculatingnurse = bean.getLocumCirculatingNurse();
		this.radiographers = ims.core.vo.HcpLiteVoCollection.buildFromBeanCollection(bean.getRadiographers());
		this.anaestheticused = bean.getAnaestheticUsed() == null ? null : ims.clinical.vo.lookups.AnaestheticType.buildLookup(bean.getAnaestheticUsed());
		this.anaestheticusedcomment = bean.getAnaestheticUsedComment();
		this.enteroptheatretime = bean.getEnterOpTheatreTime() == null ? null : bean.getEnterOpTheatreTime().buildDateTime();
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.clinical.vo.beans.SurgicalAuditProcedureDetailsVoBean 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.anaesthetistnotrequired = bean.getAnaesthetistNotRequired();
		this.anaesthetists = ims.core.vo.MedicLiteVoCollection.buildFromBeanCollection(bean.getAnaesthetists());
		this.anaesthetistassistnotrequired = bean.getAnaesthetistAssistNotRequired();
		this.anaesthetistassistedby = ims.core.vo.MedicLiteVoCollection.buildFromBeanCollection(bean.getAnaesthetistAssistedBy());
		this.opperformedby = ims.core.vo.MedicLiteVoCollection.buildFromBeanCollection(bean.getOpPerformedBy());
		this.consultantassistedby = ims.core.vo.MedicLiteVoCollection.buildFromBeanCollection(bean.getConsultantAssistedBy());
		this.anaestheticnurse = ims.core.vo.NurseVoCollection.buildFromBeanCollection(bean.getAnaestheticNurse());
		this.scrubnurse = ims.core.vo.NurseVoCollection.buildFromBeanCollection(bean.getScrubNurse());
		this.circulatingnurse = ims.core.vo.NurseVoCollection.buildFromBeanCollection(bean.getCirculatingNurse());
		this.other = bean.getOther();
		this.surgicalchecklistperformed = bean.getSurgicalCheckListPerformed() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getSurgicalCheckListPerformed());
		this.checklistnotperformedreason = bean.getCheckListNotPerformedReason() == null ? null : ims.clinical.vo.lookups.SurgicalCheckListNotPerformedReason.buildLookup(bean.getCheckListNotPerformedReason());
		this.locumanaestnurse = bean.getLocumAnaestNurse();
		this.locumscrubnurse = bean.getLocumScrubNurse();
		this.locumcirculatingnurse = bean.getLocumCirculatingNurse();
		this.radiographers = ims.core.vo.HcpLiteVoCollection.buildFromBeanCollection(bean.getRadiographers());
		this.anaestheticused = bean.getAnaestheticUsed() == null ? null : ims.clinical.vo.lookups.AnaestheticType.buildLookup(bean.getAnaestheticUsed());
		this.anaestheticusedcomment = bean.getAnaestheticUsedComment();
		this.enteroptheatretime = bean.getEnterOpTheatreTime() == null ? null : bean.getEnterOpTheatreTime().buildDateTime();
	}
	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.SurgicalAuditProcedureDetailsVoBean bean = null;
		if(map != null)
			bean = (ims.clinical.vo.beans.SurgicalAuditProcedureDetailsVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.clinical.vo.beans.SurgicalAuditProcedureDetailsVoBean();
			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("ANAESTHETISTNOTREQUIRED"))
			return getAnaesthetistNotRequired();
		if(fieldName.equals("ANAESTHETISTS"))
			return getAnaesthetists();
		if(fieldName.equals("ANAESTHETISTASSISTNOTREQUIRED"))
			return getAnaesthetistAssistNotRequired();
		if(fieldName.equals("ANAESTHETISTASSISTEDBY"))
			return getAnaesthetistAssistedBy();
		if(fieldName.equals("OPPERFORMEDBY"))
			return getOpPerformedBy();
		if(fieldName.equals("CONSULTANTASSISTEDBY"))
			return getConsultantAssistedBy();
		if(fieldName.equals("ANAESTHETICNURSE"))
			return getAnaestheticNurse();
		if(fieldName.equals("SCRUBNURSE"))
			return getScrubNurse();
		if(fieldName.equals("CIRCULATINGNURSE"))
			return getCirculatingNurse();
		if(fieldName.equals("OTHER"))
			return getOther();
		if(fieldName.equals("SURGICALCHECKLISTPERFORMED"))
			return getSurgicalCheckListPerformed();
		if(fieldName.equals("CHECKLISTNOTPERFORMEDREASON"))
			return getCheckListNotPerformedReason();
		if(fieldName.equals("LOCUMANAESTNURSE"))
			return getLocumAnaestNurse();
		if(fieldName.equals("LOCUMSCRUBNURSE"))
			return getLocumScrubNurse();
		if(fieldName.equals("LOCUMCIRCULATINGNURSE"))
			return getLocumCirculatingNurse();
		if(fieldName.equals("RADIOGRAPHERS"))
			return getRadiographers();
		if(fieldName.equals("ANAESTHETICUSED"))
			return getAnaestheticUsed();
		if(fieldName.equals("ANAESTHETICUSEDCOMMENT"))
			return getAnaestheticUsedComment();
		if(fieldName.equals("ENTEROPTHEATRETIME"))
			return getEnterOpTheatreTime();
		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 getAnaesthetistNotRequiredIsNotNull()
	{
		return this.anaesthetistnotrequired != null;
	}
	public Boolean getAnaesthetistNotRequired()
	{
		return this.anaesthetistnotrequired;
	}
	public void setAnaesthetistNotRequired(Boolean value)
	{
		this.isValidated = false;
		this.anaesthetistnotrequired = value;
	}
	public boolean getAnaesthetistsIsNotNull()
	{
		return this.anaesthetists != null;
	}
	public ims.core.vo.MedicLiteVoCollection getAnaesthetists()
	{
		return this.anaesthetists;
	}
	public void setAnaesthetists(ims.core.vo.MedicLiteVoCollection value)
	{
		this.isValidated = false;
		this.anaesthetists = value;
	}
	public boolean getAnaesthetistAssistNotRequiredIsNotNull()
	{
		return this.anaesthetistassistnotrequired != null;
	}
	public Boolean getAnaesthetistAssistNotRequired()
	{
		return this.anaesthetistassistnotrequired;
	}
	public void setAnaesthetistAssistNotRequired(Boolean value)
	{
		this.isValidated = false;
		this.anaesthetistassistnotrequired = value;
	}
	public boolean getAnaesthetistAssistedByIsNotNull()
	{
		return this.anaesthetistassistedby != null;
	}
	public ims.core.vo.MedicLiteVoCollection getAnaesthetistAssistedBy()
	{
		return this.anaesthetistassistedby;
	}
	public void setAnaesthetistAssistedBy(ims.core.vo.MedicLiteVoCollection value)
	{
		this.isValidated = false;
		this.anaesthetistassistedby = value;
	}
	public boolean getOpPerformedByIsNotNull()
	{
		return this.opperformedby != null;
	}
	public ims.core.vo.MedicLiteVoCollection getOpPerformedBy()
	{
		return this.opperformedby;
	}
	public void setOpPerformedBy(ims.core.vo.MedicLiteVoCollection value)
	{
		this.isValidated = false;
		this.opperformedby = value;
	}
	public boolean getConsultantAssistedByIsNotNull()
	{
		return this.consultantassistedby != null;
	}
	public ims.core.vo.MedicLiteVoCollection getConsultantAssistedBy()
	{
		return this.consultantassistedby;
	}
	public void setConsultantAssistedBy(ims.core.vo.MedicLiteVoCollection value)
	{
		this.isValidated = false;
		this.consultantassistedby = value;
	}
	public boolean getAnaestheticNurseIsNotNull()
	{
		return this.anaestheticnurse != null;
	}
	public ims.core.vo.NurseVoCollection getAnaestheticNurse()
	{
		return this.anaestheticnurse;
	}
	public void setAnaestheticNurse(ims.core.vo.NurseVoCollection value)
	{
		this.isValidated = false;
		this.anaestheticnurse = value;
	}
	public boolean getScrubNurseIsNotNull()
	{
		return this.scrubnurse != null;
	}
	public ims.core.vo.NurseVoCollection getScrubNurse()
	{
		return this.scrubnurse;
	}
	public void setScrubNurse(ims.core.vo.NurseVoCollection value)
	{
		this.isValidated = false;
		this.scrubnurse = value;
	}
	public boolean getCirculatingNurseIsNotNull()
	{
		return this.circulatingnurse != null;
	}
	public ims.core.vo.NurseVoCollection getCirculatingNurse()
	{
		return this.circulatingnurse;
	}
	public void setCirculatingNurse(ims.core.vo.NurseVoCollection value)
	{
		this.isValidated = false;
		this.circulatingnurse = value;
	}
	public boolean getOtherIsNotNull()
	{
		return this.other != null;
	}
	public String getOther()
	{
		return this.other;
	}
	public static int getOtherMaxLength()
	{
		return 100;
	}
	public void setOther(String value)
	{
		this.isValidated = false;
		this.other = value;
	}
	public boolean getSurgicalCheckListPerformedIsNotNull()
	{
		return this.surgicalchecklistperformed != null;
	}
	public ims.core.vo.lookups.YesNo getSurgicalCheckListPerformed()
	{
		return this.surgicalchecklistperformed;
	}
	public void setSurgicalCheckListPerformed(ims.core.vo.lookups.YesNo value)
	{
		this.isValidated = false;
		this.surgicalchecklistperformed = value;
	}
	public boolean getCheckListNotPerformedReasonIsNotNull()
	{
		return this.checklistnotperformedreason != null;
	}
	public ims.clinical.vo.lookups.SurgicalCheckListNotPerformedReason getCheckListNotPerformedReason()
	{
		return this.checklistnotperformedreason;
	}
	public void setCheckListNotPerformedReason(ims.clinical.vo.lookups.SurgicalCheckListNotPerformedReason value)
	{
		this.isValidated = false;
		this.checklistnotperformedreason = value;
	}
	public boolean getLocumAnaestNurseIsNotNull()
	{
		return this.locumanaestnurse != null;
	}
	public String getLocumAnaestNurse()
	{
		return this.locumanaestnurse;
	}
	public static int getLocumAnaestNurseMaxLength()
	{
		return 200;
	}
	public void setLocumAnaestNurse(String value)
	{
		this.isValidated = false;
		this.locumanaestnurse = value;
	}
	public boolean getLocumScrubNurseIsNotNull()
	{
		return this.locumscrubnurse != null;
	}
	public String getLocumScrubNurse()
	{
		return this.locumscrubnurse;
	}
	public static int getLocumScrubNurseMaxLength()
	{
		return 200;
	}
	public void setLocumScrubNurse(String value)
	{
		this.isValidated = false;
		this.locumscrubnurse = value;
	}
	public boolean getLocumCirculatingNurseIsNotNull()
	{
		return this.locumcirculatingnurse != null;
	}
	public String getLocumCirculatingNurse()
	{
		return this.locumcirculatingnurse;
	}
	public static int getLocumCirculatingNurseMaxLength()
	{
		return 200;
	}
	public void setLocumCirculatingNurse(String value)
	{
		this.isValidated = false;
		this.locumcirculatingnurse = value;
	}
	public boolean getRadiographersIsNotNull()
	{
		return this.radiographers != null;
	}
	public ims.core.vo.HcpLiteVoCollection getRadiographers()
	{
		return this.radiographers;
	}
	public void setRadiographers(ims.core.vo.HcpLiteVoCollection value)
	{
		this.isValidated = false;
		this.radiographers = value;
	}
	public boolean getAnaestheticUsedIsNotNull()
	{
		return this.anaestheticused != null;
	}
	public ims.clinical.vo.lookups.AnaestheticType getAnaestheticUsed()
	{
		return this.anaestheticused;
	}
	public void setAnaestheticUsed(ims.clinical.vo.lookups.AnaestheticType value)
	{
		this.isValidated = false;
		this.anaestheticused = value;
	}
	public boolean getAnaestheticUsedCommentIsNotNull()
	{
		return this.anaestheticusedcomment != null;
	}
	public String getAnaestheticUsedComment()
	{
		return this.anaestheticusedcomment;
	}
	public static int getAnaestheticUsedCommentMaxLength()
	{
		return 255;
	}
	public void setAnaestheticUsedComment(String value)
	{
		this.isValidated = false;
		this.anaestheticusedcomment = value;
	}
	public boolean getEnterOpTheatreTimeIsNotNull()
	{
		return this.enteroptheatretime != null;
	}
	public ims.framework.utils.DateTime getEnterOpTheatreTime()
	{
		return this.enteroptheatretime;
	}
	public void setEnterOpTheatreTime(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.enteroptheatretime = 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.anaesthetistassistedby != null)
		{
			if(!this.anaesthetistassistedby.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.opperformedby != null)
		{
			if(!this.opperformedby.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.consultantassistedby != null)
		{
			if(!this.consultantassistedby.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.anaestheticnurse != null)
		{
			if(!this.anaestheticnurse.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.scrubnurse != null)
		{
			if(!this.scrubnurse.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.circulatingnurse != null)
		{
			if(!this.circulatingnurse.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.anaesthetistassistedby != null)
		{
			String[] listOfOtherErrors = this.anaesthetistassistedby.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.opperformedby != null)
		{
			String[] listOfOtherErrors = this.opperformedby.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.consultantassistedby != null)
		{
			String[] listOfOtherErrors = this.consultantassistedby.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.anaestheticnurse != null)
		{
			String[] listOfOtherErrors = this.anaestheticnurse.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.scrubnurse != null)
		{
			String[] listOfOtherErrors = this.scrubnurse.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.circulatingnurse != null)
		{
			String[] listOfOtherErrors = this.circulatingnurse.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.other != null)
			if(this.other.length() > 100)
				listOfErrors.add("The length of the field [other] in the value object [ims.clinical.vo.SurgicalAuditProcedureDetailsVo] is too big. It should be less or equal to 100");
		if(this.surgicalchecklistperformed == null)
			listOfErrors.add("Surgical Check List Performed is mandatory");
		if(this.locumanaestnurse != null)
			if(this.locumanaestnurse.length() > 200)
				listOfErrors.add("The length of the field [locumanaestnurse] in the value object [ims.clinical.vo.SurgicalAuditProcedureDetailsVo] is too big. It should be less or equal to 200");
		if(this.locumscrubnurse != null)
			if(this.locumscrubnurse.length() > 200)
				listOfErrors.add("The length of the field [locumscrubnurse] in the value object [ims.clinical.vo.SurgicalAuditProcedureDetailsVo] is too big. It should be less or equal to 200");
		if(this.locumcirculatingnurse != null)
			if(this.locumcirculatingnurse.length() > 200)
				listOfErrors.add("The length of the field [locumcirculatingnurse] in the value object [ims.clinical.vo.SurgicalAuditProcedureDetailsVo] is too big. It should be less or equal to 200");
		if(this.anaestheticusedcomment != null)
			if(this.anaestheticusedcomment.length() > 255)
				listOfErrors.add("The length of the field [anaestheticusedcomment] in the value object [ims.clinical.vo.SurgicalAuditProcedureDetailsVo] is too big. It should be less or equal to 255");
		if(this.enteroptheatretime == null)
			listOfErrors.add("EnterOpTheatreTime 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;
	
		SurgicalAuditProcedureDetailsVo clone = new SurgicalAuditProcedureDetailsVo(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();
		clone.anaesthetistnotrequired = this.anaesthetistnotrequired;
		if(this.anaesthetists == null)
			clone.anaesthetists = null;
		else
			clone.anaesthetists = (ims.core.vo.MedicLiteVoCollection)this.anaesthetists.clone();
		clone.anaesthetistassistnotrequired = this.anaesthetistassistnotrequired;
		if(this.anaesthetistassistedby == null)
			clone.anaesthetistassistedby = null;
		else
			clone.anaesthetistassistedby = (ims.core.vo.MedicLiteVoCollection)this.anaesthetistassistedby.clone();
		if(this.opperformedby == null)
			clone.opperformedby = null;
		else
			clone.opperformedby = (ims.core.vo.MedicLiteVoCollection)this.opperformedby.clone();
		if(this.consultantassistedby == null)
			clone.consultantassistedby = null;
		else
			clone.consultantassistedby = (ims.core.vo.MedicLiteVoCollection)this.consultantassistedby.clone();
		if(this.anaestheticnurse == null)
			clone.anaestheticnurse = null;
		else
			clone.anaestheticnurse = (ims.core.vo.NurseVoCollection)this.anaestheticnurse.clone();
		if(this.scrubnurse == null)
			clone.scrubnurse = null;
		else
			clone.scrubnurse = (ims.core.vo.NurseVoCollection)this.scrubnurse.clone();
		if(this.circulatingnurse == null)
			clone.circulatingnurse = null;
		else
			clone.circulatingnurse = (ims.core.vo.NurseVoCollection)this.circulatingnurse.clone();
		clone.other = this.other;
		if(this.surgicalchecklistperformed == null)
			clone.surgicalchecklistperformed = null;
		else
			clone.surgicalchecklistperformed = (ims.core.vo.lookups.YesNo)this.surgicalchecklistperformed.clone();
		if(this.checklistnotperformedreason == null)
			clone.checklistnotperformedreason = null;
		else
			clone.checklistnotperformedreason = (ims.clinical.vo.lookups.SurgicalCheckListNotPerformedReason)this.checklistnotperformedreason.clone();
		clone.locumanaestnurse = this.locumanaestnurse;
		clone.locumscrubnurse = this.locumscrubnurse;
		clone.locumcirculatingnurse = this.locumcirculatingnurse;
		if(this.radiographers == null)
			clone.radiographers = null;
		else
			clone.radiographers = (ims.core.vo.HcpLiteVoCollection)this.radiographers.clone();
		if(this.anaestheticused == null)
			clone.anaestheticused = null;
		else
			clone.anaestheticused = (ims.clinical.vo.lookups.AnaestheticType)this.anaestheticused.clone();
		clone.anaestheticusedcomment = this.anaestheticusedcomment;
		if(this.enteroptheatretime == null)
			clone.enteroptheatretime = null;
		else
			clone.enteroptheatretime = (ims.framework.utils.DateTime)this.enteroptheatretime.clone();
		clone.isValidated = this.isValidated;
		
		this.isBusy = false;
		return clone;
	}
	public int compareTo(Object obj)
	{
		return compareTo(obj, true);
	}
	public int compareTo(Object obj, boolean caseInsensitive)
	{
		if (obj == null)
		{
			return -1;
		}
		if(caseInsensitive); // this is to avoid eclipse warning only.
		if (!(SurgicalAuditProcedureDetailsVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A SurgicalAuditProcedureDetailsVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		if (this.id == null)
			return 1;
		if (((SurgicalAuditProcedureDetailsVo)obj).getBoId() == null)
			return -1;
		return this.id.compareTo(((SurgicalAuditProcedureDetailsVo)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.anaesthetistnotrequired != null)
			count++;
		if(this.anaesthetists != null)
			count++;
		if(this.anaesthetistassistnotrequired != null)
			count++;
		if(this.anaesthetistassistedby != null)
			count++;
		if(this.opperformedby != null)
			count++;
		if(this.consultantassistedby != null)
			count++;
		if(this.anaestheticnurse != null)
			count++;
		if(this.scrubnurse != null)
			count++;
		if(this.circulatingnurse != null)
			count++;
		if(this.other != null)
			count++;
		if(this.surgicalchecklistperformed != null)
			count++;
		if(this.checklistnotperformedreason != null)
			count++;
		if(this.locumanaestnurse != null)
			count++;
		if(this.locumscrubnurse != null)
			count++;
		if(this.locumcirculatingnurse != null)
			count++;
		if(this.radiographers != null)
			count++;
		if(this.anaestheticused != null)
			count++;
		if(this.anaestheticusedcomment != null)
			count++;
		if(this.enteroptheatretime != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return 22;
	}
	protected ims.core.patient.vo.PatientRefVo patient;
	protected ims.core.admin.vo.CareContextRefVo carecontext;
	protected ims.core.vo.AuthoringInformationVo authoringinformation;
	protected Boolean anaesthetistnotrequired;
	protected ims.core.vo.MedicLiteVoCollection anaesthetists;
	protected Boolean anaesthetistassistnotrequired;
	protected ims.core.vo.MedicLiteVoCollection anaesthetistassistedby;
	protected ims.core.vo.MedicLiteVoCollection opperformedby;
	protected ims.core.vo.MedicLiteVoCollection consultantassistedby;
	protected ims.core.vo.NurseVoCollection anaestheticnurse;
	protected ims.core.vo.NurseVoCollection scrubnurse;
	protected ims.core.vo.NurseVoCollection circulatingnurse;
	protected String other;
	protected ims.core.vo.lookups.YesNo surgicalchecklistperformed;
	protected ims.clinical.vo.lookups.SurgicalCheckListNotPerformedReason checklistnotperformedreason;
	protected String locumanaestnurse;
	protected String locumscrubnurse;
	protected String locumcirculatingnurse;
	protected ims.core.vo.HcpLiteVoCollection radiographers;
	protected ims.clinical.vo.lookups.AnaestheticType anaestheticused;
	protected String anaestheticusedcomment;
	protected ims.framework.utils.DateTime enteroptheatretime;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
