This is the OpenMRS backend configuration for the OpenMRS distribution KenyaEMR.
This configuration is designed to be loaded by:
To build assets for deployment:
-
Install Node.js v16 or above on your system from Node.js website.
-
Two scripts are available to generate frontend assets for deployment: one for the development environment and one for production.
sh prod-build.sh
sh dev-build.sh
Both scripts generate frontend assets for deployment. Note that for the production build, the
configURL
inindex.html
must be updated, and theconfig.json
file must be updated to include the deployed serverurl
. For example, for our test instance, theindex.html
configURL
ishttp://197.248.44.226:8500/openmrs/spa/config.json
. -
The built assets are located in a folder named
frontend
. Copy these files to the frontend directory, for example,/var/lib/OpenMRS
.
Please note that our work on patient-registration and esm-login contain custom changes and require updating the respective JavaScript assets:
-
Download the version of KenyaEMR you want to run from github release latest
-
Spin up the docker compose file by running
docker compose up -d
-
Get the containers id. By running the above command two containers are spinned up namely:
mysql-container
tomcat-container
docker ps
-
Copy the modules folder and
openmrs.war
file to tomcat containerdocker cp modules <containerID>:/usr/local/tomcat docker cp openmr.war <containerId>:/usr/local/tomcat/webapps
-
Copy
demo.sql
database file to mysql container. This is back-up file of an existing instancedocker cp demo.sql <containerID>:/home
-
Execute the following sql in mysql container file
docker exec -it <MySQLContaineID> bash
Once in the container
mysql -u root -p
create database openmrs; use openmrs; source /path-to-mysql-demo.sql grant all privileges on *.* to 'openmrs_user'@'%';flush privileges;use openmrs;delete from liquibasechangelog where id like '%charts%';where id like '%charts%';
Run this stored procedures to create etl tables for KenyaEMR
call create_etl_tables(); call sp_first_time_setup();
-
Restart both container sequentially, important to note that restart mysql-container first then tomcat container after
docker restart <MySQLContainerID> docker restart <TomcatContainerID>