source: ccr2ccd-xslt/trunk/ccr_ccd.xsl@ 746

Last change on this file since 746 was 746, checked in by Richard Braman, 14 years ago

initial file from Ken Miller / first pass at coding problems into Level 3 CCD

File size: 107.5 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2
3<!--
4Conversion of CCR to Level 2 CCD
5
6Author: Ken Miller
7Solventus LLC
8ken.miller@solventus.coms
9
10Date: 2008-04-25
11Version: 0.1
12
13-->
14
15<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="urn:astm-org:CCR" xmlns:date="http://exslt.org/dates-and-times" exclude-result-prefixes="a date">
16
17 <xsl:import href="./templates/code.xsl"/>
18 <xsl:import href="./templates/datetime.xsl"/>
19 <xsl:import href="./templates/actor.xsl"/>
20 <xsl:import href="./templates/problemDescription.xsl"/>
21
22 <xsl:output method="xml" encoding="utf-8" version="1.0"/>
23 <xsl:template match="/">
24 <ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:voc="urn:hl7-org:v3/voc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
25 <typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040" />
26 <templateId root="2.16.840.1.113883.10.20.1"/>
27 <id root="db4"/>
28 <code code="34133-9" codeSystem="2.16.840.1.113883.6.1" displayName="Summarization of episode note"/>
29 <title>Continuity of Care Document</title>
30 <xsl:element name="effectiveTime">
31 <xsl:attribute name="value">
32 <xsl:call-template name="date:format-date">
33 <xsl:with-param name="date-time">
34 <xsl:value-of select="a:ContinuityOfCareRecord/a:DateTime/a:ExactDateTime"/>
35 </xsl:with-param>
36 <xsl:with-param name="pattern">yyyyMMddhhmmss+0000</xsl:with-param>
37 </xsl:call-template>
38 </xsl:attribute>
39 </xsl:element>
40 <confidentialityCode code="N" codeSystem="2.16.840.1.113883.5.25"/>
41 <languageCode code="en-US"/>
42 <xsl:variable name="patientID" select="a:ContinuityOfCareRecord/a:Patient[1]/a:ActorID"/>
43 <recordTarget>
44 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$patientID]">
45 <patientRole>
46 <xsl:element name="id">
47 <xsl:attribute name="extension">
48 <xsl:value-of select="a:IDs/a:ID[1]"/>
49 </xsl:attribute>
50 </xsl:element>
51 <patient>
52 <name>
53 <given>
54 <xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Given"></xsl:value-of>
55 </given>
56 <family>
57 <xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Family"></xsl:value-of>
58 </family>
59 </name>
60 <xsl:element name="administrativeGenderCode">
61 <xsl:attribute name="code">
62 <xsl:value-of select="a:Person/a:Gender/a:Text"></xsl:value-of>
63 </xsl:attribute>
64 </xsl:element>
65 <xsl:element name="birthTime">
66 <xsl:attribute name="value">
67 <xsl:call-template name="date:format-date">
68 <xsl:with-param name="date-time">
69 <xsl:value-of select="a:Person/a:DateOfBirth/a:ExactDateTime"/>
70 </xsl:with-param>
71 <xsl:with-param name="pattern">yyyyMMddhhmmss</xsl:with-param>
72 </xsl:call-template>
73 </xsl:attribute>
74 </xsl:element>
75 </patient>
76 </patientRole>
77 </xsl:for-each>
78 </recordTarget>
79 <author>
80 <xsl:variable name="fromID" select="a:ContinuityOfCareRecord/a:From/a:ActorLink[1]/a:ActorID"/>
81 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$fromID]">
82 <xsl:element name="time">
83 <xsl:attribute name="value">
84 <xsl:call-template name="date:format-date">
85 <xsl:with-param name="date-time">
86 <xsl:value-of select="/a:ContinuityOfCareRecord/a:DateTime/a:ExactDateTime"/>
87 </xsl:with-param>
88 <xsl:with-param name="pattern">yyyyMMddhhmmss</xsl:with-param>
89 </xsl:call-template>
90 </xsl:attribute>
91 </xsl:element>
92 <assignedAuthor>
93 <xsl:element name="id">
94 <xsl:attribute name="extension">
95 <xsl:choose>
96 <xsl:when test="a:IDs/a:ID[1]">
97 <xsl:value-of select="a:IDs/a:ID[1]"/>
98 </xsl:when>
99 <xsl:otherwise>
100 <xsl:value-of select="$fromID"/>
101 </xsl:otherwise>
102 </xsl:choose>
103 </xsl:attribute>
104 </xsl:element>
105 <assignedPerson>
106 <name>
107 <prefix>
108 <xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Title"></xsl:value-of>
109 </prefix>
110 <given>
111 <xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Given"></xsl:value-of>
112 </given>
113 <family>
114 <xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Family"></xsl:value-of>
115 </family>
116 </name>
117 </assignedPerson>
118 </assignedAuthor>
119 </xsl:for-each>
120 </author>
121 <custodian>
122 <assignedCustodian>
123 <representedCustodianOrganization>
124 <id root="2.16.840.1.113883.3.96.3.42"/>
125 <xsl:element name="name">
126 <xsl:call-template name="actorName">
127 <xsl:with-param name="objID" select="a:ContinuityOfCareRecord/a:From/a:ActorLink[1]/a:ActorID"/>
128 </xsl:call-template>
129 </xsl:element>
130 </representedCustodianOrganization>
131 </assignedCustodian>
132 </custodian>
133 <documentationOf>
134 <serviceEvent classCode="PCPR">
135 <effectiveTime>
136 <xsl:element name="low">
137 <xsl:attribute name="value">
138 <xsl:call-template name="date:format-date">
139 <xsl:with-param name="date-time">
140 <xsl:value-of select="a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$patientID]/a:Person/a:DateOfBirth/a:ExactDateTime"/>
141 </xsl:with-param>
142 <xsl:with-param name="pattern">yyyyMMdd</xsl:with-param>
143 </xsl:call-template>
144 </xsl:attribute>
145 </xsl:element>
146 <xsl:element name="high">
147 <xsl:attribute name="value">
148 <xsl:call-template name="date:format-date">
149 <xsl:with-param name="date-time">
150 <xsl:value-of select="a:ContinuityOfCareRecord/a:DateTime/a:ExactDateTime"/>
151 </xsl:with-param>
152 <xsl:with-param name="pattern">yyyyMMdd</xsl:with-param>
153 </xsl:call-template>
154 </xsl:attribute>
155 </xsl:element>
156 </effectiveTime>
157 </serviceEvent>
158 </documentationOf>
159 <component>
160 <structuredBody>
161 <component>
162 <section>
163 <templateId root="2.16.840.1.113883.10.20.1.13"/>
164 <code code="48764-5" codeSystem="2.16.840.1.113883.6.1" />
165 <title>Purpose</title>
166 <text>
167 <xsl:value-of select="a:ContinuityOfCareRecord/a:Purpose/a:Description/a:Text"></xsl:value-of>
168 </text>
169 </section>
170 </component>
171 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Alerts">
172 <component>
173 <section>
174 <templateId root="2.16.840.1.113883.10.20.1.2"/>
175 <code code="46240-8" codeSystem="2.16.840.1.113883.6.1"/>
176 <title>Alerts</title>
177 <text>
178 <table>
179 <tbody>
180 <tr>
181 <th>Type</th>
182 <th>Date</th>
183 <th>Code</th>
184 <th>Description</th>
185 <th>Reaction</th>
186 <th>Source</th>
187 </tr>
188 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Alerts/a:Alert">
189 <tr>
190 <td>
191 <xsl:value-of select="a:Type/a:Text"/>
192 </td>
193 <td>
194 <xsl:call-template name="date:format-date">
195 <xsl:with-param name="date-time">
196 <xsl:value-of select="a:DateTime/a:ExactDateTime"/>
197 </xsl:with-param>
198 </xsl:call-template>
199 </td>
200 <td>
201 <xsl:apply-templates select="a:Description/a:Code"/>
202 </td>
203 <td>
204 <xsl:value-of select="a:Description/a:Text"/>
205 </td>
206 <td>
207 <xsl:value-of select="a:Reaction/a:Description/a:Text"/>
208 <xsl:if test="a:Reaction/a:Severity/a:Text">
209 -<xsl:value-of select="a:Reaction/a:Severity/a:Text"/>
210 </xsl:if>
211 </td>
212 <td>
213 <xsl:call-template name="actorName">
214 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
215 </xsl:call-template>
216 </td>
217 </tr>
218 </xsl:for-each>
219 </tbody>
220 </table>
221 </text>
222 </section>
223 </component>
224 </xsl:if>
225 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:AdvanceDirectives">
226 <component>
227 <section>
228 <templateId root="2.16.840.1.113883.10.20.1.1"/>
229 <code code="42348-3" codeSystem="2.16.840.1.113883.6.1"/>
230 <title>Advance Directives</title>
231 <text>
232 <table>
233 <tbody>
234 <tr>
235 <th>Type</th>
236 <th>Date</th>
237 <th>Description</th>
238 <th>Status</th>
239 <th>Source</th>
240 </tr>
241 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:AdvanceDirectives/a:AdvanceDirective">
242 <tr>
243 <td>
244 <xsl:value-of select="a:Type/a:Text"/>
245 </td>
246 <td>
247 <xsl:call-template name="date:format-date">
248 <xsl:with-param name="date-time">
249 <xsl:value-of select="a:DateTime/a:ExactDateTime"/>
250 </xsl:with-param>
251 </xsl:call-template>
252 </td>
253 <td>
254 <xsl:value-of select="a:Description/a:Text"/>
255 </td>
256 <td>
257 <xsl:value-of select="a:Status/a:Text"/>
258 </td>
259 <td>
260 <xsl:call-template name="actorName">
261 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
262 </xsl:call-template>
263 </td>
264 </tr>
265 </xsl:for-each>
266 </tbody>
267 </table>
268
269 </text>
270 </section>
271 </component>
272 </xsl:if>
273 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:FunctionalStatus">
274 <component>
275 <section>
276 <templateId root="2.16.840.1.113883.10.20.1.5"/>
277 <code code="47420-5" codeSystem="2.16.840.1.113883.6.1"/>
278 <title>Functional Status</title>
279 <text>
280 <table>
281 <tbody>
282 <tr>
283 <th>Type</th>
284 <th>Date</th>
285 <th>Code</th>
286 <th>Description</th>
287 <th>Status</th>
288 <th>Source</th>
289 </tr>
290 <tr>
291 <td>
292 <xsl:value-of select="a:Type/a:Text"/>
293 </td>
294 <td>
295 <xsl:call-template name="date:format-date">
296 <xsl:with-param name="date-time">
297 <xsl:value-of select="a:DateTime/a:ExactDateTime"/>
298 </xsl:with-param>
299 </xsl:call-template>
300 </td>
301 <td>
302 <xsl:apply-templates select="a:Description/a:Code"/>
303 </td>
304 <td>
305 <xsl:value-of select="a:Description/a:Text"/>
306 </td>
307 <td>
308 <xsl:value-of select="a:Status/a:Text"/>
309 </td>
310 <td>
311 <xsl:call-template name="actorName">
312 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
313 </xsl:call-template>
314 </td>
315 </tr>
316 </tbody>
317 </table>
318 </text>
319 </section>
320 </component>
321 </xsl:if>
322 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Problems">
323 <component>
324 <section>
325 <templateId root="2.16.840.1.113883.10.20.1.11"/>
326 <code code="11450-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Problem list"/>
327 <title>Problems</title>
328 <text>
329 <table>
330 <tbody>
331 <tr>
332 <th>Type</th>
333 <th>Date</th>
334 <th>Code</th>
335 <th>Description</th>
336 <th>Status</th>
337 <th>Source</th>
338 </tr>
339 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Problems/a:Problem">
340 <tr>
341 <td>
342 <xsl:value-of select="a:Type/a:Text"/>
343 </td>
344 <td>
345 <xsl:call-template name="date:format-date">
346 <xsl:with-param name="date-time">
347 <xsl:value-of select="a:DateTime/a:ExactDateTime"/>
348 </xsl:with-param>
349 </xsl:call-template>
350 </td>
351 <td>
352 <xsl:apply-templates select="a:Description/a:Code"/>
353 </td>
354 <td>
355 <xsl:value-of select="a:Description/a:Text"/>
356 </td>
357 <td>
358 <xsl:value-of select="a:Status/a:Text"/>
359 </td>
360 <td>
361 <xsl:call-template name="actorName">
362 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
363 </xsl:call-template>
364 </td>
365 </tr>
366 </xsl:for-each>
367 </tbody>
368 </table>
369 </text>
370 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Problems/a:Problem">
371 <entry typeCode="DRIV">
372 <act classCode="ACT" moodCode="EVN">
373 <templateId root="2.16.840.1.113883.10.20.1.27"/>
374 <!-- Problem act template -->
375 <id root="6a2fa88d-4174-4909-aece-db44b60a3abb"/>
376 <code nullFlavor="NA"/>
377 <xsl:variable name="SourceActorID" select="a:Source/a:Actor/a:ActorID"/>
378 <performer typeCode="PRF">
379 <assignedEntity>
380 <xsl:variable name="CCRActor" select="//a:ContinuityOfCareRecord/a:Actors[a:ActorObjectID=$SourceActorID]/a:Actor"/>
381 <xsl:if test="$CCRActor/a:Address">
382 <addr>
383 <streetAddressLine>
384 <xsl:value-of select="$CCRActor/a:Address[0]/a:Line1"/>
385 </streetAddressLine>
386 <city>
387 <xsl:value-of select="$CCRActor/a:Address[0]/a:City"/>
388 </city>
389 <state>
390 <xsl:value-of select="$CCRActor/a:Address[0]/a:State"/>
391 </state>
392 <postalcode>
393 <xsl:value-of select="$CCRActor/a:Address[0]/a:PostalCode"/>
394 </postalcode>
395 </addr>
396 </xsl:if>
397 <xsl:if test="$CCRActor/a:Telephone">
398 <xsl:element name="telecom">
399 <xsl:attribute name="extension">
400 <xsl:value-of select="$CCRActor/a:Telephone[0]/a:Value"/>
401 </xsl:attribute>
402 </xsl:element>
403 </xsl:if>
404 <assignedPerson>
405 <name>
406 <xsl:call-template name="actorName">
407 <xsl:with-param name="objID" select="$SourceActorID"/>
408 </xsl:call-template>
409 </name>
410 </assignedPerson>
411 </assignedEntity>
412 </performer>
413 <entryRelationship typeCode="SUBJ">
414 <observation classCode="OBS" moodCode="EVN">
415 <templateId root="2.16.840.1.113883.10.20.1.28" assigningAuthorityName="CCD"/>
416 <!--Problem observation template-->
417 <id root="d11275e7-67ae-11db-bd13-0800200c9a66"/>
418 <code code="64572001" displayName="Condition" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED-CT"/>
419 <text>
420 <xsl:element name="reference">
421 <xsl:attribute name="value">
422 <xsl:value-of select="a:CCRObjectID"/>
423 </xsl:attribute>
424 </xsl:element>
425 </text>
426 <xsl:element name="statusCode">
427 <xsl:attribute name="value">
428 <xsl:value-of select="a:Status/a:Code/a:Value"/>
429 </xsl:attribute>
430 </xsl:element>
431 <xsl:element name="effectiveTime">
432 <xsl:attribute name="value">
433 <xsl:call-template name="date:format-date">
434 <xsl:with-param name="date-time">
435 <xsl:value-of select="a:DateTime[0]/a:ExactDateTime"/>
436 </xsl:with-param>
437 <xsl:with-param name="pattern">yyyyMMddhhmmss+0000</xsl:with-param>
438 </xsl:call-template>
439 </xsl:attribute>
440 </xsl:element>
441 <xsl:element name="value">
442 <xsl:attribute name="displayName">
443 <xsl:value-of select="a:Description/a:Text"/>
444 </xsl:attribute>
445 <xsl:attribute name="code">
446 <xsl:value-of select="a:Description/a:Code/a:Value"/>
447 </xsl:attribute>
448 <xsl:attribute name="codeSystemName">
449 <xsl:value-of select="a:Description/a:Code/a:CodingSystem"/>
450 </xsl:attribute>
451 </xsl:element>
452 </observation>
453 </entryRelationship>
454 </act>
455 </entry>
456 </xsl:for-each>
457 </section>
458 </component>
459 </xsl:if>
460 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Procedures">
461 <component>
462 <section>
463 <templateId root="2.16.840.1.113883.10.20.1.12"/>
464 <code code="47519-4" codeSystem="2.16.840.1.113883.6.1"/>
465 <title>Procedures</title>
466 <text>
467 <table>
468 <tbody>
469 <tr>
470 <th>Type</th>
471 <th>Date</th>
472 <th>Code</th>
473 <th>Description</th>
474 <th>Location</th>
475 <th>Substance</th>
476 <th>Method</th>
477 <th>Position</th>
478 <th>Site</th>
479 <th>Status</th>
480 <th>Source</th>
481 </tr>
482 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
483 <tr>
484 <td>
485 <xsl:value-of select="a:Type/a:Text"/>
486 </td>
487 <td>
488 <xsl:call-template name="date:format-date">
489 <xsl:with-param name="date-time">
490 <xsl:value-of select="a:DateTime/a:ExactDateTime"/>
491 </xsl:with-param>
492 </xsl:call-template>
493 </td>
494 <td>
495 <xsl:apply-templates select="a:Description/a:Code"/>
496 </td>
497 <td>
498 <xsl:value-of select="a:Description/a:Text"/>
499 </td>
500 <td>
501 <xsl:for-each select="a:Locations/a:Location">
502 <xsl:value-of select="a:Description/a:Text"/>
503 <xsl:if test="a:Actor">
504 (<xsl:call-template name="actorName">
505 <xsl:with-param name="objID" select="a:Actor/a:ActorID"/>
506 </xsl:call-template>
507 <xsl:if test="a:Actor/a:ActorRole/a:Text">
508 <xsl:text xml:space="preserve"> - </xsl:text><xsl:value-of select="a:ActorRole/a:Text"/>)
509 </xsl:if>
510 </xsl:if>)
511 <xsl:if test="position() != last()">
512 <br/>
513 </xsl:if>
514 </xsl:for-each>
515 </td>
516 <td>
517 <xsl:for-each select="a:Substance">
518 <xsl:value-of select="a:Text"/>
519 </xsl:for-each>
520 </td>
521 <td>
522 <xsl:value-of select="a:Method/a:Text"/>
523 </td>
524 <td>
525 <xsl:value-of select="a:Position/a:Text"/>
526 </td>
527 <td>
528 <xsl:value-of select="a:Site/a:Text"/>
529 </td>
530 <td>
531 <xsl:value-of select="a:Status/a:Text"/>
532 </td>
533 <td>
534 <xsl:call-template name="actorName">
535 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
536 </xsl:call-template>
537 </td>
538 </tr>
539 </xsl:for-each>
540 </tbody>
541 </table>
542 </text>
543 </section>
544 </component>
545 </xsl:if>
546 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Medications">
547 <component>
548 <section>
549 <templateId root="2.16.840.1.113883.10.20.1.8"/>
550 <code code="10160-0" codeSystem="2.16.840.1.113883.6.1"/>
551 <title>Medications</title>
552 <text>
553 <table>
554 <tbody>
555 <tr>
556 <th>Medication</th>
557 <th>Date</th>
558 <th>Status</th>
559 <th>Form</th>
560 <th>Strength</th>
561 <th>Quantity</th>
562 <th>SIG</th>
563 <th>Indications</th>
564 <th>Instruction</th>
565 <th>Refills</th>
566 <th>Source</th>
567 </tr>
568 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Medications/a:Medication">
569 <tr>
570 <td>
571
572 <xsl:value-of select="a:Product/a:ProductName/a:Text"/>
573 <xsl:if test="a:Product/a:BrandName">
574 <xsl:text xml:space="preserve"> </xsl:text>(<xsl:value-of select="a:Product/a:BrandName/a:Text"/>)
575 </xsl:if>
576
577 </td>
578 <td>
579 <xsl:call-template name="date:format-date">
580 <xsl:with-param name="date-time">
581 <xsl:value-of select="a:DateTime/a:ExactDateTime"/>
582 </xsl:with-param>
583 </xsl:call-template>
584 </td>
585 <td>
586 <xsl:value-of select="a:Status/a:Text"/>
587 </td>
588 <td>
589 <xsl:value-of select="a:Product/a:Form/a:Text"/>
590 </td>
591 <td>
592 <xsl:for-each select="a:Product/a:Strength">
593 <xsl:if test="position() > 1">
594 <xsl:text>/</xsl:text>
595 </xsl:if>
596 <xsl:value-of select="a:Value"/>
597 <xsl:text xml:space="preserve"> </xsl:text>
598 <xsl:value-of select="a:Units/a:Unit"/>
599 </xsl:for-each>
600 </td>
601 <td>
602 <xsl:value-of select="a:Quantity/a:Value"/>
603 <xsl:text xml:space="preserve"> </xsl:text>
604 <xsl:value-of select="a:Quantity/a:Units/a:Unit"/>
605 </td>
606 <td>
607 <xsl:for-each select="a:Directions/a:Direction">
608 <xsl:choose>
609 <xsl:when test="a:Description/a:Text">
610 <xsl:value-of select="a:Description/a:Text"/>
611 </xsl:when>
612 <xsl:otherwise>
613 <xsl:value-of select="a:Dose/a:Value"/>
614 <xsl:text xml:space="preserve"> </xsl:text>
615 <xsl:value-of select="a:Dose/a:Units/a:Unit"/>
616 <xsl:text xml:space="preserve"> </xsl:text>
617 <xsl:value-of select="a:Route/a:Text"/>
618 <xsl:text xml:space="preserve"> </xsl:text>
619 <xsl:value-of select="a:Frequency/a:Value"/>
620 <xsl:if test="a:Duration">
621 <xsl:text xml:space="preserve">( </xsl:text>for <xsl:value-of select="a:Duration/a:Value"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Duration/a:Units/a:Unit"/><xsl:text xml:space="preserve"> )</xsl:text>
622 </xsl:if>
623 <xsl:if test="a:MultipleDirectionModifier/a:ObjectAttribute">
624 <xsl:for-each select="a:MultipleDirectionModifier/a:ObjectAttribute">
625 <xsl:value-of select="a:Attribute"/>
626 <br/>
627 <xsl:value-of select="a:AttributeValue/a:Value"/>
628 </xsl:for-each>
629 </xsl:if>
630 </xsl:otherwise>
631 </xsl:choose>
632 </xsl:for-each>
633 </td>
634 <td>
635 <xsl:for-each select="a:Directions/a:Direction[1]/a:Indication">
636 <xsl:call-template name="problemDescription">
637 <xsl:with-param name="objID" select="a:InternalCCRLink/a:LinkID"/>
638 </xsl:call-template>
639 <br/>
640 </xsl:for-each>
641 </td>
642 <td>
643 <xsl:for-each select="a:PatientInstructions/a:Instruction">
644 <xsl:value-of select="a:Text"/>
645 <br/>
646 </xsl:for-each>
647 </td>
648 <td>
649 <xsl:for-each select="a:Refills/a:Refill">
650 <xsl:value-of select="a:Number"/>
651 <xsl:text xml:space="preserve"> </xsl:text>
652 </xsl:for-each>
653 </td>
654 <td>
655 <xsl:call-template name="actorName">
656 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
657 </xsl:call-template>
658 </td>
659 </tr>
660 </xsl:for-each>
661 </tbody>
662 </table>
663 </text>
664 </section>
665 </component>
666 </xsl:if>
667 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Immunizations">
668 <component>
669 <section>
670 <templateId root="2.16.840.1.113883.10.20.1.6"/>
671 <code code="11369-6" codeSystem="2.16.840.1.113883.6.1"/>
672 <title>Immunizations</title>
673 <text>
674 <table>
675 <tbody>
676 <tr>
677 <th>Code</th>
678 <th>Vaccine</th>
679 <th>Date</th>
680 <th>Route</th>
681 <th>Site</th>
682 <th>Source</th>
683 </tr>
684 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Immunizations/a:Immunization">
685 <tr>
686 <td>
687 <xsl:apply-templates select="a:Product/a:ProductName/a:Code"/>
688 </td>
689 <td>
690
691 <xsl:value-of select="a:Product/a:ProductName/a:Text"/>
692 <xsl:if test="a:Product/a:Form">
693 <xsl:text xml:space="preserve"> </xsl:text>(<xsl:value-of select="a:Product/a:Form/a:Text"/>)
694 </xsl:if>
695 </td>
696 <td>
697 <xsl:call-template name="date:format-date">
698 <xsl:with-param name="date-time">
699 <xsl:value-of select="a:DateTime/a:ExactDateTime"/>
700 </xsl:with-param>
701 </xsl:call-template>
702 </td>
703 <td>
704 <xsl:value-of select="a:Directions/a:Direction/a:Route/a:Text"/>
705 </td>
706 <td>
707 <xsl:value-of select="a:Directions/a:Direction/a:Site/a:Text"/>
708 </td>
709 <td>
710 <xsl:call-template name="actorName">
711 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
712 </xsl:call-template>
713 </td>
714 </tr>
715 </xsl:for-each>
716 </tbody>
717 </table>
718 </text>
719 </section>
720 </component>
721 </xsl:if>
722 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:VitalSigns">
723 <component>
724 <section>
725 <templateId root="2.16.840.1.113883.10.20.1.16"/>
726 <code code="8716-3" codeSystem="2.16.840.1.113883.6.1"/>
727 <title>Vital Signs</title>
728 <text>
729 <table>
730 <tbody>
731 <tr>
732 <th>Vital Sign</th>
733 <th>Date</th>
734 <th>Result</th>
735 <th>Source</th>
736 </tr>
737 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:VitalSigns/a:Result">
738 <tr>
739 <td>
740 <xsl:value-of select="a:Description/a:Text"/>
741 </td>
742 <td>
743 <xsl:call-template name="date:format-date">
744 <xsl:with-param name="date-time">
745 <xsl:value-of select="a:DateTime/a:ExactDateTime"/>
746 </xsl:with-param>
747 </xsl:call-template>
748 </td>
749 <td>
750 <xsl:for-each select="a:Test">
751 <xsl:value-of select="a:Description/a:Text"/>
752 <xsl:text xml:space="preserve"> </xsl:text>
753 <xsl:value-of select="a:TestResult/a:Value"/>
754 <xsl:text xml:space="preserve"> </xsl:text>
755 <xsl:value-of select="a:TestResult/a:Units/a:Unit"/>
756 <xsl:text xml:space="preserve"> </xsl:text>
757 <xsl:value-of select="a:Flag/a:Text"/>
758 <br/>
759 </xsl:for-each>
760 </td>
761 <td>
762 <xsl:call-template name="actorName">
763 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
764 </xsl:call-template>
765 </td>
766 </tr>
767 </xsl:for-each>
768 </tbody>
769 </table>
770 </text>
771 </section>
772 </component>
773 </xsl:if>
774 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Encounters">
775 <component>
776 <section>
777 <templateId root="2.16.840.1.113883.10.20.1.3"/>
778 <code code="46240-8" codeSystem="2.16.840.1.113883.6.1"/>
779 <title>Encounters</title>
780 <text>
781 <table>
782 <tbody>
783 <tr>
784 <th>Type</th>
785 <th>Date</th>
786 <th>Location</th>
787 <th>Status</th>
788 <th>Practitioner</th>
789 <th>Description</th>
790 <th>Indications</th>
791 <th>Source</th>
792 </tr>
793 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Encounters/a:Encounter">
794 <tr>
795 <td>
796 <xsl:value-of select="a:Type/a:Text"/>
797 </td>
798 <td>
799 <xsl:call-template name="date:format-date">
800 <xsl:with-param name="date-time">
801 <xsl:value-of select="a:DateTime/a:ExactDateTime"/>
802 </xsl:with-param>
803 </xsl:call-template>
804 </td>
805 <td>
806 <xsl:for-each select="a:Locations/a:Location">
807 <xsl:value-of select="a:Description/a:Text"/>
808 <xsl:call-template name="actorName">
809 <xsl:with-param name="objID" select="a:Actor/a:ActorID"/>
810 </xsl:call-template>
811 <br/>
812 </xsl:for-each>
813 </td>
814 <td>
815 <xsl:value-of select="a:Status/a:Text"/>
816 </td>
817 <td>
818 <xsl:for-each select="a:Practitioners/a:Practitioner">
819 <xsl:call-template name="actorName">
820 <xsl:with-param name="objID" select="a:ActorID"/>
821 </xsl:call-template>
822 <br/>
823 </xsl:for-each>
824 </td>
825 <td>
826 <xsl:value-of select="a:Description/a:Text"/>
827 </td>
828 <td>
829 <xsl:for-each select="a:Indications/a:Indication">
830 <xsl:call-template name="problemDescription">
831 <xsl:with-param name="objID" select="a:InternalCCRLink/a:LinkID"/>
832 </xsl:call-template>
833 <br/>
834 </xsl:for-each>
835 </td>
836 <td>
837 <xsl:call-template name="actorName">
838 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
839 </xsl:call-template>
840 </td>
841 </tr>
842 </xsl:for-each>
843 </tbody>
844 </table>
845 </text>
846 </section>
847 </component>
848 </xsl:if>
849 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:SocialHistory">
850 <component>
851 <section>
852 <templateId root="2.16.840.1.113883.10.20.1.15"/>
853 <code code="29762-2" codeSystem="2.16.840.1.113883.6.1"/>
854 <title>Social History</title>
855 <text>
856 <table>
857 <tbody>
858 <tr>
859 <th>Type</th>
860 <th>Date</th>
861 <th>Code</th>
862 <th>Description</th>
863 <th>Status</th>
864 <th>Source</th>
865 </tr>
866 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement">
867 <tr>
868 <td>
869 <xsl:value-of select="a:Type/a:Text"/>
870 </td>
871 <td>
872 <xsl:call-template name="date:format-date">
873 <xsl:with-param name="date-time">
874 <xsl:value-of select="a:DateTime/a:ExactDateTime"/>
875 </xsl:with-param>
876 </xsl:call-template>
877 </td>
878 <td>
879 <xsl:apply-templates select="a:Description/a:Code"/>
880 </td>
881 <td>
882 <xsl:value-of select="a:Description/a:Text" disable-output-escaping="yes"/>
883 </td>
884 <td>
885 <xsl:value-of select="a:Status/a:Text"/>
886 </td>
887 <td>
888 <xsl:call-template name="actorName">
889 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
890 </xsl:call-template>
891 </td>
892 </tr>
893 </xsl:for-each>
894 </tbody>
895 </table>
896 </text>
897 </section>
898 </component>
899 </xsl:if>
900 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:FamilyHistory">
901 <component>
902 <section>
903 <templateId root="2.16.840.1.113883.10.20.1.4"/>
904 <code code="10157-6" codeSystem="2.16.840.1.113883.6.1"/>
905 <title>Family History</title>
906 <text>
907 <table>
908 <tbody>
909 <tr>
910 <th>Type</th>
911 <th>Date</th>
912 <th>Code</th>
913 <th>Description</th>
914 <th>Relationship(s)</th>
915 <th>Status</th>
916 <th>Source</th>
917 </tr>
918 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:FamilyHistory/a:FamilyProblemHistory">
919 <tr>
920 <td>
921 <xsl:value-of select="a:Type/a:Text"/>
922 </td>
923 <td>
924 <xsl:call-template name="date:format-date">
925 <xsl:with-param name="date-time">
926 <xsl:value-of select="a:DateTime/a:ExactDateTime"/>
927 </xsl:with-param>
928 </xsl:call-template>
929 </td>
930 <td>
931 <xsl:apply-templates select="a:Problem/a:Description/a:Code"/>
932 </td>
933 <td>
934 <xsl:for-each select="a:Problem">
935 <xsl:value-of select="a:Description/a:Text"/>
936 <br/>
937 </xsl:for-each>
938 </td>
939 <td>
940 <xsl:value-of select="a:FamilyMember/a:ActorRole/a:Text"/>
941 </td>
942 <td>
943 <xsl:value-of select="a:Status/a:Text"/>
944 </td>
945 <td>
946 <xsl:call-template name="actorName">
947 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
948 </xsl:call-template>
949 </td>
950 </tr>
951 </xsl:for-each>
952 </tbody>
953 </table>
954 </text>
955 </section>
956 </component>
957 </xsl:if>
958 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Results/a:Result">
959 <component>
960 <section>
961 <templateId root="2.16.840.1.113883.10.20.1.14"/>
962 <code code="30954-2" codeSystem="2.16.840.1.113883.6.1"/>
963 <title>Results</title>
964 <text>
965 <table>
966 <tbody>
967 <tr>
968 <th>Test</th>
969 <th>Date</th>
970 <th>Result</th>
971 <th>Source</th>
972 </tr>
973 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Results/a:Result[a:Test/a:TestResult/a:Value!='']">
974 <tr>
975 <td>
976 <xsl:value-of select="a:Description/a:Text"/>
977 </td>
978 <td>
979 <xsl:call-template name="date:format-date">
980 <xsl:with-param name="date-time">
981 <xsl:value-of select="a:DateTime/a:ExactDateTime"/>
982 </xsl:with-param>
983 </xsl:call-template>
984 </td>
985 <td>
986 <xsl:for-each select="a:Test[a:TestResult/a:Value!='']">
987 <xsl:value-of select="a:Description/a:Text"/>
988 <xsl:text xml:space="preserve"> </xsl:text>
989 <xsl:value-of select="a:TestResult/a:Value"/>
990 <xsl:text xml:space="preserve"> </xsl:text>
991 <xsl:value-of select="a:TestResult/a:Units/a:Unit"/>
992 <xsl:text xml:space="preserve"> </xsl:text>
993 <xsl:value-of select="a:Flag/a:Text"/>
994 <br/>
995 </xsl:for-each>
996 <xsl:for-each select="a:Test[a:TestResult/a:Description/a:Text!='']">
997 <xsl:value-of select="a:Description/a:Text"/>
998 <xsl:text xml:space="preserve"> </xsl:text>
999 <xsl:value-of select="a:TestResult/a:Description/a:Text" disable-output-escaping="yes"/>
1000 <xsl:text xml:space="preserve"> </xsl:text>
1001 <xsl:value-of select="a:Flag/a:Text"/>
1002 <br/>
1003 </xsl:for-each>
1004 </td>
1005 <td>
1006 <xsl:call-template name="actorName">
1007 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1008 </xsl:call-template>
1009 </td>
1010 </tr>
1011 </xsl:for-each>
1012 </tbody>
1013 </table>
1014 </text>
1015 </section>
1016 </component>
1017 </xsl:if>
1018 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Payers">
1019 <component>
1020 <section>
1021 <templateId root="2.16.840.1.113883.10.20.1.9"/>
1022 <code code="48768-6" codeSystem="2.16.840.1.113883.6.1"/>
1023 <title>Insurance</title>
1024 <text>
1025 <table>
1026 <tbody>
1027 <tr>
1028 <th>Type</th>
1029 <th>Date</th>
1030 <th>Identification Numbers</th>
1031 <th>Payment Provider</th>
1032 <th>Subscriber</th>
1033 <th>Source</th>
1034 </tr>
1035 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Payers/a:Payer">
1036 <tr>
1037 <td>
1038 <xsl:value-of select="a:Type/a:Text"/>
1039 </td>
1040 <td>
1041 <xsl:call-template name="date:format-date">
1042 <xsl:with-param name="date-time">
1043 <xsl:value-of select="a:DateTime/a:ExactDateTime"/>
1044 </xsl:with-param>
1045 </xsl:call-template>
1046 </td>
1047 <td>
1048 <xsl:for-each select="a:IDs">
1049 <xsl:value-of select="a:Type/a:Text"/>:<xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:ID"/><br/>
1050 </xsl:for-each>
1051 </td>
1052 <td>
1053 <xsl:call-template name="actorName">
1054 <xsl:with-param name="objID" select="a:PaymentProvider/a:ActorID"/>
1055 </xsl:call-template>
1056 </td>
1057 <td>
1058 <xsl:call-template name="actorName">
1059 <xsl:with-param name="objID" select="a:Subscriber/a:ActorID"/>
1060 </xsl:call-template>
1061 </td>
1062 <td>
1063 <xsl:call-template name="actorName">
1064 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1065 </xsl:call-template>
1066 </td>
1067 </tr>
1068 </xsl:for-each>
1069 </tbody>
1070 </table>
1071 </text>
1072 </section>
1073 </component>
1074 </xsl:if>
1075 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:PlanOfCare">
1076 <component>
1077 <section>
1078 <templateId root="2.16.840.1.113883.10.20.1.10"/>
1079 <code code="18776-5" codeSystem="2.16.840.1.113883.6.1"/>
1080 <title>Plan Of Care</title>
1081 <text>
1082 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Treatment Recommendation']">
1083 <xsl:text>Plan Of Care Recommendations</xsl:text>
1084 <br/>
1085 <table>
1086 <tbody>
1087 <tr>
1088 <th>Description</th>
1089 <th>Recommendation</th>
1090 <th>Goal</th>
1091 <th>Status</th>
1092 <th>Source</th>
1093 </tr>
1094 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Treatment Recommendation']">
1095 <tr>
1096 <td>
1097 <xsl:value-of select="a:Description/a:Text"/>
1098 </td>
1099 <td>
1100 <xsl:value-of select="a:OrderRequest/a:Description/a:Text" disable-output-escaping="yes"/>
1101 </td>
1102 <td>
1103 <xsl:value-of select="a:OrderRequest/a:Goals/a:Goal/a:Description/a:Text" disable-output-escaping="yes"/>
1104 </td>
1105 <td>
1106 <xsl:value-of select="a:Status/a:Text"/>
1107 </td>
1108 <td>
1109 <xsl:call-template name="actorName">
1110 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1111 </xsl:call-template>
1112 </td>
1113 </tr>
1114 </xsl:for-each>
1115 </tbody>
1116 </table>
1117 </xsl:if>
1118 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Order']">
1119 <xsl:text>Plan Of Care Orders</xsl:text>
1120 <br/>
1121 <table>
1122 <tbody>
1123 <tr>
1124 <th>Descripion</th>
1125 <th>Plan Status</th>
1126 <th>Type</th>
1127 <th>Date</th>
1128 <th>Procedure</th>
1129 <th>Schedule</th>
1130 <th>Location</th>
1131 <th>Substance</th>
1132 <th>Method</th>
1133 <th>Position</th>
1134 <th>Site</th>
1135 <th>Status</th>
1136 <th>Source</th>
1137 </tr>
1138 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Order']">
1139 <tr>
1140 <td>
1141 <xsl:apply-templates select="a:Description/a:Text"/>
1142 </td>
1143 <td>
1144 <xsl:value-of select="a:Status/a:Text"/>
1145 </td>
1146 <td>
1147 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Type/a:Text"/>
1148 </td>
1149 <td>
1150 <xsl:call-template name="date:format-date">
1151 <xsl:with-param name="date-time">
1152 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:DateTime/a:ExactDateTime"/>
1153 </xsl:with-param>
1154 </xsl:call-template>
1155 </td>
1156 <td>
1157 <xsl:apply-templates select="a:OrderRequest/a:Procedures/a:Procedure/a:Description/a:Text"/>
1158 </td>
1159 <td>
1160 <xsl:text xml:space="preserve">Every </xsl:text>
1161 <xsl:apply-templates select="a:OrderRequest/a:Procedures/a:Procedure/a:Interval/a:Value"/>
1162 <xsl:text xml:space="preserve"> </xsl:text>
1163 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Interval/a:Units/a:Unit"/>
1164 <xsl:text xml:space="preserve"> for </xsl:text>
1165 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Duration/a:Value"/>
1166 <xsl:text xml:space="preserve"> </xsl:text>
1167 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Duration/a:Units/a:Unit"/>
1168 </td>
1169 <td>
1170 <xsl:for-each select="a:OrderRequest/a:Procedures/a:Procedure/a:Locations">
1171 <xsl:value-of select="a:Location/a:Description/a:Text"/>
1172 <xsl:if test="position() != last()">
1173 <br/>
1174 </xsl:if>
1175 </xsl:for-each>
1176 </td>
1177 <td>
1178 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Substance/a:Text"/>
1179 </td>
1180 <td>
1181 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Method/a:Text"/>
1182 </td>
1183 <td>
1184 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Position/a:Text"/>
1185 </td>
1186 <td>
1187 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Site/a:Text"/>
1188 </td>
1189 <td/>
1190 <td>
1191 <xsl:call-template name="actorName">
1192 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1193 </xsl:call-template>
1194 </td>
1195 </tr>
1196 </xsl:for-each>
1197 </tbody>
1198 </table>
1199 </xsl:if>
1200 </text>
1201 </section>
1202 </component>
1203 </xsl:if>
1204 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:HealthCareProviders">
1205 <component>
1206 <section>
1207 <title>Health Care Providers</title>
1208 <text>
1209 <table>
1210 <tbody>
1211 <tr>
1212 <th>Role</th>
1213 <th>Name</th>
1214 </tr>
1215 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:HealthCareProviders/a:Provider">
1216 <tr>
1217 <td>
1218 <xsl:value-of select="a:ActorRole/a:Text"/>
1219 </td>
1220 <td>
1221 <xsl:call-template name="actorName">
1222 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1223 </xsl:call-template>
1224 </td>
1225 </tr>
1226 </xsl:for-each>
1227 </tbody>
1228 </table>
1229 </text>
1230 </section>
1231 </component>
1232 </xsl:if>
1233 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:SupportProviders">
1234 <component>
1235 <section>
1236 <title>Support Providers</title>
1237 <text>
1238 <table>
1239 <tbody>
1240 <tr>
1241 <th>Role</th>
1242 <th>Name</th>
1243 </tr>
1244 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Support/a:SupportProvider">
1245 <tr>
1246 <td>
1247 <xsl:value-of select="a:ActorRole/a:Text"/>
1248 </td>
1249 <td>
1250 <xsl:call-template name="actorName">
1251 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1252 </xsl:call-template>
1253 </td>
1254 </tr>
1255 </xsl:for-each>
1256 </tbody>
1257 </table>
1258 </text>
1259 </section>
1260 </component>
1261 </xsl:if>
1262 <xsl:if test="a:ContinuityOfCareRecord/a:References">
1263 <component>
1264 <section>
1265 <title>References</title>
1266 <text>
1267 <table>
1268 <tbody>
1269 <tr>
1270 <th>Type</th>
1271 <th>Date</th>
1272 <th>Description</th>
1273 <th>Location</th>
1274 <th>Source</th>
1275 </tr>
1276 <xsl:for-each select="a:ContinuityOfCareRecord/a:References/a:Reference">
1277 <tr>
1278 <td>
1279 <xsl:value-of select="a:Type/a:Text"/>
1280 </td>
1281 <td>
1282 <xsl:call-template name="date:format-date">
1283 <xsl:with-param name="date-time">
1284 <xsl:value-of select="a:DateTime/a:ExactDateTime"/>
1285 </xsl:with-param>
1286 </xsl:call-template>
1287 </td>
1288 <td>
1289 <strong class="clinical">
1290 <xsl:value-of select="a:Description/a:Text"/>
1291 </strong>
1292 </td>
1293 <td>
1294 <xsl:value-of select="a:Locations/a:Location/a:Description/a:Text"/>
1295 </td>
1296 <td>
1297 <xsl:call-template name="actorName">
1298 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1299 </xsl:call-template>
1300 </td>
1301 </tr>
1302 </xsl:for-each>
1303 </tbody>
1304 </table>
1305 </text>
1306 </section>
1307 </component>
1308 </xsl:if>
1309 <component>
1310 <section>
1311 <title>Additional Information About People &amp; Organizations</title>
1312 <text>
1313 <xsl:if test="a:ContinuityOfCareRecord/a:Actors/a:Actor[a:Person]">
1314 <table>
1315 <tbody>
1316 <tr>
1317 <th>Name</th>
1318 <th>Specialty</th>
1319 <th>Relation</th>
1320 <th>Identification Numbers</th>
1321 <th>Phone</th>
1322 <th>Address/ E-mail</th>
1323 </tr>
1324 <xsl:for-each select="a:ContinuityOfCareRecord/a:Actors/a:Actor">
1325 <xsl:sort select="a:Person/a:Name/a:DisplayName|a:Person/a:Name/a:CurrentName/a:Family" data-type="text" order="ascending"/>
1326 <xsl:if test="a:Person">
1327 <tr>
1328 <td>
1329 <xsl:call-template name="actorName">
1330 <xsl:with-param name="objID" select="a:ActorObjectID"/>
1331 </xsl:call-template>
1332 </td>
1333 <td>
1334 <xsl:value-of select="a:Specialty/a:Text"/>
1335 </td>
1336 <td>
1337 <xsl:value-of select="a:Relation/a:Text"/>
1338 </td>
1339 <td>
1340 <xsl:for-each select="a:IDs">
1341 <xsl:value-of select="a:Type/a:Text"/>
1342 <xsl:text>: </xsl:text>
1343 <xsl:value-of select="a:ID"/>
1344 </xsl:for-each>
1345 </td>
1346 <td>
1347 <xsl:for-each select="a:Telephone">
1348 <xsl:value-of select="a:Type/a:Text"/>
1349 <xsl:text>: </xsl:text>
1350 <xsl:value-of select="a:Value"/>
1351 </xsl:for-each>
1352 </td>
1353 <td>
1354 <xsl:for-each select="a:Address">
1355 <xsl:if test="a:Type">
1356 <xsl:value-of select="a:Type/a:Text"/>
1357 <xsl:text>:</xsl:text>
1358 <br/>
1359 </xsl:if>
1360 <xsl:if test="a:Line1">
1361 <xsl:value-of select="a:Line1"/>
1362 <br/>
1363 </xsl:if>
1364 <xsl:if test="a:Line2">
1365 <xsl:value-of select="a:Line2"/>
1366 <br/>
1367 </xsl:if>
1368 <xsl:if test="a:City">
1369 <xsl:value-of select="a:City"/>,
1370 </xsl:if>
1371 <xsl:value-of select="a:State"/>
1372 <xsl:value-of select="a:PostalCode"/>
1373 <br/>
1374 </xsl:for-each>
1375 <xsl:for-each select="a:EMail">
1376 <br/>
1377 <xsl:value-of select="a:Value"/>
1378 </xsl:for-each>
1379 </td>
1380 </tr>
1381 </xsl:if>
1382 </xsl:for-each>
1383 </tbody>
1384 </table>
1385 </xsl:if>
1386 <xsl:if test="a:ContinuityOfCareRecord/a:Actors/a:Actor[a:Organization]">
1387 <table>
1388 <tbody>
1389 <tr>
1390 <th>Name</th>
1391 <th>Specialty</th>
1392 <th>Relation</th>
1393 <th>Identification Numbers</th>
1394 <th>Phone</th>
1395 <th>Address/ E-mail</th>
1396 </tr>
1397 <xsl:for-each select="a:ContinuityOfCareRecord/a:Actors/a:Actor">
1398 <xsl:sort select="a:Organization/a:Name" data-type="text" order="ascending"/>
1399 <xsl:if test="a:Organization">
1400 <tr>
1401 <td>
1402 <xsl:value-of select="a:Organization/a:Name"/>
1403 </td>
1404 <td>
1405 <xsl:value-of select="a:Specialty/a:Text"/>
1406 </td>
1407 <td>
1408 <xsl:value-of select="a:Relation/a:Text"/>
1409 </td>
1410 <td>
1411 <xsl:for-each select="a:IDs">
1412 <xsl:value-of select="a:Type/a:Text"/>
1413 <xsl:text>: </xsl:text>
1414 <xsl:value-of select="a:ID"/>
1415 </xsl:for-each>
1416 </td>
1417 <td>
1418 <xsl:for-each select="a:Telephone">
1419 <xsl:value-of select="a:Type/a:Text"/>
1420 <xsl:text>: </xsl:text>
1421 <xsl:value-of select="a:Value"/>
1422 </xsl:for-each>
1423 </td>
1424 <td>
1425 <xsl:for-each select="a:Address">
1426 <xsl:if test="a:Type">
1427 <xsl:value-of select="a:Type/a:Text"/>
1428 <xsl:text>:</xsl:text>
1429 <br/>
1430 </xsl:if>
1431 <xsl:if test="a:Line1">
1432 <xsl:value-of select="a:Line1"/>
1433 <br/>
1434 </xsl:if>
1435 <xsl:if test="a:Line2">
1436 <xsl:value-of select="a:Line2"/>
1437 <br/>
1438 </xsl:if>
1439 <xsl:if test="a:City">
1440 <xsl:value-of select="a:City"/>,
1441 </xsl:if>
1442 <xsl:value-of select="a:State"/>
1443 <xsl:value-of select="a:PostalCode"/>
1444 <br/>
1445 </xsl:for-each>
1446 <xsl:for-each select="a:EMail">
1447 <br/>
1448 <xsl:value-of select="a:Value"/>
1449 </xsl:for-each>
1450 </td>
1451 </tr>
1452 </xsl:if>
1453 </xsl:for-each>
1454 </tbody>
1455 </table>
1456 </xsl:if>
1457 <xsl:if test="a:ContinuityOfCareRecord/a:Actors/a:Actor[a:InformationSystem]">
1458 <table>
1459 <tbody>
1460 <tr>
1461 <th>Name</th>
1462 <th>Type</th>
1463 <th>Version</th>
1464 <th>Identification Numbers</th>
1465 <th>Phone</th>
1466 <th>Address/ E-mail</th>
1467 </tr>
1468 <xsl:for-each select="a:ContinuityOfCareRecord/a:Actors/a:Actor">
1469 <xsl:sort select="a:InformationSystem/a:Name" data-type="text" order="ascending"/>
1470 <xsl:if test="a:InformationSystem">
1471 <tr>
1472 <td>
1473 <xsl:value-of select="a:InformationSystem/a:Name"/>
1474 </td>
1475 <td>
1476 <xsl:value-of select="a:InformationSystem/a:Type"/>
1477 </td>
1478 <td>
1479 <xsl:value-of select="a:InformationSystem/a:Version"/>
1480 </td>
1481 <td>
1482 <xsl:for-each select="a:IDs">
1483 <xsl:value-of select="a:Type/a:Text"/>
1484 <xsl:text>: </xsl:text>
1485 <xsl:value-of select="a:ID"/>
1486 </xsl:for-each>
1487 </td>
1488 <td>
1489 <xsl:for-each select="a:Telephone">
1490 <xsl:value-of select="a:Type/a:Text"/>
1491 <xsl:text>: </xsl:text>
1492 <xsl:value-of select="a:Value"/>
1493 </xsl:for-each>
1494 </td>
1495 <td>
1496 <xsl:for-each select="a:Address">
1497 <xsl:if test="Type">
1498 <xsl:value-of select="a:Type/a:Text"/>
1499 <xsl:text>:</xsl:text>
1500 <br/>
1501 </xsl:if>
1502 <xsl:if test="a:Line1">
1503 <xsl:value-of select="a:Line1"/>
1504 <br/>
1505 </xsl:if>
1506 <xsl:if test="a:Line2">
1507 <xsl:value-of select="a:Line2"/>
1508 <br/>
1509 </xsl:if>
1510 <xsl:if test="a:City">
1511 <xsl:value-of select="a:City"/>,
1512 </xsl:if>
1513 <xsl:value-of select="a:State"/>
1514 <xsl:value-of select="a:PostalCode"/>
1515 <br/>
1516 </xsl:for-each>
1517 <xsl:for-each select="a:EMail">
1518 <br/>
1519 <xsl:value-of select="a:Value"/>
1520 </xsl:for-each>
1521 </td>
1522 </tr>
1523 </xsl:if>
1524 </xsl:for-each>
1525 </tbody>
1526 </table>
1527 </xsl:if>
1528 </text>
1529 </section>
1530 </component>
1531 </structuredBody>
1532 </component>
1533 </ClinicalDocument>
1534 </xsl:template>
1535</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.