Skip to content

Instantly share code, notes, and snippets.

View mherman22's full-sized avatar
:octocat:
Try again and again and again

Herman Muhereza mherman22

:octocat:
Try again and again and again
View GitHub Profile
@mherman22
mherman22 / patient-to-opencr.md
Created July 16, 2026 19:20
SEDISH/iSantePlus: how a patient gets saved and sent to OpenCR (save → mpi-client AOP advice → async worker → FHIR export)

How a patient gets saved and sent to OpenCR (SEDISH / iSantePlus)

TL;DR: PatientService.savePatient() → mpi-client AOP advice (PatientSynchronizationAdvice) → async PatientUpdateWorkerMpiClientService.exportPatient() → FHIR conditional-update (upsert) POST to OpenCR on the SEDISH source-key.

Repo (canonical): IsantePlus/openmrs-module-mpi-client (main). Registration trigger lives in charess-org/iSantePlus (registration module).


1. The patient is saved — registration module

registration/api/src/main/java/org/openmrs/module/registration/api/impl/RegistrationServiceImpl.java (~line 729)

@mherman22
mherman22 / fix-xds-pullpoint.sh
Created July 14, 2026 07:18
SEDISH 44: set xdssender.notificationsPullPoint.* so xds-sender 2.6.2 activator starts
#!/usr/bin/env bash
# xds-sender 2.6.2 activator throws when xdssender.notificationsPullPoint.endpoint is blank,
# which stops xds-sender -> cascades -> isanteplus 'appDashboard' view missing.
# Fix: set the notifications-pull-point globals (non-blank), then restart with a clean cache.
# Values below are placeholders pointing at the SEDISH OpenHIM; change endpoint/creds to the
# real XDS notifications pull point if you actually use that feature.
set -euo pipefail
OMRS=""
for d in /usr/share/tomcat7/.OpenMRS /var/lib/tomcat7/.OpenMRS /root/.OpenMRS /home/*/.OpenMRS; do
@mherman22
mherman22 / latest-boot-modules.sh
Created July 14, 2026 06:52
SEDISH 44: fate of core modules in the latest boot + deployed core omods
#!/usr/bin/env bash
set +e
DIR=/usr/share/tomcat7/.OpenMRS
LOG="$DIR/openmrs.log"; [ -f "$LOG" ] || LOG=./openmrs.log
echo "==================== deployed core omods ===================="
ls -la "$DIR/modules/" 2>/dev/null | grep -iE "isanteplus-|coreapps-|registrationapp-|registrationcore-|xds-sender-|labintegration-|m2sys"
echo
# start of the LATEST boot = last time the scheduler/refresh kicked; use last 'Setting up Country' or last banner.
@mherman22
mherman22 / last-boot-cause.sh
Created July 13, 2026 19:16
SEDISH 44: isolate the LAST boot's fatal cause (context cancel)
#!/usr/bin/env bash
# Isolates the ROOT fatal error of the most recent OpenMRS boot (the one that
# cancelled the context), rather than errors from earlier boots.
set +e
LOG=/usr/share/tomcat7/.OpenMRS/openmrs.log
[ -f "$LOG" ] || LOG=./openmrs.log
echo "log: $LOG"; echo
echo "-------- last 3 context-cancel / fatal markers (with line#) --------"
grep -nE "cancelling refresh attempt|Unable to start OpenMRS. Error thrown was|Got exception while starting up" "$LOG" | tail -3
@mherman22
mherman22 / diag-startup.sh
Created July 13, 2026 19:10
SEDISH 44: capture OpenMRS module startup errors (root cause behind appDashboard error)
#!/usr/bin/env bash
# Run in /usr/share/tomcat7/.OpenMRS (or anywhere; it locates openmrs.log).
# Prints the REAL module startup failures + root causes behind the
# "viewProvider isanteplus does not have a view named appDashboard" symptom.
set +e
LOG=""
for f in /usr/share/tomcat7/.OpenMRS/openmrs.log ./openmrs.log /var/lib/tomcat7/.OpenMRS/openmrs.log /root/.OpenMRS/openmrs.log /home/*/.OpenMRS/openmrs.log; do
[ -f "$f" ] && LOG="$f" && break
done
@mherman22
mherman22 / fix-ccd-widget.sh
Created July 13, 2026 12:58
SEDISH 44: fix Continuité des Soins CCD widget (remove broken Check CCD, View CCD -> registrationResult by uuid)
#!/usr/bin/env bash
# SEDISH / server 44: fix the "Continuité des Soins" widget in coreapps patient.gsp.
# - remove the broken "Check CCD" button (checkCCD() had window.location.href="" -> reload/no-op)
# - keep ONE button -> registrationResult.page, switched from numeric id to patient uuid,
# relabelled "Voir le dossier (SEDISH)".
# Edits patient.gsp INSIDE the coreapps .omod (lib-cache is re-exploded from the omod on restart),
# backs up the omod, verifies the edits applied, then restarts tomcat + clears the cache.
set -euo pipefail
OMRS=""
@mherman22
mherman22 / find-xdssender.sh
Created July 13, 2026 11:50
SEDISH 44: locate/recover deleted xds-sender omod
#!/usr/bin/env bash
# Locate any xds-sender module copy on this node (to recover the deleted 2.5.8 omod).
set +e
echo "==================== hunting for xds-sender module copies ===================="
OMRS=""
for d in /usr/share/tomcat7/.OpenMRS /var/lib/tomcat7/.OpenMRS /root/.OpenMRS /home/*/.OpenMRS; do
[ -d "$d/modules" ] && OMRS="$d" && break
done
echo "OpenMRS dir: ${OMRS:-NOT FOUND}"
@mherman22
mherman22 / restore-idsystem.sh
Created July 13, 2026 11:31
SEDISH 44: restore fhir_patient_identifier_system rows 3,4 after accidental delete
#!/usr/bin/env bash
# SEDISH / server 44: undo the accidental delete of fhir_patient_identifier_system
# rows 3,4 (the previous fix script deleted them, then aborted on a wrong changelog
# table name before it could restore/restart). fhir2 is already started, so its
# liquibase changesets 2026Jul07-1118/-1119 are already recorded -> a restart will
# NOT re-insert 3,4, so we simply restore them from the backup the prior run made.
set -euo pipefail
echo "==================== restore fhir_patient_identifier_system 3,4 ===================="
OMRS=""
@mherman22
mherman22 / fix-fhir2-idsystem.sh
Created July 12, 2026 13:11
SEDISH 44 recovery: fix fhir2 fhir_patient_identifier_system duplicate-PK startup failure
#!/usr/bin/env bash
# SEDISH / server 44 recovery:
# fhir2 fails to start because its liquibase seed changesets 2026Jul07-1118/-1119
# try to INSERT fhir_patient_identifier_system rows with PK 3 and 4 that already
# exist -> "Duplicate entry for key 'PRIMARY'" -> fhir2 aborts -> 9-module cascade.
#
# Fix: back up the table, drop the two colliding rows AND their (never-recorded)
# changelog entries, then restart so fhir2 re-seeds them canonically.
# Safe & reversible: a full copy of the table is kept as *_bak_recover.
set -euo pipefail
This file has been truncated, but you can view the full file.
root@ip-172-31-13-3:/usr/share/tomcat7/.OpenMRS/modules# cd ..
root@ip-172-31-13-3:/usr/share/tomcat7/.OpenMRS# cat openmrs.log
WARN - AbstractBeanFactory.getTypeForFactoryBean(1427) |2026-07-10 20:49:03,678| Bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountService' defined in URL [jar:file:/usr/share/tomcat7/.OpenMRS/.openmrs-lib-cache/emrapi/emrapi.jar!/moduleApplicationContext.xml]: Cannot create inner bean 'org.openmrs.module.emrapi.account.AccountServiceImpl#11c9a197' of type [org.openmrs.module.emrapi.account.AccountServiceImpl] while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.openmrs.module.emrapi.account.AccountServiceImpl#11c9a197' defined in URL [jar:file:/usr/share/tomcat7/.OpenMRS/.openmrs-lib-cache/emrapi/emrapi.jar!/moduleApplicationContext.xml]: Cannot resolve reference to bean 'userService' while se