I’m using this code to get the dicom file :
local dicom = RestApiGet(“/instances/” … instanceId … “/file”)
What exactly is dicom in this case? A string?
I can write the dicom file to some other location, with this code :
– Write to the file
local target = assert(io.open(path … “/” … instanceId … “.dcm”, “wb”))
target:write(dicom)
target:close()
I can send the dicom to some express api, when I just send the dicom, like :
local answer = HttpPost(url, dicom, headers)
BUT, it seems that I can’t wrap the dicom object into a more complex string/object, this code doesn’t work :
local query =
‘{ “query”: “mutation ($file: Upload!, $tags: [String!]) { upload(file: $file, tags: $tags) { uuid filename status datasets { uuid uri layers { name shape } } } }”, “variables”: { “file”: null, “tags”: [“auto-sync”] } }’
local payload = {
[“operations”] = query,
[“map”] = ‘{ “0”: [“variables.file”] }’,
[“0”] = dicom
}
PrintRecursive(payload)
local answer = HttpPost(graphqlURL, DumpJson(payload, true), headers)
In general, I can’t print the content of dicom…
Is is possible to get the 3 snippet working?
Thanks