James,
I think what you said at the end might be the problem. I do have the
latest version of HAPI, but I was using a test txt file to throw messages
in.
I am switching my operating system today, and may be out of commission most
of the day if things do not go smoothly. As soon as I get up and running I
will try and confirm what the issue is.
At the end of the day yesterday, I did almost exactly what you have above
there, minus the:
parser.setValidationContext(new NoValidation());
But when I used the getVersion() method, it was saying that the message was
an ADT_A01 message.
Thanks and I will update ASAP!
Garrett
On Fri, Nov 11, 2011 at 6:04 AM, James Agnew <ja...@jamesagnew.ca> wrote:
> Hi Garrett,
>
> Hi Garrett,
>
> Strange, I put your message into your code and it seems to work for me.
> The following:
>
> String msgString = "MSH|^~\\&|RAMSOFT|SENDING FACILITY|RAMSOFT|RECEIVING
> FACILITY|20101223202939-0400||ADT^A08|101|P|2.3.1||||||||\r" +
> "EVN|A08|20101223202939-0400||||\r" +
>
> "PID||P12345^^^ISSUER|P12345^^^ISSUER||PATIENT^TEST^M^^^^||19741018|M|||10808
> FOOTHILL BLVD^^RANCHO CUCAMONGA^CA^91730^US||(909)481-5872^^^
> sa...@ramsoft.com|(909)481-5800x1||M||12345|286-50-9510|||\r" +
>
> "PV1||O||||||||||||||||||||||||||||||||||||||||||||||||||\r" +
> "AL1|1||^PORK^|\r" +
> "AL1|2||^PENICILLIN^|";
>
> GenericParser parser = new GenericParser();
> parser.setValidationContext(new NoValidation());
> Message msg = parser.parse(msgString);
> System.out.println(msg.getClass().getName());
>
> ..parses correctly. Are you using the latest version of HAPI? Is it
> possible you are reading from a file and getting the wrong line endings or
> charset or something?
>
> James
>
>
> On Thu, Nov 10, 2011 at 6:00 PM, Garrett McTear
> <garrett.mct...@gmail.com>wrote:
>
>> Code Section:
>>
>> Parser p = new GenericParser();
>> Message hapiMsg;
>> try {
>> hapiMsg = p.parse(out.toString());
>> logger.info( "doPost() : HL7 successfully parsed" );
>> }
>> catch (EncodingNotSupportedException e) {
>> logger.info(e.getMessage());
>> }
>> catch (HL7Exception e) {
>> logger.info(e.getMessage());
>> }
>>
>> HL7 v2.3.1 ADT_A08 message that is not working:
>>
>> MSH|^~\&|RAMSOFT|SENDING FACILITY|RAMSOFT|RECEIVING
>> FACILITY|20101223202939-0400||ADT^A08|101|P|2.3.1||||||||
>> EVN|A08|20101223202939-0400||||
>> PID||P12345^^^ISSUER|P12345^^^ISSUER||PATIENT^TEST^M^^^^||19741018|M|||10808
>> FOOTHILL BLVD^^RANCHO
>> CUCAMONGA^CA^91730^US||(909)481-5872^^^sa...@ramsoft.com|(909)481-5800x1
>> ||M||12345|286-50-9510|||
>> PV1||O||||||||||||||||||||||||||||||||||||||||||||||||||
>> AL1|1||^PORK^|
>> AL1|2||^PENICILLIN^|
>>
>> Error received:
>>
>> "Can't parse message beginning MSH|^~\&|RAMSOFT|SENDING
>> FACILITY|RAMSOFT|RECEIVIN"
>>
>> Let me know if there is anything else I can provide.
>>
>> Thanks,
>> Garrett
>>
>> On Thu, Nov 10, 2011 at 3:50 PM, James Agnew <ja...@jamesagnew.ca> wrote:
>>
>>> Hi Garrett,
>>>
>>> Can you post a code snippet showing the issue you are facing?
>>>
>>> James
>>>
>>>
>>> On Thu, Nov 10, 2011 at 5:20 PM, Garrett McTear <
>>> garrett.mct...@gmail.com> wrote:
>>>
>>>> I started taking on an HL7 project about two weeks ago. The project
>>>> was left by the original programmer with very little documentation. Most
>>>> of my time has been spent doing research. I have successfully used HAPI to
>>>> parse messages from all of the version 2.x variants.
>>>>
>>>> The problem I ran into, however, is what happens when someone has taken
>>>> the liberty to append a "custom extension" to a message. In particular, I
>>>> am having issues with a modified v2.3.1 ADT_A08 message that cannot be
>>>> processed by the same HAPI program that can process any other v2.3.1
>>>> message I throw at it.
>>>>
>>>> I downloaded the HAPI source code and have been digging, but I figured
>>>> I would shoot an email to the mailing list and see if any of you had any
>>>> tips on this type of issue.
>>>>
>>>> Specifics about my issue:
>>>> I do get an error:
>>>> EncodingNotSupportedException
>>>> When using the GenericParser
>>>> This same program handles other HL7 v2.3.1 files smoothly. But this
>>>> modified ADT_A08 is the troublesome file.
>>>>
>>>> Thanks!
>>>> Garrett
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> RSA(R) Conference 2012
>>>> Save $700 by Nov 18
>>>> Register now
>>>> http://p.sf.net/sfu/rsa-sfdev2dev1
>>>> _______________________________________________
>>>> Hl7api-devel mailing list
>>>> Hl7api-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
>>>>
>>>>
>>>
>>
>
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel