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


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

	public CaseNoteWorklistSearchCriteriaVo()
	{
	}
	public CaseNoteWorklistSearchCriteriaVo(ims.core.vo.beans.CaseNoteWorklistSearchCriteriaVoBean bean)
	{
		this.searchtab = bean.getSearchTab();
		this.hospital = bean.getHospital() == null ? null : bean.getHospital().buildVo();
		this.clinicname = bean.getClinicName() == null ? null : bean.getClinicName().buildVo();
		this.listowner = bean.getListOwner() == null ? null : bean.getListOwner().buildVo();
		this.ward = bean.getWard() == null ? null : bean.getWard().buildVo();
		this.requestorlocation = bean.getRequestorLocation() == null ? null : bean.getRequestorLocation().buildVo();
		this.casenotesinmedicalrecords = bean.getCaseNotesInMedicalRecords();
		this.requestfromdate = bean.getRequestFromDate() == null ? null : bean.getRequestFromDate().buildDate();
		this.requesttodate = bean.getRequestToDate() == null ? null : bean.getRequestToDate().buildDate();
		this.requestfordays = bean.getRequestForDays();
		this.requestoverduedays = bean.getRequestOverdueDays();
		this.includecompletedrequests = bean.getIncludeCompletedRequests();
		this.requestreasons = ims.core.vo.lookups.CaseNoteReasonForRequestCollection.buildFromBeanCollection(bean.getRequestReasons());
		this.hospitalbylocation = bean.getHospitalByLocation() == null ? null : bean.getHospitalByLocation().buildVo();
		this.currentlocation = bean.getCurrentLocation() == null ? null : bean.getCurrentLocation().buildVo();
		this.casenotesinmedicalrecordsbylocation = bean.getCaseNotesInMedicalRecordsByLocation();
		this.casenotebylocationoption = bean.getCaseNoteByLocationOption();
		this.periodincurrentlocationfrom = bean.getPeriodInCurrentLocationFrom() == null ? null : bean.getPeriodInCurrentLocationFrom().buildDate();
		this.periodincurrentlocationto = bean.getPeriodInCurrentLocationTo() == null ? null : bean.getPeriodInCurrentLocationTo().buildDate();
		this.incurrentlocationforlastdays = bean.getInCurrentLocationForLastDays();
		this.wastimeron = bean.getWasTimerOn();
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.core.vo.beans.CaseNoteWorklistSearchCriteriaVoBean bean)
	{
		this.searchtab = bean.getSearchTab();
		this.hospital = bean.getHospital() == null ? null : bean.getHospital().buildVo(map);
		this.clinicname = bean.getClinicName() == null ? null : bean.getClinicName().buildVo(map);
		this.listowner = bean.getListOwner() == null ? null : bean.getListOwner().buildVo(map);
		this.ward = bean.getWard() == null ? null : bean.getWard().buildVo(map);
		this.requestorlocation = bean.getRequestorLocation() == null ? null : bean.getRequestorLocation().buildVo(map);
		this.casenotesinmedicalrecords = bean.getCaseNotesInMedicalRecords();
		this.requestfromdate = bean.getRequestFromDate() == null ? null : bean.getRequestFromDate().buildDate();
		this.requesttodate = bean.getRequestToDate() == null ? null : bean.getRequestToDate().buildDate();
		this.requestfordays = bean.getRequestForDays();
		this.requestoverduedays = bean.getRequestOverdueDays();
		this.includecompletedrequests = bean.getIncludeCompletedRequests();
		this.requestreasons = ims.core.vo.lookups.CaseNoteReasonForRequestCollection.buildFromBeanCollection(bean.getRequestReasons());
		this.hospitalbylocation = bean.getHospitalByLocation() == null ? null : bean.getHospitalByLocation().buildVo(map);
		this.currentlocation = bean.getCurrentLocation() == null ? null : bean.getCurrentLocation().buildVo(map);
		this.casenotesinmedicalrecordsbylocation = bean.getCaseNotesInMedicalRecordsByLocation();
		this.casenotebylocationoption = bean.getCaseNoteByLocationOption();
		this.periodincurrentlocationfrom = bean.getPeriodInCurrentLocationFrom() == null ? null : bean.getPeriodInCurrentLocationFrom().buildDate();
		this.periodincurrentlocationto = bean.getPeriodInCurrentLocationTo() == null ? null : bean.getPeriodInCurrentLocationTo().buildDate();
		this.incurrentlocationforlastdays = bean.getInCurrentLocationForLastDays();
		this.wastimeron = bean.getWasTimerOn();
	}
	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.CaseNoteWorklistSearchCriteriaVoBean bean = null;
		if(map != null)
			bean = (ims.core.vo.beans.CaseNoteWorklistSearchCriteriaVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.core.vo.beans.CaseNoteWorklistSearchCriteriaVoBean();
			map.addValueObjectBean(this, bean);
			bean.populate(map, this);
		}
		return bean;
	}
	public boolean getSearchTabIsNotNull()
	{
		return this.searchtab != null;
	}
	public Integer getSearchTab()
	{
		return this.searchtab;
	}
	public void setSearchTab(Integer value)
	{
		this.isValidated = false;
		this.searchtab = value;
	}
	public boolean getHospitalIsNotNull()
	{
		return this.hospital != null;
	}
	public ims.core.vo.LocationLiteVo getHospital()
	{
		return this.hospital;
	}
	public void setHospital(ims.core.vo.LocationLiteVo value)
	{
		this.isValidated = false;
		this.hospital = value;
	}
	public boolean getClinicNameIsNotNull()
	{
		return this.clinicname != null;
	}
	public ims.scheduling.vo.ProfileLiteVo getClinicName()
	{
		return this.clinicname;
	}
	public void setClinicName(ims.scheduling.vo.ProfileLiteVo value)
	{
		this.isValidated = false;
		this.clinicname = value;
	}
	public boolean getListOwnerIsNotNull()
	{
		return this.listowner != null;
	}
	public ims.core.vo.HcpLiteVo getListOwner()
	{
		return this.listowner;
	}
	public void setListOwner(ims.core.vo.HcpLiteVo value)
	{
		this.isValidated = false;
		this.listowner = 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 getRequestorLocationIsNotNull()
	{
		return this.requestorlocation != null;
	}
	public ims.core.vo.LocationLiteVo getRequestorLocation()
	{
		return this.requestorlocation;
	}
	public void setRequestorLocation(ims.core.vo.LocationLiteVo value)
	{
		this.isValidated = false;
		this.requestorlocation = value;
	}
	public boolean getCaseNotesInMedicalRecordsIsNotNull()
	{
		return this.casenotesinmedicalrecords != null;
	}
	public Boolean getCaseNotesInMedicalRecords()
	{
		return this.casenotesinmedicalrecords;
	}
	public void setCaseNotesInMedicalRecords(Boolean value)
	{
		this.isValidated = false;
		this.casenotesinmedicalrecords = value;
	}
	public boolean getRequestFromDateIsNotNull()
	{
		return this.requestfromdate != null;
	}
	public ims.framework.utils.Date getRequestFromDate()
	{
		return this.requestfromdate;
	}
	public void setRequestFromDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.requestfromdate = value;
	}
	public boolean getRequestToDateIsNotNull()
	{
		return this.requesttodate != null;
	}
	public ims.framework.utils.Date getRequestToDate()
	{
		return this.requesttodate;
	}
	public void setRequestToDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.requesttodate = value;
	}
	public boolean getRequestForDaysIsNotNull()
	{
		return this.requestfordays != null;
	}
	public Integer getRequestForDays()
	{
		return this.requestfordays;
	}
	public void setRequestForDays(Integer value)
	{
		this.isValidated = false;
		this.requestfordays = value;
	}
	public boolean getRequestOverdueDaysIsNotNull()
	{
		return this.requestoverduedays != null;
	}
	public Integer getRequestOverdueDays()
	{
		return this.requestoverduedays;
	}
	public void setRequestOverdueDays(Integer value)
	{
		this.isValidated = false;
		this.requestoverduedays = value;
	}
	public boolean getIncludeCompletedRequestsIsNotNull()
	{
		return this.includecompletedrequests != null;
	}
	public Boolean getIncludeCompletedRequests()
	{
		return this.includecompletedrequests;
	}
	public void setIncludeCompletedRequests(Boolean value)
	{
		this.isValidated = false;
		this.includecompletedrequests = value;
	}
	public boolean getRequestReasonsIsNotNull()
	{
		return this.requestreasons != null;
	}
	public ims.core.vo.lookups.CaseNoteReasonForRequestCollection getRequestReasons()
	{
		return this.requestreasons;
	}
	public void setRequestReasons(ims.core.vo.lookups.CaseNoteReasonForRequestCollection value)
	{
		this.isValidated = false;
		this.requestreasons = value;
	}
	public boolean getHospitalByLocationIsNotNull()
	{
		return this.hospitalbylocation != null;
	}
	public ims.core.vo.LocationLiteVo getHospitalByLocation()
	{
		return this.hospitalbylocation;
	}
	public void setHospitalByLocation(ims.core.vo.LocationLiteVo value)
	{
		this.isValidated = false;
		this.hospitalbylocation = value;
	}
	public boolean getCurrentLocationIsNotNull()
	{
		return this.currentlocation != null;
	}
	public ims.core.vo.LocationLiteVo getCurrentLocation()
	{
		return this.currentlocation;
	}
	public void setCurrentLocation(ims.core.vo.LocationLiteVo value)
	{
		this.isValidated = false;
		this.currentlocation = value;
	}
	public boolean getCaseNotesInMedicalRecordsByLocationIsNotNull()
	{
		return this.casenotesinmedicalrecordsbylocation != null;
	}
	public Boolean getCaseNotesInMedicalRecordsByLocation()
	{
		return this.casenotesinmedicalrecordsbylocation;
	}
	public void setCaseNotesInMedicalRecordsByLocation(Boolean value)
	{
		this.isValidated = false;
		this.casenotesinmedicalrecordsbylocation = value;
	}
	public boolean getCaseNoteByLocationOptionIsNotNull()
	{
		return this.casenotebylocationoption != null;
	}
	public Integer getCaseNoteByLocationOption()
	{
		return this.casenotebylocationoption;
	}
	public void setCaseNoteByLocationOption(Integer value)
	{
		this.isValidated = false;
		this.casenotebylocationoption = value;
	}
	public boolean getPeriodInCurrentLocationFromIsNotNull()
	{
		return this.periodincurrentlocationfrom != null;
	}
	public ims.framework.utils.Date getPeriodInCurrentLocationFrom()
	{
		return this.periodincurrentlocationfrom;
	}
	public void setPeriodInCurrentLocationFrom(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.periodincurrentlocationfrom = value;
	}
	public boolean getPeriodInCurrentLocationToIsNotNull()
	{
		return this.periodincurrentlocationto != null;
	}
	public ims.framework.utils.Date getPeriodInCurrentLocationTo()
	{
		return this.periodincurrentlocationto;
	}
	public void setPeriodInCurrentLocationTo(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.periodincurrentlocationto = value;
	}
	public boolean getInCurrentLocationForLastDaysIsNotNull()
	{
		return this.incurrentlocationforlastdays != null;
	}
	public Integer getInCurrentLocationForLastDays()
	{
		return this.incurrentlocationforlastdays;
	}
	public void setInCurrentLocationForLastDays(Integer value)
	{
		this.isValidated = false;
		this.incurrentlocationforlastdays = 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 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 CaseNoteWorklistSearchCriteriaVo))
			return false;
		CaseNoteWorklistSearchCriteriaVo compareObj = (CaseNoteWorklistSearchCriteriaVo)obj;
		if(this.getSearchTab() == null && compareObj.getSearchTab() != null)
			return false;
		if(this.getSearchTab() != null && compareObj.getSearchTab() == null)
			return false;
		if(this.getSearchTab() != null && compareObj.getSearchTab() != null)
			return this.getSearchTab().equals(compareObj.getSearchTab());
		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;
	
		CaseNoteWorklistSearchCriteriaVo clone = new CaseNoteWorklistSearchCriteriaVo();
		
		clone.searchtab = this.searchtab;
		if(this.hospital == null)
			clone.hospital = null;
		else
			clone.hospital = (ims.core.vo.LocationLiteVo)this.hospital.clone();
		if(this.clinicname == null)
			clone.clinicname = null;
		else
			clone.clinicname = (ims.scheduling.vo.ProfileLiteVo)this.clinicname.clone();
		if(this.listowner == null)
			clone.listowner = null;
		else
			clone.listowner = (ims.core.vo.HcpLiteVo)this.listowner.clone();
		if(this.ward == null)
			clone.ward = null;
		else
			clone.ward = (ims.core.vo.LocationLiteVo)this.ward.clone();
		if(this.requestorlocation == null)
			clone.requestorlocation = null;
		else
			clone.requestorlocation = (ims.core.vo.LocationLiteVo)this.requestorlocation.clone();
		clone.casenotesinmedicalrecords = this.casenotesinmedicalrecords;
		if(this.requestfromdate == null)
			clone.requestfromdate = null;
		else
			clone.requestfromdate = (ims.framework.utils.Date)this.requestfromdate.clone();
		if(this.requesttodate == null)
			clone.requesttodate = null;
		else
			clone.requesttodate = (ims.framework.utils.Date)this.requesttodate.clone();
		clone.requestfordays = this.requestfordays;
		clone.requestoverduedays = this.requestoverduedays;
		clone.includecompletedrequests = this.includecompletedrequests;
		if(this.requestreasons == null)
			clone.requestreasons = null;
		else
			clone.requestreasons = (ims.core.vo.lookups.CaseNoteReasonForRequestCollection)this.requestreasons.clone();
		if(this.hospitalbylocation == null)
			clone.hospitalbylocation = null;
		else
			clone.hospitalbylocation = (ims.core.vo.LocationLiteVo)this.hospitalbylocation.clone();
		if(this.currentlocation == null)
			clone.currentlocation = null;
		else
			clone.currentlocation = (ims.core.vo.LocationLiteVo)this.currentlocation.clone();
		clone.casenotesinmedicalrecordsbylocation = this.casenotesinmedicalrecordsbylocation;
		clone.casenotebylocationoption = this.casenotebylocationoption;
		if(this.periodincurrentlocationfrom == null)
			clone.periodincurrentlocationfrom = null;
		else
			clone.periodincurrentlocationfrom = (ims.framework.utils.Date)this.periodincurrentlocationfrom.clone();
		if(this.periodincurrentlocationto == null)
			clone.periodincurrentlocationto = null;
		else
			clone.periodincurrentlocationto = (ims.framework.utils.Date)this.periodincurrentlocationto.clone();
		clone.incurrentlocationforlastdays = this.incurrentlocationforlastdays;
		clone.wastimeron = this.wastimeron;
		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 (!(CaseNoteWorklistSearchCriteriaVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A CaseNoteWorklistSearchCriteriaVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		CaseNoteWorklistSearchCriteriaVo compareObj = (CaseNoteWorklistSearchCriteriaVo)obj;
		int retVal = 0;
		if (retVal == 0)
		{
			if(this.getSearchTab() == null && compareObj.getSearchTab() != null)
				return -1;
			if(this.getSearchTab() != null && compareObj.getSearchTab() == null)
				return 1;
			if(this.getSearchTab() != null && compareObj.getSearchTab() != null)
				retVal = this.getSearchTab().compareTo(compareObj.getSearchTab());
		}
		return retVal;
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = 0;
		if(this.searchtab != null)
			count++;
		if(this.hospital != null)
			count++;
		if(this.clinicname != null)
			count++;
		if(this.listowner != null)
			count++;
		if(this.ward != null)
			count++;
		if(this.requestorlocation != null)
			count++;
		if(this.casenotesinmedicalrecords != null)
			count++;
		if(this.requestfromdate != null)
			count++;
		if(this.requesttodate != null)
			count++;
		if(this.requestfordays != null)
			count++;
		if(this.requestoverduedays != null)
			count++;
		if(this.includecompletedrequests != null)
			count++;
		if(this.requestreasons != null)
			count++;
		if(this.hospitalbylocation != null)
			count++;
		if(this.currentlocation != null)
			count++;
		if(this.casenotesinmedicalrecordsbylocation != null)
			count++;
		if(this.casenotebylocationoption != null)
			count++;
		if(this.periodincurrentlocationfrom != null)
			count++;
		if(this.periodincurrentlocationto != null)
			count++;
		if(this.incurrentlocationforlastdays != null)
			count++;
		if(this.wastimeron != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return 21;
	}
	protected Integer searchtab;
	protected ims.core.vo.LocationLiteVo hospital;
	protected ims.scheduling.vo.ProfileLiteVo clinicname;
	protected ims.core.vo.HcpLiteVo listowner;
	protected ims.core.vo.LocationLiteVo ward;
	protected ims.core.vo.LocationLiteVo requestorlocation;
	protected Boolean casenotesinmedicalrecords;
	protected ims.framework.utils.Date requestfromdate;
	protected ims.framework.utils.Date requesttodate;
	protected Integer requestfordays;
	protected Integer requestoverduedays;
	protected Boolean includecompletedrequests;
	protected ims.core.vo.lookups.CaseNoteReasonForRequestCollection requestreasons;
	protected ims.core.vo.LocationLiteVo hospitalbylocation;
	protected ims.core.vo.LocationLiteVo currentlocation;
	protected Boolean casenotesinmedicalrecordsbylocation;
	protected Integer casenotebylocationoption;
	protected ims.framework.utils.Date periodincurrentlocationfrom;
	protected ims.framework.utils.Date periodincurrentlocationto;
	protected Integer incurrentlocationforlastdays;
	protected Boolean wastimeron;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
