/*******************************************************************************
 *  Copyright 2017 Centre for Development of Advanced Computing(C-DAC), Pune
 *  
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  
 *    http://www.apache.org/licenses/LICENSE-2.0
 *  
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *******************************************************************************/
package cdac.medinfo.sdk.hl7282.baselibs.segments;

import java.util.Locale;

import cdac.medinfo.sdk.hl7282.baselibs.CNE;
import cdac.medinfo.sdk.hl7282.baselibs.CWE;
import cdac.medinfo.sdk.hl7282.baselibs.DTM;
import cdac.medinfo.sdk.hl7282.baselibs.EI;
import cdac.medinfo.sdk.hl7282.baselibs.HD;
import cdac.medinfo.sdk.hl7282.baselibs.ID;
import cdac.medinfo.sdk.hl7282.baselibs.NM;
import cdac.medinfo.sdk.hl7282.baselibs.PL;
import cdac.medinfo.sdk.hl7282.baselibs.SI;
import cdac.medinfo.sdk.hl7282.commoninterface.IDataType;
import cdac.medinfo.sdk.hl7282.commoninterface.ISingleCollection;
import cdac.medinfo.sdk.hl7282.exceptions.FieldMissingException;
import cdac.medinfo.sdk.hl7282.exceptions.InvalidFieldException;
import cdac.medinfo.sdk.hl7282.exceptions.InvalidSegmentException;
import cdac.medinfo.sdk.hl7282.utils.EnumSegments;
import cdac.medinfo.sdk.hl7282.utils.HL7Config;
import cdac.medinfo.sdk.hl7282.utils.ResourceBundleWrapper;
import cdac.medinfo.sdk.hl7282.utils.SingleCollection;

/***
 * AIL - Appointment Information-Location Resource Segment.<p>
 * The AIL segment contains information about location resources (meeting rooms,
 * operating rooms, examination rooms, or other locations) that can be scheduled.   
 * <p>Represents an HL7 AIL message segment. 
 * This segment has the following fields:</p><p>
 * AIL-1: Set ID - AIL (SI)<b>Required</b><br> 
 * AIL-2: Segment Action Code (ID)<b>Conditional</b><br> 
 * AIL-3: Location Resource ID (PL)<b>Conditional</b><br> 
 * AIL-4: Location Type-AIL (CWE)<b>Conditional</b><br> 
 * AIL-5: Location Group (CWE)<b>Optional</b><br> 
 * AIL-6: Start Date/Time (DTM)<b>Conditional</b><br> 
 * AIL-7: Start Date/Time Offset (NM)<b>Conditional</b><br> 
 * AIL-8: Start Date/Time Offset Units (CNE)<b>Conditional</b><br> 
 * AIL-9: Duration (NM)<b>Optional</b><br> 
 * AIL-10: Duration Units (CNE)<b>Optional</b><br> 
 * AIL-11: Allow Substitution Code (CWE)<b>Conditional</b><br> 
 * AIL-12: Filler Status Code (CWE)<b>Conditional</b><br><p>
 * This class provides mechanism to validate message against HL7 v 2.8.2 standard.
 * The class provides accessors & mutators for the elements mentioned above.
 * The class has validate method which validates Message against HL7 v 2.8.2 standard.
 *
 * <p>User can also create Segment through {@link SegmentFactory}
 */
public class AIL extends Segment   
{

	

	/**
	 * Constructs the AIL segment.
	 */
	public AIL()
	{super(EnumSegments.HL7_SEG_AIL);	
	}

	//Integer values used in getter/setter is unique item id defined 
	//for each attribute.

