Announcement

Collapse
No announcement yet.

Reading an XML that points to mulitple files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reading an XML that points to mulitple files

    I am trying to take the photo output from an olympus endoscope and get the images into my HIS.

    What I get from the endo scope is a list of files in a sub-directory of the format (###OLYMP). There is an XML and the associated JPEG images. The XML file looks like this (this is not a real file with real patient data)
    <?xml version="1.0" encoding="iso-8859-1" ?>
    <?xml-stylesheet type="text/xsl" href="../examstyle.xsl"?>

    <study>
    <patient>
    <date>06/08/2012</date>
    <idno>499999</idno>
    <name>SMITH, JOHN</name>
    <sex>M</sex>
    <birth>10/10/1910</birth>
    <age>102</age>

    </patient>
    <inspections>
    <inspection number="0001">
    <file>OLYM0001.jpg</file>
    <enhance>B5</enhance>
    <contrast>N</contrast>
    <zoom>x1.0</zoom>
    <physician>JOHNSON</physician>
    <splight></splight>
    <comment>COLONOSCOPY</comment>
    </inspection>
    <inspection number="0002">
    <file>OLYM0002.jpg</file>
    <enhance>B5</enhance>
    <contrast>N</contrast>
    <zoom>x1.0</zoom>
    <physician>JOHNSON</physician>
    <splight></splight>
    <comment>COLONOSCOPY</comment>
    </inspection>
    <inspection number="0003">
    <file>OLYM0003.jpg</file>
    <enhance>B5</enhance>
    <contrast>N</contrast>
    <zoom>x1.0</zoom>
    <physician>JOHNSON</physician>
    <splight></splight>
    <comment>COLONOSCOPY</comment>
    </inspection>
    <inspection number="0004">
    <file>OLYM0004.jpg</file>
    <enhance>B5</enhance>
    <contrast>N</contrast>
    <zoom>x1.0</zoom>
    <physician>JOHNSON</physician>
    <splight></splight>
    <comment>COLONOSCOPY</comment>
    </inspection>
    <inspection number="0005">
    <file>OLYM0005.jpg</file>
    <enhance>B5</enhance>
    <contrast>N</contrast>
    <zoom>x1.0</zoom>
    <physician>JOHNSON</physician>
    <splight></splight>
    <comment>COLONOSCOPY</comment>
    </inspection>
    </inspections>
    </study>
    I need to be able to extract the each file and convert each one into an HL-7 message with the JPG in an OBX segment.

    My inital problem is getting Mirth to read into the sub directory. The second problem is being able to to greate multiple HL-7 messages. The only way I can think of to deal with this is to create a script on the server that will look for the folders, parse the XML, then rename the JPG files to include the demographinc info (I am doing something similar to this for PDF and RTF images already.)

    Any ideas/suggestions? Once I complete this I am willing to share the channel code to make it happen.
Working...
X