Good day group, my query is as follows:
I want to use the API to consult the patients, and download the study in .dcm, I would like to help me solve how to do it from php, since I am not downloading the file, but if I do it from the console, if I download the file in .dcm
Thanks for the help.
This is the code that I have
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $orthanc.‘instances/’.$uuidInstancia.‘/file > Prueba.dcm’);
$rtdo = curl_exec($ch);
$curl_errno = curl_errno($ch);
$curl_error = curl_error($ch);
$info = curl_getinfo($ch);
curl_close($ch);
The answer I get is:
Error 400: Bad Request Bad request
Disclaimer: I’m no php expert however, there’s nothing specific to Orthanc rest API. Googling for “calling a Rest API in PHP” should provide you more results than posting on this forum.
FYI, here are some PHP code accessing Orthanc API (disclaimer: I’m not the author): https://github.com/jodogne/OrthancContributed/blob/master/Applications/Php/SimpleViewerEmsy/viewer.php
Good day, I resolved the doubt, using the php system function.
In addition to this, I will share the code in github when it is complete, so that other developers can implement it in their projects.