Skip to content

Instantly share code, notes, and snippets.

@mks-d
mks-d / gist:9919ece1379ae311b38ad1d93b9fb598
Created November 8, 2016 10:02
org.openmrs.api.APIException: Editing some fields [comment] on Obs is not allowed
ERROR - BaseRestController.handleException(119) |2016-11-08 11:01:46,198| Editing some fields [comment] on Obs is not allowed
org.openmrs.api.APIException: Editing some fields [comment] on Obs is not allowed
at org.openmrs.api.db.hibernate.ImmutableEntityInterceptor.onFlushDirty(ImmutableEntityInterceptor.java:111)
at org.openmrs.api.db.hibernate.ChainingInterceptor.onFlushDirty(ChainingInterceptor.java:75)
at org.hibernate.event.internal.DefaultFlushEntityEventListener.invokeInterceptor(DefaultFlushEntityEventListener.java:365)
at org.hibernate.event.internal.DefaultFlushEntityEventListener.handleInterception(DefaultFlushEntityEventListener.java:342)
at org.hibernate.event.internal.DefaultFlushEntityEventListener.scheduleUpdate(DefaultFlushEntityEventListener.java:293)
at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:160)
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:231)
@mks-d
mks-d / openmrs-distro.properties
Created November 8, 2016 13:06
Ref App distro 2.3.x
omod.htmlformentry19ext=1.6.1
omod.reportingrest=1.5
omod.metadatadeploy=1.5
omod.serialization.xstream.type=omod
omod.serialization.xstream=0.2.10
omod.registrationapp=1.3
omod.event.groupId=org.openmrs
omod.event=2.2.1
omod.atlas.type=omod
omod.uilibrary=2.0.4
@mks-d
mks-d / gist:3aed51f773294779dc4103ea0f902816
Created November 18, 2016 17:30
printDiagnosis(Diagnosis d, boolean retained)
private void printDiagnosis(Diagnosis d, boolean retained) {
Obs obs = d.getExistingObs();
Encounter e = obs.getEncounter();
String prefix = retained ? "R\t" : "A\t";
System.out.println(prefix + e.getEncounterId() + " (" + e.getEncounterDatetime().toString() + ")\t" + obs.getObsId() + " (" + obs.getObsDatetime().toString() + ")\t" + d.getDiagnosis().getNonCodedAnswer());
}
@mks-d
mks-d / gist:d4125718aa2d9dc144007ece34fb1787
Created December 15, 2016 17:40
SDK & docker: java.net.ConnectException: Connection refused (Connection refused)
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.GeneratedConstructorAccessor13.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1129)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:358)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2489)
at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2334)
... 15 more
@mks-d
mks-d / gist:61616cabcc76c2afaf5e09fdc78f53f0
Created December 16, 2016 10:48
SDK & docker: Table 'openmrs.person_attribute_type' doesn't exist
WARN - OpenmrsUtil.getRuntimePropertiesFilePathName(2669) |2016-12-16 10:46:11,853| Unable to find a runtime properties file at /usr/local/tomcat/openmrs-runtime.properties
WARN - OpenmrsUtil.getRuntimePropertiesFilePathName(2697) |2016-12-16 10:46:11,853| Unable to find properties file: /usr/local/tomcat/.OpenMRS/openmrs-runtime.properties
INFO 12/16/16 10:46 AM:liquibase: Reading from `liquibasechangelog`
WARNING 12/16/16 10:46 AM:liquibase: modifyDataType will lose primary key/autoincrement/not null settings for mysql. Use <sql> and re-specify all configuration if this is the case
WARNING 12/16/16 10:46 AM:liquibase: modifyDataType will lose primary key/autoincrement/not null settings for mysql. Use <sql> and re-specify all configuration if this is the case
WARNING 12/16/16 10:46 AM:liquibase: modifyDataType will lose primary key/autoincrement/not null settings for mysql. Use <sql> and re-specify all configuration if this is the case
INFO 12/16/16 10:46 AM:liquibase: Successfully acquired change log loc
@mks-d
mks-d / gist:a7b522c8ceaf493912e9041aff0c5465
Created December 16, 2016 12:33
SDK & docker: Full log
mymac:demoserver mksd$ docker-compose kill
Killing openmrs-lfhcdistro-mysql ... done
mymac:demoserver mksd$ docker-compose rm -f
Going to remove openmrs-lfhcdistro, openmrs-lfhcdistro-mysql
Removing openmrs-lfhcdistro ... done
Removing openmrs-lfhcdistro-mysql ... done
mymac:demoserver mksd$ docker-compose build
openmrs-lfhcdistro-mysql uses an image, skipping
Building openmrs-lfhcdistro
Step 1 : FROM tomcat:7
@mks-d
mks-d / gist:b764052b29b172f1b924b86af59384ab
Created February 9, 2017 12:52
Core 1.11.x + Java 7 = getTimeZoneOffset_shouldReturnTimezoneForGivenDateAndNotTheCurrentDate(org.openmrs.hl7.HL7UtilTest)
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] OpenMRS
[INFO] openmrs-tools
[INFO] openmrs-test
[INFO] openmrs-api
[INFO] openmrs-web
[INFO] openmrs-webapp
@mks-d
mks-d / openmrs_sdk.sh
Last active May 5, 2020 11:31
OpenMRS SDK quick setup
#
# Install the SDK
#
mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk
#
# Ref App
#
# Setup Ref App distro
mvn openmrs-sdk:setup -DserverId=refapp-2-11 -Ddistro=referenceapplication:2.11.0-SNAPSHOT -DdbUri=jdbc:mysql://localhost:3306/openmrs_refapp-2-11 -DdbUser=root -DdbPassword=root
@mks-d
mks-d / build.xml
Last active July 6, 2017 13:05
Ant print files for pattern
<?xml version="1.0" encoding="UTF-8"?>
<project name="ant.print.files" basedir=".">
<!-- Print path manually -->
<target name="print-files" description="" >
<property name="pattern" value="**/*"/>
<path id="example.path">
<fileset dir="${basedir}">
<include name="${pattern}" />
</fileset>
@mks-d
mks-d / ubuntu-install-eclipse.txt
Created September 26, 2017 16:01
Install Ecliipse on Ubuntu
1. Download the Eclipse *installer*, usually named:
eclipse-inst-linux64.tar.gz
2. Unpack it and run eclipse-inst that is inside, just in Nautilus.
3. When done Eclipse should simply be installed in /home/<username>/eclipse
4. The installer might add a desktop file at /usr/share/applications/eclipse.desktop
Edit that file and ensure that the Exec and Icon paths are correct, eg;
Icon=/home/<username>/eclipse/jee-oxygen/eclipse/icon.xpm