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

/**
 * Linked to core.cds.CDSOutpatient business object (ID: 1104100000).
 */
public class CDSOutpatientVo extends ims.core.cds.vo.CDSOutpatientRefVo implements ims.vo.ImsCloneable, Comparable
{
	private static final long serialVersionUID = 1L;

	public CDSOutpatientVo()
	{
	}
	public CDSOutpatientVo(Integer id, int version)
	{
		super(id, version);
	}
	public CDSOutpatientVo(ims.core.vo.beans.CDSOutpatientVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.ubrn = bean.getUBRN();
		this.pathwayidentifier = bean.getPathwayIdentifier();
		this.pathwayorgcode = bean.getPathwayOrgCode();
		this.referraltotreatmentstatus = bean.getReferralToTreatmentStatus();
		this.rttstartdate = bean.getRTTStartDate() == null ? null : bean.getRTTStartDate().buildDate();
		this.rttenddate = bean.getRTTEndDate() == null ? null : bean.getRTTEndDate().buildDate();
		this.leadcareactind = bean.getLeadCareActInd();
		this.localpatientidentifier = bean.getLocalPatientIdentifier();
		this.patidorgcode = bean.getPatIdOrgCode();
		this.nhsnumber = bean.getNHSNumber();
		this.nhsnumberstatusind = bean.getNHSNumberStatusInd();
		this.patientname = bean.getPatientName();
		this.patientaddress = bean.getPatientAddress();
		this.postcode = bean.getPostCode();
		this.pctorgcode = bean.getPCTOrgCode();
		this.dateofbirth = bean.getDateOfBirth() == null ? null : bean.getDateOfBirth().buildDate();
		this.persongender = bean.getPersonGender();
		this.carersupportind = bean.getCarerSupportInd();
		this.ethniccategory = bean.getEthnicCategory();
		this.consultantcode = bean.getConsultantCode();
		this.specialtycode = bean.getSpecialtyCode();
		this.treatmentfunccode = bean.getTreatmentFuncCode();
		if(bean.getICDDiagGroup() != null)
		{
			this.icddiaggroup = new ims.core.cds.vo.CDSDiagnosisDetailsRefVoCollection();
			for(int icddiaggroup_i = 0; icddiaggroup_i < bean.getICDDiagGroup().length; icddiaggroup_i++)
			{
				this.icddiaggroup.add(new ims.core.cds.vo.CDSDiagnosisDetailsRefVo(new Integer(bean.getICDDiagGroup()[icddiaggroup_i].getId()), bean.getICDDiagGroup()[icddiaggroup_i].getVersion()));
			}
		}
		this.readdiaggroup = bean.getReadDiagGroup() == null ? null : new ims.core.cds.vo.CDSDiagnosisDetailsRefVo(new Integer(bean.getReadDiagGroup().getId()), bean.getReadDiagGroup().getVersion());
		this.attendanceidentifier = bean.getAttendanceIdentifier();
		this.admincategory = bean.getAdminCategory();
		this.attendedordna = bean.getAttendedOrDNA();
		this.firstattendance = bean.getFirstAttendance();
		this.medstafftype = bean.getMedStaffType();
		this.operationstatus = bean.getOperationStatus();
		this.attendoutcome = bean.getAttendOutcome();
		this.apptdate = bean.getApptDate() == null ? null : bean.getApptDate().buildDate();
		this.age = bean.getAge();
		this.earliestofferdate = bean.getEarliestOfferDate() == null ? null : bean.getEarliestOfferDate().buildDate();
		this.serialnumber = bean.getSerialNumber();
		this.nhsserviceagreenum = bean.getNHSServiceAgreeNum();
		this.providerrefnum = bean.getProviderRefNum();
		this.commissionerrefnum = bean.getCommissionerRefNum();
		this.orgcodeprovider = bean.getOrgCodeProvider();
		this.orgcodecommissioner = bean.getOrgCodeCommissioner();
		if(bean.getOPCSProcedure() != null)
		{
			this.opcsprocedure = new ims.core.cds.vo.CDSProcedureDetailsRefVoCollection();
			for(int opcsprocedure_i = 0; opcsprocedure_i < bean.getOPCSProcedure().length; opcsprocedure_i++)
			{
				this.opcsprocedure.add(new ims.core.cds.vo.CDSProcedureDetailsRefVo(new Integer(bean.getOPCSProcedure()[opcsprocedure_i].getId()), bean.getOPCSProcedure()[opcsprocedure_i].getVersion()));
			}
		}
		this.readprocedure = bean.getREADProcedure() == null ? null : new ims.core.cds.vo.CDSProcedureDetailsRefVo(new Integer(bean.getREADProcedure().getId()), bean.getREADProcedure().getVersion());
		this.locationclass = bean.getLocationClass();
		this.sitecodetreatment = bean.getSiteCodeTreatment();
		this.gpcode = bean.getGPCode();
		this.practicecode = bean.getPracticeCode();
		this.prioritytype = bean.getPriorityType();
		this.servicetypereq = bean.getServiceTypeReq();
		this.referralsource = bean.getReferralSource();
		this.referralreceiveddate = bean.getReferralReceivedDate() == null ? null : bean.getReferralReceivedDate().buildDate();
		this.referrercode = bean.getReferrerCode();
		this.orgcodereferrer = bean.getOrgCodeReferrer();
		this.lastdnacanceldate = bean.getLastDNACancelDate() == null ? null : bean.getLastDNACancelDate().buildDate();
		this.resourcegrpcode = bean.getResourceGrpCode();
		this.procedurescheme = bean.getProcedureScheme();
		this.hrgdominantgrouping = bean.getHrgDominantGrouping();
		this.cdsapplicabledate = bean.getCDSApplicableDate() == null ? null : bean.getCDSApplicableDate().buildDateTime();
		this.cdssenderorgcode = bean.getCDSSenderOrgCode();
		this.resourcegpversion = bean.getResourceGPVersion();
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.core.vo.beans.CDSOutpatientVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.ubrn = bean.getUBRN();
		this.pathwayidentifier = bean.getPathwayIdentifier();
		this.pathwayorgcode = bean.getPathwayOrgCode();
		this.referraltotreatmentstatus = bean.getReferralToTreatmentStatus();
		this.rttstartdate = bean.getRTTStartDate() == null ? null : bean.getRTTStartDate().buildDate();
		this.rttenddate = bean.getRTTEndDate() == null ? null : bean.getRTTEndDate().buildDate();
		this.leadcareactind = bean.getLeadCareActInd();
		this.localpatientidentifier = bean.getLocalPatientIdentifier();
		this.patidorgcode = bean.getPatIdOrgCode();
		this.nhsnumber = bean.getNHSNumber();
		this.nhsnumberstatusind = bean.getNHSNumberStatusInd();
		this.patientname = bean.getPatientName();
		this.patientaddress = bean.getPatientAddress();
		this.postcode = bean.getPostCode();
		this.pctorgcode = bean.getPCTOrgCode();
		this.dateofbirth = bean.getDateOfBirth() == null ? null : bean.getDateOfBirth().buildDate();
		this.persongender = bean.getPersonGender();
		this.carersupportind = bean.getCarerSupportInd();
		this.ethniccategory = bean.getEthnicCategory();
		this.consultantcode = bean.getConsultantCode();
		this.specialtycode = bean.getSpecialtyCode();
		this.treatmentfunccode = bean.getTreatmentFuncCode();
		if(bean.getICDDiagGroup() != null)
		{
			this.icddiaggroup = new ims.core.cds.vo.CDSDiagnosisDetailsRefVoCollection();
			for(int icddiaggroup_i = 0; icddiaggroup_i < bean.getICDDiagGroup().length; icddiaggroup_i++)
			{
				this.icddiaggroup.add(new ims.core.cds.vo.CDSDiagnosisDetailsRefVo(new Integer(bean.getICDDiagGroup()[icddiaggroup_i].getId()), bean.getICDDiagGroup()[icddiaggroup_i].getVersion()));
			}
		}
		this.readdiaggroup = bean.getReadDiagGroup() == null ? null : new ims.core.cds.vo.CDSDiagnosisDetailsRefVo(new Integer(bean.getReadDiagGroup().getId()), bean.getReadDiagGroup().getVersion());
		this.attendanceidentifier = bean.getAttendanceIdentifier();
		this.admincategory = bean.getAdminCategory();
		this.attendedordna = bean.getAttendedOrDNA();
		this.firstattendance = bean.getFirstAttendance();
		this.medstafftype = bean.getMedStaffType();
		this.operationstatus = bean.getOperationStatus();
		this.attendoutcome = bean.getAttendOutcome();
		this.apptdate = bean.getApptDate() == null ? null : bean.getApptDate().buildDate();
		this.age = bean.getAge();
		this.earliestofferdate = bean.getEarliestOfferDate() == null ? null : bean.getEarliestOfferDate().buildDate();
		this.serialnumber = bean.getSerialNumber();
		this.nhsserviceagreenum = bean.getNHSServiceAgreeNum();
		this.providerrefnum = bean.getProviderRefNum();
		this.commissionerrefnum = bean.getCommissionerRefNum();
		this.orgcodeprovider = bean.getOrgCodeProvider();
		this.orgcodecommissioner = bean.getOrgCodeCommissioner();
		if(bean.getOPCSProcedure() != null)
		{
			this.opcsprocedure = new ims.core.cds.vo.CDSProcedureDetailsRefVoCollection();
			for(int opcsprocedure_i = 0; opcsprocedure_i < bean.getOPCSProcedure().length; opcsprocedure_i++)
			{
				this.opcsprocedure.add(new ims.core.cds.vo.CDSProcedureDetailsRefVo(new Integer(bean.getOPCSProcedure()[opcsprocedure_i].getId()), bean.getOPCSProcedure()[opcsprocedure_i].getVersion()));
			}
		}
		this.readprocedure = bean.getREADProcedure() == null ? null : new ims.core.cds.vo.CDSProcedureDetailsRefVo(new Integer(bean.getREADProcedure().getId()), bean.getREADProcedure().getVersion());
		this.locationclass = bean.getLocationClass();
		this.sitecodetreatment = bean.getSiteCodeTreatment();
		this.gpcode = bean.getGPCode();
		this.practicecode = bean.getPracticeCode();
		this.prioritytype = bean.getPriorityType();
		this.servicetypereq = bean.getServiceTypeReq();
		this.referralsource = bean.getReferralSource();
		this.referralreceiveddate = bean.getReferralReceivedDate() == null ? null : bean.getReferralReceivedDate().buildDate();
		this.referrercode = bean.getReferrerCode();
		this.orgcodereferrer = bean.getOrgCodeReferrer();
		this.lastdnacanceldate = bean.getLastDNACancelDate() == null ? null : bean.getLastDNACancelDate().buildDate();
		this.resourcegrpcode = bean.getResourceGrpCode();
		this.procedurescheme = bean.getProcedureScheme();
		this.hrgdominantgrouping = bean.getHrgDominantGrouping();
		this.cdsapplicabledate = bean.getCDSApplicableDate() == null ? null : bean.getCDSApplicableDate().buildDateTime();
		this.cdssenderorgcode = bean.getCDSSenderOrgCode();
		this.resourcegpversion = bean.getResourceGPVersion();
	}
	public ims.vo.ValueObjectBean getBean()
	{
		return this.getBean(new ims.vo.ValueObjectBeanMap());
	}
	public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
	{
		ims.core.vo.beans.CDSOutpatientVoBean bean = null;
		if(map != null)
			bean = (ims.core.vo.beans.CDSOutpatientVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.core.vo.beans.CDSOutpatientVoBean();
			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("UBRN"))
			return getUBRN();
		if(fieldName.equals("PATHWAYIDENTIFIER"))
			return getPathwayIdentifier();
		if(fieldName.equals("PATHWAYORGCODE"))
			return getPathwayOrgCode();
		if(fieldName.equals("REFERRALTOTREATMENTSTATUS"))
			return getReferralToTreatmentStatus();
		if(fieldName.equals("RTTSTARTDATE"))
			return getRTTStartDate();
		if(fieldName.equals("RTTENDDATE"))
			return getRTTEndDate();
		if(fieldName.equals("LEADCAREACTIND"))
			return getLeadCareActInd();
		if(fieldName.equals("LOCALPATIENTIDENTIFIER"))
			return getLocalPatientIdentifier();
		if(fieldName.equals("PATIDORGCODE"))
			return getPatIdOrgCode();
		if(fieldName.equals("NHSNUMBER"))
			return getNHSNumber();
		if(fieldName.equals("NHSNUMBERSTATUSIND"))
			return getNHSNumberStatusInd();
		if(fieldName.equals("PATIENTNAME"))
			return getPatientName();
		if(fieldName.equals("PATIENTADDRESS"))
			return getPatientAddress();
		if(fieldName.equals("POSTCODE"))
			return getPostCode();
		if(fieldName.equals("PCTORGCODE"))
			return getPCTOrgCode();
		if(fieldName.equals("DATEOFBIRTH"))
			return getDateOfBirth();
		if(fieldName.equals("PERSONGENDER"))
			return getPersonGender();
		if(fieldName.equals("CARERSUPPORTIND"))
			return getCarerSupportInd();
		if(fieldName.equals("ETHNICCATEGORY"))
			return getEthnicCategory();
		if(fieldName.equals("CONSULTANTCODE"))
			return getConsultantCode();
		if(fieldName.equals("SPECIALTYCODE"))
			return getSpecialtyCode();
		if(fieldName.equals("TREATMENTFUNCCODE"))
			return getTreatmentFuncCode();
		if(fieldName.equals("ICDDIAGGROUP"))
			return getICDDiagGroup();
		if(fieldName.equals("READDIAGGROUP"))
			return getReadDiagGroup();
		if(fieldName.equals("ATTENDANCEIDENTIFIER"))
			return getAttendanceIdentifier();
		if(fieldName.equals("ADMINCATEGORY"))
			return getAdminCategory();
		if(fieldName.equals("ATTENDEDORDNA"))
			return getAttendedOrDNA();
		if(fieldName.equals("FIRSTATTENDANCE"))
			return getFirstAttendance();
		if(fieldName.equals("MEDSTAFFTYPE"))
			return getMedStaffType();
		if(fieldName.equals("OPERATIONSTATUS"))
			return getOperationStatus();
		if(fieldName.equals("ATTENDOUTCOME"))
			return getAttendOutcome();
		if(fieldName.equals("APPTDATE"))
			return getApptDate();
		if(fieldName.equals("AGE"))
			return getAge();
		if(fieldName.equals("EARLIESTOFFERDATE"))
			return getEarliestOfferDate();
		if(fieldName.equals("SERIALNUMBER"))
			return getSerialNumber();
		if(fieldName.equals("NHSSERVICEAGREENUM"))
			return getNHSServiceAgreeNum();
		if(fieldName.equals("PROVIDERREFNUM"))
			return getProviderRefNum();
		if(fieldName.equals("COMMISSIONERREFNUM"))
			return getCommissionerRefNum();
		if(fieldName.equals("ORGCODEPROVIDER"))
			return getOrgCodeProvider();
		if(fieldName.equals("ORGCODECOMMISSIONER"))
			return getOrgCodeCommissioner();
		if(fieldName.equals("OPCSPROCEDURE"))
			return getOPCSProcedure();
		if(fieldName.equals("READPROCEDURE"))
			return getREADProcedure();
		if(fieldName.equals("LOCATIONCLASS"))
			return getLocationClass();
		if(fieldName.equals("SITECODETREATMENT"))
			return getSiteCodeTreatment();
		if(fieldName.equals("GPCODE"))
			return getGPCode();
		if(fieldName.equals("PRACTICECODE"))
			return getPracticeCode();
		if(fieldName.equals("PRIORITYTYPE"))
			return getPriorityType();
		if(fieldName.equals("SERVICETYPEREQ"))
			return getServiceTypeReq();
		if(fieldName.equals("REFERRALSOURCE"))
			return getReferralSource();
		if(fieldName.equals("REFERRALRECEIVEDDATE"))
			return getReferralReceivedDate();
		if(fieldName.equals("REFERRERCODE"))
			return getReferrerCode();
		if(fieldName.equals("ORGCODEREFERRER"))
			return getOrgCodeReferrer();
		if(fieldName.equals("LASTDNACANCELDATE"))
			return getLastDNACancelDate();
		if(fieldName.equals("RESOURCEGRPCODE"))
			return getResourceGrpCode();
		if(fieldName.equals("PROCEDURESCHEME"))
			return getProcedureScheme();
		if(fieldName.equals("HRGDOMINANTGROUPING"))
			return getHrgDominantGrouping();
		if(fieldName.equals("CDSAPPLICABLEDATE"))
			return getCDSApplicableDate();
		if(fieldName.equals("CDSSENDERORGCODE"))
			return getCDSSenderOrgCode();
		if(fieldName.equals("RESOURCEGPVERSION"))
			return getResourceGPVersion();
		return super.getFieldValueByFieldName(fieldName);
	}
	public boolean getUBRNIsNotNull()
	{
		return this.ubrn != null;
	}
	public String getUBRN()
	{
		return this.ubrn;
	}
	public static int getUBRNMaxLength()
	{
		return 12;
	}
	public void setUBRN(String value)
	{
		this.isValidated = false;
		this.ubrn = value;
	}
	public boolean getPathwayIdentifierIsNotNull()
	{
		return this.pathwayidentifier != null;
	}
	public String getPathwayIdentifier()
	{
		return this.pathwayidentifier;
	}
	public static int getPathwayIdentifierMaxLength()
	{
		return 20;
	}
	public void setPathwayIdentifier(String value)
	{
		this.isValidated = false;
		this.pathwayidentifier = value;
	}
	public boolean getPathwayOrgCodeIsNotNull()
	{
		return this.pathwayorgcode != null;
	}
	public String getPathwayOrgCode()
	{
		return this.pathwayorgcode;
	}
	public static int getPathwayOrgCodeMaxLength()
	{
		return 3;
	}
	public void setPathwayOrgCode(String value)
	{
		this.isValidated = false;
		this.pathwayorgcode = value;
	}
	public boolean getReferralToTreatmentStatusIsNotNull()
	{
		return this.referraltotreatmentstatus != null;
	}
	public String getReferralToTreatmentStatus()
	{
		return this.referraltotreatmentstatus;
	}
	public static int getReferralToTreatmentStatusMaxLength()
	{
		return 2;
	}
	public void setReferralToTreatmentStatus(String value)
	{
		this.isValidated = false;
		this.referraltotreatmentstatus = value;
	}
	public boolean getRTTStartDateIsNotNull()
	{
		return this.rttstartdate != null;
	}
	public ims.framework.utils.Date getRTTStartDate()
	{
		return this.rttstartdate;
	}
	public void setRTTStartDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.rttstartdate = value;
	}
	public boolean getRTTEndDateIsNotNull()
	{
		return this.rttenddate != null;
	}
	public ims.framework.utils.Date getRTTEndDate()
	{
		return this.rttenddate;
	}
	public void setRTTEndDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.rttenddate = value;
	}
	public boolean getLeadCareActIndIsNotNull()
	{
		return this.leadcareactind != null;
	}
	public String getLeadCareActInd()
	{
		return this.leadcareactind;
	}
	public static int getLeadCareActIndMaxLength()
	{
		return 2;
	}
	public void setLeadCareActInd(String value)
	{
		this.isValidated = false;
		this.leadcareactind = value;
	}
	public boolean getLocalPatientIdentifierIsNotNull()
	{
		return this.localpatientidentifier != null;
	}
	public String getLocalPatientIdentifier()
	{
		return this.localpatientidentifier;
	}
	public static int getLocalPatientIdentifierMaxLength()
	{
		return 10;
	}
	public void setLocalPatientIdentifier(String value)
	{
		this.isValidated = false;
		this.localpatientidentifier = value;
	}
	public boolean getPatIdOrgCodeIsNotNull()
	{
		return this.patidorgcode != null;
	}
	public String getPatIdOrgCode()
	{
		return this.patidorgcode;
	}
	public static int getPatIdOrgCodeMaxLength()
	{
		return 5;
	}
	public void setPatIdOrgCode(String value)
	{
		this.isValidated = false;
		this.patidorgcode = value;
	}
	public boolean getNHSNumberIsNotNull()
	{
		return this.nhsnumber != null;
	}
	public String getNHSNumber()
	{
		return this.nhsnumber;
	}
	public static int getNHSNumberMaxLength()
	{
		return 17;
	}
	public void setNHSNumber(String value)
	{
		this.isValidated = false;
		this.nhsnumber = value;
	}
	public boolean getNHSNumberStatusIndIsNotNull()
	{
		return this.nhsnumberstatusind != null;
	}
	public String getNHSNumberStatusInd()
	{
		return this.nhsnumberstatusind;
	}
	public static int getNHSNumberStatusIndMaxLength()
	{
		return 2;
	}
	public void setNHSNumberStatusInd(String value)
	{
		this.isValidated = false;
		this.nhsnumberstatusind = value;
	}
	public boolean getPatientNameIsNotNull()
	{
		return this.patientname != null;
	}
	public String getPatientName()
	{
		return this.patientname;
	}
	public static int getPatientNameMaxLength()
	{
		return 70;
	}
	public void setPatientName(String value)
	{
		this.isValidated = false;
		this.patientname = value;
	}
	public boolean getPatientAddressIsNotNull()
	{
		return this.patientaddress != null;
	}
	public String getPatientAddress()
	{
		return this.patientaddress;
	}
	public static int getPatientAddressMaxLength()
	{
		return 175;
	}
	public void setPatientAddress(String value)
	{
		this.isValidated = false;
		this.patientaddress = value;
	}
	public boolean getPostCodeIsNotNull()
	{
		return this.postcode != null;
	}
	public String getPostCode()
	{
		return this.postcode;
	}
	public static int getPostCodeMaxLength()
	{
		return 8;
	}
	public void setPostCode(String value)
	{
		this.isValidated = false;
		this.postcode = value;
	}
	public boolean getPCTOrgCodeIsNotNull()
	{
		return this.pctorgcode != null;
	}
	public String getPCTOrgCode()
	{
		return this.pctorgcode;
	}
	public static int getPCTOrgCodeMaxLength()
	{
		return 3;
	}
	public void setPCTOrgCode(String value)
	{
		this.isValidated = false;
		this.pctorgcode = value;
	}
	public boolean getDateOfBirthIsNotNull()
	{
		return this.dateofbirth != null;
	}
	public ims.framework.utils.Date getDateOfBirth()
	{
		return this.dateofbirth;
	}
	public void setDateOfBirth(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.dateofbirth = value;
	}
	public boolean getPersonGenderIsNotNull()
	{
		return this.persongender != null;
	}
	public String getPersonGender()
	{
		return this.persongender;
	}
	public static int getPersonGenderMaxLength()
	{
		return 1;
	}
	public void setPersonGender(String value)
	{
		this.isValidated = false;
		this.persongender = value;
	}
	public boolean getCarerSupportIndIsNotNull()
	{
		return this.carersupportind != null;
	}
	public String getCarerSupportInd()
	{
		return this.carersupportind;
	}
	public static int getCarerSupportIndMaxLength()
	{
		return 2;
	}
	public void setCarerSupportInd(String value)
	{
		this.isValidated = false;
		this.carersupportind = value;
	}
	public boolean getEthnicCategoryIsNotNull()
	{
		return this.ethniccategory != null;
	}
	public String getEthnicCategory()
	{
		return this.ethniccategory;
	}
	public static int getEthnicCategoryMaxLength()
	{
		return 2;
	}
	public void setEthnicCategory(String value)
	{
		this.isValidated = false;
		this.ethniccategory = value;
	}
	public boolean getConsultantCodeIsNotNull()
	{
		return this.consultantcode != null;
	}
	public String getConsultantCode()
	{
		return this.consultantcode;
	}
	public static int getConsultantCodeMaxLength()
	{
		return 8;
	}
	public void setConsultantCode(String value)
	{
		this.isValidated = false;
		this.consultantcode = value;
	}
	public boolean getSpecialtyCodeIsNotNull()
	{
		return this.specialtycode != null;
	}
	public String getSpecialtyCode()
	{
		return this.specialtycode;
	}
	public static int getSpecialtyCodeMaxLength()
	{
		return 3;
	}
	public void setSpecialtyCode(String value)
	{
		this.isValidated = false;
		this.specialtycode = value;
	}
	public boolean getTreatmentFuncCodeIsNotNull()
	{
		return this.treatmentfunccode != null;
	}
	public String getTreatmentFuncCode()
	{
		return this.treatmentfunccode;
	}
	public static int getTreatmentFuncCodeMaxLength()
	{
		return 3;
	}
	public void setTreatmentFuncCode(String value)
	{
		this.isValidated = false;
		this.treatmentfunccode = value;
	}
	public boolean getICDDiagGroupIsNotNull()
	{
		return this.icddiaggroup != null;
	}
	public ims.core.cds.vo.CDSDiagnosisDetailsRefVoCollection getICDDiagGroup()
	{
		return this.icddiaggroup;
	}
	public void setICDDiagGroup(ims.core.cds.vo.CDSDiagnosisDetailsRefVoCollection value)
	{
		this.isValidated = false;
		this.icddiaggroup = value;
	}
	public boolean getReadDiagGroupIsNotNull()
	{
		return this.readdiaggroup != null;
	}
	public ims.core.cds.vo.CDSDiagnosisDetailsRefVo getReadDiagGroup()
	{
		return this.readdiaggroup;
	}
	public void setReadDiagGroup(ims.core.cds.vo.CDSDiagnosisDetailsRefVo value)
	{
		this.isValidated = false;
		this.readdiaggroup = value;
	}
	public boolean getAttendanceIdentifierIsNotNull()
	{
		return this.attendanceidentifier != null;
	}
	public String getAttendanceIdentifier()
	{
		return this.attendanceidentifier;
	}
	public static int getAttendanceIdentifierMaxLength()
	{
		return 12;
	}
	public void setAttendanceIdentifier(String value)
	{
		this.isValidated = false;
		this.attendanceidentifier = value;
	}
	public boolean getAdminCategoryIsNotNull()
	{
		return this.admincategory != null;
	}
	public String getAdminCategory()
	{
		return this.admincategory;
	}
	public static int getAdminCategoryMaxLength()
	{
		return 2;
	}
	public void setAdminCategory(String value)
	{
		this.isValidated = false;
		this.admincategory = value;
	}
	public boolean getAttendedOrDNAIsNotNull()
	{
		return this.attendedordna != null;
	}
	public String getAttendedOrDNA()
	{
		return this.attendedordna;
	}
	public static int getAttendedOrDNAMaxLength()
	{
		return 1;
	}
	public void setAttendedOrDNA(String value)
	{
		this.isValidated = false;
		this.attendedordna = value;
	}
	public boolean getFirstAttendanceIsNotNull()
	{
		return this.firstattendance != null;
	}
	public String getFirstAttendance()
	{
		return this.firstattendance;
	}
	public static int getFirstAttendanceMaxLength()
	{
		return 1;
	}
	public void setFirstAttendance(String value)
	{
		this.isValidated = false;
		this.firstattendance = value;
	}
	public boolean getMedStaffTypeIsNotNull()
	{
		return this.medstafftype != null;
	}
	public String getMedStaffType()
	{
		return this.medstafftype;
	}
	public static int getMedStaffTypeMaxLength()
	{
		return 2;
	}
	public void setMedStaffType(String value)
	{
		this.isValidated = false;
		this.medstafftype = value;
	}
	public boolean getOperationStatusIsNotNull()
	{
		return this.operationstatus != null;
	}
	public String getOperationStatus()
	{
		return this.operationstatus;
	}
	public static int getOperationStatusMaxLength()
	{
		return 1;
	}
	public void setOperationStatus(String value)
	{
		this.isValidated = false;
		this.operationstatus = value;
	}
	public boolean getAttendOutcomeIsNotNull()
	{
		return this.attendoutcome != null;
	}
	public String getAttendOutcome()
	{
		return this.attendoutcome;
	}
	public static int getAttendOutcomeMaxLength()
	{
		return 1;
	}
	public void setAttendOutcome(String value)
	{
		this.isValidated = false;
		this.attendoutcome = value;
	}
	public boolean getApptDateIsNotNull()
	{
		return this.apptdate != null;
	}
	public ims.framework.utils.Date getApptDate()
	{
		return this.apptdate;
	}
	public void setApptDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.apptdate = value;
	}
	public boolean getAgeIsNotNull()
	{
		return this.age != null;
	}
	public Integer getAge()
	{
		return this.age;
	}
	public void setAge(Integer value)
	{
		this.isValidated = false;
		this.age = value;
	}
	public boolean getEarliestOfferDateIsNotNull()
	{
		return this.earliestofferdate != null;
	}
	public ims.framework.utils.Date getEarliestOfferDate()
	{
		return this.earliestofferdate;
	}
	public void setEarliestOfferDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.earliestofferdate = value;
	}
	public boolean getSerialNumberIsNotNull()
	{
		return this.serialnumber != null;
	}
	public String getSerialNumber()
	{
		return this.serialnumber;
	}
	public static int getSerialNumberMaxLength()
	{
		return 6;
	}
	public void setSerialNumber(String value)
	{
		this.isValidated = false;
		this.serialnumber = value;
	}
	public boolean getNHSServiceAgreeNumIsNotNull()
	{
		return this.nhsserviceagreenum != null;
	}
	public String getNHSServiceAgreeNum()
	{
		return this.nhsserviceagreenum;
	}
	public static int getNHSServiceAgreeNumMaxLength()
	{
		return 10;
	}
	public void setNHSServiceAgreeNum(String value)
	{
		this.isValidated = false;
		this.nhsserviceagreenum = value;
	}
	public boolean getProviderRefNumIsNotNull()
	{
		return this.providerrefnum != null;
	}
	public String getProviderRefNum()
	{
		return this.providerrefnum;
	}
	public static int getProviderRefNumMaxLength()
	{
		return 17;
	}
	public void setProviderRefNum(String value)
	{
		this.isValidated = false;
		this.providerrefnum = value;
	}
	public boolean getCommissionerRefNumIsNotNull()
	{
		return this.commissionerrefnum != null;
	}
	public String getCommissionerRefNum()
	{
		return this.commissionerrefnum;
	}
	public static int getCommissionerRefNumMaxLength()
	{
		return 17;
	}
	public void setCommissionerRefNum(String value)
	{
		this.isValidated = false;
		this.commissionerrefnum = value;
	}
	public boolean getOrgCodeProviderIsNotNull()
	{
		return this.orgcodeprovider != null;
	}
	public String getOrgCodeProvider()
	{
		return this.orgcodeprovider;
	}
	public static int getOrgCodeProviderMaxLength()
	{
		return 5;
	}
	public void setOrgCodeProvider(String value)
	{
		this.isValidated = false;
		this.orgcodeprovider = value;
	}
	public boolean getOrgCodeCommissionerIsNotNull()
	{
		return this.orgcodecommissioner != null;
	}
	public String getOrgCodeCommissioner()
	{
		return this.orgcodecommissioner;
	}
	public static int getOrgCodeCommissionerMaxLength()
	{
		return 5;
	}
	public void setOrgCodeCommissioner(String value)
	{
		this.isValidated = false;
		this.orgcodecommissioner = value;
	}
	public boolean getOPCSProcedureIsNotNull()
	{
		return this.opcsprocedure != null;
	}
	public ims.core.cds.vo.CDSProcedureDetailsRefVoCollection getOPCSProcedure()
	{
		return this.opcsprocedure;
	}
	public void setOPCSProcedure(ims.core.cds.vo.CDSProcedureDetailsRefVoCollection value)
	{
		this.isValidated = false;
		this.opcsprocedure = value;
	}
	public boolean getREADProcedureIsNotNull()
	{
		return this.readprocedure != null;
	}
	public ims.core.cds.vo.CDSProcedureDetailsRefVo getREADProcedure()
	{
		return this.readprocedure;
	}
	public void setREADProcedure(ims.core.cds.vo.CDSProcedureDetailsRefVo value)
	{
		this.isValidated = false;
		this.readprocedure = value;
	}
	public boolean getLocationClassIsNotNull()
	{
		return this.locationclass != null;
	}
	public String getLocationClass()
	{
		return this.locationclass;
	}
	public static int getLocationClassMaxLength()
	{
		return 2;
	}
	public void setLocationClass(String value)
	{
		this.isValidated = false;
		this.locationclass = value;
	}
	public boolean getSiteCodeTreatmentIsNotNull()
	{
		return this.sitecodetreatment != null;
	}
	public String getSiteCodeTreatment()
	{
		return this.sitecodetreatment;
	}
	public static int getSiteCodeTreatmentMaxLength()
	{
		return 5;
	}
	public void setSiteCodeTreatment(String value)
	{
		this.isValidated = false;
		this.sitecodetreatment = value;
	}
	public boolean getGPCodeIsNotNull()
	{
		return this.gpcode != null;
	}
	public String getGPCode()
	{
		return this.gpcode;
	}
	public static int getGPCodeMaxLength()
	{
		return 8;
	}
	public void setGPCode(String value)
	{
		this.isValidated = false;
		this.gpcode = value;
	}
	public boolean getPracticeCodeIsNotNull()
	{
		return this.practicecode != null;
	}
	public String getPracticeCode()
	{
		return this.practicecode;
	}
	public static int getPracticeCodeMaxLength()
	{
		return 6;
	}
	public void setPracticeCode(String value)
	{
		this.isValidated = false;
		this.practicecode = value;
	}
	public boolean getPriorityTypeIsNotNull()
	{
		return this.prioritytype != null;
	}
	public String getPriorityType()
	{
		return this.prioritytype;
	}
	public static int getPriorityTypeMaxLength()
	{
		return 1;
	}
	public void setPriorityType(String value)
	{
		this.isValidated = false;
		this.prioritytype = value;
	}
	public boolean getServiceTypeReqIsNotNull()
	{
		return this.servicetypereq != null;
	}
	public String getServiceTypeReq()
	{
		return this.servicetypereq;
	}
	public static int getServiceTypeReqMaxLength()
	{
		return 1;
	}
	public void setServiceTypeReq(String value)
	{
		this.isValidated = false;
		this.servicetypereq = value;
	}
	public boolean getReferralSourceIsNotNull()
	{
		return this.referralsource != null;
	}
	public String getReferralSource()
	{
		return this.referralsource;
	}
	public static int getReferralSourceMaxLength()
	{
		return 2;
	}
	public void setReferralSource(String value)
	{
		this.isValidated = false;
		this.referralsource = value;
	}
	public boolean getReferralReceivedDateIsNotNull()
	{
		return this.referralreceiveddate != null;
	}
	public ims.framework.utils.Date getReferralReceivedDate()
	{
		return this.referralreceiveddate;
	}
	public void setReferralReceivedDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.referralreceiveddate = value;
	}
	public boolean getReferrerCodeIsNotNull()
	{
		return this.referrercode != null;
	}
	public String getReferrerCode()
	{
		return this.referrercode;
	}
	public static int getReferrerCodeMaxLength()
	{
		return 8;
	}
	public void setReferrerCode(String value)
	{
		this.isValidated = false;
		this.referrercode = value;
	}
	public boolean getOrgCodeReferrerIsNotNull()
	{
		return this.orgcodereferrer != null;
	}
	public String getOrgCodeReferrer()
	{
		return this.orgcodereferrer;
	}
	public static int getOrgCodeReferrerMaxLength()
	{
		return 6;
	}
	public void setOrgCodeReferrer(String value)
	{
		this.isValidated = false;
		this.orgcodereferrer = value;
	}
	public boolean getLastDNACancelDateIsNotNull()
	{
		return this.lastdnacanceldate != null;
	}
	public ims.framework.utils.Date getLastDNACancelDate()
	{
		return this.lastdnacanceldate;
	}
	public void setLastDNACancelDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.lastdnacanceldate = value;
	}
	public boolean getResourceGrpCodeIsNotNull()
	{
		return this.resourcegrpcode != null;
	}
	public String getResourceGrpCode()
	{
		return this.resourcegrpcode;
	}
	public static int getResourceGrpCodeMaxLength()
	{
		return 3;
	}
	public void setResourceGrpCode(String value)
	{
		this.isValidated = false;
		this.resourcegrpcode = value;
	}
	public boolean getProcedureSchemeIsNotNull()
	{
		return this.procedurescheme != null;
	}
	public String getProcedureScheme()
	{
		return this.procedurescheme;
	}
	public static int getProcedureSchemeMaxLength()
	{
		return 2;
	}
	public void setProcedureScheme(String value)
	{
		this.isValidated = false;
		this.procedurescheme = value;
	}
	public boolean getHrgDominantGroupingIsNotNull()
	{
		return this.hrgdominantgrouping != null;
	}
	public String getHrgDominantGrouping()
	{
		return this.hrgdominantgrouping;
	}
	public static int getHrgDominantGroupingMaxLength()
	{
		return 4;
	}
	public void setHrgDominantGrouping(String value)
	{
		this.isValidated = false;
		this.hrgdominantgrouping = value;
	}
	public boolean getCDSApplicableDateIsNotNull()
	{
		return this.cdsapplicabledate != null;
	}
	public ims.framework.utils.DateTime getCDSApplicableDate()
	{
		return this.cdsapplicabledate;
	}
	public void setCDSApplicableDate(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.cdsapplicabledate = value;
	}
	public boolean getCDSSenderOrgCodeIsNotNull()
	{
		return this.cdssenderorgcode != null;
	}
	public String getCDSSenderOrgCode()
	{
		return this.cdssenderorgcode;
	}
	public static int getCDSSenderOrgCodeMaxLength()
	{
		return 5;
	}
	public void setCDSSenderOrgCode(String value)
	{
		this.isValidated = false;
		this.cdssenderorgcode = value;
	}
	public boolean getResourceGPVersionIsNotNull()
	{
		return this.resourcegpversion != null;
	}
	public String getResourceGPVersion()
	{
		return this.resourcegpversion;
	}
	public static int getResourceGPVersionMaxLength()
	{
		return 3;
	}
	public void setResourceGPVersion(String value)
	{
		this.isValidated = false;
		this.resourcegpversion = 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.ubrn != null)
			if(this.ubrn.length() > 12)
				listOfErrors.add("The length of the field [ubrn] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 12");
		if(this.pathwayidentifier != null)
			if(this.pathwayidentifier.length() > 20)
				listOfErrors.add("The length of the field [pathwayidentifier] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 20");
		if(this.pathwayorgcode != null)
			if(this.pathwayorgcode.length() > 3)
				listOfErrors.add("The length of the field [pathwayorgcode] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 3");
		if(this.referraltotreatmentstatus != null)
			if(this.referraltotreatmentstatus.length() > 2)
				listOfErrors.add("The length of the field [referraltotreatmentstatus] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 2");
		if(this.leadcareactind != null)
			if(this.leadcareactind.length() > 2)
				listOfErrors.add("The length of the field [leadcareactind] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 2");
		if(this.localpatientidentifier == null || this.localpatientidentifier.length() == 0)
			listOfErrors.add("LocalPatientIdentifier is mandatory");
		else if(this.localpatientidentifier.length() > 10)
			listOfErrors.add("The length of the field [localpatientidentifier] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 10");
		if(this.patidorgcode != null)
			if(this.patidorgcode.length() > 5)
				listOfErrors.add("The length of the field [patidorgcode] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 5");
		if(this.nhsnumber != null)
			if(this.nhsnumber.length() > 17)
				listOfErrors.add("The length of the field [nhsnumber] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 17");
		if(this.nhsnumberstatusind != null)
			if(this.nhsnumberstatusind.length() > 2)
				listOfErrors.add("The length of the field [nhsnumberstatusind] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 2");
		if(this.patientname != null)
			if(this.patientname.length() > 70)
				listOfErrors.add("The length of the field [patientname] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 70");
		if(this.patientaddress != null)
			if(this.patientaddress.length() > 175)
				listOfErrors.add("The length of the field [patientaddress] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 175");
		if(this.postcode != null)
			if(this.postcode.length() > 8)
				listOfErrors.add("The length of the field [postcode] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 8");
		if(this.pctorgcode != null)
			if(this.pctorgcode.length() > 3)
				listOfErrors.add("The length of the field [pctorgcode] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 3");
		if(this.persongender != null)
			if(this.persongender.length() > 1)
				listOfErrors.add("The length of the field [persongender] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 1");
		if(this.carersupportind != null)
			if(this.carersupportind.length() > 2)
				listOfErrors.add("The length of the field [carersupportind] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 2");
		if(this.ethniccategory != null)
			if(this.ethniccategory.length() > 2)
				listOfErrors.add("The length of the field [ethniccategory] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 2");
		if(this.consultantcode != null)
			if(this.consultantcode.length() > 8)
				listOfErrors.add("The length of the field [consultantcode] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 8");
		if(this.specialtycode != null)
			if(this.specialtycode.length() > 3)
				listOfErrors.add("The length of the field [specialtycode] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 3");
		if(this.treatmentfunccode != null)
			if(this.treatmentfunccode.length() > 3)
				listOfErrors.add("The length of the field [treatmentfunccode] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 3");
		if(this.attendanceidentifier != null)
			if(this.attendanceidentifier.length() > 12)
				listOfErrors.add("The length of the field [attendanceidentifier] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 12");
		if(this.admincategory != null)
			if(this.admincategory.length() > 2)
				listOfErrors.add("The length of the field [admincategory] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 2");
		if(this.attendedordna != null)
			if(this.attendedordna.length() > 1)
				listOfErrors.add("The length of the field [attendedordna] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 1");
		if(this.firstattendance != null)
			if(this.firstattendance.length() > 1)
				listOfErrors.add("The length of the field [firstattendance] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 1");
		if(this.medstafftype != null)
			if(this.medstafftype.length() > 2)
				listOfErrors.add("The length of the field [medstafftype] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 2");
		if(this.operationstatus != null)
			if(this.operationstatus.length() > 1)
				listOfErrors.add("The length of the field [operationstatus] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 1");
		if(this.attendoutcome != null)
			if(this.attendoutcome.length() > 1)
				listOfErrors.add("The length of the field [attendoutcome] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 1");
		if(this.serialnumber != null)
			if(this.serialnumber.length() > 6)
				listOfErrors.add("The length of the field [serialnumber] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 6");
		if(this.nhsserviceagreenum != null)
			if(this.nhsserviceagreenum.length() > 10)
				listOfErrors.add("The length of the field [nhsserviceagreenum] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 10");
		if(this.providerrefnum != null)
			if(this.providerrefnum.length() > 17)
				listOfErrors.add("The length of the field [providerrefnum] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 17");
		if(this.commissionerrefnum != null)
			if(this.commissionerrefnum.length() > 17)
				listOfErrors.add("The length of the field [commissionerrefnum] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 17");
		if(this.orgcodeprovider != null)
			if(this.orgcodeprovider.length() > 5)
				listOfErrors.add("The length of the field [orgcodeprovider] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 5");
		if(this.orgcodecommissioner != null)
			if(this.orgcodecommissioner.length() > 5)
				listOfErrors.add("The length of the field [orgcodecommissioner] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 5");
		if(this.locationclass != null)
			if(this.locationclass.length() > 2)
				listOfErrors.add("The length of the field [locationclass] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 2");
		if(this.sitecodetreatment != null)
			if(this.sitecodetreatment.length() > 5)
				listOfErrors.add("The length of the field [sitecodetreatment] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 5");
		if(this.gpcode != null)
			if(this.gpcode.length() > 8)
				listOfErrors.add("The length of the field [gpcode] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 8");
		if(this.practicecode != null)
			if(this.practicecode.length() > 6)
				listOfErrors.add("The length of the field [practicecode] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 6");
		if(this.prioritytype != null)
			if(this.prioritytype.length() > 1)
				listOfErrors.add("The length of the field [prioritytype] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 1");
		if(this.servicetypereq != null)
			if(this.servicetypereq.length() > 1)
				listOfErrors.add("The length of the field [servicetypereq] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 1");
		if(this.referralsource != null)
			if(this.referralsource.length() > 2)
				listOfErrors.add("The length of the field [referralsource] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 2");
		if(this.referrercode != null)
			if(this.referrercode.length() > 8)
				listOfErrors.add("The length of the field [referrercode] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 8");
		if(this.orgcodereferrer != null)
			if(this.orgcodereferrer.length() > 6)
				listOfErrors.add("The length of the field [orgcodereferrer] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 6");
		if(this.resourcegrpcode != null)
			if(this.resourcegrpcode.length() > 3)
				listOfErrors.add("The length of the field [resourcegrpcode] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 3");
		if(this.procedurescheme != null)
			if(this.procedurescheme.length() > 2)
				listOfErrors.add("The length of the field [procedurescheme] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 2");
		if(this.hrgdominantgrouping != null)
			if(this.hrgdominantgrouping.length() > 4)
				listOfErrors.add("The length of the field [hrgdominantgrouping] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 4");
		if(this.cdsapplicabledate == null)
			listOfErrors.add("CDSApplicableDate is mandatory");
		if(this.cdssenderorgcode == null || this.cdssenderorgcode.length() == 0)
			listOfErrors.add("CDSSenderOrgCode is mandatory");
		else if(this.cdssenderorgcode.length() > 5)
			listOfErrors.add("The length of the field [cdssenderorgcode] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 5");
		if(this.resourcegpversion != null)
			if(this.resourcegpversion.length() > 3)
				listOfErrors.add("The length of the field [resourcegpversion] in the value object [ims.core.vo.CDSOutpatientVo] is too big. It should be less or equal to 3");
		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;
	
		CDSOutpatientVo clone = new CDSOutpatientVo(this.id, this.version);
		
		clone.ubrn = this.ubrn;
		clone.pathwayidentifier = this.pathwayidentifier;
		clone.pathwayorgcode = this.pathwayorgcode;
		clone.referraltotreatmentstatus = this.referraltotreatmentstatus;
		if(this.rttstartdate == null)
			clone.rttstartdate = null;
		else
			clone.rttstartdate = (ims.framework.utils.Date)this.rttstartdate.clone();
		if(this.rttenddate == null)
			clone.rttenddate = null;
		else
			clone.rttenddate = (ims.framework.utils.Date)this.rttenddate.clone();
		clone.leadcareactind = this.leadcareactind;
		clone.localpatientidentifier = this.localpatientidentifier;
		clone.patidorgcode = this.patidorgcode;
		clone.nhsnumber = this.nhsnumber;
		clone.nhsnumberstatusind = this.nhsnumberstatusind;
		clone.patientname = this.patientname;
		clone.patientaddress = this.patientaddress;
		clone.postcode = this.postcode;
		clone.pctorgcode = this.pctorgcode;
		if(this.dateofbirth == null)
			clone.dateofbirth = null;
		else
			clone.dateofbirth = (ims.framework.utils.Date)this.dateofbirth.clone();
		clone.persongender = this.persongender;
		clone.carersupportind = this.carersupportind;
		clone.ethniccategory = this.ethniccategory;
		clone.consultantcode = this.consultantcode;
		clone.specialtycode = this.specialtycode;
		clone.treatmentfunccode = this.treatmentfunccode;
		clone.icddiaggroup = this.icddiaggroup;
		clone.readdiaggroup = this.readdiaggroup;
		clone.attendanceidentifier = this.attendanceidentifier;
		clone.admincategory = this.admincategory;
		clone.attendedordna = this.attendedordna;
		clone.firstattendance = this.firstattendance;
		clone.medstafftype = this.medstafftype;
		clone.operationstatus = this.operationstatus;
		clone.attendoutcome = this.attendoutcome;
		if(this.apptdate == null)
			clone.apptdate = null;
		else
			clone.apptdate = (ims.framework.utils.Date)this.apptdate.clone();
		clone.age = this.age;
		if(this.earliestofferdate == null)
			clone.earliestofferdate = null;
		else
			clone.earliestofferdate = (ims.framework.utils.Date)this.earliestofferdate.clone();
		clone.serialnumber = this.serialnumber;
		clone.nhsserviceagreenum = this.nhsserviceagreenum;
		clone.providerrefnum = this.providerrefnum;
		clone.commissionerrefnum = this.commissionerrefnum;
		clone.orgcodeprovider = this.orgcodeprovider;
		clone.orgcodecommissioner = this.orgcodecommissioner;
		clone.opcsprocedure = this.opcsprocedure;
		clone.readprocedure = this.readprocedure;
		clone.locationclass = this.locationclass;
		clone.sitecodetreatment = this.sitecodetreatment;
		clone.gpcode = this.gpcode;
		clone.practicecode = this.practicecode;
		clone.prioritytype = this.prioritytype;
		clone.servicetypereq = this.servicetypereq;
		clone.referralsource = this.referralsource;
		if(this.referralreceiveddate == null)
			clone.referralreceiveddate = null;
		else
			clone.referralreceiveddate = (ims.framework.utils.Date)this.referralreceiveddate.clone();
		clone.referrercode = this.referrercode;
		clone.orgcodereferrer = this.orgcodereferrer;
		if(this.lastdnacanceldate == null)
			clone.lastdnacanceldate = null;
		else
			clone.lastdnacanceldate = (ims.framework.utils.Date)this.lastdnacanceldate.clone();
		clone.resourcegrpcode = this.resourcegrpcode;
		clone.procedurescheme = this.procedurescheme;
		clone.hrgdominantgrouping = this.hrgdominantgrouping;
		if(this.cdsapplicabledate == null)
			clone.cdsapplicabledate = null;
		else
			clone.cdsapplicabledate = (ims.framework.utils.DateTime)this.cdsapplicabledate.clone();
		clone.cdssenderorgcode = this.cdssenderorgcode;
		clone.resourcegpversion = this.resourcegpversion;
		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 (!(CDSOutpatientVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A CDSOutpatientVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		if (this.id == null)
			return 1;
		if (((CDSOutpatientVo)obj).getBoId() == null)
			return -1;
		return this.id.compareTo(((CDSOutpatientVo)obj).getBoId());
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = 0;
		if(this.ubrn != null)
			count++;
		if(this.pathwayidentifier != null)
			count++;
		if(this.pathwayorgcode != null)
			count++;
		if(this.referraltotreatmentstatus != null)
			count++;
		if(this.rttstartdate != null)
			count++;
		if(this.rttenddate != null)
			count++;
		if(this.leadcareactind != null)
			count++;
		if(this.localpatientidentifier != null)
			count++;
		if(this.patidorgcode != null)
			count++;
		if(this.nhsnumber != null)
			count++;
		if(this.nhsnumberstatusind != null)
			count++;
		if(this.patientname != null)
			count++;
		if(this.patientaddress != null)
			count++;
		if(this.postcode != null)
			count++;
		if(this.pctorgcode != null)
			count++;
		if(this.dateofbirth != null)
			count++;
		if(this.persongender != null)
			count++;
		if(this.carersupportind != null)
			count++;
		if(this.ethniccategory != null)
			count++;
		if(this.consultantcode != null)
			count++;
		if(this.specialtycode != null)
			count++;
		if(this.treatmentfunccode != null)
			count++;
		if(this.icddiaggroup != null)
			count++;
		if(this.readdiaggroup != null)
			count++;
		if(this.attendanceidentifier != null)
			count++;
		if(this.admincategory != null)
			count++;
		if(this.attendedordna != null)
			count++;
		if(this.firstattendance != null)
			count++;
		if(this.medstafftype != null)
			count++;
		if(this.operationstatus != null)
			count++;
		if(this.attendoutcome != null)
			count++;
		if(this.apptdate != null)
			count++;
		if(this.age != null)
			count++;
		if(this.earliestofferdate != null)
			count++;
		if(this.serialnumber != null)
			count++;
		if(this.nhsserviceagreenum != null)
			count++;
		if(this.providerrefnum != null)
			count++;
		if(this.commissionerrefnum != null)
			count++;
		if(this.orgcodeprovider != null)
			count++;
		if(this.orgcodecommissioner != null)
			count++;
		if(this.opcsprocedure != null)
			count++;
		if(this.readprocedure != null)
			count++;
		if(this.locationclass != null)
			count++;
		if(this.sitecodetreatment != null)
			count++;
		if(this.gpcode != null)
			count++;
		if(this.practicecode != null)
			count++;
		if(this.prioritytype != null)
			count++;
		if(this.servicetypereq != null)
			count++;
		if(this.referralsource != null)
			count++;
		if(this.referralreceiveddate != null)
			count++;
		if(this.referrercode != null)
			count++;
		if(this.orgcodereferrer != null)
			count++;
		if(this.lastdnacanceldate != null)
			count++;
		if(this.resourcegrpcode != null)
			count++;
		if(this.procedurescheme != null)
			count++;
		if(this.hrgdominantgrouping != null)
			count++;
		if(this.cdsapplicabledate != null)
			count++;
		if(this.cdssenderorgcode != null)
			count++;
		if(this.resourcegpversion != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return 59;
	}
	protected String ubrn;
	protected String pathwayidentifier;
	protected String pathwayorgcode;
	protected String referraltotreatmentstatus;
	protected ims.framework.utils.Date rttstartdate;
	protected ims.framework.utils.Date rttenddate;
	protected String leadcareactind;
	protected String localpatientidentifier;
	protected String patidorgcode;
	protected String nhsnumber;
	protected String nhsnumberstatusind;
	protected String patientname;
	protected String patientaddress;
	protected String postcode;
	protected String pctorgcode;
	protected ims.framework.utils.Date dateofbirth;
	protected String persongender;
	protected String carersupportind;
	protected String ethniccategory;
	protected String consultantcode;
	protected String specialtycode;
	protected String treatmentfunccode;
	protected ims.core.cds.vo.CDSDiagnosisDetailsRefVoCollection icddiaggroup;
	protected ims.core.cds.vo.CDSDiagnosisDetailsRefVo readdiaggroup;
	protected String attendanceidentifier;
	protected String admincategory;
	protected String attendedordna;
	protected String firstattendance;
	protected String medstafftype;
	protected String operationstatus;
	protected String attendoutcome;
	protected ims.framework.utils.Date apptdate;
	protected Integer age;
	protected ims.framework.utils.Date earliestofferdate;
	protected String serialnumber;
	protected String nhsserviceagreenum;
	protected String providerrefnum;
	protected String commissionerrefnum;
	protected String orgcodeprovider;
	protected String orgcodecommissioner;
	protected ims.core.cds.vo.CDSProcedureDetailsRefVoCollection opcsprocedure;
	protected ims.core.cds.vo.CDSProcedureDetailsRefVo readprocedure;
	protected String locationclass;
	protected String sitecodetreatment;
	protected String gpcode;
	protected String practicecode;
	protected String prioritytype;
	protected String servicetypereq;
	protected String referralsource;
	protected ims.framework.utils.Date referralreceiveddate;
	protected String referrercode;
	protected String orgcodereferrer;
	protected ims.framework.utils.Date lastdnacanceldate;
	protected String resourcegrpcode;
	protected String procedurescheme;
	protected String hrgdominantgrouping;
	protected ims.framework.utils.DateTime cdsapplicabledate;
	protected String cdssenderorgcode;
	protected String resourcegpversion;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
