Re: [HAPI-devel] Fixed the Highlighting glitches in the test panel

2012-08-08 Thread James Agnew
Thanks Thomas, I've applied this and committed it. Looks great! Cheers, James On Wed, Aug 8, 2012 at 12:06 PM, Thomas Robinson wrote: > On mine they are placed in the action listeners for the radio buttons and > the caret update (to handle the XML highlighter). > Here is what I have for the bu

Re: [HAPI-devel] Need help with constructing an MSH segment

2012-08-08 Thread James Agnew
Hi Eugene, The easiest way is to use the specific message structure for the message type you are trying to create. For example, to create an ADT^A01 message you could follow the instructions here: http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/CreateAMessage.html Cheers, James On Mon,

Re: [HAPI-devel] Comparing messages

2012-08-08 Thread James Agnew
Hi Derek, I don't believe that EncodedMessageComparator does, but you could always null it out in both the expected and actual message before you compare. Alternately, Hl7V2MessageCompare has a method "setFieldsToIgnore()" which lets you put in one or more terser paths to ignore. So you could do

Re: [HAPI-devel] Comparing messages

2012-08-08 Thread Derek Mahar
Does EncodedMessageComparator.equivalent() ignore the time stamp in the message header? http://hl7api.sourceforge.net/base/apidocs/ca/uhn/hl7v2/util/EncodedMessageComparator.html#equivalent(java.lang.String, java.lang.String) Derek On Wed, Aug 8, 2012 at 3:31 PM, christian ohr wrote: > > ... o

Re: [HAPI-devel] Comparing messages

2012-08-08 Thread christian ohr
... or there's ca.uhn.hl7v2.util.EncodedMessageComparator, which provides a couple of methods that help standardizing and comparing messages. cheers Christian rahul somasunderam-2 wrote: > > I wrote up a method using LightHL7Lib: > > public void assertMessagesEqual(Hl7Record expected, Hl7R

Re: [HAPI-devel] Comparing messages

2012-08-08 Thread James Agnew
Hi Derek, One other option is to use the Hl7V2MessageCompare class from the hapi-testpanel subproject. This should probably get moved to the main HAPI library at some point, so it's a bit annoying to import for now, but it's certainly very robust. We use it internally at UHN quite a bit. You can

Re: [HAPI-devel] Comparing messages

2012-08-08 Thread Rahul Somasunderam
I wrote up a method using LightHL7Lib: public void assertMessagesEqual(Hl7Record expected, Hl7Record actual) { List headers = expected.listSegments(); headers.addAll(actual.listSegments()); assertEquals(expected.listSegments(), actual.listSegments()); Set segments = new TreeSet(h

Re: [HAPI-devel] Fixed the Highlighting glitches in the test panel

2012-08-08 Thread Thomas Robinson
On mine they are placed in the action listeners for the radio buttons and the caret update (to handle the XML highlighter). Here is what I have for the buttons. myRdbtnEr7.addActionListener(new ActionListener() { > public void actionPerformed(ActionEvent theE) { >

[HAPI-devel] Comparing messages

2012-08-08 Thread Derek Mahar
Is comparing the string representation of a HAPI message the only way to compare messages? We noticed that HAPI messages don't redefine method equals(), so comparisons using JUnit assertions or Mockito verify() calls must use Object.equals() which compares object identity, not contents. Are there

Re: [HAPI-devel] Fixed the Highlighting glitches in the test panel

2012-08-08 Thread James Agnew
Hi Thomas, Thanks for the code, sounds useful! I'd love to incorporate this, but where do these two methods get called? If it's easier, you could just attach a diff to an email, and I'll apply it. Cheers, James On Tue, Aug 7, 2012 at 2:30 PM, Thomas Robinson wrote: > Hello again, > > I was wor