/*******************************************************************************
 *  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.hl7model.messages.claimsandreimbursement;

import cdac.medinfo.sdk.hl7282.baselibs.messages.Message;
import cdac.medinfo.sdk.hl7282.baselibs.segments.SFT;
import cdac.medinfo.sdk.hl7282.baselibs.segments.UAC;
import cdac.medinfo.sdk.hl7282.commoninterface.IGroup;
import cdac.medinfo.sdk.hl7282.commoninterface.ISegment;
import cdac.medinfo.sdk.hl7282.commoninterface.ISingleCollection;
import cdac.medinfo.sdk.hl7282.utils.EnumMessageCode;
import cdac.medinfo.sdk.hl7282.utils.EnumMessageStructure;
import cdac.medinfo.sdk.hl7282.utils.EnumSegments;
import cdac.medinfo.sdk.hl7282.utils.EnumTriggerEvent;
import cdac.medinfo.sdk.hl7282.utils.IMap;

/**
 * EHC_E15 - Additional Information Response (event E15).
 * This message is used to send a payment/ remittance advice to a Payee for the payment of HealthCare Services 
 * Invoices and/or other adjustments.  
 * <p>Represents a EHC_E15 message structure (see chapter 16.3.9). This structure contains the 
 * following elements: </p>
 * 0: MSH (Message Header) <b>SINGLE_COMPULSARY</b><br>
 * 1: SFT (Software Segment) <b>MULTIPLE_OPTIONAL</b><br>
 * 2: UAC (User Authentication Credential) <b>MULTIPLE_OPTIONAL</b><br>
 * 3: PAYMENT_REMITTANCE_HEADER_INFO (Group of EHC_E15 event) <b>MULTIPLE_OPTIONAL</b><br>
 * 4: PAYMENT_REMITTANCE_DETAIL_INFO (Group of EHC_E15 event) <b>MULTIPLE_OPTIONAL</b><br>
 * 5: ADJUSTMENT_PAYEE  (Group of EHC_E15 event) <b>MULTIPLE_OPTIONAL</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.
 * These elements can be easily populated & populated values can be easily retrieved.
 * The class has validate method which validates Message against HL7 v 2.8.2 standard.
 *
 * <p>Following is the step to create message<br>
 * Before that, respective Message Source and Message Recipient to be set on Message Factory.</p>
 * <p>EHC_E15 objE15 = (EHC_E15)MessageFactory.createInstance().createSendSupportedMessage("EHC", "E15");</p>
 */
public final class EHC_E15 extends Message{

	/**
	 * Constructs the EHC_E15 message.
	 */
	EHC_E15(IMap objMessageMap)
	{
		super(objMessageMap, EnumMessageCode.EHC.getValue(), EnumTriggerEvent.E15.getValue(), EnumMessageStructure.EHC_E15.getValue());
	}

	/**
	 * Retrieves Collection of Software Segments(SFT) present in this message.
	 * @return ISingleCollection<SFT> - Collection of Software Segments(SFT) present in this message.
	 */
	@SuppressWarnings("unchecked")
	public ISingleCollection<SFT> getSoftwareSegments()
	{
		ISingleCollection<?> objSegmentCollection = getSegment(EnumSegments.HL7_SEG_SFT);
		return (ISingleCollection<SFT>)objSegmentCollection;
	}

	/**
	 * Adds Software Segment(SFT) to this message.
	 * @param objSFT Specified Software Segment(SFT) to be added in this message to this message.
	 */
	public void addSoftwareSegment(SFT objSFT)
	{
		addSegment(EnumSegments.HL7_SEG_SFT, objSFT);
	}

	/**
	 * Adds collection of Software Segment(SFT) to this message.
	 * @param objSFTSegmentCollection Collection of Software Segments to add in this message
	 */
	@SuppressWarnings("unchecked")
	public void addSoftwareSegment(ISingleCollection<SFT> objSFTSegmentCollection)
	{
		ISingleCollection<?> objSegmentCollection = objSFTSegmentCollection;
		addSegment(EnumSegments.HL7_SEG_SFT, (ISingleCollection<ISegment>)objSegmentCollection);
	}
	
	/**
	 * Retrieves Collection of User Authentication Credential Segments(UAC) present in this message.
	 * @return ISingleCollection<UAC> - Collection of User Authentication Credential Segments(UAC) present in this message.
	 */
	@SuppressWarnings("unchecked")
	public ISingleCollection<UAC> getUserAuthenticationCredentialSegments()
	{
		ISingleCollection<?> objSegmentCollection = getSegment(EnumSegments.HL7_SEG_UAC);
		return (ISingleCollection<UAC>)objSegmentCollection;
	}

