/*******************************************************************************
 *  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;  

import cdac.medinfo.sdk.hl7282.baselibs.segmentfactory.DataElementFactory;
import cdac.medinfo.sdk.hl7282.commoninterface.IDataType;
import cdac.medinfo.sdk.hl7282.commoninterface.ISingleCollection;
import cdac.medinfo.sdk.hl7282.exceptions.InvalidComponentTypeException;
import cdac.medinfo.sdk.hl7282.utils.EnumDataType;
import cdac.medinfo.sdk.hl7282.utils.IDataTypeMap;

/**
 * CF - Coded Element with Formatted Values<p>
 * This data type transmits codes and the formatted text associated with the code. 
 * This data type can be used to transmit for the first time the formatted 
 * text  for the canned text portion of a report, for example, a standard 
 * radiological description for a normal chest X ray
 * <p>Represents an HL7 CF data type. 
 * This data type has the following attributes:</p><p>
 *  1.  identifier (ST)<b>Optional</b><br>
 *  2. formatted text (FT)<b>Optional</b><br>
 *  3. name of coding system (ID)<b>Conditional</b><br>
 *  4. alternate identifier (ST)<b>Optional</b><br>
 *  5. alternate formatted text (FT)<b>Optional</b><br>
 *  6. name of alternate coding system (ID)<b>Conditional</b><br><p>
 *  7. Coding System Version ID (ST)<b>Conditional</b><br><p>
 *  8. Alternate Coding System Version ID (ST)<b>Optional</b><br><p>
 *  9. Original Text (ST)<b>Optional</b><br>Optional<p>
 *  10. Second Alternate Identifier ID (ST)<b>Optional</b><br><p>
 *  11. Second Alternate Formatted Text (FT)<b>Optional</b><br><p>
 *  12. Name of Second Alternate Coding System (ID)<b>Optional</b><br><p>
 *  13. Second Alternate Coding System Version ID (ST)<b>Conditional</b><br><p>
 *  14. Coding System OID (ST)<b>Conditional</b><br><p>
 *  15. Value Set OID (ST)<b>Optional</b><br><p>
 *  16. Value Set Version ID (DTM)<b>Conditional</b><br><p>
 *  17. Alternate Coding System OID (ST)<b>Conditional</b><br><p>
 * 	18. Alternate Value Set OID (ST)<b>Optional</b><br><p>
 *  19. Alternate Value Set Version ID  (DTM)<b>Conditional</b><br><p>
 *  20. Second Alternate Coding System OID (ST)<b>Conditional</b><br><p>
 *  21. Second Alternate Value Set OID (ST)<b>Optional</b><br><p>
 *  22. Second Alternate Value Set Version ID (DTM)<b>Conditional</b><br><p>
 * This class provides accessors & mutators for the elements mentioned above.
 * This class override the equal method, to check whether some other object is "equal to" this one.
 * 
 * <p>User can also create Data Type through {@link DataElementFactory} 
 */
public class CF extends CompositeDataType    
{
	


	/**
	 * Default Constructor for CF
	 */
	public CF()
	{
		super(EnumDataType.HL7_DT_CF);
		 
	}

	/**
	 * Constructor  for CF class which takes four arguments and 
	 * sets the value in the respective member variable.
	 * @param iMinLength The Minimum length the DataType can have.
	 * @param iMaxLength The Maximum length the DataType can have.
	 * @param iCLength The Conformance length the DataType can have.
	 * @param iComponentType The Type of the component i.e Component or a subcomponent.
	 * @throws InvalidComponentTypeException - if Component Type is not specified or valid. 
	 */ 
	public CF(int iMinLength, int iMaxLength, String strCLength,int iComponentType) throws InvalidComponentTypeException
	{
		super(EnumDataType.HL7_DT_CF);
		this.iMinLength = iMinLength;
		this.iMaxLength = iMaxLength;
		this.iConformanceLength = strCLength;
		this.iComponentType = iComponentType;
		if(!isValidComponentType())
		{
			throw new InvalidComponentTypeException(this.getClass().getSimpleName());
		}
	}


