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'}
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
);
37 function changeLinkHref_All(id
,addValue
,value
) {
38 var myRegExp
= new RegExp(":" + value
+ ":");
39 if (addValue
){ //add value to href
40 if(document
.getElementById(id
) !== null)document
.getElementById(id
).href
+= ':' + value
+ ':';
42 else { //remove value from href
43 if(document
.getElementById(id
) !== null)document
.getElementById(id
).href
= document
.getElementById(id
).href
.replace(myRegExp
,'');
44 // TajEmo Work By CB 2012/06/14 02:17:16 PM remove the target change
45 //document.getElementById(id).target = '';
55 //clean the checked id's before check all the list again
56 var multiprint
=document
.getElementById('multiprint');
57 if(multiprint
!==null) {
58 multiprint
.href
= document
.getElementById('multiprint').href
.substring(0, document
.getElementById('multiprint').href
.indexOf('=') + 1);
61 var multiprintcss
=document
.getElementById('multiprintcss');
62 if(multiprintcss
!==null) {
63 multiprintcss
.href
= document
.getElementById('multiprintcss').href
.substring(0, document
.getElementById('multiprintcss').href
.indexOf('=') + 1);
66 var multiprintToFax
=document
.getElementById('multiprintToFax');
67 if(multiprintToFax
!==null) {
68 multiprintToFax
.href
= document
.getElementById('multiprintToFax').href
.substring(0, document
.getElementById('multiprintToFax').href
.indexOf('=') +1);
70 for (let pr
= 0; pr
< chk
.length
; pr
++){
71 if($(chk
[pr
]).parents("tr.inactive").length
==0)
74 changeLinkHref_All('multiprint',true,chk
[pr
].value
);
75 changeLinkHref_All('multiprintcss',true, chk
[pr
].value
);
76 changeLinkHref_All('multiprintToFax',true, chk
[pr
].value
);
82 function deleteDrug(d
) {
83 let msg
= {xlj t
='Do you really want to delete?'};
84 let choice
= confirm(msg
);
88 url
: "./library/deletedrug.php",
92 csrf_token_form
: {$CSRF_TOKEN_FORM
|js_escape
}
94 success: function(data
) {
96 document
.location
.href
= '{$GLOBALS.webroot}/controller.php?prescription&list&id=' + {$smarty
.session
.pid
|js_url
};
98 error: function(error
) {
105 function Uncheck(chk
) {
107 if (len
==undefined) {
111 for (pr
= 0; pr
< chk
.length
; pr
++){
112 chk
[pr
].checked
=false;
113 changeLinkHref_All('multiprint',false,chk
[pr
].value
);
114 changeLinkHref_All('multiprintcss',false, chk
[pr
].value
);
115 changeLinkHref_All('multiprintToFax',false, chk
[pr
].value
);
120 var CheckForChecks = function(chk
) {
121 // Checks for any checked boxes, if none are found than an alert is raised and the link is killed
122 if (Checking(chk
) == false) { return false; }
123 return top
.restoreSession();
126 function Checking(chk
) {
130 if (len
==undefined) {
131 if (chk
.checked
== true){
136 for (pr
= 0; pr
< chk
.length
; pr
++){
137 if (chk
[pr
].checked
== true) {
145 alert({xlj t
='Please select at least one prescription!'});
151 $(":checkbox:checked").each(function () {
152 changeLinkHref('multiprint',this.checked
, this.value
);
153 changeLinkHref('multiprintcss',this.checked
, this.value
);
154 changeLinkHref('multiprintToFax',this.checked
, this.value
);
162 <body id=
"prescription_list">
163 <div class=
"container-fluid">
167 <h3>{xlt t='List'}
</h3>
169 <div class=
"col-12 d-flex justify-content-between">
170 <div class=
"btn-group">
171 {if $GLOBALS.rx_zend_pdf_template}
172 <a target=
"_blank" id=
"multiprint" href=
"{$GLOBALS.webroot}/{$GLOBALS.baseModDir}{$GLOBALS.zendModDir}/public/prescription-pdf-template/{$GLOBALS.rx_zend_pdf_action}?id={if !empty($printm)}{$printm|attr_url}{/if}" onclick=
"top.restoreSession()" class=
"btn btn-primary btn-sm">{xlt t='Download'} ({xlt t='PDF'})
</a>
174 <a id=
"multiprint" href=
"{$CONTROLLER}prescription&multiprint&id={if !empty($printm)}{$printm|attr_url}{/if}" onclick=
"top.restoreSession()" class=
"btn btn-primary btn-sm btn-download">{xlt t='Download'} ({xl t='PDF'})
</a>
176 {if $GLOBALS.rx_zend_html_template}
177 <a target=
"_blank" id=
"multiprintcss" href=
"{$GLOBALS.webroot}/{$GLOBALS.baseModDir}{$GLOBALS.zendModDir}/public/prescription-html-template/{$GLOBALS.rx_zend_html_action}?id={if !empty($printm)}{$printm|attr_url}{/if}" onclick=
"top.restoreSession()" class=
"btn btn-primary btn-sm">{xl t='View Printable Version'|text} ({xlt t='HTML'})
</a>
179 <!-- TajEmo work by CB 2012/06/14 02:16:32 PM target="_script" opens better -->
180 <a target=
"_script" id=
"multiprintcss" href=
"{$CONTROLLER}prescription&multiprintcss&id={if !empty($printm)}{$printm|attr_url}{/if}" onclick=
"top.restoreSession()" class=
"btn btn-primary btn-sm btn-print">{xlt t='View Printable Version'} ({xlt t='HTML'})
</a>
182 {if $GLOBALS.rx_use_fax_template}
183 <a id=
"multiprintToFax" href=
"{$CONTROLLER}prescription&multiprintfax&id={if !empty($printm)}{$printm|attr_url}{/if}" onclick=
"top.restoreSession()" class=
"btn btn-primary btn-sm btn-download">{xlt t='Download'} ({xlt t='Fax'})
</a>
185 {if $CAMOS_FORM == true}
186 <a id=
"four_panel_rx" href=
"{$GLOBALS.webroot}/interface/forms/CAMOS/rx_print.php?sigline=plain" onclick=
"top.restoreSession()" class=
"btn btn-primary btn-sm">{xlt t='View Four Panel'}
</a>
189 <div class=
"btn-group">
190 <a href=
"#" class=
"small" onClick=
"Check(document.presc.check_list);"><span>{xlt t='Check All'}
</span></a> |
191 <a href=
"#" class=
"small" onClick=
"Uncheck(document.presc.check_list);"><span>{xlt t='Clear All'}
</span></a>
195 <div id=
"prescription_list">
197 <div class=
"table-responsive">
198 <table class=
"table table-hover">
201 <!-- TajEmo Changes 2012/06/14 02:01:43 PM by CB added Heading for checkbox column -->
204 <th>{xlt t='Drug'}
</th>
205 <th>{xlt t='RxNorm'}
</th>
206 <th>{xlt t='Created'}
<br />{xlt t='Changed'}
</th>
207 <th>{xlt t='Dosage'}
</th>
208 <th>{xlt t='Qty'}.
</th>
209 <th>{xlt t='Unit'}
</th>
210 <th>{xlt t='Refills'}
</th>
211 <th>{xlt t='Provider'}
</th>
216 {foreach from=$prescriptions item=prescription}
217 <!-- TajEmo Changes 2012/06/14 02:03:17 PM by CB added cursor:pointer for easier user understanding -->
218 <tr id=
"{$prescription->id|attr}" class=
"showborder onescript {if $prescription->active <= 0} inactive{/if}">
219 <td class=
"text-center">
220 <input class=
"check_list" id=
"check_list" type=
"checkbox" value=
"{$prescription->id|attr}" {if !empty($prescription-
>encounter) && $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=
"{xla t='Select for printing'}">
222 {if empty($prescription-
>erx_source) || $prescription-
>erx_source==
0}
223 <td class=
"editscript" id=
"{$prescription->id|attr}">
224 <a class='editscript btn btn-primary btn-sm btn-edit' id='{$prescription-
>id|attr}'
href=
"{$GLOBALS.webroot}/controller.php?prescription&edit&id={$prescription->id|attr_url}">{xlt t='Edit'}
</a>
225 <!-- TajEmo Changes 2012/06/14 02:02:22 PM by CB commented out, to avoid duplicate display of drug name
226 {if $prescription->active > 0}<b>{/if}{$prescription->drug}{if $prescription->active > 0}</b>{/if}
229 <td class=
"editscript" id=
"{$prescription->id|attr}">
230 {if $prescription-
>active
> 0}
<b>{/if}{$prescription-
>drug|text}{if $prescription-
>active
> 0}
</b>{/if}
231 <br />{$prescription-
>note|text}
235 <td id=
"{$prescription->id|attr}">
236 {if $prescription-
>active
> 0}
<b>{/if}{$prescription-
>drug|text}{if $prescription-
>active
> 0}
</b>{/if}
237 <br />{$prescription-
>note|text}
240 <td id=
"{$prescription->id|attr}">
241 {$prescription-
>rxnorm_drugcode|text}
243 <td id=
"{$prescription->id|attr}">
244 {$prescription-
>date_added|oeFormatShortDate|text}
<br />
245 {$prescription-
>date_modified|oeFormatShortDate|text}
247 <td id=
"{$prescription->id|attr}">
248 {$prescription-
>get_dosage_display()|text}
250 {if empty($prescription-
>erx_source) || $prescription-
>erx_source==
0}
251 <td class=
"editscript" id=
"{$prescription->id|attr}">
252 {$prescription-
>quantity|text}
255 <td id=
"{$prescription->id|attr}">
256 {$prescription-
>quantity|text}
259 <td id=
"{$prescription->id|attr}">
260 {$prescription-
>get_size()|text} {$prescription-
>get_unit_display()|text}
262 <td id=
"{$prescription->id|attr}">
263 {$prescription-
>refills|text}
265 <td id=
"{$prescription->id|attr}">
266 {$prescription-
>provider-
>get_name_display()|text}
268 <td><a href=
"#" id=
"deleteDrug" class=
"btn btn-danger btn-sm btn-delete" onclick=
"deleteDrug({$prescription->id|attr})">{xlt t='Delete'}
</a></td>
277 {if $GLOBALS.rx_show_drug_drug}
280 <h3>{xlt t='Drug-Drug Interaction'}
</h3>
281 <p title=
"{xla t='Severity information will be missing if interaction is found'}"><a href=
"#">*{xlt t='Notice'}
</a></p>
282 <div id=
"return_info">
290 <div class=
"text mt-3">{xlt t='There are currently no prescriptions'}.
</div>
299 $("#multiprint").on("click", function() { return CheckForChecks(document
.presc
.check_list
); });
300 $("#multiprintcss").on("click", function() { return CheckForChecks(document
.presc
.check_list
); });
301 $("#multiprintToFax").on("click", function() { return CheckForChecks(document
.presc
.check_list
); });
302 $(".editscript").on("click", function() { ShowScript(this); });
303 $(".onescript").on("mouseover", function() { $(this).children().toggleClass("highlight"); });
304 $(".onescript").on("mouseout", function() { $(this).children().toggleClass("highlight"); });
307 var ShowScript = function(eObj
) {
308 top
.restoreSession();
310 document
.location
.href
="{$GLOBALS.webroot}/controller.php?prescription&edit&id=" + encodeURIComponent(objID
);