source: ccr2ccd-xslt/trunk/make/ccd-alerts.xsl@ 1328

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

broke the stylesheet into pieces with a script to reassemble

File size: 9.7 KB
Line 
1 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Alerts">
2 <component>
3 <section>
4 <templateId root="2.16.840.1.113883.10.20.1.2" />
5 <!--C83 Allergies and Other Adverse Reactions Section Conformance Identifier-->
6 <templateId root="2.16.840.1.113883.3.88.11.83.102" />
7 <!--IHE Allergies and Other Adverse Reactions Section Conformance Identifier-->
8 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.13" />
9 <code code="48765-2" displayName="Allergies, adverse reactions, alerts" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" />
10 <title>Alerts</title>
11 <text>
12 <table>
13 <tbody>
14 <tr>
15 <th>Type</th>
16 <th>Date</th>
17 <th>Code</th>
18 <th>Description</th>
19 <th>Reaction</th>
20 <th>Source</th>
21 </tr>
22 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Alerts/a:Alert">
23 <tr>
24 <td>
25 <xsl:value-of select="a:Type/a:Text"/>
26 </td>
27 <td>
28 <xsl:call-template name="date:format-date">
29 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
30 </xsl:call-template>
31 </td>
32 <td>
33 <xsl:apply-templates select="a:Description/a:Code"/>
34 </td>
35 <td>
36 <xsl:attribute name="ID">
37 <xsl:value-of select="a:CCRDataObjectID"/>
38 </xsl:attribute>
39 <xsl:value-of select="a:Description/a:Text"/>
40 </td>
41 <td>
42 <xsl:value-of select="a:Reaction/a:Description/a:Text"/>
43 <xsl:if test="a:Reaction/a:Severity/a:Text">
44 -<xsl:value-of select="a:Reaction/a:Severity/a:Text"/>
45 </xsl:if>
46 </td>
47 <td>
48 <xsl:call-template name="actorName">
49 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
50 </xsl:call-template>
51 </td>
52 </tr>
53 </xsl:for-each>
54 </tbody>
55 </table>
56 </text>
57 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Alerts/a:Alert">
58 <entry typeCode="DRIV">
59 <act classCode="ACT" moodCode="EVN">
60 <!--CCD Problem Act Identifier-->
61 <templateId root="2.16.840.1.113883.10.20.1.27"></templateId>
62 <!--C83 Allergy Entry-->
63 <templateId root="2.16.840.1.113883.3.88.11.83.6" />
64 <!--IHE Concern Entry Conformance Identifier-->
65 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5.1"></templateId>
66 <!--IHE Allergy and Intolerance Concerns Entry-->
67 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5.3"></templateId>
68
69 <!-- <id> -->
70 <xsl:call-template name="ccdID">
71 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
72 </xsl:call-template>
73
74 <code nullFlavor="NA"/>
75 <entryRelationship typeCode="SUBJ">
76 <observation classCode="OBS" moodCode="EVN">
77 <!--CCD Alert Observation-->
78 <templateId root="2.16.840.1.113883.10.20.1.18"></templateId>
79 <!--CCD Problem Observation-->
80 <templateId root="2.16.840.1.113883.10.20.1.28" />
81 <!--IHE Problem Entry-->
82 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5" />
83 <!--IHE Allergies and Intolerances Entry-->
84 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.6" />
85 <!-- <id> -->
86 <xsl:call-template name="ccdID">
87 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
88 <xsl:with-param name="suffix"></xsl:with-param>
89 </xsl:call-template>
90
91 <code code="416098002" codeSystem="2.16.840.1.113883.6.96" displayName="drug allergy" codeSystemName="SNOMED CT"/>
92
93 <text>
94 <reference>
95 <xsl:attribute name="value">
96 <xsl:text>#</xsl:text>
97 <xsl:value-of select="a:CCRDataObjectID"/>
98 </xsl:attribute>
99 </reference>
100 </text>
101
102 <statusCode code="completed"/>
103 <value xsi:type="CD" />
104
105 <participant typeCode="CSM">
106 <xsl:choose>
107 <xsl:when test="a:Agent/a:Products/a:Product/a:Product">
108 <xsl:call-template name="ccdParticipantRoleCodedDescription">
109 <xsl:with-param name="ccrCodedDescription" select="a:Product/a:Description"/>
110 </xsl:call-template>
111 </xsl:when>
112
113 </xsl:choose>
114 </participant>
115
116 <xsl:if test="a:Reaction">
117 <entryRelationship typeCode="MFST" inversionInd="true">
118 <observation classCode="OBS" moodCode="EVN">
119 <templateId root="2.16.840.1.113883.10.20.1.54"/>
120 <!--Reaction observation template -->
121 <code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
122 <statusCode code="completed"/>
123 <xsl:call-template name="ccdCodedValue">
124 <xsl:with-param name="ccrCodedDescription" select="a:Reaction/a:Description"/>
125 </xsl:call-template>
126 </observation>
127 </entryRelationship>
128 </xsl:if>
129
130 <xsl:call-template name="ccdStatus">
131 <xsl:with-param name="ccrStatus" select="a:Status"/>
132 </xsl:call-template>
133
134 </observation>
135 </entryRelationship>
136 </act>
137 </entry>
138 </xsl:for-each>
139 </section>
140 </component>
141 </xsl:if>
Note: See TracBrowser for help on using the repository browser.