Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OZ-742: Added Bahmni EMR to Ozone. #123

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
64d51f9
OZ-742: Added Bahmni EMR to Ozone
Ruhanga Nov 22, 2024
cfbfa8a
OZ-742: Added relevant environment variables.
Ruhanga Nov 22, 2024
799b9eb
Added Bahmni EMR backend health check.
Ruhanga Nov 25, 2024
3aa8d1f
General cleanup
Ruhanga Nov 25, 2024
7fe15a2
General cleanup
Ruhanga Nov 25, 2024
a28a9ee
Enhanced Bahmni EMR backend healthcheck
Ruhanga Nov 26, 2024
4951991
Enhanced Bahmni EMR backend healthcheck
Ruhanga Nov 26, 2024
c731ce3
Fixed Bahmni web's proxy redirections
Ruhanga Nov 26, 2024
c7fdc74
Fixed Bahmni config's proxy redirections
Ruhanga Nov 27, 2024
983401e
Fixed Bahmni's proxy configs
Ruhanga Nov 27, 2024
bd34d72
Fix missing Bahmni CGI resource
Ruhanga Nov 27, 2024
4dd46a8
OZ-742: Enabled overriding Bahmni Configurations
Ruhanga Dec 5, 2024
5582222
OZ-742: Minor cleanup refactor.
Ruhanga Dec 6, 2024
a674bd5
OZ-742: Minor cleanup refactor.
Ruhanga Dec 6, 2024
e6ca679
OZ-742: Fixed Bahmni Reports
Ruhanga Dec 6, 2024
b840441
OZ-742: Fixed Bahmni Reports
Ruhanga Dec 6, 2024
1ebe514
OZ-742: Pulled and rebased from upstream
Ruhanga Dec 16, 2024
e1d8faf
OZ-742: Added Bahmni EMR start script.
Ruhanga Dec 16, 2024
19a51c6
OZ-742: start-with-bahmniemr.sh executable.
Ruhanga Jan 9, 2025
053de49
OZ-742: Allow for mounting OpenMRS modules' path
Ruhanga Jan 16, 2025
a7abd08
OZ-742: Allow for mounting OpenMRS Iniz configuration path
Ruhanga Jan 17, 2025
1f4f2b6
OZ-742: Allow for mounting OpenMRS Iniz configuration path.
Ruhanga Jan 20, 2025
86a9c66
OZ-742: Fixed Bahmni config overrides.
Ruhanga Jan 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,93 @@ HOST_URL=${SERVER_SCHEME}://${HOST_NAME}
TIMEZONE=UTC
GITPOD_ENV=false
ENABLE_SSO=false

# Bahmni EMR

RUN_WITH_BAHMNI_EMR=false

# Mail Config Properties Environment Variables
MAIL_TRANSPORT_PROTOCOL=smtps
MAIL_SMTP_AUTH=true
MAIL_SMTP_STARTTLS_ENABLE=true
MAIL_SMTP_SSL_ENABLE=true
MAIL_DEBUG=false
SEND_MAIL=false
MAIL_FROM=
MAIL_SMTP_HOST=
MAIL_SMTP_PORT=
MAIL_USER=
MAIL_PASSWORD=

# Bahmni Config Environment Variables
BAHMNI_CONFIG_IMAGE_TAG=1.0.0
BAHMNI_CONFIG_VOLUME=bahmni-config
BAHMNI_CONFIG_OVERRIDE_PATH=

# OpenMRS Environment Variables
OPENMRS_HOST=openmrs
OPENMRS_PORT=8080
OPENMRS_IMAGE_TAG=1.1.1
OPENMRS_DB_IMAGE_NAME=bahmni/openmrs-db:1.0.0-standard
OPENMRS_DB_NAME=openmrs
OPENMRS_DB_HOST=openmrsdb
OPENMRS_DB_USERNAME=openmrs-user
OPENMRS_DB_PASSWORD=password
OPENMRS_DB_SQL_MODES='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'
OPENMRS_DB_CREATE_TABLES='true'
OPENMRS_DB_AUTO_UPDATE='true'
OPENMRS_MODULE_WEB_ADMIN='false'
# OMRS_DEV_DEBUG_PORT=
OMRS_JAVA_SERVER_OPTS=''
OMRS_JAVA_MEMORY_OPTS=''
OPENMRS_UPLOAD_FILES_PATH=./openmrs-uploads
BAHMNI_OPENMRS_MODULES_PATH=
OPENMRS_DB_TYPE=mysql
OMRS_C3P0_MAX_SIZE=50
WEIGHT_CONCEPT_UUID=5089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
HEIGHT_CONCEPT_UUID=5090AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
OPENMRS_DOCKER_ENV='true'
OMRS_DB_EXTRA_ARGS="&zeroDateTimeBehavior=convertToNull"
LUCENE_MATCH_TYPE="START"
DOCUMENT_MAX_SIZE_MB=

