Thank you Sebastian for your clear explanation. I think I'm starting to become more comfortable with the plugin framework to understand it.
I also tried the plugin sample, which works well. While trying it I confirmed a concern I had which I wanted to share with you:
The plugin in fact does create a new instance with a newly generated SOPInstanceUID from dcmodify. There is an edge case (actually not so edge when studies are pushed manually from the modality to an archive) in which the technologist will re-send the images when there is doubt about whether the study arrived complete or not.
The problem here is that Orthanc will accept the instances as new instances for the same series, thus duplicating the number of images in the series.
Have you come across this use case? I honestly don't know what would be the best approach for solving this, and your thoughts would be most appreciated.
Simon