Orthanc PatientID

Hi,
I am trying to make a project for school emulating a few clinics, each one would have a orthanc server.
Those servers would send patients between them with “Send to modality” option. Everything ok but in this group i have read something that could bring me troubles, the orthanc ID of patients. From the orthanc book:

“The patient-level identifiers are not guaranteed to be globally unique, and might collide between different hospitals. For this reason, you should always do queries at the study level as soon as you deal with an application that handles patients from different hospitals.”

And searching in this group:

“Orthanc assumes that the patient id is unique to a single patient across all interactions. Imagine a situation where the patient id in dicom is being recycled or duplicated. For instance, 2 hospitals each use an internal id generator and there is a collision. In this case, the first patient assigned an id is assigned the record regardless of if they are in fact the correct patient. We actually have a pregnant man because of this.”

Assuming I would like if any more experienced with orthanc could confirm me/answer me some stuff.

1- To emulate the clinics, i have some VM, each one with orthanc server installed and running, the same .dcm files are indexed in the servers. I’ve checked the ID of the patient and they have the same ID. This make me question, Is it “fixed” the problem of not unique ID Patient of orthanc or was it simply luck the ID are the same for the patient? (Orthanc DicomAet is different in each Orthanc server)

2- If I transfer a patient using “Sent to modality” in Orthanc, is it guaranteed the Orthanc PatientID would remain the same? Example:

Orthanc Server1 Patient(ID:abc123) --(send to modality Orthanc Server2)–>Orthanc Server2 Patient(ID:abc123) ??

PD: (Clarification) when refering to Orthanc PatientID I’m refering the one Orthanc creates when indexed, not the Dicom PatientID

Any help will be appreciated and don’t hesitate to ask if i wasn’t clear enough

Thanks

Urls:
http://book.orthanc-server.com/faq/orthanc-ids.html
https://groups.google.com/forum/#!topic/orthanc-users/rSSbfLMdk-U

Hi Alberto,

Yes, the Orthanc ID is generated only from the DICOM Tags and therefore remains constant when data is moved from one Orthanc to the other or when data is uploaded multiple times. If you upload data, then delete it and re-upload it, you’ll get the same identifiers too.

Best regards,

Alain.

Thanks for your answer,

What DICOM tags does orthanc uses to generate his own patientID? Just the Dicom tag PatientId? If so, could it be possible to have 2 different patients with the same DICOM PatientID which ends up with the same Orthanc PatientId since the DICOM PatientId is not unique.
If this is the case, i was wondering if there is something I could do to guarantee this would not happened never, locally and in my system (a bunch of clinics).

This is explained here: http://book.orthanc-server.com/faq/orthanc-ids.html

  • Patients are identified as the SHA-1 hash of their PatientID tag (0010,0020).

So, if two clinics don’t use the same PatientID rules, there’s indeed a risk of PatientID collision (two different patients with the same PatientID).
You’ll have to introduce an intermediate Orthanc in which you should change the PatientID to the one of the destination hospital before pushing the data to the destination Orthanc. This can be done in a lua script that would call an external web-service to retrieve the PatientID mappings between hospitals … that’s a whole solution to develop !

Thanks a lot for your clarification !!
I’ll talk to my teacher about this and try a solution.
Thank you again.