Refactor previous name into dedicated service (#7571)
[openemr.git] / contrib / forms / hpi / FormHPI.class.php
blob0e48207dba38686054fc6b1c36a9cafaf29c6990
1 <?php
3 /* FormHPI class
5 * @package OpenEMR
6 * @author Aron Racho <aron@mi-squared.com>
7 * @author Stephen Waite <stephen.waite@cmsvt.com>
8 * @copyright Copyright (C) 2009 Aron Racho <aron@mi-squared.com>
9 * @copyright Copyright (c) 2017 Stephen Waite <stephen.waite@cmsvt.com>
10 * @link https://github.com/openemr/openemr/tree/master
11 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
14 use OpenEMR\Common\ORDataObject\ORDataObject;
16 define("EVENT_VEHICLE", 1);
17 define("EVENT_WORK_RELATED", 2);
18 define("EVENT_SLIP_FALL", 3);
19 define("EVENT_OTHER", 4);
22 /**
23 * class FormHpTjePrimary
27 class FormHPI extends ORDataObject
29 var $id;
30 var $date;
31 var $pid;
32 var $user;
33 var $groupname;
34 var $activity;
35 var $complaint;
36 var $location;
37 var $quality;
38 var $severity;
39 var $duration;
40 var $timing;
41 var $context;
42 var $factors;
43 var $signs;
45 /**
46 * Constructor sets all Form attributes to their default value
49 function __construct($id = "", $_prefix = "")
51 parent::__construct();
53 if (is_numeric($id)) {
54 $this->id = $id;
55 } else {
56 $id = "";
57 $this->date = date("Y-m-d H:i:s");
60 $this->_table = "form_hpi";
61 $this->activity = 1;
62 $this->pid = $GLOBALS['pid'];
63 if ($id != "") {
64 $this->populate();
65 //$this->date = $this->get_date();
69 function populate()
71 parent::populate();
72 //$this->temp_methods = parent::_load_enum("temp_locations",false);
75 function __toString()
77 return "ID: " . $this->id . "\n";
80 function set_id($id)
82 if (!empty($id) && is_numeric($id)) {
83 $this->id = $id;
87 function get_id()
89 return $this->id;
92 function set_pid($pid)
94 if (!empty($pid) && is_numeric($pid)) {
95 $this->pid = $pid;
99 function get_pid()
101 return $this->pid;
104 function get_date()
106 return $this->date;
109 function set_date($dt)
111 if (!empty($dt)) {
112 $this->date = $dt;
116 function get_user()
118 return $this->user;
121 function set_user($u)
123 if (!empty($u)) {
124 $this->user = $u;
128 function set_activity($tf)
130 if (!empty($tf) && is_numeric($tf)) {
131 $this->activity = $tf;
135 function get_activity()
137 return $this->activity;
140 function get_complaint()
142 return $this->complaint;
145 function set_complaint($data)
147 if (!empty($data)) {
148 $this->complaint = $data;
152 function get_location()
154 return $this->location;
157 function set_location($data)
159 if (!empty($data)) {
160 $this->location = $data;
164 function get_quality()
166 return $this->quality;
169 function set_quality($data)
171 if (!empty($data)) {
172 $this->quality = $data;
176 function get_severity()
178 return $this->severity;
181 function set_severity($data)
183 if (!empty($data)) {
184 $this->severity = $data;
188 function get_duration()
190 return $this->duration;
193 function set_duration($data)
195 if (!empty($data)) {
196 $this->duration = $data;
200 function get_timing()
202 return $this->timing;
205 function set_timing($data)
207 if (!empty($data)) {
208 $this->timing = $data;
212 function get_context()
214 return $this->context;
217 function set_context($data)
219 if (!empty($data)) {
220 $this->context = $data;
224 function get_factors()
226 return $this->factors;
229 function set_factors($data)
231 if (!empty($data)) {
232 $this->factors = $data;
236 function get_signs()
238 return $this->signs;
241 function set_signs($data)
243 if (!empty($data)) {
244 $this->signs = $data;
248 function persist()
250 parent::persist();
252 } // end of Form