$url = $orthanc.'tools/execute-script';
//echo $url;
....
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$headers = array(
"Content-Type: application/x-www-form-urlencoded",
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
//script lua
$data = "function OnStoredInstance(instanceId, tags, metadata)
if tags['Modality'] == 'DX' then
SendToModality(instanceId, 'gepacs')
end
if tags['Modality'] == 'MR' then
SendToModality(instanceId, 'gepacs')
end
if tags['Modality'] == 'CT' then
SendToModality(instanceId, 'gepacs')
end
end";
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
//for debug only!
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
curl_close($curl);
var_dump($resp);
?>