gt: 		if (obj == null)
context: //#############################################################################
  //#                                                                           #
  //#  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.scheduling.vo;
  
  /**
   * Linked to Scheduling.Booking_Appointment business object (ID: 1055100007).
   */
  public class BookingAppointmentClinicListListVo extends ims.scheduling.vo.Booking_AppointmentRefVo implements ims.vo.ImsCloneable, Comparable
  {
  	private static final long serialVersionUID = 1L;
  
  	public BookingAppointmentClinicListListVo()
  	{
  	}
  	public BookingAppointmentClinicListListVo(Integer id, int version)
  	{
  		super(id, version);
  	}
  	public BookingAppointmentClinicListListVo(ims.scheduling.vo.beans.BookingAppointmentClinicListListVoBean bean)
  	{
  		this.id = bean.getId();
  		this.version = bean.getVersion();
  		this.appointmentdate = bean.getAppointmentDate() == null ? null : bean.getAppointmentDate().buildDate();
  		this.apptstarttime = bean.getApptStartTime() == null ? null : bean.getApptStartTime().buildTime();
  		this.apptstatus = bean.getApptStatus() == null ? null : ims.scheduling.vo.lookups.Status_Reason.buildLookup(bean.getApptStatus());
  		this.activity = bean.getActivity() == null ? null : bean.getActivity().buildVo();
  		this.patient = bean.getPatient() == null ? null : bean.getPatient().buildVo();
  		this.iscabbooking = bean.getIsCABBooking();
  		this.session = bean.getSession() == null ? null : bean.getSession().buildVo();
  		this.wasprinted = bean.getWasPrinted();
  		this.bookingletter = bean.getBookingLetter() == null ? null : bean.getBookingLetter().buildVo();
  		this.numprovidercancellations = bean.getNumProviderCancellations();
  		this.numpatientcancellations = bean.getNumPatientCancellations();
  	}
  	public void populate(ims.vo.ValueObjectBeanMap map, ims.scheduling.vo.beans.BookingAppointmentClinicListListVoBean bean)
  	{
  		this.id = bean.getId();
  		this.version = bean.getVersion();
  		this.appointmentdate = bean.getAppointmentDate() == null ? null : bean.getAppointmentDate().buildDate();
  		this.apptstarttime = bean.getApptStartTime() == null ? null : bean.getApptStartTime().buildTime();
  		this.apptstatus = bean.getApptStatus() == null ? null : ims.scheduling.vo.lookups.Status_Reason.buildLookup(bean.getApptStatus());
  		this.activity = bean.getActivity() == null ? null : bean.getActivity().buildVo(map);
  		this.patient = bean.getPatient() == null ? null : bean.getPatient().buildVo(map);
  		this.iscabbooking = bean.getIsCABBooking();
  		this.session = bean.getSession() == null ? null : bean.getSession().buildVo(map);
  		this.wasprinted = bean.getWasPrinted();
  		this.bookingletter = bean.getBookingLetter() == null ? null : bean.getBookingLetter().buildVo(map);
  		this.numprovidercancellations = bean.getNumProviderCancellations();
  		this.numpatientcancellations = bean.getNumPatientCancellations();
  	}
  	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.BookingAppointmentClinicListListVoBean bean = null;
  		if(map != null)
  			bean = (ims.scheduling.vo.beans.BookingAppointmentClinicListListVoBean)map.getValueObjectBean(this);
  		if (bean == null)
  		{
  			bean = new ims.scheduling.vo.beans.BookingAppointmentClinicListListVoBean();
  			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("APPOINTMENTDATE"))
  			return getAppointmentDate();
  		if(fieldName.equals("APPTSTARTTIME"))
  			return getApptStartTime();
  		if(fieldName.equals("APPTSTATUS"))
  			return getApptStatus();
  		if(fieldName.equals("ACTIVITY"))
  			return getActivity();
  		if(fieldName.equals("PATIENT"))
  			return getPatient();
  		if(fieldName.equals("ISCABBOOKING"))
  			return getIsCABBooking();
  		if(fieldName.equals("SESSION"))
  			return getSession();
  		if(fieldName.equals("WASPRINTED"))
  			return getWasPrinted();
  		if(fieldName.equals("BOOKINGLETTER"))
  			return getBookingLetter();
  		if(fieldName.equals("NUMPROVIDERCANCELLATIONS"))
  			return getNumProviderCancellations();
  		if(fieldName.equals("NUMPATIENTCANCELLATIONS"))
  			return getNumPatientCancellations();
  		return super.getFieldValueByFieldName(fieldName);
  	}
  	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 getApptStartTimeIsNotNull()
  	{
  		return this.apptstarttime != null;
  	}
  	public ims.framework.utils.Time getApptStartTime()
  	{
  		return this.apptstarttime;
  	}
  	public void setApptStartTime(ims.framework.utils.Time value)
  	{
  		this.isValidated = false;
  		this.apptstarttime = value;
  	}
  	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 getActivityIsNotNull()
  	{
  		return this.activity != null;
  	}
  	public ims.core.vo.ActivityLiteVo getActivity()
  	{
  		return this.activity;
  	}
  	public void setActivity(ims.core.vo.ActivityLiteVo value)
  	{
  		this.isValidated = false;
  		this.activity = value;
  	}
  	public boolean getPatientIsNotNull()
  	{
  		return this.patient != null;
  	}
  	public ims.core.vo.PatientClinicListListVo getPatient()
  	{
  		return this.patient;
  	}
  	public void setPatient(ims.core.vo.PatientClinicListListVo value)
  	{
  		this.isValidated = false;
  		this.patient = value;
  	}
  	public boolean getIsCABBookingIsNotNull()
  	{
  		return this.iscabbooking != null;
  	}
  	public Boolean getIsCABBooking()
  	{
  		return this.iscabbooking;
  	}
  	public void setIsCABBooking(Boolean value)
  	{
  		this.isValidated = false;
  		this.iscabbooking = value;
  	}
  	public boolean getSessionIsNotNull()
  	{
  		return this.session != null;
  	}
  	public ims.scheduling.vo.SessionClinicListListVo getSession()
  	{
  		return this.session;
  	}
  	public void setSession(ims.scheduling.vo.SessionClinicListListVo value)
  	{
  		this.isValidated = false;
  		this.session = value;
  	}
  	public boolean getWasPrintedIsNotNull()
  	{
  		return this.wasprinted != null;
  	}
  	public Boolean getWasPrinted()
  	{
  		return this.wasprinted;
  	}
  	public void setWasPrinted(Boolean value)
  	{
  		this.isValidated = false;
  		this.wasprinted = value;
  	}
  	public boolean getBookingLetterIsNotNull()
  	{
  		return this.bookingletter != null;
  	}
  	public ims.core.vo.PatientDocumentLiteVo getBookingLetter()
  	{
  		return this.bookingletter;
  	}
  	public void setBookingLetter(ims.core.vo.PatientDocumentLiteVo value)
  	{
  		this.isValidated = false;
  		this.bookingletter = value;
  	}
  	public boolean getNumProviderCancellationsIsNotNull()
  	{
  		return this.numprovidercancellations != null;
  	}
  	public Integer getNumProviderCancellations()
  	{
  		return this.numprovidercancellations;
  	}
  	public void setNumProviderCancellations(Integer value)
  	{
  		this.isValidated = false;
  		this.numprovidercancellations = value;
  	}
  	public boolean getNumPatientCancellationsIsNotNull()
  	{
  		return this.numpatientcancellations != null;
  	}
  	public Integer getNumPatientCancellations()
  	{
  		return this.numpatientcancellations;
  	}
  	public void setNumPatientCancellations(Integer value)
  	{
  		this.isValidated = false;
  		this.numpatientcancellations = value;
  	}
  	public boolean isValidated()
  	{
  		if(this.isBusy)
  			return true;
  		this.isBusy = true;
  	
  		if(!this.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");
  		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;
  	
  		BookingAppointmentClinicListListVo clone = new BookingAppointmentClinicListListVo(this.id, this.version);
  		
  		if(this.appointmentdate == null)
  			clone.appointmentdate = null;
  		else
  			clone.appointmentdate = (ims.framework.utils.Date)this.appointmentdate.clone();
  		if(this.apptstarttime == null)
  			clone.apptstarttime = null;
  		else
  			clone.apptstarttime = (ims.framework.utils.Time)this.apptstarttime.clone();
  		if(this.apptstatus == null)
  			clone.apptstatus = null;
  		else
  			clone.apptstatus = (ims.scheduling.vo.lookups.Status_Reason)this.apptstatus.clone();
  		if(this.activity == null)
  			clone.activity = null;
  		else
  			clone.activity = (ims.core.vo.ActivityLiteVo)this.activity.clone();
  		if(this.patient == null)
  			clone.patient = null;
  		else
  			clone.patient = (ims.core.vo.PatientClinicListListVo)this.patient.clone();
  		clone.iscabbooking = this.iscabbooking;
  		if(this.session == null)
  			clone.session = null;
  		else
  			clone.session = (ims.scheduling.vo.SessionClinicListListVo)this.session.clone();
  		clone.wasprinted = this.wasprinted;
  		if(this.bookingletter == null)
  			clone.bookingletter = null;
  		else
  			clone.bookingletter = (ims.core.vo.PatientDocumentLiteVo)this.bookingletter.clone();
  		clone.numprovidercancellations = this.numprovidercancellations;
  		clone.numpatientcancellations = this.numpatientcancellations;
  		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)
  	{
  