Help! in-house drug database is missing

penguin8r wrote on Wednesday, August 29, 2007:

I have an install of OpenEMR 2.8.3, was originally 2.8.3 CVS, now upgraded to 2.8.3 final.  I have the in-house pharmaceutical variable in globals.php set to true, but when I go to the admin frame in OpenEMR, the Drugs section that I see in other installs is not there.  What other steps do I need to take to enable this?  everywhere else just setting that global variable to true has bee all that was necessary.  I’ve checked in MySQL & the drug tables are there, waiting to be populated.  Anyone have any ideas?

TIA

sunsetsystems wrote on Wednesday, August 29, 2007:

There is a “drugs” ACO in the “admin” permissions section that you need access to in order to see this area.  Somehow this didn’t get documented in acl.inc.

Rod
www.sunsetsystems.com

penguin8r wrote on Wednesday, August 29, 2007:

Rod, thanks for the tip, I’ve only recently started getting serious with PhPGACL, any hints on how to fix?

sunsetsystems wrote on Wednesday, August 29, 2007:

You may find the screenshots at http://www.sunsetsystems.com/node/19 to be helpful.

Rod
www.sunsetsystems.com

penguin8r wrote on Wednesday, August 29, 2007:

OK, I have a basic understanding now of how GACL works, but I am unable to find anything in either the OpenEMR or PhPGACL documentation that gives an idea of how to add the drugs section into PhPGACL in order to have the ability to grant access to it.  I’m now going through both the OpenEMR & GACL databases in MySQL to try to find how the two are interconnected & what changes have to be made to each to make the drugs admin option available.  There doesn’t seem to be any way to do it from the PhPGACL admin interface, so it looks like the necessary changes have to be made manually within the databases.  will post the results if/when I figure it out.  Note to anyone else out there considering PHPGACL, be very careful, once you enable it you cannot disable it without breaking parts of OpenEMR, so think about it before you use it.

bradymiller wrote on Thursday, August 30, 2007:

hey,

If you want to turn off php-gacl, just edit the gacl.class.php file, which is in the main phpgacl directory.
In the ‘gacl.class.php’ file:
Go to ‘function acl_check(…)’
In that function comment out ‘return $acl_result[‘allow’];’
And put ‘return 1;’ instead

This will basically return TRUE for any ‘acl_check(…)’ statement that openemr runs, in effect php-gacl access controls is turned off. Of course, this will effect any other programs using php-gacl.

I’m not a php programmer, so if somebody has a simpler way, please let us know.

It would be nice to have the option of turning off/on phpgacl in the openemr config file. Again, I’m not a php programmer, but I’m guessing it would require surrounding each acl_check(…) with a conditional(Or is there a global way to do this)

-brady

bradymiller wrote on Thursday, August 30, 2007:

Sorry,

In above hack, there’s a problem with using ‘return 1;’, no access to make new patients. Instead of inserting ‘return 1;’  insert the statement ‘return ‘write’;’ . That seems to turn off all access controls.

-brady

sunsetsystems wrote on Thursday, August 30, 2007:

Better to modify openemr/library/acl.inc.  This is where you can disable access to phpGACL and put in your own custom logic for access control.

Rod
www.sunsetsystems.com

bradymiller wrote on Thursday, August 30, 2007:

hey,

   I feel rather foolish, but it appears you just have to comment out the ‘$phpgacl_location = “…”;’ line near the top of the openemr/library/acl.inc file. Then it seems to disable phpgacl and go back to the default openemr access behavior.

-brady

penguin8r wrote on Thursday, August 30, 2007:

Thanks for the ideas, I will try those this evening, as I still haven’t had any luck getting PHPGACL to incorporate the drug subsection in Admin.  I hate to shut off the safeguards that GACL gives you, but when it’s stopping the doctors from being able to properly use the system there isn’t much choice.

bradymiller wrote on Monday, September 10, 2007:

hey,
  I was very impressed with this in-house drug database feature(it’s very cool-thanks Rod!!), so wrote a quick howto on getting it to work with php-gacl. The temporary link for instructions is at(may take awhile to download because of numerous screenshots):

http://www.sparmy.com/temp/

At some point, after fully tested, I’m gonna put it in the Virtual Appliance Manual
-Brady

sunsetsystems wrote on Monday, September 10, 2007:

Thanks Brady, very good of you to do this!

Rod
www.sunsetsystems.com