Fourth merge from Julia Longtin repository with conflict fix in interface/patient_fil...
[openemr.git] / contrib / forms / snellen / FormSnellen.class.php
bloba1ce9c1ff83a11f473f0cbdebc622d801b7c6091
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 FormSnellen 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 $right_1;
41 var $right_2;
43 /**
44 * Constructor sets all Form attributes to their default value
47 function FormSnellen($id= "", $_prefix = "") {
48 if (is_numeric($id)) {
49 $this->id = $id;
51 else {
52 $id = "";
53 $this->date = date("Y-m-d H:i:s");
56 $this->_table = "form_snellen";
57 $this->activity = 1;
58 $this->pid = $GLOBALS['pid'];
59 if ($id != "") {
60 $this->populate();
61 //$this->date = $this->get_date();
64 function populate() {
65 parent::populate();
66 //$this->temp_methods = parent::_load_enum("temp_locations",false);
69 function toString($html = false) {
70 $string .= "\n"
71 ."ID: " . $this->id . "\n";
73 if ($html) {
74 return nl2br($string);
76 else {
77 return $string;
80 function set_id($id) {
81 if (!empty($id) && is_numeric($id)) {
82 $this->id = $id;
85 function get_id() {
86 return $this->id;
88 function set_pid($pid) {
89 if (!empty($pid) && is_numeric($pid)) {
90 $this->pid = $pid;
93 function get_pid() {
94 return $this->pid;
97 function get_date() {
98 return $this->date;
100 function set_date($dt) {
101 if (!empty($dt)) {
102 $this->date = $dt;
105 function get_user() {
106 return $this->user;
108 function set_user($u) {
109 if(!empty($u)){
110 $this->user = $u;
114 function set_activity($tf) {
115 if (!empty($tf) && is_numeric($tf)) {
116 $this->activity = $tf;
119 function get_activity() {
120 return $this->activity;
124 function persist() {
125 parent::persist();
130 function set_left_1($tf) {
131 $this->left_1 = $tf;
133 function get_left_1() {
134 return $this->left_1;
137 function set_left_2($tf) {
138 $this->left_2 = $tf;
140 function get_left_2() {
141 return $this->left_2;
145 function set_right_1($tf) {
146 $this->right_1 = $tf;
148 function get_right_1() {
149 return $this->right_1;
152 function set_right_2($tf) {
153 $this->right_2 = $tf;
155 function get_right_2() {
156 return $this->right_2;
159 // ----- notes -----
161 var $notes;
162 function get_notes() {
163 return $this->notes;
165 function set_notes($data) {
166 if(!empty($data)) {
167 $this->notes = $data;
171 } // end of Form