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


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

	public WhiteBoardEditVo()
	{
	}
	public WhiteBoardEditVo(ims.emergency.vo.beans.WhiteBoardEditVoBean bean)
	{
		this.obsrequired = bean.getObsRequired();
		this.medsgiven = bean.getMedsGiven();
		this.ecg = bean.getECG();
		this.npo = bean.getNPO();
		this.isolation = bean.getIsolation();
		this.painassessments = bean.getPainAssessments();
		this.waterlowassessments = bean.getWaterlowAssessments();
		this.fallsassessment = bean.getFallsAssessment();
		this.isarassessments = bean.getIsarAssessments();
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.emergency.vo.beans.WhiteBoardEditVoBean bean)
	{
		this.obsrequired = bean.getObsRequired();
		this.medsgiven = bean.getMedsGiven();
		this.ecg = bean.getECG();
		this.npo = bean.getNPO();
		this.isolation = bean.getIsolation();
		this.painassessments = bean.getPainAssessments();
		this.waterlowassessments = bean.getWaterlowAssessments();
		this.fallsassessment = bean.getFallsAssessment();
		this.isarassessments = bean.getIsarAssessments();
	}
	public ims.vo.ValueObjectBean getBean()
	{
		return this.getBean(new ims.vo.ValueObjectBeanMap());
	}
	public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
	{
		ims.emergency.vo.beans.WhiteBoardEditVoBean bean = null;
		if(map != null)
			bean = (ims.emergency.vo.beans.WhiteBoardEditVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.emergency.vo.beans.WhiteBoardEditVoBean();
			map.addValueObjectBean(this, bean);
			bean.populate(map, this);
		}
		return bean;
	}
	public boolean getObsRequiredIsNotNull()
	{
		return this.obsrequired != null;
	}
	public Integer getObsRequired()
	{
		return this.obsrequired;
	}
	public void setObsRequired(Integer value)
	{
		this.isValidated = false;
		this.obsrequired = value;
	}
	public boolean getMedsGivenIsNotNull()
	{
		return this.medsgiven != null;
	}
	public Integer getMedsGiven()
	{
		return this.medsgiven;
	}
	public void setMedsGiven(Integer value)
	{
		this.isValidated = false;
		this.medsgiven = value;
	}
	public boolean getECGIsNotNull()
	{
		return this.ecg != null;
	}
	public Boolean getECG()
	{
		return this.ecg;
	}
	public void setECG(Boolean value)
	{
		this.isValidated = false;
		this.ecg = value;
	}
	public boolean getNPOIsNotNull()
	{
		return this.npo != null;
	}
	public Boolean getNPO()
	{
		return this.npo;
	}
	public void setNPO(Boolean value)
	{
		this.isValidated = false;
		this.npo = value;
	}
	public boolean getIsolationIsNotNull()
	{
		return this.isolation != null;
	}
	public Boolean getIsolation()
	{
		return this.isolation;
	}
	public void setIsolation(Boolean value)
	{
		this.isValidated = false;
		this.isolation = value;
	}
	public boolean getPainAssessmentsIsNotNull()
	{
		return this.painassessments != null;
	}
	public Integer getPainAssessments()
	{
		return this.painassessments;
	}
	public void setPainAssessments(Integer value)
	{
		this.isValidated = false;
		this.painassessments = value;
	}
	public boolean getWaterlowAssessmentsIsNotNull()
	{
		return this.waterlowassessments != null;
	}
	public Integer getWaterlowAssessments()
	{
		return this.waterlowassessments;
	}
	public void setWaterlowAssessments(Integer value)
	{
		this.isValidated = false;
		this.waterlowassessments = value;
	}
	public boolean getFallsAssessmentIsNotNull()
	{
		return this.fallsassessment != null;
	}
	public Integer getFallsAssessment()
	{
		return this.fallsassessment;
	}
	public void setFallsAssessment(Integer value)
	{
		this.isValidated = false;
		this.fallsassessment = value;
	}
	public boolean getIsarAssessmentsIsNotNull()
	{
		return this.isarassessments != null;
	}
	public Integer getIsarAssessments()
	{
		return this.isarassessments;
	}
	public void setIsarAssessments(Integer value)
	{
		this.isValidated = false;
		this.isarassessments = 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 WhiteBoardEditVo))
			return false;
		WhiteBoardEditVo compareObj = (WhiteBoardEditVo)obj;
		if(this.getObsRequired() == null && compareObj.getObsRequired() != null)
			return false;
		if(this.getObsRequired() != null && compareObj.getObsRequired() == null)
			return false;
		if(this.getObsRequired() != null && compareObj.getObsRequired() != null)
			if(!this.getObsRequired().equals(compareObj.getObsRequired()))
				return false;
		if(this.getMedsGiven() == null && compareObj.getMedsGiven() != null)
			return false;
		if(this.getMedsGiven() != null && compareObj.getMedsGiven() == null)
			return false;
		if(this.getMedsGiven() != null && compareObj.getMedsGiven() != null)
			if(!this.getMedsGiven().equals(compareObj.getMedsGiven()))
				return false;
		if(this.getECG() == null && compareObj.getECG() != null)
			return false;
		if(this.getECG() != null && compareObj.getECG() == null)
			return false;
		if(this.getECG() != null && compareObj.getECG() != null)
			if(!this.getECG().equals(compareObj.getECG()))
				return false;
		if(this.getNPO() == null && compareObj.getNPO() != null)
			return false;
		if(this.getNPO() != null && compareObj.getNPO() == null)
			return false;
		if(this.getNPO() != null && compareObj.getNPO() != null)
			if(!this.getNPO().equals(compareObj.getNPO()))
				return false;
		if(this.getIsolation() == null && compareObj.getIsolation() != null)
			return false;
		if(this.getIsolation() != null && compareObj.getIsolation() == null)
			return false;
		if(this.getIsolation() != null && compareObj.getIsolation() != null)
			return this.getIsolation().equals(compareObj.getIsolation());
		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;
	
		WhiteBoardEditVo clone = new WhiteBoardEditVo();
		
		clone.obsrequired = this.obsrequired;
		clone.medsgiven = this.medsgiven;
		clone.ecg = this.ecg;
		clone.npo = this.npo;
		clone.isolation = this.isolation;
		clone.painassessments = this.painassessments;
		clone.waterlowassessments = this.waterlowassessments;
		clone.fallsassessment = this.fallsassessment;
		clone.isarassessments = this.isarassessments;
		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 (!(WhiteBoardEditVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A WhiteBoardEditVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		WhiteBoardEditVo compareObj = (WhiteBoardEditVo)obj;
		int retVal = 0;
		if (retVal == 0)
		{
			if(this.getObsRequired() == null && compareObj.getObsRequired() != null)
				return -1;
			if(this.getObsRequired() != null && compareObj.getObsRequired() == null)
				return 1;
			if(this.getObsRequired() != null && compareObj.getObsRequired() != null)
				retVal = this.getObsRequired().compareTo(compareObj.getObsRequired());
		}
		if (retVal == 0)
		{
			if(this.getMedsGiven() == null && compareObj.getMedsGiven() != null)
				return -1;
			if(this.getMedsGiven() != null && compareObj.getMedsGiven() == null)
				return 1;
			if(this.getMedsGiven() != null && compareObj.getMedsGiven() != null)
				retVal = this.getMedsGiven().compareTo(compareObj.getMedsGiven());
		}
		if (retVal == 0)
		{
			if(this.getECG() == null && compareObj.getECG() != null)
				return -1;
			if(this.getECG() != null && compareObj.getECG() == null)
				return 1;
			if(this.getECG() != null && compareObj.getECG() != null)
				retVal = this.getECG().compareTo(compareObj.getECG());
		}
		if (retVal == 0)
		{
			if(this.getNPO() == null && compareObj.getNPO() != null)
				return -1;
			if(this.getNPO() != null && compareObj.getNPO() == null)
				return 1;
			if(this.getNPO() != null && compareObj.getNPO() != null)
				retVal = this.getNPO().compareTo(compareObj.getNPO());
		}
		if (retVal == 0)
		{
			if(this.getIsolation() == null && compareObj.getIsolation() != null)
				return -1;
			if(this.getIsolation() != null && compareObj.getIsolation() == null)
				return 1;
			if(this.getIsolation() != null && compareObj.getIsolation() != null)
				retVal = this.getIsolation().compareTo(compareObj.getIsolation());
		}
		return retVal;
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = 0;
		if(this.obsrequired != null)
			count++;
		if(this.medsgiven != null)
			count++;
		if(this.ecg != null)
			count++;
		if(this.npo != null)
			count++;
		if(this.isolation != null)
			count++;
		if(this.painassessments != null)
			count++;
		if(this.waterlowassessments != null)
			count++;
		if(this.fallsassessment != null)
			count++;
		if(this.isarassessments != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return 9;
	}
	protected Integer obsrequired;
	protected Integer medsgiven;
	protected Boolean ecg;
	protected Boolean npo;
	protected Boolean isolation;
	protected Integer painassessments;
	protected Integer waterlowassessments;
	protected Integer fallsassessment;
	protected Integer isarassessments;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
