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

	public MedicationDose()
	{
	}
	public MedicationDose(Integer id, int version)
	{
		super(id, version);
	}
	public MedicationDose(ims.core.vo.beans.MedicationDoseBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.dose = bean.getDose();
		this.whentaken = bean.getWhenTaken();
		this.adminroute = bean.getAdminRoute() == null ? null : ims.core.vo.lookups.MedicationRoute.buildLookup(bean.getAdminRoute());
		this.duration = bean.getDuration();
		this.durationunits = bean.getDurationUnits() == null ? null : ims.core.vo.lookups.TimeUnitsSecondsToMonths.buildLookup(bean.getDurationUnits());
		this.doseunit = bean.getDoseUnit() == null ? null : ims.core.vo.lookups.MedicationDoseUnit.buildLookup(bean.getDoseUnit());
		this.admintimes = ims.core.vo.lookups.MedicationTimesOfAdministrationCollection.buildFromBeanCollection(bean.getAdminTimes());
		this.dosestarthcp = bean.getDoseStartHcp() == null ? null : bean.getDoseStartHcp().buildVo();
		this.dosestartdate = bean.getDoseStartDate() == null ? null : bean.getDoseStartDate().buildDate();
		this.isstopped = bean.getIsStopped();
		this.isstoppeddate = bean.getIsStoppedDate() == null ? null : bean.getIsStoppedDate().buildDate();
		this.isstoppedhcp = bean.getIsStoppedHcp() == null ? null : bean.getIsStoppedHcp().buildVo();
		this.isstoppedreason = bean.getIsStoppedReason() == null ? null : ims.core.vo.lookups.MedicationDoseReasonStopped.buildLookup(bean.getIsStoppedReason());
		this.isstoppedreasontext = bean.getIsStoppedReasonText();
		this.iscopied = bean.getIsCopied();
		this.commencedbytype = bean.getCommencedByType() == null ? null : ims.core.vo.lookups.MedicationCommencedDiscontinuedType.buildLookup(bean.getCommencedByType());
		this.stoppedbytype = bean.getStoppedByType() == null ? null : ims.core.vo.lookups.MedicationCommencedDiscontinuedType.buildLookup(bean.getStoppedByType());
		this.authoringinformation = bean.getAuthoringInformation() == null ? null : bean.getAuthoringInformation().buildVo();
		this.comment = bean.getComment();
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.core.vo.beans.MedicationDoseBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.dose = bean.getDose();
		this.whentaken = bean.getWhenTaken();
		this.adminroute = bean.getAdminRoute() == null ? null : ims.core.vo.lookups.MedicationRoute.buildLookup(bean.getAdminRoute());
		this.duration = bean.getDuration();
		this.durationunits = bean.getDurationUnits() == null ? null : ims.core.vo.lookups.TimeUnitsSecondsToMonths.buildLookup(bean.getDurationUnits());
		this.doseunit = bean.getDoseUnit() == null ? null : ims.core.vo.lookups.MedicationDoseUnit.buildLookup(bean.getDoseUnit());
		this.admintimes = ims.core.vo.lookups.MedicationTimesOfAdministrationCollection.buildFromBeanCollection(bean.getAdminTimes());
		this.dosestarthcp = bean.getDoseStartHcp() == null ? null : bean.getDoseStartHcp().buildVo(map);
		this.dosestartdate = bean.getDoseStartDate() == null ? null : bean.getDoseStartDate().buildDate();
		this.isstopped = bean.getIsStopped();
		this.isstoppeddate = bean.getIsStoppedDate() == null ? null : bean.getIsStoppedDate().buildDate();
		this.isstoppedhcp = bean.getIsStoppedHcp() == null ? null : bean.getIsStoppedHcp().buildVo(map);
		this.isstoppedreason = bean.getIsStoppedReason() == null ? null : ims.core.vo.lookups.MedicationDoseReasonStopped.buildLookup(bean.getIsStoppedReason());
		this.isstoppedreasontext = bean.getIsStoppedReasonText();
		this.iscopied = bean.getIsCopied();
		this.commencedbytype = bean.getCommencedByType() == null ? null : ims.core.vo.lookups.MedicationCommencedDiscontinuedType.buildLookup(bean.getCommencedByType());
		this.stoppedbytype = bean.getStoppedByType() == null ? null : ims.core.vo.lookups.MedicationCommencedDiscontinuedType.buildLookup(bean.getStoppedByType());
		this.authoringinformation = bean.getAuthoringInformation() == null ? null : bean.getAuthoringInformation().buildVo(map);
		this.comment = bean.getComment();
	}
	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.MedicationDoseBean bean = null;
		if(map != null)
			bean = (ims.core.vo.beans.MedicationDoseBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.core.vo.beans.MedicationDoseBean();
			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("DOSE"))
			return getDose();
		if(fieldName.equals("WHENTAKEN"))
			return getWhenTaken();
		if(fieldName.equals("ADMINROUTE"))
			return getAdminRoute();
		if(fieldName.equals("DURATION"))
			return getDuration();
		if(fieldName.equals("DURATIONUNITS"))
			return getDurationUnits();
		if(fieldName.equals("DOSEUNIT"))
			return getDoseUnit();
		if(fieldName.equals("ADMINTIMES"))
			return getAdminTimes();
		if(fieldName.equals("DOSESTARTHCP"))
			return getDoseStartHcp();
		if(fieldName.equals("DOSESTARTDATE"))
			return getDoseStartDate();
		if(fieldName.equals("ISSTOPPED"))
			return getIsStopped();
		if(fieldName.equals("ISSTOPPEDDATE"))
			return getIsStoppedDate();
		if(fieldName.equals("ISSTOPPEDHCP"))
			return getIsStoppedHcp();
		if(fieldName.equals("ISSTOPPEDREASON"))
			return getIsStoppedReason();
		if(fieldName.equals("ISSTOPPEDREASONTEXT"))
			return getIsStoppedReasonText();
		if(fieldName.equals("ISCOPIED"))
			return getIsCopied();
		if(fieldName.equals("COMMENCEDBYTYPE"))
			return getCommencedByType();
		if(fieldName.equals("STOPPEDBYTYPE"))
			return getStoppedByType();
		if(fieldName.equals("AUTHORINGINFORMATION"))
			return getAuthoringInformation();
		if(fieldName.equals("COMMENT"))
			return getComment();
		return super.getFieldValueByFieldName(fieldName);
	}
	public boolean getDoseIsNotNull()
	{
		return this.dose != null;
	}
	public String getDose()
	{
		return this.dose;
	}
	public static int getDoseMaxLength()
	{
		return 255;
	}
	public void setDose(String value)
	{
		this.isValidated = false;
		this.dose = value;
	}
	public boolean getWhenTakenIsNotNull()
	{
		return this.whentaken != null;
	}
	public String getWhenTaken()
	{
		return this.whentaken;
	}
	public static int getWhenTakenMaxLength()
	{
		return 255;
	}
	public void setWhenTaken(String value)
	{
		this.isValidated = false;
		this.whentaken = value;
	}
	public boolean getAdminRouteIsNotNull()
	{
		return this.adminroute != null;
	}
	public ims.core.vo.lookups.MedicationRoute getAdminRoute()
	{
		return this.adminroute;
	}
	public void setAdminRoute(ims.core.vo.lookups.MedicationRoute value)
	{
		this.isValidated = false;
		this.adminroute = value;
	}
	public boolean getDurationIsNotNull()
	{
		return this.duration != null;
	}
	public Integer getDuration()
	{
		return this.duration;
	}
	public void setDuration(Integer value)
	{
		this.isValidated = false;
		this.duration = value;
	}
	public boolean getDurationUnitsIsNotNull()
	{
		return this.durationunits != null;
	}
	public ims.core.vo.lookups.TimeUnitsSecondsToMonths getDurationUnits()
	{
		return this.durationunits;
	}
	public void setDurationUnits(ims.core.vo.lookups.TimeUnitsSecondsToMonths value)
	{
		this.isValidated = false;
		this.durationunits = value;
	}
	public boolean getDoseUnitIsNotNull()
	{
		return this.doseunit != null;
	}
	public ims.core.vo.lookups.MedicationDoseUnit getDoseUnit()
	{
		return this.doseunit;
	}
	public void setDoseUnit(ims.core.vo.lookups.MedicationDoseUnit value)
	{
		this.isValidated = false;
		this.doseunit = value;
	}
	public boolean getAdminTimesIsNotNull()
	{
		return this.admintimes != null;
	}
	public ims.core.vo.lookups.MedicationTimesOfAdministrationCollection getAdminTimes()
	{
		return this.admintimes;
	}
	public void setAdminTimes(ims.core.vo.lookups.MedicationTimesOfAdministrationCollection value)
	{
		this.isValidated = false;
		this.admintimes = value;
	}
	public boolean getDoseStartHcpIsNotNull()
	{
		return this.dosestarthcp != null;
	}
	public ims.core.vo.Hcp getDoseStartHcp()
	{
		return this.dosestarthcp;
	}
	public void setDoseStartHcp(ims.core.vo.Hcp value)
	{
		this.isValidated = false;
		this.dosestarthcp = value;
	}
	public boolean getDoseStartDateIsNotNull()
	{
		return this.dosestartdate != null;
	}
	public ims.framework.utils.Date getDoseStartDate()
	{
		return this.dosestartdate;
	}
	public void setDoseStartDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.dosestartdate = value;
	}
	public boolean getIsStoppedIsNotNull()
	{
		return this.isstopped != null;
	}
	public Boolean getIsStopped()
	{
		return this.isstopped;
	}
	public void setIsStopped(Boolean value)
	{
		this.isValidated = false;
		this.isstopped = value;
	}
	public boolean getIsStoppedDateIsNotNull()
	{
		return this.isstoppeddate != null;
	}
	public ims.framework.utils.Date getIsStoppedDate()
	{
		return this.isstoppeddate;
	}
	public void setIsStoppedDate(ims.framework.utils.Date value)
	{
		this.isValidated = false;
		this.isstoppeddate = value;
	}
	public boolean getIsStoppedHcpIsNotNull()
	{
		return this.isstoppedhcp != null;
	}
	public ims.core.vo.Hcp getIsStoppedHcp()
	{
		return this.isstoppedhcp;
	}
	public void setIsStoppedHcp(ims.core.vo.Hcp value)
	{
		this.isValidated = false;
		this.isstoppedhcp = value;
	}
	public boolean getIsStoppedReasonIsNotNull()
	{
		return this.isstoppedreason != null;
	}
	public ims.core.vo.lookups.MedicationDoseReasonStopped getIsStoppedReason()
	{
		return this.isstoppedreason;
	}
	public void setIsStoppedReason(ims.core.vo.lookups.MedicationDoseReasonStopped value)
	{
		this.isValidated = false;
		this.isstoppedreason = value;
	}
	public boolean getIsStoppedReasonTextIsNotNull()
	{
		return this.isstoppedreasontext != null;
	}
	public String getIsStoppedReasonText()
	{
		return this.isstoppedreasontext;
	}
	public static int getIsStoppedReasonTextMaxLength()
	{
		return 200;
	}
	public void setIsStoppedReasonText(String value)
	{
		this.isValidated = false;
		this.isstoppedreasontext = value;
	}
	public boolean getIsCopiedIsNotNull()
	{
		return this.iscopied != null;
	}
	public Boolean getIsCopied()
	{
		return this.iscopied;
	}
	public void setIsCopied(Boolean value)
	{
		this.isValidated = false;
		this.iscopied = value;
	}
	public boolean getCommencedByTypeIsNotNull()
	{
		return this.commencedbytype != null;
	}
	public ims.core.vo.lookups.MedicationCommencedDiscontinuedType getCommencedByType()
	{
		return this.commencedbytype;
	}
	public void setCommencedByType(ims.core.vo.lookups.MedicationCommencedDiscontinuedType value)
	{
		this.isValidated = false;
		this.commencedbytype = value;
	}
	public boolean getStoppedByTypeIsNotNull()
	{
		return this.stoppedbytype != null;
	}
	public ims.core.vo.lookups.MedicationCommencedDiscontinuedType getStoppedByType()
	{
		return this.stoppedbytype;
	}
	public void setStoppedByType(ims.core.vo.lookups.MedicationCommencedDiscontinuedType value)
	{
		this.isValidated = false;
		this.stoppedbytype = value;
	}
	public boolean getAuthoringInformationIsNotNull()
	{
		return this.authoringinformation != null;
	}
	public ims.core.vo.AuthoringInformationVo getAuthoringInformation()
	{
		return this.authoringinformation;
	}
	public void setAuthoringInformation(ims.core.vo.AuthoringInformationVo value)
	{
		this.isValidated = false;
		this.authoringinformation = value;
	}
	public boolean getCommentIsNotNull()
	{
		return this.comment != null;
	}
	public String getComment()
	{
		return this.comment;
	}
	public static int getCommentMaxLength()
	{
		return 255;
	}
	public void setComment(String value)
	{
		this.isValidated = false;
		this.comment = value;
	}
	/**
	* getAdminsText
	*/
	public StringBuffer getAdminsText() 
	{
		StringBuffer ret = new StringBuffer("");	
		ret.append("<b>Administration Times:<br></b>");
		ret.append("<b>-------------------------<br></b>");
	
		if (this.getAdminTimesIsNotNull())
		{	
			for (int i = 0; i < this.getAdminTimes().size(); i++)
			{
				ret.append(this.getAdminTimes().get(i).getText());
				ret.append("<br>");
			}		
		}
		return ret;
	}
	/**
	* getDiscontinuedTooltip - returns a tooltip when a dose is discontinued
	*/
	public String getDiscontinuedTooltip()
	{
		if(this != null && this.getIsStoppedIsNotNull() && this.getIsStopped().booleanValue())
		{
			StringBuffer tooltip = new StringBuffer();
			final String CR = "\n";
			if(this.getIsStoppedDateIsNotNull())
			{
				tooltip.append("*Date Discontinued: *");
				tooltip.append(this.getIsStoppedDate().toString());
				tooltip.append(CR);
			}
			
			if(this.getIsStoppedHcpIsNotNull())
			{
				tooltip.append("*Discontinued By: *");
				tooltip.append(this.getIsStoppedHcp().toString());
				tooltip.append(CR);
			}
			
			if(this.getIsStoppedReasonIsNotNull())
			{
				tooltip.append("*Discontinued Reason: *");
				tooltip.append(this.getIsStoppedReason().toString());
				tooltip.append(CR);
			}
			
			if(this.getIsStoppedReasonTextIsNotNull())
			{
				tooltip.append("*Discontinued Reason Description: *");
				tooltip.append(this.getIsStoppedReasonText());
			}
			
			return new ims.utils.textile.Textile().process(tooltip.toString());
		}
		
		return "";
	}
	public boolean isValidated()
	{
		if(this.isBusy)
			return true;
		this.isBusy = true;
	
		if(!this.isValidated)
		{
			this.isBusy = false;
			return false;
		}
		if(this.authoringinformation != null)
		{
			if(!this.authoringinformation.isValidated())
			{
				this.isBusy = false;
				return false;
			}
		}
		this.isBusy = false;
		return true;
	}
	public String[] validate()
	{
		return validate(null);
	}
	public String[] validate(String[] existingErrors)
	{
		if(this.isBusy)
			return null;
		this.isBusy = true;
	
		java.util.ArrayList<String> listOfErrors = new java.util.ArrayList<String>();
		if(existingErrors != null)
		{
			for(int x = 0; x < existingErrors.length; x++)
			{
				listOfErrors.add(existingErrors[x]);
			}
		}
		if(this.dose != null)
			if(this.dose.length() > 255)
				listOfErrors.add("The length of the field [dose] in the value object [ims.core.vo.MedicationDose] is too big. It should be less or equal to 255");
		if(this.whentaken != null)
			if(this.whentaken.length() > 255)
				listOfErrors.add("The length of the field [whentaken] in the value object [ims.core.vo.MedicationDose] is too big. It should be less or equal to 255");
		if(this.isstoppedreasontext != null)
			if(this.isstoppedreasontext.length() > 200)
				listOfErrors.add("The length of the field [isstoppedreasontext] in the value object [ims.core.vo.MedicationDose] is too big. It should be less or equal to 200");
		if(this.authoringinformation != null)
		{
			String[] listOfOtherErrors = this.authoringinformation.validate();
			if(listOfOtherErrors != null)
			{
				for(int x = 0; x < listOfOtherErrors.length; x++)
				{
					listOfErrors.add(listOfOtherErrors[x]);
				}
			}
		}
		if(this.comment != null)
			if(this.comment.length() > 255)
				listOfErrors.add("The length of the field [comment] in the value object [ims.core.vo.MedicationDose] is too big. It should be less or equal to 255");
		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;
	
		MedicationDose clone = new MedicationDose(this.id, this.version);
		
		clone.dose = this.dose;
		clone.whentaken = this.whentaken;
		if(this.adminroute == null)
			clone.adminroute = null;
		else
			clone.adminroute = (ims.core.vo.lookups.MedicationRoute)this.adminroute.clone();
		clone.duration = this.duration;
		if(this.durationunits == null)
			clone.durationunits = null;
		else
			clone.durationunits = (ims.core.vo.lookups.TimeUnitsSecondsToMonths)this.durationunits.clone();
		if(this.doseunit == null)
			clone.doseunit = null;
		else
			clone.doseunit = (ims.core.vo.lookups.MedicationDoseUnit)this.doseunit.clone();
		if(this.admintimes == null)
			clone.admintimes = null;
		else
			clone.admintimes = (ims.core.vo.lookups.MedicationTimesOfAdministrationCollection)this.admintimes.clone();
		if(this.dosestarthcp == null)
			clone.dosestarthcp = null;
		else
			clone.dosestarthcp = (ims.core.vo.Hcp)this.dosestarthcp.clone();
		if(this.dosestartdate == null)
			clone.dosestartdate = null;
		else
			clone.dosestartdate = (ims.framework.utils.Date)this.dosestartdate.clone();
		clone.isstopped = this.isstopped;
		if(this.isstoppeddate == null)
			clone.isstoppeddate = null;
		else
			clone.isstoppeddate = (ims.framework.utils.Date)this.isstoppeddate.clone();
		if(this.isstoppedhcp == null)
			clone.isstoppedhcp = null;
		else
			clone.isstoppedhcp = (ims.core.vo.Hcp)this.isstoppedhcp.clone();
		if(this.isstoppedreason == null)
			clone.isstoppedreason = null;
		else
			clone.isstoppedreason = (ims.core.vo.lookups.MedicationDoseReasonStopped)this.isstoppedreason.clone();
		clone.isstoppedreasontext = this.isstoppedreasontext;
		clone.iscopied = this.iscopied;
		if(this.commencedbytype == null)
			clone.commencedbytype = null;
		else
			clone.commencedbytype = (ims.core.vo.lookups.MedicationCommencedDiscontinuedType)this.commencedbytype.clone();
		if(this.stoppedbytype == null)
			clone.stoppedbytype = null;
		else
			clone.stoppedbytype = (ims.core.vo.lookups.MedicationCommencedDiscontinuedType)this.stoppedbytype.clone();
		if(this.authoringinformation == null)
			clone.authoringinformation = null;
		else
			clone.authoringinformation = (ims.core.vo.AuthoringInformationVo)this.authoringinformation.clone();
		clone.comment = this.comment;
		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 (!(MedicationDose.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A MedicationDose object cannot be compared an Object of type " + obj.getClass().getName());
		}
		MedicationDose compareObj = (MedicationDose)obj;
		int retVal = 0;
		if (retVal == 0)
		{
			if(this.getID_PatientMedicationDose() == null && compareObj.getID_PatientMedicationDose() != null)
				return -1;
			if(this.getID_PatientMedicationDose() != null && compareObj.getID_PatientMedicationDose() == null)
				return 1;
			if(this.getID_PatientMedicationDose() != null && compareObj.getID_PatientMedicationDose() != null)
				retVal = this.getID_PatientMedicationDose().compareTo(compareObj.getID_PatientMedicationDose());
		}
		return retVal;
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = 0;
		if(this.dose != null)
			count++;
		if(this.whentaken != null)
			count++;
		if(this.adminroute != null)
			count++;
		if(this.duration != null)
			count++;
		if(this.durationunits != null)
			count++;
		if(this.doseunit != null)
			count++;
		if(this.admintimes != null)
			count++;
		if(this.dosestarthcp != null)
			count++;
		if(this.dosestartdate != null)
			count++;
		if(this.isstopped != null)
			count++;
		if(this.isstoppeddate != null)
			count++;
		if(this.isstoppedhcp != null)
			count++;
		if(this.isstoppedreason != null)
			count++;
		if(this.isstoppedreasontext != null)
			count++;
		if(this.iscopied != null)
			count++;
		if(this.commencedbytype != null)
			count++;
		if(this.stoppedbytype != null)
			count++;
		if(this.authoringinformation != null)
			count++;
		if(this.comment != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return 19;
	}
	protected String dose;
	protected String whentaken;
	protected ims.core.vo.lookups.MedicationRoute adminroute;
	protected Integer duration;
	protected ims.core.vo.lookups.TimeUnitsSecondsToMonths durationunits;
	protected ims.core.vo.lookups.MedicationDoseUnit doseunit;
	protected ims.core.vo.lookups.MedicationTimesOfAdministrationCollection admintimes;
	protected ims.core.vo.Hcp dosestarthcp;
	protected ims.framework.utils.Date dosestartdate;
	protected Boolean isstopped;
	protected ims.framework.utils.Date isstoppeddate;
	protected ims.core.vo.Hcp isstoppedhcp;
	protected ims.core.vo.lookups.MedicationDoseReasonStopped isstoppedreason;
	protected String isstoppedreasontext;
	protected Boolean iscopied;
	protected ims.core.vo.lookups.MedicationCommencedDiscontinuedType commencedbytype;
	protected ims.core.vo.lookups.MedicationCommencedDiscontinuedType stoppedbytype;
	protected ims.core.vo.AuthoringInformationVo authoringinformation;
	protected String comment;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
