3 {php}html_header_show();{/php}
5 <style type=
"text/css">@import url
({$FORM_ACTION
}/library
/dynarch_calendar
.css
);</style>
6 <script type=
"text/javascript" src=
"{$FORM_ACTION}/library/dialog.js"></script>
7 <script type=
"text/javascript" src=
"{$FORM_ACTION}/library/textformat.js"></script>
8 <script type=
"text/javascript" src=
"{$FORM_ACTION}/library/dynarch_calendar.js"></script>
9 {php} include_once(
"{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); {/php}
10 <script type=
"text/javascript" src=
"{$FORM_ACTION}/library/dynarch_calendar_setup.js"></script>
12 <script type=
"text/javascript">
13 var mypcc
= '{php} echo $GLOBALS['phone_country_code
'] {/php}';
15 // Only load jquery if not already closing. This page serves two purposes now,
16 // for entring of vitals and for graphing/trending previous vitals by being embedded
17 // in the interface/patient_file/encounter/trend_form.php page.
18 if (typeof jQuery
== 'undefined') {
19 document
.write("<script type='text/javascript' src='{/literal}{php}echo $GLOBALS['webroot'];{/php}{literal}/library/js/jquery.js'><\/script>")
22 <style type=
"text/css" title=
"mystyles" media=
"all">
28 border-right:
1px solid black;
33 border-right:
1px solid black;
35 background-color: #ccc;
39 background-color: #ccc;
42 background-color: #ccc;
43 border-bottom:
1px solid #ddd;
44 border-right:
1px solid #ddd;
48 border-collapse: collapse;
64 <body bgcolor=
"{$STYLE.BGCOLOR2}">
65 <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>
66 <form name=
"vitals" method=
"post" action=
"{$FORM_ACTION}/interface/forms/vitals/save.php" onSubmit=
"return top.restoreSession()">
67 <div id=
"chart"></div>
69 <tr><th align=
"left">{xl
t=
"Name"}
</th><th align=
"left">{xl
t=
"Unit"}
</th>
70 <th class='currentvalues' title='{xl t='Date and time of this observation'}'
>
71 <input type='text' size='
14' name='date' id='date'
72 value='{$vitals-
>get_date()|date_format:
"%Y-%m-%d %H:%M"}'
73 onkeyup='datekeyup(this,mypcc,true)' onblur='dateblur(this,mypcc,true)'
/>
74 <img src='{$FORM_ACTION}/interface/pic/show_calendar.gif' id='img_date' align='absbottom'
75 width='
24' height='
22' border='
0' alt='[?]' style='cursor:pointer'
/>
77 {foreach item=result from=$results}
78 <th class='historicalvalues'
>{$result.date|date_format:
"%Y-%m-%d %H:%M"}
</th>
81 {if $units_of_measurement ==
4}
<tr class=
"hide">{else}
<tr>{/if}
82 {if $units_of_measurement ==
2}
<td class=
"unfocus graph" id=
"weight">{else}
<td class=
"graph" id=
"weight">{/if}{xl
t=
"Weight"}
</td>
83 {if $units_of_measurement ==
2}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"lbs"}
</td>
84 {if $units_of_measurement ==
2}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
85 <input type=
"text" size='
5' name='weight' id='weight_input'
value=
"{if $vitals->get_weight() != 0}{$vitals->get_weight()}{/if}" onChange=
"convLbtoKg('weight_input');" title='{xl
t=
"Decimal pounds or pounds and ounces separated by #(e.g. 5#4)"}'
/>
87 {foreach item=result from=$results}
88 <td class='historicalvalues'
>{$vitals-
>display_weight($result.weight)}
</td>
91 {if $units_of_measurement ==
3}
<tr class=
"hide">{else}
<tr>{/if}
92 {if $units_of_measurement ==
1}
<td class=
"unfocus graph" id=
"weight_metric">{else}
<td class=
"graph" id=
"weight_metric">{/if}{xl
t=
"Weight"}
</td>
93 {if $units_of_measurement ==
1}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"kg"}
</td>
94 {if $units_of_measurement ==
1}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
95 <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');"/>
97 {foreach item=result from=$results}
98 <td class='historicalvalues'
>{if $result.weight !=
0}{math
equation=
"number * constant" number=$result.weight constant=
0.45359237 format=
"%.2f"}{/if}
</td>
101 {if $units_of_measurement ==
4}
<tr class=
"hide">{else}
<tr>{/if}
102 {if $units_of_measurement ==
2}
<td class=
"unfocus graph" id=
"height">{else}
<td class=
"graph" id=
"height">{/if}{xl
t=
"Height"}
</td>
103 {if $units_of_measurement ==
2}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"in"}
</td>
104 {if $units_of_measurement ==
2}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
105 <input type=
"text" size='
5' name='height' id='height_input'
value=
"{if $vitals->get_height() != 0}{$vitals->get_height()}{/if}" onChange=
"convIntoCm('height_input');"/>
107 {foreach item=result from=$results}
108 <td class='historicalvalues'
>{if $result.height !=
0}{$result.height}{/if}
</td>
111 {if $units_of_measurement ==
3}
<tr class=
"hide">{else}
<tr>{/if}
112 {if $units_of_measurement ==
1}
<td class=
"unfocus graph" id=
"height_metric">{else}
<td class=
"graph" id=
"height_metric">{/if}{xl
t=
"Height"}
</td>
113 {if $units_of_measurement ==
1}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"cm"}
</td>
114 {if $units_of_measurement ==
1}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
115 <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');"/>
117 {foreach item=result from=$results}
118 <td class='historicalvalues'
>{if $result.height !=
0}{math
equation=
"number * constant" number=$result.height constant=
2.54 format=
"%.2f"}{/if}
</td>
121 <tr><td class=
"graph" id=
"bps">{xl
t=
"BP Systolic"}
</td><td>{xl
t=
"mmHg"}
</td>
122 <td class='currentvalues'
><input type=
"text" size='
5'
123 name='bps' id='bps_input'
value=
"{$vitals->get_bps()}"/></td>
124 {foreach item=result from=$results}
125 <td class='historicalvalues'
>{$result.bps}
</td>
127 <tr><td class=
"graph" id=
"bpd">{xl
t=
"BP Diastolic"}
</td><td>{xl
t=
"mmHg"}
</td>
128 <td class='currentvalues'
><input type=
"text" size='
5'
129 name='bpd' id='bpd_input'
value=
"{$vitals->get_bpd()}"/></td>
130 {foreach item=result from=$results}
131 <td class='historicalvalues'
>{$result.bpd}
</td>
133 <tr><td class=
"graph" id=
"pulse">{xl
t=
"Pulse"}
</td><td>{xl
t=
"per min"}
</td>
134 <td class='currentvalues'
><input type=
"text" size='
5'
135 name='pulse' id='pulse_input'
value=
"{if $vitals->get_pulse() != 0}{$vitals->get_pulse()|string_format:"%
.0f
"}{/if}"/></td>
136 {foreach item=result from=$results}
137 <td class='historicalvalues'
>{if $result.pulse !=
0}{$result.pulse|string_format:
"%.0f"}{/if}
</td>
139 <tr><td class=
"graph" id=
"respiration">{xl
t=
"Respiration"}
</td><td>{xl
t=
"per min"}
</td>
140 <td class='currentvalues'
><input type=
"text" size='
5'
141 name='respiration' id='respiration_input'
value=
"{if $vitals->get_respiration() != 0}{$vitals->get_respiration()|string_format:"%
.0f
"}{/if}"/></td>
142 {foreach item=result from=$results}
143 <td class='historicalvalues'
>{if $result.respiration !=
0}{$result.respiration|string_format:
"%.0f"}{/if}
</td>
146 {if $units_of_measurement ==
4}
<tr class=
"hide">{else}
<tr>{/if}
147 {if $units_of_measurement ==
2}
<td class=
"unfocus graph" id=
"temperature">{else}
<td class=
"graph" id=
"temperature">{/if}{xl
t=
"Temperature"}
</td>
148 {if $units_of_measurement ==
2}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"F"}
</td>
149 {if $units_of_measurement ==
2}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
150 <input type=
"text" size='
5' name='temperature' id='temperature_input'
value=
"{if $vitals->get_temperature() != 0}{$vitals->get_temperature()}{/if}" onChange=
"convFtoC('temperature_input');"/>
152 {foreach item=result from=$results}
153 <td class='historicalvalues'
>{if $result.temperature !=
0}{$result.temperature}{/if}
</td>
156 {if $units_of_measurement ==
3}
<tr class=
"hide">{else}
<tr>{/if}
157 {if $units_of_measurement ==
1}
<td class=
"unfocus graph" id=
"temperature_metric">{else}
<td class=
"graph" id=
"temperature_metric">{/if}{xl
t=
"Temperature"}
</td>
158 {if $units_of_measurement ==
1}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"C"}
</td>
159 {if $units_of_measurement ==
1}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
160 <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');"/>
162 {foreach item=result from=$results}
163 <td class='historicalvalues'
>{if $result.temperature !=
0}{math
equation=
"(number - constant2 ) * constant" number=$result.temperature constant=
0.5556 constant2=
32 format=
"%.2f"}{/if}
</td>
166 <tr><td>{xl
t=
"Temp Location"}
<td></td></td>
167 <td class='currentvalues'
><select name=
"temp_method" id='temp_method'
/><option value=
""> </option>
168 <option value=
"Oral" {if $vitals-
>get_temp_method() ==
"Oral" || $vitals-
>get_temp_method() ==
2 } selected{/if}
>{xl
t=
"Oral"}
169 <option value=
"Tympanic Membrane" {if $vitals-
>get_temp_method() ==
"Tympanic Membrane" || $vitals-
>get_temp_method() ==
1 } selected{/if}
>{xl
t=
"Tympanic Membrane"}
170 <option value=
"Rectal" {if $vitals-
>get_temp_method() ==
"Rectal" || $vitals-
>get_temp_method() ==
3 } selected{/if}
>{xl
t=
"Rectal"}
171 <option value=
"Axillary" {if $vitals-
>get_temp_method() ==
"Axillary" || $vitals-
>get_temp_method() ==
4 } selected{/if}
>{xl
t=
"Axillary"}
172 <option value=
"Temporal Artery" {if $vitals-
>get_temp_method() ==
"Temporal Artery" } selected{/if}
>{xl
t=
"Temporal Artery"}
174 {foreach item=result from=$results}
175 <td class='historicalvalues'
>{if $result.temp_method}{xl t=$result.temp_method}{/if}
</td>
178 <tr><td class=
"graph" id=
"oxygen_saturation">{xl
t=
"Oxygen Saturation"}
</td><td>{xl
t=
"%"}
</td>
179 <td class='currentvalues'
><input type=
"text" size='
5'
180 name='oxygen_saturation' id='oxygen_saturation_input'
value=
"{if $vitals->get_oxygen_saturation() != 0}{$vitals->get_oxygen_saturation()|string_format:"%
.0f
"}{/if}"/></td>
181 {foreach item=result from=$results}
182 <td class='historicalvalues'
>{if $result.oxygen_saturation !=
0}{$result.oxygen_saturation|string_format:
"%.0f"}{/if}
</td>
185 {if $units_of_measurement ==
4}
<tr class=
"hide">{else}
<tr>{/if}
186 {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>
187 {if $units_of_measurement ==
2}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"in"}
</td>
188 {if $units_of_measurement ==
2}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
189 <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');"/>
191 {foreach item=result from=$results}
192 <td class='historicalvalues'
>{if $result.head_circ !=
0}{$result.head_circ}{/if}
</td>
195 {if $units_of_measurement ==
3}
<tr class=
"hide">{else}
<tr>{/if}
196 {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>
197 {if $units_of_measurement ==
1}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"cm"}
</td>
198 {if $units_of_measurement ==
1}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
199 <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');"/>
201 {foreach item=result from=$results}
202 <td class='historicalvalues'
>{if $result.head_circ !=
0}{math
equation=
"number * constant" number=$result.head_circ constant=
2.54 format=
"%.2f"}{/if}
</td>
205 {if $units_of_measurement ==
4}
<tr class=
"hide">{else}
<tr>{/if}
206 {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>
207 {if $units_of_measurement ==
2}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"in"}
</td>
208 {if $units_of_measurement ==
2}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
209 <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');"/>
211 {foreach item=result from=$results}
212 <td class='historicalvalues'
>{if $result.waist_circ !=
0}{$result.waist_circ}{/if}
</td>
215 {if $units_of_measurement ==
3}
<tr class=
"hide">{else}
<tr>{/if}
216 {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>
217 {if $units_of_measurement ==
1}
<td class=
"unfocus">{else}
<td>{/if}{xl
t=
"cm"}
</td>
218 {if $units_of_measurement ==
1}
<td class=
"valuesunfocus">{else}
<td class='currentvalues'
>{/if}
219 <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');"/>
221 {foreach item=result from=$results}
222 <td class='historicalvalues'
>{if $result.waist_circ !=
0}{math
equation=
"number * constant" number=$result.waist_circ constant=
2.54 format=
"%.2f"}{/if}
</td>
225 <tr><td class=
"graph" id=
"BMI">{xl
t=
"BMI"}
</td><td>{xl
t=
"kg/m^2"}
</td>
226 <td class='currentvalues'
><input type=
"text" size='
5'
227 name='BMI' id='BMI_input'
value=
"{if $vitals->get_BMI() != 0}{$vitals->get_BMI()|substr:0:5}{/if}"/></td>
228 {foreach item=result from=$results}
229 <td class='historicalvalues'
>{if $result.BMI !=
0}{$result.BMI|substr:
0:
5}{/if}
</td>
232 <tr><td>{xl
t=
"BMI Status"}
</td><td>{xl
t=
"Type"}
</td>
233 <td class='currentvalues'
><input type=
"text" size='
15'
234 name=
"BMI_status" id=
"BMI_status' value="{$vitals-
>get_BMI_status()}
"/></td>
235 {foreach item=result from=$results}
236 <td class='historicalvalues'>{if $result.BMI_status}{xl t=$result.BMI_status}{/if}</td>
240 <tr><td>{xl t="Other Notes
"}<td></td></td>
241 <td class='currentvalues'><input type="text
" size='20'
242 name="note
" id='note' value="{$vitals-
>get_note()}
" /></td>
243 {foreach item=result from=$results}
244 <td class='historicalvalues'>{$result.note}</td>
248 <td colspan='3' style='text-align:center'>
249 {if $patient_age <= 20 || (preg_match('/month/', $patient_age))}
250 <!-- only show growth-chart button for patients < 20 years old -->
251 <!-- <input type="button
" id="growthchart
" value="{xl
t=
"Growth-Chart"}
" style='margin-left: 20px;'> -->
252 <input type="button
" id="pdfchart
" value="{xl
t=
"Growth-Chart"} ({xl
t=
"PDF"})
" style='margin-left: 20px;'>
253 <input type="button
" id="htmlchart
" value="{xl
t=
"Growth-Chart"} ({xl
t=
"HTML"})
" style='margin-left: 20px;'>
257 <tr><td colspan='3' style='text-align:center'> </td></tr>
259 <td colspan='3' style='text-align:center'>
260 <input type="submit
" class="editonly
" name="Submit
" value="{xl
t=
"Save Form"}
">
261 <input type="button
" class="editonly
" id="cancel
" value="{xl
t=
"Don't Save"}
">
266 <input type="hidden
" name="id
" id='id' value="{$vitals-
>get_id()}
" />
267 <input type="hidden
" name="activity
" id='activity' value="{$vitals-
>get_activity()}
">
268 <input type="hidden
" name="pid
" id='pid' value="{$vitals-
>get_pid()}
">
269 <input type="hidden
" name="process
" id='process' value="true
">
273 <script language="javascript
">
274 var formdate = '{$vitals->get_date()|date_format:"%Y
%m
%d
"}';
275 // vitals array elements are in the format:
276 // date-height-weight-head_circumference
277 var vitals = new Array();
278 // get values from the current form elements
279 vitals[0] = formdate+'-{$vitals->get_height()}-{$vitals->get_weight()}-{$vitals->get_head_circ()}';
281 {foreach item=result from=$results}
282 vitals[vitals.length] = '{$result.date|date_format:"%Y
%m
%d
"}-{$result.height}-{$result.weight}-{$result.head_circ}';
284 var webroot = '{$FORM_ACTION}';
285 var pid = '{$vitals->get_pid()}';
286 var cancellink = '{$DONT_SAVE_LINK}';
289 $(document).ready(function(){
290 $("#growthchart
").click(function() { ShowGrowthchart(); });
291 $("#pdfchart
").click(function() { ShowGrowthchart(1); });
292 $("#htmlchart
").click(function() { ShowGrowthchart(2); });
293 $("#cancel
").click(function() { location.href=cancellink; });
296 function ShowGrowthchart(doPDF) {
297 // get values from the current form elements
299 vitals[0] = formdate+'-'+$("#height_input
").val()+'-'+$("#weight_input
").val()+'-'+$("#head_circ_input
").val();
301 // build the data string
303 for(var i=0; i<vitals.length; i++) {
304 datastring += vitals[i]+"~";
306 newURL = webroot+'/interface/forms/vitals/growthchart/chart.php?pid='+pid+'&data='+datastring;
307 if (doPDF == 1) newURL += "&pdf
=1";
308 if (doPDF == 2) newURL += "&html
=1";
309 // do the new window stuff
310 top.restoreSession();
311 window.open(newURL, '_blank', "menubar
=1,toolbar
=1,scrollbars
=1,resizable
=1,width
=600,height
=450");
314 function convLbtoKg(name) {
315 var lb = $("#"+name).val();
316 var hash_loc=lb.indexOf("#");
319 var pounds=lb.substr(0,hash_loc);
320 var ounces=lb.substr(hash_loc+1);
321 var num=parseInt(pounds)+parseInt(ounces)/16;
326 $("#"+name+"_metric
").val("0");
328 else if (lb == parseFloat(lb)) {
331 $("#"+name+"_metric
").val(kg);
334 $("#"+name+"_metric
").val("");
337 if (name == "weight
") {
342 function convKgtoLb(name) {
343 var kg = $("#"+name+"_metric
").val();
346 $("#"+name).val("0");
348 else if (kg == parseFloat(kg)) {
357 if (name == "weight_input
") {
362 function convIntoCm(name) {
363 var inch = $("#"+name).val();
366 $("#"+name+"_metric
").val("0");
368 else if (inch == parseFloat(inch)) {
371 $("#"+name+"_metric
").val(cm);
374 $("#"+name+"_metric
").val("");
377 if (name == "height_input
") {
382 function convCmtoIn(name) {
383 var cm = $("#"+name+"_metric
").val();
386 $("#"+name).val("0");
388 else if (cm == parseFloat(cm)) {
390 inch = inch.toFixed(2);
391 $("#"+name).val(inch);
397 if (name == "height_input
") {
402 function convFtoC(name) {
403 var Fdeg = $("#"+name).val();
405 $("#"+name+"_metric
").val("0");
407 else if (Fdeg == parseFloat(Fdeg)) {
408 Cdeg = (Fdeg-32)*0.5556;
409 Cdeg = Cdeg.toFixed(2);
410 $("#"+name+"_metric
").val(Cdeg);
413 $("#"+name+"_metric
").val("");
417 function convCtoF(name) {
418 var Cdeg = $("#"+name+"_metric
").val();
420 $("#"+name).val("0");
422 else if (Cdeg == parseFloat(Cdeg)) {
423 Fdeg = (Cdeg/0.5556)+32;
424 Fdeg = Fdeg.toFixed(2);
425 $("#"+name).val(Fdeg);
432 function calculateBMI() {
434 var height = $("#height_input
").val();
435 var weight = $("#weight_input
").val();
436 if(height == 0 || weight == 0) {
439 else if((height == parseFloat(height)) && (weight == parseFloat(weight))) {
440 bmi = weight/height/height*703;
441 bmi = bmi.toFixed(1);
442 $("#BMI_input
").val(bmi);
445 $("#BMI_input
").val("");
449 Calendar.setup({inputField:"date
", ifFormat:"%Y
-%m
-%d
%H
:%M
", button:"img_date
", showsTime:true});