I have a question about QIE's postDICOMRequest() method. I have an HTTP listener channel that receives a JSON payload that contains all the relevant information to perform a C-FIND by patientId. My plan is to find all DICOM studies for the patient by looking in various PACS that I have setup as DICOM connections within QIE. This is the code:
var destinationAET = "PACS_B";
var patientId = source.getNode("/patientId");
var request = qie.createDICOMRequest("1.2.840.10008.5.1.4.1.2.1.1", 0x20, 0); // Patient Root, STUDY level
var msgResponse = "";
request.setNode("/0010,0020", patientId); // Patient ID
request.setNode("/0008,0005", "ISO_IR 100"); // Avoids a Character set mismatch, If Orthanc stored the DICOM using non-default charset, but your C-FIND doesn’t include this...then it can silently fail to find matches
request.setNode("/0008,0052", "STUDY"); // Query Retrieve Level (STUDY/SERIES/IMAGE)
// You must explicitly request the fields you want to receive in the response by including them in the C-FIND request with empty values.
request.setNode("/0020,000d", ""); // Study Instance UID e.g. 1.2.840.10008.114051.26918.2025022511095516.3990029820
request.setNode("/0020,0010", ""); // StudyID human-entered identifier, often assigned by the imaging facility's RIS or PACS. e.g. 11540
request.setNode("/0008,0020", ""); // StudyDate
request.setNode("/0008,0030", ""); // StudyTime
request.setNode("/0008,1030", ""); // Study Description
request.setNode("/0008,0050", ""); // Accession Number
request.setNode("/0008,0061", ""); // Modalities in Study
var token = qie.postDICOMRequest(request, destinationAET);
var matchingStudiesList = [];
try {
var response = qie.getResponseToDICOMRequest(token);
while (response !== null) {
var matchingStudy = "" + response.getNode("/0020,000d"); // grab the study UID
if (StringUtils.isNotBlank(matchingStudy)) {
matchingStudiesList.push(matchingStudy);
}
response = qie.getResponseToDICOMRequest(token);
}
qie.debug("CFIND studyUIDs from " + destinationAET + ": " + JSON.stringify(matchingStudiesList));
msgResponse =
`HTTP Status: 200 OK
Content-Type="application/json"
{"matchingStudiesFound":${JSON.stringify(matchingStudiesList)}}`;
} catch (err) {
qie.warn(err);
msgResponse = `HTTP Status: 500
Content-Type="application/json"
{"error":"${err}"}
`;
}
qie.postMessageResponse(msgResponse);
This is the error I get:
[line: 18] WrappedException: Wrapped
com.qvera.qie.web.exception.MappingFailureException:
Channel 'C-FIND via JSON' is not running.
Stack Trace:
at script [line: 18]