gt: 		for(int x = 0; x < errorCount; 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.ntpf.vo;
  
  /**
   * Linked to NTPF.LoCall.LoCall business object (ID: 1039100000).
   */
  public class LoCallVo extends ims.ntpf.vo.LoCallLiteVo implements ims.vo.ImsCloneable, Comparable
  {
  	private static final long serialVersionUID = 1L;
  
  	public LoCallVo()
  	{
  	}
  	public LoCallVo(Integer id, int version)
  	{
  		super(id, version);
  	}
  	public LoCallVo(ims.ntpf.vo.beans.LoCallVoBean bean)
  	{
  		this.id = bean.getId();
  		this.version = bean.getVersion();
  		this.localldate = bean.getLoCallDate() == null ? null : bean.getLoCallDate().buildDate();
  		this.waitinglistdetails = ims.ntpf.vo.LoCallWaitingListDetailsVoCollection.buildFromBeanCollection(bean.getWaitingListDetails());
  		this.hascomments = bean.getHasComments();
  		this.locallnumber = bean.getLoCallNumber();
  		this.whereheard = bean.getWhereHeard() == null ? null : ims.ntpf.vo.lookups.WhereHeard.buildLookup(bean.getWhereHeard());
  		this.callername = bean.getCallerName();
  		this.callernumber = bean.getCallerNumber();
  		this.patientchecklist = ims.ntpf.vo.PatientCheckListVoCollection.buildFromBeanCollection(bean.getPatientCheckList());
  		this.callerrelationship = bean.getCallerRelationship() == null ? null : ims.ntpf.vo.lookups.CallerRelationship.buildLookup(bean.getCallerRelationship());
  		this.calltype = bean.getCallType() == null ? null : ims.ntpf.vo.lookups.CallType.buildLookup(bean.getCallType());
  		this.medicalinsurance = bean.getMedicalInsurance() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getMedicalInsurance());
  		this.insurancetype = bean.getInsuranceType() == null ? null : ims.ntpf.vo.lookups.InsuranceType.buildLookup(bean.getInsuranceType());
  		this.sysinfo = bean.getSysInfo() == null ? null : bean.getSysInfo().buildSystemInformation();
  		this.gpdetails = bean.getGPDetails() == null ? null : bean.getGPDetails().buildVo();
  		this.locallcomments = ims.ntpf.vo.CommentVoCollection.buildFromBeanCollection(bean.getLoCallComments());
  		this.patient = bean.getPatient() == null ? null : bean.getPatient().buildVo();
  	}
  	public void populate(ims.vo.ValueObjectBeanMap map, ims.ntpf.vo.beans.LoCallVoBean bean)
  	{
  		this.id = bean.getId();
  		this.version = bean.getVersion();
  		this.localldate = bean.getLoCallDate() == null ? null : bean.getLoCallDate().buildDate();
  		this.waitinglistdetails = ims.ntpf.vo.LoCallWaitingListDetailsVoCollection.buildFromBeanCollection(bean.getWaitingListDetails());
  		this.hascomments = bean.getHasComments();
  		this.locallnumber = bean.getLoCallNumber();
  		this.whereheard = bean.getWhereHeard() == null ? null : ims.ntpf.vo.lookups.WhereHeard.buildLookup(bean.getWhereHeard());
  		this.callername = bean.getCallerName();
  		this.callernumber = bean.getCallerNumber();
  		this.patientchecklist = ims.ntpf.vo.PatientCheckListVoCollection.buildFromBeanCollection(bean.getPatientCheckList());
  		this.callerrelationship = bean.getCallerRelationship() == null ? null : ims.ntpf.vo.lookups.CallerRelationship.buildLookup(bean.getCallerRelationship());
  		this.calltype = bean.getCallType() == null ? null : ims.ntpf.vo.lookups.CallType.buildLookup(bean.getCallType());
  		this.medicalinsurance = bean.getMedicalInsurance() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getMedicalInsurance());
  		this.insurancetype = bean.getInsuranceType() == null ? null : ims.ntpf.vo.lookups.InsuranceType.buildLookup(bean.getInsuranceType());
  		this.sysinfo = bean.getSysInfo() == null ? null : bean.getSysInfo().buildSystemInformation();
  		this.gpdetails = bean.getGPDetails() == null ? null : bean.getGPDetails().buildVo(map);
  		this.locallcomments = ims.ntpf.vo.CommentVoCollection.buildFromBeanCollection(bean.getLoCallComments());
  		this.patient = bean.getPatient() == null ? null : bean.getPatient().buildVo(map);
  	}
  	public ims.vo.ValueObjectBean getBean()
  	{
  		return this.getBean(new ims.vo.ValueObjectBeanMap());
  	}
  	public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
  	{
  		ims.ntpf.vo.beans.LoCallVoBean bean = null;
  		if(map != null)
  			bean = (ims.ntpf.vo.beans.LoCallVoBean)map.getValueObjectBean(this);
  		if (bean == null)
  		{
  			bean = new ims.ntpf.vo.beans.LoCallVoBean();
  			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("LOCALLNUMBER"))
  			return getLoCallNumber();
  		if(fieldName.equals("WHEREHEARD"))
  			return getWhereHeard();
  		if(fieldName.equals("CALLERNAME"))
  			return getCallerName();
  		if(fieldName.equals("CALLERNUMBER"))
  			return getCallerNumber();
  		if(fieldName.equals("PATIENTCHECKLIST"))
  			return getPatientCheckList();
  		if(fieldName.equals("CALLERRELATIONSHIP"))
  			return getCallerRelationship();
  		if(fieldName.equals("CALLTYPE"))
  			return getCallType();
  		if(fieldName.equals("MEDICALINSURANCE"))
  			return getMedicalInsurance();
  		if(fieldName.equals("INSURANCETYPE"))
  			return getInsuranceType();
  		if(fieldName.equals("SYSINFO"))
  			return getSysInfo();
  		if(fieldName.equals("GPDETAILS"))
  			return getGPDetails();
  		if(fieldName.equals("LOCALLCOMMENTS"))
  			return getLoCallComments();
  		if(fieldName.equals("PATIENT"))
  			return getPatient();
  		return super.getFieldValueByFieldName(fieldName);
  	}
  	public boolean getLoCallNumberIsNotNull()
  	{
  		return this.locallnumber != null;
  	}
  	public String getLoCallNumber()
  	{
  		return this.locallnumber;
  	}
  	public static int getLoCallNumberMaxLength()
  	{
  		return 255;
  	}
  	public void setLoCallNumber(String value)
  	{
  		this.isValidated = false;
  		this.locallnumber = value;
  	}
  	public boolean getWhereHeardIsNotNull()
  	{
  		return this.whereheard != null;
  	}
  	public ims.ntpf.vo.lookups.WhereHeard getWhereHeard()
  	{
  		return this.whereheard;
  	}
  	public void setWhereHeard(ims.ntpf.vo.lookups.WhereHeard value)
  	{
  		this.isValidated = false;
  		this.whereheard = value;
  	}
  	public boolean getCallerNameIsNotNull()
  	{
  		return this.callername != null;
  	}
  	public String getCallerName()
  	{
  		return this.callername;
  	}
  	public static int getCallerNameMaxLength()
  	{
  		return 50;
  	}
  	public void setCallerName(String value)
  	{
  		this.isValidated = false;
  		this.callername = value;
  	}
  	public boolean getCallerNumberIsNotNull()
  	{
  		return this.callernumber != null;
  	}
  	public String getCallerNumber()
  	{
  		return this.callernumber;
  	}
  	public static int getCallerNumberMaxLength()
  	{
  		return 30;
  	}
  	public void setCallerNumber(String value)
  	{
  		this.isValidated = false;
  		this.callernumber = value;
  	}
  	public boolean getPatientCheckListIsNotNull()
  	{
  		return this.patientchecklist != null;
  	}
  	public ims.ntpf.vo.PatientCheckListVoCollection getPatientCheckList()
  	{
  		return this.patientchecklist;
  	}
  	public void setPatientCheckList(ims.ntpf.vo.PatientCheckListVoCollection value)
  	{
  		this.isValidated = false;
  		this.patientchecklist = value;
  	}
  	public boolean getCallerRelationshipIsNotNull()
  	{
  		return this.callerrelationship != null;
  	}
  	public ims.ntpf.vo.lookups.CallerRelationship getCallerRelationship()
  	{
  		return this.callerrelationship;
  	}
  	public void setCallerRelationship(ims.ntpf.vo.lookups.CallerRelationship value)
  	{
  		this.isValidated = false;
  		this.callerrelationship = value;
  	}
  	public boolean getCallTypeIsNotNull()
  	{
  		return this.calltype != null;
  	}
  	public ims.ntpf.vo.lookups.CallType getCallType()
  	{
  		return this.calltype;
  	}
  	public void setCallType(ims.ntpf.vo.lookups.CallType value)
  	{
  		this.isValidated = false;
  		this.calltype = value;
  	}
  	public boolean getMedicalInsuranceIsNotNull()
  	{
  		return this.medicalinsurance != null;
  	}
  	public ims.core.vo.lookups.YesNo getMedicalInsurance()
  	{
  		return this.medicalinsurance;
  	}
  	public void setMedicalInsurance(ims.core.vo.lookups.YesNo value)
  	{
  		this.isValidated = false;
  		this.medicalinsurance = value;
  	}
  	public boolean getInsuranceTypeIsNotNull()
  	{
  		return this.insurancetype != null;
  	}
  	public ims.ntpf.vo.lookups.InsuranceType getInsuranceType()
  	{
  		return this.insurancetype;
  	}
  	public void setInsuranceType(ims.ntpf.vo.lookups.InsuranceType value)
  	{
  		this.isValidated = false;
  		this.insurancetype = value;
  	}
  	public boolean getSysInfoIsNotNull()
  	{
  		return this.sysinfo != null;
  	}
  	public ims.vo.SystemInformation getSysInfo()
  	{
  		return this.sysinfo;
  	}
  	public void setSysInfo(ims.vo.SystemInformation value)
  	{
  		this.isValidated = false;
  		this.sysinfo = value;
  	}
  	public boolean getGPDetailsIsNotNull()
  	{
  		return this.gpdetails != null;
  	}
  	public ims.ntpf.vo.GPDetailsNTPFVo getGPDetails()
  	{
  		return this.gpdetails;
  	}
  	public void setGPDetails(ims.ntpf.vo.GPDetailsNTPFVo value)
  	{
  		this.isValidated = false;
  		this.gpdetails = value;
  	}
  	public boolean getLoCallCommentsIsNotNull()
  	{
  		return this.locallcomments != null;
  	}
  	public ims.ntpf.vo.CommentVoCollection getLoCallComments()
  	{
  		return this.locallcomments;
  	}
  	public void setLoCallComments(ims.ntpf.vo.CommentVoCollection value)
  	{
  		this.isValidated = false;
  		this.locallcomments = value;
  	}
  	public boolean getPatientIsNotNull()
  	{
  		return this.patient != null;
  	}
  	public ims.core.vo.Patient getPatient()
  	{
  		return this.patient;
  	}
  	public void setPatient(ims.core.vo.Patient value)
  	{
  		this.isValidated = false;
  		this.patient = value;
  	}
  	public boolean isValidated()
  	{
  		if(this.isBusy)
  			return true;
  		this.isBusy = true;
  	
  		if(!this.isValidated)
  		{
  			this.isBusy = false;
  			return false;
  		}
  		if(this.waitinglistdetails != null)
  		{
  			if(!this.waitinglistdetails.isValidated())
  			{
  				this.isBusy = false;
  				return false;
  			}
  		}
  		if(this.patientchecklist != null)
  		{
  			if(!this.patientchecklist.isValidated())
  			{
  				this.isBusy = false;
  				return false;
  			}
  		}
  		if(this.gpdetails != null)
  		{
  			if(!this.gpdetails.isValidated())
  			{
  				this.isBusy = false;
  				return false;
  			}
  		}
  		if(this.locallcomments != null)
  		{
  			if(!this.locallcomments.isValidated())
  			{
  				this.isBusy = false;
  				return false;
  			}
  		}
  		if(this.patient != null)
  		{
  			if(!this.patient.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.waitinglistdetails != null)
  		{
  			String[] listOfOtherErrors = this.waitinglistdetails.validate();
  			if(listOfOtherErrors != null)
  			{
  				for(int x = 0; x < listOfOtherErrors.length; x++)
  				{
  					listOfErrors.add(listOfOtherErrors[x]);
  				}
  			}
  		}
  		if(this.hascomments == null)
  			listOfErrors.add("hasComments is mandatory");
  		if(this.callername != null)
  			if(this.callername.length() > 50)
  				listOfErrors.add("The length of the field [callername] in the value object [ims.ntpf.vo.LoCallVo] is too big. It should be less or equal to 50");
  		if(this.callernumber != null)
  			if(this.callernumber.length() > 30)
  				listOfErrors.add("The length of the field [callernumber] in the value object [ims.ntpf.vo.LoCallVo] is too big. It should be less or equal to 30");
  		if(this.patientchecklist != null)
  		{
  			String[] listOfOtherErrors = this.patientchecklist.validate();
  			if(listOfOtherErrors != null)
  			{
  				for(int x = 0; x < listOfOtherErrors.length; x++)
  				{
  					listOfErrors.add(listOfOtherErrors[x]);
  				}
  			}
  		}
  		if(this.gpdetails != null)
  		{
  			String[] listOfOtherErrors = this.gpdetails.validate();
  			if(listOfOtherErrors != null)
  			{
  				for(int x = 0; x < listOfOtherErrors.length; x++)
  				{
  					listOfErrors.add(listOfOtherErrors[x]);
  				}
  			}
  		}
  		if(this.locallcomments != null)
  		{
  			String[] listOfOtherErrors = this.locallcomments.validate();
  			if(listOfOtherErrors != null)
  			{
  				for(int x = 0; x < listOfOtherErrors.length; x++)
  				{
  					listOfErrors.add(listOfOtherErrors[x]);
  				}
  			}
  		}
  		if(this.patient == null)
  			listOfErrors.add("Patient is mandatory");
  		if(this.patient != null)
  		{
  			String[] listOfOtherErrors = this.patient.validate();
  			if(listOfOtherErrors != null)
  			{
  				for(int x = 0; x < listOfOtherErrors.length; x++)
  				{
  					listOfErrors.add(listOfOtherErrors[x]);
  				}
  			}
  		}
  		int errorCount = listOfErrors.size();
  		if(errorCount == 0)
  		{
  			this.isBusy = false;
  			this.isValidated = true;
  			return null;
  		}
  		String[] result = new String[errorCount];
  