Skip to content

Instantly share code, notes, and snippets.

@mks-d
mks-d / openmrs_fetch_icd10_diagnoses.sql
Last active October 29, 2018 13:09
MySQL query to fetch OpenMRS ICD-10 diagnoses for Haiti
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 November 23, 2023 12:34
Bahrain address hierarchy: 'Governorate', 'Place', 'Block'
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 July 13, 2018 21:58
Context sensitive test for OpenMRS Liquibase migrations
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);
}
<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>
<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-api</artifactId>
<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.maven.parents</groupId>
<artifactId>maven-parent-openmrs-module</artifactId>
<version>1.1.0</version>
</parent>
<groupId>org.openmrs.module</groupId>
<artifactId>mergepatientdata</artifactId>
package org.openmrs.module.attachments;
import java.util.List;
import org.junit.Test;
import org.openmrs.Encounter;
import org.openmrs.Patient;
import org.openmrs.Visit;
import org.openmrs.api.EncounterService;
import org.openmrs.api.PatientService;
@mks-d
mks-d / openmrs-maven-settings.xml
Created February 16, 2018 12:05
OpenMRS-generated ~/.m2/settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<servers>
<server>
<username>${env.BINTRAY_USER}</username>
<password>${env.BINTRAY_API_KEY}</password>
<id>bintray-sdk</id>
</server>
</servers>
@mks-d
mks-d / ProviderController2_0Test.java
Created January 29, 2018 11:30
RESTWS-696: ProviderController2_0Test
/**
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
* the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
*
* Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
* graphic logo is a trademark of OpenMRS Inc.
*/
package org.openmrs.module.webservices.rest.web.v1_0.controller.openmrs2_0;
@mks-d
mks-d / liquibase.xml
Created November 29, 2017 09:37
Liquibase changesets for renaming complex data handlers of Attachments
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">
<!--
See http://www.liquibase.org/manual/home#available_database_refactorings
for a list of supported elements and attributes
-->