Used 0020,000D tag (Study Instance UID) to match patient and removed 0008,1140 tag (Referenced SOP SQ) since it is not always present and causes issues for multi-modality scans.