/FileExtraction/Java_unseen/IMS-MAXIMS_openMAXIMS/Source Library/openmaxims_workspace/ValueObjects/src/ims/core/vo/AdmissionDetailVo.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 core.admin.pas.AdmissionDetail business object (ID: 1014100008).
 */
public class AdmissionDetailVo extends ims.core.admin.pas.vo.AdmissionDetailRefVo implements ims.vo.ImsCloneable, Comparable
{
	private static final long serialVersionUID = 1L;

	public AdmissionDetailVo()
	{
	}
	public AdmissionDetailVo(Integer id, int version)
	{
		super(id, version);
	}
	public AdmissionDetailVo(ims.core.vo.beans.AdmissionDetailVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.pasevent = bean.getPasEvent() == null ? null : bean.getPasEvent().buildVo();
		this.admissiondatetime = bean.getAdmissionDateTime() == null ? null : bean.getAdmissionDateTime().buildDateTime();
		this.ward = bean.getWard() == null ? null : bean.getWard().buildVo();
		this.bed = bean.getBed() == null ? null : new ims.core.layout.vo.BedSpaceRefVo(new Integer(bean.getBed().getId()), bean.getBed().getVersion());
		this.consultant = bean.getConsultant() == null ? null : bean.getConsultant().buildVo();
		this.specialty = bean.getSpecialty() == null ? null : ims.core.vo.lookups.Specialty.buildLookup(bean.getSpecialty());
		this.wardtype = bean.getWardType() == null ? null : ims.core.vo.lookups.WardType.buildLookup(bean.getWardType());
		this.methodofadmission = bean.getMethodOfAdmission() == null ? null : ims.core.vo.lookups.MethodOfAdmission.buildLookup(bean.getMethodOfAdmission());
		this.sourceofadmission = bean.getSourceOfAdmission() == null ? null : ims.core.vo.lookups.SourceOfAdmission.buildLookup(bean.getSourceOfAdmission());
		this.reasonforadmission = bean.getReasonForAdmission();
		this.estdischargedate = bean.getEstDischargeDate() == null ? null : bean.getEstDischargeDate().buildDateTime();
		this.ischaplainrequired = bean.getIsChaplainRequired();
		this.referringconsultant = bean.getReferringConsultant() == null ? null : bean.getReferringConsultant().buildVo();
		this.patientstatus = bean.getPatientStatus() == null ? null : ims.core.vo.lookups.PatientStatus.buildLookup(bean.getPatientStatus());
		this.updatecfl = bean.getUpdateCFL();
		this.anticipatedstay = bean.getAnticipatedStay();
		this.casefoldercomments = bean.getCaseFolderComments();
		this.admissionepisode = bean.getAdmissionEpisode() == null ? null : bean.getAdmissionEpisode().buildVo();
		this.extendeddetails = bean.getExtendedDetails() == null ? null : bean.getExtendedDetails().buildVo();
		this.transferhistory = ims.core.vo.TransferHistoryVoCollection.buildFromBeanCollection(bean.getTransferHistory());
		this.ismaternity = bean.getIsMaternity();
		this.service = bean.getService() == null ? null : bean.getService().buildVo();
		this.extendedlengthofstayreason = bean.getExtendedLengthOfStayReason() == null ? null : ims.core.vo.lookups.ExtendedLengthOfStayReason.buildLookup(bean.getExtendedLengthOfStayReason());
		this.medicallyfitfordischarge = bean.getMedicallyFitForDischarge() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getMedicallyFitForDischarge());
		this.reasondelayeddischarge = ims.core.vo.ReasonForDelayedDischargeVoCollection.buildFromBeanCollection(bean.getReasonDelayedDischarge());
		this.patientrequirestransport = bean.getPatientRequiresTransport();
		this.transportdetails = bean.getTransportDetails() == null ? null : bean.getTransportDetails().buildVo();
		this.abletogodischargelounge = bean.getAbleToGoDischargeLounge();
		this.reasoncannotgodischargelounge = bean.getReasonCannotGoDischargeLounge() == null ? null : ims.core.vo.lookups.ReasonCannotGoDischargeLounge.buildLookup(bean.getReasonCannotGoDischargeLounge());
		this.wardappointment = bean.getWardAppointment() == null ? null : bean.getWardAppointment().buildVo();
		this.selfadmitpatient = bean.getSelfAdmitPatient();
		this.sourceofemergencyreferral = bean.getSourceOfEmergencyReferral() == null ? null : ims.core.vo.lookups.SourceOfEmergencyReferral.buildLookup(bean.getSourceOfEmergencyReferral());
		this.healthylodgerdetails = bean.getHealthyLodgerDetails() == null ? null : bean.getHealthyLodgerDetails().buildVo();
		this.pendingemergencytheatre = bean.getPendingEmergencyTheatre() == null ? null : bean.getPendingEmergencyTheatre().buildVo();
		this.admissionward = bean.getAdmissionWard() == null ? null : bean.getAdmissionWard().buildVo();
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.core.vo.beans.AdmissionDetailVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.pasevent = bean.getPasEvent() == null ? null : bean.getPasEvent().buildVo(map);
		this.admissiondatetime = bean.getAdmissionDateTime() == null ? null : bean.getAdmissionDateTime().buildDateTime();
		this.ward = bean.getWard() == null ? null : bean.getWard().buildVo(map);
		this.bed = bean.getBed() == null ? null : new ims.core.layout.vo.BedSpaceRefVo(new Integer(bean.getBed().getId()), bean.getBed().getVersion());
		this.consultant = bean.getConsultant() == null ? null : bean.getConsultant().buildVo(map);
		this.specialty = bean.getSpecialty() == null ? null : ims.core.vo.lookups.Specialty.buildLookup(bean.getSpecialty());
		this.wardtype = bean.getWardType() == null ? null : ims.core.vo.lookups.WardType.buildLookup(bean.getWardType());
		this.methodofadmission = bean.getMethodOfAdmission() == null ? null : ims.core.vo.lookups.MethodOfAdmission.buildLookup(bean.getMethodOfAdmission());
		this.sourceofadmission = bean.getSourceOfAdmission() == null ? null : ims.core.vo.lookups.SourceOfAdmission.buildLookup(bean.getSourceOfAdmission());
		this.reasonforadmission = bean.getReasonForAdmission();
		this.estdischargedate = bean.getEstDischargeDate() == null ? null : bean.getEstDischargeDate().buildDateTime();
		this.ischaplainrequired = bean.getIsChaplainRequired();
		this.referringconsultant = bean.getReferringConsultant() == null ? null : bean.getReferringConsultant().buildVo(map);
		this.patientstatus = bean.getPatientStatus() == null ? null : ims.core.vo.lookups.PatientStatus.buildLookup(bean.getPatientStatus());
		this.updatecfl = bean.getUpdateCFL();
		this.anticipatedstay = bean.getAnticipatedStay();
		this.casefoldercomments = bean.getCaseFolderComments();
		this.admissionepisode = bean.getAdmissionEpisode() == null ? null : bean.getAdmissionEpisode().buildVo(map);
		this.extendeddetails = bean.getExtendedDetails() == null ? null : bean.getExtendedDetails().buildVo(map);
		this.transferhistory = ims.core.vo.TransferHistoryVoCollection.buildFromBeanCollection(bean.getTransferHistory());
		this.ismaternity = bean.getIsMaternity();
		this.service = bean.getService() == null ? null : bean.getService().buildVo(map);
		this.extendedlengthofstayreason = bean.getExtendedLengthOfStayReason() == null ? null : ims.core.vo.lookups.ExtendedLengthOfStayReason.buildLookup(bean.getExtendedLengthOfStayReason());
		this.medicallyfitfordischarge = bean.getMedicallyFitForDischarge() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getMedicallyFitForDischarge());
		this.reasondelayeddischarge = ims.core.vo.ReasonForDelayedDischargeVoCollection.buildFromBeanCollection(bean.getReasonDelayedDischarge());
		this.patientrequirestransport = bean.getPatientRequiresTransport();
		this.transportdetails = bean.getTransportDetails() == null ? null : bean.getTransportDetails().buildVo(map);
		this.abletogodischargelounge = bean.getAbleToGoDischargeLounge();
		this.reasoncannotgodischargelounge = bean.getReasonCannotGoDischargeLounge() == null ? null : ims.core.vo.lookups.ReasonCannotGoDischargeLounge.buildLookup(bean.getReasonCannotGoDischargeLounge());
		this.wardappointment = bean.getWardAppointment() == null ? null : bean.getWardAppointment().buildVo(map);
		this.selfadmitpatient = bean.getSelfAdmitPatient();
		this.sourceofemergencyreferral = bean.getSourceOfEmergencyReferral() == null ? null : ims.core.vo.lookups.SourceOfEmergencyReferral.buildLookup(bean.getSourceOfEmergencyReferral());
		this.healthylodgerdetails = bean.getHealthyLodgerDetails() == null ? null : bean.getHealthyLodgerDetails().buildVo(map);
		this.pendingemergencytheatre = bean.getPendingEmergencyTheatre() == null ? null : bean.getPendingEmergencyTheatre().buildVo(map);
		this.admissionward = bean.getAdmissionWard() == null ? null : bean.getAdmissionWard().buildVo(map);
	}
	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.AdmissionDetailVoBean bean = null;
		if(map != null)
			bean = (ims.core.vo.beans.AdmissionDetailVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.core.vo.beans.AdmissionDetailVoBean();
			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("PASEVENT"))
			return getPasEvent();
		if(fieldName.equals("ADMISSIONDATETIME"))
			return getAdmissionDateTime();
		if(fieldName.equals("WARD"))
			return getWard();
		if(fieldName.equals("BED"))
			return getBed();
		if(fieldName.equals("CONSULTANT"))
			return getConsultant();
		if(fieldName.equals("SPECIALTY"))
			return getSpecialty();
		if(fieldName.equals("WARDTYPE"))
			return getWardType();
		if(fieldName.equals("METHODOFADMISSION"))
			return getMethodOfAdmission();
		if(fieldName.equals("SOURCEOFADMISSION"))
			return getSourceOfAdmission();
		if(fieldName.equals("REASONFORADMISSION"))
			return getReasonForAdmission();
		if(fieldName.equals("ESTDISCHARGEDATE"))
			return getEstDischargeDate();
		if(fieldName.equals("ISCHAPLAINREQUIRED"))
			return getIsChaplainRequired();
		if(fieldName.equals("REFERRINGCONSULTANT"))
			return getReferringConsultant();
		if(fieldName.equals("PATIENTSTATUS"))
			return getPatientStatus();
		if(fieldName.equals("UPDATECFL"))
			return getUpdateCFL();
		if(fieldName.equals("ANTICIPATEDSTAY"))
			return getAnticipatedStay();
		if(fieldName.equals("CASEFOLDERCOMMENTS"))
			return getCaseFolderComments();
		if(fieldName.equals("ADMISSIONEPISODE"))
			return getAdmissionEpisode();
		if(fieldName.equals("EXTENDEDDETAILS"))
			return getExtendedDetails();
		if(fieldName.equals("TRANSFERHISTORY"))
			return getTransferHistory();
		if(fieldName.equals("ISMATERNITY"))
			return getIsMaternity();
		if(fieldName.equals("SERVICE"))
			return getService();
		if(fieldName.equals("EXTENDEDLENGTHOFSTAYREASON"))
			return getExtendedLengthOfStayReason();
		if(fieldName.equals("MEDICALLYFITFORDISCHARGE"))
			return getMedicallyFitForDischarge();
		if(fieldName.equals("REASONDELAYEDDISCHARGE"))
			return getReasonDelayedDischarge();
		if(fieldName.equals("PATIENTREQUIRESTRANSPORT"))
			return getPatientRequiresTransport();
		if(fieldName.equals("TRANSPORTDETAILS"))
			return getTransportDetails();
		if(fieldName.equals("ABLETOGODISCHARGELOUNGE"))
			return getAbleToGoDischargeLounge();
		if(fieldName.equals("REASONCANNOTGODISCHARGELOUNGE"))
			return getReasonCannotGoDischargeLounge();
		if(fieldName.equals("WARDAPPOINTMENT"))
			return getWardAppointment();
		if(fieldName.equals("SELFADMITPATIENT"))
			return getSelfAdmitPatient();
		if(fieldName.equals("SOURCEOFEMERGENCYREFERRAL"))
			return getSourceOfEmergencyReferral();
		if(fieldName.equals("HEALTHYLODGERDETAILS"))
			return getHealthyLodgerDetails();
		if(fieldName.equals("PENDINGEMERGENCYTHEATRE"))
			return getPendingEmergencyTheatre();
		if(fieldName.equals("ADMISSIONWARD"))
			return getAdmissionWard();
		return super.getFieldValueByFieldName(fieldName);
	}
	public boolean getPasEventIsNotNull()
	{
		return this.pasevent != null;
	}
	public ims.core.vo.PasEventAdmitVo getPasEvent()
	{
		return this.pasevent;
	}
	public void setPasEvent(ims.core.vo.PasEventAdmitVo value)
	{
		this.isValidated = false;
		this.pasevent = value;
	}
	public boolean getAdmissionDateTimeIsNotNull()
	{
		return this.admissiondatetime != null;
	}
	public ims.framework.utils.DateTime getAdmissionDateTime()
	{
		return this.admissiondatetime;
	}
	public void setAdmissionDateTime(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.admissiondatetime = 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 getBedIsNotNull()
	{
		return this.bed != null;
	}
	public ims.core.layout.vo.BedSpaceRefVo getBed()
	{
		return this.bed;
	}
	public void setBed(ims.core.layout.vo.BedSpaceRefVo value)
	{
		this.isValidated = false;
		this.bed = value;
	}
	public boolean getConsultantIsNotNull()
	{
		return this.consultant != null;
	}
	public ims.core.vo.MedicVo getConsultant()
	{
		return this.consultant;
	}
	public void setConsultant(ims.core.vo.MedicVo value)
	{
		this.isValidated = false;
		this.consultant = value;
	}
	public boolean getSpecialtyIsNotNull()
	{
		return this.specialty != null;
	}
	public ims.core.vo.lookups.Specialty getSpecialty()
	{
		return this.specialty;
	}
	public void setSpecialty(ims.core.vo.lookups.Specialty value)
	{
		this.isValidated = false;
		this.specialty = value;
	}
	public boolean getWardTypeIsNotNull()
	{
		return this.wardtype != null;
	}
	public ims.core.vo.lookups.WardType getWardType()
	{
		return this.wardtype;
	}
	public void setWardType(ims.core.vo.lookups.WardType value)
	{
		this.isValidated = false;
		this.wardtype = value;
	}
	public boolean getMethodOfAdmissionIsNotNull()
	{
		return this.methodofadmission != null;
	}
	public ims.core.vo.lookups.MethodOfAdmission getMethodOfAdmission()
	{
		return this.methodofadmission;
	}
	public void setMethodOfAdmission(ims.core.vo.lookups.MethodOfAdmission value)
	{
		this.isValidated = false;
		this.methodofadmission = value;
	}
	public boolean getSourceOfAdmissionIsNotNull()
	{
		return this.sourceofadmission != null;
	}
	public ims.core.vo.lookups.SourceOfAdmission getSourceOfAdmission()
	{
		return this.sourceofadmission;
	}
	public void setSourceOfAdmission(ims.core.vo.lookups.SourceOfAdmission value)
	{
		this.isValidated = false;
		this.sourceofadmission = value;
	}
	public boolean getReasonForAdmissionIsNotNull()
	{
		return this.reasonforadmission != null;
	}
	public String getReasonForAdmission()
	{
		return this.reasonforadmission;
	}
	public static int getReasonForAdmissionMaxLength()
	{
		return 255;
	}
	public void setReasonForAdmission(String value)
	{
		this.isValidated = false;
		this.reasonforadmission = value;
	}
	public boolean getEstDischargeDateIsNotNull()
	{
		return this.estdischargedate != null;
	}
	public ims.framework.utils.DateTime getEstDischargeDate()
	{
		return this.estdischargedate;
	}
	public void setEstDischargeDate(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.estdischargedate = value;
	}
	public boolean getIsChaplainRequiredIsNotNull()
	{
		return this.ischaplainrequired != null;
	}
	public Boolean getIsChaplainRequired()
	{
		return this.ischaplainrequired;
	}
	public void setIsChaplainRequired(Boolean value)
	{
		this.isValidated = false;
		this.ischaplainrequired = value;
	}
	public boolean getReferringConsultantIsNotNull()
	{
		return this.referringconsultant != null;
	}
	public ims.core.vo.MedicVo getReferringConsultant()
	{
		return this.referringconsultant;
	}
	public void setReferringConsultant(ims.core.vo.MedicVo value)
	{
		this.isValidated = false;
		this.referringconsultant = value;
	}
	public boolean getPatientStatusIsNotNull()
	{
		return this.patientstatus != null;
	}
	public ims.core.vo.lookups.PatientStatus getPatientStatus()
	{
		return this.patientstatus;
	}
	public void setPatientStatus(ims.core.vo.lookups.PatientStatus value)
	{
		this.isValidated = false;
		this.patientstatus = value;
	}
	public boolean getUpdateCFLIsNotNull()
	{
		return this.updatecfl != null;
	}
	public Boolean getUpdateCFL()
	{
		return this.updatecfl;
	}
	public void setUpdateCFL(Boolean value)
	{
		this.isValidated = false;
		this.updatecfl = value;
	}
	public boolean getAnticipatedStayIsNotNull()
	{
		return this.anticipatedstay != null;
	}
	public Integer getAnticipatedStay()
	{
		return this.anticipatedstay;
	}
	public void setAnticipatedStay(Integer value)
	{
		this.isValidated = false;
		this.anticipatedstay = value;
	}
	public boolean getCaseFolderCommentsIsNotNull()
	{
		return this.casefoldercomments != null;
	}
	public String getCaseFolderComments()
	{
		return this.casefoldercomments;
	}
	public static int getCaseFolderCommentsMaxLength()
	{
		return 1000;
	}
	public void setCaseFolderComments(String value)
	{
		this.isValidated = false;
		this.casefoldercomments = value;
	}
	public boolean getAdmissionEpisodeIsNotNull()
	{
		return this.admissionepisode != null;
	}
	public ims.core.vo.EpisodeOfCareWithPrimaryDiagnosisVo getAdmissionEpisode()
	{
		return this.admissionepisode;
	}
	public void setAdmissionEpisode(ims.core.vo.EpisodeOfCareWithPrimaryDiagnosisVo value)
	{
		this.isValidated = false;
		this.admissionepisode = value;
	}
	public boolean getExtendedDetailsIsNotNull()
	{
		return this.extendeddetails != null;
	}
	public ims.core.vo.ExtendedAdmissionDetailVo getExtendedDetails()
	{
		return this.extendeddetails;
	}
	public void setExtendedDetails(ims.core.vo.ExtendedAdmissionDetailVo value)
	{
		this.isValidated = false;
		this.extendeddetails = value;
	}
	public boolean getTransferHistoryIsNotNull()
	{
		return this.transferhistory != null;
	}
	public ims.core.vo.TransferHistoryVoCollection getTransferHistory()
	{
		return this.transferhistory;
	}
	public void setTransferHistory(ims.core.vo.TransferHistoryVoCollection value)
	{
		this.isValidated = false;
		this.transferhistory = value;
	}
	public boolean getIsMaternityIsNotNull()
	{
		return this.ismaternity != null;
	}
	public Boolean getIsMaternity()
	{
		return this.ismaternity;
	}
	public void setIsMaternity(Boolean value)
	{
		this.isValidated = false;
		this.ismaternity = value;
	}
	public boolean getServiceIsNotNull()
	{
		return this.service != null;
	}
	public ims.core.vo.ServiceLiteVo getService()
	{
		return this.service;
	}
	public void setService(ims.core.vo.ServiceLiteVo value)
	{
		this.isValidated = false;
		this.service = value;
	}
	public boolean getExtendedLengthOfStayReasonIsNotNull()
	{
		return this.extendedlengthofstayreason != null;
	}
	public ims.core.vo.lookups.ExtendedLengthOfStayReason getExtendedLengthOfStayReason()
	{
		return this.extendedlengthofstayreason;
	}
	public void setExtendedLengthOfStayReason(ims.core.vo.lookups.ExtendedLengthOfStayReason value)
	{
		this.isValidated = false;
		this.extendedlengthofstayreason = value;
	}
	public boolean getMedicallyFitForDischargeIsNotNull()
	{
		return this.medicallyfitfordischarge != null;
	}
	public ims.core.vo.lookups.YesNo getMedicallyFitForDischarge()
	{
		return this.medicallyfitfordischarge;
	}
	public void setMedicallyFitForDischarge(ims.core.vo.lookups.YesNo value)
	{
		this.isValidated = false;
		this.medicallyfitfordischarge = value;
	}
	public boolean getReasonDelayedDischargeIsNotNull()
	{
		return this.reasondelayeddischarge != null;
	}
	public ims.core.vo.ReasonForDelayedDischargeVoCollection getReasonDelayedDischarge()
	{
		return this.reasondelayeddischarge;
	}
	public void setReasonDelayedDischarge(ims.core.vo.ReasonForDelayedDischargeVoCollection value)
	{
		this.isValidated = false;
		this.reasondelayeddischarge = value;
	}
	public boolean getPatientRequiresTransportIsNotNull()
	{
		return this.patientrequirestransport != null;
	}
	public Boolean getPatientRequiresTransport()
	{
		return this.patientrequirestransport;
	}
	public void setPatientRequiresTransport(Boolean value)
	{
		this.isValidated = false;
		this.patientrequirestransport = value;
	}
	public boolean getTransportDetailsIsNotNull()
	{
		return this.transportdetails != null;
	}
	public ims.core.vo.PatientTransportRequirementsVo getTransportDetails()
	{
		return this.transportdetails;
	}
	public void setTransportDetails(ims.core.vo.PatientTransportRequirementsVo value)
	{
		this.isValidated = false;
		this.transportdetails = value;
	}
	public boolean getAbleToGoDischargeLoungeIsNotNull()
	{
		return this.abletogodischargelounge != null;
	}
	public Boolean getAbleToGoDischargeLounge()
	{
		return this.abletogodischargelounge;
	}
	public void setAbleToGoDischargeLounge(Boolean value)
	{
		this.isValidated = false;
		this.abletogodischargelounge = value;
	}
	public boolean getReasonCannotGoDischargeLoungeIsNotNull()
	{
		return this.reasoncannotgodischargelounge != null;
	}
	public ims.core.vo.lookups.ReasonCannotGoDischargeLounge getReasonCannotGoDischargeLounge()
	{
		return this.reasoncannotgodischargelounge;
	}
	public void setReasonCannotGoDischargeLounge(ims.core.vo.lookups.ReasonCannotGoDischargeLounge value)
	{
		this.isValidated = false;
		this.reasoncannotgodischargelounge = value;
	}
	public boolean getWardAppointmentIsNotNull()
	{
		return this.wardappointment != null;
	}
	public ims.RefMan.vo.BookAppointmentForWardAttendersVo getWardAppointment()
	{
		return this.wardappointment;
	}
	public void setWardAppointment(ims.RefMan.vo.BookAppointmentForWardAttendersVo value)
	{
		this.isValidated = false;
		this.wardappointment = value;
	}
	public boolean getSelfAdmitPatientIsNotNull()
	{
		return this.selfadmitpatient != null;
	}
	public Boolean getSelfAdmitPatient()
	{
		return this.selfadmitpatient;
	}
	public void setSelfAdmitPatient(Boolean value)
	{
		this.isValidated = false;
		this.selfadmitpatient = value;
	}
	public boolean getSourceOfEmergencyReferralIsNotNull()
	{
		return this.sourceofemergencyreferral != null;
	}
	public ims.core.vo.lookups.SourceOfEmergencyReferral getSourceOfEmergencyReferral()
	{
		return this.sourceofemergencyreferral;
	}
	public void setSourceOfEmergencyReferral(ims.core.vo.lookups.SourceOfEmergencyReferral value)
	{
		this.isValidated = false;
		this.sourceofemergencyreferral = value;
	}
	public boolean getHealthyLodgerDetailsIsNotNull()
	{
		return this.healthylodgerdetails != null;
	}
	public ims.core.vo.HealthyLodgerVo getHealthyLodgerDetails()
	{
		return this.healthylodgerdetails;
	}
	public void setHealthyLodgerDetails(ims.core.vo.HealthyLodgerVo value)
	{
		this.isValidated = false;
		this.healthylodgerdetails = value;
	}
	public boolean getPendingEmergencyTheatreIsNotNull()
	{
		return this.pendingemergencytheatre != null;
	}
	public ims.scheduling.vo.PendingEmergencyTheatreForAdmitVo getPendingEmergencyTheatre()
	{
		return this.pendingemergencytheatre;
	}
	public void setPendingEmergencyTheatre(ims.scheduling.vo.PendingEmergencyTheatreForAdmitVo value)
	{
		this.isValidated = false;
		this.pendingemergencytheatre = value;
	}
	public boolean getAdmissionWardIsNotNull()
	{
		return this.admissionward != null;
	}
	public ims.core.vo.LocationLiteVo getAdmissionWard()
	{
		return this.admissionward;
	}
	public void setAdmissionWard(ims.core.vo.LocationLiteVo value)
	{
		this.isValidated = false;
		this.admissionward = value;
	}
	public boolean isValidated()
	{
		if(this.isBusy)
			return true;
		this.isBusy = true;
	
		if(!this.isValidated)
		{
			this.isBusy = false;
			return false;
		}
		if(this.pasevent != null)
		{
			if(!this.pasevent.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.extendeddetails != null)
		{
			if(!this.extendeddetails.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.healthylodgerdetails != null)
		{
			if(!this.healthylodgerdetails.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.pasevent == null)
			listOfErrors.add("Patient is mandatory");
		if(this.pasevent != null)
		{
			String[] listOfOtherErrors = this.pasevent.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.admissiondatetime == null)
			listOfErrors.add("AdmissionDateTime is mandatory");
		if(this.ward == null)
			listOfErrors.add("Ward is mandatory");
		if(this.consultant == null)
			listOfErrors.add("Consultant is mandatory");
		if(this.specialty == null)
			listOfErrors.add("Specialty is mandatory");
		if(this.methodofadmission == null)
			listOfErrors.add("MethodOfAdmission is mandatory");
		if(this.sourceofadmission == null)
			listOfErrors.add("SourceOfAdmission is mandatory");
		if(this.reasonforadmission != null)
			if(this.reasonforadmission.length() > 255)
				listOfErrors.add("The length of the field [reasonforadmission] in the value object [ims.core.vo.AdmissionDetailVo] is too big. It should be less or equal to 255");
		if(this.casefoldercomments != null)
			if(this.casefoldercomments.length() > 1000)
				listOfErrors.add("The length of the field [casefoldercomments] in the value object [ims.core.vo.AdmissionDetailVo] is too big. It should be less or equal to 1000");
		if(this.extendeddetails != null)
		{
			String[] listOfOtherErrors = this.extendeddetails.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.healthylodgerdetails != null)
		{
			String[] listOfOtherErrors = this.healthylodgerdetails.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;
	
		AdmissionDetailVo clone = new AdmissionDetailVo(this.id, this.version);
		
		if(this.pasevent == null)
			clone.pasevent = null;
		else
			clone.pasevent = (ims.core.vo.PasEventAdmitVo)this.pasevent.clone();
		if(this.admissiondatetime == null)
			clone.admissiondatetime = null;
		else
			clone.admissiondatetime = (ims.framework.utils.DateTime)this.admissiondatetime.clone();
		if(this.ward == null)
			clone.ward = null;
		else
			clone.ward = (ims.core.vo.LocationLiteVo)this.ward.clone();
		clone.bed = this.bed;
		if(this.consultant == null)
			clone.consultant = null;
		else
			clone.consultant = (ims.core.vo.MedicVo)this.consultant.clone();
		if(this.specialty == null)
			clone.specialty = null;
		else
			clone.specialty = (ims.core.vo.lookups.Specialty)this.specialty.clone();
		if(this.wardtype == null)
			clone.wardtype = null;
		else
			clone.wardtype = (ims.core.vo.lookups.WardType)this.wardtype.clone();
		if(this.methodofadmission == null)
			clone.methodofadmission = null;
		else
			clone.methodofadmission = (ims.core.vo.lookups.MethodOfAdmission)this.methodofadmission.clone();
		if(this.sourceofadmission == null)
			clone.sourceofadmission = null;
		else
			clone.sourceofadmission = (ims.core.vo.lookups.SourceOfAdmission)this.sourceofadmission.clone();
		clone.reasonforadmission = this.reasonforadmission;
		if(this.estdischargedate == null)
			clone.estdischargedate = null;
		else
			clone.estdischargedate = (ims.framework.utils.DateTime)this.estdischargedate.clone();
		clone.ischaplainrequired = this.ischaplainrequired;
		if(this.referringconsultant == null)
			clone.referringconsultant = null;
		else
			clone.referringconsultant = (ims.core.vo.MedicVo)this.referringconsultant.clone();
		if(this.patientstatus == null)
			clone.patientstatus = null;
		else
			clone.patientstatus = (ims.core.vo.lookups.PatientStatus)this.patientstatus.clone();
		clone.updatecfl = this.updatecfl;
		clone.anticipatedstay = this.anticipatedstay;
		clone.casefoldercomments = this.casefoldercomments;
		if(this.admissionepisode == null)
			clone.admissionepisode = null;
		else
			clone.admissionepisode = (ims.core.vo.EpisodeOfCareWithPrimaryDiagnosisVo)this.admissionepisode.clone();
		if(this.extendeddetails == null)
			clone.extendeddetails = null;
		else
			clone.extendeddetails = (ims.core.vo.ExtendedAdmissionDetailVo)this.extendeddetails.clone();
		if(this.transferhistory == null)
			clone.transferhistory = null;
		else
			clone.transferhistory = (ims.core.vo.TransferHistoryVoCollection)this.transferhistory.clone();
		clone.ismaternity = this.ismaternity;
		if(this.service == null)
			clone.service = null;
		else
			clone.service = (ims.core.vo.ServiceLiteVo)this.service.clone();
		if(this.extendedlengthofstayreason == null)
			clone.extendedlengthofstayreason = null;
		else
			clone.extendedlengthofstayreason = (ims.core.vo.lookups.ExtendedLengthOfStayReason)this.extendedlengthofstayreason.clone();
		if(this.medicallyfitfordischarge == null)
			clone.medicallyfitfordischarge = null;
		else
			clone.medicallyfitfordischarge = (ims.core.vo.lookups.YesNo)this.medicallyfitfordischarge.clone();
		if(this.reasondelayeddischarge == null)
			clone.reasondelayeddischarge = null;
		else
			clone.reasondelayeddischarge = (ims.core.vo.ReasonForDelayedDischargeVoCollection)this.reasondelayeddischarge.clone();
		clone.patientrequirestransport = this.patientrequirestransport;
		if(this.transportdetails == null)
			clone.transportdetails = null;
		else
			clone.transportdetails = (ims.core.vo.PatientTransportRequirementsVo)this.transportdetails.clone();
		clone.abletogodischargelounge = this.abletogodischargelounge;
		if(this.reasoncannotgodischargelounge == null)
			clone.reasoncannotgodischargelounge = null;
		else
			clone.reasoncannotgodischargelounge = (ims.core.vo.lookups.ReasonCannotGoDischargeLounge)this.reasoncannotgodischargelounge.clone();
		if(this.wardappointment == null)
			clone.wardappointment = null;
		else
			clone.wardappointment = (ims.RefMan.vo.BookAppointmentForWardAttendersVo)this.wardappointment.clone();
		clone.selfadmitpatient = this.selfadmitpatient;
		if(this.sourceofemergencyreferral == null)
			clone.sourceofemergencyreferral = null;
		else
			clone.sourceofemergencyreferral = (ims.core.vo.lookups.SourceOfEmergencyReferral)this.sourceofemergencyreferral.clone();
		if(this.healthylodgerdetails == null)
			clone.healthylodgerdetails = null;
		else
			clone.healthylodgerdetails = (ims.core.vo.HealthyLodgerVo)this.healthylodgerdetails.clone();
		if(this.pendingemergencytheatre == null)
			clone.pendingemergencytheatre = null;
		else
			clone.pendingemergencytheatre = (ims.scheduling.vo.PendingEmergencyTheatreForAdmitVo)this.pendingemergencytheatre.clone();
		if(this.admissionward == null)
			clone.admissionward = null;
		else
			clone.admissionward = (ims.core.vo.LocationLiteVo)this.admissionward.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 (!(AdmissionDetailVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A AdmissionDetailVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		if (this.id == null)
			return 1;
		if (((AdmissionDetailVo)obj).getBoId() == null)
			return -1;
		return this.id.compareTo(((AdmissionDetailVo)obj).getBoId());
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = 0;
		if(this.pasevent != null)
			count++;
		if(this.admissiondatetime != null)
			count++;
		if(this.ward != null)
			count++;
		if(this.bed != null)
			count++;
		if(this.consultant != null)
			count++;
		if(this.specialty != null)
			count++;
		if(this.wardtype != null)
			count++;
		if(this.methodofadmission != null)
			count++;
		if(this.sourceofadmission != null)
			count++;
		if(this.reasonforadmission != null)
			count++;
		if(this.estdischargedate != null)
			count++;
		if(this.ischaplainrequired != null)
			count++;
		if(this.referringconsultant != null)
			count++;
		if(this.patientstatus != null)
			count++;
		if(this.updatecfl != null)
			count++;
		if(this.anticipatedstay != null)
			count++;
		if(this.casefoldercomments != null)
			count++;
		if(this.admissionepisode != null)
			count++;
		if(this.extendeddetails != null)
			count++;
		if(this.transferhistory != null)
			count++;
		if(this.ismaternity != null)
			count++;
		if(this.service != null)
			count++;
		if(this.extendedlengthofstayreason != null)
			count++;
		if(this.medicallyfitfordischarge != null)
			count++;
		if(this.reasondelayeddischarge != null)
			count++;
		if(this.patientrequirestransport != null)
			count++;
		if(this.transportdetails != null)
			count++;
		if(this.abletogodischargelounge != null)
			count++;
		if(this.reasoncannotgodischargelounge != null)
			count++;
		if(this.wardappointment != null)
			count++;
		if(this.selfadmitpatient != null)
			count++;
		if(this.sourceofemergencyreferral != null)
			count++;
		if(this.healthylodgerdetails != null)
			count++;
		if(this.pendingemergencytheatre != null)
			count++;
		if(this.admissionward != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return 35;
	}
	protected ims.core.vo.PasEventAdmitVo pasevent;
	protected ims.framework.utils.DateTime admissiondatetime;
	protected ims.core.vo.LocationLiteVo ward;
	protected ims.core.layout.vo.BedSpaceRefVo bed;
	protected ims.core.vo.MedicVo consultant;
	protected ims.core.vo.lookups.Specialty specialty;
	protected ims.core.vo.lookups.WardType wardtype;
	protected ims.core.vo.lookups.MethodOfAdmission methodofadmission;
	protected ims.core.vo.lookups.SourceOfAdmission sourceofadmission;
	protected String reasonforadmission;
	protected ims.framework.utils.DateTime estdischargedate;
	protected Boolean ischaplainrequired;
	protected ims.core.vo.MedicVo referringconsultant;
	protected ims.core.vo.lookups.PatientStatus patientstatus;
	protected Boolean updatecfl;
	protected Integer anticipatedstay;
	protected String casefoldercomments;
	protected ims.core.vo.EpisodeOfCareWithPrimaryDiagnosisVo admissionepisode;
	protected ims.core.vo.ExtendedAdmissionDetailVo extendeddetails;
	protected ims.core.vo.TransferHistoryVoCollection transferhistory;
	protected Boolean ismaternity;
	protected ims.core.vo.ServiceLiteVo service;
	protected ims.core.vo.lookups.ExtendedLengthOfStayReason extendedlengthofstayreason;
	protected ims.core.vo.lookups.YesNo medicallyfitfordischarge;
	protected ims.core.vo.ReasonForDelayedDischargeVoCollection reasondelayeddischarge;
	protected Boolean patientrequirestransport;
	protected ims.core.vo.PatientTransportRequirementsVo transportdetails;
	protected Boolean abletogodischargelounge;
	protected ims.core.vo.lookups.ReasonCannotGoDischargeLounge reasoncannotgodischargelounge;
	protected ims.RefMan.vo.BookAppointmentForWardAttendersVo wardappointment;
	protected Boolean selfadmitpatient;
	protected ims.core.vo.lookups.SourceOfEmergencyReferral sourceofemergencyreferral;
	protected ims.core.vo.HealthyLodgerVo healthylodgerdetails;
	protected ims.scheduling.vo.PendingEmergencyTheatreForAdmitVo pendingemergencytheatre;
	protected ims.core.vo.LocationLiteVo admissionward;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
