Remove quido portion of studies services, moved to IWebAPI implementation for dicomweb
This commit is contained in:
parent
3242bbcf76
commit
e4972a858c
@ -21,59 +21,6 @@ function dateToString(date) {
|
||||
return ''.concat(year, month, day);
|
||||
}
|
||||
|
||||
/**
|
||||
* Produces a QIDO URL given server details and a set of specified search filter
|
||||
* items
|
||||
*
|
||||
* @param filter
|
||||
* @param serverSupportsQIDOIncludeField
|
||||
* @returns {string} The URL with encoded filter query data
|
||||
*/
|
||||
function getQIDOQueryParams(filter, serverSupportsQIDOIncludeField) {
|
||||
const commaSeparatedFields = [
|
||||
'00081030', // Study Description
|
||||
'00080060', // Modality
|
||||
// Add more fields here if you want them in the result
|
||||
].join(',');
|
||||
|
||||
const parameters = {
|
||||
PatientName: filter.PatientName,
|
||||
PatientID: filter.PatientID,
|
||||
AccessionNumber: filter.AccessionNumber,
|
||||
StudyDescription: filter.StudyDescription,
|
||||
ModalitiesInStudy: filter.ModalitiesInStudy,
|
||||
limit: filter.limit,
|
||||
offset: filter.offset,
|
||||
fuzzymatching: filter.fuzzymatching,
|
||||
includefield: serverSupportsQIDOIncludeField ? commaSeparatedFields : 'all',
|
||||
};
|
||||
|
||||
// build the StudyDate range parameter
|
||||
if (filter.studyDateFrom || filter.studyDateTo) {
|
||||
const dateFrom = dateToString(new Date(filter.studyDateFrom));
|
||||
const dateTo = dateToString(new Date(filter.studyDateTo));
|
||||
parameters.StudyDate = `${dateFrom}-${dateTo}`;
|
||||
}
|
||||
|
||||
// Build the StudyInstanceUID parameter
|
||||
if (filter.StudyInstanceUID) {
|
||||
let studyUIDs = filter.StudyInstanceUID;
|
||||
studyUIDs = Array.isArray(studyUIDs) ? studyUIDs.join() : studyUIDs;
|
||||
studyUIDs = studyUIDs.replace(/[^0-9.]+/g, '\\');
|
||||
parameters.StudyInstanceUID = studyUIDs;
|
||||
}
|
||||
|
||||
// Clean query params of undefined values.
|
||||
const params = {};
|
||||
Object.keys(parameters).forEach(key => {
|
||||
if (parameters[key] !== undefined && parameters[key] !== '') {
|
||||
params[key] = parameters[key];
|
||||
}
|
||||
});
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses resulting data from a QIDO call into a set of Study MetaData
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user