3 {php}html_header_show();{/php}
5 <script type=
"text/javascript">
6 // Only load jquery if not already closing. This page serves two purposes now,
7 // for entring of vitals and for graphing/trending previous vitals by being embedded
8 // in the interface/patient_file/encounter/trend_form.php page.
9 if (typeof jQuery
== 'undefined') {
10 document
.write("<script type='text/javascript' src='{/literal}{php}echo $GLOBALS['webroot'];{/php}{literal}/library/js/jquery.js'><\/script>")
13 <style type=
"text/css" title=
"mystyles" media=
"all">
19 border-right:
1px solid black;
24 border-right:
1px solid black;
26 background-color: #ccc;
30 background-color: #ccc;
33 background-color: #ccc;
34 border-bottom:
1px solid #ddd;
35 border-right:
1px solid #ddd;
39 border-collapse: collapse;
55 <body bgcolor=
"{$STYLE.BGCOLOR2}">
56 <p><table><tr><td><span class=
"title">{xl
t=
"Vitals"}
</span></td><td> <a href=
"../summary/demographics.php" class=
"readonly css_button_small" onclick=
"top.restoreSession()"> <span>{xl
t=
"View Patient"}
</span></a></td></tr></table></p>
57 <form name=
"vitals" method=
"post" action=
"{$FORM_ACTION}/interface/forms/vitals/save.php" onSubmit=
"return top.restoreSession()">
58 <div id=
"chart"></div>
60 <tr><th align=
"left">{xl
t=
"Name"}
</th><th align=
"left">{xl
t=
"Unit"}
</th>
61 <th class='currentvalues'
>{$vitals-
>get_date()|date_format:
"%m/%d/%Y<br>%H:%M:%S"}
</th>
62 {foreach item=result from=$results}
63 <th class='historicalvalues'
>{$result.date|date_format:
"%m/%d/%Y<br>%H:%M:%S"}
</th>
66 {if $units_of_measurement ==
4}
<tr class=
"hide">{else}
<tr>{/if}
67 {if $units_of_measurement ==
2}
<td class=
"unfocus graph" id=
"weight">{else}
<td class=
"graph" id=
"weight">{/if}{xl
t=
"Weight"}
</td>
68 {if $units_of_measurement ==
2}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"lbs"}
</td>
69 {if $units_of_measurement ==
2}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
70 <input type=
"text" size='
5' name='weight' id='weight_input'
value=
"{if $vitals->get_weight() != 0}{$vitals->get_weight()}{/if}" onChange=
"convLbtoKg('weight_input');"/>
72 {foreach item=result from=$results}
73 <td class='historicalvalues'
>{if $result.weight !=
0}{$result.weight}{/if}
</td>
76 {if $units_of_measurement ==
3}
<tr class=
"hide">{else}
<tr>{/if}
77 {if $units_of_measurement ==
1}
<td class=
"unfocus graph" id=
"weight_metric">{else}
<td class=
"graph" id=
"weight_metric">{/if}{xl
t=
"Weight"}
</td>
78 {if $units_of_measurement ==
1}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"kg"}
</td>
79 {if $units_of_measurement ==
1}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
80 <input type=
"text" size='
5' id='weight_input_metric'
value=
"{if $vitals->get_weight() != 0}{math equation="number * constant
" number=$vitals->get_weight() constant=0.45359237 format="%
.2f
"}{/if}" onChange=
"convKgtoLb('weight_input');"/>
82 {foreach item=result from=$results}
83 <td class='historicalvalues'
>{if $result.weight !=
0}{math
equation=
"number * constant" number=$result.weight constant=
0.45359237 format=
"%.2f"}{/if}
</td>
86 {if $units_of_measurement ==
4}
<tr class=
"hide">{else}
<tr>{/if}
87 {if $units_of_measurement ==
2}
<td class=
"unfocus graph" id=
"height">{else}
<td class=
"graph" id=
"height">{/if}{xl
t=
"Height"}
</td>
88 {if $units_of_measurement ==
2}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"in"}
</td>
89 {if $units_of_measurement ==
2}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
90 <input type=
"text" size='
5' name='height' id='height_input'
value=
"{if $vitals->get_height() != 0}{$vitals->get_height()}{/if}" onChange=
"convIntoCm('height_input');"/>
92 {foreach item=result from=$results}
93 <td class='historicalvalues'
>{if $result.height !=
0}{$result.height}{/if}
</td>
96 {if $units_of_measurement ==
3}
<tr class=
"hide">{else}
<tr>{/if}
97 {if $units_of_measurement ==
1}
<td class=
"unfocus graph" id=
"height_metric">{else}
<td class=
"graph" id=
"height_metric">{/if}{xl
t=
"Height"}
</td>
98 {if $units_of_measurement ==
1}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"cm"}
</td>
99 {if $units_of_measurement ==
1}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
100 <input type=
"text" size='
5' id='height_input_metric'
value=
"{if $vitals->get_height() != 0}{math equation="number * constant
" number=$vitals->get_height() constant=2.54 format="%
.2f
"}{/if}" onChange=
"convCmtoIn('height_input');"/>
102 {foreach item=result from=$results}
103 <td class='historicalvalues'
>{if $result.height !=
0}{math
equation=
"number * constant" number=$result.height constant=
2.54 format=
"%.2f"}{/if}
</td>
106 <tr><td class=
"graph" id=
"bps">{xl
t=
"BP Systolic"}
</td><td>{xl
t=
"mm/hg"}
</td>
107 <td class='currentvalues'
><input type=
"text" size='
5'
108 name='bps' id='bps_input'
value=
"{$vitals->get_bps()}"/></td>
109 {foreach item=result from=$results}
110 <td class='historicalvalues'
>{$result.bps}
</td>
112 <tr><td class=
"graph" id=
"bpd">{xl
t=
"BP Diastolic"}
</td><td>{xl
t=
"mm/hg"}
</td>
113 <td class='currentvalues'
><input type=
"text" size='
5'
114 name='bpd' id='bpd_input'
value=
"{$vitals->get_bpd()}"/></td>
115 {foreach item=result from=$results}
116 <td class='historicalvalues'
>{$result.bpd}
</td>
118 <tr><td class=
"graph" id=
"pulse">{xl
t=
"Pulse"}
</td><td>{xl
t=
"per min"}
</td>
119 <td class='currentvalues'
><input type=
"text" size='
5'
120 name='pulse' id='pulse_input'
value=
"{if $vitals->get_pulse() != 0}{$vitals->get_pulse()|string_format:"%
.0f
"}{/if}"/></td>
121 {foreach item=result from=$results}
122 <td class='historicalvalues'
>{if $result.pulse !=
0}{$result.pulse|string_format:
"%.0f"}{/if}
</td>
124 <tr><td class=
"graph" id=
"respiration">{xl
t=
"Respiration"}
</td><td>{xl
t=
"per min"}
</td>
125 <td class='currentvalues'
><input type=
"text" size='
5'
126 name='respiration' id='respiration_input'
value=
"{if $vitals->get_respiration() != 0}{$vitals->get_respiration()|string_format:"%
.0f
"}{/if}"/></td>
127 {foreach item=result from=$results}
128 <td class='historicalvalues'
>{if $result.respiration !=
0}{$result.respiration|string_format:
"%.0f"}{/if}
</td>
131 {if $units_of_measurement ==
4}
<tr class=
"hide">{else}
<tr>{/if}
132 {if $units_of_measurement ==
2}
<td class=
"unfocus graph" id=
"temperature">{else}
<td class=
"graph" id=
"temperature">{/if}{xl
t=
"Temperature"}
</td>
133 {if $units_of_measurement ==
2}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"F"}
</td>
134 {if $units_of_measurement ==
2}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
135 <input type=
"text" size='
5' name='temperature' id='temperature_input'
value=
"{if $vitals->get_temperature() != 0}{$vitals->get_temperature()}{/if}" onChange=
"convFtoC('temperature_input');"/>
137 {foreach item=result from=$results}
138 <td class='historicalvalues'
>{if $result.temperature !=
0}{$result.temperature}{/if}
</td>
141 {if $units_of_measurement ==
3}
<tr class=
"hide">{else}
<tr>{/if}
142 {if $units_of_measurement ==
1}
<td class=
"unfocus graph" id=
"temperature_metric">{else}
<td class=
"graph" id=
"temperature_metric">{/if}{xl
t=
"Temperature"}
</td>
143 {if $units_of_measurement ==
1}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"C"}
</td>
144 {if $units_of_measurement ==
1}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
145 <input type=
"text" size='
5' id='temperature_input_metric'
value=
"{if $vitals->get_temperature() != 0}{math equation="(number - constant2 ) * constant
" number=$vitals->get_temperature() constant=0.5556 constant2=32 format="%
.2f
"}{/if}" onChange=
"convCtoF('temperature_input');"/>
147 {foreach item=result from=$results}
148 <td class='historicalvalues'
>{if $result.temperature !=
0}{math
equation=
"(number - constant2 ) * constant" number=$result.temperature constant=
0.5556 constant2=
32 format=
"%.2f"}{/if}
</td>
151 <tr><td>{xl
t=
"Temp Location"}
<td></td></td>
152 <td class='currentvalues'
><select name=
"temp_method" id='temp_method'
/><option value=
""> </option>
153 <option value=
"Oral" {if $vitals-
>get_temp_method() ==
"Oral" || $vitals-
>get_temp_method() ==
2 } selected{/if}
>{xl
t=
"Oral"}
154 <option value=
"Tympanic Membrane" {if $vitals-
>get_temp_method() ==
"Tympanic Membrane" || $vitals-
>get_temp_method() ==
1 } selected{/if}
>{xl
t=
"Tympanic Membrane"}
155 <option value=
"Rectal" {if $vitals-
>get_temp_method() ==
"Rectal" || $vitals-
>get_temp_method() ==
3 } selected{/if}
>{xl
t=
"Rectal"}
156 <option value=
"Axillary" {if $vitals-
>get_temp_method() ==
"Axillary" || $vitals-
>get_temp_method() ==
4 } selected{/if}
>{xl
t=
"Axillary"}
157 <option value=
"Temporal Artery" {if $vitals-
>get_temp_method() ==
"Temporal Artery" } selected{/if}
>{xl
t=
"Temporal Artery"}
159 {foreach item=result from=$results}
160 <td class='historicalvalues'
>{if $result.temp_method}{xl t=$result.temp_method}{/if}
</td>
163 <tr><td class=
"graph" id=
"oxygen_saturation">{xl
t=
"Oxygen Saturation"}
</td><td>{xl
t=
"%"}
</td>
164 <td class='currentvalues'
><input type=
"text" size='
5'
165 name='oxygen_saturation' id='oxygen_saturation_input'
value=
"{if $vitals->get_oxygen_saturation() != 0}{$vitals->get_oxygen_saturation()|string_format:"%
.0f
"}{/if}"/></td>
166 {foreach item=result from=$results}
167 <td class='historicalvalues'
>{if $result.oxygen_saturation !=
0}{$result.oxygen_saturation|string_format:
"%.0f"}{/if}
</td>
170 {if $units_of_measurement ==
4}
<tr class=
"hide">{else}
<tr>{/if}
171 {if $units_of_measurement ==
2}
<td class=
"unfocus graph" id=
"head_circ">{else}
<td class=
"graph" id=
"head_circ">{/if}{xl
t=
"Head Circumference"}
</td>
172 {if $units_of_measurement ==
2}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"in"}
</td>
173 {if $units_of_measurement ==
2}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
174 <input type=
"text" size='
5' name='head_circ' id='head_circ_input'
value=
"{if $vitals->get_head_circ() != 0}{$vitals->get_head_circ()}{/if}" onChange=
"convIntoCm('head_circ_input');"/>
176 {foreach item=result from=$results}
177 <td class='historicalvalues'
>{if $result.head_circ !=
0}{$result.head_circ}{/if}
</td>
180 {if $units_of_measurement ==
3}
<tr class=
"hide">{else}
<tr>{/if}
181 {if $units_of_measurement ==
1}
<td class=
"unfocus graph" id=
"head_circ_metric">{else}
<td class=
"graph" id=
"head_circ_metric">{/if}{xl
t=
"Head Circumference"}
</td>
182 {if $units_of_measurement ==
1}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"cm"}
</td>
183 {if $units_of_measurement ==
1}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
184 <input type=
"text" size='
5' id='head_circ_input_metric'
value=
"{if $vitals->get_head_circ() != 0}{math equation="number * constant
" number=$vitals->get_head_circ() constant=2.54 format="%
.2f
"}{/if}" onChange=
"convCmtoIn('head_circ_input');"/>
186 {foreach item=result from=$results}
187 <td class='historicalvalues'
>{if $result.head_circ !=
0}{math
equation=
"number * constant" number=$result.head_circ constant=
2.54 format=
"%.2f"}{/if}
</td>
190 {if $units_of_measurement ==
4}
<tr class=
"hide">{else}
<tr>{/if}
191 {if $units_of_measurement ==
2}
<td class=
"unfocus graph" id=
"waist_circ">{else}
<td class=
"graph" id=
"waist_circ">{/if}{xl
t=
"Waist Circumference"}
</td>
192 {if $units_of_measurement ==
2}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"in"}
</td>
193 {if $units_of_measurement ==
2}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
194 <input type=
"text" size='
5' name='waist_circ' id='waist_circ_input'
value=
"{if $vitals->get_waist_circ() != 0}{$vitals->get_waist_circ()}{/if}" onChange=
"convIntoCm('waist_circ_input');"/>
196 {foreach item=result from=$results}
197 <td class='historicalvalues'
>{if $result.waist_circ !=
0}{$result.waist_circ}{/if}
</td>
200 {if $units_of_measurement ==
3}
<tr class=
"hide">{else}
<tr>{/if}
201 {if $units_of_measurement ==
1}
<td class=
"unfocus graph" id=
"waist_circ_metric">{else}
<td class=
"graph" id=
"waist_circ_metric">{/if}{xl
t=
"Waist Circumference"}
</td>
202 {if $units_of_measurement ==
1}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"cm"}
</td>
203 {if $units_of_measurement ==
1}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
204 <input type=
"text" size='
5' id='waist_circ_input_metric'
value=
"{if $vitals->get_waist_circ() != 0}{math equation="number * constant
" number=$vitals->get_waist_circ() constant=2.54 format="%
.2f
"}{/if}" onChange=
"convCmtoIn('waist_circ_input');"/>
206 {foreach item=result from=$results}
207 <td class='historicalvalues'
>{if $result.waist_circ !=
0}{math
equation=
"number * constant" number=$result.waist_circ constant=
2.54 format=
"%.2f"}{/if}
</td>
210 <tr><td class=
"graph" id=
"BMI">{xl
t=
"BMI"}
</td><td>{xl
t=
"kg/m^2"}
</td>
211 <td class='currentvalues'
><input type=
"text" size='
5'
212 name='BMI' id='BMI_input'
value=
"{if $vitals->get_BMI() != 0}{$vitals->get_BMI()|substr:0:5}{/if}"/></td>
213 {foreach item=result from=$results}
214 <td class='historicalvalues'
>{if $result.BMI !=
0}{$result.BMI|substr:
0:
5}{/if}
</td>
217 <tr><td>{xl
t=
"BMI Status"}
</td><td>{xl
t=
"Type"}
</td>
218 <td class='currentvalues'
><input type=
"text" size='
15'
219 name=
"BMI_status" id=
"BMI_status' value="{$vitals-
>get_BMI_status()}
"/></td>
220 {foreach item=result from=$results}
221 <td class='historicalvalues'>{if $result.BMI_status}{xl t=$result.BMI_status}{/if}</td>
225 <tr><td>{xl t="Other Notes
"}<td></td></td>
226 <td class='currentvalues'><input type="text
" size='20'
227 name="note
" id='note' value="{$vitals-
>get_note()}
" /></td>
228 {foreach item=result from=$results}
229 <td class='historicalvalues'>{$result.note}</td>
233 <td colspan='3' style='text-align:center'>
234 {if $patient_age <= 20 || (preg_match('/month/', $patient_age))}
235 <!-- only show growth-chart button for patients < 20 years old -->
236 <!-- <input type="button
" id="growthchart
" value="{xl
t=
"Growth-Chart"}
" style='margin-left: 20px;'> -->
237 <input type="button
" id="pdfchart
" value="{xl
t=
"Growth-Chart"} ({xl
t=
"PDF"})
" style='margin-left: 20px;'>
238 <input type="button
" id="htmlchart
" value="{xl
t=
"Growth-Chart"} ({xl
t=
"HTML"})
" style='margin-left: 20px;'>
242 <tr><td colspan='3' style='text-align:center'> </td></tr>
244 <td colspan='3' style='text-align:center'>
245 <input type="submit
" class="editonly
" name="Submit
" value="{xl
t=
"Save Form"}
">
246 <input type="button
" class="editonly
" id="cancel
" value="{xl
t=
"Don't Save"}
">
251 <input type="hidden
" name="id
" id='id' value="{$vitals-
>get_id()}
" />
252 <input type="hidden
" name="activity
" id='activity' value="{$vitals-
>get_activity()}
">
253 <input type="hidden
" name="pid
" id='pid' value="{$vitals-
>get_pid()}
">
254 <input type="hidden
" name="process
" id='process' value="true
">
258 <script language="javascript
">
259 var formdate = '{$vitals->get_date()|date_format:"%Y
%m
%d
"}';
260 // vitals array elements are in the format:
261 // date-height-weight-head_circumference
262 var vitals = new Array();
263 // get values from the current form elements
264 vitals[0] = formdate+'-{$vitals->get_height()}-{$vitals->get_weight()}-{$vitals->get_head_circ()}';
266 {foreach item=result from=$results}
267 vitals[vitals.length] = '{$result.date|date_format:"%Y
%m
%d
"}-{$result.height}-{$result.weight}-{$result.head_circ}';
269 var webroot = '{$FORM_ACTION}';
270 var pid = '{$vitals->get_pid()}';
271 var cancellink = '{$DONT_SAVE_LINK}';
274 $(document).ready(function(){
275 $("#growthchart
").click(function() { ShowGrowthchart(); });
276 $("#pdfchart
").click(function() { ShowGrowthchart(1); });
277 $("#htmlchart
").click(function() { ShowGrowthchart(2); });
278 $("#cancel
").click(function() { location.href=cancellink; });
281 function ShowGrowthchart(doPDF) {
282 // get values from the current form elements
284 vitals[0] = formdate+'-'+$("#height_input
").val()+'-'+$("#weight_input
").val()+'-'+$("#head_circ_input
").val();
286 // build the data string
288 for(var i=0; i<vitals.length; i++) {
289 datastring += vitals[i]+"~";
291 newURL = webroot+'/interface/forms/vitals/growthchart/chart.php?pid='+pid+'&data='+datastring;
292 if (doPDF == 1) newURL += "&pdf
=1";
293 if (doPDF == 2) newURL += "&html
=1";
294 // do the new window stuff
295 top.restoreSession();
296 window.open(newURL, '_blank', "menubar
=1,toolbar
=1,scrollbars
=1,resizable
=1,width
=600,height
=450");
299 function convLbtoKg(name) {
300 var lb = $("#"+name).val();
303 $("#"+name+"_metric
").val("0");
305 else if (lb == parseFloat(lb)) {
308 $("#"+name+"_metric
").val(kg);
311 $("#"+name+"_metric
").val("");
314 if (name == "weight
") {
319 function convKgtoLb(name) {
320 var kg = $("#"+name+"_metric
").val();
323 $("#"+name).val("0");
325 else if (kg == parseFloat(kg)) {
334 if (name == "weight_input
") {
339 function convIntoCm(name) {
340 var inch = $("#"+name).val();
343 $("#"+name+"_metric
").val("0");
345 else if (inch == parseFloat(inch)) {
348 $("#"+name+"_metric
").val(cm);
351 $("#"+name+"_metric
").val("");
354 if (name == "height_input
") {
359 function convCmtoIn(name) {
360 var cm = $("#"+name+"_metric
").val();
363 $("#"+name).val("0");
365 else if (cm == parseFloat(cm)) {
367 inch = inch.toFixed(2);
368 $("#"+name).val(inch);
374 if (name == "height_input
") {
379 function convFtoC(name) {
380 var Fdeg = $("#"+name).val();
382 $("#"+name+"_metric
").val("0");
384 else if (Fdeg == parseFloat(Fdeg)) {
385 Cdeg = (Fdeg-32)*0.5556;
386 Cdeg = Cdeg.toFixed(2);
387 $("#"+name+"_metric
").val(Cdeg);
390 $("#"+name+"_metric
").val("");
394 function convCtoF(name) {
395 var Cdeg = $("#"+name+"_metric
").val();
397 $("#"+name).val("0");
399 else if (Cdeg == parseFloat(Cdeg)) {
400 Fdeg = (Cdeg/0.5556)+32;
401 Fdeg = Fdeg.toFixed(2);
402 $("#"+name).val(Fdeg);
409 function calculateBMI() {
411 var height = $("#height_input
").val();
412 var weight = $("#weight_input
").val();
413 if(height == 0 || weight == 0) {
416 else if((height == parseFloat(height)) && (weight == parseFloat(weight))) {
417 bmi = weight/height/height*703;
418 bmi = bmi.toFixed(1);
419 $("#BMI_input
").val(bmi);
422 $("#BMI_input
").val("");