# Bahmni Web Environment Variables
BAHMNI_WEB_IMAGE_TAG=1.1.0
BAHMNI_APPS_PATH=

# Implementer Interface Environment Variables
IMPLEMENTER_INTERFACE_IMAGE_TAG=1.1.1
IMPLEMENTER_INTERFACE_CODE_PATH=

# Bahmni Reports Environment Variables
REPORTS_DB_IMAGE_NAME=mysql:8.0
REPORTS_DB_NAME=bahmni_reports
REPORTS_DB_USERNAME=reports-user
REPORTS_DB_PASSWORD=password
REPORTS_IMAGE_TAG=1.1.0

#Patient Documents environmental variables
PATIENT_DOCUMENTS_TAG=1.1.1

#Appointments environmental variables
APPOINTMENTS_IMAGE_TAG=1.1.1
APPOINTMENTS_PATH=

#SMS-service Environment Variables
SMS_SERVICE_IMAGE_TAG=1.1.0
SMS_TOKEN=
SMS_ORIGINATOR=
SMS_PROVIDER_API="https://api.d7networks.com/messages/v1/send"
SMS_COUNTRY_CODE=

IPD_TAG=1.0.0
IPD_PATH=

# SNOMED-ICD10 Reporting
ICD10_LITE_INDICATOR=true

# O3 EMR

#
# OpenMRS
#
Expand Down
222 changes: 222 additions & 0 deletions docker-compose-bahmniemr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
x-default-logging: &default
{}

x-log-config: &log-config
<<: *default

services:

bahmni-config:
image: 'bahmni/standard-config:${BAHMNI_CONFIG_IMAGE_TAG:?}'
volumes:
- '${BAHMNI_CONFIG_VOLUME:?}:/usr/local/bahmni_config'
- '${BAHMNI_CONFIG_OVERRIDE_PATH:-bahmni-config-override}:/usr/local/bahmni_config_override'
logging: *log-config
restart: unless-stopped
networks:
- ozone
command: ["sh", "-c", "rm -rf /etc/bahmni_config/masterdata/configuration && cp -r /usr/local/bahmni_config_override/bahmniemr_config/* /etc/bahmni_config/openmrs && ./start.sh"]

