Skip to content

Instantly share code, notes, and snippets.

mks-d /
Last active Mar 10, 2021
Uuid Void/Retire Identifier type Name Description Prefix Suffix First identifier base Min length Max length Base character set _version:1 _order:6000
90563743-a6c8-4c23-8244-f50361f2a997 df255fa5-eb77-414d-89e5-5f068ba63a54 Location Prefixed Identifier Source Location Prefixed Identifier Source provider:idgen.locationBasedPrefixProvider 100000 6 0123456789ACDEFGHJKLMNPRTUVWXY
mks-d /
Created Nov 16, 2020
package org.openmrs.module.htmlformentry;
import static java.util.Calendar.MILLISECOND;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import java.util.TimeZone;
import org.junit.Assert;
mks-d / prp.latestServicePlan.widget.json
Created Oct 31, 2019
Sample PRP 'latest obs' Widget with (obs and obs group)
View prp.latestServicePlan.widget.json
"id": "prp.latestServicePlan.widget",
"instanceOf": "coreapps.template.dashboardWidget",
"order": 1,
"config": {
"widget": "latestobsforconceptlist",
"icon": "icon-user-md",
"label": "Sample PRP Widget",
"concepts": "0144f175-3231-4d12-8d97-ec8b4d348cab, e322170f-2417-45eb-86ab-5f8eb0170510"
mks-d /
Last active Nov 17, 2019
Recursively search & replace with GNU sed on macOS

While working on one of our Java projects on macOS it was required to do a search and replace in all Java files containing a string sequence. In our case it was required to change every JavaDoc "@since 2.3.0" into "@since 2.1.5, 2.3.0".

sed is the tool for this, and since BSD's implementation differs from GNU sed, we opted to stick to GNU sed which is available on Homebrew:

brew install gnu-sed

Then the magic combining find and sed:

find src/ -name '*.java' | xargs gsed -i -e "s/@since 2.3.0/@since 2.1.5, 2.3.0/g"
mks-d /
Last active Dec 17, 2018
OpenMRS Initializer provides the 'locations' domain - Example use

Strangely we could do for so long without a dedicated OpenMRS Initializer domain for locations. Until now we were simply bringing in locations metadata through OpenMRS MDS packages. MDS packages are always a convenient fallback mechanism when the desired OpenMRS Initializer domain is not (yet) available.

It was on our to do list for some time to finally address the case of locations. It is now done, please check the README about it here.

Let us look at a sample use on a Bahmni distribution of one of our clients that supports a small community health clinic in Haiti. Starting from an existing default Bahmni setup we want to end up with just two locations:

  • Clinic
  • Community

'Clinic' is the login location for providers at the clinic itself, whereas 'Community' is an ad-hoc location for providers performing community surveys while offline using Bahmni Connect. We had to deal with the

mks-d /
Last active Dec 17, 2018
Unlocking a hanging Bahmni report marked as 'Processing'

One of our Bahmni instances was not able to trigger any Bahmni Reports because - somehow - a report that could never be completed was stuck as 'Processing'. That piece of information could be seen in the 'Reports Queue' under 'My Reports':


It was clear that this report was not really processing and that the information was lingering, yet blocking the scheduling of any new report with an error 500:

The server encountered an internal error that prevented it from fulfilling this request.

Restarting Bahmni Reports didn't do anything to it:

mks-d / head.html
Created Nov 11, 2018
Jenkins: Custom OCD3 login page (with Mekom colors)
View head.html
html {
font: Helvetica;
color: #3f3f40;
div .simple-page {
text-align: center;
Original Corrected
Syndrome d'Obrinsky/Prune belly Aplasie congénitale de la musculature abdominale (Syndrome d'Obrinsky)
Rosacee Acné rosacée
Déficience de le marche Difficulté à la marche, non classée ailleurs
mks-d / openmrs_fetch_icd10_diagnoses.sql
Last active Oct 29, 2018
MySQL query to fetch OpenMRS ICD-10 diagnoses for Haiti
View openmrs_fetch_icd10_diagnoses.sql
mks-d / bahrain_ah.csv
Last active Sep 8, 2018
Bahrain address hierarchy: 'Governorate', 'Place', 'Block'
View bahrain_ah.csv
Southern Aáli 746
Southern Aáli 748
Southern Al Door 965
Southern Algainah 961
Southern Al Hajyat 929
Southern Al Hajyat 931
Southern Al Hajyat 935
Southern Al Hajyat 939
Southern Al Hunaniya 901
Southern Al Hunaniya 903