package cdac.medinfo.sdk.hl7282.hl7net.commons;

import cdac.medinfo.sdk.hl7282.commoninterface.ISegmentSet;
import cdac.medinfo.sdk.hl7282.commoninterface.ISingleCollection;


/**
 * IClientQueryCancellation is the interface for Sending Queries and Receiving responses.
 * The class that is interested in Sending Queries and Receiving responses implements this interface.
 * This interface tells about the canceled responses and query id for which 
 * no action is performed(i.e Unprocessed Queries).  
 */
public interface IClientQueryCancellation 
{
	/**
	 * Keeps track for the Queries which are Send by client.
	 * @param objSegmentSet Object of Segment set send by Client.
	 * @return this will return true in case of Query is canceled or Invalid query.
	 */
	public boolean processSend(ISegmentSet objSegmentSet);
	
	/**
	 * Keeps track for the Responses which are received by client.
	 * @param objSegmentSet Object of Segment set received to client.
	 * @return true if received response is canceled response else false.
	 */
	public boolean processReceive(ISegmentSet objSegmentSet);
	
	/**
	 * Generates segment set for QCN^J01.
	 * @param strQueryID Query Id for which to generate Segment Set.
	 * @return ISegmentSet object of Segment set. 
	 */
	public ISegmentSet generateCancellationQuery(String strQueryID);
	
	/**
	 * Retrieves all Responses which are canceled by user.
	 * This will only return this Segment set collection in case of flag set by user.
	 * @return ISingleCollection<ISegmentSet> Collection of Canceled Segment set.
	 */
	public ISingleCollection<ISegmentSet> getCancelledMessages(); 
	
	/**
	 * Sets the Mode for retrieving canceled messages 
	 * By default its value is set true. 
	 * @param blnCancelledMessage set true then store canceled messages else false.
	 */
	public void setStoreCancelledMessage(boolean bCancelledMessage);
	
	/**
	 * Gets all the canceled queries which are send by client.
	 * @return ISingleCollection<String> collection of Query id.
	 */
	public ISingleCollection<String> getCancelledQueries();
}
