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