forked from ghsmith/CoPathDump
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flatten_part.xsl
38 lines (31 loc) · 1.64 KB
/
flatten_part.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
Converts quotation marks to ¶ (paragraph mark).
Pipe through sed to get quotation marks escaped for
Excel: sed 's/\xB6/""/g'.
-->
<xsl:output method="text" encoding="iso-8859-1"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<xsl:text>+, Pt-EMPI, Case-AccessionNumber, Case-AccessionDate, Case-SignoutDate, Part-CollectionDate, Part-Designator, Part-Type, Part-TypeDisp, Part-Descr, Part-FinalText
</xsl:text>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="/CoPathDump/Patient/Case/CasePart">
<xsl:for-each select=".">
<xsl:text>+</xsl:text>
<xsl:text>,</xsl:text><xsl:value-of select="../../@empi"/>
<xsl:text>,</xsl:text><xsl:value-of select="../@accessionNumber"/>
<xsl:text>,</xsl:text><xsl:value-of select="../@accessionDate"/>
<xsl:text>,</xsl:text><xsl:value-of select="../@signoutDate"/>
<xsl:text>,</xsl:text><xsl:value-of select="@collectionDate"/>
<xsl:text>,</xsl:text><xsl:value-of select="@designator"/>
<xsl:text>,</xsl:text><xsl:value-of select="@partType"/>
<xsl:text>,"</xsl:text><xsl:value-of select="translate(@partTypeDisp, '"', '¶')"/><xsl:text>"</xsl:text>
<xsl:text>,"</xsl:text><xsl:value-of select="translate(@description, '"', '¶')"/><xsl:text>"</xsl:text>
<xsl:text>,"</xsl:text><xsl:value-of select="translate(PartFinalText, '"· ', '¶ ')"/><xsl:text>"</xsl:text>
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
<xsl:template match="/CoPathDump/Patient/Case/CaseFinalText">
</xsl:template>
</xsl:stylesheet>