Mercurial > hg > orthanc
annotate OrthancServer/OrthancExplorer/explorer.js @ 4645:1f90fe0fa13f
todo
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 28 Apr 2021 16:40:36 +0200 |
parents | 8262ffb393ff |
children | 569d9ef165b1 |
rev | line source |
---|---|
4122
4bb7522a63e0
do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
1 /** |
4bb7522a63e0
do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
4bb7522a63e0
do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
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:
4044
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:
4044
diff
changeset
|
6 * |
4bb7522a63e0
do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
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:
4044
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:
4044
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:
4044
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:
4044
diff
changeset
|
11 * |
4bb7522a63e0
do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
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:
4044
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:
4044
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:
4044
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:
4044
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:
4044
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:
4044
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:
4044
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:
4044
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:
4044
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:
4044
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:
4044
diff
changeset
|
23 * |
4bb7522a63e0
do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
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:
4044
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:
4044
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:
4044
diff
changeset
|
27 * General Public License for more details. |
4bb7522a63e0
do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
28 * |
4bb7522a63e0
do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
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:
4044
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:
4044
diff
changeset
|
31 **/ |
4bb7522a63e0
do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
32 |
4bb7522a63e0
do not enforce openssl exception in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
33 |
0 | 34 // http://stackoverflow.com/questions/1663741/is-there-a-good-jquery-drag-and-drop-file-upload-plugin |
35 | |
36 | |
37 // Forbid the access to IE | |
38 if ($.browser.msie) | |
39 { | |
40 alert("Please use Mozilla Firefox or Google Chrome. Microsoft Internet Explorer is not supported."); | |
41 } | |
42 | |
43 // http://jquerymobile.com/demos/1.1.0/docs/api/globalconfig.html | |
44 //$.mobile.ajaxEnabled = false; | |
45 //$.mobile.page.prototype.options.addBackBtn = true; | |
46 //$.mobile.defaultPageTransition = 'slide'; | |
47 | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
48 |
2873
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
49 var LIMIT_RESOURCES = 100; |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
50 |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
51 var currentPage = ''; |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
52 var currentUuid = ''; |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
53 |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
54 |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
55 function DeepCopy(obj) |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
56 { |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
57 return jQuery.extend(true, {}, obj); |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
58 } |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
59 |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
60 |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
61 function ChangePage(page, options) |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
62 { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
63 var first = true; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
64 var value; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
65 |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
66 if (options) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
67 for (var key in options) { |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
68 value = options[key]; |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
69 if (first) { |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
70 page += '?'; |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
71 first = false; |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
72 } else { |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
73 page += '&'; |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
74 } |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
75 |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
76 page += key + '=' + value; |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
77 } |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
78 } |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
79 |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
80 window.location.replace('explorer.html#' + page); |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
81 /*$.mobile.changePage('#' + page, { |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
82 changeHash: true |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
83 });*/ |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
84 } |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
85 |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
86 |
1556
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
87 function Refresh() |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
88 { |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
89 if (currentPage == 'patient') |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
90 RefreshPatient(); |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
91 else if (currentPage == 'study') |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
92 RefreshStudy(); |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
93 else if (currentPage == 'series') |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
94 RefreshSeries(); |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
95 else if (currentPage == 'instance') |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
96 RefreshInstance(); |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
97 } |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
98 |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
99 |
0 | 100 $(document).ready(function() { |
4461
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
101 var trees = [ '#dicom-tree', '#dicom-metaheader' ]; |
0 | 102 |
4461
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
103 for (var i = 0; i < trees.length; i++) { |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
104 $(trees[i]).tree({ |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
105 autoEscape: false |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
106 }); |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
107 |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
108 $(trees[i]).bind( |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
109 'tree.click', |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
110 function(event) { |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
111 if (event.node.is_open) |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
112 $(trees[i]).tree('closeNode', event.node, true); |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
113 else |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
114 $(trees[i]).tree('openNode', event.node, true); |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
115 } |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
116 ); |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
117 } |
3533
2090ec6a83a5
create a default user if none is provided, while issuing a warning in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3510
diff
changeset
|
118 |
2090ec6a83a5
create a default user if none is provided, while issuing a warning in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3510
diff
changeset
|
119 // Inject the template of the warning about insecure setup as the |
2090ec6a83a5
create a default user if none is provided, while issuing a warning in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3510
diff
changeset
|
120 // first child of each page |
2090ec6a83a5
create a default user if none is provided, while issuing a warning in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3510
diff
changeset
|
121 var insecure = $('#template-insecure').html(); |
2090ec6a83a5
create a default user if none is provided, while issuing a warning in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3510
diff
changeset
|
122 $('[data-role="page"]>[data-role="content"]').prepend(insecure); |
1556
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
123 |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
124 currentPage = $.mobile.pageData.active; |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
125 currentUuid = $.mobile.pageData.uuid; |
1591 | 126 if (!(typeof currentPage === 'undefined') && |
127 !(typeof currentUuid === 'undefined') && | |
128 currentPage.length > 0 && | |
1556
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
129 currentUuid.length > 0) |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
130 { |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
131 Refresh(); |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
132 } |
0 | 133 }); |
134 | |
3510
1a65beb5e52f
allow only 'token', 'auth-token' and 'authorization' as url params that are included in HTTP headers
Alain Mazy <alain@mazy.be>
parents:
3509
diff
changeset
|
135 function GetAuthorizationTokensFromUrl() { |
3509
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
136 var urlVariables = window.location.search.substring(1).split('&'); |
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
137 var dict = {}; |
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
138 |
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
139 for (var i = 0; i < urlVariables.length; i++) { |
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
140 var split = urlVariables[i].split('='); |
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
141 |
3510
1a65beb5e52f
allow only 'token', 'auth-token' and 'authorization' as url params that are included in HTTP headers
Alain Mazy <alain@mazy.be>
parents:
3509
diff
changeset
|
142 if (split.length == 2 && (split[0] == "token" || split[0] == "auth-token" || split[0] == "authorization")) { |
3509
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
143 dict[split[0]] = split[1]; |
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
144 } |
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
145 } |
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
146 return dict; |
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
147 }; |
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
148 |
3510
1a65beb5e52f
allow only 'token', 'auth-token' and 'authorization' as url params that are included in HTTP headers
Alain Mazy <alain@mazy.be>
parents:
3509
diff
changeset
|
149 var authorizationTokens = GetAuthorizationTokensFromUrl(); |
3509
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
150 |
3510
1a65beb5e52f
allow only 'token', 'auth-token' and 'authorization' as url params that are included in HTTP headers
Alain Mazy <alain@mazy.be>
parents:
3509
diff
changeset
|
151 /* Copy the authoziation toekn from the url search parameters into HTTP headers in every request to the Rest API. |
3509
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
152 Thanks to this behaviour, you may specify a ?token=xxx in your url and this will be passed |
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
153 as the "token" header in every request to the API allowing you to use the authorization plugin */ |
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
154 $.ajaxSetup( |
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
155 { |
3510
1a65beb5e52f
allow only 'token', 'auth-token' and 'authorization' as url params that are included in HTTP headers
Alain Mazy <alain@mazy.be>
parents:
3509
diff
changeset
|
156 headers : authorizationTokens |
3509
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
157 } |
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
158 ); |
5405d51e040d
Orthanc Explorer: include the url search params into HTTP headers to the Rest API to ease usage of the Authorization plugin
Alain Mazy <alain@mazy.be>
parents:
3321
diff
changeset
|
159 |
0 | 160 |
161 function SplitLongUid(s) | |
162 { | |
163 return '<span>' + s.substr(0, s.length / 2) + '</span> <span>' + s.substr(s.length / 2, s.length - s.length / 2) + '</span>'; | |
164 } | |
165 | |
166 | |
167 function ParseDicomDate(s) | |
168 { | |
169 y = parseInt(s.substr(0, 4), 10); | |
170 m = parseInt(s.substr(4, 2), 10) - 1; | |
171 d = parseInt(s.substr(6, 2), 10); | |
172 | |
173 if (y == null || m == null || d == null || | |
174 !isFinite(y) || !isFinite(m) || !isFinite(d)) | |
175 { | |
176 return null; | |
177 } | |
178 | |
179 if (y < 1900 || y > 2100 || | |
180 m < 0 || m >= 12 || | |
181 d <= 0 || d >= 32) | |
182 { | |
183 return null; | |
184 } | |
185 | |
186 return new Date(y, m, d); | |
187 } | |
188 | |
189 | |
190 function FormatDicomDate(s) | |
191 { | |
192 if (s == undefined) | |
193 return "No date"; | |
194 | |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
195 var d = ParseDicomDate(s); |
0 | 196 if (d == null) |
197 return '?'; | |
198 else | |
199 return d.toString('dddd, MMMM d, yyyy'); | |
200 } | |
201 | |
3576
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
202 function FormatFloatSequence(s) |
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
203 { |
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
204 if (s == undefined || s.length == 0) |
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
205 return "-"; |
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
206 |
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
207 if (s.indexOf("\\") == -1) |
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
208 return s; |
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
209 |
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
210 var oldValues = s.split("\\"); |
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
211 var newValues = []; |
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
212 for (var i = 0; i < oldValues.length; i++) |
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
213 { |
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
214 newValues.push(parseFloat(oldValues[i]).toFixed(3)); |
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
215 } |
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
216 return newValues.join("\\"); |
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
217 } |
0 | 218 |
80 | 219 function Sort(arr, fieldExtractor, isInteger, reverse) |
0 | 220 { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
221 var defaultValue; |
33 | 222 if (isInteger) |
223 defaultValue = 0; | |
224 else | |
225 defaultValue = ''; | |
226 | |
0 | 227 arr.sort(function(a, b) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
228 var ta = fieldExtractor(a); |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
229 var tb = fieldExtractor(b); |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
230 var order; |
0 | 231 |
33 | 232 if (ta == undefined) |
233 ta = defaultValue; | |
234 | |
235 if (tb == undefined) | |
236 tb = defaultValue; | |
237 | |
0 | 238 if (isInteger) |
239 { | |
240 ta = parseInt(ta, 10); | |
241 tb = parseInt(tb, 10); | |
242 order = ta - tb; | |
243 } | |
244 else | |
245 { | |
246 if (ta < tb) | |
247 order = -1; | |
248 else if (ta > tb) | |
249 order = 1; | |
250 else | |
251 order = 0; | |
252 } | |
253 | |
254 if (reverse) | |
255 return -order; | |
256 else | |
257 return order; | |
258 }); | |
259 } | |
260 | |
261 | |
80 | 262 function SortOnDicomTag(arr, tag, isInteger, reverse) |
263 { | |
264 return Sort(arr, function(a) { | |
265 return a.MainDicomTags[tag]; | |
266 }, isInteger, reverse); | |
267 } | |
268 | |
269 | |
0 | 270 |
1345 | 271 function GetResource(uri, callback) |
0 | 272 { |
273 $.ajax({ | |
1345 | 274 url: '..' + uri, |
0 | 275 dataType: 'json', |
276 async: false, | |
344
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
277 cache: false, |
0 | 278 success: function(s) { |
279 callback(s); | |
280 } | |
281 }); | |
282 } | |
283 | |
284 | |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
285 function CompleteFormatting(node, link, isReverse, count) |
0 | 286 { |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
287 if (count != null) |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
288 { |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
289 node = node.add($('<span>') |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
290 .addClass('ui-li-count') |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
291 .text(count)); |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
292 } |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
293 |
0 | 294 if (link != null) |
295 { | |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
296 node = $('<a>').attr('href', link).append(node); |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
297 |
0 | 298 if (isReverse) |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
299 node.attr('data-direction', 'reverse') |
0 | 300 } |
301 | |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
302 node = $('<li>').append(node); |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
303 |
0 | 304 if (isReverse) |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
305 node.attr('data-icon', 'back'); |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
306 |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
307 return node; |
0 | 308 } |
309 | |
310 | |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
311 function FormatMainDicomTags(target, tags, tagsToIgnore) |
38 | 312 { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
313 var v; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
314 |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
315 for (var i in tags) |
38 | 316 { |
317 if (tagsToIgnore.indexOf(i) == -1) | |
318 { | |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
319 v = tags[i]; |
38 | 320 |
40 | 321 if (i == "PatientBirthDate" || |
322 i == "StudyDate" || | |
323 i == "SeriesDate") | |
38 | 324 { |
325 v = FormatDicomDate(v); | |
326 } | |
40 | 327 else if (i == "DicomStudyInstanceUID" || |
328 i == "DicomSeriesInstanceUID") | |
38 | 329 { |
330 v = SplitLongUid(v); | |
331 } | |
3576
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
332 else if (i == "ImagePositionPatient" || |
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
333 i == "ImageOrientationPatient") |
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
334 { |
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
335 v = FormatFloatSequence(v); |
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
336 } |
38 | 337 |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
338 target.append($('<p>') |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
339 .text(i + ': ') |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
340 .append($('<strong>').text(v))); |
38 | 341 } |
342 } | |
343 } | |
344 | |
0 | 345 |
346 function FormatPatient(patient, link, isReverse) | |
347 { | |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
348 var node = $('<div>').append($('<h3>').text(patient.MainDicomTags.PatientName)); |
0 | 349 |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
350 FormatMainDicomTags(node, patient.MainDicomTags, [ |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
351 "PatientName" |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
352 // "OtherPatientIDs" |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
353 ]); |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
354 |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
355 return CompleteFormatting(node, link, isReverse, patient.Studies.length); |
0 | 356 } |
357 | |
358 | |
359 | |
2594
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
360 function FormatStudy(study, link, isReverse, includePatient) |
0 | 361 { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
362 var label; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
363 var node; |
2594
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
364 |
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
365 if (includePatient) { |
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
366 label = study.Label; |
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
367 } else { |
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
368 label = study.MainDicomTags.StudyDescription; |
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
369 } |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
370 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
371 node = $('<div>').append($('<h3>').text(label)); |
2594
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
372 |
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
373 if (includePatient) { |
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
374 FormatMainDicomTags(node, study.PatientMainDicomTags, [ |
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
375 'PatientName' |
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
376 ]); |
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
377 } |
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
378 |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
379 FormatMainDicomTags(node, study.MainDicomTags, [ |
2594
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
380 'StudyDescription', |
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
381 'StudyTime' |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
382 ]); |
2594
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
383 |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
384 return CompleteFormatting(node, link, isReverse, study.Series.length); |
0 | 385 } |
386 | |
387 | |
388 | |
389 function FormatSeries(series, link, isReverse) | |
390 { | |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
391 var c; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
392 var node; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
393 |
82 | 394 if (series.ExpectedNumberOfInstances == null || |
395 series.Instances.length == series.ExpectedNumberOfInstances) | |
80 | 396 { |
82 | 397 c = series.Instances.length; |
80 | 398 } |
399 else | |
400 { | |
401 c = series.Instances.length + '/' + series.ExpectedNumberOfInstances; | |
402 } | |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
403 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
404 node = $('<div>') |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
405 .append($('<h3>').text(series.MainDicomTags.SeriesDescription)) |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
406 .append($('<p>').append($('<em>') |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
407 .text('Status: ') |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
408 .append($('<strong>').text(series.Status)))); |
80 | 409 |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
410 FormatMainDicomTags(node, series.MainDicomTags, [ |
40 | 411 "SeriesDescription", |
412 "SeriesTime", | |
41
c1097a676eca
better naming for preview images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
413 "Manufacturer", |
c1097a676eca
better naming for preview images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
414 "ImagesInAcquisition", |
1732
5cdea1cd2071
remove display of ImageOrientationPatient and ImagePositionPatient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1591
diff
changeset
|
415 "SeriesDate", |
5cdea1cd2071
remove display of ImageOrientationPatient and ImagePositionPatient
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1591
diff
changeset
|
416 "ImageOrientationPatient" |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
417 ]); |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
418 |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
419 return CompleteFormatting(node, link, isReverse, c); |
0 | 420 } |
421 | |
422 | |
423 function FormatInstance(instance, link, isReverse) | |
424 { | |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
425 var node = $('<div>').append($('<h3>').text('Instance: ' + instance.IndexInSeries)); |
0 | 426 |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
427 FormatMainDicomTags(node, instance.MainDicomTags, [ |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
428 "AcquisitionNumber", |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
429 "InstanceNumber", |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
430 "InstanceCreationDate", |
3576
35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
Alain Mazy <alain@mazy.be>
parents:
3534
diff
changeset
|
431 "InstanceCreationTime" |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
432 ]); |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
433 |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
434 return CompleteFormatting(node, link, isReverse); |
0 | 435 } |
436 | |
437 | |
152
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
438 $('[data-role="page"]').live('pagebeforeshow', function() { |
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
439 $.ajax({ |
153 | 440 url: '../system', |
152
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
441 dataType: 'json', |
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
442 async: false, |
344
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
443 cache: false, |
152
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
444 success: function(s) { |
165 | 445 if (s.Name != "") { |
2336
a95beca72e99
fix header and query/retrieve in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2292
diff
changeset
|
446 $('.orthanc-name').html($('<a>') |
a95beca72e99
fix header and query/retrieve in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2292
diff
changeset
|
447 .addClass('ui-link') |
a95beca72e99
fix header and query/retrieve in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2292
diff
changeset
|
448 .attr('href', 'explorer.html') |
a95beca72e99
fix header and query/retrieve in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2292
diff
changeset
|
449 .text(s.Name) |
a95beca72e99
fix header and query/retrieve in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2292
diff
changeset
|
450 .append(' » ')); |
165 | 451 } |
3533
2090ec6a83a5
create a default user if none is provided, while issuing a warning in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3510
diff
changeset
|
452 |
2090ec6a83a5
create a default user if none is provided, while issuing a warning in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3510
diff
changeset
|
453 // New in Orthanc 1.5.8 |
3534
cac8ffcb9cef
forcing AuthenticationEnabled to false is considered as insecure if remote access is allowed
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3533
diff
changeset
|
454 if ('IsHttpServerSecure' in s && |
cac8ffcb9cef
forcing AuthenticationEnabled to false is considered as insecure if remote access is allowed
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3533
diff
changeset
|
455 !s.IsHttpServerSecure) { |
3533
2090ec6a83a5
create a default user if none is provided, while issuing a warning in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3510
diff
changeset
|
456 $('.warning-insecure').show(); |
2090ec6a83a5
create a default user if none is provided, while issuing a warning in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3510
diff
changeset
|
457 } else { |
2090ec6a83a5
create a default user if none is provided, while issuing a warning in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3510
diff
changeset
|
458 $('.warning-insecure').hide(); |
2090ec6a83a5
create a default user if none is provided, while issuing a warning in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3510
diff
changeset
|
459 } |
152
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
460 } |
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
461 }); |
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
462 }); |
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
463 |
0 | 464 |
465 | |
2873
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
466 $('#lookup').live('pagebeforeshow', function() { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
467 // NB: "GenerateDicomDate()" is defined in "query-retrieve.js" |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
468 var target = $('#lookup-study-date'); |
2873
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
469 $('option', target).remove(); |
3792
6dba4fa8a6cb
remove universal wildcard on StudyDate in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3576
diff
changeset
|
470 target.append($('<option>').attr('value', '').text('Any date')); |
2873
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
471 target.append($('<option>').attr('value', GenerateDicomDate(0)).text('Today')); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
472 target.append($('<option>').attr('value', GenerateDicomDate(-1)).text('Yesterday')); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
473 target.append($('<option>').attr('value', GenerateDicomDate(-7) + '-').text('Last 7 days')); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
474 target.append($('<option>').attr('value', GenerateDicomDate(-31) + '-').text('Last 31 days')); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
475 target.append($('<option>').attr('value', GenerateDicomDate(-31 * 3) + '-').text('Last 3 months')); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
476 target.append($('<option>').attr('value', GenerateDicomDate(-365) + '-').text('Last year')); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
477 target.selectmenu('refresh'); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
478 |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
479 $('#lookup-result').hide(); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
480 }); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
481 |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
482 |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
483 $('#lookup-submit').live('click', function() { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
484 var lookup; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
485 |
2873
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
486 $('#lookup-result').hide(); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
487 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
488 lookup = { |
2873
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
489 'Level' : 'Study', |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
490 'Expand' : true, |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
491 'Limit' : LIMIT_RESOURCES + 1, |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
492 'Query' : { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
493 'StudyDate' : $('#lookup-study-date').val() |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
494 } |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
495 }; |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
496 |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
497 $('#lookup-form input').each(function(index, input) { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
498 if (input.value.length != 0) { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
499 if (input.id == 'lookup-patient-id') { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
500 lookup['Query']['PatientID'] = input.value; |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
501 } |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
502 else if (input.id == 'lookup-patient-name') { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
503 lookup['Query']['PatientName'] = input.value; |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
504 } |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
505 else if (input.id == 'lookup-accession-number') { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
506 lookup['Query']['AccessionNumber'] = input.value; |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
507 } |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
508 else if (input.id == 'lookup-study-description') { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
509 lookup['Query']['StudyDescription'] = input.value; |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
510 } |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
511 else { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
512 console.error('Unknown lookup field: ' + input.id); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
513 } |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
514 } |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
515 }); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
516 |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
517 $.ajax({ |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
518 url: '../tools/find', |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
519 type: 'POST', |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
520 data: JSON.stringify(lookup), |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
521 dataType: 'json', |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
522 async: false, |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
523 error: function() { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
524 alert('Error during lookup'); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
525 }, |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
526 success: function(studies) { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
527 FormatListOfStudies('#lookup-result ul', '#lookup-alert', '#lookup-count', studies); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
528 $('#lookup-result').show(); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
529 } |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
530 }); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
531 |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
532 return false; |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
533 }); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
534 |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
535 |
0 | 536 $('#find-patients').live('pagebeforeshow', function() { |
2873
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
537 GetResource('/patients?expand&since=0&limit=' + (LIMIT_RESOURCES + 1), function(patients) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
538 var target = $('#all-patients'); |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
539 var count, showAlert, p; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
540 |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
541 |
2594
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
542 $('li', target).remove(); |
0 | 543 |
2594
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
544 SortOnDicomTag(patients, 'PatientName', false, false); |
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
545 |
2873
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
546 if (patients.length <= LIMIT_RESOURCES) { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
547 count = patients.length; |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
548 showAlert = false; |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
549 } |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
550 else { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
551 count = LIMIT_RESOURCES; |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
552 showAlert = true; |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
553 } |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
554 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
555 for (var i = 0; i < count; i++) { |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
556 p = FormatPatient(patients[i], '#patient?uuid=' + patients[i].ID); |
2594
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
557 target.append(p); |
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
558 } |
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
559 |
2873
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
560 target.listview('refresh'); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
561 |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
562 if (showAlert) { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
563 $('#count-patients').text(LIMIT_RESOURCES); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
564 $('#alert-patients').show(); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
565 } else { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
566 $('#alert-patients').hide(); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
567 } |
2594
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
568 }); |
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
569 }); |
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
570 |
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
571 |
0 | 572 |
2873
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
573 function FormatListOfStudies(targetId, alertId, countId, studies) |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
574 { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
575 var target = $(targetId); |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
576 var patient, study, s; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
577 var count, showAlert; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
578 |
2873
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
579 $('li', target).remove(); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
580 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
581 for (var i = 0; i < studies.length; i++) { |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
582 patient = studies[i].PatientMainDicomTags.PatientName; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
583 study = studies[i].MainDicomTags.StudyDescription; |
2594
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
584 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
585 s = ""; |
2873
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
586 if (typeof patient === 'string') { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
587 s = patient; |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
588 } |
2594
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
589 |
2873
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
590 if (typeof study === 'string') { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
591 if (s.length > 0) { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
592 s += ' - '; |
1343
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
593 } |
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
594 |
2873
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
595 s += study; |
2594
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
596 } |
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
597 |
2873
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
598 studies[i]['Label'] = s; |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
599 } |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
600 |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
601 Sort(studies, function(a) { return a.Label }, false, false); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
602 |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
603 if (studies.length <= LIMIT_RESOURCES) { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
604 count = studies.length; |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
605 showAlert = false; |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
606 } |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
607 else { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
608 count = LIMIT_RESOURCES; |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
609 showAlert = true; |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
610 } |
2594
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
611 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
612 for (var i = 0; i < count; i++) { |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
613 s = FormatStudy(studies[i], '#study?uuid=' + studies[i].ID, false, true); |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
614 target.append(s); |
2873
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
615 } |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
616 |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
617 target.listview('refresh'); |
2594
7fbe3f024ac9
new screen in OrthancExplorer to list studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
618 |
2873
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
619 if (showAlert) { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
620 $(countId).text(LIMIT_RESOURCES); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
621 $(alertId).show(); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
622 } else { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
623 $(alertId).hide(); |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
624 } |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
625 } |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
626 |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
627 |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
628 $('#find-studies').live('pagebeforeshow', function() { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
629 GetResource('/studies?expand&since=0&limit=' + (LIMIT_RESOURCES + 1), function(studies) { |
703d1e848907
Orthanc Explorer: Lookup and limit the results to 100 patients/studies
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2647
diff
changeset
|
630 FormatListOfStudies('#all-studies', '#alert-studies', '#count-studies', studies); |
1345 | 631 }); |
0 | 632 }); |
633 | |
634 | |
635 | |
515
a8be42bcf2bb
Link from modified to original resource in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
485
diff
changeset
|
636 function SetupAnonymizedOrModifiedFrom(buttonSelector, resource, resourceType, field) |
443
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
637 { |
515
a8be42bcf2bb
Link from modified to original resource in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
485
diff
changeset
|
638 if (field in resource) |
443
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
639 { |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
640 $(buttonSelector).closest('li').show(); |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
641 $(buttonSelector).click(function(e) { |
515
a8be42bcf2bb
Link from modified to original resource in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
485
diff
changeset
|
642 window.location.assign('explorer.html#' + resourceType + '?uuid=' + resource[field]); |
443
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
643 }); |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
644 } |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
645 else |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
646 { |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
647 $(buttonSelector).closest('li').hide(); |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
648 } |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
649 } |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
650 |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
651 |
515
a8be42bcf2bb
Link from modified to original resource in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
485
diff
changeset
|
652 |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
653 function RefreshPatient() |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
654 { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
655 var pageData, target, v; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
656 |
0 | 657 if ($.mobile.pageData) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
658 pageData = DeepCopy($.mobile.pageData); |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
659 |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
660 GetResource('/patients/' + pageData.uuid, function(patient) { |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
661 GetResource('/patients/' + pageData.uuid + '/studies', function(studies) { |
1345 | 662 SortOnDicomTag(studies, 'StudyDate', false, true); |
0 | 663 |
1345 | 664 $('#patient-info li').remove(); |
665 $('#patient-info') | |
666 .append('<li data-role="list-divider">Patient</li>') | |
667 .append(FormatPatient(patient)) | |
668 .listview('refresh'); | |
1343
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
669 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
670 target = $('#list-studies'); |
1345 | 671 $('li', target).remove(); |
672 | |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
673 for (var i = 0; i < studies.length; i++) { |
1345 | 674 if (i == 0 || studies[i].MainDicomTags.StudyDate != studies[i - 1].MainDicomTags.StudyDate) |
675 { | |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
676 target.append($('<li>') |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
677 .attr('data-role', 'list-divider') |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
678 .text(FormatDicomDate(studies[i].MainDicomTags.StudyDate))); |
0 | 679 } |
680 | |
1345 | 681 target.append(FormatStudy(studies[i], '#study?uuid=' + studies[i].ID)); |
682 } | |
0 | 683 |
1345 | 684 SetupAnonymizedOrModifiedFrom('#patient-anonymized-from', patient, 'patient', 'AnonymizedFrom'); |
685 SetupAnonymizedOrModifiedFrom('#patient-modified-from', patient, 'patient', 'ModifiedFrom'); | |
686 | |
687 target.listview('refresh'); | |
274
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
688 |
1345 | 689 // Check whether this patient is protected |
690 $.ajax({ | |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
691 url: '../patients/' + pageData.uuid + '/protected', |
1345 | 692 type: 'GET', |
693 dataType: 'text', | |
694 async: false, | |
695 cache: false, | |
696 success: function (s) { | |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
697 v = (s == '1') ? 'on' : 'off'; |
1345 | 698 $('#protection').val(v).slider('refresh'); |
699 } | |
700 }); | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
701 |
1345 | 702 currentPage = 'patient'; |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
703 currentUuid = pageData.uuid; |
0 | 704 }); |
705 }); | |
706 } | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
707 } |
0 | 708 |
709 | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
710 function RefreshStudy() |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
711 { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
712 var pageData, target; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
713 |
0 | 714 if ($.mobile.pageData) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
715 pageData = DeepCopy($.mobile.pageData); |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
716 |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
717 GetResource('/studies/' + pageData.uuid, function(study) { |
1345 | 718 GetResource('/patients/' + study.ParentPatient, function(patient) { |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
719 GetResource('/studies/' + pageData.uuid + '/series', function(series) { |
1345 | 720 SortOnDicomTag(series, 'SeriesDate', false, true); |
0 | 721 |
1345 | 722 $('#study .patient-link').attr('href', '#patient?uuid=' + patient.ID); |
723 $('#study-info li').remove(); | |
724 $('#study-info') | |
725 .append('<li data-role="list-divider">Patient</li>') | |
726 .append(FormatPatient(patient, '#patient?uuid=' + patient.ID, true)) | |
727 .append('<li data-role="list-divider">Study</li>') | |
728 .append(FormatStudy(study)) | |
729 .listview('refresh'); | |
443
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
730 |
1345 | 731 SetupAnonymizedOrModifiedFrom('#study-anonymized-from', study, 'study', 'AnonymizedFrom'); |
732 SetupAnonymizedOrModifiedFrom('#study-modified-from', study, 'study', 'ModifiedFrom'); | |
1343
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
733 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
734 target = $('#list-series'); |
1345 | 735 $('li', target).remove(); |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
736 for (var i = 0; i < series.length; i++) { |
1345 | 737 if (i == 0 || series[i].MainDicomTags.SeriesDate != series[i - 1].MainDicomTags.SeriesDate) |
738 { | |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
739 target.append($('<li>') |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
740 .attr('data-role', 'list-divider') |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
741 .text(FormatDicomDate(series[i].MainDicomTags.SeriesDate))); |
0 | 742 } |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
743 |
1345 | 744 target.append(FormatSeries(series[i], '#series?uuid=' + series[i].ID)); |
745 } | |
746 target.listview('refresh'); | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
747 |
1345 | 748 currentPage = 'study'; |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
749 currentUuid = pageData.uuid; |
0 | 750 }); |
1343
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
751 }); |
0 | 752 }); |
753 } | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
754 } |
0 | 755 |
756 | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
757 function RefreshSeries() |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
758 { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
759 var pageData, target; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
760 |
0 | 761 if ($.mobile.pageData) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
762 pageData = DeepCopy($.mobile.pageData); |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
763 |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
764 GetResource('/series/' + pageData.uuid, function(series) { |
1345 | 765 GetResource('/studies/' + series.ParentStudy, function(study) { |
766 GetResource('/patients/' + study.ParentPatient, function(patient) { | |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
767 GetResource('/series/' + pageData.uuid + '/instances', function(instances) { |
1345 | 768 Sort(instances, function(x) { return x.IndexInSeries; }, true, false); |
0 | 769 |
1345 | 770 $('#series .patient-link').attr('href', '#patient?uuid=' + patient.ID); |
771 $('#series .study-link').attr('href', '#study?uuid=' + study.ID); | |
152
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
772 |
1345 | 773 $('#series-info li').remove(); |
774 $('#series-info') | |
775 .append('<li data-role="list-divider">Patient</li>') | |
776 .append(FormatPatient(patient, '#patient?uuid=' + patient.ID, true)) | |
777 .append('<li data-role="list-divider">Study</li>') | |
778 .append(FormatStudy(study, '#study?uuid=' + study.ID, true)) | |
779 .append('<li data-role="list-divider">Series</li>') | |
780 .append(FormatSeries(series)) | |
781 .listview('refresh'); | |
0 | 782 |
1345 | 783 SetupAnonymizedOrModifiedFrom('#series-anonymized-from', series, 'series', 'AnonymizedFrom'); |
784 SetupAnonymizedOrModifiedFrom('#series-modified-from', series, 'series', 'ModifiedFrom'); | |
443
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
785 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
786 target = $('#list-instances'); |
1345 | 787 $('li', target).remove(); |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
788 for (var i = 0; i < instances.length; i++) { |
1345 | 789 target.append(FormatInstance(instances[i], '#instance?uuid=' + instances[i].ID)); |
790 } | |
791 target.listview('refresh'); | |
1343
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
792 |
1345 | 793 currentPage = 'series'; |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
794 currentUuid = pageData.uuid; |
0 | 795 }); |
796 }); | |
797 }); | |
798 }); | |
799 } | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
800 } |
0 | 801 |
802 | |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
803 function EscapeHtml(value) |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
804 { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
805 var ENTITY_MAP = { |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
806 '&': '&', |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
807 '<': '<', |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
808 '>': '>', |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
809 '"': '"', |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
810 "'": ''', |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
811 '/': '/', |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
812 '`': '`', |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
813 '=': '=' |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
814 }; |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
815 |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
816 return String(value).replace(/[&<>"'`=\/]/g, function (s) { |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
817 return ENTITY_MAP[s]; |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
818 }); |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
819 } |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
820 |
0 | 821 |
822 function ConvertForTree(dicom) | |
823 { | |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
824 var result = []; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
825 var label, c; |
0 | 826 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
827 for (var i in dicom) { |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
828 if (dicom[i] != null) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
829 label = (i + '<span class="tag-name"> (<i>' + |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
830 EscapeHtml(dicom[i]["Name"]) + |
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
831 '</i>)</span>: '); |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
832 |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
833 if (dicom[i]["Type"] == 'String') |
0 | 834 { |
835 result.push({ | |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
836 label: label + '<strong>' + EscapeHtml(dicom[i]["Value"]) + '</strong>', |
0 | 837 children: [] |
838 }); | |
839 } | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
840 else if (dicom[i]["Type"] == 'TooLong') |
0 | 841 { |
842 result.push({ | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
843 label: label + '<i>Too long</i>', |
0 | 844 children: [] |
845 }); | |
846 } | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
847 else if (dicom[i]["Type"] == 'Null') |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
848 { |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
849 result.push({ |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
850 label: label + '<i>Null</i>', |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
851 children: [] |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
852 }); |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
853 } |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
854 else if (dicom[i]["Type"] == 'Sequence') |
0 | 855 { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
856 c = []; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
857 for (var j = 0; j < dicom[i]["Value"].length; j++) { |
0 | 858 c.push({ |
4525
8262ffb393ff
The numbering of sequences in Orthanc Explorer now uses the DICOM convention (starts at 1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4461
diff
changeset
|
859 label: 'Item ' + (j + 1), |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
860 children: ConvertForTree(dicom[i]["Value"][j]) |
0 | 861 }); |
862 } | |
863 | |
864 result.push({ | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
865 label: label + '[]', |
0 | 866 children: c |
867 }); | |
868 } | |
869 } | |
870 } | |
871 | |
872 return result; | |
873 } | |
874 | |
875 | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
876 function RefreshInstance() |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
877 { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
878 var pageData; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
879 |
0 | 880 if ($.mobile.pageData) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
881 pageData = DeepCopy($.mobile.pageData); |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
882 |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
883 GetResource('/instances/' + pageData.uuid, function(instance) { |
1345 | 884 GetResource('/series/' + instance.ParentSeries, function(series) { |
885 GetResource('/studies/' + series.ParentStudy, function(study) { | |
886 GetResource('/patients/' + study.ParentPatient, function(patient) { | |
152
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
887 |
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
888 $('#instance .patient-link').attr('href', '#patient?uuid=' + patient.ID); |
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
889 $('#instance .study-link').attr('href', '#study?uuid=' + study.ID); |
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
890 $('#instance .series-link').attr('href', '#series?uuid=' + series.ID); |
0 | 891 |
892 $('#instance-info li').remove(); | |
893 $('#instance-info') | |
894 .append('<li data-role="list-divider">Patient</li>') | |
895 .append(FormatPatient(patient, '#patient?uuid=' + patient.ID, true)) | |
896 .append('<li data-role="list-divider">Study</li>') | |
897 .append(FormatStudy(study, '#study?uuid=' + study.ID, true)) | |
898 .append('<li data-role="list-divider">Series</li>') | |
899 .append(FormatSeries(series, '#series?uuid=' + series.ID, true)) | |
900 .append('<li data-role="list-divider">Instance</li>') | |
901 .append(FormatInstance(instance)) | |
902 .listview('refresh'); | |
903 | |
1345 | 904 GetResource('/instances/' + instance.ID + '/tags', function(s) { |
905 $('#dicom-tree').tree('loadData', ConvertForTree(s)); | |
0 | 906 }); |
907 | |
4461
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
908 GetResource('/instances/' + instance.ID + '/header', function(s) { |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
909 $('#dicom-metaheader').tree('loadData', ConvertForTree(s)); |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
910 }); |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
911 |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
912 $('#transfer-syntax').hide(); |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
913 GetResource('/instances/' + instance.ID + '/metadata?expand', function(s) { |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
914 transferSyntax = s['TransferSyntax']; |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
915 if (transferSyntax !== undefined) { |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
916 $('#transfer-syntax').show(); |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
917 $('#transfer-syntax-text').text(transferSyntax); |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
918 } |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
919 }); |
22abc6851191
The DICOM meta-header and the transfer syntax are displayed at the "Instance" level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
920 |
515
a8be42bcf2bb
Link from modified to original resource in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
485
diff
changeset
|
921 SetupAnonymizedOrModifiedFrom('#instance-anonymized-from', instance, 'instance', 'AnonymizedFrom'); |
a8be42bcf2bb
Link from modified to original resource in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
485
diff
changeset
|
922 SetupAnonymizedOrModifiedFrom('#instance-modified-from', instance, 'instance', 'ModifiedFrom'); |
a8be42bcf2bb
Link from modified to original resource in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
485
diff
changeset
|
923 |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
924 currentPage = 'instance'; |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
925 currentUuid = pageData.uuid; |
0 | 926 }); |
927 }); | |
928 }); | |
929 }); | |
930 } | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
931 } |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
932 |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
933 $(document).live('pagebeforehide', function() { |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
934 currentPage = ''; |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
935 currentUuid = ''; |
0 | 936 }); |
937 | |
938 | |
939 | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
940 $('#patient').live('pagebeforeshow', RefreshPatient); |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
941 $('#study').live('pagebeforeshow', RefreshStudy); |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
942 $('#series').live('pagebeforeshow', RefreshSeries); |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
943 $('#instance').live('pagebeforeshow', RefreshInstance); |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
944 |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
945 $(function() { |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
946 $(window).hashchange(function(e, data) { |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
947 // This fixes the navigation with the back button and with the anonymization |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
948 if ('uuid' in $.mobile.pageData && |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
949 currentPage == $.mobile.pageData.active && |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
950 currentUuid != $.mobile.pageData.uuid) { |
1556
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
951 Refresh(); |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
952 } |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
953 }); |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
954 }); |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
955 |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
956 |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
957 |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
958 |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
959 |
0 | 960 function DeleteResource(path) |
961 { | |
962 $.ajax({ | |
963 url: path, | |
964 type: 'DELETE', | |
965 dataType: 'json', | |
966 async: false, | |
967 success: function(s) { | |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
968 var ancestor = s.RemainingAncestor; |
0 | 969 if (ancestor == null) |
2929
e0c620f964e5
Go back to lookup if deleting a resource without an ancestor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2874
diff
changeset
|
970 $.mobile.changePage('#lookup'); |
0 | 971 else |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
165
diff
changeset
|
972 $.mobile.changePage('#' + ancestor.Type.toLowerCase() + '?uuid=' + ancestor.ID); |
0 | 973 } |
974 }); | |
975 } | |
976 | |
977 | |
978 | |
979 function OpenDeleteResourceDialog(path, title) | |
980 { | |
981 $(document).simpledialog2({ | |
982 // http://dev.jtsage.com/jQM-SimpleDialog/demos2/ | |
983 // http://dev.jtsage.com/jQM-SimpleDialog/demos2/options.html | |
984 mode: 'button', | |
985 animate: false, | |
986 headerText: title, | |
987 headerClose: true, | |
988 width: '500px', | |
989 buttons : { | |
990 'OK': { | |
991 click: function () { | |
992 DeleteResource(path); | |
993 }, | |
994 icon: "delete", | |
995 theme: "c" | |
996 }, | |
997 'Cancel': { | |
998 click: function () { | |
999 } | |
1000 } | |
1001 } | |
1002 }); | |
1003 } | |
1004 | |
1005 | |
1006 | |
1007 $('#instance-delete').live('click', function() { | |
83 | 1008 OpenDeleteResourceDialog('../instances/' + $.mobile.pageData.uuid, |
0 | 1009 'Delete this instance?'); |
1010 }); | |
1011 | |
1012 $('#study-delete').live('click', function() { | |
83 | 1013 OpenDeleteResourceDialog('../studies/' + $.mobile.pageData.uuid, |
0 | 1014 'Delete this study?'); |
1015 }); | |
1016 | |
1017 $('#series-delete').live('click', function() { | |
83 | 1018 OpenDeleteResourceDialog('../series/' + $.mobile.pageData.uuid, |
0 | 1019 'Delete this series?'); |
1020 }); | |
1021 | |
1022 $('#patient-delete').live('click', function() { | |
83 | 1023 OpenDeleteResourceDialog('../patients/' + $.mobile.pageData.uuid, |
0 | 1024 'Delete this patient?'); |
1025 }); | |
1026 | |
1027 | |
1028 $('#instance-download-dicom').live('click', function(e) { | |
1029 // http://stackoverflow.com/a/1296101 | |
1030 e.preventDefault(); //stop the browser from following | |
83 | 1031 window.location.href = '../instances/' + $.mobile.pageData.uuid + '/file'; |
0 | 1032 }); |
1033 | |
1034 $('#instance-download-json').live('click', function(e) { | |
1035 // http://stackoverflow.com/a/1296101 | |
1036 e.preventDefault(); //stop the browser from following | |
83 | 1037 window.location.href = '../instances/' + $.mobile.pageData.uuid + '/tags'; |
0 | 1038 }); |
1039 | |
1040 | |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
1041 |
0 | 1042 $('#instance-preview').live('click', function(e) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1043 var pageData, pdf, images; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1044 |
54
42a449dac415
multi-frame images in the explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
45
diff
changeset
|
1045 if ($.mobile.pageData) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1046 pageData = DeepCopy($.mobile.pageData); |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
1047 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1048 pdf = '../instances/' + pageData.uuid + '/pdf'; |
1556
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1049 $.ajax({ |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1050 url: pdf, |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1051 cache: false, |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1052 success: function(s) { |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1053 window.location.assign(pdf); |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1054 }, |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1055 error: function() { |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
1056 GetResource('/instances/' + pageData.uuid + '/frames', function(frames) { |
1556
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1057 if (frames.length == 1) |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1058 { |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1059 // Viewing a single-frame image |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
1060 jQuery.slimbox('../instances/' + pageData.uuid + '/preview', '', { |
1556
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1061 overlayFadeDuration : 1, |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1062 resizeDuration : 1, |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1063 imageFadeDuration : 1 |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1064 }); |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1065 } |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1066 else |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1067 { |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1068 // Viewing a multi-frame image |
54
42a449dac415
multi-frame images in the explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
45
diff
changeset
|
1069 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1070 images = []; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1071 for (var i = 0; i < frames.length; i++) { |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
1072 images.push([ '../instances/' + pageData.uuid + '/frames/' + i + '/preview' ]); |
1556
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1073 } |
54
42a449dac415
multi-frame images in the explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
45
diff
changeset
|
1074 |
1556
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1075 jQuery.slimbox(images, 0, { |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1076 overlayFadeDuration : 1, |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1077 resizeDuration : 1, |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1078 imageFadeDuration : 1, |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1079 loop : true |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1080 }); |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
1081 } |
54
42a449dac415
multi-frame images in the explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
45
diff
changeset
|
1082 }); |
42a449dac415
multi-frame images in the explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
45
diff
changeset
|
1083 } |
42a449dac415
multi-frame images in the explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
45
diff
changeset
|
1084 }); |
42a449dac415
multi-frame images in the explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
45
diff
changeset
|
1085 } |
0 | 1086 }); |
1087 | |
1343
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
1088 |
1345 | 1089 |
0 | 1090 $('#series-preview').live('click', function(e) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1091 var pageData, images; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1092 |
0 | 1093 if ($.mobile.pageData) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1094 pageData = DeepCopy($.mobile.pageData); |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
1095 |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
1096 GetResource('/series/' + pageData.uuid, function(series) { |
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
1097 GetResource('/series/' + pageData.uuid + '/instances', function(instances) { |
1345 | 1098 Sort(instances, function(x) { return x.IndexInSeries; }, true, false); |
0 | 1099 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1100 images = []; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1101 for (var i = 0; i < instances.length; i++) { |
1345 | 1102 images.push([ '../instances/' + instances[i].ID + '/preview', |
2292
ccd44d546b47
Fix XSS inside DICOM in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2119
diff
changeset
|
1103 (i + 1).toString() + '/' + instances.length.toString() ]) |
1345 | 1104 } |
1343
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
1105 |
1345 | 1106 jQuery.slimbox(images, 0, { |
1107 overlayFadeDuration : 1, | |
1108 resizeDuration : 1, | |
1109 imageFadeDuration : 1, | |
1110 loop : true | |
1111 }); | |
1343
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
1112 }); |
0 | 1113 }); |
1114 } | |
1115 }); | |
1116 | |
1117 | |
1118 | |
1119 | |
1120 | |
1121 function ChooseDicomModality(callback) | |
1122 { | |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1123 var clickedModality = ''; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1124 var clickedPeer = ''; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1125 var items = $('<ul>') |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1126 .attr('data-divider-theme', 'd') |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1127 .attr('data-role', 'listview'); |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1128 |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1129 // Retrieve the list of the known DICOM modalities |
0 | 1130 $.ajax({ |
83 | 1131 url: '../modalities', |
0 | 1132 type: 'GET', |
1133 dataType: 'json', | |
1134 async: false, | |
344
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1135 cache: false, |
0 | 1136 success: function(modalities) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1137 var name, item; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1138 |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1139 if (modalities.length > 0) |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1140 { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1141 items.append('<li data-role="list-divider">DICOM modalities</li>'); |
484
b8ace6fc1d1f
preparation for handling Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
482
diff
changeset
|
1142 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1143 for (var i = 0; i < modalities.length; i++) { |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1144 name = modalities[i]; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1145 item = $('<li>') |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1146 .html('<a href="#" rel="close">' + name + '</a>') |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1147 .attr('name', name) |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1148 .click(function() { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1149 clickedModality = $(this).attr('name'); |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1150 }); |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1151 items.append(item); |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1152 } |
0 | 1153 } |
1154 | |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1155 // Retrieve the list of the known Orthanc peers |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1156 $.ajax({ |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1157 url: '../peers', |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1158 type: 'GET', |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1159 dataType: 'json', |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1160 async: false, |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1161 cache: false, |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1162 success: function(peers) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1163 var name, item; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1164 |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1165 if (peers.length > 0) |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1166 { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1167 items.append('<li data-role="list-divider">Orthanc peers</li>'); |
484
b8ace6fc1d1f
preparation for handling Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
482
diff
changeset
|
1168 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1169 for (var i = 0; i < peers.length; i++) { |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1170 name = peers[i]; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1171 item = $('<li>') |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1172 .html('<a href="#" rel="close">' + name + '</a>') |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1173 .attr('name', name) |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1174 .click(function() { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1175 clickedPeer = $(this).attr('name'); |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1176 }); |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1177 items.append(item); |
0 | 1178 } |
1179 } | |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1180 |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1181 // Launch the dialog |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1182 $('#dialog').simpledialog2({ |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1183 mode: 'blank', |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1184 animate: false, |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1185 headerText: 'Choose target', |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1186 headerClose: true, |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1187 forceInput: false, |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1188 width: '100%', |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1189 blankContent: items, |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1190 callbackClose: function() { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1191 var timer; |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1192 function WaitForDialogToClose() { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1193 if (!$('#dialog').is(':visible')) { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1194 clearInterval(timer); |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1195 callback(clickedModality, clickedPeer); |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1196 } |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1197 } |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1198 timer = setInterval(WaitForDialogToClose, 100); |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1199 } |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1200 }); |
0 | 1201 } |
1202 }); | |
1203 } | |
1204 }); | |
1205 } | |
1206 | |
1207 | |
405
97a00b30abcc
sending of studies and patients with orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
354
diff
changeset
|
1208 $('#instance-store,#series-store,#study-store,#patient-store').live('click', function(e) { |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1209 ChooseDicomModality(function(modality, peer) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1210 var pageData = DeepCopy($.mobile.pageData); |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1211 var url, loading; |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1212 |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1213 if (modality != '') |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1214 { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1215 url = '../modalities/' + modality + '/store'; |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1216 loading = '#dicom-store'; |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1217 } |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1218 |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1219 if (peer != '') |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1220 { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1221 url = '../peers/' + peer + '/store'; |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1222 loading = '#peer-store'; |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1223 } |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1224 |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1225 if (url != '') { |
0 | 1226 $.ajax({ |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1227 url: url, |
0 | 1228 type: 'POST', |
1229 dataType: 'text', | |
2119
e0517f25919e
Improved robustness of Orthanc Explorer wrt. query/retrieve (maybe fix issue 24)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1732
diff
changeset
|
1230 data: pageData.uuid, |
0 | 1231 async: true, // Necessary to block UI |
1232 beforeSend: function() { | |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1233 $.blockUI({ message: $(loading) }); |
0 | 1234 }, |
1235 complete: function(s) { | |
1236 $.unblockUI(); | |
1237 }, | |
1238 success: function(s) { | |
1239 }, | |
1240 error: function() { | |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1241 alert('Error during store'); |
0 | 1242 } |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
1243 }); |
0 | 1244 } |
1245 }); | |
1246 }); | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
1247 |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
1248 |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
1249 $('#show-tag-name').live('change', function(e) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1250 var checked = e.currentTarget.checked; |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
1251 if (checked) |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
1252 $('.tag-name').show(); |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
1253 else |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
1254 $('.tag-name').hide(); |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
1255 }); |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
1256 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
1257 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
1258 $('#patient-archive').live('click', function(e) { |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
1259 e.preventDefault(); //stop the browser from following |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
1260 window.location.href = '../patients/' + $.mobile.pageData.uuid + '/archive'; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
1261 }); |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
1262 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
1263 $('#study-archive').live('click', function(e) { |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
1264 e.preventDefault(); //stop the browser from following |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
1265 window.location.href = '../studies/' + $.mobile.pageData.uuid + '/archive'; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
1266 }); |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
1267 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
1268 $('#series-archive').live('click', function(e) { |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
1269 e.preventDefault(); //stop the browser from following |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
1270 window.location.href = '../series/' + $.mobile.pageData.uuid + '/archive'; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
1271 }); |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
1272 |
1188
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
1273 |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
1274 $('#patient-media').live('click', function(e) { |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
1275 e.preventDefault(); //stop the browser from following |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
1276 window.location.href = '../patients/' + $.mobile.pageData.uuid + '/media'; |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
1277 }); |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
1278 |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
1279 $('#study-media').live('click', function(e) { |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
1280 e.preventDefault(); //stop the browser from following |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
1281 window.location.href = '../studies/' + $.mobile.pageData.uuid + '/media'; |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
1282 }); |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
1283 |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
1284 $('#series-media').live('click', function(e) { |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
1285 e.preventDefault(); //stop the browser from following |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
1286 window.location.href = '../series/' + $.mobile.pageData.uuid + '/media'; |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
1287 }); |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
1288 |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
1289 |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
1290 |
274
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
1291 $('#protection').live('change', function(e) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1292 var isProtected = e.target.value == "on"; |
274
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
1293 $.ajax({ |
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
1294 url: '../patients/' + $.mobile.pageData.uuid + '/protected', |
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
1295 type: 'PUT', |
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
1296 dataType: 'text', |
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
1297 data: isProtected ? '1' : '0', |
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
1298 async: false |
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
1299 }); |
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
1300 }); |
344
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1301 |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1302 |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1303 |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1304 function OpenAnonymizeResourceDialog(path, title) |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1305 { |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1306 $(document).simpledialog2({ |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1307 mode: 'button', |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1308 animate: false, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1309 headerText: title, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1310 headerClose: true, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1311 width: '500px', |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1312 buttons : { |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1313 'OK': { |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1314 click: function () { |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1315 $.ajax({ |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1316 url: path + '/anonymize', |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1317 type: 'POST', |
354 | 1318 data: '{ "Keep" : [ "SeriesDescription", "StudyDescription" ] }', |
344
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1319 dataType: 'json', |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1320 async: false, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1321 cache: false, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1322 success: function(s) { |
351 | 1323 // The following line does not work... |
1324 //$.mobile.changePage('explorer.html#patient?uuid=' + s.PatientID); | |
1325 | |
1326 window.location.assign('explorer.html#patient?uuid=' + s.PatientID); | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
1327 //window.location.reload(); |
344
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1328 } |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1329 }); |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1330 }, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1331 icon: "delete", |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1332 theme: "c" |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1333 }, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1334 'Cancel': { |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1335 click: function () { |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1336 } |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1337 } |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1338 } |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1339 }); |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1340 } |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1341 |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1342 $('#instance-anonymize').live('click', function() { |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1343 OpenAnonymizeResourceDialog('../instances/' + $.mobile.pageData.uuid, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1344 'Anonymize this instance?'); |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1345 }); |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1346 |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1347 $('#study-anonymize').live('click', function() { |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1348 OpenAnonymizeResourceDialog('../studies/' + $.mobile.pageData.uuid, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1349 'Anonymize this study?'); |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1350 }); |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1351 |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1352 $('#series-anonymize').live('click', function() { |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1353 OpenAnonymizeResourceDialog('../series/' + $.mobile.pageData.uuid, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1354 'Anonymize this series?'); |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1355 }); |
351 | 1356 |
1357 $('#patient-anonymize').live('click', function() { | |
1358 OpenAnonymizeResourceDialog('../patients/' + $.mobile.pageData.uuid, | |
1359 'Anonymize this patient?'); | |
1360 }); | |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1361 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1362 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1363 $('#plugins').live('pagebeforeshow', function() { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1364 $.ajax({ |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1365 url: '../plugins', |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1366 dataType: 'json', |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1367 async: false, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1368 cache: false, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1369 success: function(plugins) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1370 var target = $('#all-plugins'); |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1371 $('li', target).remove(); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1372 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1373 plugins.map(function(id) { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1374 return $.ajax({ |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1375 url: '../plugins/' + id, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1376 dataType: 'json', |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1377 async: false, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1378 cache: false, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1379 success: function(plugin) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1380 var li = $('<li>'); |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1381 var item = li; |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1382 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1383 if ('RootUri' in plugin) |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1384 { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1385 item = $('<a>'); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1386 li.append(item); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1387 item.click(function() { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1388 window.open(plugin.RootUri); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1389 }); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1390 } |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1391 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1392 item.append($('<h1>').text(plugin.ID)); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1393 item.append($('<p>').text(plugin.Description)); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1394 item.append($('<span>').addClass('ui-li-count').text(plugin.Version)); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1395 target.append(li); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1396 } |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1397 }); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1398 }); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1399 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1400 target.listview('refresh'); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1401 } |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1402 }); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1403 }); |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1404 |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1405 |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1406 |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1407 function ParseJobTime(s) |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1408 { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1409 var t = (s.substr(0, 4) + '-' + |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1410 s.substr(4, 2) + '-' + |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1411 s.substr(6, 5) + ':' + |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1412 s.substr(11, 2) + ':' + |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1413 s.substr(13)); |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1414 var utc = new Date(t); |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1415 |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1416 // Convert from UTC to local time |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1417 return new Date(utc.getTime() - utc.getTimezoneOffset() * 60000); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1418 } |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1419 |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1420 |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1421 function AddJobField(target, description, field) |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1422 { |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1423 if (!(typeof field === 'undefined')) { |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1424 target.append($('<p>') |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1425 .text(description) |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1426 .append($('<strong>').text(field))); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1427 } |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1428 } |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1429 |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1430 |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1431 function AddJobDateField(target, description, field) |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1432 { |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1433 if (!(typeof field === 'undefined')) { |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1434 target.append($('<p>') |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1435 .text(description) |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1436 .append($('<strong>').text(ParseJobTime(field)))); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1437 } |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1438 } |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1439 |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1440 |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1441 $('#jobs').live('pagebeforeshow', function() { |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1442 $.ajax({ |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1443 url: '../jobs?expand', |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1444 dataType: 'json', |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1445 async: false, |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1446 cache: false, |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1447 success: function(jobs) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1448 var target = $('#all-jobs'); |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1449 var running, pending, inactive; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1450 |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1451 $('li', target).remove(); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1452 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1453 running = $('<li>') |
2583
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1454 .attr('data-role', 'list-divider') |
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1455 .text('Currently running'); |
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1456 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1457 pending = $('<li>') |
2583
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1458 .attr('data-role', 'list-divider') |
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1459 .text('Pending jobs'); |
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1460 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1461 inactive = $('<li>') |
2583
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1462 .attr('data-role', 'list-divider') |
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1463 .text('Inactive jobs'); |
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1464 |
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1465 target.append(running); |
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1466 target.append(pending); |
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1467 target.append(inactive); |
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1468 |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1469 jobs.map(function(job) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1470 var li = $('<li>'); |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1471 var item = $('<a>'); |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1472 |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1473 li.append(item); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1474 item.attr('href', '#job?uuid=' + job.ID); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1475 item.append($('<h1>').text(job.Type)); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1476 item.append($('<span>').addClass('ui-li-count').text(job.State)); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1477 AddJobField(item, 'ID: ', job.ID); |
2647
73d7d95dd75e
removal of internal job information
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2597
diff
changeset
|
1478 AddJobField(item, 'Local AET: ', job.Content.LocalAet); |
73d7d95dd75e
removal of internal job information
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2597
diff
changeset
|
1479 AddJobField(item, 'Remote AET: ', job.Content.RemoteAet); |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1480 AddJobDateField(item, 'Creation time: ', job.CreationTime); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1481 AddJobDateField(item, 'Completion time: ', job.CompletionTime); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1482 AddJobDateField(item, 'ETA: ', job.EstimatedTimeOfArrival); |
2583
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1483 |
2589
a3fdfb6979ed
getting rid of ReusableDicomConnection in REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2583
diff
changeset
|
1484 if (job.State == 'Running' || |
a3fdfb6979ed
getting rid of ReusableDicomConnection in REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2583
diff
changeset
|
1485 job.State == 'Pending' || |
a3fdfb6979ed
getting rid of ReusableDicomConnection in REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2583
diff
changeset
|
1486 job.State == 'Paused') { |
a3fdfb6979ed
getting rid of ReusableDicomConnection in REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2583
diff
changeset
|
1487 AddJobField(item, 'Priority: ', job.Priority); |
a3fdfb6979ed
getting rid of ReusableDicomConnection in REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2583
diff
changeset
|
1488 AddJobField(item, 'Progress: ', job.Progress); |
a3fdfb6979ed
getting rid of ReusableDicomConnection in REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2583
diff
changeset
|
1489 } |
a3fdfb6979ed
getting rid of ReusableDicomConnection in REST API
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2583
diff
changeset
|
1490 |
2583
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1491 if (job.State == 'Running') { |
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1492 li.insertAfter(running); |
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1493 } else if (job.State == 'Pending' || |
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1494 job.State == 'Paused') { |
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1495 li.insertAfter(pending); |
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1496 } else { |
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1497 li.insertAfter(inactive); |
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1498 } |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1499 }); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1500 |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1501 target.listview('refresh'); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1502 } |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1503 }); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1504 }); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1505 |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1506 |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1507 $('#job').live('pagebeforeshow', function() { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1508 var pageData, target; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1509 |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1510 if ($.mobile.pageData) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1511 pageData = DeepCopy($.mobile.pageData); |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1512 |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1513 $.ajax({ |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1514 url: '../jobs/' + pageData.uuid, |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1515 dataType: 'json', |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1516 async: false, |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1517 cache: false, |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1518 success: function(job) { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1519 var block, value; |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1520 |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1521 target = $('#job-info'); |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1522 $('li', target).remove(); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1523 |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1524 target.append($('<li>') |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1525 .attr('data-role', 'list-divider') |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1526 .text('General information about the job')); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1527 |
3065
b89a4288d605
Fixed Orthanc Explorer on IE and Firefox: Explorer always show 'to many results'
am@osimis.io
parents:
3023
diff
changeset
|
1528 { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1529 block = $('<li>'); |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1530 for (var i in job) { |
3065
b89a4288d605
Fixed Orthanc Explorer on IE and Firefox: Explorer always show 'to many results'
am@osimis.io
parents:
3023
diff
changeset
|
1531 if (i == 'CreationTime' || |
b89a4288d605
Fixed Orthanc Explorer on IE and Firefox: Explorer always show 'to many results'
am@osimis.io
parents:
3023
diff
changeset
|
1532 i == 'CompletionTime' || |
b89a4288d605
Fixed Orthanc Explorer on IE and Firefox: Explorer always show 'to many results'
am@osimis.io
parents:
3023
diff
changeset
|
1533 i == 'EstimatedTimeOfArrival') { |
b89a4288d605
Fixed Orthanc Explorer on IE and Firefox: Explorer always show 'to many results'
am@osimis.io
parents:
3023
diff
changeset
|
1534 AddJobDateField(block, i + ': ', job[i]); |
b89a4288d605
Fixed Orthanc Explorer on IE and Firefox: Explorer always show 'to many results'
am@osimis.io
parents:
3023
diff
changeset
|
1535 } else if (i != 'InternalContent' && |
b89a4288d605
Fixed Orthanc Explorer on IE and Firefox: Explorer always show 'to many results'
am@osimis.io
parents:
3023
diff
changeset
|
1536 i != 'Content' && |
b89a4288d605
Fixed Orthanc Explorer on IE and Firefox: Explorer always show 'to many results'
am@osimis.io
parents:
3023
diff
changeset
|
1537 i != 'Timestamp') { |
b89a4288d605
Fixed Orthanc Explorer on IE and Firefox: Explorer always show 'to many results'
am@osimis.io
parents:
3023
diff
changeset
|
1538 AddJobField(block, i + ': ', job[i]); |
b89a4288d605
Fixed Orthanc Explorer on IE and Firefox: Explorer always show 'to many results'
am@osimis.io
parents:
3023
diff
changeset
|
1539 } |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1540 } |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1541 } |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1542 |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1543 target.append(block); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1544 |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1545 target.append($('<li>') |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1546 .attr('data-role', 'list-divider') |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1547 .text('Detailed information')); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1548 |
3065
b89a4288d605
Fixed Orthanc Explorer on IE and Firefox: Explorer always show 'to many results'
am@osimis.io
parents:
3023
diff
changeset
|
1549 { |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1550 block = $('<li>'); |
2583
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1551 |
3103
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1552 for (var item in job.Content) { |
81b58b549845
back to using 'var' instead of 'let' since let is not supported by many old browsers. All variables declaration have been moved to the top of the function to better show that their scope is the function
Alain Mazy <alain@mazy.be>
parents:
3065
diff
changeset
|
1553 var value = job.Content[item]; |
3065
b89a4288d605
Fixed Orthanc Explorer on IE and Firefox: Explorer always show 'to many results'
am@osimis.io
parents:
3023
diff
changeset
|
1554 if (typeof value !== 'string') { |
b89a4288d605
Fixed Orthanc Explorer on IE and Firefox: Explorer always show 'to many results'
am@osimis.io
parents:
3023
diff
changeset
|
1555 value = JSON.stringify(value); |
b89a4288d605
Fixed Orthanc Explorer on IE and Firefox: Explorer always show 'to many results'
am@osimis.io
parents:
3023
diff
changeset
|
1556 } |
b89a4288d605
Fixed Orthanc Explorer on IE and Firefox: Explorer always show 'to many results'
am@osimis.io
parents:
3023
diff
changeset
|
1557 |
b89a4288d605
Fixed Orthanc Explorer on IE and Firefox: Explorer always show 'to many results'
am@osimis.io
parents:
3023
diff
changeset
|
1558 AddJobField(block, item + ': ', value); |
2583
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1559 } |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1560 } |
3065
b89a4288d605
Fixed Orthanc Explorer on IE and Firefox: Explorer always show 'to many results'
am@osimis.io
parents:
3023
diff
changeset
|
1561 |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1562 target.append(block); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1563 |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1564 target.listview('refresh'); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1565 |
2582
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1566 $('#job-cancel').closest('.ui-btn').hide(); |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1567 $('#job-resubmit').closest('.ui-btn').hide(); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1568 $('#job-pause').closest('.ui-btn').hide(); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1569 $('#job-resume').closest('.ui-btn').hide(); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1570 |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1571 if (job.State == 'Running' || |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1572 job.State == 'Pending' || |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1573 job.State == 'Retry') { |
2582
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1574 $('#job-cancel').closest('.ui-btn').show(); |
2573
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1575 $('#job-pause').closest('.ui-btn').show(); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1576 } |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1577 else if (job.State == 'Success') { |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1578 } |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1579 else if (job.State == 'Failure') { |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1580 $('#job-resubmit').closest('.ui-btn').show(); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1581 } |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1582 else if (job.State == 'Paused') { |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1583 $('#job-resume').closest('.ui-btn').show(); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1584 } |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1585 } |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1586 }); |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1587 } |
3372c5255333
StoreScuJob, Orthanc Explorer for jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2336
diff
changeset
|
1588 }); |
2582
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1589 |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1590 |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1591 |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1592 function TriggerJobAction(action) |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1593 { |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1594 $.ajax({ |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1595 url: '../jobs/' + $.mobile.pageData.uuid + '/' + action, |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1596 type: 'POST', |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1597 async: false, |
2583
1b6a6d80b6f2
OrthancPeerStoreJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2582
diff
changeset
|
1598 cache: false, |
2582
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1599 complete: function(s) { |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1600 window.location.reload(); |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1601 } |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1602 }); |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1603 } |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1604 |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1605 $('#job-cancel').live('click', function() { |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1606 TriggerJobAction('cancel'); |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1607 }); |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1608 |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1609 $('#job-resubmit').live('click', function() { |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1610 TriggerJobAction('resubmit'); |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1611 }); |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1612 |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1613 $('#job-pause').live('click', function() { |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1614 TriggerJobAction('pause'); |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1615 }); |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1616 |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1617 $('#job-resume').live('click', function() { |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1618 TriggerJobAction('resume'); |
b3da733d984c
job actions in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2573
diff
changeset
|
1619 }); |