Skip to content

Commit

Permalink
#3582 : Support mapping of PID.11 in HL7 messages to Patient Address …
Browse files Browse the repository at this point in the history
…(0010,1040) DICOM attribute
  • Loading branch information
vrindanayak committed Mar 1, 2022
1 parent f0863a0 commit 93be388
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,12 @@
</xsl:call-template>
</field>
<field/>
<field/>
<field>
<xsl:call-template name="attr">
<xsl:with-param name="tag" select="'00101040'" />
<xsl:with-param name="includeNullValues" select="$includeNullValues" />
</xsl:call-template>
</field>
<field/>
<field/>
<field/>
Expand Down
24 changes: 24 additions & 0 deletions dcm4chee-arc-conf-data/src/main/resources/hl7-common.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,20 @@
<xsl:with-param name="val" select="substring($val, 1, 64)"/>
</xsl:call-template>
</xsl:template>

<xsl:template name="address">
<xsl:param name="val"/>
<xsl:variable name="streetAddr" select="$val/text()"/>
<xsl:variable name="addrComponents">
<xsl:for-each select="$val/component">
<xsl:value-of select="." />
<xsl:if test="position()!=last()">
<xsl:value-of select="'^'"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:value-of select="concat($streetAddr, '^', $addrComponents)"/>
</xsl:template>

<xsl:template match="PID">
<!-- Patient Name -->
Expand All @@ -407,6 +421,16 @@
<xsl:with-param name="vr" select="'DA'"/>
<xsl:with-param name="val" select="substring(field[7],1,8)"/>
</xsl:call-template>
<!-- Patient's Address' -->
<xsl:call-template name="attr">
<xsl:with-param name="tag" select="'00101040'"/>
<xsl:with-param name="vr" select="'LO'"/>
<xsl:with-param name="val">
<xsl:call-template name="address">
<xsl:with-param name="val" select="field[11]"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
<!-- Patient Sex -->
<xsl:call-template name="attr">
<xsl:with-param name="tag" select="'00100040'"/>
Expand Down

0 comments on commit 93be388

Please sign in to comment.