openmrs:
image: bahmni/openmrs:${OPENMRS_IMAGE_TAG:?}
environment:
TZ: ${TIMEZONE}
OMRS_DB_NAME: ${OPENMRS_DB_NAME:?}
OMRS_DB_HOSTNAME: ${OPENMRS_DB_HOST:?}
OMRS_DB_USERNAME: ${OPENMRS_DB_USER:?}
OMRS_DB_PASSWORD: ${OPENMRS_DB_PASSWORD:?}
OMRS_CREATE_TABLES: ${OPENMRS_DB_CREATE_TABLES}
OMRS_AUTO_UPDATE_DATABASE: ${OPENMRS_DB_AUTO_UPDATE}
OMRS_MODULE_WEB_ADMIN: ${OPENMRS_MODULE_WEB_ADMIN}
# OMRS_DEV_DEBUG_PORT: ${OMRS_DEV_DEBUG_PORT}
OMRS_JAVA_SERVER_OPTS: ${OMRS_JAVA_SERVER_OPTS}
OMRS_JAVA_MEMORY_OPTS: ${OMRS_JAVA_MEMORY_OPTS}
SEND_MAIL: ${SEND_MAIL}
MAIL_TRANSPORT_PROTOCOL: ${MAIL_TRANSPORT_PROTOCOL}
MAIL_SMTP_HOST: ${MAIL_SMTP_HOST}
MAIL_SMTP_PORT: ${MAIL_SMTP_PORT}
MAIL_SMTP_AUTH: ${MAIL_SMTP_AUTH}
MAIL_SMTP_STARTTLS_ENABLE: ${MAIL_SMTP_STARTTLS_ENABLE}
MAIL_SMTP_SSL_ENABLE: ${MAIL_SMTP_SSL_ENABLE}
MAIL_DEBUG: ${MAIL_DEBUG}
MAIL_FROM: ${MAIL_FROM}
MAIL_USER: ${MAIL_USER}
MAIL_PASSWORD: ${MAIL_PASSWORD}
OMRS_DOCKER_ENV: ${OPENMRS_DOCKER_ENV}
OMRS_C3P0_MAX_SIZE: ${OMRS_C3P0_MAX_SIZE}
WEIGHT_CONCEPT_UUID: ${WEIGHT_CONCEPT_UUID}
HEIGHT_CONCEPT_UUID: ${HEIGHT_CONCEPT_UUID}
OMRS_DB_EXTRA_ARGS: ${OMRS_DB_EXTRA_ARGS}
LUCENE_MATCH_TYPE: ${LUCENE_MATCH_TYPE}
DOCUMENT_MAX_SIZE_MB: ${DOCUMENT_MAX_SIZE_MB}
#ports:
# - ${OMRS_DEV_DEBUG_PORT}:${OMRS_DEV_DEBUG_PORT}
volumes:
- "${BAHMNI_CONFIG_VOLUME:?}:/etc/bahmni_config/:ro"
- "bahmni-lab-results:/home/bahmni/uploaded_results"
- "bahmni-uploaded-files:/home/bahmni/uploaded-files"
- "${BAHMNI_OPENMRS_MODULES_PATH:?}/:/openmrs/data/modules/"
- 'bahmni-patient-images:/home/bahmni/patient_images'
- 'bahmni-document-images:/home/bahmni/document_images'
- 'bahmni-clinical-forms:/home/bahmni/clinical_forms'
- "${BAHMNI_CONFIG_OVERRIDE_PATH:-openmrs-config}/initializer_config:/openmrs/distribution/openmrs_config/"
- 'configuration_checksums:/openmrs/data/configuration_checksums'
- 'sms-token:/openmrs/data/sms-token'
depends_on:
- mysql
logging: *log-config
restart: unless-stopped
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/openmrs/index.htm" ]
interval: 10s
timeout: 5s
retries: 360
start_period: 180s
networks:
- ozone

mysql:
environment:
OPENMRS_DB_NAME: ${OPENMRS_DB_NAME}
OPENMRS_DB_USER: ${OPENMRS_DB_USER}
OPENMRS_DB_PASSWORD: ${OPENMRS_DB_PASSWORD}
volumes:
- "${SQL_SCRIPTS_PATH}/mysql/openmrs:/docker-entrypoint-initdb.d/db/openmrs"
# command:
# - "--sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
logging: *log-config

bahmni-web:
image: bahmni/bahmni-web:${BAHMNI_WEB_IMAGE_TAG:?}
volumes:
- "${BAHMNI_CONFIG_VOLUME:?}:/usr/local/apache2/htdocs/bahmni_config/:ro"
# - "${BAHMNI_APPS_PATH:?}/ui/app/:/usr/local/apache2/htdocs/bahmni"
# - "${BAHMNI_APPS_PATH:?}/ui/node_modules/@bower_components/:/usr/local/apache2/htdocs/bahmni/components"
logging: *log-config
restart: unless-stopped
networks:
- ozone

implementer-interface:
image: bahmni/implementer-interface:${IMPLEMENTER_INTERFACE_IMAGE_TAG:?}
#volumes:
# - "${IMPLEMENTER_INTERFACE_CODE_PATH:?}/dist:/usr/local/apache2/htdocs/implementer_interface"
depends_on:
- openmrs
logging: *log-config
restart: unless-stopped
networks:
- ozone

reports:
image: bahmni/reports:${REPORTS_IMAGE_TAG:?}
environment:
TZ: ${TIMEZONE}
OPENMRS_DB_HOST: ${OPENMRS_DB_HOST:?}
OPENMRS_DB_NAME: ${OPENMRS_DB_NAME:?}
OPENMRS_DB_USERNAME: root
OPENMRS_DB_PASSWORD: ${MYSQL_ROOT_PASSWORD:?}
OPENMRS_HOST: ${OPENMRS_HOST:?}
OPENMRS_PORT: ${OPENMRS_PORT:?}
REPORTS_DB_SERVER: reportsdb
REPORTS_DB_NAME: ${REPORTS_DB_NAME:?}
REPORTS_DB_USERNAME: ${REPORTS_DB_USERNAME:?}
REPORTS_DB_PASSWORD: ${REPORTS_DB_PASSWORD:?}
ODOO_DB_SERVER: ${POSTGRES_DB_HOST:?}
ODOO_DB_NAME: ${ODOO_DATABASE:?}
ODOO_DB_USERNAME: ${ODOO_DB_USER:?}
ODOO_DB_PASSWORD: ${ODOO_DB_PASSWORD:?}
ICD10_LITE_INDICATOR: ${ICD10_LITE_INDICATOR}
volumes:
- "${BAHMNI_CONFIG_VOLUME:?}:/etc/bahmni_config/:ro"
- "bahmni-queued-reports:/home/bahmni/reports"
# - "../snomed-resources/icd10-extensions-1.0.0-SNAPSHOT.jar:/var/run/bahmni-reports/bahmni-reports/WEB-INF/lib/icd10-extensions-1.0.0-SNAPSHOT.jar:ro"
depends_on:
- reportsdb
- mysql
- bahmni-web
logging: *log-config
restart: unless-stopped
networks:
- ozone

