some field values were too small, and temp_methods was redundant and confusing
[openemr.git] / interface / forms / vitals / FormVitals.class.php
blob633aeaac1e5808ffd422f5902dda524d91fdba00
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() {
115 if(!$this->date){
116 $dbconn = $GLOBALS['adodb']['db'];
117 $sql = "SELECT date from form_encounter where encounter =" . $GLOBALS{'encounter'} ;
118 $result = $dbconn->Execute($sql);
119 $this->date = $result->fields['date'];
121 return $this->date;
124 function set_date($dt) {
125 if (!empty($dt)) {
126 $this->date = $dt;
129 function get_user() {
130 return $this->user;
132 function set_user($u) {
133 if(!empty($u)){
134 $this->user = $u;
137 function get_bps() {
138 return $this->bps;
140 function set_bps($bps) {
141 if(!empty($bps)){
142 $this->bps = $bps;
145 function get_bpd() {
146 return $this->bpd;
148 function set_bpd($bpd) {
149 if(!empty($bpd)){
150 $this->bpd = $bpd;
153 function get_weight() {
154 return $this->weight;
156 function set_weight($w) {
157 if(!empty($w) && is_numeric($w)){
158 $this->weight = $w;
161 function get_height() {
162 return $this->height;
164 function set_height($h) {
165 if(!empty($h) && is_numeric($h)){
166 $this->height = $h;
169 function get_temperature() {
170 return $this->temperature;
172 function set_temperature($t) {
173 if(!empty($t) && is_numeric($t)){
174 $this->temperature = $t;
177 function get_temp_method() {
178 return $this->temp_method;
180 function set_temp_method($tm) {
181 $this->temp_method = $tm;
183 // function get_temp_methods() {
184 // return $this->temp_methods;
185 // }
186 function get_pulse() {
187 return $this->pulse;
189 function set_pulse($p) {
190 if(!empty($p) && is_numeric($p)){
191 $this->pulse = $p;
194 function get_respiration() {
195 return $this->respiration;
197 function set_respiration($r) {
198 if(!empty($r) && is_numeric($r)){
199 $this->respiration = $r;
202 function get_note() {
203 return $this->note;
205 function set_note($n) {
206 if(!empty($n)){
207 $this->note = $n;
210 function get_BMI() {
211 return $this->BMI;
213 function set_BMI($bmi) {
214 if(!empty($bmi) && is_numeric($bmi)){
215 $this->BMI = $bmi;
218 function get_BMI_status() {
219 return $this->BMI_status;
221 function set_BMI_status($status) {
222 $this->BMI_status = $status;
224 function get_waist_circ() {
225 return $this->waist_circ;
227 function set_waist_circ($w) {
228 if(!empty($w) && is_numeric($w)){
229 $this->waist_circ = $w;
232 function get_head_circ() {
233 return $this->head_circ;
235 function set_head_circ($h) {
236 if(!empty($h) && is_numeric($h)){
237 $this->head_circ = $h;
240 function get_oxygen_saturation() {
241 return $this->oxygen_saturation;
243 function set_oxygen_saturation($o) {
244 if(!empty($o) && is_numeric($o)){
245 $this->oxygen_saturation = $o;
248 function persist() {
249 parent::persist();
251 } // end of Form