	/**
	 * Constructor for CF class which takes five arguments and 
	 * sets the value in the respective member variable.
	 * @param iMinLength The Minimum length the DataType can have.
	 * @param iMaxLength The Maximum length the DataType can have.
	 * @param iCLength The Conformance length the DataType can have.
	 * @param iTableNo The Table number to which the value for the component is specified. 
	 * @param iComponentType The Type of the component i.e Component or a subcomponent.
	 * @throws InvalidComponentTypeException - if Component Type is not specified or valid. 
	 */
	public CF(int iMinLength, int iMaxLength, String strCLength,int iTableNo,int iComponentType) throws InvalidComponentTypeException
	{
		super(EnumDataType.HL7_DT_CF);
		this.iMinLength = iMinLength;
		this.iMaxLength = iMaxLength;
		this.iConformanceLength = strCLength;
		this.iTableNo = iTableNo;
		this.iComponentType = iComponentType;
		if(!isValidComponentType())
		{
			throw new InvalidComponentTypeException(this.getClass().getSimpleName());		
		}
	}
	/**
	 * Constructor for CF class which takes two arguments and 
	 * sets the value in the respective member variable.
	 * @param objIDataTypeMap object of Data Type Map.
	 * @param iComponentType The Type of the component i.e Component or a subcomponent.
	 * @throws InvalidComponentTypeException - if Component Type is not specified or valid. 
	 */
	public CF(int iComponentType,IDataTypeMap objIDataTypeMap)
	{
		super(EnumDataType.HL7_DT_CF);
		this.objIDataTypeMap = objIDataTypeMap;
		this.iComponentType = iComponentType;
		if(!isValidComponentType())
		{
			throw new InvalidComponentTypeException(this.getClass().getSimpleName());
		}
	}
	/**
	 * Constructor for CF class which takes five arguments and 
	 * sets the value in the respective member variable.
	 * @param objIDataTypeMap object of Data Type Map.
	 * @param iComponentType The Type of the component i.e Component or a subcomponent.
	 * @param iMinLength The Minimum length the DataType can have.
	 * @param iMaxLength The Maximum length the DataType can have.
	 * @param iCLength The Conformance length the DataType can have.
	 * @throws InvalidComponentTypeException - if Component Type is not specified or valid. 
	 */
	public CF(int iComponentType,int iMinLength, int iMaxLength, String strCLength,IDataTypeMap objIDataTypeMap)
	{
		super(EnumDataType.HL7_DT_CF);
		this.objIDataTypeMap = objIDataTypeMap;
		this.iComponentType = iComponentType;
		this.iMinLength = iMinLength;
		this.iMaxLength = iMaxLength;
		this.iConformanceLength = strCLength;

		if(!isValidComponentType())
		{
			throw new InvalidComponentTypeException(this.getClass().getSimpleName());
		}
	}
	/**
	 * Constructor for CF class which takes six arguments and 
	 * sets the value in the respective member variable.
	 * @param objIDataTypeMap object of Data Type Map.
	 * @param iComponentType The Type of the component i.e Component or a subcomponent.
	 * @param iMinLength The Minimum length the DataType can have.
	 * @param iMaxLength The Maximum length the DataType can have.
	 * @param iCLength The Conformance length the DataType can have.
	 * @param iTableNo The Table number to which the value for the component is specified. 
	 * @throws InvalidComponentTypeException - if Component Type is not specified or valid. 
	 */
	public CF(int iComponentType,int iMinLength, int iMaxLength, String strCLength,int ITableNo,IDataTypeMap objIDataTypeMap)
	{
		super(EnumDataType.HL7_DT_CF);
		this.objIDataTypeMap = objIDataTypeMap;
		this.iComponentType = iComponentType;
		this.iTableNo = ITableNo;
		this.iMinLength = iMinLength;
		this.iMaxLength = iMaxLength;
		this.iConformanceLength = strCLength;

		if(!isValidComponentType())
		{
			throw new InvalidComponentTypeException(this.getClass().getSimpleName());
		}
	}



