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

/**
 * Linked to Oncology.Configuration.PrognosticGroupingConfig business object (ID: 1075100014).
 */
public class PrognosticGroupingCongfigVo extends ims.oncology.configuration.vo.PrognosticGroupingConfigRefVo implements ims.vo.ImsCloneable, Comparable
{
	private static final long serialVersionUID = 1L;

	public PrognosticGroupingCongfigVo()
	{
	}
	public PrognosticGroupingCongfigVo(Integer id, int version)
	{
		super(id, version);
	}
	public PrognosticGroupingCongfigVo(ims.clinicaladmin.vo.beans.PrognosticGroupingCongfigVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.ishistologicaltypepertinent = bean.getIsHistologicalTypePertinent();
		this.ishistologicalgradepertinent = bean.getIsHistologicalGradePertinent();
		this.istumourlocationpertinent = bean.getIsTumourLocationPertinent();
		this.isriskcategorypertinent = bean.getIsRiskCategoryPertinent();
		this.ispsapertinent = bean.getIsPSAPertinent();
		this.isgleasonpertinent = bean.getIsGleasonPertinent();
		this.psa = ims.clinicaladmin.vo.PSAConfigVoCollection.buildFromBeanCollection(bean.getPSA());
		this.gleason = ims.clinicaladmin.vo.GleasonConfigLiteVoCollection.buildFromBeanCollection(bean.getGleason());
		this.location = ims.oncology.vo.PrognosticLocationConfigVoCollection.buildFromBeanCollection(bean.getLocation());
		this.risk = ims.clinicaladmin.vo.PrognosticRiskConfigVoCollection.buildFromBeanCollection(bean.getRisk());
		this.usetvalues = bean.getUseTValues();
		this.usemvalues = bean.getUseMValues();
		this.usenvalues = bean.getUseNValues();
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.clinicaladmin.vo.beans.PrognosticGroupingCongfigVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.ishistologicaltypepertinent = bean.getIsHistologicalTypePertinent();
		this.ishistologicalgradepertinent = bean.getIsHistologicalGradePertinent();
		this.istumourlocationpertinent = bean.getIsTumourLocationPertinent();
		this.isriskcategorypertinent = bean.getIsRiskCategoryPertinent();
		this.ispsapertinent = bean.getIsPSAPertinent();
		this.isgleasonpertinent = bean.getIsGleasonPertinent();
		this.psa = ims.clinicaladmin.vo.PSAConfigVoCollection.buildFromBeanCollection(bean.getPSA());
		this.gleason = ims.clinicaladmin.vo.GleasonConfigLiteVoCollection.buildFromBeanCollection(bean.getGleason());
		this.location = ims.oncology.vo.PrognosticLocationConfigVoCollection.buildFromBeanCollection(bean.getLocation());
		this.risk = ims.clinicaladmin.vo.PrognosticRiskConfigVoCollection.buildFromBeanCollection(bean.getRisk());
		this.usetvalues = bean.getUseTValues();
		this.usemvalues = bean.getUseMValues();
		this.usenvalues = bean.getUseNValues();
	}
	public ims.vo.ValueObjectBean getBean()
	{
		return this.getBean(new ims.vo.ValueObjectBeanMap());
	}
	public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
	{
		ims.clinicaladmin.vo.beans.PrognosticGroupingCongfigVoBean bean = null;
		if(map != null)
			bean = (ims.clinicaladmin.vo.beans.PrognosticGroupingCongfigVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.clinicaladmin.vo.beans.PrognosticGroupingCongfigVoBean();
			map.addValueObjectBean(this, bean);
			bean.populate(map, this);
		}
		return bean;
	}
	public Object getFieldValueByFieldName(String fieldName)
	{
		if(fieldName == null)
			throw new ims.framework.exceptions.CodingRuntimeException("Invalid field name");
		fieldName = fieldName.toUpperCase();
		if(fieldName.equals("ISHISTOLOGICALTYPEPERTINENT"))
			return getIsHistologicalTypePertinent();
		if(fieldName.equals("ISHISTOLOGICALGRADEPERTINENT"))
			return getIsHistologicalGradePertinent();
		if(fieldName.equals("ISTUMOURLOCATIONPERTINENT"))
			return getIsTumourLocationPertinent();
		if(fieldName.equals("ISRISKCATEGORYPERTINENT"))
			return getIsRiskCategoryPertinent();
		if(fieldName.equals("ISPSAPERTINENT"))
			return getIsPSAPertinent();
		if(fieldName.equals("ISGLEASONPERTINENT"))
			return getIsGleasonPertinent();
		if(fieldName.equals("PSA"))
			return getPSA();
		if(fieldName.equals("GLEASON"))
			return getGleason();
		if(fieldName.equals("LOCATION"))
			return getLocation();
		if(fieldName.equals("RISK"))
			return getRisk();
		if(fieldName.equals("USETVALUES"))
			return getUseTValues();
		if(fieldName.equals("USEMVALUES"))
			return getUseMValues();
		if(fieldName.equals("USENVALUES"))
			return getUseNValues();
		return super.getFieldValueByFieldName(fieldName);
	}
	public boolean getIsHistologicalTypePertinentIsNotNull()
	{
		return this.ishistologicaltypepertinent != null;
	}
	public Boolean getIsHistologicalTypePertinent()
	{
		return this.ishistologicaltypepertinent;
	}
	public void setIsHistologicalTypePertinent(Boolean value)
	{
		this.isValidated = false;
		this.ishistologicaltypepertinent = value;
	}
	public boolean getIsHistologicalGradePertinentIsNotNull()
	{
		return this.ishistologicalgradepertinent != null;
	}
	public Boolean getIsHistologicalGradePertinent()
	{
		return this.ishistologicalgradepertinent;
	}
	public void setIsHistologicalGradePertinent(Boolean value)
	{
		this.isValidated = false;
		this.ishistologicalgradepertinent = value;
	}
	public boolean getIsTumourLocationPertinentIsNotNull()
	{
		return this.istumourlocationpertinent != null;
	}
	public Boolean getIsTumourLocationPertinent()
	{
		return this.istumourlocationpertinent;
	}
	public void setIsTumourLocationPertinent(Boolean value)
	{
		this.isValidated = false;
		this.istumourlocationpertinent = value;
	}
	public boolean getIsRiskCategoryPertinentIsNotNull()
	{
		return this.isriskcategorypertinent != null;
	}
	public Boolean getIsRiskCategoryPertinent()
	{
		return this.isriskcategorypertinent;
	}
	public void setIsRiskCategoryPertinent(Boolean value)
	{
		this.isValidated = false;
		this.isriskcategorypertinent = value;
	}
	public boolean getIsPSAPertinentIsNotNull()
	{
		return this.ispsapertinent != null;
	}
	public Boolean getIsPSAPertinent()
	{
		return this.ispsapertinent;
	}
	public void setIsPSAPertinent(Boolean value)
	{
		this.isValidated = false;
		this.ispsapertinent = value;
	}
	public boolean getIsGleasonPertinentIsNotNull()
	{
		return this.isgleasonpertinent != null;
	}
	public Boolean getIsGleasonPertinent()
	{
		return this.isgleasonpertinent;
	}
	public void setIsGleasonPertinent(Boolean value)
	{
		this.isValidated = false;
		this.isgleasonpertinent = value;
	}
	public boolean getPSAIsNotNull()
	{
		return this.psa != null;
	}
	public ims.clinicaladmin.vo.PSAConfigVoCollection getPSA()
	{
		return this.psa;
	}
	public void setPSA(ims.clinicaladmin.vo.PSAConfigVoCollection value)
	{
		this.isValidated = false;
		this.psa = value;
	}
	public boolean getGleasonIsNotNull()
	{
		return this.gleason != null;
	}
	public ims.clinicaladmin.vo.GleasonConfigLiteVoCollection getGleason()
	{
		return this.gleason;
	}
	public void setGleason(ims.clinicaladmin.vo.GleasonConfigLiteVoCollection value)
	{
		this.isValidated = false;
		this.gleason = value;
	}
	public boolean getLocationIsNotNull()
	{
		return this.location != null;
	}
	public ims.oncology.vo.PrognosticLocationConfigVoCollection getLocation()
	{
		return this.location;
	}
	public void setLocation(ims.oncology.vo.PrognosticLocationConfigVoCollection value)
	{
		this.isValidated = false;
		this.location = value;
	}
	public boolean getRiskIsNotNull()
	{
		return this.risk != null;
	}
	public ims.clinicaladmin.vo.PrognosticRiskConfigVoCollection getRisk()
	{
		return this.risk;
	}
	public void setRisk(ims.clinicaladmin.vo.PrognosticRiskConfigVoCollection value)
	{
		this.isValidated = false;
		this.risk = value;
	}
	public boolean getUseTValuesIsNotNull()
	{
		return this.usetvalues != null;
	}
	public Boolean getUseTValues()
	{
		return this.usetvalues;
	}
	public void setUseTValues(Boolean value)
	{
		this.isValidated = false;
		this.usetvalues = value;
	}
	public boolean getUseMValuesIsNotNull()
	{
		return this.usemvalues != null;
	}
	public Boolean getUseMValues()
	{
		return this.usemvalues;
	}
	public void setUseMValues(Boolean value)
	{
		this.isValidated = false;
		this.usemvalues = value;
	}
	public boolean getUseNValuesIsNotNull()
	{
		return this.usenvalues != null;
	}
	public Boolean getUseNValues()
	{
		return this.usenvalues;
	}
	public void setUseNValues(Boolean value)
	{
		this.isValidated = false;
		this.usenvalues = value;
	}
	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]);
			}
		}
		if(this.ishistologicaltypepertinent == null)
			listOfErrors.add("isHistologicalTypePertinent is mandatory");
		if(this.ishistologicalgradepertinent == null)
			listOfErrors.add("isHistologicalGradePertinent is mandatory");
		if(this.istumourlocationpertinent == null)
			listOfErrors.add("isTumourLocationPertinent is mandatory");
		if(this.isriskcategorypertinent == null)
			listOfErrors.add("isRiskCategoryPertinent is mandatory");
		if(this.ispsapertinent == null)
			listOfErrors.add("isPSAPertinent is mandatory");
		if(this.isgleasonpertinent == null)
			listOfErrors.add("isGleasonPertinent is mandatory");
		if(this.usetvalues == null)
			listOfErrors.add("useTValues is mandatory");
		if(this.usemvalues == null)
			listOfErrors.add("useMValues is mandatory");
		if(this.usenvalues == null)
			listOfErrors.add("useNValues is mandatory");
		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 void clearIDAndVersion()
	{
		this.id = null;
		this.version = 0;
	}
	public Object clone()
	{
		if(this.isBusy)
			return this;
		this.isBusy = true;
	
		PrognosticGroupingCongfigVo clone = new PrognosticGroupingCongfigVo(this.id, this.version);
		
		clone.ishistologicaltypepertinent = this.ishistologicaltypepertinent;
		clone.ishistologicalgradepertinent = this.ishistologicalgradepertinent;
		clone.istumourlocationpertinent = this.istumourlocationpertinent;
		clone.isriskcategorypertinent = this.isriskcategorypertinent;
		clone.ispsapertinent = this.ispsapertinent;
		clone.isgleasonpertinent = this.isgleasonpertinent;
		if(this.psa == null)
			clone.psa = null;
		else
			clone.psa = (ims.clinicaladmin.vo.PSAConfigVoCollection)this.psa.clone();
		if(this.gleason == null)
			clone.gleason = null;
		else
			clone.gleason = (ims.clinicaladmin.vo.GleasonConfigLiteVoCollection)this.gleason.clone();
		if(this.location == null)
			clone.location = null;
		else
			clone.location = (ims.oncology.vo.PrognosticLocationConfigVoCollection)this.location.clone();
		if(this.risk == null)
			clone.risk = null;
		else
			clone.risk = (ims.clinicaladmin.vo.PrognosticRiskConfigVoCollection)this.risk.clone();
		clone.usetvalues = this.usetvalues;
		clone.usemvalues = this.usemvalues;
		clone.usenvalues = this.usenvalues;
		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 (!(PrognosticGroupingCongfigVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A PrognosticGroupingCongfigVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		if (this.id == null)
			return 1;
		if (((PrognosticGroupingCongfigVo)obj).getBoId() == null)
			return -1;
		return this.id.compareTo(((PrognosticGroupingCongfigVo)obj).getBoId());
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = 0;
		if(this.ishistologicaltypepertinent != null)
			count++;
		if(this.ishistologicalgradepertinent != null)
			count++;
		if(this.istumourlocationpertinent != null)
			count++;
		if(this.isriskcategorypertinent != null)
			count++;
		if(this.ispsapertinent != null)
			count++;
		if(this.isgleasonpertinent != null)
			count++;
		if(this.psa != null)
			count++;
		if(this.gleason != null)
			count++;
		if(this.location != null)
			count++;
		if(this.risk != null)
			count++;
		if(this.usetvalues != null)
			count++;
		if(this.usemvalues != null)
			count++;
		if(this.usenvalues != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return 13;
	}
	protected Boolean ishistologicaltypepertinent;
	protected Boolean ishistologicalgradepertinent;
	protected Boolean istumourlocationpertinent;
	protected Boolean isriskcategorypertinent;
	protected Boolean ispsapertinent;
	protected Boolean isgleasonpertinent;
	protected ims.clinicaladmin.vo.PSAConfigVoCollection psa;
	protected ims.clinicaladmin.vo.GleasonConfigLiteVoCollection gleason;
	protected ims.oncology.vo.PrognosticLocationConfigVoCollection location;
	protected ims.clinicaladmin.vo.PrognosticRiskConfigVoCollection risk;
	protected Boolean usetvalues;
	protected Boolean usemvalues;
	protected Boolean usenvalues;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
