I don't see why the HL7 message couldn't just be posted to a port by itself without any json or xml or authentication. Isn't there some other way to dump stuff into the HL7 queue?
From: [email protected] [mailto:[email protected]] On Behalf Of Daniel Kayiwa Sent: Friday, August 05, 2011 10:39 AM To: [email protected] Subject: Re: [OPENMRS-DEV] WebServices-REST API I tested it without the "source" field and got this exception: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'hl7_source' cannot be null It saved successfully without the "sourceKey" though the record was saved with NULL in the database for the "hl7_source_key" field. So looks like before we implement that, the current version of the module requires a value for the "source" field. On Fri, Aug 5, 2011 at 5:12 PM, Burke Mamlin <[email protected]<mailto:[email protected]>> wrote: What are "source" and "sourceKey"? Are these the sending application ± facility and the message control ID (unique identifier for the message)? If so, can't these taken from the HL7 message (MSH-3 ± MSH-4 and MSH-10, respectively)? I would have expected: POST /openmrs/ws/rest/v1/hl7 Body content: MSH|^~\&|FORMENTRY|AMRS.ELD|HL7LISTENER|AMRS.ELD|20110805104142||ORU^R01|REl7wt78q9Pzlqe9ecJB|P|2.5|1||||||||3^AMRS.ELD.FORMID PID|||3^^^^||Patient^John^D|| PV1||O|1||||1|||||||||||||||||||||||||||||||||||||20110805|||||||V ORC|RE||||||||20110805104141|1^Super User OBR|1|||1238^MEDICAL RECORD OBSERVATIONS^99DCT OBX|1|NM|5089^WEIGHT (KG)^99DCT||67.2|||||||||20110805 Where the HL7 message already identifies: * Sending application (MSH--3) = "FORMENTRY" * Sending facility (MSH-4) = "AMRS.ELD" * Receiving application (MSH-5) = "HL7LISTENER" * Receiving facility (MSH-6) = "AMRS.ELD" * Message Control ID (MSH-10) = "REl7wt78q9Pzlqe9ecJB" ← same as "source key", right? Cheers, -Burke On Fri, Aug 5, 2011 at 9:49 AM, Daniel Kayiwa <[email protected]<mailto:[email protected]>> wrote: Hi Jeff, Here is a small example of how you can send an hl7 message to OpenMRS using the REST Web Services Module. POST /openmrs/ws/rest/v1/hl7 Body content: {"source":"LOCAL", "sourceKey":"4XaL1KXdqL2T4Xbj4kZM", "data":"TheActualHl7Message"} And replace "TheActualHl7Message" with the actual hl7 message Below is an example for a message i sent to create a weight observation of value 67.2 for a patient called John Doe: MSH|^~\&|FORMENTRY|AMRS.ELD|HL7LISTENER|AMRS.ELD|20110805104142||ORU^R01|REl7wt78q9Pzlqe9ecJB|P|2.5|1||||||||3^AMRS.ELD.FORMID PID|||3^^^^||Patient^John^D|| PV1||O|1||||1|||||||||||||||||||||||||||||||||||||20110805|||||||V ORC|RE||||||||20110805104141|1^Super User OBR|1|||1238^MEDICAL RECORD OBSERVATIONS^99DCT OBX|1|NM|5089^WEIGHT (KG)^99DCT||67.2|||||||||20110805 The REST Web services module has a "Test" link which you can access from the admin page and try testing GET, POST, DELETE for the various web service resources. NOTE: When you send an hl7 message, it will go into the queue and therefore you will need to schedule and start the "Process HL7 Task", which you can see when you click the "Manage Scheduler" link on the admin page. On Fri, Aug 5, 2011 at 4:57 AM, Price, Jeff M. <[email protected]<mailto:[email protected]>> wrote: (sorry if this a duplicate) I am new to openMRS,HL7,andWebServices, but am on a project where I have to send HL7 messages into openMRS. I know it’s a lot to learn and I am feeling a bit lost. Would it be possible for anyone to tell me what I need to do and how to send an HL7 message into openMRS with REST-WebServices API, and perhaps even give me a small example ? Someone pointed me to the link below, but I could not figure out what to do from there. Probably because I do not know about WebServices/REST in general https://wiki.openmrs.org/display/docs/REST+Web+Services+API Thanks so much Freel free to email me directly : [email protected]<mailto:[email protected]> Jeff Price West Wireless Health Institute<http://www.westwirelesshealth.org/> Principal Systems Enginner [email protected]<mailto:[email protected]> (858) 535-7000<tel:%28858%29%20535-7000> / TEL (858) 412-8639<tel:%28858%29%20412-8639> / DIRECT (858)-361-5751<tel:%28858%29-361-5751> / CELL ________________________________ Click here to unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l> from OpenMRS Developers' mailing list -- If we keep uppermost in our minds the unkind and unjust acts of others, we shall find it impossible to love them as Christ has loved us; but if our thoughts dwell upon the wondrous love and pity of Christ for us, the same spirit will flow out to others. ________________________________ Click here to unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l> from OpenMRS Developers' mailing list ________________________________ Click here to unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l> from OpenMRS Developers' mailing list -- If we keep uppermost in our minds the unkind and unjust acts of others, we shall find it impossible to love them as Christ has loved us; but if our thoughts dwell upon the wondrous love and pity of Christ for us, the same spirit will flow out to others. ________________________________ Click here to unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l> from OpenMRS Developers' mailing list

