refinements to drug database and dispensing
[openemr.git] / templates / prescription / general_edit.html
blob609040a5286cc28efca8ec31e697afdba7795dcc
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 '?drug_id=' + f.drug_id.value +
66 '&prescription=' + f.id.value +
67 '&quantity=' + f.disp_quantity.value +
68 '&fee=' + f.disp_fee.value,
69 '_blank', 400, 200);
72 </script>
73 {/literal}
74 </head>
75 <body {$STYLE.BOTTOM_BG_LINE}>
76 <form name="prescribe" method="post" action="{$FORM_ACTION}">
77 <table CELLSPACING="0" CELLPADDING="3">
78 <tr>
79 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >Starting Date</td>
80 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
81 {html_select_date start_year="-10" end_year="+5" time=$prescription->start_date prefix="start_date_"}
82 </td>
83 </tr>
84 <tr>
85 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >Provider</td>
86 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
87 {html_options name="provider_id" options=$prescription->provider->utility_provider_array() selected=$prescription->provider->get_id()}
88 <input type="hidden" name="patient_id" value="{$prescription->patient->id}" />
89 </td>
90 </tr>
91 <!--
92 <tr>
93 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >Patient Name</td>
94 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >{$prescription->patient->get_name_display()}</td>
95 </tr>
96 -->
97 <tr>
98 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >Drug</td>
99 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
100 <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"/>
101 </td>
102 </tr>
104 {if $DRUG_ARRAY}
105 <tr>
106 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >&nbsp; in-house</td>
107 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
108 <select name="drug_id" onchange="drugselected(this)">
109 {html_options options=$DRUG_ARRAY selected=$prescription->get_drug_id()}
110 </select>
111 </td>
112 </tr>
113 {/if}
115 <tr>
116 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >Quantity</td>
117 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
118 <input TYPE="TEXT" NAME="quantity" SIZE="2" MAXLENGTH="10" VALUE="{$prescription->quantity}"/>
119 </td>
120 </tr>
121 <tr>
122 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >Medicine Units</td>
123 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
124 <input TYPE="TEXT" NAME="size" SIZE="11" MAXLENGTH="10" VALUE="{$prescription->size}"/>
125 <select name="unit">{html_options options=$prescription->unit_array selected=$prescription->unit}</select>
126 </td>
127 </tr>
128 <tr>
129 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >Take</td>
130 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
131 <input TYPE="TEXT" NAME="dosage" SIZE="2" MAXLENGTH="10" VALUE="{$prescription->dosage}"/> in
132 <select name="form">{html_options options=$prescription->form_array selected=$prescription->form}</select>
133 <select name="route">{html_options options=$prescription->route_array selected=$prescription->route}</select>
134 <select name="interval">{html_options options=$prescription->interval_array selected=$prescription->interval}</select>
135 </td>
136 </tr>
137 <tr>
138 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >Refill</td>
139 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
140 {html_options name="refills" options=$prescription->refills_array selected=$prescription->refills}
141 <input TYPE="TEXT" NAME="per_refill" SIZE="2" MAXLENGTH="10" VALUE="{$prescription->per_refill}"/> units</td>
142 </tr>
143 <tr>
144 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >Substitution</td>
145 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
146 {html_options name="substitute" options=$prescription->substitute_array selected=$prescription->substitute}
147 </td>
148 </tr>
149 <tr>
150 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >Notes</td>
151 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
152 <textarea name="note" cols="30" rows="2" wrap="virtual">{$prescription->note}</textarea>
153 </td>
154 </tr>
155 <tr>
156 <td colspan="3">
157 <input type="submit" value="Prescribe" />
158 <!--
159 {if $DRUG_ARRAY}{if $prescription->id}
160 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
161 <input type="button" value="Dispense" onclick="dispense()" />
162 <input type="text" name="disp_quantity" size="2" maxlength="10" value="{$prescription->quantity}" />
163 units, $
164 <input type="text" name="disp_fee" size="5" maxlength="10" />
165 {/if}{/if}
167 {if $DRUG_ARRAY}
168 &nbsp; &nbsp; &nbsp; &nbsp;
169 <input type="submit" name="disp_button" value="Prescribe and Dispense" />
170 <input type="text" name="disp_quantity" size="2" maxlength="10" value="{$DISP_QUANTITY}" />
171 units, $
172 <input type="text" name="disp_fee" size="5" maxlength="10" value="{$DISP_FEE}" />
173 {/if}
174 </td>
175 </tr>
176 </table>
177 <input type="hidden" name="id" value="{$prescription->id}" />
178 <input type="hidden" name="process" value="{$PROCESS}" />
179 <script language='JavaScript'>
180 {$ENDING_JAVASCRIPT}
181 </script>
182 </form>
183 </body>
184 </html>