Re: [HAPI-devel] Z segments in Hapi, latest source code and version for download

2023-05-30 Thread Ian Vowles
The short answer to your question is yes, through the use of terser. Terser is very useful, and works well. Parse the message with a pipeparser, create a terser on the message, use the get method. Your messages may introduce challenges, that terser can overcome, but it can still end up being a comp

[HAPI-devel] Hapi HL7 Client

2022-08-24 Thread Ian Vowles
I'm attempting to build an HL7 Client using the Hapi Library. Fortunately there are examples that show clearly what to do. See the SendLotsOfMessages Example here: https://hapifhir.github.io/hapi-hl7v2/xref/ca/uhn/hl7v2/examples/SendLotsOfMessages.html Unfortunately when I run the code, a null po

[HAPI-devel] Build with MFE4 data type fix method

2020-10-27 Thread Ian Vowles
Is there a release available with this fix in place? We have a sender that doesn't fill in the MFE-4, so we have been staying down at release 2.2 for a while because their MFN will parse using that version. Don't feel confident trying to build it all myself. Thanks Ian Vowles I

Re: [HAPI-devel] Parse MSH from arbitrary message

2020-01-30 Thread Ian Vowles
asn’t been a release containing it. I’m not game to try to do the entire build myself, so mostly use the 2.2 release. One of our systems leaves the field containing the type blank, be aware David, since we both receive messages from that sender. Ian Vowles Integration Specialist, Metro North Integratio

Re: [HAPI-devel] Error parsing ACK message

2020-01-15 Thread Ian Vowles
I think having the 3rd component in MSH-9 makes the parse create the message type specified there. Is it possible to omit the MDM_T01 in MSH-9? Ian Vowles Integration Specialist, Metro North Integration Centre Metro North IT Citilink Lobby 1, Level 3 153 Campbell St, Bowen Hills QLD 4006 P: 07

[HAPI-devel] When you try to test one thing, sometimes you find another...

2019-09-01 Thread Ian Vowles
n when you make the MSH exist as only "MSH|\r". You get an ArrayIndexOutOfBoundsException, because an HL7Exception tries to be built addressing an array, and the element being addressed is not present. Sometimes I just end up making my own life difficult when I try to be thorough. Ia

Re: [HAPI-devel] Parsing an MFN with no MFE-5

2019-03-19 Thread Ian Vowles
s code is dated 2018. Thanks Ian From: Ian Vowles [mailto:ian.vow...@health.qld.gov.au] Sent: Thursday, 14 March 2019 7:52 AM To: hl7api-devel@lists.sourceforge.net Subject: [HAPI-devel] Parsing an MFN with no MFE-5 I am currently trying to update a message processor that parses MFNs from HAPI 2.2 to

[HAPI-devel] Parsing an MFN with no MFE-5

2019-03-13 Thread Ian Vowles
I am currently trying to update a message processor that parses MFNs from HAPI 2.2 to HAPI 2.3 The sender does not fill out the MFE-5, and the 2.2 version was able to parse the message without the MFE-5. This is not the case with HAPI 2.3 In a hopeful attempt I set the InvalidObx2Type and Defau

Re: [HAPI-devel] Article on Handling binary data transmission using Base-64 Encoding - Feedback Required

2018-10-07 Thread Ian Vowles
encapsulated data, and indication that it is a PDF not an RTF, JPG or other type is very helpful. Thanks again for such detailed examples Ian Vowles Integration Specialist Metro North Integration Centre Citilink Lobby 2, Level 3 153 Campbell St Bowen Hills QLD 4006 Ph: (07) 3646

[HAPI-devel] MFE Primary Key Value Type

2018-09-02 Thread Ian Vowles
4_PrimaryKeyValueMFE(0).getData().encode(); //System.out.println(mfnM02.printStructure()); } Note the only message structures imported are the 2.4 messages. This didn't help. Is there a method to make similar settings to the OBX default/invalid for the MFE segment, or an ov

