XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
ben MantSubject: HL7 EDI to XML problems -'ORU_R0'1-message'
Author: ben Mant
Date: 07 May 2010 08:36 AM
Hi
I'm a SAS programmer and I am attempting to import HL7 files into readable SAS datasets. To do this I am using stylus studio to convert the HL7 files to XML and then using an XML map import these XML files directly to SAS.
This worked fine for an 'order request' where stylus studio identified the EDI stype as HL7 version 2.3 and everything worked fine.

However we have 2 type of Hl7 an order and then a 'result request' unfortunately stylus studio could not determine the EDI format.I though decided to try and use HL7 version 2.3 EDI and got the follwing error:

"Likely the specific version is not recognized. Try disabling some of the validation options.

Dialect: HL7

Version: codelist=230/;message=230

Message: ORU_R01

Segment: MSH (segment 1)

Native error: 203, in table: H0357

A required table in the repository is missing. Typically this is caused by trying to decode an
EDI dialect that is not supported. Consider disabling all validation or creating a SEF file to
define the necessary tables."

It appears the message is not set up but I have attempted to add it in a SEF file and am getting quite stuck...

Any help would be greatly appreciated

many thanks

Ben


Documentx20090710444.HL7
Hl7 file to convert

Postnext
Tony LavinioSubject: HL7 EDI to XML problems -'ORU_R0'1-message'
Author: Tony Lavinio
Date: 11 May 2010 09:18 AM
The version number should be "2.3" in the header, not "230".

That's why it is getting confused.

If you can alter those files, they should load without difficulty.

Postnext
ben MantSubject: HL7 EDI to XML problems -'ORU_R0'1-message'
Author: ben Mant
Date: 11 May 2010 10:21 AM
HI
many thanks for your help
the problem was as you suggested that the version was not correct in the files. The version was entered as '2.30' in the message line and not '2.3' and hence it was not read in correctly.

Is there a way this could be automatically detected by the software to prevent me having to manually edit all Hl7 files as due to the volume of files this is not really practical.

Many thanks for your help

Kind regards

Ben

Postnext
Tony LavinioSubject: HL7 EDI to XML problems -'ORU_R0'1-message'
Author: Tony Lavinio
Date: 11 May 2010 11:41 AM
The next version of the XML Converters will have an option that lets you override the version stating in the incoming data stream, specifically to avoid this problem.

Postnext
ben MantSubject: HL7 EDI to XML problems -'ORU_R0'1-message'
Author: ben Mant
Date: 11 May 2010 01:05 PM
HI
many thanks for confirming that it will be fixed in the new version.

Now that I have used the software and have it working converting a single HL7 file to XML which I have successfully read into to SAS I would like to know the potential for the software.

What I am looking to do is basially is to read an entire set of multiple HL7 files from a single location have them map all using the same schema and create multiple XML files which I can then process in SAS and database. What would be even better would be if a single XML file would be created.

So what I am basically looking for the software to do is:
i) Set source directory of all Hl7 EDI files
ii) Stylus reads in all HL7 files from the given location into a project
iii) XML files are all written out using a determined schema i.e. HL7 2.3 and saved to a given location (or single XML file by appending data???)

Is this at all a possibility using this software

Kind regards and many thanks in advance

Ben


Postnext
Tony LavinioSubject: HL7 EDI to XML problems -'ORU_R0'1-message'
Author: Tony Lavinio
Date: 13 May 2010 08:20 AM
The documentation contains information here:
http://media.datadirect.com/download/docs/ddxquery/allddxq/reference/wwhelp/wwhimpl/js/html/wwhelp.htm?href=advancedfeatures3.html#wp219064
that will guide you to writing an XQuery program that will read all of the files in a given location; it will convert them en masse as it reads them.

Postnext
ben MantSubject: HL7 EDI to XML problems -'ORU_R0'1-message'
Author: ben Mant
Date: 13 May 2010 12:50 PM
HI
Many thanks for your answer. Looks like potentially this could solve my problems and create a workable interface for all my HL7 files.

I have therefore written an XQUERY as follows which runs without any errors (having added the opt=yes and seg=no option as prompted from my first run):

fn:collection("converter:///EDI:opt=yes:seg=no?file:///Y:/Import/BACKUP/20070527?select=*.hl7;recurse=yes;sort=a")/Hl7

the file directory contains 2 Hl7 files I've put there as a test.

The program appears to process fine BUT the xml output I was expecting in the preview window does not appear. It is instead simply blank. I did also set an outout URL location for the file using the 'Edit scenario properties' and this just create a completely blank XML file too...

Any help would be greatly appreciated. Must be something simple I'm not doing right

Kind regards and many thanks in advance

Ben

Postnext
Tony LavinioSubject: HL7 EDI to XML problems -'ORU_R0'1-message'
Author: Tony Lavinio
Date: 13 May 2010 04:59 PM
Two things right off:

"converter:EDI" not "converter:///EDI" (no slashes there)

and

"/HL7" not "Hl7" (XML is case-sensitive)

Postnext
ben MantSubject: HL7 EDI to XML problems -'ORU_R0'1-message'
Author: ben Mant
Date: 14 May 2010 05:34 AM
Many thanks for the reply
These quick fixes corrected the problem and an XML file was created successfully.

However as the file is created by appending each XML output to the next the XML becomes malformed.

i.e. in my data the root element is <HL7> but as this closes with </HL7> at the end of each hl7 file processed and then starts again with the next file it has no true encompassing root element when appended.

Adding a new root element at the start and end to the XML is easy enough manually but can this be done automatically?

Many thanks again for all your help

Kind regards

Ben

Postnext
Tony LavinioSubject: HL7 EDI to XML problems -'ORU_R0'1-message'
Author: Tony Lavinio
Date: 14 May 2010 09:29 AM
Try something like this:

<HL7>
{
fn:collection("converter:EDI:opt=yes:seg=no?file:///Y:/Import/BACKUP/20070527?select=*.hl7;recurse=yes;sort=a")/HL7/*
}
</HL7>

That should expand all of the elements under the HL7's without getting the top-level elements themselves, while wrapping the whole result in an HL7.

Posttop
ben MantSubject: HL7 EDI to XML problems -'ORU_R0'1-message'
Author: ben Mant
Date: 14 May 2010 10:49 AM
many thanks for your assistance this now creates the XML perfectly.

thanks again for your help let me know when the new version is ready i.e. with the version override

Ben

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.