3 use OpenEMR\Common\ORDataObject\ORDataObject
;
6 * Copyright Medical Information Integration,LLC info@mi-squared.com
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * @file AbstractClickmapModel.php
14 * @brief This file contains the AbstractClickmapModel class, used to model form contents.
18 /* for $GLOBALS['srcdir','pid'] */
19 /* remember that include paths are calculated relative to the including script, not this file. */
20 require_once(dirname(__FILE__
) . '/../globals.php');
23 * @class AbstractClickmapModel
25 * @brief code This class extends the OrDataObject class, which is used to model form data for a smarty generated form.
27 * This class extends the ORDataObject class, to model the contents of an image-based form.
30 abstract class AbstractClickmapModel
extends ORDataObject
34 * The row to persist information to/from.
41 * FIXME: either last modification date OR creation date?
48 * The unique identifier of the patient this form belongs to.
55 * required field in database table. not used, always defaulted to NULL.
62 * required field in database table. not used, always defaulted to NULL.
69 * required field in the database table. always defaulted to NULL.
76 * required field in the database table. always defaulted to NULL.
83 * The contents of our form, in one field.
90 * @brief Initialize a newly created object belonging to this class
93 * The sql table to persist form contents from/to.
96 * The index of a row in the given table to initialize form contents from.
98 public function __construct($table, $id = "")
100 parent
::__construct();
102 /* Only accept numeric IDs as arguments. */
103 if (is_numeric($id)) {
109 $this->date
= date("Y-m-d H:i:s");
110 $this->_table
= $table;
112 $this->pid
= $GLOBALS['pid'];
119 * @brief Override this abstract function with your implementation of getTitle.
121 * @return The title of this form.
123 abstract function getTitle();
126 * @brief Override this abstract function with your implementation of getCode.
128 * @return A string thats a 'code' for this form.
130 abstract function getCode();
133 * @brief Fill in this object's members with the contents from the database representing the stored form.
137 /* Run our parent's implementation. */
142 * @brief Store the current structure members representing the form into the database.
146 /* Run our parent's implementation. */
150 /* 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. */
159 if (!empty($id) && is_numeric($id)) {
162 trigger_error('API violation: set function called with empty or non numeric string.', E_USER_WARNING
);
171 function set_pid($pid)
173 if (!empty($pid) && is_numeric($pid)) {
176 trigger_error('API violation: set function called with empty or non numeric string.', E_USER_WARNING
);
180 function get_activity()
182 return $this->activity
;
185 function set_activity($tf)
187 if (!empty($tf) && is_numeric($tf)) {
188 $this->activity
= $tf;
190 trigger_error('API violation: set function called with empty or non numeric string.', E_USER_WARNING
);
205 function set_date($dt)
210 trigger_error('API violation: set function called with empty string.', E_USER_WARNING
);
219 function set_user($u)
224 trigger_error('API violation: set function called with empty string.', E_USER_WARNING
);
233 function set_data($data)
238 trigger_error('API violation: set function called with empty string.', E_USER_WARNING
);