How to Patch OpenEMR to latest MedEx files?


(Ralf Lukner MD PhD) #1

Situation
No appointments being sent to MedEx. Worked with Ray last night but neither of us could remember out how to get into the docker OpenEMR MedEx directory to look at the API.php file for MedEx. He confirmed that no messages were being sent and the status for the appointments did not show that they were being processed. Recall single patient also did not send a message.

OpenEMR Version
I’m using OpenEMR version 5.0.1 patch 7 (thank you Sherwin Gattis) with curl installed on AWS Standard (ditto).

Browser:
I’m using: Firefox (now that patch 7 broke the calendar and Chrome no longer opens OpenEMR).

Operating System
I’m using: Amazon AWS EC2 (hosted) Standard

Logs
Did you check the logs? Was there anything pertinent in them? Paste them here (surround with three backticks (```) for readability.

How do I read the logs?

Thank you in advance,
Ralf


(Ralf Lukner MD PhD) #2

I’m going to try

sudo docker exec -it standard_openemr_1

(which I stole from one of @sherwingaddis posts)


(R Magauran) #3

The question for aws users is how do they upload the latest MedEx 5.01 files to a docker instance. For linux is as simple as unzipping the file in the root /openemr directory. I’m sure there must be a simple way to do this but I am a docker novice. Please advise.


(Ralf Lukner MD PhD) #4

I tried
sudo docker logs standard_openemr_1
and got …
Generating a 4096 bit RSA private key

…++

…++

writing new private key to ‘/etc/ssl/private/selfsigned.key.pem’


Running quick setup!

<b>Configuration:</b><br/>

driver = <b>mysqli_mod</b>,<br/>

host = <b>or1xhybjytz0lew.cydpnbzyq3qr.us-east-1.rds.amazonaws.com</b>,<br/>

user = <b>openemr</b>,<br/>

database = <b>openemr</b>,<br/>

table prefix = <b>gacl_</b>Testing database connection…<br/>

<font color=“green”><b>Success!</b></font> Connected to &quot;<b>mysqli_mod</b>&quot; database on &quot;<b>or1xhybjytz0lew.cydpnbzyq3qr.us-east-1.rds.amazonaws.com</b>&quot;.<br/>

Testing database type…<br/>

<font color=“green”><b>Success!</b></font> Compatible database type “<b>mysqli_mod</b>” detected!<br/>

Making sure database “<b>openemr</b>” exists…<br/>

<font color=“green”><b>Success!</b></font> Good, database “<b>openemr</b>” already exists!<br/>

<font color=“green”><b>Success!</b></font>

First Step of Access Control Installation Successful!!!<br><br/>

<html>

<head>

<title>OpenEMR ACL Setup</title>

<link rel=STYLESHEET href=“interface/themes/style_blue.css”>

</head>

<body>

<b>OpenEMR ACL Setup</b>

<br>

All done configuring and installing access controls (php-GACL)!

</body>

</html>

OpenEMR configured.

Setup Complete!

Setting user ‘www’ as owner of openemr/ and setting file/dir permissions to 400/500

Default file permissions and ownership set, allowing writing to specific directories

Removing remaining setup scripts

Setup scripts removed, we should be ready to go now!

Love OpenEMR? You can now support the project via the open collective:

> https://opencollective.com/openemr/donate

Starting cron daemon!

Starting apache!

AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 172.18.0.2. Set the ‘ServerName’ directive globally to suppress this message

Love OpenEMR? You can now support the project via the open collective:

> https://opencollective.com/openemr/donate

Starting cron daemon!

Starting apache!

AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 172.18.0.2. Set the ‘ServerName’ directive globally to suppress this message

Love OpenEMR? You can now support the project via the open collective:

> https://opencollective.com/openemr/donate

Starting cron daemon!

Starting apache!

AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 172.18.0.2. Set the ‘ServerName’ directive globally to suppress this message

Love OpenEMR? You can now support the project via the open collective:

> https://opencollective.com/openemr/donate

Starting cron daemon!

Starting apache!

AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 172.18.0.2. Set the ‘ServerName’ directive globally to suppress this message

Love OpenEMR? You can now support the project via the open collective:

> https://opencollective.com/openemr/donate

Starting cron daemon!

Starting apache!

AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 172.18.0.2. Set the ‘ServerName’ directive globally to suppress this message

Love OpenEMR? You can now support the project via the open collective:

> https://opencollective.com/openemr/donate

Starting cron daemon!

Starting apache!

AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 172.18.0.2. Set the ‘ServerName’ directive globally to suppress this message

Love OpenEMR? You can now support the project via the open collective:

> https://opencollective.com/openemr/donate

Starting cron daemon!

Starting apache!

AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 172.18.0.2. Set the ‘ServerName’ directive globally to suppress this message

Love OpenEMR? You can now support the project via the open collective:

> https://opencollective.com/openemr/donate

Starting cron daemon!

Starting apache!

AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 172.18.0.2. Set the ‘ServerName’ directive globally to suppress this message

Love OpenEMR? You can now support the project via the open collective:

> https://opencollective.com/openemr/donate

Starting cron daemon!

Starting apache!

AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 172.18.0.2. Set the ‘ServerName’ directive globally to suppress this message

Love OpenEMR? You can now support the project via the open collective:

> https://opencollective.com/openemr/donate

Starting cron daemon!

Starting apache!

AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 172.18.0.2. Set the ‘ServerName’ directive globally to suppress this message

Love OpenEMR? You can now support the project via the open collective:

> https://opencollective.com/openemr/donate

Starting cron daemon!

Starting apache!

AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 172.18.0.2. Set the ‘ServerName’ directive globally to suppress this message

httpd (pid 14) already running

Love OpenEMR? You can now support the project via the open collective:

> https://opencollective.com/openemr/donate

Starting cron daemon!

Starting apache!

AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 172.18.0.2. Set the ‘ServerName’ directive globally to suppress this message

Love OpenEMR? You can now support the project via the open collective:

> https://opencollective.com/openemr/donate

Starting cron daemon!

Starting apache!

AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 172.18.0.2. Set the ‘ServerName’ directive globally to suppress this message

Love OpenEMR? You can now support the project via the open collective:

> https://opencollective.com/openemr/donate

Starting cron daemon!

Starting apache!

AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 172.18.0.2. Set the ‘ServerName’ directive globally to suppress this message

Love OpenEMR? You can now support the project via the open collective:

> https://opencollective.com/openemr/donate

Starting cron daemon!

Starting apache!

AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 172.18.0.2. Set the ‘ServerName’ directive globally to suppress this message


(Stephen Waite) #5

after docker ps from a sudo bash shell to obtain the container id you docker cp the file:

docker cp script.php <openemr container id>:/var/www/localhost/htdocs/openemr/<path to file>


(Brady Miller) #6

Also, regarding docker exec, you need to place the command at the end, which in this case is sh to start the sh shell:
docker exec -it standard_openemr_1 sh


(Ralf Lukner MD PhD) #7

I saved a copy of the original API.php by copying it to API.php.old. Then I copied the API.php from the medexbank.co/assets/zip/MedEx_5.0.1.zip to the …/openemr/library/MedEx/ directory … that did not work so well. When I tried the flowboard, I got the following error: Query Error:
ERROR: query failed: UPDATE medex_prefs set status =?
Error: Unknown column ‘status’ in the ‘field list’
/var/www/localhost/htdocs/openemr/library/MedEx/API.php at 3571:sqlQuery …
I then copied the old API.php file back, but my flowboard does not work. Do I need to restart the Apache server? Is there something else that I need to do to clear this error condition?


(Ralf Lukner MD PhD) #8

Ok, I actually read the README file of the MedEx zip :blush: .
Here is what it says:
Here are the steps to update MedEx on your server:

  1. PhpMyAdmin -
    add a field to the medex_prefs table in your openemr database:

    ALTER TABLE medex_prefs ADD COLUMN status text;

    Reconfigure background_services:
    UPDATE ‘background_services’ SET ‘execute_interval’=5, active=1, running=0, require_once=’/library/MedEx/MedEx_background.php’ WHERE ‘name’=‘MedEx’;

Ok … How do I access PhpMyAdmin?


(Stephen Waite) #9

might be easier to access the mysql docker, docker exec -it $(docker ps | grep mysql | cut -f 1 -d " ") /bin/bash

from openemr-devops/packages/lightsail at master · openemr/openemr-devops · GitHub


(Ralf Lukner MD PhD) #10

I tried that and got the following error:
ubuntu@ip-10-0-1-83:~$ sudo docker exec -it $(docker ps | grep mysql | cut -f 1 -d " ") /bin/bash
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.29/containers/json: dial unix /var/run/docker.sock: connect: permission denied
“docker exec” requires at least 2 argument(s).
See ‘docker exec --help’.

Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG…]

Run a command in a running container


(Stephen Waite) #11

do these commands from sudo bash for ease of use


(Ralf Lukner MD PhD) #12

when I do a ps -a in docker, there is no mysql process

/var/www/localhost/htdocs/openemr # mysql -v

ERROR 1045 (28000): Access denied for user ‘root’@‘10.0.1.83’ (using password: NO)

If I try the database password, it says …
ERROR 1045 (28000): Access denied for user ‘root’@‘10.0.1.83’ (using password: YES)


(Stephen Waite) #13

looks like you’re in the openemr (apache) docker, get back to the instance root prompt and then you can get into the mysql shell


(Ralf Lukner MD PhD) #14

Do you mean like this:

root@ip-10-0-1-83 : ~ # docker exec -it $(docker ps | grep mysql | cut -f 1 -d " ") /bin/bash

“docker exec” requires at least 2 argument(s).

See ‘docker exec --help’.

Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG…]

Run a command in a running container

If I just run mysql -v from the command line of the instance:
root@ip-10-0-1-83 : ~ # mysql -v

The program ‘mysql’ can be found in the following packages:

  • mysql-client-core-5.7

  • mariadb-client-core-10.0

Try: apt install <selected package>

Does this mean I need to install the mysql client?

Keep in mind that my goal is …
add a field to the medex_prefs table in your openemr database:

ALTER TABLE medex_prefs ADD COLUMN status text;

Reconfigure background_services:
UPDATE ‘background_services’ SET ‘execute_interval’=5, active=1, running=0, require_once=’/library/MedEx/MedEx_background.php’ WHERE ‘name’=‘MedEx’;


(Ralf Lukner MD PhD) #15

I have made some progress …
Ok, so it turns out that evidently mysql-client-core-5.7 does need to be installed with the
apt install mysql-client-core-5.7
command
After this, one needs to obtain some information about the database … I had to go to Amazon RDS from the aws.amazon.com console.
Go to “databases”
Choose the database instance
Go to connectivity and security and get the “endpoint” (looks like a web address ending in amazonaws.com)
Then type the following command as sudo bash (root) in the openemr instance (not the database and not docker).
mysql -h .amazonaws.com -u openemr -p -P 3306
After typing the MySQL openemr (master user) password (which hopefully you remember, have written down, or can get from one of the password lists you have), the system will respond with something like this:
Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 11111111

Server version: 5.6.40-log Source distribution

Copyright © 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql>

Then connect to the openemr database

mysql> connect openemr
Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Connection id: 5092331
Current database: openemr

mysql>


(Stephen Waite) #16

ok, so you’re not running an aws cloud package?

wait it says aws standard in an earlier post, then you don’t need to install mysql since it’s running in a docker

see this: openemr-devops/packages/standard at master · openemr/openemr-devops · GitHub


(Ralf Lukner MD PhD) #17

True. My issue was that I am not very familiar with MySQL and by installing a MySQL client in the instance, I was then able to get Amazon support to help me quickly and easily. I was also able to refer to the MySQL client application document and make the changes that are required for MedEx to work correctly. MedEx is working well for me now. Thank you and thank you to everyone who helped guide me through this process. I’m excited because not only is MedEx a nice package for communicating with patients about appointment reminders, but I now know how to run Queries on my database directly and that opens up infinite possibilities to accessing my EMR data in a very precise and powerful manner.