-
Notifications
You must be signed in to change notification settings - Fork 1
/
flatten_final_dx.xsl
35 lines (28 loc) · 1.37 KB
/
flatten_final_dx.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
<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, FirstPart-CollectionDate, Case-FinalText, Case-Comment
</xsl:text>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="/CoPathDump/Patient/Case">
<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="CasePart[1]/@collectionDate"/>
<xsl:text>,"</xsl:text><xsl:value-of select="translate(CaseFinalText, '"· ', '¶ ')"/><xsl:text>"</xsl:text>
<xsl:text>,"</xsl:text><xsl:value-of select="translate(CaseComment, '"· ', '¶ ')"/><xsl:text>"</xsl:text>
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
<xsl:template match="/CoPathDump/Patient/Case/CaseFinalText">
</xsl:template>
</xsl:stylesheet>