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


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

	public DiagnosticImageTransferSearchCriteriaVo()
	{
	}
	public DiagnosticImageTransferSearchCriteriaVo(ims.eas.vo.beans.DiagnosticImageTransferSearchCriteriaVoBean bean)
	{
		this.seenfrom = bean.getSeenFrom() == null ? null : bean.getSeenFrom().buildDate();
		this.seento = bean.getSeenTo() == null ? null : bean.getSeenTo().buildDate();
		this.seenby = bean.getSeenBy() == null ? null : bean.getSeenBy().buildVo();
		this.responsiblehcp = bean.getResponsibleHcp() == null ? null : bean.getResponsibleHcp().buildVo();
		this.easstatus = bean.getEASStatus() == null ? null : ims.eas.vo.lookups.EASStatus.buildLookup(bean.getEASStatus());
		this.imagetype = bean.getImageType() == null ? null : ims.oncology.vo.lookups.EASImageType.buildLookup(bean.getImageType());
		this.removed = bean.getRemoved();
		this.imagerequested = bean.getImageRequested();
		this.dtafrom = bean.getDTAFrom() == null ? null : bean.getDTAFrom().buildDate();
		this.dtato = bean.getDTATo() == null ? null : bean.getDTATo().buildDate();
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.eas.vo.beans.DiagnosticImageTransferSearchCriteriaVoBean bean)
	{
		this.seenfrom = bean.getSeenFrom() == null ? null : bean.getSeenFrom().buildDate();
		this.seento = bean.getSeenTo() == null ? null : bean.getSeenTo().buildDate();
		this.seenby = bean.getSeenBy() == null ? null : bean.getSeenBy().buildVo(map);
		this.responsiblehcp = bean.getResponsibleHcp() == null ? null : bean.getResponsibleHcp().buildVo(map);
		this.easstatus = bean.getEASStatus() == null ? null : ims.eas.vo.lookups.EASStatus.buildLookup(bean.getEASStatus());
		this.imagetype = bean.getImageType() == null ? null : ims.oncology.vo.lookups.EASImageType.buildLookup(bean.getImageType());
		this.removed = bean.getRemoved();
		this.imagerequested = bean.getImageRequested();
		this.dtafrom = bean.getDTAFrom() == null ? null : bean.getDTAFrom().buildDate();
		this.dtato = bean.getDTATo() == null ? null : bean.getDTATo().buildDate();
	}
	public ims.vo.ValueObjectBean getBean()
	{
		return this.getBean(new ims.vo.ValueObjectBeanMap());
	}
	public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
	{
		ims.eas.vo.beans.DiagnosticImageTransferSearchCriteriaVoBean bean = null;
		if(map != null)
			bean = (ims.eas.vo.beans.DiagnosticImageTransferSearchCriteriaVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.eas.vo.beans.DiagnosticImageTransferSearchCriteriaVoBean();
			map.addValueObjectBean(this, bean);
			bean.populate(map, this);
		}
		return bean;
	}
	public boolean getSeenFromIsNotNull()
	{
		return this.seenfrom != null;
	}
	public ims.framework.utils.Date getSeenFrom()
	{
		return this.seenfrom;
	}
	public void setSeenFrom(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.seenfrom = value;
	}
	public boolean getSeenToIsNotNull()
	{
		return this.seento != null;
	}
	public ims.framework.utils.Date getSeenTo()
	{
		return this.seento;
	}
	public void setSeenTo(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.seento = value;
	}
	public boolean getSeenByIsNotNull()
	{
		return this.seenby != null;
	}
	public ims.core.vo.HcpLiteVo getSeenBy()
	{
		return this.seenby;
	}
	public void setSeenBy(ims.core.vo.HcpLiteVo value)
	{
		this.isValidated = false;
		this.seenby = value;
	}
	public boolean getResponsibleHcpIsNotNull()
	{
		return this.responsiblehcp != null;
	}
	public ims.core.vo.HcpLiteVo getResponsibleHcp()
	{
		return this.responsiblehcp;
	}
	public void setResponsibleHcp(ims.core.vo.HcpLiteVo value)
	{
		this.isValidated = false;
		this.responsiblehcp = value;
	}
	public boolean getEASStatusIsNotNull()
	{
		return this.easstatus != null;
	}
	public ims.eas.vo.lookups.EASStatus getEASStatus()
	{
		return this.easstatus;
	}
	public void setEASStatus(ims.eas.vo.lookups.EASStatus value)
	{
		this.isValidated = false;
		this.easstatus = value;
	}
	public boolean getImageTypeIsNotNull()
	{
		return this.imagetype != null;
	}
	public ims.oncology.vo.lookups.EASImageType getImageType()
	{
		return this.imagetype;
	}
	public void setImageType(ims.oncology.vo.lookups.EASImageType value)
	{
		this.isValidated = false;
		this.imagetype = value;
	}
	public boolean getRemovedIsNotNull()
	{
		return this.removed != null;
	}
	public Boolean getRemoved()
	{
		return this.removed;
	}
	public void setRemoved(Boolean value)
	{
		this.isValidated = false;
		this.removed = value;
	}
	public boolean getImageRequestedIsNotNull()
	{
		return this.imagerequested != null;
	}
	public Boolean getImageRequested()
	{
		return this.imagerequested;
	}
	public void setImageRequested(Boolean value)
	{
		this.isValidated = false;
		this.imagerequested = value;
	}
	public boolean getDTAFromIsNotNull()
	{
		return this.dtafrom != null;
	}
	public ims.framework.utils.Date getDTAFrom()
	{
		return this.dtafrom;
	}
	public void setDTAFrom(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.dtafrom = value;
	}
	public boolean getDTAToIsNotNull()
	{
		return this.dtato != null;
	}
	public ims.framework.utils.Date getDTATo()
	{
		return this.dtato;
	}
	public void setDTATo(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.dtato = 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 DiagnosticImageTransferSearchCriteriaVo))
			return false;
		DiagnosticImageTransferSearchCriteriaVo compareObj = (DiagnosticImageTransferSearchCriteriaVo)obj;
		if(this.getSeenBy() == null && compareObj.getSeenBy() != null)
			return false;
		if(this.getSeenBy() != null && compareObj.getSeenBy() == null)
			return false;
		if(this.getSeenBy() != null && compareObj.getSeenBy() != null)
			if(!this.getSeenBy().equals(compareObj.getSeenBy()))
				return false;
		if(this.getResponsibleHcp() == null && compareObj.getResponsibleHcp() != null)
			return false;
		if(this.getResponsibleHcp() != null && compareObj.getResponsibleHcp() == null)
			return false;
		if(this.getResponsibleHcp() != null && compareObj.getResponsibleHcp() != null)
			if(!this.getResponsibleHcp().equals(compareObj.getResponsibleHcp()))
				return false;
		if(this.getEASStatus() == null && compareObj.getEASStatus() != null)
			return false;
		if(this.getEASStatus() != null && compareObj.getEASStatus() == null)
			return false;
		if(this.getEASStatus() != null && compareObj.getEASStatus() != null)
			if(!this.getEASStatus().equals(compareObj.getEASStatus()))
				return false;
		if(this.getImageType() == null && compareObj.getImageType() != null)
			return false;
		if(this.getImageType() != null && compareObj.getImageType() == null)
			return false;
		if(this.getImageType() != null && compareObj.getImageType() != null)
			if(!this.getImageType().equals(compareObj.getImageType()))
				return false;
		if(this.getRemoved() == null && compareObj.getRemoved() != null)
			return false;
		if(this.getRemoved() != null && compareObj.getRemoved() == null)
			return false;
		if(this.getRemoved() != null && compareObj.getRemoved() != null)
			if(!this.getRemoved().equals(compareObj.getRemoved()))
				return false;
		if(this.getImageRequested() == null && compareObj.getImageRequested() != null)
			return false;
		if(this.getImageRequested() != null && compareObj.getImageRequested() == null)
			return false;
		if(this.getImageRequested() != null && compareObj.getImageRequested() != null)
			if(!this.getImageRequested().equals(compareObj.getImageRequested()))
				return false;
		if(this.getSeenFrom() == null && compareObj.getSeenFrom() != null)
			return false;
		if(this.getSeenFrom() != null && compareObj.getSeenFrom() == null)
			return false;
		if(this.getSeenFrom() != null && compareObj.getSeenFrom() != null)
			if(!this.getSeenFrom().equals(compareObj.getSeenFrom()))
				return false;
		if(this.getSeenTo() == null && compareObj.getSeenTo() != null)
			return false;
		if(this.getSeenTo() != null && compareObj.getSeenTo() == null)
			return false;
		if(this.getSeenTo() != null && compareObj.getSeenTo() != null)
			if(!this.getSeenTo().equals(compareObj.getSeenTo()))
				return false;
		if(this.getDTAFrom() == null && compareObj.getDTAFrom() != null)
			return false;
		if(this.getDTAFrom() != null && compareObj.getDTAFrom() == null)
			return false;
		if(this.getDTAFrom() != null && compareObj.getDTAFrom() != null)
			if(!this.getDTAFrom().equals(compareObj.getDTAFrom()))
				return false;
		if(this.getDTATo() == null && compareObj.getDTATo() != null)
			return false;
		if(this.getDTATo() != null && compareObj.getDTATo() == null)
			return false;
		if(this.getDTATo() != null && compareObj.getDTATo() != null)
			return this.getDTATo().equals(compareObj.getDTATo());
		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;
	
		DiagnosticImageTransferSearchCriteriaVo clone = new DiagnosticImageTransferSearchCriteriaVo();
		
		if(this.seenfrom == null)
			clone.seenfrom = null;
		else
			clone.seenfrom = (ims.framework.utils.Date)this.seenfrom.clone();
		if(this.seento == null)
			clone.seento = null;
		else
			clone.seento = (ims.framework.utils.Date)this.seento.clone();
		if(this.seenby == null)
			clone.seenby = null;
		else
			clone.seenby = (ims.core.vo.HcpLiteVo)this.seenby.clone();
		if(this.responsiblehcp == null)
			clone.responsiblehcp = null;
		else
			clone.responsiblehcp = (ims.core.vo.HcpLiteVo)this.responsiblehcp.clone();
		if(this.easstatus == null)
			clone.easstatus = null;
		else
			clone.easstatus = (ims.eas.vo.lookups.EASStatus)this.easstatus.clone();
		if(this.imagetype == null)
			clone.imagetype = null;
		else
			clone.imagetype = (ims.oncology.vo.lookups.EASImageType)this.imagetype.clone();
		clone.removed = this.removed;
		clone.imagerequested = this.imagerequested;
		if(this.dtafrom == null)
			clone.dtafrom = null;
		else
			clone.dtafrom = (ims.framework.utils.Date)this.dtafrom.clone();
		if(this.dtato == null)
			clone.dtato = null;
		else
			clone.dtato = (ims.framework.utils.Date)this.dtato.clone();
		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 (!(DiagnosticImageTransferSearchCriteriaVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A DiagnosticImageTransferSearchCriteriaVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		DiagnosticImageTransferSearchCriteriaVo compareObj = (DiagnosticImageTransferSearchCriteriaVo)obj;
		int retVal = 0;
		if (retVal == 0)
		{
			if(this.getSeenBy() == null && compareObj.getSeenBy() != null)
				return -1;
			if(this.getSeenBy() != null && compareObj.getSeenBy() == null)
				return 1;
			if(this.getSeenBy() != null && compareObj.getSeenBy() != null)
				retVal = this.getSeenBy().compareTo(compareObj.getSeenBy());
		}
		if (retVal == 0)
		{
			if(this.getResponsibleHcp() == null && compareObj.getResponsibleHcp() != null)
				return -1;
			if(this.getResponsibleHcp() != null && compareObj.getResponsibleHcp() == null)
				return 1;
			if(this.getResponsibleHcp() != null && compareObj.getResponsibleHcp() != null)
				retVal = this.getResponsibleHcp().compareTo(compareObj.getResponsibleHcp());
		}
		if (retVal == 0)
		{
			if(this.getEASStatus() == null && compareObj.getEASStatus() != null)
				return -1;
			if(this.getEASStatus() != null && compareObj.getEASStatus() == null)
				return 1;
			if(this.getEASStatus() != null && compareObj.getEASStatus() != null)
				retVal = this.getEASStatus().compareTo(compareObj.getEASStatus());
		}
		if (retVal == 0)
		{
			if(this.getImageType() == null && compareObj.getImageType() != null)
				return -1;
			if(this.getImageType() != null && compareObj.getImageType() == null)
				return 1;
			if(this.getImageType() != null && compareObj.getImageType() != null)
				retVal = this.getImageType().compareTo(compareObj.getImageType());
		}
		if (retVal == 0)
		{
			if(this.getRemoved() == null && compareObj.getRemoved() != null)
				return -1;
			if(this.getRemoved() != null && compareObj.getRemoved() == null)
				return 1;
			if(this.getRemoved() != null && compareObj.getRemoved() != null)
				retVal = this.getRemoved().compareTo(compareObj.getRemoved());
		}
		if (retVal == 0)
		{
			if(this.getImageRequested() == null && compareObj.getImageRequested() != null)
				return -1;
			if(this.getImageRequested() != null && compareObj.getImageRequested() == null)
				return 1;
			if(this.getImageRequested() != null && compareObj.getImageRequested() != null)
				retVal = this.getImageRequested().compareTo(compareObj.getImageRequested());
		}
		if (retVal == 0)
		{
			if(this.getSeenFrom() == null && compareObj.getSeenFrom() != null)
				return -1;
			if(this.getSeenFrom() != null && compareObj.getSeenFrom() == null)
				return 1;
			if(this.getSeenFrom() != null && compareObj.getSeenFrom() != null)
				retVal = this.getSeenFrom().compareTo(compareObj.getSeenFrom());
		}
		if (retVal == 0)
		{
			if(this.getSeenTo() == null && compareObj.getSeenTo() != null)
				return -1;
			if(this.getSeenTo() != null && compareObj.getSeenTo() == null)
				return 1;
			if(this.getSeenTo() != null && compareObj.getSeenTo() != null)
				retVal = this.getSeenTo().compareTo(compareObj.getSeenTo());
		}
		if (retVal == 0)
		{
			if(this.getDTAFrom() == null && compareObj.getDTAFrom() != null)
				return -1;
			if(this.getDTAFrom() != null && compareObj.getDTAFrom() == null)
				return 1;
			if(this.getDTAFrom() != null && compareObj.getDTAFrom() != null)
				retVal = this.getDTAFrom().compareTo(compareObj.getDTAFrom());
		}
		if (retVal == 0)
		{
			if(this.getDTATo() == null && compareObj.getDTATo() != null)
				return -1;
			if(this.getDTATo() != null && compareObj.getDTATo() == null)
				return 1;
			if(this.getDTATo() != null && compareObj.getDTATo() != null)
				retVal = this.getDTATo().compareTo(compareObj.getDTATo());
		}
		return retVal;
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = 0;
		if(this.seenfrom != null)
			count++;
		if(this.seento != null)
			count++;
		if(this.seenby != null)
			count++;
		if(this.responsiblehcp != null)
			count++;
		if(this.easstatus != null)
			count++;
		if(this.imagetype != null)
			count++;
		if(this.removed != null)
			count++;
		if(this.imagerequested != null)
			count++;
		if(this.dtafrom != null)
			count++;
		if(this.dtato != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return 10;
	}
	protected ims.framework.utils.Date seenfrom;
	protected ims.framework.utils.Date seento;
	protected ims.core.vo.HcpLiteVo seenby;
	protected ims.core.vo.HcpLiteVo responsiblehcp;
	protected ims.eas.vo.lookups.EASStatus easstatus;
	protected ims.oncology.vo.lookups.EASImageType imagetype;
	protected Boolean removed;
	protected Boolean imagerequested;
	protected ims.framework.utils.Date dtafrom;
	protected ims.framework.utils.Date dtato;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
