source: ccr/trunk/p/ccr.xsl@ 760

Last change on this file since 760 was 207, checked in by George Lilly, 16 years ago

modified ccr.xsl to build better SIG for Meds

File size: 140.5 KB
RevLine 
[207]1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3
4 Copyright 2007 American Academy of Family Physicians
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software distributed
13 under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
14 CONDITIONS OF ANY KIND, either express or implied. See the License for the
15 specific language governing permissions and limitations under the License.
16
17This XSLT creates a simple HTML representation of the ASTM Continuity of Care Record.
18This representation does not present all the potential data storable in the CCR.
19Instead it gives a potential clinical representation of the CCR instance. There is
20the potential for important information in a CCR to not be displayed in the resulting
21HTML.
22
23Derived works MUST change the footer.xsl template to denote that the resulting HTML
24is a derived work from the AAFP's XSLT or remove the display of the "American Academy
25of Family Physicians" name.
26
27
28Although not required, it is encouraged to submit modifications or improvements to
29this XSLT back to the community.
30
31 Author: Steven E. Waldren, MD
32 American Academy of Family Physicians
33 swaldren@aafp.org
34
35 Coauthors: Ken Miller Simon Sadedin
36 Solventus Medcommons
37
38 Date: 2007-06-01
39 Version: 2.0
40
41 -->
42 <xsl:stylesheet exclude-result-prefixes="a date str" version="1.0" xmlns:a="urn:astm-org:CCR" xmlns:date="http://exslt.org/dates-and-times" xmlns:str="http://exslt.org/strings" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
43 <xsl:output encoding="UTF-8" method="html"/>
44 <!-- XSL Parameters -->
45 <!-- This param can be used to define different CCS style sheets
46 If not passed, the default will be used -->
47 <xsl:param name="stylesheet"/>
48 <xsl:template match="/">
49 <html>
50 <head>
51 <!-- Load in the CSS file -->
52 <xsl:choose>
53 <xsl:when test="$stylesheet!=''">
54 <link href="{$stylesheet}" rel="stylesheet" type="text/css"/>
55 </xsl:when>
56 <xsl:otherwise>
57 <xsl:call-template name="defaultCCS"/>
58 <!-- call to ./templates/defaultCCS.xsl-->
59 </xsl:otherwise>
60 </xsl:choose>
61 <title>Continuity of Care Record</title>
62 </head>
63 <body>
64 <table cellPadding="1" cellSpacing="1">
65 <tbody>
66 <tr>
67 <td>
68 <table cellPadding="1" cellSpacing="1">
69 <tbody>
70 <tr id="ccrheaderrow">
71 <td>
72 <h1>Continuity of Care Record
73 <br/>
74 </h1>
75 <table bgColor="#ffffcc" cellPadding="1" cellSpacing="3" id="ccrheader" width="75%">
76 <tbody>
77 <tr>
78 <td>
79 <strong>Date Created:</strong>
80 </td>
81 <td>
82 <xsl:call-template name="date:format-date">
83 <xsl:with-param name="date-time">
84 <xsl:value-of select="a:ContinuityOfCareRecord/a:DateTime/a:ExactDateTime"/>
85 </xsl:with-param>
86 <xsl:with-param name="pattern">EEE MMM dd, yyyy 'at' hh:mm aa zzz</xsl:with-param>
87 </xsl:call-template>
88 </td>
89 </tr>
90 <tr>
91 <td>
92 <strong>From:</strong>
93 </td>
94 <td>
95 <xsl:for-each select="a:ContinuityOfCareRecord/a:From/a:ActorLink">
96 <xsl:call-template name="actorName">
97 <xsl:with-param name="objID" select="a:ActorID"/>
98 </xsl:call-template>
99 <xsl:if test="a:ActorRole/a:Text">
100 <xsl:text xml:space="preserve"> (</xsl:text>
101 <xsl:value-of select="a:ActorRole/a:Text"/>
102 <xsl:text>)</xsl:text>
103 </xsl:if>
104 <br/>
105 </xsl:for-each>
106 </td>
107 </tr>
108 <tr>
109 <td>
110 <strong>To:</strong>
111 </td>
112 <td>
113 <xsl:for-each select="a:ContinuityOfCareRecord/a:To/a:ActorLink">
114 <xsl:call-template name="actorName">
115 <xsl:with-param name="objID" select="a:ActorID"/>
116 </xsl:call-template>
117 <xsl:if test="a:ActorRole/a:Text">
118 <xsl:text xml:space="preserve"> (</xsl:text>
119 <xsl:value-of select="a:ActorRole/a:Text"/>
120 <xsl:text>)</xsl:text>
121 </xsl:if>
122 <br/>
123 </xsl:for-each>
124 </td>
125 </tr>
126 <tr>
127 <td>
128 <strong>Purpose:</strong>
129 </td>
130 <td>
131 <xsl:value-of select="a:ContinuityOfCareRecord/a:Purpose/a:Description/a:Text"/>
132 </td>
133 </tr>
134 </tbody>
135 </table>
136 <br/>
137 </td>
138 </tr>
139 <tr id="demographicsrow">
140 <td>
141 <span class="header">Patient Demographics</span>
142 <br/>
143 <table class="list" id="demographics">
144 <tbody>
145 <tr>
146 <th>Name</th>
147 <th>Date of Birth</th>
148 <th>Gender</th>
149 <th>Identification Numbers</th>
150 <th>Address / Phone</th>
151 </tr>
152 <xsl:for-each select="a:ContinuityOfCareRecord/a:Patient">
153 <xsl:variable name="objID" select="a:ActorID"/>
154 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Actors/a:Actor">
155 <xsl:variable name="thisObjID" select="a:ActorObjectID"/>
156 <xsl:if test="$objID = $thisObjID">
157 <tr>
158 <td>
159 <xsl:call-template name="actorName">
160 <xsl:with-param name="objID">
161 <xsl:value-of select="$thisObjID"/>
162 </xsl:with-param>
163 </xsl:call-template>
164 <br/>
165 </td>
166 <td>
167 <table class="internal">
168 <tbody>
169 <xsl:call-template name="dateTime">
170 <xsl:with-param name="dt" select="a:Person/a:DateOfBirth"/>
171 </xsl:call-template>
172 </tbody>
173 </table>
174 </td>
175 <td>
176 <xsl:value-of select="a:Person/a:Gender/a:Text"/>
177 </td>
178 <td>
179 <table class="internal">
180 <tbody>
181 <xsl:for-each select="a:IDs">
182 <tr>
183 <td width="50%">
184 <xsl:value-of select="a:Type/a:Text"/>
185 </td>
186 <td width="50%">
187 <xsl:value-of select="a:ID"/>
188 </td>
189 </tr>
190 </xsl:for-each>
191 </tbody>
192 </table>
193 </td>
194 <td>
195 <xsl:for-each select="a:Address">
196 <xsl:if test="a:Type">
197 <b>
198 <xsl:value-of select="a:Type/a:Text"/>:</b>
199 <br/>
200 </xsl:if>
201 <xsl:if test="a:Line1">
202 <xsl:value-of select="a:Line1"/>
203 <br/>
204 </xsl:if>
205 <xsl:if test="a:Line2">
206 <xsl:value-of select="a:Line2"/>
207 <br/>
208 </xsl:if>
209 <xsl:if test="a:City">
210 <xsl:value-of select="a:City"/>,
211 </xsl:if>
212 <xsl:value-of select="a:State"/>
213 <xsl:value-of select="a:PostalCode"/>
214 <br/>
215 </xsl:for-each>
216 <xsl:for-each select="a:Telephone">
217 <br/>
218 <xsl:if test="a:Type/a:Text">
219 <xsl:value-of select="a:Type/a:Text"/>:
220 </xsl:if>
221 <xsl:value-of select="a:Value"/>
222 </xsl:for-each>
223 </td>
224 </tr>
225 </xsl:if>
226 </xsl:for-each>
227 </xsl:for-each>
228 </tbody>
229 </table>
230 </td>
231 </tr>
232 <span id="ccrcontent">
233 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Alerts">
234 <tr id="alertsrow">
235 <td>
236 <span class="header">Alerts</span>
237 <br/>
238 <table class="list" id="alerts">
239 <tbody>
240 <tr>
241 <th>Type</th>
242 <th>Date</th>
243 <th>Code</th>
244 <th>Description</th>
245 <th>Reaction</th>
246 <th>Source</th>
247 </tr>
248 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Alerts/a:Alert">
249 <tr>
250 <td>
251 <xsl:value-of select="a:Type/a:Text"/>
252 </td>
253 <td>
254 <table class="internal">
255 <tbody>
256 <xsl:call-template name="dateTime">
257 <xsl:with-param name="dt" select="a:DateTime"/>
258 </xsl:call-template>
259 </tbody>
260 </table>
261 </td>
262 <td>
263 <xsl:apply-templates select="a:Description/a:Code"/>
264 </td>
265 <td>
266 <strong class="clinical">
267 <xsl:value-of select="a:Description/a:Text"/>
268 </strong>
269 </td>
270 <td>
271 <xsl:value-of select="a:Reaction/a:Description/a:Text"/>
272 <xsl:if test="a:Reaction/a:Severity/a:Text">
273 <xsl:text>-</xsl:text>
274 <xsl:value-of select="a:Reaction/a:Severity/a:Text"/>
275 </xsl:if>
276 </td>
277 <td>
278 <a>
279 <xsl:attribute name="href">
280 <xsl:text>#</xsl:text>
281 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
282 </xsl:attribute>
283 <xsl:call-template name="actorName">
284 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
285 </xsl:call-template>
286 </a>
287 </td>
288 </tr>
289 </xsl:for-each>
290 </tbody>
291 </table>
292 </td>
293 </tr>
294 </xsl:if>
295 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:AdvanceDirectives">
296 <tr id="advancedirectivesrow">
297 <td>
298 <span class="header">Advance Directives</span>
299 <br/>
300 <table class="list" id="advancedirectives">
301 <tbody>
302 <tr>
303 <th>Type</th>
304 <th>Date</th>
305 <th>Description</th>
306 <th>Status</th>
307 <th>Source</th>
308 </tr>
309 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:AdvanceDirectives/a:AdvanceDirective">
310 <tr>
311 <td>
312 <xsl:value-of select="a:Type/a:Text"/>
313 </td>
314 <td>
315 <table class="internal">
316 <tbody>
317 <xsl:call-template name="dateTime">
318 <xsl:with-param name="dt" select="a:DateTime"/>
319 </xsl:call-template>
320 </tbody>
321 </table>
322 </td>
323 <td>
324 <strong class="clinical">
325 <xsl:value-of select="a:Description/a:Text"/>
326 </strong>
327 </td>
328 <td>
329 <xsl:value-of select="a:Status/a:Text"/>
330 </td>
331 <td>
332 <a>
333 <xsl:attribute name="href">
334 <xsl:text>#</xsl:text>
335 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
336 </xsl:attribute>
337 <xsl:call-template name="actorName">
338 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
339 </xsl:call-template>
340 </a>
341 </td>
342 </tr>
343 </xsl:for-each>
344 </tbody>
345 </table>
346 </td>
347 </tr>
348 </xsl:if>
349 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Support">
350 <tr id="supportprovidersrow">
351 <td>
352 <span class="header" id="supportproviders">Support Providers</span>
353 <br/>
354 <table class="list">
355 <tbody>
356 <tr>
357 <th>Role</th>
358 <th>Name</th>
359 </tr>
360 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Support/a:SupportProvider">
361 <tr>
362 <td>
363 <xsl:value-of select="a:ActorRole/a:Text"/>
364 </td>
365 <td>
366 <a>
367 <xsl:attribute name="href">
368 <xsl:text>#</xsl:text>
369 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
370 </xsl:attribute>
371 <xsl:call-template name="actorName">
372 <xsl:with-param name="objID" select="a:ActorID"/>
373 </xsl:call-template>
374 </a>
375 </td>
376 </tr>
377 </xsl:for-each>
378 </tbody>
379 </table>
380 </td>
381 </tr>
382 </xsl:if>
383 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:FunctionalStatus">
384 <tr id="functionalstatus">
385 <td>
386 <span class="header">Functional Status</span>
387 <br/>
388 <table class="list">
389 <tbody>
390 <tr>
391 <th>Type</th>
392 <th>Date</th>
393 <th>Code</th>
394 <th>Description</th>
395 <th>Status</th>
396 <th>Source</th>
397 </tr>
398 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:FunctionalStatus/a:Function">
399 <tr>
400 <td>
401 <xsl:value-of select="a:Type/a:Text"/>
402 </td>
403 <td>
404 <table class="internal">
405 <tbody>
406 <xsl:call-template name="dateTime">
407 <xsl:with-param name="dt" select="a:DateTime"/>
408 </xsl:call-template>
409 </tbody>
410 </table>
411 </td>
412 <td>
413 <xsl:apply-templates select="a:Description/a:Code"/>
414 </td>
415 <td>
416 <strong class="clinical">
417 <xsl:value-of select="a:Description/a:Text"/>
418 </strong>
419 </td>
420 <td>
421 <xsl:value-of select="a:Status/a:Text"/>
422 </td>
423 <td>
424 <a>
425 <xsl:attribute name="href">
426 <xsl:text>#</xsl:text>
427 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
428 </xsl:attribute>
429 <xsl:call-template name="actorName">
430 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
431 </xsl:call-template>
432 </a>
433 </td>
434 </tr>
435 </xsl:for-each>
436 </tbody>
437 </table>
438 </td>
439 </tr>
440 </xsl:if>
441 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Problems">
442 <tr id="problemsrow">
443 <td>
444 <span class="header">Problems</span>
445 <br/>
446 <table class="list" id="problems">
447 <tbody>
448 <tr>
449 <th>Type</th>
450 <th>Date</th>
451 <th>Code</th>
452 <th>Description</th>
453 <th>Status</th>
454 <th>Source</th>
455 </tr>
456 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Problems/a:Problem">
457 <tr>
458 <td>
459 <xsl:value-of select="a:Type/a:Text"/>
460 </td>
461 <td>
462 <table class="internal">
463 <tbody>
464 <xsl:call-template name="dateTime">
465 <xsl:with-param name="dt" select="a:DateTime"/>
466 </xsl:call-template>
467 </tbody>
468 </table>
469 </td>
470 <td>
471 <xsl:apply-templates select="a:Description/a:Code"/>
472 </td>
473 <td>
474 <strong class="clinical">
475 <xsl:value-of select="a:Description/a:Text"/>
476 </strong>
477 </td>
478 <td>
479 <xsl:value-of select="a:Status/a:Text"/>
480 </td>
481 <td>
482 <a>
483 <xsl:attribute name="href">
484 <xsl:text>#</xsl:text>
485 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
486 </xsl:attribute>
487 <xsl:call-template name="actorName">
488 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
489 </xsl:call-template>
490 </a>
491 </td>
492 </tr>
493 </xsl:for-each>
494 </tbody>
495 </table>
496 </td>
497 </tr>
498 </xsl:if>
499 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Procedures">
500 <tr id="proceduresrow">
501 <td>
502 <span class="header">Procedures</span>
503 <br/>
504 <table class="list" id="procedures">
505 <tbody>
506 <tr>
507 <th>Type</th>
508 <th>Date</th>
509 <th>Code</th>
510 <th>Description</th>
511 <th>Location</th>
512 <th>Substance</th>
513 <th>Method</th>
514 <th>Position</th>
515 <th>Site</th>
516 <th>Status</th>
517 <th>Source</th>
518 </tr>
519 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
520 <tr>
521 <td>
522 <xsl:value-of select="a:Type/a:Text"/>
523 </td>
524 <td>
525 <table class="internal">
526 <tbody>
527 <xsl:call-template name="dateTime">
528 <xsl:with-param name="dt" select="a:DateTime"/>
529 </xsl:call-template>
530 </tbody>
531 </table>
532 </td>
533 <td>
534 <xsl:apply-templates select="a:Description/a:Code"/>
535 </td>
536 <td>
537 <strong class="clinical">
538 <xsl:value-of select="a:Description/a:Text"/>
539 </strong>
540 </td>
541 <td>
542 <xsl:for-each select="a:Locations/a:Location">
543 <xsl:value-of select="a:Description/a:Text"/>
544 <xsl:if test="a:Actor">
545 <xsl:text>(</xsl:text>
546 <xsl:call-template name="actorName">
547 <xsl:with-param name="objID" select="a:Actor/a:ActorID"/>
548 </xsl:call-template>
549 <xsl:if test="a:Actor/a:ActorRole/a:Text">
550 <xsl:text xml:space="preserve"> </xsl:text>-<xsl:text xml:space="preserve"> </xsl:text>
551 <xsl:value-of select="a:ActorRole/a:Text"/>
552 <xsl:text>)</xsl:text>
553 </xsl:if>
554 </xsl:if>
555 <xsl:if test="position() != last()">
556 <br/>
557 </xsl:if>
558 </xsl:for-each>
559 </td>
560 <td>
561 <xsl:for-each select="a:Substance">
562 <xsl:value-of select="a:Text"/>
563 </xsl:for-each>
564 </td>
565 <td>
566 <xsl:value-of select="a:Method/a:Text"/>
567 </td>
568 <td>
569 <xsl:value-of select="a:Position/a:Text"/>
570 </td>
571 <td>
572 <xsl:value-of select="a:Site/a:Text"/>
573 </td>
574 <td>
575 <xsl:value-of select="a:Status/a:Text"/>
576 </td>
577 <td>
578 <a>
579 <xsl:attribute name="href">
580 <xsl:text>#</xsl:text>
581 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
582 </xsl:attribute>
583 <xsl:call-template name="actorName">
584 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
585 </xsl:call-template>
586 </a>
587 </td>
588 </tr>
589 </xsl:for-each>
590 </tbody>
591 </table>
592 </td>
593 </tr>
594 </xsl:if>
595 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Medications">
596 <tr id="medicationsrow">
597 <td>
598 <span class="header" id="medications">Medications</span>
599 <br/>
600 <table class="list">
601 <tbody>
602 <tr>
603 <th>Medication</th>
604 <th>Date</th>
605 <th>Status</th>
606 <th>Form</th>
607 <th>Strength</th>
608 <th>Quantity</th>
609 <th>SIG</th>
610 <th>Indications</th>
611 <th>Instruction</th>
612 <th>Refills</th>
613 <th>Source</th>
614 </tr>
615 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Medications/a:Medication">
616 <tr>
617 <td>
618 <strong class="clinical">
619 <xsl:value-of select="a:Product/a:ProductName/a:Text"/>
620 <xsl:if test="a:Product/a:BrandName">
621 <xsl:text xml:space="preserve"> (</xsl:text>
622 <xsl:value-of select="a:Product/a:BrandName/a:Text"/>
623 <xsl:text>)</xsl:text>
624 </xsl:if>
625 </strong>
626 </td>
627 <td>
628 <table class="internal">
629 <tbody>
630 <xsl:call-template name="dateTime">
631 <xsl:with-param name="dt" select="a:DateTime"/>
632 </xsl:call-template>
633 </tbody>
634 </table>
635 </td>
636 <td>
637 <xsl:value-of select="a:Status/a:Text"/>
638 </td>
639 <td>
640 <xsl:value-of select="a:Product/a:Form/a:Text"/>
641 </td>
642 <td>
643 <xsl:for-each select="a:Product/a:Strength">
644 <xsl:if test="position() > 1">
645 <xsl:text>/</xsl:text>
646 </xsl:if>
647 <xsl:value-of select="a:Value"/>
648 <xsl:text xml:space="preserve"> </xsl:text>
649 <xsl:value-of select="a:Units/a:Unit"/>
650 </xsl:for-each>
651 </td>
652 <td>
653 <xsl:value-of select="a:Quantity/a:Value"/>
654 <xsl:text xml:space="preserve"> </xsl:text>
655 <xsl:value-of select="a:Quantity/a:Units/a:Unit"/>
656 </td>
657 <td>
658 <table border="1" class="internal">
659 <tbody>
660 <xsl:apply-templates select="a:Directions"/>
661 <!-- call to /templates/directions.xsl -->
662 </tbody>
663 </table>
664 </td>
665 <td>
666 <xsl:for-each select="a:Indications/a:Indication">
667 <xsl:call-template name="problemDescription">
668 <xsl:with-param name="objID" select="a:InternalCCRLink/a:LinkID"/>
669 </xsl:call-template>
670 <br/>
671 </xsl:for-each>
672 </td>
673 <td>
674 <xsl:for-each select="a:PatientInstructions/a:Instruction">
675 <xsl:value-of select="a:Text"/>
676 <br/>
677 </xsl:for-each>
678 </td>
679 <td>
680 <xsl:for-each select="a:Refills/a:Refill">
681 <xsl:value-of select="a:Number"/>
682 <xsl:text xml:space="preserve"> </xsl:text>
683 </xsl:for-each>
684 </td>
685 <td>
686 <a>
687 <xsl:attribute name="href">
688 <xsl:text>#</xsl:text>
689 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
690 </xsl:attribute>
691 <xsl:call-template name="actorName">
692 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
693 </xsl:call-template>
694 </a>
695 </td>
696 </tr>
697 </xsl:for-each>
698 </tbody>
699 </table>
700 </td>
701 </tr>
702 </xsl:if>
703 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Immunizations">
704 <tr id="immunizationsrow">
705 <td>
706 <span class="header">Immunizations</span>
707 <br/>
708 <table class="list" id="immunizations">
709 <tbody>
710 <tr>
711 <th>Code</th>
712 <th>Vaccine</th>
713 <th>Date</th>
714 <th>Route</th>
715 <th>Site</th>
716 <th>Source</th>
717 </tr>
718 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Immunizations/a:Immunization">
719 <tr>
720 <td>
721 <xsl:apply-templates select="a:Product/a:ProductName/a:Code"/>
722 </td>
723 <td>
724 <strong class="clinical">
725 <xsl:value-of select="a:Product/a:ProductName/a:Text"/>
726 <xsl:if test="a:Product/a:Form">
727 <xsl:text xml:space="preserve"> (</xsl:text>
728 <xsl:value-of select="a:Product/a:Form/a:Text"/>
729 <xsl:text>)</xsl:text>
730 </xsl:if>
731 </strong>
732 </td>
733 <td>
734 <table class="internal">
735 <tbody>
736 <xsl:call-template name="dateTime">
737 <xsl:with-param name="dt" select="a:DateTime"/>
738 </xsl:call-template>
739 </tbody>
740 </table>
741 </td>
742 <td>
743 <xsl:value-of select="a:Directions/a:Direction/a:Route/a:Text"/>
744 </td>
745 <td>
746 <xsl:value-of select="a:Directions/a:Direction/a:Site/a:Text"/>
747 </td>
748 <td>
749 <a>
750 <xsl:attribute name="href">
751 <xsl:text>#</xsl:text>
752 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
753 </xsl:attribute>
754 <xsl:call-template name="actorName">
755 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
756 </xsl:call-template>
757 </a>
758 </td>
759 </tr>
760 </xsl:for-each>
761 </tbody>
762 </table>
763 </td>
764 </tr>
765 </xsl:if>
766 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:VitalSigns">
767 <tr id="vitalsignsrow">
768 <td>
769 <span class="header">Vital Signs</span>
770 <br/>
771 <table class="list" id="vitalsigns">
772 <tbody>
773 <tr>
774 <th>Vital Sign</th>
775 <th>Date</th>
776 <th>Result</th>
777 <th>Source</th>
778 </tr>
779 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:VitalSigns/a:Result">
780 <tr>
781 <td>
782 <xsl:value-of select="a:Description/a:Text"/>
783 </td>
784 <td>
785 <table class="internal">
786 <tbody>
787 <xsl:call-template name="dateTime">
788 <xsl:with-param name="dt" select="a:DateTime"/>
789 <xsl:with-param name="fmt">MMM dd, yyyy ':' hh:mm aa zzz</xsl:with-param>
790 </xsl:call-template>
791 </tbody>
792 </table>
793 </td>
794 <td>
795 <table class="internal">
796 <tbody>
797 <xsl:for-each select="a:Test">
798 <xsl:choose>
799 <xsl:when test="position() mod 2=0">
800 <tr class="even">
801 <td width="33%">
802 <strong class="clinical">
803 <xsl:value-of select="a:Description/a:Text"/>
804 </strong>
805 </td>
806 <td width="33%">
807 <xsl:value-of select="a:TestResult/a:Value"/>
808 <xsl:text xml:space="preserve"> </xsl:text>
809 <xsl:value-of select="a:TestResult/a:Units/a:Unit"/>
810 </td>
811 <td width="33%">
812 <xsl:value-of select="a:Flag/a:Text"/>
813 </td>
814 </tr>
815 </xsl:when>
816 <xsl:otherwise>
817 <tr class="odd">
818 <td width="33%">
819 <strong class="clinical">
820 <xsl:value-of select="a:Description/a:Text"/>
821 </strong>
822 </td>
823 <td width="33%">
824 <xsl:value-of select="a:TestResult/a:Value"/>
825 <xsl:text xml:space="preserve"> </xsl:text>
826 <xsl:value-of select="a:TestResult/a:Units/a:Unit"/>
827 </td>
828 <td width="33%">
829 <xsl:value-of select="a:Flag/a:Text"/>
830 </td>
831 </tr>
832 </xsl:otherwise>
833 </xsl:choose>
834 </xsl:for-each>
835 </tbody>
836 </table>
837 </td>
838 <td>
839 <a>
840 <xsl:attribute name="href">
841 <xsl:text>#</xsl:text>
842 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
843 </xsl:attribute>
844 <xsl:call-template name="actorName">
845 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
846 </xsl:call-template>
847 </a>
848 </td>
849 </tr>
850 </xsl:for-each>
851 </tbody>
852 </table>
853 </td>
854 </tr>
855 </xsl:if>
856 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Encounters">
857 <tr id="encountersrow">
858 <td>
859 <span class="header">Encounters</span>
860 <br/>
861 <table class="list" id="encounters">
862 <tbody>
863 <tr>
864 <th>Type</th>
865 <th>Date</th>
866 <th>Location</th>
867 <th>Status</th>
868 <th>Practitioner</th>
869 <th>Description</th>
870 <th>Indications</th>
871 <th>Source</th>
872 </tr>
873 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Encounters/a:Encounter">
874 <tr>
875 <td>
876 <xsl:value-of select="a:Type/a:Text"/>
877 </td>
878 <td>
879 <table class="internal">
880 <tbody>
881 <xsl:call-template name="dateTime">
882 <xsl:with-param name="dt" select="a:DateTime"/>
883 </xsl:call-template>
884 </tbody>
885 </table>
886 </td>
887 <td>
888 <xsl:for-each select="a:Locations/a:Location">
889 <xsl:value-of select="a:Description/a:Text"/>
890 <xsl:call-template name="actorName">
891 <xsl:with-param name="objID" select="a:Actor/a:ActorID"/>
892 </xsl:call-template>
893 <br/>
894 </xsl:for-each>
895 </td>
896 <td>
897 <xsl:value-of select="a:Status/a:Text"/>
898 </td>
899 <td>
900 <xsl:for-each select="a:Practitioners/a:Practitioner">
901 <xsl:call-template name="actorName">
902 <xsl:with-param name="objID" select="a:ActorID"/>
903 </xsl:call-template>
904 <br/>
905 </xsl:for-each>
906 </td>
907 <td>
908 <strong class="clinical">
909 <xsl:value-of select="a:Description/a:Text"/>
910 </strong>
911 </td>
912 <td>
913 <xsl:for-each select="a:Indications/a:Indication">
914 <xsl:call-template name="problemDescription">
915 <xsl:with-param name="objID" select="a:InternalCCRLink/a:LinkID"/>
916 </xsl:call-template>
917 <br/>
918 </xsl:for-each>
919 </td>
920 <td>
921 <a>
922 <xsl:attribute name="href">
923 <xsl:text>#</xsl:text>
924 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
925 </xsl:attribute>
926 <xsl:call-template name="actorName">
927 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
928 </xsl:call-template>
929 </a>
930 </td>
931 </tr>
932 </xsl:for-each>
933 </tbody>
934 </table>
935 </td>
936 </tr>
937 </xsl:if>
938 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:SocialHistory">
939 <tr id="socialhistoryrow">
940 <td>
941 <span class="header">Social History</span>
942 <br/>
943 <table class="list" id="socialhistory">
944 <tbody>
945 <tr>
946 <th>Type</th>
947 <th>Date</th>
948 <th>Code</th>
949 <th>Description</th>
950 <th>Status</th>
951 <th>Source</th>
952 </tr>
953 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement">
954 <tr>
955 <td>
956 <xsl:value-of select="a:Type/a:Text"/>
957 </td>
958 <td>
959 <table class="internal">
960 <tbody>
961 <xsl:call-template name="dateTime">
962 <xsl:with-param name="dt" select="a:DateTime"/>
963 </xsl:call-template>
964 </tbody>
965 </table>
966 </td>
967 <td>
968 <xsl:apply-templates select="a:Description/a:Code"/>
969 </td>
970 <td>
971 <strong class="clinical">
972 <span>
973 <xsl:value-of disable-output-escaping="yes" select="a:Description/a:Text"/>
974 </span>
975 </strong>
976 </td>
977 <td>
978 <xsl:value-of select="a:Status/a:Text"/>
979 </td>
980 <td>
981 <a>
982 <xsl:attribute name="href">
983 <xsl:text>#</xsl:text>
984 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
985 </xsl:attribute>
986 <xsl:call-template name="actorName">
987 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
988 </xsl:call-template>
989 </a>
990 </td>
991 </tr>
992 </xsl:for-each>
993 </tbody>
994 </table>
995 </td>
996 </tr>
997 </xsl:if>
998 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:FamilyHistory">
999 <tr id="familyhistoryrow">
1000 <td>
1001 <span class="header">Family History</span>
1002 <br/>
1003 <table class="list" id="familyhistory">
1004 <tbody>
1005 <tr>
1006 <th>Type</th>
1007 <th>Date</th>
1008 <th>Code</th>
1009 <th>Description</th>
1010 <th>Relationship(s)</th>
1011 <th>Status</th>
1012 <th>Source</th>
1013 </tr>
1014 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:FamilyHistory/a:FamilyProblemHistory">
1015 <tr>
1016 <td>
1017 <xsl:value-of select="a:Type/a:Text"/>
1018 </td>
1019 <td>
1020 <table class="internal">
1021 <tbody>
1022 <xsl:call-template name="dateTime">
1023 <xsl:with-param name="dt" select="a:DateTime"/>
1024 </xsl:call-template>
1025 </tbody>
1026 </table>
1027 </td>
1028 <td>
1029 <xsl:apply-templates select="a:Problem/a:Description/a:Code"/>
1030 </td>
1031 <td>
1032 <table class="internal" id="familyhistoryproblem">
1033 <xsl:for-each select="a:Problem">
1034 <tr>
1035 <td>
1036 <strong class="clinical">
1037 <xsl:value-of select="a:Description/a:Text"/>
1038 </strong>
1039 </td>
1040 </tr>
1041 </xsl:for-each>
1042 </table>
1043 </td>
1044 <td>
1045 <xsl:value-of select="a:FamilyMember/a:ActorRole/a:Text"/>
1046 </td>
1047 <td>
1048 <xsl:value-of select="a:Status/a:Text"/>
1049 </td>
1050 <td>
1051 <a>
1052 <xsl:attribute name="href">
1053 <xsl:text>#</xsl:text>
1054 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
1055 </xsl:attribute>
1056 <xsl:call-template name="actorName">
1057 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1058 </xsl:call-template>
1059 </a>
1060 </td>
1061 </tr>
1062 </xsl:for-each>
1063 </tbody>
1064 </table>
1065 </td>
1066 </tr>
1067 </xsl:if>
1068 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Results/a:Result[a:Test/a:TestResult/a:Value!='']">
1069 <tr id="resultsrow">
1070 <td>
1071 <span class="header">Results (Discrete)</span>
1072 <br/>
1073 <table class="list" id="results">
1074 <tbody>
1075 <tr>
1076 <th>Test</th>
1077 <th>Date</th>
1078 <th>Result</th>
1079 <th>Source</th>
1080 </tr>
1081 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Results/a:Result[a:Test/a:TestResult/a:Value!='']">
1082 <tr>
1083 <td>
1084 <xsl:value-of select="a:Description/a:Text"/>
1085 </td>
1086 <td>
1087 <table class="internal">
1088 <tbody>
1089 <xsl:call-template name="dateTime">
1090 <xsl:with-param name="dt" select="a:DateTime"/>
1091 <xsl:with-param name="fmt">MMM dd, yyyy ':' hh:mm aa zzz</xsl:with-param>
1092 </xsl:call-template>
1093 </tbody>
1094 </table>
1095 </td>
1096 <td>
1097 <table class="internal">
1098 <tbody>
1099 <xsl:for-each select="a:Test">
1100 <xsl:choose>
1101 <xsl:when test="position() mod 2=0">
1102 <tr class="even">
1103 <td width="33%">
1104 <strong class="clinical">
1105 <xsl:value-of select="a:Description/a:Text"/>
1106 </strong>
1107 </td>
1108 <td width="33%">
1109 <xsl:value-of select="a:TestResult/a:Value"/>
1110 <xsl:text xml:space="preserve"> </xsl:text>
1111 <xsl:value-of select="a:TestResult/a:Units/a:Unit"/>
1112 </td>
1113 <td width="33%">
1114 <xsl:value-of select="a:Flag/a:Text"/>
1115 </td>
1116 </tr>
1117 </xsl:when>
1118 <xsl:otherwise>
1119 <tr class="odd">
1120 <td width="33%">
1121 <strong class="clinical">
1122 <xsl:value-of select="a:Description/a:Text"/>
1123 </strong>
1124 </td>
1125 <td width="33%">
1126 <xsl:value-of select="a:TestResult/a:Value"/>
1127 <xsl:text xml:space="preserve"> </xsl:text>
1128 <xsl:value-of select="a:TestResult/a:Units/a:Unit"/>
1129 </td>
1130 <td width="33%">
1131 <xsl:value-of select="a:Flag/a:Text"/>
1132 </td>
1133 </tr>
1134 </xsl:otherwise>
1135 </xsl:choose>
1136 </xsl:for-each>
1137 </tbody>
1138 </table>
1139 </td>
1140 <td>
1141 <a>
1142 <xsl:attribute name="href">
1143 <xsl:text>#</xsl:text>
1144 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
1145 </xsl:attribute>
1146 <xsl:call-template name="actorName">
1147 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1148 </xsl:call-template>
1149 </a>
1150 </td>
1151 </tr>
1152 </xsl:for-each>
1153 </tbody>
1154 </table>
1155 </td>
1156 </tr>
1157 </xsl:if>
1158 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Results/a:Result[a:Test/a:TestResult/a:Description/a:Text!='']">
1159 <tr id="resultsreportrow">
1160 <td>
1161 <span class="header">Results (Report)</span>
1162 <br/>
1163 <table class="list" id="resultsreport">
1164 <tbody>
1165 <tr>
1166 <th>Test</th>
1167 <th>Date</th>
1168 <th>Result</th>
1169 <th>Source</th>
1170 </tr>
1171 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Results/a:Result[a:Test/a:TestResult/a:Description/a:Text!='']">
1172 <tr>
1173 <td>
1174 <xsl:value-of select="a:Description/a:Text"/>
1175 </td>
1176 <td>
1177 <table class="internal">
1178 <tbody>
1179 <xsl:call-template name="dateTime">
1180 <xsl:with-param name="dt" select="a:DateTime"/>
1181 <xsl:with-param name="fmt">MMM dd, yyyy ':' hh:mm aa zzz</xsl:with-param>
1182 </xsl:call-template>
1183 </tbody>
1184 </table>
1185 </td>
1186 <td>
1187 <table class="internal">
1188 <tbody>
1189 <xsl:for-each select="a:Test">
1190 <xsl:choose>
1191 <xsl:when test="position() mod 2=0">
1192 <tr class="even">
1193 <td width="20%">
1194 <strong class="clinical">
1195 <xsl:value-of select="a:Description/a:Text"/>
1196 </strong>
1197 </td>
1198 <td width="65%">
1199 <span>
1200 <xsl:value-of disable-output-escaping="yes" select="a:TestResult/a:Description/a:Text"/>
1201 </span>
1202 </td>
1203 <td width="15%">
1204 <xsl:value-of select="a:Flag/a:Text"/>
1205 </td>
1206 </tr>
1207 </xsl:when>
1208 <xsl:otherwise>
1209 <tr class="odd">
1210 <td width="20%">
1211 <strong class="clinical">
1212 <xsl:value-of select="a:Description/a:Text"/>
1213 </strong>
1214 </td>
1215 <td width="65%">
1216 <xsl:value-of disable-output-escaping="yes" select="a:TestResult/a:Description/a:Text"/>
1217 </td>
1218 <td width="15%">
1219 <xsl:value-of select="a:Flag/a:Text"/>
1220 </td>
1221 </tr>
1222 </xsl:otherwise>
1223 </xsl:choose>
1224 </xsl:for-each>
1225 </tbody>
1226 </table>
1227 </td>
1228 <td>
1229 <a>
1230 <xsl:attribute name="href">
1231 <xsl:text>#</xsl:text>
1232 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
1233 </xsl:attribute>
1234 <xsl:call-template name="actorName">
1235 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1236 </xsl:call-template>
1237 </a>
1238 </td>
1239 </tr>
1240 </xsl:for-each>
1241 </tbody>
1242 </table>
1243 </td>
1244 </tr>
1245 </xsl:if>
1246 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Payers">
1247 <tr id="insurancerow">
1248 <td>
1249 <span class="header">Insurance</span>
1250 <br/>
1251 <table class="list" id="insurance">
1252 <tbody>
1253 <tr>
1254 <th>Type</th>
1255 <th>Date</th>
1256 <th>Identification Numbers</th>
1257 <th>Payment Provider</th>
1258 <th>Subscriber</th>
1259 <th>Source</th>
1260 </tr>
1261 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:Payers/a:Payer">
1262 <tr>
1263 <td>
1264 <xsl:value-of select="a:Type/a:Text"/>
1265 </td>
1266 <td>
1267 <table class="internal">
1268 <tbody>
1269 <xsl:for-each select="a:DateTime">
1270 <xsl:call-template name="dateTime">
1271 <xsl:with-param name="dt" select="."/>
1272 <xsl:with-param name="fmt">MMM dd, yyyy ':' hh:mm aa zzz</xsl:with-param>
1273 </xsl:call-template>
1274 </xsl:for-each>
1275 </tbody>
1276 </table>
1277 </td>
1278 <td>
1279 <table border="1" class="internal">
1280 <tbody>
1281 <xsl:for-each select="a:IDs">
1282 <xsl:choose>
1283 <xsl:when test="position() mod 2=0">
1284 <tr class="even">
1285 <td width="50%">
1286 <xsl:value-of select="a:Type/a:Text"/>:</td>
1287 <td width="50%">
1288 <xsl:value-of select="a:ID"/>
1289 </td>
1290 </tr>
1291 </xsl:when>
1292 <xsl:otherwise>
1293 <tr class="odd">
1294 <td width="50%">
1295 <xsl:value-of select="a:Type/a:Text"/>:</td>
1296 <td width="50%">
1297 <xsl:value-of select="a:ID"/>
1298 </td>
1299 </tr>
1300 </xsl:otherwise>
1301 </xsl:choose>
1302 </xsl:for-each>
1303 </tbody>
1304 </table>
1305 </td>
1306 <td>
1307 <a>
1308 <xsl:attribute name="href">
1309 <xsl:text>#</xsl:text>
1310 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
1311 </xsl:attribute>
1312 <xsl:call-template name="actorName">
1313 <xsl:with-param name="objID" select="a:PaymentProvider/a:ActorID"/>
1314 </xsl:call-template>
1315 </a>
1316 </td>
1317 <td>
1318 <a>
1319 <xsl:attribute name="href">
1320 <xsl:text>#</xsl:text>
1321 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
1322 </xsl:attribute>
1323 <xsl:call-template name="actorName">
1324 <xsl:with-param name="objID" select="a:Subscriber/a:ActorID"/>
1325 </xsl:call-template>
1326 </a>
1327 </td>
1328 <td>
1329 <a>
1330 <xsl:attribute name="href">
1331 <xsl:text>#</xsl:text>
1332 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
1333 </xsl:attribute>
1334 <xsl:call-template name="actorName">
1335 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1336 </xsl:call-template>
1337 </a>
1338 </td>
1339 </tr>
1340 </xsl:for-each>
1341 </tbody>
1342 </table>
1343 </td>
1344 </tr>
1345 </xsl:if>
1346 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:PlanOfCare">
1347 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Treatment Recommendation']">
1348 <tr id="planofcarerow">
1349 <td>
1350 <span class="header">Plan Of Care Recommendations</span>
1351 <br/>
1352 <table class="list" id="planofcare">
1353 <tbody>
1354 <tr>
1355 <th>Description</th>
1356 <th>Recommendation</th>
1357 <th>Goal</th>
1358 <th>Status</th>
1359 <th>Source</th>
1360 </tr>
1361 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Treatment Recommendation']">
1362 <tr>
1363 <td>
1364 <xsl:value-of select="a:Description/a:Text"/>
1365 </td>
1366 <td>
1367 <xsl:value-of disable-output-escaping="yes" select="a:OrderRequest/a:Description/a:Text"/>
1368 </td>
1369 <td>
1370 <xsl:value-of disable-output-escaping="yes" select="a:OrderRequest/a:Goals/a:Goal/a:Description/a:Text"/>
1371 </td>
1372 <td>
1373 <xsl:value-of select="a:Status/a:Text"/>
1374 </td>
1375 <td>
1376 <a>
1377 <xsl:attribute name="href">
1378 <xsl:text>#</xsl:text>
1379 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
1380 </xsl:attribute>
1381 <xsl:call-template name="actorName">
1382 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1383 </xsl:call-template>
1384 </a>
1385 </td>
1386 </tr>
1387 </xsl:for-each>
1388 </tbody>
1389 </table>
1390 </td>
1391 </tr>
1392 </xsl:if>
1393 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Order']">
1394 <tr id="planofcareordersrow">
1395 <td>
1396 <span class="header">Plan Of Care Orders</span>
1397 <br/>
1398 <table class="list" id="planofcareorders">
1399 <tbody>
1400 <tr>
1401 <th>Descripion</th>
1402 <th>Plan Status</th>
1403 <th>Type</th>
1404 <th>Date</th>
1405 <th>Procedure</th>
1406 <th>Schedule</th>
1407 <th>Location</th>
1408 <th>Substance</th>
1409 <th>Method</th>
1410 <th>Position</th>
1411 <th>Site</th>
1412 <th>Status</th>
1413 <th>Source</th>
1414 </tr>
1415 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Order']">
1416 <tr>
1417 <td>
1418 <xsl:apply-templates select="a:Description/a:Text"/>
1419 </td>
1420 <td>
1421 <xsl:value-of select="a:Status/a:Text"/>
1422 </td>
1423 <td>
1424 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Type/a:Text"/>
1425 </td>
1426 <td>
1427 <table class="internal">
1428 <tbody>
1429 <xsl:call-template name="dateTime">
1430 <xsl:with-param name="dt" select="a:OrderRequest/a:Procedures/a:Procedure/a:DateTime"/>
1431 </xsl:call-template>
1432 </tbody>
1433 </table>
1434 </td>
1435 <td>
1436 <xsl:apply-templates select="a:OrderRequest/a:Procedures/a:Procedure/a:Description/a:Text"/>
1437 </td>
1438 <td>
1439 <span>Every </span>
1440 <xsl:apply-templates select="a:OrderRequest/a:Procedures/a:Procedure/a:Interval/a:Value"/>
1441 <xsl:text xml:space="preserve"> </xsl:text>
1442 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Interval/a:Units/a:Unit"/>
1443 <span> for </span>
1444 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Duration/a:Value"/>
1445 <xsl:text xml:space="preserve"> </xsl:text>
1446 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Duration/a:Units/a:Unit"/>
1447 </td>
1448 <td>
1449 <xsl:for-each select="a:OrderRequest/a:Procedures/a:Procedure/a:Locations">
1450 <xsl:value-of select="a:Location/a:Description/a:Text"/>
1451 <xsl:if test="position() != last()">
1452 <br/>
1453 </xsl:if>
1454 </xsl:for-each>
1455 </td>
1456 <td>
1457 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Substance/a:Text"/>
1458 </td>
1459 <td>
1460 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Method/a:Text"/>
1461 </td>
1462 <td>
1463 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Position/a:Text"/>
1464 </td>
1465 <td>
1466 <xsl:value-of select="a:OrderRequest/a:Procedures/a:Procedure/a:Site/a:Text"/>
1467 </td>
1468 <td/>
1469 <td>
1470 <a>
1471 <xsl:attribute name="href">
1472 <xsl:text>#</xsl:text>
1473 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
1474 </xsl:attribute>
1475 <xsl:call-template name="actorName">
1476 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1477 </xsl:call-template>
1478 </a>
1479 </td>
1480 </tr>
1481 </xsl:for-each>
1482 </tbody>
1483 </table>
1484 </td>
1485 </tr>
1486 </xsl:if>
1487 </xsl:if>
1488 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:HealthCareProviders">
1489 <tr id="healthcareprovidersrow">
1490 <td>
1491 <span class="header">Health Care Providers</span>
1492 <br/>
1493 <table class="list" id="healthcareproviders">
1494 <tbody>
1495 <tr>
1496 <th>Role</th>
1497 <th>Name</th>
1498 </tr>
1499 <xsl:for-each select="a:ContinuityOfCareRecord/a:Body/a:HealthCareProviders/a:Provider">
1500 <tr>
1501 <td>
1502 <xsl:value-of select="a:ActorRole/a:Text"/>
1503 </td>
1504 <td>
1505 <a>
1506 <xsl:attribute name="href">
1507 <xsl:text>#</xsl:text>
1508 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
1509 </xsl:attribute>
1510 <xsl:call-template name="actorName">
1511 <xsl:with-param name="objID" select="a:ActorID"/>
1512 </xsl:call-template>
1513 </a>
1514 </td>
1515 </tr>
1516 </xsl:for-each>
1517 </tbody>
1518 </table>
1519 </td>
1520 </tr>
1521 </xsl:if>
1522 <xsl:if test="a:ContinuityOfCareRecord/a:References">
1523 <tr id="referencesrow">
1524 <td>
1525 <span class="header">References</span>
1526 <br/>
1527 <table class="list" id="references">
1528 <tbody>
1529 <tr>
1530 <th>Type</th>
1531 <th>Date</th>
1532 <th>Description</th>
1533 <th>Location</th>
1534 <th>Source</th>
1535 </tr>
1536 <xsl:for-each select="a:ContinuityOfCareRecord/a:References/a:Reference">
1537 <tr>
1538 <td>
1539 <xsl:value-of select="a:Type/a:Text"/>
1540 </td>
1541 <td>
1542 <table class="internal">
1543 <tbody>
1544 <xsl:call-template name="dateTime">
1545 <xsl:with-param name="dt" select="a:DateTime"/>
1546 </xsl:call-template>
1547 </tbody>
1548 </table>
1549 </td>
1550 <td>
1551 <strong class="clinical">
1552 <xsl:value-of select="a:Description/a:Text"/>
1553 </strong>
1554 </td>
1555 <td>
1556 <a target="_blank">
1557 <xsl:attribute name="href">
1558 <xsl:value-of select="a:Locations/a:Location/a:Description/a:Text"/>
1559 </xsl:attribute>
1560 <xsl:value-of select="a:Locations/a:Location/a:Description/a:Text"/>
1561 </a>
1562 </td>
1563 <td>
1564 <a>
1565 <xsl:attribute name="href">
1566 <xsl:text>#</xsl:text>
1567 <xsl:value-of select="a:Source/a:Actor/a:ActorID"/>
1568 </xsl:attribute>
1569 <xsl:call-template name="actorName">
1570 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1571 </xsl:call-template>
1572 </a>
1573 </td>
1574 </tr>
1575 </xsl:for-each>
1576 </tbody>
1577 </table>
1578 </td>
1579 </tr>
1580 </xsl:if>
1581 </span>
1582 <tr>
1583 <td/>
1584 <td/>
1585 </tr>
1586 </tbody>
1587 </table>
1588 </td>
1589 </tr>
1590 <tr>
1591 <td/>
1592 </tr>
1593 </tbody>
1594 </table>
1595 <br/>
1596 <span id="actors">
1597 <span class="header">Additional Information About People &amp; Organizations</span>
1598 <xsl:if test="a:ContinuityOfCareRecord/a:Actors/a:Actor[a:Person]">
1599 <span id="people">
1600 <h4>People</h4>
1601 <table class="list" id="actorstable">
1602 <tbody>
1603 <tr>
1604 <th>Name</th>
1605 <th>Specialty</th>
1606 <th>Relation</th>
1607 <th>Identification Numbers</th>
1608 <th>Phone</th>
1609 <th>Address/ E-mail</th>
1610 </tr>
1611 <xsl:for-each select="a:ContinuityOfCareRecord/a:Actors/a:Actor">
1612 <xsl:sort data-type="text" order="ascending" select="a:Person/a:Name/a:DisplayName|a:Person/a:Name/a:CurrentName/a:Family"/>
1613 <xsl:if test="a:Person">
1614 <tr>
1615 <td>
1616 <a>
1617 <xsl:attribute name="name">
1618 <xsl:value-of select="a:ActorObjectID"/>
1619 </xsl:attribute>
1620 <xsl:call-template name="actorName">
1621 <xsl:with-param name="objID" select="a:ActorObjectID"/>
1622 </xsl:call-template>
1623 </a>
1624 </td>
1625 <td>
1626 <xsl:value-of select="a:Specialty/a:Text"/>
1627 </td>
1628 <td>
1629 <xsl:value-of select="a:Relation/a:Text"/>
1630 </td>
1631 <td>
1632 <table class="internal">
1633 <tbody>
1634 <xsl:for-each select="a:IDs">
1635 <tr>
1636 <td width="50%">
1637 <xsl:value-of select="a:Type/a:Text"/>
1638 </td>
1639 <td width="50%">
1640 <xsl:value-of select="a:ID"/>
1641 </td>
1642 </tr>
1643 </xsl:for-each>
1644 </tbody>
1645 </table>
1646 </td>
1647 <td>
1648 <table class="internal">
1649 <tbody>
1650 <xsl:for-each select="a:Telephone">
1651 <tr>
1652 <td width="50%">
1653 <xsl:value-of select="a:Type/a:Text"/>
1654 </td>
1655 <td width="50%">
1656 <xsl:value-of select="a:Value"/>
1657 </td>
1658 </tr>
1659 </xsl:for-each>
1660 </tbody>
1661 </table>
1662 </td>
1663 <td>
1664 <xsl:for-each select="a:Address">
1665 <xsl:if test="a:Type">
1666 <b>
1667 <xsl:value-of select="a:Type/a:Text"/>:</b>
1668 <br/>
1669 </xsl:if>
1670 <xsl:if test="a:Line1">
1671 <xsl:value-of select="a:Line1"/>
1672 <br/>
1673 </xsl:if>
1674 <xsl:if test="a:Line2">
1675 <xsl:value-of select="a:Line2"/>
1676 <br/>
1677 </xsl:if>
1678 <xsl:if test="a:City">
1679 <xsl:value-of select="a:City"/>,
1680 </xsl:if>
1681 <xsl:value-of select="a:State"/>
1682 <xsl:value-of select="a:PostalCode"/>
1683 <br/>
1684 </xsl:for-each>
1685 <xsl:for-each select="a:EMail">
1686 <br/>
1687 <xsl:value-of select="a:Value"/>
1688 </xsl:for-each>
1689 </td>
1690 </tr>
1691 </xsl:if>
1692 </xsl:for-each>
1693 </tbody>
1694 </table>
1695 </span>
1696 </xsl:if>
1697 <xsl:if test="a:ContinuityOfCareRecord/a:Actors/a:Actor[a:Organization]">
1698 <span id="organizations">
1699 <h4>Organizations</h4>
1700 <table class="list" id="organizationstable">
1701 <tbody>
1702 <tr>
1703 <th>Name</th>
1704 <th>Specialty</th>
1705 <th>Relation</th>
1706 <th>Identification Numbers</th>
1707 <th>Phone</th>
1708 <th>Address/ E-mail</th>
1709 </tr>
1710 <xsl:for-each select="a:ContinuityOfCareRecord/a:Actors/a:Actor">
1711 <xsl:sort data-type="text" order="ascending" select="a:Organization/a:Name"/>
1712 <xsl:if test="a:Organization">
1713 <tr>
1714 <td>
1715 <a>
1716 <xsl:attribute name="name">
1717 <xsl:value-of select="a:ActorObjectID"/>
1718 </xsl:attribute>
1719 <xsl:value-of select="a:Organization/a:Name"/>
1720 </a>
1721 </td>
1722 <td>
1723 <xsl:value-of select="a:Specialty/a:Text"/>
1724 </td>
1725 <td>
1726 <xsl:value-of select="a:Relation/a:Text"/>
1727 </td>
1728 <td>
1729 <table class="internal">
1730 <tbody>
1731 <xsl:for-each select="a:IDs">
1732 <tr>
1733 <td width="50%">
1734 <xsl:value-of select="a:Type/a:Text"/>
1735 </td>
1736 <td width="50%">
1737 <xsl:value-of select="a:ID"/>
1738 </td>
1739 </tr>
1740 </xsl:for-each>
1741 </tbody>
1742 </table>
1743 </td>
1744 <td>
1745 <table class="internal">
1746 <tbody>
1747 <xsl:for-each select="a:Telephone">
1748 <tr>
1749 <td width="50%">
1750 <xsl:value-of select="a:Type/a:Text"/>
1751 </td>
1752 <td width="50%">
1753 <xsl:value-of select="a:Value"/>
1754 </td>
1755 </tr>
1756 </xsl:for-each>
1757 </tbody>
1758 </table>
1759 </td>
1760 <td>
1761 <xsl:for-each select="a:Address">
1762 <xsl:if test="a:Type">
1763 <b>
1764 <xsl:value-of select="a:Type/a:Text"/>:</b>
1765 <br/>
1766 </xsl:if>
1767 <xsl:if test="a:Line1">
1768 <xsl:value-of select="a:Line1"/>
1769 <br/>
1770 </xsl:if>
1771 <xsl:if test="a:Line2">
1772 <xsl:value-of select="a:Line2"/>
1773 <br/>
1774 </xsl:if>
1775 <xsl:if test="a:City">
1776 <xsl:value-of select="a:City"/>,
1777 </xsl:if>
1778 <xsl:value-of select="a:State"/>
1779 <xsl:value-of select="a:PostalCode"/>
1780 <br/>
1781 </xsl:for-each>
1782 <xsl:for-each select="a:EMail">
1783 <br/>
1784 <xsl:value-of select="a:Value"/>
1785 </xsl:for-each>
1786 </td>
1787 </tr>
1788 </xsl:if>
1789 </xsl:for-each>
1790 </tbody>
1791 </table>
1792 </span>
1793 </xsl:if>
1794 <xsl:if test="a:ContinuityOfCareRecord/a:Actors/a:Actor[a:InformationSystem]">
1795 <span id="informationsystems">
1796 <h4>Information Systems</h4>
1797 <table class="list" id="informationsystemstable">
1798 <tbody>
1799 <tr>
1800 <th>Name</th>
1801 <th>Type</th>
1802 <th>Version</th>
1803 <th>Identification Numbers</th>
1804 <th>Phone</th>
1805 <th>Address/ E-mail</th>
1806 </tr>
1807 <xsl:for-each select="a:ContinuityOfCareRecord/a:Actors/a:Actor">
1808 <xsl:sort data-type="text" order="ascending" select="a:InformationSystem/a:Name"/>
1809 <xsl:if test="a:InformationSystem">
1810 <tr>
1811 <td>
1812 <a>
1813 <xsl:attribute name="name">
1814 <xsl:value-of select="a:ActorObjectID"/>
1815 </xsl:attribute>
1816 <xsl:value-of select="a:InformationSystem/a:Name"/>
1817 </a>
1818 </td>
1819 <td>
1820 <xsl:value-of select="a:InformationSystem/a:Type"/>
1821 </td>
1822 <td>
1823 <xsl:value-of select="a:InformationSystem/a:Version"/>
1824 </td>
1825 <td>
1826 <table class="internal">
1827 <tbody>
1828 <xsl:for-each select="a:IDs">
1829 <tr>
1830 <td width="50%">
1831 <xsl:value-of select="a:Type/a:Text"/>
1832 </td>
1833 <td width="50%">
1834 <xsl:value-of select="a:ID"/>
1835 </td>
1836 </tr>
1837 </xsl:for-each>
1838 </tbody>
1839 </table>
1840 </td>
1841 <td>
1842 <table class="internal">
1843 <tbody>
1844 <xsl:for-each select="a:Telephone">
1845 <tr>
1846 <td width="50%">
1847 <xsl:value-of select="a:Type/a:Text"/>
1848 </td>
1849 <td width="50%">
1850 <xsl:value-of select="a:Value"/>
1851 </td>
1852 </tr>
1853 </xsl:for-each>
1854 </tbody>
1855 </table>
1856 </td>
1857 <td>
1858 <xsl:for-each select="a:Address">
1859 <xsl:if test="Type">
1860 <b>
1861 <xsl:value-of select="a:Type/a:Text"/>:</b>
1862 <br/>
1863 </xsl:if>
1864 <xsl:if test="a:Line1">
1865 <xsl:value-of select="a:Line1"/>
1866 <br/>
1867 </xsl:if>
1868 <xsl:if test="a:Line2">
1869 <xsl:value-of select="a:Line2"/>
1870 <br/>
1871 </xsl:if>
1872 <xsl:if test="a:City">
1873 <xsl:value-of select="a:City"/>,
1874 </xsl:if>
1875 <xsl:value-of select="a:State"/>
1876 <xsl:value-of select="a:PostalCode"/>
1877 <br/>
1878 </xsl:for-each>
1879 <xsl:for-each select="a:EMail">
1880 <br/>
1881 <xsl:value-of select="a:Value"/>
1882 </xsl:for-each>
1883 </td>
1884 </tr>
1885 </xsl:if>
1886 </xsl:for-each>
1887 </tbody>
1888 </table>
1889 </span>
1890 </xsl:if>
1891 </span>
1892 <xsl:call-template name="footer"/>
1893 </body>
1894 </html>
1895 </xsl:template>
1896 <!-- date.format-date.template -->
1897 <!-- This is from the EXSLT.org Library (http://www.exslt.org/) -->
1898 <date:months>
1899 <date:month abbr="Jan" length="31">January</date:month>
1900 <date:month abbr="Feb" length="28">February</date:month>
1901 <date:month abbr="Mar" length="31">March</date:month>
1902 <date:month abbr="Apr" length="30">April</date:month>
1903 <date:month abbr="May" length="31">May</date:month>
1904 <date:month abbr="Jun" length="30">June</date:month>
1905 <date:month abbr="Jul" length="31">July</date:month>
1906 <date:month abbr="Aug" length="31">August</date:month>
1907 <date:month abbr="Sep" length="30">September</date:month>
1908 <date:month abbr="Oct" length="31">October</date:month>
1909 <date:month abbr="Nov" length="30">November</date:month>
1910 <date:month abbr="Dec" length="31">December</date:month>
1911 </date:months>
1912 <date:days>
1913 <date:day abbr="Sun">Sunday</date:day>
1914 <date:day abbr="Mon">Monday</date:day>
1915 <date:day abbr="Tue">Tuesday</date:day>
1916 <date:day abbr="Wed">Wednesday</date:day>
1917 <date:day abbr="Thu">Thursday</date:day>
1918 <date:day abbr="Fri">Friday</date:day>
1919 <date:day abbr="Sat">Saturday</date:day>
1920 </date:days>
1921 <xsl:template name="date:format-date">
1922 <xsl:param name="date-time"/>
1923 <xsl:param name="pattern"/>
1924 <xsl:variable name="formatted">
1925 <xsl:choose>
1926 <xsl:when test="starts-with($date-time, '---')">
1927 <xsl:call-template name="date:_format-date">
1928 <xsl:with-param name="year" select="'NaN'"/>
1929 <xsl:with-param name="month" select="'NaN'"/>
1930 <xsl:with-param name="day" select="number(substring($date-time, 4, 2))"/>
1931 <xsl:with-param name="pattern" select="$pattern"/>
1932 </xsl:call-template>
1933 </xsl:when>
1934 <xsl:when test="starts-with($date-time, '--')">
1935 <xsl:call-template name="date:_format-date">
1936 <xsl:with-param name="year" select="'NaN'"/>
1937 <xsl:with-param name="month" select="number(substring($date-time, 3, 2))"/>
1938 <xsl:with-param name="day" select="number(substring($date-time, 6, 2))"/>
1939 <xsl:with-param name="pattern" select="$pattern"/>
1940 </xsl:call-template>
1941 </xsl:when>
1942 <xsl:otherwise>
1943 <xsl:variable name="neg" select="starts-with($date-time, '-')"/>
1944 <xsl:variable name="no-neg">
1945 <xsl:choose>
1946 <xsl:when test="$neg or starts-with($date-time, '+')">
1947 <xsl:value-of select="substring($date-time, 2)"/>
1948 </xsl:when>
1949 <xsl:otherwise>
1950 <xsl:value-of select="$date-time"/>
1951 </xsl:otherwise>
1952 </xsl:choose>
1953 </xsl:variable>
1954 <xsl:variable name="no-neg-length" select="string-length($no-neg)"/>
1955 <xsl:variable name="timezone">
1956 <xsl:choose>
1957 <xsl:when test="substring($no-neg, $no-neg-length) = 'Z'">Z</xsl:when>
1958 <xsl:otherwise>
1959 <xsl:variable name="tz" select="substring($no-neg, $no-neg-length - 5)"/>
1960 <xsl:value-of select="$tz"/>
1961 </xsl:otherwise>
1962 </xsl:choose>
1963 </xsl:variable>
1964 <xsl:if test="not(string($timezone)) or $timezone = 'Z' or (substring($timezone, 2, 2) &lt;= 23 and substring($timezone, 5, 2) &lt;= 59)">
1965 <xsl:variable name="dt" select="substring($no-neg, 1, $no-neg-length - string-length($timezone))"/>
1966 <xsl:variable name="dt-length" select="string-length($dt)"/>
1967 <xsl:choose>
1968 <xsl:when test="substring($dt, 3, 1) = ':' and substring($dt, 6, 1) = ':'">
1969 <xsl:variable name="hour" select="substring($dt, 1, 2)"/>
1970 <xsl:variable name="min" select="substring($dt, 4, 2)"/>
1971 <xsl:variable name="sec" select="substring($dt, 7)"/>
1972 <xsl:if test="$hour &lt;= 23 and $min &lt;= 59 and $sec &lt;= 60">
1973 <xsl:call-template name="date:_format-date">
1974 <xsl:with-param name="year" select="'NaN'"/>
1975 <xsl:with-param name="month" select="'NaN'"/>
1976 <xsl:with-param name="day" select="'NaN'"/>
1977 <xsl:with-param name="hour" select="$hour"/>
1978 <xsl:with-param name="minute" select="$min"/>
1979 <xsl:with-param name="second" select="$sec"/>
1980 <xsl:with-param name="timezone" select="$timezone"/>
1981 <xsl:with-param name="pattern" select="$pattern"/>
1982 </xsl:call-template>
1983 </xsl:if>
1984 </xsl:when>
1985 <xsl:otherwise>
1986 <xsl:variable name="year" select="substring($dt, 1, 4) * (($neg * -2) + 1)"/>
1987 <xsl:choose>
1988 <xsl:when test="not(number($year))"/>
1989 <xsl:when test="$dt-length = 4">
1990 <xsl:call-template name="date:_format-date">
1991 <xsl:with-param name="year" select="$year"/>
1992 <xsl:with-param name="timezone" select="$timezone"/>
1993 <xsl:with-param name="pattern" select="$pattern"/>
1994 </xsl:call-template>
1995 </xsl:when>
1996 <xsl:when test="substring($dt, 5, 1) = '-'">
1997 <xsl:variable name="month" select="substring($dt, 6, 2)"/>
1998 <xsl:choose>
1999 <xsl:when test="not($month &lt;= 12)"/>
2000 <xsl:when test="$dt-length = 7">
2001 <xsl:call-template name="date:_format-date">
2002 <xsl:with-param name="year" select="$year"/>
2003 <xsl:with-param name="month" select="$month"/>
2004 <xsl:with-param name="timezone" select="$timezone"/>
2005 <xsl:with-param name="pattern" select="$pattern"/>
2006 </xsl:call-template>
2007 </xsl:when>
2008 <xsl:when test="substring($dt, 8, 1) = '-'">
2009 <xsl:variable name="day" select="substring($dt, 9, 2)"/>
2010 <xsl:if test="$day &lt;= 31">
2011 <xsl:choose>
2012 <xsl:when test="$dt-length = 10">
2013 <xsl:call-template name="date:_format-date">
2014 <xsl:with-param name="year" select="$year"/>
2015 <xsl:with-param name="month" select="$month"/>
2016 <xsl:with-param name="day" select="$day"/>
2017 <xsl:with-param name="timezone" select="$timezone"/>
2018 <xsl:with-param name="pattern" select="$pattern"/>
2019 </xsl:call-template>
2020 </xsl:when>
2021 <xsl:when test="substring($dt, 11, 1) = 'T' and substring($dt, 14, 1) = ':' and substring($dt, 17, 1) = ':'">
2022 <xsl:variable name="hour" select="substring($dt, 12, 2)"/>
2023 <xsl:variable name="min" select="substring($dt, 15, 2)"/>
2024 <xsl:variable name="sec" select="substring($dt, 18)"/>
2025 <xsl:if test="$hour &lt;= 23 and $min &lt;= 59 and $sec &lt;= 60">
2026 <xsl:call-template name="date:_format-date">
2027 <xsl:with-param name="year" select="$year"/>
2028 <xsl:with-param name="month" select="$month"/>
2029 <xsl:with-param name="day" select="$day"/>
2030 <xsl:with-param name="hour" select="$hour"/>
2031 <xsl:with-param name="minute" select="$min"/>
2032 <xsl:with-param name="second" select="$sec"/>
2033 <xsl:with-param name="timezone" select="$timezone"/>
2034 <xsl:with-param name="pattern" select="$pattern"/>
2035 </xsl:call-template>
2036 </xsl:if>
2037 </xsl:when>
2038 </xsl:choose>
2039 </xsl:if>
2040 </xsl:when>
2041 </xsl:choose>
2042 </xsl:when>
2043 </xsl:choose>
2044 </xsl:otherwise>
2045 </xsl:choose>
2046 </xsl:if>
2047 </xsl:otherwise>
2048 </xsl:choose>
2049 </xsl:variable>
2050 <xsl:value-of select="$formatted"/>
2051 </xsl:template>
2052 <xsl:template name="date:_format-date">
2053 <xsl:param name="year"/>
2054 <xsl:param name="month" select="1"/>
2055 <xsl:param name="day" select="1"/>
2056 <xsl:param name="hour" select="0"/>
2057 <xsl:param name="minute" select="0"/>
2058 <xsl:param name="second" select="0"/>
2059 <xsl:param name="timezone" select="'Z'"/>
2060 <xsl:param name="pattern" select="''"/>
2061 <xsl:variable name="char" select="substring($pattern, 1, 1)"/>
2062 <xsl:choose>
2063 <xsl:when test="not($pattern)"/>
2064 <xsl:when test="$char = &quot;'&quot;">
2065 <xsl:choose>
2066 <xsl:when test="substring($pattern, 2, 1) = &quot;'&quot;">
2067 <xsl:text>'</xsl:text>
2068 <xsl:call-template name="date:_format-date">
2069 <xsl:with-param name="year" select="$year"/>
2070 <xsl:with-param name="month" select="$month"/>
2071 <xsl:with-param name="day" select="$day"/>
2072 <xsl:with-param name="hour" select="$hour"/>
2073 <xsl:with-param name="minute" select="$minute"/>
2074 <xsl:with-param name="second" select="$second"/>
2075 <xsl:with-param name="timezone" select="$timezone"/>
2076 <xsl:with-param name="pattern" select="substring($pattern, 3)"/>
2077 </xsl:call-template>
2078 </xsl:when>
2079 <xsl:otherwise>
2080 <xsl:variable name="literal-value" select="substring-before(substring($pattern, 2), &quot;'&quot;)"/>
2081 <xsl:value-of select="$literal-value"/>
2082 <xsl:call-template name="date:_format-date">
2083 <xsl:with-param name="year" select="$year"/>
2084 <xsl:with-param name="month" select="$month"/>
2085 <xsl:with-param name="day" select="$day"/>
2086 <xsl:with-param name="hour" select="$hour"/>
2087 <xsl:with-param name="minute" select="$minute"/>
2088 <xsl:with-param name="second" select="$second"/>
2089 <xsl:with-param name="timezone" select="$timezone"/>
2090 <xsl:with-param name="pattern" select="substring($pattern, string-length($literal-value) + 2)"/>
2091 </xsl:call-template>
2092 </xsl:otherwise>
2093 </xsl:choose>
2094 </xsl:when>
2095 <xsl:when test="not(contains('abcdefghjiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', $char))">
2096 <xsl:value-of select="$char"/>
2097 <xsl:call-template name="date:_format-date">
2098 <xsl:with-param name="year" select="$year"/>
2099 <xsl:with-param name="month" select="$month"/>
2100 <xsl:with-param name="day" select="$day"/>
2101 <xsl:with-param name="hour" select="$hour"/>
2102 <xsl:with-param name="minute" select="$minute"/>
2103 <xsl:with-param name="second" select="$second"/>
2104 <xsl:with-param name="timezone" select="$timezone"/>
2105 <xsl:with-param name="pattern" select="substring($pattern, 2)"/>
2106 </xsl:call-template>
2107 </xsl:when>
2108 <xsl:when test="not(contains('GyMdhHmsSEDFwWakKz', $char))">
2109 <xsl:message>
2110 Invalid token in format string: <xsl:value-of select="$char"/>
2111 </xsl:message>
2112 <xsl:call-template name="date:_format-date">
2113 <xsl:with-param name="year" select="$year"/>
2114 <xsl:with-param name="month" select="$month"/>
2115 <xsl:with-param name="day" select="$day"/>
2116 <xsl:with-param name="hour" select="$hour"/>
2117 <xsl:with-param name="minute" select="$minute"/>
2118 <xsl:with-param name="second" select="$second"/>
2119 <xsl:with-param name="timezone" select="$timezone"/>
2120 <xsl:with-param name="pattern" select="substring($pattern, 2)"/>
2121 </xsl:call-template>
2122 </xsl:when>
2123 <xsl:otherwise>
2124 <xsl:variable name="next-different-char" select="substring(translate($pattern, $char, ''), 1, 1)"/>
2125 <xsl:variable name="pattern-length">
2126 <xsl:choose>
2127 <xsl:when test="$next-different-char">
2128 <xsl:value-of select="string-length(substring-before($pattern, $next-different-char))"/>
2129 </xsl:when>
2130 <xsl:otherwise>
2131 <xsl:value-of select="string-length($pattern)"/>
2132 </xsl:otherwise>
2133 </xsl:choose>
2134 </xsl:variable>
2135 <xsl:choose>
2136 <xsl:when test="$char = 'G'">
2137 <xsl:choose>
2138 <xsl:when test="string($year) = 'NaN'"/>
2139 <xsl:when test="$year > 0">AD</xsl:when>
2140 <xsl:otherwise>BC</xsl:otherwise>
2141 </xsl:choose>
2142 </xsl:when>
2143 <xsl:when test="$char = 'M'">
2144 <xsl:choose>
2145 <xsl:when test="string($month) = 'NaN'"/>
2146 <xsl:when test="$pattern-length >= 3">
2147 <xsl:variable name="month-node" select="document('')/*/date:months/date:month[number($month)]"/>
2148 <xsl:choose>
2149 <xsl:when test="$pattern-length >= 4">
2150 <xsl:value-of select="$month-node"/>
2151 </xsl:when>
2152 <xsl:otherwise>
2153 <xsl:value-of select="$month-node/@abbr"/>
2154 </xsl:otherwise>
2155 </xsl:choose>
2156 </xsl:when>
2157 <xsl:when test="$pattern-length = 2">
2158 <xsl:value-of select="format-number($month, '00')"/>
2159 </xsl:when>
2160 <xsl:otherwise>
2161 <xsl:value-of select="$month"/>
2162 </xsl:otherwise>
2163 </xsl:choose>
2164 </xsl:when>
2165 <xsl:when test="$char = 'E'">
2166 <xsl:choose>
2167 <xsl:when test="string($year) = 'NaN' or string($month) = 'NaN' or string($day) = 'NaN'"/>
2168 <xsl:otherwise>
2169 <xsl:variable name="month-days" select="sum(document('')/*/date:months/date:month[position() &lt; $month]/@length)"/>
2170 <xsl:variable name="days" select="$month-days + $day + boolean(((not(boolean($year mod 4)) and $year mod 100) or not(boolean($year mod 400))) and $month > 2)"/>
2171 <xsl:variable name="y-1" select="$year - 1"/>
2172 <xsl:variable name="dow" select="(($y-1 + floor($y-1 div 4) - floor($y-1 div 100) + floor($y-1 div 400) + $days) mod 7) + 1"/>
2173 <xsl:variable name="day-node" select="document('')/*/date:days/date:day[number($dow)]"/>
2174 <xsl:choose>
2175 <xsl:when test="$pattern-length >= 4">
2176 <xsl:value-of select="$day-node"/>
2177 </xsl:when>
2178 <xsl:otherwise>
2179 <xsl:value-of select="$day-node/@abbr"/>
2180 </xsl:otherwise>
2181 </xsl:choose>
2182 </xsl:otherwise>
2183 </xsl:choose>
2184 </xsl:when>
2185 <xsl:when test="$char = 'a'">
2186 <xsl:choose>
2187 <xsl:when test="string($hour) = 'NaN'"/>
2188 <xsl:when test="$hour >= 12">PM</xsl:when>
2189 <xsl:otherwise>AM</xsl:otherwise>
2190 </xsl:choose>
2191 </xsl:when>
2192 <xsl:when test="$char = 'z'">
2193 <xsl:choose>
2194 <xsl:when test="$timezone = 'Z'">UTC</xsl:when>
2195 <xsl:otherwise>UTC<xsl:value-of select="$timezone"/>
2196 </xsl:otherwise>
2197 </xsl:choose>
2198 </xsl:when>
2199 <xsl:otherwise>
2200 <xsl:variable name="padding">
2201 <xsl:choose>
2202 <xsl:when test="$pattern-length > 10">
2203 <xsl:call-template name="str:padding">
2204 <xsl:with-param name="length" select="$pattern-length"/>
2205 <xsl:with-param name="chars" select="'0'"/>
2206 </xsl:call-template>
2207 </xsl:when>
2208 <xsl:otherwise>
2209 <xsl:value-of select="substring('0000000000', 1, $pattern-length)"/>
2210 </xsl:otherwise>
2211 </xsl:choose>
2212 </xsl:variable>
2213 <xsl:choose>
2214 <xsl:when test="$char = 'y'">
2215 <xsl:choose>
2216 <xsl:when test="string($year) = 'NaN'"/>
2217 <xsl:when test="$pattern-length > 2">
2218 <xsl:value-of select="format-number($year, $padding)"/>
2219 </xsl:when>
2220 <xsl:otherwise>
2221 <xsl:value-of select="format-number(substring($year, string-length($year) - 1), $padding)"/>
2222 </xsl:otherwise>
2223 </xsl:choose>
2224 </xsl:when>
2225 <xsl:when test="$char = 'd'">
2226 <xsl:choose>
2227 <xsl:when test="string($day) = 'NaN'"/>
2228 <xsl:otherwise>
2229 <xsl:value-of select="format-number($day, $padding)"/>
2230 </xsl:otherwise>
2231 </xsl:choose>
2232 </xsl:when>
2233 <xsl:when test="$char = 'h'">
2234 <xsl:variable name="h" select="$hour mod 12"/>
2235 <xsl:choose>
2236 <xsl:when test="string($hour) = 'NaN'"/>
2237 <xsl:when test="$h">
2238 <xsl:value-of select="format-number($h, $padding)"/>
2239 </xsl:when>
2240 <xsl:otherwise>
2241 <xsl:value-of select="format-number(12, $padding)"/>
2242 </xsl:otherwise>
2243 </xsl:choose>
2244 </xsl:when>
2245 <xsl:when test="$char = 'H'">
2246 <xsl:choose>
2247 <xsl:when test="string($hour) = 'NaN'"/>
2248 <xsl:otherwise>
2249 <xsl:value-of select="format-number($hour, $padding)"/>
2250 </xsl:otherwise>
2251 </xsl:choose>
2252 </xsl:when>
2253 <xsl:when test="$char = 'k'">
2254 <xsl:choose>
2255 <xsl:when test="string($hour) = 'NaN'"/>
2256 <xsl:when test="$hour">
2257 <xsl:value-of select="format-number($hour, $padding)"/>
2258 </xsl:when>
2259 <xsl:otherwise>
2260 <xsl:value-of select="format-number(24, $padding)"/>
2261 </xsl:otherwise>
2262 </xsl:choose>
2263 </xsl:when>
2264 <xsl:when test="$char = 'K'">
2265 <xsl:choose>
2266 <xsl:when test="string($hour) = 'NaN'"/>
2267 <xsl:otherwise>
2268 <xsl:value-of select="format-number($hour mod 12, $padding)"/>
2269 </xsl:otherwise>
2270 </xsl:choose>
2271 </xsl:when>
2272 <xsl:when test="$char = 'm'">
2273 <xsl:choose>
2274 <xsl:when test="string($minute) = 'NaN'"/>
2275 <xsl:otherwise>
2276 <xsl:value-of select="format-number($minute, $padding)"/>
2277 </xsl:otherwise>
2278 </xsl:choose>
2279 </xsl:when>
2280 <xsl:when test="$char = 's'">
2281 <xsl:choose>
2282 <xsl:when test="string($second) = 'NaN'"/>
2283 <xsl:otherwise>
2284 <xsl:value-of select="format-number($second, $padding)"/>
2285 </xsl:otherwise>
2286 </xsl:choose>
2287 </xsl:when>
2288 <xsl:when test="$char = 'S'">
2289 <xsl:choose>
2290 <xsl:when test="string($second) = 'NaN'"/>
2291 <xsl:otherwise>
2292 <xsl:value-of select="format-number(substring-after($second, '.'), $padding)"/>
2293 </xsl:otherwise>
2294 </xsl:choose>
2295 </xsl:when>
2296 <xsl:when test="$char = 'F'">
2297 <xsl:choose>
2298 <xsl:when test="string($day) = 'NaN'"/>
2299 <xsl:otherwise>
2300 <xsl:value-of select="floor($day div 7) + 1"/>
2301 </xsl:otherwise>
2302 </xsl:choose>
2303 </xsl:when>
2304 <xsl:when test="string($year) = 'NaN' or string($month) = 'NaN' or string($day) = 'NaN'"/>
2305 <xsl:otherwise>
2306 <xsl:variable name="month-days" select="sum(document('')/*/date:months/date:month[position() &lt; $month]/@length)"/>
2307 <xsl:variable name="days" select="$month-days + $day + boolean(((not($year mod 4) and $year mod 100) or not($year mod 400)) and $month > 2)"/>
2308 <xsl:choose>
2309 <xsl:when test="$char = 'D'">
2310 <xsl:value-of select="format-number($days, $padding)"/>
2311 </xsl:when>
2312 <xsl:when test="$char = 'w'">
2313 <xsl:call-template name="date:_week-in-year">
2314 <xsl:with-param name="days" select="$days"/>
2315 <xsl:with-param name="year" select="$year"/>
2316 </xsl:call-template>
2317 </xsl:when>
2318 <xsl:when test="$char = 'W'">
2319 <xsl:variable name="y-1" select="$year - 1"/>
2320 <xsl:variable name="day-of-week" select="(($y-1 + floor($y-1 div 4) - floor($y-1 div 100) + floor($y-1 div 400) + $days) mod 7) + 1"/>
2321 <xsl:choose>
2322 <xsl:when test="($day - $day-of-week) mod 7">
2323 <xsl:value-of select="floor(($day - $day-of-week) div 7) + 2"/>
2324 </xsl:when>
2325 <xsl:otherwise>
2326 <xsl:value-of select="floor(($day - $day-of-week) div 7) + 1"/>
2327 </xsl:otherwise>
2328 </xsl:choose>
2329 </xsl:when>
2330 </xsl:choose>
2331 </xsl:otherwise>
2332 </xsl:choose>
2333 </xsl:otherwise>
2334 </xsl:choose>
2335 <xsl:call-template name="date:_format-date">
2336 <xsl:with-param name="year" select="$year"/>
2337 <xsl:with-param name="month" select="$month"/>
2338 <xsl:with-param name="day" select="$day"/>
2339 <xsl:with-param name="hour" select="$hour"/>
2340 <xsl:with-param name="minute" select="$minute"/>
2341 <xsl:with-param name="second" select="$second"/>
2342 <xsl:with-param name="timezone" select="$timezone"/>
2343 <xsl:with-param name="pattern" select="substring($pattern, $pattern-length + 1)"/>
2344 </xsl:call-template>
2345 </xsl:otherwise>
2346 </xsl:choose>
2347 </xsl:template>
2348 <xsl:template name="date:_week-in-year">
2349 <xsl:param name="days"/>
2350 <xsl:param name="year"/>
2351 <xsl:variable name="y-1" select="$year - 1"/>
2352 <!-- this gives the day of the week, counting from Sunday = 0 -->
2353 <xsl:variable name="day-of-week" select="($y-1 + floor($y-1 div 4) - floor($y-1 div 100) + floor($y-1 div 400) + $days) mod 7"/>
2354 <!-- this gives the day of the week, counting from Monday = 1 -->
2355 <xsl:variable name="dow">
2356 <xsl:choose>
2357 <xsl:when test="$day-of-week">
2358 <xsl:value-of select="$day-of-week"/>
2359 </xsl:when>
2360 <xsl:otherwise>7</xsl:otherwise>
2361 </xsl:choose>
2362 </xsl:variable>
2363 <xsl:variable name="start-day" select="($days - $dow + 7) mod 7"/>
2364 <xsl:variable name="week-number" select="floor(($days - $dow + 7) div 7)"/>
2365 <xsl:choose>
2366 <xsl:when test="$start-day >= 4">
2367 <xsl:value-of select="$week-number + 1"/>
2368 </xsl:when>
2369 <xsl:otherwise>
2370 <xsl:choose>
2371 <xsl:when test="not($week-number)">
2372 <xsl:call-template name="date:_week-in-year">
2373 <xsl:with-param name="days" select="365 + ((not($y-1 mod 4) and $y-1 mod 100) or not($y-1 mod 400))"/>
2374 <xsl:with-param name="year" select="$y-1"/>
2375 </xsl:call-template>
2376 </xsl:when>
2377 <xsl:otherwise>
2378 <xsl:value-of select="$week-number"/>
2379 </xsl:otherwise>
2380 </xsl:choose>
2381 </xsl:otherwise>
2382 </xsl:choose>
2383 </xsl:template>
2384 <!-- str.padding.template.xsl -->
2385 <!-- This is from the EXSLT.org Library (http://www.exslt.org/) -->
2386 <xsl:template name="str:padding">
2387 <xsl:param name="length" select="0"/>
2388 <xsl:param name="chars" select="' '"/>
2389 <xsl:choose>
2390 <xsl:when test="not($length) or not($chars)"/>
2391 <xsl:otherwise>
2392 <xsl:variable name="string" select="concat($chars, $chars, $chars, $chars, $chars, $chars, $chars, $chars, $chars, $chars)"/>
2393 <xsl:choose>
2394 <xsl:when test="string-length($string) >= $length">
2395 <xsl:value-of select="substring($string, 1, $length)"/>
2396 </xsl:when>
2397 <xsl:otherwise>
2398 <xsl:call-template name="str:padding">
2399 <xsl:with-param name="length" select="$length"/>
2400 <xsl:with-param name="chars" select="$string"/>
2401 </xsl:call-template>
2402 </xsl:otherwise>
2403 </xsl:choose>
2404 </xsl:otherwise>
2405 </xsl:choose>
2406 </xsl:template>
2407 <!-- actor.xsl -->
2408 <!-- Returns the name of the actor, if there is no name it returns the ActorObjectID that was passed in -->
2409 <xsl:template name="actorName">
2410 <xsl:param name="objID"/>
2411 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Actors/a:Actor">
2412 <xsl:variable name="thisObjID" select="a:ActorObjectID"/>
2413 <xsl:if test="$objID = $thisObjID">
2414 <xsl:choose>
2415 <xsl:when test="a:Person">
2416 <xsl:choose>
2417 <xsl:when test="a:Person/a:Name/a:DisplayName">
2418 <xsl:value-of select="a:Person/a:Name/a:DisplayName"/>
2419 </xsl:when>
2420 <xsl:when test="a:Person/a:Name/a:CurrentName">
2421 <xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Given"/>
2422 <xsl:text xml:space="preserve"> </xsl:text>
2423 <xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Middle"/>
2424 <xsl:text xml:space="preserve"> </xsl:text>
2425 <xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Family"/>
2426 <xsl:text xml:space="preserve"> </xsl:text>
2427 <xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Suffix"/>
2428 <xsl:text xml:space="preserve"> </xsl:text>
2429 <xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Title"/>
2430 <xsl:text xml:space="preserve"> </xsl:text>
2431 </xsl:when>
2432 <xsl:when test="a:Person/a:Name/a:BirthName">
2433 <xsl:value-of select="a:Person/a:Name/a:BirthName/a:Given"/>
2434 <xsl:text xml:space="preserve"> </xsl:text>
2435 <xsl:value-of select="a:Person/a:Name/a:BirthName/a:Middle"/>
2436 <xsl:text xml:space="preserve"> </xsl:text>
2437 <xsl:value-of select="a:Person/a:Name/a:BirthName/a:Family"/>
2438 <xsl:text xml:space="preserve"> </xsl:text>
2439 <xsl:value-of select="a:Person/a:Name/a:BirthName/a:Suffix"/>
2440 <xsl:text xml:space="preserve"> </xsl:text>
2441 <xsl:value-of select="a:Person/a:Name/a:BirthName/a:Title"/>
2442 <xsl:text xml:space="preserve"> </xsl:text>
2443 </xsl:when>
2444 <xsl:when test="a:Person/a:Name/a:AdditionalName">
2445 <xsl:for-each select="a:Person/a:Name/a:AdditionalName">
2446 <xsl:value-of select="a:Given"/>
2447 <xsl:text xml:space="preserve"> </xsl:text>
2448 <xsl:value-of select="a:Middle"/>
2449 <xsl:text xml:space="preserve"> </xsl:text>
2450 <xsl:value-of select="a:Family"/>
2451 <xsl:text xml:space="preserve"> </xsl:text>
2452 <xsl:value-of select="a:Suffix"/>
2453 <xsl:text xml:space="preserve"> </xsl:text>
2454 <xsl:value-of select="a:Title"/>
2455 <xsl:text xml:space="preserve"> </xsl:text>
2456 <xsl:if test="position() != last()">
2457 <br/>
2458 </xsl:if>
2459 </xsl:for-each>
2460 </xsl:when>
2461 </xsl:choose>
2462 </xsl:when>
2463 <xsl:when test="a:Organization">
2464 <xsl:value-of select="a:Organization/a:Name"/>
2465 </xsl:when>
2466 <xsl:when test="a:InformationSystem">
2467 <xsl:value-of select="a:InformationSystem/a:Name"/>
2468 <xsl:text xml:space="preserve"> </xsl:text>
2469 <xsl:if test="a:InformationSystem/a:Version">
2470 <xsl:value-of select="a:InformationSystem/a:Version"/>
2471 <xsl:text xml:space="preserve"> </xsl:text>
2472 </xsl:if>
2473 <xsl:if test="a:InformationSystem/a:Type">(<xsl:value-of select="a:InformationSystem/a:Type"/>)</xsl:if>
2474 </xsl:when>
2475 <xsl:otherwise>
2476 <xsl:value-of select="$objID"/>
2477 </xsl:otherwise>
2478 </xsl:choose>
2479 </xsl:if>
2480 </xsl:for-each>
2481 </xsl:template>
2482 <!-- code.xsl -->
2483 <xsl:template match="a:Code">
2484 <xsl:value-of select="a:Value"/>
2485 <xsl:if test="a:CodingSystem">
2486 <xsl:text xml:space="preserve"> </xsl:text>(<xsl:value-of select="a:CodingSystem"/>)
2487 </xsl:if>
2488 </xsl:template>
2489 <!--datetime. xsl -->
2490 <!-- Displays the DateTime. If ExactDateTime is present, it will format according
2491 to the 'fmt' variable. The default format is: Oct 31, 2005 -->
2492 <xsl:template match="DateTime" name="dateTime">
2493 <xsl:param name="dt" select="."/>
2494 <xsl:param name="fmt">MMM dd, yyyy</xsl:param>
2495 <tr>
2496 <xsl:if test="$dt/a:Type/a:Text">
2497 <td>
2498 <xsl:value-of select="$dt/a:Type/a:Text"/>:</td>
2499 </xsl:if>
2500 <xsl:choose>
2501 <xsl:when test="$dt/a:ExactDateTime">
2502 <td>
2503 <xsl:call-template name="date:format-date">
2504 <xsl:with-param name="date-time">
2505 <xsl:value-of select="$dt/a:ExactDateTime"/>
2506 </xsl:with-param>
2507 <xsl:with-param name="pattern" select="$fmt"/>
2508 </xsl:call-template>
2509 </td>
2510 </xsl:when>
2511 <xsl:when test="$dt/a:Age">
2512 <td>
2513 <xsl:value-of select="$dt/a:Age/a:Value"/>
2514 <xsl:text xml:space="preserve"> </xsl:text>
2515 <xsl:value-of select="$dt/a:Age/a:Units/a:Unit"/>
2516 </td>
2517 </xsl:when>
2518 <xsl:when test="$dt/a:ApproximateDateTime">
2519 <td>
2520 <xsl:value-of select="$dt/a:ApproximateDateTime/a:Text"/>
2521 </td>
2522 </xsl:when>
2523 <xsl:when test="$dt/a:DateTimeRange">
2524 <td>
2525 <xsl:for-each select="$dt/a:DateTimeRange/a:BeginRange">
2526 <xsl:choose>
2527 <xsl:when test="$dt/a:ExactDateTime">
2528 <xsl:call-template name="date:format-date">
2529 <xsl:with-param name="date-time">
2530 <xsl:value-of select="$dt/a:ExactDateTime"/>
2531 </xsl:with-param>
2532 <xsl:with-param name="pattern" select="$fmt"/>
2533 </xsl:call-template>
2534 </xsl:when>
2535 <xsl:when test="$dt/a:Age">
2536 <xsl:value-of select="$dt/a:Age/a:Value"/>
2537 <xsl:text xml:space="preserve"> </xsl:text>
2538 <xsl:value-of select="$dt/a:Age/a:Units/a:Unit"/>
2539 </xsl:when>
2540 <xsl:when test="$dt/a:ApproximateDateTime">
2541 <xsl:value-of select="$dt/a:ApproximateDateTime/a:Text"/>
2542 </xsl:when>
2543 <xsl:otherwise/>
2544 </xsl:choose>
2545 </xsl:for-each>
2546 <xsl:text xml:space="preserve"> </xsl:text>
2547 <xsl:text>-</xsl:text>
2548 <xsl:text xml:space="preserve"> </xsl:text>
2549 <xsl:for-each select="$dt/a:DateTimeRange/a:EndRange">
2550 <xsl:choose>
2551 <xsl:when test="$dt/a:ExactDateTime">
2552 <xsl:call-template name="date:format-date">
2553 <xsl:with-param name="date-time">
2554 <xsl:value-of select="$dt/a:ExactDateTime"/>
2555 </xsl:with-param>
2556 <xsl:with-param name="pattern" select="$fmt"/>
2557 </xsl:call-template>
2558 </xsl:when>
2559 <xsl:when test="$dt/a:Age">
2560 <xsl:value-of select="$dt/a:Age/a:Value"/>
2561 <xsl:text xml:space="preserve"> </xsl:text>
2562 <xsl:value-of select="$dt/a:Age/a:Units/a:Unit"/>
2563 </xsl:when>
2564 <xsl:when test="$dt/a:ApproximateDateTime">
2565 <xsl:value-of select="$dt/a:ApproximateDateTime/a:Text"/>
2566 </xsl:when>
2567 <xsl:otherwise/>
2568 </xsl:choose>
2569 </xsl:for-each>
2570 </td>
2571 </xsl:when>
2572 <xsl:otherwise/>
2573 </xsl:choose>
2574 </tr>
2575 </xsl:template>
2576 <!-- defaultCSS.xsl -->
2577 <xsl:template name="defaultCCS">
2578 <style type="text/css">&lt;!--
2579*{
2580 font-size: small;
2581 font-family: Arial, sans-serif;
2582}
2583h1{
2584 font-size: 150%;
2585}
2586strong.clinical {
2587 color: #3300FF;
2588}
2589p {
2590 margin-left: 20px
2591}
2592span.header{
2593 font-weight: bold;
2594 font-size: medium;
2595 line-height: 16pt;
2596 padding-top: 10px;
2597}
2598table.list {
2599 padding-bottom: 5px;
2600 border: thin solid #cccccc;
2601 border-style-internal: thin solid #cccccc;
2602 BORDER-COLLAPSE: collapse;
2603 background: white;
2604 background-image: none
2605}
2606table.list th {
2607 text-align: left;
2608 FONT-WEIGHT: bold;
2609 COLOR: white;
2610 background: #006699;
2611 background-image: none
2612}
2613table.list td {
2614 padding: 5px;
2615 border: thin solid #cccccc;
2616 vertical-align: top;
2617}
2618table.internal {
2619 border: none;
2620}
2621table.internal td {
2622 vertical-align: top;
2623 padding: 1px;
2624 border: none;
2625}
2626table.internal tr.even{
2627 background: #CEFFFF;
2628 background-image: none
2629}
2630--&gt;</style>
2631 </xsl:template>
2632 <!-- directions.xsl -->
2633 <xsl:template match="a:Directions">
2634 <xsl:for-each select="a:Direction">
2635 <xsl:choose>
2636 <xsl:when test="position() mod 2=0">
2637 <tr class="even">
2638 <xsl:choose>
2639 <xsl:when test="a:Description/a:Text">
2640 <td>
2641 <xsl:value-of select="a:Description/a:Text"/>
2642 </td>
2643 </xsl:when>
2644 <xsl:otherwise>
2645 <td>
2646 <xsl:value-of select="a:DeliveryMethod/a:Text"/>
2647 <xsl:text xml:space="preserve"> </xsl:text>
2648 <xsl:value-of select="a:Dose/a:Value"/>
2649 <xsl:text xml:space="preserve"> </xsl:text>
2650 <xsl:value-of select="a:Dose/a:Units/a:Unit"/>
2651 <xsl:text xml:space="preserve"> </xsl:text>
2652 <xsl:value-of select="a:Route/a:Text"/>
2653 <xsl:text xml:space="preserve"> </xsl:text>
2654 <xsl:value-of select="a:Frequency/a:Value"/>
2655 <xsl:if test="a:Duration">
2656 <xsl:text xml:space="preserve"> </xsl:text>(for <xsl:value-of select="a:Duration/a:Value"/>
2657 <xsl:text xml:space="preserve"> </xsl:text>
2658 <xsl:value-of select="a:Duration/a:Units/a:Unit"/>)
2659 </xsl:if>
2660 </td>
2661 <xsl:if test="a:MultipleDirectionModifier/a:ObjectAttribute">
2662 <td>
2663 <xsl:if test="a:MultipleDirectionModifier/a:Text">
2664 <xsl:value-of select="a:MultipleDirectionModifier/a:Text"/>
2665 <xsl:text xml:space="preserve"> </xsl:text>
2666 </xsl:if>
2667 <xsl:for-each select="a:MultipleDirectionModifier/a:ObjectAttribute">
2668 <xsl:value-of select="a:Attribute"/>
2669 <br/>
2670 <xsl:value-of select="a:AttributeValue/a:Value"/>
2671 </xsl:for-each>
2672 </td>
2673 </xsl:if>
2674 </xsl:otherwise>
2675 </xsl:choose>
2676 </tr>
2677 </xsl:when>
2678 <xsl:otherwise>
2679 <tr class="odd">
2680 <xsl:choose>
2681 <xsl:when test="a:Description/a:Text">
2682 <td>
2683 <xsl:value-of select="a:Description/a:Text"/>
2684 </td>
2685 </xsl:when>
2686 <xsl:otherwise>
2687 <td>
2688 <xsl:value-of select="a:DeliveryMethod/a:Text"/>
2689 <xsl:text xml:space="preserve"> </xsl:text>
2690 <xsl:value-of select="a:Dose/a:Value"/>
2691 <xsl:text xml:space="preserve"> </xsl:text>
2692 <xsl:value-of select="a:Dose/a:Units/a:Unit"/>
2693 <xsl:text xml:space="preserve"> </xsl:text>
2694 <xsl:value-of select="a:Route/a:Text"/>
2695 <xsl:text xml:space="preserve"> </xsl:text>
2696 <xsl:value-of select="a:Frequency/a:Value"/>
2697 <xsl:if test="a:Duration">
2698 <xsl:text xml:space="preserve"> </xsl:text>(for <xsl:value-of select="a:Duration/a:Value"/>
2699 <xsl:text xml:space="preserve"> </xsl:text>
2700 <xsl:value-of select="a:Duration/a:Units/a:Unit"/>)
2701 </xsl:if>
2702 </td>
2703 <xsl:if test="a:MultipleDirectionModifier/a:ObjectAttribute">
2704 <td>
2705 <xsl:for-each select="a:MultipleDirectionModifier/a:ObjectAttribute">
2706 <xsl:value-of select="a:Attribute"/>
2707 <br/>
2708 <xsl:value-of select="a:AttributeValue/a:Value"/>
2709 </xsl:for-each>
2710 </td>
2711 </xsl:if>
2712 </xsl:otherwise>
2713 </xsl:choose>
2714 </tr>
2715 </xsl:otherwise>
2716 </xsl:choose>
2717 </xsl:for-each>
2718 </xsl:template>
2719 <!-- footer.xsl -->
2720 <!-- HTML Footer for CCR.XSL -->
2721 <xsl:template name="footer">
2722 <br/>
2723 <hr/>
2724 <table cellspacing="3">
2725 <tbody>
2726 <tr>
2727 <th>
2728 <font color="#CCCCCC" size="2">
2729 The stylesheet used to generate this view of the CCR was provided by the American Academy of Family Physicians and the CCR Acceleration Task Force
2730</font>
2731 </th>
2732 </tr>
2733 <tr>
2734 <td/>
2735 </tr>
2736 <tr>
2737 <td>
2738 <font color="#CCCCCC" size="3">
2739 <strong>Powered by the <a href="http://www.astm.org/cgi-bin/SoftCart.exe/DATABASE.CART/REDLINE_PAGES/E2369.htm?E+mystore" style="color:#CCCCCC;">ASTM E2369-05 Specification for the Continuity of Care Record (CCR)</a>
2740 </strong>
2741 </font>
2742 </td>
2743 </tr>
2744 </tbody>
2745 </table>
2746 </xsl:template>
2747 <!-- problemDescription.xsl -->
2748 <!-- Returns the description of the problem, if there is no name it returns the ObjectID that was passed in -->
2749 <xsl:template name="problemDescription">
2750 <xsl:param name="objID"/>
2751 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Problems/a:Problem">
2752 <xsl:variable name="thisObjID" select="a:CCRDataObjectID"/>
2753 <xsl:if test="$objID = $thisObjID">
2754 <xsl:choose>
2755 <xsl:when test="a:Description/a:Text">
2756 <xsl:value-of select="a:Description/a:Text"/>
2757 </xsl:when>
2758 <xsl:otherwise>
2759 <xsl:value-of select="$objID"/>
2760 </xsl:otherwise>
2761 </xsl:choose>
2762 </xsl:if>
2763 </xsl:for-each>
2764 </xsl:template>
2765</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.