Modify Patient Info without creating new patient


I have a server with Orthanc 1.5.8 and I was hoping there was a way to use it to modify studies without creating a new record. When I modify studies it changes the studies unique identifiers (StudyInstanceUID, SeriesInstanceUID, etc…). It creates two records when I only need one. I can delete the second record but if someone sends the original again it will store it as a second record.

I would like to update accession numbers without changing any of the unique identifiers. Is that something Orthanc is capable of somehow?



Hello. Are you using this endpoint?{id}~1modify/post

In the JSON body of your request, you can send:

“Keep”: [
“StudyInstanceUID”, “SeriesInstanceUID”, “SOPInstanceUID”

A quarta-feira, 13 de abril de 2022 à(s) 18:38:23 UTC+1, escreveu:

Hi Diego,

I gave that a shot and it kind of worked. It kept the StudyInstanceUID and the SeriesInstanceUID but changed the SOPInstanceUID on the instance level. On top of that I attempted to use the KeepSource:false to not keep the original but the original stayed.

Below is the curl command I used, did I mess the formatting up in any way?

curl --request POST --url http://localhost:8042/patients/7248ea76-2d511b6e-f8924c21-608c9d4e-f67f4f68/modify --data ‘{“Replace”:{“PatientID”:“TESTING1”,“AccessionNumber”:“TESTING2”}, “Keep”: [“StudyInstanceUID”, “SeriesInstanceUID”, “SOPInstanceUID”], “KeepSource”:false, “Force”:true}’

The logs state I should avoid doing this. I thought the force command should allow it?
W0413 15:36:57.979992 DicomModification.cpp:1079] Modifying a study while keeping its original StudyInstanceUID: This should be avoided!
W0413 15:36:57.980010 DicomModification.cpp:1092] Modifying a series while keeping its original SeriesInstanceUID: This should be avoided!
W0413 15:36:57.994325 DicomModification.cpp:1079] Modifying a study while keeping its original StudyInstanceUID: This should be avoided!

Any ideas?


The logs remind you that this is a bad idea but Orthanc is still doing the job.

Best regards,


I’m not sure but I think you must modify certain tags with the right endpoints. For example, since the PatientID belongs to /patients/, you were able to modify it. Were you able to modify AccessionNumber too?

For example, the reason KeepSource: false failed may be because you didn’t try to modify a study/instance, but a patient, which is just a convenient separation made by Orthanc.

A quarta-feira, 13 de abril de 2022 à(s) 20:46:54 UTC+1, escreveu:

Hi Alain and Diego,

You are correct, it did perform that action. I did not realize that it was stating Study and Series Instance UID. The log did not mention anything about the SOPInstanceUID.

I went back and tried at the instance level as Diego said and Orthanc said marking SOPInstanceUID to be kept had no effect:

W0414 08:03:49.989587 DicomModification.cpp:397] Marking this tag as to be kept has no effect: 0008,0018

I tried replacing the SOPInstanceUID with the one i want but that did not work. It still created a new one. Even if I tried again on the new one to set it back it created a new one again.

curl --request POST -url http://localhost:8042/instances/11111111-11111111-11111111-111111111-11111111/modify --data ‘{“Replace”:{“SOPInstanceUID”:“”}, “Keep”: [“StudyInstanceUID”, “SeriesInstanceUID”, “SOPInstanceUID”], “Force”:true}’ > file.dcm