added ability to have inactive prescriptions
[openemr.git] / templates / prescription / general_edit.html
blobeef2062cdec2b83d5bc6b05b6051c20104a73020
1 <html>
2 <head>
3 {literal}
4 <style type="text/css" title="mystyles" media="all">
5 <!--
6 td {
7 font-size:8pt;
8 font-family:helvetica;
10 input {
11 font-size:8pt;
12 font-family:helvetica;
14 select {
15 font-size:8pt;
16 font-family:helvetica;
18 textarea {
19 font-size:8pt;
20 font-family:helvetica;
22 -->
23 </style>
24 <script type="text/javascript" src="library/dialog.js"></script>
25 <script language='JavaScript'>
27 // This holds all the default drug attributes.
28 {/literal}
29 var drugopts = [{$DRUG_ATTRIBUTES}];
30 {literal}
32 // Helper to choose an option from its value.
33 function selchoose(sel, value) {
34 var o = sel.options;
35 for (i = 0; i < o.length; ++i) {
36 o[i].selected = (o[i].value == value);
40 // Fill in default values when a drop-down drug is selected.
41 function drugselected(sel) {
42 var f = document.forms[0];
43 var i = f.drug_id.selectedIndex - 1;
44 if (i >= 0) {
45 var d = drugopts[i];
46 f.drug.value = d[0];
47 selchoose(f.form, d[1]);
48 f.dosage.value = d[2];
49 f.size.value = d[3];
50 selchoose(f.unit, d[4]);
51 selchoose(f.route, d[5]);
52 selchoose(f.interval, d[6]);
53 selchoose(f.substitute, d[7]);
54 f.quantity.value = d[8];
55 f.disp_quantity.value = d[8];
56 selchoose(f.refills, d[9]);
57 f.per_refill.value = d[10];
61 // Invoke the popup to dispense a drug.
62 function dispense() {
63 var f = document.forms[0];
64 dlgopen('interface/drugs/dispense_drug.php' +
65 {/literal}'?drug_id={$prescription->get_drug_id()}' +{literal}
66 '&prescription=' + f.id.value +
67 '&quantity=' + f.disp_quantity.value +
68 '&fee=' + f.disp_fee.value,
69 '_blank', 400, 200);
72 function quantityChanged() {
73 var f = document.forms[0];
74 f.per_refill.value = f.quantity.value;
75 if (f.disp_quantity) {
76 f.disp_quantity.value = f.quantity.value;
80 </script>
81 {/literal}
82 </head>
83 <body {$STYLE.BOTTOM_BG_LINE}>
84 <form name="prescribe" method="post" action="{$FORM_ACTION}" onsubmit="return top.restoreSession()">
85 <table CELLSPACING="0" CELLPADDING="3">
86 <tr>
87 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >{xl t='Currently Active'}</td>
88 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
89 <input type="checkbox" name="active" value="1"{if $prescription->get_active() > 0} checked{/if} />
90 </td>
91 </tr>
92 <tr>
93 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >{xl t='Starting Date'}</td>
94 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
95 {html_select_date start_year="-10" end_year="+5" time=$prescription->start_date prefix="start_date_"}
96 </td>
97 </tr>
98 <tr>
99 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >{xl t='Provider'}</td>
100 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
101 {html_options name="provider_id" options=$prescription->provider->utility_provider_array() selected=$prescription->provider->get_id()}
102 <input type="hidden" name="patient_id" value="{$prescription->patient->id}" />
103 </td>
104 </tr>
105 <!--
106 <tr>
107 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >Patient Name</td>
108 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >{$prescription->patient->get_name_display()}</td>
109 </tr>
111 <tr>
112 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >{xl t='Drug'}</td>
113 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
114 <input type="input" size="20" name="drug" value="{$prescription->drug}"/><input class="button" type="BUTTON" onClick="drugPopup=window.open('controller.php?prescription&lookup', 'drugPopup', 'width=400,height=50,menubar=no,titlebar=no,left = 825,top = 400'); drugPopup.opener=self; return true;" value="Drug Lookup"/>
115 </td>
116 </tr>
118 {if $DRUG_ARRAY_VALUES}
119 <tr>
120 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >&nbsp; {xl t='in-house'}</td>
121 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
122 <select name="drug_id" onchange="drugselected(this)">
123 {html_options values=$DRUG_ARRAY_VALUES output=$DRUG_ARRAY_OUTPUT}
124 </select>
125 </td>
126 </tr>
127 {/if}
129 <tr>
130 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >{xl t='Quantity'}</td>
131 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
132 <input TYPE="TEXT" NAME="quantity" SIZE="10" MAXLENGTH="10"
133 VALUE="{$prescription->quantity}"
134 onchange="quantityChanged()" />
135 </td>
136 </tr>
137 {if $SIMPLIFIED_PRESCRIPTIONS && !$prescription->size}
138 <tr style='display:none;'>
139 {else}
140 <tr>
141 {/if}
142 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >{xl t='Medicine Units'}</td>
143 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
144 <input TYPE="TEXT" NAME="size" SIZE="11" MAXLENGTH="10" VALUE="{$prescription->size}"/>
145 <select name="unit">{html_options options=$prescription->unit_array selected=$prescription->unit}</select>
146 </td>
147 </tr>
148 <tr>
149 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >{xl t='Take'}</td>
150 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
151 {if $SIMPLIFIED_PRESCRIPTIONS && !$prescription->form && !$prescription->route && !$prescription->interval}
152 <input TYPE="text" NAME="dosage" SIZE="30" MAXLENGTH="100" VALUE="{$prescription->dosage}" />
153 <input type="hidden" name="form" value="0" />
154 <input type="hidden" name="route" value="0" />
155 <input type="hidden" name="interval" value="0" />
156 {else}
157 <input TYPE="TEXT" NAME="dosage" SIZE="2" MAXLENGTH="10" VALUE="{$prescription->dosage}"/> {xl t='in'}
158 <select name="form">{html_options options=$prescription->form_array selected=$prescription->form}</select>
159 <select name="route">{html_options options=$prescription->route_array selected=$prescription->route}</select>
160 <select name="interval">{html_options options=$prescription->interval_array selected=$prescription->interval}</select>
161 {/if}
162 </td>
163 </tr>
164 <tr>
165 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >{xl t='Refills'}</td>
166 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
167 {html_options name="refills" options=$prescription->refills_array selected=$prescription->refills}
168 {if $SIMPLIFIED_PRESCRIPTIONS}
169 <input TYPE="hidden" ID="per_refill" NAME="per_refill" VALUE="{$prescription->per_refill}" />
170 {else}
171 &nbsp; &nbsp; # {xl t='of tablets'}:
172 <input TYPE="TEXT" ID="per_refill" NAME="per_refill" SIZE="2" MAXLENGTH="10" VALUE="{$prescription->per_refill}" />
173 {/if}
174 </td>
175 </tr>
176 <!--
177 <tr>
178 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >{xl t='Substitution'}</td>
179 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
180 {html_options name="substitute" options=$prescription->substitute_array selected=$prescription->substitute}
181 </td>
182 </tr>
184 <tr>
185 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >{xl t='Notes'}</td>
186 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
187 <textarea name="note" cols="30" rows="2" wrap="virtual">{$prescription->note}</textarea>
188 </td>
189 </tr>
190 <tr>
191 {if $WEIGHT_LOSS_CLINIC}
192 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >{xl t='Substitution'}</td>
193 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
194 {html_options name="substitute" options=$prescription->substitute_array selected=$prescription->substitute}
195 </td>
196 {else}
197 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >{xl t='Add to Medication List'}</td>
198 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
199 {html_radios name="medication" options=$prescription->medication_array selected=$prescription->medication}
200 &nbsp; &nbsp;
201 {html_options name="substitute" options=$prescription->substitute_array selected=$prescription->substitute}
202 </td>
203 {/if}
204 </tr>
205 <tr>
206 <td colspan="3">
207 <input type="submit" value="{xl t='Save'}" />
208 {if $DRUG_ARRAY_VALUES}
209 &nbsp; &nbsp; &nbsp; &nbsp;
210 {if $prescription->get_refills() >= $prescription->get_dispensation_count()}
211 <input type="submit" name="disp_button" value="{xl t='Save and Dispense'}" />
212 <input type="text" name="disp_quantity" size="2" maxlength="10" value="{$DISP_QUANTITY}" />
213 units, $
214 <input type="text" name="disp_fee" size="5" maxlength="10" value="{$DISP_FEE}" />
215 {else}
216 {xl t=' prescription has reached its limit of'} {$prescription->get_refills()} {xl t='refills'}.
217 {/if}
218 {/if}
219 </td>
220 </tr>
221 </table>
222 <input type="hidden" name="id" value="{$prescription->id}" />
223 <input type="hidden" name="process" value="{$PROCESS}" />
224 <script language='JavaScript'>
225 {$ENDING_JAVASCRIPT}
226 </script>
227 </form>
228 </body>
229 </html>