	/**
	 * Adds User Authentication Credential Segment(UAC) to this message.
	 * @param objUAC Specified User Authentication Credential Segment(UAC) to be added in this message to this message.
	 */
	public void addUserAuthenticationCredentialSegment(UAC objUAC)
	{
		addSegment(EnumSegments.HL7_SEG_UAC, objUAC);
	}

	/**
	 * Adds collection of User Authentication Credential Segment(UAC) to this message.
	 * @param objUACSegmentCollection Collection of User Authentication Credential Segments to add in this message
	 */
	@SuppressWarnings("unchecked")
	public void addUserAuthenticationCredentialSegment(ISingleCollection<UAC> objUACSegmentCollection)
	{
		ISingleCollection<?> objSegmentCollection = objUACSegmentCollection;
		addSegment(EnumSegments.HL7_SEG_UAC, (ISingleCollection<ISegment>)objSegmentCollection);
	}
	
	/**
	 * Retrieves Collection of PAYMENT_REMITTANCE_HEADER_INFO present in this message.
	 * @return ISingleCollection<Group> - Collection of PAYMENT_REMITTANCE_HEADER_INFO present in this Message.
	 */
	public ISingleCollection<IGroup> getPaymentRemittanceHeaderInfoGroups()
	{
		return getGroup(EnumSegments.HL7_GROUP_PAYMENT_REMITTANCE_HEADER_INFO);
	}

	/**
	 * Adds Collection of PAYMENT_REMITTANCE_HEADER_INFO to this message.
	 * @param objSingleCollection - Specified PAYMENT_REMITTANCE_HEADER_INFO Collection.
	 */
	public void addPaymentRemittanceHeaderInfoGroups(ISingleCollection<IGroup> objSingleCollection)
	{
		addGroup(EnumSegments.HL7_GROUP_PAYMENT_REMITTANCE_HEADER_INFO, objSingleCollection);
	}

	/**
	 * Adds PAYMENT_REMITTANCE_HEADER_INFO to this message.
	 * @param objGroup Specified PAYMENT_REMITTANCE_HEADER_INFO.
	 */
	public void addPaymentRemittanceHeaderInfoGroup(IGroup objGroup)
	{
		addGroup(EnumSegments.HL7_GROUP_PAYMENT_REMITTANCE_HEADER_INFO, objGroup);
	}
	
	/**
	 * Retrieves Collection of PAYMENT_REMITTANCE_DETAIL_INFO present in this message.
	 * @return ISingleCollection<Group> - Collection of PAYMENT_REMITTANCE_DETAIL_INFO present in this Message.
	 */
	public ISingleCollection<IGroup> getPaymentRemittanceDetailInfoGroups()
	{
		return getGroup(EnumSegments.HL7_GROUP_PAYMENT_REMITTANCE_DETAIL_INFO);
	}

	/**
	 * Adds Collection of PAYMENT_REMITTANCE_DETAIL_INFO to this message.
	 * @param objSingleCollection - Specified PAYMENT_REMITTANCE_DETAIL_INFO Collection.
	 */
	public void addPaymentRemittanceDetailInfoGroups(ISingleCollection<IGroup> objSingleCollection)
	{
		addGroup(EnumSegments.HL7_GROUP_PAYMENT_REMITTANCE_DETAIL_INFO, objSingleCollection);
	}

	/**
	 * Adds PAYMENT_REMITTANCE_DETAIL_INFO to this message.
	 * @param objGroup Specified PAYMENT_REMITTANCE_DETAIL_INFO.
	 */
	public void addPaymentRemittanceDetailInfoGroup(IGroup objGroup)
	{
		addGroup(EnumSegments.HL7_GROUP_PAYMENT_REMITTANCE_DETAIL_INFO, objGroup);
	}
	
	/**
	 * Retrieves Collection of ADJUSTMENT_PAYEE present in this message.
	 * @return ISingleCollection<Group> - Collection of ADJUSTMENT_PAYEE present in this Message.
	 */
	public ISingleCollection<IGroup> getAdjustmentPayeeGroups()
	{
		return getGroup(EnumSegments.HL7_GROUP_ADJUSTMENT_PAYEE);
	}

	/**
	 * Adds Collection of ADJUSTMENT_PAYEE to this message.
	 * @param objSingleCollection - Specified ADJUSTMENT_PAYEE Collection.
	 */
	public void addAdjustmentPayeeGroups(ISingleCollection<IGroup> objSingleCollection)
	{
		addGroup(EnumSegments.HL7_GROUP_ADJUSTMENT_PAYEE, objSingleCollection);
	}

	/**
	 * Adds ADJUSTMENT_PAYEE to this message.
	 * @param objGroup Specified ADJUSTMENT_PAYEE.
	 */
	public void addAdjustmentPayeeGroup(IGroup objGroup)
	{
		addGroup(EnumSegments.HL7_GROUP_ADJUSTMENT_PAYEE, objGroup);
	}
}
