Skip to content

Instantly share code, notes, and snippets.

Dimitri R mks-d

Block or report user

Report or block mks-d

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mks-d
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
mks-d / tech_tip_20190321.md
Last active Nov 17, 2019
Recursively search & replace with GNU sed on macOS
View tech_tip_20190321.md

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
mks-d / tech_tip_20181213.md
Last active Dec 17, 2018
OpenMRS Initializer provides the 'locations' domain - Example use
View tech_tip_20181213.md

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
mks-d / tech_tip_20181201.md
Last active Dec 17, 2018
Unlocking a hanging Bahmni report marked as 'Processing'
View tech_tip_20181201.md

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':

Imgur

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
mks-d / head.html
Created Nov 11, 2018
Jenkins: Custom OCD3 login page (with Mekom colors)
View head.html
<style>
html {
font: Helvetica;
color: #3f3f40;
}
div .simple-page {
text-align: center;
}
View haiti_fr_diagnoses_corrected.md
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
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
SELECT
data.uuid,
GROUP_CONCAT(DISTINCT data.name SEPARATOR '; ') AS name,
data.set_name,
GROUP_CONCAT(DISTINCT data.code SEPARATOR '; ') AS 'Mapping'
FROM
(
SELECT
c.uuid,
(
@mks-d
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
@mks-d
mks-d / LiquibaseMigrationTest.java
Created Jul 13, 2018
Context sensitive test for OpenMRS Liquibase migrations
View LiquibaseMigrationTest.java
public class LiquibaseMigrationTest extends BaseModuleContextSensitiveTest {
public LiquibaseMigrationTest() {
super();
Properties props = getRuntimeProperties();
if (useInMemoryDatabase()) {
String url = "jdbc:h2:mem:openmrs;DB_CLOSE_DELAY=30;LOCK_TIMEOUT=10000;LOCK_MODE=0";
props.setProperty(Environment.URL, url);
}
View mergepatientdata-omod-pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.openmrs.module</groupId>
<artifactId>mergepatientdata</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>mergepatientdata-omod</artifactId>
<packaging>jar</packaging>
<name>Merge Patient Data OMOD</name>
You can’t perform that action at this time.