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

/**
 * Linked to clinical.PatientHomeSituation business object (ID: 1072100065).
 */
public class PatientHomeSituationVo extends ims.clinical.vo.PatientHomeSituationRefVo implements ims.vo.ImsCloneable, Comparable
{
	private static final long serialVersionUID = 1L;

	public PatientHomeSituationVo()
	{
	}
	public PatientHomeSituationVo(Integer id, int version)
	{
		super(id, version);
	}
	public PatientHomeSituationVo(ims.core.vo.beans.PatientHomeSituationVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.carecontext = bean.getCareContext() == null ? null : new ims.core.admin.vo.CareContextRefVo(new Integer(bean.getCareContext().getId()), bean.getCareContext().getVersion());
		this.clinicalcontact = bean.getClinicalContact() == null ? null : new ims.core.admin.vo.ClinicalContactRefVo(new Integer(bean.getClinicalContact().getId()), bean.getClinicalContact().getVersion());
		this.accomtype = bean.getAccomType() == null ? null : ims.clinical.vo.lookups.HSAccomType.buildLookup(bean.getAccomType());
		this.accomtypeother = bean.getAccomTypeOther();
		this.ownership = bean.getOwnership() == null ? null : ims.clinical.vo.lookups.HSOwnership.buildLookup(bean.getOwnership());
		this.supervisedby = bean.getSupervisedBy() == null ? null : ims.clinical.vo.lookups.HSSupervisedBy.buildLookup(bean.getSupervisedBy());
		this.supervisename = bean.getSuperviseName();
		this.superviseaddress = bean.getSuperviseAddress();
		this.supervisephoneno = bean.getSupervisePhoneNo();
		this.floorlevel = bean.getFloorLevel() == null ? null : ims.clinical.vo.lookups.HSFloorLevel.buildLookup(bean.getFloorLevel());
		this.lift = bean.getLift() == null ? null : ims.clinical.vo.lookups.HSLift.buildLookup(bean.getLift());
		this.stairs = bean.getStairs() == null ? null : ims.clinical.vo.lookups.HSStairs.buildLookup(bean.getStairs());
		this.stairslift = bean.getStairsLift();
		this.rails = bean.getRails() == null ? null : ims.clinical.vo.lookups.HSRails.buildLookup(bean.getRails());
		this.railside = bean.getRailSide() == null ? null : ims.clinical.vo.lookups.HSRailsSide.buildLookup(bean.getRailSide());
		this.bathroom = bean.getBathroom();
		this.bathroomlocation = bean.getBathroomLocation() == null ? null : ims.clinical.vo.lookups.HSBathroomLocation.buildLookup(bean.getBathroomLocation());
		this.toilet = bean.getToilet();
		this.toiletlocation = bean.getToiletLocation() == null ? null : ims.clinical.vo.lookups.HSToiletLocation.buildLookup(bean.getToiletLocation());
		this.shower = bean.getShower();
		this.showerlocation = bean.getShowerLocation() == null ? null : ims.clinical.vo.lookups.HSShowerLocation.buildLookup(bean.getShowerLocation());
		this.housekeys = bean.getHouseKeys();
		this.spareset = bean.getSpareSet();
		this.authoringinformation = bean.getAuthoringInformation() == null ? null : bean.getAuthoringInformation().buildVo();
		this.liveswith = bean.getLivesWith() == null ? null : ims.core.vo.lookups.LivesWith.buildLookup(bean.getLivesWith());
		this.liveswithdetails = bean.getLivesWithDetails();
		this.fittocareforpatient = bean.getFitToCareForPatient() == null ? null : ims.core.vo.lookups.YesNoUnknown.buildLookup(bean.getFitToCareForPatient());
		this.fittotakehome = bean.getFitToTakeHome() == null ? null : ims.core.vo.lookups.YesNoUnknown.buildLookup(bean.getFitToTakeHome());
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.core.vo.beans.PatientHomeSituationVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.carecontext = bean.getCareContext() == null ? null : new ims.core.admin.vo.CareContextRefVo(new Integer(bean.getCareContext().getId()), bean.getCareContext().getVersion());
		this.clinicalcontact = bean.getClinicalContact() == null ? null : new ims.core.admin.vo.ClinicalContactRefVo(new Integer(bean.getClinicalContact().getId()), bean.getClinicalContact().getVersion());
		this.accomtype = bean.getAccomType() == null ? null : ims.clinical.vo.lookups.HSAccomType.buildLookup(bean.getAccomType());
		this.accomtypeother = bean.getAccomTypeOther();
		this.ownership = bean.getOwnership() == null ? null : ims.clinical.vo.lookups.HSOwnership.buildLookup(bean.getOwnership());
		this.supervisedby = bean.getSupervisedBy() == null ? null : ims.clinical.vo.lookups.HSSupervisedBy.buildLookup(bean.getSupervisedBy());
		this.supervisename = bean.getSuperviseName();
		this.superviseaddress = bean.getSuperviseAddress();
		this.supervisephoneno = bean.getSupervisePhoneNo();
		this.floorlevel = bean.getFloorLevel() == null ? null : ims.clinical.vo.lookups.HSFloorLevel.buildLookup(bean.getFloorLevel());
		this.lift = bean.getLift() == null ? null : ims.clinical.vo.lookups.HSLift.buildLookup(bean.getLift());
		this.stairs = bean.getStairs() == null ? null : ims.clinical.vo.lookups.HSStairs.buildLookup(bean.getStairs());
		this.stairslift = bean.getStairsLift();
		this.rails = bean.getRails() == null ? null : ims.clinical.vo.lookups.HSRails.buildLookup(bean.getRails());
		this.railside = bean.getRailSide() == null ? null : ims.clinical.vo.lookups.HSRailsSide.buildLookup(bean.getRailSide());
		this.bathroom = bean.getBathroom();
		this.bathroomlocation = bean.getBathroomLocation() == null ? null : ims.clinical.vo.lookups.HSBathroomLocation.buildLookup(bean.getBathroomLocation());
		this.toilet = bean.getToilet();
		this.toiletlocation = bean.getToiletLocation() == null ? null : ims.clinical.vo.lookups.HSToiletLocation.buildLookup(bean.getToiletLocation());
		this.shower = bean.getShower();
		this.showerlocation = bean.getShowerLocation() == null ? null : ims.clinical.vo.lookups.HSShowerLocation.buildLookup(bean.getShowerLocation());
		this.housekeys = bean.getHouseKeys();
		this.spareset = bean.getSpareSet();
		this.authoringinformation = bean.getAuthoringInformation() == null ? null : bean.getAuthoringInformation().buildVo(map);
		this.liveswith = bean.getLivesWith() == null ? null : ims.core.vo.lookups.LivesWith.buildLookup(bean.getLivesWith());
		this.liveswithdetails = bean.getLivesWithDetails();
		this.fittocareforpatient = bean.getFitToCareForPatient() == null ? null : ims.core.vo.lookups.YesNoUnknown.buildLookup(bean.getFitToCareForPatient());
		this.fittotakehome = bean.getFitToTakeHome() == null ? null : ims.core.vo.lookups.YesNoUnknown.buildLookup(bean.getFitToTakeHome());
	}
	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.PatientHomeSituationVoBean bean = null;
		if(map != null)
			bean = (ims.core.vo.beans.PatientHomeSituationVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.core.vo.beans.PatientHomeSituationVoBean();
			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("CARECONTEXT"))
			return getCareContext();
		if(fieldName.equals("CLINICALCONTACT"))
			return getClinicalContact();
		if(fieldName.equals("ACCOMTYPE"))
			return getAccomType();
		if(fieldName.equals("ACCOMTYPEOTHER"))
			return getAccomTypeOther();
		if(fieldName.equals("OWNERSHIP"))
			return getOwnership();
		if(fieldName.equals("SUPERVISEDBY"))
			return getSupervisedBy();
		if(fieldName.equals("SUPERVISENAME"))
			return getSuperviseName();
		if(fieldName.equals("SUPERVISEADDRESS"))
			return getSuperviseAddress();
		if(fieldName.equals("SUPERVISEPHONENO"))
			return getSupervisePhoneNo();
		if(fieldName.equals("FLOORLEVEL"))
			return getFloorLevel();
		if(fieldName.equals("LIFT"))
			return getLift();
		if(fieldName.equals("STAIRS"))
			return getStairs();
		if(fieldName.equals("STAIRSLIFT"))
			return getStairsLift();
		if(fieldName.equals("RAILS"))
			return getRails();
		if(fieldName.equals("RAILSIDE"))
			return getRailSide();
		if(fieldName.equals("BATHROOM"))
			return getBathroom();
		if(fieldName.equals("BATHROOMLOCATION"))
			return getBathroomLocation();
		if(fieldName.equals("TOILET"))
			return getToilet();
		if(fieldName.equals("TOILETLOCATION"))
			return getToiletLocation();
		if(fieldName.equals("SHOWER"))
			return getShower();
		if(fieldName.equals("SHOWERLOCATION"))
			return getShowerLocation();
		if(fieldName.equals("HOUSEKEYS"))
			return getHouseKeys();
		if(fieldName.equals("SPARESET"))
			return getSpareSet();
		if(fieldName.equals("AUTHORINGINFORMATION"))
			return getAuthoringInformation();
		if(fieldName.equals("LIVESWITH"))
			return getLivesWith();
		if(fieldName.equals("LIVESWITHDETAILS"))
			return getLivesWithDetails();
		if(fieldName.equals("FITTOCAREFORPATIENT"))
			return getFitToCareForPatient();
		if(fieldName.equals("FITTOTAKEHOME"))
			return getFitToTakeHome();
		return super.getFieldValueByFieldName(fieldName);
	}
	public boolean getCareContextIsNotNull()
	{
		return this.carecontext != null;
	}
	public ims.core.admin.vo.CareContextRefVo getCareContext()
	{
		return this.carecontext;
	}
	public void setCareContext(ims.core.admin.vo.CareContextRefVo value)
	{
		this.isValidated = false;
		this.carecontext = value;
	}
	public boolean getClinicalContactIsNotNull()
	{
		return this.clinicalcontact != null;
	}
	public ims.core.admin.vo.ClinicalContactRefVo getClinicalContact()
	{
		return this.clinicalcontact;
	}
	public void setClinicalContact(ims.core.admin.vo.ClinicalContactRefVo value)
	{
		this.isValidated = false;
		this.clinicalcontact = value;
	}
	public boolean getAccomTypeIsNotNull()
	{
		return this.accomtype != null;
	}
	public ims.clinical.vo.lookups.HSAccomType getAccomType()
	{
		return this.accomtype;
	}
	public void setAccomType(ims.clinical.vo.lookups.HSAccomType value)
	{
		this.isValidated = false;
		this.accomtype = value;
	}
	public boolean getAccomTypeOtherIsNotNull()
	{
		return this.accomtypeother != null;
	}
	public String getAccomTypeOther()
	{
		return this.accomtypeother;
	}
	public static int getAccomTypeOtherMaxLength()
	{
		return 255;
	}
	public void setAccomTypeOther(String value)
	{
		this.isValidated = false;
		this.accomtypeother = value;
	}
	public boolean getOwnershipIsNotNull()
	{
		return this.ownership != null;
	}
	public ims.clinical.vo.lookups.HSOwnership getOwnership()
	{
		return this.ownership;
	}
	public void setOwnership(ims.clinical.vo.lookups.HSOwnership value)
	{
		this.isValidated = false;
		this.ownership = value;
	}
	public boolean getSupervisedByIsNotNull()
	{
		return this.supervisedby != null;
	}
	public ims.clinical.vo.lookups.HSSupervisedBy getSupervisedBy()
	{
		return this.supervisedby;
	}
	public void setSupervisedBy(ims.clinical.vo.lookups.HSSupervisedBy value)
	{
		this.isValidated = false;
		this.supervisedby = value;
	}
	public boolean getSuperviseNameIsNotNull()
	{
		return this.supervisename != null;
	}
	public String getSuperviseName()
	{
		return this.supervisename;
	}
	public static int getSuperviseNameMaxLength()
	{
		return 255;
	}
	public void setSuperviseName(String value)
	{
		this.isValidated = false;
		this.supervisename = value;
	}
	public boolean getSuperviseAddressIsNotNull()
	{
		return this.superviseaddress != null;
	}
	public String getSuperviseAddress()
	{
		return this.superviseaddress;
	}
	public static int getSuperviseAddressMaxLength()
	{
		return 255;
	}
	public void setSuperviseAddress(String value)
	{
		this.isValidated = false;
		this.superviseaddress = value;
	}
	public boolean getSupervisePhoneNoIsNotNull()
	{
		return this.supervisephoneno != null;
	}
	public String getSupervisePhoneNo()
	{
		return this.supervisephoneno;
	}
	public static int getSupervisePhoneNoMaxLength()
	{
		return 255;
	}
	public void setSupervisePhoneNo(String value)
	{
		this.isValidated = false;
		this.supervisephoneno = value;
	}
	public boolean getFloorLevelIsNotNull()
	{
		return this.floorlevel != null;
	}
	public ims.clinical.vo.lookups.HSFloorLevel getFloorLevel()
	{
		return this.floorlevel;
	}
	public void setFloorLevel(ims.clinical.vo.lookups.HSFloorLevel value)
	{
		this.isValidated = false;
		this.floorlevel = value;
	}
	public boolean getLiftIsNotNull()
	{
		return this.lift != null;
	}
	public ims.clinical.vo.lookups.HSLift getLift()
	{
		return this.lift;
	}
	public void setLift(ims.clinical.vo.lookups.HSLift value)
	{
		this.isValidated = false;
		this.lift = value;
	}
	public boolean getStairsIsNotNull()
	{
		return this.stairs != null;
	}
	public ims.clinical.vo.lookups.HSStairs getStairs()
	{
		return this.stairs;
	}
	public void setStairs(ims.clinical.vo.lookups.HSStairs value)
	{
		this.isValidated = false;
		this.stairs = value;
	}
	public boolean getStairsLiftIsNotNull()
	{
		return this.stairslift != null;
	}
	public String getStairsLift()
	{
		return this.stairslift;
	}
	public static int getStairsLiftMaxLength()
	{
		return 255;
	}
	public void setStairsLift(String value)
	{
		this.isValidated = false;
		this.stairslift = value;
	}
	public boolean getRailsIsNotNull()
	{
		return this.rails != null;
	}
	public ims.clinical.vo.lookups.HSRails getRails()
	{
		return this.rails;
	}
	public void setRails(ims.clinical.vo.lookups.HSRails value)
	{
		this.isValidated = false;
		this.rails = value;
	}
	public boolean getRailSideIsNotNull()
	{
		return this.railside != null;
	}
	public ims.clinical.vo.lookups.HSRailsSide getRailSide()
	{
		return this.railside;
	}
	public void setRailSide(ims.clinical.vo.lookups.HSRailsSide value)
	{
		this.isValidated = false;
		this.railside = value;
	}
	public boolean getBathroomIsNotNull()
	{
		return this.bathroom != null;
	}
	public String getBathroom()
	{
		return this.bathroom;
	}
	public static int getBathroomMaxLength()
	{
		return 255;
	}
	public void setBathroom(String value)
	{
		this.isValidated = false;
		this.bathroom = value;
	}
	public boolean getBathroomLocationIsNotNull()
	{
		return this.bathroomlocation != null;
	}
	public ims.clinical.vo.lookups.HSBathroomLocation getBathroomLocation()
	{
		return this.bathroomlocation;
	}
	public void setBathroomLocation(ims.clinical.vo.lookups.HSBathroomLocation value)
	{
		this.isValidated = false;
		this.bathroomlocation = value;
	}
	public boolean getToiletIsNotNull()
	{
		return this.toilet != null;
	}
	public String getToilet()
	{
		return this.toilet;
	}
	public static int getToiletMaxLength()
	{
		return 255;
	}
	public void setToilet(String value)
	{
		this.isValidated = false;
		this.toilet = value;
	}
	public boolean getToiletLocationIsNotNull()
	{
		return this.toiletlocation != null;
	}
	public ims.clinical.vo.lookups.HSToiletLocation getToiletLocation()
	{
		return this.toiletlocation;
	}
	public void setToiletLocation(ims.clinical.vo.lookups.HSToiletLocation value)
	{
		this.isValidated = false;
		this.toiletlocation = value;
	}
	public boolean getShowerIsNotNull()
	{
		return this.shower != null;
	}
	public String getShower()
	{
		return this.shower;
	}
	public static int getShowerMaxLength()
	{
		return 255;
	}
	public void setShower(String value)
	{
		this.isValidated = false;
		this.shower = value;
	}
	public boolean getShowerLocationIsNotNull()
	{
		return this.showerlocation != null;
	}
	public ims.clinical.vo.lookups.HSShowerLocation getShowerLocation()
	{
		return this.showerlocation;
	}
	public void setShowerLocation(ims.clinical.vo.lookups.HSShowerLocation value)
	{
		this.isValidated = false;
		this.showerlocation = value;
	}
	public boolean getHouseKeysIsNotNull()
	{
		return this.housekeys != null;
	}
	public String getHouseKeys()
	{
		return this.housekeys;
	}
	public static int getHouseKeysMaxLength()
	{
		return 255;
	}
	public void setHouseKeys(String value)
	{
		this.isValidated = false;
		this.housekeys = value;
	}
	public boolean getSpareSetIsNotNull()
	{
		return this.spareset != null;
	}
	public String getSpareSet()
	{
		return this.spareset;
	}
	public static int getSpareSetMaxLength()
	{
		return 255;
	}
	public void setSpareSet(String value)
	{
		this.isValidated = false;
		this.spareset = value;
	}
	public boolean getAuthoringInformationIsNotNull()
	{
		return this.authoringinformation != null;
	}
	public ims.core.vo.AuthoringInformationVo getAuthoringInformation()
	{
		return this.authoringinformation;
	}
	public void setAuthoringInformation(ims.core.vo.AuthoringInformationVo value)
	{
		this.isValidated = false;
		this.authoringinformation = value;
	}
	public boolean getLivesWithIsNotNull()
	{
		return this.liveswith != null;
	}
	public ims.core.vo.lookups.LivesWith getLivesWith()
	{
		return this.liveswith;
	}
	public void setLivesWith(ims.core.vo.lookups.LivesWith value)
	{
		this.isValidated = false;
		this.liveswith = value;
	}
	public boolean getLivesWithDetailsIsNotNull()
	{
		return this.liveswithdetails != null;
	}
	public String getLivesWithDetails()
	{
		return this.liveswithdetails;
	}
	public static int getLivesWithDetailsMaxLength()
	{
		return 255;
	}
	public void setLivesWithDetails(String value)
	{
		this.isValidated = false;
		this.liveswithdetails = value;
	}
	public boolean getFitToCareForPatientIsNotNull()
	{
		return this.fittocareforpatient != null;
	}
	public ims.core.vo.lookups.YesNoUnknown getFitToCareForPatient()
	{
		return this.fittocareforpatient;
	}
	public void setFitToCareForPatient(ims.core.vo.lookups.YesNoUnknown value)
	{
		this.isValidated = false;
		this.fittocareforpatient = value;
	}
	public boolean getFitToTakeHomeIsNotNull()
	{
		return this.fittotakehome != null;
	}
	public ims.core.vo.lookups.YesNoUnknown getFitToTakeHome()
	{
		return this.fittotakehome;
	}
	public void setFitToTakeHome(ims.core.vo.lookups.YesNoUnknown value)
	{
		this.isValidated = false;
		this.fittotakehome = value;
	}
	public boolean isValidated()
	{
		if(this.isBusy)
			return true;
		this.isBusy = true;
	
		if(!this.isValidated)
		{
			this.isBusy = false;
			return false;
		}
		if(this.authoringinformation != null)
		{
			if(!this.authoringinformation.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.carecontext == null)
			listOfErrors.add("CareContext is mandatory");
		if(this.authoringinformation != null)
		{
			String[] listOfOtherErrors = this.authoringinformation.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[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 void clearIDAndVersion()
	{
		this.id = null;
		this.version = 0;
	}
	public Object clone()
	{
		if(this.isBusy)
			return this;
		this.isBusy = true;
	
		PatientHomeSituationVo clone = new PatientHomeSituationVo(this.id, this.version);
		
		clone.carecontext = this.carecontext;
		clone.clinicalcontact = this.clinicalcontact;
		if(this.accomtype == null)
			clone.accomtype = null;
		else
			clone.accomtype = (ims.clinical.vo.lookups.HSAccomType)this.accomtype.clone();
		clone.accomtypeother = this.accomtypeother;
		if(this.ownership == null)
			clone.ownership = null;
		else
			clone.ownership = (ims.clinical.vo.lookups.HSOwnership)this.ownership.clone();
		if(this.supervisedby == null)
			clone.supervisedby = null;
		else
			clone.supervisedby = (ims.clinical.vo.lookups.HSSupervisedBy)this.supervisedby.clone();
		clone.supervisename = this.supervisename;
		clone.superviseaddress = this.superviseaddress;
		clone.supervisephoneno = this.supervisephoneno;
		if(this.floorlevel == null)
			clone.floorlevel = null;
		else
			clone.floorlevel = (ims.clinical.vo.lookups.HSFloorLevel)this.floorlevel.clone();
		if(this.lift == null)
			clone.lift = null;
		else
			clone.lift = (ims.clinical.vo.lookups.HSLift)this.lift.clone();
		if(this.stairs == null)
			clone.stairs = null;
		else
			clone.stairs = (ims.clinical.vo.lookups.HSStairs)this.stairs.clone();
		clone.stairslift = this.stairslift;
		if(this.rails == null)
			clone.rails = null;
		else
			clone.rails = (ims.clinical.vo.lookups.HSRails)this.rails.clone();
		if(this.railside == null)
			clone.railside = null;
		else
			clone.railside = (ims.clinical.vo.lookups.HSRailsSide)this.railside.clone();
		clone.bathroom = this.bathroom;
		if(this.bathroomlocation == null)
			clone.bathroomlocation = null;
		else
			clone.bathroomlocation = (ims.clinical.vo.lookups.HSBathroomLocation)this.bathroomlocation.clone();
		clone.toilet = this.toilet;
		if(this.toiletlocation == null)
			clone.toiletlocation = null;
		else
			clone.toiletlocation = (ims.clinical.vo.lookups.HSToiletLocation)this.toiletlocation.clone();
		clone.shower = this.shower;
		if(this.showerlocation == null)
			clone.showerlocation = null;
		else
			clone.showerlocation = (ims.clinical.vo.lookups.HSShowerLocation)this.showerlocation.clone();
		clone.housekeys = this.housekeys;
		clone.spareset = this.spareset;
		if(this.authoringinformation == null)
			clone.authoringinformation = null;
		else
			clone.authoringinformation = (ims.core.vo.AuthoringInformationVo)this.authoringinformation.clone();
		if(this.liveswith == null)
			clone.liveswith = null;
		else
			clone.liveswith = (ims.core.vo.lookups.LivesWith)this.liveswith.clone();
		clone.liveswithdetails = this.liveswithdetails;
		if(this.fittocareforpatient == null)
			clone.fittocareforpatient = null;
		else
			clone.fittocareforpatient = (ims.core.vo.lookups.YesNoUnknown)this.fittocareforpatient.clone();
		if(this.fittotakehome == null)
			clone.fittotakehome = null;
		else
			clone.fittotakehome = (ims.core.vo.lookups.YesNoUnknown)this.fittotakehome.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 (!(PatientHomeSituationVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A PatientHomeSituationVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		if (this.id == null)
			return 1;
		if (((PatientHomeSituationVo)obj).getBoId() == null)
			return -1;
		return this.id.compareTo(((PatientHomeSituationVo)obj).getBoId());
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = 0;
		if(this.accomtype != null)
			count++;
		if(this.accomtypeother != null)
			count++;
		if(this.ownership != null)
			count++;
		if(this.supervisedby != null)
			count++;
		if(this.supervisename != null)
			count++;
		if(this.superviseaddress != null)
			count++;
		if(this.supervisephoneno != null)
			count++;
		if(this.floorlevel != null)
			count++;
		if(this.lift != null)
			count++;
		if(this.stairs != null)
			count++;
		if(this.stairslift != null)
			count++;
		if(this.rails != null)
			count++;
		if(this.railside != null)
			count++;
		if(this.bathroom != null)
			count++;
		if(this.bathroomlocation != null)
			count++;
		if(this.toilet != null)
			count++;
		if(this.toiletlocation != null)
			count++;
		if(this.shower != null)
			count++;
		if(this.showerlocation != null)
			count++;
		if(this.housekeys != null)
			count++;
		if(this.spareset != null)
			count++;
		if(this.liveswith != null)
			count++;
		if(this.liveswithdetails != null)
			count++;
		if(this.fittocareforpatient != null)
			count++;
		if(this.fittotakehome != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return 25;
	}
	protected ims.core.admin.vo.CareContextRefVo carecontext;
	protected ims.core.admin.vo.ClinicalContactRefVo clinicalcontact;
	protected ims.clinical.vo.lookups.HSAccomType accomtype;
	protected String accomtypeother;
	protected ims.clinical.vo.lookups.HSOwnership ownership;
	protected ims.clinical.vo.lookups.HSSupervisedBy supervisedby;
	protected String supervisename;
	protected String superviseaddress;
	protected String supervisephoneno;
	protected ims.clinical.vo.lookups.HSFloorLevel floorlevel;
	protected ims.clinical.vo.lookups.HSLift lift;
	protected ims.clinical.vo.lookups.HSStairs stairs;
	protected String stairslift;
	protected ims.clinical.vo.lookups.HSRails rails;
	protected ims.clinical.vo.lookups.HSRailsSide railside;
	protected String bathroom;
	protected ims.clinical.vo.lookups.HSBathroomLocation bathroomlocation;
	protected String toilet;
	protected ims.clinical.vo.lookups.HSToiletLocation toiletlocation;
	protected String shower;
	protected ims.clinical.vo.lookups.HSShowerLocation showerlocation;
	protected String housekeys;
	protected String spareset;
	protected ims.core.vo.AuthoringInformationVo authoringinformation;
	protected ims.core.vo.lookups.LivesWith liveswith;
	protected String liveswithdetails;
	protected ims.core.vo.lookups.YesNoUnknown fittocareforpatient;
	protected ims.core.vo.lookups.YesNoUnknown fittotakehome;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
