Style fixes (Mainly RTL) (#1846)
[openemr.git] / templates / prescription / general_list.html
blob96ab00d7cb6ac07b2fca7ebceb1c02c154acce27
1 {**
2 * Prescription list
4 * @package OpenEMR
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
9 *}
10 <html>
11 <head>
13 {headerShow}
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>
18 {literal}
19 <style type="text/css" title="mystyles" media="all">
20 .inactive {
21 color:#777777;
23 </style>
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);
47 return false;
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 = '';
62 function Check(chk) {
63 var len=chk.length;
64 if (len==undefined) {chk.checked=true;}
65 else {
66 for (pr = 0; pr < chk.length; pr++){
67 if($(chk[pr]).parents("tr.inactive").length==0)
69 chk[pr].checked=true;
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) {
79 var len=chk.length;
80 if (len==undefined) {chk.checked=false;}
81 else {
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) {
98 var len=chk.length;
99 var foundone=false;
101 if (len==undefined) {
102 if (chk.checked == true){
103 foundone=true;
106 else {
107 for (pr = 0; pr < chk.length; pr++){
108 if (chk[pr].checked == true) {
109 foundone=true;
113 if (foundone) {
114 return true;
115 } else {
116 alert("{/literal}{xl t='Please select at least one prescription!'}{literal}");
117 return false;
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);
129 </script>
131 {/literal}
132 </head>
133 <body id="prescription_list" class="body_top">
135 {if $prescriptions}
136 <span class="title"><b>{xl t='List'|escape:'html'}</b></span>
138 <div id="prescription_list">
140 <form name="presc">
142 <div id="print_links">
143 <table width="100%">
144 <tr>
145 <td align="left">
146 <table>
147 <tr>
148 <td>
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>
151 {else}
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>
153 {/if}
154 </td>
155 <td>
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>
158 {else}
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>
161 {/if}
162 </td>
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>
166 </td>
167 {/if}
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>
171 </td>
172 {/if}
173 {if $CAMOS_FORM == true}
174 <td>
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>
176 </td>
177 {/if}
178 </tr>
179 </table>
180 </td>
181 <td align="right">
182 <table>
183 <tr>
184 <td>
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>
187 </td>
188 </tr>
189 </table>
190 </td>
191 </tr>
192 </table>
193 </div>
196 <table width="100%" class="showborder_head" cellspacing="0px" cellpadding="2px">
197 <tr>
198 <!-- TajEmo Changes 2012/06/14 02:01:43 PM by CB added Heading for checkbox column -->
199 <th width="8px">&nbsp;</th>
200 <th width="8px">&nbsp;</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>
214 {/if}
215 </tr>
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'}">
220 <td align="center">
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'}">
222 </td>
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}&nbsp;
229 </td>
230 <td class="editscript" id="{$prescription->id}">
231 {if $prescription->active > 0}<b>{/if}{$prescription->drug|escape:'html'}{if $prescription->active > 0}</b>{/if}&nbsp;
232 <br />{$prescription->note|escape:'html'}
233 </td>
234 {else}
235 <td>&nbsp;</td>
236 <td id="{$prescription->id}">
237 {if $prescription->active > 0}<b>{/if}{$prescription->drug|escape:'html'}{if $prescription->active > 0}</b>{/if}&nbsp;
238 <br />{$prescription->note|escape:'html'}
239 </td>
240 {/if}
241 <td id="{$prescription->id}">
242 {$prescription->rxnorm_drugcode|escape:'html'}&nbsp;
243 </td>
244 <td id="{$prescription->id}">
245 {$prescription->date_added|escape:'html'}<br />
246 {$prescription->date_modified|escape:'html'}&nbsp;
247 </td>
248 <td id="{$prescription->id}">
249 {$prescription->get_dosage_display()|escape:'html'} &nbsp;
250 </td>
251 {if $prescription->erx_source==0}
252 <td class="editscript" id="{$prescription->id}">
253 {$prescription->quantity|escape:'html'} &nbsp;
254 </td>
255 {else}
256 <td id="{$prescription->id}">
257 {$prescription->quantity|escape:'html'} &nbsp;
258 </td>
259 {/if}
260 <td id="{$prescription->id}">
261 {$prescription->get_size()|escape:'html'} {$prescription->get_unit_display()|escape:'html'}&nbsp;
262 </td>
263 <td id="{$prescription->id}">
264 {$prescription->refills|escape:'html'} &nbsp;
265 </td>
266 <td id="{$prescription->id}">
267 {$prescription->provider->get_name_display()|escape:'html'}&nbsp;
268 </td>
269 {if $GLOBALS.weno_rx_enable}
270 <td align="center">
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'}>
273 {/if}
274 </td>
275 <td align="center">
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'}>
278 {/if}
279 </td>
280 <td id="{$prescription->id|escape:'html'}" align="center">
281 {$prescription->txDate|escape:'html'}
282 </td>
283 {/if}
284 </tr>
285 {/foreach}
287 </table>
289 </form>
290 </div>
292 {else}
293 <div class="text" style="margin-top:10px">{xl t='There are currently no prescriptions'|escape:'html'}.</div>
294 {/if}
296 </body>
297 {literal}
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();
311 objID = eObj.id;
312 document.location.href="{/literal}{$GLOBALS.webroot}{literal}/controller.php?prescription&edit&id="+objID;
313 return true;
316 </script>
317 {/literal}
318 </html>