LT-63: Applying date range filter for DicomWeb and DIMSE services on study list
This commit is contained in:
parent
8d5d1ee360
commit
ed86c14807
@ -45,7 +45,7 @@ Template.worklistResult.helpers({
|
|||||||
|
|
||||||
sortingColumnsIcons() {
|
sortingColumnsIcons() {
|
||||||
const instance = Template.instance();
|
const instance = Template.instance();
|
||||||
|
|
||||||
let sortingColumnsIcons = {};
|
let sortingColumnsIcons = {};
|
||||||
Object.keys(instance.sortingColumns.keys).forEach(key => {
|
Object.keys(instance.sortingColumns.keys).forEach(key => {
|
||||||
const value = instance.sortingColumns.get(key);
|
const value = instance.sortingColumns.get(key);
|
||||||
@ -218,13 +218,20 @@ Template.worklistResult.onRendered(() => {
|
|||||||
const instance = Template.instance();
|
const instance = Template.instance();
|
||||||
|
|
||||||
// Initialize daterangepicker
|
// Initialize daterangepicker
|
||||||
instance.$('#studyDate').daterangepicker({
|
const today = moment();
|
||||||
|
const lastWeek = moment().subtract(6, 'days');
|
||||||
|
const lastMonth = moment().subtract(29, 'days');
|
||||||
|
const datePicker = instance.$('#studyDate').daterangepicker({
|
||||||
|
maxDate: today,
|
||||||
|
autoUpdateInput: true,
|
||||||
ranges: {
|
ranges: {
|
||||||
Today: [moment(), moment()],
|
Today: [today, today],
|
||||||
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
|
'Last 7 Days': [lastWeek, today],
|
||||||
'Last 30 Days': [moment().subtract(29, 'days'), moment()]
|
'Last 30 Days': [lastMonth, today]
|
||||||
}
|
}
|
||||||
});
|
}).data('daterangepicker');
|
||||||
|
datePicker.setStartDate(lastWeek);
|
||||||
|
datePicker.setEndDate(today);
|
||||||
|
|
||||||
// Retrieve all studies
|
// Retrieve all studies
|
||||||
search();
|
search();
|
||||||
@ -251,7 +258,7 @@ Template.worklistResult.events({
|
|||||||
|
|
||||||
'change #studyDate'(event) {
|
'change #studyDate'(event) {
|
||||||
let dateRange = $(event.currentTarget).val();
|
let dateRange = $(event.currentTarget).val();
|
||||||
|
|
||||||
// Remove all space chars
|
// Remove all space chars
|
||||||
dateRange = dateRange.replace(/ /g, '');
|
dateRange = dateRange.replace(/ /g, '');
|
||||||
|
|
||||||
@ -287,4 +294,3 @@ Template.worklistResult.events({
|
|||||||
Session.set('sortOption', sortOption);
|
Session.set('sortOption', sortOption);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,47 +1,59 @@
|
|||||||
/**
|
import { moment } from 'meteor/mrt:moment';
|
||||||
* Parses resulting data from a QIDO call into a set of Study MetaData
|
|
||||||
*
|
/**
|
||||||
* @param resultData
|
* Parses resulting data from a QIDO call into a set of Study MetaData
|
||||||
* @returns {Array} An array of Study MetaData objects
|
*
|
||||||
*/
|
* @param resultData
|
||||||
function resultDataToStudies(resultData) {
|
* @returns {Array} An array of Study MetaData objects
|
||||||
var studies = [];
|
*/
|
||||||
|
function resultDataToStudies(resultData) {
|
||||||
resultData.forEach(function(studyRaw) {
|
var studies = [];
|
||||||
var study = studyRaw.toObject();
|
|
||||||
studies.push({
|
resultData.forEach(function(studyRaw) {
|
||||||
studyInstanceUid: study[0x0020000D],
|
var study = studyRaw.toObject();
|
||||||
// 00080005 = SpecificCharacterSet
|
studies.push({
|
||||||
studyDate: study[0x00080020],
|
studyInstanceUid: study[0x0020000D],
|
||||||
studyTime: study[0x00080030],
|
// 00080005 = SpecificCharacterSet
|
||||||
accessionNumber: study[0x00080050],
|
studyDate: study[0x00080020],
|
||||||
referringPhysicianName: study[0x00080090],
|
studyTime: study[0x00080030],
|
||||||
// 00081190 = URL
|
accessionNumber: study[0x00080050],
|
||||||
patientName: study[0x00100010],
|
referringPhysicianName: study[0x00080090],
|
||||||
patientId: study[0x00100020],
|
// 00081190 = URL
|
||||||
patientBirthdate: study[0x00100030],
|
patientName: study[0x00100010],
|
||||||
patientSex: study[0x00100040],
|
patientId: study[0x00100020],
|
||||||
imageCount: study[0x00201208],
|
patientBirthdate: study[0x00100030],
|
||||||
studyId: study[0x00200010],
|
patientSex: study[0x00100040],
|
||||||
studyDescription: study[0x00081030],
|
imageCount: study[0x00201208],
|
||||||
modalities: study[0x00080061]
|
studyId: study[0x00200010],
|
||||||
});
|
studyDescription: study[0x00081030],
|
||||||
});
|
modalities: study[0x00080061]
|
||||||
return studies;
|
});
|
||||||
}
|
});
|
||||||
|
return studies;
|
||||||
Services.DIMSE.Studies = function(filter) {
|
}
|
||||||
log.info('Services.DIMSE.Studies');
|
|
||||||
var parameters = {
|
Services.DIMSE.Studies = function(filter) {
|
||||||
0x00100010: filter.patientName,
|
log.info('Services.DIMSE.Studies');
|
||||||
0x00100020: filter.patientId,
|
|
||||||
0x00080050: filter.accessionNumber,
|
let filterStudyDate = '';
|
||||||
0x00081030: filter.studyDescription,
|
if (filter.studyDateFrom && filter.studyDateTo) {
|
||||||
0x00100040: '',
|
const convertDate = date => moment(date, 'MM/DD/YYYY').format('YYYYMMDD');
|
||||||
0x00201208: '',
|
const dateFrom = convertDate(filter.studyDateFrom);
|
||||||
0x00080061: filter.modalitiesInStudy
|
const dateTo = convertDate(filter.studyDateTo);
|
||||||
};
|
filterStudyDate = `${dateFrom}-${dateTo}`;
|
||||||
|
}
|
||||||
var results = DIMSE.retrieveStudies(parameters);
|
|
||||||
return resultDataToStudies(results);
|
var parameters = {
|
||||||
};
|
0x00100010: filter.patientName,
|
||||||
|
0x00100020: filter.patientId,
|
||||||
|
0x00080050: filter.accessionNumber,
|
||||||
|
0x00080020: filterStudyDate,
|
||||||
|
0x00081030: filter.studyDescription,
|
||||||
|
0x00100040: '',
|
||||||
|
0x00201208: '',
|
||||||
|
0x00080061: filter.modalitiesInStudy
|
||||||
|
};
|
||||||
|
|
||||||
|
var results = DIMSE.retrieveStudies(parameters);
|
||||||
|
return resultDataToStudies(results);
|
||||||
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user