CCR Import, made changes per comments in github.
[openemr.git] / contrib / forms / complaint_history / FormComplaintHistory.class.php
blob3bc8f89a3bb782113ad91150cb45e93bb8ecd3c3
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 FormComplaintHistory 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_history;
40 /**
41 * Constructor sets all Form attributes to their default value
44 function FormComplaintHistory($id= "", $_prefix = "") {
45 if (is_numeric($id)) {
46 $this->id = $id;
48 else {
49 $id = "";
50 $this->date = date("Y-m-d H:i:s");
53 $this->_table = "form_complaint_history";
54 $this->activity = 1;
55 $this->pid = $GLOBALS['pid'];
56 if ($id != "") {
57 $this->populate();
58 //$this->date = $this->get_date();
61 function populate() {
62 parent::populate();
63 //$this->temp_methods = parent::_load_enum("temp_locations",false);
66 function toString($html = false) {
67 $string .= "\n"
68 ."ID: " . $this->id . "\n";
70 if ($html) {
71 return nl2br($string);
73 else {
74 return $string;
77 function set_id($id) {
78 if (!empty($id) && is_numeric($id)) {
79 $this->id = $id;
82 function get_id() {
83 return $this->id;
85 function set_pid($pid) {
86 if (!empty($pid) && is_numeric($pid)) {
87 $this->pid = $pid;
90 function get_pid() {
91 return $this->pid;
94 function get_date() {
95 return $this->date;
97 function set_date($dt) {
98 if (!empty($dt)) {
99 $this->date = $dt;
102 function get_user() {
103 return $this->user;
105 function set_user($u) {
106 if(!empty($u)){
107 $this->user = $u;
111 function set_activity($tf) {
112 if (!empty($tf) && is_numeric($tf)) {
113 $this->activity = $tf;
116 function get_activity() {
117 return $this->activity;
120 function get_complaint_history() {
121 return $this->complaint_history;
123 function set_complaint_history($data) {
124 $this->complaint_history = $data;
127 function persist() {
128 parent::persist();
130 } // end of Form