added metric version of the vitals form
[openemr.git] / interface / forms / vitalsM / FormVitalsM.class.php
blob6f60508c016d13990377250e5a124cbe8e4c80a9
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);
10 /**
11 * class FormVitalsM
14 class FormVitalsM extends ORDataObject {
16 /**
18 * @access public
21 /**
23 * static
25 var $id;
26 var $date;
27 var $pid;
28 var $user;
29 var $groupname;
30 var $authorized;
31 var $activity;
32 var $bps;
33 var $bpd;
34 var $weight;
35 var $height;
36 var $temperature;
37 var $temp_method;
38 var $pulse;
39 var $respiration;
40 var $note;
41 var $BMI;
42 var $BMI_status;
43 var $waist_circ;
44 var $head_circ;
45 var $oxygen_saturation;
47 /**
48 * Constructor sets all Form attributes to their default value
51 function FormVitalsM($id= "", $_prefix = "") {
52 if ($id > 0) {
53 $this->id = $id;
55 else {
56 $id = "";
57 $this->date = $this->get_date();
59 $this->_table = "form_vitalsM";
60 $this->activity = 1;
61 $this->pid = $GLOBALS['pid'];
62 if ($id != "") {
63 $this->populate();
67 function populate() {
68 parent::populate();
71 function toString($html = false) {
72 $string .= "\n"
73 ."ID: " . $this->id . "\n";
74 if ($html) {
75 return nl2br($string);
77 else {
78 return $string;
82 function set_id($id) {
83 if (!empty($id) && is_numeric($id)) {
84 $this->id = $id;
88 function get_id() {
89 return $this->id;
92 function set_pid($pid) {
93 if (!empty($pid) && is_numeric($pid)) {
94 $this->pid = $pid;
98 function get_pid() {
99 return $this->pid;
102 function set_activity($tf) {
103 if (!empty($tf) && is_numeric($tf)) {
104 $this->activity = $tf;
108 function get_activity() {
109 return $this->activity;
112 function get_date() {
113 if(!$this->date){
114 $dbconn = $GLOBALS['adodb']['db'];
115 $sql = "SELECT date from form_encounter where encounter =" . $GLOBALS{'encounter'} ;
116 $result = $dbconn->Execute($sql);
117 $this->date = $result->fields['date'];
119 return $this->date;
122 function set_date($dt) {
123 if (!empty($dt)) {
124 $this->date = $dt;
128 function get_user() {
129 return $this->user;
132 function set_user($u) {
133 if(!empty($u)){
134 $this->user = $u;
138 function get_bps() {
139 return $this->bps;
142 function set_bps($bps) {
143 if(!empty($bps)){
144 $this->bps = $bps;
148 function get_bpd() {
149 return $this->bpd;
152 function set_bpd($bpd) {
153 if(!empty($bpd)){
154 $this->bpd = $bpd;
158 function get_weight() {
159 return $this->weight;
162 function set_weight($w) {
163 if(!empty($w) && is_numeric($w)){
164 $this->weight = $w;
168 function get_height() {
169 return $this->height;
172 function set_height($h) {
173 if(!empty($h) && is_numeric($h)){
174 $this->height = $h;
178 function get_temperature() {
179 return $this->temperature;
182 function set_temperature($t) {
183 if(!empty($t) && is_numeric($t)){
184 $this->temperature = $t;
188 function get_temp_method() {
189 return $this->temp_method;
192 function set_temp_method($tm) {
193 $this->temp_method = $tm;
196 function get_pulse() {
197 return $this->pulse;
200 function set_pulse($p) {
201 if(!empty($p) && is_numeric($p)){
202 $this->pulse = $p;
206 function get_respiration() {
207 return $this->respiration;
210 function set_respiration($r) {
211 if(!empty($r) && is_numeric($r)){
212 $this->respiration = $r;
216 function get_note() {
217 return $this->note;
220 function set_note($n) {
221 if(!empty($n)){
222 $this->note = $n;
226 function get_BMI() {
227 return $this->BMI;
230 function set_BMI($bmi) {
231 if(!empty($bmi) && is_numeric($bmi)){
232 $this->BMI = $bmi;
236 function get_BMI_status() {
237 return $this->BMI_status;
240 function set_BMI_status($status) {
241 $this->BMI_status = $status;
244 function get_waist_circ() {
245 return $this->waist_circ;
248 function set_waist_circ($w) {
249 if(!empty($w) && is_numeric($w)){
250 $this->waist_circ = $w;
254 function get_head_circ() {
255 return $this->head_circ;
258 function set_head_circ($h) {
259 if(!empty($h) && is_numeric($h)){
260 $this->head_circ = $h;
264 function get_oxygen_saturation() {
265 return $this->oxygen_saturation;
268 function set_oxygen_saturation($o) {
269 if(!empty($o) && is_numeric($o)){
270 $this->oxygen_saturation = $o;
274 function persist() {
275 parent::persist();
277 } // end of Form