/*******************************************************************************
 *  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.CNE;
import cdac.medinfo.sdk.hl7282.baselibs.CWE;
import cdac.medinfo.sdk.hl7282.baselibs.MO;
import cdac.medinfo.sdk.hl7282.baselibs.NM;
import cdac.medinfo.sdk.hl7282.baselibs.OCD;
import cdac.medinfo.sdk.hl7282.baselibs.OSP;
import cdac.medinfo.sdk.hl7282.baselibs.SI;
import cdac.medinfo.sdk.hl7282.baselibs.ST;
import cdac.medinfo.sdk.hl7282.baselibs.UVC;
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;

/**
 * UB2 - UniformBilling Data Segment.<p>
 * The UB2 segment contains data necessary to complete UniformBilling bills specific to the United States; other realms may choose to implement using regional code sets.
 * <p>Represents an HL7 UB2 message segment. 
 * This segment has the following fields:</p><p>
 * UB2-1: Set ID - UB2 (SI)<b>Optional</b><br> 
 * UB2-2: Co-Insurance Days (9) (ST)<b>Optional</b><br> 
 * UB2-3: Condition Code (24-30) (CWE)<b>Optional</b><br> 
 * UB2-4: Covered Days (7) (ST)<b>Optional</b><br> 
 * UB2-5: Non-Covered Days (8) (ST)<b>Optional</b><br> 
 * UB2-6: Value Amount & Code (UVC)<b>Optional</b><br> 
 * UB2-7: Occurrence Code & Date (32-35) (OCD)<b>Optional</b><br> 
 * UB2-8: Occurrence Span Code/Dates (36) (OSP)<b>Optional</b><br> 
 * UB2-9: Uniform Billing Locator 2 (State) (ST)<b>Optional</b><br> 
 * UB2-10: Uniform Billing Locator 11 (State) (ST)<b>Optional</b><br> 
 * UB2-11: Uniform Billing Locator 31 (National) (ST)<b>Optional</b><br> 
 * UB2-12: Document Control Number (ST)<b>Optional</b><br> 
 * UB2-13: Uniform Billing Locator 49 (National) (ST)<b>Optional</b><br> 
 * UB2-14: Uniform Billing Locator 56 (State) (ST)<b>Optional</b><br> 
 * UB2-15: Uniform Billing Locator 57 (National) (ST)<b>Optional</b><br> 
 * UB2-16: Uniform Billing Locator 78 (State) (ST)<b>Optional</b><br> 
 * UB2-17: Special Visit Count (NM)<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 UB2 extends Segment   
{
	

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

	/**
	 * Constucts the UB2 segment.
	 */
	public UB2()
	{super(EnumSegments.HL7_SEG_UB2);
	}

	/**
	 * Retrieves the Set ID.
	 * @return String - setID
	 */
	public SI getSetID() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(553);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (SI)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the CoInsuranceDays.
	 * @return String - coInsuranceDays
	 */
	public ST getCoInsuranceDays() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(554);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Condition Code.
	 * @return ISingleCollection<CWE> - conditionCode
	 */
	public ISingleCollection<CWE> getConditionCode() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(555);
		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 Covered Days.
	 * @return String - coveredDays
	 */
	public ST getCoveredDays() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(556);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Non Covered Days. 
	 * @return String - nonCoveredDays
	 */
	public ST getNonCoveredDays() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(557);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Value Amount And Code.
	 * @return ISingleCollection<UVC> - valueAmountAndCode
	 */
	public ISingleCollection<UVC> getValueAmountAndCode() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(558);
		ISingleCollection<UVC> objDataList = new SingleCollection<UVC>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				UVC objUVC = (UVC)objDataType;
				objDataList.add(objUVC);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Occurance Code And Date.
	 * @return ISingleCollection<OCD> - occuranceCodeAndDate
	 */
	public ISingleCollection<OCD> getOccuranceCodeAndDate() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(559);
		ISingleCollection<OCD> objDataList = new SingleCollection<OCD>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				OCD objOCD = (OCD)objDataType;
				objDataList.add(objOCD);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Occurance Span Code Or Dates.
	 * @return ISingleCollection<OSP> - occuranceSpanCodeOrDates
	 */
	public ISingleCollection<OSP> getOccuranceSpanCodeOrDates() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(560);
		ISingleCollection<OSP> objDataList = new SingleCollection<OSP>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				OSP objOSP = (OSP)objDataType;
				objDataList.add(objOSP);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Uniform Billing Locator 2 State.
	 * @return ISingleCollection<ST> - Uniform BillingLocator2State
	 */
	public ISingleCollection<ST> getUniformBillingLocator2State() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(561);
		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 Uniform Billing Locator 11 State.
	 * @return ISingleCollection<ST> - Uniform BillingLocator11State
	 */
	public ISingleCollection<ST> getUniformBillingLocator11State() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(562);
		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 Uniform Billing Locator 31 National.
	 * @return String - Uniform BillingLocator31National
	 */
	public ST getUniformBillingLocator31National() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(563);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Document Control Number. 
	 * @return ISingleCollection<ST> - documentControlNumber
	 */
	public ISingleCollection<ST> getDocumentControlNumber() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(564);
		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 Uniform Billing Locator 49 National.
	 * @return ISingleCollection<ST> - Uniform BillingLocator49National
	 */
	public ISingleCollection<ST> getUniformBillingLocator49National() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(565);
		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 Uniform Billing Locator 56 State.
	 * @return ISingleCollection<ST> - Uniform BillingLocator56State
	 */
	public ISingleCollection<ST> getUniformBillingLocator56State() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(566);
		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 Uniform Billing Locator 57 National.
	 * @return String - Uniform BillingLocator57National
	 */
	public ST getUniformBillingLocator57National() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(567);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Uniform Billing Locator 78 State.
	 * @return ISingleCollection<ST> - UniformBillingLocator78State
	 */
	public ISingleCollection<ST> getUniformBillingLocator78State() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(568);
		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 Special Visit Count.
	 * @return String - specialVisitCount
	 */
	public NM getSpecialVisitCount() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(815);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (NM)objDataCollection.elementAt(0);
		else
			return null;
	}	

	/**
	 * Set the CoInsuranceDays.
	 * @param strCoInsuranceDays Use as CoInsuranceDays.
	 */ 
	public void setCoInsuranceDays (String strCoInsuranceDays) 
	{
		ST coInsuranceDays  = (ST)getDataElement(554);
		coInsuranceDays.setValue(strCoInsuranceDays); 
		setCoInsuranceDays (coInsuranceDays);


	} 

	/** Set the CoInsuranceDays.
	 * @param objcoInsuranceDays Use as CoInsuranceDays.
	 */ 
	public void setCoInsuranceDays(ST objcoInsuranceDays)
	{
		setDataType(554,objcoInsuranceDays);


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

	} 

	/** Set the Condition Code.
	 * @param objtempConditionCode Use as ConditionCode.
	 */ 
	public void addConditionCode(CWE objtempConditionCode)
	{
		addDataType(555,objtempConditionCode);

	}

	/**
	 * Set the ConditionCode list.
	 * @param objConditionCodeList List of ConditionCode
	 */	
	@SuppressWarnings("unchecked")
	public void setConditionCode(ISingleCollection<CWE> objConditionCodeList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objConditionCodeList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(555,objCollection);
	}

	/**
	 * Set the Covered Days.
	 * @param strCoveredDays Use as CoveredDays.
	 */ 
	public void setCoveredDays (String strCoveredDays)  
	{
		ST coveredDays  = (ST)getDataElement(556);
		coveredDays.setValue(strCoveredDays); 
		setCoveredDays (coveredDays);
	} 

	/** Set the Covered Days.
	 * @param objcoveredDays Use as CoveredDays.
	 */ 
	public void setCoveredDays(ST objcoveredDays)
	{
		setDataType(556,objcoveredDays);


	}
	/**
	 * Set the Document Control Number.
	 * This may repeat up to three times.
	 * @param strDocumentControlNumber Use as DocumentControlNumber.
	 */ 
	public void addDocumentControlNumber (String strDocumentControlNumber) 
	{
		ST tempDocumentControlNumber  = (ST)getDataElement(564);
		tempDocumentControlNumber.setValue(strDocumentControlNumber); 
		addDocumentControlNumber(tempDocumentControlNumber);

	} 

	/** Set the Document Control Number.
	 * This may repeat up to three times.
	 * @param objtempDocumentControlNumber Use as DocumentControlNumber.
	 */ 
	public void addDocumentControlNumber(ST objtempDocumentControlNumber)
	{
		addDataType(564,objtempDocumentControlNumber);

	}

	/**
	 * Set the DocumentControlNumber list.
	 * @param objDocumentControlNumberList List of DocumentControlNumber
	 */	
	@SuppressWarnings("unchecked")
	public void setDocumentControlNumber(ISingleCollection<ST> objDocumentControlNumberList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objDocumentControlNumberList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(564,objCollection);
	}

	/**
	 * Set the Non Covered Days. 
	 * @param strNonCoveredDays Use as NonCoveredDays.
	 */ 
	public void setNonCoveredDays (String strNonCoveredDays) 
	{
		ST nonCoveredDays  = (ST)getDataElement(557);
		nonCoveredDays.setValue(strNonCoveredDays); 
		setNonCoveredDays (nonCoveredDays);


	} 

	/** Set the Non Covered Days. 
	 * @param objnonCoveredDays Use as NonCoveredDays.
	 */ 
	public void setNonCoveredDays(ST objnonCoveredDays)
	{
		setDataType(557,objnonCoveredDays);


	}
	/**
	 * Set the Occurrence Code And Date.
	 * @param objOccuranceCode Use as OccuranceCode.
	 * @param  strOccuranceDate Use as OccuranceDate.
	 */
	public void addOccuranceCodeAndDate(CNE objOccuranceCode,String strOccuranceDate) 
	{
		OCD tempOccuranceCodeAndDate =(OCD)getDataElement(559);
		tempOccuranceCodeAndDate.setOccurrenceCode(objOccuranceCode);
		tempOccuranceCodeAndDate.setOccurrenceDate(strOccuranceDate);
		addOccuranceCodeAndDate(tempOccuranceCodeAndDate);
	}

	/**
	 * Set the Occurrence Code And Date.
	 * @param tempOccuranceCodeAndDate Occurrence Code And Date
	 */
	public void addOccuranceCodeAndDate(OCD tempOccuranceCodeAndDate)
	{
		addDataType(559,tempOccuranceCodeAndDate);
	}

	/**
	 * Set the OccuranceCodeAndDate list.
	 * @param objOccuranceCodeAndDateList List of OccuranceCodeAndDate
	 */	
	@SuppressWarnings("unchecked")
	public void setOccuranceCodeAndDate(ISingleCollection<OCD> objOccuranceCodeAndDateList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objOccuranceCodeAndDateList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(559,objCollection);
	}

	/**
	 * Set the Occurance Span Code Or Dates.
	 * @param objOccuranceSpanDate Use as OccuranceSpanDate
	 * @param strOccuranceSpanStartDate Use as OccuranceSpanStartDate
	 * @param strOccuranceSpanStopDate Use as OccuranceSpanStopDate
	 */
	public void addOccuranceSpanCodeOrDates(CNE objOccurrenceSpanCode,String strOccuranceSpanStartDate,String strOccuranceSpanStopDate) 
	{
		OSP tempOccuranceSpanCodeOrDates =(OSP)getDataElement(560);
		tempOccuranceSpanCodeOrDates.setOccurrenceSpanCode(objOccurrenceSpanCode);
		tempOccuranceSpanCodeOrDates.setOccurrenceSpanStartDate(strOccuranceSpanStartDate);
		tempOccuranceSpanCodeOrDates.setOccurrenceSpanStopDate(strOccuranceSpanStopDate);
		addOccuranceSpanCodeOrDates(tempOccuranceSpanCodeOrDates);
	}

	/**
	 * Set the Occurance Span Code Or Dates.
	 * @param tempOccuranceSpanCodeOrDates Occurance Span Code Or Dates. 
	 * @param strOccuranceSpanStopDate Use as OccuranceSpanStopDate
	 */
	public void addOccuranceSpanCodeOrDates(OSP tempOccuranceSpanCodeOrDates)
	{
		addDataType(560,tempOccuranceSpanCodeOrDates);
	}

	/**
	 * Set the OccuranceSpanCodeOrDates list.
	 * @param objOccuranceSpanCodeOrDatesList List of OccuranceSpanCodeOrDates
	 */	
	@SuppressWarnings("unchecked")
	public void setOccuranceSpanCodeOrDates(ISingleCollection<OSP> objOccuranceSpanCodeOrDatesList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objOccuranceSpanCodeOrDatesList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(560,objCollection);
	}

	/**
	 * Set the Set ID.
	 * @param strSquenceID Use as SquenceID.
	 */ 
	public void setSetID (String strSquenceID) 
	{
		SI setID  = (SI)getDataElement(553);
		setID.setValue(strSquenceID); 
		setSetID (setID);


	} 

	/** Set the Set ID.
	 * @param objsetID Use as SquenceID.
	 */ 
	public void setSetID(SI objsetID)
	{
		setDataType(553,objsetID);


	}
	/**
	 * Set the Special Visit Count.
	 * @param strSpecialVisitCount Use as SpecialVisitCount.
	 */ 
	public void setSpecialVisitCount (String strSpecialVisitCount) 
	{
		NM specialVisitCount  = (NM)getDataElement(815);
		specialVisitCount.setValue(strSpecialVisitCount); 
		setSpecialVisitCount (specialVisitCount);


	} 

	/** Set the Special Visit Count.
	 * @param objspecialVisitCount Use as SpecialVisitCount.
	 */ 
	public void setSpecialVisitCount(NM objspecialVisitCount)
	{
		setDataType(815,objspecialVisitCount);


	}
	/**
	 * Set the UniformBilling Locator 11 State.
	 * @param strUniformBillingLocator11State Use as UniformBillingLocator11State
	 */ 
	public void addUniformBillingLocator11State (String strUniformBillingLocator11State) 
	{
		ST tempUniformBillingLocator11State  = (ST)getDataElement(562);
		tempUniformBillingLocator11State.setValue(strUniformBillingLocator11State); 
		addUniformBillingLocator11State(tempUniformBillingLocator11State);


	} 

	/** Set the UniformBilling Locator 11 State.
	 * @param objtempUniformBillingLocator11State Use as UniformBillingLocator11State
	 */ 
	public void addUniformBillingLocator11State(ST objtempUniformBillingLocator11State)
	{
		addDataType(562,objtempUniformBillingLocator11State);


	}

	/**
	 * Set the UniformBillingLocator11State list.
	 * @param objOccuranceCodeAndDateList List of UniformBillingLocator11State
	 */	
	@SuppressWarnings("unchecked")
	public void setUniformBillingLocator11State(ISingleCollection<ST> objUniformBillingLocator11StateList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objUniformBillingLocator11StateList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(562,objCollection);
	}

	/**
	 * Set the UniformBilling Locator 2 State.
	 * This field may repeat up to two times.
	 * @param strUniformBillingLocator2State Use as UniformBillingLocator2State
	 */ 
	public void addUniformBillingLocator2State (String strUniformBillingLocator2State) 
	{
		ST tempUniformBillingLocator2State  = (ST)getDataElement(561);
		tempUniformBillingLocator2State.setValue(strUniformBillingLocator2State); 
		addUniformBillingLocator2State(tempUniformBillingLocator2State);


	} 

	/** Set the UniformBilling Locator 2 State.
	 * This field may repeat up to two times.
	 * @param objtempUniformBillingLocator2State Use as UniformBillingLocator2State
	 */ 
	public void addUniformBillingLocator2State(ST objtempUniformBillingLocator2State)
	{
		addDataType(561,objtempUniformBillingLocator2State);


	}

	/**
	 * Set the UniformBillingLocator2State list.
	 * @param objOccuranceCodeAndDateList List of UniformBillingLocator2State
	 */	
	@SuppressWarnings("unchecked")
	public void setUniformBillingLocator2State(ISingleCollection<ST> objUniformBillingLocator2StateList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objUniformBillingLocator2StateList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(561,objCollection);
	}

	/**
	 * Set the UniformBilling Locator 31 National.
	 * @param strUniformBillingLocator31National Use as UniformBillingLocator31National
	 */ 
	public void setUniformBillingLocator31National (String strUniformBillingLocator31National) 
	{
		ST UniformBillingLocator31National  = (ST)getDataElement(563);
		UniformBillingLocator31National.setValue(strUniformBillingLocator31National); 
		setUniformBillingLocator31National (UniformBillingLocator31National);


	} 

	/** Set the UniformBilling Locator 31 National.
	 * @param objUniformBillingLocator31National Use as UniformBillingLocator31National
	 */ 
	public void setUniformBillingLocator31National(ST objUniformBillingLocator31National)
	{
		setDataType(563,objUniformBillingLocator31National);


	}
	/**
	 * Set the UniformBilling Locator 49 National.
	 * This field may repeat up to twenty-three times.
	 * @param strUniformBillingLocator49National Use as UniformBillingLocator49National.
	 */ 
	public void addUniformBillingLocator49National (String strUniformBillingLocator49National) 
	{
		ST tempUniformBillingLocator49National  = (ST)getDataElement(565);
		tempUniformBillingLocator49National.setValue(strUniformBillingLocator49National); 
		addUniformBillingLocator49National(tempUniformBillingLocator49National);


	} 

	/** Set the UniformBilling Locator 49 National.
	 * This field may repeat up to twenty-three times.
	 * @param objtempUniformBillingLocator49National Use as UniformBillingLocator49National.
	 */ 
	public void addUniformBillingLocator49National(ST objtempUniformBillingLocator49National)
	{
		addDataType(565,objtempUniformBillingLocator49National);


	}

	/**
	 * Set the UniformBillingLocator49National list.
	 * @param objUniformBillingLocator49NationalList List of UniformBillingLocator49National
	 */	
	@SuppressWarnings("unchecked")
	public void setUniformBillingLocator49National(ISingleCollection<ST> objUniformBillingLocator49NationalList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objUniformBillingLocator49NationalList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(565,objCollection);
	}

	/**
	 * Set the UniformBilling Locator 56 State.
	 * @param strUniformBillingLocator56State Use as UniformBillingLocator56State.
	 */ 
	public void addUniformBillingLocator56State(String strUniformBillingLocator56State)
	{
		ST tempUniformBillingLocator56State  = (ST)getDataElement(566);
		tempUniformBillingLocator56State.setValue(strUniformBillingLocator56State); 
		addUniformBillingLocator56State(tempUniformBillingLocator56State);

	} 

	/** Set the UniformBilling Locator 56 State.
	 * @param objtempUniformBillingLocator56State Use as UniformBillingLocator56State.
	 */ 
	public void addUniformBillingLocator56State(ST objtempUniformBillingLocator56State)
	{
		addDataType(566,objtempUniformBillingLocator56State);

	}

	/**
	 * Set the UniformBillingLocator56State list.
	 * @param objUniformBillingLocator56StateList List of UniformBillingLocator56State
	 */	
	@SuppressWarnings("unchecked")
	public void setUniformBillingLocator56State(ISingleCollection<ST> objUniformBillingLocator56StateList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objUniformBillingLocator56StateList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(566,objCollection);
	}

	/**
	 * Set the UniformBilling Locator 57 National.
	 * @param strUniformBillingLocator57National Use as UniformBillingLocator57National.
	 */ 
	public void setUniformBillingLocator57National (String strUniformBillingLocator57National) 
	{
		ST UniformBillingLocator57National  = (ST)getDataElement(567);
		UniformBillingLocator57National.setValue(strUniformBillingLocator57National); 
		setUniformBillingLocator57National (UniformBillingLocator57National);


	} 

	/** Set the UniformBilling Locator 57 National.
	 * @param objUniformBillingLocator57National Use as UniformBillingLocator57National.
	 */ 
	public void setUniformBillingLocator57National(ST objUniformBillingLocator57National)
	{
		setDataType(567,objUniformBillingLocator57National);


	}
	/**
	 * Set the UniformBilling Locator 78 State.
	 * @param strUniformBillingLocator78State Use as UniformBillingLocator78State.
	 */ 
	public void addUniformBillingLocator78State (String strUniformBillingLocator78State) 
	{
		ST tempUniformBillingLocator78State  = (ST)getDataElement(568);
		tempUniformBillingLocator78State.setValue(strUniformBillingLocator78State); 
		addUniformBillingLocator78State(tempUniformBillingLocator78State);


	} 

	/** Set the UniformBilling Locator 78 State.
	 * @param objtempUniformBillingLocator78State Use as UniformBillingLocator78State.
	 */ 
	public void addUniformBillingLocator78State(ST objtempUniformBillingLocator78State)
	{
		addDataType(568,objtempUniformBillingLocator78State);


	}

	/**
	 * Set the UniformBillingLocator78State list.
	 * @param objUniformBillingLocator78StateList List of UniformBillingLocator78State
	 */	
	@SuppressWarnings("unchecked")
	public void setUniformBillingLocator78State(ISingleCollection<ST> objUniformBillingLocator78StateList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objUniformBillingLocator78StateList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(568,objCollection);
	}

	/**
	 * Set the Value Amount And Code.
	 * @param objValueCode Contains Value Code
	 * @param objValueAmount Contains Value Amount
	 * @param objNonMonetaryValueAmountQuantity Specifies the numeric amount when needed to pair with the value when it is non-monetary.
	 * @param objNonMonetaryValueAmountUnits This component species the units in which the non-monetary quantity is expressed. Refer to the Unified Code for Units of Measure (UCUM) for valid values
	 */ 
	public void addValueAmountAndCode(CWE objValueCode,MO objValueAmount,NM objNonMonetaryValueAmountQuantity, CWE objNonMonetaryValueAmountUnits) 
	{
		UVC tempValueAmountAndCode =(UVC)getDataElement(558);
		tempValueAmountAndCode.setValueCode(objValueCode);
		tempValueAmountAndCode.setValueAmount(objValueAmount);
		tempValueAmountAndCode.setNonMonetaryValueAmountUnits(objNonMonetaryValueAmountUnits);
		tempValueAmountAndCode.setNonMonetaryValueAmountQuantity(objNonMonetaryValueAmountQuantity);
		addValueAmountAndCode(tempValueAmountAndCode);
	}

	/**
	 * Set the Value Amount And Code.
	 * This field can repeat max 12 times.  
	 * @param tempValueAmountAndCode Value Amount And Code
	 */
	public void addValueAmountAndCode(UVC tempValueAmountAndCode)
	{
		addDataType(558,tempValueAmountAndCode);
	}

	/**
	 * Set the ValueAmountAndCode list.
	 * @param objValueAmountAndCodeList List of ValueAmountAndCode
	 */	
	@SuppressWarnings("unchecked")
	public void setValueAmountAndCode(ISingleCollection<UVC> objValueAmountAndCodeList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objValueAmountAndCodeList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(558,objCollection);
	}

	/**
	 * Validates HL7 Message objects .
	 * Validate method checks for validation each and every segments in side the Message object against specified message Structure. 
	 * Validation chcecks include optionality of segment or group.
	 * It also verifies the number of times segment or group is repeated in message.
	 * e.g 
	 * {PSH} while parsing PSH segment validate method will check for its mandatory presence.
	 * [PSH] in this case validate will throw exception if one tries to enter more than one PSH segment.
	 * @return boolean - true or false.
	 * @throws InvalidSegmentException Throws when Segment Validation fails.
	 */
	public boolean validate() throws InvalidSegmentException
	{
		//All fields are optional.
		//		This Segment Supports Feature Modes For Updating via Repeating Segment.
		//		Validation Mode for this segments validation doesn't affect.
		super.validate();
		return true;
	}
}