Improve flexibility of which code types are used in claims and other misc.
[openemr.git] / contrib / forms / hand / FormHand.class.php
bloba7a37f7cde1f5e09a2304086d46ddb577f534999
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
8 require_once(dirname(__FILE__) . "/../../../library/classes/ORDataObject.class.php");
10 define("EVENT_VEHICLE",1);
11 define("EVENT_WORK_RELATED",2);
12 define("EVENT_SLIP_FALL",3);
13 define("EVENT_OTHER",4);
16 /**
17 * class FormHpTjePrimary
20 class FormHand 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 $left_1;
39 var $left_2;
40 var $left_3;
41 var $right_1;
42 var $right_2;
43 var $right_3;
45 /**
46 * Constructor sets all Form attributes to their default value
49 function FormHand($id= "", $_prefix = "") {
50 if (is_numeric($id)) {
51 $this->id = $id;
53 else {
54 $id = "";
55 $this->date = date("Y-m-d H:i:s");
58 $this->_table = "form_hand";
59 $this->activity = 1;
60 $this->pid = $GLOBALS['pid'];
61 if ($id != "") {
62 $this->populate();
63 //$this->date = $this->get_date();
66 function populate() {
67 parent::populate();
68 //$this->temp_methods = parent::_load_enum("temp_locations",false);
71 function toString($html = false) {
72 $string .= "\n"
73 ."ID: " . $this->id . "\n";
75 if ($html) {
76 return nl2br($string);
78 else {
79 return $string;
82 function set_id($id) {
83 if (!empty($id) && is_numeric($id)) {
84 $this->id = $id;
87 function get_id() {
88 return $this->id;
90 function set_pid($pid) {
91 if (!empty($pid) && is_numeric($pid)) {
92 $this->pid = $pid;
95 function get_pid() {
96 return $this->pid;
99 function get_date() {
100 return $this->date;
102 function set_date($dt) {
103 if (!empty($dt)) {
104 $this->date = $dt;
107 function get_user() {
108 return $this->user;
110 function set_user($u) {
111 if(!empty($u)){
112 $this->user = $u;
116 function set_activity($tf) {
117 if (!empty($tf) && is_numeric($tf)) {
118 $this->activity = $tf;
121 function get_activity() {
122 return $this->activity;
126 function persist() {
127 parent::persist();
132 function set_left_1($tf) {
133 $this->left_1 = $tf;
135 function get_left_1() {
136 return $this->left_1;
139 function set_left_2($tf) {
140 $this->left_2 = $tf;
142 function get_left_2() {
143 return $this->left_2;
146 function set_left_3($tf) {
147 $this->left_3 = $tf;
149 function get_left_3() {
150 return $this->left_3;
153 function set_right_1($tf) {
154 $this->right_1 = $tf;
156 function get_right_1() {
157 return $this->right_1;
160 function set_right_2($tf) {
161 $this->right_2 = $tf;
163 function get_right_2() {
164 return $this->right_2;
167 function set_right_3($tf) {
168 $this->right_3 = $tf;
170 function get_right_3() {
171 return $this->right_3;
175 var $handedness;
176 function get_handedness() {
177 return $this->handedness;
179 function set_handedness($data) {
180 if(!empty($data)) {
181 $this->handedness = $data;
184 function get_handedness_l() {
185 return $this->handedness == "Left" ? "CHECKED" : ""; }
186 function get_handedness_r() {
187 return $this->handedness == "Right" ? "CHECKED" : ""; }
188 function get_handedness_b() {
189 return $this->handedness == "Both" ? "CHECKED" : ""; }
191 // ----- notes -----
193 var $notes;
194 function get_notes() {
195 return $this->notes;
197 function set_notes($data) {
198 if(!empty($data)) {
199 $this->notes = $data;
204 } // end of Form