From 64d51f990d0c86d199ac2bca53263f7172a24c9b Mon Sep 17 00:00:00 2001 From: ruhanga Date: Fri, 22 Nov 2024 14:40:29 +0300 Subject: [PATCH 01/24] OZ-742: Added Bahmni EMR to Ozone --- docker-compose-bahmniemr.yml | 237 +++++++++++++++++++++++++++++++++++ proxy/default.conf.template | 87 +++++++++++-- 2 files changed, 312 insertions(+), 12 deletions(-) create mode 100644 docker-compose-bahmniemr.yml diff --git a/docker-compose-bahmniemr.yml b/docker-compose-bahmniemr.yml new file mode 100644 index 0000000..79c5580 --- /dev/null +++ b/docker-compose-bahmniemr.yml @@ -0,0 +1,237 @@ +version: '3.7' + +x-default-logging: &default + {} + +x-log-config: &log-config + <<: *default + +services: + + proxy: + image: 'bahmni/proxy:${PROXY_IMAGE_TAG:?}' + #volumes: + # - ${CERTIFICATE_PATH}:/etc/tls + ports: + - '80:80' + - '443:443' + logging: *log-config + restart: ${RESTART_POLICY} + environment: + TZ: ${TZ} + networks: + - ozone + + bahmni-config: + image: 'bahmni/standard-config:${CONFIG_IMAGE_TAG:?}' + volumes: + - '${CONFIG_VOLUME:?}:/usr/local/bahmni_config' + logging: *log-config + restart: ${RESTART_POLICY} + networks: + - ozone + + openmrs: + image: bahmni/openmrs:${OPENMRS_IMAGE_TAG:?} + environment: + TZ: ${TZ} + 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} + OPENELIS_HOST: ${OPENELIS_HOST:?} + OPENELIS_PORT: ${OPENELIS_PORT:?} + OPENELIS_ATOMFEED_USER: ${OPENELIS_ATOMFEED_USER:?} + OPENELIS_ATOMFEED_PASSWORD: ${OPENELIS_ATOMFEED_PASSWORD:?} + 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: + - "${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' + - 'configuration_checksums:/openmrs/data/configuration_checksums' + - 'sms-token:/openmrs/data/sms-token' + depends_on: + - mysql + logging: *log-config + restart: ${RESTART_POLICY} + 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:?} + profiles: ["emr","bahmni-standard","bahmni-mart"] + volumes: + - "${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: ${RESTART_POLICY} + networks: + - ozone + + implementer-interface: + image: bahmni/implementer-interface:${IMPLEMENTER_INTERFACE_IMAGE_TAG:?} + profiles: ["implementer-interface","emr","bahmni-standard"] + #volumes: + # - "${IMPLEMENTER_INTERFACE_CODE_PATH:?}/dist:/usr/local/apache2/htdocs/implementer_interface" + depends_on: + - openmrs + logging: *log-config + restart: ${RESTART_POLICY} + networks: + - ozone + + reports: + image: bahmni/reports:${REPORTS_IMAGE_TAG:?} + environment: + TZ: ${TZ} + OPENMRS_DB_HOST: ${OPENMRS_DB_HOST:?} + OPENMRS_DB_NAME: ${OPENMRS_DB_NAME:?} + OPENMRS_DB_USERNAME: ${OPENMRS_DB_USER:?} + OPENMRS_DB_PASSWORD: ${OPENMRS_DB_PASSWORD:?} + OPENMRS_HOST: ${OPENMRS_HOST:?} + OPENMRS_PORT: ${OPENMRS_PORT:?} + OPENELIS_DB_SERVER: ${OPENELIS_DB_SERVER} + 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: ${ODOO_DB_HOST:?} + ODOO_DB_NAME: ${ODOO_DB_NAME:?} + ODOO_DB_USERNAME: ${ODOO_DB_USER:?} + ODOO_DB_PASSWORD: ${ODOO_DB_PASSWORD:?} + ICD10_LITE_INDICATOR: ${ICD10_LITE_INDICATOR} + volumes: + - "${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: ${RESTART_POLICY} + networks: + - ozone + + reportsdb: + platform: linux/amd64 + image: ${REPORTS_DB_IMAGE_NAME:?} + environment: + TZ: ${TZ} + 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: ${RESTART_POLICY} + networks: + - ozone + + patient-documents: + image: 'bahmni/patient-documents:${PATIENT_DOCUMENTS_TAG:?}' + profiles: ["emr","bahmni-standard"] + 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: ${TZ} + OPENMRS_HOST: ${OPENMRS_HOST:?} + depends_on: + - openmrs + logging: *log-config + restart: ${RESTART_POLICY} + networks: + - ozone + + appointments: + image: bahmni/appointments:${APPOINTMENTS_IMAGE_TAG:?} + restart: ${RESTART_POLICY} + # volumes: + # - "${APPOINTMENTS_PATH:?}/dist/:/usr/local/apache2/htdocs/appointments" + networks: + - ozone + + sms-service: + image: bahmni/sms-service:${SMS_SERVICE_IMAGE_TAG:?} + profiles: ["sms"] + restart: ${RESTART_POLICY} + environment: + TZ: ${TZ} + 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: ${RESTART_POLICY} + # volumes: + # - "${IPD_PATH:?}/dist/federation/:/usr/local/apache2/htdocs/ipd" + logging: *log-config + networks: + - ozone + +volumes: + openmrs-data: + openmrsdbdata: + 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: diff --git a/proxy/default.conf.template b/proxy/default.conf.template index 8a1306b..bd234c2 100644 --- a/proxy/default.conf.template +++ b/proxy/default.conf.template @@ -24,15 +24,6 @@ map $GITPOD_ENV $senaite_rewrite { default /VirtualHostBase/http/$host/senaite/VirtualHostRoot/; } -upstream frontend { - # always assume the frontend will be available - server frontend max_fails=0; -} - -upstream backend { - server openmrs:8080 max_fails=0; -} - server { listen 80; @@ -85,17 +76,89 @@ server { } location /openmrs/spa/ { - proxy_pass http://frontend/; + set $frontend frontend; + proxy_pass http://$frontend/; proxy_redirect http://$host/ /openmrs/spa/; } location /openmrs { - proxy_pass http://backend; + set $openmrs openmrs:8080; + proxy_pass http://$openmrs; } location = / { return 301 /openmrs/spa/; } + + # Permanent redirect for /home + rewrite ^/home$ /bahmni/home/ permanent; + + # Uploaded Files + location /uploaded-files { + set $patient_documents patient-documents:80; + proxy_pass http://$patient_documents/uploaded-files; + } + + # Patient Documents + location /document_images { + set $patient_documents patient-documents:80; + proxy_pass http://$patient_documents/document_images; + } + + # Lab Results + location /uploaded_results { + set $patient_documents patient-documents:80; + proxy_pass http://$patient_documents/uploaded_results; + } + + # OpenMRS Authentication + location /openmrs/auth { + set $patient_documents patient-documents:80; + proxy_pass http://$patient_documents/openmrs/auth; + } + + # appointments:80 + location /appointments:80 { + set $appointments appointments:80; + proxy_pass http://$appointments/appointments; + } + + # ipd:80 + location /ipd:80 { + set $ipd ipd:80; + proxy_pass http://$ipd/ipd; + } + + # Bahmni Web + location /bahmni { + set $bahmni_web bahmni-web:8091; + proxy_pass http://$bahmni_web/bahmni; + add_header X-Robots-Tag "noindex, nofollow"; + } + + # Bahmni Person Management + location /person-management { + set $bahmni_web bahmni-web:8091; + proxy_pass http://$bahmni_web/person-management; + } + + # Bahmni Config OpenMRS Apps + location /bahmni_config/openmrs/apps { + set $bahmni_web bahmni-web:8091; + proxy_pass http://$bahmni_web/bahmni_config/openmrs/apps; + } + + # Bahmni Config OpenMRS I18n + location /bahmni_config/openmrs/i18n { + set $bahmni_web bahmni-web:8091; + proxy_pass http://$bahmni_web/bahmni_config/openmrs/i18n; + } + + # Implementer Interface + location /implementer-interface:80 { + set $implementer_interface implementer-interface:80; + proxy_pass http://$implementer_interface/implementer-interface; + } } server { @@ -105,7 +168,7 @@ server { # Increase proxy buffer size proxy_buffers 16 64k; proxy_buffer_size 128k; - # Force timeouts if the backend dies + # Force timeouts if the openmrs:8080 dies proxy_next_upstream error timeout invalid_header http_500 http_502 http_503; # Enable data compression gzip on; From cfbfa8a0dc7378a2f3d010ed532f2360033aefaf Mon Sep 17 00:00:00 2001 From: ruhanga Date: Fri, 22 Nov 2024 17:32:38 +0300 Subject: [PATCH 02/24] OZ-742: Added relevant environment variables. --- .env | 86 ++++++++++++++++++++++++++++++++++++ docker-compose-bahmniemr.yml | 53 +++++++--------------- 2 files changed, 103 insertions(+), 36 deletions(-) diff --git a/.env b/.env index 72e4992..2c48b58 100644 --- a/.env +++ b/.env @@ -14,6 +14,92 @@ HOST_URL=${SERVER_SCHEME}://${HOST_NAME} TIMEZONE=UTC GITPOD_ENV=false ENABLE_SSO=false + +# Bahmni EMR + +LOKI_URL=http://localhost:3100/loki/api/v1/push + +# 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 +CONFIG_IMAGE_TAG=1.0.0 +CONFIG_VOLUME=bahmni-config + +# 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=/Users/mac/repositories/OZONE_HIS/ozone-distro/target/ozone-1.0.0-SNAPSHOT/distro/binaries/bahmniemr/modules +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 # diff --git a/docker-compose-bahmniemr.yml b/docker-compose-bahmniemr.yml index 79c5580..0f81ab8 100644 --- a/docker-compose-bahmniemr.yml +++ b/docker-compose-bahmniemr.yml @@ -8,33 +8,19 @@ x-log-config: &log-config services: - proxy: - image: 'bahmni/proxy:${PROXY_IMAGE_TAG:?}' - #volumes: - # - ${CERTIFICATE_PATH}:/etc/tls - ports: - - '80:80' - - '443:443' - logging: *log-config - restart: ${RESTART_POLICY} - environment: - TZ: ${TZ} - networks: - - ozone - bahmni-config: image: 'bahmni/standard-config:${CONFIG_IMAGE_TAG:?}' volumes: - '${CONFIG_VOLUME:?}:/usr/local/bahmni_config' logging: *log-config - restart: ${RESTART_POLICY} + restart: unless-stopped networks: - ozone openmrs: image: bahmni/openmrs:${OPENMRS_IMAGE_TAG:?} environment: - TZ: ${TZ} + TZ: ${TIMEZONE} OMRS_DB_NAME: ${OPENMRS_DB_NAME:?} OMRS_DB_HOSTNAME: ${OPENMRS_DB_HOST:?} OMRS_DB_USERNAME: ${OPENMRS_DB_USER:?} @@ -45,10 +31,6 @@ services: # OMRS_DEV_DEBUG_PORT: ${OMRS_DEV_DEBUG_PORT} OMRS_JAVA_SERVER_OPTS: ${OMRS_JAVA_SERVER_OPTS} OMRS_JAVA_MEMORY_OPTS: ${OMRS_JAVA_MEMORY_OPTS} - OPENELIS_HOST: ${OPENELIS_HOST:?} - OPENELIS_PORT: ${OPENELIS_PORT:?} - OPENELIS_ATOMFEED_USER: ${OPENELIS_ATOMFEED_USER:?} - OPENELIS_ATOMFEED_PASSWORD: ${OPENELIS_ATOMFEED_PASSWORD:?} SEND_MAIL: ${SEND_MAIL} MAIL_TRANSPORT_PROTOCOL: ${MAIL_TRANSPORT_PROTOCOL} MAIL_SMTP_HOST: ${MAIL_SMTP_HOST} @@ -82,7 +64,7 @@ services: depends_on: - mysql logging: *log-config - restart: ${RESTART_POLICY} + restart: unless-stopped networks: - ozone @@ -105,7 +87,7 @@ services: # - "${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: ${RESTART_POLICY} + restart: unless-stopped networks: - ozone @@ -117,27 +99,26 @@ services: depends_on: - openmrs logging: *log-config - restart: ${RESTART_POLICY} + restart: unless-stopped networks: - ozone reports: image: bahmni/reports:${REPORTS_IMAGE_TAG:?} environment: - TZ: ${TZ} + TZ: ${TIMEZONE} OPENMRS_DB_HOST: ${OPENMRS_DB_HOST:?} OPENMRS_DB_NAME: ${OPENMRS_DB_NAME:?} OPENMRS_DB_USERNAME: ${OPENMRS_DB_USER:?} OPENMRS_DB_PASSWORD: ${OPENMRS_DB_PASSWORD:?} OPENMRS_HOST: ${OPENMRS_HOST:?} OPENMRS_PORT: ${OPENMRS_PORT:?} - OPENELIS_DB_SERVER: ${OPENELIS_DB_SERVER} 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: ${ODOO_DB_HOST:?} - ODOO_DB_NAME: ${ODOO_DB_NAME:?} + 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} @@ -150,7 +131,7 @@ services: - mysql - bahmni-web logging: *log-config - restart: ${RESTART_POLICY} + restart: unless-stopped networks: - ozone @@ -158,7 +139,7 @@ services: platform: linux/amd64 image: ${REPORTS_DB_IMAGE_NAME:?} environment: - TZ: ${TZ} + TZ: ${TIMEZONE} MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:?} MYSQL_DATABASE: ${REPORTS_DB_NAME:?} MYSQL_USER: ${REPORTS_DB_USERNAME:?} @@ -166,7 +147,7 @@ services: volumes: - 'reportsdbdata:/var/lib/mysql' logging: *log-config - restart: ${RESTART_POLICY} + restart: unless-stopped networks: - ozone @@ -178,18 +159,18 @@ services: - 'bahmni-lab-results:/usr/share/nginx/html/uploaded_results' - "bahmni-uploaded-files:/usr/share/nginx/html/uploaded-files" environment: - TZ: ${TZ} + TZ: ${TIMEZONE} OPENMRS_HOST: ${OPENMRS_HOST:?} depends_on: - openmrs logging: *log-config - restart: ${RESTART_POLICY} + restart: unless-stopped networks: - ozone appointments: image: bahmni/appointments:${APPOINTMENTS_IMAGE_TAG:?} - restart: ${RESTART_POLICY} + restart: unless-stopped # volumes: # - "${APPOINTMENTS_PATH:?}/dist/:/usr/local/apache2/htdocs/appointments" networks: @@ -198,9 +179,9 @@ services: sms-service: image: bahmni/sms-service:${SMS_SERVICE_IMAGE_TAG:?} profiles: ["sms"] - restart: ${RESTART_POLICY} + restart: unless-stopped environment: - TZ: ${TZ} + TZ: ${TIMEZONE} SMS_TOKEN: ${SMS_TOKEN} SMS_ORIGINATOR: ${SMS_ORIGINATOR} SMS_PROVIDER_API: ${SMS_PROVIDER_API} @@ -215,7 +196,7 @@ services: ipd: image: bahmni/microfrontend-ipd:${IPD_TAG:?} container_name: ipd - restart: ${RESTART_POLICY} + restart: unless-stopped # volumes: # - "${IPD_PATH:?}/dist/federation/:/usr/local/apache2/htdocs/ipd" logging: *log-config From 799b9eb0dfbcaef5f16e3c4438a67bc0dce4f824 Mon Sep 17 00:00:00 2001 From: ruhanga Date: Mon, 25 Nov 2024 15:25:45 +0300 Subject: [PATCH 03/24] Added Bahmni EMR backend health check. --- docker-compose-bahmniemr.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker-compose-bahmniemr.yml b/docker-compose-bahmniemr.yml index 0f81ab8..5a708fa 100644 --- a/docker-compose-bahmniemr.yml +++ b/docker-compose-bahmniemr.yml @@ -65,6 +65,12 @@ services: - mysql logging: *log-config restart: unless-stopped + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:8080/openmrs/" ] + interval: 10s + timeout: 5s + retries: 48 + start_period: 600s networks: - ozone From 3aa8d1fc682162a25c4dd939526efdcc29dc3d35 Mon Sep 17 00:00:00 2001 From: ruhanga Date: Mon, 25 Nov 2024 15:40:45 +0300 Subject: [PATCH 04/24] General cleanup --- .env | 2 +- scripts/utils.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 2c48b58..7b8ecb3 100644 --- a/.env +++ b/.env @@ -53,7 +53,7 @@ OPENMRS_MODULE_WEB_ADMIN='false' OMRS_JAVA_SERVER_OPTS='' OMRS_JAVA_MEMORY_OPTS='' OPENMRS_UPLOAD_FILES_PATH=./openmrs-uploads -BAHMNI_OPENMRS_MODULES_PATH=/Users/mac/repositories/OZONE_HIS/ozone-distro/target/ozone-1.0.0-SNAPSHOT/distro/binaries/bahmniemr/modules +BAHMNI_OPENMRS_MODULES_PATH= OPENMRS_DB_TYPE=mysql OMRS_C3P0_MAX_SIZE=50 WEIGHT_CONCEPT_UUID=5089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA diff --git a/scripts/utils.sh b/scripts/utils.sh index 529f368..4cb8eb2 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -42,6 +42,7 @@ function exportPaths () { export ERPNEXT_SCRIPTS_PATH=$DISTRO_PATH/binaries/erpnext/scripts/ export KEYCLOAK_CONFIG_PATH=$DISTRO_PATH/configs/keycloak export KEYCLOAK_BINARIES_PATH=$DISTRO_PATH/binaries/keycloak + export BAHMNI_OPENMRS_MODULES_PATH=$DISTRO_PATH/binaries/bahmniemr/modules echo "→ OPENMRS_CONFIG_PATH=$OPENMRS_CONFIG_PATH" echo "→ OPENMRS_PROPERTIES_PATH=$OPENMRS_PROPERTIES_PATH" @@ -62,6 +63,7 @@ function exportPaths () { echo "→ ERPNEXT_SCRIPTS_PATH=$ERPNEXT_SCRIPTS_PATH" echo "→ KEYCLOAK_CONFIG_PATH=$KEYCLOAK_CONFIG_PATH" echo "→ KEYCLOAK_BINARIES_PATH=$KEYCLOAK_BINARIES_PATH" + echo "→ BAHMNI_OPENMRS_MODULES_PATH=$BAHMNI_OPENMRS_MODULES_PATH" } From 7fe15a21c628f9f657e8f5c2b29b0ec6496648de Mon Sep 17 00:00:00 2001 From: ruhanga Date: Mon, 25 Nov 2024 18:37:19 +0300 Subject: [PATCH 05/24] General cleanup --- docker-compose-bahmniemr.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docker-compose-bahmniemr.yml b/docker-compose-bahmniemr.yml index 5a708fa..5737534 100644 --- a/docker-compose-bahmniemr.yml +++ b/docker-compose-bahmniemr.yml @@ -1,5 +1,3 @@ -version: '3.7' - x-default-logging: &default {} @@ -87,7 +85,6 @@ services: bahmni-web: image: bahmni/bahmni-web:${BAHMNI_WEB_IMAGE_TAG:?} - profiles: ["emr","bahmni-standard","bahmni-mart"] volumes: - "${CONFIG_VOLUME:?}:/usr/local/apache2/htdocs/bahmni_config/:ro" # - "${BAHMNI_APPS_PATH:?}/ui/app/:/usr/local/apache2/htdocs/bahmni" @@ -99,7 +96,6 @@ services: implementer-interface: image: bahmni/implementer-interface:${IMPLEMENTER_INTERFACE_IMAGE_TAG:?} - profiles: ["implementer-interface","emr","bahmni-standard"] #volumes: # - "${IMPLEMENTER_INTERFACE_CODE_PATH:?}/dist:/usr/local/apache2/htdocs/implementer_interface" depends_on: @@ -159,7 +155,6 @@ services: patient-documents: image: 'bahmni/patient-documents:${PATIENT_DOCUMENTS_TAG:?}' - profiles: ["emr","bahmni-standard"] volumes: - 'bahmni-document-images:/usr/share/nginx/html/document_images' - 'bahmni-lab-results:/usr/share/nginx/html/uploaded_results' @@ -184,7 +179,6 @@ services: sms-service: image: bahmni/sms-service:${SMS_SERVICE_IMAGE_TAG:?} - profiles: ["sms"] restart: unless-stopped environment: TZ: ${TIMEZONE} From a28a9eeed6d2e57480bb2cdd58265f4951cf5c81 Mon Sep 17 00:00:00 2001 From: ruhanga Date: Tue, 26 Nov 2024 16:16:17 +0300 Subject: [PATCH 06/24] Enhanced Bahmni EMR backend healthcheck --- docker-compose-bahmniemr.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose-bahmniemr.yml b/docker-compose-bahmniemr.yml index 5737534..a2ad53f 100644 --- a/docker-compose-bahmniemr.yml +++ b/docker-compose-bahmniemr.yml @@ -64,11 +64,11 @@ services: logging: *log-config restart: unless-stopped healthcheck: - test: [ "CMD", "curl", "-f", "http://localhost:8080/openmrs/" ] + test: [ "CMD", "curl", "-f", "http://localhost:8080/openmrs/index.htm" ] interval: 10s timeout: 5s - retries: 48 - start_period: 600s + retries: 192 + start_period: 180s networks: - ozone From 4951991a302ae5a832698ff8024aa67738df8947 Mon Sep 17 00:00:00 2001 From: ruhanga Date: Tue, 26 Nov 2024 16:17:43 +0300 Subject: [PATCH 07/24] Enhanced Bahmni EMR backend healthcheck --- docker-compose-bahmniemr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose-bahmniemr.yml b/docker-compose-bahmniemr.yml index a2ad53f..e06982f 100644 --- a/docker-compose-bahmniemr.yml +++ b/docker-compose-bahmniemr.yml @@ -67,7 +67,7 @@ services: test: [ "CMD", "curl", "-f", "http://localhost:8080/openmrs/index.htm" ] interval: 10s timeout: 5s - retries: 192 + retries: 360 start_period: 180s networks: - ozone From c731ce3e27536de156b49c139521d217d08b98e3 Mon Sep 17 00:00:00 2001 From: ruhanga Date: Tue, 26 Nov 2024 21:44:52 +0300 Subject: [PATCH 08/24] Fixed Bahmni web's proxy redirections --- proxy/default.conf.template | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/proxy/default.conf.template b/proxy/default.conf.template index bd234c2..1470963 100644 --- a/proxy/default.conf.template +++ b/proxy/default.conf.template @@ -90,9 +90,6 @@ server { return 301 /openmrs/spa/; } - # Permanent redirect for /home - rewrite ^/home$ /bahmni/home/ permanent; - # Uploaded Files location /uploaded-files { set $patient_documents patient-documents:80; @@ -117,23 +114,28 @@ server { proxy_pass http://$patient_documents/openmrs/auth; } - # appointments:80 - location /appointments:80 { + # appointments + location /appointments { set $appointments appointments:80; proxy_pass http://$appointments/appointments; } - # ipd:80 - location /ipd:80 { + # ipd + location /ipd { set $ipd ipd:80; proxy_pass http://$ipd/ipd; } # Bahmni Web + location = /bahmni { + return 301 /bahmni/; + } + location /bahmni { set $bahmni_web bahmni-web:8091; - proxy_pass http://$bahmni_web/bahmni; add_header X-Robots-Tag "noindex, nofollow"; + proxy_pass http://$bahmni_web; + proxy_redirect http://$host/ /; } # Bahmni Person Management @@ -155,7 +157,7 @@ server { } # Implementer Interface - location /implementer-interface:80 { + location /implementer-interface { set $implementer_interface implementer-interface:80; proxy_pass http://$implementer_interface/implementer-interface; } From c7fdc74569951683a93b98a17298f0c709f67bcb Mon Sep 17 00:00:00 2001 From: ruhanga Date: Wed, 27 Nov 2024 12:36:38 +0300 Subject: [PATCH 09/24] Fixed Bahmni config's proxy redirections --- proxy/default.conf.template | 95 +++++++++++++++++++++++++++++-------- 1 file changed, 75 insertions(+), 20 deletions(-) diff --git a/proxy/default.conf.template b/proxy/default.conf.template index 1470963..779270b 100644 --- a/proxy/default.conf.template +++ b/proxy/default.conf.template @@ -24,6 +24,11 @@ map $GITPOD_ENV $senaite_rewrite { default /VirtualHostBase/http/$host/senaite/VirtualHostRoot/; } +map $GITPOD_ENV $bahmni_config_rewrite { + "true" /VirtualHostBase/https/$host/bahmni_config/VirtualHostRoot/; + default /VirtualHostBase/http/$host/bahmni_config/VirtualHostRoot/; +} + server { listen 80; @@ -91,39 +96,69 @@ server { } # Uploaded Files - location /uploaded-files { + location = /uploaded-files { + return 301 /uploaded-files/; + } + + location /uploaded-files/ { set $patient_documents patient-documents:80; - proxy_pass http://$patient_documents/uploaded-files; + proxy_pass http://$patient_documents; + proxy_redirect http://$host/ /; } # Patient Documents - location /document_images { + location = /document_images { + return 301 /document_images/; + } + + location /document_images/ { set $patient_documents patient-documents:80; - proxy_pass http://$patient_documents/document_images; + proxy_pass http://$patient_documents; + proxy_redirect http://$host/ /; } # Lab Results - location /uploaded_results { + location = /uploaded_results { + return 301 /uploaded_results/; + } + + location /uploaded_results/ { set $patient_documents patient-documents:80; - proxy_pass http://$patient_documents/uploaded_results; + proxy_pass http://$patient_documents; + proxy_redirect http://$host/ /; } # OpenMRS Authentication - location /openmrs/auth { + location = /openmrs/auth { + return 301 /openmrs/auth/; + } + + location /openmrs/auth/ { set $patient_documents patient-documents:80; - proxy_pass http://$patient_documents/openmrs/auth; + proxy_pass http://$patient_documents; + proxy_redirect http://$host/ /; } # appointments - location /appointments { + location = /appointments { + return 301 /appointments/; + } + + location /appointments/ { set $appointments appointments:80; - proxy_pass http://$appointments/appointments; + proxy_pass http://$appointments; + proxy_redirect http://$host/ /; } # ipd - location /ipd { + location = /ipd { + return 301 /ipd/; + } + + location /ipd/ { set $ipd ipd:80; - proxy_pass http://$ipd/ipd; + proxy_pass http://$ipd; + proxy_redirect http://$host/ /; } # Bahmni Web @@ -139,27 +174,47 @@ server { } # Bahmni Person Management - location /person-management { + location = /person-management { + return 301 /person-management/; + } + + location /person-management/ { set $bahmni_web bahmni-web:8091; - proxy_pass http://$bahmni_web/person-management; + proxy_pass http://$bahmni_web; + proxy_redirect http://$host/ /; } # Bahmni Config OpenMRS Apps - location /bahmni_config/openmrs/apps { + location = /bahmni_config/openmrs/apps { + return 301 /bahmni_config/openmrs/apps/; + } + + location /bahmni_config/openmrs/apps/ { set $bahmni_web bahmni-web:8091; - proxy_pass http://$bahmni_web/bahmni_config/openmrs/apps; + proxy_pass http://$bahmni_web; + proxy_redirect http://$host/ /; } # Bahmni Config OpenMRS I18n - location /bahmni_config/openmrs/i18n { + location = /bahmni_config/openmrs/i18n { + return 301 /bahmni_config/openmrs/i18n/; + } + + location /bahmni_config/openmrs/i18n/ { set $bahmni_web bahmni-web:8091; - proxy_pass http://$bahmni_web/bahmni_config/openmrs/i18n; + proxy_pass http://$bahmni_web; + proxy_redirect http://$host/ /; } # Implementer Interface - location /implementer-interface { + location = /implementer-interface { + return 301 /implementer-interface/; + } + + location /implementer-interface/ { set $implementer_interface implementer-interface:80; - proxy_pass http://$implementer_interface/implementer-interface; + proxy_pass http://$implementer_interface; + proxy_redirect http://$host/ /; } } From 983401e529935be09504f25ffe92514f2453870c Mon Sep 17 00:00:00 2001 From: ruhanga Date: Wed, 27 Nov 2024 12:45:15 +0300 Subject: [PATCH 10/24] Fixed Bahmni's proxy configs --- proxy/default.conf.template | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/proxy/default.conf.template b/proxy/default.conf.template index 779270b..b19bf89 100644 --- a/proxy/default.conf.template +++ b/proxy/default.conf.template @@ -24,11 +24,6 @@ map $GITPOD_ENV $senaite_rewrite { default /VirtualHostBase/http/$host/senaite/VirtualHostRoot/; } -map $GITPOD_ENV $bahmni_config_rewrite { - "true" /VirtualHostBase/https/$host/bahmni_config/VirtualHostRoot/; - default /VirtualHostBase/http/$host/bahmni_config/VirtualHostRoot/; -} - server { listen 80; @@ -166,7 +161,7 @@ server { return 301 /bahmni/; } - location /bahmni { + location /bahmni/ { set $bahmni_web bahmni-web:8091; add_header X-Robots-Tag "noindex, nofollow"; proxy_pass http://$bahmni_web; From bd34d72ba779a9443972ede1bb35c68c1de46cfd Mon Sep 17 00:00:00 2001 From: ruhanga Date: Wed, 27 Nov 2024 13:20:22 +0300 Subject: [PATCH 11/24] Fix missing Bahmni CGI resource --- proxy/Dockerfile | 3 ++- proxy/bahmni/systemdate.sh | 8 ++++++++ proxy/default.conf.template | 5 +++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 proxy/bahmni/systemdate.sh diff --git a/proxy/Dockerfile b/proxy/Dockerfile index e34fa0d..5f9c592 100644 --- a/proxy/Dockerfile +++ b/proxy/Dockerfile @@ -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/ \ No newline at end of file +COPY default.conf.template /etc/nginx/templates/ +COPY bahmni/systemdate.sh /usr/local/bahmni/cgi-bin/systemdate \ No newline at end of file diff --git a/proxy/bahmni/systemdate.sh b/proxy/bahmni/systemdate.sh new file mode 100644 index 0000000..4f74d94 --- /dev/null +++ b/proxy/bahmni/systemdate.sh @@ -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\"}" \ No newline at end of file diff --git a/proxy/default.conf.template b/proxy/default.conf.template index b19bf89..0ace292 100644 --- a/proxy/default.conf.template +++ b/proxy/default.conf.template @@ -211,6 +211,11 @@ server { proxy_pass http://$implementer_interface; proxy_redirect http://$host/ /; } + + # Bahmni's CGI script location + location /cgi-bin/ { + root /usr/local/bahmni; + } } server { From 4dd46a8c6b67be9ea1591e3d4933389655bbe4d3 Mon Sep 17 00:00:00 2001 From: ruhanga Date: Thu, 5 Dec 2024 18:56:54 +0300 Subject: [PATCH 12/24] OZ-742: Enabled overriding Bahmni Configurations --- docker-compose-bahmniemr.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker-compose-bahmniemr.yml b/docker-compose-bahmniemr.yml index e06982f..7b82b38 100644 --- a/docker-compose-bahmniemr.yml +++ b/docker-compose-bahmniemr.yml @@ -10,10 +10,12 @@ services: image: 'bahmni/standard-config:${CONFIG_IMAGE_TAG:?}' volumes: - '${CONFIG_VOLUME:?}:/usr/local/bahmni_config' + - '${CONFIG_OVERRIDE_VOLUME:-bahmni-config-override}:/usr/local/bahmni_config_override' logging: *log-config restart: unless-stopped networks: - ozone + command: ["sh", "-c", "cp -r /usr/local/bahmni_config_override/initializer_config/* /etc/bahmni_config/masterdata/configuration && cp -r /usr/local/bahmni_config_override/bahmniemr_config/* /etc/bahmni_config/masterdata/openmrs && ./start.sh"] openmrs: image: bahmni/openmrs:${OPENMRS_IMAGE_TAG:?} @@ -206,6 +208,7 @@ services: volumes: openmrs-data: openmrsdbdata: + bahmni-config-override: ~ bahmni-patient-images: bahmni-document-images: bahmni-clinical-forms: From 5582222831a2f547c16075b4e143c607bcb77153 Mon Sep 17 00:00:00 2001 From: ruhanga Date: Fri, 6 Dec 2024 09:28:46 +0300 Subject: [PATCH 13/24] OZ-742: Minor cleanup refactor. --- .env | 5 +++-- docker-compose-bahmniemr.yml | 6 +++--- scripts/utils.sh | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.env b/.env index 7b8ecb3..3a740f2 100644 --- a/.env +++ b/.env @@ -33,8 +33,9 @@ MAIL_USER= MAIL_PASSWORD= # Bahmni Config Environment Variables -CONFIG_IMAGE_TAG=1.0.0 -CONFIG_VOLUME=bahmni-config +BAHMNI_CONFIG_IMAGE_TAG=1.0.0 +BAHMNI_CONFIG_VOLUME=bahmni-config +BAHMNI_CONFIG_OVERRIDE_VOLUME= # OpenMRS Environment Variables OPENMRS_HOST=openmrs diff --git a/docker-compose-bahmniemr.yml b/docker-compose-bahmniemr.yml index 7b82b38..cafc57c 100644 --- a/docker-compose-bahmniemr.yml +++ b/docker-compose-bahmniemr.yml @@ -7,10 +7,10 @@ x-log-config: &log-config services: bahmni-config: - image: 'bahmni/standard-config:${CONFIG_IMAGE_TAG:?}' + image: 'bahmni/standard-config:${BAHMNI_CONFIG_IMAGE_TAG:?}' volumes: - - '${CONFIG_VOLUME:?}:/usr/local/bahmni_config' - - '${CONFIG_OVERRIDE_VOLUME:-bahmni-config-override}:/usr/local/bahmni_config_override' + - '${BAHMNI_CONFIG_VOLUME:?}:/usr/local/bahmni_config' + - '${BAHMNI_CONFIG_OVERRIDE_VOLUME:-bahmni-config-override}:/usr/local/bahmni_config_override' logging: *log-config restart: unless-stopped networks: diff --git a/scripts/utils.sh b/scripts/utils.sh index 4cb8eb2..5fefddc 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -43,6 +43,7 @@ function exportPaths () { export KEYCLOAK_CONFIG_PATH=$DISTRO_PATH/configs/keycloak export KEYCLOAK_BINARIES_PATH=$DISTRO_PATH/binaries/keycloak export BAHMNI_OPENMRS_MODULES_PATH=$DISTRO_PATH/binaries/bahmniemr/modules + export BAHMNI_CONFIG_OVERRIDE_VOLUME=$DISTRO_PATH/configs/bahmni echo "→ OPENMRS_CONFIG_PATH=$OPENMRS_CONFIG_PATH" echo "→ OPENMRS_PROPERTIES_PATH=$OPENMRS_PROPERTIES_PATH" @@ -64,7 +65,7 @@ function exportPaths () { echo "→ KEYCLOAK_CONFIG_PATH=$KEYCLOAK_CONFIG_PATH" echo "→ KEYCLOAK_BINARIES_PATH=$KEYCLOAK_BINARIES_PATH" echo "→ BAHMNI_OPENMRS_MODULES_PATH=$BAHMNI_OPENMRS_MODULES_PATH" - + echo "→ BAHMNI_CONFIG_OVERRIDE_VOLUME=$CONFIG_OVERRIDE_VOLUME" } function setDockerComposeCLIOptions () { From a674bd58d6655f95a6eaf270a32402f1038b174f Mon Sep 17 00:00:00 2001 From: ruhanga Date: Fri, 6 Dec 2024 09:30:12 +0300 Subject: [PATCH 14/24] OZ-742: Minor cleanup refactor. --- docker-compose-bahmniemr.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose-bahmniemr.yml b/docker-compose-bahmniemr.yml index cafc57c..5f758ff 100644 --- a/docker-compose-bahmniemr.yml +++ b/docker-compose-bahmniemr.yml @@ -52,7 +52,7 @@ services: #ports: # - ${OMRS_DEV_DEBUG_PORT}:${OMRS_DEV_DEBUG_PORT} volumes: - - "${CONFIG_VOLUME:?}:/etc/bahmni_config/:ro" + - "${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/" @@ -88,7 +88,7 @@ services: bahmni-web: image: bahmni/bahmni-web:${BAHMNI_WEB_IMAGE_TAG:?} volumes: - - "${CONFIG_VOLUME:?}:/usr/local/apache2/htdocs/bahmni_config/:ro" + - "${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 @@ -127,7 +127,7 @@ services: ODOO_DB_PASSWORD: ${ODOO_DB_PASSWORD:?} ICD10_LITE_INDICATOR: ${ICD10_LITE_INDICATOR} volumes: - - "${CONFIG_VOLUME:?}:/etc/bahmni_config/:ro" + - "${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: From e6ca679541870da22c59ef7fc1be3007016ae4e3 Mon Sep 17 00:00:00 2001 From: ruhanga Date: Fri, 6 Dec 2024 14:13:08 +0300 Subject: [PATCH 15/24] OZ-742: Fixed Bahmni Reports --- docker-compose-bahmniemr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose-bahmniemr.yml b/docker-compose-bahmniemr.yml index 5f758ff..54fdedd 100644 --- a/docker-compose-bahmniemr.yml +++ b/docker-compose-bahmniemr.yml @@ -113,8 +113,8 @@ services: TZ: ${TIMEZONE} OPENMRS_DB_HOST: ${OPENMRS_DB_HOST:?} OPENMRS_DB_NAME: ${OPENMRS_DB_NAME:?} - OPENMRS_DB_USERNAME: ${OPENMRS_DB_USER:?} - OPENMRS_DB_PASSWORD: ${OPENMRS_DB_PASSWORD:?} + OPENMRS_DB_USERNAME: root + OPENMRS_DB_PASSWORD: ${MYSQL_ROOT_PASSWORD:?} OPENMRS_HOST: ${OPENMRS_HOST:?} OPENMRS_PORT: ${OPENMRS_PORT:?} REPORTS_DB_SERVER: reportsdb From b84044157d8910ea4e306a374468530222c74e94 Mon Sep 17 00:00:00 2001 From: ruhanga Date: Fri, 6 Dec 2024 14:21:06 +0300 Subject: [PATCH 16/24] OZ-742: Fixed Bahmni Reports --- proxy/default.conf.template | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/proxy/default.conf.template b/proxy/default.conf.template index 0ace292..cbcc424 100644 --- a/proxy/default.conf.template +++ b/proxy/default.conf.template @@ -156,6 +156,17 @@ server { proxy_redirect http://$host/ /; } + # bahmnireports + location = /bahmnireports { + return 301 /bahmnireports/; + } + + location /bahmnireports/ { + set $bahmnireports reports:8051; + proxy_pass http://$bahmnireports; + proxy_redirect http://$host/ /; + } + # Bahmni Web location = /bahmni { return 301 /bahmni/; From 1ebe51466598d5767e20d3dcc2221c67ed62b5eb Mon Sep 17 00:00:00 2001 From: ruhanga Date: Mon, 16 Dec 2024 13:49:27 +0300 Subject: [PATCH 17/24] OZ-742: Pulled and rebased from upstream --- .env | 2 +- scripts/docker-compose-files.txt | 1 + scripts/utils.sh | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 3a740f2..c22f184 100644 --- a/.env +++ b/.env @@ -17,7 +17,7 @@ ENABLE_SSO=false # Bahmni EMR -LOKI_URL=http://localhost:3100/loki/api/v1/push +RUN_WITH_BAHMNI_EMR=false # Mail Config Properties Environment Variables MAIL_TRANSPORT_PROTOCOL=smtps diff --git a/scripts/docker-compose-files.txt b/scripts/docker-compose-files.txt index 723d993..49a0cd3 100755 --- a/scripts/docker-compose-files.txt +++ b/scripts/docker-compose-files.txt @@ -4,6 +4,7 @@ docker-compose-odoo.yml docker-compose-odoo-sso.yml docker-compose-openmrs.yml docker-compose-openmrs-sso.yml +docker-compose-bahmniemr.yml docker-compose-senaite.yml docker-compose-senaite-sso.yml docker-compose-backup.yml diff --git a/scripts/utils.sh b/scripts/utils.sh index 5fefddc..fc6afe7 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -71,6 +71,11 @@ function exportPaths () { function setDockerComposeCLIOptions () { # Parse 'docker-compose-files.txt' to get the list of Docker Compose files to run dockerComposeFiles=$(cat docker-compose-files.txt) + + if [ "$RUN_WITH_BAHMNI_EMR" == "true" ]; then + export ENABLE_SSO=false + fi + for file in ${dockerComposeFiles} do if [ "$ENABLE_SSO" != "true" ]; then @@ -78,6 +83,15 @@ function setDockerComposeCLIOptions () { continue fi fi + + if [[ "$file" == *"-bahmniemr.yml" && "$RUN_WITH_BAHMNI_EMR" == "false" ]]; then + continue + fi + + if [[ "$file" == *"-openmrs.yml" && "$RUN_WITH_BAHMNI_EMR" == "true" ]]; then + continue + fi + export dockerComposeFilesCLIOptions="$dockerComposeFilesCLIOptions -f ../$file" done From e1d8faf543eb8fed2976f63914dd1861b4d3610b Mon Sep 17 00:00:00 2001 From: ruhanga Date: Mon, 16 Dec 2024 15:31:07 +0300 Subject: [PATCH 18/24] OZ-742: Added Bahmni EMR start script. --- scripts/start-with-bahmniemr.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 scripts/start-with-bahmniemr.sh diff --git a/scripts/start-with-bahmniemr.sh b/scripts/start-with-bahmniemr.sh new file mode 100644 index 0000000..30d5149 --- /dev/null +++ b/scripts/start-with-bahmniemr.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -e + +# Run with Bahmni EMR +export RUN_WITH_BAHMNI_EMR=true +echo "$INFO Setting RUN_WITH_BAHMNI_EMR=true..." +echo "→ RUN_WITH_BAHMNI_EMR=$RUN_WITH_BAHMNI_EMR" + +source start.sh From 19a51c61e7b9aae771eef2ef9cb5cf3632d5107d Mon Sep 17 00:00:00 2001 From: ruhanga Date: Thu, 9 Jan 2025 12:26:35 +0300 Subject: [PATCH 19/24] OZ-742: start-with-bahmniemr.sh executable. --- scripts/start-with-bahmniemr.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/start-with-bahmniemr.sh diff --git a/scripts/start-with-bahmniemr.sh b/scripts/start-with-bahmniemr.sh old mode 100644 new mode 100755 From 053de49d1717a811c1f515cdec5e0a66e06f2ada Mon Sep 17 00:00:00 2001 From: ruhanga Date: Thu, 16 Jan 2025 15:06:56 +0300 Subject: [PATCH 20/24] OZ-742: Allow for mounting OpenMRS modules' path --- docker-compose-bahmniemr.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose-bahmniemr.yml b/docker-compose-bahmniemr.yml index 54fdedd..04285f1 100644 --- a/docker-compose-bahmniemr.yml +++ b/docker-compose-bahmniemr.yml @@ -59,6 +59,7 @@ services: - 'bahmni-patient-images:/home/bahmni/patient_images' - 'bahmni-document-images:/home/bahmni/document_images' - 'bahmni-clinical-forms:/home/bahmni/clinical_forms' + - "${BAHMNI_CONFIG_OVERRIDE_VOLUME:-openmrs-config}/initializer_config:/openmrs/distribution/openmrs_config/" - 'configuration_checksums:/openmrs/data/configuration_checksums' - 'sms-token:/openmrs/data/sms-token' depends_on: @@ -73,6 +74,7 @@ services: start_period: 180s networks: - ozone + command: ["sh", "-c", "./bahmni_startup.sh && rm -r /openmrs/data/configuration/*"] mysql: environment: From a7abd08641241fd21cc784524defb8e6d07eaec6 Mon Sep 17 00:00:00 2001 From: ruhanga Date: Fri, 17 Jan 2025 11:47:43 +0300 Subject: [PATCH 21/24] OZ-742: Allow for mounting OpenMRS Iniz configuration path --- .env | 2 +- docker-compose-bahmniemr.yml | 7 +++---- scripts/utils.sh | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.env b/.env index c22f184..4427969 100644 --- a/.env +++ b/.env @@ -35,7 +35,7 @@ MAIL_PASSWORD= # Bahmni Config Environment Variables BAHMNI_CONFIG_IMAGE_TAG=1.0.0 BAHMNI_CONFIG_VOLUME=bahmni-config -BAHMNI_CONFIG_OVERRIDE_VOLUME= +BAHMNI_CONFIG_OVERRIDE_PATH= # OpenMRS Environment Variables OPENMRS_HOST=openmrs diff --git a/docker-compose-bahmniemr.yml b/docker-compose-bahmniemr.yml index 04285f1..37fd2d3 100644 --- a/docker-compose-bahmniemr.yml +++ b/docker-compose-bahmniemr.yml @@ -10,12 +10,12 @@ services: image: 'bahmni/standard-config:${BAHMNI_CONFIG_IMAGE_TAG:?}' volumes: - '${BAHMNI_CONFIG_VOLUME:?}:/usr/local/bahmni_config' - - '${BAHMNI_CONFIG_OVERRIDE_VOLUME:-bahmni-config-override}:/usr/local/bahmni_config_override' + - '${BAHMNI_CONFIG_OVERRIDE_PATH:-bahmni-config-override}:/usr/local/bahmni_config_override' logging: *log-config restart: unless-stopped networks: - ozone - command: ["sh", "-c", "cp -r /usr/local/bahmni_config_override/initializer_config/* /etc/bahmni_config/masterdata/configuration && cp -r /usr/local/bahmni_config_override/bahmniemr_config/* /etc/bahmni_config/masterdata/openmrs && ./start.sh"] + command: ["sh", "-c", "rm -r /etc/bahmni_config/masterdata/configuration && cp -r /usr/local/bahmni_config_override/bahmniemr_config/* /etc/bahmni_config/masterdata/openmrs && ./start.sh"] openmrs: image: bahmni/openmrs:${OPENMRS_IMAGE_TAG:?} @@ -59,7 +59,7 @@ services: - 'bahmni-patient-images:/home/bahmni/patient_images' - 'bahmni-document-images:/home/bahmni/document_images' - 'bahmni-clinical-forms:/home/bahmni/clinical_forms' - - "${BAHMNI_CONFIG_OVERRIDE_VOLUME:-openmrs-config}/initializer_config:/openmrs/distribution/openmrs_config/" + - "${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: @@ -74,7 +74,6 @@ services: start_period: 180s networks: - ozone - command: ["sh", "-c", "./bahmni_startup.sh && rm -r /openmrs/data/configuration/*"] mysql: environment: diff --git a/scripts/utils.sh b/scripts/utils.sh index fc6afe7..8aab8e8 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -43,7 +43,7 @@ function exportPaths () { export KEYCLOAK_CONFIG_PATH=$DISTRO_PATH/configs/keycloak export KEYCLOAK_BINARIES_PATH=$DISTRO_PATH/binaries/keycloak export BAHMNI_OPENMRS_MODULES_PATH=$DISTRO_PATH/binaries/bahmniemr/modules - export BAHMNI_CONFIG_OVERRIDE_VOLUME=$DISTRO_PATH/configs/bahmni + export BAHMNI_CONFIG_OVERRIDE_PATH=$DISTRO_PATH/configs/bahmni echo "→ OPENMRS_CONFIG_PATH=$OPENMRS_CONFIG_PATH" echo "→ OPENMRS_PROPERTIES_PATH=$OPENMRS_PROPERTIES_PATH" @@ -65,7 +65,7 @@ function exportPaths () { echo "→ KEYCLOAK_CONFIG_PATH=$KEYCLOAK_CONFIG_PATH" echo "→ KEYCLOAK_BINARIES_PATH=$KEYCLOAK_BINARIES_PATH" echo "→ BAHMNI_OPENMRS_MODULES_PATH=$BAHMNI_OPENMRS_MODULES_PATH" - echo "→ BAHMNI_CONFIG_OVERRIDE_VOLUME=$CONFIG_OVERRIDE_VOLUME" + echo "→ BAHMNI_CONFIG_OVERRIDE_PATH=$BAHMNI_CONFIG_OVERRIDE_PATH" } function setDockerComposeCLIOptions () { From 1f4f2b60af89e1fa1496de58424123330ecc44e7 Mon Sep 17 00:00:00 2001 From: ruhanga Date: Mon, 20 Jan 2025 10:36:31 +0300 Subject: [PATCH 22/24] OZ-742: Allow for mounting OpenMRS Iniz configuration path. --- docker-compose-bahmniemr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose-bahmniemr.yml b/docker-compose-bahmniemr.yml index 37fd2d3..6c5ecf3 100644 --- a/docker-compose-bahmniemr.yml +++ b/docker-compose-bahmniemr.yml @@ -15,7 +15,7 @@ services: restart: unless-stopped networks: - ozone - command: ["sh", "-c", "rm -r /etc/bahmni_config/masterdata/configuration && cp -r /usr/local/bahmni_config_override/bahmniemr_config/* /etc/bahmni_config/masterdata/openmrs && ./start.sh"] + command: ["sh", "-c", "rm -rf /etc/bahmni_config/masterdata/configuration && cp -r /usr/local/bahmni_config_override/bahmniemr_config/* /etc/bahmni_config/masterdata/openmrs && ./start.sh"] openmrs: image: bahmni/openmrs:${OPENMRS_IMAGE_TAG:?} From 86a9c66e1a2ed3686b841ce20eb0251f8aaf8c96 Mon Sep 17 00:00:00 2001 From: ruhanga Date: Mon, 20 Jan 2025 11:10:51 +0300 Subject: [PATCH 23/24] OZ-742: Fixed Bahmni config overrides. --- docker-compose-bahmniemr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose-bahmniemr.yml b/docker-compose-bahmniemr.yml index 6c5ecf3..0013994 100644 --- a/docker-compose-bahmniemr.yml +++ b/docker-compose-bahmniemr.yml @@ -15,7 +15,7 @@ services: 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/masterdata/openmrs && ./start.sh"] + 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:?} From b9c966fe54e956930b5d14674d8f1ffbf3a56f8e Mon Sep 17 00:00:00 2001 From: ruhanga Date: Sun, 26 Jan 2025 15:37:02 +0300 Subject: [PATCH 24/24] OZ-742: Properly mount OpenMRS modules --- docker-compose-bahmniemr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose-bahmniemr.yml b/docker-compose-bahmniemr.yml index 0013994..a6b66a9 100644 --- a/docker-compose-bahmniemr.yml +++ b/docker-compose-bahmniemr.yml @@ -55,7 +55,7 @@ services: - "${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_OPENMRS_MODULES_PATH:?}/:/openmrs/distribution/openmrs_modules/" - 'bahmni-patient-images:/home/bahmni/patient_images' - 'bahmni-document-images:/home/bahmni/document_images' - 'bahmni-clinical-forms:/home/bahmni/clinical_forms'