	/**
	 *Sets the Identifier
	 *@param strIdentifier Specifies Sequence of characters (the code) that uniquely identifies the item being
	 * 						  referenced by the CF-2.
	 */
	public void setIdentifier(String strIdentifier)
	{
		if(strIdentifier!=null)
			setComponentType(1, strIdentifier);
		else
			setIdentifier((ST)null);
	}


	/**
	 *Sets the Identifier
	 *@param objST Specifies Sequence of characters (the code) that uniquely identifies the item being
	 * 						  referenced by the CF-2.
	 */
	public void setIdentifier(ST objST)
	{
		setComponentType(1,objST);
	}

	/**
	 * Sets the Formatted Text.
	 * @param strFormattedText Specifies Name or description of the item in question with the addition of embedded 
	 * 							 formatting instructions.
	 */
	public void setFormattedText(String strFormattedText)
	{
		if(strFormattedText!=null)
			setComponentType(2, strFormattedText);
		else
			setFormattedText((FT)null);
	}

	/**
	 * Sets the Formatted Text.
	 * @param objFT Specifies Name or description of the item in question with the addition of embedded 
	 * 							 formatting instructions.
	 */
	public void setFormattedText(FT objFT)
	{
		setComponentType(2,objFT);
	}

	/**
	 *Sets the Name Of Coding System.
	 *@param strNameOfCodingSystem Specifies the name of the coding system employed. 
	 */
	public void setNameOfCodingSystem(String strNameOfCodingSystem)
	{
		if(strNameOfCodingSystem!=null)
			setComponentType(3, strNameOfCodingSystem);
		else
			setNameOfCodingSystem((ID)null);
	}

	/**
	 *Sets the Name Of Coding System.
	 *@param objID Specifies the name of the coding system employed.
	 */
	public void setNameOfCodingSystem(ID objID)
	{
		setComponentType(3,objID);
	}

	/**
	 *Sets the Alternate Identifier.
	 *@param strAlternateIdentifier Specifies a sequence of characters that uniquely identifies an alternate code. 
	 */
	public void setAlternateIdentifier(String strAlternateIdentifier)
	{
		if(strAlternateIdentifier!=null)
			setComponentType(4, strAlternateIdentifier);
		else
			setAlternateIdentifier((ST)null);
	}

	/**
	 *Sets the Alternate Identifier.
	 *@param objST Specifies a sequence of characters that uniquely identifies an alternate code.
	 */
	public void setAlternateIdentifier(ST objST)
	{
		setComponentType(4,objST);
	}

	/**
	 * Sets the Alternate Formatted Text.
	 * @param strAlternateFormattedText Specifies name or description of the alternate identifier in question with the
	 * 									   addition of embedded formatting instructions.
	 */
	public void setAlternateFormattedText(String strAlternateFormattedText)
	{
		if(strAlternateFormattedText!=null)
			setComponentType(5, strAlternateFormattedText);
		else
			setAlternateFormattedText((FT)null);
	}

	/**
	 * Sets the Alternate Formatted Text.
	 * @param objFT Specifies name or description of the alternate identifier in question with the
	 * 									   addition of embedded formatting instructions.
	 */
	public void setAlternateFormattedText(FT objFT)
	{
		setComponentType(5,objFT);
	}
	
	/**
	 *Sets the Name Of Alternate Coding System.
	 *@param strNameOfAlternateCodingSystem Specifies the name of the coding system employed for the alternate identifier. 
	 */
	public void setNameOfAlternateCodingSystem(String strNameOfAlternateCodingSystem)
	{
		if(strNameOfAlternateCodingSystem!=null)
			setComponentType(6, strNameOfAlternateCodingSystem);
		else
			setNameOfAlternateCodingSystem((ID)null);
	}

	/**
	 *Sets the Name Of Alternate Coding System.
	 *@param objID Specifies the name of the coding system employed for the alternate identifier.
	 */
	public void setNameOfAlternateCodingSystem(ID objID)
	{
		setComponentType(6,objID);
	}
	/**
	 *Sets the Coding System Version ID.
	 *@param strCodingSystemVersionID carries the version for the coding system identified by components 1-3.
	 */
	public void setCodingSystemVersionID(String strCodingSystemVersionID)
	{
		if(strCodingSystemVersionID!=null)
			setComponentType(7, strCodingSystemVersionID);
		else
			setIdentifier((ST)null);
	}


