I might be doing something wrong but I think the StudyInstanceUID, and SeriesInstanceUID, and SOPInstanceUID values are modified by Orthanc Raw when retrieving data from the archives, which means we can't compare SOPInstanceUIDs to check for existing instances. I'll open a PR with a test to check the StudyInstanceUID in Orthanc Raw is the same as in the VNA (assuming this is the expected behaviour?)
Originally posted by @p-j-smith in https://github.com/SAFEHR-data/PIXL/issues/486#issuecomment-2326050577