reportsdb:
platform: linux/amd64
image: ${REPORTS_DB_IMAGE_NAME:?}
environment:
TZ: ${TIMEZONE}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:?}
MYSQL_DATABASE: ${REPORTS_DB_NAME:?}
MYSQL_USER: ${REPORTS_DB_USERNAME:?}
MYSQL_PASSWORD: ${REPORTS_DB_PASSWORD:?}
volumes:
- 'reportsdbdata:/var/lib/mysql'
logging: *log-config
restart: unless-stopped
networks:
- ozone

patient-documents:
image: 'bahmni/patient-documents:${PATIENT_DOCUMENTS_TAG:?}'
volumes:
- 'bahmni-document-images:/usr/share/nginx/html/document_images'
- 'bahmni-lab-results:/usr/share/nginx/html/uploaded_results'
- "bahmni-uploaded-files:/usr/share/nginx/html/uploaded-files"
environment:
TZ: ${TIMEZONE}
OPENMRS_HOST: ${OPENMRS_HOST:?}
depends_on:
- openmrs
logging: *log-config
restart: unless-stopped
networks:
- ozone

appointments:
image: bahmni/appointments:${APPOINTMENTS_IMAGE_TAG:?}
restart: unless-stopped
# volumes:
# - "${APPOINTMENTS_PATH:?}/dist/:/usr/local/apache2/htdocs/appointments"
networks:
- ozone

sms-service:
image: bahmni/sms-service:${SMS_SERVICE_IMAGE_TAG:?}
restart: unless-stopped
environment:
TZ: ${TIMEZONE}
SMS_TOKEN: ${SMS_TOKEN}
SMS_ORIGINATOR: ${SMS_ORIGINATOR}
SMS_PROVIDER_API: ${SMS_PROVIDER_API}
SMS_OPENMRS_HOST: ${OPENMRS_HOST:?}
SMS_OPENMRS_PORT: ${OPENMRS_PORT:?}
SMS_COUNTRY_CODE: ${SMS_COUNTRY_CODE}
volumes:
- 'sms-token:/opt/tokens'
networks:
- ozone

ipd:
image: bahmni/microfrontend-ipd:${IPD_TAG:?}
container_name: ipd
restart: unless-stopped
# volumes:
# - "${IPD_PATH:?}/dist/federation/:/usr/local/apache2/htdocs/ipd"
logging: *log-config
networks:
- ozone

volumes:
openmrs-data:
openmrsdbdata:
bahmni-config-override: ~
bahmni-patient-images:
bahmni-document-images:
bahmni-clinical-forms:
bahmni-config:
bahmni-lab-results:
bahmni-uploaded-files:
configuration_checksums:
sms-token:
bahmni-queued-reports:
reportsdbdata:
3 changes: 2 additions & 1 deletion proxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ FROM nginx:1.25-alpine
ENV FRAME_ANCESTORS ""

COPY nginx.conf /etc/nginx/nginx.conf
COPY default.conf.template /etc/nginx/templates/
COPY default.conf.template /etc/nginx/templates/
COPY bahmni/systemdate.sh /usr/local/bahmni/cgi-bin/systemdate
8 changes: 8 additions & 0 deletions proxy/bahmni/systemdate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Note: This script has been copied from bahmni-playbboks/roles/bahmni-emr/files/systemdate.sh
#!/usr/bin/env bash
OUTPUT=$(date +"%D %r %Z")
OFFSET=$(date +"%z")

echo "Content-type: application/json"
echo ""
echo "{\"date\": \"$OUTPUT\" , \"offset\" : \"$OFFSET\"}"
Loading
Loading