LT-412: Study list needs default date filter
This commit is contained in:
parent
46360c0c95
commit
5d8c608e70
@ -158,7 +158,12 @@ export const UISettings = new SimpleSchema({
|
|||||||
type: String,
|
type: String,
|
||||||
label: 'Auto position text call-outs for measurements when creating them.',
|
label: 'Auto position text call-outs for measurements when creating them.',
|
||||||
defaultValue: 'TRBL'
|
defaultValue: 'TRBL'
|
||||||
}
|
},
|
||||||
|
studyListDateFilterNumDays: {
|
||||||
|
type: Number,
|
||||||
|
label: 'Number of days to be used on Study List date filter',
|
||||||
|
min: 1
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export const PublicServerConfig = new SimpleSchema({
|
export const PublicServerConfig = new SimpleSchema({
|
||||||
|
|||||||
@ -234,9 +234,20 @@ Template.studylistResult.onRendered(() => {
|
|||||||
const today = moment();
|
const today = moment();
|
||||||
const lastWeek = moment().subtract(6, 'days');
|
const lastWeek = moment().subtract(6, 'days');
|
||||||
const lastMonth = moment().subtract(29, 'days');
|
const lastMonth = moment().subtract(29, 'days');
|
||||||
const datePicker = instance.$('#studyDate').daterangepicker({
|
const $studyDate = instance.$('#studyDate');
|
||||||
|
const dateFilterNumDays = OHIF.uiSettings.studyListDateFilterNumDays;
|
||||||
|
let startDate, endDate;
|
||||||
|
|
||||||
|
if (dateFilterNumDays) {
|
||||||
|
startDate = moment().subtract(dateFilterNumDays - 1, 'days');
|
||||||
|
endDate = today;
|
||||||
|
}
|
||||||
|
|
||||||
|
const datePicker = $studyDate.daterangepicker({
|
||||||
maxDate: today,
|
maxDate: today,
|
||||||
autoUpdateInput: true,
|
autoUpdateInput: true,
|
||||||
|
startDate: startDate,
|
||||||
|
endDate: endDate,
|
||||||
ranges: {
|
ranges: {
|
||||||
Today: [today, today],
|
Today: [today, today],
|
||||||
'Last 7 Days': [lastWeek, today],
|
'Last 7 Days': [lastWeek, today],
|
||||||
@ -244,8 +255,13 @@ Template.studylistResult.onRendered(() => {
|
|||||||
}
|
}
|
||||||
}).data('daterangepicker');
|
}).data('daterangepicker');
|
||||||
|
|
||||||
// Retrieve all studies
|
if (startDate && endDate) {
|
||||||
search();
|
datePicker.updateInputText();
|
||||||
|
$studyDate.trigger('change');
|
||||||
|
} else {
|
||||||
|
// Retrieve all studies
|
||||||
|
search();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function resetSortingColumns(instance, sortingColumn) {
|
function resetSortingColumns(instance, sortingColumn) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user