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

/**
 * Linked to RefMan.CatsReferral business object (ID: 1004100035).
 */
public class CatsReferralListVo extends ims.RefMan.vo.CatsReferralRefVo implements ims.vo.ImsCloneable, Comparable
{
	private static final long serialVersionUID = 1L;

	public CatsReferralListVo()
	{
	}
	public CatsReferralListVo(Integer id, int version)
	{
		super(id, version);
	}
	public CatsReferralListVo(ims.RefMan.vo.beans.CatsReferralListVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.patient = bean.getPatient() == null ? null : bean.getPatient().buildVo();
		this.referraldetails = bean.getReferralDetails() == null ? null : bean.getReferralDetails().buildVo();
		this.hasdocuments = bean.getHasDocuments();
		this.currentstatus = bean.getCurrentStatus() == null ? null : bean.getCurrentStatus().buildVo();
		this.hasinvestigations = bean.getHasInvestigations();
		this.hasappointments = bean.getHasAppointments();
		this.carecontext = bean.getCareContext() == null ? null : new ims.core.admin.vo.CareContextRefVo(new Integer(bean.getCareContext().getId()), bean.getCareContext().getVersion());
		this.hasreferralletter = bean.getHasReferralLetter();
		this.iscab = bean.getIsCAB();
		this.consultationappt = bean.getConsultationAppt() == null ? null : bean.getConsultationAppt().buildVo();
		this.additionalinvapptsstatus = bean.getAdditionalInvApptsStatus() == null ? null : ims.RefMan.vo.lookups.AdditionalInvestigationAppointmentsStatus.buildLookup(bean.getAdditionalInvApptsStatus());
		this.hasrejectedinv = bean.getHasRejectedInv();
		this.providercancellation = bean.getProviderCancellation() == null ? null : new ims.RefMan.vo.ProviderCancellationRefVo(new Integer(bean.getProviderCancellation().getId()), bean.getProviderCancellation().getVersion());
		this.isflaggedforreview = bean.getIsFlaggedForReview();
		this.onwardreferralstatus = bean.getOnwardReferralStatus() == null ? null : ims.RefMan.vo.lookups.OnwardReferralStatus.buildLookup(bean.getOnwardReferralStatus());
		this.statushistory = ims.RefMan.vo.CatsReferralStatusVoCollection.buildFromBeanCollection(bean.getStatusHistory());
		this.hasconsultationdetails = bean.getHasConsultationDetails();
		this.lastapptarriveddate = bean.getLastApptArrivedDate() == null ? null : bean.getLastApptArrivedDate().buildDate();
		this.hastltstartcontact = bean.getHasTLTStartContact();
		this.issuitableforsurgery = bean.getIsSuitableForSurgery();
		this.isfitforsurgery = bean.getIsFitForSurgery();
		this.hastheatreappt = bean.getHasTheatreAppt();
		this.haslinkedicp = bean.getHasLinkedICP();
		this.iscurrentlyallocated = bean.getIsCurrentlyAllocated();
		this.isawaitingclinicalinfo = bean.getIsAwaitingClinicalInfo();
		this.awaitingclinicalinfo = bean.getAwaitingClinicalInfo() == null ? null : bean.getAwaitingClinicalInfo().buildVo();
		this.opdlocation = bean.getOPDLocation() == null ? null : new ims.core.resource.place.vo.LocationRefVo(new Integer(bean.getOPDLocation().getId()), bean.getOPDLocation().getVersion());
		this.suitableforsurgerydate = bean.getSuitableForSurgeryDate() == null ? null : bean.getSuitableForSurgeryDate().buildDate();
		this.endofcaredate = bean.getEndOfCareDate() == null ? null : bean.getEndOfCareDate().buildDate();
		this.contract = bean.getContract() == null ? null : bean.getContract().buildVo();
		if(bean.getAdminEvent() != null)
		{
			this.adminevent = new ims.pathways.vo.AdminEventRefVoCollection();
			for(int adminevent_i = 0; adminevent_i < bean.getAdminEvent().length; adminevent_i++)
			{
				this.adminevent.add(new ims.pathways.vo.AdminEventRefVo(new Integer(bean.getAdminEvent()[adminevent_i].getId()), bean.getAdminEvent()[adminevent_i].getVersion()));
			}
		}
		this.pathwayid = bean.getPathwayID();
		this.numprovidercancelledappts = bean.getNumProviderCancelledAppts();
		this.numpatientcancelledappts = bean.getNumPatientCancelledAppts();
		this.hasmultiplereferralletter = bean.getHasMultipleReferralLetter();
		this.consultationactivityrequired = bean.getConsultationActivityRequired();
		this.patientcategory = bean.getPatientCategory() == null ? null : ims.core.vo.lookups.PatientStatus.buildLookup(bean.getPatientCategory());
		this.isemergencyreferral = bean.getIsEmergencyReferral();
		this.icabreferral = bean.getICABReferral() == null ? null : bean.getICABReferral().buildVo();
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.RefMan.vo.beans.CatsReferralListVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.patient = bean.getPatient() == null ? null : bean.getPatient().buildVo(map);
		this.referraldetails = bean.getReferralDetails() == null ? null : bean.getReferralDetails().buildVo(map);
		this.hasdocuments = bean.getHasDocuments();
		this.currentstatus = bean.getCurrentStatus() == null ? null : bean.getCurrentStatus().buildVo(map);
		this.hasinvestigations = bean.getHasInvestigations();
		this.hasappointments = bean.getHasAppointments();
		this.carecontext = bean.getCareContext() == null ? null : new ims.core.admin.vo.CareContextRefVo(new Integer(bean.getCareContext().getId()), bean.getCareContext().getVersion());
		this.hasreferralletter = bean.getHasReferralLetter();
		this.iscab = bean.getIsCAB();
		this.consultationappt = bean.getConsultationAppt() == null ? null : bean.getConsultationAppt().buildVo(map);
		this.additionalinvapptsstatus = bean.getAdditionalInvApptsStatus() == null ? null : ims.RefMan.vo.lookups.AdditionalInvestigationAppointmentsStatus.buildLookup(bean.getAdditionalInvApptsStatus());
		this.hasrejectedinv = bean.getHasRejectedInv();
		this.providercancellation = bean.getProviderCancellation() == null ? null : new ims.RefMan.vo.ProviderCancellationRefVo(new Integer(bean.getProviderCancellation().getId()), bean.getProviderCancellation().getVersion());
		this.isflaggedforreview = bean.getIsFlaggedForReview();
		this.onwardreferralstatus = bean.getOnwardReferralStatus() == null ? null : ims.RefMan.vo.lookups.OnwardReferralStatus.buildLookup(bean.getOnwardReferralStatus());
		this.statushistory = ims.RefMan.vo.CatsReferralStatusVoCollection.buildFromBeanCollection(bean.getStatusHistory());
		this.hasconsultationdetails = bean.getHasConsultationDetails();
		this.lastapptarriveddate = bean.getLastApptArrivedDate() == null ? null : bean.getLastApptArrivedDate().buildDate();
		this.hastltstartcontact = bean.getHasTLTStartContact();
		this.issuitableforsurgery = bean.getIsSuitableForSurgery();
		this.isfitforsurgery = bean.getIsFitForSurgery();
		this.hastheatreappt = bean.getHasTheatreAppt();
		this.haslinkedicp = bean.getHasLinkedICP();
		this.iscurrentlyallocated = bean.getIsCurrentlyAllocated();
		this.isawaitingclinicalinfo = bean.getIsAwaitingClinicalInfo();
		this.awaitingclinicalinfo = bean.getAwaitingClinicalInfo() == null ? null : bean.getAwaitingClinicalInfo().buildVo(map);
		this.opdlocation = bean.getOPDLocation() == null ? null : new ims.core.resource.place.vo.LocationRefVo(new Integer(bean.getOPDLocation().getId()), bean.getOPDLocation().getVersion());
		this.suitableforsurgerydate = bean.getSuitableForSurgeryDate() == null ? null : bean.getSuitableForSurgeryDate().buildDate();
		this.endofcaredate = bean.getEndOfCareDate() == null ? null : bean.getEndOfCareDate().buildDate();
		this.contract = bean.getContract() == null ? null : bean.getContract().buildVo(map);
		if(bean.getAdminEvent() != null)
		{
			this.adminevent = new ims.pathways.vo.AdminEventRefVoCollection();
			for(int adminevent_i = 0; adminevent_i < bean.getAdminEvent().length; adminevent_i++)
			{
				this.adminevent.add(new ims.pathways.vo.AdminEventRefVo(new Integer(bean.getAdminEvent()[adminevent_i].getId()), bean.getAdminEvent()[adminevent_i].getVersion()));
			}
		}
		this.pathwayid = bean.getPathwayID();
		this.numprovidercancelledappts = bean.getNumProviderCancelledAppts();
		this.numpatientcancelledappts = bean.getNumPatientCancelledAppts();
		this.hasmultiplereferralletter = bean.getHasMultipleReferralLetter();
		this.consultationactivityrequired = bean.getConsultationActivityRequired();
		this.patientcategory = bean.getPatientCategory() == null ? null : ims.core.vo.lookups.PatientStatus.buildLookup(bean.getPatientCategory());
		this.isemergencyreferral = bean.getIsEmergencyReferral();
		this.icabreferral = bean.getICABReferral() == null ? null : bean.getICABReferral().buildVo(map);
	}
	public ims.vo.ValueObjectBean getBean()
	{
		return this.getBean(new ims.vo.ValueObjectBeanMap());
	}
	public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
	{
		ims.RefMan.vo.beans.CatsReferralListVoBean bean = null;
		if(map != null)
			bean = (ims.RefMan.vo.beans.CatsReferralListVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.RefMan.vo.beans.CatsReferralListVoBean();
			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("REFERRALDETAILS"))
			return getReferralDetails();
		if(fieldName.equals("HASDOCUMENTS"))
			return getHasDocuments();
		if(fieldName.equals("CURRENTSTATUS"))
			return getCurrentStatus();
		if(fieldName.equals("HASINVESTIGATIONS"))
			return getHasInvestigations();
		if(fieldName.equals("HASAPPOINTMENTS"))
			return getHasAppointments();
		if(fieldName.equals("CARECONTEXT"))
			return getCareContext();
		if(fieldName.equals("HASREFERRALLETTER"))
			return getHasReferralLetter();
		if(fieldName.equals("ISCAB"))
			return getIsCAB();
		if(fieldName.equals("CONSULTATIONAPPT"))
			return getConsultationAppt();
		if(fieldName.equals("ADDITIONALINVAPPTSSTATUS"))
			return getAdditionalInvApptsStatus();
		if(fieldName.equals("HASREJECTEDINV"))
			return getHasRejectedInv();
		if(fieldName.equals("PROVIDERCANCELLATION"))
			return getProviderCancellation();
		if(fieldName.equals("ISFLAGGEDFORREVIEW"))
			return getIsFlaggedForReview();
		if(fieldName.equals("ONWARDREFERRALSTATUS"))
			return getOnwardReferralStatus();
		if(fieldName.equals("STATUSHISTORY"))
			return getStatusHistory();
		if(fieldName.equals("HASCONSULTATIONDETAILS"))
			return getHasConsultationDetails();
		if(fieldName.equals("LASTAPPTARRIVEDDATE"))
			return getLastApptArrivedDate();
		if(fieldName.equals("HASTLTSTARTCONTACT"))
			return getHasTLTStartContact();
		if(fieldName.equals("ISSUITABLEFORSURGERY"))
			return getIsSuitableForSurgery();
		if(fieldName.equals("ISFITFORSURGERY"))
			return getIsFitForSurgery();
		if(fieldName.equals("HASTHEATREAPPT"))
			return getHasTheatreAppt();
		if(fieldName.equals("HASLINKEDICP"))
			return getHasLinkedICP();
		if(fieldName.equals("ISCURRENTLYALLOCATED"))
			return getIsCurrentlyAllocated();
		if(fieldName.equals("ISAWAITINGCLINICALINFO"))
			return getIsAwaitingClinicalInfo();
		if(fieldName.equals("AWAITINGCLINICALINFO"))
			return getAwaitingClinicalInfo();
		if(fieldName.equals("OPDLOCATION"))
			return getOPDLocation();
		if(fieldName.equals("SUITABLEFORSURGERYDATE"))
			return getSuitableForSurgeryDate();
		if(fieldName.equals("ENDOFCAREDATE"))
			return getEndOfCareDate();
		if(fieldName.equals("CONTRACT"))
			return getContract();
		if(fieldName.equals("ADMINEVENT"))
			return getAdminEvent();
		if(fieldName.equals("PATHWAYID"))
			return getPathwayID();
		if(fieldName.equals("NUMPROVIDERCANCELLEDAPPTS"))
			return getNumProviderCancelledAppts();
		if(fieldName.equals("NUMPATIENTCANCELLEDAPPTS"))
			return getNumPatientCancelledAppts();
		if(fieldName.equals("HASMULTIPLEREFERRALLETTER"))
			return getHasMultipleReferralLetter();
		if(fieldName.equals("CONSULTATIONACTIVITYREQUIRED"))
			return getConsultationActivityRequired();
		if(fieldName.equals("PATIENTCATEGORY"))
			return getPatientCategory();
		if(fieldName.equals("ISEMERGENCYREFERRAL"))
			return getIsEmergencyReferral();
		if(fieldName.equals("ICABREFERRAL"))
			return getICABReferral();
		return super.getFieldValueByFieldName(fieldName);
	}
	public boolean getPatientIsNotNull()
	{
		return this.patient != null;
	}
	public ims.core.vo.PatientShortListVo getPatient()
	{
		return this.patient;
	}
	public void setPatient(ims.core.vo.PatientShortListVo value)
	{
		this.isValidated = false;
		this.patient = value;
	}
	public boolean getReferralDetailsIsNotNull()
	{
		return this.referraldetails != null;
	}
	public ims.RefMan.vo.ReferralLetterDetailsLiteVo getReferralDetails()
	{
		return this.referraldetails;
	}
	public void setReferralDetails(ims.RefMan.vo.ReferralLetterDetailsLiteVo value)
	{
		this.isValidated = false;
		this.referraldetails = value;
	}
	public boolean getHasDocumentsIsNotNull()
	{
		return this.hasdocuments != null;
	}
	public Boolean getHasDocuments()
	{
		return this.hasdocuments;
	}
	public void setHasDocuments(Boolean value)
	{
		this.isValidated = false;
		this.hasdocuments = value;
	}
	public boolean getCurrentStatusIsNotNull()
	{
		return this.currentstatus != null;
	}
	public ims.RefMan.vo.CatsReferralStatusVo getCurrentStatus()
	{
		return this.currentstatus;
	}
	public void setCurrentStatus(ims.RefMan.vo.CatsReferralStatusVo value)
	{
		this.isValidated = false;
		this.currentstatus = value;
	}
	public boolean getHasInvestigationsIsNotNull()
	{
		return this.hasinvestigations != null;
	}
	public Boolean getHasInvestigations()
	{
		return this.hasinvestigations;
	}
	public void setHasInvestigations(Boolean value)
	{
		this.isValidated = false;
		this.hasinvestigations = value;
	}
	public boolean getHasAppointmentsIsNotNull()
	{
		return this.hasappointments != null;
	}
	public Boolean getHasAppointments()
	{
		return this.hasappointments;
	}
	public void setHasAppointments(Boolean value)
	{
		this.isValidated = false;
		this.hasappointments = 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 getHasReferralLetterIsNotNull()
	{
		return this.hasreferralletter != null;
	}
	public Boolean getHasReferralLetter()
	{
		return this.hasreferralletter;
	}
	public void setHasReferralLetter(Boolean value)
	{
		this.isValidated = false;
		this.hasreferralletter = value;
	}
	public boolean getIsCABIsNotNull()
	{
		return this.iscab != null;
	}
	public Boolean getIsCAB()
	{
		return this.iscab;
	}
	public void setIsCAB(Boolean value)
	{
		this.isValidated = false;
		this.iscab = value;
	}
	public boolean getConsultationApptIsNotNull()
	{
		return this.consultationappt != null;
	}
	public ims.scheduling.vo.BookingAppointmentLiteVo getConsultationAppt()
	{
		return this.consultationappt;
	}
	public void setConsultationAppt(ims.scheduling.vo.BookingAppointmentLiteVo value)
	{
		this.isValidated = false;
		this.consultationappt = value;
	}
	public boolean getAdditionalInvApptsStatusIsNotNull()
	{
		return this.additionalinvapptsstatus != null;
	}
	public ims.RefMan.vo.lookups.AdditionalInvestigationAppointmentsStatus getAdditionalInvApptsStatus()
	{
		return this.additionalinvapptsstatus;
	}
	public void setAdditionalInvApptsStatus(ims.RefMan.vo.lookups.AdditionalInvestigationAppointmentsStatus value)
	{
		this.isValidated = false;
		this.additionalinvapptsstatus = value;
	}
	public boolean getHasRejectedInvIsNotNull()
	{
		return this.hasrejectedinv != null;
	}
	public Boolean getHasRejectedInv()
	{
		return this.hasrejectedinv;
	}
	public void setHasRejectedInv(Boolean value)
	{
		this.isValidated = false;
		this.hasrejectedinv = value;
	}
	public boolean getProviderCancellationIsNotNull()
	{
		return this.providercancellation != null;
	}
	public ims.RefMan.vo.ProviderCancellationRefVo getProviderCancellation()
	{
		return this.providercancellation;
	}
	public void setProviderCancellation(ims.RefMan.vo.ProviderCancellationRefVo value)
	{
		this.isValidated = false;
		this.providercancellation = value;
	}
	public boolean getIsFlaggedForReviewIsNotNull()
	{
		return this.isflaggedforreview != null;
	}
	public Boolean getIsFlaggedForReview()
	{
		return this.isflaggedforreview;
	}
	public void setIsFlaggedForReview(Boolean value)
	{
		this.isValidated = false;
		this.isflaggedforreview = value;
	}
	public boolean getOnwardReferralStatusIsNotNull()
	{
		return this.onwardreferralstatus != null;
	}
	public ims.RefMan.vo.lookups.OnwardReferralStatus getOnwardReferralStatus()
	{
		return this.onwardreferralstatus;
	}
	public void setOnwardReferralStatus(ims.RefMan.vo.lookups.OnwardReferralStatus value)
	{
		this.isValidated = false;
		this.onwardreferralstatus = value;
	}
	public boolean getStatusHistoryIsNotNull()
	{
		return this.statushistory != null;
	}
	public ims.RefMan.vo.CatsReferralStatusVoCollection getStatusHistory()
	{
		return this.statushistory;
	}
	public void setStatusHistory(ims.RefMan.vo.CatsReferralStatusVoCollection value)
	{
		this.isValidated = false;
		this.statushistory = value;
	}
	public boolean getHasConsultationDetailsIsNotNull()
	{
		return this.hasconsultationdetails != null;
	}
	public Boolean getHasConsultationDetails()
	{
		return this.hasconsultationdetails;
	}
	public void setHasConsultationDetails(Boolean value)
	{
		this.isValidated = false;
		this.hasconsultationdetails = value;
	}
	public boolean getLastApptArrivedDateIsNotNull()
	{
		return this.lastapptarriveddate != null;
	}
	public ims.framework.utils.Date getLastApptArrivedDate()
	{
		return this.lastapptarriveddate;
	}
	public void setLastApptArrivedDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.lastapptarriveddate = value;
	}
	public boolean getHasTLTStartContactIsNotNull()
	{
		return this.hastltstartcontact != null;
	}
	public Boolean getHasTLTStartContact()
	{
		return this.hastltstartcontact;
	}
	public void setHasTLTStartContact(Boolean value)
	{
		this.isValidated = false;
		this.hastltstartcontact = value;
	}
	public boolean getIsSuitableForSurgeryIsNotNull()
	{
		return this.issuitableforsurgery != null;
	}
	public Boolean getIsSuitableForSurgery()
	{
		return this.issuitableforsurgery;
	}
	public void setIsSuitableForSurgery(Boolean value)
	{
		this.isValidated = false;
		this.issuitableforsurgery = value;
	}
	public boolean getIsFitForSurgeryIsNotNull()
	{
		return this.isfitforsurgery != null;
	}
	public Boolean getIsFitForSurgery()
	{
		return this.isfitforsurgery;
	}
	public void setIsFitForSurgery(Boolean value)
	{
		this.isValidated = false;
		this.isfitforsurgery = value;
	}
	public boolean getHasTheatreApptIsNotNull()
	{
		return this.hastheatreappt != null;
	}
	public Boolean getHasTheatreAppt()
	{
		return this.hastheatreappt;
	}
	public void setHasTheatreAppt(Boolean value)
	{
		this.isValidated = false;
		this.hastheatreappt = value;
	}
	public boolean getHasLinkedICPIsNotNull()
	{
		return this.haslinkedicp != null;
	}
	public Boolean getHasLinkedICP()
	{
		return this.haslinkedicp;
	}
	public void setHasLinkedICP(Boolean value)
	{
		this.isValidated = false;
		this.haslinkedicp = value;
	}
	public boolean getIsCurrentlyAllocatedIsNotNull()
	{
		return this.iscurrentlyallocated != null;
	}
	public Boolean getIsCurrentlyAllocated()
	{
		return this.iscurrentlyallocated;
	}
	public void setIsCurrentlyAllocated(Boolean value)
	{
		this.isValidated = false;
		this.iscurrentlyallocated = value;
	}
	public boolean getIsAwaitingClinicalInfoIsNotNull()
	{
		return this.isawaitingclinicalinfo != null;
	}
	public Boolean getIsAwaitingClinicalInfo()
	{
		return this.isawaitingclinicalinfo;
	}
	public void setIsAwaitingClinicalInfo(Boolean value)
	{
		this.isValidated = false;
		this.isawaitingclinicalinfo = value;
	}
	public boolean getAwaitingClinicalInfoIsNotNull()
	{
		return this.awaitingclinicalinfo != null;
	}
	public ims.RefMan.vo.AwaitingClinicalInfoVo getAwaitingClinicalInfo()
	{
		return this.awaitingclinicalinfo;
	}
	public void setAwaitingClinicalInfo(ims.RefMan.vo.AwaitingClinicalInfoVo value)
	{
		this.isValidated = false;
		this.awaitingclinicalinfo = value;
	}
	public boolean getOPDLocationIsNotNull()
	{
		return this.opdlocation != null;
	}
	public ims.core.resource.place.vo.LocationRefVo getOPDLocation()
	{
		return this.opdlocation;
	}
	public void setOPDLocation(ims.core.resource.place.vo.LocationRefVo value)
	{
		this.isValidated = false;
		this.opdlocation = value;
	}
	public boolean getSuitableForSurgeryDateIsNotNull()
	{
		return this.suitableforsurgerydate != null;
	}
	public ims.framework.utils.Date getSuitableForSurgeryDate()
	{
		return this.suitableforsurgerydate;
	}
	public void setSuitableForSurgeryDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.suitableforsurgerydate = value;
	}
	public boolean getEndOfCareDateIsNotNull()
	{
		return this.endofcaredate != null;
	}
	public ims.framework.utils.Date getEndOfCareDate()
	{
		return this.endofcaredate;
	}
	public void setEndOfCareDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.endofcaredate = value;
	}
	public boolean getContractIsNotNull()
	{
		return this.contract != null;
	}
	public ims.RefMan.vo.ContractConfigShortVo getContract()
	{
		return this.contract;
	}
	public void setContract(ims.RefMan.vo.ContractConfigShortVo value)
	{
		this.isValidated = false;
		this.contract = value;
	}
	public boolean getAdminEventIsNotNull()
	{
		return this.adminevent != null;
	}
	public ims.pathways.vo.AdminEventRefVoCollection getAdminEvent()
	{
		return this.adminevent;
	}
	public void setAdminEvent(ims.pathways.vo.AdminEventRefVoCollection value)
	{
		this.isValidated = false;
		this.adminevent = value;
	}
	public boolean getPathwayIDIsNotNull()
	{
		return this.pathwayid != null;
	}
	public String getPathwayID()
	{
		return this.pathwayid;
	}
	public static int getPathwayIDMaxLength()
	{
		return 20;
	}
	public void setPathwayID(String value)
	{
		this.isValidated = false;
		this.pathwayid = value;
	}
	public boolean getNumProviderCancelledApptsIsNotNull()
	{
		return this.numprovidercancelledappts != null;
	}
	public Integer getNumProviderCancelledAppts()
	{
		return this.numprovidercancelledappts;
	}
	public void setNumProviderCancelledAppts(Integer value)
	{
		this.isValidated = false;
		this.numprovidercancelledappts = value;
	}
	public boolean getNumPatientCancelledApptsIsNotNull()
	{
		return this.numpatientcancelledappts != null;
	}
	public Integer getNumPatientCancelledAppts()
	{
		return this.numpatientcancelledappts;
	}
	public void setNumPatientCancelledAppts(Integer value)
	{
		this.isValidated = false;
		this.numpatientcancelledappts = value;
	}
	public boolean getHasMultipleReferralLetterIsNotNull()
	{
		return this.hasmultiplereferralletter != null;
	}
	public Boolean getHasMultipleReferralLetter()
	{
		return this.hasmultiplereferralletter;
	}
	public void setHasMultipleReferralLetter(Boolean value)
	{
		this.isValidated = false;
		this.hasmultiplereferralletter = value;
	}
	public boolean getConsultationActivityRequiredIsNotNull()
	{
		return this.consultationactivityrequired != null;
	}
	public Boolean getConsultationActivityRequired()
	{
		return this.consultationactivityrequired;
	}
	public void setConsultationActivityRequired(Boolean value)
	{
		this.isValidated = false;
		this.consultationactivityrequired = value;
	}
	public boolean getPatientCategoryIsNotNull()
	{
		return this.patientcategory != null;
	}
	public ims.core.vo.lookups.PatientStatus getPatientCategory()
	{
		return this.patientcategory;
	}
	public void setPatientCategory(ims.core.vo.lookups.PatientStatus value)
	{
		this.isValidated = false;
		this.patientcategory = value;
	}
	public boolean getIsEmergencyReferralIsNotNull()
	{
		return this.isemergencyreferral != null;
	}
	public Boolean getIsEmergencyReferral()
	{
		return this.isemergencyreferral;
	}
	public void setIsEmergencyReferral(Boolean value)
	{
		this.isValidated = false;
		this.isemergencyreferral = value;
	}
	public boolean getICABReferralIsNotNull()
	{
		return this.icabreferral != null;
	}
	public ims.admin.vo.ICABReferralLiteVo getICABReferral()
	{
		return this.icabreferral;
	}
	public void setICABReferral(ims.admin.vo.ICABReferralLiteVo value)
	{
		this.isValidated = false;
		this.icabreferral = value;
	}
	/**
	* CatsReferralListVoDateTimeComparator  (class definition)
	*/
	public static class CatsReferralListVoDateTimeComparator implements java.util.Comparator
	{
		private int direction = 1;
		public CatsReferralListVoDateTimeComparator ()
		{
			this(ims.framework.enumerations.SortOrder.ASCENDING);
		}
		public CatsReferralListVoDateTimeComparator (ims.framework.enumerations.SortOrder order)
		{
			if (order == ims.framework.enumerations.SortOrder.DESCENDING)
			{
				direction = -1;
			}
		}
		public int compare(Object obj1, Object obj2)
		{
			CatsReferralListVo voObj1 = (CatsReferralListVo)obj1;
			CatsReferralListVo voObj2 = (CatsReferralListVo)obj2;
			if (voObj1.getReferralDetailsIsNotNull()
				&& voObj2.getReferralDetailsIsNotNull())
			{	
				if (voObj1.getReferralDetails().getEnd18WW() == null)//WDEV-11801
						return -1;
				if (voObj2.getReferralDetails().getEnd18WW() == null)//WDEV-11801
						return 1;			
				return direction*(voObj1.getReferralDetails().getEnd18WW().compareTo(voObj2.getReferralDetails().getEnd18WW()));//WDEV-11801
			}
			else
				return direction;
		}
		public boolean equals(Object obj)
		{
			return false;
		}	
	}
	/**
	* getDateTimeComparator - retrieves a new instance of static class CatsReferralListVoDateTimeComparator
	*/
	public static CatsReferralListVoDateTimeComparator getDateTimeComparator(ims.framework.enumerations.SortOrder sortOrder)
	{
		return new CatsReferralListVo.CatsReferralListVoDateTimeComparator(sortOrder);
	}
	
	public boolean isValidated()
	{
		if(this.isBusy)
			return true;
		this.isBusy = true;
	
		if(!this.isValidated)
		{
			this.isBusy = false;
			return false;
		}
		if(this.currentstatus != null)
		{
			if(!this.currentstatus.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.statushistory != null)
		{
			if(!this.statushistory.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.contract != null)
		{
			if(!this.contract.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.icabreferral != null)
		{
			if(!this.icabreferral.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.currentstatus != null)
		{
			String[] listOfOtherErrors = this.currentstatus.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.carecontext == null)
			listOfErrors.add("CareContext is mandatory");
		if(this.statushistory != null)
		{
			String[] listOfOtherErrors = this.statushistory.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.contract != null)
		{
			String[] listOfOtherErrors = this.contract.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.pathwayid != null)
			if(this.pathwayid.length() > 20)
				listOfErrors.add("The length of the field [pathwayid] in the value object [ims.RefMan.vo.CatsReferralListVo] is too big. It should be less or equal to 20");
		if(this.icabreferral != null)
		{
			String[] listOfOtherErrors = this.icabreferral.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];
		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;
	
		CatsReferralListVo clone = new CatsReferralListVo(this.id, this.version);
		
		if(this.patient == null)
			clone.patient = null;
		else
			clone.patient = (ims.core.vo.PatientShortListVo)this.patient.clone();
		if(this.referraldetails == null)
			clone.referraldetails = null;
		else
			clone.referraldetails = (ims.RefMan.vo.ReferralLetterDetailsLiteVo)this.referraldetails.clone();
		clone.hasdocuments = this.hasdocuments;
		if(this.currentstatus == null)
			clone.currentstatus = null;
		else
			clone.currentstatus = (ims.RefMan.vo.CatsReferralStatusVo)this.currentstatus.clone();
		clone.hasinvestigations = this.hasinvestigations;
		clone.hasappointments = this.hasappointments;
		clone.carecontext = this.carecontext;
		clone.hasreferralletter = this.hasreferralletter;
		clone.iscab = this.iscab;
		if(this.consultationappt == null)
			clone.consultationappt = null;
		else
			clone.consultationappt = (ims.scheduling.vo.BookingAppointmentLiteVo)this.consultationappt.clone();
		if(this.additionalinvapptsstatus == null)
			clone.additionalinvapptsstatus = null;
		else
			clone.additionalinvapptsstatus = (ims.RefMan.vo.lookups.AdditionalInvestigationAppointmentsStatus)this.additionalinvapptsstatus.clone();
		clone.hasrejectedinv = this.hasrejectedinv;
		clone.providercancellation = this.providercancellation;
		clone.isflaggedforreview = this.isflaggedforreview;
		if(this.onwardreferralstatus == null)
			clone.onwardreferralstatus = null;
		else
			clone.onwardreferralstatus = (ims.RefMan.vo.lookups.OnwardReferralStatus)this.onwardreferralstatus.clone();
		if(this.statushistory == null)
			clone.statushistory = null;
		else
			clone.statushistory = (ims.RefMan.vo.CatsReferralStatusVoCollection)this.statushistory.clone();
		clone.hasconsultationdetails = this.hasconsultationdetails;
		if(this.lastapptarriveddate == null)
			clone.lastapptarriveddate = null;
		else
			clone.lastapptarriveddate = (ims.framework.utils.Date)this.lastapptarriveddate.clone();
		clone.hastltstartcontact = this.hastltstartcontact;
		clone.issuitableforsurgery = this.issuitableforsurgery;
		clone.isfitforsurgery = this.isfitforsurgery;
		clone.hastheatreappt = this.hastheatreappt;
		clone.haslinkedicp = this.haslinkedicp;
		clone.iscurrentlyallocated = this.iscurrentlyallocated;
		clone.isawaitingclinicalinfo = this.isawaitingclinicalinfo;
		if(this.awaitingclinicalinfo == null)
			clone.awaitingclinicalinfo = null;
		else
			clone.awaitingclinicalinfo = (ims.RefMan.vo.AwaitingClinicalInfoVo)this.awaitingclinicalinfo.clone();
		clone.opdlocation = this.opdlocation;
		if(this.suitableforsurgerydate == null)
			clone.suitableforsurgerydate = null;
		else
			clone.suitableforsurgerydate = (ims.framework.utils.Date)this.suitableforsurgerydate.clone();
		if(this.endofcaredate == null)
			clone.endofcaredate = null;
		else
			clone.endofcaredate = (ims.framework.utils.Date)this.endofcaredate.clone();
		if(this.contract == null)
			clone.contract = null;
		else
			clone.contract = (ims.RefMan.vo.ContractConfigShortVo)this.contract.clone();
		clone.adminevent = this.adminevent;
		clone.pathwayid = this.pathwayid;
		clone.numprovidercancelledappts = this.numprovidercancelledappts;
		clone.numpatientcancelledappts = this.numpatientcancelledappts;
		clone.hasmultiplereferralletter = this.hasmultiplereferralletter;
		clone.consultationactivityrequired = this.consultationactivityrequired;
		if(this.patientcategory == null)
			clone.patientcategory = null;
		else
			clone.patientcategory = (ims.core.vo.lookups.PatientStatus)this.patientcategory.clone();
		clone.isemergencyreferral = this.isemergencyreferral;
		if(this.icabreferral == null)
			clone.icabreferral = null;
		else
			clone.icabreferral = (ims.admin.vo.ICABReferralLiteVo)this.icabreferral.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 (!(CatsReferralListVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A CatsReferralListVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		CatsReferralListVo compareObj = (CatsReferralListVo)obj;
		int retVal = 0;
		if (retVal == 0)
		{
			if(this.getReferralDetails() == null && compareObj.getReferralDetails() != null)
				return -1;
			if(this.getReferralDetails() != null && compareObj.getReferralDetails() == null)
				return 1;
			if(this.getReferralDetails() != null && compareObj.getReferralDetails() != null)
				retVal = this.getReferralDetails().compareTo(compareObj.getReferralDetails());
		}
		return retVal;
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = 0;
		if(this.patient != null)
			count++;
		if(this.referraldetails != null)
			count++;
		if(this.hasdocuments != null)
			count++;
		if(this.currentstatus != null)
			count++;
		if(this.hasinvestigations != null)
			count++;
		if(this.hasappointments != null)
			count++;
		if(this.carecontext != null)
			count++;
		if(this.hasreferralletter != null)
			count++;
		if(this.iscab != null)
			count++;
		if(this.consultationappt != null)
			count++;
		if(this.additionalinvapptsstatus != null)
			count++;
		if(this.hasrejectedinv != null)
			count++;
		if(this.providercancellation != null)
			count++;
		if(this.isflaggedforreview != null)
			count++;
		if(this.onwardreferralstatus != null)
			count++;
		if(this.statushistory != null)
			count++;
		if(this.hasconsultationdetails != null)
			count++;
		if(this.lastapptarriveddate != null)
			count++;
		if(this.hastltstartcontact != null)
			count++;
		if(this.issuitableforsurgery != null)
			count++;
		if(this.isfitforsurgery != null)
			count++;
		if(this.hastheatreappt != null)
			count++;
		if(this.haslinkedicp != null)
			count++;
		if(this.iscurrentlyallocated != null)
			count++;
		if(this.isawaitingclinicalinfo != null)
			count++;
		if(this.awaitingclinicalinfo != null)
			count++;
		if(this.opdlocation != null)
			count++;
		if(this.suitableforsurgerydate != null)
			count++;
		if(this.endofcaredate != null)
			count++;
		if(this.contract != null)
			count++;
		if(this.adminevent != null)
			count++;
		if(this.pathwayid != null)
			count++;
		if(this.numprovidercancelledappts != null)
			count++;
		if(this.numpatientcancelledappts != null)
			count++;
		if(this.hasmultiplereferralletter != null)
			count++;
		if(this.consultationactivityrequired != null)
			count++;
		if(this.patientcategory != null)
			count++;
		if(this.isemergencyreferral != null)
			count++;
		if(this.icabreferral != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return 39;
	}
	protected ims.core.vo.PatientShortListVo patient;
	protected ims.RefMan.vo.ReferralLetterDetailsLiteVo referraldetails;
	protected Boolean hasdocuments;
	protected ims.RefMan.vo.CatsReferralStatusVo currentstatus;
	protected Boolean hasinvestigations;
	protected Boolean hasappointments;
	protected ims.core.admin.vo.CareContextRefVo carecontext;
	protected Boolean hasreferralletter;
	protected Boolean iscab;
	protected ims.scheduling.vo.BookingAppointmentLiteVo consultationappt;
	protected ims.RefMan.vo.lookups.AdditionalInvestigationAppointmentsStatus additionalinvapptsstatus;
	protected Boolean hasrejectedinv;
	protected ims.RefMan.vo.ProviderCancellationRefVo providercancellation;
	protected Boolean isflaggedforreview;
	protected ims.RefMan.vo.lookups.OnwardReferralStatus onwardreferralstatus;
	protected ims.RefMan.vo.CatsReferralStatusVoCollection statushistory;
	protected Boolean hasconsultationdetails;
	protected ims.framework.utils.Date lastapptarriveddate;
	protected Boolean hastltstartcontact;
	protected Boolean issuitableforsurgery;
	protected Boolean isfitforsurgery;
	protected Boolean hastheatreappt;
	protected Boolean haslinkedicp;
	protected Boolean iscurrentlyallocated;
	protected Boolean isawaitingclinicalinfo;
	protected ims.RefMan.vo.AwaitingClinicalInfoVo awaitingclinicalinfo;
	protected ims.core.resource.place.vo.LocationRefVo opdlocation;
	protected ims.framework.utils.Date suitableforsurgerydate;
	protected ims.framework.utils.Date endofcaredate;
	protected ims.RefMan.vo.ContractConfigShortVo contract;
	protected ims.pathways.vo.AdminEventRefVoCollection adminevent;
	protected String pathwayid;
	protected Integer numprovidercancelledappts;
	protected Integer numpatientcancelledappts;
	protected Boolean hasmultiplereferralletter;
	protected Boolean consultationactivityrequired;
	protected ims.core.vo.lookups.PatientStatus patientcategory;
	protected Boolean isemergencyreferral;
	protected ims.admin.vo.ICABReferralLiteVo icabreferral;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
