Skip to content

Instantly share code, notes, and snippets.

View djazayeri's full-sized avatar

Darius Jazayeri djazayeri

View GitHub Profile
@djazayeri
djazayeri / request.json
Created March 24, 2016 22:12
minimal POST to create an OpenMRS order
{
"type": "testorder",
"patient": "1681f4b7-7f4d-4227-9562-718ee347bbd8",
"concept": "840AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"encounter": "8a32e7cb-0bbb-4c4e-8ed4-fc982443859f",
"orderer": "9e28cb36-0df4-4972-b375-4a5ff88e39d9",
"careSetting": "c365e560-c3ec-11e3-9c1a-0800200c9a66"
}
@djazayeri
djazayeri / EnterHtmlFormFragmentControllerComponentTest.java
Created March 25, 2016 01:13
additional test that shows an exception being thrown by controller
@Test
public void testErrorInPatientIdentifier() throws Exception {
FragmentModel model = new FragmentModel();
Patient patient = new Patient();
String resourcePath = "emr:htmlforms/patientIdentifierTest.xml";
when(resourceFactory.getResourceAsString("emr", "htmlforms/patientIdentifierTest.xml")).thenReturn(PATIENT_IDENTIFIER_TEST_FORM_DEFINITION);
FragmentConfiguration config = new FragmentConfiguration();
config.put("patient", patient);
config.put("definitionUiResource", resourcePath);
{
"name": "Capture Vitals",
"uuid": "60df0617-c18e-4609-8bdf-6f8de1b5b0cc",
"processor": "EncounterFormProcessor",
"pages": [
{
"label": "",
"sections": [
{
"label": "Vitals",
@djazayeri
djazayeri / gist:738b5a9e54e54a2e38ff6b244a3547a1
Created March 3, 2017 23:04
failure of mvn release:prepare
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:jar (attach-javadocs) on project openmrs-api: MavenReportException: Error while generating Javadoc:
[INFO] [ERROR] Exit code: 1 - /Users/djazayer/code/openmrs/openmrs-core/api/src/main/java/org/openmrs/Address.java:78: warning: no description for @param
[INFO] [ERROR] * @param address7
[INFO] [ERROR] ^
[INFO] [ERROR] /Users/djazayer/code/openmrs/openmrs-core/api/src/main/java/org/openmrs/Address.java:90: warning: no description for @param
[INFO] [ERROR] * @param address8
[INFO] [ERROR] ^
[INFO] [ERROR] /Users/djazayer/code/openmrs/openmrs-core/api/src/main/java/org/openmrs/Address.java:102: warning: no description for @param
[INFO] [ERROR] * @param address9
[INFO] [ERROR] ^
public class EvaluatedCohortResourceTest extends BaseEvaluatedResourceTest<EvaluatedCohortResource, EvaluatedCohort> {
// original file content was here
// I added this to the end
@Test
public void andelaExample() throws Exception {
GenderCohortDefinition query1 = new GenderCohortDefinition();
query1.setMaleIncluded(true);
@djazayeri
djazayeri / gist:2f71e383451d94e146570a9acd8d5037
Created March 26, 2017 06:22
browser location for ocl search bug report
https://staging.openconceptlab.org/search/?collection-owner=djazayeri&collection-name=TEST&collection-url=%2Fusers%2Fdjazayeri%2Fcollections%2FTEST%2F&collection-owner=djazayeri&collection-name=OMRS&collection-url=%2Fusers%2Fdjazayeri%2Fcollections%2FOMRS%2F&collection-owner=djazayeri&collection-name=NO&collection-url=%2Fusers%2Fdjazayeri%2Fcollections%2FNO%2F&collection-owner=djazayeri&collection-name=DxStart&collection-url=%2Fusers%2Fdjazayeri%2Fcollections%2FDxStart%2F&collection-owner=djazayeri&collection-name=OMRS16&collection-url=%2Fusers%2Fdjazayeri%2Fcollections%2FOMRS16%2F&collection-owner=djazayeri&collection-name=302&collection-url=%2Fusers%2Fdjazayeri%2Fcollections%2F302%2F&collection-owner=djazayeri&collection-name=testauto&collection-url=%2Fusers%2Fdjazayeri%2Fcollections%2Ftestauto%2F&collection-owner=djazayeri&collection-name=502&collection-url=%2Fusers%2Fdjazayeri%2Fcollections%2F502%2F&collection-owner=djazayeri&collection-name=427&collection-url=%2Fusers%2Fdjazayeri%2Fcollections%2F427%2F&c
@djazayeri
djazayeri / result.json
Created March 28, 2017 09:02
Reporting module data set export for encounters and all obs
{
"uuid": null,
"metadata": {
"columns": [
{
"datatype": "java.lang.Integer",
"name": "ENCOUNTER_ID",
"label": "ENCOUNTER_ID"
},
{
@djazayeri
djazayeri / gist:6404c739ff16b2a4cd28ec3037e760fd
Last active April 12, 2017 23:29
pre-2.1 cohort REST API
--- Create a cohort
POST https://demo.openmrs.org/openmrs/ws/rest/v1/cohort
{"name":"Darius testing", "description": "REST", "memberIds": [515]}
=>
{
"uuid": "ca254345-429b-491c-b833-1933cdd7d828",
"display": "Darius testing",
2017-08-16 02:40:20.114 INFO 1 --- [pool-2-thread-1] o.o.a.scheduled.FetchDetailsToIndex : Fetching OMOD for org.openmrs.module.omodreloader 1.0
2017-08-16 02:40:20.114 INFO 1 --- [pool-2-thread-1] o.o.a.scheduled.FetchDetailsToIndex : fetching config.xml from https://bintray.com/openmrs/omod/download_file?file_path=omodreloader-1.0.omod
2017-08-16 02:40:21.136 ERROR 1 --- [pool-2-thread-1] o.o.a.scheduled.FetchDetailsToIndex : Error indexing org.openmrs.module.openhmis-backboneforms
org.springframework.web.client.HttpClientErrorException: 404 Not Found
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:91) ~[spring-web-4.3.6.RELEASE.jar!/:4.3.6.RELEASE]
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:700) ~[spring-web-4.3.6.RELEASE.jar!/:4.3.6.RELEASE]
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:653) ~[spring-web-4.3.6.RELEASE.jar!/:4.3.6.RELEASE]
at org.springframework
@djazayeri
djazayeri / encounter.json
Created March 5, 2018 21:57
visit note encounter example
{
"uuid": "22a7d95a-1198-41d8-a7fa-ab313c75b43d",
"display": "Visit Note 05\/03\/2018",
"encounterDatetime": "2018-03-05T21:53:47.000+0000",
"patient": {
"uuid": "2e6417da-f242-4ef6-adbf-1864bd9f9cf7",
"display": "100J43 - Azza Ahmed Mohamed",
"links": [
{
"rel": "self",