4 * Dicom viewer wrapper script for documents
7 * @link https://www.open-emr.org
8 * @author Victor Kofia <https://kofiav.com> 'Viewer'
9 * @author Jerry Padgett <sjpadgett@gmail.com> 'Viewer wrapper'
10 * @copyright Copyright (c) 2017-2018 Victor Kofia <https://kofiav.com>
11 * @copyright Copyright (c) 2018-2020 Jerry Padgett <sjpadgett@gmail.com>
12 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 /* Warning: This script wraps the Dicom viewer which is HTML5 compatible only and bootstrap styling
16 * should not be used inside this script due to style conflicts with viewer, namely, hidden class.
19 require_once('../interface/globals.php');
21 use OpenEMR\Core\Header
;
22 use OpenEMR\Common\Csrf\CsrfUtils
;
24 $web_path = $_REQUEST['web_path'] ??
null;
26 $patid = $_REQUEST['patient_id'] ??
null;
27 $docid = isset($_REQUEST['document_id']) ?
$_REQUEST['document_id'] : ($_REQUEST['doc_id'] ??
null);
28 $d = new Document(attr($docid));
30 if ($d->get_mimetype() == 'application/dicom+zip') {
33 $csrf = attr(CsrfUtils
::collectCsrfToken());
34 $state_url = $GLOBALS['web_root'] . "/library/ajax/upload.php";
35 $web_path = attr($web_path) . '&retrieve&patient_id=' . attr_url($patid) . '&document_id=' . attr_url($docid) . '&as_file=false&type=' . attr_url($type);
41 <title
><?php
echo xlt("Dicom Viewer"); ?
></title
>
43 <?php Header
::setupHeader(['dwv', 'i18next', 'i18next-xhr-backend', 'i18next-browser-languagedetector', 'jszip', 'magic-wand', 'konva']); ?
>
44 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/flot/dist/es5/jquery.flot.js"></script
>
46 <script src
="<?php echo $GLOBALS['web_root'] ?>/library/js/dwv/gui/browser.js"></script
>
47 <script src
="<?php echo $GLOBALS['web_root'] ?>/library/js/dwv/gui/colourMap.js"></script
>
48 <script src
="<?php echo $GLOBALS['web_root'] ?>/library/js/dwv/gui/custom.js"></script
>
49 <script src
="<?php echo $GLOBALS['web_root'] ?>/library/js/dwv/gui/dropboxLoader.js"></script
>
50 <script src
="<?php echo $GLOBALS['web_root'] ?>/library/js/dwv/gui/filter.js"></script
>
51 <script src
="<?php echo $GLOBALS['web_root'] ?>/library/js/dwv/gui/generic.js"></script
>
52 <script src
="<?php echo $GLOBALS['web_root'] ?>/library/js/dwv/gui/undo.js"></script
>
53 <script src
="<?php echo $GLOBALS['web_root'] ?>/library/js/dwv/gui/help.js"></script
>
54 <script src
="<?php echo $GLOBALS['web_root'] ?>/library/js/dwv/gui/html.js"></script
>
55 <script src
="<?php echo $GLOBALS['web_root'] ?>/library/js/dwv/gui/infoController.js"></script
>
56 <script src
="<?php echo $GLOBALS['web_root'] ?>/library/js/dwv/gui/infoOverlay.js"></script
>
57 <script src
="<?php echo $GLOBALS['web_root'] ?>/library/js/dwv/gui/loader.js"></script
>
58 <script src
="<?php echo $GLOBALS['web_root'] ?>/library/js/dwv/gui/tools.js"></script
>
59 <script src
="<?php echo $GLOBALS['web_root'] ?>/library/js/dwv/gui/plot.js"></script
>
60 <!-- i18n dwv wrapper
-->
61 <script src
="<?php echo $GLOBALS['web_root'] ?>/library/js/dwv/dwv_i18n.js"></script
>
62 <!-- Launch the app
-->
63 <script src
="<?php echo $GLOBALS['web_root'] ?>/library/js/dwv/dicom_gui.js"></script
>
64 <script src
="<?php echo $GLOBALS['web_root'] ?>/library/js/dwv/dicom_launcher.js"></script
>
66 <style type
="text/css">
68 background
-color
: #555;
72 button
, input
, li
, table
{
82 flex
-direction
: column
;
88 justify
-content
: space
-between
;
92 #pageHeader h1, h2, h3, h5, h6 {
101 #pageHeader .toolbar {
107 justify
-content
: center
;
124 pointer
-events
: none
;
133 border
: 5px dashed
#ccc;
136 .dropBoxBorder
.hover
{
138 border
: 5px dashed
#cc0;
147 list-style
-type
: none
;
154 list-style
-type
: none
;
168 text
-shadow
: 1px
1px
#000;
174 text
-shadow
: 1px
1px
#000;
183 text
-shadow
: 0 1px
0 #000;
192 text
-shadow
: 0 1px
0 #000;
200 text
-shadow
: 0 1px
0 #000;
208 text
-shadow
: 0 1px
0 #000;
216 text
-shadow
: 0 1px
0 #000;
224 text
-shadow
: 0 1px
0 #000;
233 text
-shadow
: 0 1px
0 #000;
241 text
-shadow
: 0 1px
0 #000;
254 border
-collapse
: collapse
;
255 background
-color
: #fff;
259 table
.tagsTable thead
{
260 background
-color
: #000;
264 table
.tagsTable thead th
{
265 text
-transform
: uppercase
;
270 table
.tagsTable tr
:nth
-child(even
) {
271 background
-color
: #c2c2c2;
275 border
-collapse
: collapse
;
278 table
.drawsTable td
{
279 vertical
-align
: middle
;
282 table
.drawsTable thead th
{
283 text
-transform
: uppercase
;
293 background
-color
: #fff;
295 padding
: 1rem
1.25rem
;
303 .drawList tr
:nth
-child(even
) {
304 background
-color
: #333;
318 padding
: 1rem
1.25rem
;
326 transform
: scale(1.05);
327 transition
: visibility
0s linear
0.25s
, opacity
0.25s
0s
, transform
0.25s
;
342 #loaderlist div.popup-content {
346 transform
: translate(-50%
, -50%
);
347 background
-color
: white
;
348 padding
: 1rem
1.25rem
;
350 border
-radius
: 0.5rem
;
351 padding
-left
: .325rem
;
354 .lg div
.popup
-content
{
356 border
: 2px solid
#fff;
358 border
-radius
: 0.5rem
;
361 background
-color
: white
;
364 #helpPopup div.popup-content {
365 background
-color
: black
;
380 .close
-button
:hover
{
381 background
-color
: lightcoral
;
387 transform
: scale(1.0);
388 transition
: visibility
0s linear
0s
, opacity
0.25s
0s
, transform
0.25s
;
395 background
-color
: #4CAF50;
404 margin
: .325rem
0 .325rem
;
409 <div id
="dwv" class="container-fluid" src
='<?php echo $web_path ?>'>
410 <?php
if ($web_path) { ?
>
411 <input type
="hidden" id
="state_url" value
='<?php echo $state_url ?>' />
412 <input type
="hidden" id
="csrf" value
='<?php echo $csrf ?>' />
413 <input type
="hidden" id
="doc_id" value
='<?php echo attr($docid) ?>'' />
415 <div id="pageHeader">
417 <h2>DICOM Viewer<span> <em>( Not for Diagnostics )</em></h2>
419 <span class="editspan"></span>
420 <div class="toolbar"></div>
421 </div><!-- /pageHeader -->
423 <!-- get state json data if file -->
424 <div class="openData" title="File">
425 <!-- Open image files -->
426 <div class="popup" id="loaderlist">
427 <div class="popup-content">
428 <span class="close-button" onclick="toggle('loaderlist
');">×</span>
430 <div class="openData" title="File">
431 <div class="loaderlist"></div>
432 <div id="progressbar"></div>
438 <div class="toolList" title="Toolbox"></div>
440 <div class="history" title="History"></div>
442 <div class="popup lg" id="tagsPopup">
443 <div class="popup-content">
444 <span class="close-button" onclick="toggle('tagsPopup
');">×</span>
445 <div class="tags" title="Tags">Please load a DICOM study to view image tags.</div>
449 <div class="popup lg" id="helpPopup">
450 <div class="popup-content">
451 <span class="close-button" onclick="toggle('helpPopup
');">×</span>
452 <div class="help" title="Help"></div>
455 <!-- Layer Container -->
456 <div class="layerDialog" title="Image">
457 <div class="layerContainer">
458 <div class="dropBox dropBoxBorder"></div>
459 <canvas class="imageLayer">Only for HTML5 compatible browsers...</canvas>
460 <div class="drawDiv"></div>
461 <div class="infoLayer">
462 <div class="infotl"></div>
463 <div class="infotc"></div>
464 <div class="infotr"></div>
465 <div class="infocl"></div>
466 <div class="infocr"></div>
467 <div class="infobl"></div>
468 <div class="infobc"></div>
469 <div class="infobr" style="bottom: 64px;"></div>
470 <div class="plot"></div>
471 </div><!-- /infoLayer -->
472 </div><!-- /layerContainer -->
473 </div><!-- /layerDialog -->
475 <div class="drawList" title="Draw list"></div>
476 </div><!-- /pageMain -->