/*******************************************************************************
 *  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.CP;
import cdac.medinfo.sdk.hl7282.baselibs.CWE;
import cdac.medinfo.sdk.hl7282.baselibs.DTM;
import cdac.medinfo.sdk.hl7282.baselibs.ID;
import cdac.medinfo.sdk.hl7282.baselibs.MO;
import cdac.medinfo.sdk.hl7282.baselibs.NM;
import cdac.medinfo.sdk.hl7282.baselibs.ST;
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;

/***
 * PRC - Pricing Segment.<p>
 * The PRC segment contains the pricing information for the preceding CDM segment's chargeable item.  
 * <p>Represents an HL7 PRC message segment. 
 * This segment has the following fields:</p><p>
 * PRC-1: Primary Key Value - PRC (CWE)<b>Required</b><br> 
 * PRC-2: Facility ID - PRC (CWE)<b>Optional</b><br> 
 * PRC-3: Department (CWE)<b>Optional</b><br> 
 * PRC-4: Valid Patient Classes (CWE)<b>Optional</b><br> 
 * PRC-5: Price (CP)<b>Conditional</b><br> 
 * PRC-6: Formula (ST)<b>Optional</b><br> 
 * PRC-7: Minimum Quantity (NM)<b>Optional</b><br> 
 * PRC-8: Maximum Quantity (NM)<b>Optional</b><br> 
 * PRC-9: Minimum Price (MO)<b>Optional</b><br> 
 * PRC-10: Maximum Price (MO)<b>Optional</b><br> 
 * PRC-11: Effective Start Date (DTM)<b>Optional</b><br> 
 * PRC-12: Effective End Date (DTM)<b>Optional</b><br> 
 * PRC-13: Price Override Flag (CWE)<b>Optional</b><br> 
 * PRC-14: Billing Category (CWE)<b>Optional</b><br> 
 * PRC-15: Chargeable Flag (ID)<b>Optional</b><br> 
 * PRC-16: Active/Inactive Flag (ID)<b>Optional</b><br> 
 * PRC-17: Cost (MO)<b>Optional</b><br> 
 * PRC-18: Charge On 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 PRC extends Segment   
{
	

	/**
	 *  Constructs the PRC segment.
	 */
	public PRC()
	{super(EnumSegments.HL7_SEG_PRC);
	}

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

	/**
	 * Retrieves the Active Inactive Flag
	 * This field indicates whether this is a usable CDM entry or not.  
	 * @return ID - active_InactiveFlag
	 */
	public ID getActive_InactiveFlag() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(675);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Billing Category.
	 * This field contains the billing category codes for any classification systems 
	 * needed, for example, general ledger codes and UB92 categories.
	 * @return ISingleCollection<CWE> - billingCategory
	 */
	public ISingleCollection<CWE> getBillingCategory() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1007);
		ISingleCollection<CWE> objDataList = new SingleCollection<CWE>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				CWE objCWE = (CWE)objDataType;
				objDataList.add(objCWE);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Chargeable Flag.
	 * This field contains a chargeable indicator. 
	 * @return ID - chargeableFlag
	 */
	public ID getChargeableFlag() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1008);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Charge On Indicator.
	 * This field contains the user-defined table of values which indicates when a charge 
	 * for services or procedures should be accrued.
	 * @return CWE - chargeOnIndicator
	 */
	public CWE getChargeOnIndicator() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1009);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Cost.
	 * This field contains the institution's calculation of how much it costs to provide this item.
	 * @return MO - cost
	 */
	public MO getCost() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(989);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (MO)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Department.
	 * This field contains the department of the facility which accrues revenue/cost for 
	 * this type of charge. 
	 * @return ISingleCollection<CWE> - department
	 */
	public ISingleCollection<CWE> getDepartment() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(676);
		ISingleCollection<CWE> objDataList = new SingleCollection<CWE>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				CWE objCWE = (CWE)objDataType;
				objDataList.add(objCWE);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Effective End Date.
	 * This field contains the date/time when this CDM entry is no longer effective.
	 * @return DTM - effectiveEndDate
	 */
	public DTM getEffectiveEndDate() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1005);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DTM)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Effective Start Date.
	 * This field contains the date/time when this CDM entry becomes effective.
	 * @return DTM - effectiveStartDate
	 */
	public DTM getEffectiveStartDate() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1004);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DTM)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Facility ID PRC.
	 * This field contains the facility of the institution for which this price(for the 
	 * preceding CDM entry) is valid.  
	 * @return ISingleCollection<CWE> - facilityID_PRC
	 */
	public ISingleCollection<CWE> getFacilityID_PRC() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(995);
		ISingleCollection<CWE> objDataList = new SingleCollection<CWE>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				CWE objCWE = (CWE)objDataType;
				objDataList.add(objCWE);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Formula.
	 * This field contains the mathematical formula to apply to PRC-5 - Price in order to compute total price. 
	 * @return ISingleCollection<ST> - formula
	 */
	public ISingleCollection<ST> getFormula() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(999);
		ISingleCollection<ST> objDataList = new SingleCollection<ST>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				ST objST = (ST)objDataType;
				objDataList.add(objST);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Maximum Price.
	 * This field contains the maximum total price (after computation of components of price) that can be charged for this item.
	 * @return MO - maximumPrice
	 */
	public MO getMaximumPrice() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1003);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (MO)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Maximum Quantity.
	 * This field contains the maximum number of identical charges allowed on one patient account for this CDM entry.
	 * @return NM - maximumQuantity
	 */
	public NM getMaximumQuantity() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1001);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (NM)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Minimum Price.
	 * This field contains the minimum total price (after computation of components of price) that can be charged for this item.
	 * @return MO - minimumPrice
	 */
	public MO getMinimumPrice() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1002);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (MO)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Minimum Quantity.
	 * This field contains the minimum number of identical charges allowed on one patient account for this CDM entry.
	 * @return NM - minimumQuantity
	 */
	public NM getMinimumQuantity() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1000);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (NM)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Price.
	 * This field contains the price to be charged for service, item, or procedure.  
	 * @return ISingleCollection<CP> - price
	 */
	public ISingleCollection<CP> getPrice() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(998);
		ISingleCollection<CP> objDataList = new SingleCollection<CP>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				CP objCP = (CP)objDataType;
				objDataList.add(objCP);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Price Override Flag.
	 * This field indicates whether this CDM entry's price can be overridden or not.
	 * @return CWE - priceOverrideFlag
	 */
	public CWE getPriceOverrideFlag() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1006);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Primary Key Value PRC.
	 * This field contains the code assigned by the institution for the purpose of uniquely identifying the thing that can be charged.
	 * @return CWE - primaryKeyValue_PRC
	 */
	public CWE getPrimaryKeyValue_PRC() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(982);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Valid Patient Classes.
	 * This field contains the patient types for which this charge description is valid.
	 * @return ISingleCollection<CWE> - validPatientClasses
	 */
	public ISingleCollection<CWE> getValidPatientClasses() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(967);
		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;
	}

	/**
	 * Set the Primary Key Value PRC.
	 * This field contains the code assigned by the institution for the purpose of uniquely identifying the thing that can be charged.  
	 * @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_PRC(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(982);
		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_PRC(cwe);
	}

	/**
	 * Set the Primary Key Value PRC.
	 * This field contains the code assigned by the institution for the purpose of uniquely identifying the thing that can be charged.
	 * @param objprimaryKeyValue_PRC Object of Primary Key Value PRC.
	 */
	public void setPrimaryKeyValue_PRC(CWE objprimaryKeyValue_PRC)
	{
		setDataType(982,objprimaryKeyValue_PRC);
	}

	/**
	 * Add the Facility ID PRC.
	 * This field contains the facility of the institution for which this price(for the 
	 * preceding CDM entry) is valid.  
	 * @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 addFacilityID_PRC(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(995);
		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);
		addFacilityID_PRC(cwe);
	}

	/**
	 * Add the Facility ID PRC.
	 * This field contains the facility of the institution for which this price(for the 
	 * preceding CDM entry) is valid.
	 * @param objfacilityID_PRC Object of Facility ID PRC.
	 */
	public void addFacilityID_PRC(CWE objfacilityID_PRC)
	{
		addDataType(995,objfacilityID_PRC);
	}

	/**
	 * Set the Facility ID PRC.
	 * This field contains the facility of the institution for which this price(for the 
	 * preceding CDM entry) is valid.
	 * @param objfacilityID_PRCList List of Facility ID PRC.
	 */
	@SuppressWarnings("unchecked")
	public void setFacilityID_PRC(ISingleCollection<CWE> objfacilityID_PRCList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objfacilityID_PRCList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(995,objCollection);
	}

	/**
	 * Add the Department.
	 * This field contains the department of the facility which accrues revenue/cost for 
	 * this type of charge.   
	 * @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 addDepartment(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(676);
		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);
		addDepartment(cwe);
	}

	/**
	 * Add the Department.
	 * This field contains the department of the facility which accrues revenue/cost for 
	 * this type of charge.
	 * @param objdepartment Object of Department.
	 */
	public void addDepartment(CWE objdepartment)
	{
		addDataType(676,objdepartment);
	}

	/**
	 * Set the Department.
	 * This field contains the department of the facility which accrues revenue/cost for 
	 * this type of charge.
	 * @param objdepartmentList List of Department.
	 */
	@SuppressWarnings("unchecked")
	public void setDepartment(ISingleCollection<CWE> objdepartmentList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objdepartmentList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(676,objCollection);
	}

	/**
	 * Add the Valid Patient Classes.
	 * This field contains the patient types for which this charge description is valid.    
	 * @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 addValidPatientClasses(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(967);
		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);
		addValidPatientClasses(cwe);
	}

	/**
	 * Add the Valid Patient Classes.
	 * This field contains the patient types for which this charge description is valid.
	 * @param objvalidPatientClasses Object of Valid Patient Classes.
	 */
	public void addValidPatientClasses(CWE objvalidPatientClasses)
	{
		addDataType(967,objvalidPatientClasses);
	}

	/**
	 * Set the Valid Patient Classes.
	 * This field contains the patient types for which this charge description is valid.
	 * @param objvalidPatientClassesList List of Valid Patient Classes.
	 */
	@SuppressWarnings("unchecked")
	public void setValidPatientClasses(ISingleCollection<CWE> objvalidPatientClassesList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objvalidPatientClassesList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(967,objCollection);
	}

	/**
	 * Add the Price.
	 * This field contains the price to be charged for service, item, or procedure.
	 * @param objPrice Specifies an amount of money and the denomination in which it is expressed.
	 * @param strPriceType Specifies a coded value, data type ID.[Refer to HL7 Table 0205]
	 * 						  Suggested Values AP,DC,IC,PF,TF,TP,UP. 
	 * @param strFromValue Specifies the "range" alongwith strToValue.  
	 * @param strToValue Specifies the "range" alongwith strFromValue.
	 * @param objRangeUnits Specifies This describes the units associated with the range, e.g., seconds, minutes
	 * @param strRangeType Refer to HL7 Table 0298 - CP range type for valid values.(P,F)
	 */	
	public void addPrice(MO objPrice,String strPriceType,String strFromValue,String strToValue,
			CWE objRangeUnits,String strRangeType)
	{
		CP price = (CP)getDataElement(998);
		price.setPrice(objPrice);
		price.setPriceType(strPriceType);
		price.setFromValue(strFromValue);
		price.setToValue(strToValue);
		price.setRangeUnits(objRangeUnits);
		price.setRangeType(strRangeType);
		addPrice(price);
	}

	/**
	 * Add the Price.
	 * This field contains the price to be charged for service, item, or procedure.
	 * @param objprice Object of Price.
	 */
	public void addPrice(CP objprice)
	{
		addDataType(998,objprice);
	}

	/**
	 * Set the Price.
	 * This field contains the price to be charged for service, item, or procedure.
	 * @param objpriceList List of Price.
	 */
	@SuppressWarnings("unchecked")
	public void setPrice(ISingleCollection<CP> objpriceList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objpriceList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(998,objCollection);
	}

	/**
	 * Add the Formula.
	 * This field contains the mathematical formula to apply to PRC-5 - Price in order to compute total price.
	 * @param strFormula String value of formula.
	 */
	public void addFormula(String strFormula) 
	{
		ST formula  = (ST)getDataElement(999);
		formula.setValue(strFormula);
		addFormula(formula);
	}

	/**
	 * Add the Formula.
	 * This field contains the mathematical formula to apply to PRC-5 - Price in order to compute total price.
	 * @param objformula Object of Formula.
	 */
	public void addFormula(ST objformula)
	{
		addDataType(999,objformula);
	}

	/**
	 * Set the Formula.
	 * This field contains the mathematical formula to apply to PRC-5 - Price in order to compute total price.
	 * @param objformulaList List of Formula.
	 */
	@SuppressWarnings("unchecked")
	public void setFormula(ISingleCollection<ST> objformulaList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objformulaList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(999,objCollection);
	}

	/** 
	 * Set the Minimum Quantity.
	 * This field contains the minimum number of identical charges allowed on one patient account for this CDM entry.
	 * @param strMinimumQuantity Specifies the maximum number of days that the insurance policy will cover.
	 */ 
	public void setMinimumQuantity (String strMinimumQuantity) 
	{
		NM minimumQuantity  = (NM)getDataElement(1000);
		minimumQuantity.setValue(strMinimumQuantity); 
		setMinimumQuantity(minimumQuantity);

	} 

	/** 
	 * Set the Minimum Quantity.
	 * This field contains the minimum number of identical charges allowed on one patient account for this CDM entry.
	 * @param objminimumQuantity Object of Minimum Quantity.
	 */ 
	public void setMinimumQuantity(NM objminimumQuantity)
	{
		setDataType(1000,objminimumQuantity);

	}

	/** 
	 * Set the Maximum Quantity.
	 * This field contains the maximum number of identical charges allowed on one patient account for this CDM entry.
	 * @param strMaximumQuantity Specifies the maximum number of days that the insurance policy will cover.
	 */ 
	public void setMaximumQuantity (String strMaximumQuantity) 
	{
		NM maximumQuantity  = (NM)getDataElement(1001);
		maximumQuantity.setValue(strMaximumQuantity); 
		setMaximumQuantity(maximumQuantity);

	} 

	/** 
	 * Set the Maximum Quantity.
	 * This field contains the maximum number of identical charges allowed on one patient account for this CDM entry.
	 * @param objmaximumQuantity Object of Maximum Quantity.
	 */ 
	public void setMaximumQuantity(NM objmaximumQuantity)
	{
		setDataType(1001,objmaximumQuantity);

	}

	/**
	 * Set the Minimum Price.
	 * This field contains the minimum total price (after computation of components of price) that can be charged for this item.
	 * @param strQuantity Specifies the Quantity.
	 * @param strDenomination Specifies the denomination in which the quantity is expressed. 
	 */ 
	public void setMinimumPrice (String strQuantity,String strDenomination)
	{
		MO minimumPrice  = (MO)getDataElement(1002);
		minimumPrice.setQuantity(strQuantity);
		minimumPrice.setDenomination(strDenomination);
		setMinimumPrice(minimumPrice);
	} 

	/** 
	 * Set the Minimum Price.
	 * This field contains the minimum total price (after computation of components of price) that can be charged for this item.
	 * @param objminimumPrice Object of  Minimum Price.
	 */ 
	public void setMinimumPrice(MO objminimumPrice)
	{
		setDataType(1002,objminimumPrice);


	}

	/**
	 * Set the Maximum Price.
	 * This field contains the maximum total price (after computation of components of price) that can be charged for this item.
	 * @param strQuantity Specifies the Quantity.
	 * @param strDenomination Specifies the denomination in which the quantity is expressed. 
	 */ 
	public void setMaximumPrice (String strQuantity,String strDenomination)
	{
		MO maximumPrice  = (MO)getDataElement(1003);
		maximumPrice.setQuantity(strQuantity);
		maximumPrice.setDenomination(strDenomination); 
		setMaximumPrice(maximumPrice);


	} 

	/** 
	 * Set the Maximum Price.
	 * This field contains the maximum total price (after computation of components of price) that can be charged for this item.
	 * @param objmaximumPrice Object of  Maximum Price.
	 */ 
	public void setMaximumPrice(MO objmaximumPrice)
	{
		setDataType(1003,objmaximumPrice);


	}

	/**
	 * Set the Effective Start Date.
	 * This field contains the date/time when this CDM entry becomes effective.  
	 * @param strDate Specifies a point in time using a 24-hour clock notation. 
	 */ 
	public void setEffectiveStartDate (String strDate) 
	{
		DTM effectiveStartDate  = (DTM)getDataElement(1004);
		effectiveStartDate.setValue(strDate);
		setEffectiveStartDate(effectiveStartDate);

	} 

	/** 
	 * Set the Effective Start Date.
	 * This field contains the date/time when this CDM entry becomes effective.
	 * @param objeffectiveStartDate Object of Effective Start Date.
	 */ 
	public void setEffectiveStartDate(DTM objeffectiveStartDate)
	{
		setDataType(1004,objeffectiveStartDate);

	}

	/**
	 * Set the Effective End Date.
	 * This field contains the date/time when this CDM entry is no longer effective.
	 * @param strDate Specifies a point in time using a 24-hour clock notation. 
	 */ 
	public void setEffectiveEndDate (String strDate) 
	{
		DTM effectiveEndDate  = (DTM)getDataElement(1005);
		effectiveEndDate.setValue(strDate);
		setEffectiveEndDate(effectiveEndDate);

	} 

	/** 
	 * Set the Effective End Date.
	 * This field contains the date/time when this CDM entry is no longer effective.
	 * @param objeffectiveEndDate Object of Effective End Date. 
	 */ 
	public void setEffectiveEndDate(DTM objeffectiveEndDate)
	{
		setDataType(1005,objeffectiveEndDate);

	}

	/**
	 * Set the Price Override Flag.
	 * This field indicates whether this CDM entry's price can be overridden or not.
	 * @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 setPriceOverrideFlag (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(1006);
		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); 
		setPriceOverrideFlag(cwe);

	} 

	/** 
	 * Set the Price Override Flag.
	 * This field indicates whether this CDM entry's price can be overridden or not.
	 * @param objpriceOverrideFlag Object of Price Override Flag.
	 */ 
	public void setPriceOverrideFlag(CWE objpriceOverrideFlag)
	{
		setDataType(1006,objpriceOverrideFlag);

	}

	/**
	 * Add the Billing Category.
	 * This field contains the billing category codes for any classification systems 
	 * needed, for example, general ledger codes and UB92 categories.
	 * @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 addBillingCategory(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(1007);
		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);
		addBillingCategory(cwe);
	}

	/**
	 * Add the Billing Category.
	 * This field contains the billing category codes for any classification systems 
	 * needed, for example, general ledger codes and UB92 categories.
	 * @param objbillingCategory Object of Billing Category.
	 */
	public void addBillingCategory(CWE objbillingCategory)
	{
		addDataType(1007,objbillingCategory);
	}

	/**
	 * Set the Billing Category.
	 * This field contains the billing category codes for any classification systems 
	 * needed, for example, general ledger codes and UB92 categories.
	 * @param objbillingCategoryList List of Billing Category.
	 */
	@SuppressWarnings("unchecked")
	public void setBillingCategory(ISingleCollection<CWE> objbillingCategoryList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objbillingCategoryList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(1007,objCollection);
	}

	/**
	 * Set the Chargeable Flag.
	 * This field contains a chargeable indicator.
	 * @param strChargeableFlag String shows the action to be taken . 
	 */ 
	public void setChargeableFlag (String strChargeableFlag) 
	{
		ID chargeableFlag  = (ID)getDataElement(1008);
		chargeableFlag.setValue(strChargeableFlag); 
		setChargeableFlag(chargeableFlag);

	} 

	/** 
	 * Set the Chargeable Flag.
	 * This field contains a chargeable indicator.
	 * @param objchargeableFlag Object of Chargeable Flag.
	 */ 
	public void setChargeableFlag(ID objchargeableFlag)
	{
		setDataType(1008,objchargeableFlag);

	}

	/**
	 * Set the Active Inactive Flag
	 * This field indicates whether this is a usable CDM entry or not.
	 * @param strActive_InactiveFlag String shows the action to be taken . 
	 */ 
	public void setActive_InactiveFlag (String strActive_InactiveFlag) 
	{
		ID active_InactiveFlag  = (ID)getDataElement(675);
		active_InactiveFlag.setValue(strActive_InactiveFlag); 
		setActive_InactiveFlag(active_InactiveFlag);

	} 

	/** 
	 * Set the Active Inactive Flag
	 * This field indicates whether this is a usable CDM entry or not.
	 * @param objactive_InactiveFlag Object of Active Inactive Flag
	 */ 
	public void setActive_InactiveFlag(ID objactive_InactiveFlag)
	{
		setDataType(675,objactive_InactiveFlag);

	}

	/**
	 * Set the Cost.
	 * This field contains the institution's calculation of how much it costs to provide this item.
	 * @param strQuantity Specifies the Quantity.
	 * @param strDenomination Specifies the denomination in which the quantity is expressed. 
	 */ 
	public void setCost (String strQuantity,String strDenomination)
	{
		MO cost  = (MO)getDataElement(989);
		cost.setQuantity(strQuantity);
		cost.setDenomination(strDenomination); 
		setCost(cost);


	} 

	/** 
	 * Set the Cost.
	 * This field contains the institution's calculation of how much it costs to provide this item.
	 * @param objcost Object of Cost.  
	 */ 
	public void setCost(MO objcost)
	{
		setDataType(989,objcost);


	}

	/**
	 * Set the Charge On Indicator.
	 * This field contains the user-defined table of values which indicates when a charge 
	 * for services or procedures should be accrued.
	 * @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 setChargeOnIndicator (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(1009);
		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);
		setChargeOnIndicator(cwe);

	} 

	/** 
	 * Set the Charge On Indicator.
	 * This field contains the user-defined table of values which indicates when a charge 
	 * for services or procedures should be accrued.
	 * @param objchargeOnIndicator Object of Charge On Indicator.
	 */ 
	public void setChargeOnIndicator(CWE objchargeOnIndicator)
	{
		setDataType(1009,objchargeOnIndicator);

	}

	/**
	 * Validates HL7 Message objects .
	 * Validate method checks for validation each and every segments in side the Message object against specified message Structure. 
	 * Validation checks 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 
	{
		try
		{
			/*
			 * PrimaryKeyValue_PRC is a required field.
			 */
			//Condition for Segment Price not clear.
			/*
			 * Segment Price is conditional field. 
			 * Condition rule : .  If CDM price will always be overridden when charges are posted, then this field is optional.
			 * Otherwise, price would be a required field.
			 */
			super.validate();

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