Hello group. I’m testing Orthanc’s Api Rest, but I’m having trouble using / tools / find. With curl (on linux or windows) it works fine, but not with python. Code:
import requests
from requests.auth import HTTPBasicAuth
data = ‘{“Level”:“Study”,“Query”:{“PatientName”:“BRAINIX”},“Expand”:true}’
url = “http://localhost:8042/tools/find -d”
response = requests.get(url + ’ '’ +data + '' ', auth=HTTPBasicAuth(‘alice’, ‘luisPassword’))
print(response.text)
Response:
{
“HttpError” : “Not Found”,
“HttpStatus” : 404,
“Message” : “Unknown resource”,
“Method” : “GET”,
“OrthancError” : “Unknown resource”,
“OrthancStatus” : 17,
“Uri” : "/tools/find -d ‘{"Level":"Study","Query":{"PatientName":"BRAINIX"},"Expand":true}’ "
}
with curl (on linux):
curl -u alice:alicePassword http://localhost:8042/tools/find -d ‘{“Level”:“Study”,“Query”:{“PatientName”:“BRAINIX”},“Expand”:true}’
and curl on windows:
curl -u alice:alicePassword http://localhost:8042/tools/find -d ‘{"Level":"Study","Query":{"PatientName":"BRAINIX"},"Expand":true}’
Response (OK):
{
“ID” : “27f7126f-4f66fb14-03f4081b-f9341db2-53925988”,
“IsStable” : true,
“LastUpdate” : “20210804T012231”,
“MainDicomTags” :
{
“AccessionNumber” : “0”,
“InstitutionName” : “7GEFF0GbzqCNo43Yd0,Ibu,zQSSX”,
“ReferringPhysicianName” : “dAEvNTxZJO0E”,
“RequestedProcedureDescription” : “IRM c\u00e9r\u00e9brale, neuro-cr\u00e2ne”,
“StudyDate” : “20061201”,
“StudyDescription” : “IRM c\u00e9r\u00e9brale, neuro-cr\u00e2ne”,
“StudyID” : “218211405”,
“StudyInstanceUID” : “2.16.840.1.113669.632.20.1211.10000357775”,
“StudyTime” : “141645.000000”
},
“ParentPatient” : “16738bc3-e47ed42a-43ce044c-a3414a45-cb069bd0”,
“PatientMainDicomTags” :
{
“PatientBirthDate” : “19490301”,
“PatientID” : “5Yp0E”,
“PatientName” : “BRAINIX”,
“PatientSex” : “0000”
},
“Series” :
[
“1e2c125c-411b8e86-3f4fe68e-a7584dd3-c6da78f0”
],
“Type” : “Study”
}
]
Please, I need help.
Thank You