You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
(4) |
May
(5) |
Jun
(6) |
Jul
(3) |
Aug
(13) |
Sep
(28) |
Oct
(33) |
Nov
(8) |
Dec
(1) |
2003 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(25) |
May
(21) |
Jun
(13) |
Jul
(12) |
Aug
(14) |
Sep
(6) |
Oct
(6) |
Nov
(16) |
Dec
(6) |
2004 |
Jan
(5) |
Feb
(7) |
Mar
(13) |
Apr
(17) |
May
(24) |
Jun
(14) |
Jul
(14) |
Aug
(8) |
Sep
(3) |
Oct
(8) |
Nov
(14) |
Dec
(26) |
2005 |
Jan
(18) |
Feb
(12) |
Mar
(29) |
Apr
(9) |
May
(4) |
Jun
(12) |
Jul
(17) |
Aug
(9) |
Sep
(12) |
Oct
|
Nov
(12) |
Dec
|
2006 |
Jan
(46) |
Feb
(18) |
Mar
(11) |
Apr
(13) |
May
(12) |
Jun
(27) |
Jul
(34) |
Aug
(45) |
Sep
(27) |
Oct
(13) |
Nov
(26) |
Dec
(22) |
2007 |
Jan
(21) |
Feb
(29) |
Mar
(32) |
Apr
(6) |
May
(11) |
Jun
(13) |
Jul
(14) |
Aug
(11) |
Sep
(15) |
Oct
(7) |
Nov
(30) |
Dec
(16) |
2008 |
Jan
(11) |
Feb
(14) |
Mar
(5) |
Apr
(18) |
May
(12) |
Jun
(11) |
Jul
(5) |
Aug
(12) |
Sep
(3) |
Oct
(2) |
Nov
(15) |
Dec
(2) |
2009 |
Jan
(18) |
Feb
(6) |
Mar
(9) |
Apr
(10) |
May
(29) |
Jun
(16) |
Jul
(44) |
Aug
(49) |
Sep
(14) |
Oct
(21) |
Nov
(11) |
Dec
(22) |
2010 |
Jan
(12) |
Feb
(13) |
Mar
(5) |
Apr
(6) |
May
(15) |
Jun
(15) |
Jul
(14) |
Aug
(20) |
Sep
(17) |
Oct
(36) |
Nov
(19) |
Dec
(7) |
2011 |
Jan
(8) |
Feb
(14) |
Mar
(21) |
Apr
(12) |
May
(6) |
Jun
(12) |
Jul
(17) |
Aug
(6) |
Sep
(13) |
Oct
(15) |
Nov
(26) |
Dec
(9) |
2012 |
Jan
(25) |
Feb
(13) |
Mar
(31) |
Apr
(10) |
May
(16) |
Jun
(21) |
Jul
(61) |
Aug
(38) |
Sep
(16) |
Oct
(13) |
Nov
(37) |
Dec
(26) |
2013 |
Jan
(20) |
Feb
(26) |
Mar
(34) |
Apr
(32) |
May
(27) |
Jun
(56) |
Jul
(16) |
Aug
(38) |
Sep
(35) |
Oct
(17) |
Nov
(11) |
Dec
(7) |
2014 |
Jan
(36) |
Feb
(13) |
Mar
(25) |
Apr
|
May
(27) |
Jun
(33) |
Jul
(34) |
Aug
|
Sep
(4) |
Oct
(11) |
Nov
(42) |
Dec
(2) |
2015 |
Jan
(5) |
Feb
(6) |
Mar
(11) |
Apr
(3) |
May
|
Jun
(1) |
Jul
(2) |
Aug
(5) |
Sep
(5) |
Oct
(5) |
Nov
(8) |
Dec
(19) |
2016 |
Jan
(8) |
Feb
(12) |
Mar
(6) |
Apr
(5) |
May
(5) |
Jun
(3) |
Jul
(1) |
Aug
|
Sep
(9) |
Oct
(1) |
Nov
(2) |
Dec
(5) |
2017 |
Jan
(2) |
Feb
|
Mar
(3) |
Apr
(6) |
May
(8) |
Jun
(7) |
Jul
(14) |
Aug
(10) |
Sep
(6) |
Oct
(2) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
(9) |
Mar
(2) |
Apr
(3) |
May
(1) |
Jun
(1) |
Jul
(1) |
Aug
(8) |
Sep
(4) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
2019 |
Jan
(10) |
Feb
(2) |
Mar
(6) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(5) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
2020 |
Jan
(9) |
Feb
|
Mar
|
Apr
(6) |
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
(9) |
Oct
(1) |
Nov
(11) |
Dec
|
2021 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(7) |
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2023 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
(2) |
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
(7) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
|
From: moparisthebest <ad...@mo...> - 2016-04-12 18:06:39
|
Hello, I'm new to HAPI and HL7 in general, and I tried this example exactly: http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/CreateAMessage.html With these maven dependencies: <dependency> <groupId>ca.uhn.hapi</groupId> <artifactId>hapi-base</artifactId> <version>2.2</version> </dependency> <dependency> <groupId>ca.uhn.hapi</groupId> <artifactId>hapi-structures-v24</artifactId> <version>2.2</version> </dependency> And though the example says it should print: MSH|^~\&|TestSendingSystem||||200701011539||ADT^A01^ADT A01||||123 PID|||123456||Doe^John What it *actually* prints is only: PID|||123456||Doe^John What do I need to do to get it to print the entire message? I am using java version "1.8.0_74" amd64 on a Linux machine, if that matters. Thanks much! |
From: Srinath R. <sr...@gg...> - 2016-03-19 10:04:29
|
Thanks Christian and Cheers !!! I am missing something here. I only see a 'keep' text file under the hapi-structures-v251 library. ...\hapi-mvn\hapi-structures-v251\src\main\java regards, Srinath From: Srinath Remala [mailto:sr...@gg...] Sent: Thursday, March 17, 2016 10:29 AM To: 'hl7...@li...' <hl7...@li...> Subject: Missing "message" folder under sources Greetings !!! The distribution is missing the "message" folder under sources. It only has "datatype" folder. For example under 251 hapi-mvn\hapi-base\src\main\java\ca\uhn\hl7v2\model\v251 there is 'datatype' folder present but 'message' folder is missing. Any guidance is greatly appreciated. Thanks SR |
From: Christian O. <chr...@gm...> - 2016-03-17 19:02:01
|
You find the messages (as well as groups and segments) in the hapi-structures-v251 library. Likewise all the other versins in their respective structure library cheers Christian Am 17.03.2016 um 15:29 schrieb Srinath Remala: > > Greetings !!! > > The distribution is missing the “message” folder under sources. It > only has “*/datatype”/* folder. > > For example under 251 > > hapi-mvn\hapi-base\src\main\java\ca\uhn\hl7v2\model\v251 > > there is ‘datatype’ folder present but ‘message’ folder is missing. > > Any guidance is greatly appreciated. > > Thanks > > SR > > > > ------------------------------------------------------------------------------ > Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more. > http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140 > > > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel |
From: Srinath R. <sr...@gg...> - 2016-03-17 14:42:03
|
Greetings !!! The distribution is missing the "message" folder under sources. It only has "datatype" folder. For example under 251 hapi-mvn\hapi-base\src\main\java\ca\uhn\hl7v2\model\v251 there is 'datatype' folder present but 'message' folder is missing. Any guidance is greatly appreciated. Thanks SR |
From: Jeremy H. <jer...@ka...> - 2016-03-16 12:03:41
|
A little bit more detail on this: The problem was added in this commit: https://sourceforge.net/p/hl7api/code/926/#diff-5 It was to fix this bug report: https://sourceforge.net/p/hl7api/bugs/206/ The question is, when a socket times out, do you expect to be able to recover from that error? The previously reported behaviour, in which a partial message was processed was obviously incorrect. The solution implemented was to throw away the first half of the message, which seems ok, but then the decoder tries to recover by going back and looking for the next message. The socket is now in an unknown state (the decoder assumes it is in between messages while the sender knows it is in the middle of the message). I guess at best, the decoder can treat the rest of the message as garbage and get back in sync next time it comes across a start-of-message byte. What I question, though, is whether trying to recover from a socket timeout is ever a good idea. I think the solution to the problem in bug 206 should have been to stop setting a socket timeout at all. Doing that, the slow message would not have been lost. Anyone who sets an explicit socket timeout probably wants something useful to happen when that timeout is hit. I think the most reasonable thing is to treat it as fatal and close the connection. For example, if you don't want ill-behaving clients to cause you to leave sockets open for ever. Jeremy Huiskamp | karoshealth Software Engineer 7 Father David Bauer Drive, Suite 201 Waterloo, ON, N2L 0A2, Canada www.karoshealth.com On 15 March 2016 at 10:19, Jeremy Huiskamp <jer...@ka...> wrote: > Hi Martin, > > Thanks for your response. This is a server socket, but we're already > installing our own socket factory and setting the socket timeout. The > problem is that MllpDecoder catches the SocketTimeoutException and ignores > it, going back to listening on the socket again. > > Have you verified that something actually happens when you hit your > timeout? Maybe I'm missing something... > > Jeremy Huiskamp | karoshealth > Software Engineer > 7 Father David Bauer Drive, Suite 201 > Waterloo, ON, N2L 0A2, Canada > www.karoshealth.com > > On 15 March 2016 at 04:00, Martin Schlapfer <mar...@gm...> > wrote: > >> Hi Jeremy, >> >> Is this a server side socket, or client side? For server side we >> subclass the HAPI socket factory, so we can set the socket timeout, then >> set it in the HapiContext: >> >> public class MySocketFactory extends >> ca.uhn.hl7v2.util.StandardSocketFactory { >> @Override >> public void configureNewAcceptedSocket(Socket theSocket) throws >> SocketException { >> if (socketTimeout>0) >> { >> log.info("Setting socket timeout on accepted socket from >> HAPI to '{}'.", socketTimeout); >> theSocket.setSoTimeout(socketTimeout); >> } >> } >> } >> >> .... >> ctx = new DefaultHapiContext(); >> >> ctx.setSocketFactory(new MySocketFactory()); >> >> Does this help you? >> >> Cheers, >> Martin. >> >> >> On 3/14/2016 7:11 AM, Jeremy Huiskamp wrote: >> >> Anyone have any thoughts on the below question? >> >> Thanks, >> >> Jeremy Huiskamp | karoshealth >> Software Engineer >> 7 Father David Bauer Drive, Suite 201 >> Waterloo, ON, N2L 0A2, Canada >> <http://www.karoshealth.com/>www.karoshealth.com >> >> On 14 September 2015 at 23:32, Jeremy Huiskamp < >> jer...@ka...> wrote: >> >>> Hi all, >>> >>> We're in the process of upgrading from hapi 1.2 to 2.2. With 1.2, we >>> used to be able to call Socket.setSOTimeout() and when that timeout >>> tripped, the connection using the socket would nicely shut down. 2.2 seems >>> to catch the exception, ignore it and keep on going. >>> >>> Is there some other mechanism we can use to automatically shut down a >>> connection after a certain period of inactivity? We need this >>> functionality to prevent leaks in our hl7 servers in environments where >>> clients crash or firewalls silently drop connections. >>> >>> I'd be happy to submit a patch but would want some feedback first. >>> Would it be acceptable to close the connection when a >>> SocketTimeoutException happens? Are there legitimate use cases for >>> triggering and then recovering from a timeout? >>> >>> Jeremy Huiskamp | karoshealth >>> Software Engineer >>> 7 Father David Bauer Drive, Suite 201 >>> Waterloo, ON, N2L 0A2, Canada >>> <http://www.karoshealth.com/>www.karoshealth.com >>> >>> >> >> >> ------------------------------------------------------------------------------ >> Transform Data into Opportunity. >> Accelerate data analysis in your applications with >> Intel Data Analytics Acceleration Library. >> Click to learn more.http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140 >> >> >> >> _______________________________________________ >> Hl7api-devel mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> >> >> > |
From: Jeremy H. <jer...@ka...> - 2016-03-15 09:19:47
|
Hi Martin, Thanks for your response. This is a server socket, but we're already installing our own socket factory and setting the socket timeout. The problem is that MllpDecoder catches the SocketTimeoutException and ignores it, going back to listening on the socket again. Have you verified that something actually happens when you hit your timeout? Maybe I'm missing something... Jeremy Huiskamp | karoshealth Software Engineer 7 Father David Bauer Drive, Suite 201 Waterloo, ON, N2L 0A2, Canada www.karoshealth.com On 15 March 2016 at 04:00, Martin Schlapfer <mar...@gm...> wrote: > Hi Jeremy, > > Is this a server side socket, or client side? For server side we subclass > the HAPI socket factory, so we can set the socket timeout, then set it in > the HapiContext: > > public class MySocketFactory extends > ca.uhn.hl7v2.util.StandardSocketFactory { > @Override > public void configureNewAcceptedSocket(Socket theSocket) throws > SocketException { > if (socketTimeout>0) > { > log.info("Setting socket timeout on accepted socket from > HAPI to '{}'.", socketTimeout); > theSocket.setSoTimeout(socketTimeout); > } > } > } > > .... > ctx = new DefaultHapiContext(); > > ctx.setSocketFactory(new MySocketFactory()); > > Does this help you? > > Cheers, > Martin. > > > On 3/14/2016 7:11 AM, Jeremy Huiskamp wrote: > > Anyone have any thoughts on the below question? > > Thanks, > > Jeremy Huiskamp | karoshealth > Software Engineer > 7 Father David Bauer Drive, Suite 201 > Waterloo, ON, N2L 0A2, Canada > <http://www.karoshealth.com/>www.karoshealth.com > > On 14 September 2015 at 23:32, Jeremy Huiskamp < > jer...@ka...> wrote: > >> Hi all, >> >> We're in the process of upgrading from hapi 1.2 to 2.2. With 1.2, we >> used to be able to call Socket.setSOTimeout() and when that timeout >> tripped, the connection using the socket would nicely shut down. 2.2 seems >> to catch the exception, ignore it and keep on going. >> >> Is there some other mechanism we can use to automatically shut down a >> connection after a certain period of inactivity? We need this >> functionality to prevent leaks in our hl7 servers in environments where >> clients crash or firewalls silently drop connections. >> >> I'd be happy to submit a patch but would want some feedback first. >> Would it be acceptable to close the connection when a >> SocketTimeoutException happens? Are there legitimate use cases for >> triggering and then recovering from a timeout? >> >> Jeremy Huiskamp | karoshealth >> Software Engineer >> 7 Father David Bauer Drive, Suite 201 >> Waterloo, ON, N2L 0A2, Canada >> <http://www.karoshealth.com/>www.karoshealth.com >> >> > > > ------------------------------------------------------------------------------ > Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more.http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140 > > > > _______________________________________________ > Hl7api-devel mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > > |
From: Jeremy H. <jer...@ka...> - 2016-03-14 14:34:53
|
Anyone have any thoughts on the below question? Thanks, Jeremy Huiskamp | karoshealth Software Engineer 7 Father David Bauer Drive, Suite 201 Waterloo, ON, N2L 0A2, Canada www.karoshealth.com On 14 September 2015 at 23:32, Jeremy Huiskamp < jer...@ka...> wrote: > Hi all, > > We're in the process of upgrading from hapi 1.2 to 2.2. With 1.2, we > used to be able to call Socket.setSOTimeout() and when that timeout > tripped, the connection using the socket would nicely shut down. 2.2 seems > to catch the exception, ignore it and keep on going. > > Is there some other mechanism we can use to automatically shut down a > connection after a certain period of inactivity? We need this > functionality to prevent leaks in our hl7 servers in environments where > clients crash or firewalls silently drop connections. > > I'd be happy to submit a patch but would want some feedback first. Would > it be acceptable to close the connection when a SocketTimeoutException > happens? Are there legitimate use cases for triggering and then recovering > from a timeout? > > Jeremy Huiskamp | karoshealth > Software Engineer > 7 Father David Bauer Drive, Suite 201 > Waterloo, ON, N2L 0A2, Canada > www.karoshealth.com > > |
From: <sat...@gm...> - 2016-02-26 14:21:28
|
> Hi > > When am parsing the following result hl7 message using hapi Parser the NTE segment comment (NTE.03 field) data's beginning spaces are suppressed. Am using 2.5 version parser > > e.g. NTE|1|L| ** S = Susceptible; I = Intermediate; R = Resistant ** > > becomes > > NTE|1|L|** S = Susceptible; I = Intermediate; R = Resistant ** > > after parsing. Notice NTE.03 field beginning spaces are trimmed. > > Is there any way by which i can keep these spaces after parsing also. When the spaces are automatically suppressed the user can't see the data properly aligned. Have attached the complete hl7 message below. > > > If you have any questions please don't hesitate to ask. > > Can you please help. > > Thanks > > Regards > Satish > > > MSH|^~\&|abcde|ab|abcdefghij|abcdefa|201602151222||ORU^R01|6497|P|2.5 > PID|1|123-45-6789|04699445010|123456789|HISTO^LABCORP^T||19500301|M|||abcdef^^NEW YORK^NY^12345||(123)123-1234|||||123123123^^^04^^F|123456789 > ORC|RE|R-20160226002^LAB|04699445010^LAB||||||201602150000|||170^PROVIDER^J^^^^^N > OBR|1|R-20160226002^LAB|04699445010^LAB|997871^Result^L|||201602130517||1500||G|||201602151157||||R-201602130||R-20160226002||201602151222|||F|008722|||008144 > OBX|1|ST|997141^Result 1^L^6463-4^Bacteria identified^LN||Salmonella typhi|||A||N|F|||201602151205|01 > NTE|1|L|Heavy growth > OBX|2|ST|997142^Result 2^L^6463-4^Bacteria identified^LN||Shigella dysenteriae|||A||N|F|||201602151205|01 > OBX|3|TX|997145^Antimicrobial Susceptibility^L^23658-8^Antibiotic XXX^LN||Comment|||||N|F|||201602151205|01 > NTE|1|L| ** S = Susceptible; I = Intermediate; R = Resistant ** > NTE|2|L| P = Positive; N = Negative > NTE|3|L| MICS are expressed in micrograms per mL > NTE|4|L| Antibiotic RSLT#1 RSLT#2 RSLT#3 RSLT#4 > NTE|5|L|Amikacin =S > NTE|6|L|Ampicillin =S > NTE|7|L|Ampicillin/Sulbactam =S > NTE|8|L|Cefazolin =R > NTE|9|L|Cefepime =R > NTE|10|L|Cefoxitin =S > NTE|11|L|Ceftazidime =S > NTE|12|L|Ceftriaxone =S > NTE|13|L|Ciprofloxacin =S > NTE|14|L|ESBL =I > NTE|15|L|Gentamicin =R > NTE|16|L|Imipenem =R > NTE|17|L|Levofloxacin =R > NTE|18|L|Meropenem =S > NTE|19|L|Nitrofurantoin =S > NTE|20|L|Piperacillin/Tazobactam =S > NTE|21|L|Tobramycin =I > NTE|22|L|Trimethoprim/Sulfa =S > |
From: Davies, B. <Bri...@Mc...> - 2016-02-24 16:10:28
|
Hi James, It is possible, especially since it is happening during the decoding process and the messages actually get to the server. I will look into that possibility. Cheers, Brian. From: James Agnew [mailto:jam...@gm...] Sent: Wednesday, February 24, 2016 9:53 AM To: Davies, Brian Cc: hl7...@li... Subject: Re: [HAPI-devel] HohClientSimple Exception (Missed putting the subject) Hi Brian, To me that looks like the server isn't setting the content type on the response. Is that possible? Cheers, James On Tue, Feb 23, 2016 at 9:01 AM, Davies, Brian <Bri...@mc...<mailto:Bri...@mc...>> wrote: Hi All, I am using the HAPI HohClientSimple client to send a simple HL7 message to some HTTP endpoint but have been encountering an issue with it. I constantly get an exception relating to the content-type of the message. Initially I had set up an embedded Jetty server and I got this message. I had also set up a simple servlet to receive messages posted from the HohClientSimple client. Initally, I suspected I was getting the exception because of Jetty, so I eliminated the Jetty piece and find even with a simple direct post to a servlet, I still get this exception. Please be aware that the message gets posted to the servlet. I even proceeded to set up a separate standalone web application to eliminate issues of a 3rd party library doing any translation. However, I still got the exception on the client as follows: 0:14:47.627 INFO [main][ca.uhn.hl7v2.hoh.util.VersionLogger] HL7 over HTTP (HAPI) library version 2.2 - Build 932 (2014-03-04 20:34:45) ca.uhn.hl7v2.hoh.api.DecodeException: Content-Type not specified at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.doReadContentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:230) at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.readHeadersAndContentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:541) at ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.doSendAndReceiveInternal(AbstractRawClient.java:159) at ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.sendAndReceive(AbstractRawClient.java:279) at ca.uhn.hl7v2.hoh.raw.client.HohRawClientSimple.sendAndReceive(HohRawClientSimple.java:55) at ca.uhn.hl7v2.hoh.hapi.client.AbstractClient.sendAndReceiveMessage(AbstractClient.java:161) at com.mckesson.mms.ecb2b.hl7.message.post.handler.MainTest.main(MainTest.java:35) Here is the MainTest client which simple posts to a servlet hosted on Tomcat, you cannot get any simpler than this: HohClientSimple client = new HohClientSimple(“localhost”,8080 ,” /appcontext/tests/test”,PipeParser.getInstanceWithNoValidation()); ADT_A38 adt=new ADT_A38(); MSH msh1=adt.getMSH(); msh1.getMsh1_FieldSeparator().setValue("|"); msh1.getMsh2_EncodingCharacters().setValue("^~\\&"); msh1.getMsh10_MessageControlID().setValue("0944553"); msh1.getMsh11_ProcessingID().getProcessingID().setValue("W"); msh1.getMsh12_VersionID().getVersionID().setValue("2.5"); msh1.getMsh3_SendingApplication().getHd1_NamespaceID().setValue("LEXMA"); msh1.getMsh5_ReceivingApplication().getNamespaceID().setValue("ASD"); SFT sft=adt.getSFT(); adt.insertSFT(sft, 0); DB1 db1=adt.getDB1(); db1.getDisabledPersonCode().setValue("ABLD"); adt.insertDB1(db1, 0); ISendable sendable = new MessageSendable(adt); client.sendAndReceiveMessage(sendable); You can see that the data is posted to the servlet as in the output below: Here is the output from the server side: Received Message !!!! MSH|^~\&|LEXMA||ASD|||||0944553|W|2.5 DB1||ABLD Why am I getting this error? Shouldn’t the HohClientSimple be setting the content type? I’d appreciate feedback as this is a critical issue for me. I’m Many thanks, Brian Davies ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140<http://cp.mcafee.com/d/2DRPoQ81MOrhovspjd7aqoUSrhhjhupjvvhdEEFELcFKcECPpISHoHZalxOVJDkShlcwM-aSsKqenJuQlvu7uaI8cCzAlTQm1mN1AQsF-gsSN1MSrdCPo0dpIxG5e8YxlIwvZzVmaY3s8x3kcIul9igej79If3AnQmww29dDoMyNsSrusudCXCQPrNKVJUSyrh> _______________________________________________ Hl7api-devel mailing list Hl7...@li...<mailto:Hl7...@li...> https://lists.sourceforge.net/lists/listinfo/hl7api-devel<http://cp.mcafee.com/d/2DRPoOd2gAcCQm7T6kPhOCCedCQkkQnCkTTQjqaaqbParza9ISrdGSa_iBosKrpRdAlj8cfyJDbCzBXnJ5nTxTyH239EV5tZ5wlIgpd7avA7dIgsdCPpISjDdqymovaAWtiHsruW01_wrxYGjFxYGjB1SK4PNSHibEupYYSrusudCXCQPrNKVJUSyrh> |
From: James A. <jam...@gm...> - 2016-02-24 15:53:48
|
Hi Brian, To me that looks like the server isn't setting the content type on the response. Is that possible? Cheers, James On Tue, Feb 23, 2016 at 9:01 AM, Davies, Brian <Bri...@mc...> wrote: > Hi All, > > > > I am using the HAPI HohClientSimple client to send a simple HL7 message > to some HTTP endpoint but have been encountering an issue with it. I > constantly get an exception relating to the content-type of the message. > Initially I had set up an embedded Jetty server and I got this message. I > had also set up a simple servlet to receive messages posted from the > HohClientSimple client. Initally, I suspected I was getting the exception > because of Jetty, so I eliminated the Jetty piece and find even with a > simple direct post to a servlet, I still get this exception. Please be > aware that the message gets posted to the servlet. I even proceeded to set > up a separate standalone web application to eliminate issues of a 3rd > party library doing any translation. However, I still got the exception on > the client as follows: > > > > 0:14:47.627 INFO [main][ca.uhn.hl7v2.hoh.util.VersionLogger] HL7 over > HTTP (HAPI) library version 2.2 - Build 932 (2014-03-04 20:34:45) > > *ca.uhn.hl7v2.hoh.api.DecodeException*: Content-Type not specified > > at > ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.doReadContentsFromInputStreamAndDecode( > *AbstractHl7OverHttpDecoder.java:230*) > > at > ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.readHeadersAndContentsFromInputStreamAndDecode( > *AbstractHl7OverHttpDecoder.java:541*) > > at > ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.doSendAndReceiveInternal( > *AbstractRawClient.java:159*) > > at ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.sendAndReceive( > *AbstractRawClient.java:279*) > > at ca.uhn.hl7v2.hoh.raw.client.HohRawClientSimple.sendAndReceive( > *HohRawClientSimple.java:55*) > > at > ca.uhn.hl7v2.hoh.hapi.client.AbstractClient.sendAndReceiveMessage( > *AbstractClient.java:161*) > > at com.mckesson.mms.ecb2b.hl7.message.post.handler.MainTest.main( > *MainTest.java:35*) > > > > Here is the MainTest client which simple posts to a servlet hosted on > Tomcat, you cannot get any simpler than this: > > > > *HohClientSimple client = new HohClientSimple(“localhost”,8080 ,” > /appcontext/tests/test”,PipeParser.getInstanceWithNoValidation());* > > ADT_A38 adt=new ADT_A38(); > > MSH msh1=adt.getMSH(); > > msh1.getMsh1_FieldSeparator().setValue("|"); > > msh1.getMsh2_EncodingCharacters().setValue("^~\\&"); > > msh1.getMsh10_MessageControlID().setValue("0944553"); > > msh1.getMsh11_ProcessingID().getProcessingID().setValue("W"); > > msh1.getMsh12_VersionID().getVersionID().setValue("2.5"); > > > msh1.getMsh3_SendingApplication().getHd1_NamespaceID().setValue("LEXMA"); > > > msh1.getMsh5_ReceivingApplication().getNamespaceID().setValue("ASD"); > > SFT sft=adt.getSFT(); > > adt.insertSFT(sft, 0); > > DB1 db1=adt.getDB1(); > > db1.getDisabledPersonCode().setValue("ABLD"); > > adt.insertDB1(db1, 0); > > ISendable sendable = new MessageSendable(adt); > > client.sendAndReceiveMessage(sendable); > > > > > > You can see that the data is posted to the servlet as in the output below: > > > > *Here is the output from the server side:* > > Received Message !!!! > > MSH|^~\&|LEXMA||ASD|||||0944553|W|2.5 > > DB1||ABLD > > > > Why am I getting this error? Shouldn’t the *HohClientSimple *be setting > the content type? I’d appreciate feedback as this is a critical issue for > me. I’m > > > > Many thanks, > > Brian Davies > > > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > |
From: Davies, B. <Bri...@Mc...> - 2016-02-23 23:41:56
|
Hi Mike, That’s doesn’t seem to be the problem. Neither one of these solves the problem. ADT_A38 adt=new ADT_A38(); adt.initQuickstart("0RR","001","W"); or even msh1.getMsh9_MessageType().getMsg1_MessageCode().setValue("0RR"); msh1.getMsh9_MessageType().getMsg2_TriggerEvent().setValue("001"); msh1.getMsh9_MessageType().getMsg3_MessageStructure().setValue("W"); I think it is indeed related to the content-type not set somewhere. Observe the following: This problem really seems related to the content-type header not set in the http request because AbstractHl7OverHttpDecoder does the following check: for (Map.Entry<String, String> nextEntry : getHeaders().entrySet()) ...... } else if ("content-type".equals(nextHeader)) { myContentType = nextValue.trim(); } public String getContentType() { return myContentType; } Then a check is made for this value and if not set an exception is thrown, so it doesn’t appear to be related to the MSH9 field. if (getContentType() == null) { throw new DecodeException("Content-Type not specified"); } Many thanks Brian. From: Mike Mills [mailto:mi...@th...] Sent: Tuesday, February 23, 2016 1:42 PM To: Davies, Brian Cc: HAPI Devel List Subject: Re: [HAPI-devel] (no subject) Have you tried using initQuickstart() on the adt object? We only use std mllp (ie not over http) but having gone through the receive code for mllp, you must have MSH9 set, which is one of the fields initQuickstart configures. The content type error could just be a side effect of not sending a valid hl7 message? Mike On 24 Feb 2016 2:59 AM, "Davies, Brian" <Bri...@mc...<mailto:Bri...@mc...>> wrote: Hi All, I am using the HAPI HohClientSimple client to send a simple HL7 message to some HTTP endpoint but have been encountering an issue with it. I constantly get an exception relating to the content-type of the message. Initially I had set up an embedded Jetty server and I got this message. I had also set up a simple servlet to receive messages posted from the HohClientSimple client. Initally, I suspected I was getting the exception because of Jetty, so I eliminated the Jetty piece and find even with a simple direct post to a servlet, I still get this exception. Please be aware that the message gets posted to the servlet. I even proceeded to set up a separate standalone web application to eliminate issues of a 3rd party library doing any translation. However, I still got the exception on the client as follows: 0:14:47.627 INFO [main][ca.uhn.hl7v2.hoh.util.VersionLogger] HL7 over HTTP (HAPI) library version 2.2 - Build 932 (2014-03-04 20:34:45) ca.uhn.hl7v2.hoh.api.DecodeException: Content-Type not specified at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.doReadContentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:230) at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.readHeadersAndContentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:541) at ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.doSendAndReceiveInternal(AbstractRawClient.java:159) at ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.sendAndReceive(AbstractRawClient.java:279) at ca.uhn.hl7v2.hoh.raw.client.HohRawClientSimple.sendAndReceive(HohRawClientSimple.java:55) at ca.uhn.hl7v2.hoh.hapi.client.AbstractClient.sendAndReceiveMessage(AbstractClient.java:161) at com.mckesson.mms.ecb2b.hl7.message.post.handler.MainTest.main(MainTest.java:35) Here is the MainTest client which simple posts to a servlet hosted on Tomcat, you cannot get any simpler than this: HohClientSimple client = new HohClientSimple(“localhost”,8080 ,” /appcontext/tests/test”,PipeParser.getInstanceWithNoValidation()); ADT_A38 adt=new ADT_A38(); MSH msh1=adt.getMSH(); msh1.getMsh1_FieldSeparator().setValue("|"); msh1.getMsh2_EncodingCharacters().setValue("^~\\&"); msh1.getMsh10_MessageControlID().setValue("0944553"); msh1.getMsh11_ProcessingID().getProcessingID().setValue("W"); msh1.getMsh12_VersionID().getVersionID().setValue("2.5"); msh1.getMsh3_SendingApplication().getHd1_NamespaceID().setValue("LEXMA"); msh1.getMsh5_ReceivingApplication().getNamespaceID().setValue("ASD"); SFT sft=adt.getSFT(); adt.insertSFT(sft, 0); DB1 db1=adt.getDB1(); db1.getDisabledPersonCode().setValue("ABLD"); adt.insertDB1(db1, 0); ISendable sendable = new MessageSendable(adt); client.sendAndReceiveMessage(sendable); You can see that the data is posted to the servlet as in the output below: Here is the output from the server side: Received Message !!!! MSH|^~\&|LEXMA||ASD|||||0944553|W|2.5 DB1||ABLD Why am I getting this error? Shouldn’t the HohClientSimple be setting the content type? I’d appreciate feedback as this is a critical issue for me. I’m Many thanks, Brian Davies ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140<http://cp.mcafee.com/d/avndz8w76Qm7T4TT63hOedCQkkQnCkTTQjqaaqbParza9ISrdGSa_iBosKrsuvt5i2qbUHpNZ2W91cluZwQsyH3zZxnn7S1lNB5VB5dOMVRMSrdCPo0dpIxG5e8YxlIwvZzVmaY3s8x3kcIul9igej79If3AnQmww29dDoMyNsSrusudCXCQPrNKVJUSyrh> _______________________________________________ Hl7api-devel mailing list Hl7...@li...<mailto:Hl7...@li...> https://lists.sourceforge.net/lists/listinfo/hl7api-devel<http://cp.mcafee.com/d/FZsSd1MAd2hJ5xZNdZNwQszzpJ55d5VBdZZ4SyyCyYOCUOyrdCPqJyLQFm7bCT7DThkwCy-aSsvgKygj5nLod78GMU_olRNZwlsphuphjsIetsdCPpISjDdqymovaAWtiHsruW01_wrxYGjFxYGjB1SK4PNSHibEupYYSrusudCXCQPrNKVJUSyrh> |
From: Davies, B. <Bri...@Mc...> - 2016-02-23 23:20:25
|
I will configure that field and give it a go. That would be a strange message to give for such a case. However, looking at the code , it is actually checking getContentType()==null and then throwing the exception. Many thanks, Brian. From: Mike Mills [mailto:mi...@th...] Sent: Tuesday, February 23, 2016 1:42 PM To: Davies, Brian Cc: HAPI Devel List Subject: Re: [HAPI-devel] (no subject) Have you tried using initQuickstart() on the adt object? We only use std mllp (ie not over http) but having gone through the receive code for mllp, you must have MSH9 set, which is one of the fields initQuickstart configures. The content type error could just be a side effect of not sending a valid hl7 message? Mike On 24 Feb 2016 2:59 AM, "Davies, Brian" <Bri...@mc...<mailto:Bri...@mc...>> wrote: Hi All, I am using the HAPI HohClientSimple client to send a simple HL7 message to some HTTP endpoint but have been encountering an issue with it. I constantly get an exception relating to the content-type of the message. Initially I had set up an embedded Jetty server and I got this message. I had also set up a simple servlet to receive messages posted from the HohClientSimple client. Initally, I suspected I was getting the exception because of Jetty, so I eliminated the Jetty piece and find even with a simple direct post to a servlet, I still get this exception. Please be aware that the message gets posted to the servlet. I even proceeded to set up a separate standalone web application to eliminate issues of a 3rd party library doing any translation. However, I still got the exception on the client as follows: 0:14:47.627 INFO [main][ca.uhn.hl7v2.hoh.util.VersionLogger] HL7 over HTTP (HAPI) library version 2.2 - Build 932 (2014-03-04 20:34:45) ca.uhn.hl7v2.hoh.api.DecodeException: Content-Type not specified at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.doReadContentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:230) at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.readHeadersAndContentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:541) at ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.doSendAndReceiveInternal(AbstractRawClient.java:159) at ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.sendAndReceive(AbstractRawClient.java:279) at ca.uhn.hl7v2.hoh.raw.client.HohRawClientSimple.sendAndReceive(HohRawClientSimple.java:55) at ca.uhn.hl7v2.hoh.hapi.client.AbstractClient.sendAndReceiveMessage(AbstractClient.java:161) at com.mckesson.mms.ecb2b.hl7.message.post.handler.MainTest.main(MainTest.java:35) Here is the MainTest client which simple posts to a servlet hosted on Tomcat, you cannot get any simpler than this: HohClientSimple client = new HohClientSimple(“localhost”,8080 ,” /appcontext/tests/test”,PipeParser.getInstanceWithNoValidation()); ADT_A38 adt=new ADT_A38(); MSH msh1=adt.getMSH(); msh1.getMsh1_FieldSeparator().setValue("|"); msh1.getMsh2_EncodingCharacters().setValue("^~\\&"); msh1.getMsh10_MessageControlID().setValue("0944553"); msh1.getMsh11_ProcessingID().getProcessingID().setValue("W"); msh1.getMsh12_VersionID().getVersionID().setValue("2.5"); msh1.getMsh3_SendingApplication().getHd1_NamespaceID().setValue("LEXMA"); msh1.getMsh5_ReceivingApplication().getNamespaceID().setValue("ASD"); SFT sft=adt.getSFT(); adt.insertSFT(sft, 0); DB1 db1=adt.getDB1(); db1.getDisabledPersonCode().setValue("ABLD"); adt.insertDB1(db1, 0); ISendable sendable = new MessageSendable(adt); client.sendAndReceiveMessage(sendable); You can see that the data is posted to the servlet as in the output below: Here is the output from the server side: Received Message !!!! MSH|^~\&|LEXMA||ASD|||||0944553|W|2.5 DB1||ABLD Why am I getting this error? Shouldn’t the HohClientSimple be setting the content type? I’d appreciate feedback as this is a critical issue for me. I’m Many thanks, Brian Davies ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140<http://cp.mcafee.com/d/avndz8w76Qm7T4TT63hOedCQkkQnCkTTQjqaaqbParza9ISrdGSa_iBosKrsuvt5i2qbUHpNZ2W91cluZwQsyH3zZxnn7S1lNB5VB5dOMVRMSrdCPo0dpIxG5e8YxlIwvZzVmaY3s8x3kcIul9igej79If3AnQmww29dDoMyNsSrusudCXCQPrNKVJUSyrh> _______________________________________________ Hl7api-devel mailing list Hl7...@li...<mailto:Hl7...@li...> https://lists.sourceforge.net/lists/listinfo/hl7api-devel<http://cp.mcafee.com/d/FZsSd1MAd2hJ5xZNdZNwQszzpJ55d5VBdZZ4SyyCyYOCUOyrdCPqJyLQFm7bCT7DThkwCy-aSsvgKygj5nLod78GMU_olRNZwlsphuphjsIetsdCPpISjDdqymovaAWtiHsruW01_wrxYGjFxYGjB1SK4PNSHibEupYYSrusudCXCQPrNKVJUSyrh> |
From: Mike M. <mi...@th...> - 2016-02-23 20:11:19
|
Have you tried using initQuickstart() on the adt object? We only use std mllp (ie not over http) but having gone through the receive code for mllp, you must have MSH9 set, which is one of the fields initQuickstart configures. The content type error could just be a side effect of not sending a valid hl7 message? Mike On 24 Feb 2016 2:59 AM, "Davies, Brian" <Bri...@mc...> wrote: > Hi All, > > > > I am using the HAPI HohClientSimple client to send a simple HL7 message > to some HTTP endpoint but have been encountering an issue with it. I > constantly get an exception relating to the content-type of the message. > Initially I had set up an embedded Jetty server and I got this message. I > had also set up a simple servlet to receive messages posted from the > HohClientSimple client. Initally, I suspected I was getting the exception > because of Jetty, so I eliminated the Jetty piece and find even with a > simple direct post to a servlet, I still get this exception. Please be > aware that the message gets posted to the servlet. I even proceeded to set > up a separate standalone web application to eliminate issues of a 3rd > party library doing any translation. However, I still got the exception on > the client as follows: > > > > 0:14:47.627 INFO [main][ca.uhn.hl7v2.hoh.util.VersionLogger] HL7 over > HTTP (HAPI) library version 2.2 - Build 932 (2014-03-04 20:34:45) > > *ca.uhn.hl7v2.hoh.api.DecodeException*: Content-Type not specified > > at > ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.doReadContentsFromInputStreamAndDecode( > *AbstractHl7OverHttpDecoder.java:230*) > > at > ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.readHeadersAndContentsFromInputStreamAndDecode( > *AbstractHl7OverHttpDecoder.java:541*) > > at > ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.doSendAndReceiveInternal( > *AbstractRawClient.java:159*) > > at ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.sendAndReceive( > *AbstractRawClient.java:279*) > > at ca.uhn.hl7v2.hoh.raw.client.HohRawClientSimple.sendAndReceive( > *HohRawClientSimple.java:55*) > > at > ca.uhn.hl7v2.hoh.hapi.client.AbstractClient.sendAndReceiveMessage( > *AbstractClient.java:161*) > > at com.mckesson.mms.ecb2b.hl7.message.post.handler.MainTest.main( > *MainTest.java:35*) > > > > Here is the MainTest client which simple posts to a servlet hosted on > Tomcat, you cannot get any simpler than this: > > > > *HohClientSimple client = new HohClientSimple(“localhost”,8080 ,” > /appcontext/tests/test”,PipeParser.getInstanceWithNoValidation());* > > ADT_A38 adt=new ADT_A38(); > > MSH msh1=adt.getMSH(); > > msh1.getMsh1_FieldSeparator().setValue("|"); > > msh1.getMsh2_EncodingCharacters().setValue("^~\\&"); > > msh1.getMsh10_MessageControlID().setValue("0944553"); > > msh1.getMsh11_ProcessingID().getProcessingID().setValue("W"); > > msh1.getMsh12_VersionID().getVersionID().setValue("2.5"); > > > msh1.getMsh3_SendingApplication().getHd1_NamespaceID().setValue("LEXMA"); > > > msh1.getMsh5_ReceivingApplication().getNamespaceID().setValue("ASD"); > > SFT sft=adt.getSFT(); > > adt.insertSFT(sft, 0); > > DB1 db1=adt.getDB1(); > > db1.getDisabledPersonCode().setValue("ABLD"); > > adt.insertDB1(db1, 0); > > ISendable sendable = new MessageSendable(adt); > > client.sendAndReceiveMessage(sendable); > > > > > > You can see that the data is posted to the servlet as in the output below: > > > > *Here is the output from the server side:* > > Received Message !!!! > > MSH|^~\&|LEXMA||ASD|||||0944553|W|2.5 > > DB1||ABLD > > > > Why am I getting this error? Shouldn’t the *HohClientSimple *be setting > the content type? I’d appreciate feedback as this is a critical issue for > me. I’m > > > > Many thanks, > > Brian Davies > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > |
From: Davies, B. <Bri...@Mc...> - 2016-02-23 17:02:17
|
Hi All, I am using the HAPI HohClientSimple client to send a simple HL7 message to some HTTP endpoint but have been encountering an issue with it. I constantly get an exception relating to the content-type of the message. Initially I had set up an embedded Jetty server and I got this message. I had also set up a simple servlet to receive messages posted from the HohClientSimple client. Initally, I suspected I was getting the exception because of Jetty, so I eliminated the Jetty piece and find even with a simple direct post to a servlet, I still get this exception. Please be aware that the message gets posted to the servlet. I even proceeded to set up a separate standalone web application to eliminate issues of a 3rd party library doing any translation. However, I still got the exception on the client as follows: 0:14:47.627 INFO [main][ca.uhn.hl7v2.hoh.util.VersionLogger] HL7 over HTTP (HAPI) library version 2.2 - Build 932 (2014-03-04 20:34:45) ca.uhn.hl7v2.hoh.api.DecodeException: Content-Type not specified at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.doReadContentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:230) at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.readHeadersAndContentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:541) at ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.doSendAndReceiveInternal(AbstractRawClient.java:159) at ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.sendAndReceive(AbstractRawClient.java:279) at ca.uhn.hl7v2.hoh.raw.client.HohRawClientSimple.sendAndReceive(HohRawClientSimple.java:55) at ca.uhn.hl7v2.hoh.hapi.client.AbstractClient.sendAndReceiveMessage(AbstractClient.java:161) at com.mckesson.mms.ecb2b.hl7.message.post.handler.MainTest.main(MainTest.java:35) Here is the MainTest client which simple posts to a servlet hosted on Tomcat, you cannot get any simpler than this: HohClientSimple client = new HohClientSimple("localhost",8080 ," /appcontext/tests/test",PipeParser.getInstanceWithNoValidation()); ADT_A38 adt=new ADT_A38(); MSH msh1=adt.getMSH(); msh1.getMsh1_FieldSeparator().setValue("|"); msh1.getMsh2_EncodingCharacters().setValue("^~\\&"); msh1.getMsh10_MessageControlID().setValue("0944553"); msh1.getMsh11_ProcessingID().getProcessingID().setValue("W"); msh1.getMsh12_VersionID().getVersionID().setValue("2.5"); msh1.getMsh3_SendingApplication().getHd1_NamespaceID().setValue("LEXMA"); msh1.getMsh5_ReceivingApplication().getNamespaceID().setValue("ASD"); SFT sft=adt.getSFT(); adt.insertSFT(sft, 0); DB1 db1=adt.getDB1(); db1.getDisabledPersonCode().setValue("ABLD"); adt.insertDB1(db1, 0); ISendable sendable = new MessageSendable(adt); client.sendAndReceiveMessage(sendable); You can see that the data is posted to the servlet as in the output below: Here is the output from the server side: Received Message !!!! MSH|^~\&|LEXMA||ASD|||||0944553|W|2.5 DB1||ABLD Why am I getting this error? Shouldn't the HohClientSimple be setting the content type? I'd appreciate feedback as this is a critical issue for me. I'm Many thanks, Brian Davies |
From: Davies, B. <Bri...@Mc...> - 2016-02-23 16:59:23
|
Hi All, I am using the HAPI HohClientSimple client to send a simple HL7 message to some HTTP endpoint but have been encountering an issue with it. I constantly get an exception relating to the content-type of the message. Initially I had set up an embedded Jetty server and I got this message. I had also set up a simple servlet to receive messages posted from the HohClientSimple client. Initally, I suspected I was getting the exception because of Jetty, so I eliminated the Jetty piece and find even with a simple direct post to a servlet, I still get this exception. Please be aware that the message gets posted to the servlet. I even proceeded to set up a separate standalone web application to eliminate issues of a 3rd party library doing any translation. However, I still got the exception on the client as follows: 0:14:47.627 INFO [main][ca.uhn.hl7v2.hoh.util.VersionLogger] HL7 over HTTP (HAPI) library version 2.2 - Build 932 (2014-03-04 20:34:45) ca.uhn.hl7v2.hoh.api.DecodeException: Content-Type not specified at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.doReadContentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:230) at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.readHeadersAndContentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:541) at ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.doSendAndReceiveInternal(AbstractRawClient.java:159) at ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.sendAndReceive(AbstractRawClient.java:279) at ca.uhn.hl7v2.hoh.raw.client.HohRawClientSimple.sendAndReceive(HohRawClientSimple.java:55) at ca.uhn.hl7v2.hoh.hapi.client.AbstractClient.sendAndReceiveMessage(AbstractClient.java:161) at com.mckesson.mms.ecb2b.hl7.message.post.handler.MainTest.main(MainTest.java:35) Here is the MainTest client which simple posts to a servlet hosted on Tomcat, you cannot get any simpler than this: HohClientSimple client = new HohClientSimple("localhost",8080 ," /appcontext/tests/test",PipeParser.getInstanceWithNoValidation()); ADT_A38 adt=new ADT_A38(); MSH msh1=adt.getMSH(); msh1.getMsh1_FieldSeparator().setValue("|"); msh1.getMsh2_EncodingCharacters().setValue("^~\\&"); msh1.getMsh10_MessageControlID().setValue("0944553"); msh1.getMsh11_ProcessingID().getProcessingID().setValue("W"); msh1.getMsh12_VersionID().getVersionID().setValue("2.5"); msh1.getMsh3_SendingApplication().getHd1_NamespaceID().setValue("LEXMA"); msh1.getMsh5_ReceivingApplication().getNamespaceID().setValue("ASD"); SFT sft=adt.getSFT(); adt.insertSFT(sft, 0); DB1 db1=adt.getDB1(); db1.getDisabledPersonCode().setValue("ABLD"); adt.insertDB1(db1, 0); ISendable sendable = new MessageSendable(adt); client.sendAndReceiveMessage(sendable); You can see that the data is posted to the servlet as in the output below: Here is the output from the server side: Received Message !!!! MSH|^~\&|LEXMA||ASD|||||0944553|W|2.5 DB1||ABLD Why am I getting this error? Shouldn't the HohClientSimple be setting the content type? I'd appreciate feedback as this is a critical issue for me. I'm Many thanks, Brian Davies |
From: Davies, B. <Bri...@Mc...> - 2016-02-22 14:27:50
|
The client is an instance of HohClientSimple. I expect then that it will set the correct Content-Type see the code snippet below. The servlet that’s registered with Jetty also extends HohServlet so I expect it should also be expect to be able to process the received HL7 content type. //Client is a HL7 over HTTP capable client public HohClientSimple httpClient() { HohClientSimple client = new HohClientSimple(env.getProperty("va.http.host"), Integer.parseInt(env.getProperty("va.http.port")), env.getProperty("va.http.uri.path"),PipeParser.getInstanceWithNoValidation()); client.setSocketFactory(new TlsSocketFactory()); return client; } //Servlet registered with embedded Jetty instance is a HTTP over HL7 Servlet type. public class HttpMessageReceiver extends HohServlet { @Override public void init(ServletConfig servletConfig) throws ServletException { setApplication(new MessageHandler()); } } //This is how I register the Servlet with Jetty. Note it is an instance of HohServlet from above. Server server = new Server(5050); ServletContextHandler handler = new ServletContextHandler(server, "/testURL"); Servlet servlet=new HttpMessageReceiver(); handler.addServlet(new ServletHolder(servlet), "/appContext"); server.start(); server.join(); System.out.println("Server started!!"); As an aside there doesn’t seem to be any available constructor for the alternative of using the DefaultContext to obtain a connection but there doesn’t seem to be any method on the connection object that takes a URI argument. Is there a way to set the URI using the DefaultContext? DefaultHapiContext ctx = new DefaultHapiContext(); // Create an HoH LLP for the context LowerLayerProtocol llp = new Hl7OverHttpLowerLayerProtocol(ServerRoleEnum.CLIENT); ctx.setLowerLayerProtocol(llp); // Use the LLP in a HapiContext to get a client connection String host = "localhost"; int port = 5050; boolean tls = false; Connection connection = ctx.newClient(host, port, tls); From: Davies, Brian [mailto:Bri...@Mc...] Sent: Friday, February 19, 2016 10:02 PM To: Mike Mills; hl7...@li... Subject: Re: [HAPI-devel] Fwd: (no subject) It does resolve to 5050. It uses a properties file with 5050. From: Mike Mills [mailto:mi...@th...] Sent: Friday, February 19, 2016 3:19 PM To: hl7...@li...<mailto:hl7...@li...> Subject: [HAPI-devel] Fwd: (no subject) I forgot to CC the list in the response... ---------- Forwarded message ---------- From: Mike Mills <mi...@th...<mailto:mi...@th...>> Date: Sat, Feb 20, 2016 at 7:18 AM Subject: Re: [HAPI-devel] (no subject) To: "Davies, Brian" <Bri...@mc...<mailto:Bri...@mc...>> Your client is sending to "Integer.parseInt(env.getProperty("http.port"))", your server is listening on hard coded port 5050. Does Integer.parseInt(env.getProperty("http.port")) resolve to port 5050? or as the property implies does it resolve to an http port? Your error trace mentions "Invalid Content-Type: text/html", this implies your HL7 cient is talking to an http server and not an mllp server. On Sat, Feb 20, 2016 at 6:29 AM, Davies, Brian <Bri...@mc...<mailto:Bri...@mc...>> wrote: I am trying to test sending a message using a HAPI http client using the following configuration. The server starts and the message is sent but import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; import ca.uhn.hl7v2.hoh.hapi.client.HohClientSimple; import ca.uhn.hl7v2.hoh.sockets.TlsSocketFactory; import ca.uhn.hl7v2.parser.PipeParser; @Component @PropertySource(value = {"classpath:connection.properties" }) public class HttpClientConfig { @Autowired private Environment env; @Bean public HohClientSimple httpClient() { HohClientSimple client = new HohClientSimple(env.getProperty("http.host"), Integer.parseInt(env.getProperty("http.port")), env.getProperty("http.uri.path"),PipeParser.getInstanceWithNoValidation()); client.setSocketFactory(new TlsSocketFactory()); return client; } } import java.io.IOException; import java.util.Map; import ca.uhn.hl7v2.AcknowledgmentCode; import ca.uhn.hl7v2.HL7Exception; import ca.uhn.hl7v2.model.Message; import ca.uhn.hl7v2.protocol.ReceivingApplication; import ca.uhn.hl7v2.protocol.ReceivingApplicationException; public class MessageHandler implements ReceivingApplication { @Override public Message processMessage(Message theMessage, Map<String, Object> theMetadata) throws ReceivingApplicationException, HL7Exception { Message response = null; try { response = theMessage.generateACK(); } catch (IOException e) { e.printStackTrace(); } return response; } @Override public boolean canProcess(Message theMessage) { return true; } } import java.io.IOException; import javax.servlet.Servlet; import org.eclipse.jetty.server.Server; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; import ca.uhn.hl7v2.DefaultHapiContext; import ca.uhn.hl7v2.HL7Exception; import ca.uhn.hl7v2.app.Connection; import ca.uhn.hl7v2.hoh.api.DecodeException; import ca.uhn.hl7v2.hoh.api.EncodeException; import ca.uhn.hl7v2.hoh.api.ISendable; import ca.uhn.hl7v2.hoh.hapi.api.MessageSendable; import ca.uhn.hl7v2.hoh.hapi.client.HohClientSimple; import ca.uhn.hl7v2.hoh.llp.Hl7OverHttpLowerLayerProtocol; import ca.uhn.hl7v2.hoh.util.ServerRoleEnum; import ca.uhn.hl7v2.llp.LLPException; import ca.uhn.hl7v2.llp.LowerLayerProtocol; import ca.uhn.hl7v2.model.DataTypeException; import ca.uhn.hl7v2.model.Message; import ca.uhn.hl7v2.model.v25.message.ADT_A01; import ca.uhn.hl7v2.model.v25.message.ADT_A38; import ca.uhn.hl7v2.model.v25.segment.DB1; import ca.uhn.hl7v2.model.v25.segment.MSH; import ca.uhn.hl7v2.model.v25.segment.SFT; import ca.uhn.hl7v2.parser.EncodingNotSupportedException; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {HttpClientConfig.class},loader = AnnotationConfigContextLoader.class) public class SendingRequestTest { @Autowired private HohClientSimple httpClient; @Before public void initServer() throws Exception{ Server server = new Server(5050); ServletContextHandler handler = new ServletContextHandler(server, "/testURL"); Servlet servlet=new HttpMessageReceiver(); handler.addServlet(new ServletHolder(servlet), "/appContext"); server.start(); System.out.println("Server started!!"); } @Test public void testSendReceive(){ try { ADT_A38 adt=new ADT_A38(); MSH msh1=adt.getMSH(); msh1.getMsh1_FieldSeparator().setValue("|"); msh1.getMsh2_EncodingCharacters().setValue("^~\\&"); SFT sft=adt.getSFT(); adt.insertSFT(sft, 0); DB1 db1=adt.getDB1(); adt.insertDB1(db1, 0); ISendable sendable = new MessageSendable(adt); //Message message=createTestMessage(); httpClient.sendAndReceiveMessage(sendable); } catch (DataTypeException e) { e.printStackTrace(); System.out.println("datatype problem"); } catch (EncodingNotSupportedException e) { e.printStackTrace(); System.out.println("encode not supported problem"); System.exit(1); } catch (HL7Exception e) { e.printStackTrace(); } catch (DecodeException e) { e.printStackTrace(); System.out.println("decode problem"); System.exit(1); } catch (IOException e) { e.printStackTrace(); System.exit(1); } catch (EncodeException e) { e.printStackTrace(); System.out.println("encode problem, not that it's not supported"); } } } I get the following error: Feb 19, 2016 1:14:25 PM org.springframework.context.support.GenericApplicati onContext prepareRefresh INFO: Refreshing org.springframework.context.support.GenericApplicationConte xt@3b733273: startup date [Fri Feb 19 13:14:25 CST 2016]; root of context hierar chy SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder<http://cp.mcafee.com/d/k-Kr4x8qdEIfLCzB5VdxYSrhhjhupjvvhdEEFELcFKcECPpISHoHZalxOVJ_TkNlCTLyLSRWX3H0GVvnhlwwwWaAdSMGO_uMVVNZNfXCPpISr01kfto4u00VqG7QU70ocjSsH1mF4zYhCk4fyrdEIKndCXCQPrNKVJUSyrh> for further de tails. SendingRequestTest > testSendReceive STANDARD_OUT Server started!! SendingRequestTest > testSendReceive STANDARD_ERR OR ca.uhn.hl7v2.hoh.api.NonHl7ResponseException: Invalid Content-Type: text/html l at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.doReadContentsFro mInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:233) at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.readHeadersAndCon tentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:541) at ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.doSendAndReceiveInterna l(AbstractRawClient.java:159) …. ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140<http://cp.mcafee.com/d/1jWVIg6wUSyM--qeknAS7PpJ55d5VBdZZ4SyyCyYOCUOyrdCPqJyLQFm7bCT_tj5mru-a_rnHIeI2HBZt5m223EGgTr2HbZX3DD7T4_KrdCPpI06ISgR2D4ugGSgf-NYH5u1K4gxG6mfaAF879zAS7xObWbgg14CPIohoKrdEIKndCXCQPrNKVJUSyrh> _______________________________________________ Hl7api-devel mailing list Hl7...@li...<mailto:Hl7...@li...> https://lists.sourceforge.net/lists/listinfo/hl7api-devel<http://cp.mcafee.com/d/5fHCNAp410idEIfLCzB5VdxYSrhhjhupjvvhdEEFELcFKcECPpISHoHZalxOVJ_TkNlCTLyLSRWX3H0GVvnhlwwwWaAdSMGO_uMVVNZNfXCPpISr9PCJhbcfBiteFlKdLt00_MdM-l9QM-l9OwXn2pUXlF5Qfc-urdEIKndCXCQPrNKVJUSyrh> |
From: Davies, B. <Bri...@Mc...> - 2016-02-20 04:21:57
|
It does resolve to 5050. It uses a properties file with 5050. From: Mike Mills [mailto:mi...@th...] Sent: Friday, February 19, 2016 3:19 PM To: hl7...@li... Subject: [HAPI-devel] Fwd: (no subject) I forgot to CC the list in the response... ---------- Forwarded message ---------- From: Mike Mills <mi...@th...<mailto:mi...@th...>> Date: Sat, Feb 20, 2016 at 7:18 AM Subject: Re: [HAPI-devel] (no subject) To: "Davies, Brian" <Bri...@mc...<mailto:Bri...@mc...>> Your client is sending to "Integer.parseInt(env.getProperty("http.port"))", your server is listening on hard coded port 5050. Does Integer.parseInt(env.getProperty("http.port")) resolve to port 5050? or as the property implies does it resolve to an http port? Your error trace mentions "Invalid Content-Type: text/html", this implies your HL7 cient is talking to an http server and not an mllp server. On Sat, Feb 20, 2016 at 6:29 AM, Davies, Brian <Bri...@mc...<mailto:Bri...@mc...>> wrote: I am trying to test sending a message using a HAPI http client using the following configuration. The server starts and the message is sent but import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; import ca.uhn.hl7v2.hoh.hapi.client.HohClientSimple; import ca.uhn.hl7v2.hoh.sockets.TlsSocketFactory; import ca.uhn.hl7v2.parser.PipeParser; @Component @PropertySource(value = {"classpath:connection.properties" }) public class HttpClientConfig { @Autowired private Environment env; @Bean public HohClientSimple httpClient() { HohClientSimple client = new HohClientSimple(env.getProperty("http.host"), Integer.parseInt(env.getProperty("http.port")), env.getProperty("http.uri.path"),PipeParser.getInstanceWithNoValidation()); client.setSocketFactory(new TlsSocketFactory()); return client; } } import java.io.IOException; import java.util.Map; import ca.uhn.hl7v2.AcknowledgmentCode; import ca.uhn.hl7v2.HL7Exception; import ca.uhn.hl7v2.model.Message; import ca.uhn.hl7v2.protocol.ReceivingApplication; import ca.uhn.hl7v2.protocol.ReceivingApplicationException; public class MessageHandler implements ReceivingApplication { @Override public Message processMessage(Message theMessage, Map<String, Object> theMetadata) throws ReceivingApplicationException, HL7Exception { Message response = null; try { response = theMessage.generateACK(); } catch (IOException e) { e.printStackTrace(); } return response; } @Override public boolean canProcess(Message theMessage) { return true; } } import java.io.IOException; import javax.servlet.Servlet; import org.eclipse.jetty.server.Server; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; import ca.uhn.hl7v2.DefaultHapiContext; import ca.uhn.hl7v2.HL7Exception; import ca.uhn.hl7v2.app.Connection; import ca.uhn.hl7v2.hoh.api.DecodeException; import ca.uhn.hl7v2.hoh.api.EncodeException; import ca.uhn.hl7v2.hoh.api.ISendable; import ca.uhn.hl7v2.hoh.hapi.api.MessageSendable; import ca.uhn.hl7v2.hoh.hapi.client.HohClientSimple; import ca.uhn.hl7v2.hoh.llp.Hl7OverHttpLowerLayerProtocol; import ca.uhn.hl7v2.hoh.util.ServerRoleEnum; import ca.uhn.hl7v2.llp.LLPException; import ca.uhn.hl7v2.llp.LowerLayerProtocol; import ca.uhn.hl7v2.model.DataTypeException; import ca.uhn.hl7v2.model.Message; import ca.uhn.hl7v2.model.v25.message.ADT_A01; import ca.uhn.hl7v2.model.v25.message.ADT_A38; import ca.uhn.hl7v2.model.v25.segment.DB1; import ca.uhn.hl7v2.model.v25.segment.MSH; import ca.uhn.hl7v2.model.v25.segment.SFT; import ca.uhn.hl7v2.parser.EncodingNotSupportedException; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {HttpClientConfig.class},loader = AnnotationConfigContextLoader.class) public class SendingRequestTest { @Autowired private HohClientSimple httpClient; @Before public void initServer() throws Exception{ Server server = new Server(5050); ServletContextHandler handler = new ServletContextHandler(server, "/testURL"); Servlet servlet=new HttpMessageReceiver(); handler.addServlet(new ServletHolder(servlet), "/appContext"); server.start(); System.out.println("Server started!!"); } @Test public void testSendReceive(){ try { ADT_A38 adt=new ADT_A38(); MSH msh1=adt.getMSH(); msh1.getMsh1_FieldSeparator().setValue("|"); msh1.getMsh2_EncodingCharacters().setValue("^~\\&"); SFT sft=adt.getSFT(); adt.insertSFT(sft, 0); DB1 db1=adt.getDB1(); adt.insertDB1(db1, 0); ISendable sendable = new MessageSendable(adt); //Message message=createTestMessage(); httpClient.sendAndReceiveMessage(sendable); } catch (DataTypeException e) { e.printStackTrace(); System.out.println("datatype problem"); } catch (EncodingNotSupportedException e) { e.printStackTrace(); System.out.println("encode not supported problem"); System.exit(1); } catch (HL7Exception e) { e.printStackTrace(); } catch (DecodeException e) { e.printStackTrace(); System.out.println("decode problem"); System.exit(1); } catch (IOException e) { e.printStackTrace(); System.exit(1); } catch (EncodeException e) { e.printStackTrace(); System.out.println("encode problem, not that it's not supported"); } } } I get the following error: Feb 19, 2016 1:14:25 PM org.springframework.context.support.GenericApplicati onContext prepareRefresh INFO: Refreshing org.springframework.context.support.GenericApplicationConte xt@3b733273: startup date [Fri Feb 19 13:14:25 CST 2016]; root of context hierar chy SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder<http://cp.mcafee.com/d/k-Kr4x8qdEIfLCzB5VdxYSrhhjhupjvvhdEEFELcFKcECPpISHoHZalxOVJ_TkNlCTLyLSRWX3H0GVvnhlwwwWaAdSMGO_uMVVNZNfXCPpISr01kfto4u00VqG7QU70ocjSsH1mF4zYhCk4fyrdEIKndCXCQPrNKVJUSyrh> for further de tails. SendingRequestTest > testSendReceive STANDARD_OUT Server started!! SendingRequestTest > testSendReceive STANDARD_ERR OR ca.uhn.hl7v2.hoh.api.NonHl7ResponseException: Invalid Content-Type: text/html l at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.doReadContentsFro mInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:233) at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.readHeadersAndCon tentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:541) at ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.doSendAndReceiveInterna l(AbstractRawClient.java:159) …. ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140<http://cp.mcafee.com/d/1jWVIg6wUSyM--qeknAS7PpJ55d5VBdZZ4SyyCyYOCUOyrdCPqJyLQFm7bCT_tj5mru-a_rnHIeI2HBZt5m223EGgTr2HbZX3DD7T4_KrdCPpI06ISgR2D4ugGSgf-NYH5u1K4gxG6mfaAF879zAS7xObWbgg14CPIohoKrdEIKndCXCQPrNKVJUSyrh> _______________________________________________ Hl7api-devel mailing list Hl7...@li...<mailto:Hl7...@li...> https://lists.sourceforge.net/lists/listinfo/hl7api-devel<http://cp.mcafee.com/d/5fHCNAp410idEIfLCzB5VdxYSrhhjhupjvvhdEEFELcFKcECPpISHoHZalxOVJ_TkNlCTLyLSRWX3H0GVvnhlwwwWaAdSMGO_uMVVNZNfXCPpISr9PCJhbcfBiteFlKdLt00_MdM-l9QM-l9OwXn2pUXlF5Qfc-urdEIKndCXCQPrNKVJUSyrh> |
From: Mike M. <mi...@th...> - 2016-02-19 21:43:44
|
I forgot to CC the list in the response... ---------- Forwarded message ---------- From: Mike Mills <mi...@th...> Date: Sat, Feb 20, 2016 at 7:18 AM Subject: Re: [HAPI-devel] (no subject) To: "Davies, Brian" <Bri...@mc...> Your client is sending to "Integer.parseInt(env.getProperty("http.port"))", your server is listening on hard coded port 5050. Does Integer.parseInt(env.getProperty("http.port")) resolve to port 5050? or as the property implies does it resolve to an http port? Your error trace mentions "Invalid Content-Type: text/html", this implies your HL7 cient is talking to an http server and not an mllp server. On Sat, Feb 20, 2016 at 6:29 AM, Davies, Brian <Bri...@mc...> wrote: > I am trying to test sending a message using a HAPI http client using the > following configuration. The server starts and the message is sent but > > > > > > import org.springframework.beans.factory.annotation.Autowired; > > import org.springframework.context.annotation.Bean; > > import org.springframework.context.annotation.PropertySource; > > import org.springframework.core.env.Environment; > > import org.springframework.stereotype.Component; > > import ca.uhn.hl7v2.hoh.hapi.client.HohClientSimple; > > import ca.uhn.hl7v2.hoh.sockets.TlsSocketFactory; > > import ca.uhn.hl7v2.parser.PipeParser; > > > > @Component > > @PropertySource(value = {"classpath:connection.properties" }) > > public class HttpClientConfig { > > > > @Autowired > > private Environment env; > > > > @Bean > > public HohClientSimple httpClient() { > > HohClientSimple client = new > HohClientSimple(env.getProperty("http.host"), > Integer.parseInt(env.getProperty("http.port")), > env.getProperty("http.uri.path"),PipeParser.getInstanceWithNoValidation()); > > client.setSocketFactory(new > TlsSocketFactory()); > > return client; > > } > > } > > > > > > *import* java.io.IOException; > > *import* java.util.Map; > > > > *import* ca.uhn.hl7v2.AcknowledgmentCode; > > *import* ca.uhn.hl7v2.HL7Exception; > > *import* ca.uhn.hl7v2.model.Message; > > *import* ca.uhn.hl7v2.protocol.ReceivingApplication; > > *import* ca.uhn.hl7v2.protocol.ReceivingApplicationException; > > > > *public* *class* MessageHandler *implements* ReceivingApplication { > > > > @Override > > *public* Message processMessage(Message theMessage, Map<String, > Object> theMetadata) > > *throws* ReceivingApplicationException, HL7Exception { > > > > Message response = *null*; > > *try* { > > response = theMessage.generateACK(); > > } *catch* (IOException e) { > > e.printStackTrace(); > > } > > *return* response; > > } > > > > @Override > > *public* *boolean* canProcess(Message theMessage) { > > *return* *true*; > > } > > > > } > > > > > > > > import java.io.IOException; > > > > import javax.servlet.Servlet; > > > > import org.eclipse.jetty.server.Server; > > import org.junit.Before; > > import org.junit.Test; > > import org.junit.runner.RunWith; > > import org.springframework.beans.factory.annotation.Autowired; > > import org.springframework.test.context.ContextConfiguration; > > import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; > > import > org.springframework.test.context.support.AnnotationConfigContextLoader; > > > > > > > > import ca.uhn.hl7v2.DefaultHapiContext; > > import ca.uhn.hl7v2.HL7Exception; > > import ca.uhn.hl7v2.app.Connection; > > import ca.uhn.hl7v2.hoh.api.DecodeException; > > import ca.uhn.hl7v2.hoh.api.EncodeException; > > import ca.uhn.hl7v2.hoh.api.ISendable; > > import ca.uhn.hl7v2.hoh.hapi.api.MessageSendable; > > import ca.uhn.hl7v2.hoh.hapi.client.HohClientSimple; > > import ca.uhn.hl7v2.hoh.llp.Hl7OverHttpLowerLayerProtocol; > > import ca.uhn.hl7v2.hoh.util.ServerRoleEnum; > > import ca.uhn.hl7v2.llp.LLPException; > > import ca.uhn.hl7v2.llp.LowerLayerProtocol; > > import ca.uhn.hl7v2.model.DataTypeException; > > import ca.uhn.hl7v2.model.Message; > > import ca.uhn.hl7v2.model.v25.message.ADT_A01; > > import ca.uhn.hl7v2.model.v25.message.ADT_A38; > > import ca.uhn.hl7v2.model.v25.segment.DB1; > > import ca.uhn.hl7v2.model.v25.segment.MSH; > > import ca.uhn.hl7v2.model.v25.segment.SFT; > > import ca.uhn.hl7v2.parser.EncodingNotSupportedException; > > > > import org.eclipse.jetty.servlet.ServletContextHandler; > > import org.eclipse.jetty.servlet.ServletHolder; > > > > @RunWith(SpringJUnit4ClassRunner.class) > > @ContextConfiguration(classes = {HttpClientConfig.class},loader = > AnnotationConfigContextLoader.class) > > public class SendingRequestTest { > > > > @Autowired > > private HohClientSimple httpClient; > > @Before > > public void initServer() throws Exception{ > > Server server = new Server(5050); > > ServletContextHandler handler = new > ServletContextHandler(server, "/testURL"); > > Servlet servlet=new HttpMessageReceiver(); > > handler.addServlet(new > ServletHolder(servlet), "/appContext"); > > server.start(); > > System.out.println("Server started!!"); > > } > > @Test > > public void testSendReceive(){ > > > > try { > > ADT_A38 adt=new ADT_A38(); > > MSH msh1=adt.getMSH(); > > msh1.getMsh1_FieldSeparator().setValue("|"); > > msh1.getMsh2_EncodingCharacters().setValue("^~\\&"); > > SFT sft=adt.getSFT(); > > adt.insertSFT(sft, 0); > > DB1 db1=adt.getDB1(); > > adt.insertDB1(db1, 0); > > ISendable sendable = new MessageSendable(adt); > > //Message > message=createTestMessage(); > > httpClient.sendAndReceiveMessage(sendable); > > > > } catch (DataTypeException e) { > > e.printStackTrace(); > > System.out.println("datatype > problem"); > > } catch (EncodingNotSupportedException e) { > > e.printStackTrace(); > > System.out.println("encode > not supported problem"); > > > System.exit(1); > > > } catch (HL7Exception e) { > > > e.printStackTrace(); > > } catch (DecodeException e) { > > e.printStackTrace(); > > System.out.println("decode > problem"); > > System.exit(1); > > } catch (IOException e) { > > e.printStackTrace(); > > System.exit(1); > > } catch (EncodeException e) { > > e.printStackTrace(); > > System.out.println("encode > problem, not that it's not supported"); > > } > > > > } > > > > } > > > > I get the following error: > > > > Feb 19, 2016 1:14:25 PM > org.springframework.context.support.GenericApplicati > onContext prepareRefresh > > INFO: Refreshing > org.springframework.context.support.GenericApplicationConte > xt@3b733273: startup date [Fri Feb 19 13:14:25 CST 2016]; root of context > hierar > chy > > SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". > > SLF4J: Defaulting to no-operation (NOP) logger implementation > > SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for > further > de > tails. > > SendingRequestTest > testSendReceive STANDARD_OUT > > Server started!! > > > > SendingRequestTest > testSendReceive > STANDARD_ERR > OR > > ca.uhn.hl7v2.hoh.api.NonHl7ResponseException: Invalid Content-Type: > text/html > l > > at > ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.doReadContentsFro > mInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:233) > > at > ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.readHeadersAndCon > tentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:541) > > at > ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.doSendAndReceiveInterna > l(AbstractRawClient.java:159) > > …. > > > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > |
From: Davies, B. <Bri...@Mc...> - 2016-02-19 20:50:06
|
I am trying to test sending a message using a HAPI http client using the following configuration. The server starts and the message is sent but import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; import ca.uhn.hl7v2.hoh.hapi.client.HohClientSimple; import ca.uhn.hl7v2.hoh.sockets.TlsSocketFactory; import ca.uhn.hl7v2.parser.PipeParser; @Component @PropertySource(value = {"classpath:connection.properties" }) public class HttpClientConfig { @Autowired private Environment env; @Bean public HohClientSimple httpClient() { HohClientSimple client = new HohClientSimple(env.getProperty("http.host"), Integer.parseInt(env.getProperty("http.port")), env.getProperty("http.uri.path"),PipeParser.getInstanceWithNoValidation()); client.setSocketFactory(new TlsSocketFactory()); return client; } } import java.io.IOException; import java.util.Map; import ca.uhn.hl7v2.AcknowledgmentCode; import ca.uhn.hl7v2.HL7Exception; import ca.uhn.hl7v2.model.Message; import ca.uhn.hl7v2.protocol.ReceivingApplication; import ca.uhn.hl7v2.protocol.ReceivingApplicationException; public class MessageHandler implements ReceivingApplication { @Override public Message processMessage(Message theMessage, Map<String, Object> theMetadata) throws ReceivingApplicationException, HL7Exception { Message response = null; try { response = theMessage.generateACK(); } catch (IOException e) { e.printStackTrace(); } return response; } @Override public boolean canProcess(Message theMessage) { return true; } } import java.io.IOException; import javax.servlet.Servlet; import org.eclipse.jetty.server.Server; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; import ca.uhn.hl7v2.DefaultHapiContext; import ca.uhn.hl7v2.HL7Exception; import ca.uhn.hl7v2.app.Connection; import ca.uhn.hl7v2.hoh.api.DecodeException; import ca.uhn.hl7v2.hoh.api.EncodeException; import ca.uhn.hl7v2.hoh.api.ISendable; import ca.uhn.hl7v2.hoh.hapi.api.MessageSendable; import ca.uhn.hl7v2.hoh.hapi.client.HohClientSimple; import ca.uhn.hl7v2.hoh.llp.Hl7OverHttpLowerLayerProtocol; import ca.uhn.hl7v2.hoh.util.ServerRoleEnum; import ca.uhn.hl7v2.llp.LLPException; import ca.uhn.hl7v2.llp.LowerLayerProtocol; import ca.uhn.hl7v2.model.DataTypeException; import ca.uhn.hl7v2.model.Message; import ca.uhn.hl7v2.model.v25.message.ADT_A01; import ca.uhn.hl7v2.model.v25.message.ADT_A38; import ca.uhn.hl7v2.model.v25.segment.DB1; import ca.uhn.hl7v2.model.v25.segment.MSH; import ca.uhn.hl7v2.model.v25.segment.SFT; import ca.uhn.hl7v2.parser.EncodingNotSupportedException; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {HttpClientConfig.class},loader = AnnotationConfigContextLoader.class) public class SendingRequestTest { @Autowired private HohClientSimple httpClient; @Before public void initServer() throws Exception{ Server server = new Server(5050); ServletContextHandler handler = new ServletContextHandler(server, "/testURL"); Servlet servlet=new HttpMessageReceiver(); handler.addServlet(new ServletHolder(servlet), "/appContext"); server.start(); System.out.println("Server started!!"); } @Test public void testSendReceive(){ try { ADT_A38 adt=new ADT_A38(); MSH msh1=adt.getMSH(); msh1.getMsh1_FieldSeparator().setValue("|"); msh1.getMsh2_EncodingCharacters().setValue("^~\\&"); SFT sft=adt.getSFT(); adt.insertSFT(sft, 0); DB1 db1=adt.getDB1(); adt.insertDB1(db1, 0); ISendable sendable = new MessageSendable(adt); //Message message=createTestMessage(); httpClient.sendAndReceiveMessage(sendable); } catch (DataTypeException e) { e.printStackTrace(); System.out.println("datatype problem"); } catch (EncodingNotSupportedException e) { e.printStackTrace(); System.out.println("encode not supported problem"); System.exit(1); } catch (HL7Exception e) { e.printStackTrace(); } catch (DecodeException e) { e.printStackTrace(); System.out.println("decode problem"); System.exit(1); } catch (IOException e) { e.printStackTrace(); System.exit(1); } catch (EncodeException e) { e.printStackTrace(); System.out.println("encode problem, not that it's not supported"); } } } I get the following error: Feb 19, 2016 1:14:25 PM org.springframework.context.support.GenericApplicati onContext prepareRefresh INFO: Refreshing org.springframework.context.support.GenericApplicationConte xt@3b733273: startup date [Fri Feb 19 13:14:25 CST 2016]; root of context hierar chy SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further de tails. SendingRequestTest > testSendReceive STANDARD_OUT Server started!! SendingRequestTest > testSendReceive STANDARD_ERR OR ca.uhn.hl7v2.hoh.api.NonHl7ResponseException: Invalid Content-Type: text/html l at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.doReadContentsFro mInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:233) at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.readHeadersAndCon tentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:541) at ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.doSendAndReceiveInterna l(AbstractRawClient.java:159) .... |
From: Ian V. <Ian...@he...> - 2016-01-27 22:49:05
|
Here is an example I put together hoping it would cover your question: A method that takes a TS input: package hapiexamples; import ca.uhn.hl7v2.model.DataTypeException; import ca.uhn.hl7v2.model.v24.datatype.TS; import ca.uhn.hl7v2.util.DeepCopy; /** * * @author vowlesi */ public class TSMethod { public static TS doSomethingToTsDatatype(TS inputTs) throws DataTypeException { TS resultTs = new TS(inputTs.getMessage()); DeepCopy.copy(inputTs, resultTs); return resultTs; } } A test case for the method: package hapiexamples; import ca.uhn.hl7v2.HL7Exception; import ca.uhn.hl7v2.model.v24.datatype.TS; import ca.uhn.hl7v2.model.v24.message.ADT_A01; import java.io.IOException; import java.util.Date; import org.junit.Test; import static org.junit.Assert.*; /** * * @author vowlesi */ public class TSMethodTest { public TSMethodTest() { } @Test public void testdoSomethingToTsDatatype() throws HL7Exception, IOException { ADT_A01 dummyMessage = new ADT_A01(); dummyMessage.initQuickstart("ADT", "A01", "T"); Date now = new Date(); dummyMessage.getMSH().getDateTimeOfMessage().getTs1_TimeOfAnEvent().setValue(now); TS resultTs = TSMethod.doSomethingToTsDatatype(dummyMessage.getMSH().getDateTimeOfMessage()); assertEquals("result date matches original created value", now, resultTs.getTs1_TimeOfAnEvent().getValueAsDate()); } } Hope this helps Ian From: John Giotta [mailto:jdg...@gm...] Sent: Thursday, 28 January 2016 5:34 AM To: hl7...@li... Subject: [HAPI-devel] Unit Tests for TS DataType How can write a unit test for a TS datatype? My method expects a TS object as a parameter. ******************************************************************************** This email, including any attachments sent with it, is confidential and for the sole use of the intended recipient(s). This confidentiality is not waived or lost, if you receive it and you are not the intended recipient(s), or if it is transmitted/received in error. Any unauthorised use, alteration, disclosure, distribution or review of this email is strictly prohibited. The information contained in this email, including any attachment sent with it, may be subject to a statutory duty of confidentiality if it relates to health service matters. If you are not the intended recipient(s), or if you have received this email in error, you are asked to immediately notify the sender by telephone collect on Australia +61 1800 198 175 or by return email. You should also delete this email, and any copies, from your computer system network and destroy any hard copies produced. If not an intended recipient of this email, you must not copy, distribute or take any action(s) that relies on it; any form of disclosure, modification, distribution and/or publication of this email is also prohibited. Although Queensland Health takes all reasonable steps to ensure this email does not contain malicious software, Queensland Health does not accept responsibility for the consequences if any person's computer inadvertently suffers any disruption to services, loss of information, harm or is infected with a virus, other malicious computer programme or code that may occur as a consequence of receiving this email. Unless stated otherwise, this email represents only the views of the sender and not the views of the Queensland Government. ********************************************************************************** |
From: John G. <jdg...@gm...> - 2016-01-27 19:33:48
|
How can write a unit test for a TS datatype? My method expects a TS object as a parameter. |
From: John G. <jdg...@gm...> - 2016-01-27 19:30:14
|
Sorry for the very late response. I did finally figure out what the problem was. Mostly CN and TN formatting. For example: ORC|RE||31971|||||||1^Clark^Mark||71^Abrams^Richard|^^^Colorado Preventive Medicine&169|(303) 320-2400^^^^^303^3202400|20160105180250||||| I created a custom parser to fix some of these issues, but RegEx replacing doesn't sit well with me. On Tue, Jan 5, 2016 at 8:29 AM Jens Villadsen < jen...@gm...> wrote: > If you can provide the messages I'll have a look ASAP > > On 5 January 2016 at 14:27, John Giotta <jdg...@gm...> wrote: > >> The problem is these HL7 messages I'm getting. I've written my own custom >> PipeParser to attempt fixing the message midstream. However I'm now onto my >> 33rd string replacement and I don't even have production messages yet. >> >> I didn't realize how out of specification these messages can be. Is there >> an easier way to extract specific segments without parsing the entire >> message? I assume there isn't since some version identification must be >> discovered first. >> >> >> >> On Mon, Jan 4, 2016 at 4:41 PM Jens Villadsen < >> jen...@gm...> wrote: >> >>> Could you provide a stacktrace? >>> >>> On 3 January 2016 at 18:55, John Giotta <jdg...@gm...> wrote: >>> >>>> I was provided an HL7 file that if I simply trying to consume it with >>>> HAPI I get an exception of formatting. >>>> >>>> How do I handle formatting exceptions, but still access the parts of >>>> the HL7 I need? >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> >>>> _______________________________________________ >>>> Hl7api-devel mailing list >>>> Hl7...@li... >>>> https://lists.sourceforge.net/lists/listinfo/hl7api-devel >>>> >>>> >>> >>> >>> -- >>> >>> Med venlig hilsen / Kind regards >>> >>> *Jens Kristian Villadsen* >>> cand.polyt >>> >>> Stålhøjen 24 >>> 8240 Risskov >>> Denmark >>> >>> Mobile +4523373806 >>> jen...@gm... >>> >> > > > -- > > Med venlig hilsen / Kind regards > > *Jens Kristian Villadsen* > cand.polyt > > Stålhøjen 24 > 8240 Risskov > Denmark > > Mobile +4523373806 > jen...@gm... > |
From: Ian V. <Ian...@he...> - 2016-01-13 23:59:25
|
The dropping of repeats has been causing some trouble for us in production, so we have investigated further. Within the pipe parser a split method was found which we believe is the culprit. I pulled it out, created some tests, and have included a proposed replacement split method. Another alternative using commons lang was also attempted and included, but it also fails. See below for code containing splitOriginal, split and splitUseCommons. A set of test cases are also included. Hope this helps Ian ---code--- /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package hapiexamples; import java.util.ArrayList; import java.util.StringTokenizer; import org.apache.commons.lang.StringUtils; /** * * @author vowlesi */ public class ReplaceHapiSplitToCorrectLostTilde { /** * Splits the given composite string into an array of components using the * given delimiter. * * @param composite encoded composite string * @param delim delimiter to split upon * @return split string */ public static String[] splitOriginal(String composite, String delim) { ArrayList<String> components = new ArrayList<String>(); // defend against evil nulls if (composite == null) { composite = ""; } if (delim == null) { delim = ""; } StringTokenizer tok = new StringTokenizer(composite, delim, true); boolean previousTokenWasDelim = true; while (tok.hasMoreTokens()) { String thisTok = tok.nextToken(); if (thisTok.equals(delim)) { if (previousTokenWasDelim) { components.add(null); } previousTokenWasDelim = true; } else { components.add(thisTok); previousTokenWasDelim = false; } } String[] ret = new String[components.size()]; for (int i = 0; i < components.size(); i++) { ret[i] = components.get(i); } return ret; } /** * Splits the given composite string into an array of components using the * given delimiter. * * @param composite encoded composite string * @param delim delimiter to split upon * @return split string */ public static String[] split(String composite, String delim) { // defend against evil nulls String escapeTheseForSplit = "\\^|.$()*+?[{"; if (composite == null) { composite = ""; } if (delim == null) { String[] ret = new String[]{composite}; return ret; } if (escapeTheseForSplit.contains(delim)) { delim = "\\" + delim; } String[] ret = composite.split(delim, -1); return ret; } /** * Splits the given composite string into an array of components using the * given delimiter. * * @param composite encoded composite string * @param delim delimiter to split upon * @return split string */ public static String[] splitUseCommons(String composite, String delim) { // defend against evil nulls String[] ret = StringUtils.split(composite, delim); return ret; } } --- tests --- /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package hapiexamples; import static hapiexamples.ReplaceHapiSplitToCorrectLostTilde.split; import static hapiexamples.ReplaceHapiSplitToCorrectLostTilde.splitOriginal; import static hapiexamples.ReplaceHapiSplitToCorrectLostTilde.splitUseCommons; import org.junit.Test; import static org.junit.Assert.*; /** * * @author vowlesi */ public class ReplaceHapiSplitToCorrectLostTildeTest { public ReplaceHapiSplitToCorrectLostTildeTest() { } /** * Test of splitOriginal method, of class * ReplaceHapiSplitToCorrectLostTilde. */ @Test public void testSplitOriginal() { System.out.println("splitOriginal"); String composite = "Example with trailing repeat delimiters~~~"; String delim = "~"; String[] result = splitOriginal(composite, delim); assertEquals("With 3 trailing delimiters the array result should have 4 elements", 4, result.length); } /** * Test of proposed replacement split method * All possible delimiter values within the printable single character range for HL7 are tested */ @Test public void testSplit() { System.out.println("split"); for (byte i = 32; i < 127; i++) { String delim = new String(new byte[] {i}); String composite = "ZZZZ" + delim + delim + delim; if ("Z".equals(delim)) { composite = "XXXX" + delim + delim + delim; } System.out.println("Counter at " + String.valueOf(i) + " Delimiter is '" + delim + "'"); String[] result = split(composite, delim); for (int j = 0; j < result.length; j++) { System.out.println(j + " " + result[j]); } assertEquals("With 3 trailing delimiters the array result should have 4 elements", 4, result.length); } } /** * Test of Alternative split using Apache Commons Split version of method * All possible delimiter values within the printable single character range for HL7 are tested */ @Test public void testSplitCommonsSplit() { System.out.println("split"); for (byte i = 32; i < 126; i++) { String delim = new String(new byte[] {i}); String composite = "ZZZZ" + delim + delim + delim; if ("Z".equals(delim)) { composite = "XXXX" + delim + delim + delim; } System.out.println("Delimiter is '" + delim + "'"); String[] result = splitUseCommons(composite, delim); for (int j = 0; j < result.length; j++) { System.out.println(j + " " + result[j]); } assertEquals("With 3 trailing delimiters the array result should have 4 elements", 4, result.length); } } /** * Test of proposed replacement split method, of class * ReplaceHapiSplitToCorrectLostTilde. */ @Test public void testSplitWithNullsPassed() { System.out.println("split"); String composite = null; String delim = null; String[] result = split(composite, delim); assertEquals("Passing all nulls makes an empty list", 1, result.length); assertEquals("The one element array has an empty string content", "", result[0]); } /** * Test of proposed replacement split method, of class * ReplaceHapiSplitToCorrectLostTilde. */ @Test public void testSplitWithNullPassedAsDelimiter() { System.out.println("split"); String composite = "Some content"; String delim = null; String[] result = split(composite, delim); assertEquals("Passing null delimiter returns a one element array containing the content", 1, result.length); assertEquals("The one element array has the original string as content", composite, result[0]); } /** * Test of proposed replacement split method * All possible delimiter values within the printable single character range for HL7 are tested */ @Test public void testSplitWithNullPassedAsCompositeAndAnyDelimiter() { String composite = null; for (byte i = 32; i < 126; i++) { String delim = new String(new byte[] {i}); System.out.println("Delimiter is '" + delim + "'"); String[] result = split(composite, delim); for (int j = 0; j < result.length; j++) { System.out.println(j + " '" + result[j] + "'"); } assertEquals("Passing null content produces a one element array containing an empty string", 1, result.length); assertEquals("The one element array has an empty string content", "", result[0]); } } } From: Ian Vowles [mailto:Ian...@he...] Sent: Tuesday, 8 December 2015 7:20 AM To: hl7...@li... Subject: Re: [HAPI-devel] Parser dropping 1 empty repeat on an OBX-5 each time you parse Thanks for your reply James. I ran the test you provided, and it passed as you expected. Couple of things. The OBX-5 provided in the example has 9 repeats. You only had code to test 8. If you add the line: assertEquals("", obx.getOBX().getObx5_ObservationValue()[8].encode()); Then the test fails. Alternatively the assertions could be reduced to: assertEquals("Count of OBX-5 repeat is 9", 9, obx.getOBX().getObx5_ObservationValueReps()); Which also fails. To check if this might be something particular to OBX-5 entries, given their variable nature I extended the test to include a check on another repeating field by adding 3 repeat characters to the end of the PID-3 list (making 4 repeats) + "PID|1||10011682^^^CL_MRN Pool^^CD:237968946~~~|60683166^^^DONOTSEND^^CD:237968946|CLABTEST^ONE||19500101120000|F||C|34605 W 12 MILE RD^^FARM MILLS^MN^48331-3263^CD:309221^CD:756^^CD:637908|CD:637908|(248)489-6000^CD:170||CD:151|M|CD:3391461|606831661088^^^DONOTSEND^FIN NBR^CD:237968946||||CD:654655774|||0|||CD:654897458\r" and added another assertion: assertEquals("Count of PID-3 repeat is 4", 4, ((ORU_R01) hapiMsg).getPATIENT_RESULT(0).getPATIENT().getPID().getPid3_PatientIdentifierListReps()); This also fails. Any thoughts on what is going on? Thanks Ian From: James Agnew [mailto:jam...@gm...] Sent: Monday, 7 December 2015 11:13 PM To: Ian Vowles Cc: hl7...@li... Subject: Re: [HAPI-devel] Parser dropping 1 empty repeat on an OBX-5 each time you parse Hi Ian, I turned this into a unit test, and it seems to give me the expected results: String msg = "MSH|^~\\&|HNAM|CL|CL_RADNET|CL|20110628095233||ORU^R01|Q2301030099T1904270849|P|2.4\r" + "PID|1||10011682^^^CL_MRN Pool^^CD:237968946|60683166^^^DONOTSEND^^CD:237968946|CLABTEST^ONE||19500101120000|F||C|34605 W 12 MILE RD^^FARM MILLS^MN^48331-3263^CD:309221^CD:756^^CD:637908|CD:637908|(248)489-6000^CD:170||CD:151|M|CD:3391461|606831661088^^^DONOTSEND^FIN NBR^CD:237968946||||CD:654655774|||0|||CD:654897458\r" + "PV1|1|Inpatient|MS^0414^1^CL^^^MMCCN|3|||5332^Rahiman^Abdul|||MED|MS|||1|||5332^Rahiman^Doctor|A||60|||||||||||||||||||CL||Active|||20110329113000\r" + "ORC|NW|3415770735^HNAM_ORDERID|||RL||||20110628095142|71573^Doctor^Janet^D^^^^^DONOTSEND^^^^COMMUNITY DR NBR~70988^Doctor^Janet^D^^^^^DONOTSEND^^^^Personnel Primary Identifier~FHJDB2293^Doctor^Janet^D^^^^^DONOTSEND^^^^External Identifier~T^Doctor^Janet^D^^^^^DONOTSEND^^^^CD:296695676|||||20110628095231|||CD:2562^Written|71573^Doctor^Janet^D^^^^^DONOTSEND^^^^COMMUNITY DR NBR~70988^Doctor^Janet^D^^^^^DONOTSEND^^^^Personnel Primary Identifier~FHJDB2293^Doctor^Janet^D^^^^^DONOTSEND^^^^External Identifier~T^Doctor^Janet^D^^^^^DONOTSEND^^^^CD:296695676\r" + "OBR|1|3415770735^HNAM_ORDERID||CL987^MRA Head w and w/o Contrast|||||||||||Rad Type&Rad Type|||||00000MR20110001703^HNA_ACCN~8546871^HNA_ACCNID~7515376^HNA_PACSID|CD:232990825|20110628095231||Magnetic Resonance Imaging|||1^^0^20110628095100^^RT||||^Dizziness\r" + "OBX|1|TX|20725^ROUTINE HEMATOLOGY|H7800-4|This~Is~A~Report~~~~~||||||I|||200704021122\r" + "NTE|1|P|Special Instructions-\r"; Parser p = new GenericParser(); Message hapiMsg; // The parse method performs the actual parsing hapiMsg = p.parse(msg); ORU_R01_OBSERVATION obx = ((ORU_R01) hapiMsg).getPATIENT_RESULT(0).getORDER_OBSERVATION(0).getOBSERVATION(0); assertEquals("This", obx.getOBX().getObx5_ObservationValue()[0].encode()); assertEquals("Is", obx.getOBX().getObx5_ObservationValue()[1].encode()); assertEquals("A", obx.getOBX().getObx5_ObservationValue()[2].encode()); assertEquals("Report", obx.getOBX().getObx5_ObservationValue()[3].encode()); assertEquals("", obx.getOBX().getObx5_ObservationValue()[4].encode()); assertEquals("", obx.getOBX().getObx5_ObservationValue()[5].encode()); assertEquals("", obx.getOBX().getObx5_ObservationValue()[6].encode()); assertEquals("", obx.getOBX().getObx5_ObservationValue()[7].encode()); Cheers, James On Mon, Nov 30, 2015 at 10:59 PM, Ian Vowles <Ian...@he...<mailto:Ian...@he...>> wrote: We have been having some trouble with textual OBX-5’s which have repeats used to indicate each line of a report when some empty repeats exist to denote empty lines for formatting. Is there a way to overcome this? The following example demonstrates the problem Thanks Ian package hapiexamples; import ca.uhn.hl7v2.HL7Exception; import ca.uhn.hl7v2.app.ApplicationException; import ca.uhn.hl7v2.model.Message; import ca.uhn.hl7v2.model.v24.message.ORU_R01; import ca.uhn.hl7v2.parser.GenericParser; import ca.uhn.hl7v2.parser.Parser; import java.io.IOException; /** * * @author VowlesI */ public class OruR01RepeatsInObx5 { public static void main(String[] args) throws HL7Exception, ApplicationException, IOException { String msg = "MSH|^~\\&|HNAM|CL|CL_RADNET|CL|20110628095233||ORU^R01|Q2301030099T1904270849|P|2.4\r" + "PID|1||10011682^^^CL_MRN Pool^^CD:237968946|60683166^^^DONOTSEND^^CD:237968946|CLABTEST^ONE||19500101120000|F||C|34605 W 12 MILE RD^^FARM MILLS^MN^48331-3263^CD:309221^CD:756^^CD:637908|CD:637908|(248)489-6000^CD:170||CD:151|M|CD:3391461|606831661088^^^DONOTSEND^FIN NBR^CD:237968946||||CD:654655774|||0|||CD:654897458\r" + "PV1|1|Inpatient|MS^0414^1^CL^^^MMCCN|3|||5332^Rahiman^Abdul|||MED|MS|||1|||5332^Rahiman^Doctor|A||60|||||||||||||||||||CL||Active|||20110329113000\r" + "ORC|NW|3415770735^HNAM_ORDERID|||RL||||20110628095142|71573^Doctor^Janet^D^^^^^DONOTSEND^^^^COMMUNITY DR NBR~70988^Doctor^Janet^D^^^^^DONOTSEND^^^^Personnel Primary Identifier~FHJDB2293^Doctor^Janet^D^^^^^DONOTSEND^^^^External Identifier~T^Doctor^Janet^D^^^^^DONOTSEND^^^^CD:296695676|||||20110628095231|||CD:2562^Written|71573^Doctor^Janet^D^^^^^DONOTSEND^^^^COMMUNITY DR NBR~70988^Doctor^Janet^D^^^^^DONOTSEND^^^^Personnel Primary Identifier~FHJDB2293^Doctor^Janet^D^^^^^DONOTSEND^^^^External Identifier~T^Doctor^Janet^D^^^^^DONOTSEND^^^^CD:296695676\r" + "OBR|1|3415770735^HNAM_ORDERID||CL987^MRA Head w and w/o Contrast|||||||||||Rad Type&Rad Type|||||00000MR20110001703^HNA_ACCN~8546871^HNA_ACCNID~7515376^HNA_PACSID|CD:232990825|20110628095231||Magnetic Resonance Imaging|||1^^0^20110628095100^^RT||||^Dizziness\r" + "OBX|1|TX|20725^ROUTINE HEMATOLOGY|H7800-4|This~Is~A~Report~~~~~||||||I|||200704021122\r" + "NTE|1|P|Special Instructions-\r"; Parser p = new GenericParser(); Message hapiMsg; // The parse method performs the actual parsing hapiMsg = p.parse(msg); System.out.println("OBX-5 has " + ((ORU_R01) hapiMsg).getPATIENT_RESULT(0).getORDER_OBSERVATION(0).getOBSERVATION(0).getOBX().getObx5_ObservationValueReps()); hapiMsg.parse(hapiMsg.encode()); System.out.println("OBX-5 has " + ((ORU_R01) hapiMsg).getPATIENT_RESULT(0).getORDER_OBSERVATION(0).getOBSERVATION(0).getOBX().getObx5_ObservationValueReps()); hapiMsg.parse(hapiMsg.encode()); System.out.println("OBX-5 has " + ((ORU_R01) hapiMsg).getPATIENT_RESULT(0).getORDER_OBSERVATION(0).getOBSERVATION(0).getOBX().getObx5_ObservationValueReps()); hapiMsg.parse(hapiMsg.encode()); System.out.println("OBX-5 has " + ((ORU_R01) hapiMsg).getPATIENT_RESULT(0).getORDER_OBSERVATION(0).getOBSERVATION(0).getOBX().getObx5_ObservationValueReps()); hapiMsg.parse(hapiMsg.encode()); System.out.println("OBX-5 has " + ((ORU_R01) hapiMsg).getPATIENT_RESULT(0).getORDER_OBSERVATION(0).getOBSERVATION(0).getOBX().getObx5_ObservationValueReps()); hapiMsg.parse(hapiMsg.encode()); System.out.println("OBX-5 has " + ((ORU_R01) hapiMsg).getPATIENT_RESULT(0).getORDER_OBSERVATION(0).getOBSERVATION(0).getOBX().getObx5_ObservationValueReps()); hapiMsg.parse(hapiMsg.encode()); System.out.println("OBX-5 has " + ((ORU_R01) hapiMsg).getPATIENT_RESULT(0).getORDER_OBSERVATION(0).getOBSERVATION(0).getOBX().getObx5_ObservationValueReps()); } } ******************************************************************************** This email, including any attachments sent with it, is confidential and for the sole use of the intended recipient(s). This confidentiality is not waived or lost, if you receive it and you are not the intended recipient(s), or if it is transmitted/received in error. Any unauthorised use, alteration, disclosure, distribution or review of this email is strictly prohibited. The information contained in this email, including any attachment sent with it, may be subject to a statutory duty of confidentiality if it relates to health service matters. If you are not the intended recipient(s), or if you have received this email in error, you are asked to immediately notify the sender by telephone collect on Australia +61 1800 198 175<tel:%2B61%201800%20198%20175> or by return email. You should also delete this email, and any copies, from your computer system network and destroy any hard copies produced. If not an intended recipient of this email, you must not copy, distribute or take any action(s) that relies on it; any form of disclosure, modification, distribution and/or publication of this email is also prohibited. Although Queensland Health takes all reasonable steps to ensure this email does not contain malicious software, Queensland Health does not accept responsibility for the consequences if any person's computer inadvertently suffers any disruption to services, loss of information, harm or is infected with a virus, other malicious computer programme or code that may occur as a consequence of receiving this email. Unless stated otherwise, this email represents only the views of the sender and not the views of the Queensland Government. ********************************************************************************** ------------------------------------------------------------------------------ Go from Idea to Many App Stores Faster with Intel(R) XDK Give your users amazing mobile app experiences with Intel(R) XDK. Use one codebase in this all-in-one HTML5 development environment. Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs. http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140 _______________________________________________ Hl7api-devel mailing list Hl7...@li...<mailto:Hl7...@li...> https://lists.sourceforge.net/lists/listinfo/hl7api-devel |
From: Jens V. <jen...@gm...> - 2016-01-05 13:30:11
|
If you can provide the messages I'll have a look ASAP On 5 January 2016 at 14:27, John Giotta <jdg...@gm...> wrote: > The problem is these HL7 messages I'm getting. I've written my own custom > PipeParser to attempt fixing the message midstream. However I'm now onto my > 33rd string replacement and I don't even have production messages yet. > > I didn't realize how out of specification these messages can be. Is there > an easier way to extract specific segments without parsing the entire > message? I assume there isn't since some version identification must be > discovered first. > > > > On Mon, Jan 4, 2016 at 4:41 PM Jens Villadsen < > jen...@gm...> wrote: > >> Could you provide a stacktrace? >> >> On 3 January 2016 at 18:55, John Giotta <jdg...@gm...> wrote: >> >>> I was provided an HL7 file that if I simply trying to consume it with >>> HAPI I get an exception of formatting. >>> >>> How do I handle formatting exceptions, but still access the parts of the >>> HL7 I need? >>> >>> >>> ------------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Hl7api-devel mailing list >>> Hl7...@li... >>> https://lists.sourceforge.net/lists/listinfo/hl7api-devel >>> >>> >> >> >> -- >> >> Med venlig hilsen / Kind regards >> >> *Jens Kristian Villadsen* >> cand.polyt >> >> Stålhøjen 24 >> 8240 Risskov >> Denmark >> >> Mobile +4523373806 >> jen...@gm... >> > -- Med venlig hilsen / Kind regards *Jens Kristian Villadsen* cand.polyt Stålhøjen 24 8240 Risskov Denmark Mobile +4523373806 jen...@gm... |
From: John G. <jdg...@gm...> - 2016-01-05 13:27:20
|
The problem is these HL7 messages I'm getting. I've written my own custom PipeParser to attempt fixing the message midstream. However I'm now onto my 33rd string replacement and I don't even have production messages yet. I didn't realize how out of specification these messages can be. Is there an easier way to extract specific segments without parsing the entire message? I assume there isn't since some version identification must be discovered first. On Mon, Jan 4, 2016 at 4:41 PM Jens Villadsen < jen...@gm...> wrote: > Could you provide a stacktrace? > > On 3 January 2016 at 18:55, John Giotta <jdg...@gm...> wrote: > >> I was provided an HL7 file that if I simply trying to consume it with >> HAPI I get an exception of formatting. >> >> How do I handle formatting exceptions, but still access the parts of the >> HL7 I need? >> >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> Hl7api-devel mailing list >> Hl7...@li... >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel >> >> > > > -- > > Med venlig hilsen / Kind regards > > *Jens Kristian Villadsen* > cand.polyt > > Stålhøjen 24 > 8240 Risskov > Denmark > > Mobile +4523373806 > jen...@gm... > |