	/**
	 *Sets the Alternate Coding System Version ID.
	 *@param objST carries the version for the coding system identified by components 1-3.
	 */
	public void setCodingSystemVersionID(ST objST)
	{
		setComponentType(7,objST);
	}
	
	/**
	 *Sets the Alternate Coding System Version ID.
	 *@param strAlternate Coding System Version ID carries the version for the coding system identified by components 4-6.
	 */
	public void setAlternateCodingSystemVersionID(String strAlternateCodingSystemVersionID)
	{
		if(strAlternateCodingSystemVersionID!=null)
			setComponentType(8, strAlternateCodingSystemVersionID);
		else
			setIdentifier((ST)null);
	}


	/**
	 *Sets the Alternate Coding SystemVersion ID.
	 *@param objST carries version for the coding system identified by components 4-6.
	 */
	public void setAlternateCodingSystemVersionID(ST objST)
	{
		setComponentType(8,objST);
	}

	/**
	 *Sets the Original Text.
	 *@param strOriginalText specifies the text as seen and/or selected by the user who entered the data.
	 */
	public void setOriginalText(String strOriginalText)
	{
		if(strOriginalText!=null)
			setComponentType(9, strOriginalText);
		else
			setIdentifier((ST)null);
	}


	/**
	 *Sets the Original Text.
	 *@param objST specifies the text as seen and/or selected by the user who entered the data.
	 */
	public void setOriginalText(ST objST)
	{
		setComponentType(9,objST);
	}
	
	/**
	 *Sets the Second Alternate Identifier.
	 *@param strSecondAlternateIdentifier specifies the sequence of characters that uniquely identifies an alternate code.
	 */
	public void setSecondAlternateIdentifier(String strSecondAlternateIdentifier)
	{
		if(strSecondAlternateIdentifier!=null)
			setComponentType(10, strSecondAlternateIdentifier);
		else
			setIdentifier((ST)null);
	}


	/**
	 *Sets the Second Alternate Identifier.
	 *@param objST the sequence of characters that uniquely identifies an alternate code.
	 */
	public void setSecondAlternateIdentifier(ST objST)
	{
		setComponentType(10,objST);
	}
	
	/**
	 *Sets the Second Alternate Formatted Text.
	 *@param strSecondAlternateFormattedText Specifies the descriptive or textual name of the Second Alternate Identifier.
	 */
	public void setSecondAlternateFormattedText(String strSecondAlternateFormattedText)
	{
		if(strSecondAlternateFormattedText!=null)
			setComponentType(11, strSecondAlternateFormattedText);
		else
			setSecondAlternateFormattedText((FT)null);
	}

	/**
	 *Sets the Second Alternate Formatted Text.
	 *@param objFT Specifies the descriptive or textual name of the Second Alternate Identifier.
	 */
	public void setSecondAlternateFormattedText(FT objFT)
	{
		setComponentType(11,objFT);
	}
	
	/**
	 *Sets the  Name of Second Alternate Coding System.
	 *@param strNameofSecondAlternateCodingSystem Identifies the coding scheme being used in the Second Alternate Identifier component.
	 */
	public void setNameofSecondAlternateCodingSystem(String strNameofSecondAlternateCodingSystem)
	{
		if(strNameofSecondAlternateCodingSystem!=null)
			setComponentType(12, strNameofSecondAlternateCodingSystem);
		else
			setNameofSecondAlternateCodingSystem((ID)null);
	}

	/**
	 *Sets the Name of Second Alternate Coding System.
	 *@param objID  Identifies the coding scheme being used in the Second Alternate Identifier component.
	 */
	public void setNameofSecondAlternateCodingSystem(ID objID)
	{
		setComponentType(12,objID);
	}
	
