2 * general document view
5 * @link http://www.open-emr.org
6 * @author Brady Miller
<brady.g.miller@gmail.com
>
7 * @copyright Copyright (c)
2017 Brady Miller
<brady.g.miller@gmail.com
>
8 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License
3
11 <script language=
"JavaScript">
13 function popoutcontent(othis
) {literal
}{{/literal
}
14 let popsrc
= $(othis
).parents('body').find('#DocContents iframe').attr("src");
15 let wname
= '_' + Math
.random().toString(36).substr(2, 6);
16 let opt
= "menubar=no,location=no,resizable=yes,scrollbars=yes,status=no";
17 window
.open(popsrc
,wname
, opt
);
22 // Process click on Delete link.
23 function deleteme(docid
) {literal
}{{/literal
}
24 dlgopen('interface/patient_file/deleter.php?document=' + docid
, '_blank', 500, 450);
28 // Called by the deleter.php window on a successful delete.
29 function imdeleted() {literal
}{{/literal
}
31 window
.location
.href
='{$REFRESH_ACTION}';
34 // Called to show patient notes related to this document in the "other" frame.
35 function showpnotes(docid
) {literal
}{{/literal
}
38 let btnClose
= '{/literal}{xl t="Done"|escape:"html"}{literal}';
39 let url
= top
.webroot_url
+ '/interface/patient_file/summary/pnotes.php?docid=' + docid
;
40 dlgopen(url
, 'pno1', 'modal-xl', 500, '', '', {
42 {text
: btnClose
, close
: true, style
: 'default btn-xs'}
53 var othername
= (window
.name
== 'RTop') ? 'RBot' : 'RTop';
54 parent
.left_nav
.forceDual();
55 parent
.left_nav
.loadFrame('pno1', othername
, 'patient_file/summary/pnotes.php?docid=' + docid
);
59 function submitNonEmpty( e
) {literal
}{{/literal
}
60 if ( e
.elements
['passphrase'].value
.length
== 0 ) {literal
}{{/literal
}
61 alert( "{xl t='You must enter a pass phrase to encrypt the document'}" );
62 {literal
}}{/literal} else {literal}{{/literal}
67 // For tagging it encounter
68 function tagUpdate() {literal
}{{/literal
}
69 var f
= document
.forms
['document_tag'];
70 if (f
.encounter_check
.checked
) {literal
}{{/literal
}
71 if(f
.visit_category_id
.value
==0) {literal
}{{/literal
}
72 alert(" {xl t='Please select visit category'}" );
75 {literal
}}{/literal} else if (f.encounter_id.value == 0 ) {literal}{{/literal}
76 alert(" {xl t='Please select encounter'}");
79 //top.restoreSession();
80 document
.forms
['document_tag'].submit();
83 // For new or existing encounter
84 function set_checkbox() {literal
}{{/literal
}
85 var f
= document
.forms
['document_tag'];
86 if (f
.encounter_check
.checked
) {literal
}{{/literal
}
87 f
.encounter_id
.disabled
= true;
88 f
.visit_category_id
.disabled
= false;
89 $('.hide_clear').attr('href','javascript:void(0);');
90 {literal
}}{/literal} else {literal}{{/literal}
91 f
.encounter_id
.disabled
= false;
92 f
.visit_category_id
.disabled
= true;
93 f
.visit_category_id
.value
= 0;
94 $('.hide_clear').attr('href','{$clear_encounter_tag}');
98 // For tagging it with image procedure
99 function ImgProcedure() {literal
}{{/literal
}
100 var f
= document
.forms
['img_procedure_tag'];
101 if(f
.image_procedure_id
.value
== 0 ) {literal
}{{/literal
}
102 alert("{xl t='Please select image procedure'}");
105 f
.procedure_code
.value
= f
.image_procedure_id
.options
[f
.image_procedure_id
.selectedIndex
].getAttribute('data-code');
106 document
.forms
['img_procedure_tag'].submit();
108 // Process click on Import link.
109 function import_ccr(docid
) {literal
}{
110 top
.restoreSession();
112 url
: "library/ajax/ccr_import_ajax.php",
120 success: function(data
){
122 top
.restoreSession();
123 document
.location
.reload();
132 <table valign=
"top" width=
"100%">
135 <div style=
"margin-bottom: 6px;padding-bottom: 6px;border-bottom:3px solid gray;">
136 <h4>{$file-
>get_url_web()|escape:'html'}
137 <div class=
"btn-group btn-toggle">
138 <button class=
"btn btn-xs btn-default properties">{xl t='Properties'|escape:'html'}
</button>
139 <button class=
"btn btn-xs btn-primary active">{xl t='Contents'|escape:'html'}
</button>
141 <span style=
"float:right;">
142 <a class=
"css_button" href='' onclick='return popoutcontent(this)'
title=
"{xl t='Pop Out Full Screen.'|escape:'html'}">
143 <span class=
"glyphicon glyphicon-fullscreen"></span></a>
144 <a class=
"css_button" href=
"{$web_path}" title=
"{xl t='Original file'|escape:'html'}" onclick=
"top.restoreSession()"><span>{xl t='Download'|escape:'html'}
</span></a>
145 <a class=
"css_button" href='' onclick='return showpnotes({$file-
>get_id()})'
><span>{xl t='Show Notes'|escape:'html'}
</span></a>
147 {if $file-
>get_ccr_type($file-
>get_id()) eq
"CCR" and ($file-
>get_mimetype($file-
>get_id()) eq
"application/xml" or $file-
>get_mimetype($file-
>get_id()) eq
"text/xml") and
148 $file-
>get_imported($file-
>get_id()) eq
0 }
149 <a class=
"css_button" href='javascript:' onclick='return import_ccr({$file-
>get_id()})'
><span>{xl t='Import'|escape:'html'}
</span></a>
156 <tr id=
"DocProperties" style=
"display:none;">
158 {if !$hide_encryption}
160 <form method=
"post" name=
"document_encrypt" action=
"{$web_path}" onsubmit=
"return top.restoreSession()">
162 <div style=
"float:left">
163 <b>{xl t='Encryption'|escape:'html'}
</b>
165 <div style=
"float:none">
166 <a href=
"javascript:;" onclick=
"submitNonEmpty( document.forms['document_encrypt'] );">(
<span>{xl t='download encrypted file'|escape:'html'})
</span></a>
170 {xl t='Pass Phrase'|escape:'html'}:
171 <input title=
"{xl t='Supports TripleDES encryption/decryption only.'|escape:'html'} {xl t='Leaving the pass phrase blank will not encrypt the document'|escape:'html'}" type='text' size='
20' name='passphrase' id='passphrase' value=''
/>
172 <input type=
"hidden" name=
"encrypted" value=
"true"></input>
179 <form method=
"post" name=
"document_validate" action=
"{$VALIDATE_ACTION}" onsubmit=
"return top.restoreSession()">
181 <div style=
"float:left">
182 <b>{xl t='Sha-
1 Hash'|escape:'html'}:
</b>
183 <i>{$file-
>get_hash()|escape:'html'}
</i>
185 <div style=
"float:none">
186 <a href=
"javascript:;" onclick=
"document.forms['document_validate'].submit();">(
<span>{xl t='validate'|escape:'html'})
</span></a>
193 <form method=
"post" name=
"document_update" action=
"{$UPDATE_ACTION}" onsubmit=
"return top.restoreSession()">
195 <div style=
"float:left">
196 <b>{xl t='Update'|escape:'html'}
</b>
198 <div style=
"float:none">
199 <a href=
"javascript:;" onclick=
"document.forms['document_update'].submit();">(
<span>{xl t='submit'|escape:'html'})
</span></a>
203 {xl t='Rename'|escape:'html'}:
204 <input type='text' size='
20' name='docname' id='docname' value='{$file-
>get_url_web()|escape:'html'}'
/>
207 {xl t='Date'|escape:'html'}:
208 <input type='text' size='
10' class='datepicker' name='docdate' id='docdate'
209 value='{$DOCDATE|escape:'html'}' title='{xl t='yyyy-mm-dd document date'|escape:'html'}'
/>
210 <select name=
"issue_id">{$ISSUES_LIST}
</select>
218 <form method=
"post" name=
"document_move" action=
"{$MOVE_ACTION}" onsubmit=
"return top.restoreSession()">
220 <div style=
"float:left">
221 <b>{xl t='Move'|escape:'html'}
</b>
223 <div style=
"float:none">
224 <a href=
"javascript:;" onclick=
"document.forms['document_move'].submit();">(
<span>{xl t='submit'|escape:'html'})
</span></a>
229 <select name=
"new_category_id">{$tree_html_listbox}
</select>
230 {xl t='Move to Patient'|escape:'html'} #
<input type=
"text" name=
"new_patient_id" size=
"4" />
231 <a href=
"javascript:{literal}{}{/literal}"
232 onclick=
"top.restoreSession();var URL='controller.php?patient_finder&find&form_id={"document_move['new_patient_id']
"|escape:"url
"}&form_name={"document_move['new_patient_name']
"|escape:"url
"}'; window.open(URL, 'document_move', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=450,height=400,left=425,top=250');">
233 <img src=
"images/stock_search-16.png" border=
"0" /></a>
234 <input type=
"hidden" name=
"new_patient_name" value=
"" />
242 <form method=
"post" name=
"document_tag" id=
"document_tag" action=
"{$TAG_ACTION}" onsubmit=
"return top.restoreSession()">
245 <div style=
"float:left">
246 <b>{xl t='Tag to Encounter'|escape:'html'}
</b>
249 <div style=
"float:none">
250 <a href=
"javascript:;" onclick=
"tagUpdate();">(
<span>{xl t='submit'|escape:'html'})
</span></a>
255 <select id=
"encounter_id" name=
"encounter_id" >{$ENC_LIST}
</select>
256 <a href=
"{$clear_encounter_tag}" class=
"hide_clear">(
<span>{xl t='clear'|escape:'html'})
</span></a>
257 <input type=
"checkbox" name=
"encounter_check" id=
"encounter_check" onclick='set_checkbox(this)'
/> <label for=
"encounter_check"><b>{xl t='Create Encounter'|escape:'html'}
</b></label>
258 {xl t='Visit Category'|escape:'html'} :
<select id=
"visit_category_id" name=
"visit_category_id" disabled
>{$VISIT_CATEGORY_LIST}
</select>
265 <form method=
"post" name=
"img_procedure_tag" id=
"img_procedure_tag" action=
"{$IMG_PROCEDURE_TAG_ACTION}" onsubmit=
"return top.restoreSession()">
266 <input type='hidden' name='procedure_code' value=''
>
268 <div style=
"float:left">
269 <b>{xl t='Tag to Image Procedure'|escape:'html'}
</b>
271 <div style=
"float:none">
272 <a href=
"javascript:;" onclick=
"ImgProcedure();">(
<span>{xl t='submit'|escape:'html'})
</span></a>
276 <select id=
"image_procedure_id" name=
"image_procedure_id">{$IMAGE_PROCEDURE_LIST}
</select>
277 <a href=
"{$clear_procedure_tag}">(
<span>{xl t='clear'|escape:'html'})
</span></a>
284 <form name=
"notes" method=
"post" action=
"{$NOTE_ACTION}" onsubmit=
"return top.restoreSession()">
287 <div style=
"float:left">
288 <b>{xl t='Notes'|escape:'html'}
</b>
290 <div style=
"float:none">
291 <a href=
"javascript:;" onclick=
"document.notes.identifier.value='no';document.forms['notes'].submit();">(
<span>{xl t='add'|escape:'html'}
</span>)
</a>
292 <b>{xl t='Email'|escape:'html'}
</b>
293 <input type=
"text" size=
"25" name=
"provide_email" id=
"provide_email" />
294 <input type=
"hidden" name=
"identifier" id=
"identifier" />
295 <a href=
"javascript:;" onclick=
"javascript:document.notes.identifier.value='yes';document.forms['notes'].submit();">
296 (
<span>{xl t='Send'|escape:'html'}
</span>)
302 <div style=
"float:none">
306 <textarea cols=
"53" rows=
"8" wrap=
"virtual" name=
"note" style=
"width:100%"></textarea><br>
307 <input type=
"hidden" name=
"process" value=
"{$PROCESS|escape:'html'}" />
308 <input type=
"hidden" name=
"foreign_id" value=
"{$file->get_id()|escape:'html'}" />
311 <div style=
"margin-top:7px">
312 {foreach name=note_loop from=$notes item=note}
314 {xl t='Note'|escape:'html'} #{$note-
>get_id()|escape:'html'}
315 {xl t='Date:'|escape:'html'} {$note-
>get_date()|escape:'html'}
316 {$note-
>get_note()|escape:'html'}
317 {if $note-
>get_owner()}
318 -{user_info id=$note-
>get_owner()}
327 <h4>{xl t='Contents'|escape:'html'}
</h4>
330 <tr id=
"DocContents" style=
"height:100%">
332 {if $file-
>get_mimetype() eq
"image/tiff"}
333 <embed frameborder=
"0" style=
"height:84vh" type=
"{$file->get_mimetype()|escape:'html'}" src=
"{$web_path|escape:'html'}as_file=false"></embed>
334 {elseif $file-
>get_mimetype() eq
"image/png" or
335 $file-
>get_mimetype() eq
"image/jpg" or
336 $file-
>get_mimetype() eq
"image/jpeg" or
337 $file-
>get_mimetype() eq
"image/gif" or
338 $file-
>get_mimetype() eq
"application/pdf" }
339 <iframe frameborder=
"0" style=
"height:84vh" type=
"{$file->get_mimetype()|escape:'html'}" src=
"{$web_path|escape:'html'}as_file=false"></iframe>
340 {elseif $file-
>get_mimetype() eq
"application/dicom"}
341 <iframe frameborder=
"0" style=
"height:84vh" type=
"{$file->get_mimetype()|escape:'html'}" src=
"{$GLOBALS.webroot}/library/dicom_frame.php?web_path={$web_path|escape:'html'}as_file=false"></iframe>
342 {elseif $file-
>get_ccr_type($file-
>get_id()) ne
"CCR" and $file-
>get_ccr_type($file-
>get_id()) ne
"CCD"}
343 <iframe frameborder=
"0" style=
"height:84vh" type=
"{$file->get_mimetype()|escape:'html'}" src=
"{$web_path|escape:'html'}as_file=true"></iframe>
348 <script language='JavaScript'
>
350 $('.btn-toggle').click(function() {
351 $(this).find('.btn').toggleClass('active');
353 if ($(this).find('.btn-primary').length
>0) {
354 $(this).find('.btn').toggleClass('btn-primary');
357 $(this).find('.btn').toggleClass('btn-default');
358 var show_prop
= ($(this).find('.properties.active').length
> 0 ? 'block':'none');
359 $("#DocProperties").css('display', show_prop
);