/*******************************************************************************
 *  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.utils.EnumSegments;

/**
 * EQL - embedded query language segment<p>
 * The EQL segment is used to define queries using select statements based on the query language of choice.
 * <p>Represents an HL7 EQL message segment. 
 * This segment has the following fields:</p><p>
 * EQL-1: Query Tag (ST)<b>Optional</b><br> 
 * EQL-2: Query/Response Format Code (ID)<b>Required</b><br> 
 * EQL-3: EQL Query Name (CE)<b>Required</b><br> 
 * EQL-4: EQL Query Statement (ST)<b>Required</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 EQL extends Segment    
{
	





	/**
	 *  Constructs the EQL Segment.
	 */
	public EQL()
	{super(EnumSegments.HL7_SEG_EQL);
	}

//	/**
//	 * Retrieves the EQL Query Name.
//	 * @return CE - eQLQueryName
//	 */
//	public CE getEQLQueryName() 
//	{
//		ISingleCollection<IDataType> objDataCollection =getDataType(709);
//		if(objDataCollection != null && objDataCollection.size() != 0) 
//			return (CE)objDataCollection.elementAt(0);
//		else
//			return null;
//	}
//
//	/**
//	 * Set the EQL Query Name.
//	 * @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.
//	 */ 
//	public void setEQLQueryName (String strIdentifier,String strText,String strNameOfCodingSystem,
//			String strAlternateIdentifier,String strAlternateText,String strNameOfAlternateCodingSystem)
//	{
//		CE eQLQueryName  = (CE)getDataElement(709);
//		eQLQueryName.setIdentifier(strIdentifier);
//		eQLQueryName.setText(strText);
//		eQLQueryName.setNameOfCodingSystem(strNameOfCodingSystem);
//		eQLQueryName.setAlternateIdentifier(strAlternateIdentifier);
//		eQLQueryName.setAlternateText(strAlternateText);
//		eQLQueryName.setNameOfAlternateCodingSystem(strNameOfAlternateCodingSystem); 
//		setEQLQueryName(eQLQueryName);
//
//	} 
//
//	/** Set the EQL Query Name.
//	 * @param objeQLQueryName object of EQLQueryName.
//	 */ 
//	public void setEQLQueryName(CE objeQLQueryName)
//	{
//		setDataType(709,objeQLQueryName);
//
//	}	
//	/**
//	 * Retrieves the EQL Query statement.
//	 * @return ST - eQLQueryStatement
//	 */
//	public ST getEQLQueryStatement() 
//	{
//		ISingleCollection<IDataType> objDataCollection =getDataType(710);
//		if(objDataCollection != null && objDataCollection.size() != 0) 
//			return (ST)objDataCollection.elementAt(0);
//		else
//			return null;
//	}
//
//	/**
//	 * Set the EQL Query Statement.
//	 * This field contains the EQL select statement that is the basis of the query
//	 * @param strQueryStatement The name of the party
//	 */ 
//	public void setEQLQueryStatement (String strQueryStatement) 
//	{
//		ST eQLQueryStatement  = (ST)getDataElement(710);
//		eQLQueryStatement.setValue(strQueryStatement); 
//		setEQLQueryStatement(eQLQueryStatement);
//
//	} 
//
//	/** Set the EQL Query Statement.
//	 * This field contains the EQL select statement that is the basis of the query
//	 * @param objeQLQueryStatement object of EQLQueryStatement
//	 */ 
//	public void setEQLQueryStatement(ST objeQLQueryStatement)
//	{
//		setDataType(710,objeQLQueryStatement);
//	}	
//	/**
//	 * Retrieves the Query Response Format Code.
//	 * This field refers to HL7 Table 0106 - Query/response format code for valid values.
//	 * @return string- queryResponseFormatCode
//	 */
//	public ID getQueryResponseFormatCode() 
//	{
//		ISingleCollection<IDataType> objDataCollection =getDataType(697);
//		if(objDataCollection != null && objDataCollection.size() != 0) 
//			return (ID)objDataCollection.elementAt(0);
//		else
//			return null;
//	}
//
//	/**
//	 * Set the Query Response Format Code.
//	 * This field refers to HL7 Table 0106 - Query/response format code for valid values D,R,T.
//	 * @param strQueryResponseFormatCode Speifies string value of QueryResponseFormatCode.
//	 */ 
//	public void setQueryResponseFormatCode (String strQueryResponseFormatCode) 
//	{
//		ID queryResponseFormatCode  = (ID)getDataElement(697);
//		queryResponseFormatCode.setValue(strQueryResponseFormatCode); 
//		setQueryResponseFormatCode(queryResponseFormatCode);
//	} 
//
//	/**Sets the Query Response Format Code
//	 * @param objqueryResponseFormatCode object of Query Response Format Code.
//	 */ 
//	public void setQueryResponseFormatCode(ID objqueryResponseFormatCode)
//	{
//		setDataType(697,objqueryResponseFormatCode);
//	}	
//	/**
//	 * Retrieves the Query Tag.
//	 * This field identifies Query Tag.
//	 * @return ST - queryTag
//	 */
//	public ST getQueryTag() 
//	{
//		ISingleCollection<IDataType> objDataCollection =getDataType(696);
//		if(objDataCollection != null && objDataCollection.size() != 0) 
//			return (ST)objDataCollection.elementAt(0);
//		else
//			return null;
//	}
//
//	/**
//	 * Set the Query Tag.
//	 * This field may be valued by the initiating system to identify the query, and may be used to match response messages to the originating query. 
//	 * @param strQueryTag Specifies string value of QueryTag.
//	 */ 
//	public void setQueryTag (String strQueryTag) 
//	{
//		ST queryTag  = (ST)getDataElement(696);
//		queryTag.setValue(strQueryTag); 
//		setQueryTag(queryTag);
//
//	} 
//
//	/** Set the Query Tag.
//	 * This field may be valued by the initiating system to identify the query, and may be used to match response messages to the originating query. 
//	 * @param objqueryTag object of Query Tag.
//	 */ 
//	public void setQueryTag(ST objqueryTag)
//	{
//		setDataType(696,objqueryTag);
//	}	
//	/**
//	 * Validates the Segment object.
//	 * This method checks for validation of each and every field as per HL7 attribute table of segment.
//	 * Validation chcecks include confirmation of presence of required field denoted by 'R' in OPT column of table.
//	 * It also verifies conditional fields(denoted by 'C').If condition is not fullfilled Exception is thrown.
//	 * Backward fields (denoted by 'B')are not checked for validation,as they are introduced for compatibility with previous versions. 
//	 * @return boolean - true or false.
//	 * @throws InvalidSegmentException Thrown when Any of required filed is missing.
//	 */
//	@Override
//	public boolean validate() throws InvalidSegmentException 
//	{
//		try
//		{
//			super.validate();
//			return true;
//		}
//		catch(FieldMissingException ex)
//		{
//			throw new InvalidSegmentException(enumSegments.getValue(),ex);
//		}
//	}
}