4 * Copyright Medical Information Integration,LLC info@mi-squared.com
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * @file AbstractClickmapModel.php
12 * @brief This file contains the AbstractClickmapModel class, used to model form contents.
16 /* for $GLOBALS['srcdir','pid'] */
17 /* remember that include paths are calculated relative to the including script, not this file. */
18 require_once(dirname(__FILE__
).'/../globals.php');
21 * @class AbstractClickmapModel
23 * @brief code This class extends the OrDataObject class, which is used to model form data for a smarty generated form.
25 * This class extends the ORDataObject class, to model the contents of an image-based form.
28 abstract class AbstractClickmapModel
extends ORDataObject
32 * The row to persist information to/from.
39 * FIXME: either last modification date OR creation date?
46 * The unique identifier of the patient this form belongs to.
53 * required field in database table. not used, always defaulted to NULL.
60 * required field in database table. not used, always defaulted to NULL.
67 * required field in the database table. always defaulted to NULL.
74 * required field in the database table. always defaulted to NULL.
81 * The contents of our form, in one field.
88 * @brief Initialize a newly created object belonging to this class
91 * The sql table to persist form contents from/to.
94 * The index of a row in the given table to initialize form contents from.
96 public function __construct($table, $id = "")
98 parent
::__construct();
100 /* Only accept numeric IDs as arguments. */
101 if (is_numeric($id)) {
107 $this->date
= date("Y-m-d H:i:s");
108 $this->_table
= $table;
110 $this->pid
= $GLOBALS['pid'];
117 * @brief Override this abstract function with your implementation of getTitle.
119 * @return The title of this form.
121 abstract function getTitle();
124 * @brief Override this abstract function with your implementation of getCode.
126 * @return A string thats a 'code' for this form.
128 abstract function getCode();
131 * @brief Fill in this object's members with the contents from the database representing the stored form.
135 /* Run our parent's implementation. */
140 * @brief Store the current structure members representing the form into the database.
144 /* Run our parent's implementation. */
148 /* The rest of this object consists of set_ and get_ pairs, for setting and getting the value of variables that are members of this object. */
157 if (!empty($id) && is_numeric($id)) {
160 trigger_error('API violation: set function called with empty or non numeric string.', E_USER_WARNING
);
169 function set_pid($pid)
171 if (!empty($pid) && is_numeric($pid)) {
174 trigger_error('API violation: set function called with empty or non numeric string.', E_USER_WARNING
);
178 function get_activity()
180 return $this->activity
;
183 function set_activity($tf)
185 if (!empty($tf) && is_numeric($tf)) {
186 $this->activity
= $tf;
188 trigger_error('API violation: set function called with empty or non numeric string.', E_USER_WARNING
);
203 function set_date($dt)
208 trigger_error('API violation: set function called with empty string.', E_USER_WARNING
);
217 function set_user($u)
222 trigger_error('API violation: set function called with empty string.', E_USER_WARNING
);
231 function set_data($data)
236 trigger_error('API violation: set function called with empty string.', E_USER_WARNING
);