Hello, I have some studies where the Patient ID is not correct. I am trying to fix it in Orthanc Explorer 2 but I keep running into errors. For example, John Doe has 5 studies. 4 of those Studies have the correct Patient ID. Here are the steps I took:
- I pull up the study with the wrong patient ID in OE2.
- I then click on Modify->Change Patient.
- I enter the correct PatientID and then click on Modify.
- I click on Select next to the correct patient from the list. There is only one patient in this list.
OE2 then errors out with:
Unexpected error during modification, check the Orthanc logs or the browser console logs
So, I check the Orthanc logs and this is what it says:
HTTP-8 OrthancException.cpp:144] Bad request: Trying to change patient tags in a study. The Patient already exists and has other studies. All the ‘Replace’ tags should match the existing patient main dicom tags and you should specify all Patient MainDicomTags in your query. Try using /patients/../modify instead to modify the patient. Missing tag in the ‘Replace’ tags: 0010,0040
orthanc-1 | I0529 16:54:21.538836 HTTP-8 ElapsedTimer.cpp:107] (http) POST /studies/0000000-000000-000000-000000-0000000/modify (elapsed: 31868 us)
The Patient Name & DOB are the same between both the wrong PatientID and the correct PatientID.
According to the Orthanc Explorer 2 Plugin page (Orthanc Explorer 2 plugin — Orthanc Book documentation), I should be able to use this method to move this study to the correct patient. But, I am clearly missing or misunderstanding something. Any help would be appreciated!
Hi @idavid
This issue has been fixed a few weeks ago and I have just released a new version of OE2 with the fix.
Hope this helps,
Alain
Free software isn’t free to make — it takes time, effort, and resources. If you appreciate the project, consider donating to help sustain its development!
Thanks @alainmazy , I updated the image and it’s working great now. Thank you!
I have a quick question in regard to the DICOM UID, is it generally preferred to have Orthanc generate a new UID when doing these types of modifications? or is using the existing UID’s ok? I did a little research but the answers I am getting are not the cleanest. To me it does not seem like there is a clear use case on when to use each option.
I’m not Alain obviously, but from my experience, whether it’s necessary to generate a new UID or not really depends on what your goals are when modifying the DICOM data.
For example, if I’m using an anonymization tool to remove all Protected Health Information, I would want the resulting DICOM files to have new UIDs. I wouldn’t want a system I’m bringing the data into to in inadvertently associate the data with previous copies of the same data. Similarly, if I’m trying to reproduce some unwanted behavior with data that I know causes that issue, I want new UIDs throughout the data so the processing software doesn’t mix the new instance of the data up with the old instances.
On the other hand, say I work in a hospital setting and I have some DICOM images that were sent from an outside imaging center. Let’s say the images have a Patient ID that doesn’t match what my hospital has for that patient, and I want to modify the DICOM files to change the Patient ID before importing the images into my own PACS. In this case, maybe it doesn’t matter to leave the image UIDs with their original entries. (But maybe it doesn’t matter if new UIDs are generated as well.)
Probably the only time it is important to keep the UIDs the same is when you have multiple DICOM objects that reference each other via the UIDs, and you’re not simply running the files through an anonymizer. A good anonymizer will keep all these UIDs in sync (e.g. if File 1 refers to the UID of FIle 2, a good anonymizer will both update the UID of File 2 AND update the reference to that UID in File 1). But maybe I’m not anonymizing it, maybe I’m just updating a single DICOM tag for testing purposes. In this case, allowing the DICOM tool to write new UIDs will break that inter-file association, and then I’d have to manually update the UID reference to match the new values. Which might be trivial if it’s just one file, but if it’s hundreds of files it could be a real pain in the neck.
2 Likes
Oh wow, thank you for the detailed explanation! I actually inherited responsibility for this system as part of my job, and I’m still very new to it. Because of that, I’ve been pretty hesitant to make changes until I understand everything better. I definitely don’t want to accidentally break any traceability or existing links.
Thankfully, our data is backed up regularly, and I’ve been working with a copy of the backup data while I learn the system.
Our use case is fairly straightforward. We’re a clinic, and when we take X-rays, our Fuji X-ray system sends the processed images to Orthanc as well as to the radiologists we work with. If a patient requests a copy of their images, we burn them to a disc and provide it to them. Other than that, we don’t export the images anywhere else.
Unfortunately, the staff may accidentally enter the wrong patient name or patient ID, or select the wrong patient record from time to time. When that happens, the incorrect information gets stored in the DICOM tags. For newer studies, we can usually correct the information on the Fuji system, delete the study from Orthanc and then resend the corrected study back to Orthanc, but that approach doesn’t help with older studies that are already stored in Orthanc.
Sorry for the novel! lol But, I wanted to provide some context. My goal is simply to correct a patient ID or fix a typo in a patient’s name. The images themselves will remain in Orthanc, and based on what you’ve explained, it sounds like the best approach for my situation would be to modify the DICOM tags without generating new UIDs.
Thank you again for taking the time to explain all of this! Your information was incredibly helpful 
1 Like