2 * general document list
5 * @link http://www.open-emr.org
6 * @author Brady Miller
<brady.g.miller@gmail.com
>
7 * @author Jerry Padgett
<sjpadgett@gmail.com
>
8 * @copyright Copyright (c)
2017-
2018 Brady Miller
<brady.g.miller@gmail.com
>
9 * @copyright Copyright (c)
2019-
2024 Jerry Padgett
<sjpadgett@gmail.com
>
10 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License
3
15 {headerTemplate assets='datetime-picker|select2'}
16 <link rel=
"stylesheet" href=
"{$GLOBALS.assets_static_relative}/dropzone/dist/dropzone.css">
19 height:
35px!important;
20 border-radius:
4px
0 0 4px!important;
23 margin:
10px auto
10px auto;
24 color: rgb(
255,
0,
0);
34 <script src=
"{$GLOBALS.webroot}/library/js/DocumentTreeMenu.js"></script>
35 <script src=
"{$GLOBALS.assets_static_relative}/dropzone/dist/dropzone.js"></script>
38 function callTemplateModule(patient_id
, cuser
, templateName
, id
, edit
) {
40 let callUrl
= '{$GLOBALS.webroot}/portal/patient/onsitedocuments?is_module=1' +
41 '&catid=' + {$category_id
|js_url
} +
42 '&pid=' + encodeURIComponent(patient_id
) +
43 '&cuser=' + encodeURIComponent(cuser
) +
44 '&recid=' + encodeURIComponent(id
) +
45 '&edit=' + encodeURIComponent(edit
) +
46 '&new=' + encodeURIComponent(templateName
)
47 location
.assign(callUrl
);
50 <title>{xlt t='Documents'}
</title>
52 <!-- ViSolve - Call expandAll function on loading of the page if global value 'expand_document' is set -->
53 {if $GLOBALS.expand_document_tree}
54 <body onload=
"javascript:objTreeMenu_1.expandAll();return false;">
58 <div class=
"container-fluid mt-3">
60 <div class=
"col-sm-12">
62 <h2>{xlt t='Documents'}
<a href='interface/patient_file/summary/demographics.php' onclick='top.restoreSession()'
title=
"{xla t='Go Back'}" ><i id='advanced-tooltip' class='fa fa-solid fa-backward fa-sm' aria-hidden='true'
></i></a></h2>
67 <div class=
"col-sm-3">
68 <div id=
"documents_list">
70 <legend>{xlt t='Documents List'}
</legend>
72 <div class=
"form-inline float-right" id=
"patientSearch">
73 <select id=
"selectPatient" class=
"form-control" type=
"text" data-placeholder=
"{$place_hld|attr}">
76 <button id='pid'
type=
"button" class='float-right btn btn-primary pBtn'
>×</button>
78 <a id=
"list_collapse" href=
"#" onclick=
"javascript:objTreeMenu_1.collapseAll();return false;"> ({xlt t='Collapse all'})
</a>
84 <div class=
"col-sm-9">
85 <div id=
"documents_actions">
87 <legend>{xlt t='Document Uploader/Viewer'}
</legend>
88 <div style=
"padding: 0 10px">
90 <div class='text'
style=
"margin-bottom:-10px; margin-top:-8px; padding:10px;"><i>{$message|text}
</i></div><br />
92 {if !empty($messages)}
93 <div class='text'
style=
"margin-bottom:-10px; margin-top:-8px; padding:10px;"><i>{$messages|text}
</i></div><br />
95 {if !empty($activity)}{$activity}{/if}
101 </div><!--end of container div-->
103 var curpid
= {$cur_pid
|js_escape
};
104 var newVersion
= {$is_new
|js_escape
};
105 var demoPid
= {$demo_pid
|js_escape
};
106 var inUseMsg
= {$used_msg
|js_escape
};
108 if(curpid
== demoPid
&& !newVersion
){
109 $("#patientSearch").hide();
112 $("#pid").text(curpid
);
115 $("#selectPatient").select2({
117 url
: "{$GLOBALS.webroot}/library/ajax/document_helpers.php",
119 data: function(params
) {
122 csrf_token_form
: {$CSRF_TOKEN_FORM
|js_escape
},
126 processResults: function(data
) {
128 results
: $.map(data
, function(item
, index
) {
141 minimumInputLength
: 3
144 $('#selectPatient').on('select2:select', function (e
) {
146 if (e
.params
.data
.value
== '00' && ! e
.params
.data
.label
.match({xlj t
="Reset"})){
150 $(this).val(e
.params
.data
.label
);
151 location
.href
= "{$GLOBALS.webroot}/controller.php?document&list&patient_id=" + encodeURIComponent(e
.params
.data
.value
) + "&patient_name=" + encodeURIComponent(e
.params
.data
.label
);
152 $("#pid").text(e
.params
.data
.value
);
155 $(".pBtn").click(function(event
) {
156 var $input
= $("#selectPatient");
160 $("#list_collapse").detach().appendTo("#objTreeMenu_1_node_1 nobr");
162 // functions to view and pop out documents as needed.
164 $("img[id^='icon_objTreeMenu_']").tooltip({
165 items
: $("img[src*='file3.png']"),
166 content
: {xlj t
="Double Click on this icon to pop up document in a new viewer."}
169 $("img[id^='icon_objTreeMenu_']").on('dblclick', function (e
) {
170 let popsrc
= $(this).next("a").attr('href') || '';
171 let diview
= $(this).next("a").text();
173 if (!popsrc
.includes('&view&')) {
175 } else if (diview
.toLowerCase().includes('.dcm') || diview
.toLowerCase().includes('.zip')) {
176 popsrc
= "{$GLOBALS.webroot}/library/dicom_frame.php?web_path=" + popsrc
;
179 popsrc
= popsrc
.replace('&view&', '&retrieve&') + 'as_file=false';
180 let poContentModal = function () {
181 let wname
= '_' + Math
.random().toString(36).substr(2, 6);
182 let opt
= "menubar=no,location=no,resizable=yes,scrollbars=yes,status=no";
183 window
.open(popsrc
, wname
, opt
);
186 let btnText
= {xlj t
="Full Screen"};
187 let btnClose
= {xlj t
="Close"};
188 let size
= 'modal-xl';
189 dlgopen(popsrc
, 'popdoc', size
, 700, '', '', {
191 { text
: btnText
, close
: true, style
: 'primary btn-sm', click
: poContentModal
},
192 { text
: btnClose
, close
: true, style
: 'secondary btn-sm' }
204 {datetimepickerSupport
}