I have an application that posts HL7 messages to OpenMRS. The message built
is as follows:
MSH|^~\&|MedAssist|OpenMRS|AUSDVA|OpenMRS|20140716150602||ORU^R01|20140716150602|P|2.5|1
PID|||2||Patient^John
OBR|1||1234^SensorReading|88304
OBX||NM|1||45||||||C
OBX||NM|2||34||||||C
OBX||NM|3||23||||||C
I have passed this message through an online HL7 validator and it comes
clean without any error messages. Now, when I post this message, it is
placed in the "HL7 queued messages" queue. However, it never exits this
queue. On the console, I get the following exception:
ERROR - TimerSchedulerTask.run(54) |2014-07-15 16:16:30,198| FATAL ERROR:
Task [class org.openmrs.scheduler.tasks.TaskThreadedInitializationWrapper]
failed due to exception
[org.springframework.transaction.UnexpectedRollbackException]
org.springframework.transaction.UnexpectedRollbackException: Transaction
rolled back because it has been marked as rollback-only
The full stack trace can be found here: http://pastebin.com/KzVFewy8
I thought the reason for this was because some fields in the HL7 message
were null. However, I then tried posting this sample message:
MSH|^~\&|FORMENTRY|AMRS|HL7LISTENER|AMRS|20050217152845||ORU^R01|AMRS20050217152845|P|2.5|1||||||||1^AMRS-ELDORET\^[
http://schemas.openmrs.org/2006/FormEntry/formId]\^URI
PID||1^\^^AMRS|1MT^9^M10||Patient^Jonny^Dee{^}{^}DR|Patient^Momma^Thee^\^MS|20040101000000^Y|M||B|555
Johnson Road^Apt.555^Indianapolis^IN^46202^USA|||||||||||Indianapolis,
IN|||||||||||||||||TRIBE CODE
PV1|1|O|^^^^^^^^^1^AMRS|2|||1^Mamlin^Joseph^^^^^^^^8^M10^^AMRS|||||||||||||||||||||||||||||||||||||20050217140000|||||||V
ORC|RE||||||||20050221130000|1^Enterer^Ima^^^^^AMRS
OBR|1|||1238^MEDICAL RECORD OBSERVATIONS^DCT
OBX|1|CE|1082^REVIEW OF SYSTEMS, CENTRAL NERVOUS
SYSTEM^DCT||207^DEPRESSION^DCT||||||F|||20050217204000
OBX|2|SN|5497^CD4 COUNT^DCT||<^10|cells/mm3|10-1500|L|||F|||20050217204000
OBX|3|NM|5089^WEIGHT (KG)^DCT||25|kg|20-300|L|||F|||20050217204000
OBX|4|TS|1191^HISTORICAL DRUG STOP
DATE^DCT||20050101||||||F|||20050217204000
I get the same error with the sample message. It is placed in the "HL7
queued messages" queue and it never gets out. On the console, I get the
UnexpectedRollbackException. Clearly, this is not supposed to happen. I
tried restarting the scheduler, but even that did not seem to work.
Q1. Why does the message not exit the queue? Is this normal behaviour? (I
really doubt it is)
Q2. Is there a problem with either of the two messages? If not, then why is
it stuck in the queue just like my message?
Q3. What should I do to get this transaction to work?
--
Regards,
Rishi Baijal.
2012084.
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel