Hello,
I can’t reproduce your issue. If I load your Lua script:
function send(id, destination, SOPInstanceUID, debug)
if (debug == true) then
return
end
print(‘SOPInstanceUID’, SOPInstanceUID)
– Send the modified instance to another modality
local url = ‘/modalities/’ … destination …‘/store’
local results = RestApiPost(‘/modalities/’ … destination …‘/store’, id)
print('RestApiPost results for: ’ … url)
print(results)
PrintRecursive(ParseJson(results))
–SendToModality(id, destination)
end
Using the following Orthanc configuration:
{
“LuaScripts” : [ “test.lua” ],
“DicomModalities” : {
“storescp” : [ “STORESCP”, “localhost”, 2000 ]
}
}
And if I type the following command line:
curl -X POST http://localhost:8042/tools/execute-script -d ‘send(“19816330-cb02e1cf-df3a8fe8-bf510623-ccefe9f5”,“storescp”,“1.2.840.113543.6.6.4.7.64234348190163144631511103849051737563212”,false)’
I get:
SOPInstanceUID, 1.2.840.113543.6.6.4.7.64234348190163144631511103849051737563212
RestApiPost results for: /modalities/storescp/store
{
“Description” : “REST API”,
“FailedInstancesCount” : 0,
“InstancesCount” : 1,
“LocalAet” : “ORTHANC”,
“RemoteAet” : “STORESCP”
}
table
[FailedInstancesCount], number, 0
[LocalAet], string, ORTHANC
[InstancesCount], number, 1
[Description], string, REST API
[RemoteAet], string, STORESCP
Which indicates that everything works as expected: There is no problem related to a “nil” result.
Sébastien-