Re: [HAPI-devel] Feedback Required on HAPI Article Series...

2018-08-13 Thread Ian Vowles
Thanks Saravanan. Bookmarked! Examples are always helpful, and I went into the validation and conformance profiles sections because those areas have caused some trouble in the past. It is clear getting to know the Messaging Workbench better is important. Thanks again Ian From: Saravanan Subra

Re: [HAPI-devel] Configure message validation

2017-01-26 Thread Ian Vowles
We have a plethora of systems that don’t strictly adhere to the standard, and have taken to turning off validation as our default position. On your context use: setValidationRuleBuilder(new NoValidationBuilder()) Validation will not be performed. Ian Vowles Queensland Health Australia From

Re: [HAPI-devel] RDS and RDE O01 messages

2016-06-06 Thread Ian Vowles
Found it! Vendor told us it was v2.5, but they are using the v2.3 structure (plus Z segments), which is present in the 2.3 library. Either way we will build a new message for this vendor, since they are problematic due to consistent issues like this. Thanks Ian Vowles Systems Integration

[HAPI-devel] RDS and RDE O01 messages

2016-06-06 Thread Ian Vowles
2.4.properties (or v25). Thanks Ian Vowles Systems Integration Team eHealth Queensland, Australia This email, including any attachments sent with it, is confidential and for the sole use of the intended recipient(s

Re: [HAPI-devel] How to parse NK1 segment in HL7 v2.1

2016-05-17 Thread Ian Vowles
are from a higher version of the standard than the sender claims they are, because frequently senders will say they are 2.x but have added a field or segment that are from 2.x+y without realising. Ian From: Dayu Han [mailto:d...@stratahealth.com] Sent: Wednesday, 18 May 2016 2:28 AM To: Ian Vowl

Re: [HAPI-devel] How to parse NK1 segment in HL7 v2.1

2016-05-16 Thread Ian Vowles
I adjusted an earlier message example I had played with to try out the message.getall() that you are using. See below. It looked to work ok, so I’m not able to offer much more. You may note that I went through a parse step on a message string first, before trying to use getAll. I presume you h

Re: [HAPI-devel] Unit Tests for TS DataType

2016-01-27 Thread Ian Vowles
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 TSMetho

Re: [HAPI-devel] Parser dropping 1 empty repeat on an OBX-5 each time you parse

2016-01-13 Thread Ian Vowles
= 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 + " '" + re

Re: [HAPI-devel] Custom Model Classes

2015-12-22 Thread Ian Vowles
Following up on the example of our ORMIS message I posted earlier, I added an implementation called ORM_Q01. Code basically exactly the same as the ORU_R01 posted earlier (see below) I then added a test case to our test class (see further below), and successfully got an implementation of the cu

Re: [HAPI-devel] Custom Messages

2015-12-17 Thread Ian Vowles
If you arrange your custom classes in a package structure for the custom message (let's use our ORMIS sending system as an example) like this: xxx.xxx.ormis.group - contains any custom group definitions OBSERVATION.java ORMIS_ORDER_OBSERVATION.java PATIENT.java VISIT.java xxx.xxx.ormis.segment -

Re: [HAPI-devel] Escaping Encoded characters

2015-12-16 Thread Ian Vowles
for. HAPI does the escaping when you encode your result ready for sending. When you receive a message with escaped delimiter characters and parse it with HAPI, a getValue method will un-escape the characters for you, and give you a java string result. HAPI really knows HL7, and does a lot to help

Re: [HAPI-devel] Parser dropping 1 empty repeat on an OBX-5 each time you parse

2015-12-07 Thread Ian Vowles
((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:jamesag...@gmail.com] Sent: Monday, 7 December 2015 11:13 PM To: Ian Vowles Cc: hl7api-devel@lists.sourcefo

[HAPI-devel] Parser dropping 1 empty repeat on an OBX-5 each time you parse

2015-11-30 Thread Ian Vowles
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; i

Re: [HAPI-devel] Trying to determine the issue with Result Message

2015-11-08 Thread Ian Vowles
The MSH-9 field needs the second component to cope. Try with (guessing you want an R01): MSH|^~\&|harvest|harvest|harvest|harvest|20151106111919||ORU^R01|37037|P|2.3| Hope this helps Ian From: John Giotta [mailto:jdgio...@gmail.com] Sent: Sunday, 8 November 2015 5:14 AM To: hl7api-devel@lists.s

[HAPI-devel] Adding specific localised escaping implementation to application specific message formats.

2015-08-20 Thread Ian Vowles
Thanks to help from this list in the past we have been able to apply our own local implementation of HL7 escaping effectively to a hapi context. Recently we have been updating our application specific message formats, and realised we had not added our HL7 escaping implementation. We have succee

Re: [HAPI-devel] Handling Repetitions in fields

2015-08-16 Thread Ian Vowles
, but I'm not dealing with the XML representation every day. Is anyone else able to comment? Thanks Ian Vowles Systems Integration Team Queensland Department of Health Australia From: Satyam, Ashutosh [mailto:ashutosh.sat...@ca.com] Sent: Tuesday, 11 August 2015 9:12 AM To: hl

[HAPI-devel] As we get deeper into using HAPI's features

2015-07-01 Thread Ian Vowles
st //compile 'ca.uhn.hapi:hapi-structures-v231:' + hapiVersion testCompile 'junit:junit:4.+' } Thanks for your help, and thanks again for the API. We have recently tried out the FHIR 1.0 library at a FHIR connectathon, and found we were not alone in using it, an

[HAPI-devel] Coping with unescaped escape characters (backslash).

2015-04-01 Thread Ian Vowles
Back in 2013 I posted a question regarding unescaped escape characters. The thread can be seen here: http://article.gmane.org/gmane.comp.medical.hl7/1402/match=backslash At the time it was a minor issue that wasn't really bothering us. Unfortunately a recent requirement to receive a message co

[HAPI-devel] Testing content of a message using SegmentFinder. Why does this happen?

2015-03-25 Thread Ian Vowles
I have been trying to create a method that checks a field for a specific value that will work when passed just a Message object with any parsed message. It's a bit tricky because it's in a Z-Segment, but the methods all look to be there. Unfortunately, I have hit a somewhat odd behaviour. My in

Re: [HAPI-devel] Custom Z segment creation

2015-03-12 Thread Ian Vowles
I wrote a program that writes Z-Segment code for HAPI from a tab separated text table format like this. I say like, since it also wants the data type of each field, and doesn’t cope so well with fields that are not specified at all. I have attached my interpretation of the table below as java c

Re: [HAPI-devel] DG1 segments repetition.

2014-11-11 Thread Ian Vowles
I thought I would give your example a try, because you had mentioned ‘phantom’ DG1s, something I hadn’t seen. Well, I hadn’t used getNames before, so I was curious. So, yes, I did see getnames listing DG1 even when the example didn’t contain one. I also noticed that your example message provid

Re: [HAPI-devel] DG1 segments repetition.

2014-11-11 Thread Ian Vowles
In our team I often use the phrase “printStructure is your friend!”. If you think something like this might be happening, output a printStructure after parsing and you will see exactly where your segments are, and the DG1, DG12, DG13 James has referred to will be very apparent, as will anything

Re: [HAPI-devel] DG1 segments repetition.

2014-11-11 Thread Ian Vowles
I can second James’ additional alternatives, having successfully coded several custom structures, and also pulled out Z-segments via string manipulation before parsing into a standard HAPI structure. Hope it goes well Ian From: James Agnew [mailto:jamesag...@gmail.com] Sent: Wednesday, 12 Nove

Re: [HAPI-devel] Customized (v2.7.1 based) Parsing Schema

2014-11-05 Thread Ian Vowles
In HAPI vs 2.2 the maximum HL7 version supported with complete structures is 2.6. However, HAPI is quite able to deal with messages that don’t exactly match against a versions structure, so you are likely to still be able to meet your requirements. So, point one is certainly possible, given th

Re: [HAPI-devel] Custom XML output

2014-11-04 Thread Ian Vowles
There are quite a few format escape sequences in HL7. You may find it valuable to get your hands on a copy of the standard, and refer to chapter 2 (in the 2.3.1 standard chapter 2 section 10). Here you will find a detailed list of the possible escape sequences, and what they indicate. Then yo

Re: [HAPI-devel] Parse HL7 v2.3 REF message with local customizations

2014-10-29 Thread Ian Vowles
Here is a snippet of code which is in use here: HapiContext hapiContext = new DefaultHapiContext(); hapiContext.setModelClassFactory(new CanonicalModelClassFactory(hl7Version)); hapiContext.setValidationRuleBuilder(new NoValidationBuilder()); final PipeParser pipe

[HAPI-devel] Using Z-segments in ADT_AXX superstructure

2014-07-21 Thread Ian Vowles
In the current transformation I am working on I thought I would try using the ADT_AXX superstructure, since multiple ADT types need to be handled. Some complexity was present, given that the inbound has several Z-Segments, which I have built definitions for, and the outbound has one of a differen

Re: [HAPI-devel] UTF-8 support, how to define and test?

2014-01-14 Thread Ian Vowles
M949, x-IBM949C, x-IBM950, x-IBM964, x-IBM970, x-ISCII91, x-ISO-2022-CN-CNS, x-ISO-2022-CN-GB, x-iso-8859-11, x-JIS0208, x-JISAutoDetect, x-Johab, x-MacArabic, x-MacCentralEurope, x-MacCroatian, x-MacCyrillic, x-MacDingbat, x-MacGreek, x-MacHebrew, x-MacIceland, x-MacRoman, x-MacRomania, x-MacSymbol,

Re: [HAPI-devel] UTF-8 support, how to define and test?

2014-01-14 Thread Ian Vowles
I have encountered some issues with character sets, although not to the extent Tom is dealing with. Rahul's comment about the character sets at each end is something I have encountered, and I will add that on the UNIX platforms I have dealt with, the base character set is NOT configured to UTF-8,

Re: [HAPI-devel] HAPI 2.2 beta-1 released

2013-12-02 Thread Ian Vowles
This is excellent news that the 2.2 version is at beta stage. The changelog link doesn't seem to connect up to any notes on the changes for 2.2 though. I am particularly interested to see if there are any changes in the area of HL7 escaping, since I made a suggestion in this regard. I note

[HAPI-devel] Using Hl7InputStreamMessageIterator

2013-10-31 Thread Ian Vowles
As the use of HAPI extends deeper into our work practices, building test cases has encouraged us to use example message files. Saving them with the package, and bringing them in as resource streams is the manner we have adopted. Today I stumbled across the Hl7InputStreamMessageIterator, which l

Re: [HAPI-devel] HAPI 2.1 Using .isEmpty()

2013-09-30 Thread Ian Vowles
y" value? Personally I don't think so Christian 2013/9/30 Ian Vowles Checking for nulls, empty strings, empty data types and active nulls makes for a lot of code in message transforms. The presence of .isEmpty() looks like a godsend, but how is it intended to work? The following code produc

[HAPI-devel] HAPI 2.1 Using .isEmpty()

2013-09-29 Thread Ian Vowles
Checking for nulls, empty strings, empty data types and active nulls makes for a lot of code in message transforms. The presence of .isEmpty() looks like a godsend, but how is it intended to work? The following code produces the results shown below. Is this the way it's supposed to work? T

Re: [HAPI-devel] Dealing with messages that have failed to escape delimiters

2013-09-04 Thread Ian Vowles
es, we rather added possibilities to plug in custom strategies of doing things while keeping the default, rather than changing existing behavior. So far, Escape is unfortunately very static, but for 2.2 we can think about making the escaping strategy pluggable just like other things in HAPI. Th

[HAPI-devel] Dealing with messages that have failed to escape delimiters

2013-09-03 Thread Ian Vowles
I have sent mails to the general list about this issue before, and the advice has helped me progress. Then along comes another system that has slightly different behaviour. In this particular case a system correctly escapes the HL7 delimiters EXCEPT the escape delimiter. This allows it to se

Re: [HAPI-devel] Hapi connection with existing server

2013-09-03 Thread Ian Vowles
I reckon we would all be in a lot of trouble if HAPI didn't parse out repeating segments and groups. So glad I took the time to learn about HAPI. By far the best adherence to the HL7 standard I have encountered in my interfacing career. Finding good how-to guides is sometimes challenging, parti

Re: [HAPI-devel] Checking for the existence of a segment or group

2013-07-07 Thread Ian Vowles
Jul 4, 2013 at 8:56 PM, Ian Vowles wrote: I like the look of isEmpty(), easy to see and understand. Leads me to another question. In HAPI 2.1 I don't see a java 1.4 implementation. We use JCAPS and HAPI together these days, but our JCAPS version expects code at 1.4, and can run some stuff

[HAPI-devel] Checking for the existence of a segment or group

2013-07-02 Thread Ian Vowles
When building a transform of an HL7 message where some segment is optional, but if it is present lots of fields are to be checked and transformed, I like to check for existence of the segment first. Using HAPI I code the check like this: if (!("IN1".equals(hl7Message.getINSURANCE(0).

Re: [HAPI-devel] Generic class for ADT message

2013-06-18 Thread Ian Vowles
I posted this response a couple of weeks back to a similar question about ADT generic. Ian --- I overcame this issue by creating a GENERIC_ADT message using techniques shown on the Hapi site. Our establishment has many Z-segments, so I had to do all those, and group them accordingly. A basic e

Re: [HAPI-devel] ADT_AXX message

2013-05-30 Thread Ian Vowles
I overcame this issue by creating a GENERIC_ADT message using techniques shown on the Hapi site. Our establishment has many Z-segments, so I had to do all those, and group them accordingly. A basic example is available on the Hapi site at http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/example

Re: [HAPI-devel] Dealing with messages that have failed to escape delimiters

2013-05-02 Thread Ian Vowles
This response about XML from James tweeked my interest in relation to the problem I have with the un-escaped delimiters, so I used the code to parse the message and look at the XML. The XML looked promising, so I created a new terser, and did my tersing tests again. This time they worked. Intere

Re: [HAPI-devel] Dealing with messages that have failed to escape delimiters

2013-05-02 Thread Ian Vowles
ou using? Cheers, James On Tue, Apr 30, 2013 at 6:14 PM, Ian Vowles wrote: One of the most common problems I face with vendors who claim to follow the HL7 standard is their failure to escape the delimiters. On a recent project I have implemented all the HL7 transforms in hapi, and everything w

[HAPI-devel] Dealing with messages that have failed to escape delimiters

2013-04-30 Thread Ian Vowles
One of the most common problems I face with vendors who claim to follow the HL7 standard is their failure to escape the delimiters. On a recent project I have implemented all the HL7 transforms in hapi, and everything was looking good until it was noted that a description field could have un-e

Re: [HAPI-devel] generating and parsing an ORM with mutiple observation requests

2013-02-14 Thread Ian Vowles
The area which may be leading you astray in the order is that according to the standard, the section that HAPI implements as the ORDER section MUST contain an ORC segment before a single OBR or RQD or etc. As a result, two OBR segments without corresponding ORC segments are considered non-standa

Re: [HAPI-devel] reading HL7 generically

2013-01-10 Thread Ian Vowles
We are in the same boat as James, and created a "super structure". Using the MWB was the path I planned to take, but unfortunately I have, to this day, not figured out how to make MWB work. I wrote the "super structure" in java using HAPI. I would be very grateful if someone could point me to a

Re: [HAPI-devel] Processing Incoming Messages on Multiple ports.

2012-12-17 Thread Ian Vowles
We have written several programs which implement simple server on different ports and run them separately. This enables us to log each feed and stop/start them individually when required. Whilst it can mean you end up with quite a few processes running, it has proved an effective technique. Ia

[HAPI-devel] NoValidation and trimming

2012-10-22 Thread Ian Vowles
Since starting to use HAPI, I have always turned on NoValidation because nobody ever uses the telephone number format specified (in Australia?), amongst other things. Now it's going to bite me because it trims leading spaces. Where can I find a beginners introduction to validation in HAPI?

[HAPI-devel] Problems with time zone offsets

2012-05-28 Thread Ian Vowles
Last year I posted when I had a problem setting TS values using Date or Calendar, as per this code: CommonTM tmbad = new CommonTM(); tmbad.setOffset(signedOffset); tmbad.setValue(theCalendar); System.out.println("Result of tmbad.setValue(theCalendar) = " + tmbad.

[HAPI-devel] Using a non-standard message definition in the simpleserver processMessage

2012-05-16 Thread Ian Vowles
We have a vendor who sends us non-standard messages which resemble ORU R01, and the MSH states that they are ORU R01. A class to represent the message has been built, and it works well, except when we want to use it in the processMessage method of a SimpleServer. processMessage requires the m

Re: [HAPI-devel] "Path" expressions?

2012-02-16 Thread Ian Vowles
What you are after is the terser. Cut and pasted snippets below. Since the structure of the ORM is rather deep, I included some additional strings to make it easier. The example I extracted this from uses a properties file that has a database column name as the key, and the datatype and terse

Re: [HAPI-devel] Getting a SimpleServer to deploy in a Glassfish Appserver, and post received messages to a queue

2012-01-11 Thread Ian Vowles
I got it to work. Not sure I understand exactly, but I am guessing it has something to do with when the appserver/bean agree that the objects truly come into existence. Ultimately this shows how helpful the HAPI Library is. The amount of code I had to write to get an essential part of HL7 mes

Re: [HAPI-devel] Getting a SimpleServer to deploy in a Glassfish Appserver, and post received messages to a queue

2012-01-10 Thread Ian Vowles
Thanks Christian, every little bit might help me. What I posted was several failed iterations on, and you have certainly shown that I am getting very confused. I have refactored, hopefully to come into line with the suggestions you are making, and this certainly makes the code look a bit clea

[HAPI-devel] Getting a SimpleServer to deploy in a Glassfish Appserver, and post received messages to a queue

2012-01-09 Thread Ian Vowles
I would really like to get a HAPI Simple Server to write to a Glassfish JMS queue, and it's been doing my head in for a couple of days now and I just can't seem to join the last dot. Please be aware, I am still learning this stuff the hard way, with limited experience, and next to no documenta

Re: [HAPI-devel] Structural comparison of HL7 Messages

2011-09-26 Thread Ian Vowles
First, please understand I am far from a HAPI expert. I am learning myself, and watch the list for questions that may help me improve my understanding. I suspect that some of what you are seeing is the need to get a java language construct to reflect the standard as well as it possibly can, but

[HAPI-devel] DataTypeException when dealing with timezones

2011-08-09 Thread Ian Vowles
The code below produces the error: 10/08/2011 9:04:39 AM au.gov.qld.health.sit.bsqr.BsqrCreateHapiMessage main SEVERE: null ca.uhn.hl7v2.model.DataTypeException: The GMT offset minute value of the TM datatype must be >=0 and <=59 at ca.uhn.hl7v2.model.primitive.CommonTM.setOffset(CommonTM.java: