Missing $_REQUEST variable in messages check
[openemr.git] / contrib / forms / md_assessment / FormMDAssessment.class.php
blobb7f4e9c3d5c4ccb042718fc9a93e31693752bc4e
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 FormMDAssessment 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 $assessment;
39 var $plan;
41 /**
42 * Constructor sets all Form attributes to their default value
45 function FormMDAssessment($id= "", $_prefix = "") {
46 if (is_numeric($id)) {
47 $this->id = $id;
49 else {
50 $id = "";
51 $this->date = date("Y-m-d H:i:s");
54 $this->_table = "form_md_assessment";
55 $this->activity = 1;
56 $this->pid = $GLOBALS['pid'];
57 if ($id != "") {
58 $this->populate();
59 //$this->date = $this->get_date();
62 function populate() {
63 parent::populate();
64 //$this->temp_methods = parent::_load_enum("temp_locations",false);
67 function toString($html = false) {
68 $string .= "\n"
69 ."ID: " . $this->id . "\n";
71 if ($html) {
72 return nl2br($string);
74 else {
75 return $string;
78 function set_id($id) {
79 if (!empty($id) && is_numeric($id)) {
80 $this->id = $id;
83 function get_id() {
84 return $this->id;
86 function set_pid($pid) {
87 if (!empty($pid) && is_numeric($pid)) {
88 $this->pid = $pid;
91 function get_pid() {
92 return $this->pid;
95 function get_date() {
96 return $this->date;
98 function set_date($dt) {
99 if (!empty($dt)) {
100 $this->date = $dt;
103 function get_user() {
104 return $this->user;
106 function set_user($u) {
107 if(!empty($u)){
108 $this->user = $u;
112 function set_activity($tf) {
113 if (!empty($tf) && is_numeric($tf)) {
114 $this->activity = $tf;
117 function get_activity() {
118 return $this->activity;
121 function get_assessment() {
122 return $this->assessment;
124 function set_assessment($data) {
125 if(!empty($data)){
126 $this->assessment = $data;
130 function get_plan() {
131 return $this->plan;
133 function set_plan($data) {
134 if(!empty($data)){
135 $this->plan = $data;
139 function persist() {
140 parent::persist();
142 } // end of Form