/*******************************************************************************
 *  Copyright 2017-2018 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.dcm30_04.baselibs;

/*
 * The Raw data that was used to derive this Image.
 *One or more Items are permitted in this Sequence.
 *Note: The items of in this Sequence may identify raw data that hasnot been stored or encoded as a DICOM object. This allowsrecognition that images and spectra in different instanceshave been reconstructed from the same raw data.
 */

import cdac.medinfo.sdk.dcm30_04.commoninterface.IDictionaryReader;
import cdac.medinfo.sdk.dcm30_04.commoninterface.IItem;
import cdac.medinfo.sdk.dcm30_04.commoninterface.ITransferSyntax;





/**
 * A sequence that identifies the set of Raw Data SOP Class/Instance pairs of the Raw
 * data which were used to derive this Image.
 */
public class ReferencedRawDataSequence extends SQ  
{
	

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;


	/**
	 * This constructor creates CQ with specified transferSyntax and specified DictionaryReader
	 * @param objTransferSyntax specifies the DICOM Standard defined TransfeSyntax
	 * @param objDictionaryReader specifies the DICOM Dictionary reader to be used 
	 */
	ReferencedRawDataSequence(ITransferSyntax objTransferSyntax,IDictionaryReader objDictionaryReader)
	{
		super(objTransferSyntax, objDictionaryReader);
	}
	/*
	 * This is the overriding method isValidItem which checks whether the
	 * item being added is of HierarchicalSeriesReferenceMacroDependentItem
	 */
	protected boolean isValidItem(IItem objIItem)
	{
		return objIItem instanceof HierarchicalSeriesReferenceMacroDependentItem ? true : false;
	}

	/*
	 * (non-Javadoc) This overriding method creates the item of type HierarchicalSeriesReferenceMacroDependentItem
	 * @see cdac.medinfo.sdk.dcm30_04.baselibs.dicomv3.SQ#createItem()
	 */
	protected IItem createItem()
	{
		return new HierarchicalSeriesReferenceMacroDependentItem(objITransferSyntax,objIDictionaryReader);
	}


	/*
	 * When a new Item is requested, it should be added in the internal collection of sequence
	 * before giving it to the user
	 */
	/**
	 * Retrieves new item when requested.
	 * User has to add this item to sequence by calling additem of SQ.
	 * @return - instance of HierarchicalSeriesReferenceMacroDependentItem.
	 */ 
	public HierarchicalSeriesReferenceMacroDependentItem getNewItem()
	{
		HierarchicalSeriesReferenceMacroDependentItem objHierarchicalSeriesReferenceMacroDependentItem = new HierarchicalSeriesReferenceMacroDependentItem(objITransferSyntax,objIDictionaryReader);

		return objHierarchicalSeriesReferenceMacroDependentItem;
	}

}
