/FileExtraction/Java_unseen/IMS-MAXIMS_openMAXIMS/Source Library/openmaxims_workspace/ValueObjects/src/ims/clinical/vo/DementiaWorklistSearchCriteriaVo.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 DementiaWorklistSearchCriteriaVo extends ims.vo.ValueObject implements ims.vo.ImsCloneable, Comparable
{
	private static final long serialVersionUID = 1L;

	public DementiaWorklistSearchCriteriaVo()
	{
	}
	public DementiaWorklistSearchCriteriaVo(ims.clinical.vo.beans.DementiaWorklistSearchCriteriaVoBean bean)
	{
		this.hospital = bean.getHospital() == null ? null : bean.getHospital().buildVo();
		this.ward = bean.getWard() == null ? null : bean.getWard().buildVo();
		this.admissiondatefrom = bean.getAdmissionDateFrom() == null ? null : bean.getAdmissionDateFrom().buildDateTime();
		this.admissiondateto = bean.getAdmissionDateTo() == null ? null : bean.getAdmissionDateTo().buildDateTime();
		// Interface field type not supported.
		this.specialty = bean.getSpecialty() == null ? null : ims.core.vo.lookups.Specialty.buildLookup(bean.getSpecialty());
		this.surname = bean.getSurname();
		this.forename = bean.getForename();
		this.patidtype = bean.getPatIdType() == null ? null : ims.core.vo.lookups.PatIdType.buildLookup(bean.getPatIdType());
		this.patidvalue = bean.getPatIdValue();
		this.dob = bean.getDOB() == null ? null : bean.getDOB().buildPartialDate();
		this.dementiastatus = bean.getDementiaStatus() == null ? null : ims.core.vo.lookups.DementiaWorklistStatus.buildLookup(bean.getDementiaStatus());
		this.excluderemoved = bean.getExcludeRemoved();
		this.dementiaconfirmed = bean.getDementiaConfirmed();
		this.deliriumconfirmed = bean.getDeliriumConfirmed();
		this.wastimeron = bean.getWasTimerOn();
		this.inpatientonly = bean.getInpatientOnly();
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.clinical.vo.beans.DementiaWorklistSearchCriteriaVoBean bean)
	{
		this.hospital = bean.getHospital() == null ? null : bean.getHospital().buildVo(map);
		this.ward = bean.getWard() == null ? null : bean.getWard().buildVo(map);
		this.admissiondatefrom = bean.getAdmissionDateFrom() == null ? null : bean.getAdmissionDateFrom().buildDateTime();
		this.admissiondateto = bean.getAdmissionDateTo() == null ? null : bean.getAdmissionDateTo().buildDateTime();
		// Interface field type not supported.
		this.specialty = bean.getSpecialty() == null ? null : ims.core.vo.lookups.Specialty.buildLookup(bean.getSpecialty());
		this.surname = bean.getSurname();
		this.forename = bean.getForename();
		this.patidtype = bean.getPatIdType() == null ? null : ims.core.vo.lookups.PatIdType.buildLookup(bean.getPatIdType());
		this.patidvalue = bean.getPatIdValue();
		this.dob = bean.getDOB() == null ? null : bean.getDOB().buildPartialDate();
		this.dementiastatus = bean.getDementiaStatus() == null ? null : ims.core.vo.lookups.DementiaWorklistStatus.buildLookup(bean.getDementiaStatus());
		this.excluderemoved = bean.getExcludeRemoved();
		this.dementiaconfirmed = bean.getDementiaConfirmed();
		this.deliriumconfirmed = bean.getDeliriumConfirmed();
		this.wastimeron = bean.getWasTimerOn();
		this.inpatientonly = bean.getInpatientOnly();
	}
	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.DementiaWorklistSearchCriteriaVoBean bean = null;
		if(map != null)
			bean = (ims.clinical.vo.beans.DementiaWorklistSearchCriteriaVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.clinical.vo.beans.DementiaWorklistSearchCriteriaVoBean();
			map.addValueObjectBean(this, bean);
			bean.populate(map, this);
		}
		return bean;
	}
	public boolean getHospitalIsNotNull()
	{
		return this.hospital != null;
	}
	public ims.core.vo.LocSiteLiteVo getHospital()
	{
		return this.hospital;
	}
	public void setHospital(ims.core.vo.LocSiteLiteVo value)
	{
		this.isValidated = false;
		this.hospital = 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 getAdmissionDateFromIsNotNull()
	{
		return this.admissiondatefrom != null;
	}
	public ims.framework.utils.DateTime getAdmissionDateFrom()
	{
		return this.admissiondatefrom;
	}
	public void setAdmissionDateFrom(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.admissiondatefrom = value;
	}
	public boolean getAdmissionDateToIsNotNull()
	{
		return this.admissiondateto != null;
	}
	public ims.framework.utils.DateTime getAdmissionDateTo()
	{
		return this.admissiondateto;
	}
	public void setAdmissionDateTo(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.admissiondateto = value;
	}
	public boolean getConsultantIsNotNull()
	{
		return this.consultant != null;
	}
	public ims.vo.interfaces.IMos getConsultant()
	{
		return this.consultant;
	}
	public void setConsultant(ims.vo.interfaces.IMos value)
	{
		this.isValidated = false;
		this.consultant = value;
	}
	public boolean getSpecialtyIsNotNull()
	{
		return this.specialty != null;
	}
	public ims.core.vo.lookups.Specialty getSpecialty()
	{
		return this.specialty;
	}
	public void setSpecialty(ims.core.vo.lookups.Specialty value)
	{
		this.isValidated = false;
		this.specialty = value;
	}
	public boolean getSurnameIsNotNull()
	{
		return this.surname != null;
	}
	public String getSurname()
	{
		return this.surname;
	}
	public static int getSurnameMaxLength()
	{
		return 255;
	}
	public void setSurname(String value)
	{
		this.isValidated = false;
		this.surname = value;
	}
	public boolean getForenameIsNotNull()
	{
		return this.forename != null;
	}
	public String getForename()
	{
		return this.forename;
	}
	public static int getForenameMaxLength()
	{
		return 255;
	}
	public void setForename(String value)
	{
		this.isValidated = false;
		this.forename = value;
	}
	public boolean getPatIdTypeIsNotNull()
	{
		return this.patidtype != null;
	}
	public ims.core.vo.lookups.PatIdType getPatIdType()
	{
		return this.patidtype;
	}
	public void setPatIdType(ims.core.vo.lookups.PatIdType value)
	{
		this.isValidated = false;
		this.patidtype = value;
	}
	public boolean getPatIdValueIsNotNull()
	{
		return this.patidvalue != null;
	}
	public String getPatIdValue()
	{
		return this.patidvalue;
	}
	public static int getPatIdValueMaxLength()
	{
		return 255;
	}
	public void setPatIdValue(String value)
	{
		this.isValidated = false;
		this.patidvalue = 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 getDementiaStatusIsNotNull()
	{
		return this.dementiastatus != null;
	}
	public ims.core.vo.lookups.DementiaWorklistStatus getDementiaStatus()
	{
		return this.dementiastatus;
	}
	public void setDementiaStatus(ims.core.vo.lookups.DementiaWorklistStatus value)
	{
		this.isValidated = false;
		this.dementiastatus = value;
	}
	public boolean getExcludeRemovedIsNotNull()
	{
		return this.excluderemoved != null;
	}
	public Boolean getExcludeRemoved()
	{
		return this.excluderemoved;
	}
	public void setExcludeRemoved(Boolean value)
	{
		this.isValidated = false;
		this.excluderemoved = 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 getDeliriumConfirmedIsNotNull()
	{
		return this.deliriumconfirmed != null;
	}
	public Boolean getDeliriumConfirmed()
	{
		return this.deliriumconfirmed;
	}
	public void setDeliriumConfirmed(Boolean value)
	{
		this.isValidated = false;
		this.deliriumconfirmed = value;
	}
	public boolean getWasTimerOnIsNotNull()
	{
		return this.wastimeron != null;
	}
	public Boolean getWasTimerOn()
	{
		return this.wastimeron;
	}
	public void setWasTimerOn(Boolean value)
	{
		this.isValidated = false;
		this.wastimeron = value;
	}
	public boolean getInpatientOnlyIsNotNull()
	{
		return this.inpatientonly != null;
	}
	public Boolean getInpatientOnly()
	{
		return this.inpatientonly;
	}
	public void setInpatientOnly(Boolean value)
	{
		this.isValidated = false;
		this.inpatientonly = 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 DementiaWorklistSearchCriteriaVo))
			return false;
		DementiaWorklistSearchCriteriaVo compareObj = (DementiaWorklistSearchCriteriaVo)obj;
		if(this.getHospital() == null && compareObj.getHospital() != null)
			return false;
		if(this.getHospital() != null && compareObj.getHospital() == null)
			return false;
		if(this.getHospital() != null && compareObj.getHospital() != null)
			return this.getHospital().equals(compareObj.getHospital());
		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;
	
		DementiaWorklistSearchCriteriaVo clone = new DementiaWorklistSearchCriteriaVo();
		
		if(this.hospital == null)
			clone.hospital = null;
		else
			clone.hospital = (ims.core.vo.LocSiteLiteVo)this.hospital.clone();
		if(this.ward == null)
			clone.ward = null;
		else
			clone.ward = (ims.core.vo.LocationLiteVo)this.ward.clone();
		if(this.admissiondatefrom == null)
			clone.admissiondatefrom = null;
		else
			clone.admissiondatefrom = (ims.framework.utils.DateTime)this.admissiondatefrom.clone();
		if(this.admissiondateto == null)
			clone.admissiondateto = null;
		else
			clone.admissiondateto = (ims.framework.utils.DateTime)this.admissiondateto.clone();
		clone.consultant = this.consultant;
		if(this.specialty == null)
			clone.specialty = null;
		else
			clone.specialty = (ims.core.vo.lookups.Specialty)this.specialty.clone();
		clone.surname = this.surname;
		clone.forename = this.forename;
		if(this.patidtype == null)
			clone.patidtype = null;
		else
			clone.patidtype = (ims.core.vo.lookups.PatIdType)this.patidtype.clone();
		clone.patidvalue = this.patidvalue;
		if(this.dob == null)
			clone.dob = null;
		else
			clone.dob = (ims.framework.utils.PartialDate)this.dob.clone();
		if(this.dementiastatus == null)
			clone.dementiastatus = null;
		else
			clone.dementiastatus = (ims.core.vo.lookups.DementiaWorklistStatus)this.dementiastatus.clone();
		clone.excluderemoved = this.excluderemoved;
		clone.dementiaconfirmed = this.dementiaconfirmed;
		clone.deliriumconfirmed = this.deliriumconfirmed;
		clone.wastimeron = this.wastimeron;
		clone.inpatientonly = this.inpatientonly;
		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 (!(DementiaWorklistSearchCriteriaVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A DementiaWorklistSearchCriteriaVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		DementiaWorklistSearchCriteriaVo compareObj = (DementiaWorklistSearchCriteriaVo)obj;
		int retVal = 0;
		if (retVal == 0)
		{
			if(this.getHospital() == null && compareObj.getHospital() != null)
				return -1;
			if(this.getHospital() != null && compareObj.getHospital() == null)
				return 1;
			if(this.getHospital() != null && compareObj.getHospital() != null)
				retVal = this.getHospital().compareTo(compareObj.getHospital());
		}
		return retVal;
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = 0;
		if(this.hospital != null)
			count++;
		if(this.ward != null)
			count++;
		if(this.admissiondatefrom != null)
			count++;
		if(this.admissiondateto != null)
			count++;
		if(this.consultant != null)
			count++;
		if(this.specialty != null)
			count++;
		if(this.surname != null)
			count++;
		if(this.forename != null)
			count++;
		if(this.patidtype != null)
			count++;
		if(this.patidvalue != null)
			count++;
		if(this.dob != null)
			count++;
		if(this.dementiastatus != null)
			count++;
		if(this.excluderemoved != null)
			count++;
		if(this.dementiaconfirmed != null)
			count++;
		if(this.deliriumconfirmed != null)
			count++;
		if(this.wastimeron != null)
			count++;
		if(this.inpatientonly != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return 17;
	}
	protected ims.core.vo.LocSiteLiteVo hospital;
	protected ims.core.vo.LocationLiteVo ward;
	protected ims.framework.utils.DateTime admissiondatefrom;
	protected ims.framework.utils.DateTime admissiondateto;
	protected ims.vo.interfaces.IMos consultant;
	protected ims.core.vo.lookups.Specialty specialty;
	protected String surname;
	protected String forename;
	protected ims.core.vo.lookups.PatIdType patidtype;
	protected String patidvalue;
	protected ims.framework.utils.PartialDate dob;
	protected ims.core.vo.lookups.DementiaWorklistStatus dementiastatus;
	protected Boolean excluderemoved;
	protected Boolean dementiaconfirmed;
	protected Boolean deliriumconfirmed;
	protected Boolean wastimeron;
	protected Boolean inpatientonly;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
