/*******************************************************************************
 *  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 cdac.medinfo.sdk.hl7282.baselibs.CWE;
import cdac.medinfo.sdk.hl7282.baselibs.SI;
import cdac.medinfo.sdk.hl7282.baselibs.ST;
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.SingleCollection;

/**
 * AL1 - Patient Allergy Information Segment <p>
 * The AL1 segment contains patient allergy information of various types.
 * Most of this information will be derived from user-defined tables.
 * Each AL1 segment describes a single patient allergy.
 * <p>Represents an HL7 AL1 message segment. 
 * This segment has the following fields:</p><p>
 * AL1-1: Set ID - AL1 (SI)<b>Required</b><br> 
 * AL1-2: Allergen Type Code (CWE)<b>Optional</b><br> 
 * AL1-3: Allergen Code/Mnemonic/Description (CWE)<b>Required</b><br> 
 * AL1-4: Allergy Severity Code (CWE)<b>Optional</b><br> 
 * AL1-5: Allergy Reaction Code (ST)<b>Optional</b><br> 
 * AL1-6: Identification Date (DT)<b>Withdrawn</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 AL1 extends Segment    
{
	

	/**
	 * Constructs the AL1 segment. 
	 */
	public AL1()
	{super(EnumSegments.HL7_SEG_AL1);
	}
	//Integer values used in getter/setter is unique item id defined 
	//for each attribute.

	/**
	 * Retrieves the Allergen Code Mnemonic Description.
	 * @return CWE - allergenCodeMnemonicDescription
	 */
	public CWE getAllergenCodeMnemonicDescription() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(205);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Allergen Type Code.
	 * @return CWE - allergenTypeCode
	 */
	public CWE getAllergenTypeCode() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(204);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Allergy Reaction Code.
	 * @return ISingleCollection<ST> - allergyReactionCode
	 */
	public ISingleCollection<ST> getAllergyReactionCode() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(207);
		ISingleCollection<ST> objDataList = new SingleCollection<ST>();
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				ST objST = (ST)objDataType;
				objDataList.add(objST);
			}
		}

		return objDataList;
	}

	/**
	 * Retrieves the Allergy Severity Code.
	 * @return CWE - allergySeverityCode
	 */
	public CWE getAllergySeverityCode()
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(206);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Identification Date.
	 * @return String - identificationDate
	 *//*
	public DT getIdentificationDate() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(208);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DT)objDataCollection.elementAt(0);
		else
			return null;
	}*/

	/**
	 * Retrieves the Set ID AL1.
	 * @return String - setID_AL1
	 */
	public SI getSetID_AL1() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(203);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (SI)objDataCollection.elementAt(0);
		else
			return null;
	}


	/**
	 * Set the Allergen Code Mnemonic Description.
	 * @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 setAllergenCodeMnemonicDescription (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 allergenCodeMnemonicDescription  = (CWE)getDataElement(205);
		allergenCodeMnemonicDescription.setIdentifier(strIdentifier);
		allergenCodeMnemonicDescription.setText(strText);
		allergenCodeMnemonicDescription.setNameOfCodingSystem(strNameOfCodingSystem);
		allergenCodeMnemonicDescription.setAlternateIdentifier(strAlternateIdentifier);
		allergenCodeMnemonicDescription.setAlternateText(strAlternateText);
		allergenCodeMnemonicDescription.setNameOfAlternateCodingSystem(strNameOfAlternateCodingSystem); 
		allergenCodeMnemonicDescription.setCodingSystemVersionID(strCodingSystemVersionID);
		allergenCodeMnemonicDescription.setAlternateCodingSystemVersionId(strAlternateCodingSystemVersionId);
		allergenCodeMnemonicDescription.setOriginalText(strOriginalText);
		allergenCodeMnemonicDescription.setSecondAlternateIdentifier(strSecondAlternateIdentifier);
		allergenCodeMnemonicDescription.setSecondAlternateText(strSecondAlternateText);
		allergenCodeMnemonicDescription.setNameofSecondAlternateCodingSystem(strNameofSecondAlternateCodingSystem);
		allergenCodeMnemonicDescription.setSecondAlternateCodingSystemVersionID(strSecondAlternateCodingSystemVersionID);
		allergenCodeMnemonicDescription.setCodingSystemOID(strCodingSystemOID);
		allergenCodeMnemonicDescription.setValueSetOID(strValueSetOID);
		allergenCodeMnemonicDescription.setValueSetVersionID(strValueSetVersionID);
		allergenCodeMnemonicDescription.setAlternateCodingSystemOID(strAlternateCodingSystemOID);
		allergenCodeMnemonicDescription.setAlternateValueSetOID(strAlternateValueSetOID);
		allergenCodeMnemonicDescription.setAlternateValueSetVersionID(strAlternateValueSetVersionID);
		allergenCodeMnemonicDescription.setSecondAlternateCodingSystemOID(strSecondAlternateCodingSystemOID);
		allergenCodeMnemonicDescription.setSecondAlternateValueSetOID(strSecondAlternateValueSetOID);
		allergenCodeMnemonicDescription.setSecondAlternateValueSetVersionID(strSecondAlternateValueSetVersionID);
		setAllergenCodeMnemonicDescription(allergenCodeMnemonicDescription);
	} 

	/** Set the Allergen Code Mnemonic Description.
	 * @param objallergenCodeMnemonicDescription object of Allergen Code Mnemonic Description.
	 */ 
	public void setAllergenCodeMnemonicDescription(CWE objallergenCodeMnemonicDescription)
	{
		setDataType(205,objallergenCodeMnemonicDescription);
	}
	/**
	 * Set the Allergen TypeCode.
	* @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 setAllergenTypeCode (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 allergenTypeCode  = (CWE)getDataElement(204);
		allergenTypeCode.setIdentifier(strIdentifier);
		allergenTypeCode.setText(strText);
		allergenTypeCode.setNameOfCodingSystem(strNameOfCodingSystem);
		allergenTypeCode.setAlternateIdentifier(strAlternateIdentifier);
		allergenTypeCode.setAlternateText(strAlternateText);
		allergenTypeCode.setNameOfAlternateCodingSystem(strNameOfAlternateCodingSystem); 
		allergenTypeCode.setCodingSystemVersionID(strCodingSystemVersionID);
		allergenTypeCode.setAlternateCodingSystemVersionId(strAlternateCodingSystemVersionId);
		allergenTypeCode.setOriginalText(strOriginalText);
		allergenTypeCode.setSecondAlternateIdentifier(strSecondAlternateIdentifier);
		allergenTypeCode.setSecondAlternateText(strSecondAlternateText);
		allergenTypeCode.setNameofSecondAlternateCodingSystem(strNameofSecondAlternateCodingSystem);
		allergenTypeCode.setSecondAlternateCodingSystemVersionID(strSecondAlternateCodingSystemVersionID);
		allergenTypeCode.setCodingSystemOID(strCodingSystemOID);
		allergenTypeCode.setValueSetOID(strValueSetOID);
		allergenTypeCode.setValueSetVersionID(strValueSetVersionID);
		allergenTypeCode.setAlternateCodingSystemOID(strAlternateCodingSystemOID);
		allergenTypeCode.setAlternateValueSetOID(strAlternateValueSetOID);
		allergenTypeCode.setAlternateValueSetVersionID(strAlternateValueSetVersionID);
		allergenTypeCode.setSecondAlternateCodingSystemOID(strSecondAlternateCodingSystemOID);
		allergenTypeCode.setSecondAlternateValueSetOID(strSecondAlternateValueSetOID);
		allergenTypeCode.setSecondAlternateValueSetVersionID(strSecondAlternateValueSetVersionID);
		setAllergenTypeCode(allergenTypeCode);

	} 

	/** Set the Allergen TypeCode.
	 * @param objallergenTypeCode object of Allergen TypeCode.
	 */ 
	public void setAllergenTypeCode(CWE objallergenTypeCode)
	{
		setDataType(204,objallergenTypeCode);
	}
	/**
	 * Set the Allergy Reaction Code.
	 * @param strAllergyReactionCode Specifies the specific allergic reaction that was documented.  
	 */ 
	public void addAllergyReactionCode (String strAllergyReactionCode) 
	{
		ST tempAllergyReactionCode  = (ST)getDataElement(207);
		tempAllergyReactionCode.setValue(strAllergyReactionCode); 
		addAllergyReactionCode(tempAllergyReactionCode);
	} 

	/** Set the Allergy Reaction Code.
	 * @param objtempAllergyReactionCode object of Allergy Reaction Code.  
	 */ 
	public void addAllergyReactionCode(ST objtempAllergyReactionCode)
	{
		addDataType(207,objtempAllergyReactionCode);
	}

	/**
	 * Set the Allergy Reaction Code.
	 * @param objAllergyReactionCode List of Allergy Reaction Code.
	 */
	@SuppressWarnings("unchecked")
	public void setAllergyReactionCode(ISingleCollection<ST> objAllergyReactionCode)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objAllergyReactionCode;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(207,objCollection);
	}
	/**
	 * Set the Allergy Severity 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 setAllergySeverityCode (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 allergySeverityCode  = (CWE)getDataElement(206);
		allergySeverityCode.setIdentifier(strIdentifier);
		allergySeverityCode.setText(strText);
		allergySeverityCode.setNameOfCodingSystem(strNameOfCodingSystem);
		allergySeverityCode.setAlternateIdentifier(strAlternateIdentifier);
		allergySeverityCode.setAlternateText(strAlternateText);
		allergySeverityCode.setNameOfAlternateCodingSystem(strNameOfAlternateCodingSystem); 
		allergySeverityCode.setCodingSystemVersionID(strCodingSystemVersionID);
		allergySeverityCode.setAlternateCodingSystemVersionId(strAlternateCodingSystemVersionId);
		allergySeverityCode.setOriginalText(strOriginalText);
		allergySeverityCode.setSecondAlternateIdentifier(strSecondAlternateIdentifier);
		allergySeverityCode.setSecondAlternateText(strSecondAlternateText);
		allergySeverityCode.setNameofSecondAlternateCodingSystem(strNameofSecondAlternateCodingSystem);
		allergySeverityCode.setSecondAlternateCodingSystemVersionID(strSecondAlternateCodingSystemVersionID);
		allergySeverityCode.setCodingSystemOID(strCodingSystemOID);
		allergySeverityCode.setValueSetOID(strValueSetOID);
		allergySeverityCode.setValueSetVersionID(strValueSetVersionID);
		allergySeverityCode.setAlternateCodingSystemOID(strAlternateCodingSystemOID);
		allergySeverityCode.setAlternateValueSetOID(strAlternateValueSetOID);
		allergySeverityCode.setAlternateValueSetVersionID(strAlternateValueSetVersionID);
		allergySeverityCode.setSecondAlternateCodingSystemOID(strSecondAlternateCodingSystemOID);
		allergySeverityCode.setSecondAlternateValueSetOID(strSecondAlternateValueSetOID);
		allergySeverityCode.setSecondAlternateValueSetVersionID(strSecondAlternateValueSetVersionID);
		setAllergySeverityCode(allergySeverityCode);
	} 

	/** Set the Allergy Severity Code.
	 * @param objallergySeverityCode Allergy Severity Code.
	 */ 
	public void setAllergySeverityCode(CWE objallergySeverityCode)
	{
		setDataType(206,objallergySeverityCode);
	}
	/**
	 * Set the Identification Date.
	 * @param strIdentificationDate Specifies the date that the allergy was identified.
	 * 								  This field has been retained for backward compatibility only.  
	 *//* 
	public void setIdentificationDate (String strIdentificationDate) 
	{
		DT identificationDate  = (DT)getDataElement(208);
		identificationDate.setValue(strIdentificationDate); 
		setIdentificationDate(identificationDate);
	} 

	*//** Set the Identification Date.
	 * @param objidentificationDate object of Identification Date.  
	 *//* 
	public void setIdentificationDate(DT objidentificationDate)
	{
		setDataType(208,objidentificationDate);
	}*/
	/**
	 * Set the Set ID AL1.
	 * @param strSetID_AL1 This field contains the number that identifies AL1 transaction. 
	 */ 
	public void setSetID_AL1 (String strSetID_AL1) 
	{
		SI setID_AL1  = (SI)getDataElement(203);
		setID_AL1.setValue(strSetID_AL1); 
		setSetID_AL1(setID_AL1);
	} 

	/** Set the Set ID AL1.
	 * @param objsetID_AL1 object of Set ID AL1. 
	 */ 
	public void setSetID_AL1(SI objsetID_AL1)
	{
		setDataType(203,objsetID_AL1);
	}

	/**
	 * Validates HL7 Message objects .
	 * Validate method checks for validation each and every segments in side the Message object against specified message Structure. 
	 * Validation chcecks 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 Field Validation Fails.
	 */
	public boolean validate()throws InvalidSegmentException
	{
		try
		{
			super.validate();
			return true;
		}
		catch(FieldMissingException ex)
		{
			throw new InvalidSegmentException(enumSegments.getValue(),ex);
		}
	}
}