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

/**
 * Linked to Pathways.PatientPathwayJourney business object (ID: 1088100000).
 */
public class PatientJourneyInterfaceVo extends ims.pathways.vo.PatientPathwayJourneyRefVo implements ims.vo.ImsCloneable, Comparable, ims.vo.interfaces.IPatientJourney
{
	private static final long serialVersionUID = 1L;

	public PatientJourneyInterfaceVo()
	{
	}
	public PatientJourneyInterfaceVo(Integer id, int version)
	{
		super(id, version);
	}
	public PatientJourneyInterfaceVo(ims.pathways.vo.beans.PatientJourneyInterfaceVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.pathway = bean.getPathway() == null ? null : bean.getPathway().buildVo();
		this.startdate = bean.getStartDate() == null ? null : bean.getStartDate().buildDate();
		this.endedondate = bean.getEndedOnDate() == null ? null : bean.getEndedOnDate().buildDate();
		this.journeytargets = ims.pathways.vo.PatientJourneyJourneyTargetInterfaceVoCollection.buildFromBeanCollection(bean.getJourneyTargets());
		this.clockhistory = ims.pathways.vo.PathwayClockVoCollection.buildFromBeanCollection(bean.getClockHistory());
		this.currentstatus = bean.getCurrentStatus() == null ? null : bean.getCurrentStatus().buildVo();
		this.statushistory = ims.pathways.vo.PatientJourneyStatusVoCollection.buildFromBeanCollection(bean.getStatusHistory());
		this.journeytitle = bean.getJourneyTitle();
		this.journeyevents = ims.pathways.vo.PatientJourneyEventInterfaceVoCollection.buildFromBeanCollection(bean.getJourneyEvents());
		this.pathwaytargets = ims.pathways.vo.PatientJourneyTargetInterfaceVoCollection.buildFromBeanCollection(bean.getPathwayTargets());
		this.referral = bean.getReferral() == null ? null : bean.getReferral().buildVo();
		this.linkedcomments = ims.pathways.vo.PatientJourneyCommentLiteVoCollection.buildFromBeanCollection(bean.getLinkedComments());
		this.nextvalidationdate = bean.getNextValidationDate() == null ? null : bean.getNextValidationDate().buildDate();
		this.currentclock = bean.getCurrentClock() == null ? null : bean.getCurrentClock().buildVo();
		this.lastvalidationdate = bean.getLastValidationDate() == null ? null : bean.getLastValidationDate().buildDate();
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.pathways.vo.beans.PatientJourneyInterfaceVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.pathway = bean.getPathway() == null ? null : bean.getPathway().buildVo(map);
		this.startdate = bean.getStartDate() == null ? null : bean.getStartDate().buildDate();
		this.endedondate = bean.getEndedOnDate() == null ? null : bean.getEndedOnDate().buildDate();
		this.journeytargets = ims.pathways.vo.PatientJourneyJourneyTargetInterfaceVoCollection.buildFromBeanCollection(bean.getJourneyTargets());
		this.clockhistory = ims.pathways.vo.PathwayClockVoCollection.buildFromBeanCollection(bean.getClockHistory());
		this.currentstatus = bean.getCurrentStatus() == null ? null : bean.getCurrentStatus().buildVo(map);
		this.statushistory = ims.pathways.vo.PatientJourneyStatusVoCollection.buildFromBeanCollection(bean.getStatusHistory());
		this.journeytitle = bean.getJourneyTitle();
		this.journeyevents = ims.pathways.vo.PatientJourneyEventInterfaceVoCollection.buildFromBeanCollection(bean.getJourneyEvents());
		this.pathwaytargets = ims.pathways.vo.PatientJourneyTargetInterfaceVoCollection.buildFromBeanCollection(bean.getPathwayTargets());
		this.referral = bean.getReferral() == null ? null : bean.getReferral().buildVo(map);
		this.linkedcomments = ims.pathways.vo.PatientJourneyCommentLiteVoCollection.buildFromBeanCollection(bean.getLinkedComments());
		this.nextvalidationdate = bean.getNextValidationDate() == null ? null : bean.getNextValidationDate().buildDate();
		this.currentclock = bean.getCurrentClock() == null ? null : bean.getCurrentClock().buildVo(map);
		this.lastvalidationdate = bean.getLastValidationDate() == null ? null : bean.getLastValidationDate().buildDate();
	}
	public ims.vo.ValueObjectBean getBean()
	{
		return this.getBean(new ims.vo.ValueObjectBeanMap());
	}
	public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
	{
		ims.pathways.vo.beans.PatientJourneyInterfaceVoBean bean = null;
		if(map != null)
			bean = (ims.pathways.vo.beans.PatientJourneyInterfaceVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.pathways.vo.beans.PatientJourneyInterfaceVoBean();
			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("PATHWAY"))
			return getPathway();
		if(fieldName.equals("STARTDATE"))
			return getStartDate();
		if(fieldName.equals("ENDEDONDATE"))
			return getEndedOnDate();
		if(fieldName.equals("JOURNEYTARGETS"))
			return getJourneyTargets();
		if(fieldName.equals("CLOCKHISTORY"))
			return getClockHistory();
		if(fieldName.equals("CURRENTSTATUS"))
			return getCurrentStatus();
		if(fieldName.equals("STATUSHISTORY"))
			return getStatusHistory();
		if(fieldName.equals("JOURNEYTITLE"))
			return getJourneyTitle();
		if(fieldName.equals("JOURNEYEVENTS"))
			return getJourneyEvents();
		if(fieldName.equals("PATHWAYTARGETS"))
			return getPathwayTargets();
		if(fieldName.equals("REFERRAL"))
			return getReferral();
		if(fieldName.equals("LINKEDCOMMENTS"))
			return getLinkedComments();
		if(fieldName.equals("NEXTVALIDATIONDATE"))
			return getNextValidationDate();
		if(fieldName.equals("CURRENTCLOCK"))
			return getCurrentClock();
		if(fieldName.equals("LASTVALIDATIONDATE"))
			return getLastValidationDate();
		return super.getFieldValueByFieldName(fieldName);
	}
	public boolean getPathwayIsNotNull()
	{
		return this.pathway != null;
	}
	public ims.pathways.vo.PathwayLiteVo getPathway()
	{
		return this.pathway;
	}
	public void setPathway(ims.pathways.vo.PathwayLiteVo value)
	{
		this.isValidated = false;
		this.pathway = value;
	}
	public boolean getStartDateIsNotNull()
	{
		return this.startdate != null;
	}
	public ims.framework.utils.Date getStartDate()
	{
		return this.startdate;
	}
	public void setStartDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.startdate = value;
	}
	public boolean getEndedOnDateIsNotNull()
	{
		return this.endedondate != null;
	}
	public ims.framework.utils.Date getEndedOnDate()
	{
		return this.endedondate;
	}
	public void setEndedOnDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.endedondate = value;
	}
	public boolean getJourneyTargetsIsNotNull()
	{
		return this.journeytargets != null;
	}
	public ims.pathways.vo.PatientJourneyJourneyTargetInterfaceVoCollection getJourneyTargets()
	{
		return this.journeytargets;
	}
	public void setJourneyTargets(ims.pathways.vo.PatientJourneyJourneyTargetInterfaceVoCollection value)
	{
		this.isValidated = false;
		this.journeytargets = value;
	}
	public boolean getClockHistoryIsNotNull()
	{
		return this.clockhistory != null;
	}
	public ims.pathways.vo.PathwayClockVoCollection getClockHistory()
	{
		return this.clockhistory;
	}
	public void setClockHistory(ims.pathways.vo.PathwayClockVoCollection value)
	{
		this.isValidated = false;
		this.clockhistory = value;
	}
	public boolean getCurrentStatusIsNotNull()
	{
		return this.currentstatus != null;
	}
	public ims.pathways.vo.PatientJourneyStatusVo getCurrentStatus()
	{
		return this.currentstatus;
	}
	public void setCurrentStatus(ims.pathways.vo.PatientJourneyStatusVo value)
	{
		this.isValidated = false;
		this.currentstatus = value;
	}
	public boolean getStatusHistoryIsNotNull()
	{
		return this.statushistory != null;
	}
	public ims.pathways.vo.PatientJourneyStatusVoCollection getStatusHistory()
	{
		return this.statushistory;
	}
	public void setStatusHistory(ims.pathways.vo.PatientJourneyStatusVoCollection value)
	{
		this.isValidated = false;
		this.statushistory = value;
	}
	public boolean getJourneyTitleIsNotNull()
	{
		return this.journeytitle != null;
	}
	public String getJourneyTitle()
	{
		return this.journeytitle;
	}
	public static int getJourneyTitleMaxLength()
	{
		return 255;
	}
	public void setJourneyTitle(String value)
	{
		this.isValidated = false;
		this.journeytitle = value;
	}
	public boolean getJourneyEventsIsNotNull()
	{
		return this.journeyevents != null;
	}
	public ims.pathways.vo.PatientJourneyEventInterfaceVoCollection getJourneyEvents()
	{
		return this.journeyevents;
	}
	public void setJourneyEvents(ims.pathways.vo.PatientJourneyEventInterfaceVoCollection value)
	{
		this.isValidated = false;
		this.journeyevents = value;
	}
	public boolean getPathwayTargetsIsNotNull()
	{
		return this.pathwaytargets != null;
	}
	public ims.pathways.vo.PatientJourneyTargetInterfaceVoCollection getPathwayTargets()
	{
		return this.pathwaytargets;
	}
	public void setPathwayTargets(ims.pathways.vo.PatientJourneyTargetInterfaceVoCollection value)
	{
		this.isValidated = false;
		this.pathwaytargets = value;
	}
	public boolean getReferralIsNotNull()
	{
		return this.referral != null;
	}
	public ims.core.vo.ReferralListVo getReferral()
	{
		return this.referral;
	}
	public void setReferral(ims.core.vo.ReferralListVo value)
	{
		this.isValidated = false;
		this.referral = value;
	}
	public boolean getLinkedCommentsIsNotNull()
	{
		return this.linkedcomments != null;
	}
	public ims.pathways.vo.PatientJourneyCommentLiteVoCollection getLinkedComments()
	{
		return this.linkedcomments;
	}
	public void setLinkedComments(ims.pathways.vo.PatientJourneyCommentLiteVoCollection value)
	{
		this.isValidated = false;
		this.linkedcomments = value;
	}
	public boolean getNextValidationDateIsNotNull()
	{
		return this.nextvalidationdate != null;
	}
	public ims.framework.utils.Date getNextValidationDate()
	{
		return this.nextvalidationdate;
	}
	public void setNextValidationDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.nextvalidationdate = value;
	}
	public boolean getCurrentClockIsNotNull()
	{
		return this.currentclock != null;
	}
	public ims.pathways.vo.PathwayCurrentClockForRttStatusVo getCurrentClock()
	{
		return this.currentclock;
	}
	public void setCurrentClock(ims.pathways.vo.PathwayCurrentClockForRttStatusVo value)
	{
		this.isValidated = false;
		this.currentclock = value;
	}
	public boolean getLastValidationDateIsNotNull()
	{
		return this.lastvalidationdate != null;
	}
	public ims.framework.utils.Date getLastValidationDate()
	{
		return this.lastvalidationdate;
	}
	public void setLastValidationDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.lastvalidationdate = value;
	}
	/**
	* IPatientJourney methods
	*/
	public ims.vo.interfaces.IPatientJourneyEvent[] getIPatientJourneyJourneyEvents() 
	{
		if(journeyevents == null)
			return new ims.vo.interfaces.IPatientJourneyEvent[0];
			
		ims.vo.interfaces.IPatientJourneyEvent[] result = new ims.vo.interfaces.IPatientJourneyEvent[journeyevents.size()];
		
		for(int x = 0; x < journeyevents.size(); x++)
		{
			result[x] = journeyevents.get(x);	
		}
		
		return result;
	}
	public ims.vo.interfaces.IPatientJourneyTarget[] getIPatientJourneyJourneyTargets() 
	{
		if(journeytargets == null)
			return new ims.vo.interfaces.IPatientJourneyTarget[0];
			
		ims.vo.interfaces.IPatientJourneyTarget[] result = new ims.vo.interfaces.IPatientJourneyTarget[journeytargets.size()];
		
		for(int x = 0; x < journeytargets.size(); x++)
		{
			result[x] = journeytargets.get(x);	
		}
		
		return result;
	}
	public String getIPatientJourneyJourneyTitle() 
	{
		return journeytitle == null ? "This Patient's Journey" : journeytitle;
	}
	public ims.vo.interfaces.IPatientJourneyPathwayTarget[] getIPatientJourneyPathwayTargets() 
	{		
		if(pathwaytargets == null)
			return new ims.vo.interfaces.IPatientJourneyPathwayTarget[0];
				
		ims.vo.interfaces.IPatientJourneyPathwayTarget[] result = new ims.vo.interfaces.IPatientJourneyPathwayTarget[pathwaytargets.size()];
			
		for(int x = 0; x < pathwaytargets.size(); x++)
		{
			result[x] = pathwaytargets.get(x);	
		}
			
		return result;
	}
	
	public String getIPatientJourneyProfileTitle() 
	{
		if(pathway == null || pathway.getName() == null)
			return "";
		
		return pathway.getName();
	}
	public ims.framework.utils.Date getIPatientJourneyStartDate() 
	{
		return startdate;
	}
	public ims.vo.interfaces.IPatientJourneyClock[] getIPatientJourneyClockHistory() 
	{
		if(clockhistory == null)
			return new ims.vo.interfaces.IPatientJourneyClock[0];
			
		ims.vo.interfaces.IPatientJourneyClock[] result = new ims.vo.interfaces.IPatientJourneyClock[clockhistory.size()];
			
		for(int x = 0; x < clockhistory.size(); x++)
		{
			result[x] = clockhistory.get(x);
		}
		
		return result;
	}
	public ims.framework.utils.Date getIPatientJourneyEndDate() 
	{
		return endedondate;
	}
	public ims.vo.interfaces.IPatientJourneyStatus getIPatientJourneyStatus() 
	{
		return currentstatus;
	}
	public ims.vo.interfaces.IPatientJourneyStatus[] getIPatientJourneyStatusHistory() 
	{
		if(statushistory == null)
			return new ims.vo.interfaces.IPatientJourneyStatus[0];
			
		ims.vo.interfaces.IPatientJourneyStatus[] result = new ims.vo.interfaces.IPatientJourneyStatus[statushistory.size()];
			
		for(int x = 0; x < statushistory.size(); x++)
		{
			result[x] = statushistory.get(x);
		}
			
		return result;
	}
	public Integer getIPatientJourneyNumberOfWeeks() 
	{
		if(pathway == null || pathway.getNumWeeks() == null)
			return 0;
		if (pathway.getJourneyCountType().getId() == -1666)
		{
	         if (pathway.getNumWeeks() % 7 != 0 )
			return (pathway.getNumWeeks() / 7 )+ 1;
		   else
			return pathway.getNumWeeks() / 7;
		}	
	
	      return pathway.getNumWeeks();
	}
	public ims.framework.utils.Date getIPatientJourneyReferralReceivedDate() 
	{
		if(referral == null || referral.getReferralReceivedDate() == null)
			return null;
	
		return referral.getReferralReceivedDate();
	}
	public ims.framework.utils.Date getIPatientJourneyOriginalReferralDate() 
	{
		if(referral == null || referral.getOriginalReferralDate() == null)
			return null;
	
		return referral.getOriginalReferralDate();
	}
	
	public boolean isValidated()
	{
		if(this.isBusy)
			return true;
		this.isBusy = true;
	
		if(!this.isValidated)
		{
			this.isBusy = false;
			return false;
		}
		if(this.pathway != null)
		{
			if(!this.pathway.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.journeytargets != null)
		{
			if(!this.journeytargets.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.clockhistory != null)
		{
			if(!this.clockhistory.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.currentstatus != null)
		{
			if(!this.currentstatus.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.statushistory != null)
		{
			if(!this.statushistory.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.journeyevents != null)
		{
			if(!this.journeyevents.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		if(this.pathwaytargets != null)
		{
			if(!this.pathwaytargets.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.pathway == null)
			listOfErrors.add("Pathway is mandatory");
		if(this.pathway != null)
		{
			String[] listOfOtherErrors = this.pathway.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.startdate == null)
			listOfErrors.add("StartDate is mandatory");
		if(this.journeytargets == null || this.journeytargets.size() == 0)
			listOfErrors.add("JourneyTargets are mandatory");
		if(this.journeytargets != null)
		{
			String[] listOfOtherErrors = this.journeytargets.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.clockhistory != null)
		{
			String[] listOfOtherErrors = this.clockhistory.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.currentstatus == null)
			listOfErrors.add("CurrentStatus is mandatory");
		if(this.currentstatus != null)
		{
			String[] listOfOtherErrors = this.currentstatus.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.statushistory == null || this.statushistory.size() == 0)
			listOfErrors.add("StatusHistory are mandatory");
		if(this.statushistory != null)
		{
			String[] listOfOtherErrors = this.statushistory.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.journeyevents != null)
		{
			String[] listOfOtherErrors = this.journeyevents.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.pathwaytargets != null)
		{
			String[] listOfOtherErrors = this.pathwaytargets.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;
	
		PatientJourneyInterfaceVo clone = new PatientJourneyInterfaceVo(this.id, this.version);
		
		if(this.pathway == null)
			clone.pathway = null;
		else
			clone.pathway = (ims.pathways.vo.PathwayLiteVo)this.pathway.clone();
		if(this.startdate == null)
			clone.startdate = null;
		else
			clone.startdate = (ims.framework.utils.Date)this.startdate.clone();
		if(this.endedondate == null)
			clone.endedondate = null;
		else
			clone.endedondate = (ims.framework.utils.Date)this.endedondate.clone();
		if(this.journeytargets == null)
			clone.journeytargets = null;
		else
			clone.journeytargets = (ims.pathways.vo.PatientJourneyJourneyTargetInterfaceVoCollection)this.journeytargets.clone();
		if(this.clockhistory == null)
			clone.clockhistory = null;
		else
			clone.clockhistory = (ims.pathways.vo.PathwayClockVoCollection)this.clockhistory.clone();
		if(this.currentstatus == null)
			clone.currentstatus = null;
		else
			clone.currentstatus = (ims.pathways.vo.PatientJourneyStatusVo)this.currentstatus.clone();
		if(this.statushistory == null)
			clone.statushistory = null;
		else
			clone.statushistory = (ims.pathways.vo.PatientJourneyStatusVoCollection)this.statushistory.clone();
		clone.journeytitle = this.journeytitle;
		if(this.journeyevents == null)
			clone.journeyevents = null;
		else
			clone.journeyevents = (ims.pathways.vo.PatientJourneyEventInterfaceVoCollection)this.journeyevents.clone();
		if(this.pathwaytargets == null)
			clone.pathwaytargets = null;
		else
			clone.pathwaytargets = (ims.pathways.vo.PatientJourneyTargetInterfaceVoCollection)this.pathwaytargets.clone();
		if(this.referral == null)
			clone.referral = null;
		else
			clone.referral = (ims.core.vo.ReferralListVo)this.referral.clone();
		if(this.linkedcomments == null)
			clone.linkedcomments = null;
		else
			clone.linkedcomments = (ims.pathways.vo.PatientJourneyCommentLiteVoCollection)this.linkedcomments.clone();
		if(this.nextvalidationdate == null)
			clone.nextvalidationdate = null;
		else
			clone.nextvalidationdate = (ims.framework.utils.Date)this.nextvalidationdate.clone();
		if(this.currentclock == null)
			clone.currentclock = null;
		else
			clone.currentclock = (ims.pathways.vo.PathwayCurrentClockForRttStatusVo)this.currentclock.clone();
		if(this.lastvalidationdate == null)
			clone.lastvalidationdate = null;
		else
			clone.lastvalidationdate = (ims.framework.utils.Date)this.lastvalidationdate.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 (!(PatientJourneyInterfaceVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A PatientJourneyInterfaceVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		if (this.id == null)
			return 1;
		if (((PatientJourneyInterfaceVo)obj).getBoId() == null)
			return -1;
		return this.id.compareTo(((PatientJourneyInterfaceVo)obj).getBoId());
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = 0;
		if(this.pathway != null)
			count++;
		if(this.startdate != null)
			count++;
		if(this.endedondate != null)
			count++;
		if(this.journeytargets != null)
			count++;
		if(this.clockhistory != null)
			count++;
		if(this.currentstatus != null)
			count++;
		if(this.statushistory != null)
			count++;
		if(this.journeytitle != null)
			count++;
		if(this.journeyevents != null)
			count++;
		if(this.pathwaytargets != null)
			count++;
		if(this.referral != null)
			count++;
		if(this.linkedcomments != null)
			count++;
		if(this.nextvalidationdate != null)
			count++;
		if(this.currentclock != null)
			count++;
		if(this.lastvalidationdate != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return 15;
	}
	protected ims.pathways.vo.PathwayLiteVo pathway;
	protected ims.framework.utils.Date startdate;
	protected ims.framework.utils.Date endedondate;
	protected ims.pathways.vo.PatientJourneyJourneyTargetInterfaceVoCollection journeytargets;
	protected ims.pathways.vo.PathwayClockVoCollection clockhistory;
	protected ims.pathways.vo.PatientJourneyStatusVo currentstatus;
	protected ims.pathways.vo.PatientJourneyStatusVoCollection statushistory;
	protected String journeytitle;
	protected ims.pathways.vo.PatientJourneyEventInterfaceVoCollection journeyevents;
	protected ims.pathways.vo.PatientJourneyTargetInterfaceVoCollection pathwaytargets;
	protected ims.core.vo.ReferralListVo referral;
	protected ims.pathways.vo.PatientJourneyCommentLiteVoCollection linkedcomments;
	protected ims.framework.utils.Date nextvalidationdate;
	protected ims.pathways.vo.PathwayCurrentClockForRttStatusVo currentclock;
	protected ims.framework.utils.Date lastvalidationdate;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
