source: ccr2ccd-xslt/trunk/gpl/ccd-encounters.xsl@ 1699

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

latest version

File size: 10.1 KB
Line 
1 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Encounters">
2 <component>
3 <section>
4 <templateId root="2.16.840.1.113883.3.88.11.83.127" assigningAuthorityName="HITSP/C83"/>
5 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.5.3.3" assigningAuthorityName="IHE PCC"/>
6 <templateId root="2.16.840.1.113883.10.20.1.3" assigningAuthorityName="HL7 CCD"/>
7 <!--Encounters section template-->
8 <code code="46240-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of encounters"/>
9 <title>Encounters</title>
10 <text>
11 <table>
12 <tbody>
13 <tr>
14 <th>Type</th>
15 <th>Date</th>
16 <th>Location</th>
17 <th>Status</th>
18 <th>Practitioner</th>
19 <th>Description</th>
20 <th>Indications</th>
21 <th>Source</th>
22 </tr>
23 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Encounters/a:Encounter">
24 <tr>
25 <xsl:attribute name="id">
26 <xsl:value-of select="a:CCRDataObjectID"/>
27 </xsl:attribute>
28
29 <td>
30 <xsl:value-of select="a:Type/a:Text"/>
31 </td>
32 <td>
33 <xsl:call-template name="date:format-date">
34 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
35 </xsl:call-template>
36 </td>
37 <td>
38 <xsl:for-each select="a:Locations/a:Location">
39 <xsl:value-of select="a:Description/a:Text"/>
40 <xsl:call-template name="actorName">
41 <xsl:with-param name="objID" select="a:Actor/a:ActorID"/>
42 </xsl:call-template>
43 <br/>
44 </xsl:for-each>
45 </td>
46 <td>
47 <xsl:value-of select="a:Status/a:Text"/>
48 </td>
49 <td>
50 <xsl:for-each select="a:Practitioners/a:Practitioner">
51 <xsl:call-template name="actorName">
52 <xsl:with-param name="objID" select="a:ActorID"/>
53 </xsl:call-template>
54 <br/>
55 </xsl:for-each>
56 </td>
57 <td>
58 <xsl:value-of select="a:Description/a:Text"/>
59 </td>
60 <td>
61 <xsl:for-each select="a:Indications/a:Indication">
62 <xsl:call-template name="problemDescription">
63 <xsl:with-param name="objID" select="a:InternalCCRLink/a:LinkID"/>
64 </xsl:call-template>
65 <br/>
66 </xsl:for-each>
67 </td>
68 <td>
69 <xsl:call-template name="actorName">
70 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
71 </xsl:call-template>
72 </td>
73 </tr>
74 </xsl:for-each>
75 </tbody>
76 </table>
77 </text>
78 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Encounters/a:Encounter">
79 <entry typeCode="DRIV">
80 <encounter classCode="ENC" moodCode="EVN">
81 <templateId root="2.16.840.1.113883.3.88.11.83.16" assigningAuthorityName="HITSP C83"/>
82 <templateId root="2.16.840.1.113883.10.20.1.21" assigningAuthorityName="CCD"/>
83 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.14" assigningAuthorityName="IHE PCC"/>
84
85 <!-- Encounter activity template -->
86
87 <!-- <id> -->
88 <xsl:call-template name="ccdID">
89 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
90 </xsl:call-template>
91
92 <xsl:call-template name="ccdCodedValue">
93 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
94 <xsl:with-param name="nodeName" select="'code'"/>
95 </xsl:call-template>
96
97 <text>
98 <reference>
99 <xsl:attribute name="value">
100 <xsl:text>#</xsl:text>
101 <xsl:value-of select="a:CCRDataObjectID"/>
102 </xsl:attribute>
103 </reference>
104 </text>
105
106 <xsl:call-template name="ccdDateTime">
107 <xsl:with-param name="dt" select="a:DateTime"/>
108 </xsl:call-template>
109
110 <xsl:if test="a:Practitioners[1]/a:Practitioner">
111 <xsl:call-template name="ccdPerformer">
112 <xsl:with-param name="ccrActorReference" select="a:Practitioners/a:Practitioner[1]"/>
113 </xsl:call-template>
114 </xsl:if>
115
116 <xsl:if test="a:Locations[1]/a:Location">
117 <participant typeCode="LOC">
118 <templateId root="2.16.840.1.113883.10.20.1.45"/>
119 <!-- Location participation template -->
120 <xsl:choose>
121 <xsl:when test="a:Locations[1]/a:Location/a:ActorID">
122 <xsl:call-template name="ccdParticipantRoleActor">
123 <xsl:with-param name="ccrActorObjectID" select="a:Locations[1]/a:Location/a:ActorID"/>
124 </xsl:call-template>
125 </xsl:when>
126 <xsl:otherwise>
127 <xsl:call-template name="ccdParticipantRoleCodedDescription">
128 <xsl:with-param name="ccrCodedDescription" select="a:Locations[1]/a:Location/a:Description"/>
129 </xsl:call-template>
130 </xsl:otherwise>
131 </xsl:choose>
132 </participant>
133 </xsl:if>
134 </encounter>
135 </entry>
136 </xsl:for-each>
137 </section>
138 </component>
139 </xsl:if>
Note: See TracBrowser for help on using the repository browser.