Consolidate the AdvanceQueryIterator code.
Consolidate the AdvanceQueryIterator code.

hendradarwin/vtk-dicom,hendradarwin/vtk-dicom,dgobbi/vtk-dicom,hendradarwin/vtk-dicom,dgobbi/vtk-dicom,dgobbi/vtk-dicom