annotate OrthancServer/OrthancExplorer/query-retrieve.js @ 4808:7e1740813fa4

todo cont
author Alain Mazy <am@osimis.io>
date Wed, 17 Nov 2021 10:08:44 +0100
parents 72a850947b11
children b2417ac5055a 7053502fbf97
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4122
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
1 /**
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
4 * Department, University Hospital of Liege, Belgium
4437
d9473bd5ed43 upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4122
diff changeset
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium
4122
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
6 *
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
7 * This program is free software: you can redistribute it and/or
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
8 * modify it under the terms of the GNU General Public License as
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
9 * published by the Free Software Foundation, either version 3 of the
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
10 * License, or (at your option) any later version.
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
11 *
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
12 * In addition, as a special exception, the copyright holders of this
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
13 * program give permission to link the code of its release with the
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
15 * that use the same license as the "OpenSSL" library), and distribute
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
16 * the linked executables. You must obey the GNU General Public License
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
17 * in all respects for all of the code used other than "OpenSSL". If you
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
18 * modify file(s) with this exception, you may extend this exception to
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
19 * your version of the file(s), but you are not obligated to do so. If
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
20 * you do not wish to do so, delete this exception statement from your
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
21 * version. If you delete this exception statement from all source files
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
22 * in the program, then also delete it here.
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
23 *
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
24 * This program is distributed in the hope that it will be useful, but
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
25 * WITHOUT ANY WARRANTY; without even the implied warranty of
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
27 * General Public License for more details.
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
28 *
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
29 * You should have received a copy of the GNU General Public License
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
30 * along with this program. If not, see <http://www.gnu.org/licenses/>.
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
31 **/
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
32
4bb7522a63e0 do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4090
diff changeset
33
4757
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
34 function IsoToDicomDate(s)
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
35 {
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
36 return s.substring(0, 4) + s.substring(5, 7) + s.substring(8, 10);
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
37 }
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
38
3373
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
39 function GenerateDicomDate(days)
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
40 {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
41 var today = new Date();
4610
8661811abca3 Use the local timezone for query/retrieve in the Orthanc Explorer interface (was UTC before)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
42 var utc = new Date(today);
8661811abca3 Use the local timezone for query/retrieve in the Orthanc Explorer interface (was UTC before)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
43 utc.setDate(today.getDate() + days);
8661811abca3 Use the local timezone for query/retrieve in the Orthanc Explorer interface (was UTC before)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
44
8661811abca3 Use the local timezone for query/retrieve in the Orthanc Explorer interface (was UTC before)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
45 /**
8661811abca3 Use the local timezone for query/retrieve in the Orthanc Explorer interface (was UTC before)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
46 * "utc" contains the date of interest, as selected by the user.
8661811abca3 Use the local timezone for query/retrieve in the Orthanc Explorer interface (was UTC before)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
47 * Calling "utc.toISOString()" would return a date in the UTC
8661811abca3 Use the local timezone for query/retrieve in the Orthanc Explorer interface (was UTC before)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
48 * timezone, whereas the user expects the date to be expressed in
8661811abca3 Use the local timezone for query/retrieve in the Orthanc Explorer interface (was UTC before)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
49 * her own timezone. We thus adjust from UTC to the local timezome.
8661811abca3 Use the local timezone for query/retrieve in the Orthanc Explorer interface (was UTC before)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
50 * https://stackoverflow.com/a/50537435
8661811abca3 Use the local timezone for query/retrieve in the Orthanc Explorer interface (was UTC before)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
51 * https://groups.google.com/g/orthanc-users/c/dK7EEPVpedk/m/DPtMRFnKAgAJ
8661811abca3 Use the local timezone for query/retrieve in the Orthanc Explorer interface (was UTC before)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
52 **/
8661811abca3 Use the local timezone for query/retrieve in the Orthanc Explorer interface (was UTC before)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
53 var timezoneOffset = today.getTimezoneOffset() * 60 * 1000;
8661811abca3 Use the local timezone for query/retrieve in the Orthanc Explorer interface (was UTC before)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
54 var localDate = new Date(utc.getTime() - timezoneOffset);
8661811abca3 Use the local timezone for query/retrieve in the Orthanc Explorer interface (was UTC before)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
55
4757
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
56 return IsoToDicomDate(localDate.toISOString());
3373
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
57 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
58
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
59
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
60 $('#query-retrieve').live('pagebeforeshow', function() {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
61 var targetDate;
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
62
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
63 $.ajax({
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
64 url: '../modalities',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
65 dataType: 'json',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
66 async: false,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
67 cache: false,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
68 success: function(modalities) {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
69 var targetServer = $('#qr-server');
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
70 var option;
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
71
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
72 $('option', targetServer).remove();
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
73
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
74 for (var i = 0; i < modalities.length; i++) {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
75 option = $('<option>').text(modalities[i]);
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
76 targetServer.append(option);
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
77 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
78
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
79 targetServer.selectmenu('refresh');
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
80 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
81 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
82
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
83 targetDate = $('#qr-date');
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
84 $('option', targetDate).remove();
3792
6dba4fa8a6cb remove universal wildcard on StudyDate in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3373
diff changeset
85 targetDate.append($('<option>').attr('value', '').text('Any date'));
3373
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
86 targetDate.append($('<option>').attr('value', GenerateDicomDate(0)).text('Today'));
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
87 targetDate.append($('<option>').attr('value', GenerateDicomDate(-1)).text('Yesterday'));
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
88 targetDate.append($('<option>').attr('value', GenerateDicomDate(-7) + '-').text('Last 7 days'));
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
89 targetDate.append($('<option>').attr('value', GenerateDicomDate(-31) + '-').text('Last 31 days'));
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
90 targetDate.append($('<option>').attr('value', GenerateDicomDate(-31 * 3) + '-').text('Last 3 months'));
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
91 targetDate.append($('<option>').attr('value', GenerateDicomDate(-365) + '-').text('Last year'));
4757
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
92 targetDate.append($('<option>').attr('value', 'specific').text('Specific date'));
3373
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
93 targetDate.selectmenu('refresh');
4757
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
94
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
95 $('#qr-date-specific').hide();
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
96 });
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
97
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
98
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
99 $('#qr-date').live('change', function() {
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
100 if ($(this).val() == 'specific') {
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
101 $('#qr-date-specific').show();
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
102 } else {
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
103 $('#qr-date-specific').hide();
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
104 }
3373
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
105 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
106
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
107
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
108 $('#qr-echo').live('click', function() {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
109 var server = $('#qr-server').val();
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
110 var message = 'Error: The C-Echo has failed!';
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
111
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
112 $.ajax({
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
113 url: '../modalities/' + server + '/echo',
4088
ce7709cb380e Fix issue #183 (C-ECHO always fails in Orthanc Explorer, regression from 1.6.1 to 1.7.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3792
diff changeset
114 data: '{}', // Fix for issue #183 (regression from Orthanc 1.6.1 to 1.7.0)
3373
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
115 type: 'POST',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
116 cache: false,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
117 async: false,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
118 success: function() {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
119 message = 'The C-Echo has succeeded!';
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
120 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
121 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
122
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
123 $('<div>').simpledialog2({
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
124 mode: 'button',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
125 headerText: 'Echo result',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
126 headerClose: true,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
127 buttonPrompt: message,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
128 animate: false,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
129 buttons : {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
130 'OK': { click: function () { } }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
131 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
132 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
133
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
134 return false;
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
135 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
136
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
137
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
138 $('#qr-submit').live('click', function() {
4757
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
139 var query, server, modalities, field, studyDate;
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
140
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
141 studyDate = $('#qr-date').val();
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
142 if (studyDate == 'specific') {
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
143 studyDate = IsoToDicomDate($('#qr-date-specific').val());
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
144 }
3373
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
145
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
146 query = {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
147 'Level' : 'Study',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
148 'Query' : {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
149 'AccessionNumber' : '',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
150 'PatientBirthDate' : '',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
151 'PatientID' : '',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
152 'PatientName' : '',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
153 'PatientSex' : '',
4757
72a850947b11 In lookup and query/retrieve, possibility to provide a specific study date
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4610
diff changeset
154 'StudyDate' : studyDate,
3792
6dba4fa8a6cb remove universal wildcard on StudyDate in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3373
diff changeset
155 'StudyDescription' : ''
3373
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
156 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
157 };
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
158
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
159 modalities = '';
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
160
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
161 field = $('#qr-fields input:checked').val();
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
162 query['Query'][field] = $('#qr-value').val().toUpperCase();
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
163
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
164 $('#qr-modalities input:checked').each(function() {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
165 var s = $(this).attr('name');
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
166 if (modalities == '')
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
167 modalities = s;
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
168 else
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
169 modalities += '\\' + s;
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
170 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
171
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
172 if (modalities.length > 0) {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
173 query['Query']['ModalitiesInStudy'] = modalities;
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
174 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
175
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
176
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
177 server = $('#qr-server').val();
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
178 $.ajax({
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
179 url: '../modalities/' + server + '/query',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
180 type: 'POST',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
181 data: JSON.stringify(query),
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
182 dataType: 'json',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
183 async: false,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
184 error: function() {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
185 alert('Error during query (C-Find)');
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
186 },
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
187 success: function(result) {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
188 ChangePage('query-retrieve-2', {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
189 'server' : server,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
190 'uuid' : result['ID']
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
191 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
192 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
193 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
194
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
195 return false;
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
196 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
197
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
198
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
199
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
200 $('#query-retrieve-2').live('pagebeforeshow', function() {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
201 var pageData, uri;
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
202
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
203 if ($.mobile.pageData) {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
204 pageData = DeepCopy($.mobile.pageData);
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
205
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
206 uri = '../queries/' + pageData.uuid + '/answers';
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
207
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
208 $.ajax({
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
209 url: uri,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
210 dataType: 'json',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
211 async: false,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
212 success: function(answers) {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
213 var target = $('#query-retrieve-2 ul');
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
214 $('li', target).remove();
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
215
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
216 for (var i = 0; i < answers.length; i++) {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
217 $.ajax({
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
218 url: uri + '/' + answers[i] + '/content?simplify',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
219 dataType: 'json',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
220 async: false,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
221 success: function(study) {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
222 var series = '#query-retrieve-3?server=' + pageData.server + '&uuid=' + study['StudyInstanceUID'];
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
223
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
224 var content = ($('<div>')
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
225 .append($('<h3>').text(study['PatientID'] + ' - ' + study['PatientName']))
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
226 .append($('<p>').text('Accession number: ')
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
227 .append($('<b>').text(study['AccessionNumber'])))
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
228 .append($('<p>').text('Birth date: ')
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
229 .append($('<b>').text(study['PatientBirthDate'])))
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
230 .append($('<p>').text('Patient sex: ')
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
231 .append($('<b>').text(study['PatientSex'])))
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
232 .append($('<p>').text('Study description: ')
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
233 .append($('<b>').text(study['StudyDescription'])))
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
234 .append($('<p>').text('Study date: ')
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
235 .append($('<b>').text(FormatDicomDate(study['StudyDate'])))));
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
236
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
237 var info = $('<a>').attr('href', series).html(content);
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
238
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
239 var answerId = answers[i];
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
240 var retrieve = $('<a>').text('Retrieve all study').click(function() {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
241 ChangePage('query-retrieve-4', {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
242 'query' : pageData.uuid,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
243 'answer' : answerId,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
244 'server' : pageData.server
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
245 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
246 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
247
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
248 target.append($('<li>').append(info).append(retrieve));
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
249 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
250 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
251 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
252
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
253 target.listview('refresh');
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
254 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
255 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
256 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
257 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
258
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
259
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
260 $('#query-retrieve-3').live('pagebeforeshow', function() {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
261 var pageData, query;
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
262
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
263 if ($.mobile.pageData) {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
264 pageData = DeepCopy($.mobile.pageData);
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
265
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
266 query = {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
267 'Level' : 'Series',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
268 'Query' : {
3792
6dba4fa8a6cb remove universal wildcard on StudyDate in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3373
diff changeset
269 'Modality' : '',
6dba4fa8a6cb remove universal wildcard on StudyDate in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3373
diff changeset
270 'ProtocolName' : '',
6dba4fa8a6cb remove universal wildcard on StudyDate in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3373
diff changeset
271 'SeriesDescription' : '',
6dba4fa8a6cb remove universal wildcard on StudyDate in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3373
diff changeset
272 'SeriesInstanceUID' : '',
3373
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
273 'StudyInstanceUID' : pageData.uuid
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
274 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
275 };
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
276
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
277 $.ajax({
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
278 url: '../modalities/' + pageData.server + '/query',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
279 type: 'POST',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
280 data: JSON.stringify(query),
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
281 dataType: 'json',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
282 async: false,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
283 error: function() {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
284 alert('Error during query (C-Find)');
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
285 },
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
286 success: function(answer) {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
287 var queryUuid = answer['ID'];
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
288 var uri = '../queries/' + answer['ID'] + '/answers';
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
289
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
290 $.ajax({
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
291 url: uri,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
292 dataType: 'json',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
293 async: false,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
294 success: function(answers) {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
295
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
296 var target = $('#query-retrieve-3 ul');
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
297 $('li', target).remove();
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
298
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
299 for (var i = 0; i < answers.length; i++) {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
300 $.ajax({
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
301 url: uri + '/' + answers[i] + '/content?simplify',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
302 dataType: 'json',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
303 async: false,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
304 success: function(series) {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
305 var content = ($('<div>')
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
306 .append($('<h3>').text(series['SeriesDescription']))
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
307 .append($('<p>').text('Modality: ')
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
308 .append($('<b>').text(series['Modality'])))
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
309 .append($('<p>').text('ProtocolName: ')
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
310 .append($('<b>').text(series['ProtocolName']))));
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
311
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
312 var info = $('<a>').html(content);
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
313
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
314 var answerId = answers[i];
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
315 info.click(function() {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
316 ChangePage('query-retrieve-4', {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
317 'query' : queryUuid,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
318 'study' : pageData.uuid,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
319 'answer' : answerId,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
320 'server' : pageData.server
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
321 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
322 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
323
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
324 target.append($('<li>').attr('data-icon', 'arrow-d').append(info));
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
325 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
326 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
327 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
328
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
329 target.listview('refresh');
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
330 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
331 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
332 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
333 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
334 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
335 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
336
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
337
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
338
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
339 $('#query-retrieve-4').live('pagebeforeshow', function() {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
340 var pageData, uri;
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
341
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
342 if ($.mobile.pageData) {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
343 var pageData = DeepCopy($.mobile.pageData);
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
344 var uri = '../queries/' + pageData.query + '/answers/' + pageData.answer + '/retrieve';
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
345
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
346 $.ajax({
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
347 url: '../system',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
348 dataType: 'json',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
349 async: false,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
350 cache: false,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
351 success: function(system) {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
352 $('#retrieve-target').val(system['DicomAet']);
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
353
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
354 $('#retrieve-form').submit(function(event) {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
355 var aet;
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
356
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
357 event.preventDefault();
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
358
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
359 aet = $('#retrieve-target').val();
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
360 if (aet.length == 0) {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
361 aet = system['DicomAet'];
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
362 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
363
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
364 $.ajax({
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
365 url: uri,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
366 type: 'POST',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
367 async: true, // Necessary to block UI
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
368 dataType: 'text',
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
369 data: aet,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
370 beforeSend: function() {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
371 $.blockUI({ message: $('#info-retrieve') });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
372 },
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
373 complete: function(s) {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
374 $.unblockUI();
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
375 },
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
376 success: function() {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
377 if (pageData.study) {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
378 // Go back to the list of series
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
379 ChangePage('query-retrieve-3', {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
380 'server' : pageData.server,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
381 'uuid' : pageData.study
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
382 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
383 } else {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
384 // Go back to the list of studies
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
385 ChangePage('query-retrieve-2', {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
386 'server' : pageData.server,
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
387 'uuid' : pageData.query
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
388 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
389 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
390 },
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
391 error: function() {
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
392 alert('Error during retrieve');
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
393 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
394 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
395 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
396 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
397 });
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
398 }
4a8e8a96b233 Fixed CRLF to LF in various files (found through grepping the source tree)
Benjamin Golinvaux <bgo@osimis.io>
parents: 3310
diff changeset
399 });