6beb930aca85e1c8dc47818cc2ef3799b40896f4
[openemr.git] / interface / forms / vitals / FormVitals.class.php
blob6beb930aca85e1c8dc47818cc2ef3799b40896f4
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 get_height() {
163 return $this->height;
165 function set_height($h) {
166 if(!empty($h) && is_numeric($h)){
167 $this->height = $h;
170 function get_temperature() {
171 return $this->temperature;
173 function set_temperature($t) {
174 if(!empty($t) && is_numeric($t)){
175 $this->temperature = $t;
178 function get_temp_method() {
179 return $this->temp_method;
181 function set_temp_method($tm) {
182 $this->temp_method = $tm;
184 // function get_temp_methods() {
185 // return $this->temp_methods;
186 // }
187 function get_pulse() {
188 return $this->pulse;
190 function set_pulse($p) {
191 if(!empty($p) && is_numeric($p)){
192 $this->pulse = $p;
195 function get_respiration() {
196 return $this->respiration;
198 function set_respiration($r) {
199 if(!empty($r) && is_numeric($r)){
200 $this->respiration = $r;
203 function get_note() {
204 return $this->note;
206 function set_note($n) {
207 if(!empty($n)){
208 $this->note = $n;
211 function get_BMI() {
212 return $this->BMI;
214 function set_BMI($bmi) {
215 if(!empty($bmi) && is_numeric($bmi)){
216 $this->BMI = $bmi;
219 function get_BMI_status() {
220 return $this->BMI_status;
222 function set_BMI_status($status) {
223 $this->BMI_status = $status;
225 function get_waist_circ() {
226 return $this->waist_circ;
228 function set_waist_circ($w) {
229 if(!empty($w) && is_numeric($w)){
230 $this->waist_circ = $w;
233 function get_head_circ() {
234 return $this->head_circ;
236 function set_head_circ($h) {
237 if(!empty($h) && is_numeric($h)){
238 $this->head_circ = $h;
241 function get_oxygen_saturation() {
242 return $this->oxygen_saturation;
244 function set_oxygen_saturation($o) {
245 if(!empty($o) && is_numeric($o)){
246 $this->oxygen_saturation = $o;
249 function persist() {
250 parent::persist();
252 } // end of Form