Support for using pounds and ounces on the vitals form.
[openemr.git] / interface / forms / vitals / FormVitals.class.php
blob733e90ef1842a3e8b7ae97190f0bb91187304b8f
1 <?php
3 require_once(dirname(__FILE__) . "/../../../library/classes/ORDataObject.class.php");
5 define("EVENT_VEHICLE",1);
6 define("EVENT_WORK_RELATED",2);
7 define("EVENT_SLIP_FALL",3);
8 define("EVENT_OTHER",4);
11 /**
12 * class FormHpTjePrimary
15 class FormVitals extends ORDataObject {
17 /**
19 * @access public
23 /**
25 * static
27 var $id;
28 var $date;
29 var $pid;
30 var $user;
31 var $groupname;
32 var $authorized;
33 var $activity;
34 var $bps;
35 var $bpd;
36 var $weight;
37 var $height;
38 var $temperature;
39 var $temp_method;
40 var $pulse;
41 var $respiration;
42 var $note;
43 var $BMI;
44 var $BMI_status;
45 var $waist_circ;
46 var $head_circ;
47 var $oxygen_saturation;
49 // var $temp_methods;
50 /**
51 * Constructor sets all Form attributes to their default value
54 function FormVitals($id= "", $_prefix = "") {
55 if ($id > 0) {
56 $this->id = $id;
59 else {
60 $id = "";
61 $this->date = $this->get_date();
64 $this->_table = "form_vitals";
65 $this->activity = 1;
66 $this->pid = $GLOBALS['pid'];
67 if ($id != "") {
68 $this->populate();
72 function populate() {
73 parent::populate();
74 //$this->temp_methods = parent::_load_enum("temp_locations",false);
77 function toString($html = false) {
78 $string .= "\n"
79 ."ID: " . $this->id . "\n";
81 if ($html) {
82 return nl2br($string);
84 else {
85 return $string;
88 function set_id($id) {
89 if (!empty($id) && is_numeric($id)) {
90 $this->id = $id;
93 function get_id() {
94 return $this->id;
96 function set_pid($pid) {
97 if (!empty($pid) && is_numeric($pid)) {
98 $this->pid = $pid;
101 function get_pid() {
102 return $this->pid;
104 function set_activity($tf) {
105 if (!empty($tf) && is_numeric($tf)) {
106 $this->activity = $tf;
109 function get_activity() {
110 return $this->activity;
113 function get_date() {
114 if(!$this->date){
115 $this->date = date('YmdHis', time());
117 return $this->date;
120 function set_date($dt) {
121 if (!empty($dt)) {
122 $dt = str_replace('-', '', $dt);
123 $dt = str_replace(':', '', $dt);
124 $dt = str_replace(' ', '', $dt);
125 while (strlen($dt) < 14) $dt .= '0';
126 $this->date = $dt;
130 function get_user() {
131 return $this->user;
133 function set_user($u) {
134 if(!empty($u)){
135 $this->user = $u;
138 function get_bps() {
139 return $this->bps;
141 function set_bps($bps) {
142 if(!empty($bps)){
143 $this->bps = $bps;
146 function get_bpd() {
147 return $this->bpd;
149 function set_bpd($bpd) {
150 if(!empty($bpd)){
151 $this->bpd = $bpd;
154 function get_weight() {
155 return $this->weight;
157 function set_weight($w) {
158 if(!empty($w) && is_numeric($w)){
159 $this->weight = $w;
162 function display_weight($pounds)
164 if($pounds!=0)
166 if($GLOBALS['us_weight_format']==2)
168 $pounds_int=floor($pounds);
169 return $pounds_int." ".xl('lb') ." " .round(($pounds-$pounds_int)*16)." ".xl('oz');
171 else
173 return $pounds;
177 function get_height() {
178 return $this->height;
180 function set_height($h) {
181 if(!empty($h) && is_numeric($h)){
182 $this->height = $h;
185 function get_temperature() {
186 return $this->temperature;
188 function set_temperature($t) {
189 if(!empty($t) && is_numeric($t)){
190 $this->temperature = $t;
193 function get_temp_method() {
194 return $this->temp_method;
196 function set_temp_method($tm) {
197 $this->temp_method = $tm;
199 // function get_temp_methods() {
200 // return $this->temp_methods;
201 // }
202 function get_pulse() {
203 return $this->pulse;
205 function set_pulse($p) {
206 if(!empty($p) && is_numeric($p)){
207 $this->pulse = $p;
210 function get_respiration() {
211 return $this->respiration;
213 function set_respiration($r) {
214 if(!empty($r) && is_numeric($r)){
215 $this->respiration = $r;
218 function get_note() {
219 return $this->note;
221 function set_note($n) {
222 if(!empty($n)){
223 $this->note = $n;
226 function get_BMI() {
227 return $this->BMI;
229 function set_BMI($bmi) {
230 if(!empty($bmi) && is_numeric($bmi)){
231 $this->BMI = $bmi;
234 function get_BMI_status() {
235 return $this->BMI_status;
237 function set_BMI_status($status) {
238 $this->BMI_status = $status;
240 function get_waist_circ() {
241 return $this->waist_circ;
243 function set_waist_circ($w) {
244 if(!empty($w) && is_numeric($w)){
245 $this->waist_circ = $w;
248 function get_head_circ() {
249 return $this->head_circ;
251 function set_head_circ($h) {
252 if(!empty($h) && is_numeric($h)){
253 $this->head_circ = $h;
256 function get_oxygen_saturation() {
257 return $this->oxygen_saturation;
259 function set_oxygen_saturation($o) {
260 if(!empty($o) && is_numeric($o)){
261 $this->oxygen_saturation = $o;
264 function persist() {
265 parent::persist();
267 } // end of Form