/*******************************************************************************
 *  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.FN;
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.SI;
import cdac.medinfo.sdk.hl7282.baselibs.XCN;
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.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;

/**
 * AIP - Appointment Information - Personnel Resource Segment<p>
 * The AIP segment contains information about the personnel types that can be scheduled.
 * The kinds of personnel described on this segment include any healthcare provider in the
 * institution controlled by a schedule (for example: technicians, physicians, nurses,
 * surgeons, anesthesiologists, or CRNAs).
 * <p>Represents an HL7 AIP message segment. 
 * This segment has the following fields:</p><p>
 * AIP-1: Set ID - AIP (SI)<b>Required</b><br> 
 * AIP-2: Segment Action Code (ID)<b>Conditional</b><br> 
 * AIP-3: Personnel Resource ID (XCN)<b>Conditional</b><br> 
 * AIP-4: Resource Type (CWE)<b>Conditional</b><br> 
 * AIP-5: Resource Group (CWE)<b>Optional</b><br> 
 * AIP-6: Start Date/Time (DTM)<b>Conditional</b><br> 
 * AIP-7: Start Date/Time Offset (NM)<b>Conditional</b><br> 
 * AIP-8: Start Date/Time Offset Units (CNE)<b>Conditional</b><br> 
 * AIP-9: Duration (NM)<b>Optional</b><br> 
 * AIP-10: Duration Units (CNE)<b>Optional</b><br> 
 * AIP-11: Allow Substitution Code (CWE)<b>Conditional</b><br> 
 * AIP-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 AIP extends Segment   
{

	

	/**
	 *  Constructs the AIP segment.
	 */
	public AIP()
	{super(EnumSegments.HL7_SEG_AIP);
	}

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

	/**
	 * Retrieves the Allow Substitution Code.
	 * @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 it is different than the overall duration of the requested/scheduled appointment.
	 * @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 a code describing the units of time used for expressing the AIG-11-Duration field.
	 * @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.
	 * @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 Personnel Resource ID.
	 * @return ISingleCollection<XCN> - personnelResourceID
	 */
	public ISingleCollection<XCN> getPersonnelResourceID() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(913);
		ISingleCollection<XCN> objDataList = new SingleCollection<XCN>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				XCN objXCN = (XCN)objDataType;
				objDataList.add(objXCN);
			}
		}
		return objDataList;
	}

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

	/**
	 * Retrieves the Resource Type.
	 * This field specify the resource requested/scheduled for this appointment.
	 * For requests, if a specific resource is not identified in AIG-3-Resource ID, then this
	 * field identifies the type of resource that should be scheduled by the filler application.
	 * @return CWE - resourceType
	 */
	public CWE getResourceType() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(907);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Segment Action Code.
	 * This field specify the action to be taken 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 AIP.
	 * @return SI - setID_AIP
	 */
	public SI getSetID_AIP() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(906);
		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 service 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 that this resource 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 AIG-9-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 AIP.
	 * @param strSetID_AIP This field contains a number that uniquely identifies the information represented by this segment in this transaction for the purposes of addition, change or deletion.
	 */	
	public void setSetID_AIP(String strSetID_AIP) 
	{
		SI setID_AIP  = (SI)getDataElement(906);
		setID_AIP.setValue(strSetID_AIP);
		setSetID_AIP(setID_AIP);
	}

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

	}

	/**
	 * Set the Segment Action Code.
	 * This field specify the action to be taken when updating or modifying information in this segment from previously sent interface transactions. 
	 * @param strSegmentActionCode String value of Segment Action Code.
	 */
	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 Personnel Resource ID.
	 * @param strIDNumber Refers to the coded ID according to a user-defined table
	 * @param objFamilyName Specifies the surname of a person.
	 * @param strGivenName Specifies First name.
	 * @param strSecondAndFurtherGivenNamesOrInitialsThereof Specifies multiple middle names that may be included by 
	 * 														   separating them with spaces.
	 * @param strSuffix Used to specify a name suffix (e.g., Jr. or III).
	 * @param strPrefix Used to specify a name prefix (e.g., Dr.).
	 * @param strSourceTable Used as the HL7 identifier for the user-defined table of values for this component. [Refer User-defined Table 0297 - CN ID.]
	 * @param objAssigningAuthority Specifies a unique identifier of the system (or organization or agency of department)
	 * 								  that creates the data. [Refer User-defined Table 0363 - Assigning authority]
	 * @param strNameTypeCode Specifies a code that represents the type of name. 
	 * @param strIdentifierCheckDigit Specifies part of the identifying number used in the sending application. 
	 * @param strCheckDigitScheme Specifies the code identifying the check digit scheme employed.[Refer HL7 Table 0061 - Check digit scheme].
	 * @param strIdentifierTypeCode Specifies A code corresponding to the type of identifier.[Refer HL7 Table 0203 - Identifier type].
	 * @param objAssigningFacility Specifies the place or location identifier where the identifier was first assigned to the person
	 * @param strNameRepresentationCode Provides an indication of the representation provided by the data item.  
	 * @param objNameContext Designates the context in which a name is used. [Refer User-defined Table 0448 ]
	 * @param strNameAssemblyOrder Specifies a code that represents the preferred display order of the components of this person name. Suggested values are G,F[Refer table 0444.]
	 * @param strEffectiveDate Specifies the first date, if known, on which the address is valid and active.
	 * @param strExpirationDate Specifies the last date, if known, on which the address is valid and active.
	 * @param strProfessionalSuffix Used to specify an abbreviation, or a string of abbreviations, denoting qualifications that support the person's profession, (e.g., licenses).
	 * @param objAssigningJurisdiction Specifies the geo-political body that assigned the identifier.
	 * @param objAssigningAgencyOrDepratment Specifies the agency or department that assigned the identifier
	 * @param strSecurityCheck Specifies the version code that may be assigned to the person identifier
	 * @param strSecurityCheckScheme Specifies the check digit scheme.
	 */ 
	public void addPersonnelResourceID (String strIDNumber,FN objFamilyName,String strGivenName,String strSecondAndFurtherGivenNamesOrInitialsThereof,
			String 	strSuffix,String strPrefix,CWE objSourceTable,HD objAssigningAuthority,
			String strNameTypeCode,String strIdentifierCheckDigit,String strCheckDigitScheme,String strIdentifierTypeCode,
			HD objAssigningFacility,String strNameRepresentationCode,CWE objNameContext,
			String strNameAssemblyOrder, String strEffectiveDate,String strExpirationDate,String strProfessionalSuffix,
			CWE objAssigningJurisdiction,CWE objAssigningAgencyOrDepratment, String strSecurityCheck, String strSecurityCheckScheme)
	{
		XCN xcn  = (XCN)getDataElement(913);
		xcn.setIdNumber(strIDNumber);
		xcn.setFamilyName(objFamilyName);
		xcn.setGivenName(strGivenName);
		xcn.setSecondNameOrInitials(strSecondAndFurtherGivenNamesOrInitialsThereof);
		xcn.setSuffix(strSuffix);
		xcn.setPrefix(strPrefix);
 
		xcn.setSourceTable(objSourceTable);
		xcn.setAssigningAuthority(objAssigningAuthority);
		xcn.setNameTypeCode(strNameTypeCode);
		xcn.setIdentifierCheckDigit(strIdentifierCheckDigit);
		xcn.setCheckDigitScheme(strCheckDigitScheme);
		xcn.setIdentifierTypeCode(strIdentifierTypeCode);
		xcn.setAssigningFacility(objAssigningFacility);
		xcn.setNameRepresentationCode(strNameRepresentationCode);
		xcn.setNameContext(objNameContext);
 
		xcn.setNameAssemblyOrder(strNameAssemblyOrder);
		xcn.setEffectiveDate(strEffectiveDate);
		xcn.setExpirationDate(strExpirationDate);
		xcn.setProfessionalSuffix(strProfessionalSuffix);
		xcn.setAssigningJurisdiction(objAssigningJurisdiction);
		xcn.setAssigningAgencyOrDepartment(objAssigningAgencyOrDepratment); 
		xcn.setSecurityCheck(strSecurityCheck);
		xcn.setSecurityCheckScheme(strSecurityCheckScheme);
		addPersonnelResourceID(xcn);

	} 

	/** 
	 * Add the Personnel Resource ID.
	 * @param objpersonnelResourceID Object of Personnel Resource ID.
	 */ 
	public void addPersonnelResourceID(XCN objpersonnelResourceID)
	{
		addDataType(913,objpersonnelResourceID);

	} 

	/** 
	 * Set the Personnel Resource ID.
	 * @param objpersonnelResourceIDList List of Personnel Resource ID.
	 */ 
	@SuppressWarnings("unchecked")
	public void setPersonnelResourceID(ISingleCollection<XCN> objpersonnelResourceID)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objpersonnelResourceID;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(913,objCollection);
	}

	/**
	 * Set the Resource Type.
	 * This field specify the resource requested/scheduled for this appointment.
	 * For requests, if a specific resource is not identified in AIG-3-Resource ID, then this
	 * field identifies the type of resource that should be scheduled by 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 setResourceType (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(907);
		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); 
		setResourceType(cwe);

	} 

	/** 
	 * Set the Resource Type.
	 * This field specify the resource requested/scheduled for this appointment.
	 * For requests, if a specific resource is not identified in AIG-3-Resource ID, then this
	 * field identifies the type of resource that should be scheduled by the filler application.
	 * @param objresourceType Object of Resource Type.
	 */ 
	public void setResourceType(CWE objresourceType)
	{
		setDataType(907,objresourceType);

	}

	/**
	 * Set the Resource 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 setResourceGroup (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(899);
		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);
		setResourceGroup(cwe);

	} 

	/** 
	 * Set the Resource Group.
	 * This field specify the requested resource as a member of the indicated group.  
	 * @param objresourceGroup Object of Resource Group.
	 */ 
	public void setResourceGroup(CWE objresourceGroup)
	{
		setDataType(899,objresourceGroup);

	}

	/**
	 * Set the Start Date Time.
	 * This field specify the date and time and this service 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 service 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 that this resource needs for the appointment, expressed in units of
	 * time relative to the scheduled start date/time.  
	 * @param strStartDateTimeOffset The offset that this resource needs for the appointment, expressed in units of time relative to the scheduled start date/time.  
	 */ 
	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 that this resource 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 AIG-9-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 AIG-9-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 it is different than the overall duration of the requested/scheduled appointment.  
	 * @param strDuration String value of Duration.
	 */ 
	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 it is different than the overall duration of the requested/scheduled appointment.
	 * @param objduration Object of Duration.
	 */ 
	public void setDuration(NM objduration)
	{
		setDataType(893,objduration);

	}

	/**
	 * Set the Duration Units.
	 * This field specify a code describing the units of time used for expressing the AIG-11-Duration field.  
	 * @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 a code describing the units of time used for expressing the AIG-11-Duration field.  
	 * @param objdurationUnits Object of Duration Units.
	 */ 
	public void setDurationUnits(CNE objdurationUnits)
	{
		setDataType(894,objdurationUnits);

	}

	/**
	 * Set the Allow Substitution Code.
	 * @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.
	 * @param objallowSubstitutionCode Object of Allow Substitution Code.
	 */ 
	public void setAllowSubstitutionCode(CWE objallowSubstitutionCode)
	{
		setDataType(895,objallowSubstitutionCode);

	}

	/**
	 * Set the Filler Status Code. 
	 * @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. 
	 * @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 Thrown when Segment Validation Fails.
	 */
	@Override
	public boolean validate() throws InvalidSegmentException 
	{
		try 
		{
			super.validate();
			/*
			 * Condition not clear
			 * Segment Action Code 
			 * This field is conditionally required.  It is required for all updating or modifying trigger events.
			 */

			/*
			 * Condition not clear
			 * Personnel Resource ID  
			 * This field is conditionally required for this segment.  
			 * In new schedule request messages, it is required if the request asks that a specific person be scheduled.
			 * For all other request messages, the specific person should be identified if the information is available (either because a specific person was initially requested, or because the filler application returned the ID of the specific person who has been scheduled).
			 * This field is required for all unsolicited transactions from the filler application. 
			 */

			/*
			 * Condition not clear
			 * Resource Type  
			 * For all messages, this field is conditionally required if a specific location is not identified in AIP-3-Personnel resource ID. 
			 */
			NM startDateTimeOffset = getStartDateTimeOffset();
			DTM startDateTime = getStartDateTime();
			CNE startDateTimeOffsetUnits = getStartDateTimeOffsetUnits();
			/*
			 * If a value for Start date/time offset is not provided, then a value is required for startDateTime. 
			 */
			if(startDateTimeOffset == null && startDateTime == null)
			{
				String str = objSegmentMap.getFieldName(891) + ":" + objSegmentMap.getFieldName(1202) + ResourceBundleWrapper.getValue("exceptions", "SegmentCondition", new Locale(HL7Config.createInstance().getLocale()));
				
					throw new FieldMissingException(str);
			}

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

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

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

			/*
			 * Condition not clear
			 * Filler Status Code  
			 * This field is conditionally required. 
			 * It should not be valued in any request transactions from the placer application to the filler application.  
			 * It is required for all transactions from the filler application
			 */

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