	/**
	 *Sets the Second Alternate Coding System Version ID.
	 *@param strSecondAlternateFormattedText carries the version for the coding system identified by components 10-12.
	 */
	public void setSecondAlternateCodingSystemVersionID(String strSecondAlternateCodingSystemVersionID)
	{
		if(strSecondAlternateCodingSystemVersionID!=null)
			setComponentType(13, strSecondAlternateCodingSystemVersionID);
		else
			setSecondAlternateCodingSystemVersionID((ST)null);
	}

	/**
	 *Sets the Second Alternate Coding System Version ID.
	 *@param objST carries the version for the coding system identified by components 10-12.
	 */
	public void setSecondAlternateCodingSystemVersionID(ST objST)
	{
		setComponentType(13,objST);
	}
	
	/**
	 *Sets the Coding System OID .
	 *@param strSCoding System OID contains the ISO Object Identifier (OID) for the coding system.
	 */
	public void setCodingSystemOID(String strCodingSystemOID)
	{
		if(strCodingSystemOID!=null)
			setComponentType(14, strCodingSystemOID);
		else
			setCodingSystemOID((ST)null);
	}
	/**
	 *Sets the Coding System OID.
	 *@param objST contains the ISO Object Identifier (OID) for the coding system.
	 */
	public void setCodingSystemOID (ST objST)
	{
		setComponentType(14,objST);
	}
	
	/**
	 *Sets the Value Set OID .
	 *@param strValueSetOID contains the ISO Object Identifier (OID) to allow identification of the value set.
	 */
	public void setValueSetOID (String strValueSetOID )
	{
		if(strValueSetOID !=null)
			setComponentType(15, strValueSetOID );
		else
			setValueSetOID ((ST)null);
	}
	/**
	 *Sets the Value Set OID.
	 *@param objST contains the ISO Object Identifier (OID) to allow identification of the value set.
	 */
	public void setValueSetOID (ST objST)
	{
		setComponentType(15,objST);
	}
	
	/**
	 *Sets the Value Set Version ID .
	 *@param strValueSetVersionID carries the version for the value set.
	 */
	public void setValueSetVersionID (String strValueSetVersionID )
	{
		if(strValueSetVersionID !=null)
			setComponentType(16, strValueSetVersionID );
		else
			setValueSetVersionID ((DTM)null);
	}
	/**
	 *Sets the Value Set Version ID.
	 *@param objDTM carries the version for the value set.
	 */
	public void setValueSetVersionID (DTM objDTM)
	{
		setComponentType(16,objDTM);
	}
	
	/**
	 *Sets the Alternate Coding System OID .
	 *@param strAlternateCodingSystemOID contains the ISO Object Identifier (OID) for the coding system.
	 */
	public void setAlternateCodingSystemOID (String strAlternateCodingSystemOID)
	{
		if(strAlternateCodingSystemOID !=null)
			setComponentType(17, strAlternateCodingSystemOID );
		else
			setValueSetOID ((ST)null);
	}
	/**
	 *Sets the Alternate Coding System OID.
	 *@param objST contains the ISO Object Identifier (OID) for the coding system.
	 */
	public void setAlternateCodingSystemOID (ST objST)
	{
		setComponentType(17,objST);
	}
	
	/**
	 *Sets the Alternate Value Set OID .
	 *@param strAlternateValueSetOID contains the ISO Object Identifier (OID) to allow identification of the value set.
	 */
	public void setAlternateValueSetOID (String strAlternateValueSetOID)
	{
		if(strAlternateValueSetOID !=null)
			setComponentType(18, strAlternateValueSetOID);
		else
			setAlternateValueSetOID ((ST)null);
	}
	/**
	 *Sets the Alternate Value Set OID.
	 *@param objST contains the ISO Object Identifier (OID) to allow identification of the value set.
	 */
	public void setAlternateValueSetOID (ST objST)
	{
		setComponentType(18,objST);
	}
	
