/*******************************************************************************
 *  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.ID;
import cdac.medinfo.sdk.hl7282.baselibs.SN;
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;

/**
 * TCD - Test Code Detail Segment.<p>
 * The test code detail (TCD)segment contains the data necessary to
 * perform operations or calculations, or execute decisions by the
 * laboratory automation system, and which are not supported by the original HL7 segments 
 * related to orders (ORC, OBR).
 * <p>Represents an HL7 TCD message segment. 
 * This segment has the following fields:</p><p>
 * TCD-1: Universal Service Identifier (CWE)<b>Required</b><br> 
 * TCD-2: Auto-Dilution Factor (SN)<b>Optional</b><br> 
 * TCD-3: Rerun Dilution Factor (SN)<b>Optional</b><br> 
 * TCD-4: Pre-Dilution Factor (SN)<b>Optional</b><br> 
 * TCD-5: Endogenous Content of Pre-Dilution Diluent (SN)<b>Optional</b><br> 
 * TCD-6: Automatic Repeat Allowed (ID)<b>Optional</b><br> 
 * TCD-7: Reflex Allowed (ID)<b>Optional</b><br> 
 * TCD-8: Analyte Repeat Status (CWE)<b>Optional</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 TCD extends Segment    
{
	






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

	/**
	 * Retrieves the Analyte Repeat Status.  
	 * @return CWE - analyteRepeatStatus
	 */
	public CWE getAnalyteRepeatStatus() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1425);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Auto Dilution Factor.
	 * This field specify that it is to be used as the factor for automatically diluting a particular specimen by an instrument for this particular test code.
	 * @return SN - auto_DilutionFactor
	 */
	public SN getAuto_DilutionFactor() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1420);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (SN)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Automatic Repeat Allowed.
	 * This field identify whether automatic repeats are to be initiated 
	 * for this particular specimen for this particular test code or not.
	 * @return ID - automaticRepeatAllowed
	 */
	public ID getAutomaticRepeatAllowed() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1416);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Endogenous Content of Pre Dilution Diluent. 
	 * @return SN - endogenousContentofPre_DilutionDiluent
	 */
	public SN getEndogenousContentofPre_DilutionDiluent() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1413);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (SN)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Pre Dilution Factor.
	 * This field specify that is to be used as the factor for a particular specimen
	 * that is delivered to the automated system as pre-diluted for this particular test code 
	 * @return SN - pre_DilutionFactor
	 */
	public SN getPre_DilutionFactor() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1422);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (SN)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Reflex Allowed.
	 * This field identify whether automatic or manual reflex testing is to be initiated for this particular specimen  or not.
	 * @return ID - reflexAllowed
	 */
	public ID getReflexAllowed() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1424);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Rerun Dilution Factor.
	 * This field specify that it is to be used as the factor for automatically diluting a particular specimen in case of rerun for this particular test code. 
	 * @return SN - rerunDilutionFactor
	 */
	public SN getRerunDilutionFactor() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1421);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (SN)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Universal Service Identifier. 
	 * @return CWE - universalServiceIdentifier
	 */
	public CWE getUniversalServiceIdentifier() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(238);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Set the Analyte Repeat Status.
	 * This field identifies the repeat status for the analyte/result (e.g., original, rerun, repeat, reflex).
	 * @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 setAnalyteRepeatStatus (String strIdentifier,String strText,String strNameOfCodingSystem,
			String strAlternateIdentifier,String strAlternateText,String strNameOfAlternateCodingSystem, String strCodingSystemVersionID, String 				strAlternateCodingSystemVersionId,
			String strOriginalText, String  strSecondAlternateIdentifier, String strSecondAlternateText, 
			String strNameofSecondAlternateCodingSystem, String strSecondAlternateCodingSystemVersionID, String strCodingSystemOID, String strValueSetOID,
			String strValueSetVersionID, String strAlternateCodingSystemOID, String strAlternateValueSetOID, String strAlternateValueSetVersionID,
			String  strSecondAlternateCodingSystemOID, String strSecondAlternateValueSetOID, String strSecondAlternateValueSetVersionID)
	{
		CWE cwe  = (CWE)getDataElement(1425);
		cwe.setIdentifier(strIdentifier);
		cwe.setText(strText);
		cwe.setNameOfCodingSystem(strNameOfCodingSystem);
		cwe.setAlternateIdentifier(strAlternateIdentifier);
		cwe.setAlternateText(strAlternateText);
		cwe.setNameOfAlternateCodingSystem(strNameOfAlternateCodingSystem); 
		cwe.setCodingSystemVersionID(strCodingSystemVersionID);
		cwe.setAlternateCodingSystemVersionId(strAlternateCodingSystemVersionId);
		cwe.setOriginalText(strOriginalText);
		cwe.setSecondAlternateIdentifier(strSecondAlternateIdentifier);
		cwe.setSecondAlternateText(strSecondAlternateText);
		cwe.setNameofSecondAlternateCodingSystem(strNameofSecondAlternateCodingSystem);
		cwe.setSecondAlternateCodingSystemVersionID(strSecondAlternateCodingSystemVersionID);
		cwe.setCodingSystemOID(strCodingSystemOID);
		cwe.setValueSetOID(strValueSetOID);
		cwe.setValueSetVersionID(strValueSetVersionID);
		cwe.setAlternateCodingSystemOID(strAlternateCodingSystemOID);
		cwe.setAlternateValueSetOID(strAlternateValueSetOID);
		cwe.setAlternateValueSetVersionID(strAlternateValueSetVersionID);
		cwe.setSecondAlternateCodingSystemOID(strSecondAlternateCodingSystemOID);
		cwe.setSecondAlternateValueSetOID(strSecondAlternateValueSetOID);
		cwe.setSecondAlternateValueSetVersionID(strSecondAlternateValueSetVersionID); 
		setAnalyteRepeatStatus(cwe);

	} 

	/**
	 * 	Set the Analyte Repeat Status.
	 * This field identifies the repeat status for the analyte/result (e.g., original, rerun, repeat, reflex).
	 * @param objanalyteRepeatStatus object of Analyte Repeat Status.
	 */ 
	public void setAnalyteRepeatStatus(CWE objanalyteRepeatStatus)
	{
		setDataType(1425,objanalyteRepeatStatus);

	}	
	
	/**
	 * Set the Auto Dilution Factor.
	 * This field specify that it is to be used as the factor for automatically diluting a particular specimen by an instrument for this particular test code.
	 * @param strComparator Specifies as greater than, less than, greater than or equal, less than or equal,
	 * 						 equal, and not equal, respectively 
	 * @param strNum1 Specifies A number. 
	 * @param strSeparatorSuffix Specifies Separat or Suffix 
	 * @param strNum2 Specifies A number or null depending on the measurement.
	 */ 
	public void setAuto_DilutionFactor (String strComparator,String strNum1,String strSeparatorSuffix,String strNum2) 
	{
		SN auto_DilutionFactor  = (SN)getDataElement(1420);
		auto_DilutionFactor.setComparator(strComparator);
		auto_DilutionFactor.setNum1(strNum1);
		auto_DilutionFactor.setSeparatorSuffix(strSeparatorSuffix);
		auto_DilutionFactor.setNum2(strNum2); 
		setAuto_DilutionFactor(auto_DilutionFactor);

	} 

	/** Set the Auto Dilution Factor.
	 * This field specify that it is to be used as the factor for automatically diluting a particular specimen by an instrument for this particular test code.
	 * @param objauto_DilutionFactor object of Auto_Dilution Factor.
	 */ 
	public void setAuto_DilutionFactor(SN objauto_DilutionFactor)
	{
		setDataType(1420,objauto_DilutionFactor);

	}	/**
	 * Set the Automatic Repeat Allowed.
	 * This field identify whether automatic repeats are to be initiated 
	 * for this particular specimen for this particular test code or not.
	 * @param strAutomaticRepeatAllowed This field contains the String Value of Automatic Repeat Allowed
	 */ 
	public void setAutomaticRepeatAllowed (String strAutomaticRepeatAllowed) 
	{
		ID automaticRepeatAllowed  = (ID)getDataElement(1416);
		automaticRepeatAllowed.setValue(strAutomaticRepeatAllowed); 
		setAutomaticRepeatAllowed(automaticRepeatAllowed);

	} 

	/** Set the Automatic Repeat Allowed.
	 * This field identify whether automatic repeats are to be initiated 
	 * for this particular specimen for this particular test code or not.
	 * @param objautomaticRepeatAllowed object of Automatic Repeat Allowed.
	 */ 
	public void setAutomaticRepeatAllowed(ID objautomaticRepeatAllowed)
	{
		setDataType(1416,objautomaticRepeatAllowed);

	}	
	/**
	 * Set the Endogenous Content of Pre Dilution Diluent.
	 * @param strComparator Specifies as greater than, less than, greater than or equal, less than or equal,
	 * 						 equal, and not equal, respectively 
	 * @param strNum1 Specifies A number. 
	 * @param strSeparatorSuffix Specifies Separat or Suffix 
	 * @param strNum2 Specifies A number or null depending on the measurement.
	 */ 
	public void setEndogenousContentofPre_DilutionDiluent (String strComparator,String strNum1,String strSeparatorSuffix,String strNum2)  
	{
		SN endogenousContentofPre_DilutionDiluent  = (SN)getDataElement(1413);
		endogenousContentofPre_DilutionDiluent.setComparator(strComparator);
		endogenousContentofPre_DilutionDiluent.setNum1(strNum1);
		endogenousContentofPre_DilutionDiluent.setSeparatorSuffix(strSeparatorSuffix);
		endogenousContentofPre_DilutionDiluent.setNum2(strNum2); 
		setEndogenousContentofPre_DilutionDiluent(endogenousContentofPre_DilutionDiluent);
	} 

	/** Set the Endogenous Content of Pre Dilution Diluent.
	 * @param objendogenousContentofPre_DilutionDiluent object of Endogenous Content of Pre_Dilution Diluent.
	 */ 
	public void setEndogenousContentofPre_DilutionDiluent(SN objendogenousContentofPre_DilutionDiluent)
	{
		setDataType(1413,objendogenousContentofPre_DilutionDiluent);

	}	/**
	 * Set the Pre Dilution Factor.
	 * This field specify that is to be used as the factor for a particular specimen
	 * that is delivered to the automated system as pre-diluted for this particular test code 
	 * that is delivered to the automated system as pre-diluted for this particular test code
	 * @param strComparator Specifies as greater than, less than, greater than or equal, less than or equal,
	 * 						 equal, and not equal, respectively 
	 * @param strNum1 Specifies A number. 
	 * @param strSeparatorSuffix Specifies Separat or Suffix 
	 * @param strNum2 Specifies A number or null depending on the measurement.
	 */ 
	public void setPre_DilutionFactor (String strComparator,String strNum1,String strSeparatorSuffix,String strNum2)  
	{
		SN pre_DilutionFactor  = (SN)getDataElement(1422);
		pre_DilutionFactor.setComparator(strComparator);
		pre_DilutionFactor.setNum1(strNum1);
		pre_DilutionFactor.setSeparatorSuffix(strSeparatorSuffix);
		pre_DilutionFactor.setNum2(strNum2); 
		setPre_DilutionFactor(pre_DilutionFactor);

	} 

	/** Set the Pre Dilution Factor.
	 * This field specify that is to be used as the factor for a particular specimen
	 * that is delivered to the automated system as pre-diluted for this particular test code 
	 * that is delivered to the automated system as pre-diluted for this particular test code
	 * @param objpre_DilutionFactor object of Pre_Dilution Factor.
	 */ 
	public void setPre_DilutionFactor(SN objpre_DilutionFactor)
	{
		setDataType(1422,objpre_DilutionFactor);
	}	/**
	 * Set the Reflex Allowed.
	 * This field identify whether automatic or manual reflex testing is to be initiated for this particular specimen  or not.
	 * @param strReflexAllowed This field contains the String Value of Reflex Allowed
	 */ 
	public void setReflexAllowed (String strReflexAllowed) 
	{
		ID reflexAllowed  = (ID)getDataElement(1424);
		reflexAllowed.setValue(strReflexAllowed); 
		setReflexAllowed(reflexAllowed);
	} 

	/** Set the Reflex Allowed.
	 * This field identify whether automatic or manual reflex testing is to be initiated for this particular specimen  or not.
	 * @param objreflexAllowed object of Reflex Allowed.
	 */ 
	public void setReflexAllowed(ID objreflexAllowed)
	{
		setDataType(1424,objreflexAllowed);
	}	/**
	 * Set the Rerun Dilution Factor.
	 * This field specify that it is to be used as the factor for automatically diluting a particular specimen in case of rerun for this particular test code.
	 * @param strComparator Specifies as greater than, less than, greater than or equal, less than or equal,
	 * 						 equal, and not equal, respectively 
	 * @param strNum1 Specifies A number. 
	 * @param strSeparatorSuffix Specifies Separat or Suffix 
	 * @param strNum2 Specifies A number or null depending on the measurement.
	 */ 
	public void setRerunDilutionFactor (String strComparator,String strNum1,String strSeparatorSuffix,String strNum2) 
	{
		SN rerunDilutionFactor  = (SN)getDataElement(1421);
		rerunDilutionFactor.setComparator(strComparator);
		rerunDilutionFactor.setNum1(strNum1);
		rerunDilutionFactor.setSeparatorSuffix(strSeparatorSuffix);
		rerunDilutionFactor.setNum2(strNum2); 
		setRerunDilutionFactor(rerunDilutionFactor);
	} 

	/** Set the Rerun Dilution Factor.
	 * This field specify that it is to be used as the factor for automatically diluting a particular specimen in case of rerun for this particular test code.
	 * @param objrerunDilutionFactor object of Rerun Dilution Factor.
	 */ 
	public void setRerunDilutionFactor(SN objrerunDilutionFactor)
	{
		setDataType(1421,objrerunDilutionFactor);
	}	
	
	/**
	 * Set the Universal Service Identifier.
	 * This field identifies the test code that information is being transmitted about.
	 * @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 setUniversalServiceIdentifier (String strIdentifier,String strText,String strNameOfCodingSystem,
			String strAlternateIdentifier,String strAlternateText,String strNameOfAlternateCodingSystem, String strCodingSystemVersionID, String 				strAlternateCodingSystemVersionId,
			String strOriginalText, String  strSecondAlternateIdentifier, String strSecondAlternateText, 
			String strNameofSecondAlternateCodingSystem, String strSecondAlternateCodingSystemVersionID, String strCodingSystemOID, String strValueSetOID,
			String strValueSetVersionID, String strAlternateCodingSystemOID, String strAlternateValueSetOID, String strAlternateValueSetVersionID,
			String  strSecondAlternateCodingSystemOID, String strSecondAlternateValueSetOID, String strSecondAlternateValueSetVersionID)
	{
		CWE cwe  = (CWE)getDataElement(238);
		cwe.setIdentifier(strIdentifier);
		cwe.setText(strText);
		cwe.setNameOfCodingSystem(strNameOfCodingSystem);
		cwe.setAlternateIdentifier(strAlternateIdentifier);
		cwe.setAlternateText(strAlternateText);
		cwe.setNameOfAlternateCodingSystem(strNameOfAlternateCodingSystem); 
		cwe.setCodingSystemVersionID(strCodingSystemVersionID);
		cwe.setAlternateCodingSystemVersionId(strAlternateCodingSystemVersionId);
		cwe.setOriginalText(strOriginalText);
		cwe.setSecondAlternateIdentifier(strSecondAlternateIdentifier);
		cwe.setSecondAlternateText(strSecondAlternateText);
		cwe.setNameofSecondAlternateCodingSystem(strNameofSecondAlternateCodingSystem);
		cwe.setSecondAlternateCodingSystemVersionID(strSecondAlternateCodingSystemVersionID);
		cwe.setCodingSystemOID(strCodingSystemOID);
		cwe.setValueSetOID(strValueSetOID);
		cwe.setValueSetVersionID(strValueSetVersionID);
		cwe.setAlternateCodingSystemOID(strAlternateCodingSystemOID);
		cwe.setAlternateValueSetOID(strAlternateValueSetOID);
		cwe.setAlternateValueSetVersionID(strAlternateValueSetVersionID);
		cwe.setSecondAlternateCodingSystemOID(strSecondAlternateCodingSystemOID);
		cwe.setSecondAlternateValueSetOID(strSecondAlternateValueSetOID);
		cwe.setSecondAlternateValueSetVersionID(strSecondAlternateValueSetVersionID); 
		setUniversalServiceIdentifier(cwe);

	} 

	/** Set the Universal Service Identifier.
	 * This field identifies the test code that information is being transmitted about.
	 * @param objuniversalServiceIdentifier object of Universal Service Identifier.
	 */ 
	public void setUniversalServiceIdentifier(CWE objuniversalServiceIdentifier)
	{
		setDataType(238,objuniversalServiceIdentifier);
	}
	
	/**
	 * 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 Throws when Segment Validation fails.
	 */
	public boolean validate() throws InvalidSegmentException
	{
		try
		{
			super.validate();
			return true;
		}
		catch(FieldMissingException ex)
		{
			throw new InvalidSegmentException(enumSegments.getValue(),ex);
		}
	}
}