/*******************************************************************************
 *  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.MO;
import cdac.medinfo.sdk.hl7282.baselibs.SI;
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.InvalidDataTypeException;
import cdac.medinfo.sdk.hl7282.utils.EnumSegments;

/**
 * MCP - Master File Coverage Policy Segment<p>
 * The Technical Steward for the PM1 segment is Orders and Observations.
 * For the payer  defined in PM1-1 and the service provider defined in MFE-4:
 * •	When MFI-1 is MLCP (Medical Limited Coverage Process) this segment is identifing what is in limited coverage.
 * •	When MFI-1 is MACP (Medical Approved Coverage Process) this segment is identifing what is approved. This segment defines the tests that are approved for a given Diagnosis Code based on the Procedure Code.
 * <p>Represents an HL7 MCP message segment. 
 * This segment has the following fields:</p><p>
 * MCP-1: Set ID - MCP (SI)<b>Required</b><br> 
 * MCP-2: Producer's Service/Test/Observation ID (CWE)<b>Required</b><br> 
 * MCP-3: Universal Service Price Range – Low Value (MO)<b>Optional</b><br> 
 * MCP-4: Universal Service Price Range – High Value (MO)<b>Optional</b><br> 
 * MCP-5: Reason for Universal Service Cost Range (ST)<b>Conditional</b><br> 
 * 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 MCP extends Segment   
{
	

	/**
	 * Constructs the OMC segment.
	 */
	public MCP()
	{super(EnumSegments.HL7_SEG_MCP);}
	
	/**
	 * Retrieves the Set ID - MCP.
	 * This field contains the number that identifies this transaction.
	 * @return SI - SetID_MCP
	 */
	public SI getSetID_MCP() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(3468);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (SI)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Set the Set ID - MCP.
	 * This field contains the number that identifies this transaction.
	 * @param strSetID_MCP This field contains the String Value of Set ID - MCP
	 */ 
	public void setSetID_MCP (String strSetID_MCP) 
	{
		SI SetID_MCP  = (SI)getDataElement(3468);
		SetID_MCP.setValue(strSetID_MCP); 
		setSetID_MCP(SetID_MCP);

	} 

	/** 
	 * Set the Set ID - MCP.
	 * This field contains the number that identifies this transaction.
	 * @param objSetID_MCP Object of Set ID - MCP.
	 */ 
	public void setSetID_MCP(SI objSetID_MCP)
	{
		setDataType(3468,objSetID_MCP);
	}
	
	/**
	 * Retrieves the Producer Service Test Observation ID.
	 * This field contains the producer's usual or preferred identification of the test or observation.   
	 * @return CWE - producerServiceTestObservationID
	 */
	public CWE getProducerServiceTestObservationID() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(587);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Set the Producer Service Test Observation ID.
	 * This field contains the producer's usual or preferred identification of the test or observation.   
	 * @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 setProducerServiceTestObservationID (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(587);
		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); 
		setProducerServiceTestObservationID(cwe);

	} 

	/** 
	 * Set the Producer Service Test Observation ID.
	 * This field contains the producer's usual or preferred identification of the test or observation.   
	 * @param objproducerServiceTestObservationID Object of Producer Service Test Observation ID.
	 */ 
	public void setProducerServiceTestObservationID(CWE objproducerServiceTestObservationID)
	{
		setDataType(587,objproducerServiceTestObservationID);
	}
	
	/**
	 * Retrieves the Universal Service Price Range – Low Value.
	 * This field Specifies the lowest price for the Universal Service that needs to be disclosed on the payer notification to the patient (for example Medicare ABN). 
	 * @return MO - UniversalServicePriceRange_LowValue
	 */
	public MO getUniversalServicePriceRange_LowValue() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(3469);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (MO)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Set the Universal Service Price Range – Low Value.
	 * Specifies the lowest price for the Universal Service that needs to be disclosed on the payer notification to the patient (for example Medicare ABN). 
	 * @param strQuantity Specifies the Quantity.
	 * @param strDenomination Specifies the denomination in which the quantity is expressed. 
	 */ 
	public void setUniversalServicePriceRange_LowValue (String strQuantity,String strDenomination)
	{
		MO UniversalServicePriceRange_LowValue  = (MO)getDataElement(3469);
		UniversalServicePriceRange_LowValue.setQuantity(strQuantity);
		UniversalServicePriceRange_LowValue.setDenomination(strDenomination); 
		setUniversalServicePriceRange_LowValue(UniversalServicePriceRange_LowValue);
	} 

	/** 
	 * Set the Universal Service Price Range – Low Value.
	 * Specifies the lowest price for the Universal Service that needs to be disclosed on the payer notification to the patient (for example Medicare ABN). 
	 * @param objUniversalServicePriceRange_LowValue Object of  Universal Service Price Range – Low Value.
	 */ 
	public void setUniversalServicePriceRange_LowValue(MO objUniversalServicePriceRange_LowValue)
	{
		setDataType(3469,objUniversalServicePriceRange_LowValue);
	}
	
	/**
	 * Retrieves the Universal Service Price Range – High Value.
	 * Specifies the highest price for the Universal Service that needs to be disclosed on the payer notification to the patient (for example Medicare ABN). 
	 * @return MO - UniversalServicePriceRange_HighValue
	 */
	public MO getUniversalServicePriceRange_HighValue() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(3470);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (MO)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Set the Universal Service Price Range – High Value.
	 * Specifies the highest price for the Universal Service that needs to be disclosed on the payer notification to the patient (for example Medicare ABN). 
	 * @param strQuantity Specifies the Quantity.
	 * @param strDenomination Specifies the denomination in which the quantity is expressed. 
	 */ 
	public void setUniversalServicePriceRange_HighValue (String strQuantity,String strDenomination) throws InvalidDataTypeException
	{
		MO UniversalServicePriceRange_HighValue =(MO)getDataElement(3470);
		UniversalServicePriceRange_HighValue.setQuantity(strQuantity); 
		UniversalServicePriceRange_HighValue.setDenomination(strDenomination);
		setUniversalServicePriceRange_HighValue(UniversalServicePriceRange_HighValue);
	} 

	/** 
	 * Set the Universal Service Price Range – High Value.
	 * Specifies the highest price for the Universal Service that needs to be disclosed on the payer notification to the patient (for example Medicare ABN). 
	 * @param objUniversalServicePriceRange_HighValue Object of  Universal Service Price Range – High Value.
	 */ 
	public void setUniversalServicePriceRange_HighValue(MO objUniversalServicePriceRange_HighValue)
	{
		setDataType(3470,objUniversalServicePriceRange_HighValue);
	}
	
	/**
	 * Retrieves the Reason for Universal Service Cost Range.
	 * Specifies the reason for the interval between the lowest and the highest price for the Universal Service, 
	 * for example additional testing (reflex test) that is added based on values of the initial test. 
	 * @return ST - ReasonForUniversalServiceCostRange
	 */
	public ST getReasonForUniversalServiceCostRange() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(3471);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Set the Reason for Universal Service Cost Range.
	 * Specifies the reason for the interval between the lowest and the highest price for the Universal Service, 
	 * for example additional testing (reflex test) that is added based on values of the initial test. 
	 * @param strReasonForUniversalServiceCostRange String to be passed as Reason for Universal Service Cost Range
	 */ 
	public void setReasonForUniversalServiceCostRange (String strReasonForUniversalServiceCostRange) 
	{
		ST ReasonForUniversalServiceCostRange  = (ST)getDataElement(3471);
		ReasonForUniversalServiceCostRange.setValue(strReasonForUniversalServiceCostRange); 
		setReasonForUniversalServiceCostRange(ReasonForUniversalServiceCostRange);

	} 

	/** 
	 * Set the Reason for Universal Service Cost Range.
	 * Specifies the reason for the interval between the lowest and the highest price for the Universal Service, 
	 * for example additional testing (reflex test) that is added based on values of the initial test. 
	 * @param objReasonForUniversalServiceCostRange Object of Reason for Universal Service Cost Range.
	 */ 
	public void setReasonForUniversalServiceCostRange(ST objReasonForUniversalServiceCostRange)
	{
		setDataType(3471,objReasonForUniversalServiceCostRange);

	}

}