	/**
	 *Sets the Alternate Value Set Version ID .
	 *@param strAlternateValueSetVersionID carries the version for the value set.
	 */
	public void setAlternateValueSetVersionID (String strAlternateValueSetVersionID )
	{
		if(strAlternateValueSetVersionID  !=null)
			setComponentType(19, strAlternateValueSetVersionID );
		else
			setValueSetVersionID ((DTM)null);
	}
	/**
	 *Sets the Alternate Value Set Version ID.
	 *@param objDTM carries the version for the value set.
	 */
	public void setAlternateValueSetVersionID  (DTM objDTM)
	{
		setComponentType(19,objDTM);
	}
	
	/**
	 *Sets the Second Alternate Coding System OID.
	 *@param strSecondAlternateCodingSystemOID contains the ISO Object Identifier (OID) for the coding system.
	 */
	public void setSecondAlternateCodingSystemOID (String strSecondAlternateCodingSystemOID)
	{
		if(strSecondAlternateCodingSystemOID !=null)
			setComponentType(20, strSecondAlternateCodingSystemOID);
		else
			setSecondAlternateCodingSystemOID ((ST)null);
	}
	/**
	 *Sets the Second Alternate Coding System OID.
	 *@param objST contains the ISO Object Identifier (OID) for the coding system.
	 */
	public void setSecondAlternateCodingSystemOID (ST objST)
	{
		setComponentType(20,objST);
	}
	
	/**
	 *Sets the Second Alternate Value Set OID.
	 *@param strSecondAlternateValueSetOID contains the ISO Object Identifier (OID) to allow identification of the value set.
	 */
	public void setSecondAlternateValueSetOID(String strSecondAlternateValueSetOID)
	{
		if(strSecondAlternateValueSetOID !=null)
			setComponentType(21, strSecondAlternateValueSetOID);
		else
			setSecondAlternateValueSetOID ((ST)null);
	}
	/**
	 *Sets the Second Alternate Value Set OID.
	 *@param objST contains the ISO Object Identifier (OID) to allow identification of the value set.
	 */
	public void setSecondAlternateValueSetOID (ST objST)
	{
		setComponentType(21,objST);
	}
	
