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


public class DementialManualClassAssemblyVo extends ims.vo.ValueObject implements ims.vo.ImsCloneable, Comparable
{
	private static final long serialVersionUID = 1L;

	public DementialManualClassAssemblyVo()
	{
	}
	public DementialManualClassAssemblyVo(ims.clinical.vo.beans.DementialManualClassAssemblyVoBean bean)
	{
		this.dementiaid = bean.getDementiaId();
		this.patientsurname = bean.getPatientSurname();
		this.patientforename = bean.getPatientForename();
		this.patientidentifier = bean.getPatientIdentifier();
		this.patientdob = bean.getPatientDOB() == null ? null : bean.getPatientDOB().buildPartialDate();
		this.ward = bean.getWard();
		this.consultant = bean.getConsultant();
		this.reasonforexclusion = bean.getReasonForExclusion();
		this.isexcludedfromworklist = bean.getIsExcludedFromWorklist();
		this.dischargedatetime = bean.getDischargeDateTime() == null ? null : bean.getDischargeDateTime().buildDateTime();
		this.breachdatetime = bean.getBreachDateTime() == null ? null : bean.getBreachDateTime().buildDateTime();
		this.deliriumconfirmed = bean.getDeliriumConfirmed();
		this.dementiaconfirmed = bean.getDementiaConfirmed();
		this.currentstatus = bean.getCurrentStatus() == null ? null : bean.getCurrentStatus().buildLookupInstVo();
		this.consultantsort = bean.getConsultantSort();
		this.amtsscore = bean.getAMTSScore();
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.clinical.vo.beans.DementialManualClassAssemblyVoBean bean)
	{
		this.dementiaid = bean.getDementiaId();
		this.patientsurname = bean.getPatientSurname();
		this.patientforename = bean.getPatientForename();
		this.patientidentifier = bean.getPatientIdentifier();
		this.patientdob = bean.getPatientDOB() == null ? null : bean.getPatientDOB().buildPartialDate();
		this.ward = bean.getWard();
		this.consultant = bean.getConsultant();
		this.reasonforexclusion = bean.getReasonForExclusion();
		this.isexcludedfromworklist = bean.getIsExcludedFromWorklist();
		this.dischargedatetime = bean.getDischargeDateTime() == null ? null : bean.getDischargeDateTime().buildDateTime();
		this.breachdatetime = bean.getBreachDateTime() == null ? null : bean.getBreachDateTime().buildDateTime();
		this.deliriumconfirmed = bean.getDeliriumConfirmed();
		this.dementiaconfirmed = bean.getDementiaConfirmed();
		this.currentstatus = bean.getCurrentStatus() == null ? null : bean.getCurrentStatus().buildLookupInstVo();
		this.consultantsort = bean.getConsultantSort();
		this.amtsscore = bean.getAMTSScore();
	}
	public ims.vo.ValueObjectBean getBean()
	{
		return this.getBean(new ims.vo.ValueObjectBeanMap());
	}
	public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
	{
		ims.clinical.vo.beans.DementialManualClassAssemblyVoBean bean = null;
		if(map != null)
			bean = (ims.clinical.vo.beans.DementialManualClassAssemblyVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.clinical.vo.beans.DementialManualClassAssemblyVoBean();
			map.addValueObjectBean(this, bean);
			bean.populate(map, this);
		}
		return bean;
	}
	public boolean getDementiaIdIsNotNull()
	{
		return this.dementiaid != null;
	}
	public Integer getDementiaId()
	{
		return this.dementiaid;
	}
	public void setDementiaId(Integer value)
	{
		this.isValidated = false;
		this.dementiaid = value;
	}
	public boolean getPatientSurnameIsNotNull()
	{
		return this.patientsurname != null;
	}
	public String getPatientSurname()
	{
		return this.patientsurname;
	}
	public static int getPatientSurnameMaxLength()
	{
		return 255;
	}
	public void setPatientSurname(String value)
	{
		this.isValidated = false;
		this.patientsurname = value;
	}
	public boolean getPatientForenameIsNotNull()
	{
		return this.patientforename != null;
	}
	public String getPatientForename()
	{
		return this.patientforename;
	}
	public static int getPatientForenameMaxLength()
	{
		return 255;
	}
	public void setPatientForename(String value)
	{
		this.isValidated = false;
		this.patientforename = value;
	}
	public boolean getPatientIdentifierIsNotNull()
	{
		return this.patientidentifier != null;
	}
	public String getPatientIdentifier()
	{
		return this.patientidentifier;
	}
	public static int getPatientIdentifierMaxLength()
	{
		return 255;
	}
	public void setPatientIdentifier(String value)
	{
		this.isValidated = false;
		this.patientidentifier = value;
	}
	public boolean getPatientDOBIsNotNull()
	{
		return this.patientdob != null;
	}
	public ims.framework.utils.PartialDate getPatientDOB()
	{
		return this.patientdob;
	}
	public void setPatientDOB(ims.framework.utils.PartialDate value)
	{
		this.isValidated = false;
		this.patientdob = value;
	}
	public boolean getWardIsNotNull()
	{
		return this.ward != null;
	}
	public String getWard()
	{
		return this.ward;
	}
	public static int getWardMaxLength()
	{
		return 255;
	}
	public void setWard(String value)
	{
		this.isValidated = false;
		this.ward = value;
	}
	public boolean getConsultantIsNotNull()
	{
		return this.consultant != null;
	}
	public String getConsultant()
	{
		return this.consultant;
	}
	public static int getConsultantMaxLength()
	{
		return 255;
	}
	public void setConsultant(String value)
	{
		this.isValidated = false;
		this.consultant = value;
	}
	public boolean getReasonForExclusionIsNotNull()
	{
		return this.reasonforexclusion != null;
	}
	public String getReasonForExclusion()
	{
		return this.reasonforexclusion;
	}
	public static int getReasonForExclusionMaxLength()
	{
		return 255;
	}
	public void setReasonForExclusion(String value)
	{
		this.isValidated = false;
		this.reasonforexclusion = value;
	}
	public boolean getIsExcludedFromWorklistIsNotNull()
	{
		return this.isexcludedfromworklist != null;
	}
	public Boolean getIsExcludedFromWorklist()
	{
		return this.isexcludedfromworklist;
	}
	public void setIsExcludedFromWorklist(Boolean value)
	{
		this.isValidated = false;
		this.isexcludedfromworklist = value;
	}
	public boolean getDischargeDateTimeIsNotNull()
	{
		return this.dischargedatetime != null;
	}
	public ims.framework.utils.DateTime getDischargeDateTime()
	{
		return this.dischargedatetime;
	}
	public void setDischargeDateTime(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.dischargedatetime = value;
	}
	public boolean getBreachDateTimeIsNotNull()
	{
		return this.breachdatetime != null;
	}
	public ims.framework.utils.DateTime getBreachDateTime()
	{
		return this.breachdatetime;
	}
	public void setBreachDateTime(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.breachdatetime = value;
	}
	public boolean getDeliriumConfirmedIsNotNull()
	{
		return this.deliriumconfirmed != null;
	}
	public Boolean getDeliriumConfirmed()
	{
		return this.deliriumconfirmed;
	}
	public void setDeliriumConfirmed(Boolean value)
	{
		this.isValidated = false;
		this.deliriumconfirmed = value;
	}
	public boolean getDementiaConfirmedIsNotNull()
	{
		return this.dementiaconfirmed != null;
	}
	public Boolean getDementiaConfirmed()
	{
		return this.dementiaconfirmed;
	}
	public void setDementiaConfirmed(Boolean value)
	{
		this.isValidated = false;
		this.dementiaconfirmed = value;
	}
	public boolean getCurrentStatusIsNotNull()
	{
		return this.currentstatus != null;
	}
	public ims.vo.LookupInstVo getCurrentStatus()
	{
		return this.currentstatus;
	}
	public void setCurrentStatus(ims.vo.LookupInstVo value)
	{
		this.isValidated = false;
		this.currentstatus = value;
	}
	public boolean getConsultantSortIsNotNull()
	{
		return this.consultantsort != null;
	}
	public String getConsultantSort()
	{
		return this.consultantsort;
	}
	public static int getConsultantSortMaxLength()
	{
		return 255;
	}
	public void setConsultantSort(String value)
	{
		this.isValidated = false;
		this.consultantsort = value;
	}
	public boolean getAMTSScoreIsNotNull()
	{
		return this.amtsscore != null;
	}
	public Integer getAMTSScore()
	{
		return this.amtsscore;
	}
	public void setAMTSScore(Integer value)
	{
		this.isValidated = false;
		this.amtsscore = value;
	}
	public final String getIItemText()
	{
		return toString();
	}
	public final Integer getBoId() 
	{
		return null;
	}
	public final String getBoClassName()
	{
		return null;
	}
	public boolean equals(Object obj)
	{
		if(obj == null)
			return false;
		if(!(obj instanceof DementialManualClassAssemblyVo))
			return false;
		DementialManualClassAssemblyVo compareObj = (DementialManualClassAssemblyVo)obj;
		if(this.getDementiaId() == null && compareObj.getDementiaId() != null)
			return false;
		if(this.getDementiaId() != null && compareObj.getDementiaId() == null)
			return false;
		if(this.getDementiaId() != null && compareObj.getDementiaId() != null)
			return this.getDementiaId().equals(compareObj.getDementiaId());
		return super.equals(obj);
	}
	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]);
			}
		}
		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 Object clone()
	{
		if(this.isBusy)
			return this;
		this.isBusy = true;
	
		DementialManualClassAssemblyVo clone = new DementialManualClassAssemblyVo();
		
		clone.dementiaid = this.dementiaid;
		clone.patientsurname = this.patientsurname;
		clone.patientforename = this.patientforename;
		clone.patientidentifier = this.patientidentifier;
		if(this.patientdob == null)
			clone.patientdob = null;
		else
			clone.patientdob = (ims.framework.utils.PartialDate)this.patientdob.clone();
		clone.ward = this.ward;
		clone.consultant = this.consultant;
		clone.reasonforexclusion = this.reasonforexclusion;
		clone.isexcludedfromworklist = this.isexcludedfromworklist;
		if(this.dischargedatetime == null)
			clone.dischargedatetime = null;
		else
			clone.dischargedatetime = (ims.framework.utils.DateTime)this.dischargedatetime.clone();
		if(this.breachdatetime == null)
			clone.breachdatetime = null;
		else
			clone.breachdatetime = (ims.framework.utils.DateTime)this.breachdatetime.clone();
		clone.deliriumconfirmed = this.deliriumconfirmed;
		clone.dementiaconfirmed = this.dementiaconfirmed;
		clone.currentstatus = this.currentstatus;
		clone.consultantsort = this.consultantsort;
		clone.amtsscore = this.amtsscore;
		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 (!(DementialManualClassAssemblyVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A DementialManualClassAssemblyVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		DementialManualClassAssemblyVo compareObj = (DementialManualClassAssemblyVo)obj;
		int retVal = 0;
		if (retVal == 0)
		{
			if(this.getDementiaId() == null && compareObj.getDementiaId() != null)
				return -1;
			if(this.getDementiaId() != null && compareObj.getDementiaId() == null)
				return 1;
			if(this.getDementiaId() != null && compareObj.getDementiaId() != null)
				retVal = this.getDementiaId().compareTo(compareObj.getDementiaId());
		}
		return retVal;
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = 0;
		if(this.dementiaid != null)
			count++;
		if(this.patientsurname != null)
			count++;
		if(this.patientforename != null)
			count++;
		if(this.patientidentifier != null)
			count++;
		if(this.patientdob != null)
			count++;
		if(this.ward != null)
			count++;
		if(this.consultant != null)
			count++;
		if(this.reasonforexclusion != null)
			count++;
		if(this.isexcludedfromworklist != null)
			count++;
		if(this.dischargedatetime != null)
			count++;
		if(this.breachdatetime != null)
			count++;
		if(this.deliriumconfirmed != null)
			count++;
		if(this.dementiaconfirmed != null)
			count++;
		if(this.currentstatus != null)
			count++;
		if(this.consultantsort != null)
			count++;
		if(this.amtsscore != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return 16;
	}
	protected Integer dementiaid;
	protected String patientsurname;
	protected String patientforename;
	protected String patientidentifier;
	protected ims.framework.utils.PartialDate patientdob;
	protected String ward;
	protected String consultant;
	protected String reasonforexclusion;
	protected Boolean isexcludedfromworklist;
	protected ims.framework.utils.DateTime dischargedatetime;
	protected ims.framework.utils.DateTime breachdatetime;
	protected Boolean deliriumconfirmed;
	protected Boolean dementiaconfirmed;
	protected ims.vo.LookupInstVo currentstatus;
	protected String consultantsort;
	protected Integer amtsscore;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
