--[[
   This script generates the hints for sorting the RF sequences within the study
   stills first, then cine clips by acquisition date/time 
   
	Cristian Bonciu		August 2004
	-	Created and implemented the above functionality for development testing purposes
	Allan Noordvyk		September 16, 2005
     -	Added modality as first sort criteria so that like modality series
		a grouped together in combo studies even when simultaneous acquisition
		was done (or acquistion time information is missing or uniform). 
	Allan Noordvyk		September 25, 2005
     -	Removed modality sanity check because some sites call RF other
          things (e.g. "DF")
	Mahesh Nagarajan	January 31, 2007
	- 	Modified syntaxes for sorting hints as part of v11.5 re-write
	-	Site customized code will be removed and re-located to SortRF.site files -> starting with 11.5, 
		unless sort orders are fundamentally flawed, all change requests to sorting schemes will be
		incorporated into a site file for the site.		
--]]

function DeclareTags()
end

-- ////////////////////////////////////////////////////////////////////////////
-- end common scripting context (temp)
-- ////////////////////////////////////////////////////////////////////////////

-- ////////////////////////////////////////////////////////////////////////////
-- RF sequence sorting function
-- ////////////////////////////////////////////////////////////////////////////

function Execute()
-- ////////////////////////////////////////////////////////////////////////////
-- generates the hints for sorting the RF sequences as follows 
-- stills first, clips last, and then series date, time, number and UID
-- ////////////////////////////////////////////////////////////////////////////
    DeclareTags()
	
    local sortHint01 = SortingHint:new("RF Sequence Sort", "DEFAULT")
 
    -- Used to group CR separately from RF in combo exams
    sortHint01:AddEntry(MODALITY_PROP)  
    
    sortHint01:AddEntry(SERIES_DATE_TAG)
    sortHint01:AddEntry(SERIES_TIME_TAG)
    sortHint01:AddEntry(SERIES_NUMBER_TAG)
    sortHint01:AddEntry(ACQUISITON_DATETIME_TAG)
    sortHint01:AddEntry(ACQUISITON_DATE_TAG)
    sortHint01:AddEntry(ACQUISITON_TIME_TAG)
    sortHint01:AddEntry(IMAGE_ACQUISITON_TIME_TAG)
    sortHint01:AddEntry(INSTANCE_NUMBER_TAG) 
    sortHint01:AddEntry(ALI_IMAGE_FILENAME_TAG) 
    sortHint01:AddEntry(SERIES_UID_TAG)
    sortHint01:AddEntry(IMAGE_UID_TAG)  
    
    SortSequencesInStudy(sortHint01) 

end

if( AliDSDebugEdit == 1 ) then
    Execute()
end
