Hi Ryan,
Is there any chance it's just an artifact of the way it's bring printed to
the console? I'm sure you already know this, but HL7 uses unusual line
endings (\r) as the segment delimiter and sometimes this can appear
strangely when printed. It might be worth printing the encoded message
string with something like this to confirm what the line endings actually
are:
System.out.println(parser.encode(message).replace('\r', 'R').replace('\n',
'N'));
If that confirms that things are wrong, are you able to reduce your issue
into a code snippet you could post to the list?
Cheers,
James
On Mon, May 13, 2013 at 6:28 PM, Ternier, Ryan <ryan.tern...@cgi.com> wrote:
> I’m attempting to parse from XML to HL7v2 and I’m having some issues
> with line breaks – they’re not getting put in. ****
>
> ** **
>
> Any thoughts?****
>
>
> The XML I have is valid, and it’s producing something like:****
>
> ** **
>
> ** **
>
>
> MSH|^~\&|BCHCIM|HCIM|VCHA_LION|VCHA||||9387b270-0769-49af-8902-c1a68c0d3e5f|||||NE
> ****
>
> MSA|1|2|BCHCIM.FC.0.0012 - The search completed
> successfully.QAK||||9QPD|Q22^Find
> Candidates|49550PID|1|||123123123^^^&CRS|HUMPTY^DUMPTY^WALL
> FALLER^^^^L||19710607||||203-2621 My
> Street^^Victoria^BC^V8T4M2^^PHYS||^H^^^^^2504146867QRI|41|ExactPID|2||123123123^^^&VHA_LION|123123123^^^&CRS|HUMPTY^DUMPTY^WALL
> FLOWER****
>
> ** **
>
> It gets some line breaks (Like the MSA on the 2nd line) but it’s not
> pushing out QPD’s, PID, etc. to their own lines.****
>
> ** **
>
> ** **
>
> Example of the XML:
>
> ****
>
> <?xml version="1.0" encoding="UTF-8"?>****
>
> <RSP_K22 xmlns="urn:hl7-org:v2xml" xmlns:soap="
> http://schemas.xmlsoap.org/soap/envelope/" xmlns:v3="urn:hl7-org:v3">****
>
> <MSH>****
>
> <MSH.1>|</MSH.1>****
>
> <MSH.2>^~\&</MSH.2>****
>
> <MSH.3>****
>
> <HD.1>HCIM</HD.1>****
>
> </MSH.3>****
>
> <MSH.4>****
>
> <HD.1>HCIM</HD.1>****
>
> </MSH.4>****
>
> <MSH.5>****
>
> <HD.1>VHA</HD.1>****
>
> </MSH.5>****
>
> <MSH.6>****
>
> <HD.1>VHA</HD.1>****
>
> </MSH.6>****
>
> <MSH.7>****
>
> <HD.1>20130513134245</HD.1>****
>
> </MSH.7>****
>
> <MSH.9>****
>
> <MSG.9.1>RSP</MSG.9.1>****
>
> <MSG.9.2>K22</MSG.9.2>****
>
> </MSH.9>****
>
> <MSH.10>44f62784-de63-4840-a745-3c1008708c79</MSH.10>****
>
> <MSH.11>****
>
> <VID.1>T</VID.1>****
>
> </MSH.11>****
>
> <MSH.12>2.4</MSH.12>****
>
> <MSH.15>NE</MSH.15>****
>
> </MSH>****
>
> <MSA>****
>
> <MSA.1>1****
>
> </MSA.1>****
>
> <MSA.2>2****
>
> </MSA.2>****
>
> <MSA.3>HCIM.FC.0.0012 - The search completed
> successfully.</MSA.3>****
>
> </MSA>****
>
> <ERR>****
>
> <ERR.1/>****
>
> </ERR>****
>
> <QAK>****
>
> <QAK.4>9</QAK.4>****
>
> </QAK>****
>
> <QPD>****
>
> <QPD.1>****
>
> <CE.1>Q22</CE.1>****
>
> <CE.2>Find Candidates</CE.2>****
>
> </QPD.1>****
>
> <QPD.2>49550</QPD.2>****
>
> <PID>****
>
> <PID.5>****
>
> <PID.5.1>Humpty</PID.5.1>****
>
> <PID.5.2>Dumpty</PID.5.2>****
>
> <PID.5.3/>****
>
> <PID.5.4/>****
>
> <PID.5.5>L C</PID.5.5>****
>
> </PID.5>****
>
> <PID.7>20110815000000</PID.7>****
>
> </PID>****
>
> </QPD>****
>
> <RSP_K22.QUERY_RESPONSE>****
>
> <PID>****
>
> <PID.1>1</PID.1>****
>
> <PID.4>****
>
> <CX.1>123123123</CX.1>****
>
> <CX.4>****
>
> <HD.2>CRS</HD.2>****
>
> …****
>
> ** **
>
> ** **
>
> ** **
>
> Thanks,****
>
> ** **
>
> Ryan****
>
> ** **
>
>
> ------------------------------------------------------------------------------
> AlienVault Unified Security Management (USM) platform delivers complete
> security visibility with the essential security capabilities. Easily and
> efficiently configure, manage, and operate all of your security controls
> from a single console and one unified framework. Download a free trial.
> http://p.sf.net/sfu/alienvault_d2d
> _______________________________________________
> Hl7api-devel mailing list
> Hl7api-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
>
>
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel