• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
HL7-XML process project
R. WangMar 04, 05Introduction:
This project automates the process from receiving HL7 messageto loading to Promis tables by bridging XML. This project involved several parts:receiving HL7 message, processing HL7 message, converting to XML, Loading todatabase by using SQL*Loader, querying XML table and inserting to Promis table.The figure 1 depicts the basic flow of this project.
HL7ADTListener.pl
HL7_ADT.hl7 HL7_ADT_P.hl7HL7_ADT_P.xml
XML_LOAD_TABLE
XML_TABLE
HL7 Message
Save to File
Pro_HL7_batch.plInsert_XML_TABLE SQL*Loader
Barxml XML converterBack to next incoming HL7 message(s)Promis tableInserXML_ADT
 Figure 1. Flowchart of HL7XML project
Receiving HL7 message
There is a perl program “HL7ADTListener.pl” to receive the HL7 message. As thisprogram running, a specific port is open to be available to receive message fromsender. As soon as one/more messages are received, a batch file is called to gothrough the HL7 processing till this message be inserted into the Promis table.The HL7 message received originally is stored in HL7 file “HL7_ADT.hl7” forfurther process.
Validating HL7 message
 
Basically, the original HL7 message contains unwanted space or string whichshould be eliminated before converting to XML because the XML converter willnot accept the HL7 message with idle parts. Another perl program “Pro_HL7_batch.pl” will perform this work. This perl file read the message from “HL7_ADT.hl7” into an array line by line and only keep the qualified messagebody in a new HL7 file with name “HL7_ADT_P.hl7”.
Converting HL7 to XML
As for the conversion from HL7 to XML, we use the tool “barxml” to do it.Currently, “barxml” offers two HL7 version conversion: V2.3 and V2.4.Technically, this converter will automatically identify the version of HL7 file. “Barxml” also provides helpful error message to help us know why the errorhappened if we experienced it. A new xml file “HL7_ADT_P.xml” will be created if this conversion is successful.
Loading to XML table by using SQL*Loader
The new XML file means that the HL7 message is parsed to structured data withXML format. That makes it possible to insert to oracle table with datatypeXMLType. Oralce offers robust support on this datatype and make us can queryXMLType with standard SQL statement which save us lots of works to parse theunstructured HL7 data. By using SQL*Loader, this xml is insert into table “XML_LOAD_TABLE” as a CLOB column. Before we do that, two new tables “XML_LOAD_TABLE” (CLOB) and “XML_TABLE” (XMLType) should be created.* table: xml_load_table (CLOB)create table xml_load_table (xmlcolumn CLOB);* table: xml_table (XMLType)create table xml_table (xmldoc sys.xmltype);
Converting CLOB to XMLType
CLOB is a kind of normal large object in Oracle, but is lack on XML support. Thatmeans we can’t query CLOB with SQL statement. Fortunately, CLOB can beconverted to XMLType by using the XMLType function “CreateXML”. As we convertCLOB to XMLType, we can easily query XMLType to get the necessary HL7segment message. The procedure “insert_xml_table” is called to perform theconverting.
Querying XML table and Inserting to Promis table
Even though we already had the structured message on XMLType, we still needmore control to process the string queried from table XML_TABLE. Currentlly, thecursor is used to process the message segment one by one and then insert intoPromis table.
Back to next incoming HL7 message(s)
 
As soon as the data has been inserted into Promis table, the program will returnto receive next incoming HL7 message(s) and then perform the same processdescribed above.
Program files list:
1.
HL7ADTListener.pl ---
Perl file to receive the HL7 data from sender and callbatch file to process the rest of jobs2.
HL7_batch.bat
--- OS batch file to integrate the processing files, includingvalidating HL7 format, converting to XML, loadingxml to database, inserting into Promis table3.
Pro_HL7_batch.pl
--- Perl file to validate the HL7 message (eliminating idleparts)4.
Barxml
--- Java tool to convert HL7 to XML5.
VIHATest.ctl
--- SQL*Loader control file to identify the loading method6.
insert_xml_table.sql
--- SQL script to create the procedureinsert_xml_table, which create the data in XMLType and then insert into tablexml_table7.
insertXml_ADT.sql
--- SQL scripe to query the data from XMLType in tablexml_table and then insert into Promis table, used in test, VIHA_Patients
AppendixTwo ways to save xml data in oracle database:1. LOB data
This xml data saving way in Oracle offers flexibility when the XML data modelchanged. In our application, that means the possible change in HL7, furtherconverted to XML, will not affect the data loading and saving method we arecurrently using. Another important point is that saving data in LOB will keep thecomplete data oringinally converted from HL7. That make us keep the dataconsistent with the one we received. The disadvantage of this method is thatsaving data in LOB require more phisical disk space.
2. Structrued (relation-object) data
Comparing to LOB data, structured data is not flexible as LOB data because thedata in XML file will be parsed and further inserted into specific xml table. Thechanges on HL7 data model will make data schema redefined. Saving data instructured xml will lose some information in XML. If we want the completness of data, this method is not our choice. The advange of this method is that theperformance on DML is excellent and it requires less physical disk space thanLOB data.
Summary
Currently, Promis is experiencing challenge of HL7 loading. We are working tofind a effective solution to make the HL7 loading easily. We are trying to parsethe HL7 data by bridging XML to skip the fussy work previously handled by
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...