package cdac.medinfo.sdk.hl7282.hl7model.messages.materialsmanagement;

import cdac.medinfo.sdk.hl7282.baselibs.messages.Message;
import cdac.medinfo.sdk.hl7282.baselibs.segments.SCP;
import cdac.medinfo.sdk.hl7282.baselibs.segments.SFT;
import cdac.medinfo.sdk.hl7282.baselibs.segments.SLT;
import cdac.medinfo.sdk.hl7282.baselibs.segments.UAC;
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;

/**
 * STC_S33 - Notification of Sterilization Configuration (Event S33).
 * This message is sent from a filler application to notify other applications of a new sterilization configuration. 
 * <p>Represents a STC_S33 message structure (see chapter 17.6.1). This structure contains the 
 * following elements: </p>
 * 0: MSH (Message Header Segment) <b>SINGLE_COMPULSARY</b><br>
 * 1: SFT (Software Segment) <b>MULTIPLE_OPTIONAL</b><br>
 * 2: UAC (User Authentication Credential) <b>SINGLE OPTIONAL</b><br/>
 * 3: SCP (Sterilization Configuration) <b>MULTIPLE_COMPULSARY</b><br>
 * The class provides accessors & mutators for the elements mentioned above.
 * These elements can be easily populated & populated values can be easily retrieved.
 * 
 * <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>STC_S33 objS33 = (STC_S33)MessageFactory.createInstance().createSendSupportedMessage("STC", "S33");</p> 
 *
 */

public final class STC_S33 extends Message
{
	/**
	 * Constructs the STC_S33 message.
	 */
	STC_S33(IMap objMessageMap)
	{
		super(objMessageMap, EnumMessageCode.STC.getValue(), EnumTriggerEvent.S33.getValue(), EnumMessageStructure.STC_S33.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 messageto 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 User Authentication Credential(UAC) segment present in this message
	 * @return UAC - Specified UAC Segment
	 */
	public UAC getUserAuthenticationCredentialSegment()
	{
		ISingleCollection<ISegment> objSingleCollection = getSegment(EnumSegments.HL7_SEG_UAC);
		if(objSingleCollection != null)
			return (UAC)objSingleCollection.elementAt(0);
		return null;
	}

	/**
	 * Sets value of User Authentication Credential segment for this message,overwrites if already present.
	 * @param objUAC Specified UAC Segment
	 */
	public void setUserAuthenticationCredentialSegment(UAC objUAC)
	{
		setSegment(EnumSegments.HL7_SEG_UAC,objUAC);
	}
	
	/**
	 * Retrieves Collection of Sterilization Configuration(SCP) present in this message.
	 * @return ISingleCollection<SCP> - Collection of Sterilization Configuration(SCP) present in this message.
	 */
	@SuppressWarnings("unchecked")
	public ISingleCollection<SCP> getSterilizationConfigurationSegments()
	{
		ISingleCollection<?> objSegmentCollection = getSegment(EnumSegments.HL7_SEG_SCP);
		return (ISingleCollection<SCP>)objSegmentCollection;
	}

	/**
	 * Adds Sterilization Configuration(SCP) to this message.
	 * @param objSCP Specified Sterilization Configuration(SCP) to be added in this message.
	 */
	public void addSterilizationConfigurationSegment(SCP objSCP)
	{
		addSegment(EnumSegments.HL7_SEG_SCP, objSCP);
	}

	/**
	 * Adds collection of Sterilization Configuration(SCP) to this message.
	 * @param objSCPSegmentCollection Collection of Sterilization Configuration(SCP) to add in this message
	 */
	@SuppressWarnings("unchecked")
	public void addSterilizationConfigurationSegments(ISingleCollection<SCP>  objSCPSegmentCollection)
	{
		ISingleCollection<?> objSegmentCollection =  objSCPSegmentCollection;
		addSegment(EnumSegments.HL7_SEG_SCP, (ISingleCollection<ISegment>)objSegmentCollection);
	}
	
}