	/**
	 * Retrieves the Allow Substitution Code.
	 * This field specify the code indicating whether the identified
	 * resource can be substituted with an equivalent resource by the filler application or not.
	 * @return CWE - allowSubstitutionCode
	 */
	public CWE getAllowSubstitutionCode() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(895);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Duration.
	 * This field specify the duration for which the resource is requested/scheduled for this appointment,
	 * if different from the overall duration of the requested/scheduled appointment. 
	 * expressed in units of time relative to the scheduled start date/time.
	 * @return NM - duration
	 */
	public NM getDuration() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(893);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (NM)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Duration Units.
	 * This field specify the units of time used for expressing the duration.
	 * @return CNE - durationUnits
	 */
	public CNE getDurationUnits() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(894);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CNE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Filler Status Code.
	 * This field specify the code, that describes the requested/scheduled status of the resource or activity,
	 * from the point of view of the filler application.
	 * @return CWE - fillerStatusCode
	 */
	public CWE getFillerStatusCode() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(889);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Location Group.
	 * This field specify the requested resource as a member of the indicated group.
	 * @return CWE - locationGroup
	 */
	public CWE getLocationGroup() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(905);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Location Resource ID.
	 * @return ISingleCollection<PL> - locationResourceID
	 */
	public ISingleCollection<PL> getLocationResourceID() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(903);
		ISingleCollection<PL> objDataList = new SingleCollection<PL>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				PL objPL = (PL)objDataType;
				objDataList.add(objPL);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Location Type AIL.
	 * This field specify the type of the location requested/scheduled for this appointment.
	 * @return CWE - locationType_AIL
	 */
	public CWE getLocationType_AIL() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(904);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Segment Action Code.
	 * This field specify the contains of the Action Code when updating or modifying information 
	 * in this segment from previously sent interface transactions.
	 * @return ID - segmentActionCode
	 */
	public ID getSegmentActionCode() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(763);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Set ID AIL.
	 * @return SI - setID_AIL
	 */
	public SI getSetID_AIL() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(902);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (SI)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Start Date Time.
	 * This field specify the date and time and this needs for the appointment.
	 * @return DTM - startDateTime
	 */
	public DTM getStartDateTime() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1202);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DTM)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Start Date Time Offset.
	 * This field specify the offset and this needs for the appointment,
	 * expressed in units of time relative to the scheduled start date/time.
	 * @return NM - startDateTimeOffset
	 */
	public NM getStartDateTimeOffset() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(891);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (NM)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Start Date Time Offset Units.
	 * This field specify the units of time used for expressing the start date/time offset.
	 * @return CNE - startDateTimeOffsetUnits
	 */
	public CNE getStartDateTimeOffsetUnits() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(892);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CNE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Set the Set ID AIL.
	 * @param strSetID_AIL This field contains the number that identifies AIL transaction. 
	 */ 
	public void setSetID_AIL (String strSetID_AIL) 
	{
		SI setID_AIL  = (SI)getDataElement(902);
		setID_AIL.setValue(strSetID_AIL); 
		setSetID_AIL(setID_AIL);

	} 

	/** 
	 * Set the Set ID AIL.
	 * @param objsetID_AIL Object of Set ID AIL. 
	 */ 
	public void setSetID_AIL(SI objsetID_AIL)
	{
		setDataType(902,objsetID_AIL);

	}

	/**
	 * Set the Segment Action Code.
	 * This field specify the contains of the Action Code when updating or modifying information 
	 * in this segment from previously sent interface transactions.   
	 * @param strSegmentActionCode String shows the action to be taken . 
	 */ 
	public void setSegmentActionCode (String strSegmentActionCode) 
	{
		ID segmentActionCode  = (ID)getDataElement(763);
		segmentActionCode.setValue(strSegmentActionCode); 
		setSegmentActionCode(segmentActionCode);

	} 

	/** 
	 * Set the Segment Action Code.
	 * This field specify the contains of the Action Code when updating or modifying information 
	 * in this segment from previously sent interface transactions.   
	 * @param objsegmentActionCode Object of Segment Action Code.
	 */ 
	public void setSegmentActionCode(ID objsegmentActionCode)
	{
		setDataType(763,objsegmentActionCode);

	}

	/**
	 * Add the Location Resource ID.
	 * @param strPointOfCare Use as PointOfCare.
	 * @param strRoom Use as Room.
	 * @param strBed Use as Bed.
	 * @param objFacility Use as Facility.
	 * @param strLocationStatus Use as LocationStatus.
	 * @param strPersonLocationType Use as PersonLocationType.
	 * @param strBuilding Use as Building.
	 * @param strFloor Use as Floor.
	 * @param strLocationDescription Use as LocationDescription.
	 * @param objComprehensiveLocationIdentifier Use as ComprehensiveLocationIdentifier.
	 * @param objAssigningAuthorityForLocation Use as AssigningAuthorityForLocation.
	 */ 
	public void addLocationResourceID (HD objPointOfCare, HD objRoom, HD objBed, HD objFacility,
			String strLocationStatus, String strPersonLocationType, HD objBuilding, HD objFloor, 
			String strLocationDescription, EI objComprehensiveLocationIdentifier, HD objAssigningAuthorityForLocation)
	{
		PL pl  = (PL)getDataElement(903);
		pl.setPointOfCare(objPointOfCare);
		pl.setRoom(objRoom);
		pl.setBed(objBed);
		pl.setFacility(objFacility);
		pl.setLocationStatus(strLocationStatus);
		pl.setPersonLocationType(strPersonLocationType);
		pl.setBuilding(objBuilding);
		pl.setFloor(objFloor);
		pl.setLocationDescription(strLocationDescription);
		pl.setComprehensiveLocationIdentifier(objComprehensiveLocationIdentifier);
		pl.setAssigningAuthorityForLocation(objAssigningAuthorityForLocation);  
		addLocationResourceID(pl);

	} 

	/** 
	 * Add the Location Resource ID.
	 * @param  objlocationResourceID Object of Location Resource ID.
	 */ 
	public void addLocationResourceID(PL objlocationResourceID)
	{
		addDataType(903,objlocationResourceID);

	} 

	/** 
	 * Set the Location Resource ID.
	 * @param  objlocationResourceIDList List of Location Resource ID.
	 */ 
	@SuppressWarnings("unchecked")
	public void setLocationResourceID(ISingleCollection<PL> objlocationResourceIDList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objlocationResourceIDList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(903,objCollection);
	}

	/**
	 * Set the Location Type AIL.
	 * This field specify the type of the location requested/scheduled for this appointment.               
	 * @param strIdentifier Specifies of characters (the code) that uniquely identifies the item being referenced. 
	 * @param strText Specifies The descriptive or textual name of the identifier, e.g., myocardial infarction. 
	 * @param strNameOfCodingSystem Identifies the coding scheme being used in the identifier component.
	 * @param strAlternateIdentifier Specifies an alternate sequence of characters (the code) that uniquely identifies the item being referenced.
	 * @param strAlternateText Specifies the descriptive or textual name of the alternate identifier. See usage note in section introduction.
	 * @param strNameOfAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component. 
	 * @param strCodingSystemVersionID A sequence of characters that uniquely identifies a second alternate code.
	 * @param strAlternateCodingSystemVersionId This component carries the version for the coding system identified by components 4-6.
	 * @param strOriginalText The text as seen and/or selected by the user who entered the data.
	 * @param strSecondAlternateIdentifier A sequence of characters that uniquely identifies a second alternate code.
	 * @param strSecondAlternateText The descriptive or textual name of the alternate identifier.
	 * @param strNameofSecondAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component.
	 * @param strSecondAlternateCodingSystemVersionID This component carries the version for the coding system identified by components 10-12.
	 * @param strCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.3.
	 * @param strValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.1 is obtained.
	 * @param strValueSetVersionID This component carries the version for the value set identified by CWE.15. The version is a date. The date is the date/time that the value set being used was published.
	 * @param strAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.6.
	 * @param strAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.4 is obtained.
	 * @param strAlternateValueSetVersionID This component carries the version for the value set identified by CWE.18. The version is a date.
	 * @param strSecondAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.12.
	 * @param strSecondAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.10 is obtained.
	 * @param strSecondAlternateValueSetVersionID This component carries the version for the value set identified by CWE.21. The version is a date.
	 */	 
	public void setLocationType_AIL (String strIdentifier,String strText,String strNameOfCodingSystem,
			String strAlternateIdentifier,String strAlternateText,String strNameOfAlternateCodingSystem, String strCodingSystemVersionID, String 				strAlternateCodingSystemVersionId,
			String strOriginalText, String  strSecondAlternateIdentifier, String strSecondAlternateText, 
			String strNameofSecondAlternateCodingSystem, String strSecondAlternateCodingSystemVersionID, String strCodingSystemOID, String strValueSetOID,
			String strValueSetVersionID, String strAlternateCodingSystemOID, String strAlternateValueSetOID, String strAlternateValueSetVersionID,
			String  strSecondAlternateCodingSystemOID, String strSecondAlternateValueSetOID, String strSecondAlternateValueSetVersionID)
	{
		CWE cwe  = (CWE)getDataElement(904);
		cwe.setIdentifier(strIdentifier);
		cwe.setText(strText);
		cwe.setNameOfCodingSystem(strNameOfCodingSystem);
		cwe.setAlternateIdentifier(strAlternateIdentifier);
		cwe.setAlternateText(strAlternateText);
		cwe.setNameOfAlternateCodingSystem(strNameOfAlternateCodingSystem); 
		cwe.setCodingSystemVersionID(strCodingSystemVersionID);
		cwe.setAlternateCodingSystemVersionId(strAlternateCodingSystemVersionId);
		cwe.setOriginalText(strOriginalText);
		cwe.setSecondAlternateIdentifier(strSecondAlternateIdentifier);
		cwe.setSecondAlternateText(strSecondAlternateText);
		cwe.setNameofSecondAlternateCodingSystem(strNameofSecondAlternateCodingSystem);
		cwe.setSecondAlternateCodingSystemVersionID(strSecondAlternateCodingSystemVersionID);
		cwe.setCodingSystemOID(strCodingSystemOID);
		cwe.setValueSetOID(strValueSetOID);
		cwe.setValueSetVersionID(strValueSetVersionID);
		cwe.setAlternateCodingSystemOID(strAlternateCodingSystemOID);
		cwe.setAlternateValueSetOID(strAlternateValueSetOID);
		cwe.setAlternateValueSetVersionID(strAlternateValueSetVersionID);
		cwe.setSecondAlternateCodingSystemOID(strSecondAlternateCodingSystemOID);
		cwe.setSecondAlternateValueSetOID(strSecondAlternateValueSetOID);
		cwe.setSecondAlternateValueSetVersionID(strSecondAlternateValueSetVersionID);
		setLocationType_AIL(cwe);

	} 

	/** 
	 * Set the Location Type AIL.
	 * This field specify the type of the location requested/scheduled for this appointment.
	 * @param objlocationType_AIL Object of Location Type AIL.
	 */ 
	public void setLocationType_AIL(CWE objlocationType_AIL)
	{
		setDataType(904,objlocationType_AIL);

	}

	/**
	 * Set the Location Group.
	 * This field specify the requested resource as a member of the indicated group.                 
	 * @param strIdentifier Specifies of characters (the code) that uniquely identifies the item being referenced. 
	 * @param strText Specifies The descriptive or textual name of the identifier, e.g., myocardial infarction. 
	 * @param strNameOfCodingSystem Identifies the coding scheme being used in the identifier component.
	 * @param strAlternateIdentifier Specifies an alternate sequence of characters (the code) that uniquely identifies the item being referenced.
	 * @param strAlternateText Specifies the descriptive or textual name of the alternate identifier. See usage note in section introduction.
	 * @param strNameOfAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component. 
	 * @param strCodingSystemVersionID A sequence of characters that uniquely identifies a second alternate code.
	 * @param strAlternateCodingSystemVersionId This component carries the version for the coding system identified by components 4-6.
	 * @param strOriginalText The text as seen and/or selected by the user who entered the data.
	 * @param strSecondAlternateIdentifier A sequence of characters that uniquely identifies a second alternate code.
	 * @param strSecondAlternateText The descriptive or textual name of the alternate identifier.
	 * @param strNameofSecondAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component.
	 * @param strSecondAlternateCodingSystemVersionID This component carries the version for the coding system identified by components 10-12.
	 * @param strCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.3.
	 * @param strValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.1 is obtained.
	 * @param strValueSetVersionID This component carries the version for the value set identified by CWE.15. The version is a date. The date is the date/time that the value set being used was published.
	 * @param strAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.6.
	 * @param strAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.4 is obtained.
	 * @param strAlternateValueSetVersionID This component carries the version for the value set identified by CWE.18. The version is a date.
	 * @param strSecondAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.12.
	 * @param strSecondAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.10 is obtained.
	 * @param strSecondAlternateValueSetVersionID This component carries the version for the value set identified by CWE.21. The version is a date.
	 */
	public void setLocationGroup (String strIdentifier,String strText,String strNameOfCodingSystem,
			String strAlternateIdentifier,String strAlternateText,String strNameOfAlternateCodingSystem, String strCodingSystemVersionID, String 				strAlternateCodingSystemVersionId,
			String strOriginalText, String  strSecondAlternateIdentifier, String strSecondAlternateText, 
			String strNameofSecondAlternateCodingSystem, String strSecondAlternateCodingSystemVersionID, String strCodingSystemOID, String strValueSetOID,
			String strValueSetVersionID, String strAlternateCodingSystemOID, String strAlternateValueSetOID, String strAlternateValueSetVersionID,
			String  strSecondAlternateCodingSystemOID, String strSecondAlternateValueSetOID, String strSecondAlternateValueSetVersionID)
	{
		CWE cwe  = (CWE)getDataElement(905);
		cwe.setIdentifier(strIdentifier);
		cwe.setText(strText);
		cwe.setNameOfCodingSystem(strNameOfCodingSystem);
		cwe.setAlternateIdentifier(strAlternateIdentifier);
		cwe.setAlternateText(strAlternateText);
		cwe.setNameOfAlternateCodingSystem(strNameOfAlternateCodingSystem); 
		cwe.setCodingSystemVersionID(strCodingSystemVersionID);
		cwe.setAlternateCodingSystemVersionId(strAlternateCodingSystemVersionId);
		cwe.setOriginalText(strOriginalText);
		cwe.setSecondAlternateIdentifier(strSecondAlternateIdentifier);
		cwe.setSecondAlternateText(strSecondAlternateText);
		cwe.setNameofSecondAlternateCodingSystem(strNameofSecondAlternateCodingSystem);
		cwe.setSecondAlternateCodingSystemVersionID(strSecondAlternateCodingSystemVersionID);
		cwe.setCodingSystemOID(strCodingSystemOID);
		cwe.setValueSetOID(strValueSetOID);
		cwe.setValueSetVersionID(strValueSetVersionID);
		cwe.setAlternateCodingSystemOID(strAlternateCodingSystemOID);
		cwe.setAlternateValueSetOID(strAlternateValueSetOID);
		cwe.setAlternateValueSetVersionID(strAlternateValueSetVersionID);
		cwe.setSecondAlternateCodingSystemOID(strSecondAlternateCodingSystemOID);
		cwe.setSecondAlternateValueSetOID(strSecondAlternateValueSetOID);
		cwe.setSecondAlternateValueSetVersionID(strSecondAlternateValueSetVersionID);
		setLocationGroup(cwe);

	} 

	/** 
	 * Set the Location Group.
	 * This field specify the requested resource as a member of the indicated group.                 
	 * @param objlocationGroup Object of Location Group.
	 */ 
	public void setLocationGroup(CWE objlocationGroup)
	{
		setDataType(905,objlocationGroup);

	}

	/**
	 * Set the Start Date Time.
	 * This field specify the date and time and this needs for the appointment.  
	 * @param strTime Specifies a point in time using a 24-hour clock notation.	 
	 */ 
	public void setStartDateTime (String strTime) 
	{
		DTM startDateTime  = (DTM)getDataElement(1202);
		startDateTime.setValue(strTime);	 
		setStartDateTime(startDateTime);

	} 

	/** 
	 * Set the Start Date Time.
	 * This field specify the date and time and this needs for the appointment.  
	 * @param objstartDateTime Object of Start Date Time.
	 */ 
	public void setStartDateTime(DTM objstartDateTime)
	{
		setDataType(1202,objstartDateTime);

	}

	/**
	 * Set the Start Date Time Offset.
	 * This field specify the offset and this needs for the appointment,
	 * expressed in units of time relative to the scheduled start date/time.   
	 * @param strStartDateTimeOffset Amount of time being requested for the appointment. .
	 */ 
	public void setStartDateTimeOffset (String strStartDateTimeOffset) 
	{
		NM startDateTimeOffset  = (NM)getDataElement(891);
		startDateTimeOffset.setValue(strStartDateTimeOffset); 
		setStartDateTimeOffset(startDateTimeOffset);

	} 

	/** 
	 * Set the Start Date Time Offset.
	 * This field specify the offset and this needs for the appointment,
	 * expressed in units of time relative to the scheduled start date/time.
	 * @param objstartDateTimeOffset Object of Start Date Time Offset.
	 */ 
	public void setStartDateTimeOffset(NM objstartDateTimeOffset)
	{
		setDataType(891,objstartDateTimeOffset);

	}

	/**
	 * Set the Start Date Time Offset Units.
	 * This field specify the units of time used for expressing the start date/time offset.   
	 * @param strIdentifier Specifies sequence of characters (the code) that uniquely identifies
	 * 						 the item being referenced by the CNE.
	 * @param strText Specifies descriptive or textual name of the identifier, e.g., myocardial infarction 
	 * @param strNameOfCodingSystem Specifies the coding scheme being used in the identifier component. 
	 * @param strAlternateIdentifier Specifies the local or user seen code as described. 
	 * @param strAlternateText Specifies descriptive or textual name of the alternate identifier.  
	 * @param strNameOfAlternateCodingSystem Specifies the coding scheme being used in the alternate identifier 
	 * 											component.  
	 * @param strCodingSystemVersionID Specifies the version ID for the coding system. 
	 * @param strAlternateCodingSystemVersionID Specifies the version ID for the coding system .
	 * @param strOriginalText Specifies the original text that was available to an automated process or a human 
	 * 							before a specific code was assigned.
	 * @param strSecondAlternateIdentifier Specifies a sequence of characters that uniquely identifies the second alternate code
	 * @param strSecondAlternateText Specifies a the textual information of the second alternate code
	 * @param strNameOfSecondAltenateCodingSystem Specifies the second coding scheme being used in the identifier component.
	 * @param strSecondAlternateCodingSystemVersionID Specifies version ID of Second alternative coding system.
	 * @param strCodingSystemOID contains the ISO Object identifier for the coding system.
	 * @param strValueSetOID contains the value set from which CNE-1 is obtained 
	 * @param strValueSetVersionID contains the version of the value set identified by CNE-15. 
	 * @param strAlternateCodingSystemOID contains the ISO Object identifier for the alternate coding system
	 * @param strAlternateValueSetOID contains the value set from which CNE-4 is obtained
	 * @param strAlternateValueSetVersionID contains the version of the value set identified by CNE-18. 
	 * @param strSecondAlternateCodingSystemOID contains the value set from which CNE-12 is obtained
	 * @param strSecondAlternateValueSetOID contains the value set from which CNE-10 is obtained
	 * @param strSecondAlternateValueSetVersionID contains the version of the value set identified by CNE-21. 
	 */  
	public void setStartDateTimeOffsetUnits (String strIdentifier,String strText,String strNameOfCodingSystem,String strAlternateIdentifier,
			String strAlternateText,String strNameOfAlternateCodingSystem,String strCodingSystemVersionID,
			String strAlternateCodingSystemVersionID,String strOriginalText, String strSecondAlternateIdentifier, String strSecondAlternateText,
			String strNameOfSecondAltenateCodingSystem, String strSecondAlternateCodingSystemVersionID, String strCodingSystemOID, 
			String strValueSetOID, String strValueSetVersionID, String strAlternateCodingSystemOID, String strAlternateValueSetOID,
			String strAlternateValueSetVersionID, String strSecondAlternateCodingSystemOID, String strSecondAlternateValueSetOID,
			String strSecondAlternateValueSetVersionID)
	{
		CNE cne  = (CNE)getDataElement(892);
		cne.setIdentifier(strIdentifier);
		cne.setText(strText);
		cne.setNameOfCodingSystem(strNameOfCodingSystem);
		cne.setAlternateIdentifier(strAlternateIdentifier);
		cne.setAlternateText(strAlternateText);
		cne.setNameOfAlternateCodingSystem(strNameOfAlternateCodingSystem);
		cne.setCodingSystemVersionID(strCodingSystemVersionID);
		cne.setAlternateCodingSystemVersionID(strAlternateCodingSystemVersionID);
		cne.setOriginalText(strOriginalText); 
		cne.setSecondAlternateIdentifier(strSecondAlternateIdentifier);
		cne.setSecondAlternateText(strSecondAlternateText);
		cne.setNameofSecondAlternateCodingSystem(strNameOfSecondAltenateCodingSystem);
		cne.setSecondAlternateCodingSystemVersionID(strSecondAlternateCodingSystemVersionID);
		cne.setCodingSystemOID(strCodingSystemOID);
		cne.setValueSetOID(strValueSetOID);
		cne.setValueSetVersionID(strValueSetVersionID);
		cne.setAlternateCodingSystemOID(strAlternateCodingSystemOID);
		cne.setAlternateValueSetOID(strAlternateValueSetOID);
		cne.setAlternateValueSetVersionID(strAlternateValueSetVersionID);
		cne.setSecondAlternateCodingSystemOID(strSecondAlternateCodingSystemOID);
		cne.setSecondAlternateValueSetOID(strSecondAlternateValueSetOID);
		cne.setSecondAlternateValueSetVersionID(strSecondAlternateValueSetVersionID);
		setStartDateTimeOffsetUnits(cne);

	} 

	/** 
	 * Set the Start Date Time Offset Units.
	 * This field specify the units of time used for expressing the start date/time offset.
	 * @param objstartDateTimeOffsetUnits Object of Start Date Time Offset Units.
	 */ 
	public void setStartDateTimeOffsetUnits(CNE objstartDateTimeOffsetUnits)
	{
		setDataType(892,objstartDateTimeOffsetUnits);

	}

	/**
	 * Set the Duration.
	 * This field specify the duration for which the resource is requested/scheduled for this appointment,
	 * if different from the overall duration of the requested/scheduled appointment. 
	 * expressed in units of time relative to the scheduled start date/time.   
	 * @param strDuration Amount of time being requested for the appointment. .
	 */ 
	public void setDuration (String strDuration) 
	{
		NM duration  = (NM)getDataElement(893);
		duration.setValue(strDuration); 
		setDuration(duration);

	} 

	/** 
	 * Set the Duration.
	 * This field specify the duration for which the resource is requested/scheduled for this appointment,
	 * if different from the overall duration of the requested/scheduled appointment. 
	 * expressed in units of time relative to the scheduled start date/time.
	 * @param objduration Object of Duration.
	 */ 
	public void setDuration(NM objduration)
	{
		setDataType(893,objduration);

	}

	/**
	 * Set the Duration Units.
	 * This field specify the units of time used for expressing the duration.     
	 * @param strIdentifier Specifies sequence of characters (the code) that uniquely identifies
	 * 						 the item being referenced by the CNE.
	 * @param strText Specifies descriptive or textual name of the identifier, e.g., myocardial infarction 
	 * @param strNameOfCodingSystem Specifies the coding scheme being used in the identifier component. 
	 * @param strAlternateIdentifier Specifies the local or user seen code as described. 
	 * @param strAlternateText Specifies descriptive or textual name of the alternate identifier.  
	 * @param strNameOfAlternateCodingSystem Specifies the coding scheme being used in the alternate identifier 
	 * 											component.  
	 * @param strCodingSystemVersionID Specifies the version ID for the coding system. 
	 * @param strAlternateCodingSystemVersionID Specifies the version ID for the coding system .
	 * @param strOriginalText Specifies the original text that was available to an automated process or a human 
	 * 							before a specific code was assigned.
	 * @param strSecondAlternateIdentifier Specifies a sequence of characters that uniquely identifies the second alternate code
	 * @param strSecondAlternateText Specifies a the textual information of the second alternate code
	 * @param strNameOfSecondAltenateCodingSystem Specifies the second coding scheme being used in the identifier component.
	 * @param strSecondAlternateCodingSystemVersionID Specifies version ID of Second alternative coding system.
	 * @param strCodingSystemOID contains the ISO Object identifier for the coding system.
	 * @param strValueSetOID contains the value set from which CNE-1 is obtained 
	 * @param strValueSetVersionID contains the version of the value set identified by CNE-15. 
	 * @param strAlternateCodingSystemOID contains the ISO Object identifier for the alternate coding system
	 * @param strAlternateValueSetOID contains the value set from which CNE-4 is obtained
	 * @param strAlternateValueSetVersionID contains the version of the value set identified by CNE-18. 
	 * @param strSecondAlternateCodingSystemOID contains the value set from which CNE-12 is obtained
	 * @param strSecondAlternateValueSetOID contains the value set from which CNE-10 is obtained
	 * @param strSecondAlternateValueSetVersionID contains the version of the value set identified by CNE-21. 
	 */  
	public void setDurationUnits (String strIdentifier,String strText,String strNameOfCodingSystem,String strAlternateIdentifier,
			String strAlternateText,String strNameOfAlternateCodingSystem,String strCodingSystemVersionID,
			String strAlternateCodingSystemVersionID,String strOriginalText, String strSecondAlternateIdentifier, String strSecondAlternateText,
			String strNameOfSecondAltenateCodingSystem, String strSecondAlternateCodingSystemVersionID, String strCodingSystemOID, 
			String strValueSetOID, String strValueSetVersionID, String strAlternateCodingSystemOID, String strAlternateValueSetOID,
			String strAlternateValueSetVersionID, String strSecondAlternateCodingSystemOID, String strSecondAlternateValueSetOID,
			String strSecondAlternateValueSetVersionID)
	{
		CNE cne  = (CNE)getDataElement(894);
		cne.setIdentifier(strIdentifier);
		cne.setText(strText);
		cne.setNameOfCodingSystem(strNameOfCodingSystem);
		cne.setAlternateIdentifier(strAlternateIdentifier);
		cne.setAlternateText(strAlternateText);
		cne.setNameOfAlternateCodingSystem(strNameOfAlternateCodingSystem);
		cne.setCodingSystemVersionID(strCodingSystemVersionID);
		cne.setAlternateCodingSystemVersionID(strAlternateCodingSystemVersionID);
		cne.setOriginalText(strOriginalText); 
		cne.setSecondAlternateIdentifier(strSecondAlternateIdentifier);
		cne.setSecondAlternateText(strSecondAlternateText);
		cne.setNameofSecondAlternateCodingSystem(strNameOfSecondAltenateCodingSystem);
		cne.setSecondAlternateCodingSystemVersionID(strSecondAlternateCodingSystemVersionID);
		cne.setCodingSystemOID(strCodingSystemOID);
		cne.setValueSetOID(strValueSetOID);
		cne.setValueSetVersionID(strValueSetVersionID);
		cne.setAlternateCodingSystemOID(strAlternateCodingSystemOID);
		cne.setAlternateValueSetOID(strAlternateValueSetOID);
		cne.setAlternateValueSetVersionID(strAlternateValueSetVersionID);
		cne.setSecondAlternateCodingSystemOID(strSecondAlternateCodingSystemOID);
		cne.setSecondAlternateValueSetOID(strSecondAlternateValueSetOID);
		cne.setSecondAlternateValueSetVersionID(strSecondAlternateValueSetVersionID);
		setDurationUnits(cne);

	} 

	/** 
	 * Set the Duration Units.
	 * This field specify the units of time used for expressing the duration.     
	 * @param objdurationUnits Object of Duration Units.
	 */ 
	public void setDurationUnits(CNE objdurationUnits)
	{
		setDataType(894,objdurationUnits);

	}

	/**
	 * Set the Allow Substitution Code.
	 * This field specify the code indicating whether the identified
	 * resource can be substituted with an equivalent resource by the filler application or not.  
	 * @param strIdentifier Specifies of characters (the code) that uniquely identifies the item being referenced. 
	 * @param strText Specifies The descriptive or textual name of the identifier, e.g., myocardial infarction. 
	 * @param strNameOfCodingSystem Identifies the coding scheme being used in the identifier component.
	 * @param strAlternateIdentifier Specifies an alternate sequence of characters (the code) that uniquely identifies the item being referenced.
	 * @param strAlternateText Specifies the descriptive or textual name of the alternate identifier. See usage note in section introduction.
	 * @param strNameOfAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component. 
	 * @param strCodingSystemVersionID A sequence of characters that uniquely identifies a second alternate code.
	 * @param strAlternateCodingSystemVersionId This component carries the version for the coding system identified by components 4-6.
	 * @param strOriginalText The text as seen and/or selected by the user who entered the data.
	 * @param strSecondAlternateIdentifier A sequence of characters that uniquely identifies a second alternate code.
	 * @param strSecondAlternateText The descriptive or textual name of the alternate identifier.
	 * @param strNameofSecondAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component.
	 * @param strSecondAlternateCodingSystemVersionID This component carries the version for the coding system identified by components 10-12.
	 * @param strCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.3.
	 * @param strValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.1 is obtained.
	 * @param strValueSetVersionID This component carries the version for the value set identified by CWE.15. The version is a date. The date is the date/time that the value set being used was published.
	 * @param strAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.6.
	 * @param strAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.4 is obtained.
	 * @param strAlternateValueSetVersionID This component carries the version for the value set identified by CWE.18. The version is a date.
	 * @param strSecondAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.12.
	 * @param strSecondAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.10 is obtained.
	 * @param strSecondAlternateValueSetVersionID This component carries the version for the value set identified by CWE.21. The version is a date.
	 */ 
	public void setAllowSubstitutionCode (String strIdentifier,String strText,String strNameOfCodingSystem,
			String strAlternateIdentifier,String strAlternateText,String strNameOfAlternateCodingSystem, String strCodingSystemVersionID, String 				strAlternateCodingSystemVersionId,
			String strOriginalText, String  strSecondAlternateIdentifier, String strSecondAlternateText, 
			String strNameofSecondAlternateCodingSystem, String strSecondAlternateCodingSystemVersionID, String strCodingSystemOID, String strValueSetOID,
			String strValueSetVersionID, String strAlternateCodingSystemOID, String strAlternateValueSetOID, String strAlternateValueSetVersionID,
			String  strSecondAlternateCodingSystemOID, String strSecondAlternateValueSetOID, String strSecondAlternateValueSetVersionID)
	{
		CWE cwe  = (CWE)getDataElement(895);
		cwe.setIdentifier(strIdentifier);
		cwe.setText(strText);
		cwe.setNameOfCodingSystem(strNameOfCodingSystem);
		cwe.setAlternateIdentifier(strAlternateIdentifier);
		cwe.setAlternateText(strAlternateText);
		cwe.setNameOfAlternateCodingSystem(strNameOfAlternateCodingSystem); 
		cwe.setCodingSystemVersionID(strCodingSystemVersionID);
		cwe.setAlternateCodingSystemVersionId(strAlternateCodingSystemVersionId);
		cwe.setOriginalText(strOriginalText);
		cwe.setSecondAlternateIdentifier(strSecondAlternateIdentifier);
		cwe.setSecondAlternateText(strSecondAlternateText);
		cwe.setNameofSecondAlternateCodingSystem(strNameofSecondAlternateCodingSystem);
		cwe.setSecondAlternateCodingSystemVersionID(strSecondAlternateCodingSystemVersionID);
		cwe.setCodingSystemOID(strCodingSystemOID);
		cwe.setValueSetOID(strValueSetOID);
		cwe.setValueSetVersionID(strValueSetVersionID);
		cwe.setAlternateCodingSystemOID(strAlternateCodingSystemOID);
		cwe.setAlternateValueSetOID(strAlternateValueSetOID);
		cwe.setAlternateValueSetVersionID(strAlternateValueSetVersionID);
		cwe.setSecondAlternateCodingSystemOID(strSecondAlternateCodingSystemOID);
		cwe.setSecondAlternateValueSetOID(strSecondAlternateValueSetOID);
		cwe.setSecondAlternateValueSetVersionID(strSecondAlternateValueSetVersionID);
		setAllowSubstitutionCode(cwe);

	} 

	/** 
	 * Set the Allow Substitution Code.
	 * This field specify the code indicating whether the identified
	 * resource can be substituted with an equivalent resource by the filler application or not.  
	 * @param objallowSubstitutionCode Object of Allow Substitution Code.
	 */ 
	public void setAllowSubstitutionCode(CWE objallowSubstitutionCode)
	{
		setDataType(895,objallowSubstitutionCode);

	}

	/**
	 * Set the Filler Status Code.
	 * This field specify the code, that describes the requested/scheduled status of the resource or activity,
	 * from the point of view of the filler application.     
	 * @param strIdentifier Specifies of characters (the code) that uniquely identifies the item being referenced. 
	 * @param strText Specifies The descriptive or textual name of the identifier, e.g., myocardial infarction. 
	 * @param strNameOfCodingSystem Identifies the coding scheme being used in the identifier component.
	 * @param strAlternateIdentifier Specifies an alternate sequence of characters (the code) that uniquely identifies the item being referenced.
	 * @param strAlternateText Specifies the descriptive or textual name of the alternate identifier. See usage note in section introduction.
	 * @param strNameOfAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component. 
	 * @param strCodingSystemVersionID A sequence of characters that uniquely identifies a second alternate code.
	 * @param strAlternateCodingSystemVersionId This component carries the version for the coding system identified by components 4-6.
	 * @param strOriginalText The text as seen and/or selected by the user who entered the data.
	 * @param strSecondAlternateIdentifier A sequence of characters that uniquely identifies a second alternate code.
	 * @param strSecondAlternateText The descriptive or textual name of the alternate identifier.
	 * @param strNameofSecondAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component.
	 * @param strSecondAlternateCodingSystemVersionID This component carries the version for the coding system identified by components 10-12.
	 * @param strCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.3.
	 * @param strValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.1 is obtained.
	 * @param strValueSetVersionID This component carries the version for the value set identified by CWE.15. The version is a date. The date is the date/time that the value set being used was published.
	 * @param strAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.6.
	 * @param strAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.4 is obtained.
	 * @param strAlternateValueSetVersionID This component carries the version for the value set identified by CWE.18. The version is a date.
	 * @param strSecondAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.12.
	 * @param strSecondAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.10 is obtained.
	 * @param strSecondAlternateValueSetVersionID This component carries the version for the value set identified by CWE.21. The version is a date.
	 */	 
	public void setFillerStatusCode (String strIdentifier,String strText,String strNameOfCodingSystem,
			String strAlternateIdentifier,String strAlternateText,String strNameOfAlternateCodingSystem, String strCodingSystemVersionID, String 				strAlternateCodingSystemVersionId,
			String strOriginalText, String  strSecondAlternateIdentifier, String strSecondAlternateText, 
			String strNameofSecondAlternateCodingSystem, String strSecondAlternateCodingSystemVersionID, String strCodingSystemOID, String strValueSetOID,
			String strValueSetVersionID, String strAlternateCodingSystemOID, String strAlternateValueSetOID, String strAlternateValueSetVersionID,
			String  strSecondAlternateCodingSystemOID, String strSecondAlternateValueSetOID, String strSecondAlternateValueSetVersionID)
	{
		CWE cwe  = (CWE)getDataElement(889);
		cwe.setIdentifier(strIdentifier);
		cwe.setText(strText);
		cwe.setNameOfCodingSystem(strNameOfCodingSystem);
		cwe.setAlternateIdentifier(strAlternateIdentifier);
		cwe.setAlternateText(strAlternateText);
		cwe.setNameOfAlternateCodingSystem(strNameOfAlternateCodingSystem); 
		cwe.setCodingSystemVersionID(strCodingSystemVersionID);
		cwe.setAlternateCodingSystemVersionId(strAlternateCodingSystemVersionId);
		cwe.setOriginalText(strOriginalText);
		cwe.setSecondAlternateIdentifier(strSecondAlternateIdentifier);
		cwe.setSecondAlternateText(strSecondAlternateText);
		cwe.setNameofSecondAlternateCodingSystem(strNameofSecondAlternateCodingSystem);
		cwe.setSecondAlternateCodingSystemVersionID(strSecondAlternateCodingSystemVersionID);
		cwe.setCodingSystemOID(strCodingSystemOID);
		cwe.setValueSetOID(strValueSetOID);
		cwe.setValueSetVersionID(strValueSetVersionID);
		cwe.setAlternateCodingSystemOID(strAlternateCodingSystemOID);
		cwe.setAlternateValueSetOID(strAlternateValueSetOID);
		cwe.setAlternateValueSetVersionID(strAlternateValueSetVersionID);
		cwe.setSecondAlternateCodingSystemOID(strSecondAlternateCodingSystemOID);
		cwe.setSecondAlternateValueSetOID(strSecondAlternateValueSetOID);
		cwe.setSecondAlternateValueSetVersionID(strSecondAlternateValueSetVersionID);
		setFillerStatusCode(cwe);

	} 

	/** 
	 * Set the Filler Status Code.
	 * This field specify the code, that describes the requested/scheduled status of the resource or activity,
	 * from the point of view of the filler application.     
	 * @param objfillerStatusCode Object of Filler Status Code.
	 */ 
	public void setFillerStatusCode(CWE objfillerStatusCode)
	{
		setDataType(889,objfillerStatusCode);

	}	

	/**
	 * Validates HL7 Message objects .
	 * Validate method checks for validation each and every segments in side the Message object against specified message Structure. 
	 * Validation checks include optionality of segment or group.
	 * It also verifies the number of times segment or group is repeated in message.
	 * e.g 
	 * {PSH} while parsing PSH segment validate method will check for its mandatory presence.
	 * [PSH] in this case validate will throw exception if one tries to enter more than one PSH segment.
	 * @return boolean - true or false.
	 * @throws InvalidSegmentException If Segment Validation fails. 
	 */
	@Override
	public boolean validate() throws InvalidSegmentException 
	{
		try
		{
			super.validate();
			/*
			 * SetID-AIL is required field.
			 */
			NM startDateTimeOffset = getStartDateTimeOffset();
			DTM startDateTime = getStartDateTime();
			CNE startDateTimeOffsetUnits = getStartDateTimeOffsetUnits();
			/*
			 * This field is conditionally required.
			 * If a value for Start date/time offset is not provided, then a value is required for this field.  
			 */
			if(startDateTimeOffset == null && startDateTime == null)
			{
				String str = ResourceBundleWrapper.getValue("exceptions", "InvalidField", new Locale(HL7Config.createInstance().getLocale())) + ":" + objSegmentMap.getFieldName(1202);
				
					throw new InvalidFieldException(str);
			}

			/*
			 * This field is conditionally required.
			 * If a value for Start date/time is not provided, then a value is required for this field. 
			 */
			if(startDateTime == null && startDateTimeOffset == null)
			{
				String str = ResourceBundleWrapper.getValue("exceptions", "InvalidField", new Locale(HL7Config.createInstance().getLocale())) + ":" + objSegmentMap.getFieldName(891);
				
					throw new InvalidFieldException(str);
			}

			/*
			 * This field is conditionally required.
			 * If a value for Start date/time offset is provided, then a value is required for this field.
			 */
			if(startDateTimeOffset != null && startDateTimeOffsetUnits == null)
			{
				String str = ResourceBundleWrapper.getValue("exceptions", "InvalidField", new Locale(HL7Config.createInstance().getLocale())) + ":" + objSegmentMap.getFieldName(892);
				
					throw new InvalidFieldException(str);
			}

			//Condition for Segment Action Code not clear.
			/*
			 * Segment Action Code is conditional field. 
			 * Condition rule:This field is conditionally required.  It is required for all updating or modifying trigger events.
			 */

			//Condition for Location Resource ID not clear.
			/*
			 * Location Resource ID is conditional field. 
			 * Condition rule:This field is required for all unsolicited transactions from the filler application
			 */

			//Condition for Location Type-AIL not clear.
			/*
			 * Location Type-AIL is conditional field. 
			 * Condition rule: This field is conditionally required if a specific location is not identified in AIL-3-Location resource ID.  
			 */

			//Condition for Allow Substitution Code not clear.
			/*
			 * Allow Substitution Code is conditional field. 
			 * Condition rule: This field is conditionally required.  It is required for all request messages.  
			 */

			//Condition for Filler Status Code not clear.
			/*
			 * Filler Status Code is conditional field. 
			 * Condition rule: This is a conditionally required field.  
			 * Because the information contained in this field is only appropriate in transactions originating from a filler application, it is required for those messages.    
			 */

			return true;
		}
		catch(FieldMissingException ex)
		{
			throw new InvalidSegmentException(enumSegments.getValue(),ex);
		}
	}
}