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
13 {headerTemplate assets='no_bootstrap|no_fontawesome|no_textformat|no_dialog'}
16 <style type=
"text/css" title=
"mystyles" media=
"all">
22 <script language=
"javascript">
24 function changeLinkHref(id
,addValue
,value
) {
25 var myRegExp
= new RegExp(":" + value
+ ":");
26 if (addValue
){ //add value to href
27 if(document
.getElementById(id
) !== null)document
.getElementById(id
).href
+= ':' + value
+ ':';
29 else { //remove value from href
30 if(document
.getElementById(id
) !== null)document
.getElementById(id
).href
= document
.getElementById(id
).href
.replace(myRegExp
,'');
34 function changeLinkHrefAll(addValue
, value
) {
35 changeLinkHref('multiprint', addValue
, value
);
36 changeLinkHref('multiprintcss', addValue
, value
);
37 changeLinkHref('multiprintToFax', addValue
, value
);
40 //uses jquery to update database table
41 function markTx(oThis
,id
){{/literal
}
42 var isChecked
= oThis
.checked
? 1 : 0; // @TODO this is better served if checkboxs are all checked on submit with one call to markTx
43 $.get('./interface/weno/markTx.php?rx=' + encodeURIComponent(id
) + '&state=' + encodeURIComponent(isChecked
) + '&csrf_token_form=' + {$CSRF_TOKEN_FORM
|js_url
});
47 function changeLinkHref_All(id
,addValue
,value
) {
48 var myRegExp
= new RegExp(":" + value
+ ":");
49 if (addValue
){ //add value to href
50 if(document
.getElementById(id
) !== null)document
.getElementById(id
).href
+= ':' + value
+ ':';
52 else { //remove value from href
53 if(document
.getElementById(id
) !== null)document
.getElementById(id
).href
= document
.getElementById(id
).href
.replace(myRegExp
,'');
54 // TajEmo Work By CB 2012/06/14 02:17:16 PM remove the target change
55 //document.getElementById(id).target = '';
61 if (len
==undefined) {chk
.checked
=true;}
63 //clean the checked id's before check all the list again
64 document
.getElementById('multiprint').href
= document
.getElementById('multiprint').href
.substring(0, document
.getElementById('multiprint').href
.indexOf('=') + 1);
65 document
.getElementById('multiprintcss').href
= document
.getElementById('multiprintcss').href
.substring(0, document
.getElementById('multiprintcss').href
.indexOf('=') + 1);
66 document
.getElementById('multiprintToFax').href
= document
.getElementById('multiprintToFax').href
.substring(0, document
.getElementById('multiprintToFax').href
.indexOf('=') +1);
67 for (pr
= 0; pr
< chk
.length
; pr
++){
68 if($(chk
[pr
]).parents("tr.inactive").length
==0)
71 changeLinkHref_All('multiprint',true,chk
[pr
].value
);
72 changeLinkHref_All('multiprintcss',true, chk
[pr
].value
);
73 changeLinkHref_All('multiprintToFax',true, chk
[pr
].value
);
79 function Uncheck(chk
) {
81 if (len
==undefined) {chk
.checked
=false;}
83 for (pr
= 0; pr
< chk
.length
; pr
++){
84 chk
[pr
].checked
=false;
85 changeLinkHref_All('multiprint',false,chk
[pr
].value
);
86 changeLinkHref_All('multiprintcss',false, chk
[pr
].value
);
87 changeLinkHref_All('multiprintToFax',false, chk
[pr
].value
);
92 var CheckForChecks = function(chk
) {
93 // Checks for any checked boxes, if none are found than an alert is raised and the link is killed
94 if (Checking(chk
) == false) { return false; }
95 return top
.restoreSession();
98 function Checking(chk
) {
102 if (len
==undefined) {
103 if (chk
.checked
== true){
108 for (pr
= 0; pr
< chk
.length
; pr
++){
109 if (chk
[pr
].checked
== true) {
117 alert("{/literal}{xl t='Please select at least one prescription!'}{literal}");
122 $(document
).ready(function(){
123 $(":checkbox:checked").each(function () {
124 changeLinkHref('multiprint',this.checked
, this.value
);
125 changeLinkHref('multiprintcss',this.checked
, this.value
);
126 changeLinkHref('multiprintToFax',this.checked
, this.value
);
134 <body id=
"prescription_list" class=
"body_top">
137 <span class=
"title"><b>{xl t='List'|escape:'html'}
</b></span>
139 <div id=
"prescription_list">
143 <div id=
"print_links">
150 {if $GLOBALS.rx_zend_pdf_template}
151 <a target=
"_blank" id=
"multiprint" href=
"{$GLOBALS.webroot}/{$GLOBALS.baseModDir}{$GLOBALS.zendModDir}/public/prescription-pdf-template/{$GLOBALS.rx_zend_pdf_action}?id={$printm}" onclick=
"top.restoreSession()" class=
"css_button"><span>{xl t='Download'|escape:'html'} ({xl t='PDF'|escape:'html'})
</span></a>
153 <a id=
"multiprint" href=
"{$CONTROLLER}prescription&multiprint&id={$printm}" onclick=
"top.restoreSession()" class=
"css_button"><span>{xl t='Download'|escape:'html'} ({xl t='PDF'|escape:'html'})
</span></a>
157 {if $GLOBALS.rx_zend_html_template}
158 <a target=
"_blank" id=
"multiprintcss" href=
"{$GLOBALS.webroot}/{$GLOBALS.baseModDir}{$GLOBALS.zendModDir}/public/prescription-html-template/{$GLOBALS.rx_zend_html_action}?id={$printm}" onclick=
"top.restoreSession()" class=
"css_button"><span>{xl t='View Printable Version'|escape:'html'} ({xl t='HTML'|escape:'html'})
</span></a>
160 <!-- TajEmo work by CB 2012/06/14 02:16:32 PM target="_script" opens better -->
161 <a target=
"_script" id=
"multiprintcss" href=
"{$CONTROLLER}prescription&multiprintcss&id={$printm}" onclick=
"top.restoreSession()" class=
"css_button"><span>{xl t='View Printable Version'|escape:'html'} ({xl t='HTML'|escape:'html'})
</span></a>
164 {if $GLOBALS.rx_use_fax_template}
165 <td style=
"border-style:none;">
166 <a id=
"multiprintToFax" href=
"{$CONTROLLER}prescription&multiprintfax&id={$printm}" onclick=
"top.restoreSession()" class=
"css_button"><span>{xl t='Download'|escape:'html'} ({xl t='Fax'|escape:'html'})
</span></a>
169 {if $GLOBALS.weno_rx_enable}
170 <td style=
"border-style:none;">
171 <a id=
"multiprintToFax" href=
"{$GLOBALS.webroot}/interface/weno/validate.php?csrf_token_form={$CSRF_TOKEN_FORM|attr_url}" onclick=
"top.restoreSession()" class=
"css_button"><span>{xl t='Transmit'|escape:'html'} {xl t='Rx'|escape:'html'}
</span></a>
174 {if $CAMOS_FORM == true}
176 <a id=
"four_panel_rx" href=
"{$GLOBALS.webroot}/interface/forms/CAMOS/rx_print.php?sigline=plain" onclick=
"top.restoreSession()" class=
"css_button"><span>{xl t='View Four Panel'|escape:'html'}
</span></a>
186 <a href=
"#" class=
"small" onClick=
"Check(document.presc.check_list);"><span>{xl t='Check All'|escape:'html'}
</span></a> |
187 <a href=
"#" class=
"small" onClick=
"Uncheck(document.presc.check_list);"><span>{xl t='Clear All'|escape:'html'}
</span></a>
197 <table width=
"100%" class=
"showborder_head" cellspacing=
"0px" cellpadding=
"2px">
199 <!-- TajEmo Changes 2012/06/14 02:01:43 PM by CB added Heading for checkbox column -->
200 <th width=
"8px"> </th>
201 <th width=
"8px"> </th>
203 <th width=
"70px">{xl t='Drug'|escape:'html'}
</th>
204 <th width=
"70px">{xl t='RxNorm'|escape:'html'}
</th>
205 <th width=
"70px">{xl t='Created'|escape:'html'}
<br />{xl t='Changed'|escape:'html'}
</th>
206 <th width=
"20px">{xl t='Dosage'|escape:'html'}
</th>
207 <th width=
"20px">{xl t='Qty'|escape:'html'}.
</th>
208 <th>{xl t='Unit'|escape:'html'}
</th>
209 <th width=
"20px">{xl t='Refills'|escape:'html'}
</th>
210 <th>{xl t='Provider'|escape:'html'}
</th>
211 {if $GLOBALS.weno_rx_enable}
212 <th>{xl t='Send'|escape:'html'}
<br>{xl t='NewRx'|escape:'html'}
</th>
213 <th>{xl t='Refill'|escape:'html'}
<br>{xl t='Rx'|escape:'html'}
</th>
214 <th>{xl t='Last'|escape:'html'}
<br>{xl t='Tx Date'|escape:'html'}
</th>
218 {foreach from=$prescriptions item=prescription}
219 <!-- TajEmo Changes 2012/06/14 02:03:17 PM by CB added cursor:pointer for easier user understanding -->
220 <tr style=
"cursor:pointer" id=
"{$prescription->id|escape:'html'}" class=
"showborder onescript {if $prescription->active <= 0} inactive{/if}" title=
"{xl t='Click to view/edit'|escape:'html'}">
222 <input class=
"check_list" id=
"check_list" type=
"checkbox" value=
"{$prescription->id|escape:'html'}" {if $prescription-
>encounter == $prescription-
>get_encounter() && $prescription-
>active
> 0}
checked=
"checked" {/if}
onclick=
"changeLinkHref('multiprint',this.checked, this.value);changeLinkHref('multiprintcss',this.checked, this.value);changeLinkHref('multiprintToFax',this.checked, this.value)" title=
"{xl t='Select for printing'|escape:'html'}">
224 {if $prescription-
>erx_source==
0}
225 <td class=
"editscript" id=
"{$prescription->id}">
226 <a class='editscript css_button_small' id='{$prescription-
>id}'
href=
"controller.php?prescription&edit&id={$prescription->id}" style=
"margin-top:-2px"><span>{xl t='Edit'|escape:'html'}
</span></a>
227 <!-- TajEmo Changes 2012/06/14 02:02:22 PM by CB commented out, to avoid duplicate display of drug name
228 {if $prescription->active > 0}<b>{/if}{$prescription->drug}{if $prescription->active > 0}</b>{/if}
231 <td class=
"editscript" id=
"{$prescription->id}">
232 {if $prescription-
>active
> 0}
<b>{/if}{$prescription-
>drug|escape:'html'}{if $prescription-
>active
> 0}
</b>{/if}
233 <br />{$prescription-
>note|escape:'html'}
237 <td id=
"{$prescription->id}">
238 {if $prescription-
>active
> 0}
<b>{/if}{$prescription-
>drug|escape:'html'}{if $prescription-
>active
> 0}
</b>{/if}
239 <br />{$prescription-
>note|escape:'html'}
242 <td id=
"{$prescription->id}">
243 {$prescription-
>rxnorm_drugcode|escape:'html'}
245 <td id=
"{$prescription->id}">
246 {$prescription-
>date_added|escape:'html'}
<br />
247 {$prescription-
>date_modified|escape:'html'}
249 <td id=
"{$prescription->id}">
250 {$prescription-
>get_dosage_display()|escape:'html'}
252 {if $prescription-
>erx_source==
0}
253 <td class=
"editscript" id=
"{$prescription->id}">
254 {$prescription-
>quantity|escape:'html'}
257 <td id=
"{$prescription->id}">
258 {$prescription-
>quantity|escape:'html'}
261 <td id=
"{$prescription->id}">
262 {$prescription-
>get_size()|escape:'html'} {$prescription-
>get_unit_display()|escape:'html'}
264 <td id=
"{$prescription->id}">
265 {$prescription-
>refills|escape:'html'}
267 <td id=
"{$prescription->id}">
268 {$prescription-
>provider-
>get_name_display()|escape:'html'}
270 {if $GLOBALS.weno_rx_enable}
272 {if $prescription-
>ntx ==
0}
273 <input class=
"check_list" id=
"NewRx-{$smarty.foreach.rx.index|escape:'html'}" type=
"checkbox" {if $prescription-
>active <
1}
disabled=
"disabled" {/if}
value=
"{$prescription->id|escape:'html'}" {if $prescription-
>ntx
> 0 && $prescription-
>active
> 0}
checked=
"checked" {/if}
onClick=
"markTx(this,'NewRx-{$prescription->id|escape:'html'}'); changeLinkHrefAll(this.checked, this.value);" title={xl
t=
"Select to transmit"|escape:'html'}
>
277 {if $prescription-
>ntx ==
1}
278 <input class=
"check_list" id=
"RefillRx-{$smarty.foreach.rx.index|escape:'html'}" type=
"checkbox" {if $prescription-
>active <
1}
disabled=
"disabled" {/if}
value=
"{$prescription->id|escape:'html'}" {if $prescription-
>ntx
> 0 && $prescription-
>active
> 0}
checked=
"checked" {/if}
onClick=
"markTx(this,'RefillRx-{$prescription->id|escape:'html'}'); changeLinkHrefAll(this.checked, this.value);" title={xl
t=
"Select to transmit"|escape:'html'}
>
281 <td id=
"{$prescription->id|escape:'html'}" align=
"center">
282 {$prescription-
>txDate|escape:'html'}
294 <div class=
"text" style=
"margin-top:10px">{xl t='There are currently no prescriptions'|escape:'html'}.
</div>
299 <script language='JavaScript'
>
301 $(document
).ready(function(){
302 $("#multiprint").on("click", function() { return CheckForChecks(document
.presc
.check_list
); });
303 $("#multiprintcss").on("click", function() { return CheckForChecks(document
.presc
.check_list
); });
304 $("#multiprintToFax").on("click", function() { return CheckForChecks(document
.presc
.check_list
); });
305 $(".editscript").on("click", function() { ShowScript(this); });
306 $(".onescript").on("mouseover", function() { $(this).children().toggleClass("highlight"); });
307 $(".onescript").on("mouseout", function() { $(this).children().toggleClass("highlight"); });
310 var ShowScript = function(eObj
) {
311 top
.restoreSession();
313 document
.location
.href
="{/literal}{$GLOBALS.webroot}{literal}/controller.php?prescription&edit&id="+objID
;