/*******************************************************************************
 *  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.utils;

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

/**
 *	DataTypeMap represents structure of a DataType as per defined in HL7 standard.
 *  It includes index for Component item sequence defined in DataType structure.
 *  Index for Component Item starts with 1.
 */
public interface IDataTypeMap 
{
	/**
	 * Retrieves Component structure in terms of ComponentItem from specified sequence.
	 * @param iSequenceNo sequence value for Component.
	 * @return IComponentItem instance of ComponentItem
	 */
	IComponentItem getComponentItem(int iSequenceNo);
	
	/**
	 * Adds ComponentItem to IDataTypeMap at current available index.
	 * @param objComponentItem instance of Component Item
	 */
	void addComponentItem(IComponentItem objComponentItem);
	
	/**
	 * Adds ComponentItem to IDataTypeMap at given index position according to the modification mode.
	 * @param objComponentItem instance of Component Item
	 * @param index sequence position
	 * @param enumModifyMode enumerated value of modification mode
	 */
	void addComponentItem(IComponentItem objComponentItem,int index,EnumMapModifyMode enumModifyMode);
	
	/**
	 * Retrieves a clone of IDataTypeMap
	 * @return IDataTypeMap - instance of IDataTypeMap
	 */
	IDataTypeMap clone();
	
	/**
	 * Sets lock on IDataTypeMap.
	 * If lock is set then new ComponentItem can not be added in SegmentMap
	 * @param bLock value of lock
	 */
	void setLock(boolean bLock);
	
	/**
	 * Retrieves current status of lock for IDataTypeMap
	 * @return boolean - status of lock
	 */
	boolean getLock();
	
	/**
	 * Retrieves size of IDataTypeMap
	 * @return int - total number of Component Items
	 */
	int size();
	
	/**
	 * Retrieves the list of Item ID of all AttributeItems which are member of ISEgmentMap.
	 * @return ISingleCollection<Integer> - return collection of Item ID.
	 */
	ISingleCollection<Integer> getSequenceNumberList();
	
	/**
	 * Retrieves the Table value specified by HL7 Standard for the specified Item ID.
	 * @param iSequenceNo Integer value of Sequence number.
	 * @return int[] - return array of Table value for specified Item ID.
	 */
	int[] getValueTable(int iSequenceNo);

	/**
	 * Retrieves the Minimum Length of an Item specified by HL7 Standard for the specified Item.
	 * @param iItemID Integer value of Sequence number.
	 * @return int - return Minimum Length value for specified Item ID.
	 */
	public int getItemMinimumLength(int iSequenceNo);

	/**
	 * Retrieves the Maximum Length of an Item specified by HL7 Standard for the specified Item.
	 * @param iItemID Integer value of Sequence number.
	 * @return int - return Maximum Length value for specified Item ID.
	 */
	public int getItemMaximumLength(int iSequenceNo);
	
	/**
	 * Retrieves the Conformance Length of an Item specified by HL7 Standard for the specified Item.
	 * @param iItemID Integer value of Sequence number.
	 * @return String - return Conformance Length value for specified Item ID.
	 */
	public String getItemConformanceLength(int iSequenceNo);
	
	/**
	 * Retrieves the Data Type name of an Item specified by HL7 Standard for the specified Item.
	 * @param iSequenceNo Integer value of Sequence number.
	 * @return String - return Data type name for specified Item ID.
	 */
	String getDataTypeName(int iSequenceNo);

	/**
	 * Retrieves the status indicating whether the specified Item ID is optional or not.
	 * @param iSequenceNo Integer value of Sequence number.
	 * @return boolean - the status indicating whether the specified Item ID is optional or not.
	 */
	boolean isOptional(int iSequenceNo);

	/**
	 * Retrieves the Field name of an Item specified by HL7 Standard for the specified Item.
	 * @param iSequenceNo Integer value of Sequence number.
	 * @return String - return Field name for specified Item ID.
	 */
	String getFieldName(int iSequenceNo);
}
