# HG changeset patch # User Sebastien Jodogne # Date 1526474405 -7200 # Node ID ef7ba1b21d58df6a44a38e71d4041cc6e401ae0e # Parent 56770d54d13a3e350586730abe43e274f943c148# Parent 42ac291f7b3fe14959105c7af4cb18312d0acaba integration mainline->jobs diff -r 56770d54d13a -r ef7ba1b21d58 NEWS --- a/NEWS Wed May 16 14:34:06 2018 +0200 +++ b/NEWS Wed May 16 14:40:05 2018 +0200 @@ -6,6 +6,11 @@ * New advanced job engine +Orthanc Explorer +---------------- + +* New screen listing all the available studies + REST API -------- diff -r 56770d54d13a -r ef7ba1b21d58 OrthancExplorer/explorer.html --- a/OrthancExplorer/explorer.html Wed May 16 14:34:06 2018 +0200 +++ b/OrthancExplorer/explorer.html Wed May 16 14:40:05 2018 +0200 @@ -37,8 +37,9 @@

Find a patient

-
+
Upload @@ -52,10 +53,31 @@
-
+
+
+

Find a study

+ + +
+
+
    +
+
+
+ +

Upload DICOM files

- Patients +
@@ -81,7 +103,10 @@

Patient

- Patients +
Upload Query/Retrieve @@ -138,7 +163,10 @@ Patient » Study - Patients +
Upload Query/Retrieve @@ -189,8 +217,10 @@ Study » Series - - Patients +
Upload Query/Retrieve @@ -243,7 +273,10 @@ Series » Instance - Patients +
Upload Query/Retrieve @@ -295,7 +328,10 @@

Plugins

- Patients +
    @@ -306,7 +342,10 @@

    DICOM Query/Retrieve (1/4)

    - Patients +
    @@ -373,7 +412,10 @@

    DICOM Query/Retrieve (2/4)

    - Patients + Query/Retrieve
    @@ -386,7 +428,10 @@

    DICOM Query/Retrieve (3/4)

    - Patients + Query/Retrieve
    @@ -399,7 +444,10 @@

    DICOM Query/Retrieve (4/4)

    - Patients + Query/Retrieve
    @@ -425,7 +473,10 @@

    Jobs

    - Patients +
      @@ -436,8 +487,11 @@

      Job

      - diff -r 56770d54d13a -r ef7ba1b21d58 OrthancExplorer/explorer.js --- a/OrthancExplorer/explorer.js Wed May 16 14:34:06 2018 +0200 +++ b/OrthancExplorer/explorer.js Wed May 16 14:40:05 2018 +0200 @@ -264,15 +264,29 @@ -function FormatStudy(study, link, isReverse) +function FormatStudy(study, link, isReverse, includePatient) { - var node = $('
      ').append($('

      ').text(study.MainDicomTags.StudyDescription)); + var label; + + if (includePatient) { + label = study.Label; + } else { + label = study.MainDicomTags.StudyDescription; + } + var node = $('
      ').append($('

      ').text(label)); + + if (includePatient) { + FormatMainDicomTags(node, study.PatientMainDicomTags, [ + 'PatientName' + ]); + } + FormatMainDicomTags(node, study.MainDicomTags, [ - "StudyDescription", - "StudyTime" + 'StudyDescription', + 'StudyTime' ]); - + return CompleteFormatting(node, link, isReverse, study.Series.length); } @@ -348,17 +362,55 @@ $('#find-patients').live('pagebeforeshow', function() { GetResource('/patients?expand', function(patients) { - var target = $('#all-patients'); - $('li', target).remove(); + var target = $('#all-patients'); + $('li', target).remove(); - SortOnDicomTag(patients, 'PatientName', false, false); + SortOnDicomTag(patients, 'PatientName', false, false); + + for (var i = 0; i < patients.length; i++) { + var p = FormatPatient(patients[i], '#patient?uuid=' + patients[i].ID); + target.append(p); + } + + target.listview('refresh'); + }); +}); + + - for (var i = 0; i < patients.length; i++) { - var p = FormatPatient(patients[i], '#patient?uuid=' + patients[i].ID); - target.append(p); +$('#find-studies').live('pagebeforeshow', function() { + GetResource('/studies?expand', function(studies) { + var target = $('#all-studies'); + $('li', target).remove(); + + for (var i = 0; i < studies.length; i++) { + var patient = studies[i].PatientMainDicomTags.PatientName; + var study = studies[i].MainDicomTags.StudyDescription; + + var s; + if (typeof patient === 'string') { + s = patient; } - target.listview('refresh'); + if (typeof study === 'string') { + if (s.length > 0) { + s += ' - '; + } + + s += study; + } + + studies[i]['Label'] = s; + } + + Sort(studies, function(a) { return a.Label }, false, false); + + for (var i = 0; i < studies.length; i++) { + var p = FormatStudy(studies[i], '#study?uuid=' + studies[i].ID, false, true); + target.append(p); + } + + target.listview('refresh'); }); });