gt: 				for(int x = 0; x < listOfOtherErrors.length; x++)
context: //#############################################################################
  //#                                                                           #
  //#  Copyright (C) <2014>  <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/>.    #
  //#                                                                           #
  //#############################################################################
  //#EOH
  // This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5007.25751)
  // Copyright (C) 1995-2014 IMS MAXIMS. All rights reserved.
  // WARNING: DO NOT MODIFY the content of this file
  
  package ims.scheduling.vo;
  
  /**
   * Linked to Scheduling.Booking_Appointment business object (ID: 1055100007).
   */
  public class BookingAppointmentOutcomeVo extends ims.scheduling.vo.Booking_AppointmentRefVo implements ims.vo.ImsCloneable, Comparable
  {
  	private static final long serialVersionUID = 1L;
  
  	public BookingAppointmentOutcomeVo()
  	{
  	}
  	public BookingAppointmentOutcomeVo(Integer id, int version)
  	{
  		super(id, version);
  	}
  	public BookingAppointmentOutcomeVo(ims.scheduling.vo.beans.BookingAppointmentOutcomeVoBean bean)
  	{
  		this.id = bean.getId();
  		this.version = bean.getVersion();
  		this.apptstatus = bean.getApptStatus() == null ? null : ims.scheduling.vo.lookups.Status_Reason.buildLookup(bean.getApptStatus());
  		this.outcome = bean.getOutcome() == null ? null : ims.scheduling.vo.lookups.ApptOutcome.buildLookup(bean.getOutcome());
  		this.outcomecomments = bean.getOutcomeComments();
  		this.haselectivelist = bean.getHasElectiveList();
  		this.appointmentdate = bean.getAppointmentDate() == null ? null : bean.getAppointmentDate().buildDate();
  		this.seenby = bean.getSeenBy() == null ? null : bean.getSeenBy().buildVo();
  		this.outpatientprocedures = ims.RefMan.vo.PatientProcedureForAppointmentOutcomeVoCollection.buildFromBeanCollection(bean.getOutpatientProcedures());
  		this.outpatientdiagnoses = ims.clinical.vo.PatientDiagnosisOpNotesVoCollection.buildFromBeanCollection(bean.getOutpatientDiagnoses());
  		this.session = bean.getSession() == null ? null : bean.getSession().buildVo();
  		this.outcomereason = bean.getOutcomeReason() == null ? null : ims.admin.vo.lookups.AppointmentOutcomeReason.buildLookup(bean.getOutcomeReason());
  		this.wasfirstdefinitivetreatment = bean.getWasFirstDefinitiveTreatment();
  		this.outcomeactions = ims.scheduling.vo.AppointmentOutcomeActionVoCollection.buildFromBeanCollection(bean.getOutcomeActions());
  	}
  	public void populate(ims.vo.ValueObjectBeanMap map, ims.scheduling.vo.beans.BookingAppointmentOutcomeVoBean bean)
  	{
  		this.id = bean.getId();
  		this.version = bean.getVersion();
  		this.apptstatus = bean.getApptStatus() == null ? null : ims.scheduling.vo.lookups.Status_Reason.buildLookup(bean.getApptStatus());
  		this.outcome = bean.getOutcome() == null ? null : ims.scheduling.vo.lookups.ApptOutcome.buildLookup(bean.getOutcome());
  		this.outcomecomments = bean.getOutcomeComments();
  		this.haselectivelist = bean.getHasElectiveList();
  		this.appointmentdate = bean.getAppointmentDate() == null ? null : bean.getAppointmentDate().buildDate();
  		this.seenby = bean.getSeenBy() == null ? null : bean.getSeenBy().buildVo(map);
  		this.outpatientprocedures = ims.RefMan.vo.PatientProcedureForAppointmentOutcomeVoCollection.buildFromBeanCollection(bean.getOutpatientProcedures());
  		this.outpatientdiagnoses = ims.clinical.vo.PatientDiagnosisOpNotesVoCollection.buildFromBeanCollection(bean.getOutpatientDiagnoses());
  		this.session = bean.getSession() == null ? null : bean.getSession().buildVo(map);
  		this.outcomereason = bean.getOutcomeReason() == null ? null : ims.admin.vo.lookups.AppointmentOutcomeReason.buildLookup(bean.getOutcomeReason());
  		this.wasfirstdefinitivetreatment = bean.getWasFirstDefinitiveTreatment();
  		this.outcomeactions = ims.scheduling.vo.AppointmentOutcomeActionVoCollection.buildFromBeanCollection(bean.getOutcomeActions());
  	}
  	public ims.vo.ValueObjectBean getBean()
  	{
  		return this.getBean(new ims.vo.ValueObjectBeanMap());
  	}
  	public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
  	{
  		ims.scheduling.vo.beans.BookingAppointmentOutcomeVoBean bean = null;
  		if(map != null)
  			bean = (ims.scheduling.vo.beans.BookingAppointmentOutcomeVoBean)map.getValueObjectBean(this);
  		if (bean == null)
  		{
  			bean = new ims.scheduling.vo.beans.BookingAppointmentOutcomeVoBean();
  			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("APPTSTATUS"))
  			return getApptStatus();
  		if(fieldName.equals("OUTCOME"))
  			return getOutcome();
  		if(fieldName.equals("OUTCOMECOMMENTS"))
  			return getOutcomeComments();
  		if(fieldName.equals("HASELECTIVELIST"))
  			return getHasElectiveList();
  		if(fieldName.equals("APPOINTMENTDATE"))
  			return getAppointmentDate();
  		if(fieldName.equals("SEENBY"))
  			return getSeenBy();
  		if(fieldName.equals("OUTPATIENTPROCEDURES"))
  			return getOutpatientProcedures();
  		if(fieldName.equals("OUTPATIENTDIAGNOSES"))
  			return getOutpatientDiagnoses();
  		if(fieldName.equals("SESSION"))
  			return getSession();
  		if(fieldName.equals("OUTCOMEREASON"))
  			return getOutcomeReason();
  		if(fieldName.equals("WASFIRSTDEFINITIVETREATMENT"))
  			return getWasFirstDefinitiveTreatment();
  		if(fieldName.equals("OUTCOMEACTIONS"))
  			return getOutcomeActions();
  		return super.getFieldValueByFieldName(fieldName);
  	}
  	public boolean getApptStatusIsNotNull()
  	{
  		return this.apptstatus != null;
  	}
  	public ims.scheduling.vo.lookups.Status_Reason getApptStatus()
  	{
  		return this.apptstatus;
  	}
  	public void setApptStatus(ims.scheduling.vo.lookups.Status_Reason value)
  	{
  		this.isValidated = false;
  		this.apptstatus = value;
  	}
  	public boolean getOutcomeIsNotNull()
  	{
  		return this.outcome != null;
  	}
  	public ims.scheduling.vo.lookups.ApptOutcome getOutcome()
  	{
  		return this.outcome;
  	}
  	public void setOutcome(ims.scheduling.vo.lookups.ApptOutcome value)
  	{
  		this.isValidated = false;
  		this.outcome = value;
  	}
  	public boolean getOutcomeCommentsIsNotNull()
  	{
  		return this.outcomecomments != null;
  	}
  	public String getOutcomeComments()
  	{
  		return this.outcomecomments;
  	}
  	public static int getOutcomeCommentsMaxLength()
  	{
  		return 500;
  	}
  	public void setOutcomeComments(String value)
  	{
  		this.isValidated = false;
  		this.outcomecomments = value;
  	}
  	public boolean getHasElectiveListIsNotNull()
  	{
  		return this.haselectivelist != null;
  	}
  	public Boolean getHasElectiveList()
  	{
  		return this.haselectivelist;
  	}
  	public void setHasElectiveList(Boolean value)
  	{
  		this.isValidated = false;
  		this.haselectivelist = value;
  	}
  	public boolean getAppointmentDateIsNotNull()
  	{
  		return this.appointmentdate != null;
  	}
  	public ims.framework.utils.Date getAppointmentDate()
  	{
  		return this.appointmentdate;
  	}
  	public void setAppointmentDate(ims.framework.utils.Date value)
  	{
  		this.isValidated = false;
  		this.appointmentdate = value;
  	}
  	public boolean getSeenByIsNotNull()
  	{
  		return this.seenby != null;
  	}
  	public ims.core.vo.HcpLiteVo getSeenBy()
  	{
  		return this.seenby;
  	}
  	public void setSeenBy(ims.core.vo.HcpLiteVo value)
  	{
  		this.isValidated = false;
  		this.seenby = value;
  	}
  	public boolean getOutpatientProceduresIsNotNull()
  	{
  		return this.outpatientprocedures != null;
  	}
  	public ims.RefMan.vo.PatientProcedureForAppointmentOutcomeVoCollection getOutpatientProcedures()
  	{
  		return this.outpatientprocedures;
  	}
  	public void setOutpatientProcedures(ims.RefMan.vo.PatientProcedureForAppointmentOutcomeVoCollection value)
  	{
  		this.isValidated = false;
  		this.outpatientprocedures = value;
  	}
  	public boolean getOutpatientDiagnosesIsNotNull()
  	{
  		return this.outpatientdiagnoses != null;
  	}
  	public ims.clinical.vo.PatientDiagnosisOpNotesVoCollection getOutpatientDiagnoses()
  	{
  		return this.outpatientdiagnoses;
  	}
  	public void setOutpatientDiagnoses(ims.clinical.vo.PatientDiagnosisOpNotesVoCollection value)
  	{
  		this.isValidated = false;
  		this.outpatientdiagnoses = value;
  	}
  	public boolean getSessionIsNotNull()
  	{
  		return this.session != null;
  	}
  	public ims.RefMan.vo.SessionForAppointmentOutcomeVo getSession()
  	{
  		return this.session;
  	}
  	public void setSession(ims.RefMan.vo.SessionForAppointmentOutcomeVo value)
  	{
  		this.isValidated = false;
  		this.session = value;
  	}
  	public boolean getOutcomeReasonIsNotNull()
  	{
  		return this.outcomereason != null;
  	}
  	public ims.admin.vo.lookups.AppointmentOutcomeReason getOutcomeReason()
  	{
  		return this.outcomereason;
  	}
  	public void setOutcomeReason(ims.admin.vo.lookups.AppointmentOutcomeReason value)
  	{
  		this.isValidated = false;
  		this.outcomereason = value;
  	}
  	public boolean getWasFirstDefinitiveTreatmentIsNotNull()
  	{
  		return this.wasfirstdefinitivetreatment != null;
  	}
  	public Boolean getWasFirstDefinitiveTreatment()
  	{
  		return this.wasfirstdefinitivetreatment;
  	}
  	public void setWasFirstDefinitiveTreatment(Boolean value)
  	{
  		this.isValidated = false;
  		this.wasfirstdefinitivetreatment = value;
  	}
  	public boolean getOutcomeActionsIsNotNull()
  	{
  		return this.outcomeactions != null;
  	}
  	public ims.scheduling.vo.AppointmentOutcomeActionVoCollection getOutcomeActions()
  	{
  		return this.outcomeactions;
  	}
  	public void setOutcomeActions(ims.scheduling.vo.AppointmentOutcomeActionVoCollection value)
  	{
  		this.isValidated = false;
  		this.outcomeactions = value;
  	}
  	public boolean isValidated()
  	{
  		if(this.isBusy)
  			return true;
  		this.isBusy = true;
  	
  		if(!this.isValidated)
  		{
  			this.isBusy = false;
  			return false;
  		}
  		if(this.outpatientprocedures != null)
  		{
  			if(!this.outpatientprocedures.isValidated())
  			{
  				this.isBusy = false;
  				return false;
  			}
  		}
  		if(this.outpatientdiagnoses != null)
  		{
  			if(!this.outpatientdiagnoses.isValidated())
  			{
  				this.isBusy = false;
  				return false;
  			}
  		}
  		if(this.outcomeactions != null)
  		{
  			if(!this.outcomeactions.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.apptstatus == null)
  			listOfErrors.add("Appointment Status is mandatory");
  		if(this.outcome == null)
  			listOfErrors.add("Outcome is mandatory");
  		if(this.outcomecomments != null)
  			if(this.outcomecomments.length() > 500)
  				listOfErrors.add("The length of the field [outcomecomments] in the value object [ims.scheduling.vo.BookingAppointmentOutcomeVo] is too big. It should be less or equal to 500");
  		if(this.outpatientprocedures != null)
  		{
  			String[] listOfOtherErrors = this.outpatientprocedures.validate();
  			if(listOfOtherErrors != null)
  			{
  				for(int x = 0; x < listOfOtherErrors.length; x++)
  				{
  					listOfErrors.add(listOfOtherErrors[x]);
  				}
  			}
  		}
  		if(this.outpatientdiagnoses != null)
  		{
  			String[] listOfOtherErrors = this.outpatientdiagnoses.validate();
  			if(listOfOtherErrors != null)
  			{
  