How to convert PatientID to unique patient?uuid=?


Hello Orthanc Team,

I can see this is Orthanc Development form but kindly consider my request as a development of AI based Image classification for Cancer Diagnosis.

It’s being sometime we are using Orthanc as our hospital main Dicom Server and we are a Non-profit Cancer Institute. Till now we have more than 3000 studies Including CT, CR and MRI. I must tell, this is one of the best application we have ever tried.
As a side part we have developed our In-house Electronic Medical Records (EMR) system with Java programming language and we are trying to implement the AI based prediction model with Orthanc image repository. In our EMR PatientID is unique so we are trying to call the Orthanc dicom server with PatientID but In Orthanc PatientID is converted with Unique set of UUID. We have tried the REST API but could not figure out.

We have tried this :

   "ID" : "115e2a53-d737ec3f-41a34d77-716b5020-19438a3d",
   "IsStable" : true,
   "LastUpdate" : "20191203T113041",
   "MainDicomTags" : {
      "PatientBirthDate" : "",
      "PatientID" : "201900016",      ("Unable to call through this PatientID from EMR")
      "PatientName" : "NAZRUL^ISLAM^34Y",
      "PatientSex" : "M"
   "Studies" : [
   "Type" : "Patient"



How to convert this set of Unique UUID into PatientID or how to convert PatientID into Unique UUID. So, we can call the Orthanc patient image through our EMR PatientID. 

Please help us to get the result. 


You can use the /tools/find route of the API.

In your case, with httpie, you would have the below behaviour:
$ echo ‘{“Level”:“Patient”, “Query”: {“PatientID”:“201900016”}}’ | http localhost/tools/find

HTTP/1.1 200 OK
Connection: keep-alive
Content-Encoding: gzip
Content-Length: 69
Content-Type: application/json; charset=utf-8




Once you get the Patient UUID, you can query Orthanc with it. Of course, you need to adapt your EMR with a small script that will convert the PatientID into the Orthanc Patient UUID, but it should not be too complicated I guess.




Thanks for your positive feedback about Orthanc.

In complement to Michel’s answer, the following page explains how to convert the “Patient ID” DICOM tag to an Orthanc identifier:

Basically, you have to compute the SHA-1 sum of the “Patient ID”. Here is a GNU/Linux command line that illustrates this computation:

$ echo -n ‘201900016’ | sha1sum
115e2a53d737ec3f41a34d77716b502019438a3d -