Is there any way to update OpenEMR config from code behind/ change some setting file?

Without using OpenEMR interface is there any way through which I can update settings of “Admin-> Global-> Connectors” from code behind or by changing some settings from any config file ?

hi milan,
there is a large number of fields in the connectors page - which ones did you want to change? also i’m curious as to why you’d not want to use the interface?

Hi Ruth,

This is the customer requirement where he don’t want to expose OpenEMR Interface to their other admin users.

Below are the fields :

  1. Enable OpenEMR Standard FHIR REST API
  2. Enable OpenEMR FHIR System Scopes (Turn on only if you know what you are doing)
  3. Enable OpenEMR Standard REST API
  4. Enable OpenEMR Patient Portal REST API (EXPERIMENTAL)
  5. Enable OAuth2 Password Grant (Not considered secure)’ select ‘On for Both Roles
  6. OAuth2 App Manual Approval Settings’ select ‘Patient standalone apps Auto Approved

I think most of those settings are in the “globals” data table.

Of course, there is the possibility of damaging your emr setup if you trash this data table so use all precautions like backing up the table, using a sandbox server, and etc. while developing and testing.

1 Like

thanks DC, yes i think they are all in the db ‘globals’ table.

You may be able to create a new ACL using the Administrator ACL as a start. Then put other admins with new ACL

In actual scenario we are planning to run openEMR through docker, so we just wanted to automate to set few global configurations at the time of running docker image through any script.
So, is there any way where we can write script which update global configuration ?

So you can use probably any scripting language that can connect to a mariadb database and then change the values of the specific global settings you want changed in the global data table.

I recommend using php to do that, since php will already be installed and it’s easy enough to work with.

As mentioned earlier, take precautions against messing up your database and test the script before running on production server.

Take a look at my Weno modules service interface/modules/custom_modules/oe-module-weno/src/Services/ModuleService.php saveVenorGlobals() and getVenorGlobals()

These methods will give you a very good idea of what you’re trying to do.

BTW: thanks everyone who has offered help here. Us admins are grateful when folks from the community collaborate to help the other folks.