/*******************************************************************************
 *  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.DT;
import cdac.medinfo.sdk.hl7282.baselibs.EI;
import cdac.medinfo.sdk.hl7282.baselibs.ID;
import cdac.medinfo.sdk.hl7282.baselibs.PIP;
import cdac.medinfo.sdk.hl7282.baselibs.PLN;
import cdac.medinfo.sdk.hl7282.baselibs.SI;
import cdac.medinfo.sdk.hl7282.baselibs.SPD;
import cdac.medinfo.sdk.hl7282.commoninterface.IDataType;
import cdac.medinfo.sdk.hl7282.commoninterface.ISingleCollection;
import cdac.medinfo.sdk.hl7282.exceptions.InvalidSegmentException;
import cdac.medinfo.sdk.hl7282.utils.EnumSegments;
import cdac.medinfo.sdk.hl7282.utils.SingleCollection;

/***
 * PRA - Practitioner Detail Segment   <p>
 * The PRA segment adds detailed medical practitioner information to the personnel identified by the STF segment.       
 * <p>Represents an HL7 PRA message segment. 
 * This segment has the following fields:</p><p>
 * PRA-1: Primary Key Value - PRA (CWE)<b>Conditional</b><br> 
 * PRA-2: Practitioner Group (CWE)<b>Optional</b><br> 
 * PRA-3: Practitioner Category (CWE)<b>Optional</b><br> 
 * PRA-4: Provider Billing (ID)<b>Optional</b><br> 
 * PRA-5: Specialty (SPD)<b>Optional</b><br> 
 * PRA-6: Practitioner ID Numbers (PLN)<b>Backward</b><br> 
 * PRA-7: Privileges (PIP)<b>Optional</b><br> 
 * PRA-8: Date Entered Practice (DT)<b>Optional</b><br> 
 * PRA-9: Institution (CWE)<b>Optional</b><br> 
 * PRA-10: Date Left Practice (DT)<b>Optional</b><br> 
 * PRA-11: Government Reimbursement Billing Eligibility (CWE)<b>Optional</b><br> 
 * PRA-12: Set ID - PRA (SI)<b>Conditional</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 PRA extends Segment   
{
	

	/**
	 *  Constucts the PRA segment.
	 */
	public PRA()
	{super(EnumSegments.HL7_SEG_PRA);	
	}

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

	/**
	 * Retrieves the Date Entered Practice.
	 * This field contains the date, the practitioner begin practicing at the present institution. 
	 * @return DT - dateEnteredPractice
	 */
	public DT getDateEnteredPractice() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1296);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DT)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Date Left Practice.
	 * This field contains the date the practitioner ended or intends to end practicing at the given institution.
	 * @return DT - dateLeftPractice
	 */
	public DT getDateLeftPractice() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1348);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DT)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Government Reimbursement Billing Eligibility.
	 * This field contains a code that indicates the agency that the practitioner is authorized to bill for medical services. 
	 * @return ISingleCollection<CWE> - governmentReimbursementBillingEligibility
	 */
	public ISingleCollection<CWE> getGovernmentReimbursementBillingEligibility() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1388);
		ISingleCollection<CWE> objDataList = new SingleCollection<CWE>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				CWE objCE = (CWE)objDataType;
				objDataList.add(objCE);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Institution.
	 * This field contains the institution, the practitioner begin or intends to begin practicing at  hospital, or at physician organization, or at managed care network.  
	 * @return CWE - institution
	 */
	public CWE getInstitution() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1613);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Practitioner Category.
	 * @return ISingleCollection<CWE> - practitionerCategory
	 */
	public ISingleCollection<CWE> getPractitionerCategory() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(687);
		ISingleCollection<CWE> objDataList = new SingleCollection<CWE>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				CWE objIS = (CWE)objDataType;
				objDataList.add(objIS);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Practitioner Group.
	 * This field contains the name and/or code of a group of practitioners to which this practitioner belongs. 
	 * @return ISingleCollection<CWE> - practitionerGroup
	 */
	public ISingleCollection<CWE> getPractitionerGroup() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(686);
		ISingleCollection<CWE> objDataList = new SingleCollection<CWE>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				CWE objCE = (CWE)objDataType;
				objDataList.add(objCE);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Practitioner ID Numbers.
	 * This field contains this practitioner's license numbers and other ID numbers.  
	 * @return ISingleCollection<PLN> - practitionerIDNumbers
	 */
	public ISingleCollection<PLN> getPractitionerIDNumbers() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(690);
		ISingleCollection<PLN> objDataList = new SingleCollection<PLN>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				PLN objPLN = (PLN)objDataType;
				objDataList.add(objPLN);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Primary Key Value PRA.
	 * This field identify which entry is being referenced.  
	 * @return CWE - primaryKeyValue_PRA
	 */
	public CWE getPrimaryKeyValue_PRA() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(685);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Privileges.
	 * This field contains the institutional privileges which this provider may exercise.
	 * @return ISingleCollection<PIP> - privileges
	 */
	public ISingleCollection<PIP> getPrivileges() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(691);
		ISingleCollection<PIP> objDataList = new SingleCollection<PIP>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				PIP objPIP = (PIP)objDataType;
				objDataList.add(objPIP);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Provider Billing.
	 * This field indicates how provider services are billed.  
	 * @return ID - providerBilling
	 */
	public ID getProviderBilling() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(688);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Set ID PRA.
	 * This field contains the number that identifies this transaction.  
	 * @return SI - setID_PRA
	 */
	public SI getSetID_PRA() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1616);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (SI)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Specialty.
	 * This field contains multiple components to record the practitioner-s specialties.  
	 * @return ISingleCollection<SPD> - specialty
	 */
	public ISingleCollection<SPD> getSpecialty() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(689);
		ISingleCollection<SPD> objDataList = new SingleCollection<SPD>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				SPD objSPD = (SPD)objDataType;
				objDataList.add(objSPD);
			}
		}
		return objDataList;
	}

	/**
	 * Set the Primary Key Value PRA.
	 * This field identify which entry is being referenced.
	 * @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 setPrimaryKeyValue_PRA(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(685);
		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);
		setPrimaryKeyValue_PRA(cwe);
	}

	/**
	 * Set the Primary Key Value PRA.
	 * This field identify which entry is being referenced.
	 * @param objPrimaryKeyValue_PRA Object of Primary Key Value PRA.
	 */
	public void setPrimaryKeyValue_PRA(CWE objPrimaryKeyValue_PRA)
	{
		setDataType(685,objPrimaryKeyValue_PRA);
	}

	/**
	 * Add the Practitioner Group.
	 * This field contains the name and/or code of a group of practitioners to which this practitioner belongs.
	 * @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 addPractitionerGroup(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(686);
		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);
		addPractitionerGroup(cwe);
	}

	/**
	 * Add the Practitioner Group.
	 * This field contains the name and/or code of a group of practitioners to which this practitioner belongs.
	 * @param objPractitionerGroup Object of Practitioner Group.
	 */
	public void addPractitionerGroup(CWE objPractitionerGroup)
	{
		addDataType(686,objPractitionerGroup);
	}

	/**
	 * Set the Practitioner Group.
	 * This field contains the name and/or code of a group of practitioners to which this practitioner belongs.
	 * @param objPractitionerGroupList List of Practitioner Group.
	 */
	@SuppressWarnings("unchecked")
	public void setPractitionerGroup(ISingleCollection<CWE> objPractitionerGroupList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objPractitionerGroupList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(686,objCollection);
	}

	/**
	 * Add the Practitioner Category.
	 * @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 addPractitionerCategory(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(687);
		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);
		addPractitionerCategory(cwe);
	}

	/**
	 * Add the Practitioner Category.
	 * @param objPractitionerCategory Object of Practitioner Category.
	 */
	public void addPractitionerCategory(CWE objPractitionerCategory)
	{
		addDataType(687,objPractitionerCategory);
	}

	/**
	 * Set the Practitioner Category.
	 * @param objPractitionerCategoryList List of Practitioner Category.
	 */
	@SuppressWarnings("unchecked")
	public void setPractitionerCategory(ISingleCollection<CWE> objPractitionerCategoryList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objPractitionerCategoryList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(687,objCollection);
	}

	/**
	 * Set the Provider Billing.
	 * This field indicates how provider services are billed.
	 * @param strProviderBilling String shows the value of Provider Billing. 
	 */
	public void setProviderBilling(String strProviderBilling) 
	{
		ID providerBilling  = (ID)getDataElement(688);
		providerBilling.setValue(strProviderBilling);
		setProviderBilling(providerBilling);
	}

	/**
	 * Set the Provider Billing.
	 * This field indicates how provider services are billed.
	 * @param objProviderBilling Object of Provider Billing.
	 */
	public void setProviderBilling(ID objProviderBilling)
	{
		setDataType(688,objProviderBilling);
	}

	/**
	 * Add the Specialty.
	 * This field contains multiple components to record the practitioner's specialties.  
	 * @param strSpecialtyName Identifies the provider's specialty.
	 * @param strGoverningBoard Identifies the governing body providing for the specialty.
	 * @param strEligibleOrCertified Specifies the certification status. 
	 * @param strDateOfCertification Specifies when certification occurred.
	 */
	public void addSpecialty(String strSpecialtyName,String strGoverningBoard,String strEligibleOrCertified,String strDateOfCertification) 
	{
		SPD specialty  = (SPD)getDataElement(689);
		specialty.setSpecialtyName(strSpecialtyName);
		specialty.setGoverningBoard(strGoverningBoard);
		specialty.setEligibleOrCertified(strEligibleOrCertified);
		specialty.setDateOfCertification(strDateOfCertification);
		addSpecialty(specialty);
	}

	/**
	 * Add the Specialty.
	 * This field contains multiple components to record the practitioner's specialties. 
	 * @param objSpecialty Object of Specialty.
	 */
	public void addSpecialty(SPD objSpecialty)
	{
		addDataType(689,objSpecialty);
	}

	/**
	 * Set the Specialty.
	 * This field contains multiple components to record the practitioner's specialties.
	 * @param objSpecialtyList List of Specialty.
	 */
	@SuppressWarnings("unchecked")
	public void setSpecialty(ISingleCollection<SPD> objSpecialtyList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objSpecialtyList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(689,objCollection);
	}

	/**
	 * Add the Practitioner ID Numbers.
	 * This field contains this practitioner's license numbers and other ID numbers.
	 * @param strIdNumber Specifies the license number or other ID number such as UPIN, Medicare and Medicaid number.
	 * @param objTypeOfIdNumber Specifies the type of number.
	 * @param strStateOtherQualifyingInfo Specifies the state or province in which the license or ID is valid
	 * @param strExpirationDate Specifies the date when the license or ID is no longer valid.
	 */
	public void addPractitionerIDNumbers(String strIdNumber,CWE objTypeOfIdNumber,String strStateOtherQualifyingInfo,String strExpirationDate) 
	{
		PLN practitionerIDNumbers  = (PLN)getDataElement(690);
		practitionerIDNumbers.setIdNumber(strIdNumber);
		practitionerIDNumbers.setTypeOfIdNumber(objTypeOfIdNumber);
		practitionerIDNumbers.setStateOtherQualifyingInformation(strStateOtherQualifyingInfo);
		practitionerIDNumbers.setExpirationDate(strExpirationDate);
		addPractitionerIDNumbers(practitionerIDNumbers);
	}

	/**
	 * Add the Practitioner ID Numbers.
	 * This field contains this practitioner's license numbers and other ID numbers.
	 * @param objPractitionerIDNumbers Object of Practitioner ID Numbers.
	 */
	public void addPractitionerIDNumbers(PLN objPractitionerIDNumbers)
	{
		addDataType(690,objPractitionerIDNumbers);
	}

	/**
	 * Set the Practitioner ID Numbers.
	 * This field contains this practitioner's license numbers and other ID numbers.
	 * @param objPractitionerIDNumbersList List of Practitioner ID Numbers.
	 */
	@SuppressWarnings("unchecked")
	public void setPractitionerIDNumbers(ISingleCollection<PLN> objPractitionerIDNumbersList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objPractitionerIDNumbersList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(690,objCollection);
	}

	/**
	 * Add the Privileges.
	 * This field contains the institutional privileges which this provider may exercise.  
	 * @param objPrivilege Specifies the institutional privilege itself. 
	 * @param objPrivilegeClass Specifies the class category of institutional privilege. 
	 * @param strExpirationDate Specifies the date the institutional privilege is/was no longer valid.
	 * @param strActivationDate Specifies the date the institutional privilege became/becomes valid.
	 * @param objFacility Specifies the facility in which the institutional privilege is/was valid.
	 */
	public void addPrivileges(CWE objPrivilege,CWE objPrivilegeClass,String strExpirationDate,String strActivationDate,
			EI objFacility)
	{
		PIP privileges = (PIP)getDataElement(691);
		privileges.setPrivilege(objPrivilegeClass);
		privileges.setPrivilegeClass(objPrivilegeClass);
		privileges.setExpirationDate(strExpirationDate);
		privileges.setActivationDate(strActivationDate);
		privileges.setFacility(objFacility);
		addPrivileges(privileges);
	}

	/**
	 * Add the Privileges.
	 * This field contains the institutional privileges which this provider may exercise.
	 * @param objPrivileges Object of Privileges.
	 */
	public void addPrivileges(PIP objPrivileges)
	{
		addDataType(691,objPrivileges);
	}


	/**
	 * Set the Privileges.
	 * This field contains the institutional privileges which this provider may exercise.
	 * @param objPrivilegesList List of Privileges.
	 */
	@SuppressWarnings("unchecked")
	public void setPrivileges(ISingleCollection<PIP> objPrivilegesList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objPrivilegesList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(691,objCollection);
	}

	/**
	 * Set the Date Entered Practice.
	 * This field contains the date, the practitioner begin practicing at the present institution. 
	 * @param strDateEnteredPractice The string value shows Date Entered Practice.
	 */
	public void setDateEnteredPractice(String strDateEnteredPractice) 
	{
		DT dateEnteredPractice  = (DT)getDataElement(1296);
		dateEnteredPractice.setValue(strDateEnteredPractice);
		setDateEnteredPractice(dateEnteredPractice);
	}

	/**
	 * Set the Date Entered Practice.
	 * This field contains the date, the practitioner begin practicing at the present institution.
	 * @param objDateEnteredPractice Object of Date Entered Practice.
	 */
	public void setDateEnteredPractice(DT objDateEnteredPractice)
	{
		setDataType(1296,objDateEnteredPractice);
	}

	/**
	 * Set the Institution.
	 * This field contains the institution, the practitioner begin or intends to begin practicing at  hospital, or at physician organization, or at managed care network.     
	 * @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 setInstitution(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(1613);
		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);
		setInstitution(cwe);
	}

	/**
	 * Set the Institution.
	 * This field contains the institution, the practitioner begin or intends to begin practicing at  hospital, or at physician organization, or at managed care network.
	 * @param objInstitution Object of Institution.
	 */
	public void setInstitution(CWE objInstitution)
	{
		setDataType(1613,objInstitution);
	}

	/**
	 * Set the Date Left Practice.
	 * This field contains the date the practitioner ended or intends to end practicing at the given institution.
	 * @param strDateLeftPractice The string value shows Date Left Practice.
	 */
	public void setDateLeftPractice(String strDateLeftPractice) 
	{
		DT dateLeftPractice  = (DT)getDataElement(1348);
		dateLeftPractice.setValue(strDateLeftPractice);
		setDateLeftPractice(dateLeftPractice);
	}

	/**
	 * Set the Date Left Practice.
	 * This field contains the date the practitioner ended or intends to end practicing at the given institution.
	 * @param objDateLeftPractice Object of Date Left Practice.
	 */
	public void setDateLeftPractice(DT objDateLeftPractice)
	{
		setDataType(1348,objDateLeftPractice);
	}

	/**
	 * Add the Government Reimbursement Billing Eligibility.
	 * This field contains a code that indicates the agency that the practitioner is authorized to bill for medical services.
	 * @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 addGovernmentReimbursementBillingEligibility(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(1388);
		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);
		addGovernmentReimbursementBillingEligibility(cwe);
	}

	/**
	 * Add the Government Reimbursement Billing Eligibility.
	 * This field contains a code that indicates the agency that the practitioner is authorized to bill for medical services.
	 * @param objGovernmentReimbursementBillingEligibility Object of Government Reimbursement Billing Eligibility.
	 */
	public void addGovernmentReimbursementBillingEligibility(CWE objGovernmentReimbursementBillingEligibility)
	{
		addDataType(1388,objGovernmentReimbursementBillingEligibility);
	}

	/**
	 * Set the Government Reimbursement Billing Eligibility.
	 * This field contains a code that indicates the agency that the practitioner is authorized to bill for medical services.
	 * @param objGovernmentReimbursementBillingEligibilityList List of Government Reimbursement Billing Eligibility.
	 */
	@SuppressWarnings("unchecked")
	public void setGovernmentReimbursementBillingEligibility(ISingleCollection<CWE> objGovernmentReimbursementBillingEligibilityList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objGovernmentReimbursementBillingEligibilityList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(1388,objCollection);
	}

	/**
	 * Set the Set ID PRA.
	 * This field contains the number that identifies this transaction.
	 * @param strSetID_PRA This field contains the number that identifies PRA transaction. 
	 */	
	public void setSetID_PRA(String strSetID_PRA) 
	{
		SI setID_PRA  = (SI)getDataElement(1616);
		setID_PRA.setValue(strSetID_PRA);
		setSetID_PRA(setID_PRA);
	}

	/**
	 * Set the Set ID PRA.
	 * This field contains the number that identifies this transaction.
	 * @param objSetID_PRA Object of Set ID PRA.
	 */
	public void setSetID_PRA(SI objSetID_PRA)
	{
		setDataType(1616,objSetID_PRA);
	}

	/**
	 * 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.
	 */
	@Override
	public boolean validate() throws InvalidSegmentException 
	{
		//Condition for PrimaryKeyValue_PRA not clear.
		/*
		 * PrimaryKeyValue_PRA is conditional field. 
		 * Condition rule : For MFN Master File Notification, this field is required and must match MFE-4-primary key value,
		 * to identify which entry is being referenced.      
		 */

		//Condition for SetID_PRA not clear.
		/*
		 * SetID_PRA is conditional field. 
		 * Condition rule : For all messages except the Staff/Practitioner Master File Notification,this field is required.      
		 */
		super.validate();

		return true;
	}
}