Highway to PSR2
[openemr.git] / contrib / forms / hpi / FormHPI.class.php
blobf1f7735ddaeac2fb68f024bd76fd82fac6e6a12a
1 <?php
2 // Copyright (C) 2009 Aron Racho <aron@mi-squared.com>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
9 define("EVENT_VEHICLE", 1);
10 define("EVENT_WORK_RELATED", 2);
11 define("EVENT_SLIP_FALL", 3);
12 define("EVENT_OTHER", 4);
15 /**
16 * class FormHpTjePrimary
19 class FormHPI extends ORDataObject
22 /**
24 * @access public
28 /**
30 * static
32 var $id;
33 var $date;
34 var $pid;
35 var $user;
36 var $groupname;
37 var $activity;
38 var $complaint;
39 var $location;
40 var $quality;
41 var $severity;
42 var $duration;
43 var $timing;
44 var $context;
45 var $factors;
46 var $signs;
49 /**
50 * Constructor sets all Form attributes to their default value
53 function FormHPI($id = "", $_prefix = "")
55 if (is_numeric($id)) {
56 $this->id = $id;
57 } else {
58 $id = "";
59 $this->date = date("Y-m-d H:i:s");
62 $this->_table = "form_hpi";
63 $this->activity = 1;
64 $this->pid = $GLOBALS['pid'];
65 if ($id != "") {
66 $this->populate();
67 //$this->date = $this->get_date();
70 function populate()
72 parent::populate();
73 //$this->temp_methods = parent::_load_enum("temp_locations",false);
76 function toString($html = false)
78 $string .= "\n"
79 ."ID: " . $this->id . "\n";
81 if ($html) {
82 return nl2br($string);
83 } else {
84 return $string;
87 function set_id($id)
89 if (!empty($id) && is_numeric($id)) {
90 $this->id = $id;
93 function get_id()
95 return $this->id;
97 function set_pid($pid)
99 if (!empty($pid) && is_numeric($pid)) {
100 $this->pid = $pid;
103 function get_pid()
105 return $this->pid;
108 function get_date()
110 return $this->date;
112 function set_date($dt)
114 if (!empty($dt)) {
115 $this->date = $dt;
118 function get_user()
120 return $this->user;
122 function set_user($u)
124 if (!empty($u)) {
125 $this->user = $u;
129 function set_activity($tf)
131 if (!empty($tf) && is_numeric($tf)) {
132 $this->activity = $tf;
135 function get_activity()
137 return $this->activity;
140 function get_complaint()
142 return $this->complaint;
144 function set_complaint($data)
146 if (!empty($data)) {
147 $this->complaint = $data;
151 function get_location()
153 return $this->location;
155 function set_location($data)
157 if (!empty($data)) {
158 $this->location = $data;
162 function get_quality()
164 return $this->quality;
166 function set_quality($data)
168 if (!empty($data)) {
169 $this->quality = $data;
173 function get_severity()
175 return $this->severity;
177 function set_severity($data)
179 if (!empty($data)) {
180 $this->severity = $data;
184 function get_duration()
186 return $this->duration;
188 function set_duration($data)
190 if (!empty($data)) {
191 $this->duration = $data;
195 function get_timing()
197 return $this->timing;
199 function set_timing($data)
201 if (!empty($data)) {
202 $this->timing = $data;
206 function get_context()
208 return $this->context;
210 function set_context($data)
212 if (!empty($data)) {
213 $this->context = $data;
217 function get_factors()
219 return $this->factors;
221 function set_factors($data)
223 if (!empty($data)) {
224 $this->factors = $data;
228 function get_signs()
230 return $this->signs;
232 function set_signs($data)
234 if (!empty($data)) {
235 $this->signs = $data;
239 function persist()
241 parent::persist();
243 } // end of Form