diff OrthancServer/OrthancExplorer/explorer.js @ 4757:72a850947b11

In lookup and query/retrieve, possibility to provide a specific study date
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 20 Jul 2021 08:14:05 +0200
parents 1a061bc2d6ca
children b2417ac5055a ae643f664628
line wrap: on
line diff
--- a/OrthancServer/OrthancExplorer/explorer.js	Mon Jul 19 15:13:40 2021 +0200
+++ b/OrthancServer/OrthancExplorer/explorer.js	Tue Jul 20 08:14:05 2021 +0200
@@ -506,23 +506,39 @@
   target.append($('<option>').attr('value', GenerateDicomDate(-31) + '-').text('Last 31 days'));
   target.append($('<option>').attr('value', GenerateDicomDate(-31 * 3) + '-').text('Last 3 months'));
   target.append($('<option>').attr('value', GenerateDicomDate(-365) + '-').text('Last year'));
+  target.append($('<option>').attr('value', 'specific').text('Specific date'));
   target.selectmenu('refresh');
 
   $('#lookup-result').hide();
+  $('#lookup-study-date-specific').hide();
+});
+
+
+$('#lookup-study-date').live('change', function() {
+  if ($(this).val() == 'specific') {
+    $('#lookup-study-date-specific').show();
+  } else {
+    $('#lookup-study-date-specific').hide();
+  }
 });
 
 
 $('#lookup-submit').live('click', function() {
-  var lookup;
+  var lookup, studyDate;
 
   $('#lookup-result').hide();
 
+  studyDate = $('#lookup-study-date').val();
+  if (studyDate == 'specific') {
+    studyDate = IsoToDicomDate($('#lookup-study-date-specific').val());
+  }
+  
   lookup = {
     'Level' : 'Study',
     'Expand' : true,
     'Limit' : LIMIT_RESOURCES + 1,
     'Query' : {
-      'StudyDate' : $('#lookup-study-date').val()
+      'StudyDate' : studyDate
     },
     'Full' : true
   };
@@ -541,6 +557,9 @@
       else if (input.id == 'lookup-study-description') {
         lookup['Query']['StudyDescription'] = input.value;
       }
+      else if (input.id == 'lookup-study-date-specific') {
+        // Ignore
+      }
       else {
         console.error('Unknown lookup field: ' + input.id);
       }