source: ccr2ccd-xslt/trunk/make/ccd-results.xsl@ 1187

Last change on this file since 1187 was 875, checked in by George Lilly, 14 years ago

broke the stylesheet into pieces with a script to reassemble

File size: 8.8 KB
Line 
1 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Results/a:Result">
2 <component>
3 <section>
4 <templateId root="2.16.840.1.113883.10.20.1.14"/>
5 <code code="30954-2" codeSystem="2.16.840.1.113883.6.1"/>
6 <title>Results</title>
7 <text>
8 <table>
9 <tbody>
10 <tr>
11 <th>Test</th>
12 <th>Date</th>
13 <th>Result</th>
14 <th>Source</th>
15 </tr>
16 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Results/a:Result">
17 <tr>
18 <xsl:attribute name="id">
19 <xsl:value-of select="a:CCRDataObjectID"/>
20 </xsl:attribute>
21 <td>
22 <xsl:value-of select="a:Description/a:Text"/>
23 </td>
24 <td>
25 <xsl:call-template name="date:format-date">
26 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
27 </xsl:call-template>
28 </td>
29 <td>
30 <xsl:for-each select="a:Test[a:TestResult/a:Value!='']">
31 <div>
32 <xsl:attribute name="id">
33 <xsl:value-of select="a:CCRDataObjectID"/>
34 </xsl:attribute>
35
36 <xsl:value-of select="a:Description/a:Text"/>
37 <xsl:text xml:space="preserve"> </xsl:text>
38 <xsl:value-of select="a:TestResult/a:Value"/>
39 <xsl:text xml:space="preserve"> </xsl:text>
40 <xsl:value-of select="a:TestResult/a:Units/a:Unit"/>
41 <xsl:text xml:space="preserve"> </xsl:text>
42 <xsl:value-of select="a:Flag/a:Text"/>
43 <br/>
44 </div>
45 </xsl:for-each>
46 <xsl:for-each select="a:Test[a:TestResult/a:Description/a:Text!='']">
47 <div>
48 <xsl:attribute name="id">
49 <xsl:value-of select="a:CCRDataObjectID"/>
50 </xsl:attribute>
51
52 <xsl:value-of select="a:Description/a:Text"/>
53 <xsl:text xml:space="preserve"> </xsl:text>
54 <xsl:value-of select="a:TestResult/a:Description/a:Text" disable-output-escaping="yes"/>
55 <xsl:text xml:space="preserve"> </xsl:text>
56 <xsl:value-of select="a:Flag/a:Text"/>
57 <br/>
58 </div>
59 </xsl:for-each>
60 </td>
61 <td>
62 <xsl:call-template name="actorName">
63 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
64 </xsl:call-template>
65 </td>
66 </tr>
67 </xsl:for-each>
68 </tbody>
69 </table>
70 </text>
71 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Results/a:Result">
72 <entry typeCode="DRIV">
73 <xsl:variable name="testDate" select="a:DateTime"/>
74
75 <xsl:choose>
76 <xsl:when test="count(a:Test)>1">
77 <organizer classCode="BATTERY" moodCode="EVN">
78 <templateId root="2.16.840.1.113883.10.20.1.32"/>
79 <!--Result organizer template -->
80
81 <!-- <id> -->
82 <xsl:call-template name="ccdID">
83 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
84 </xsl:call-template>
85
86 <!-- <code> -->
87 <xsl:call-template name="ccdCodedValue">
88 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
89 <xsl:with-param name="nodeName" select="'code'"/>
90 </xsl:call-template>
91
92 <statusCode code="completed"/>
93
94 <!-- <effectiveTime> -->
95 <xsl:call-template name="ccdDateTime">
96 <xsl:with-param name="dt" select="$testDate"/>
97 </xsl:call-template>
98
99 <xsl:call-template name="ccdPerformer">
100 <xsl:with-param name="ccrActorReference" select="a:Source/a:Actor"/>
101 </xsl:call-template>
102
103 <xsl:for-each select="a:Test">
104 <xsl:call-template name="ccdObservation">
105 <xsl:with-param name="ccrTestNode" select="."/>
106 <xsl:with-param name="testDate" select="$testDate"/>
107 </xsl:call-template>
108 </xsl:for-each>
109
110 </organizer>
111
112 </xsl:when>
113 <xsl:otherwise>
114 <xsl:call-template name="ccdObservation">
115 <xsl:with-param name="ccrTestNode" select="a:Test[1]"/>
116 <xsl:with-param name="testDate" select="$testDate"/>
117 </xsl:call-template>
118 </xsl:otherwise>
119 </xsl:choose>
120 </entry>
121 </xsl:for-each>
122 </section>
123 </component>
124 </xsl:if>
Note: See TracBrowser for help on using the repository browser.