/FileExtraction/Java_unseen/IMS-MAXIMS_openMAXIMS/Source Library/openmaxims_workspace/ValueObjects/src/ims/core/vo/PatientShort.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.patient.Patient business object (ID: 1001100000).
 */
public class PatientShort extends ims.core.patient.vo.PatientRefVo implements ims.vo.ImsCloneable, Comparable, ims.framework.interfaces.ISelectedPatient
{
	private static final long serialVersionUID = 1L;

	public PatientShort()
	{
	}
	public PatientShort(Integer id, int version)
	{
		super(id, version);
	}
	public PatientShort(ims.core.vo.beans.PatientShortBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.name = bean.getName() == null ? null : bean.getName().buildVo();
		this.sex = bean.getSex() == null ? null : ims.core.vo.lookups.Sex.buildLookup(bean.getSex());
		this.age = bean.getAge();
		this.agetext = bean.getAgeText();
		this.address = bean.getAddress() == null ? null : bean.getAddress().buildVo();
		this.dob = bean.getDob() == null ? null : bean.getDob().buildPartialDate();
		this.dod = bean.getDod() == null ? null : bean.getDod().buildDate();
		this.ward = bean.getWard() == null ? null : bean.getWard().buildVo();
		this.religion = bean.getReligion() == null ? null : ims.core.vo.lookups.Religion.buildLookup(bean.getReligion());
		this.hasallergies = bean.getHasAllergies();
		this.hasalerts = bean.getHasAlerts();
		this.identifiers = ims.core.vo.PatientIdCollection.buildFromBeanCollection(bean.getIdentifiers());
		this.isactive = bean.getIsActive();
		this.associatedpatient = bean.getAssociatedPatient() == null ? null : bean.getAssociatedPatient().buildVo();
		this.commchannels = ims.core.vo.CommChannelVoCollection.buildFromBeanCollection(bean.getCommChannels());
		this.ethnicorigin = bean.getEthnicOrigin() == null ? null : ims.core.vo.lookups.EthnicOrigin.buildLookup(bean.getEthnicOrigin());
		this.maritalstatus = bean.getMaritalStatus() == null ? null : ims.core.vo.lookups.MaritalStatus.buildLookup(bean.getMaritalStatus());
		this.scn = bean.getSCN();
		this.sourceofinformation = bean.getSourceOfInformation() == null ? null : ims.core.vo.lookups.RegistrationSourceOfInfo.buildLookup(bean.getSourceOfInformation());
		this.sysinfo = bean.getSysInfo() == null ? null : bean.getSysInfo().buildSystemInformation();
		this.hasactivealerts = bean.getHasActiveAlerts();
		this.timeofdeath = bean.getTimeOfDeath() == null ? null : bean.getTimeOfDeath().buildTime();
		this.isquickregistrationpatient = bean.getIsQuickRegistrationPatient();
		this.ocsnotification = bean.getOCSNotification() == null ? null : bean.getOCSNotification().buildVo();
		this.currentresponsibleconsultant = bean.getCurrentResponsibleConsultant() == null ? null : new ims.core.resource.people.vo.MedicRefVo(new Integer(bean.getCurrentResponsibleConsultant().getId()), bean.getCurrentResponsibleConsultant().getVersion());
		this.dementiabreachdatetime = bean.getDementiaBreachDateTime() == null ? null : bean.getDementiaBreachDateTime().buildDateTime();
		this.dementiaworkliststatus = bean.getDementiaWorklistStatus() == null ? null : ims.core.vo.lookups.DementiaWorklistStatus.buildLookup(bean.getDementiaWorklistStatus());
		this.mrnstatus = bean.getMRNStatus() == null ? null : ims.core.vo.lookups.MRNStatus.buildLookup(bean.getMRNStatus());
		this.hasscannedcasenotefolders = bean.getHasScannedCaseNoteFolders();
		this.isconfidential = bean.getIsConfidential();
		this.timeofbirth = bean.getTimeOfBirth() == null ? null : bean.getTimeOfBirth().buildTime();
		this.isselfadmitpatient = bean.getIsSelfAdmitPatient();
		this.patientcategory = bean.getPatientCategory() == null ? null : ims.core.vo.lookups.PatientStatus.buildLookup(bean.getPatientCategory());
		this.pdspatientgp = bean.getPDSPatientGP() == null ? null : bean.getPDSPatientGP().buildVo();
		this.hasalertcategory1 = bean.getHasAlertCategory1();
		this.hasalertcategory2 = bean.getHasAlertCategory2();
		this.hasalertcategory3 = bean.getHasAlertCategory3();
		this.hasalertcategory4 = bean.getHasAlertCategory4();
		this.hasalertcategoryother = bean.getHasAlertCategoryOther();
		this.futureapptscancelonmarkdeceasedanswer = bean.getFutureApptsCancelOnMarkDeceasedAnswer();
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.core.vo.beans.PatientShortBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.name = bean.getName() == null ? null : bean.getName().buildVo(map);
		this.sex = bean.getSex() == null ? null : ims.core.vo.lookups.Sex.buildLookup(bean.getSex());
		this.age = bean.getAge();
		this.agetext = bean.getAgeText();
		this.address = bean.getAddress() == null ? null : bean.getAddress().buildVo(map);
		this.dob = bean.getDob() == null ? null : bean.getDob().buildPartialDate();
		this.dod = bean.getDod() == null ? null : bean.getDod().buildDate();
		this.ward = bean.getWard() == null ? null : bean.getWard().buildVo(map);
		this.religion = bean.getReligion() == null ? null : ims.core.vo.lookups.Religion.buildLookup(bean.getReligion());
		this.hasallergies = bean.getHasAllergies();
		this.hasalerts = bean.getHasAlerts();
		this.identifiers = ims.core.vo.PatientIdCollection.buildFromBeanCollection(bean.getIdentifiers());
		this.isactive = bean.getIsActive();
		this.associatedpatient = bean.getAssociatedPatient() == null ? null : bean.getAssociatedPatient().buildVo(map);
		this.commchannels = ims.core.vo.CommChannelVoCollection.buildFromBeanCollection(bean.getCommChannels());
		this.ethnicorigin = bean.getEthnicOrigin() == null ? null : ims.core.vo.lookups.EthnicOrigin.buildLookup(bean.getEthnicOrigin());
		this.maritalstatus = bean.getMaritalStatus() == null ? null : ims.core.vo.lookups.MaritalStatus.buildLookup(bean.getMaritalStatus());
		this.scn = bean.getSCN();
		this.sourceofinformation = bean.getSourceOfInformation() == null ? null : ims.core.vo.lookups.RegistrationSourceOfInfo.buildLookup(bean.getSourceOfInformation());
		this.sysinfo = bean.getSysInfo() == null ? null : bean.getSysInfo().buildSystemInformation();
		this.hasactivealerts = bean.getHasActiveAlerts();
		this.timeofdeath = bean.getTimeOfDeath() == null ? null : bean.getTimeOfDeath().buildTime();
		this.isquickregistrationpatient = bean.getIsQuickRegistrationPatient();
		this.ocsnotification = bean.getOCSNotification() == null ? null : bean.getOCSNotification().buildVo(map);
		this.currentresponsibleconsultant = bean.getCurrentResponsibleConsultant() == null ? null : new ims.core.resource.people.vo.MedicRefVo(new Integer(bean.getCurrentResponsibleConsultant().getId()), bean.getCurrentResponsibleConsultant().getVersion());
		this.dementiabreachdatetime = bean.getDementiaBreachDateTime() == null ? null : bean.getDementiaBreachDateTime().buildDateTime();
		this.dementiaworkliststatus = bean.getDementiaWorklistStatus() == null ? null : ims.core.vo.lookups.DementiaWorklistStatus.buildLookup(bean.getDementiaWorklistStatus());
		this.mrnstatus = bean.getMRNStatus() == null ? null : ims.core.vo.lookups.MRNStatus.buildLookup(bean.getMRNStatus());
		this.hasscannedcasenotefolders = bean.getHasScannedCaseNoteFolders();
		this.isconfidential = bean.getIsConfidential();
		this.timeofbirth = bean.getTimeOfBirth() == null ? null : bean.getTimeOfBirth().buildTime();
		this.isselfadmitpatient = bean.getIsSelfAdmitPatient();
		this.patientcategory = bean.getPatientCategory() == null ? null : ims.core.vo.lookups.PatientStatus.buildLookup(bean.getPatientCategory());
		this.pdspatientgp = bean.getPDSPatientGP() == null ? null : bean.getPDSPatientGP().buildVo(map);
		this.hasalertcategory1 = bean.getHasAlertCategory1();
		this.hasalertcategory2 = bean.getHasAlertCategory2();
		this.hasalertcategory3 = bean.getHasAlertCategory3();
		this.hasalertcategory4 = bean.getHasAlertCategory4();
		this.hasalertcategoryother = bean.getHasAlertCategoryOther();
		this.futureapptscancelonmarkdeceasedanswer = bean.getFutureApptsCancelOnMarkDeceasedAnswer();
	}
	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.PatientShortBean bean = null;
		if(map != null)
			bean = (ims.core.vo.beans.PatientShortBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.core.vo.beans.PatientShortBean();
			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("NAME"))
			return getName();
		if(fieldName.equals("SEX"))
			return getSex();
		if(fieldName.equals("AGE"))
			return getAge();
		if(fieldName.equals("AGETEXT"))
			return getAgeText();
		if(fieldName.equals("ADDRESS"))
			return getAddress();
		if(fieldName.equals("DOB"))
			return getDob();
		if(fieldName.equals("DOD"))
			return getDod();
		if(fieldName.equals("WARD"))
			return getWard();
		if(fieldName.equals("RELIGION"))
			return getReligion();
		if(fieldName.equals("HASALLERGIES"))
			return getHasAllergies();
		if(fieldName.equals("HASALERTS"))
			return getHasAlerts();
		if(fieldName.equals("IDENTIFIERS"))
			return getIdentifiers();
		if(fieldName.equals("ISACTIVE"))
			return getIsActive();
		if(fieldName.equals("ASSOCIATEDPATIENT"))
			return getAssociatedPatient();
		if(fieldName.equals("COMMCHANNELS"))
			return getCommChannels();
		if(fieldName.equals("ETHNICORIGIN"))
			return getEthnicOrigin();
		if(fieldName.equals("MARITALSTATUS"))
			return getMaritalStatus();
		if(fieldName.equals("SCN"))
			return getSCN();
		if(fieldName.equals("SOURCEOFINFORMATION"))
			return getSourceOfInformation();
		if(fieldName.equals("SYSINFO"))
			return getSysInfo();
		if(fieldName.equals("HASACTIVEALERTS"))
			return getHasActiveAlerts();
		if(fieldName.equals("TIMEOFDEATH"))
			return getTimeOfDeath();
		if(fieldName.equals("ISQUICKREGISTRATIONPATIENT"))
			return getIsQuickRegistrationPatient();
		if(fieldName.equals("OCSNOTIFICATION"))
			return getOCSNotification();
		if(fieldName.equals("CURRENTRESPONSIBLECONSULTANT"))
			return getCurrentResponsibleConsultant();
		if(fieldName.equals("DEMENTIABREACHDATETIME"))
			return getDementiaBreachDateTime();
		if(fieldName.equals("DEMENTIAWORKLISTSTATUS"))
			return getDementiaWorklistStatus();
		if(fieldName.equals("MRNSTATUS"))
			return getMRNStatus();
		if(fieldName.equals("HASSCANNEDCASENOTEFOLDERS"))
			return getHasScannedCaseNoteFolders();
		if(fieldName.equals("ISCONFIDENTIAL"))
			return getIsConfidential();
		if(fieldName.equals("TIMEOFBIRTH"))
			return getTimeOfBirth();
		if(fieldName.equals("ISSELFADMITPATIENT"))
			return getIsSelfAdmitPatient();
		if(fieldName.equals("PATIENTCATEGORY"))
			return getPatientCategory();
		if(fieldName.equals("PDSPATIENTGP"))
			return getPDSPatientGP();
		if(fieldName.equals("HASALERTCATEGORY1"))
			return getHasAlertCategory1();
		if(fieldName.equals("HASALERTCATEGORY2"))
			return getHasAlertCategory2();
		if(fieldName.equals("HASALERTCATEGORY3"))
			return getHasAlertCategory3();
		if(fieldName.equals("HASALERTCATEGORY4"))
			return getHasAlertCategory4();
		if(fieldName.equals("HASALERTCATEGORYOTHER"))
			return getHasAlertCategoryOther();
		if(fieldName.equals("FUTUREAPPTSCANCELONMARKDECEASEDANSWER"))
			return getFutureApptsCancelOnMarkDeceasedAnswer();
		return super.getFieldValueByFieldName(fieldName);
	}
	public boolean getNameIsNotNull()
	{
		return this.name != null;
	}
	public ims.core.vo.PersonName getName()
	{
		return this.name;
	}
	public void setName(ims.core.vo.PersonName value)
	{
		this.isValidated = false;
		this.name = value;
	}
	public boolean getSexIsNotNull()
	{
		return this.sex != null;
	}
	public ims.core.vo.lookups.Sex getSex()
	{
		return this.sex;
	}
	public void setSex(ims.core.vo.lookups.Sex value)
	{
		this.isValidated = false;
		this.sex = 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 getAgeTextIsNotNull()
	{
		return this.agetext != null;
	}
	public String getAgeText()
	{
		return this.agetext;
	}
	public static int getAgeTextMaxLength()
	{
		return 255;
	}
	public void setAgeText(String value)
	{
		this.isValidated = false;
		this.agetext = value;
	}
	public boolean getAddressIsNotNull()
	{
		return this.address != null;
	}
	public ims.core.vo.PersonAddress getAddress()
	{
		return this.address;
	}
	public void setAddress(ims.core.vo.PersonAddress value)
	{
		this.isValidated = false;
		this.address = value;
	}
	public boolean getDobIsNotNull()
	{
		return this.dob != null;
	}
	public ims.framework.utils.PartialDate getDob()
	{
		return this.dob;
	}
	public void setDob(ims.framework.utils.PartialDate value)
	{
		this.isValidated = false;
		this.dob = value;
	}
	public boolean getDodIsNotNull()
	{
		return this.dod != null;
	}
	public ims.framework.utils.Date getDod()
	{
		return this.dod;
	}
	public void setDod(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.dod = value;
	}
	public boolean getWardIsNotNull()
	{
		return this.ward != null;
	}
	public ims.core.vo.LocationLiteVo getWard()
	{
		return this.ward;
	}
	public void setWard(ims.core.vo.LocationLiteVo value)
	{
		this.isValidated = false;
		this.ward = value;
	}
	public boolean getReligionIsNotNull()
	{
		return this.religion != null;
	}
	public ims.core.vo.lookups.Religion getReligion()
	{
		return this.religion;
	}
	public void setReligion(ims.core.vo.lookups.Religion value)
	{
		this.isValidated = false;
		this.religion = value;
	}
	public boolean getHasAllergiesIsNotNull()
	{
		return this.hasallergies != null;
	}
	public Boolean getHasAllergies()
	{
		return this.hasallergies;
	}
	public void setHasAllergies(Boolean value)
	{
		this.isValidated = false;
		this.hasallergies = value;
	}
	public boolean getHasAlertsIsNotNull()
	{
		return this.hasalerts != null;
	}
	public Boolean getHasAlerts()
	{
		return this.hasalerts;
	}
	public void setHasAlerts(Boolean value)
	{
		this.isValidated = false;
		this.hasalerts = value;
	}
	public boolean getIdentifiersIsNotNull()
	{
		return this.identifiers != null;
	}
	public ims.core.vo.PatientIdCollection getIdentifiers()
	{
		return this.identifiers;
	}
	public void setIdentifiers(ims.core.vo.PatientIdCollection value)
	{
		this.isValidated = false;
		this.identifiers = value;
	}
	public boolean getIsActiveIsNotNull()
	{
		return this.isactive != null;
	}
	public Boolean getIsActive()
	{
		return this.isactive;
	}
	public void setIsActive(Boolean value)
	{
		this.isValidated = false;
		this.isactive = value;
	}
	public boolean getAssociatedPatientIsNotNull()
	{
		return this.associatedpatient != null;
	}
	public ims.core.vo.PatientShort getAssociatedPatient()
	{
		return this.associatedpatient;
	}
	public void setAssociatedPatient(ims.core.vo.PatientShort value)
	{
		this.isValidated = false;
		this.associatedpatient = value;
	}
	public boolean getCommChannelsIsNotNull()
	{
		return this.commchannels != null;
	}
	public ims.core.vo.CommChannelVoCollection getCommChannels()
	{
		return this.commchannels;
	}
	public void setCommChannels(ims.core.vo.CommChannelVoCollection value)
	{
		this.isValidated = false;
		this.commchannels = value;
	}
	public boolean getEthnicOriginIsNotNull()
	{
		return this.ethnicorigin != null;
	}
	public ims.core.vo.lookups.EthnicOrigin getEthnicOrigin()
	{
		return this.ethnicorigin;
	}
	public void setEthnicOrigin(ims.core.vo.lookups.EthnicOrigin value)
	{
		this.isValidated = false;
		this.ethnicorigin = value;
	}
	public boolean getMaritalStatusIsNotNull()
	{
		return this.maritalstatus != null;
	}
	public ims.core.vo.lookups.MaritalStatus getMaritalStatus()
	{
		return this.maritalstatus;
	}
	public void setMaritalStatus(ims.core.vo.lookups.MaritalStatus value)
	{
		this.isValidated = false;
		this.maritalstatus = value;
	}
	public boolean getSCNIsNotNull()
	{
		return this.scn != null;
	}
	public Integer getSCN()
	{
		return this.scn;
	}
	public void setSCN(Integer value)
	{
		this.isValidated = false;
		this.scn = value;
	}
	public boolean getSourceOfInformationIsNotNull()
	{
		return this.sourceofinformation != null;
	}
	public ims.core.vo.lookups.RegistrationSourceOfInfo getSourceOfInformation()
	{
		return this.sourceofinformation;
	}
	public void setSourceOfInformation(ims.core.vo.lookups.RegistrationSourceOfInfo value)
	{
		this.isValidated = false;
		this.sourceofinformation = value;
	}
	public boolean getSysInfoIsNotNull()
	{
		return this.sysinfo != null;
	}
	public ims.vo.SystemInformation getSysInfo()
	{
		return this.sysinfo;
	}
	public void setSysInfo(ims.vo.SystemInformation value)
	{
		this.isValidated = false;
		this.sysinfo = value;
	}
	public boolean getHasActiveAlertsIsNotNull()
	{
		return this.hasactivealerts != null;
	}
	public Boolean getHasActiveAlerts()
	{
		return this.hasactivealerts;
	}
	public void setHasActiveAlerts(Boolean value)
	{
		this.isValidated = false;
		this.hasactivealerts = value;
	}
	public boolean getTimeOfDeathIsNotNull()
	{
		return this.timeofdeath != null;
	}
	public ims.framework.utils.Time getTimeOfDeath()
	{
		return this.timeofdeath;
	}
	public void setTimeOfDeath(ims.framework.utils.Time value)
	{
		this.isValidated = false;
		this.timeofdeath = value;
	}
	public boolean getIsQuickRegistrationPatientIsNotNull()
	{
		return this.isquickregistrationpatient != null;
	}
	public Boolean getIsQuickRegistrationPatient()
	{
		return this.isquickregistrationpatient;
	}
	public void setIsQuickRegistrationPatient(Boolean value)
	{
		this.isValidated = false;
		this.isquickregistrationpatient = value;
	}
	public boolean getOCSNotificationIsNotNull()
	{
		return this.ocsnotification != null;
	}
	public ims.core.vo.PatientNotificationsFillerOnlyVo getOCSNotification()
	{
		return this.ocsnotification;
	}
	public void setOCSNotification(ims.core.vo.PatientNotificationsFillerOnlyVo value)
	{
		this.isValidated = false;
		this.ocsnotification = value;
	}
	public boolean getCurrentResponsibleConsultantIsNotNull()
	{
		return this.currentresponsibleconsultant != null;
	}
	public ims.core.resource.people.vo.MedicRefVo getCurrentResponsibleConsultant()
	{
		return this.currentresponsibleconsultant;
	}
	public void setCurrentResponsibleConsultant(ims.core.resource.people.vo.MedicRefVo value)
	{
		this.isValidated = false;
		this.currentresponsibleconsultant = value;
	}
	public boolean getDementiaBreachDateTimeIsNotNull()
	{
		return this.dementiabreachdatetime != null;
	}
	public ims.framework.utils.DateTime getDementiaBreachDateTime()
	{
		return this.dementiabreachdatetime;
	}
	public void setDementiaBreachDateTime(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.dementiabreachdatetime = value;
	}
	public boolean getDementiaWorklistStatusIsNotNull()
	{
		return this.dementiaworkliststatus != null;
	}
	public ims.core.vo.lookups.DementiaWorklistStatus getDementiaWorklistStatus()
	{
		return this.dementiaworkliststatus;
	}
	public void setDementiaWorklistStatus(ims.core.vo.lookups.DementiaWorklistStatus value)
	{
		this.isValidated = false;
		this.dementiaworkliststatus = value;
	}
	public boolean getMRNStatusIsNotNull()
	{
		return this.mrnstatus != null;
	}
	public ims.core.vo.lookups.MRNStatus getMRNStatus()
	{
		return this.mrnstatus;
	}
	public void setMRNStatus(ims.core.vo.lookups.MRNStatus value)
	{
		this.isValidated = false;
		this.mrnstatus = value;
	}
	public boolean getHasScannedCaseNoteFoldersIsNotNull()
	{
		return this.hasscannedcasenotefolders != null;
	}
	public Boolean getHasScannedCaseNoteFolders()
	{
		return this.hasscannedcasenotefolders;
	}
	public void setHasScannedCaseNoteFolders(Boolean value)
	{
		this.isValidated = false;
		this.hasscannedcasenotefolders = value;
	}
	public boolean getIsConfidentialIsNotNull()
	{
		return this.isconfidential != null;
	}
	public Boolean getIsConfidential()
	{
		return this.isconfidential;
	}
	public void setIsConfidential(Boolean value)
	{
		this.isValidated = false;
		this.isconfidential = value;
	}
	public boolean getTimeOfBirthIsNotNull()
	{
		return this.timeofbirth != null;
	}
	public ims.framework.utils.Time getTimeOfBirth()
	{
		return this.timeofbirth;
	}
	public void setTimeOfBirth(ims.framework.utils.Time value)
	{
		this.isValidated = false;
		this.timeofbirth = value;
	}
	public boolean getIsSelfAdmitPatientIsNotNull()
	{
		return this.isselfadmitpatient != null;
	}
	public Boolean getIsSelfAdmitPatient()
	{
		return this.isselfadmitpatient;
	}
	public void setIsSelfAdmitPatient(Boolean value)
	{
		this.isValidated = false;
		this.isselfadmitpatient = 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 getPDSPatientGPIsNotNull()
	{
		return this.pdspatientgp != null;
	}
	public ims.core.vo.PDSPatientGPVo getPDSPatientGP()
	{
		return this.pdspatientgp;
	}
	public void setPDSPatientGP(ims.core.vo.PDSPatientGPVo value)
	{
		this.isValidated = false;
		this.pdspatientgp = value;
	}
	public boolean getHasAlertCategory1IsNotNull()
	{
		return this.hasalertcategory1 != null;
	}
	public Boolean getHasAlertCategory1()
	{
		return this.hasalertcategory1;
	}
	public void setHasAlertCategory1(Boolean value)
	{
		this.isValidated = false;
		this.hasalertcategory1 = value;
	}
	public boolean getHasAlertCategory2IsNotNull()
	{
		return this.hasalertcategory2 != null;
	}
	public Boolean getHasAlertCategory2()
	{
		return this.hasalertcategory2;
	}
	public void setHasAlertCategory2(Boolean value)
	{
		this.isValidated = false;
		this.hasalertcategory2 = value;
	}
	public boolean getHasAlertCategory3IsNotNull()
	{
		return this.hasalertcategory3 != null;
	}
	public Boolean getHasAlertCategory3()
	{
		return this.hasalertcategory3;
	}
	public void setHasAlertCategory3(Boolean value)
	{
		this.isValidated = false;
		this.hasalertcategory3 = value;
	}
	public boolean getHasAlertCategory4IsNotNull()
	{
		return this.hasalertcategory4 != null;
	}
	public Boolean getHasAlertCategory4()
	{
		return this.hasalertcategory4;
	}
	public void setHasAlertCategory4(Boolean value)
	{
		this.isValidated = false;
		this.hasalertcategory4 = value;
	}
	public boolean getHasAlertCategoryOtherIsNotNull()
	{
		return this.hasalertcategoryother != null;
	}
	public Boolean getHasAlertCategoryOther()
	{
		return this.hasalertcategoryother;
	}
	public void setHasAlertCategoryOther(Boolean value)
	{
		this.isValidated = false;
		this.hasalertcategoryother = value;
	}
	public boolean getFutureApptsCancelOnMarkDeceasedAnswerIsNotNull()
	{
		return this.futureapptscancelonmarkdeceasedanswer != null;
	}
	public Boolean getFutureApptsCancelOnMarkDeceasedAnswer()
	{
		return this.futureapptscancelonmarkdeceasedanswer;
	}
	public void setFutureApptsCancelOnMarkDeceasedAnswer(Boolean value)
	{
		this.isValidated = false;
		this.futureapptscancelonmarkdeceasedanswer = value;
	}
	/**
	* getPatientInfo: Returns a formatted String suitable for display in the patient info bar
	*/
	public String getPatientInfo()
	{
		calculateAge();
		java.lang.StringBuffer sb = new java.lang.StringBuffer("");
	
		if (dod != null)
		{
			sb.append(ims.configuration.ConfigFlag.UI.RIP_INFO_PREFIX.getValue());
		}
		if (this.getName() != null)
		{
			if(Boolean.TRUE.equals(ims.configuration.ConfigFlag.UI.DISPLAY_PATIENT_NAME_IN_PROPER_CASE.getValue()))	//WDEV-12193
			{
				sb.append(this.getName().toProperCase() + " ");
			}
			else
			{
				sb.append(this.getName().toString() + " ");
			}
		}
		if (this.dob != null)
		{
			sb.append(": " + dob.toString(ims.framework.utils.DateFormat.STANDARD));
			if (ims.configuration.ConfigFlag.UI.HAS_PAEDIATRIC_PATIENTS.getValue())
				sb.append(" Age: " + new ims.framework.utils.Age(this.dob, this.dod).toPaediatricString() + " ");
			else
				sb.append(" Age: " + new ims.framework.utils.Age(this.dob, this.dod) + " ");
		}
		else
		{
			sb.append(": DOB Unknown ");
		}
		if (this.sex !=null)
		{
			sb.append(" " + this.sex.toString() + ". ");
		}
		else
		{
			sb.append(": Sex Unknown. ");
		}
		ims.core.vo.PatientId id = getDisplayId();
		if (id != null) 
		{
			if (id.getVerified() != null
					&& id.getVerified().equals( Boolean.FALSE) 
					&& id.getType().equals(ims.core.vo.lookups.PatIdType.NHSN))
			{
				sb.append(id.getType().getText() + ": " + "***" + id.getValue() + " ");
			}
			else
			{
				sb.append(id.getType().getText() + ": " + id.getValue() + " ");
			}
		}
		else if (ims.core.vo.lookups.PatIdType.getNegativeInstance(ims.configuration.ConfigFlag.UI.DISPLAY_PATID_TYPE.getValue()).equals(ims.core.vo.lookups.PatIdType.MRNNUM)
				&& getPatId(ims.core.vo.lookups.PatIdType.MRNNUM) == null)
		{
			sb.append(ims.core.vo.lookups.PatIdType.MRNNUM.getText()).append(": ").append(mrnstatus != null ? mrnstatus.getIItemText() : "");
		}
	
		if (ward != null)
		{
			sb.append( "(" + ward.getName() + ")");
		}
	
		return sb.toString();
	}
	
	
	/**
	* calculateAge: calculate's the patient's Age based on DOB and DOD
	*/
	public Integer calculateAge()
	{
		calculateAgeText();
		if (dob != null)
		{		
			int patAge = 0;
			if (dod != null)
			{
				patAge = dod.yearDiff(dob);
			}
			else
			{
				patAge = new ims.framework.utils.Age(this.dob, this.dod).getYears();
			}
			setAge(new Integer(patAge));
		}
		return getAge();
	}
	
	/**
	* getPatId: Gets the patient identifier for the type passed in
	*/
	public ims.core.vo.PatientId getPatId(ims.core.vo.lookups.PatIdType idType)
	{
		if (identifiers == null) return null;
		for (int i = 0; i < identifiers.size(); i++)
		{
			ims.core.vo.PatientId id = identifiers.get(i);
			if (id.getType().equals(idType))
			{
				return id;
			}
		}
		return null;
	}
	/**
	* getDisplayId: Gets the default identifier as specified by the ConfigFlag.UI.DEFAULT_PATIENT_ID_TYPE
	*/
	public ims.core.vo.PatientId getDisplayId()
	{
		String name = ims.configuration.ConfigFlag.UI.DISPLAY_PATID_TYPE.getValue();
		ims.core.vo.lookups.PatIdType type = ims.core.vo.lookups.PatIdType.getNegativeInstance(name);
		
		if (type == null) type = ims.core.vo.lookups.PatIdType.HOSPNUM;
		return getPatId(type);
	}
	/**
	* getInterfaceid: Gets the default id use for interfacing
	*/
	public ims.core.vo.PatientId getInterfaceId()
	{
		String name = ims.configuration.ConfigFlag.DOM.INTERFACE_PATID_TYPE.getValue();
		ims.core.vo.lookups.PatIdType type = ims.core.vo.lookups.PatIdType.getNegativeInstance(name);
		
		if (type == null) type = ims.core.vo.lookups.PatIdType.HOSPNUM;
		return getPatId(type);
	}
	
	/**
	* getHospnum: 
	*/
	public ims.core.vo.PatientId getHospnum()
	{
		return getPatId(ims.core.vo.lookups.PatIdType.HOSPNUM);
	}
	
	/**
	* getChartnum
	*/
	public ims.core.vo.PatientId getChartnum()
	{
		return getPatId(ims.core.vo.lookups.PatIdType.CHARTNUM);
	}
	/**
	* getNhsn
	*/
	public ims.core.vo.PatientId getNhsn()
	{
		return getPatId(ims.core.vo.lookups.PatIdType.NHSN);
	}
	/**
	* getPkey
	*/
	public ims.core.vo.PatientId getPkey()
	{
		return getPatId(ims.core.vo.lookups.PatIdType.PKEY);
	}
	/**
	* getPpsn
	*/
	public ims.core.vo.PatientId getPpsn()
	{
		return getPatId(ims.core.vo.lookups.PatIdType.PPSN);
	}
	/**
	* addId: Add a new Patient ID to the collection of id's
	*/
	public void addId(ims.core.vo.lookups.PatIdType type, String val)
	{
		addId(type, val, false);
	}
	public void addId(ims.core.vo.lookups.PatIdType type, String val, Boolean verified)
	{
		if (identifiers == null) identifiers = new ims.core.vo.PatientIdCollection();
		ims.core.vo.PatientId id = getPatId(type);
		if (id != null)
		{
			if (val == null || val.length() == 0)
			{
				identifiers.remove(identifiers.indexOf(id));
			}
			else
			{
				id.setValue(val);
				id.setVerified(verified);
			}	
		}
		else
		{
			if (val != null && val.length() > 0)
			{
				id = new ims.core.vo.PatientId();
				id.setType(type);
				id.setValue(val);
				id.setVerified(verified);
				identifiers.add(id);
			}
				
		}
	}
	/**
	* setName: Takes in name parts and contructs PersonName
	*/
	public void setName(String surname, String forename, String midname)
	{
		if (name == null) name = new ims.core.vo.PersonName();
		name .setSurname(surname);
		name .setForename(forename);
		name .setMiddleName(midname);
	}
	/**
	* getIsDead: Is the Patient Dead
	*/
	public Boolean getIsDead()
	{
		Boolean bIsDead = Boolean.FALSE;
		if(dod != null)
			bIsDead =  Boolean.TRUE;
			
		return bIsDead;
	}
	/**
	* getNtpfnum
	*/
	public ims.core.vo.PatientId getNtpfnum()
	{
		return getPatId(ims.core.vo.lookups.PatIdType.NTPFNUM);
	}
	/**
	* getMsgMergedPatient: returns a formatted warning message for the merged patientss
	*/
	public String getMsgMergedPatient(ims.core.vo.lookups.PatIdType patIdType)
	{
	    PatientId patId = getPatId(patIdType);
	    
	    StringBuffer sbMessage = new StringBuffer();
	    sbMessage.append("This patient has been merged with patient ");
	    sbMessage.append(patIdType != null?patIdType.toString():" id");
	    sbMessage.append(" ");
	    sbMessage.append(patId != null?patId.getValue():"");
	    return sbMessage.toString();
	}
	/**
	* getLastMergedPatient: Gets recursively the last merged patient
	*/
	public PatientShort getLastMergedPatient() 
	{
	    if(this.getAssociatedPatientIsNotNull())
	        return getAssociatedPatient(this.getAssociatedPatient()); 
	    return null;
	}
	
	private PatientShort getAssociatedPatient(PatientShort patient)
	{
	    if(patient.getAssociatedPatientIsNotNull())
	        return getAssociatedPatient(patient.getAssociatedPatient());
	            
	    return patient;
	}
	/**
	* getCommunicationChannel - Returns the Communication Channel for a specified channel type
	*/
	public ims.core.vo.CommChannelVo getCommunicationChannel(ims.core.vo.lookups.ChannelType channelType)
	{
		if (commchannels == null) return null;
		for (int i = 0; i < commchannels.size(); i++)
		{
			ims.core.vo.CommChannelVo voCommChannel = commchannels.get(i);
			if (voCommChannel.getChannelType().equals(channelType))
			{
				return voCommChannel;
			}
		}
		return null;
	}
	/**
	* getHomePhoneNumber
	*/
	public ims.core.vo.CommChannelVo getHomePhoneNumber()
	{
		return getCommunicationChannel(ims.core.vo.lookups.ChannelType.HOME_PHONE);
	}
	/**
	* getWorkPhoneNumber
	*/
	public ims.core.vo.CommChannelVo getWorkPhoneNumber()
	{
		return getCommunicationChannel(ims.core.vo.lookups.ChannelType.WORK_PHONE);
	}
	/**
	* getMobile
	*/
	public ims.core.vo.CommChannelVo getMobile()
	{
		return getCommunicationChannel(ims.core.vo.lookups.ChannelType.MOBILE);
	}
	/**
	* addCommunicationChannel - adds a new communication channel to the collection of communications
	*/
	public void addCommunicationChannel(ims.core.vo.lookups.ChannelType channelType, String val)
	{
		if (commchannels == null) commchannels = new ims.core.vo.CommChannelVoCollection();
		ims.core.vo.CommChannelVo voCommChannell = getCommunicationChannel(channelType);
		if (voCommChannell != null)
		{
			if (val == null || val.length() == 0)
			{
				commchannels.remove(commchannels.indexOf(voCommChannell ));
			}
			else
			{
				if (val.length() <= CommChannelVo.getCommValueMaxLength())  // wdev-6914
					voCommChannell.setCommValue(val);
			}	
		}
		else
		{
			if (val != null && val.length() > 0 && val.length() <= 50)  // wdev-6914
			{
				voCommChannell = new ims.core.vo.CommChannelVo();
				voCommChannell .setChannelType(channelType);
				voCommChannell .setCommValue(val);
				commchannels.add(voCommChannell);
			}
				
		}
	}
	
	/**
	* getPatientIdentifier
	*/
		public PatientId getPatientIdentifier(ims.core.vo.lookups.PatIdType identifierType)
		{
			if (this.identifiers == null)
				return null;
			
			for (int i=0; i<this.identifiers.size(); i++)
			{
				PatientId id = identifiers.get(i);
				if (id.type.equals(identifierType))
					return id;
			}
			return null;
		}
	/**
	* getDistrict
	*/
	public ims.core.vo.PatientId getDistrict()
	{
		return getPatId(ims.core.vo.lookups.PatIdType.DISTRICT);
	}
	
	/**
	* getSentnum
	*/
	public ims.core.vo.PatientId getSentnum()
	{
		return getPatId(ims.core.vo.lookups.PatIdType.SENTNUM);
	}
	
	/**
	* ISelectedPatient interface
	*/
		public Integer getISelectedPatientID() 
		{
			return super.id;
		}
		public String getISelectedPatientName() 
		{
			return name == null ? "" : name.toString();
		}	
		public String getISelectedPatientInterfaceID() 
		{
			ims.core.vo.PatientId interfaceID = getInterfaceId();
			if(interfaceID == null)
				return null;
			return interfaceID.idvalue;
		}
		public Integer getISelectedPatientInterfaceIDType() 
		{
			ims.core.vo.PatientId interfaceID = getInterfaceId();
			if(interfaceID == null || interfaceID.type == null) 
				return null;
			return interfaceID.type.getID(); 
		}
	/**
	* getNTPFDisplayString - For tooltip in Patient List grids in PMS and PTR
	*/
	public String getNTPFDisplayString()
	{
		java.lang.StringBuffer sb = new java.lang.StringBuffer("");
		if(this.getAddressIsNotNull())
			sb.append("Address: " + this.getAddress().toNTPFDisplayString()  + "\r\n");
		
		if (this.getAddress() != null && this.getAddress().getPhone() != null)
			sb.append("Home Phone: " + this.getAddress().getPhone() + "\r\n");
	
		if (this.getWorkPhoneNumber() != null)
			sb.append("Work Phone: " + this.getWorkPhoneNumber()  + "\r\n");
	
		if (this.getMobile() != null)
			sb.append("Mobile Phone: " + this.getMobile()  + " ");
	
		return sb.toString();
	}
	/**
	* calculateAgeText
	*/
	public String calculateAgeText()
	{
		agetext = "-";
		if (dob != null)
		{
			if (ims.configuration.ConfigFlag.UI.HAS_PAEDIATRIC_PATIENTS.getValue())
				agetext = new ims.framework.utils.Age(this.dob, this.dod).toPaediatricString();
			else
				agetext = new ims.framework.utils.Age(this.dob, this.dod).toString();			
		}
		return getAgeText();
	}
	/**
	* getPatientNameAndIdInfo: Returns a formatted String with name surname and display id
	*/
	public String getPatientNameAndIdInfo()
	{
		java.lang.StringBuffer sb = new java.lang.StringBuffer("");
		if (this.getName() != null)
		{
			sb.append(this.getName().toString() + " ");
		}
		ims.core.vo.PatientId id = getDisplayId();
		if (id != null) 
		{
			sb.append(id.getType().getText() + ": " + id.getValue() + " ");
		}
		return sb.toString();
	}
	/**
	* getCaseNum
	*/
	public ims.core.vo.PatientId getCaseNum()
	{
		return getPatId(ims.core.vo.lookups.PatIdType.CASENUM);
	}
	/**
	* getEmpi
	*/
	public ims.core.vo.PatientId getEmpi()
	{
		return getPatId(ims.core.vo.lookups.PatIdType.EMPI);
	}
	/**
	* getClientId
	*/
	public ims.core.vo.PatientId getClientId()
	{
		return getPatId(ims.core.vo.lookups.PatIdType.CLIENTID);
	}
	/**
	* getGmsId
	*/
	public ims.core.vo.PatientId getGmsId()
	{
		return getPatId(ims.core.vo.lookups.PatIdType.GMSID);
	}
	/**
	* getPatientNumber
	*/
	public ims.core.vo.PatientId getPatientNumber()
	{
		return getPatId(ims.core.vo.lookups.PatIdType.PATNUM);
	}
	/**
	* hasPatientNotification
	*/
	public boolean hasPatientNotification()
	{
		if (this.ocsnotification == null)
			return false;
		
		if (this.ocsnotification.getNewResults()== null && this.ocsnotification.getSeenResults()== null)
			return false;
	
		if (this.ocsnotification.getNewResults()!= null && this.ocsnotification.getSeenResults()== null)
			return true;
	
		if (this.ocsnotification.getNewResults().getNewCount()== null && this.ocsnotification.getSeenResults().getSeenCount()== null)
			return false;
	
		if (this.ocsnotification.getNewResults().getNewCount()!= null && this.ocsnotification.getSeenResults().getSeenCount()== null)
			return true;
		
		if (this.ocsnotification.getNewResults().getNewCount()> this.ocsnotification.getSeenResults().getSeenCount())
			return true;
		
		return false;
	}
	/**
	* public ims.core.vo.PatientId getMrnnum
	*/
	public ims.core.vo.PatientId getMrnnum()
	{
		return getPatId(ims.core.vo.lookups.PatIdType.MRNNUM);
	}
	
	/**
	* toPatientLite()
	*/
	public PatientLiteVo toPatientLite()
	{
		PatientLiteVo patientLite = new PatientLiteVo(id, version);
		patientLite.name = this.name;
		patientLite.sex = this.sex;
		patientLite.dob = this.dob;
		patientLite.isactive = this.isactive;
		patientLite.isquickregistrationpatient = this.isquickregistrationpatient;
	
		return patientLite;
	}
	
	/**
	* toPatientLite_IdentifiersVo()
	*/
	public PatientLite_IdentifiersVo toPatientLite_IdentifiersVo()
	{
		PatientLite_IdentifiersVo patient = new PatientLite_IdentifiersVo(id, version);
		
		patient.name						= this.name;
		patient.sex							= this.sex;
		patient.dob							= this.dob;
		patient.isactive					= this.isactive;
		patient.isquickregistrationpatient	= this.isquickregistrationpatient;
				
		patient.identifiers					= this.identifiers;
		patient.age							= this.age;
		patient.agetext						= this.agetext;
				
		patient.dod							= this.dod;
		patient.patientcategory				= this.patientcategory;
		
		patient.hasalerts					= this.hasalerts;
		patient.associatedpatient			= this.associatedpatient;
		patient.ward						= this.ward;
		patient.isselfadmitpatient			= this.isselfadmitpatient;
	
		// The patient alerts cannot be filled in from PatientShort
		patient.patientalerts = null;
		
		return patient;
	}
	
	/**
	* getAgeInYearsOn: Gets patients age on a particular date
	*/
	public Integer getAgeInYearsOn(ims.framework.utils.Date date)
	{
		if (dob != null&&date!=null)
		{		
			int patAge = 0;
			ims.framework.utils.Date endDate = null;
			if(dod!=null)
			{
				endDate=dod.isGreaterThan(date)?date:dod;
			}
			else
			{
				endDate=date;
			}
			patAge = new ims.framework.utils.Age(this.dob, endDate).getYears();
			return new Integer(patAge); 
		}
		return null; // No Age
	}
	/**
	* isPaediatricOn: checks if the patient is Paediatric on a particular date
	*/
	public Boolean isPaediatricOn(ims.framework.utils.Date date)
	{
		Integer age = getAgeInYearsOn(date);
		if (age!=null &&age.compareTo(Integer.valueOf(ims.configuration.gen.ConfigFlag.GEN.PAEDIATRIC_AGE.getValue()))<=0)
			return true;
		else
			return false;
	}
	public boolean isValidated()
	{
		if(this.isBusy)
			return true;
		this.isBusy = true;
	
		if(!this.isValidated)
		{
			this.isBusy = false;
			return false;
		}
		if(this.name != null)
		{
			if(!this.name.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.address != null)
		{
			if(!this.address.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.ward != null)
		{
			if(!this.ward.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.identifiers != null)
		{
			if(!this.identifiers.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.associatedpatient != null)
		{
			if(!this.associatedpatient.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.commchannels != null)
		{
			if(!this.commchannels.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.pdspatientgp != null)
		{
			if(!this.pdspatientgp.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.name != null)
		{
			String[] listOfOtherErrors = this.name.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.address != null)
		{
			String[] listOfOtherErrors = this.address.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.ward != null)
		{
			String[] listOfOtherErrors = this.ward.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.identifiers != null)
		{
			String[] listOfOtherErrors = this.identifiers.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.associatedpatient != null)
		{
			String[] listOfOtherErrors = this.associatedpatient.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.commchannels != null)
		{
			String[] listOfOtherErrors = this.commchannels.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.pdspatientgp != null)
		{
			String[] listOfOtherErrors = this.pdspatientgp.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;
	
		PatientShort clone = new PatientShort(this.id, this.version);
		
		if(this.name == null)
			clone.name = null;
		else
			clone.name = (ims.core.vo.PersonName)this.name.clone();
		if(this.sex == null)
			clone.sex = null;
		else
			clone.sex = (ims.core.vo.lookups.Sex)this.sex.clone();
		clone.age = this.age;
		clone.agetext = this.agetext;
		if(this.address == null)
			clone.address = null;
		else
			clone.address = (ims.core.vo.PersonAddress)this.address.clone();
		if(this.dob == null)
			clone.dob = null;
		else
			clone.dob = (ims.framework.utils.PartialDate)this.dob.clone();
		if(this.dod == null)
			clone.dod = null;
		else
			clone.dod = (ims.framework.utils.Date)this.dod.clone();
		if(this.ward == null)
			clone.ward = null;
		else
			clone.ward = (ims.core.vo.LocationLiteVo)this.ward.clone();
		if(this.religion == null)
			clone.religion = null;
		else
			clone.religion = (ims.core.vo.lookups.Religion)this.religion.clone();
		clone.hasallergies = this.hasallergies;
		clone.hasalerts = this.hasalerts;
		if(this.identifiers == null)
			clone.identifiers = null;
		else
			clone.identifiers = (ims.core.vo.PatientIdCollection)this.identifiers.clone();
		clone.isactive = this.isactive;
		if(this.associatedpatient == null)
			clone.associatedpatient = null;
		else
			clone.associatedpatient = (ims.core.vo.PatientShort)this.associatedpatient.clone();
		if(this.commchannels == null)
			clone.commchannels = null;
		else
			clone.commchannels = (ims.core.vo.CommChannelVoCollection)this.commchannels.clone();
		if(this.ethnicorigin == null)
			clone.ethnicorigin = null;
		else
			clone.ethnicorigin = (ims.core.vo.lookups.EthnicOrigin)this.ethnicorigin.clone();
		if(this.maritalstatus == null)
			clone.maritalstatus = null;
		else
			clone.maritalstatus = (ims.core.vo.lookups.MaritalStatus)this.maritalstatus.clone();
		clone.scn = this.scn;
		if(this.sourceofinformation == null)
			clone.sourceofinformation = null;
		else
			clone.sourceofinformation = (ims.core.vo.lookups.RegistrationSourceOfInfo)this.sourceofinformation.clone();
		if(this.sysinfo == null)
			clone.sysinfo = null;
		else
			clone.sysinfo = (ims.vo.SystemInformation)this.sysinfo.clone();
		clone.hasactivealerts = this.hasactivealerts;
		if(this.timeofdeath == null)
			clone.timeofdeath = null;
		else
			clone.timeofdeath = (ims.framework.utils.Time)this.timeofdeath.clone();
		clone.isquickregistrationpatient = this.isquickregistrationpatient;
		if(this.ocsnotification == null)
			clone.ocsnotification = null;
		else
			clone.ocsnotification = (ims.core.vo.PatientNotificationsFillerOnlyVo)this.ocsnotification.clone();
		clone.currentresponsibleconsultant = this.currentresponsibleconsultant;
		if(this.dementiabreachdatetime == null)
			clone.dementiabreachdatetime = null;
		else
			clone.dementiabreachdatetime = (ims.framework.utils.DateTime)this.dementiabreachdatetime.clone();
		if(this.dementiaworkliststatus == null)
			clone.dementiaworkliststatus = null;
		else
			clone.dementiaworkliststatus = (ims.core.vo.lookups.DementiaWorklistStatus)this.dementiaworkliststatus.clone();
		if(this.mrnstatus == null)
			clone.mrnstatus = null;
		else
			clone.mrnstatus = (ims.core.vo.lookups.MRNStatus)this.mrnstatus.clone();
		clone.hasscannedcasenotefolders = this.hasscannedcasenotefolders;
		clone.isconfidential = this.isconfidential;
		if(this.timeofbirth == null)
			clone.timeofbirth = null;
		else
			clone.timeofbirth = (ims.framework.utils.Time)this.timeofbirth.clone();
		clone.isselfadmitpatient = this.isselfadmitpatient;
		if(this.patientcategory == null)
			clone.patientcategory = null;
		else
			clone.patientcategory = (ims.core.vo.lookups.PatientStatus)this.patientcategory.clone();
		if(this.pdspatientgp == null)
			clone.pdspatientgp = null;
		else
			clone.pdspatientgp = (ims.core.vo.PDSPatientGPVo)this.pdspatientgp.clone();
		clone.hasalertcategory1 = this.hasalertcategory1;
		clone.hasalertcategory2 = this.hasalertcategory2;
		clone.hasalertcategory3 = this.hasalertcategory3;
		clone.hasalertcategory4 = this.hasalertcategory4;
		clone.hasalertcategoryother = this.hasalertcategoryother;
		clone.futureapptscancelonmarkdeceasedanswer = this.futureapptscancelonmarkdeceasedanswer;
		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 (!(PatientShort.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A PatientShort object cannot be compared an Object of type " + obj.getClass().getName());
		}
		PatientShort compareObj = (PatientShort)obj;
		int retVal = 0;
		if (retVal == 0)
		{
			if(this.getName() == null && compareObj.getName() != null)
				return -1;
			if(this.getName() != null && compareObj.getName() == null)
				return 1;
			if(this.getName() != null && compareObj.getName() != null)
				retVal = this.getName().compareTo(compareObj.getName());
		}
		return retVal;
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = 0;
		if(this.name != null)
			count++;
		if(this.sex != null)
			count++;
		if(this.age != null)
			count++;
		if(this.agetext != null)
			count++;
		if(this.address != null)
			count++;
		if(this.dob != null)
			count++;
		if(this.dod != null)
			count++;
		if(this.ward != null)
			count++;
		if(this.religion != null)
			count++;
		if(this.hasallergies != null)
			count++;
		if(this.hasalerts != null)
			count++;
		if(this.identifiers != null)
			count++;
		if(this.isactive != null)
			count++;
		if(this.associatedpatient != null)
			count++;
		if(this.commchannels != null)
			count++;
		if(this.ethnicorigin != null)
			count++;
		if(this.maritalstatus != null)
			count++;
		if(this.scn != null)
			count++;
		if(this.sourceofinformation != null)
			count++;
		if(this.sysinfo != null)
			count++;
		if(this.hasactivealerts != null)
			count++;
		if(this.timeofdeath != null)
			count++;
		if(this.isquickregistrationpatient != null)
			count++;
		if(this.ocsnotification != null)
			count++;
		if(this.currentresponsibleconsultant != null)
			count++;
		if(this.dementiabreachdatetime != null)
			count++;
		if(this.dementiaworkliststatus != null)
			count++;
		if(this.mrnstatus != null)
			count++;
		if(this.hasscannedcasenotefolders != null)
			count++;
		if(this.isconfidential != null)
			count++;
		if(this.timeofbirth != null)
			count++;
		if(this.isselfadmitpatient != null)
			count++;
		if(this.patientcategory != null)
			count++;
		if(this.pdspatientgp != null)
			count++;
		if(this.hasalertcategory1 != null)
			count++;
		if(this.hasalertcategory2 != null)
			count++;
		if(this.hasalertcategory3 != null)
			count++;
		if(this.hasalertcategory4 != null)
			count++;
		if(this.hasalertcategoryother != null)
			count++;
		if(this.futureapptscancelonmarkdeceasedanswer != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return 40;
	}
	protected ims.core.vo.PersonName name;
	protected ims.core.vo.lookups.Sex sex;
	protected Integer age;
	protected String agetext;
	protected ims.core.vo.PersonAddress address;
	protected ims.framework.utils.PartialDate dob;
	protected ims.framework.utils.Date dod;
	protected ims.core.vo.LocationLiteVo ward;
	protected ims.core.vo.lookups.Religion religion;
	protected Boolean hasallergies;
	protected Boolean hasalerts;
	protected ims.core.vo.PatientIdCollection identifiers;
	protected Boolean isactive;
	protected ims.core.vo.PatientShort associatedpatient;
	protected ims.core.vo.CommChannelVoCollection commchannels;
	protected ims.core.vo.lookups.EthnicOrigin ethnicorigin;
	protected ims.core.vo.lookups.MaritalStatus maritalstatus;
	protected Integer scn;
	protected ims.core.vo.lookups.RegistrationSourceOfInfo sourceofinformation;
	protected ims.vo.SystemInformation sysinfo;
	protected Boolean hasactivealerts;
	protected ims.framework.utils.Time timeofdeath;
	protected Boolean isquickregistrationpatient;
	protected ims.core.vo.PatientNotificationsFillerOnlyVo ocsnotification;
	protected ims.core.resource.people.vo.MedicRefVo currentresponsibleconsultant;
	protected ims.framework.utils.DateTime dementiabreachdatetime;
	protected ims.core.vo.lookups.DementiaWorklistStatus dementiaworkliststatus;
	protected ims.core.vo.lookups.MRNStatus mrnstatus;
	protected Boolean hasscannedcasenotefolders;
	protected Boolean isconfidential;
	protected ims.framework.utils.Time timeofbirth;
	protected Boolean isselfadmitpatient;
	protected ims.core.vo.lookups.PatientStatus patientcategory;
	protected ims.core.vo.PDSPatientGPVo pdspatientgp;
	protected Boolean hasalertcategory1;
	protected Boolean hasalertcategory2;
	protected Boolean hasalertcategory3;
	protected Boolean hasalertcategory4;
	protected Boolean hasalertcategoryother;
	protected Boolean futureapptscancelonmarkdeceasedanswer;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
