Most efficient way to identify and reject duplicate studies in Orthanc PACS

Hi everyone,

I am looking for an efficient solution to identify and reject studies that already exist in the Orthanc PACS. The goal is to prevent duplicate studies from being stored in the system.

Currently, I’m considering using study metadata (such as StudyInstanceUID) to perform this check. However, I’d like to know if anyone has implemented a more optimized workflow for this, perhaps using plugins, scripts, or integrations with external tools.

My questions are:

  1. What is the most efficient approach to check for duplicates in Orthanc?

  2. Is there any native configuration or plugin that simplifies this task?

  3. If custom development is necessary, what would be the best strategy? (e.g., using the REST API to verify duplicates before storage).

Any suggestions or experiences would be greatly appreciated!

Thank you!

Hello ,

In my understanding, this is already built into Orthanc.

By default, duplicate instances with the same Orthanc ID will not be stored by Orthanc, unless you set OverwriteInstances to true.

Please note that this “no duplicate” rule is with respect to the Orthanc ID which, for an instance, depends upon PatientID, StudyInstanceUID, SeriesInstanceUID and SOPInstanceUID (reference).

So, if you write several instances with the same SOPInstanceUID but where the other IDs are different, this can lead to duplicates.

The default makes sense because the DICOM model is supposed to be immutable : in order to change data, you need to generate new objects with new IDs, although in some cases (like development), it can be useful to replace instances.

If you are in this particular situation, you might find some inspiration in the replies to this question : Checking for Duplicated instances with same instance number - General - Orthanc Users

–B

1 Like

It worked, thank you very much

Hi Onerb, good day.
I have a similar problem. You know, if I send a study twice to Orthanc, it adds the images together. That is, if the study has 10 images, and I send it again, that same study now has 20 images. How can I fix this? Can you help me? Best regards.
Cristian

Hello Cristian

If you find out that the images appear twice, it surely means that these new instances have new SOPInstanceUIDs.

How it works:

  • If the OverwriteInstances setting is true, sending the same instances (same SOPInstanceUID) will not be overwrite the ones already in Orthanc → nothing happens.

  • If the OverwriteInstances setting is false, sending the same instances (same SOPInstanceUID) will lead to only the new instance being present after the overwrite operation.

So, what you are seeing surely means that, either you are sending a whole new study (with both studies, series and instances IDs being different), or the StudyInstanceUID is the same but the instance/series IDs are different.

I think you need to find a tag on the instances that will help you tell the new study from the old one, so that you can purge the older instances when receiving your new study. Perhaps someone has already encountered the issue and has a suggestion,

HTH

Cristian,

I can see that your problem is solved, in another (3rd !) thread.

(Writing this so that nobody wastes time on it)

@benjamin.golinvaux .
Hi, Benjamin
Luckily it was possible to resolve it.
Thanks for helping anyway.
Regards