Subject: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...
Subject: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.
Subject: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.
Subject: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???)
Subject: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):
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
Subject: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?