3 {php}html_header_show();{/php}
5 <link rel=
"stylesheet" href=
"{php}echo $GLOBALS['css_header']; {/php}" type=
"text/css">
6 <link rel=
"stylesheet" href=
"{$WEBROOT}/interface/themes/jquery.autocomplete.css" type=
"text/css">
8 <script type=
"text/javascript" src=
"{$WEBROOT}/library/dialog.js"></script>
9 <script type=
"text/javascript" src=
"{$WEBROOT}/library/js/jquery-1.2.2.min.js"></script>
10 <script type=
"text/javascript" src=
"{$WEBROOT}/library/js/jquery.bgiframe.min.js"></script>
11 <script type=
"text/javascript" src=
"{$WEBROOT}/library/js/jquery.dimensions.pack.js"></script>
12 <script type=
"text/javascript" src=
"{$WEBROOT}/library/js/jquery.autocomplete.pack.js"></script>
14 <style type=
"text/css" title=
"mystyles" media=
"all">
18 font-family:helvetica;
22 font-family:helvetica;
26 font-family:helvetica;
30 font-family:helvetica;
34 <script language='JavaScript'
>
36 // This holds all the default drug attributes.
38 var drugopts
= [{$DRUG_ATTRIBUTES
}];
41 // Helper to choose an option from its value.
42 function selchoose(sel
, value
) {
44 for (i
= 0; i
< o
.length
; ++i
) {
45 o
[i
].selected
= (o
[i
].value
== value
);
49 // Fill in default values when a drop-down drug is selected.
50 function drugselected(sel
) {
51 var f
= document
.forms
[0];
52 var i
= f
.drug_id
.selectedIndex
- 1;
56 selchoose(f
.form
, d
[1]);
57 f
.dosage
.value
= d
[2];
59 selchoose(f
.unit
, d
[4]);
60 selchoose(f
.route
, d
[5]);
61 selchoose(f
.interval
, d
[6]);
62 selchoose(f
.substitute
, d
[7]);
63 f
.quantity
.value
= d
[8];
64 f
.disp_quantity
.value
= d
[8];
65 selchoose(f
.refills
, d
[9]);
66 f
.per_refill
.value
= d
[10];
70 // Invoke the popup to dispense a drug.
72 var f
= document
.forms
[0];
73 dlgopen('interface/drugs/dispense_drug.php' +
74 {/literal
}'?drug_id={$prescription->get_drug_id()}' +{literal
}
75 '&prescription=' + f
.id
.value
+
76 '&quantity=' + f
.disp_quantity
.value
+
77 '&fee=' + f
.disp_fee
.value
,
81 function quantityChanged() {
82 var f
= document
.forms
[0];
83 f
.per_refill
.value
= f
.quantity
.value
;
84 if (f
.disp_quantity
) {
85 f
.disp_quantity
.value
= f
.quantity
.value
;
92 <body {$STYLE.BOTTOM_BG_LINE}
>
93 <form name=
"prescribe" id=
"prescribe" method=
"post" action=
"{$FORM_ACTION}">
94 <table CELLSPACING=
"0" CELLPADDING=
"3">
96 <td COLSPAN=
"1" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >{xl t='Currently Active'}
</td>
97 <td COLSPAN=
"2" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >
98 <input type=
"checkbox" name=
"active" value=
"1"{if $prescription-
>get_active()
> 0} checked{/if}
/>
102 <td COLSPAN=
"1" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >{xl t='Starting Date'}
</td>
103 <td COLSPAN=
"2" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >
104 {html_select_date
start_year=
"-10" end_year=
"+5" time=$prescription-
>start_date
prefix=
"start_date_"}
108 <td COLSPAN=
"1" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >{xl t='Provider'}
</td>
109 <td COLSPAN=
"2" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >
110 {html_options
name=
"provider_id" options=$prescription-
>provider-
>utility_provider_array() selected=$prescription-
>provider-
>get_id()}
111 <input type=
"hidden" name=
"patient_id" value=
"{$prescription->patient->id}" />
116 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >Patient Name</td>
117 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >{$prescription->patient->get_name_display()}</td>
121 <td COLSPAN=
"1" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >{xl t='Drug'}
</td>
122 <td COLSPAN=
"2" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >
123 <input type=
"input" size=
"20" name=
"drug" id=
"drug" value=
"{$prescription->drug}"/>
124 <input id=
"druglookup" class=
"button" type=
"BUTTON" value=
"Drug Lookup"/>
128 {if $DRUG_ARRAY_VALUES}
130 <td COLSPAN=
"1" ALIGN=
"LEFT" VALIGN=
"MIDDLE" > {xl t='in-house'}
</td>
131 <td COLSPAN=
"2" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >
132 <select name=
"drug_id" onchange=
"drugselected(this)">
133 {html_options values=$DRUG_ARRAY_VALUES output=$DRUG_ARRAY_OUTPUT}
140 <td COLSPAN=
"1" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >{xl t='Quantity'}
</td>
141 <td COLSPAN=
"2" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >
142 <input TYPE=
"TEXT" NAME=
"quantity" id=
"quantity" SIZE=
"10" MAXLENGTH=
"31"
143 VALUE=
"{$prescription->quantity}"
144 onchange=
"quantityChanged()" />
147 {if $SIMPLIFIED_PRESCRIPTIONS && !$prescription-
>size}
148 <tr style='display:none;'
>
152 <td COLSPAN=
"1" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >{xl t='Medicine Units'}
</td>
153 <td COLSPAN=
"2" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >
154 <input TYPE=
"TEXT" NAME=
"size" id=
"size" SIZE=
"11" MAXLENGTH=
"10" VALUE=
"{$prescription->size}"/>
155 <select name=
"unit" id=
"unit">{html_options options=$prescription-
>unit_array selected=$prescription-
>unit}
</select>
159 <td COLSPAN=
"1" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >{xl t='Take'}
</td>
160 <td COLSPAN=
"2" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >
161 {if $SIMPLIFIED_PRESCRIPTIONS && !$prescription-
>form && !$prescription-
>route && !$prescription-
>interval}
162 <input TYPE=
"text" NAME=
"dosage" id=
"dosage" SIZE=
"30" MAXLENGTH=
"100" VALUE=
"{$prescription->dosage}" />
163 <input type=
"hidden" name=
"form" id=
"form" value=
"0" />
164 <input type=
"hidden" name=
"route" id=
"route" value=
"0" />
165 <input type=
"hidden" name=
"interval" id=
"interval" value=
"0" />
167 <input TYPE=
"TEXT" NAME=
"dosage" id=
"dosage" SIZE=
"2" MAXLENGTH=
"10" VALUE=
"{$prescription->dosage}"/> {xl t='in'}
168 <select name=
"form" id=
"form">{html_options options=$prescription-
>form_array selected=$prescription-
>form}
</select>
169 <select name=
"route" id=
"route">{html_options options=$prescription-
>route_array selected=$prescription-
>route}
</select>
170 <select name=
"interval" id=
"interval">{html_options options=$prescription-
>interval_array selected=$prescription-
>interval}
</select>
175 <td COLSPAN=
"1" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >{xl t='Refills'}
</td>
176 <td COLSPAN=
"2" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >
177 {html_options
name=
"refills" options=$prescription-
>refills_array selected=$prescription-
>refills}
178 {if $SIMPLIFIED_PRESCRIPTIONS}
179 <input TYPE=
"hidden" ID=
"per_refill" NAME=
"per_refill" VALUE=
"{$prescription->per_refill}" />
181 # {xl t='of tablets'}:
182 <input TYPE=
"TEXT" ID=
"per_refill" NAME=
"per_refill" SIZE=
"2" MAXLENGTH=
"10" VALUE=
"{$prescription->per_refill}" />
188 <td COLSPAN="1" ALIGN="LEFT" VALIGN="MIDDLE" >{xl t='Substitution'}</td>
189 <td COLSPAN="2" ALIGN="LEFT" VALIGN="MIDDLE" >
190 {html_options name="substitute" options=$prescription->substitute_array selected=$prescription->substitute}
195 <td COLSPAN=
"1" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >{xl t='Notes'}
</td>
196 <td COLSPAN=
"2" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >
197 <textarea name=
"note" cols=
"30" rows=
"2" wrap=
"virtual">{$prescription-
>note}
</textarea>
201 {if $WEIGHT_LOSS_CLINIC}
202 <td COLSPAN=
"1" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >{xl t='Substitution'}
</td>
203 <td COLSPAN=
"2" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >
204 {html_options
name=
"substitute" options=$prescription-
>substitute_array selected=$prescription-
>substitute}
207 <td COLSPAN=
"1" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >{xl t='Add to Medication List'}
</td>
208 <td COLSPAN=
"2" ALIGN=
"LEFT" VALIGN=
"MIDDLE" >
209 {html_radios
name=
"medication" options=$prescription-
>medication_array selected=$prescription-
>medication}
211 {html_options
name=
"substitute" options=$prescription-
>substitute_array selected=$prescription-
>substitute}
217 <input type=
"submit" value=
"{xl t='Save'}" />
218 {if $DRUG_ARRAY_VALUES}
219
220 {if $prescription-
>get_refills()
>= $prescription-
>get_dispensation_count()}
221 <input type=
"submit" name=
"disp_button" value=
"{xl t='Save and Dispense'}" />
222 <input type=
"text" name=
"disp_quantity" size=
"2" maxlength=
"10" value=
"{$DISP_QUANTITY}" />
224 <input type=
"text" name=
"disp_fee" size=
"5" maxlength=
"10" value=
"{$DISP_FEE}" />
226 {xl t=' prescription has reached its limit of'} {$prescription-
>get_refills()} {xl t='refills'}.
232 <input type=
"hidden" name=
"id" value=
"{$prescription->id}" />
233 <input type=
"hidden" name=
"process" value=
"{$PROCESS}" />
234 <script language='JavaScript'
>
241 <!-- for the fancy jQuery stuff -->
242 <script type=
"text/javascript">
243 $().ready(function() {
244 $("#drug").autocomplete('library/ajax/prescription_drugname_lookup.php',
251 $("#prescribe").submit(function() { return CheckForErrors(this) });
252 $("#druglookup").click(function() { DoDrugLookup(this) });
256 // pop up a drug lookup window with the value of the drug name, if we have one
257 function DoDrugLookup(eObj
) {
259 if ($('#drug').val() != "") { drugname
= $('#drug').val(); }
260 drugPopup
= window
.open('controller.php?prescription&lookup&drug='+drugname
, 'drugPopup', 'width=400,height=50,menubar=no,titlebar=no,left = 825,top = 400');
261 drugPopup
.opener
= self
;
266 // check the form for required fields before submitting
267 var CheckForErrors = function(eObj
) {
269 if (CheckRequired('drug') == false) { return false; }
270 //if (CheckRequired('quantity') == false) { return false; }
271 //if (CheckRequired('unit') == false) { return false; }
272 //if (CheckRequired('size') == false) { return false; }
273 //if (CheckRequired('dosage') == false) { return false; }
274 //if (CheckRequired('form') == false) { return false; }
275 //if (CheckRequired('route') == false) { return false; }
276 //if (CheckRequired('interval') == false) { return false; }
278 return top
.restoreSession();
281 function CheckRequired(objID
) {
284 if ($('#'+objID
).is('text')) {
285 if ($('#'+objID
).val() == "") {
286 alert("Missing a required field");
287 $('#'+objID
).css("backgroundColor", "pink");
293 if ($('#'+objID
).is('select')) {
294 if ($('#'+objID
).val() == "0") {
295 alert("Missing a required field");
296 $('#'+objID
).css("backgroundColor", "pink");