/*******************************************************************************
 *  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.DTM;
import cdac.medinfo.sdk.hl7282.baselibs.EI;
import cdac.medinfo.sdk.hl7282.baselibs.FN;
import cdac.medinfo.sdk.hl7282.baselibs.HD;
import cdac.medinfo.sdk.hl7282.baselibs.ID;
import cdac.medinfo.sdk.hl7282.baselibs.NM;
import cdac.medinfo.sdk.hl7282.baselibs.SI;
import cdac.medinfo.sdk.hl7282.baselibs.XCN;
import cdac.medinfo.sdk.hl7282.commoninterface.IDataType;
import cdac.medinfo.sdk.hl7282.commoninterface.ISingleCollection;
import cdac.medinfo.sdk.hl7282.exceptions.FieldMissingException;
import cdac.medinfo.sdk.hl7282.exceptions.InvalidSegmentException;
import cdac.medinfo.sdk.hl7282.utils.EnumSegments;
import cdac.medinfo.sdk.hl7282.utils.SingleCollection;

/**
 * DG1 - Diagnosis Segment.<p>
 * The DG1 segment contains patient diagnosis information of various types, for example, admitting, primary, etc.
 * The DG1 segment is used to send multiple diagnoses (for example, for medical records encoding).  
 * <p>Represents an HL7 DG1 message segment. 
 * This segment has the following fields:</p><p>
 * DG1-1: Set ID - DG1 (SI)<b>Required</b><br> 
 * DG1-2: Diagnosis Coding Method (ID)<b>Withdrawn</b><br> 
 * DG1-3: Diagnosis Code - DG1 (CWE)<b>Optional</b><br> 
 * DG1-4: Diagnosis Description (ST)<b>Withdrawn</b><br> 
 * DG1-5: Diagnosis Date/Time (DTM)<b>Optional</b><br> 
 * DG1-6: Diagnosis Type (CWE)<b>Required</b><br> 
 * DG1-7: Major Diagnostic Category (CWE)<b>Withdrawn</b><br> 
 * DG1-8: Diagnostic Related Group (CWE)<b>Withdrawn</b><br> 
 * DG1-9: DRG Approval Indicator (ID)<b>Withdrawn</b><br> 
 * DG1-10: DRG Grouper Review Code (IS)<b>Withdrawn</b><br> 
 * DG1-11: Outlier Type (CWE)<b>Withdrawn</b><br> 
 * DG1-12: Outlier Days (NM)<b>Withdrawn</b><br> 
 * DG1-13: Outlier Cost (CP)<b>Withdrawn</b><br> 
 * DG1-14: Grouper Version And Type (ST)<b>Withdrawn</b><br> 
 * DG1-15: Diagnosis Priority (NM)<b>Optional</b><br> 
 * DG1-16: Diagnosing Clinician (XCN)<b>Optional</b><br> 
 * DG1-17: Diagnosis Classification (CWE)<b>Optional</b><br> 
 * DG1-18: Confidential Indicator (ID)<b>Optional</b><br> 
 * DG1-19: Attestation Date/Time (DTM)<b>Optional</b><br> 
 * DG1-20: Diagnosis Identifier (EI)<b>Conditional</b><br> 
 * DG1-21: Diagnosis Action Code (ID)<b>Conditional</b><br>
 * DG1-22: Parent Diagnosis (EI)<b>Conditional</b><br> 
 * DG1-23: DRG CCL Value Code (CWE)<b>Optional</b><br> 
 * DG1-24: DRG Grouping Usage (ID)<b>Optional</b><br> 
 * DG1-25: DRG Diagnosis Determination Status (CWE)<b>Optional</b><br> 
 * DG1-26: Present On Admission (POA) Indicator (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 DG1 extends Segment   
{

	

	/**
	 * Constructs the DG1 segment.
	 */
	public DG1()
	{super(EnumSegments.HL7_SEG_DG1);
	}

	//Integer values used in getter/setter is unique item id defined for each attribute.

	/**
	 * Retrieves the Attestation Date Time.
	 * This field contains the time stamp that indicates the date and time of the signed attestation.
	 * @return DTM - attestationDateTime
	 */
	public DTM getAttestationDateTime() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(768);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DTM)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Confidential Indicator.
	 * This field indicates whether the diagnosis is confidential or not. 
	 * @return String - confidentialIndicator
	 */
	public ID getConfidentialIndicator() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(767);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Diagnosing Clinician.
	 * This field contains the individual responsible for generating the diagnosis 
	 * information. Multiple names and identifiers for the same person may be send in 
	 * this field, not multiple diagnosing clinicians.  
	 * @return ISingleCollection<XCN> - diagnosingClinician
	 */
	public ISingleCollection<XCN> getDiagnosingClinician()
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(390);
		ISingleCollection<XCN> objDataList = new SingleCollection<XCN>();
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				XCN objXCN = (XCN)objDataType;
				objDataList.add(objXCN);
			}
		}

		return objDataList;
	}

	/**
	 * Retrieves the Diagnosis Action Code.
	 * This field define the action to be taken for this diagnosis. 
	 * @return String - diagnosisActionCode
	 */
	public ID getDiagnosisActionCode() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1894);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Diagnosis Classification.
	 * This field indicates whether the patient information is for a diagnosis or a non-diagnosis code.  
	 * @return String - diagnosisClassification
	 */
	public CWE getDiagnosisClassification() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(766);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Diagnosis Code DG1.
	 * This field use for compatibility with clinical and ancillary systems.
	 * @return CWE - diagnosisCode_DG1
	 */
	public CWE getDiagnosisCode_DG1() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(377);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Diagnosis Date Time.
	 * This field contains the date/time when the diagnosis is determine.
	 * @return DTM - diagnosisDateTime
	 */
	public DTM getDiagnosisDateTime()
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(379);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DTM)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Diagnosis Identifier.
	 * This field contains a value that uniquely identify a single diagnosis 
	 * for an encounter. It is unique across all segments and messages for an encounter.  
	 * @return EI - diagnosisIdentifier
	 */
	public EI getDiagnosisIdentifier()
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1850);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (EI)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Diagnosis Priority.
	 * This field contains the number that identify the significance or priority of the diagnosis code.  
	 * @return String - diagnosisPriority
	 */
	public NM getDiagnosisPriority() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(389);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (NM)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Diagnosis Type.
	 * This field contains a code that identify the type of diagnosis sent.  
	 * @return String - diagnosisType
	 */
	public CWE getDiagnosisType() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(380);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Set ID DG1.
	 * This field contains the number that identify this transaction.  
	 * @return String - setID_DG1
	 */
	public SI getSetID_DG1() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(375);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (SI)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Retrieves the Parent Diagnosis.
	 * This field contains the entity identifier for the parent diagnosis 
	 * @return EI - ParentDiagnosis
	 */
	public EI getParentDiagnosis() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2152);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (EI)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Retrieves the DRG CCL Value Code.
	 * This field indicates the CCL value for the determined DRG for this diagnosis. 
	 * @return CWE - DRGCCLValueCode
	 */
	public CWE getDRGCCLValueCode() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2153);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Retrieves the DRG Grouping Usage.
	 * This field identifies whether this particular diagnosis has been used for the DRG determination.
	 * @return ID - DRGGroupingUsage
	 */
	public ID getDRGGroupingUsage() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2154);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Retrieves the DRG Diagnosis Determination Status.
	 * This field contains the status of this particular diagnosis for the DRG determination.  
	 * @return CWE - DRGDiagnosisDeterminationStatus
	 */
	public CWE getDRGDiagnosisDeterminationStatus() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2155);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Retrieves the Present On Admission (POA) Indicator.
	 * This field contains the present on admission indicator for this particular diagnosis. 
	 * @return CWE - PresentOnAdmissionPOAIndicator
	 */
	public CWE getPresentOnAdmissionPOAIndicator() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2288);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Set the Attestation Date Time.
	 * This field contains the time stamp that indicates the date and time of the signed attestation.
	 * @param strTime Specifies a point in time using a 24-hour clock notation. 
	 */	
	public void setAttestationDateTime(String strTime)
	{
		DTM attestationDateTime  = (DTM)getDataElement(768);
		attestationDateTime.setValue(strTime);
		setAttestationDateTime(attestationDateTime);
	}

	/**
	 * Set the Attestation Date Time.
	 * This field contains the time stamp that indicates the date and time of the signed attestation.
	 * @param attestationDateTime value of Attestation Date Time.
	 */	
	public void setAttestationDateTime(DTM attestationDateTime)
	{
		setDataType(768,attestationDateTime);
	}

	/**
	 * Set the Confidential Indicator.
	 * This field indicates whether the diagnosis is confidential or not. 
	 * @param strConfidentialIndicator Specifies whether the diagnosis is confidential.  
	 */ 
	public void setConfidentialIndicator (String strConfidentialIndicator)
	{
		ID confidentialIndicator  = (ID)getDataElement(767);
		confidentialIndicator.setValue(strConfidentialIndicator); 
		setConfidentialIndicator(confidentialIndicator);

	} 

	/** Set the Confidential Indicator.
	 * This field indicates whether the diagnosis is confidential or not. 
	 * @param objconfidentialIndicator Specifies whether the diagnosis is confidential.  
	 */ 
	public void setConfidentialIndicator(ID objconfidentialIndicator)
	{
		setDataType(767,objconfidentialIndicator);

	}
	/**
	 * Set the Diagnosing Clinician.
	 * This field contains the individual responsible for generating the diagnosis 
	 * information. Multiple names and identifiers for the same person may be send in 
	 * this field, not multiple diagnosing clinicians.  
	 * @param strIDNumber Refers to the coded ID according to a user-defined table
	 * @param objFamilyName Specifies the surname of a person.
	 * @param strGivenName Specifies First name.
	 * @param strSecondAndFurtherGivenNamesOrInitialsThereof Specifies multiple middle names that may be included by 
	 * 														   separating them with spaces.
	 * @param strSuffix Used to specify a name suffix (e.g., Jr. or III).
	 * @param strPrefix Used to specify a name prefix (e.g., Dr.).
	 * @param strSourceTable Used as the HL7 identifier for the user-defined table of values for this component. [Refer User-defined Table 0297 - CN ID.]
	 * @param objAssigningAuthority Specifies a unique identifier of the system (or organization or agency of department)
	 * 								  that creates the data. [Refer User-defined Table 0363 - Assigning authority]
	 * @param strNameTypeCode Specifies a code that represents the type of name. 
	 * @param strIdentifierCheckDigit Specifies part of the identifying number used in the sending application. 
	 * @param strCheckDigitScheme Specifies the code identifying the check digit scheme employed.[Refer HL7 Table 0061 - Check digit scheme].
	 * @param strIdentifierTypeCode Specifies A code corresponding to the type of identifier.[Refer HL7 Table 0203 - Identifier type].
	 * @param objAssigningFacility Specifies the place or location identifier where the identifier was first assigned to the person
	 * @param strNameRepresentationCode Provides an indication of the representation provided by the data item.  
	 * @param objNameContext Designates the context in which a name is used. [Refer User-defined Table 0448 ]
	 * @param strNameAssemblyOrder Specifies a code that represents the preferred display order of the components of this person name. Suggested values are G,F[Refer table 0444.]
	 * @param strEffectiveDate Specifies the first date, if known, on which the address is valid and active.
	 * @param strExpirationDate Specifies the last date, if known, on which the address is valid and active.
	 * @param strProfessionalSuffix Used to specify an abbreviation, or a string of abbreviations, denoting qualifications that support the person's profession, (e.g., licenses).
	 * @param objAssigningJurisdiction Specifies the geo-political body that assigned the identifier.
	 * @param objAssigningAgencyOrDepratment Specifies the agency or department that assigned the identifier
	 * @param strSecurityCheck Specifies the version code that may be assigned to the person identifier
	 * @param strSecurityCheckScheme Specifies the check digit scheme.
	 */	
	public void addDiagnosingClinician(String strIDNumber,FN objFamilyName,String strGivenName,String strSecondAndFurtherGivenNamesOrInitialsThereof,
			String 	strSuffix,String strPrefix,CWE objSourceTable,HD objAssigningAuthority,
			String strNameTypeCode,String strIdentifierCheckDigit,String strCheckDigitScheme,String strIdentifierTypeCode,
			HD objAssigningFacility,String strNameRepresentationCode,CWE objNameContext,
			String strNameAssemblyOrder, String strEffectiveDate,String strExpirationDate,String strProfessionalSuffix,
			CWE objAssigningJurisdiction,CWE objAssigningAgencyOrDepratment, String strSecurityCheck, String strSecurityCheckScheme)
	{
		XCN xcn  = (XCN)getDataElement(390);
		xcn.setIdNumber(strIDNumber);
		xcn.setFamilyName(objFamilyName);
		xcn.setGivenName(strGivenName);
		xcn.setSecondNameOrInitials(strSecondAndFurtherGivenNamesOrInitialsThereof);
		xcn.setSuffix(strSuffix);
		xcn.setPrefix(strPrefix);
 
		xcn.setSourceTable(objSourceTable);
		xcn.setAssigningAuthority(objAssigningAuthority);
		xcn.setNameTypeCode(strNameTypeCode);
		xcn.setIdentifierCheckDigit(strIdentifierCheckDigit);
		xcn.setCheckDigitScheme(strCheckDigitScheme);
		xcn.setIdentifierTypeCode(strIdentifierTypeCode);
		xcn.setAssigningFacility(objAssigningFacility);
		xcn.setNameRepresentationCode(strNameRepresentationCode);
		xcn.setNameContext(objNameContext);
 
		xcn.setNameAssemblyOrder(strNameAssemblyOrder);
		xcn.setEffectiveDate(strEffectiveDate);
		xcn.setExpirationDate(strExpirationDate);
		xcn.setProfessionalSuffix(strProfessionalSuffix);
		xcn.setAssigningJurisdiction(objAssigningJurisdiction);
		xcn.setAssigningAgencyOrDepartment(objAssigningAgencyOrDepratment); 
		xcn.setSecurityCheck(strSecurityCheck);
		xcn.setSecurityCheckScheme(strSecurityCheckScheme);
		addDiagnosingClinician(xcn);
	}

	/**
	 * Set the Diagnosing Clinician.
	 * This field contains the individual responsible for generating the diagnosis 
	 * information. Multiple names and identifiers for the same person may be send in 
	 * this field, not multiple diagnosing clinicians.  
	 * @param DiagnosingClinician Diagnosing Clinician.
	 */	
	public void addDiagnosingClinician(XCN DiagnosingClinician)
	{
		addDataType(390,DiagnosingClinician);
	}

	/**
	 * Set the Diagnosing Clinician list.
	 * This field define the action to be taken for this diagnosis. 
	 * @param objDiagnosingClinicianList List of Diagnosing Clinician
	 */	
	@SuppressWarnings("unchecked")
	public void setDiagnosingClinician(ISingleCollection<XCN> objDiagnosingClinicianList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objDiagnosingClinicianList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(390,objCollection);
	}


	/**
	 * Set the Diagnosis Action Code.
	 * This field define the action to be taken for this diagnosis. 
	 * @param strDiagnosisActionCode Specifies the action to be taken for this diagnosis.[Refer to HL7 Table 0206].
	 * 									Suggested Values A,D,U. 
	 */ 
	public void setDiagnosisActionCode (String strDiagnosisActionCode)
	{
		ID diagnosisActionCode  = (ID)getDataElement(1894);
		diagnosisActionCode.setValue(strDiagnosisActionCode); 
		setDiagnosisActionCode(diagnosisActionCode);

	} 

	/** Set the Diagnosis Action Code.
	 * This field define the action to be taken for this diagnosis. 
	 * @param objdiagnosisActionCode Specifies the action to be taken for this diagnosis.[Refer to HL7 Table 0206].
	 * 									Suggested Values A,D,U. 
	 */ 
	public void setDiagnosisActionCode(ID objdiagnosisActionCode)
	{
		setDataType(1894,objdiagnosisActionCode);

	}

	/**
	 * Set the Diagnosis Classification.
	 * This field indicates whether the patient information is for a diagnosis or a non-diagnosis code.  
	 * @param strIdentifier Specifies of characters (the code) that uniquely identifies the item being referenced. 
	 * @param strText Specifies The descriptive or textual name of the identifier, e.g., myocardial infarction. 
	 * @param strNameOfCodingSystem Identifies the coding scheme being used in the identifier component.
	 * @param strAlternateIdentifier Specifies an alternate sequence of characters (the code) that uniquely identifies the item being referenced.
	 * @param strAlternateText Specifies the descriptive or textual name of the alternate identifier. See usage note in section introduction.
	 * @param strNameOfAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component. 
	 * @param strCodingSystemVersionID A sequence of characters that uniquely identifies a second alternate code.
	 * @param strAlternateCodingSystemVersionId This component carries the version for the coding system identified by components 4-6.
	 * @param strOriginalText The text as seen and/or selected by the user who entered the data.
	 * @param strSecondAlternateIdentifier A sequence of characters that uniquely identifies a second alternate code.
	 * @param strSecondAlternateText The descriptive or textual name of the alternate identifier.
	 * @param strNameofSecondAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component.
	 * @param strSecondAlternateCodingSystemVersionID This component carries the version for the coding system identified by components 10-12.
	 * @param strCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.3.
	 * @param strValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.1 is obtained.
	 * @param strValueSetVersionID This component carries the version for the value set identified by CWE.15. The version is a date. The date is the date/time that the value set being used was published.
	 * @param strAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.6.
	 * @param strAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.4 is obtained.
	 * @param strAlternateValueSetVersionID This component carries the version for the value set identified by CWE.18. The version is a date.
	 * @param strSecondAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.12.
	 * @param strSecondAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.10 is obtained.
	 * @param strSecondAlternateValueSetVersionID This component carries the version for the value set identified by CWE.21. The version is a date.
	 */ 
	public void setDiagnosisClassification (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(766);
		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); 
		setDiagnosisClassification(cwe);

	} 

	/** Set the Diagnosis Classification.
	 * This field indicates whether the patient information is for a diagnosis or a non-diagnosis code.  
	 * @param objdiagnosisClassification Specifies whether the patient information is for a diagnosis or a non-diagnosis code.
	 * 										[Refer to User-defined Table 0228 - Diagnosis Classification].Suggested Values C,D,M,O,R,S,T,I
	 */ 
	public void setDiagnosisClassification(CWE objdiagnosisClassification)
	{
		setDataType(766,objdiagnosisClassification);

	}
	/**
	 * Set the Diagnosis Code DG1.
	 * This field use for compatibility with clinical and ancillary systems.
	  * @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 setDiagnosisCode_DG1 (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(377);
		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);
		setDiagnosisCode_DG1(cwe);
	}

	/**
	 * Set the Diagnosis Code DG1.
	 * This field use for compatibility with clinical and ancillary systems.
	 * @param diagnosisCode_DG1 Diagnosis Code DG1.
	 */	
	public void setDiagnosisCode_DG1(CWE diagnosisCode_DG1)
	{
		setDataType(377,diagnosisCode_DG1);
	}

	/**
	 * Set the Diagnosis Date Time.
	 * This field contains the date/time when the diagnosis is determine.
	 * @param strTime Specifies a point in time using a 24-hour clock notation. 
	 */	
	public void setDiagnosisDateTime(String strTime)
	{
		DTM diagnosisDateTime  = (DTM)getDataElement(379);
		diagnosisDateTime.setValue(strTime);

		setDiagnosisDateTime(diagnosisDateTime);
	}

	/**
	 * Set the Diagnosis Date Time.
	 * This field contains the date/time when the diagnosis is determine.
	 * @param diagnosisDateTime Diagnosis Date Time.
	 */	
	public void setDiagnosisDateTime(DTM diagnosisDateTime)
	{
		setDataType(379,diagnosisDateTime);
	}

	/**
	 * Set the Diagnosis Identifier.
	 * This field contains a value that uniquely identify a single diagnosis 
	 * for an encounter. It is unique across all segments and messages for an encounter.
	 * @param strEntityIdentifier Specifies defined by a hierarchic designator, represented by components 2 through 4.
	 * 								[Reference Section 2.A.33, "HD - hierarchic designator".] 
	 * @param strNamespaceId Specifies  the HL7 identifier for the user-defined table of values for this component.
	 * 						   [Refer to User-defined Table 0363 - Assigning authority] 	 
	 * @param strUniversalId Specifies string formatted according to the scheme defined by the component, 
	 * 							<universal ID type> (UID type). 
	 * @param strUniversalIdType Specifies  the interpretation of the second component of the HD. 
	 */	
	public void setDiagnosisIdentifier(String strEntityIdentifier,String strNamespaceId,
			String strUniversalId,String strUniversalIdType)
	{
		EI diagnosisIdentifier  = (EI)getDataElement(1850);
		diagnosisIdentifier.setEntityIdentifier(strEntityIdentifier);
		diagnosisIdentifier.setNamespaceId(strNamespaceId);
		diagnosisIdentifier.setUniversalId(strUniversalId);
		diagnosisIdentifier.setUniversalIdType(strUniversalIdType);

		setDiagnosisIdentifier(diagnosisIdentifier);
	}

	/**
	 * Set the Diagnosis Identifier.
	 * This field contains a value that uniquely identify a single diagnosis 
	 * for an encounter. It is unique across all segments and messages for an encounter.
	 * @param diagnosisIdentifier Diagnosis Identifier.
	 */	
	public void setDiagnosisIdentifier(EI diagnosisIdentifier)
	{
		setDataType(1850,diagnosisIdentifier);
	}

	/**
	 * Set the Diagnosis Priority.
	 * This field contains the number that identify the significance or priority of the diagnosis code.  
	 * @param strDiagnosisPriority This field contains the number that identifies the significance or priority of the
	 * 								 diagnosis code.[Refer to  HL7 Table 0359].Suggested Values  0,1,2 . . .
	 */ 
	public void setDiagnosisPriority (String strDiagnosisPriority)
	{
		NM diagnosisPriority  = (NM)getDataElement(389);
		diagnosisPriority.setValue(strDiagnosisPriority); 
		setDiagnosisPriority(diagnosisPriority);

	} 

	/** Set the Diagnosis Priority.
	 * This field contains the number that identify the significance or priority of the diagnosis code.  
	 * @param objdiagnosisPriority This field contains the number that identifies the significance or priority of the
	 * 								 diagnosis code.[Refer to  HL7 Table 0359].Suggested Values  0,1,2 . . .
	 */ 
	public void setDiagnosisPriority(NM objdiagnosisPriority)
	{
		setDataType(389,objdiagnosisPriority);

	}

	/**
	 * Set the Diagnosis Type.
	 * This field contains a code that identify the type of diagnosis sent.  
	  * @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 setDiagnosisType (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(380);
		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);
		setDiagnosisType(cwe);

	} 

	/** Set the Diagnosis Type.
	 * This field contains a code that identify the type of diagnosis sent.  
	 * @param objdiagnosisType This field contains a code that identifies the type of diagnosis being sent.
	 * 								[Refer to User-defined Table 0052 - Diagnosis Type]
	 * 								Sugested Values A,W,F.	
	 */ 
	public void setDiagnosisType(CWE objdiagnosisType)
	{
		setDataType(380,objdiagnosisType);

	}

	/**
	 * Set the Set ID DG1.
	 * This field contains the number that identify this transaction.  
	 * @param strSetID_DG1 This field contains the number that identifies transaction of DG1 segment.  
	 */ 
	public void setSetID_DG1 (String strSetID_DG1)
	{
		SI setID_DG1  = (SI)getDataElement(375);
		setID_DG1.setValue(strSetID_DG1); 
		setSetID_DG1(setID_DG1);

	} 

	/** Set the Set ID DG1.
	 * This field contains the number that identify this transaction.  
	 * @param objsetID_DG1 This field contains the number that identifies transaction of DG1 segment.  
	 */ 
	public void setSetID_DG1(SI objsetID_DG1)
	{
		setDataType(375,objsetID_DG1);

	}
	
	/**
	 * Set the Parent Diagnosis.
	 * This field contains the entity identifier for the parent diagnosis
	 * @param strEntityIdentifier Specifies defined by a hierarchic designator, represented by components 2 through 4.
	 * 								[Reference Section 2.A.33, "HD - hierarchic designator".] 
	 * @param strNamespaceId Specifies  the HL7 identifier for the user-defined table of values for this component.
	 * 						   [Refer to User-defined Table 0363 - Assigning authority] 	 
	 * @param strUniversalId Specifies string formatted according to the scheme defined by the component, 
	 * 							<universal ID type> (UID type). 
	 * @param strUniversalIdType Specifies  the interpretation of the second component of the HD. 
	 */ 
	public void setParentDiagnosis (String strEntityIdentifier,String strNamespaceId,
			String strUniversalId,String strUniversalIdType)
	{
		EI ParentDiagnosis  = (EI)getDataElement(2152);
		ParentDiagnosis.setEntityIdentifier(strEntityIdentifier);
		ParentDiagnosis.setNamespaceId(strNamespaceId);
		ParentDiagnosis.setUniversalId(strUniversalId);
		ParentDiagnosis.setUniversalIdType(strUniversalIdType); 
		setParentDiagnosis(ParentDiagnosis);

	} 

	/** 
	 * Set the Parent Diagnosis.
	 * This field contains the entity identifier for the parent diagnosis
	 * @param objParentDiagnosis Object of Parent Diagnosis.
	 */ 
	public void setParentDiagnosis(EI objParentDiagnosis)
	{
		setDataType(2152,objParentDiagnosis);

	}
	
	/**
	 * Set the DRG CCL Value Code.
	 * This field indicates the CCL value for the determined DRG for this diagnosis. 
	 * @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 setDRGCCLValueCode (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(2153);
		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); 
		setDRGCCLValueCode(cwe);

	} 

	/** 
	 * Set the DRG CCL Value Code.
	 * This field indicates the CCL value for the determined DRG for this diagnosis. 
	 * @param objDRGCCLValueCode Object of DRG CCL Value Code.
	 */ 
	public void setDRGCCLValueCode(CWE objDRGCCLValueCode)
	{
		setDataType(2153,objDRGCCLValueCode);

	}
	
	/**
	 * Set the DRG Grouping Usage.
	 * This field identifies whether this particular diagnosis has been used for the DRG determination.
	 * @param strDRGGroupingUsage Y   Delivery was by Caesarian Section,N	Delivery was not by Caesarian Section.
	 * 
	 */ 
	public void setDRGGroupingUsage (String strDRGGroupingUsage) 
	{
		ID DRGGroupingUsage  = (ID)getDataElement(2154);
		DRGGroupingUsage.setValue(strDRGGroupingUsage); 
		setDRGGroupingUsage(DRGGroupingUsage);

	} 

	/** Set the DRG Grouping Usage.
	 * This field identifies whether this particular diagnosis has been used for the DRG determination.
	 * @param objDRGGroupingUsage Y   Delivery was by Caesarian Section,N	Delivery was not by Caesarian Section.
	 * 
	 */ 
	public void setDRGGroupingUsage(ID objDRGGroupingUsage)
	{
		setDataType(2154,objDRGGroupingUsage);

	}
	
	/**
	 * Set the DRG Diagnosis Determination Status.
	 * This field contains the status of this particular diagnosis for the DRG determination. 
	 * @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 setDRGDiagnosisDeterminationStatus (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(2155);
		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); 
		setDRGDiagnosisDeterminationStatus(cwe);

	} 

	/** Set the DRG Diagnosis Determination Status.
	 * This field contains the status of this particular diagnosis for the DRG determination.    
	 * @param objDRGDiagnosisDeterminationStatus
	 */ 
	public void setDRGDiagnosisDeterminationStatus(CWE objDRGDiagnosisDeterminationStatus)
	{
		setDataType(2155,objDRGDiagnosisDeterminationStatus);

	}
	
	/**
	 * Set the Present On Admission (POA) Indicator.
	 * This field contains the present on admission indicator for this particular diagnosis.   
	 * @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 setPresentOnAdmissionPOAIndicator (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(2288);
		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); 
		setPresentOnAdmissionPOAIndicator(cwe);

	} 

	/** Set the Present On Admission (POA) Indicator.
	 * This field contains the present on admission indicator for this particular diagnosis.   
	 * @param objPresentOnAdmissionPOAIndicator
	 */ 
	public void setPresentOnAdmissionPOAIndicator(CWE objPresentOnAdmissionPOAIndicator)
	{
		setDataType(2288,objPresentOnAdmissionPOAIndicator);

	}

	/**
	 * Validates HL7 Message objects .
	 * Validate method checks for validation each and every segments in side the Message object against specified message Structure. 
	 * Validation chcecks include optionality of segment or group.
	 * It also verifies the number of times segment or group is repeated in message.
	 * e.g 
	 * {PSH} while parsing PSH segment validate method will check for its mandatory presence.
	 * [PSH] in this case validate will throw exception if one tries to enter more than one PSH segment. 
	 * @return boolean - true or false.
	 * @throws InvalidSegmentException Thrown when Segment Validation Fails. 
	 */
	public boolean validate()throws InvalidSegmentException
	{
		/*
		 * In this segment the field diagnosisCodingMethod is required for backward compatibility,
		 * but optional for 2.5,thus has to be checked and not yet decided for that.
		 * Also fields,diagnosisIdentifier and diagnosisActionCode are Conditional,
		 * and are required for the update diagnosis/procedures (P12) message.In all other events it is optional.
		 * So no code is added yet.
		 */
		try
		{
			//There is No check for Action Code because of This segment can be used in 
			//SnapShot and Actoin Code /Unique Identifiers mode for 
			//feature Modes for Updating Via Repeating Segments.
			super.validate();

			return true;
		}
		catch(FieldMissingException ex)
		{
			throw new InvalidSegmentException(enumSegments.getValue(),ex);
		}
	}
}