source: ccr2ccd-xslt/trunk/make/ccd-planofcare.xsl@ 1061

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

broke the stylesheet into pieces with a script to reassemble

File size: 28.0 KB
Line 
1 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:PlanOfCare">
2 <component>
3 <section>
4 <templateId root="2.16.840.1.113883.10.20.1.10"/>
5 <code code="18776-5" codeSystem="2.16.840.1.113883.6.1"/>
6 <title>Plan Of Care</title>
7 <text>
8 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Treatment Recommendation']">
9 <xsl:text>Plan Of Care Recommendations</xsl:text>
10 <br/>
11 <table>
12 <tbody>
13 <tr>
14 <th>Description</th>
15 <th>Recommendation</th>
16 <th>Goal</th>
17 <th>Status</th>
18 <th>Source</th>
19 </tr>
20 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Treatment Recommendation']">
21 <tr>
22 <td>
23 <xsl:value-of select="a:Description/a:Text"/>
24 </td>
25 <td>
26 <xsl:value-of select="a:OrderRequest/a:Description/a:Text" disable-output-escaping="yes"/>
27 </td>
28 <td>
29 <xsl:value-of select="a:OrderRequest/a:Goals/a:Goal/a:Description/a:Text" disable-output-escaping="yes"/>
30 </td>
31 <td>
32 <xsl:value-of select="a:Status/a:Text"/>
33 </td>
34 <td>
35 <xsl:call-template name="actorName">
36 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
37 </xsl:call-template>
38 </td>
39 </tr>
40 </xsl:for-each>
41 </tbody>
42 </table>
43 </xsl:if>
44 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Order']">
45 <xsl:text>Plan Of Care Orders</xsl:text>
46 <br/>
47 <table>
48 <tbody>
49 <tr>
50 <th>Descripion</th>
51 <th>Plan Status</th>
52 <th>Type</th>
53 <th>Date</th>
54 <th>Procedure</th>
55 <th>Schedule</th>
56 <th>Location</th>
57 <th>Substance</th>
58 <th>Method</th>
59 <th>Position</th>
60 <th>Site</th>
61 <th>Status</th>
62 <th>Source</th>
63 </tr>
64 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Order']">
65 <tr>
66 <td>
67 <xsl:apply-templates select="a:Description/a:Text"/>
68 </td>
69 <td>
70 <xsl:value-of select="a:Status/a:Text"/>
71 </td>
72 <td>
73 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Type/a:Text"/>
74 </td>
75 <td>
76 <xsl:call-template name="date:format-date">
77 <xsl:with-param name="date-time" select="a:OrderRequest/a:Procedures/a:Procedure/a:DateTime/a:ExactDateTime"/>
78 </xsl:call-template>
79 </td>
80 <td>
81 <xsl:apply-templates select="a:OrderRequest/a:Procedures/a:Procedure/a:Description/a:Text"/>
82 </td>
83 <td>
84 <xsl:text xml:space="preserve">Every </xsl:text>
85 <xsl:apply-templates select="a:OrderRequest/a:Procedures/a:Procedure/a:Interval/a:Value"/>
86 <xsl:text xml:space="preserve"> </xsl:text>
87 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Interval/a:Units/a:Unit"/>
88 <xsl:text xml:space="preserve"> for </xsl:text>
89 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Duration/a:Value"/>
90 <xsl:text xml:space="preserve"> </xsl:text>
91 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Duration/a:Units/a:Unit"/>
92 </td>
93 <td>
94 <xsl:for-each select="a:OrderRequest/a:Procedures/a:Procedure/a:Locations">
95 <xsl:value-of select="a:Location/a:Description/a:Text"/>
96 <xsl:if test="position() != last()">
97 <br/>
98 </xsl:if>
99 </xsl:for-each>
100 </td>
101 <td>
102 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Substance/a:Text"/>
103 </td>
104 <td>
105 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Method/a:Text"/>
106 </td>
107 <td>
108 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Position/a:Text"/>
109 </td>
110 <td>
111 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Site/a:Text"/>
112 </td>
113 <td/>
114 <td>
115 <xsl:call-template name="actorName">
116 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
117 </xsl:call-template>
118 </td>
119 </tr>
120 </xsl:for-each>
121 </tbody>
122 </table>
123 </xsl:if>
124 </text>
125 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan/a:OrderRequest/a:Procedures/a:Procedure">
126 <entry typeCode="DRIV">
127 <observation classCode="OBS" moodCode="RQO">
128 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.20.3.1"/>
129
130 <!-- <id> -->
131 <xsl:call-template name="ccdID">
132 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
133 </xsl:call-template>
134
135 <!-- <code> -->
136 <xsl:call-template name="ccdCodedValue">
137 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
138 <xsl:with-param name="nodeName" select="'code'"/>
139 </xsl:call-template>
140
141 <statusCode code="new"/>
142
143 <effectiveTime>
144 <xsl:choose>
145 <xsl:when test="a:DateTime">
146 <xsl:call-template name="ccdDateTime">
147 <xsl:with-param name="dt" select="a:DateTime"/>
148 </xsl:call-template>
149 </xsl:when>
150 <xsl:when test="a:Interval">
151 <xsl:attribute name="xsi:type">PIVL_TS</xsl:attribute>
152 <xsl:attribute name="operator">A</xsl:attribute>
153 <xsl:attribute name="institutionSpecified">true</xsl:attribute>
154 <period>
155 <xsl:attribute name="value">
156 <xsl:value-of select="a:Interval/a:Value"/>
157 </xsl:attribute>
158 <xsl:attribute name="unit">
159 <xsl:value-of select="a:Interval/a:Units/a:Unit"/>
160 </xsl:attribute>
161 </period>
162 </xsl:when>
163 </xsl:choose>
164 </effectiveTime>
165 </observation>
166 </entry>
167 </xsl:for-each>
168
169 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan/a:OrderRequest/a:Medications/a:Medication">
170 <entry typeCode="DRIV">
171 <substanceAdministration classCode="SBADM" moodCode="INT">
172 <templateId root="2.16.840.1.113883.10.20.1.24" assigningAuthorityName="CCD"/>
173 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1" assigningAuthorityName="IHE PCC"/>
174
175 <!--Medication activity template -->
176
177 <!-- <id> -->
178 <xsl:call-template name="ccdID">
179 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
180 </xsl:call-template>
181
182 <statusCode code='completed'/>
183
184 <xsl:call-template name="ccdDateTime">
185 <xsl:with-param name="dt" select="a:DateTime"/>
186 <xsl:with-param name="type" select="'IVL_TS'"/>
187 </xsl:call-template>
188
189 <xsl:call-template name="ccdMedicationFrequency">
190 <xsl:with-param name="frequency" select="a:Directions/a:Direction/a:Frequency"/>
191 </xsl:call-template>
192
193 <xsl:call-template name="ccdCodedValue">
194 <xsl:with-param name="ccrCodedDescription" select="a:Directions/a:Direction/a:Route"/>
195 <xsl:with-param name="nodeName" select="'routeCode'"/>
196 <xsl:with-param name="domain" select="'RouteOfAdministration'"/>
197 </xsl:call-template>
198
199 <xsl:if test="a:Directions/a:Direction/a:Dose">
200 <doseQuantity>
201 <low>
202 <xsl:attribute name="value">
203 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Value"></xsl:value-of>
204 </xsl:attribute>
205 <xsl:attribute name="unit">
206 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Unit"></xsl:value-of>
207 </xsl:attribute>
208 </low>
209 <high>
210 <xsl:attribute name="value">
211 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Value"></xsl:value-of>
212 </xsl:attribute>
213 <xsl:attribute name="unit">
214 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Unit"></xsl:value-of>
215 </xsl:attribute>
216 </high>
217 </doseQuantity>
218 </xsl:if>
219 <consumable>
220 <manufacturedProduct>
221 <templateId root="2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName="HITSP C83"/>
222 <templateId root="2.16.840.1.113883.10.20.1.53" assigningAuthorityName="CCD"/>
223 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName="IHE PCC"/>
224
225 <!-- Product template -->
226
227 <manufacturedMaterial>
228 <xsl:call-template name="ccdCodedValue">
229 <xsl:with-param name="ccrCodedDescription" select="a:Product/a:ProductName"/>
230 <xsl:with-param name="nodeName" select="'code'"/>
231 </xsl:call-template>
232 <name>
233 <xsl:value-of select="a:Product/a:BrandName/a:Text"/>
234 </name>
235 </manufacturedMaterial>
236 </manufacturedProduct>
237 </consumable>
238 </substanceAdministration>
239 </entry>
240 </xsl:for-each>
241 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan/a:OrderRequest/a:Immunizations/a:Immunization">
242
243 <entry typeCode="DRIV">
244 <substanceAdministration classCode="SBADM" moodCode="EVN">
245 <templateId root="2.16.840.1.113883.10.20.1.24" assigningAuthorityName="CCD"/>
246 <templateId root="2.16.840.1.113883.3.88.11.83.13" assigningAuthorityName="HITSP C83"/>
247 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.12" assigningAuthorityName="IHE PCC"/>
248
249 <!-- Medication activity template -->
250
251 <!-- <id> -->
252 <xsl:call-template name="ccdID">
253 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
254 </xsl:call-template>
255
256 <code code="IMMUNIZ" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7 ActCode"/>
257 <text>
258 <reference>
259 <xsl:attribute name="value">
260 <xsl:text>#</xsl:text>
261 <xsl:value-of select="a:CCRDataObjectID"/>
262 </xsl:attribute>
263 </reference>
264 </text>
265
266 <statusCode code='completed'/>
267
268 <xsl:call-template name="ccdDateTime">
269 <xsl:with-param name="dt" select="a:DateTime"/>
270 <xsl:with-param name="type" select="'IVL_TS'"/>
271 </xsl:call-template>
272
273 <xsl:call-template name="ccdCodedValue">
274 <xsl:with-param name="ccrCodedDescription" select="a:Directions/a:Direction/a:Route"/>
275 <xsl:with-param name="nodeName" select="'routeCode'"/>
276 <xsl:with-param name="domain" select="'RouteOfAdministration'"/>
277 </xsl:call-template>
278
279 <xsl:if test="a:Directions/a:Direction/a:Site">
280 <xsl:call-template name="ccdCodedValue">
281 <xsl:with-param name="ccrCodedDescription" select="a:Directions/a:Direction/a:Site"/>
282 <xsl:with-param name="nodeName" select="'approachSiteCode'"/>
283 <xsl:with-param name="originalTextReference">
284 <xsl:text>#</xsl:text>
285 <xsl:value-of select="a:CCRDataObjectID"/>
286 <xsl:text>:Site</xsl:text>
287 </xsl:with-param>
288 </xsl:call-template>
289 </xsl:if>
290
291 <consumable>
292 <manufacturedProduct>
293 <templateId root="2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName="HITSP C83"/>
294 <templateId root="2.16.840.1.113883.10.20.1.53" assigningAuthorityName="CCD"/>
295 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName="IHE PCC"/>
296
297 <!-- Product template -->
298
299 <manufacturedMaterial>
300 <xsl:call-template name="ccdCodedValue">
301 <xsl:with-param name="ccrCodedDescription" select="a:Product/a:ProductName"/>
302 <xsl:with-param name="nodeName" select="'code'"/>
303 </xsl:call-template>
304 <name>
305 <xsl:value-of select="a:Product/a:BrandName/a:Text"/>
306 </name>
307 </manufacturedMaterial>
308 </manufacturedProduct>
309 </consumable>
310
311 </substanceAdministration>
312 </entry>
313 </xsl:for-each>
314
315 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan/a:OrderRequest/a:Encounters/a:Encounter">
316 <entry typeCode="DRIV">
317 <encounter classCode="ENC" moodCode="INT">
318 <templateId root="2.16.840.1.113883.3.88.11.83.16" assigningAuthorityName="HITSP C83"/>
319 <templateId root="2.16.840.1.113883.10.20.1.21" assigningAuthorityName="CCD"/>
320 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.14" assigningAuthorityName="IHE PCC"/>
321
322 <!-- Encounter activity template -->
323
324 <!-- <id> -->
325 <xsl:call-template name="ccdID">
326 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
327 </xsl:call-template>
328
329 <xsl:call-template name="ccdCodedValue">
330 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
331 <xsl:with-param name="nodeName" select="'code'"/>
332 </xsl:call-template>
333
334 <text>
335 <reference>
336 <xsl:attribute name="value">
337 <xsl:text>#</xsl:text>
338 <xsl:value-of select="a:CCRDataObjectID"/>
339 </xsl:attribute>
340 </reference>
341 </text>
342
343 <xsl:call-template name="ccdDateTime">
344 <xsl:with-param name="dt" select="a:DateTime"/>
345 </xsl:call-template>
346
347 <xsl:if test="a:Practitioners[1]/a:Practitioner">
348 <xsl:call-template name="ccdPerformer">
349 <xsl:with-param name="ccrActorReference" select="a:Practitioners/a:Practitioner[1]"/>
350 </xsl:call-template>
351 </xsl:if>
352
353 <xsl:if test="a:Locations[1]/a:Location">
354 <participant typeCode="LOC">
355 <templateId root="2.16.840.1.113883.10.20.1.45"/>
356 <!-- Location participation template -->
357 <xsl:choose>
358 <xsl:when test="a:Locations[1]/a:Location/a:ActorID">
359 <xsl:call-template name="ccdParticipantRoleActor">
360 <xsl:with-param name="ccrActorObjectID" select="a:Locations[1]/a:Location/a:ActorID"/>
361 </xsl:call-template>
362 </xsl:when>
363 <xsl:otherwise>
364 <xsl:call-template name="ccdParticipantRoleCodedDescription">
365 <xsl:with-param name="ccrCodedDescription" select="a:Locations[1]/a:Location/a:Description"/>
366 </xsl:call-template>
367 </xsl:otherwise>
368 </xsl:choose>
369 </participant>
370 </xsl:if>
371 </encounter>
372 </entry>
373 </xsl:for-each>
374 </section>
375 </component>
376 </xsl:if>
Note: See TracBrowser for help on using the repository browser.