3 * Upgrade script for access controls.
5 * This script will update the phpGACL database, which include
6 * Access Control Objects(ACO), Groups(ARO), and Access Control
7 * Lists(ACL) to the most recent version.
8 * It will display whether each update already exist
9 * or if it was updated succesfully.
10 * To avoid reversing customizations, upgrade is done in versions,
11 * which are recorded in the database. To add another version of
12 * changes, use the following template:
13 * <pre>// Upgrade for acl_version <acl_version_here>
14 * $upgrade_acl = <acl_version_here>;
15 * if ($acl_version < $upgrade_acl) {
16 * echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
18 * //Collect the ACL ID numbers.
19 * echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
21 * //Add new object Sections
22 * echo "<BR/><B>Adding new object sections</B><BR/>";
25 * echo "<BR/><B>Adding new objects</B><BR/>";
27 * //Update already existing Objects
28 * echo "<BR/><B>Upgrading objects</B><BR/>";
30 * //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
31 * // (will also place in the appropriate group and CREATE a new group if needed)
32 * echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
35 * echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
37 * //DONE with upgrading to this version
38 * $acl_version = $upgrade_acl;
43 * <pre>---VERSION 1 ACL---
45 * Section "sensitivities" (Sensitivities):
46 * ADD normal Normal (Administrators, Physicians, Clinicians(addonly))
47 * ADD high High (Administrators, Physicians)
48 * Section "admin" (Administration):
49 * ADD super Superuser (Adminstrators)
51 * Section "admin" (Administration):
52 * ADD drugs Pharmacy Dispensary (Administrators, Physicians, Clinicians(write))
53 * ADD acl ACL Administration (Administrators)
54 * Section "sensitivities" (Sensitivities):
55 * EDIT high High (ensure the order variable is '20')
56 * Section "acct" (Accounting):
57 * ADD disc Price Discounting (Administrators, Physicians, Accounting(write))
59 * ADD Section "lists" (Lists):
60 * ADD default Default List (write,addonly optional) (Administrators)
61 * ADD state State List (write,addonly optional) (Administrators)
62 * ADD country Country List (write,addonly optional) (Administrators)
63 * ADD language Language List (write,addonly optional) (Administrators)
64 * ADD ethrace Ethnicity-Race List (write,addonly optional) (Administrators)
65 * ADD Section "placeholder" (Placeholder):
66 * ADD filler Placeholder (Maintains empty ACLs)
67 * ACL/Group doc addonly "Physicians" (filler aco)
68 * ACL/Group front addonly "Front Office" (filler aco)
69 * ACL/Group back addonly "Accounting" (filler aco)
71 * Section "patients" (Patients):
72 * ADD sign Sign Lab Results (Physicians)
73 * ACL/Group breakglass write "Emergency Login" (added all aco's to it)
75 * Section "nationnotes" (Nation Notes):
76 * ADD nn_configure Nation Notes Configure (Administrators, Emergency Login)
77 * Section "patientportal" (Patient Portal):
78 * ADD portal Patient Portal (Administrators, Emergency Login)
80 * ACL/Group doc wsome "Physicians" (filler aco)
81 * ACL/Group clin wsome "Clinicians" (filler aco)
82 * ACL/Group front wsome "Front Office" (filler aco)
83 * ACL/Group back wsome "Accounting" (filler aco)
84 * ACL/Group doc view "Physicians" (filler aco)
85 * ACL/Group clin view "Clinicians" (filler aco)
86 * ACL/Group front view "Front Office" (filler aco)
87 * ACL/Group back view "Accounting" (filler aco)
89 * Section "menus" (Menus):
90 * ADD modle Module (Administrators, Emergency Login)
92 * Section "patients" (Patients):
93 * ADD reminder Patient Reminders (Physicians,Clinicians(addonly))
94 * ADD alert Clinical Reminders/Alerts (Physicians,Clinicians,Front Office(view),Accounting(view))
95 * ADD disclosure Disclosures (Physicians,Clinicians(addonly))
96 * ADD rx Prescriptions (Physicians,Clinicians(addonly))
97 * ADD amendment Amendments (Physicians,Clinicians(addonly))
98 * ADD lab Lab Results (Physicians,Clinicians(addonly))
99 * ADD docs_rm Documents Delete (Administrators)
100 * Section "admin" (Administration):
101 * ADD multipledb Multipledb (Administrators)
102 * ADD menu Menu (Administrators)
103 * Section "groups" (Groups):
104 * ADD gadd View/Add/Update groups (Administrators)
105 * ADD gcalendar View/Create/Update groups appointment in calendar (Administrators,Physicians,Clinicians)
106 * ADD glog Group encounter log (Administrators,Physicians, Clinicians)
107 * ADD gdlog Group detailed log of appointment in patient record (Administrators)
108 * ADD gm Send message from the permanent group therapist to the personal therapist (Administrators)
110 * Section "patients" (Patients):
111 * ADD pat_rep Patient Report (Administrators)
115 * @link http://www.open-emr.org
116 * @author Brady Miller <brady.g.miller@gmail.com>
117 * @copyright Copyright (c) 2012-2017 Brady Miller <brady.g.miller@gmail.com>
118 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
121 // Checks if the server's PHP version is compatible with OpenEMR:
122 require_once(dirname(__FILE__
) . "/src/Common/Compatibility/Checker.php");
123 $response = OpenEMR\Common\Compatibility\Checker
::checkPhpVersion();
124 if ($response !== true) {
125 die(htmlspecialchars($response));
128 $ignoreAuth = true; // no login required
130 require_once('interface/globals.php');
131 require_once("$srcdir/acl_upgrade_fx.php");
133 //Ensure that phpGACL has been installed
134 include_once('library/acl.inc');
135 if (isset($phpgacl_location)) {
136 include_once("$phpgacl_location/gacl_api.class.php");
137 $gacl = new gacl_api();
139 die("You must first set up library/acl.inc to use phpGACL!");
142 $acl_version = get_acl_version();
143 if (empty($acl_version)) {
147 // Upgrade for acl_version 1
149 if ($acl_version < $upgrade_acl) {
150 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
152 //Collect the ACL ID numbers.
153 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
154 //Get Administrator ACL ID number
155 $admin_write = getAclIdNumber('Administrators', 'write');
156 //Get Doctor ACL ID Number
157 $doc_write = getAclIdNumber('Physicians', 'write');
158 //Get Clinician ACL with write access ID number
159 $clin_write = getAclIdNumber('Clinicians', 'write');
160 //Get Clinician ACL with addonly access ID number
161 $clin_addonly = getAclIdNumber('Clinicians', 'addonly');
162 //Get Receptionist ACL ID number
163 $front_write = getAclIdNumber('Front Office', 'write');
164 //Get Accountant ACL ID number
165 $back_write = getAclIdNumber('Accounting', 'write');
167 //Add new object Sections
168 echo "<BR/><B>Adding new object sections</B><BR/>";
169 //Add 'Sensitivities' object section (added in 2.8.2)
170 addObjectSectionAcl('sensitivities', 'Sensitivities');
171 //Add 'Lists' object section (added in 3.0.2)
172 addObjectSectionAcl('lists', 'Lists');
173 //Add 'Placeholder' object section (added in 3.0.2)
174 addObjectSectionAcl('placeholder', 'Placeholder');
175 //Add 'Nation Notes' object section (added in 4.1.0)
176 addObjectSectionAcl('nationnotes', 'Nation Notes');
177 //Add 'Patient Portal' object section (added in 4.1.0)
178 addObjectSectionAcl('patientportal', 'Patient Portal');
181 echo "<BR/><B>Adding new objects</B><BR/>";
182 //Add 'Normal' sensitivity object, order variable is default 10 (added in 2.8.2)
183 addObjectAcl('sensitivities', 'Sensitivities', 'normal', 'Normal');
184 //Add 'High' sensitivity object, order variable is set to 20 (added in 2.8.2)
185 addObjectAclWithOrder('sensitivities', 'Sensitivities', 'high', 'High', 20);
186 //Add 'Pharmacy Dispensary' object (added in 2.8.4)
187 addObjectAcl('admin', 'Administration', 'drugs', 'Pharmacy Dispensary');
188 //Add 'ACL Administration' object (added in 2.8.4)
189 addObjectAcl('admin', 'Administration', 'acl', 'ACL Administration');
190 //Add 'Price Discounting' object (added in 2.8.4)
191 addObjectAcl('acct', 'Accounting', 'disc', 'Price Discounting');
192 //Add 'Default List (write,addonly optional)' object (added in 3.0.2)
193 addObjectAcl('lists', 'Lists', 'default', 'Default List (write,addonly optional)');
194 //Add 'State List (write,addonly optional)' object (added in 3.0.2)
195 addObjectAcl('lists', 'Lists', 'state', 'State List (write,addonly optional)');
196 //Add 'Country List (write,addonly optional)' object (added in 3.0.2)
197 addObjectAcl('lists', 'Lists', 'country', 'Country List (write,addonly optional)');
198 //Add 'Language List (write,addonly optional)' object (added in 3.0.2)
199 addObjectAcl('lists', 'Lists', 'language', 'Language List (write,addonly optional)');
200 //Add 'Ethnicity-Race List (write,addonly optional)' object (added in 3.0.2)
201 addObjectAcl('lists', 'Lists', 'ethrace', 'Ethnicity-Race List (write,addonly optional)');
202 //Add 'Placeholder (Maintains empty ACLs)' object (added in 3.0.2)
203 addObjectAcl('placeholder', 'Placeholder', 'filler', 'Placeholder (Maintains empty ACLs)');
204 //Add 'Sign Lab Results (write,addonly optional)' object (added in 3.3.0)
205 addObjectAcl('patients', 'Patients', 'sign', 'Sign Lab Results (write,addonly optional)');
206 //Add 'nationnotes' object (added in 4.1.0)
207 addObjectAcl('nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure');
208 //Add 'patientportal' object (added in 4.1.0)
209 addObjectAcl('patientportal', 'Patient Portal', 'portal', 'Patient Portal');
211 //Update already existing Objects
212 echo "<BR/><B>Upgrading objects</B><BR/>";
213 //Ensure that 'High' sensitivity object order variable is set to 20
214 editObjectAcl('sensitivities', 'Sensitivities', 'high', 'High', 20);
216 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
217 // (will also place in the appropriate group and CREATE a new group if needed)
218 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
219 //Add 'Physicians' ACL with 'addonly' and collect the ID number (added in 3.0.2)
220 $doc_addonly = addNewACL('Physicians', 'doc', 'addonly', 'Things that physicians can read and enter but not modify');
221 //Add 'Front Office' ACL with 'addonly' and collect the ID number (added in 3.0.2)
222 $front_addonly = addNewACL('Front Office', 'front', 'addonly', 'Things that front office can read and enter but not modify');
223 //Add 'Accounting' ACL with 'addonly' and collect the ID number (added in 3.0.2)
224 $back_addonly = addNewACL('Accounting', 'back', 'addonly', 'Things that back office can read and enter but not modify');
225 //Add 'Emergency Login' ACL with 'write' and collect the ID number (added in 3.3.0)
226 $emergency_write = addNewACL('Emergency Login', 'breakglass', 'write', 'Things that can use for emergency login, can read and modify');
229 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
230 //Insert the 'super' object from the 'admin' section into the Administrators group write ACL (added in 2.8.2)
231 updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'super', 'Superuser', 'write');
232 //Insert the 'high' object from the 'sensitivities' section into the Administrators group write ACL (added in 2.8.2)
233 updateAcl($admin_write, 'Administrators', 'sensitivities', 'Sensitivities', 'high', 'High', 'write');
234 //Insert the 'normal' object from the 'sensitivities' section into the Administrators group write ACL (added in 2.8.2)
235 updateAcl($admin_write, 'Administrators', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'write');
236 //Insert the 'high' object from the 'sensitivities' section into the Physicians group write ACL (added in 2.8.2)
237 updateAcl($doc_write, 'Physicians', 'sensitivities', 'Sensitivities', 'high', 'High', 'write');
238 //Insert the 'normal' object from the 'sensitivities' section into the Physicians group write ACL (added in 2.8.2)
239 updateAcl($doc_write, 'Physicians', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'write');
240 //Insert the 'normal' object from the 'sensitivities' section into the Clinicians group addonly ACL (added in 2.8.2)
241 updateAcl($clin_addonly, 'Clinicians', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'addonly');
242 //Insert the 'drugs' object from the 'admin' section into the Administrators group write ACL (added in 2.8.4)
243 updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'drugs', 'Pharmacy Dispensary', 'write');
244 //Insert the 'drugs' object from the 'admin' section into the Physicians group write ACL (added in 2.8.4)
245 updateAcl($doc_write, 'Physicians', 'admin', 'Administration', 'drugs', 'Pharmacy Dispensary', 'write');
246 //Insert the 'drugs' object from the 'admin' section into the Clinicians group write ACL (added in 2.8.4)
247 updateAcl($clin_write, 'Clinicians', 'admin', 'Administration', 'drugs', 'Pharmacy Dispensary', 'write');
248 //Insert the 'acl' object from the 'admin' section into the Administrators group write ACL (added in 2.8.4)
249 updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'acl', 'ACL Administration', 'write');
250 //Insert the 'disc' object from the 'acct' section into the Administrators group write ACL (added in 2.8.4)
251 updateAcl($admin_write, 'Administrators', 'acct', 'Accounting', 'disc', 'Price Discounting', 'write');
252 //Insert the 'disc' object from the 'acct' section into the Accounting group write ACL (added in 2.8.4)
253 updateAcl($back_write, 'Accounting', 'acct', 'Accounting', 'disc', 'Price Discounting', 'write');
254 //Insert the 'disc' object from the 'acct' section into the Physicians group write ACL (added in 2.8.4)
255 updateAcl($doc_write, 'Physicians', 'acct', 'Accounting', 'disc', 'Price Discounting', 'write');
256 //Insert the 'default' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
257 updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'default', 'Default List (write,addonly optional)', 'write');
258 //Insert the 'state' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
259 updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'state', 'State List (write,addonly optional)', 'write');
260 //Insert the 'country' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
261 updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'country', 'Country List (write,addonly optional)', 'write');
262 //Insert the 'language' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
263 updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'language', 'Language List (write,addonly optional)', 'write');
264 //Insert the 'race' object from the 'lists' section into the Administrators group write ACL (added in 3.0.2)
265 updateAcl($admin_write, 'Administrators', 'lists', 'Lists', 'ethrace', 'Ethnicity-Race List (write,addonly optional)', 'write');
266 //Update ACLs for Emergency Login
267 //Insert the 'disc' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
268 updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'disc', 'Price Discounting', 'write');
269 //Insert the 'bill' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
270 updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'bill', 'Billing (write optional)', 'write');
271 //Insert the 'eob' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
272 updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'eob', 'EOB Data Entry', 'write');
273 //Insert the 'rep' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
274 updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'rep', 'Financial Reporting - my encounters', 'write');
275 //Insert the 'rep_a' object from the 'acct' section into the Emergency Login group write ACL (added in 3.3.0)
276 updateAcl($emergency_write, 'Emergency Login', 'acct', 'Accounting', 'rep_a', 'Financial Reporting - anything', 'write');
277 //Insert the 'calendar' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
278 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'calendar', 'Calendar Settings', 'write');
279 //Insert the 'database' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
280 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'database', 'Database Reporting', 'write');
281 //Insert the 'forms' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
282 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'forms', 'Forms Administration', 'write');
283 //Insert the 'practice' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
284 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'practice', 'Practice Settings', 'write');
285 //Insert the 'superbill' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
286 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'superbill', 'Superbill Codes Administration', 'write');
287 //Insert the 'users' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
288 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'users', 'Users/Groups/Logs Administration', 'write');
289 //Insert the 'batchcom' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
290 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'batchcom', 'Batch Communication Tool', 'write');
291 //Insert the 'language' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
292 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'language', 'Language Interface Tool', 'write');
293 //Insert the 'super' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
294 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'super', 'Superuser', 'write');
295 //Insert the 'drugs' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
296 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'drugs', 'Pharmacy Dispensary', 'write');
297 //Insert the 'acl' object from the 'admin' section into the Emergency Login group write ACL (added in 3.3.0)
298 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'acl', 'ACL Administration', 'write');
299 //Insert the 'auth_a' object from the 'encounters' section into the Emergency Login group write ACL (added in 3.3.0)
300 updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'auth_a', 'Authorize - any encounters', 'write');
301 //Insert the 'coding_a' object from the 'encounters' section into the Emergency Login group write ACL (added in 3.3.0)
302 updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'coding_a', 'Coding - any encounters (write,wsome optional)', 'write');
303 //Insert the 'notes_a' object from the 'encounters' section into the Emergency Login group write ACL (added in 3.3.0)
304 updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'notes_a', 'Notes - any encounters (write,addonly optional)', 'write');
305 //Insert the 'date_a' object from the 'encounters' section into the Emergency Login group write ACL (added in 3.3.0)
306 updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'date_a', 'Fix encounter dates - any encounters', 'write');
307 //Insert the 'default' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
308 updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'default', 'Default List (write,addonly optional)', 'write');
309 //Insert the 'state' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
310 updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'state', 'State List (write,addonly optional)', 'write');
311 //Insert the 'country' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
312 updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'country', 'Country List (write,addonly optional)', 'write');
313 //Insert the 'language' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
314 updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'language', 'Language List (write,addonly optional)', 'write');
315 //Insert the 'ethrace' object from the 'lists' section into the Emergency Login group write ACL (added in 3.3.0)
316 updateAcl($emergency_write, 'Emergency Login', 'lists', 'Lists', 'ethrace', 'Ethnicity-Race List (write,addonly optional)', 'write');
317 //Insert the 'appt' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
318 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'appt', 'Appointments (write,wsome optional)', 'write');
319 //Insert the 'demo' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
320 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'demo', 'Demographics (write,addonly optional)', 'write');
321 //Insert the 'med' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
322 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'med', 'Medical/History (write,addonly optional)', 'write');
323 //Insert the 'trans' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
324 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'trans', 'Transactions (write optional)', 'write');
325 //Insert the 'docs' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
326 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'docs', 'Documents (write,addonly optional)', 'write');
327 //Insert the 'notes' object from the 'patients' section into the Emergency Login group write ACL (added in 3.3.0)
328 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'notes', 'Patient Notes (write,addonly optional)', 'write');
329 //Insert the 'high' object from the 'sensitivities' section into the Emergency Login group write ACL (added in 3.3.0)
330 updateAcl($emergency_write, 'Emergency Login', 'sensitivities', 'Sensitivities', 'high', 'High', 'write');
331 //Insert the 'normal' object from the 'sensitivities' section into the Emergency Login group write ACL (added in 3.3.0)
332 updateAcl($emergency_write, 'Emergency Login', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'write');
333 //Insert the 'sign' object from the 'patients' section into the Physicians group write ACL (added in 3.3.0)
334 updateAcl($doc_write, 'Physicians', 'patients', 'Patients', 'sign', 'Sign Lab Results (write,addonly optional)', 'write');
335 //Insert the 'sign' object from the 'nationnotes' section into the Administrators group write ACL (added in 3.3.0)
336 updateAcl($admin_write, 'Administrators', 'nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure', 'write');
337 //Insert the 'sign' object from the 'nationnotes' section into the Emergency Login group write ACL (added in 3.3.0)
338 updateAcl($emergency_write, 'Emergency Login', 'nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure', 'write');
339 //Insert the 'patientportal' object from the 'patientportal' section into the Administrators group write ACL (added in 4.1.0)
340 updateAcl($admin_write, 'Administrators', 'patientportal', 'Patient Portal', 'portal', 'Patient Portal', 'write');
341 //Insert the 'patientportal' object from the 'patientportal' section into the Emergency Login group write ACL (added in 4.1.0)
342 updateAcl($emergency_write, 'Emergency Login', 'patientportal', 'Patient Portal', 'portal', 'Patient Portal', 'write');
344 //DONE with upgrading to this version
345 $acl_version = $upgrade_acl;
348 // Upgrade for acl_version 2
350 if ($acl_version < $upgrade_acl) {
351 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
353 //Collect the ACL ID numbers.
354 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
356 //Add new object Sections
357 echo "<BR/><B>Adding new object sections</B><BR/>";
360 echo "<BR/><B>Adding new objects</B><BR/>";
362 //Update already existing Objects
363 echo "<BR/><B>Upgrading objects</B><BR/>";
365 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
366 // (will also place in the appropriate group and CREATE a new group if needed)
367 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
368 addNewACL('Physicians', 'doc', 'wsome', 'Things that physicians can read and partly modify');
369 addNewACL('Clinicians', 'clin', 'wsome', 'Things that clinicians can read and partly modify');
370 addNewACL('Front Office', 'front', 'wsome', 'Things that front office can read and partly modify');
371 addNewACL('Accounting', 'back', 'wsome', 'Things that back office can read and partly modify');
372 addNewACL('Physicians', 'doc', 'view', 'Things that physicians can only read');
373 addNewACL('Clinicians', 'clin', 'view', 'Things that clinicians can only read');
374 addNewACL('Front Office', 'front', 'view', 'Things that front office can only read');
375 addNewACL('Accounting', 'back', 'view', 'Things that back office can only read');
378 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
380 //DONE with upgrading to this version
381 $acl_version = $upgrade_acl;
384 // Upgrade for acl_version 3
386 if ($acl_version < $upgrade_acl) {
387 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
389 //Collect the ACL ID numbers.
390 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
391 //Get Administrator ACL ID number
392 $admin_write = getAclIdNumber('Administrators', 'write');
393 //Get Emergency ACL ID number
394 $emergency_write = getAclIdNumber('Emergency Login', 'write');
396 //Add new object Sections
397 echo "<BR/><B>Adding new object sections</B><BR/>";
398 //Add 'Menus' object section (added in 4.1.3)
399 addObjectSectionAcl('menus', 'Menus');
402 echo "<BR/><B>Adding new objects</B><BR/>";
403 //Add 'modules' object (added in 4.1.3)
404 addObjectAcl('menus', 'Menus', 'modle', 'Modules');
406 //Update already existing Objects
407 echo "<BR/><B>Upgrading objects</B><BR/>";
409 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
410 // (will also place in the appropriate group and CREATE a new group if needed)
411 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
414 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
415 //Insert the 'Modules' object from the 'Menus' section into the Administrators group write ACL (added in 4.1.3)
416 updateAcl($admin_write, 'Administrators', 'menus', 'Menus', 'modle', 'Modules', 'write');
417 //Insert the 'Modules' object from the 'Menus' section into the Emergency Login group write ACL (added in 4.1.3)
418 updateAcl($emergency_write, 'Emergency Login', 'menus', 'Menus', 'modle', 'Modules', 'write');
420 //DONE with upgrading to this version
421 $acl_version = $upgrade_acl;
424 // Upgrade for acl_version 4
426 if ($acl_version < $upgrade_acl) {
427 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
429 //Collect the ACL ID numbers.
430 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
431 //Get Administrator ACL ID number
432 $admin_write = getAclIdNumber('Administrators', 'write');
433 //Get Doctor ACL ID Number
434 $doc_write = getAclIdNumber('Physicians', 'write');
435 //Get Clinician ACL with write access ID number
436 $clin_write = getAclIdNumber('Clinicians', 'write');
437 //Get Clinician ACL with addonly access ID number
438 $clin_addonly = getAclIdNumber('Clinicians', 'addonly');
439 //Get Receptionist ACL ID number
440 $front_write = getAclIdNumber('Front Office', 'write');
441 //Get Accountant ACL ID number
442 $back_write = getAclIdNumber('Accounting', 'write');
444 //Add new object Sections
445 // echo "<BR/><B>Adding new object sections</B><BR/>";
448 echo "<BR/><B>Adding new objects</B><BR/>";
449 // Add 'Patient Reminders (write,addonly optional)' object (added in 5.0.1)
450 addObjectAcl('patients', 'Patients', 'reminder', 'Patient Reminders (write,addonly optional)');
451 // Add 'Clinical Reminders/Alerts (write,addonly optional)' object (added in 5.0.1)
452 addObjectAcl('patients', 'Patients', 'alert', 'Clinical Reminders/Alerts (write,addonly optional)');
453 // Add 'Disclosures (write,addonly optional)' object (added in 5.0.1)
454 addObjectAcl('patients', 'Patients', 'disclosure', 'Disclosures (write,addonly optional)');
455 // Add 'Prescriptions (write,addonly optional)' object (added in 5.0.1)
456 addObjectAcl('patients', 'Patients', 'rx', 'Prescriptions (write,addonly optional)');
457 // Add 'Amendments (write,addonly optional)' object (added in 5.0.1)
458 addObjectAcl('patients', 'Patients', 'amendment', 'Amendments (write,addonly optional)');
459 // Add 'Lab Results (write,addonly optional)' object (added in 5.0.1)
460 addObjectAcl('patients', 'Patients', 'lab', 'Lab Results (write,addonly optional)');
462 //Update already existing Objects
463 // echo "<BR/><B>Upgrading objects</B><BR/>";
465 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
466 // (will also place in the appropriate group and CREATE a new group if needed)
467 // echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
470 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
471 //Insert the 'reminder' object from the 'patients' section into the Physicians group write ACL (added in 5.0.1)
472 updateAcl($doc_write, 'Physicians', 'patients', 'Patients', 'reminder', 'Patient Reminders (write,addonly optional)', 'write');
473 //Insert the 'alert' object from the 'patients' section into the Physicians group write ACL (added in 5.0.1)
474 updateAcl($doc_write, 'Physicians', 'patients', 'Patients', 'alert', 'Clinical Reminders/Alerts (write,addonly optional)', 'write');
475 //Insert the 'disclosure' object from the 'patients' section into the Physicians group write ACL (added in 5.0.1)
476 updateAcl($doc_write, 'Physicians', 'patients', 'Patients', 'disclosure', 'Disclosures (write,addonly optional)', 'write');
477 //Insert the 'rx' object from the 'patients' section into the Physicians group write ACL (added in 5.0.1)
478 updateAcl($doc_write, 'Physicians', 'patients', 'Patients', 'rx', 'Prescriptions (write,addonly optional)', 'write');
479 //Insert the 'amendment' object from the 'patients' section into the Physicians group write ACL (added in 5.0.1)
480 updateAcl($doc_write, 'Physicians', 'patients', 'Patients', 'amendment', 'Amendments (write,addonly optional)', 'write');
481 //Insert the 'lab' object from the 'patients' section into the Physicians group write ACL (added in 5.0.1)
482 updateAcl($doc_write, 'Physicians', 'patients', 'Patients', 'lab', 'Lab Results (write,addonly optional)', 'write');
483 //DONE with upgrading to this version
484 $acl_version = $upgrade_acl;
487 //This is a template for a new revision, when needed
488 // Upgrade for acl_version 5
490 if ($acl_version < $upgrade_acl) {
491 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
493 //Collect the ACL ID numbers.
494 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
495 //Get Accountant ACL ID number
496 $admin_write = getAclIdNumber('Administrators', 'write');
499 //Add new object Sections
500 echo "<BR/><B>Adding new object sections</B><BR/>";
501 // Add 'Groups' object (added in 5.0.1)
502 addObjectSectionAcl('groups', 'Groups');
506 echo "<BR/><B>Adding new objects</B><BR/>";
507 // Add 'Multipledb' object (added in 5.0.1)
508 addObjectAcl('admin', 'Administration', 'multipledb', 'Multipledb');
509 addObjectAcl('groups', 'Groups', 'gadd', 'View/Add/Update groups');
510 addObjectAcl('groups', 'Groups', 'gcalendar', 'View/Create/Update groups appointment in calendar');
511 addObjectAcl('groups', 'Groups', 'glog', 'Group encounter log');
512 addObjectAcl('groups', 'Groups', 'gdlog', 'Group detailed log of appointment in patient record');
513 addObjectAcl('groups', 'Groups', 'gm', 'Send message from the permanent group therapist to the personal therapist');
514 //Update already existing Objects
515 echo "<BR/><B>Upgrading objects</B><BR/>";
517 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
518 // (will also place in the appropriate group and CREATE a new group if needed)
519 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
522 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
523 updateAcl($admin_write, 'Administrators', 'groups', 'Groups', 'gadd', 'View/Add/Update groups', 'write');
524 updateAcl($admin_write, 'Administrators', 'groups', 'Groups', 'gcalendar', 'View/Create/Update groups appointment in calendar', 'write');
525 updateAcl($admin_write, 'Administrators', 'groups', 'Groups', 'glog', 'Group encounter log', 'write');
526 updateAcl($admin_write, 'Administrators', 'groups', 'Groups', 'gdlog', 'Group detailed log of appointment in patient record', 'write');
527 updateAcl($admin_write, 'Administrators', 'groups', 'Groups', 'gm', 'Send message from the permanent group therapist to the personal therapist', 'write');
528 //Insert the 'Multipledb' object from the 'admin' section into the Administrators group write ACL (added in 5.0.1)
529 updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'multipledb', 'Multipledb', 'write');
530 //DONE with upgrading to this version
531 $acl_version = $upgrade_acl;
534 // Upgrade for acl_version 6
536 if ($acl_version < $upgrade_acl) {
537 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
539 //Collect the ACL ID numbers.
540 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
541 $admin_write = getAclIdNumber('Administrators', 'write');
542 $doc_write = getAclIdNumber('Physicians', 'write');
543 $clin_addonly = getAclIdNumber('Clinicians', 'addonly');
544 $clin_write = getAclIdNumber('Clinicians', 'write');
545 $front_view = getAclIdNumber('Front Office', 'view');
546 $front_write = getAclIdNumber('Front Office', 'write');
547 $back_view = getAclIdNumber('Accounting', 'view');
548 $emergency_write = getAclIdNumber('Emergency Login', 'write');
550 //Add new object Sections
551 echo "<BR/><B>Adding new object sections</B><BR/>";
552 addObjectAcl('admin', 'Administration', 'menu', 'Menu');
555 echo "<BR/><B>Adding new objects</B><BR/>";
557 //Update already existing Objects
558 echo "<BR/><B>Upgrading objects</B><BR/>";
560 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
561 // (will also place in the appropriate group and CREATE a new group if needed)
562 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
565 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
566 updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'menu', 'Menu', 'write');
568 updateAcl($admin_write, 'Administrators', 'encounters', 'Encounters', 'auth', 'Authorize - my encounters', 'write');
569 updateAcl($admin_write, 'Administrators', 'encounters', 'Encounters', 'coding', 'Coding - my encounters (write,wsome optional)', 'write');
570 updateAcl($admin_write, 'Administrators', 'encounters', 'Encounters', 'notes', 'Notes - my encounters (write,addonly optional)', 'write');
571 updateAcl($admin_write, 'Administrators', 'encounters', 'Encounters', 'relaxed', 'Less-private information (write,addonly optional)', 'write');
573 updateAcl($admin_write, 'Administrators', 'patients', 'Patients', 'sign', 'Sign Lab Results (write,addonly optional)', 'write');
574 updateAcl($admin_write, 'Administrators', 'patients', 'Patients', 'reminder', 'Patient Reminders (write,addonly optional)', 'write');
575 updateAcl($admin_write, 'Administrators', 'patients', 'Patients', 'alert', 'Clinical Reminders/Alerts (write,addonly optional)', 'write');
576 updateAcl($admin_write, 'Administrators', 'patients', 'Patients', 'disclosure', 'Disclosures (write,addonly optional)', 'write');
577 updateAcl($admin_write, 'Administrators', 'patients', 'Patients', 'rx', 'Prescriptions (write,addonly optional)', 'write');
578 updateAcl($admin_write, 'Administrators', 'patients', 'Patients', 'amendment', 'Amendments (write,addonly optional)', 'write');
579 updateAcl($admin_write, 'Administrators', 'patients', 'Patients', 'lab', 'Lab Results (write,addonly optional)', 'write');
581 updateAcl($doc_write, 'Physicians', 'encounters', 'Encounters', 'auth', 'Authorize - my encounters', 'write');
582 updateAcl($doc_write, 'Physicians', 'encounters', 'Encounters', 'coding', 'Coding - my encounters (write,wsome optional)', 'write');
583 updateAcl($doc_write, 'Physicians', 'encounters', 'Encounters', 'notes', 'Notes - my encounters (write,addonly optional)', 'write');
584 updateAcl($doc_write, 'Physicians', 'encounters', 'Encounters', 'relaxed', 'Less-private information (write,addonly optional)', 'write');
586 updateAcl($doc_write, 'Physicians', 'groups', 'Groups', 'gcalendar', 'View/Create/Update groups appointment in calendar', 'write');
587 updateAcl($doc_write, 'Physicians', 'groups', 'Groups', 'glog', 'Group encounter log', 'write');
589 updateAcl($clin_addonly, 'Clinicians', 'patients', 'Patients', 'trans', 'Transactions (write optional)', 'addonly');
590 updateAcl($clin_addonly, 'Clinicians', 'patients', 'Patients', 'reminder', 'Patient Reminders (write,addonly optional)', 'addonly');
591 updateAcl($clin_addonly, 'Clinicians', 'patients', 'Patients', 'alert', 'Clinical Reminders/Alerts (write,addonly optional)', 'addonly');
592 updateAcl($clin_addonly, 'Clinicians', 'patients', 'Patients', 'disclosure', 'Disclosures (write,addonly optional)', 'addonly');
593 updateAcl($clin_addonly, 'Clinicians', 'patients', 'Patients', 'rx', 'Prescriptions (write,addonly optional)', 'addonly');
594 updateAcl($clin_addonly, 'Clinicians', 'patients', 'Patients', 'amendment', 'Amendments (write,addonly optional)', 'addonly');
595 updateAcl($clin_addonly, 'Clinicians', 'patients', 'Patients', 'lab', 'Lab Results (write,addonly optional)', 'addonly');
597 updateAcl($clin_write, 'Clinicians', 'groups', 'Groups', 'gcalendar', 'View/Create/Update groups appointment in calendar', 'write');
598 updateAcl($clin_write, 'Clinicians', 'groups', 'Groups', 'glog', 'Group encounter log', 'write');
600 updateAcl($front_view, 'Front Office', 'patients', 'Patients', 'alert', 'Clinical Reminders/Alerts (write,addonly optional)', 'view');
602 updateAcl($front_write, 'Front Office', 'groups', 'Groups', 'gcalendar', 'View/Create/Update groups appointment in calendar', 'write');
604 updateAcl($back_view, 'Accounting', 'patients', 'Patients', 'alert', 'Clinical Reminders/Alerts (write,addonly optional)', 'view');
606 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'multipledb', 'Multipledb', 'write');
607 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'menu', 'Menu', 'write');
608 updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'auth', 'Authorize - my encounters', 'write');
609 updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'coding', 'Coding - my encounters (write,wsome optional)', 'write');
610 updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'notes', 'Notes - my encounters (write,addonly optional)', 'write');
611 updateAcl($emergency_write, 'Emergency Login', 'encounters', 'Encounters', 'relaxed', 'Less-private information (write,addonly optional)', 'write');
612 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'sign', 'Sign Lab Results (write,addonly optional)', 'write');
613 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'reminder', 'Patient Reminders (write,addonly optional)', 'write');
614 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'alert', 'Clinical Reminders/Alerts (write,addonly optional)', 'write');
615 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'disclosure', 'Disclosures (write,addonly optional)', 'write');
616 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'rx', 'Prescriptions (write,addonly optional)', 'write');
617 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'amendment', 'Amendments (write,addonly optional)', 'write');
618 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'lab', 'Lab Results (write,addonly optional)', 'write');
619 updateAcl($emergency_write, 'Emergency Login', 'groups', 'Groups', 'gadd', 'View/Add/Update groups', 'write');
620 updateAcl($emergency_write, 'Emergency Login', 'groups', 'Groups', 'gcalendar', 'View/Create/Update groups appointment in calendar', 'write');
621 updateAcl($emergency_write, 'Emergency Login', 'groups', 'Groups', 'glog', 'Group encounter log', 'write');
622 updateAcl($emergency_write, 'Emergency Login', 'groups', 'Groups', 'gdlog', 'Group detailed log of appointment in patient record', 'write');
623 updateAcl($emergency_write, 'Emergency Login', 'groups', 'Groups', 'gm', 'Send message from the permanent group therapist to the personal therapist', 'write');
625 //DONE with upgrading to this version
626 $acl_version = $upgrade_acl;
630 // Upgrade for acl_version 7
632 if ($acl_version < $upgrade_acl) {
633 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
635 //Collect the ACL ID numbers.
636 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
637 $admin_write = getAclIdNumber('Administrators', 'write');
638 $emergency_write = getAclIdNumber('Emergency Login', 'write');
640 //Add new object Sections
641 echo "<BR/><B>Adding new object sections</B><BR/>";
642 addObjectAcl('admin', 'Administration', 'manage_modules', 'Manage modules');
645 echo "<BR/><B>Adding new objects</B><BR/>";
647 //Update already existing Objects
648 echo "<BR/><B>Upgrading objects</B><BR/>";
650 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
651 // (will also place in the appropriate group and CREATE a new group if needed)
652 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
653 updateAcl($admin_write, 'Administrators', 'admin', 'Administration', 'manage_modules', 'Manage modules', 'write');
654 updateAcl($emergency_write, 'Emergency Login', 'admin', 'Administration', 'manage_modules', 'Manage modules', 'write');
657 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
659 //DONE with upgrading to this version
660 $acl_version = $upgrade_acl;
663 // Upgrade for acl_version 8
665 if ($acl_version < $upgrade_acl) {
666 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
668 //Collect the ACL ID numbers.
669 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
670 $admin_write = getAclIdNumber('Administrators', 'write');
671 $emergency_write = getAclIdNumber('Emergency Login', 'write');
673 //Add new object Sections
674 echo "<BR/><B>Adding new object sections</B><BR/>";
675 addObjectAcl('patients', 'Patients', 'docs_rm', 'Documents Delete');
678 echo "<BR/><B>Adding new objects</B><BR/>";
680 //Update already existing Objects
681 echo "<BR/><B>Upgrading objects</B><BR/>";
683 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
684 // (will also place in the appropriate group and CREATE a new group if needed)
685 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
686 updateAcl($admin_write, 'Administrators', 'patients', 'Patients', 'docs_rm', 'Documents Delete', 'write');
687 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'docs_rm', 'Documents Delete', 'write');
691 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
693 //DONE with upgrading to this version
694 $acl_version = $upgrade_acl;
697 // Upgrade for acl_version 9
699 if ($acl_version < $upgrade_acl) {
700 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
702 //Collect the ACL ID numbers.
703 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
704 $admin_write = getAclIdNumber('Administrators', 'write');
705 $accounting_view = getAclIdNumber('Accounting', 'view');
706 $clinicians_view = getAclIdNumber('Clinicians', 'view');
707 $emergency_write = getAclIdNumber('Emergency Login', 'write');
708 $frontoffice_view = getAclIdNumber('Front Office', 'view');
709 $physicians_view = getAclIdNumber('Physicians', 'view');
711 //Add new object Sections
712 echo "<BR/><B>Adding new object sections</B><BR/>";
715 echo "<BR/><B>Adding new objects</B><BR/>";
716 addObjectAcl('patients', 'Patients', 'pat_rep', 'Patient Report');
718 //Update already existing Objects
719 echo "<BR/><B>Upgrading objects</B><BR/>";
721 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
722 // (will also place in the appropriate group and CREATE a new group if needed)
723 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
724 updateAcl($admin_write, 'Administrators', 'patients', 'Patients', 'pat_rep', 'Patient Report', 'write');
725 updateAcl($accounting_view, 'Accounting', 'patients', 'Patients', 'pat_rep', 'Patient Report', 'view');
726 updateAcl($clinicians_view, 'Clinicians', 'patients', 'Patients', 'pat_rep', 'Patient Report', 'view');
727 updateAcl($emergency_write, 'Emergency Login', 'patients', 'Patients', 'pat_rep', 'Patient Report', 'write');
728 updateAcl($frontoffice_view, 'Front Office', 'patients', 'Patients', 'pat_rep', 'Patient Report', 'view');
729 updateAcl($physicians_view, 'Physicians', 'patients', 'Patients', 'pat_rep', 'Patient Report', 'view');
732 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
734 //DONE with upgrading to this version
735 $acl_version = $upgrade_acl;
738 /* This is a template for a new revision, when needed
739 // Upgrade for acl_version 10
741 if ($acl_version < $upgrade_acl) {
742 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
744 //Collect the ACL ID numbers.
745 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
747 //Add new object Sections
748 echo "<BR/><B>Adding new object sections</B><BR/>";
751 echo "<BR/><B>Adding new objects</B><BR/>";
753 //Update already existing Objects
754 echo "<BR/><B>Upgrading objects</B><BR/>";
756 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
757 // (will also place in the appropriate group and CREATE a new group if needed)
758 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
761 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
763 //DONE with upgrading to this version
764 $acl_version = $upgrade_acl;
768 /* This is a template for a new revision, when needed
769 // Upgrade for acl_version 11
771 if ($acl_version < $upgrade_acl) {
772 echo "<B>UPGRADING ACCESS CONTROLS TO VERSION ".$upgrade_acl.":</B></BR>";
774 //Collect the ACL ID numbers.
775 echo "<B>Checking to ensure all the proper ACL(access control list) are present:</B></BR>";
777 //Add new object Sections
778 echo "<BR/><B>Adding new object sections</B><BR/>";
781 echo "<BR/><B>Adding new objects</B><BR/>";
783 //Update already existing Objects
784 echo "<BR/><B>Upgrading objects</B><BR/>";
786 //Add new ACLs here (will return the ACL ID of newly created or already existant ACL)
787 // (will also place in the appropriate group and CREATE a new group if needed)
788 echo "<BR/><B>Adding ACLs(Access Control Lists) and groups</B><BR/>";
791 echo "<BR/><B>Updating the ACLs(Access Control Lists)</B><BR/>";
793 //DONE with upgrading to this version
794 $acl_version = $upgrade_acl;
799 $response = set_acl_version($acl_version);
802 echo "DONE upgrading access controls";
804 echo "ERROR upgrading access control version";