# HG changeset patch # User Sebastien Jodogne # Date 1526473936 -7200 # Node ID 7fbe3f024ac96ee60ee3432f4b099223b0b2e9ba # Parent 1f7b459b247bea25cd3feab228e3fc0077eaf770 new screen in OrthancExplorer to list studies diff -r 1f7b459b247b -r 7fbe3f024ac9 OrthancExplorer/explorer.html --- a/OrthancExplorer/explorer.html Tue May 15 11:23:25 2018 +0200 +++ b/OrthancExplorer/explorer.html Wed May 16 14:32:16 2018 +0200 @@ -37,7 +37,10 @@

Find a patient

- Plugins +
Upload Query/Retrieve @@ -49,10 +52,31 @@
-
+
+
+

Find a study

+ + +
+
+
    +
+
+
+ +

Upload DICOM files

- Patients +
@@ -78,7 +102,10 @@

Patient

- Patients +
Upload Query/Retrieve @@ -135,7 +162,10 @@ Patient » Study - Patients +
Upload Query/Retrieve @@ -186,8 +216,10 @@ Study » Series - - Patients +
Upload Query/Retrieve @@ -240,7 +272,10 @@ Series » Instance - Patients +
Upload Query/Retrieve @@ -292,7 +327,10 @@

Plugins

- Patients +
    @@ -303,7 +341,10 @@

    DICOM Query/Retrieve (1/4)

    - Patients +
    @@ -370,7 +411,10 @@

    DICOM Query/Retrieve (2/4)

    - Patients + Query/Retrieve
    @@ -383,7 +427,10 @@

    DICOM Query/Retrieve (3/4)

    - Patients + Query/Retrieve
    @@ -396,7 +443,10 @@

    DICOM Query/Retrieve (4/4)

    - Patients + Query/Retrieve
    diff -r 1f7b459b247b -r 7fbe3f024ac9 OrthancExplorer/explorer.js --- a/OrthancExplorer/explorer.js Tue May 15 11:23:25 2018 +0200 +++ b/OrthancExplorer/explorer.js Wed May 16 14:32:16 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'); }); });