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
15 <link rel=
"stylesheet" href=
"{$GLOBALS.css_header}" type=
"text/css">
16 <script type=
"text/javascript" src=
"{$GLOBALS.assets_static_relative}/manual-added-packages/jquery-min-1-2-2/index.js"></script>
19 <style type=
"text/css" title=
"mystyles" media=
"all">
25 <script language=
"javascript">
27 function changeLinkHref(id
,addValue
,value
) {
28 var myRegExp
= new RegExp(":" + value
+ ":");
29 if (addValue
){ //add value to href
30 if(document
.getElementById(id
) !== null)document
.getElementById(id
).href
+= ':' + value
+ ':';
32 else { //remove value from href
33 if(document
.getElementById(id
) !== null)document
.getElementById(id
).href
= document
.getElementById(id
).href
.replace(myRegExp
,'');
37 function changeLinkHrefAll(addValue
, value
) {
38 changeLinkHref('multiprint', addValue
, value
);
39 changeLinkHref('multiprintcss', addValue
, value
);
40 changeLinkHref('multiprintToFax', addValue
, value
);
43 //uses jquery to update database table
44 function markTx(oThis
,id
){
45 var isChecked
= oThis
.checked
? 1 : 0; // @TODO this is better served if checkboxs are all checked on submit with one call to markTx
46 $.get('./interface/weno/markTx.php?rx='+id
+'&state='+isChecked
);
50 function changeLinkHref_All(id
,addValue
,value
) {
51 var myRegExp
= new RegExp(":" + value
+ ":");
52 if (addValue
){ //add value to href
53 if(document
.getElementById(id
) !== null)document
.getElementById(id
).href
+= ':' + value
+ ':';
55 else { //remove value from href
56 if(document
.getElementById(id
) !== null)document
.getElementById(id
).href
= document
.getElementById(id
).href
.replace(myRegExp
,'');
57 // TajEmo Work By CB 2012/06/14 02:17:16 PM remove the target change
58 //document.getElementById(id).target = '';
64 if (len
==undefined) {chk
.checked
=true;}
66 for (pr
= 0; pr
< chk
.length
; pr
++){
67 if($(chk
[pr
]).parents("tr.inactive").length
==0)
70 changeLinkHref_All('multiprint',true,chk
[pr
].value
);
71 changeLinkHref_All('multiprintcss',true, chk
[pr
].value
);
72 changeLinkHref_All('multiprintToFax',true, chk
[pr
].value
);
78 function Uncheck(chk
) {
80 if (len
==undefined) {chk
.checked
=false;}
82 for (pr
= 0; pr
< chk
.length
; pr
++){
83 chk
[pr
].checked
=false;
84 changeLinkHref_All('multiprint',false,chk
[pr
].value
);
85 changeLinkHref_All('multiprintcss',false, chk
[pr
].value
);
86 changeLinkHref_All('multiprintToFax',false, chk
[pr
].value
);
91 var CheckForChecks = function(chk
) {
92 // Checks for any checked boxes, if none are found than an alert is raised and the link is killed
93 if (Checking(chk
) == false) { return false; }
94 return top
.restoreSession();
97 function Checking(chk
) {
101 if (len
==undefined) {
102 if (chk
.checked
== true){
107 for (pr
= 0; pr
< chk
.length
; pr
++){
108 if (chk
[pr
].checked
== true) {
116 alert("{/literal}{xl t='Please select at least one prescription!'}{literal}");
121 $(document
).ready(function(){
122 $(":checkbox:checked").each(function () {
123 changeLinkHref('multiprint',this.checked
, this.value
);
124 changeLinkHref('multiprintcss',this.checked
, this.value
);
125 changeLinkHref('multiprintToFax',this.checked
, this.value
);
133 <body id=
"prescription_list" class=
"body_top">
136 <span class=
"title"><b>{xl t='List'|escape:'html'}
</b></span>
138 <div id=
"prescription_list">
142 <div id=
"print_links">
149 {if $GLOBALS.rx_zend_pdf_template}
150 <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>
152 <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>
156 {if $GLOBALS.rx_zend_html_template}
157 <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>
159 <!-- TajEmo work by CB 2012/06/14 02:16:32 PM target="_script" opens better -->
160 <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>
163 {if $GLOBALS.rx_use_fax_template}
164 <td style=
"border-style:none;">
165 <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>
168 {if $GLOBALS.weno_rx_enable}
169 <td style=
"border-style:none;">
170 <a id=
"multiprintToFax" href=
"{$GLOBALS.webroot}/interface/weno/validate.php" onclick=
"top.restoreSession()" class=
"css_button"><span>{xl t='Transmit'|escape:'html'} {xl t='Rx'|escape:'html'}
</span></a>
173 {if $CAMOS_FORM == true}
175 <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>
185 <a href=
"#" class=
"small" onClick=
"Check(document.presc.check_list);"><span>{xl t='Check All'|escape:'html'}
</span></a> |
186 <a href=
"#" class=
"small" onClick=
"Uncheck(document.presc.check_list);"><span>{xl t='Clear All'|escape:'html'}
</span></a>
196 <table width=
"100%" class=
"showborder_head" cellspacing=
"0px" cellpadding=
"2px">
198 <!-- TajEmo Changes 2012/06/14 02:01:43 PM by CB added Heading for checkbox column -->
199 <th width=
"8px"> </th>
200 <th width=
"8px"> </th>
202 <th width=
"70px">{xl t='Drug'|escape:'html'}
</th>
203 <th width=
"70px">{xl t='RxNorm'|escape:'html'}
</th>
204 <th width=
"70px">{xl t='Created'|escape:'html'}
<br />{xl t='Changed'|escape:'html'}
</th>
205 <th width=
"20px">{xl t='Dosage'|escape:'html'}
</th>
206 <th width=
"20px">{xl t='Qty'|escape:'html'}.
</th>
207 <th>{xl t='Unit'|escape:'html'}
</th>
208 <th width=
"20px">{xl t='Refills'|escape:'html'}
</th>
209 <th>{xl t='Provider'|escape:'html'}
</th>
210 {if $GLOBALS.weno_rx_enable}
211 <th>{xl t='Send'|escape:'html'}
<br>{xl t='NewRx'|escape:'html'}
</th>
212 <th>{xl t='Refill'|escape:'html'}
<br>{xl t='Rx'|escape:'html'}
</th>
213 <th>{xl t='Last'|escape:'html'}
<br>{xl t='Tx Date'|escape:'html'}
</th>
217 {foreach from=$prescriptions item=prescription}
218 <!-- TajEmo Changes 2012/06/14 02:03:17 PM by CB added cursor:pointer for easier user understanding -->
219 <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'}">
221 <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'}">
223 {if $prescription-
>erx_source==
0}
224 <td class=
"editscript" id=
"{$prescription->id}">
225 <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>
226 <!-- TajEmo Changes 2012/06/14 02:02:22 PM by CB commented out, to avoid duplicate display of drug name
227 {if $prescription->active > 0}<b>{/if}{$prescription->drug}{if $prescription->active > 0}</b>{/if}
230 <td class=
"editscript" id=
"{$prescription->id}">
231 {if $prescription-
>active
> 0}
<b>{/if}{$prescription-
>drug|escape:'html'}{if $prescription-
>active
> 0}
</b>{/if}
232 <br />{$prescription-
>note|escape:'html'}
236 <td id=
"{$prescription->id}">
237 {if $prescription-
>active
> 0}
<b>{/if}{$prescription-
>drug|escape:'html'}{if $prescription-
>active
> 0}
</b>{/if}
238 <br />{$prescription-
>note|escape:'html'}
241 <td id=
"{$prescription->id}">
242 {$prescription-
>rxnorm_drugcode|escape:'html'}
244 <td id=
"{$prescription->id}">
245 {$prescription-
>date_added|escape:'html'}
<br />
246 {$prescription-
>date_modified|escape:'html'}
248 <td id=
"{$prescription->id}">
249 {$prescription-
>get_dosage_display()|escape:'html'}
251 {if $prescription-
>erx_source==
0}
252 <td class=
"editscript" id=
"{$prescription->id}">
253 {$prescription-
>quantity|escape:'html'}
256 <td id=
"{$prescription->id}">
257 {$prescription-
>quantity|escape:'html'}
260 <td id=
"{$prescription->id}">
261 {$prescription-
>get_size()|escape:'html'} {$prescription-
>get_unit_display()|escape:'html'}
263 <td id=
"{$prescription->id}">
264 {$prescription-
>refills|escape:'html'}
266 <td id=
"{$prescription->id}">
267 {$prescription-
>provider-
>get_name_display()|escape:'html'}
269 {if $GLOBALS.weno_rx_enable}
271 {if $prescription-
>ntx ==
0}
272 <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'}
>
276 {if $prescription-
>ntx ==
1}
277 <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'}
>
280 <td id=
"{$prescription->id|escape:'html'}" align=
"center">
281 {$prescription-
>txDate|escape:'html'}
293 <div class=
"text" style=
"margin-top:10px">{xl t='There are currently no prescriptions'|escape:'html'}.
</div>
298 <script language='JavaScript'
>
300 $(document
).ready(function(){
301 $("#multiprint").click(function() { return CheckForChecks(document
.presc
.check_list
); });
302 $("#multiprintcss").click(function() { return CheckForChecks(document
.presc
.check_list
); });
303 $("#multiprintToFax").click(function() { return CheckForChecks(document
.presc
.check_list
); });
304 $(".editscript").click(function() { ShowScript(this); });
305 $(".onescript").mouseover(function() { $(this).children().toggleClass("highlight"); });
306 $(".onescript").mouseout(function() { $(this).children().toggleClass("highlight"); });
309 var ShowScript = function(eObj
) {
310 top
.restoreSession();
312 document
.location
.href
="{/literal}{$GLOBALS.webroot}{literal}/controller.php?prescription&edit&id="+objID
;