/*******************************************************************************
 *  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.exceptions.InvalidDataTypeException;
import cdac.medinfo.sdk.hl7282.exceptions.InvalidValueException;
import cdac.medinfo.sdk.hl7282.exceptions.MissingValueException;
import cdac.medinfo.sdk.hl7282.utils.EnumDataType;
import cdac.medinfo.sdk.hl7282.utils.IDataTypeMap;

/**
 * CSU - Channel Sensitivity<p>
 * This data type defines the channel sensitivity (gain) and the units in which it is measured in a waveform result.
 * <p>Represents an HL7 CSU data type. 
 * This data type has the following attributes:</p><p>
 *  1.  Channel Sensitivity (NM)<b>Required</b><br>
 *  2. Unit of Measure Identifier (ST)<b>Conditional</b><br>
 *  3. Unit of Measure Description (ST)<b>Conditional</b><br>
 *  4. Unit of Measure Coding System (ID)<b>Conditional</b><br>
 *  5. Alternate Unit of Measure Identifier (ST)<b>Optional</b><br>
 *  6. Alternate Unit of Measure Description (ST)<b>Optional</b><br>
 *  7. Alternate Unit of Measure Coding System (ID)<b>Conditional</b><br><p>
 *  8. Unit of Measure Coding System Version ID (ST)<b>Conditional</b><br><p>
 *  9. Alternate Unit of Measure Coding System Version ID (ST)<b>Optional</b><br><p>
 *  10. Original Text (ST)<b>Optional</b><br><p>
 *  11. Second Alternate Unit of Measure Identifier (ST)<b>Optional</b><br><p>
 *  12. Second Alternate Unit of Measure Text (ST)<b>Optional</b><br><p>
 *  13. Name of Second Alternate Unit of Measure Coding System (ID)<b>Optional</b><br><p>
 *  14. Second Alternate Unit of Measure Coding System Version ID (ST)<b>Conditional</b><br><p>
 *  15. Unit of Measure Coding System OID  (ST)<b>Conditional</b><br><p>
 *  16. Unit of Measure Value Set OID (ST)<b>Optional</b><br><p>
 *  17. Unit of Measure Value Set Version ID (DTM)<b>Conditional</b><br><p>
 *  18. Alternate Unit of Measure Coding System (ST)<b>Conditional</b><br><p>
 *  19. Alternate Unit of Measure Value Set OID (ST)<b>Optional</b><br><p>
 *  20. Alternate Unit of Measure Value Set Version ID (DTM)<b>Conditional</b><br><p>
 *  21. Alternate Unit of Measure Coding System OID (ST)<b>COnditional</b><br><p>
 *  22. Alternate Unit of Measure Value Set OID (ST)<b>Optional</b><br><p>
 *  23. Alternate Unit of Measure Value Set Version ID (ST)<b>Conditiobnal</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 CSU extends CompositeDataType    
{
	


	/**
	 * Default Constructor for CSU
	 */
	public CSU()
	{
		super(EnumDataType.HL7_DT_CSU);
		 
	}

	/**
	 * Constructor  for CSU 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 CSU(int iMinLength, int iMaxLength, String strCLength,int iComponentType) throws InvalidComponentTypeException
	{
		super(EnumDataType.HL7_DT_CSU);
		this.iMinLength = iMinLength;
		this.iMaxLength = iMaxLength;
		this.iConformanceLength = strCLength;
		this.iComponentType = iComponentType;
		if(!isValidComponentType())
		{
			throw new InvalidComponentTypeException(this.getClass().getSimpleName());
		}
	}


	/**
	 * Constructor for CSU 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 CSU(int iMinLength, int iMaxLength, String strCLength,int iTableNo,int iComponentType) throws InvalidComponentTypeException
	{
		super(EnumDataType.HL7_DT_CSU);
		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 CSU 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 CSU(int iComponentType,IDataTypeMap objIDataTypeMap)
	{
		super(EnumDataType.HL7_DT_CSU);
		this.objIDataTypeMap = objIDataTypeMap;
		this.iComponentType = iComponentType;
		if(!isValidComponentType())
		{
			throw new InvalidComponentTypeException(this.getClass().getSimpleName());
		}
	}
	/**
	 * Constructor for CSU 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 CSU(int iComponentType,int iMinLength, int iMaxLength, String strCLength,IDataTypeMap objIDataTypeMap)
	{
		super(EnumDataType.HL7_DT_CSU);
		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 CSU 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 CSU(int iComponentType,int iMinLength, int iMaxLength, String strCLength,int ITableNo,IDataTypeMap objIDataTypeMap)
	{
		super(EnumDataType.HL7_DT_CSU);
		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 Channel Sensitivity.
	 *@param strChannelSensitivity Specifies the nominal value that corresponds to one unit in the waveform data 
	 */
	public void setChannelSensitivity(String strChannelSensitivity)
	{
		if(strChannelSensitivity!=null)
			setComponentType(1, strChannelSensitivity);
		else
			setChannelSensitivity((NM)null);
	}

	/**
	 *Sets the Channel Sensitivity.
	 *@param objNM Specifies the nominal value that corresponds to one unit in the waveform data
	 */
	public void setChannelSensitivity(NM objNM)
	{
		setComponentType(1,objNM);
	}

	/**
	 *sets the Unit Of Measure Identifier.
	 *@param strUnitOfMeasureIdentifier Specifies unit designation for the channel sensitivity. 
	 */
	public void setUnitOfMeasureIdentifier(String strUnitOfMeasureIdentifier)
	{
		if(strUnitOfMeasureIdentifier!=null)
			setComponentType(2, strUnitOfMeasureIdentifier);
		else
			setUnitOfMeasureIdentifier((ST)null);
	}

	/**
	 *sets the Unit Of Measure Identifier.
	 *@param objST Specifies unit designation for the channel sensitivity.
	 */
	public void setUnitOfMeasureIdentifier(ST objST)
	{
		setComponentType(2,objST);
	}

	/**
	 *Sets the Unit Of Measure Description.
	 *@param strUnitOfMeasureDescription Specifies full text name of the unit of measure identifier. 
	 */
	public void setUnitOfMeasureDescription(String strUnitOfMeasureDescription)
	{
		if(strUnitOfMeasureDescription!=null)
			setComponentType(3, strUnitOfMeasureDescription);
		else
			setUnitOfMeasureDescription((ST)null);
	}

	/**
	 *Sets the Unit Of Measure Description.
	 *@param objST Specifies full text name of the unit of measure identifier.
	 */
	public void setUnitOfMeasureDescription(ST objST)
	{
		setComponentType(3,objST);
	}

	/**
	 *Sets the Unit Of Measure Coding System.
	 *@param strUnitOfMeasureCodingSystem Specifies the designated system of units. 
	 */
	public void setUnitOfMeasureCodingSystem(String strUnitOfMeasureCodingSystem)
	{
		if(strUnitOfMeasureCodingSystem!=null)
			setComponentType(4, strUnitOfMeasureCodingSystem);
		else
			setUnitOfMeasureCodingSystem((ID)null);
	}

	/**
	 *Sets the Unit Of Measure Coding System.
	 *@param objID Specifies the designated system of units.
	 */
	public void setUnitOfMeasureCodingSystem(ID objID)
	{
		setComponentType(4,objID);
	}

	/**
	 *Sets the Alternate Unit Of Measure Identifier.
	 *@param strAlternateUnitOfMeasureIdentifier Specifies an alternate units designation for the channel sensitivity. 
	 */
	public void setAlternateUnitOfMeasureIdentifier(String strAlternateUnitOfMeasureIdentifier)
	{
		if(strAlternateUnitOfMeasureIdentifier!=null)
			setComponentType(5, strAlternateUnitOfMeasureIdentifier);
		else
			setAlternateUnitOfMeasureIdentifier((ST)null);
	}

	/**
	 *Sets the Alternate Unit Of Measure Identifier.
	 *@param objST Specifies an alternate units designation for the channel sensitivity.
	 */
	public void setAlternateUnitOfMeasureIdentifier(ST objST)
	{
		setComponentType(5,objST);
	}

	/**
	 *Sets the Alternate Unit Of Measure Description.
	 *@param strAlternateUnitOfMeasureDescription Specifies full text name of the alternate unit of measure identifier 
	 */
	public void setAlternateUnitOfMeasureDescription(String strAlternateUnitOfMeasureDescription)
	{
		if(strAlternateUnitOfMeasureDescription!=null)
			setComponentType(6, strAlternateUnitOfMeasureDescription);
		else
			setAlternateUnitOfMeasureDescription((ST)null);
	}

	/**
	 *Sets the Alternate Unit Of Measure Description.
	 *@param objST Specifies full text name of the alternate unit of measure identifier
	 */
	public void setAlternateUnitOfMeasureDescription(ST objST)
	{
		setComponentType(6,objST);
	}

	/**
	 *Sets the Alternate Unit Of Measure Coding System.
	 *@param strAlternateUnitOfMeasureCodingSystem Specifies the coding system for the alternate unit of measure. 
	 */
	public void setAlternateUnitOfMeasureCodingSystem(String strAlternateUnitOfMeasureCodingSystem)
	{
		if(strAlternateUnitOfMeasureCodingSystem!=null)
			setComponentType(7, strAlternateUnitOfMeasureCodingSystem);
		else
			setAlternateUnitOfMeasureCodingSystem((ID)null);
	}

	/**
	 *Sets the Alternate Unit Of Measure Coding System.
	 *@param objString Specifies the coding system for the alternate unit of measure.
	 */
	public void setAlternateUnitOfMeasureCodingSystem(ID objID)
	{
		setComponentType(7,objID);
	}
	
	/**
	 *Sets the Unit of Measure Coding System Version ID.
	 *@param strUnitofMeasureCodinSystemVersionID Specifies the version of the coding system identified by components 2-4. 
	 */
	public void setUnitofMeasureCodinSystemVersionID(String strUnitofMeasureCodinSystemVersionID)
	{
		if(strUnitofMeasureCodinSystemVersionID!=null)
			setComponentType(8, strUnitofMeasureCodinSystemVersionID);
		else
			setUnitofMeasureCodinSystemVersionID((ST)null);
	}

	/**
	 *Sets the Unit of Measure Coding System Version ID.
	 *@param objST Specifies the version of the coding system identified by components 2-4. 
	 */
	public void setUnitofMeasureCodinSystemVersionID(ST objST)
	{
		setComponentType(8,objST);
	}
	
	/**
	 *Sets the Alternate Unit of Measure Coding System Version ID.
	 *@param strAlternateUnitofMeasureCodingSystemVersionID Specifies version for the coding system identified by components 5-7. 
	 */
	public void setAlternateUnitofMeasureCodingSystemVersionID(String strAlternateUnitofMeasureCodingSystemVersionID)
	{
		if(strAlternateUnitofMeasureCodingSystemVersionID!=null)
			setComponentType(9, strAlternateUnitofMeasureCodingSystemVersionID);
		else
			setAlternateUnitofMeasureCodingSystemVersionID((ST)null);
	}

	/**
	 *Sets the Alternate Unit of Measure Coding System Version ID.
	 *@param objST Specifies version for the coding system identified by components 5-7.
	 */
	public void setAlternateUnitofMeasureCodingSystemVersionID(ST objST)
	{
		setComponentType(9,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(10, strOriginalText);
		else
			setOriginalText((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(10,objST);
	}
	
	/**
	 *Sets the Second Alternate Unit of Measure Identifier.
	 *@param strSecondAlternateUnitofMeasureIdentifier Specifies A sequence of characters that uniquely identifies a  second alternate units designation for the channel sensitivity. 
	 */
	public void setSecondAlternateUnitofMeasureIdentifier(String strSecondAlternateUnitofMeasureIdentifier)
	{
		if(strSecondAlternateUnitofMeasureIdentifier!=null)
			setComponentType(11, strSecondAlternateUnitofMeasureIdentifier);
		else
			setSecondAlternateUnitofMeasureIdentifier((ST)null);
	}

	/**
	 *Sets the Second Alternate Unit of Measure Identifier.
	 *@param objST Specifies A sequence of characters that uniquely identifies a  second alternate units designation for the channel sensitivity.
	 */
	public void setSecondAlternateUnitofMeasureIdentifier(ST objST)
	{
		setComponentType(11,objST);
	}
	
	/**
	 *Sets the Second Alternate Unit of Measure Text.
	 *@param strSecondAlternateUnitofMeasureText Specifies the descriptive or textual name of the second alternate identifier. 
	 */
	public void setSecondAlternateUnitofMeasureText(String strSecondAlternateUnitofMeasureText)
	{
		if(strSecondAlternateUnitofMeasureText!=null)
			setComponentType(12, strSecondAlternateUnitofMeasureText);
		else
			setSecondAlternateUnitofMeasureText((ST)null);
	}

	/**
	 *Sets the Second Alternate Unit of Measure Text.
	 *@param objST Specifies the descriptive or textual name of the second alternate identifier.
	 */
	public void setSecondAlternateUnitofMeasureText(ST objST)
	{
		setComponentType(12,objST);
	}
	
	/**
	 *Sets the  Name of Second Alternate Unit of Measure Coding System.
	 *@param strNameofSecondAlternateUnitofMeasureCodingSystem Specifies the coding system for the second alternate unit of measure. 
	 */
	public void setNameofSecondAlternateUnitofMeasureCodingSystem(String strNameofSecondAlternateUnitofMeasureCodingSystem)
	{
		if(strNameofSecondAlternateUnitofMeasureCodingSystem!=null)
			setComponentType(13, strNameofSecondAlternateUnitofMeasureCodingSystem);
		else
			setNameofSecondAlternateUnitofMeasureCodingSystem((ID)null);
	}

	/**
	 *Sets the  Name of Second Alternate Unit of Measure Coding System.
	 *@param objID Specifies the coding system for the second alternate unit of measure.
	 */
	public void setNameofSecondAlternateUnitofMeasureCodingSystem(ID objID)
	{
		setComponentType(13,objID);
	}
	
	/**
	 *Sets the Second Alternate Unit of Measure Coding System Version ID.
	 *@param strSecondAlternateUnitofMeasureCodingSystemVersionID carries the version for the coding system identified by components 11-13.
	 */
	public void setSecondAlternateUnitofMeasureCodingSystemVersionID(String strSecondAlternateUnitofMeasureCodingSystemVersionID)
	{
		if(strSecondAlternateUnitofMeasureCodingSystemVersionID!=null)
			setComponentType(14, strSecondAlternateUnitofMeasureCodingSystemVersionID);
		else
			setSecondAlternateUnitofMeasureCodingSystemVersionID((ST)null);
	}

	/**
	 *Sets the Second Alternate Unit of Measure Coding System Version ID.
	 *@param objST carries the version for the coding system identified by components 11-13.
	 */
	public void setSecondAlternateUnitofMeasureCodingSystemVersionID(ST objST)
	{
		setComponentType(14,objST);
	}
	
	/**
	 *Sets the Unit of Measure Coding System OID.
	 *@param strUnitofMeasureCodingSystemOID contains the ISO Object Identifier (OID) for the coding system. 
	 */
	public void setUnitofMeasureCodingSystemOID(String strUnitofMeasureCodingSystemOID)
	{
		if(strUnitofMeasureCodingSystemOID!=null)
			setComponentType(15, strUnitofMeasureCodingSystemOID);
		else
			setUnitofMeasureCodingSystemOID((ST)null);
	}

	/**
	 *Sets the Unit of Measure Coding System OID.
	 *@param objST contains the ISO Object Identifier (OID) for the coding system.
	 */
	public void setUnitofMeasureCodingSystemOID(ST objST)
	{
		setComponentType(15,objST);
	}
	
	/**
	 *Sets the Unit of Measure Value Set OID.
	 *@param strUnitofMeasureValueSetOID contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CSU.2 is obtained. 
	 */
	public void setUnitofMeasureValueSetOID(String strUnitofMeasureValueSetOID)
	{
		if(strUnitofMeasureValueSetOID!=null)
			setComponentType(16, strUnitofMeasureValueSetOID);
		else
			setUnitofMeasureValueSetOID((ST)null);
	}

	/**
	 *Sets the Unit of Measure Value Set OID.
	 *@param objST contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CSU.2 is obtained.
	 */
	public void setUnitofMeasureValueSetOID(ST objST)
	{
		setComponentType(16,objST);
	}
	
	/**
	 *Sets the Unit of Measure Value Set Version ID.
	 *@param strUnitofMeasureValueSetVersionID carries the version for the value set identified by CSU.16 and it is a date. 
	 */
	public void setUnitofMeasureValueSetVersionID(String strUnitofMeasureValueSetVersionID)
	{
		if(strUnitofMeasureValueSetVersionID!=null)
			setComponentType(17, strUnitofMeasureValueSetVersionID);
		else
			setUnitofMeasureValueSetVersionID((DTM)null);
	}

	/**
	 *Sets the Unit of Measure Value Set Version ID.
	 *@param objDTM carries the version for the value set identified by CSU.16 and it is a date. 
	 */
	public void setUnitofMeasureValueSetVersionID(DTM objDTM)
	{
		setComponentType(17,objDTM);
	}
	
	/**
	 *Sets the Alternate Unit of Measure Coding System OID.
	 *@param strAlternateUnitofMeasureCodingSystemOID contains the ISO Object Identifier (OID) for the coding system or value set named in CSU.7 
	 */
	public void setAlternateUnitofMeasureCodingSystemOID(String strAlternateUnitofMeasureCodingSystemOID)
	{
		if(strAlternateUnitofMeasureCodingSystemOID!=null)
			setComponentType(18, strAlternateUnitofMeasureCodingSystemOID);
		else
			setAlternateUnitofMeasureCodingSystemOID((ST)null);
	}

	/**
	 *Sets the Alternate Unit of Measure Coding System OID.
	 *@param objST contains the ISO Object Identifier (OID) for the coding system or value set named in CSU.7
	 */
	public void setAlternateUnitofMeasureCodingSystemOID(ST objST)
	{
		setComponentType(18,objST);
	}
	
	/**
	 *Sets the Alternate Unit of Measure Value Set OID.
	 *@param strAlternateUnitofMeasureValueSetOID contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CSU.5 is obtained. 
	 */
	public void setAlternateUnitofMeasureValueSetOID(String strAlternateUnitofMeasureValueSetOID)
	{
		if(strAlternateUnitofMeasureValueSetOID!=null)
			setComponentType(19, strAlternateUnitofMeasureValueSetOID);
		else
			setAlternateUnitofMeasureValueSetOID((ST)null);
	}

	/**
	 *Sets the Alternate Unit of Measure Value Set OID.
	 *@param objST contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CSU.5 is obtained.
	 */
	public void setAlternateUnitofMeasureValueSetOID(ST objST)
	{
		setComponentType(19,objST);
	}
	
	/**
	 *Sets the Alternate Unit of Measure Value Set Version ID.
	 *@param strAlternateUnitofMeasureValueSetVersionID carries the version for the value set identified by CSU.19 and it is a date.
	 */
	public void setAlternateUnitofMeasureValueSetVersionID(String strAlternateUnitofMeasureValueSetVersionID)
	{
		if(strAlternateUnitofMeasureValueSetVersionID!=null)
			setComponentType(20, strAlternateUnitofMeasureValueSetVersionID);
		else
			setAlternateUnitofMeasureValueSetVersionID((DTM)null);
	}

	/**
	 *Sets the Alternate Unit of Measure Value Set Version ID.
	 *@param objDTM carries the version for the value set identified by CSU.19 and it is a date.
	 */
	public void setAlternateUnitofMeasureValueSetVersionID(DTM objDTM)
	{
		setComponentType(20,objDTM);
	}
	
	/**
	 *Sets the Second Alternate Unit of Measure Coding System OID.
	 *@param strSecondAlternateUnitofMeasureCodingSystemOID contains the ISO Object Identifier (OID) for the coding system or value set named in CSU.13.
	 */
	public void setSecondAlternateUnitofMeasureCodingSystemOID(String strSecondAlternateUnitofMeasureCodingSystemOID)
	{
		if(strSecondAlternateUnitofMeasureCodingSystemOID!=null)
			setComponentType(21, strSecondAlternateUnitofMeasureCodingSystemOID);
		else
			setSecondAlternateUnitofMeasureCodingSystemOID((ST)null);
	}

	/**
	 *Sets the Alternate Unit of Measure Coding System OID.
	 *@param objST contains the ISO Object Identifier (OID) for the coding system or value set named in CSU.13.
	 */
	public void setSecondAlternateUnitofMeasureCodingSystemOID(ST objST)
	{
		setComponentType(21,objST);
	}
	
	/**
	 *Sets the Second Alternate Unit of Measure Value Set OID.
	 *@param strSecondAlternateUnitofMeasureValueSetOID contains the ISO Object Identifier (OID) to allow identification of the value set. 
	 */
	public void setSecondAlternateUnitofMeasureValueSetOID(String strSecondAlternateUnitofMeasureValueSetOID)
	{
		if(strSecondAlternateUnitofMeasureValueSetOID!=null)
			setComponentType(22, strSecondAlternateUnitofMeasureValueSetOID);
		else
			setSecondAlternateUnitofMeasureValueSetOID((ST)null);
	}

	/**
	 *Sets the Alternate Unit of Measure Value Set OID.
	 *@param objST contains the ISO Object Identifier (OID) to allow identification of the value set.
	 */
	public void setSecondAlternateUnitofMeasureValueSetOID(ST objST)
	{
		setComponentType(22,objST);
	}
	
	/**
	 *Sets the Second Alternate Unit of Measure Value Set Version ID.
	 *@param strSecondAlternateUnitofMeasureValueSetVersionID carries the version for the value set identified by CSU.22 and it is a date. 
	 */
	public void setSecondAlternateUnitofMeasureValueSetVersionID(String strSecondAlternateUnitofMeasureValueSetVersionID)
	{
		if(strSecondAlternateUnitofMeasureValueSetVersionID!=null)
			setComponentType(23, strSecondAlternateUnitofMeasureValueSetVersionID);
		else
			setSecondAlternateUnitofMeasureValueSetVersionID((ST)null);
	}

	/**
	 *Sets the Alternate Unit of Measure Value Set Version ID.
	 *@param objST carries the version for the value set identified by CSU.22 and it is a date.
	 */
	public void setSecondAlternateUnitofMeasureValueSetVersionID(ST objST)
	{
		setComponentType(23,objST);
	}

	/**
	 * Returns Channel Sensitivity
	 * @return NM - data type.
	 */
	public NM getChannelSensitivity()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(1);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (NM)objDataCollection.elementAt(0);
		else
			return null;
	}

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

	/**
	 * Returns Unit of Measure Description
	 * @return ST - data type.
	 */
	public ST getUnitOfMeasureDescription()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(3);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Returns Unit of Measure Coding System
	 * @return ID - data type.
	 */
	public ID getUnitOfMeasureCodingSystem()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(4);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}

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

	/**
	 * Returns Alternate Unit of Measure Description
	 * @return ST - data type.
	 */
	public ST getAlternateUnitOfMeasureDescription()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(6);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Returns Alternate Unit of Measure Coding System
	 * @return ID - data type.
	 */
	public ID getAlternateUnitOfMeasureCodingSystem()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(7);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Returns Unit of Measure Coding System Version ID 
	 * @return ST - data type.
	 */
	public ST getUnitofMeasureCodingSystemVersionID ()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(8);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Returns Alternate Unit of Measure Coding System Version ID
	 * @return ST - data type.
	 */
	public ST getAlternateUnitofMeasureCodingSystemVersionID()
	{
		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(10);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Returns Second Alternate Unit of Measure Identifier
	 * @return ST - data type.
	 */
	public ST getSecondAlternateUnitofMeasureIdentifier()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(11);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Returns Second Alternate Unit of Measure Text 
	 * @return ST - data type.
	 */
	public ST getSecondAlternateUnitofMeasureText()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(12);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Returns Name of Second Alternate Unit of Measure Coding System
	 * @return ID - data type.
	 */
	public ID getNameofSecondAlternateUnitofMeasureCodingSystem()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(13);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Returns Second Alternate Unit of Measure Coding System Version ID
	 * @return ST - data type.
	 */
	public ST getSecondAlternateUnitofMeasureCodingSystemVersionID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(14);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Returns Unit of Measure Coding System OID
	 * @return ST - data type.
	 */
	public ST getUnitofMeasureCodingSystemOID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(15);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Returns Unit of Measure Value Set OID
	 * @return ST - data type.
	 */
	public ST getUnitofMeasureValueSetOID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(16);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Returns Unit of Measure Value Set Version ID
	 * @return DTM - data type.
	 */
	public DTM getUnitofMeasureValueSetVersionID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(17);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DTM)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Returns Alternate Unit of Measure Coding System OID
	 * @return ST - data type.
	 */
	public ST getAlternateUnitofMeasureCodingSystemOID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(18);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Returns Alternate Unit of Measure Value Set OID
	 * @return ST - data type.
	 */
	public ST getAlternateUnitofMeasureValueSetOID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(19);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Returns Alternate Unit of Measure Value Set Version ID
	 * @return DTM - data type.
	 */
	public DTM getAlternateUnitofMeasureValueSetVersionID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(20);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DTM)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Returns Second Alternate Unit of Measure Coding System OID
	 * @return ST - data type.
	 */
	public ST getSecondAlternateUnitofMeasureCodingSystemOID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(21);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Returns Second Alternate Unit of Measure Value Set OID
	 * @return ST - data type.
	 */
	public ST getSecondAlternateUnitofMeasureValueSetOID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(22);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Returns Second Alternate Unit of Measure Value Set Version ID
	 * @return ST - data type.
	 */
	public ST getSecondAlternateUnitofMeasureValueSetVersionID()
	{
		ISingleCollection<IDataType> objDataCollection =getComponentType(23);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * The Method validates the Input value,and if validated properly then returns true.
	 * Here the validation is based on the compulsory fields for the Datatype. 
	 * @return boolean - true or false.
	 * @throws InvalidDataTypeException - if Invalid values is entered or Mandatory field is missing.
	 */
	public boolean validate() throws InvalidDataTypeException
	{
		super.validate();
		//First field is required.
		if(getComponentType(1)==null)
		{
			throw new MissingValueException(this.getClass().getSimpleName() + "Channel Sensitivity");
		}
		else
		{
			//if second is not present then third is required and vice a versa.
			if(getComponentType(2)==null &&getComponentType(3)==null ||getComponentType(2)!=null &&getComponentType(4)==null)
			{
				String strMessage = "\"Unit of Measure Identifier\",\"Unit of Measure Description\" both should be present or both should not be present.";
				throw new InvalidValueException(strMessage);
			}
			else 
			{
				return true;
			}
		}
	}

	/**
	 * 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 CSU)))
			return false;

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

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

		if(this.getUnitOfMeasureDescription() == null)
		{
			if(((CSU)objObject).getUnitOfMeasureDescription() != null)
				return false;
		}
		else if(false == (this.getUnitOfMeasureDescription().equals(((CSU)objObject).getUnitOfMeasureDescription())))
			return false;
		
		if(this.getUnitOfMeasureCodingSystem() == null)
		{
			if(((CSU)objObject).getUnitOfMeasureCodingSystem() != null)
				return false;
		}
		else if(false == (this.getUnitOfMeasureCodingSystem().equals(((CSU)objObject).getUnitOfMeasureCodingSystem())))
			return false;

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

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

		if(this.getAlternateUnitOfMeasureCodingSystem() == null)
		{
			if(((CSU)objObject).getAlternateUnitOfMeasureCodingSystem() != null)
				return false;
		}
		else if(false == (this.getAlternateUnitOfMeasureCodingSystem().equals(((CSU)objObject).getAlternateUnitOfMeasureCodingSystem())))
			return false;
		
		if(this.getUnitofMeasureCodingSystemVersionID() == null)
		{
			if(((CSU)objObject).getUnitofMeasureCodingSystemVersionID() != null)
				return false;
		}
		else if(false == (this.getUnitofMeasureCodingSystemVersionID().equals(((CSU)objObject).getUnitofMeasureCodingSystemVersionID())))
			return false;
		
		if(this.getAlternateUnitofMeasureCodingSystemVersionID() == null)
		{
			if(((CSU)objObject).getAlternateUnitofMeasureCodingSystemVersionID() != null)
				return false;
		}
		else if(false == (this.getAlternateUnitofMeasureCodingSystemVersionID().equals(((CSU)objObject).getAlternateUnitofMeasureCodingSystemVersionID())))
			return false;
		
		if(this.getOriginalText() == null)
		{
			if(((CSU)objObject).getOriginalText() != null)
				return false;
		}
		else if(false == (this.getOriginalText().equals(((CSU)objObject).getOriginalText())))
			return false;
		
		if(this.getSecondAlternateUnitofMeasureIdentifier() == null)
		{
			if(((CSU)objObject).getSecondAlternateUnitofMeasureIdentifier() != null)
				return false;
		}
		else if(false == (this.getSecondAlternateUnitofMeasureIdentifier().equals(((CSU)objObject).getSecondAlternateUnitofMeasureIdentifier())))
			return false;
		
		if(this.getSecondAlternateUnitofMeasureText() == null)
		{
			if(((CSU)objObject).getSecondAlternateUnitofMeasureText() != null)
				return false;
		}
		else if(false == (this.getSecondAlternateUnitofMeasureText().equals(((CSU)objObject).getSecondAlternateUnitofMeasureText())))
			return false;
		
		if(this.getNameofSecondAlternateUnitofMeasureCodingSystem() == null)
		{
			if(((CSU)objObject).getNameofSecondAlternateUnitofMeasureCodingSystem() != null)
				return false;
		}
		else if(false == (this.getNameofSecondAlternateUnitofMeasureCodingSystem().equals(((CSU)objObject).getNameofSecondAlternateUnitofMeasureCodingSystem())))
			return false;
		
		if(this.getSecondAlternateUnitofMeasureCodingSystemVersionID() == null)
		{
			if(((CSU)objObject).getSecondAlternateUnitofMeasureCodingSystemVersionID() != null)
				return false;
		}
		else if(false == (this.getSecondAlternateUnitofMeasureCodingSystemVersionID().equals(((CSU)objObject).getSecondAlternateUnitofMeasureCodingSystemVersionID())))
			return false;
		
		if(this.getUnitofMeasureCodingSystemOID() == null)
		{
			if(((CSU)objObject).getUnitofMeasureCodingSystemOID() != null)
				return false;
		}
		else if(false == (this.getUnitofMeasureCodingSystemOID().equals(((CSU)objObject).getUnitofMeasureCodingSystemOID())))
			return false;
		
		if(this.getUnitofMeasureValueSetOID() == null)
		{
			if(((CSU)objObject).getUnitofMeasureValueSetOID() != null)
				return false;
		}
		else if(false == (this.getUnitofMeasureValueSetOID().equals(((CSU)objObject).getUnitofMeasureValueSetOID())))
			return false;
		
		if(this.getUnitofMeasureValueSetVersionID() == null)
		{
			if(((CSU)objObject).getUnitofMeasureValueSetVersionID() != null)
				return false;
		}
		else if(false == (this.getUnitofMeasureValueSetVersionID().equals(((CSU)objObject).getUnitofMeasureValueSetVersionID())))
			return false;
		
		if(this.getAlternateUnitofMeasureCodingSystemOID() == null)
		{
			if(((CSU)objObject).getAlternateUnitofMeasureCodingSystemOID() != null)
				return false;
		}
		else if(false == (this.getAlternateUnitofMeasureCodingSystemOID().equals(((CSU)objObject).getAlternateUnitofMeasureCodingSystemOID())))
			return false;
		
		if(this.getAlternateUnitofMeasureValueSetOID() == null)
		{
			if(((CSU)objObject).getAlternateUnitofMeasureValueSetOID() != null)
				return false;
		}
		else if(false == (this.getAlternateUnitofMeasureValueSetOID().equals(((CSU)objObject).getAlternateUnitofMeasureValueSetOID())))
			return false;
		
		if(this.getAlternateUnitofMeasureValueSetVersionID() == null)
		{
			if(((CSU)objObject).getAlternateUnitofMeasureValueSetVersionID() != null)
				return false;
		}
		else if(false == (this.getAlternateUnitofMeasureValueSetVersionID().equals(((CSU)objObject).getAlternateUnitofMeasureValueSetVersionID())))
			return false;
		
		if(this.getSecondAlternateUnitofMeasureCodingSystemOID() == null)
		{
			if(((CSU)objObject).getSecondAlternateUnitofMeasureCodingSystemOID() != null)
				return false;
		}
		else if(false == (this.getSecondAlternateUnitofMeasureCodingSystemOID().equals(((CSU)objObject).getSecondAlternateUnitofMeasureCodingSystemOID())))
			return false;
		
		if(this.getSecondAlternateUnitofMeasureValueSetOID() == null)
		{
			if(((CSU)objObject).getSecondAlternateUnitofMeasureValueSetOID() != null)
				return false;
		}
		else if(false == (this.getSecondAlternateUnitofMeasureValueSetOID().equals(((CSU)objObject).getSecondAlternateUnitofMeasureValueSetOID())))
			return false;

		if(this.getSecondAlternateUnitofMeasureValueSetVersionID() == null)
		{
			if(((CSU)objObject).getSecondAlternateUnitofMeasureValueSetVersionID() != null)
				return false;
		}
		else if(false == (this.getSecondAlternateUnitofMeasureValueSetVersionID().equals(((CSU)objObject).getSecondAlternateUnitofMeasureValueSetVersionID())))
			return false;
		
		return true;
	}
}
