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

/**
 * Linked to core.admin.EmergencyAttendance business object (ID: 1004100025).
 */
public class AttendanceDetailsVo extends ims.core.admin.vo.EmergencyAttendanceRefVo implements ims.vo.ImsCloneable, Comparable
{
	private static final long serialVersionUID = 1L;

	public AttendanceDetailsVo()
	{
	}
	public AttendanceDetailsVo(Integer id, int version)
	{
		super(id, version);
	}
	public AttendanceDetailsVo(ims.emergency.vo.beans.AttendanceDetailsVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.arrivaldatetime = bean.getArrivalDateTime() == null ? null : bean.getArrivalDateTime().buildDateTime();
		this.registrationdatetime = bean.getRegistrationDateTime() == null ? null : bean.getRegistrationDateTime().buildDateTime();
		this.dischargedatetime = bean.getDischargeDateTime() == null ? null : bean.getDischargeDateTime().buildDateTime();
		this.attendancetype = bean.getAttendanceType() == null ? null : ims.emergency.vo.lookups.AttendanceType.buildLookup(bean.getAttendanceType());
		this.emergencydepttype = bean.getEmergencyDeptType() == null ? null : ims.emergency.vo.lookups.EmergencyDeptType.buildLookup(bean.getEmergencyDeptType());
		this.modeofarrival = bean.getModeOfArrival() == null ? null : ims.emergency.vo.lookups.ModeOfArrival.buildLookup(bean.getModeOfArrival());
		this.accompaniedby = bean.getAccompaniedBy() == null ? null : ims.emergency.vo.lookups.AccompaniedBy.buildLookup(bean.getAccompaniedBy());
		this.registrationlocation = bean.getRegistrationLocation() == null ? null : new ims.core.resource.place.vo.LocationRefVo(new Integer(bean.getRegistrationLocation().getId()), bean.getRegistrationLocation().getVersion());
		this.carecontext = bean.getCareContext() == null ? null : bean.getCareContext().buildVo();
		this.emergencyepisode = bean.getEmergencyEpisode() == null ? null : new ims.core.admin.vo.EmergencyEpisodeRefVo(new Integer(bean.getEmergencyEpisode().getId()), bean.getEmergencyEpisode().getVersion());
		this.outcome = bean.getOutcome() == null ? null : ims.emergency.vo.lookups.AttendanceOutcome.buildLookup(bean.getOutcome());
		this.destination = bean.getDestination();
		this.patient = bean.getPatient() == null ? null : new ims.core.patient.vo.PatientRefVo(new Integer(bean.getPatient().getId()), bean.getPatient().getVersion());
		this.episode = bean.getEpisode() == null ? null : new ims.core.admin.vo.EmergencyEpisodeRefVo(new Integer(bean.getEpisode().getId()), bean.getEpisode().getVersion());
		this.ambulancearrivaldatetime = bean.getAmbulanceArrivalDateTime() == null ? null : bean.getAmbulanceArrivalDateTime().buildDateTime();
		this.ambulancejobno = bean.getAmbulanceJobNo();
		this.ageatattendance = bean.getAgeAtAttendance();
		this.urgencylevel = bean.getUrgencyLevel() == null ? null : ims.emergency.vo.lookups.UrgencyLevel.buildLookup(bean.getUrgencyLevel());
		this.visittype = bean.getVisitType() == null ? null : ims.emergency.vo.lookups.EDVisitType.buildLookup(bean.getVisitType());
		this.edconsultant = bean.getEDConsultant() == null ? null : ims.emergency.vo.lookups.EDConsultant.buildLookup(bean.getEDConsultant());
		this.registeringmos = bean.getRegisteringMOS() == null ? null : bean.getRegisteringMOS().buildVo();
		this.updatingmos = bean.getUpdatingMOS() == null ? null : bean.getUpdatingMOS().buildVo();
		this.comments = bean.getComments();
		this.preferedlanguage = bean.getPreferedLanguage() == null ? null : ims.core.vo.lookups.Language.buildLookup(bean.getPreferedLanguage());
		this.intrepreterrequired = bean.getIntrepreterRequired() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getIntrepreterRequired());
		this.depttype = bean.getDeptType() == null ? null : ims.emergency.vo.lookups.EmergencyDeptType.buildLookup(bean.getDeptType());
		this.isexpectedarrival = bean.getIsExpectedArrival();
		this.isprimarycare = bean.getIsPrimaryCare();
		this.bedtyperequested = bean.getBedTypeRequested() == null ? null : ims.core.vo.lookups.BedTypeRequested.buildLookup(bean.getBedTypeRequested());
		this.useprivatehealthinsurance = bean.getUsePrivateHealthInsurance();
		this.endofregistrationdatetime = bean.getEndOfRegistrationDateTime() == null ? null : bean.getEndOfRegistrationDateTime().buildDateTime();
		this.ambulancehandoverdatetime = bean.getAmbulanceHandoverDateTime() == null ? null : bean.getAmbulanceHandoverDateTime().buildDateTime();
		this.ambulancedelayreason = bean.getAmbulanceDelayReason() == null ? null : ims.emergency.vo.lookups.AmbulanceDelayReason.buildLookup(bean.getAmbulanceDelayReason());
		this.customid = bean.getCustomID();
		this.accomodationrequestedtype = bean.getAccomodationRequestedType() == null ? null : ims.core.vo.lookups.AccomodationRequestedType.buildLookup(bean.getAccomodationRequestedType());
		this.ambulancedelayreasoncomment = bean.getAmbulanceDelayReasonComment();
		this.requiressignoff = bean.getRequiresSignOff() == null ? null : ims.emergency.vo.lookups.RequiresSignOff.buildLookup(bean.getRequiresSignOff());
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.emergency.vo.beans.AttendanceDetailsVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.arrivaldatetime = bean.getArrivalDateTime() == null ? null : bean.getArrivalDateTime().buildDateTime();
		this.registrationdatetime = bean.getRegistrationDateTime() == null ? null : bean.getRegistrationDateTime().buildDateTime();
		this.dischargedatetime = bean.getDischargeDateTime() == null ? null : bean.getDischargeDateTime().buildDateTime();
		this.attendancetype = bean.getAttendanceType() == null ? null : ims.emergency.vo.lookups.AttendanceType.buildLookup(bean.getAttendanceType());
		this.emergencydepttype = bean.getEmergencyDeptType() == null ? null : ims.emergency.vo.lookups.EmergencyDeptType.buildLookup(bean.getEmergencyDeptType());
		this.modeofarrival = bean.getModeOfArrival() == null ? null : ims.emergency.vo.lookups.ModeOfArrival.buildLookup(bean.getModeOfArrival());
		this.accompaniedby = bean.getAccompaniedBy() == null ? null : ims.emergency.vo.lookups.AccompaniedBy.buildLookup(bean.getAccompaniedBy());
		this.registrationlocation = bean.getRegistrationLocation() == null ? null : new ims.core.resource.place.vo.LocationRefVo(new Integer(bean.getRegistrationLocation().getId()), bean.getRegistrationLocation().getVersion());
		this.carecontext = bean.getCareContext() == null ? null : bean.getCareContext().buildVo(map);
		this.emergencyepisode = bean.getEmergencyEpisode() == null ? null : new ims.core.admin.vo.EmergencyEpisodeRefVo(new Integer(bean.getEmergencyEpisode().getId()), bean.getEmergencyEpisode().getVersion());
		this.outcome = bean.getOutcome() == null ? null : ims.emergency.vo.lookups.AttendanceOutcome.buildLookup(bean.getOutcome());
		this.destination = bean.getDestination();
		this.patient = bean.getPatient() == null ? null : new ims.core.patient.vo.PatientRefVo(new Integer(bean.getPatient().getId()), bean.getPatient().getVersion());
		this.episode = bean.getEpisode() == null ? null : new ims.core.admin.vo.EmergencyEpisodeRefVo(new Integer(bean.getEpisode().getId()), bean.getEpisode().getVersion());
		this.ambulancearrivaldatetime = bean.getAmbulanceArrivalDateTime() == null ? null : bean.getAmbulanceArrivalDateTime().buildDateTime();
		this.ambulancejobno = bean.getAmbulanceJobNo();
		this.ageatattendance = bean.getAgeAtAttendance();
		this.urgencylevel = bean.getUrgencyLevel() == null ? null : ims.emergency.vo.lookups.UrgencyLevel.buildLookup(bean.getUrgencyLevel());
		this.visittype = bean.getVisitType() == null ? null : ims.emergency.vo.lookups.EDVisitType.buildLookup(bean.getVisitType());
		this.edconsultant = bean.getEDConsultant() == null ? null : ims.emergency.vo.lookups.EDConsultant.buildLookup(bean.getEDConsultant());
		this.registeringmos = bean.getRegisteringMOS() == null ? null : bean.getRegisteringMOS().buildVo(map);
		this.updatingmos = bean.getUpdatingMOS() == null ? null : bean.getUpdatingMOS().buildVo(map);
		this.comments = bean.getComments();
		this.preferedlanguage = bean.getPreferedLanguage() == null ? null : ims.core.vo.lookups.Language.buildLookup(bean.getPreferedLanguage());
		this.intrepreterrequired = bean.getIntrepreterRequired() == null ? null : ims.core.vo.lookups.YesNo.buildLookup(bean.getIntrepreterRequired());
		this.depttype = bean.getDeptType() == null ? null : ims.emergency.vo.lookups.EmergencyDeptType.buildLookup(bean.getDeptType());
		this.isexpectedarrival = bean.getIsExpectedArrival();
		this.isprimarycare = bean.getIsPrimaryCare();
		this.bedtyperequested = bean.getBedTypeRequested() == null ? null : ims.core.vo.lookups.BedTypeRequested.buildLookup(bean.getBedTypeRequested());
		this.useprivatehealthinsurance = bean.getUsePrivateHealthInsurance();
		this.endofregistrationdatetime = bean.getEndOfRegistrationDateTime() == null ? null : bean.getEndOfRegistrationDateTime().buildDateTime();
		this.ambulancehandoverdatetime = bean.getAmbulanceHandoverDateTime() == null ? null : bean.getAmbulanceHandoverDateTime().buildDateTime();
		this.ambulancedelayreason = bean.getAmbulanceDelayReason() == null ? null : ims.emergency.vo.lookups.AmbulanceDelayReason.buildLookup(bean.getAmbulanceDelayReason());
		this.customid = bean.getCustomID();
		this.accomodationrequestedtype = bean.getAccomodationRequestedType() == null ? null : ims.core.vo.lookups.AccomodationRequestedType.buildLookup(bean.getAccomodationRequestedType());
		this.ambulancedelayreasoncomment = bean.getAmbulanceDelayReasonComment();
		this.requiressignoff = bean.getRequiresSignOff() == null ? null : ims.emergency.vo.lookups.RequiresSignOff.buildLookup(bean.getRequiresSignOff());
	}
	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.AttendanceDetailsVoBean bean = null;
		if(map != null)
			bean = (ims.emergency.vo.beans.AttendanceDetailsVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.emergency.vo.beans.AttendanceDetailsVoBean();
			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("ARRIVALDATETIME"))
			return getArrivalDateTime();
		if(fieldName.equals("REGISTRATIONDATETIME"))
			return getRegistrationDateTime();
		if(fieldName.equals("DISCHARGEDATETIME"))
			return getDischargeDateTime();
		if(fieldName.equals("ATTENDANCETYPE"))
			return getAttendanceType();
		if(fieldName.equals("EMERGENCYDEPTTYPE"))
			return getEmergencyDeptType();
		if(fieldName.equals("MODEOFARRIVAL"))
			return getModeOfArrival();
		if(fieldName.equals("ACCOMPANIEDBY"))
			return getAccompaniedBy();
		if(fieldName.equals("REGISTRATIONLOCATION"))
			return getRegistrationLocation();
		if(fieldName.equals("CARECONTEXT"))
			return getCareContext();
		if(fieldName.equals("EMERGENCYEPISODE"))
			return getEmergencyEpisode();
		if(fieldName.equals("OUTCOME"))
			return getOutcome();
		if(fieldName.equals("DESTINATION"))
			return getDestination();
		if(fieldName.equals("PATIENT"))
			return getPatient();
		if(fieldName.equals("EPISODE"))
			return getEpisode();
		if(fieldName.equals("AMBULANCEARRIVALDATETIME"))
			return getAmbulanceArrivalDateTime();
		if(fieldName.equals("AMBULANCEJOBNO"))
			return getAmbulanceJobNo();
		if(fieldName.equals("AGEATATTENDANCE"))
			return getAgeAtAttendance();
		if(fieldName.equals("URGENCYLEVEL"))
			return getUrgencyLevel();
		if(fieldName.equals("VISITTYPE"))
			return getVisitType();
		if(fieldName.equals("EDCONSULTANT"))
			return getEDConsultant();
		if(fieldName.equals("REGISTERINGMOS"))
			return getRegisteringMOS();
		if(fieldName.equals("UPDATINGMOS"))
			return getUpdatingMOS();
		if(fieldName.equals("COMMENTS"))
			return getComments();
		if(fieldName.equals("PREFEREDLANGUAGE"))
			return getPreferedLanguage();
		if(fieldName.equals("INTREPRETERREQUIRED"))
			return getIntrepreterRequired();
		if(fieldName.equals("DEPTTYPE"))
			return getDeptType();
		if(fieldName.equals("ISEXPECTEDARRIVAL"))
			return getIsExpectedArrival();
		if(fieldName.equals("ISPRIMARYCARE"))
			return getIsPrimaryCare();
		if(fieldName.equals("BEDTYPEREQUESTED"))
			return getBedTypeRequested();
		if(fieldName.equals("USEPRIVATEHEALTHINSURANCE"))
			return getUsePrivateHealthInsurance();
		if(fieldName.equals("ENDOFREGISTRATIONDATETIME"))
			return getEndOfRegistrationDateTime();
		if(fieldName.equals("AMBULANCEHANDOVERDATETIME"))
			return getAmbulanceHandoverDateTime();
		if(fieldName.equals("AMBULANCEDELAYREASON"))
			return getAmbulanceDelayReason();
		if(fieldName.equals("CUSTOMID"))
			return getCustomID();
		if(fieldName.equals("ACCOMODATIONREQUESTEDTYPE"))
			return getAccomodationRequestedType();
		if(fieldName.equals("AMBULANCEDELAYREASONCOMMENT"))
			return getAmbulanceDelayReasonComment();
		if(fieldName.equals("REQUIRESSIGNOFF"))
			return getRequiresSignOff();
		return super.getFieldValueByFieldName(fieldName);
	}
	public boolean getArrivalDateTimeIsNotNull()
	{
		return this.arrivaldatetime != null;
	}
	public ims.framework.utils.DateTime getArrivalDateTime()
	{
		return this.arrivaldatetime;
	}
	public void setArrivalDateTime(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.arrivaldatetime = value;
	}
	public boolean getRegistrationDateTimeIsNotNull()
	{
		return this.registrationdatetime != null;
	}
	public ims.framework.utils.DateTime getRegistrationDateTime()
	{
		return this.registrationdatetime;
	}
	public void setRegistrationDateTime(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.registrationdatetime = value;
	}
	public boolean getDischargeDateTimeIsNotNull()
	{
		return this.dischargedatetime != null;
	}
	public ims.framework.utils.DateTime getDischargeDateTime()
	{
		return this.dischargedatetime;
	}
	public void setDischargeDateTime(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.dischargedatetime = value;
	}
	public boolean getAttendanceTypeIsNotNull()
	{
		return this.attendancetype != null;
	}
	public ims.emergency.vo.lookups.AttendanceType getAttendanceType()
	{
		return this.attendancetype;
	}
	public void setAttendanceType(ims.emergency.vo.lookups.AttendanceType value)
	{
		this.isValidated = false;
		this.attendancetype = value;
	}
	public boolean getEmergencyDeptTypeIsNotNull()
	{
		return this.emergencydepttype != null;
	}
	public ims.emergency.vo.lookups.EmergencyDeptType getEmergencyDeptType()
	{
		return this.emergencydepttype;
	}
	public void setEmergencyDeptType(ims.emergency.vo.lookups.EmergencyDeptType value)
	{
		this.isValidated = false;
		this.emergencydepttype = value;
	}
	public boolean getModeOfArrivalIsNotNull()
	{
		return this.modeofarrival != null;
	}
	public ims.emergency.vo.lookups.ModeOfArrival getModeOfArrival()
	{
		return this.modeofarrival;
	}
	public void setModeOfArrival(ims.emergency.vo.lookups.ModeOfArrival value)
	{
		this.isValidated = false;
		this.modeofarrival = value;
	}
	public boolean getAccompaniedByIsNotNull()
	{
		return this.accompaniedby != null;
	}
	public ims.emergency.vo.lookups.AccompaniedBy getAccompaniedBy()
	{
		return this.accompaniedby;
	}
	public void setAccompaniedBy(ims.emergency.vo.lookups.AccompaniedBy value)
	{
		this.isValidated = false;
		this.accompaniedby = value;
	}
	public boolean getRegistrationLocationIsNotNull()
	{
		return this.registrationlocation != null;
	}
	public ims.core.resource.place.vo.LocationRefVo getRegistrationLocation()
	{
		return this.registrationlocation;
	}
	public void setRegistrationLocation(ims.core.resource.place.vo.LocationRefVo value)
	{
		this.isValidated = false;
		this.registrationlocation = value;
	}
	public boolean getCareContextIsNotNull()
	{
		return this.carecontext != null;
	}
	public ims.core.vo.CareContextShortVo getCareContext()
	{
		return this.carecontext;
	}
	public void setCareContext(ims.core.vo.CareContextShortVo value)
	{
		this.isValidated = false;
		this.carecontext = value;
	}
	public boolean getEmergencyEpisodeIsNotNull()
	{
		return this.emergencyepisode != null;
	}
	public ims.core.admin.vo.EmergencyEpisodeRefVo getEmergencyEpisode()
	{
		return this.emergencyepisode;
	}
	public void setEmergencyEpisode(ims.core.admin.vo.EmergencyEpisodeRefVo value)
	{
		this.isValidated = false;
		this.emergencyepisode = value;
	}
	public boolean getOutcomeIsNotNull()
	{
		return this.outcome != null;
	}
	public ims.emergency.vo.lookups.AttendanceOutcome getOutcome()
	{
		return this.outcome;
	}
	public void setOutcome(ims.emergency.vo.lookups.AttendanceOutcome value)
	{
		this.isValidated = false;
		this.outcome = value;
	}
	public boolean getDestinationIsNotNull()
	{
		return this.destination != null;
	}
	public String getDestination()
	{
		return this.destination;
	}
	public static int getDestinationMaxLength()
	{
		return 120;
	}
	public void setDestination(String value)
	{
		this.isValidated = false;
		this.destination = value;
	}
	public boolean getPatientIsNotNull()
	{
		return this.patient != null;
	}
	public ims.core.patient.vo.PatientRefVo getPatient()
	{
		return this.patient;
	}
	public void setPatient(ims.core.patient.vo.PatientRefVo value)
	{
		this.isValidated = false;
		this.patient = value;
	}
	public boolean getEpisodeIsNotNull()
	{
		return this.episode != null;
	}
	public ims.core.admin.vo.EmergencyEpisodeRefVo getEpisode()
	{
		return this.episode;
	}
	public void setEpisode(ims.core.admin.vo.EmergencyEpisodeRefVo value)
	{
		this.isValidated = false;
		this.episode = value;
	}
	public boolean getAmbulanceArrivalDateTimeIsNotNull()
	{
		return this.ambulancearrivaldatetime != null;
	}
	public ims.framework.utils.DateTime getAmbulanceArrivalDateTime()
	{
		return this.ambulancearrivaldatetime;
	}
	public void setAmbulanceArrivalDateTime(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.ambulancearrivaldatetime = value;
	}
	public boolean getAmbulanceJobNoIsNotNull()
	{
		return this.ambulancejobno != null;
	}
	public String getAmbulanceJobNo()
	{
		return this.ambulancejobno;
	}
	public static int getAmbulanceJobNoMaxLength()
	{
		return 25;
	}
	public void setAmbulanceJobNo(String value)
	{
		this.isValidated = false;
		this.ambulancejobno = value;
	}
	public boolean getAgeAtAttendanceIsNotNull()
	{
		return this.ageatattendance != null;
	}
	public Integer getAgeAtAttendance()
	{
		return this.ageatattendance;
	}
	public void setAgeAtAttendance(Integer value)
	{
		this.isValidated = false;
		this.ageatattendance = value;
	}
	public boolean getUrgencyLevelIsNotNull()
	{
		return this.urgencylevel != null;
	}
	public ims.emergency.vo.lookups.UrgencyLevel getUrgencyLevel()
	{
		return this.urgencylevel;
	}
	public void setUrgencyLevel(ims.emergency.vo.lookups.UrgencyLevel value)
	{
		this.isValidated = false;
		this.urgencylevel = value;
	}
	public boolean getVisitTypeIsNotNull()
	{
		return this.visittype != null;
	}
	public ims.emergency.vo.lookups.EDVisitType getVisitType()
	{
		return this.visittype;
	}
	public void setVisitType(ims.emergency.vo.lookups.EDVisitType value)
	{
		this.isValidated = false;
		this.visittype = value;
	}
	public boolean getEDConsultantIsNotNull()
	{
		return this.edconsultant != null;
	}
	public ims.emergency.vo.lookups.EDConsultant getEDConsultant()
	{
		return this.edconsultant;
	}
	public void setEDConsultant(ims.emergency.vo.lookups.EDConsultant value)
	{
		this.isValidated = false;
		this.edconsultant = value;
	}
	public boolean getRegisteringMOSIsNotNull()
	{
		return this.registeringmos != null;
	}
	public ims.core.vo.MemberOfStaffLiteVo getRegisteringMOS()
	{
		return this.registeringmos;
	}
	public void setRegisteringMOS(ims.core.vo.MemberOfStaffLiteVo value)
	{
		this.isValidated = false;
		this.registeringmos = value;
	}
	public boolean getUpdatingMOSIsNotNull()
	{
		return this.updatingmos != null;
	}
	public ims.core.vo.MemberOfStaffLiteVo getUpdatingMOS()
	{
		return this.updatingmos;
	}
	public void setUpdatingMOS(ims.core.vo.MemberOfStaffLiteVo value)
	{
		this.isValidated = false;
		this.updatingmos = value;
	}
	public boolean getCommentsIsNotNull()
	{
		return this.comments != null;
	}
	public String getComments()
	{
		return this.comments;
	}
	public static int getCommentsMaxLength()
	{
		return 500;
	}
	public void setComments(String value)
	{
		this.isValidated = false;
		this.comments = value;
	}
	public boolean getPreferedLanguageIsNotNull()
	{
		return this.preferedlanguage != null;
	}
	public ims.core.vo.lookups.Language getPreferedLanguage()
	{
		return this.preferedlanguage;
	}
	public void setPreferedLanguage(ims.core.vo.lookups.Language value)
	{
		this.isValidated = false;
		this.preferedlanguage = value;
	}
	public boolean getIntrepreterRequiredIsNotNull()
	{
		return this.intrepreterrequired != null;
	}
	public ims.core.vo.lookups.YesNo getIntrepreterRequired()
	{
		return this.intrepreterrequired;
	}
	public void setIntrepreterRequired(ims.core.vo.lookups.YesNo value)
	{
		this.isValidated = false;
		this.intrepreterrequired = value;
	}
	public boolean getDeptTypeIsNotNull()
	{
		return this.depttype != null;
	}
	public ims.emergency.vo.lookups.EmergencyDeptType getDeptType()
	{
		return this.depttype;
	}
	public void setDeptType(ims.emergency.vo.lookups.EmergencyDeptType value)
	{
		this.isValidated = false;
		this.depttype = value;
	}
	public boolean getIsExpectedArrivalIsNotNull()
	{
		return this.isexpectedarrival != null;
	}
	public Boolean getIsExpectedArrival()
	{
		return this.isexpectedarrival;
	}
	public void setIsExpectedArrival(Boolean value)
	{
		this.isValidated = false;
		this.isexpectedarrival = value;
	}
	public boolean getIsPrimaryCareIsNotNull()
	{
		return this.isprimarycare != null;
	}
	public Boolean getIsPrimaryCare()
	{
		return this.isprimarycare;
	}
	public void setIsPrimaryCare(Boolean value)
	{
		this.isValidated = false;
		this.isprimarycare = value;
	}
	public boolean getBedTypeRequestedIsNotNull()
	{
		return this.bedtyperequested != null;
	}
	public ims.core.vo.lookups.BedTypeRequested getBedTypeRequested()
	{
		return this.bedtyperequested;
	}
	public void setBedTypeRequested(ims.core.vo.lookups.BedTypeRequested value)
	{
		this.isValidated = false;
		this.bedtyperequested = value;
	}
	public boolean getUsePrivateHealthInsuranceIsNotNull()
	{
		return this.useprivatehealthinsurance != null;
	}
	public Boolean getUsePrivateHealthInsurance()
	{
		return this.useprivatehealthinsurance;
	}
	public void setUsePrivateHealthInsurance(Boolean value)
	{
		this.isValidated = false;
		this.useprivatehealthinsurance = value;
	}
	public boolean getEndOfRegistrationDateTimeIsNotNull()
	{
		return this.endofregistrationdatetime != null;
	}
	public ims.framework.utils.DateTime getEndOfRegistrationDateTime()
	{
		return this.endofregistrationdatetime;
	}
	public void setEndOfRegistrationDateTime(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.endofregistrationdatetime = value;
	}
	public boolean getAmbulanceHandoverDateTimeIsNotNull()
	{
		return this.ambulancehandoverdatetime != null;
	}
	public ims.framework.utils.DateTime getAmbulanceHandoverDateTime()
	{
		return this.ambulancehandoverdatetime;
	}
	public void setAmbulanceHandoverDateTime(ims.framework.utils.DateTime value)
	{
		this.isValidated = false;
		this.ambulancehandoverdatetime = value;
	}
	public boolean getAmbulanceDelayReasonIsNotNull()
	{
		return this.ambulancedelayreason != null;
	}
	public ims.emergency.vo.lookups.AmbulanceDelayReason getAmbulanceDelayReason()
	{
		return this.ambulancedelayreason;
	}
	public void setAmbulanceDelayReason(ims.emergency.vo.lookups.AmbulanceDelayReason value)
	{
		this.isValidated = false;
		this.ambulancedelayreason = value;
	}
	public boolean getCustomIDIsNotNull()
	{
		return this.customid != null;
	}
	public String getCustomID()
	{
		return this.customid;
	}
	public static int getCustomIDMaxLength()
	{
		return 20;
	}
	public void setCustomID(String value)
	{
		this.isValidated = false;
		this.customid = value;
	}
	public boolean getAccomodationRequestedTypeIsNotNull()
	{
		return this.accomodationrequestedtype != null;
	}
	public ims.core.vo.lookups.AccomodationRequestedType getAccomodationRequestedType()
	{
		return this.accomodationrequestedtype;
	}
	public void setAccomodationRequestedType(ims.core.vo.lookups.AccomodationRequestedType value)
	{
		this.isValidated = false;
		this.accomodationrequestedtype = value;
	}
	public boolean getAmbulanceDelayReasonCommentIsNotNull()
	{
		return this.ambulancedelayreasoncomment != null;
	}
	public String getAmbulanceDelayReasonComment()
	{
		return this.ambulancedelayreasoncomment;
	}
	public static int getAmbulanceDelayReasonCommentMaxLength()
	{
		return 5000;
	}
	public void setAmbulanceDelayReasonComment(String value)
	{
		this.isValidated = false;
		this.ambulancedelayreasoncomment = value;
	}
	public boolean getRequiresSignOffIsNotNull()
	{
		return this.requiressignoff != null;
	}
	public ims.emergency.vo.lookups.RequiresSignOff getRequiresSignOff()
	{
		return this.requiressignoff;
	}
	public void setRequiresSignOff(ims.emergency.vo.lookups.RequiresSignOff value)
	{
		this.isValidated = false;
		this.requiressignoff = value;
	}
	public boolean isValidated()
	{
		if(this.isBusy)
			return true;
		this.isBusy = true;
	
		if(!this.isValidated)
		{
			this.isBusy = false;
			return false;
		}
		if(this.carecontext != null)
		{
			if(!this.carecontext.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.arrivaldatetime == null)
			listOfErrors.add("Arrival Date Time is mandatory!");
		if(this.registrationdatetime == null)
			listOfErrors.add("Registration Date Time is mandatory!");
		if(this.carecontext == null)
			listOfErrors.add("Care Context is mandatory!");
		if(this.carecontext != null)
		{
			String[] listOfOtherErrors = this.carecontext.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.emergencyepisode == null)
			listOfErrors.add("Emergency Episode is mandatory!");
		if(this.destination != null)
			if(this.destination.length() > 120)
				listOfErrors.add("The length of the field [destination] in the value object [ims.emergency.vo.AttendanceDetailsVo] is too big. It should be less or equal to 120");
		if(this.patient == null)
			listOfErrors.add("Patient is mandatory");
		if(this.episode == null)
			listOfErrors.add("Episode is mandatory");
		if(this.ambulancejobno != null)
			if(this.ambulancejobno.length() > 25)
				listOfErrors.add("The length of the field [ambulancejobno] in the value object [ims.emergency.vo.AttendanceDetailsVo] is too big. It should be less or equal to 25");
		if(this.registeringmos == null)
			listOfErrors.add("Registering MOS is mandatory!");
		if(this.comments != null)
			if(this.comments.length() > 500)
				listOfErrors.add("The length of the field [comments] in the value object [ims.emergency.vo.AttendanceDetailsVo] is too big. It should be less or equal to 500");
		if(this.endofregistrationdatetime == null)
			listOfErrors.add("Registration End Time is mandatory!");
		if(this.customid != null)
			if(this.customid.length() > 20)
				listOfErrors.add("The length of the field [customid] in the value object [ims.emergency.vo.AttendanceDetailsVo] is too big. It should be less or equal to 20");
		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;
	
		AttendanceDetailsVo clone = new AttendanceDetailsVo(this.id, this.version);
		
		if(this.arrivaldatetime == null)
			clone.arrivaldatetime = null;
		else
			clone.arrivaldatetime = (ims.framework.utils.DateTime)this.arrivaldatetime.clone();
		if(this.registrationdatetime == null)
			clone.registrationdatetime = null;
		else
			clone.registrationdatetime = (ims.framework.utils.DateTime)this.registrationdatetime.clone();
		if(this.dischargedatetime == null)
			clone.dischargedatetime = null;
		else
			clone.dischargedatetime = (ims.framework.utils.DateTime)this.dischargedatetime.clone();
		if(this.attendancetype == null)
			clone.attendancetype = null;
		else
			clone.attendancetype = (ims.emergency.vo.lookups.AttendanceType)this.attendancetype.clone();
		if(this.emergencydepttype == null)
			clone.emergencydepttype = null;
		else
			clone.emergencydepttype = (ims.emergency.vo.lookups.EmergencyDeptType)this.emergencydepttype.clone();
		if(this.modeofarrival == null)
			clone.modeofarrival = null;
		else
			clone.modeofarrival = (ims.emergency.vo.lookups.ModeOfArrival)this.modeofarrival.clone();
		if(this.accompaniedby == null)
			clone.accompaniedby = null;
		else
			clone.accompaniedby = (ims.emergency.vo.lookups.AccompaniedBy)this.accompaniedby.clone();
		clone.registrationlocation = this.registrationlocation;
		if(this.carecontext == null)
			clone.carecontext = null;
		else
			clone.carecontext = (ims.core.vo.CareContextShortVo)this.carecontext.clone();
		clone.emergencyepisode = this.emergencyepisode;
		if(this.outcome == null)
			clone.outcome = null;
		else
			clone.outcome = (ims.emergency.vo.lookups.AttendanceOutcome)this.outcome.clone();
		clone.destination = this.destination;
		clone.patient = this.patient;
		clone.episode = this.episode;
		if(this.ambulancearrivaldatetime == null)
			clone.ambulancearrivaldatetime = null;
		else
			clone.ambulancearrivaldatetime = (ims.framework.utils.DateTime)this.ambulancearrivaldatetime.clone();
		clone.ambulancejobno = this.ambulancejobno;
		clone.ageatattendance = this.ageatattendance;
		if(this.urgencylevel == null)
			clone.urgencylevel = null;
		else
			clone.urgencylevel = (ims.emergency.vo.lookups.UrgencyLevel)this.urgencylevel.clone();
		if(this.visittype == null)
			clone.visittype = null;
		else
			clone.visittype = (ims.emergency.vo.lookups.EDVisitType)this.visittype.clone();
		if(this.edconsultant == null)
			clone.edconsultant = null;
		else
			clone.edconsultant = (ims.emergency.vo.lookups.EDConsultant)this.edconsultant.clone();
		if(this.registeringmos == null)
			clone.registeringmos = null;
		else
			clone.registeringmos = (ims.core.vo.MemberOfStaffLiteVo)this.registeringmos.clone();
		if(this.updatingmos == null)
			clone.updatingmos = null;
		else
			clone.updatingmos = (ims.core.vo.MemberOfStaffLiteVo)this.updatingmos.clone();
		clone.comments = this.comments;
		if(this.preferedlanguage == null)
			clone.preferedlanguage = null;
		else
			clone.preferedlanguage = (ims.core.vo.lookups.Language)this.preferedlanguage.clone();
		if(this.intrepreterrequired == null)
			clone.intrepreterrequired = null;
		else
			clone.intrepreterrequired = (ims.core.vo.lookups.YesNo)this.intrepreterrequired.clone();
		if(this.depttype == null)
			clone.depttype = null;
		else
			clone.depttype = (ims.emergency.vo.lookups.EmergencyDeptType)this.depttype.clone();
		clone.isexpectedarrival = this.isexpectedarrival;
		clone.isprimarycare = this.isprimarycare;
		if(this.bedtyperequested == null)
			clone.bedtyperequested = null;
		else
			clone.bedtyperequested = (ims.core.vo.lookups.BedTypeRequested)this.bedtyperequested.clone();
		clone.useprivatehealthinsurance = this.useprivatehealthinsurance;
		if(this.endofregistrationdatetime == null)
			clone.endofregistrationdatetime = null;
		else
			clone.endofregistrationdatetime = (ims.framework.utils.DateTime)this.endofregistrationdatetime.clone();
		if(this.ambulancehandoverdatetime == null)
			clone.ambulancehandoverdatetime = null;
		else
			clone.ambulancehandoverdatetime = (ims.framework.utils.DateTime)this.ambulancehandoverdatetime.clone();
		if(this.ambulancedelayreason == null)
			clone.ambulancedelayreason = null;
		else
			clone.ambulancedelayreason = (ims.emergency.vo.lookups.AmbulanceDelayReason)this.ambulancedelayreason.clone();
		clone.customid = this.customid;
		if(this.accomodationrequestedtype == null)
			clone.accomodationrequestedtype = null;
		else
			clone.accomodationrequestedtype = (ims.core.vo.lookups.AccomodationRequestedType)this.accomodationrequestedtype.clone();
		clone.ambulancedelayreasoncomment = this.ambulancedelayreasoncomment;
		if(this.requiressignoff == null)
			clone.requiressignoff = null;
		else
			clone.requiressignoff = (ims.emergency.vo.lookups.RequiresSignOff)this.requiressignoff.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 (!(AttendanceDetailsVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A AttendanceDetailsVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		if (this.id == null)
			return 1;
		if (((AttendanceDetailsVo)obj).getBoId() == null)
			return -1;
		return this.id.compareTo(((AttendanceDetailsVo)obj).getBoId());
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = 0;
		if(this.arrivaldatetime != null)
			count++;
		if(this.registrationdatetime != null)
			count++;
		if(this.dischargedatetime != null)
			count++;
		if(this.attendancetype != null)
			count++;
		if(this.emergencydepttype != null)
			count++;
		if(this.modeofarrival != null)
			count++;
		if(this.accompaniedby != null)
			count++;
		if(this.registrationlocation != null)
			count++;
		if(this.carecontext != null)
			count++;
		if(this.emergencyepisode != null)
			count++;
		if(this.outcome != null)
			count++;
		if(this.destination != null)
			count++;
		if(this.patient != null)
			count++;
		if(this.episode != null)
			count++;
		if(this.ambulancearrivaldatetime != null)
			count++;
		if(this.ambulancejobno != null)
			count++;
		if(this.ageatattendance != null)
			count++;
		if(this.urgencylevel != null)
			count++;
		if(this.visittype != null)
			count++;
		if(this.edconsultant != null)
			count++;
		if(this.registeringmos != null)
			count++;
		if(this.updatingmos != null)
			count++;
		if(this.comments != null)
			count++;
		if(this.preferedlanguage != null)
			count++;
		if(this.intrepreterrequired != null)
			count++;
		if(this.depttype != null)
			count++;
		if(this.isexpectedarrival != null)
			count++;
		if(this.isprimarycare != null)
			count++;
		if(this.bedtyperequested != null)
			count++;
		if(this.useprivatehealthinsurance != null)
			count++;
		if(this.endofregistrationdatetime != null)
			count++;
		if(this.ambulancehandoverdatetime != null)
			count++;
		if(this.ambulancedelayreason != null)
			count++;
		if(this.customid != null)
			count++;
		if(this.accomodationrequestedtype != null)
			count++;
		if(this.ambulancedelayreasoncomment != null)
			count++;
		if(this.requiressignoff != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return 37;
	}
	protected ims.framework.utils.DateTime arrivaldatetime;
	protected ims.framework.utils.DateTime registrationdatetime;
	protected ims.framework.utils.DateTime dischargedatetime;
	protected ims.emergency.vo.lookups.AttendanceType attendancetype;
	protected ims.emergency.vo.lookups.EmergencyDeptType emergencydepttype;
	protected ims.emergency.vo.lookups.ModeOfArrival modeofarrival;
	protected ims.emergency.vo.lookups.AccompaniedBy accompaniedby;
	protected ims.core.resource.place.vo.LocationRefVo registrationlocation;
	protected ims.core.vo.CareContextShortVo carecontext;
	protected ims.core.admin.vo.EmergencyEpisodeRefVo emergencyepisode;
	protected ims.emergency.vo.lookups.AttendanceOutcome outcome;
	protected String destination;
	protected ims.core.patient.vo.PatientRefVo patient;
	protected ims.core.admin.vo.EmergencyEpisodeRefVo episode;
	protected ims.framework.utils.DateTime ambulancearrivaldatetime;
	protected String ambulancejobno;
	protected Integer ageatattendance;
	protected ims.emergency.vo.lookups.UrgencyLevel urgencylevel;
	protected ims.emergency.vo.lookups.EDVisitType visittype;
	protected ims.emergency.vo.lookups.EDConsultant edconsultant;
	protected ims.core.vo.MemberOfStaffLiteVo registeringmos;
	protected ims.core.vo.MemberOfStaffLiteVo updatingmos;
	protected String comments;
	protected ims.core.vo.lookups.Language preferedlanguage;
	protected ims.core.vo.lookups.YesNo intrepreterrequired;
	protected ims.emergency.vo.lookups.EmergencyDeptType depttype;
	protected Boolean isexpectedarrival;
	protected Boolean isprimarycare;
	protected ims.core.vo.lookups.BedTypeRequested bedtyperequested;
	protected Boolean useprivatehealthinsurance;
	protected ims.framework.utils.DateTime endofregistrationdatetime;
	protected ims.framework.utils.DateTime ambulancehandoverdatetime;
	protected ims.emergency.vo.lookups.AmbulanceDelayReason ambulancedelayreason;
	protected String customid;
	protected ims.core.vo.lookups.AccomodationRequestedType accomodationrequestedtype;
	protected String ambulancedelayreasoncomment;
	protected ims.emergency.vo.lookups.RequiresSignOff requiressignoff;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
