5 * @link http://www.open-emr.org
6 * @author Brady Miller
<brady.g.miller@gmail.com
>
7 * @author Sherwin Gaddis
<sherwingaddis@gmail.com
>
8 * @copyright Copyright (c)
2017-
2018 Brady Miller
<brady.g.miller@gmail.com
>
9 * @copyright Copyright (c)
2018 Sherwin Gaddis
<sherwingaddis@gmail.com
>
10 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License
3
15 {headerTemplate assets='no_textformat|no_dialog'}
18 <script language=
"javascript">
20 function changeLinkHref(id
,addValue
,value
) {
21 var myRegExp
= new RegExp(":" + value
+ ":");
22 if (addValue
){ //add value to href
23 if(document
.getElementById(id
) !== null)document
.getElementById(id
).href
+= ':' + value
+ ':';
25 else { //remove value from href
26 if(document
.getElementById(id
) !== null)document
.getElementById(id
).href
= document
.getElementById(id
).href
.replace(myRegExp
,'');
30 function changeLinkHrefAll(addValue
, value
) {
31 changeLinkHref('multiprint', addValue
, value
);
32 changeLinkHref('multiprintcss', addValue
, value
);
33 changeLinkHref('multiprintToFax', addValue
, value
);
36 //uses jquery to update database table
37 function markTx(oThis
,id
){{/literal
}
38 var isChecked
= oThis
.checked
? 1 : 0; // @TODO this is better served if checkboxs are all checked on submit with one call to markTx
39 $.get('./interface/weno/markTx.php?rx=' + encodeURIComponent(id
) + '&state=' + encodeURIComponent(isChecked
) + '&csrf_token_form=' + {$CSRF_TOKEN_FORM
|js_url
});
43 function changeLinkHref_All(id
,addValue
,value
) {
44 var myRegExp
= new RegExp(":" + value
+ ":");
45 if (addValue
){ //add value to href
46 if(document
.getElementById(id
) !== null)document
.getElementById(id
).href
+= ':' + value
+ ':';
48 else { //remove value from href
49 if(document
.getElementById(id
) !== null)document
.getElementById(id
).href
= document
.getElementById(id
).href
.replace(myRegExp
,'');
50 // TajEmo Work By CB 2012/06/14 02:17:16 PM remove the target change
51 //document.getElementById(id).target = '';
57 if (len
==undefined) {chk
.checked
=true;}
59 //clean the checked id's before check all the list again
60 document
.getElementById('multiprint').href
= document
.getElementById('multiprint').href
.substring(0, document
.getElementById('multiprint').href
.indexOf('=') + 1);
61 document
.getElementById('multiprintcss').href
= document
.getElementById('multiprintcss').href
.substring(0, document
.getElementById('multiprintcss').href
.indexOf('=') + 1);
62 document
.getElementById('multiprintToFax').href
= document
.getElementById('multiprintToFax').href
.substring(0, document
.getElementById('multiprintToFax').href
.indexOf('=') +1);
63 for (pr
= 0; pr
< chk
.length
; pr
++){
64 if($(chk
[pr
]).parents("tr.inactive").length
==0)
67 changeLinkHref_All('multiprint',true,chk
[pr
].value
);
68 changeLinkHref_All('multiprintcss',true, chk
[pr
].value
);
69 changeLinkHref_All('multiprintToFax',true, chk
[pr
].value
);
75 function Uncheck(chk
) {
77 if (len
==undefined) {chk
.checked
=false;}
79 for (pr
= 0; pr
< chk
.length
; pr
++){
80 chk
[pr
].checked
=false;
81 changeLinkHref_All('multiprint',false,chk
[pr
].value
);
82 changeLinkHref_All('multiprintcss',false, chk
[pr
].value
);
83 changeLinkHref_All('multiprintToFax',false, chk
[pr
].value
);
88 var CheckForChecks = function(chk
) {
89 // Checks for any checked boxes, if none are found than an alert is raised and the link is killed
90 if (Checking(chk
) == false) { return false; }
91 return top
.restoreSession();
94 function Checking(chk
) {
99 if (chk
.checked
== true){
104 for (pr
= 0; pr
< chk
.length
; pr
++){
105 if (chk
[pr
].checked
== true) {
113 alert({/literal
}{xl t
='Please select at least one prescription!'|js_escape
}{literal
});
118 $(document
).ready(function(){
119 $(":checkbox:checked").each(function () {
120 changeLinkHref('multiprint',this.checked
, this.value
);
121 changeLinkHref('multiprintcss',this.checked
, this.value
);
122 changeLinkHref('multiprintToFax',this.checked
, this.value
);
130 <body id=
"prescription_list" class=
"body_top">
133 <h3>{xl t='List'|text}
</h3>
134 <div id=
"prescription_list">
138 <div id=
"print_links">
145 {if $GLOBALS.rx_zend_pdf_template}
146 <a target=
"_blank" id=
"multiprint" href=
"{$GLOBALS.webroot}/{$GLOBALS.baseModDir}{$GLOBALS.zendModDir}/public/prescription-pdf-template/{$GLOBALS.rx_zend_pdf_action}?id={$printm|attr_url}" onclick=
"top.restoreSession()" class=
"css_button"><span>{xl t='Download'|text} ({xl t='PDF'|text})
</span></a>
148 <a id=
"multiprint" href=
"{$CONTROLLER}prescription&multiprint&id={$printm|attr_url}" onclick=
"top.restoreSession()" class=
"css_button"><span>{xl t='Download'|text} ({xl t='PDF'|text})
</span></a>
152 {if $GLOBALS.rx_zend_html_template}
153 <a target=
"_blank" id=
"multiprintcss" href=
"{$GLOBALS.webroot}/{$GLOBALS.baseModDir}{$GLOBALS.zendModDir}/public/prescription-html-template/{$GLOBALS.rx_zend_html_action}?id={$printm|attr_url}" onclick=
"top.restoreSession()" class=
"css_button"><span>{xl t='View Printable Version'|text} ({xl t='HTML'|text})
</span></a>
155 <!-- TajEmo work by CB 2012/06/14 02:16:32 PM target="_script" opens better -->
156 <a target=
"_script" id=
"multiprintcss" href=
"{$CONTROLLER}prescription&multiprintcss&id={$printm|attr_url}" onclick=
"top.restoreSession()" class=
"css_button"><span>{xl t='View Printable Version'|text} ({xl t='HTML'|text})
</span></a>
159 {if $GLOBALS.rx_use_fax_template}
160 <td style=
"border-style:none;">
161 <a id=
"multiprintToFax" href=
"{$CONTROLLER}prescription&multiprintfax&id={$printm|attr_url}" onclick=
"top.restoreSession()" class=
"css_button"><span>{xl t='Download'|text} ({xl t='Fax'|text})
</span></a>
164 {if $GLOBALS.weno_rx_enable}
165 <td style=
"border-style:none;">
166 <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'|text} {xl t='Rx'|text}
</span></a>
169 {if $CAMOS_FORM == true}
171 <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'|text}
</span></a>
181 <a href=
"#" class=
"small" onClick=
"Check(document.presc.check_list);"><span>{xl t='Check All'|text}
</span></a> |
182 <a href=
"#" class=
"small" onClick=
"Uncheck(document.presc.check_list);"><span>{xl t='Clear All'|text}
</span></a>
192 <table class=
"table">
195 <!-- TajEmo Changes 2012/06/14 02:01:43 PM by CB added Heading for checkbox column -->
198 <th>{xl t='Drug'|text}
</th>
199 <th>{xl t='RxNorm'|text}
</th>
200 <th>{xl t='Created'|text}
<br />{xl t='Changed'|text}
</th>
201 <th>{xl t='Dosage'|text}
</th>
202 <th>{xl t='Qty'|text}.
</th>
203 <th>{xl t='Unit'|text}
</th>
204 <th>{xl t='Refills'|text}
</th>
205 <th>{xl t='Provider'|text}
</th>
206 {if $GLOBALS.weno_rx_enable}
207 <th>{xl t='Send NewRx'|text}
</th>
208 <th>{xl t='Refill Rx'|text}
</th>
209 <th>{xl t='Last Tx Date'|text}
</th>
214 {foreach from=$prescriptions item=prescription}
215 <!-- TajEmo Changes 2012/06/14 02:03:17 PM by CB added cursor:pointer for easier user understanding -->
216 <tr id=
"{$prescription->id|attr}" class=
"showborder onescript {if $prescription->active <= 0} inactive{/if}">
218 <input class=
"check_list" id=
"check_list" type=
"checkbox" value=
"{$prescription->id|attr}" {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'|attr}">
220 {if $prescription-
>erx_source==
0}
221 <td class=
"editscript" id=
"{$prescription->id|attr}">
222 <a class='editscript css_button_small' id='{$prescription-
>id|attr}'
href=
"controller.php?prescription&edit&id={$prescription->id|attr_url}"><span>{xl t='Edit'|text}
</span></a>
223 <!-- TajEmo Changes 2012/06/14 02:02:22 PM by CB commented out, to avoid duplicate display of drug name
224 {if $prescription->active > 0}<b>{/if}{$prescription->drug}{if $prescription->active > 0}</b>{/if}
227 <td class=
"editscript" id=
"{$prescription->id|attr}">
228 {if $prescription-
>active
> 0}
<b>{/if}{$prescription-
>drug|text}{if $prescription-
>active
> 0}
</b>{/if}
229 <br />{$prescription-
>note|text}
233 <td id=
"{$prescription->id|attr}">
234 {if $prescription-
>active
> 0}
<b>{/if}{$prescription-
>drug|text}{if $prescription-
>active
> 0}
</b>{/if}
235 <br />{$prescription-
>note|text}
238 <td id=
"{$prescription->id|attr}">
239 {$prescription-
>rxnorm_drugcode|text}
241 <td id=
"{$prescription->id|attr}">
242 {$prescription-
>date_added|text}
<br />
243 {$prescription-
>date_modified|text}
245 <td id=
"{$prescription->id|attr}">
246 {$prescription-
>get_dosage_display()|text}
248 {if $prescription-
>erx_source==
0}
249 <td class=
"editscript" id=
"{$prescription->id|attr}">
250 {$prescription-
>quantity|text}
253 <td id=
"{$prescription->id|attr}">
254 {$prescription-
>quantity|text}
257 <td id=
"{$prescription->id|attr}">
258 {$prescription-
>get_size()|text} {$prescription-
>get_unit_display()|text}
260 <td id=
"{$prescription->id|attr}">
261 {$prescription-
>refills|escape:'html'}
263 <td id=
"{$prescription->id|attr}">
264 {$prescription-
>provider-
>get_name_display()|text}
266 {if $GLOBALS.weno_rx_enable}
268 {if $prescription-
>ntx ==
0}
269 <input class=
"check_list" id=
"NewRx-{$smarty.foreach.rx.index|attr}" type=
"checkbox" {if $prescription-
>active <
1}
disabled=
"disabled" {/if}
value=
"{$prescription->id|attr}" {if $prescription-
>ntx
> 0 && $prescription-
>active
> 0}
checked=
"checked" {/if}
onClick=
"markTx(this,'NewRx-{$prescription->id|attr}'); changeLinkHrefAll(this.checked, this.value);" title=
"{xl t="Select to transmit
"|attr}">
273 {if $prescription-
>ntx ==
1}
274 <input class=
"check_list" id=
"RefillRx-{$smarty.foreach.rx.index|attr}" type=
"checkbox" {if $prescription-
>active <
1}
disabled=
"disabled" {/if}
value=
"{$prescription->id|attr}" {if $prescription-
>ntx
> 0 && $prescription-
>active
> 0}
checked=
"checked" {/if}
onClick=
"markTx(this,'RefillRx-{$prescription->id|attr}'); changeLinkHrefAll(this.checked, this.value);" title=
"{xl t="Select to transmit
"|attr}">
277 <td id=
"{$prescription->id|attr}" align=
"center">
278 {$prescription-
>txDate|text}
289 {if $GLOBALS.rx_show_drug_drug}
292 <h3>{xl t='Drug-Drug Interaction'|text}
</h3>
293 <p title=
"{xl t='Severity information will be missing if interaction is found'|attr}"><a href=
"#">*{xl t='Notice'|text}
</a></p>
294 <div id=
"return_info">
302 <div class=
"text" style=
"margin-top:10px">{xl t='There are currently no prescriptions'|text}.
</div>
307 <script language='JavaScript'
>
309 $(document
).ready(function(){
310 $("#multiprint").on("click", function() { return CheckForChecks(document
.presc
.check_list
); });
311 $("#multiprintcss").on("click", function() { return CheckForChecks(document
.presc
.check_list
); });
312 $("#multiprintToFax").on("click", function() { return CheckForChecks(document
.presc
.check_list
); });
313 $(".editscript").on("click", function() { ShowScript(this); });
314 $(".onescript").on("mouseover", function() { $(this).children().toggleClass("highlight"); });
315 $(".onescript").on("mouseout", function() { $(this).children().toggleClass("highlight"); });
318 var ShowScript = function(eObj
) {
319 top
.restoreSession();
321 document
.location
.href
="{/literal}{$GLOBALS.webroot}{literal}/controller.php?prescription&edit&id=" + encodeURIComponent(objID
);