How to convert PatientID to unique patient?uuid=?

EMR.png

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 :
http://localhost:8042/patients/115e2a53-d737ec3f-41a34d77-716b5020-19438a3d

{
   "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" : [
      "22d20f80-86c90f3d-02a44231-34093acd-6a81cc18",
      "73880e10-b7f157c4-0d56892c-aa66d706-eeabcc46"
   ],
   "Type" : "Patient"
}

http://localhost:8042/patients

[
   "115e2a53-d737ec3f-41a34d77-716b5020-19438a3d",
   "d0955944-56650341-5e23a473-6b540168-091744ee",
   "4f6f48a3-5fbe93e0-77cb238c-9a0d45a9-5bc016f0",
   "f30159c3-0c5a3d68-576fa3b0-ded4e78e-aaf63942"
]

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. 
Thanks


Hi,

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

[
“115e2a53-d737ec3f-41a34d77-716b5020-19438a3d”

]

`

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.

Cheers,

Michel

Hello,

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:
https://book.orthanc-server.com/faq/orthanc-ids.html

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 -

HTH,
Sébastien-