	/**
	 *Sets the Second Alternate Value Set Version ID .
	 *@param strSecondAlternateValueSetVersionID carries the version for the value set.
	 */
	public void setSecondAlternateValueSetVersionID(String strSecondAlternateValueSetVersionID)
	{
		if(strSecondAlternateValueSetVersionID  !=null)
			setComponentType(22, strSecondAlternateValueSetVersionID );
		else
			setSecondAlternateValueSetVersionID ((DTM)null);
	}
	/**
	 *Sets the Second Alternate Value Set Version ID.
	 *@param objDTM carries the version for the value set.
	 */
	public void setSecondAlternateValueSetVersionID (DTM objDTM)
	{
		setComponentType(22,objDTM);
	}
	
	
	/**
	 * Returns Identifier.
	 * @return ST - data type.
	 */
	public ST getIdentifier()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(1);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Returns Formatted Text.
	 * @return FT - data type.
	 */
	public FT getFormattedText()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(2);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (FT)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Returns Name Of Coding System.
	 * @return ID - data type.
	 */
	public ID getNameOfCodingSystem()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(3);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Returns Alternate Identifier.
	 * @return ST - data type.
	 */
	public ST getAlternateIdentifier()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(4);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Returns Alternate Formatted Text.
	 * @return FT - data type.
	 */
	public FT getAlternateFormattedText()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(5);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (FT)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Returns Name Of Alternate Coding System.
	 * @return ID - data type.
	 */
	public ID getNameOfAlternateCodingSystem()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(6);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Returns Coding System Version ID.
	 * @return ST - data type.
	 */
	public ST getCodingSystemVersionID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(7);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Returns Alternate Coding System Version ID.
	 * @return ST - data type.
	 */
	public ST getAlternateCodingSystemVersionID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(8);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Returns Original Text.
	 * @return ST - data type.
	 */
	public ST getOriginalText()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(9);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Returns Second Alternate Identifier .
	 * @return ST - data type.
	 */
	public ST getSecondAlternateIdentifier ()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(10);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Returns Second Alternate Formatted Text.
	 * @return FT - data type.
	 */
	public FT getSecondAlternateFormattedText()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(11);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (FT)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Returns Name of Second Alternate Coding System.
	 * @return ID - data type.
	 */
	public ID getNameofSecondAlternateCodingSystem()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(12);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Returns Second Alternate Coding System Version ID.
	 * @return ST - data type.
	 */
	public ST getSecondAlternateCodingSystemVersionID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(13);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Returns Coding System OID.
	 * @return ST - data type.
	 */
	public ST getCodingSystemOID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(14);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Returns Value Set OID.
	 * @return ST - data type.
	 */
	public ST getValueSetOID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(15);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Returns Value Set Version ID.
	 * @return DTM - data type.
	 */
	public DTM getValueSetVersionID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(16);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DTM)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Returns Alternate Coding System OID.
	 * @return ST - data type.
	 */
	public ST getAlternateCodingSystemOID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(17);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Returns Alternate Value Set OID.
	 * @return ST - data type.
	 */
	public ST getAlternateValueSetOID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(18);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Returns Alternate Value Set Version ID.
	 * @return DTM - data type.
	 */
	public DTM getAlternateValueSetVersionID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(19);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DTM)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Returns Second Alternate Coding System OID.
	 * @return ST - data type.
	 */
	public ST getSecondAlternateCodingSystemOID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(20);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Returns Second Alternate Value Set OID.
	 * @return ST - data type.
	 */
	public ST getSecondAlternateValueSetOID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(21);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Returns Second Alternate Value Set Version ID.
	 * @return DTM - data type.
	 */
	public DTM getSecondAlternateValueSetVersionID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(22);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DTM)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	/**
	 * This method checks the equality of Object.
	 * @param objObject object of Object class.
	 * @return boolean - shows success or failure of the comparison.
	 */
	public boolean equals(Object objObject)
	{
		if((objObject == null ) || (!(objObject instanceof CF)))
			return false;

		if(this.getIdentifier() == null)
		{
			if(((CF)objObject).getIdentifier() != null)
				return false;
		}
		else if(false == (this.getIdentifier().equals(((CF)objObject).getIdentifier())))
			return false;

		if(this.getFormattedText() == null)
		{
			if(((CF)objObject).getFormattedText() != null)
				return false;
		}
		else if(false == (this.getFormattedText().equals(((CF)objObject).getFormattedText())))
			return false;

		if(this.getNameOfCodingSystem() == null)
		{
			if(((CF)objObject).getNameOfCodingSystem() != null)
				return false;
		}
		else if(false == (this.getNameOfCodingSystem().equals(((CF)objObject).getNameOfCodingSystem())))
			return false;

		if(this.getAlternateIdentifier() == null)
		{
			if(((CF)objObject).getAlternateIdentifier() != null)
				return false;
		}
		else if(false == (this.getAlternateIdentifier().equals(((CF)objObject).getAlternateIdentifier())))
			return false;

		if(this.getAlternateFormattedText() == null)
		{
			if(((CF)objObject).getAlternateFormattedText() != null)
				return false;
		}
		else if(false == (this.getAlternateFormattedText().equals(((CF)objObject).getAlternateFormattedText())))
			return false;

		if(this.getNameOfAlternateCodingSystem() == null)
		{
			if(((CF)objObject).getNameOfAlternateCodingSystem() != null)
				return false;
		}
		else if(false == (this.getNameOfAlternateCodingSystem().equals(((CF)objObject).getNameOfAlternateCodingSystem())))
			return false;
		
		if(this.getCodingSystemVersionID() == null)
		{
			if(((CF)objObject).getCodingSystemVersionID() != null)
				return false;
		}
		else if(false == (this.getCodingSystemVersionID().equals(((CF)objObject).getCodingSystemVersionID())))
			return false;
		
		if(this.getAlternateCodingSystemVersionID() == null)
		{
			if(((CF)objObject).getAlternateCodingSystemVersionID() != null)
				return false;
		}
		else if(false == (this.getAlternateCodingSystemVersionID().equals(((CF)objObject).getAlternateCodingSystemVersionID())))
			return false;
		
		if(this.getOriginalText() == null)
		{
			if(((CF)objObject).getOriginalText() != null)
				return false;
		}
		else if(false == (this.getOriginalText().equals(((CF)objObject).getOriginalText())))
			return false;
		
		if(this.getSecondAlternateIdentifier() == null)
		{
			if(((CF)objObject).getSecondAlternateIdentifier() != null)
				return false;
		}
		else if(false == (this.getSecondAlternateIdentifier().equals(((CF)objObject).getSecondAlternateIdentifier())))
			return false;
		
		if(this.getSecondAlternateFormattedText() == null)
		{
			if(((CF)objObject).getSecondAlternateFormattedText() != null)
				return false;
		}
		else if(false == (this.getSecondAlternateFormattedText().equals(((CF)objObject).getSecondAlternateFormattedText())))
			return false;
		
		if(this.getNameofSecondAlternateCodingSystem() == null)
		{
			if(((CF)objObject).getNameofSecondAlternateCodingSystem() != null)
				return false;
		}
		else if(false == (this.getNameofSecondAlternateCodingSystem().equals(((CF)objObject).getNameofSecondAlternateCodingSystem())))
			return false;
		
		if(this.getSecondAlternateCodingSystemVersionID() == null)
		{
			if(((CF)objObject).getSecondAlternateCodingSystemVersionID() != null)
				return false;
		}
		else if(false == (this.getSecondAlternateCodingSystemVersionID().equals(((CF)objObject).getSecondAlternateCodingSystemVersionID())))
			return false;
		
		if(this.getCodingSystemOID() == null)
		{
			if(((CF)objObject).getCodingSystemOID() != null)
				return false;
		}
		else if(false == (this.getCodingSystemOID().equals(((CF)objObject).getCodingSystemOID())))
			return false;
		
		if(this.getValueSetOID() == null)
		{
			if(((CF)objObject).getValueSetOID() != null)
				return false;
		}
		else if(false == (this.getValueSetOID().equals(((CF)objObject).getValueSetOID())))
			return false;
		
		if(this.getValueSetVersionID() == null)
		{
			if(((CF)objObject).getValueSetVersionID()!= null)
				return false;
		}
		else if(false == (this.getValueSetVersionID().equals(((CF)objObject).getValueSetVersionID())))
			return false;
		
		if(this.getAlternateCodingSystemOID() == null)
		{
			if(((CF)objObject).getAlternateCodingSystemOID()!= null)
				return false;
		}
		else if(false == (this.getAlternateCodingSystemOID().equals(((CF)objObject).getAlternateCodingSystemOID())))
			return false;

		if(this.getAlternateValueSetOID() == null)
		{
			if(((CF)objObject).getAlternateValueSetOID()!= null)
				return false;
		}
		else if(false == (this.getAlternateValueSetOID().equals(((CF)objObject).getAlternateValueSetOID())))
			return false;
		
		if(this.getAlternateValueSetVersionID() == null)
		{
			if(((CF)objObject).getAlternateValueSetVersionID()!= null)
				return false;
		}
		else if(false == (this.getAlternateValueSetVersionID().equals(((CF)objObject).getAlternateValueSetVersionID())))
			return false;
		
		if(this.getSecondAlternateCodingSystemOID() == null)
		{
			if(((CF)objObject).getSecondAlternateCodingSystemOID()!= null)
				return false;
		}
		else if(false == (this.getSecondAlternateCodingSystemOID().equals(((CF)objObject).getSecondAlternateCodingSystemOID())))
			return false;
		
		if(this.getSecondAlternateValueSetOID() == null)
		{
			if(((CF)objObject).getSecondAlternateValueSetOID()!= null)
				return false;
		}
		else if(false == (this.getSecondAlternateValueSetOID().equals(((CF)objObject).getSecondAlternateValueSetOID())))
			return false;
		
		if(this.getSecondAlternateValueSetVersionID() == null)
		{
			if(((CF)objObject).getSecondAlternateValueSetVersionID()!= null)
				return false;
		}
		else if(false == (this.getSecondAlternateValueSetVersionID().equals(((CF)objObject).getSecondAlternateValueSetVersionID())))
			return false;
		
		return true;
	}
}
