Extracting message field data

44 views
Skip to first unread message

Steve Pillar

unread,
Sep 17, 2013, 10:50:29 AM9/17/13
to dcm...@googlegroups.com
I am trying to extract the NHS Number that is coming over in my HL7 ORM^O01 message into DCM4CHEE. 

The PID section is as follows:

PID|||ABC123456^^^ABC02^MR~123 456 7891^^^ etc

I have edited the common.xsl file as follows:

<!-- Other Patient ID -->
        <xsl:call-template name="attr">
          <xsl:with-param name="tag" select="'00101000'"/>
 <xsl:with-param name="vr" select="'LO'"/>
          <xsl:with-param name="val" select="field[3]/component[4]/text()"/>
    </xsl:call-template>

The value that is extracted is MR and not 'MR~123 456 7891'

The problem seems to be because the tilde (~) is treated as a field delimiter but editing the common.xsl file to show "field[3]/component[5]/text()" or "field[3]/component[4]/subcomponent[1]text()" doesn't return anything.

How do I get at the string after the tilde?

fleetwoodfc

unread,
Sep 17, 2013, 2:59:49 PM9/17/13
to dcm...@googlegroups.com
Best thing to do is enable the service=HL7Server->FileReceivedHL7AsXML attribute. This will show you how the HL7 message gets parsed into XML for input into the xsl.  

Steve Pillar

unread,
Sep 18, 2013, 4:44:44 AM9/18/13
to dcm...@googlegroups.com
Thanks. That has been done and the output is as follows:

<PID>
<field/>
<field/>
<field>ABC123456<component/>
<component/>
<component>ABC02</component>
<component>MR</component>
<repeat>123 456 7891<component/>
<component/>

So I changed the common.xsl file as follows

<!-- Other Patient ID -->
        <xsl:call-template name="attr">
          <xsl:with-param name="tag" select="'00101000'"/>
  <xsl:with-param name="vr" select="'LO'"/>
          <xsl:with-param name="val" select="field[3]/component[4]/repeat[1]/text()"/>
    </xsl:call-template>

But still nothing - what is the correct syntax to access that repeated field?

Steve Pillar

unread,
Sep 18, 2013, 5:34:55 AM9/18/13
to dcm...@googlegroups.com
All done - edited common.xsl as follows:

<xsl:with-param name="val" select="field[3]/repeat[1]/text()"/>

Thanks for your help.
Reply all
Reply to author
Forward
0 new messages