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
33 * The row to persist information to/from.
40 * FIXME: either last modification date OR creation date?
47 * The unique identifier of the patient this form belongs to.
54 * required field in database table. not used, always defaulted to NULL.
61 * required field in database table. not used, always defaulted to NULL.
68 * required field in the database table. always defaulted to NULL.
75 * required field in the database table. always defaulted to NULL.
82 * The contents of our form, in one field.
89 * @brief Initialize a newly created object belonging to this class
92 * The sql table to persist form contents from/to.
95 * The index of a row in the given table to initialize form contents from.
97 public function __construct($table, $id = "")
99 parent
::__construct();
101 /* Only accept numeric IDs as arguments. */
102 if (is_numeric($id)) {
108 $this->date
= date("Y-m-d H:i:s");
109 $this->_table
= $table;
111 $this->pid
= $GLOBALS['pid'];
118 * @brief Override this abstract function with your implementation of getTitle.
120 * @return The title of this form.
122 abstract function getTitle();
125 * @brief Override this abstract function with your implementation of getCode.
127 * @return A string thats a 'code' for this form.
129 abstract function getCode();
132 * @brief Fill in this object's members with the contents from the database representing the stored form.
136 /* Run our parent's implementation. */
141 * @brief Store the current structure members representing the form into the database.
145 /* Run our parent's implementation. */
149 /* 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. */
158 if (!empty($id) && is_numeric($id)) {
161 trigger_error('API violation: set function called with empty or non numeric string.', E_USER_WARNING
);
170 function set_pid($pid)
172 if (!empty($pid) && is_numeric($pid)) {
175 trigger_error('API violation: set function called with empty or non numeric string.', E_USER_WARNING
);
179 function get_activity()
181 return $this->activity
;
184 function set_activity($tf)
186 if (!empty($tf) && is_numeric($tf)) {
187 $this->activity
= $tf;
189 trigger_error('API violation: set function called with empty or non numeric string.', E_USER_WARNING
);
204 function set_date($dt)
209 trigger_error('API violation: set function called with empty string.', E_USER_WARNING
);
218 function set_user($u)
223 trigger_error('API violation: set function called with empty string.', E_USER_WARNING
);
232 function set_data($data)
237 trigger_error('API violation: set function called with empty string.', E_USER_WARNING
);