-- Collects Missing Series from Source Archive and Moves them to Destination Archive--- -- DECLARATIONS ------------------------------------------- SourceAET = 'SOURCEAET' DestinationAET = 'DESTINATIONAET' DateOffset = 0 -- days ------------------------------------------------------------ t2 = os.time() t1 = t2 - DateOffset*24*60*60 d1 = os.date("%Y%m%d",t1) d2 = os.date("%Y%m%d",t2) DateRange = d1.."-"..d2 a1=DicomObject:new(); a1.QueryRetrieveLevel='SERIES'; a1.SeriesInstanceUID=''; a1.SeriesDate = DateRange; b1=dicomquery(SourceAET, 'SERIES', a1); a2=DicomObject:new(); a2.QueryRetrieveLevel='SERIES'; a2.SeriesInstanceUID=''; a2.SeriesDate= DateRange; b2=dicomquery(DestinationAET, 'SERIES', a2); for i=0, #b1-1 do found = false for j=0, #b2-1 do if b1[i].SeriesInstanceUID == b2[j].SeriesInstanceUID then found = true break end end if not found then dicommove(SourceAET,DestinationAET,b1[i]) end end