source: ccr2ccd-xslt/trunk/make/cda.xsl@ 999

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

latest

File size: 63.2 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:n1="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3 <xsl:output method="html" indent="yes" version="4.01" encoding="ISO-8859-1" doctype-system="http://www.w3.org/TR/html4/strict.dtd" doctype-public="-//W3C//DTD HTML 4.01//EN"/>
4 <!-- global variable title -->
5 <xsl:variable name="title">
6 <xsl:choose>
7 <xsl:when test="string-length(/n1:ClinicalDocument/n1:title) &gt;= 1">
8 <xsl:value-of select="/n1:ClinicalDocument/n1:title"/>
9 </xsl:when>
10 <xsl:when test="/n1:ClinicalDocument/n1:code/@displayName">
11 <xsl:value-of select="/n1:ClinicalDocument/n1:code/@displayName"/>
12 </xsl:when>
13 <xsl:otherwise>
14 <xsl:text>Clinical Document</xsl:text>
15 </xsl:otherwise>
16 </xsl:choose>
17 </xsl:variable>
18 <!-- Main -->
19 <xsl:template match="/">
20 <xsl:apply-templates select="n1:ClinicalDocument"/>
21 </xsl:template>
22 <!-- produce browser rendered, human readable clinical document -->
23 <xsl:template match="n1:ClinicalDocument">
24 <html>
25 <xsl:comment>
26 Do not edit this HTML directly, it was generated by an XSLT transformation from a source CDA document.
27 The stylesheet which produced this display of the CDA document was most recently updated by Jingdong Li, AALLC, on November 13, 2008.
28 The current version and documentation are always available at www.alschulerassociates.com/cda/?topic=cda-tools. We welcome feedback to jdli@alschulerassociates.com
29 The stylesheet is the cumulative work of several developers; the most significant prior milestones were the foundation work from HL7 Finland
30(Tyylitiedosto) and HL7 US (Calvin Beebe), and the presentation approach from [[the Swiss]].
31 </xsl:comment>
32 <head>
33 <xsl:comment> Do NOT edit this HTML directly: it was generated via an XSLT transformation from a CDA Release 2 XML document. </xsl:comment>
34 <title>
35 <xsl:value-of select="$title"/>
36 </title>
37 <!-- <link rel="stylesheet" type="text/css" href="cda.css"/> -->
38 <style type="text/css">
39 <xsl:text>
40body {
41 color: #003366;
42 background-color: #FFFFFF;
43 font-family: Verdana, Tahoma, sans-serif;
44 font-size: 11px;
45}
46
47a {
48 color: #003366;
49 background-color: #FFFFFF;
50}
51
52h1 {
53 font-size: 12pt;
54 font-weight: bold;
55}
56
57h2 {
58 font-size: 11pt;
59 font-weight: bold;
60}
61
62h3 {
63 font-size: 10pt;
64 font-weight: bold;
65}
66
67h4 {
68 font-size: 8pt;
69 font-weight: bold;
70}
71
72div {
73 width: 80%;
74}
75
76table {
77 line-height: 10pt;
78 width: 80%;
79}
80
81tr {
82 background-color: #ccccff;
83}
84
85td {
86 padding: 0.1cm 0.2cm;
87 vertical-align: top;
88}
89
90.h1center {
91 font-size: 12pt;
92 font-weight: bold;
93 text-align: center;
94 width: 80%;
95}
96
97.header_table{
98 border: 1pt inset #00008b;
99}
100
101.narr_table {
102 width: 100%;
103}
104
105.narr_tr {
106 background-color: #ffffcc;
107}
108
109.narr_th {
110 background-color: #ffd700;
111}
112
113.td_label{
114 font-weight: bold;
115 color: white;
116}
117 </xsl:text>
118 </style>
119 </head>
120 <body>
121 <h1 class="h1center">
122 <xsl:value-of select="$title"/>
123 </h1>
124 <!-- START display top portion of clinical document -->
125 <xsl:call-template name="recordTarget"/>
126 <xsl:call-template name="documentGeneral"/>
127 <xsl:call-template name="documentationOf"/>
128 <xsl:call-template name="author"/>
129 <!-- END display top portion of clinical document -->
130 <!-- produce table of contents -->
131 <xsl:call-template name="make-tableofcontents"/>
132 <hr align="left" color="teal" size="2" width="80%"/>
133 <!-- produce human readable document content -->
134 <xsl:apply-templates select="n1:component/n1:structuredBody|n1:component/n1:nonXMLBody"/>
135 <br/>
136 <hr align="left" color="teal" size="2" width="80%"/>
137 <br/>
138 <!-- START display bottom portion of clinical document -->
139 <xsl:call-template name="componentof"/>
140 <xsl:call-template name="custodian"/>
141 <xsl:call-template name="participant"/>
142 <xsl:call-template name="dataEnterer"/>
143 <xsl:call-template name="authenticator"/>
144 <xsl:call-template name="informant"/>
145 <xsl:call-template name="informationRecipient"/>
146 <xsl:call-template name="legalAuthenticator"/>
147 <!-- END display bottom portion of clinical document -->
148 </body>
149 </html>
150 </xsl:template>
151 <!-- generate table of contents -->
152 <xsl:template name="make-tableofcontents">
153 <h2>
154 <a name="toc">Table of Contents</a>
155 </h2>
156 <ul>
157 <xsl:for-each select="n1:component/n1:structuredBody/n1:component/n1:section/n1:title">
158 <li>
159 <a href="#{generate-id(.)}">
160 <xsl:value-of select="."/>
161 </a>
162 </li>
163 </xsl:for-each>
164 </ul>
165 </xsl:template>
166 <!-- header elements -->
167 <xsl:template name="documentGeneral">
168 <table class="header_table">
169 <tbody>
170 <tr>
171 <td width="20%" bgcolor="#3399ff">
172 <span class="td_label">
173 <xsl:text>Document Id</xsl:text>
174 </span>
175 </td>
176 <td width="80%">
177 <xsl:call-template name="show-id">
178 <xsl:with-param name="id" select="n1:id"/>
179 </xsl:call-template>
180 </td>
181 </tr>
182 <tr>
183 <td width="20%" bgcolor="#3399ff">
184 <span class="td_label">
185 <xsl:text>Document Created:</xsl:text>
186 </span>
187 </td>
188 <td width="80%">
189 <xsl:call-template name="show-time">
190 <xsl:with-param name="datetime" select="n1:effectiveTime"/>
191 </xsl:call-template>
192 </td>
193 </tr>
194 </tbody>
195 </table>
196 </xsl:template>
197 <!-- confidentiality -->
198 <xsl:template name="confidentiality">
199 <table class="header_table">
200 <tbody>
201 <td width="20%" bgcolor="#3399ff">
202 <xsl:text>Confidentiality</xsl:text>
203 </td>
204 <td width="80%">
205 <xsl:choose>
206 <xsl:when test="n1:confidentialityCode/@code = &apos;N&apos;">
207 <xsl:text>Normal</xsl:text>
208 </xsl:when>
209 <xsl:when test="n1:confidentialityCode/@code = &apos;R&apos;">
210 <xsl:text>Restricted</xsl:text>
211 </xsl:when>
212 <xsl:when test="n1:confidentialityCode/@code = &apos;V&apos;">
213 <xsl:text>Very restricted</xsl:text>
214 </xsl:when>
215 </xsl:choose>
216 <xsl:if test="n1:confidentialityCode/n1:originalText">
217 <xsl:text> </xsl:text>
218 <xsl:value-of select="n1:confidentialityCode/n1:originalText"/>
219 </xsl:if>
220 </td>
221 </tbody>
222 </table>
223 </xsl:template>
224 <!-- author -->
225 <xsl:template name="author">
226 <table class="header_table">
227 <tbody>
228 <xsl:for-each select="n1:author/n1:assignedAuthor">
229 <tr>
230 <td width="20%" bgcolor="#3399ff">
231 <span class="td_label">
232 <xsl:text>Author</xsl:text>
233 </span>
234 </td>
235 <td width="80%">
236 <xsl:choose>
237 <xsl:when test="n1:assignedPerson/n1:name">
238 <xsl:call-template name="show-name">
239 <xsl:with-param name="name" select="n1:assignedPerson/n1:name"/>
240 </xsl:call-template>
241 <xsl:if test="n1:representedOrganization">
242 <xsl:text>, </xsl:text>
243 <xsl:call-template name="show-name">
244 <xsl:with-param name="name" select="n1:representedOrganization/n1:name"/>
245 </xsl:call-template>
246 </xsl:if>
247 </xsl:when>
248 <xsl:when test="n1:assignedAuthoringDevice/n1:softwareName">
249 <xsl:value-of select="n1:assignedAuthoringDevice/n1:softwareName"/>
250 </xsl:when>
251 <xsl:when test="n1:representedOrganization">
252 <xsl:call-template name="show-name">
253 <xsl:with-param name="name" select="n1:representedOrganization/n1:name"/>
254 </xsl:call-template>
255 </xsl:when>
256 <xsl:otherwise>
257 <xsl:for-each select="n1:id">
258 <xsl:call-template name="show-id"/>
259 <br/>
260 </xsl:for-each>
261 </xsl:otherwise>
262 </xsl:choose>
263 </td>
264 </tr>
265 <xsl:if test="n1:addr | n1:telecom">
266 <tr>
267 <td bgcolor="#3399ff">
268 <span class="td_label">
269 <xsl:text>Contact info</xsl:text>
270 </span>
271 </td>
272 <td>
273 <xsl:call-template name="show-contactInfo">
274 <xsl:with-param name="contact" select="."/>
275 </xsl:call-template>
276 </td>
277 </tr>
278 </xsl:if>
279 </xsl:for-each>
280 </tbody>
281 </table>
282 </xsl:template>
283 <!-- authenticator -->
284 <xsl:template name="authenticator">
285 <xsl:if test="n1:authenticator">
286 <table class="header_table">
287 <tbody>
288 <tr>
289 <xsl:for-each select="n1:authenticator">
290 <tr>
291 <td width="20%" bgcolor="#3399ff">
292 <span class="td_label">
293 <xsl:text>Signed </xsl:text>
294 </span>
295 </td>
296 <td width="80%">
297 <xsl:call-template name="show-name">
298 <xsl:with-param name="name" select="n1:assignedEntity/n1:assignedPerson/n1:name"/>
299 </xsl:call-template>
300 <xsl:text> at </xsl:text>
301 <xsl:call-template name="show-time">
302 <xsl:with-param name="date" select="n1:time"/>
303 </xsl:call-template>
304 </td>
305 </tr>
306 <xsl:if test="n1:assignedEntity/n1:addr | n1:assignedEntity/n1:telecom">
307 <tr>
308 <td bgcolor="#3399ff">
309 <span class="td_label">
310 <xsl:text>Contact info</xsl:text>
311 </span>
312 </td>
313 <td width="80%">
314 <xsl:call-template name="show-contactInfo">
315 <xsl:with-param name="contact" select="n1:assignedEntity"/>
316 </xsl:call-template>
317 </td>
318 </tr>
319 </xsl:if>
320 </xsl:for-each>
321 </tr>
322 </tbody>
323 </table>
324 </xsl:if>
325 </xsl:template>
326 <!-- legalAuthenticator -->
327 <xsl:template name="legalAuthenticator">
328 <xsl:if test="n1:legalAuthenticator">
329 <table class="header_table">
330 <tbody>
331 <tr>
332 <td width="20%" bgcolor="#3399ff">
333 <span class="td_label">
334 <xsl:text>Legal authenticator</xsl:text>
335 </span>
336 </td>
337 <td width="80%">
338 <xsl:call-template name="show-assignedEntity">
339 <xsl:with-param name="asgnEntity" select="n1:legalAuthenticator/n1:assignedEntity"/>
340 </xsl:call-template>
341 <xsl:text> </xsl:text>
342 <xsl:call-template name="show-sig">
343 <xsl:with-param name="sig" select="n1:legalAuthenticator/n1:signatureCode"/>
344 </xsl:call-template>
345 <xsl:if test="n1:legalAuthenticator/n1:time/@value">
346 <xsl:text> at </xsl:text>
347 <xsl:call-template name="show-time">
348 <xsl:with-param name="datetime" select="n1:legalAuthenticator/n1:time"/>
349 </xsl:call-template>
350 </xsl:if>
351 </td>
352 </tr>
353 <xsl:if test="n1:legalAuthenticator/n1:assignedEntity/n1:addr | n1:legalAuthenticator/n1:assignedEntity/n1:telecom">
354 <tr>
355 <td bgcolor="#3399ff">
356 <span class="td_label">
357 <xsl:text>Contact info</xsl:text>
358 </span>
359 </td>
360 <td>
361 <xsl:call-template name="show-contactInfo">
362 <xsl:with-param name="contact" select="n1:legalAuthenticator/n1:assignedEntity"/>
363 </xsl:call-template>
364 </td>
365 </tr>
366 </xsl:if>
367 </tbody>
368 </table>
369 </xsl:if>
370 </xsl:template>
371 <!-- dataEnterer -->
372 <xsl:template name="dataEnterer">
373 <xsl:if test="n1:dataEnterer">
374 <table class="header_table">
375 <tbody>
376 <tr>
377 <td width="20%" bgcolor="#3399ff">
378 <span class="td_label">
379 <xsl:text>Entered by</xsl:text>
380 </span>
381 </td>
382 <td width="80%">
383 <xsl:call-template name="show-assignedEntity">
384 <xsl:with-param name="asgnEntity" select="n1:dataEnterer/n1:assignedEntity"/>
385 </xsl:call-template>
386 </td>
387 </tr>
388 <xsl:if test="n1:dataEnterer/n1:assignedEntity/n1:addr | n1:dataEnterer/n1:assignedEntity/n1:telecom">
389 <tr>
390 <td bgcolor="#3399ff">
391 <span class="td_label">
392 <xsl:text>Contact info</xsl:text>
393 </span>
394 </td>
395 <td>
396 <xsl:call-template name="show-contactInfo">
397 <xsl:with-param name="contact" select="n1:dataEnterer/n1:assignedEntity"/>
398 </xsl:call-template>
399 </td>
400 </tr>
401 </xsl:if>
402 </tbody>
403 </table>
404 </xsl:if>
405 </xsl:template>
406 <!-- componentOf -->
407 <xsl:template name="componentof">
408 <xsl:if test="n1:componentOf">
409 <table class="header_table">
410 <tbody>
411 <xsl:for-each select="n1:componentOf/n1:encompassingEncounter">
412 <xsl:if test="n1:location/n1:healthCareFacility">
413 <tr>
414 <td width="20%" bgcolor="#3399ff">
415 <span class="td_label">
416 <xsl:text>Encounter Location</xsl:text>
417 </span>
418 </td>
419 <td width="80%">
420 <xsl:choose>
421 <xsl:when test="n1:location/n1:healthCareFacility/n1:location/n1:name">
422 <xsl:call-template name="show-name">
423 <xsl:with-param name="name" select="n1:location/n1:healthCareFacility/n1:location/n1:name"/>
424 </xsl:call-template>
425 <xsl:for-each select="n1:location/n1:healthCareFacility/n1:serviceProviderOrganization/n1:name">
426 <xsl:text> of </xsl:text>
427 <xsl:call-template name="show-name">
428 <xsl:with-param name="name" select="n1:location/n1:healthCareFacility/n1:serviceProviderOrganization/n1:name"/>
429 </xsl:call-template>
430 </xsl:for-each>
431 </xsl:when>
432 <xsl:when test="n1:location/n1:healthCareFacility/n1:code">
433 <xsl:call-template name="show-code">
434 <xsl:with-param name="code" select="n1:location/n1:healthCareFacility/n1:code"/>
435 </xsl:call-template>
436 </xsl:when>
437 <xsl:otherwise>
438 <xsl:if test="n1:location/n1:healthCareFacility/n1:id">
439 <xsl:text>id: </xsl:text>
440 <xsl:for-each select="n1:location/n1:healthCareFacility/n1:id">
441 <xsl:call-template name="show-id">
442 <xsl:with-param name="id" select="."/>
443 </xsl:call-template>
444 </xsl:for-each>
445 </xsl:if>
446 </xsl:otherwise>
447 </xsl:choose>
448 </td>
449 </tr>
450 </xsl:if>
451 <xsl:if test="n1:responsibleParty">
452 <tr>
453 <td bgcolor="#3399ff">
454 <span class="td_label">
455 <xsl:text>Responsible party</xsl:text>
456 </span>
457 </td>
458 <td width="80%">
459 <xsl:call-template name="show-assignedEntity">
460 <xsl:with-param name="asgnEntity" select="n1:responsibleParty/n1:assignedEntity"/>
461 </xsl:call-template>
462 </td>
463 </tr>
464 </xsl:if>
465 <xsl:if test="n1:responsibleParty/n1:assignedEntity/n1:addr | n1:responsibleParty/n1:assignedEntity/n1:telecom">
466 <tr>
467 <td bgcolor="#3399ff">
468 <span class="td_label">
469 <xsl:text>Contact info</xsl:text>
470 </span>
471 </td>
472 <td>
473 <xsl:call-template name="show-contactInfo">
474 <xsl:with-param name="contact" select="n1:responsibleParty/n1:assignedEntity"/>
475 </xsl:call-template>
476 </td>
477 </tr>
478 </xsl:if>
479 </xsl:for-each>
480 </tbody>
481 </table>
482 </xsl:if>
483 </xsl:template>
484 <!-- custodian -->
485 <xsl:template name="custodian">
486 <table class="header_table">
487 <tbody>
488 <tr>
489 <td width="20%" bgcolor="#3399ff">
490 <span class="td_label">
491 <xsl:text>Document maintained by</xsl:text>
492 </span>
493 </td>
494 <td width="80%">
495 <xsl:choose>
496 <xsl:when test="n1:custodian/n1:assignedCustodian/n1:representedCustodianOrganization/n1:name">
497 <xsl:call-template name="show-name">
498 <xsl:with-param name="name" select="n1:custodian/n1:assignedCustodian/n1:representedCustodianOrganization/n1:name"/>
499 </xsl:call-template>
500 </xsl:when>
501 <xsl:otherwise>
502 <xsl:for-each select="n1:custodian/n1:assignedCustodian/n1:representedCustodianOrganization/n1:id">
503 <xsl:call-template name="show-id"/>
504 <xsl:if test="position()!=last()">
505 <br/>
506 </xsl:if>
507 </xsl:for-each>
508 </xsl:otherwise>
509 </xsl:choose>
510 </td>
511 </tr>
512 <xsl:if test="n1:custodian/n1:assignedCustodian/n1:representedCustodianOrganization/n1:addr | n1:custodian/n1:assignedCustodian/n1:representedCustodianOrganization/n1:telecom">
513 <tr>
514 <td bgcolor="#3399ff">
515 <span class="td_label">
516 <xsl:text>Contact info</xsl:text>
517 </span>
518 </td>
519 <td width="80%">
520 <xsl:call-template name="show-contactInfo">
521 <xsl:with-param name="contact" select="n1:custodian/n1:assignedCustodian/n1:representedCustodianOrganization"/>
522 </xsl:call-template>
523 </td>
524 </tr>
525 </xsl:if>
526 </tbody>
527 </table>
528 </xsl:template>
529 <!-- documentationOf -->
530 <xsl:template name="documentationOf">
531 <xsl:if test="n1:documentationOf">
532 <table class="header_table">
533 <tbody>
534 <xsl:for-each select="n1:documentationOf">
535 <xsl:if test="n1:serviceEvent/@classCode and n1:serviceEvent/n1:code">
536 <xsl:variable name="displayName">
537 <xsl:call-template name="show-actClassCode">
538 <xsl:with-param name="clsCode" select="n1:serviceEvent/@classCode"/>
539 </xsl:call-template>
540 </xsl:variable>
541 <xsl:if test="$displayName">
542 <tr>
543 <td width="20%" bgcolor="#3399ff">
544 <span class="td_label">
545 <xsl:call-template name="firstCharCaseUp">
546 <xsl:with-param name="data" select="$displayName"/>
547 </xsl:call-template>
548 </span>
549 </td>
550 <td width="80%" colspan="3">
551 <xsl:call-template name="show-code">
552 <xsl:with-param name="code" select="n1:serviceEvent/n1:code"/>
553 </xsl:call-template>
554 <xsl:if test="n1:serviceEvent/n1:effectiveTime">
555 <xsl:choose>
556 <xsl:when test="n1:serviceEvent/n1:effectiveTime/@value">
557 <xsl:text>&#160;at&#160;</xsl:text>
558 <xsl:call-template name="show-time">
559 <xsl:with-param name="datetime" select="n1:serviceEvent/n1:effectiveTime"/>
560 </xsl:call-template>
561 </xsl:when>
562 <xsl:when test="n1:serviceEvent/n1:effectiveTime/n1:low">
563 <xsl:text>&#160;from&#160;</xsl:text>
564 <xsl:call-template name="show-time">
565 <xsl:with-param name="datetime" select="n1:serviceEvent/n1:effectiveTime/n1:low"/>
566 </xsl:call-template>
567 <xsl:if test="n1:serviceEvent/n1:effectiveTime/n1:high">
568 <xsl:text> to </xsl:text>
569 <xsl:call-template name="show-time">
570 <xsl:with-param name="datetime" select="n1:serviceEvent/n1:effectiveTime/n1:high"/>
571 </xsl:call-template>
572 </xsl:if>
573 </xsl:when>
574 </xsl:choose>
575 </xsl:if>
576 </td>
577 </tr>
578 </xsl:if>
579 </xsl:if>
580 <xsl:for-each select="n1:serviceEvent/n1:performer">
581 <xsl:variable name="displayName">
582 <xsl:call-template name="show-participationType">
583 <xsl:with-param name="ptype" select="@typeCode"/>
584 </xsl:call-template>
585 <xsl:text> </xsl:text>
586 <xsl:if test="n1:functionCode/@code">
587 <xsl:text>(</xsl:text>
588 <xsl:call-template name="show-participationFunction">
589 <xsl:with-param name="pFunction" select="n1:functionCode/@code"/>
590 </xsl:call-template>
591 <xsl:text>)</xsl:text>
592 </xsl:if>
593 </xsl:variable>
594 <tr>
595 <td width="20%" bgcolor="#3399ff">
596 <span class="td_label">
597 <xsl:call-template name="firstCharCaseUp">
598 <xsl:with-param name="data" select="$displayName"/>
599 </xsl:call-template>
600 </span>
601 </td>
602 <td width="80%" colspan="3">
603 <xsl:call-template name="show-assignedEntity">
604 <xsl:with-param name="asgnEntity" select="n1:assignedEntity"/>
605 </xsl:call-template>
606 </td>
607 </tr>
608 </xsl:for-each>
609 </xsl:for-each>
610 </tbody>
611 </table>
612 </xsl:if>
613 </xsl:template>
614 <!-- inFulfillmentOf -->
615 <xsl:template name="inFulfillmentOf">
616 <xsl:if test="n1:infulfillmentOf">
617 <table class="header_table">
618 <tbody>
619 <xsl:for-each select="n1:inFulfillmentOf">
620 <tr>
621 <td width="20%" bgcolor="#3399ff">
622 <span class="td_label">
623 <xsl:text>In fulfillment of</xsl:text>
624 </span>
625 </td>
626 <td width="80%">
627 <xsl:for-each select="n1:order">
628 <xsl:for-each select="n1:id">
629 <xsl:call-template name="show-id"/>
630 </xsl:for-each>
631 <xsl:for-each select="n1:code">
632 <xsl:text>&#160;</xsl:text>
633 <xsl:call-template name="show-code">
634 <xsl:with-param name="code" select="."/>
635 </xsl:call-template>
636 </xsl:for-each>
637 <xsl:for-each select="n1:priorityCode">
638 <xsl:text>&#160;</xsl:text>
639 <xsl:call-template name="show-code">
640 <xsl:with-param name="code" select="."/>
641 </xsl:call-template>
642 </xsl:for-each>
643 </xsl:for-each>
644 </td>
645 </tr>
646 </xsl:for-each>
647 </tbody>
648 </table>
649 </xsl:if>
650 </xsl:template>
651 <!-- informant -->
652 <xsl:template name="informant">
653 <xsl:if test="n1:informant">
654 <table class="header_table">
655 <tbody>
656 <xsl:for-each select="n1:informant">
657 <tr>
658 <td width="20%" bgcolor="#3399ff">
659 <span class="td_label">
660 <xsl:text>Informant</xsl:text>
661 </span>
662 </td>
663 <td width="80%">
664 <xsl:if test="n1:assignedEntity">
665 <xsl:call-template name="show-assignedEntity">
666 <xsl:with-param name="asgnEntity" select="n1:assignedEntity"/>
667 </xsl:call-template>
668 </xsl:if>
669 <xsl:if test="n1:relatedEntity">
670 <xsl:call-template name="show-relatedEntity">
671 <xsl:with-param name="relatedEntity" select="n1:relatedEntity"/>
672 </xsl:call-template>
673 </xsl:if>
674 </td>
675 </tr>
676 <xsl:choose>
677 <xsl:when test="n1:assignedEntity/n1:addr | n1:assignedEntity/n1:telecom">
678 <tr>
679 <td bgcolor="#3399ff">
680 <span class="td_label">
681 <xsl:text>Contact info</xsl:text>
682 </span>
683 </td>
684 <td>
685 <xsl:if test="n1:assignedEntity">
686 <xsl:call-template name="show-contactInfo">
687 <xsl:with-param name="contact" select="n1:assignedEntity"/>
688 </xsl:call-template>
689 </xsl:if>
690 </td>
691 </tr>
692 </xsl:when>
693 <xsl:when test="n1:relatedEntity/n1:addr | n1:relatedEntity/n1:telecom">
694 <tr>
695 <td bgcolor="#3399ff">
696 <span class="td_label">
697 <xsl:text>Contact info</xsl:text>
698 </span>
699 </td>
700 <td>
701 <xsl:if test="n1:relatedEntity">
702 <xsl:call-template name="show-contactInfo">
703 <xsl:with-param name="contact" select="n1:relatedEntity"/>
704 </xsl:call-template>
705 </xsl:if>
706 </td>
707 </tr>
708 </xsl:when>
709 </xsl:choose>
710 </xsl:for-each>
711 </tbody>
712 </table>
713 </xsl:if>
714 </xsl:template>
715 <!-- informantionRecipient -->
716 <xsl:template name="informationRecipient">
717 <xsl:if test="n1:informationRecipient">
718 <table class="header_table">
719 <tbody>
720 <xsl:for-each select="n1:informationRecipient">
721 <tr>
722 <td width="20%" bgcolor="#3399ff">
723 <span class="td_label">
724 <xsl:text>Information recipient:</xsl:text>
725 </span>
726 </td>
727 <td width="80%">
728 <xsl:choose>
729 <xsl:when test="n1:intendedRecipient/n1:informationRecipient/n1:name">
730 <xsl:for-each select="n1:intendedRecipient/n1:informationRecipient">
731 <xsl:call-template name="show-name">
732 <xsl:with-param name="name" select="n1:name"/>
733 </xsl:call-template>
734 <xsl:if test="position() != last()">
735 <br/>
736 </xsl:if>
737 </xsl:for-each>
738 </xsl:when>
739 <xsl:otherwise>
740 <xsl:for-each select="n1:intendedRecipient">
741 <xsl:for-each select="n1:id">
742 <xsl:call-template name="show-id"/>
743 </xsl:for-each>
744 <xsl:if test="position() != last()">
745 <br/>
746 </xsl:if>
747 <br/>
748 </xsl:for-each>
749 </xsl:otherwise>
750 </xsl:choose>
751 </td>
752 </tr>
753 <xsl:if test="n1:intendedRecipient/n1:addr | n1:intendedRecipient/n1:telecom">
754 <tr>
755 <td bgcolor="#3399ff">
756 <span class="td_label">
757 <xsl:text>Contact info</xsl:text>
758 </span>
759 </td>
760 <td>
761 <xsl:call-template name="show-contactInfo">
762 <xsl:with-param name="contact" select="n1:intendedRecipient"/>
763 </xsl:call-template>
764 </td>
765 </tr>
766 </xsl:if>
767 </xsl:for-each>
768 </tbody>
769 </table>
770 </xsl:if>
771 </xsl:template>
772 <!-- participant -->
773 <xsl:template name="participant">
774 <xsl:if test="n1:participant">
775 <table class="header_table">
776 <tbody>
777 <xsl:for-each select="n1:participant">
778 <tr>
779 <td width="20%" bgcolor="#3399ff">
780 <xsl:variable name="participtRole">
781 <xsl:call-template name="translateRoleAssoCode">
782 <xsl:with-param name="code" select="n1:associatedEntity/@classCode"/>
783 </xsl:call-template>
784 </xsl:variable>
785 <xsl:choose>
786 <xsl:when test="$participtRole">
787 <span class="td_label">
788 <xsl:call-template name="firstCharCaseUp">
789 <xsl:with-param name="data" select="$participtRole"/>
790 </xsl:call-template>
791 </span>
792 </xsl:when>
793 <xsl:otherwise>
794 <span class="td_label">
795 <xsl:text>Participant</xsl:text>
796 </span>
797 </xsl:otherwise>
798 </xsl:choose>
799 </td>
800 <td width="80%">
801 <xsl:if test="n1:functionCode">
802 <xsl:call-template name="show-code">
803 <xsl:with-param name="code" select="n1:functionCode"/>
804 </xsl:call-template>
805 </xsl:if>
806 <xsl:call-template name="show-associatedEntity">
807 <xsl:with-param name="assoEntity" select="n1:associatedEntity"/>
808 </xsl:call-template>
809 <xsl:if test="n1:time">
810 <xsl:if test="n1:time/n1:low">
811 <xsl:text> from </xsl:text>
812 <xsl:call-template name="show-time">
813 <xsl:with-param name="datetime" select="n1:time/n1:low"/>
814 </xsl:call-template>
815 </xsl:if>
816 <xsl:if test="n1:time/n1:high">
817 <xsl:text> to </xsl:text>
818 <xsl:call-template name="show-time">
819 <xsl:with-param name="datetime" select="n1:time/n1:high"/>
820 </xsl:call-template>
821 </xsl:if>
822 </xsl:if>
823 <xsl:if test="position() != last()">
824 <br/>
825 </xsl:if>
826 </td>
827 </tr>
828 <xsl:if test="n1:associatedEntity/n1:addr | n1:associatedEntity/n1:telecom">
829 <tr>
830 <td bgcolor="#3399ff">
831 <span class="td_label">
832 <xsl:text>Contact info</xsl:text>
833 </span>
834 </td>
835 <td>
836 <xsl:call-template name="show-contactInfo">
837 <xsl:with-param name="contact" select="n1:associatedEntity"/>
838 </xsl:call-template>
839 </td>
840 </tr>
841 </xsl:if>
842 </xsl:for-each>
843 </tbody>
844 </table>
845 </xsl:if>
846 </xsl:template>
847 <!-- recordTarget -->
848 <xsl:template name="recordTarget">
849 <table class="header_table">
850 <tbody>
851 <xsl:for-each select="/n1:ClinicalDocument/n1:recordTarget/n1:patientRole">
852 <xsl:if test="not(n1:id/@nullFlavor)">
853 <tr>
854 <td width="20%" bgcolor="#3399ff">
855 <span class="td_label">
856 <xsl:text>Patient</xsl:text>
857 </span>
858 </td>
859 <td colspan="3">
860 <xsl:call-template name="show-name">
861 <xsl:with-param name="name" select="n1:patient/n1:name"/>
862 </xsl:call-template>
863 </td>
864 </tr>
865 <tr>
866 <td width="20%" bgcolor="#3399ff">
867 <span class="td_label">
868 <xsl:text>Date of birth</xsl:text>
869 </span>
870 </td>
871 <td width="30%">
872 <xsl:call-template name="show-time">
873 <xsl:with-param name="datetime" select="n1:patient/n1:birthTime"/>
874 </xsl:call-template>
875 </td>
876 <td width="10%" bgcolor="#3399ff">
877 <span class="td_label">
878 <xsl:text>Sex</xsl:text>
879 </span>
880 </td>
881 <td>
882 <xsl:for-each select="n1:patient/n1:administrativeGenderCode">
883 <xsl:call-template name="show-gender"/>
884 </xsl:for-each>
885 </td>
886 </tr>
887 <tr>
888 <td width="10%" bgcolor="#3399ff">
889 <span class="td_label">
890 <xsl:text>Contact info</xsl:text>
891 </span>
892 </td>
893 <td width="35%">
894 <xsl:call-template name="show-contactInfo">
895 <xsl:with-param name="contact" select="."/>
896 </xsl:call-template>
897 </td>
898 <td width="10%" bgcolor="#3399ff">
899 <span class="td_label">
900 <xsl:text>Patient IDs</xsl:text>
901 </span>
902 </td>
903 <td>
904 <xsl:for-each select="n1:id">
905 <xsl:call-template name="show-id"/>
906 <br/>
907 </xsl:for-each>
908 </td>
909 </tr>
910 </xsl:if>
911 </xsl:for-each>
912 </tbody>
913 </table>
914 </xsl:template>
915 <!-- relatedDocument -->
916 <xsl:template name="relatedDocument">
917 <xsl:if test="n1:relatedDocument">
918 <table class="header_table">
919 <tbody>
920 <xsl:for-each select="n1:relatedDocument">
921 <tr>
922 <td width="20%" bgcolor="#3399ff">
923 <span class="td_label">
924 <xsl:text>Related document</xsl:text>
925 </span>
926 </td>
927 <td width="80%">
928 <xsl:for-each select="n1:parentDocument">
929 <xsl:for-each select="n1:id">
930 <xsl:call-template name="show-id"/>
931 <br/>
932 </xsl:for-each>
933 </xsl:for-each>
934 </td>
935 </tr>
936 </xsl:for-each>
937 </tbody>
938 </table>
939 </xsl:if>
940 </xsl:template>
941 <!-- authorization (consent) -->
942 <xsl:template name="authorization">
943 <xsl:if test="n1:authorization">
944 <table class="header_table">
945 <tbody>
946 <xsl:for-each select="n1:authorization">
947 <tr>
948 <td width="20%" bgcolor="#3399ff">
949 <span class="td_label">
950 <xsl:text>Consent</xsl:text>
951 </span>
952 </td>
953 <td width="80%">
954 <xsl:choose>
955 <xsl:when test="n1:consent/n1:code">
956 <xsl:call-template name="show-code">
957 <xsl:with-param name="code" select="n1:consent/n1:code"/>
958 </xsl:call-template>
959 </xsl:when>
960 <xsl:otherwise>
961 <xsl:call-template name="show-code">
962 <xsl:with-param name="code" select="n1:consent/n1:statusCode"/>
963 </xsl:call-template>
964 </xsl:otherwise>
965 </xsl:choose>
966 <br/>
967 </td>
968 </tr>
969 </xsl:for-each>
970 </tbody>
971 </table>
972 </xsl:if>
973 </xsl:template>
974 <!-- setAndVersion -->
975 <xsl:template name="setAndVersion">
976 <xsl:if test="n1:setId and n1:versionNumber">
977 <table class="header_table">
978 <tbody>
979 <tr>
980 <td width="20%">
981 <xsl:text>SetId and Version</xsl:text>
982 </td>
983 <td colspan="3">
984 <xsl:text>SetId: </xsl:text>
985 <xsl:call-template name="show-id">
986 <xsl:with-param name="id" select="n1:setId"/>
987 </xsl:call-template>
988 <xsl:text> Version: </xsl:text>
989 <xsl:value-of select="n1:versionNumber/@value"/>
990 </td>
991 </tr>
992 </tbody>
993 </table>
994 </xsl:if>
995 </xsl:template>
996 <!-- show StructuredBody -->
997 <xsl:template match="n1:component/n1:structuredBody">
998 <xsl:for-each select="n1:component/n1:section">
999 <xsl:call-template name="section" />
1000 </xsl:for-each>
1001 </xsl:template>
1002 <!-- show nonXMLBody -->
1003 <xsl:template match='n1:component/n1:nonXMLBody'>
1004 <xsl:choose>
1005 <!-- if there is a reference, use that in an IFRAME -->
1006 <xsl:when test='n1:text/n1:reference'>
1007 <IFRAME name='nonXMLBody' id='nonXMLBody' WIDTH='80%' HEIGHT='66%' src='{n1:text/n1:reference/@value}'/>
1008 </xsl:when>
1009 <xsl:when test='n1:text/@mediaType="text/plain"'>
1010 <pre>
1011 <xsl:value-of select='n1:text/text()'/>
1012 </pre>
1013 </xsl:when>
1014 <xsl:otherwise>
1015 <CENTER>Cannot display the text</CENTER>
1016 </xsl:otherwise>
1017 </xsl:choose>
1018 </xsl:template>
1019 <!-- top level component/section: display title and text,
1020 and process any nested component/sections
1021 -->
1022 <xsl:template name="section">
1023 <xsl:call-template name="section-title">
1024 <xsl:with-param name="title" select="n1:title"/>
1025 </xsl:call-template>
1026 <xsl:call-template name="section-author"/>
1027 <xsl:call-template name="section-text"/>
1028 <xsl:for-each select="n1:component/n1:section">
1029 <xsl:call-template name="nestedSection">
1030 <xsl:with-param name="margin" select="2"/>
1031 </xsl:call-template>
1032 </xsl:for-each>
1033 </xsl:template>
1034 <!-- top level section title -->
1035 <xsl:template name="section-title">
1036 <xsl:param name="title"/>
1037 <h3>
1038 <a name="{generate-id($title)}" href="#toc">
1039 <xsl:value-of select="$title"/>
1040 </a>
1041 </h3>
1042 </xsl:template>
1043 <!-- section author -->
1044 <xsl:template name="section-author">
1045 <xsl:if test="count(n1:author)&gt;0">
1046 <div style="margin-left : 2em;">
1047 <b>
1048 <xsl:text>Section Author: </xsl:text>
1049 </b>
1050 <xsl:for-each select="n1:author/n1:assignedAuthor">
1051 <xsl:choose>
1052 <xsl:when test="n1:assignedPerson/n1:name">
1053 <xsl:call-template name="show-name">
1054 <xsl:with-param name="name" select="n1:assignedPerson/n1:name"/>
1055 </xsl:call-template>
1056 <xsl:if test="n1:representedOrganization">
1057 <xsl:text>, </xsl:text>
1058 <xsl:call-template name="show-name">
1059 <xsl:with-param name="name" select="n1:representedOrganization/n1:name"/>
1060 </xsl:call-template>
1061 </xsl:if>
1062 </xsl:when>
1063 <xsl:when test="n1:assignedAuthoringDevice/n1:softwareName">
1064 <xsl:value-of select="n1:assignedAuthoringDevice/n1:softwareName"/>
1065 </xsl:when>
1066 <xsl:otherwise>
1067 <xsl:for-each select="n1:id">
1068 <xsl:call-template name="show-id"/>
1069 <br/>
1070 </xsl:for-each>
1071 </xsl:otherwise>
1072 </xsl:choose>
1073 </xsl:for-each>
1074 <br />
1075 </div>
1076 </xsl:if>
1077 </xsl:template>
1078 <!-- top-level section Text -->
1079 <xsl:template name="section-text">
1080 <div>
1081 <xsl:apply-templates select="n1:text" />
1082 </div>
1083 </xsl:template>
1084 <!-- nested component/section -->
1085 <xsl:template name="nestedSection">
1086 <xsl:param name="margin" />
1087 <h4 style="margin-left : {$margin}em;">
1088 <xsl:value-of select="n1:title"/>
1089 </h4>
1090 <div style="margin-left : {$margin}em;">
1091 <xsl:apply-templates select="n1:text"/>
1092 </div>
1093 <xsl:for-each select="n1:component/n1:section">
1094 <xsl:call-template name="nestedSection">
1095 <xsl:with-param name="margin" select="2*$margin"/>
1096 </xsl:call-template>
1097 </xsl:for-each>
1098 </xsl:template>
1099 <!-- paragraph -->
1100 <xsl:template match="n1:paragraph">
1101 <p>
1102 <xsl:apply-templates/>
1103 </p>
1104 </xsl:template>
1105 <!-- pre format -->
1106 <xsl:template match="n1:pre">
1107 <pre>
1108 <xsl:apply-templates/>
1109 </pre>
1110 </xsl:template>
1111 <!-- Content w/ deleted text is hidden -->
1112 <xsl:template match="n1:content[@revised='delete']"/>
1113 <!-- content -->
1114 <xsl:template match="n1:content">
1115 <xsl:apply-templates/>
1116 </xsl:template>
1117 <!-- line break -->
1118 <xsl:template match="n1:br">
1119 <xsl:element name='br'>
1120 <xsl:apply-templates/>
1121 </xsl:element>
1122 </xsl:template>
1123 <!-- list -->
1124 <xsl:template match="n1:list">
1125 <xsl:if test="n1:caption">
1126 <p>
1127 <b>
1128 <xsl:apply-templates select="n1:caption"/>
1129 </b>
1130 </p>
1131 </xsl:if>
1132 <ul>
1133 <xsl:for-each select="n1:item">
1134 <li>
1135 <xsl:apply-templates/>
1136 </li>
1137 </xsl:for-each>
1138 </ul>
1139 </xsl:template>
1140 <xsl:template match="n1:list[@listType='ordered']">
1141 <xsl:if test="n1:caption">
1142 <span style="font-weight:bold; ">
1143 <xsl:apply-templates select="n1:caption"/>
1144 </span>
1145 </xsl:if>
1146 <ol>
1147 <xsl:for-each select="n1:item">
1148 <li>
1149 <xsl:apply-templates/>
1150 </li>
1151 </xsl:for-each>
1152 </ol>
1153 </xsl:template>
1154 <!-- caption -->
1155 <xsl:template match="n1:caption">
1156 <xsl:apply-templates/>
1157 <xsl:text>: </xsl:text>
1158 </xsl:template>
1159 <!-- Tables -->
1160 <xsl:template match="n1:table/@*|n1:thead/@*|n1:tfoot/@*|n1:tbody/@*|n1:colgroup/@*|n1:col/@*|n1:tr/@*|n1:th/@*|n1:td/@*">
1161 <xsl:copy>
1162 <xsl:copy-of select="@*"/>
1163 <xsl:apply-templates/>
1164 </xsl:copy>
1165 </xsl:template>
1166 <xsl:template match="n1:table">
1167 <table class="narr_table">
1168 <xsl:copy-of select="@*"/>
1169 <xsl:apply-templates/>
1170 </table>
1171 </xsl:template>
1172 <xsl:template match="n1:thead">
1173 <thead>
1174 <xsl:copy-of select="@*"/>
1175 <xsl:apply-templates/>
1176 </thead>
1177 </xsl:template>
1178 <xsl:template match="n1:tfoot">
1179 <tfoot>
1180 <xsl:copy-of select="@*"/>
1181 <xsl:apply-templates/>
1182 </tfoot>
1183 </xsl:template>
1184 <xsl:template match="n1:tbody">
1185 <tbody>
1186 <xsl:copy-of select="@*"/>
1187 <xsl:apply-templates/>
1188 </tbody>
1189 </xsl:template>
1190 <xsl:template match="n1:colgroup">
1191 <colgroup>
1192 <xsl:copy-of select="@*"/>
1193 <xsl:apply-templates/>
1194 </colgroup>
1195 </xsl:template>
1196 <xsl:template match="n1:col">
1197 <col>
1198 <xsl:copy-of select="@*"/>
1199 <xsl:apply-templates/>
1200 </col>
1201 </xsl:template>
1202 <xsl:template match="n1:tr">
1203 <tr class="narr_tr">
1204 <xsl:copy-of select="@*"/>
1205 <xsl:apply-templates/>
1206 </tr>
1207 </xsl:template>
1208 <xsl:template match="n1:th">
1209 <th class="narr_th">
1210 <xsl:copy-of select="@*"/>
1211 <xsl:apply-templates/>
1212 </th>
1213 </xsl:template>
1214 <xsl:template match="n1:td">
1215 <td>
1216 <xsl:copy-of select="@*"/>
1217 <xsl:apply-templates/>
1218 </td>
1219 </xsl:template>
1220 <xsl:template match="n1:table/n1:caption">
1221 <span style="font-weight:bold; ">
1222 <xsl:apply-templates/>
1223 </span>
1224 </xsl:template>
1225 <!-- RenderMultiMedia
1226 this currently only handles GIF's and JPEG's. It could, however,
1227 be extended by including other image MIME types in the predicate
1228 and/or by generating <object> or <applet> tag with the correct
1229 params depending on the media type @ID =$imageRef referencedObject
1230 -->
1231 <xsl:template match="n1:renderMultiMedia">
1232 <xsl:variable name="imageRef" select="@referencedObject"/>
1233 <xsl:choose>
1234 <xsl:when test="//n1:regionOfInterest[@ID=$imageRef]">
1235 <!-- Here is where the Region of Interest image referencing goes -->
1236 <xsl:if test="//n1:regionOfInterest[@ID=$imageRef]//n1:observationMedia/n1:value[@mediaType='image/gif' or
1237 @mediaType='image/jpeg']">
1238 <br clear="all"/>
1239 <xsl:element name="img">
1240 <xsl:attribute name="src"><xsl:value-of select="//n1:regionOfInterest[@ID=$imageRef]//n1:observationMedia/n1:value/n1:reference/@value"/></xsl:attribute>
1241 </xsl:element>
1242 </xsl:if>
1243 </xsl:when>
1244 <xsl:otherwise>
1245 <!-- Here is where the direct MultiMedia image referencing goes -->
1246 <xsl:if test="//n1:observationMedia[@ID=$imageRef]/n1:value[@mediaType='image/gif' or @mediaType='image/jpeg']">
1247 <br clear="all"/>
1248 <xsl:element name="img">
1249 <xsl:attribute name="src"><xsl:value-of select="//n1:observationMedia[@ID=$imageRef]/n1:value/n1:reference/@value"/></xsl:attribute>
1250 </xsl:element>
1251 </xsl:if>
1252 </xsl:otherwise>
1253 </xsl:choose>
1254 </xsl:template>
1255 <!-- Stylecode processing
1256 Supports Bold, Underline and Italics display
1257 -->
1258 <xsl:template match="//n1:*[@styleCode]">
1259 <xsl:if test="@styleCode='Bold'">
1260 <xsl:element name="b">
1261 <xsl:apply-templates/>
1262 </xsl:element>
1263 </xsl:if>
1264 <xsl:if test="@styleCode='Italics'">
1265 <xsl:element name="i">
1266 <xsl:apply-templates/>
1267 </xsl:element>
1268 </xsl:if>
1269 <xsl:if test="@styleCode='Underline'">
1270 <xsl:element name="u">
1271 <xsl:apply-templates/>
1272 </xsl:element>
1273 </xsl:if>
1274 <xsl:if test="contains(@styleCode,'Bold') and contains(@styleCode,'Italics') and not (contains(@styleCode, 'Underline'))">
1275 <xsl:element name="b">
1276 <xsl:element name="i">
1277 <xsl:apply-templates/>
1278 </xsl:element>
1279 </xsl:element>
1280 </xsl:if>
1281 <xsl:if test="contains(@styleCode,'Bold') and contains(@styleCode,'Underline') and not (contains(@styleCode, 'Italics'))">
1282 <xsl:element name="b">
1283 <xsl:element name="u">
1284 <xsl:apply-templates/>
1285 </xsl:element>
1286 </xsl:element>
1287 </xsl:if>
1288 <xsl:if test="contains(@styleCode,'Italics') and contains(@styleCode,'Underline') and not (contains(@styleCode, 'Bold'))">
1289 <xsl:element name="i">
1290 <xsl:element name="u">
1291 <xsl:apply-templates/>
1292 </xsl:element>
1293 </xsl:element>
1294 </xsl:if>
1295 <xsl:if test="contains(@styleCode,'Italics') and contains(@styleCode,'Underline') and contains(@styleCode, 'Bold')">
1296 <xsl:element name="b">
1297 <xsl:element name="i">
1298 <xsl:element name="u">
1299 <xsl:apply-templates/>
1300 </xsl:element>
1301 </xsl:element>
1302 </xsl:element>
1303 </xsl:if>
1304 <xsl:if test="not (contains(@styleCode,'Italics') or contains(@styleCode,'Underline') or contains(@styleCode, 'Bold'))">
1305 <xsl:apply-templates/>
1306 </xsl:if>
1307 </xsl:template>
1308 <!-- Superscript or Subscript -->
1309 <xsl:template match="n1:sup">
1310 <xsl:element name="sup">
1311 <xsl:apply-templates/>
1312 </xsl:element>
1313 </xsl:template>
1314 <xsl:template match="n1:sub">
1315 <xsl:element name="sub">
1316 <xsl:apply-templates/>
1317 </xsl:element>
1318 </xsl:template>
1319 <!-- show nonXMLBody -->
1320 <xsl:template match='n1:component/n1:nonXMLBody'>
1321 <xsl:choose>
1322 <!-- if there is a reference, use that in an IFRAME -->
1323 <xsl:when test='n1:text/n1:reference'>
1324 <IFRAME name='nonXMLBody' id='nonXMLBody' WIDTH='80%' HEIGHT='66%' src='{n1:text/n1:reference/@value}'/>
1325 </xsl:when>
1326 <xsl:when test='n1:text/@mediaType="text/plain"'>
1327 <pre>
1328 <xsl:value-of select='n1:text/text()'/>
1329 </pre>
1330 </xsl:when>
1331 <xsl:otherwise>
1332 <CENTER>Cannot display the text</CENTER>
1333 </xsl:otherwise>
1334 </xsl:choose>
1335 </xsl:template>
1336 <!-- show-signature -->
1337 <xsl:template name="show-sig">
1338 <xsl:param name="sig"/>
1339 <xsl:choose>
1340 <xsl:when test="$sig/@code =&apos;S&apos;">
1341 <xsl:text>signed</xsl:text>
1342 </xsl:when>
1343 <xsl:when test="$sig/@code=&apos;I&apos;">
1344 <xsl:text>intended</xsl:text>
1345 </xsl:when>
1346 <xsl:when test="$sig/@code=&apos;X&apos;">
1347 <xsl:text>signature required</xsl:text>
1348 </xsl:when>
1349 </xsl:choose>
1350 </xsl:template>
1351 <!-- show-id -->
1352 <xsl:template name="show-id">
1353 <xsl:param name="id"/>
1354 <xsl:choose>
1355 <xsl:when test="not($id)">
1356 <xsl:if test="not(@nullFlavor)">
1357 <xsl:if test="@extension">
1358 <xsl:value-of select="@extension"/>
1359 </xsl:if>
1360 <xsl:text> </xsl:text>
1361 <xsl:value-of select="@root"/>
1362 </xsl:if>
1363 </xsl:when>
1364 <xsl:otherwise>
1365 <xsl:if test="not($id/@nullFlavor)">
1366 <xsl:if test="$id/@extension">
1367 <xsl:value-of select="$id/@extension"/>
1368 </xsl:if>
1369 <xsl:text> </xsl:text>
1370 <xsl:value-of select="$id/@root"/>
1371 </xsl:if>
1372 </xsl:otherwise>
1373 </xsl:choose>
1374 </xsl:template>
1375 <!-- show-name -->
1376 <xsl:template name="show-name">
1377 <xsl:param name="name"/>
1378 <xsl:choose>
1379 <xsl:when test="$name/n1:family">
1380 <xsl:if test="$name/n1:prefix">
1381 <xsl:value-of select="$name/n1:prefix"/>
1382 <xsl:text> </xsl:text>
1383 </xsl:if>
1384 <xsl:value-of select="$name/n1:given"/>
1385 <xsl:text> </xsl:text>
1386 <xsl:value-of select="$name/n1:family"/>
1387 <xsl:if test="$name/n1:suffix">
1388 <xsl:text>, </xsl:text>
1389 <xsl:value-of select="$name/n1:suffix"/>
1390 </xsl:if>
1391 </xsl:when>
1392 <xsl:otherwise>
1393 <xsl:value-of select="$name"/>
1394 </xsl:otherwise>
1395 </xsl:choose>
1396 </xsl:template>
1397 <!-- show-gender -->
1398 <xsl:template name="show-gender">
1399 <xsl:choose>
1400 <xsl:when test="@code = &apos;M&apos;">
1401 <xsl:text>Male</xsl:text>
1402 </xsl:when>
1403 <xsl:when test="@code = &apos;F&apos;">
1404 <xsl:text>Female</xsl:text>
1405 </xsl:when>
1406 <xsl:when test="@code = &apos;U&apos;">
1407 <xsl:text>Undifferentiated</xsl:text>
1408 </xsl:when>
1409 </xsl:choose>
1410 </xsl:template>
1411 <!-- show-contactInfo -->
1412 <xsl:template name="show-contactInfo">
1413 <xsl:param name="contact"/>
1414 <xsl:call-template name="show-address">
1415 <xsl:with-param name="address" select="$contact/n1:addr"/>
1416 </xsl:call-template>
1417 <xsl:call-template name="show-telecom">
1418 <xsl:with-param name="telecom" select="$contact/n1:telecom"/>
1419 </xsl:call-template>
1420 </xsl:template>
1421 <!-- show-address -->
1422 <xsl:template name="show-address">
1423 <xsl:param name="address"/>
1424 <xsl:choose>
1425 <xsl:when test="$address">
1426 <xsl:if test="$address/@use">
1427 <xsl:text> </xsl:text>
1428 <xsl:call-template name="translateTelecomCode">
1429 <xsl:with-param name="code" select="$address/@use"/>
1430 </xsl:call-template>
1431 <xsl:text>:</xsl:text>
1432 <br/>
1433 </xsl:if>
1434 <xsl:for-each select="$address/n1:streetAddressLine">
1435 <xsl:value-of select="."/>
1436 <br/>
1437 </xsl:for-each>
1438 <xsl:if test="$address/n1:streetName">
1439 <xsl:value-of select="$address/n1:streetName"/>
1440 <xsl:text> </xsl:text>
1441 <xsl:value-of select="$address/n1:houseNumber"/>
1442 <br/>
1443 </xsl:if>
1444 <xsl:if test="string-length($address/n1:city)>0">
1445 <xsl:value-of select="$address/n1:city"/>
1446 </xsl:if>
1447 <xsl:if test="string-length($address/n1:state)>0">
1448 <xsl:text>,&#160;</xsl:text>
1449 <xsl:value-of select="$address/n1:state"/>
1450 </xsl:if>
1451 <xsl:if test="string-length($address/n1:postalCode)>0">
1452 <xsl:text>&#160;</xsl:text>
1453 <xsl:value-of select="$address/n1:postalCode"/>
1454 </xsl:if>
1455 <xsl:if test="string-length($address/n1:country)>0">
1456 <xsl:text>,&#160;</xsl:text>
1457 <xsl:value-of select="$address/n1:country"/>
1458 </xsl:if>
1459 </xsl:when>
1460 <xsl:otherwise>
1461 <xsl:text>address not available</xsl:text>
1462 </xsl:otherwise>
1463 </xsl:choose>
1464 <br/>
1465 </xsl:template>
1466 <!-- show-telecom -->
1467 <xsl:template name="show-telecom">
1468 <xsl:param name="telecom"/>
1469 <xsl:choose>
1470 <xsl:when test="$telecom">
1471 <xsl:variable name="type" select="substring-before($telecom/@value, ':')"/>
1472 <xsl:variable name="value" select="substring-after($telecom/@value, ':')"/>
1473 <xsl:if test="$type">
1474 <xsl:call-template name="translateTelecomCode">
1475 <xsl:with-param name="code" select="$type"/>
1476 </xsl:call-template>
1477 <xsl:if test="@use">
1478 <xsl:text> (</xsl:text>
1479 <xsl:call-template name="translateTelecomCode">
1480 <xsl:with-param name="code" select="@use"/>
1481 </xsl:call-template>
1482 <xsl:text>)</xsl:text>
1483 </xsl:if>
1484 <xsl:text>: </xsl:text>
1485 <xsl:text> </xsl:text>
1486 <xsl:value-of select="$value"/>
1487 </xsl:if>
1488 </xsl:when>
1489 <xsl:otherwise>
1490 <xsl:text>Telecom information not available</xsl:text>
1491 </xsl:otherwise>
1492 </xsl:choose>
1493 <br/>
1494 </xsl:template>
1495 <!-- show-recipientType -->
1496 <xsl:template name="show-recipientType">
1497 <xsl:param name="typeCode"/>
1498 <xsl:choose>
1499 <xsl:when test="$typeCode='PRCP'">Primary Recipient:</xsl:when>
1500 <xsl:when test="$typeCode='TRC'">Secondary Recipient:</xsl:when>
1501 <xsl:otherwise>Recipient:</xsl:otherwise>
1502 </xsl:choose>
1503 </xsl:template>
1504 <!-- Convert Telecom URL to display text -->
1505 <xsl:template name="translateTelecomCode">
1506 <xsl:param name="code"/>
1507 <!--xsl:value-of select="document('voc.xml')/systems/system[@root=$code/@codeSystem]/code[@value=$code/@code]/@displayName"/-->
1508 <!--xsl:value-of select="document('codes.xml')/*/code[@code=$code]/@display"/-->
1509 <xsl:choose>
1510 <!-- lookup table Telecom URI -->
1511 <xsl:when test="$code='tel'">
1512 <xsl:text>Tel</xsl:text>
1513 </xsl:when>
1514 <xsl:when test="$code='fax'">
1515 <xsl:text>Fax</xsl:text>
1516 </xsl:when>
1517 <xsl:when test="$code='http'">
1518 <xsl:text>Web</xsl:text>
1519 </xsl:when>
1520 <xsl:when test="$code='mailto'">
1521 <xsl:text>Mail</xsl:text>
1522 </xsl:when>
1523 <xsl:when test="$code='H'">
1524 <xsl:text>Home</xsl:text>
1525 </xsl:when>
1526 <xsl:when test="$code='HV'">
1527 <xsl:text>Vacation Home</xsl:text>
1528 </xsl:when>
1529 <xsl:when test="$code='HP'">
1530 <xsl:text>Pirmary Home</xsl:text>
1531 </xsl:when>
1532 <xsl:when test="$code='WP'">
1533 <xsl:text>Work Place</xsl:text>
1534 </xsl:when>
1535 <xsl:when test="$code='PUB'">
1536 <xsl:text>Pub</xsl:text>
1537 </xsl:when>
1538 <xsl:otherwise>
1539 <xsl:text>{$code='</xsl:text>
1540 <xsl:value-of select="$code"/>
1541 <xsl:text>'?}</xsl:text>
1542 </xsl:otherwise>
1543 </xsl:choose>
1544 </xsl:template>
1545 <!-- convert RoleClassAssociative code to display text -->
1546 <xsl:template name="translateRoleAssoCode">
1547 <xsl:param name="code"/>
1548 <xsl:choose>
1549 <xsl:when test="$code='AFFL'">
1550 <xsl:text>affiliate</xsl:text>
1551 </xsl:when>
1552 <xsl:when test="$code='AGNT'">
1553 <xsl:text>agent</xsl:text>
1554 </xsl:when>
1555 <xsl:when test="$code='ASSIGNED'">
1556 <xsl:text>assigned entity</xsl:text>
1557 </xsl:when>
1558 <xsl:when test="$code='COMPAR'">
1559 <xsl:text>commissioning party</xsl:text>
1560 </xsl:when>
1561 <xsl:when test="$code='CON'">
1562 <xsl:text>contact</xsl:text>
1563 </xsl:when>
1564 <xsl:when test="$code='ECON'">
1565 <xsl:text>emergency contact</xsl:text>
1566 </xsl:when>
1567 <xsl:when test="$code='NOK'">
1568 <xsl:text>next of kin</xsl:text>
1569 </xsl:when>
1570 <xsl:when test="$code='SGNOFF'">
1571 <xsl:text>signing authority</xsl:text>
1572 </xsl:when>
1573 <xsl:when test="$code='GUARD'">
1574 <xsl:text>guardian</xsl:text>
1575 </xsl:when>
1576 <xsl:when test="$code='GUAR'">
1577 <xsl:text>guardian</xsl:text>
1578 </xsl:when>
1579 <xsl:when test="$code='CIT'">
1580 <xsl:text>citizen</xsl:text>
1581 </xsl:when>
1582 <xsl:when test="$code='COVPTY'">
1583 <xsl:text>covered party</xsl:text>
1584 </xsl:when>
1585 <xsl:otherwise>
1586 <xsl:text>{$code='</xsl:text>
1587 <xsl:value-of select="$code"/>
1588 <xsl:text>'?}</xsl:text>
1589 </xsl:otherwise>
1590 </xsl:choose>
1591 </xsl:template>
1592 <!-- show time -->
1593 <xsl:template name="show-time">
1594 <xsl:param name="datetime"/>
1595 <xsl:choose>
1596 <xsl:when test="not($datetime)">
1597 <xsl:call-template name="formatDateTime">
1598 <xsl:with-param name="date" select="@value"/>
1599 </xsl:call-template>
1600 <xsl:text> </xsl:text>
1601 </xsl:when>
1602 <xsl:otherwise>
1603 <xsl:call-template name="formatDateTime">
1604 <xsl:with-param name="date" select="$datetime/@value"/>
1605 </xsl:call-template>
1606 <xsl:text> </xsl:text>
1607 </xsl:otherwise>
1608 </xsl:choose>
1609 </xsl:template>
1610 <!-- show assignedEntity -->
1611 <xsl:template name="show-assignedEntity">
1612 <xsl:param name="asgnEntity"/>
1613 <xsl:choose>
1614 <xsl:when test="$asgnEntity/n1:assignedPerson/n1:name">
1615 <xsl:call-template name="show-name">
1616 <xsl:with-param name="name" select="$asgnEntity/n1:assignedPerson/n1:name"/>
1617 </xsl:call-template>
1618 <xsl:if test="$asgnEntity/n1:representedOrganization/n1:name">
1619 <xsl:text> of </xsl:text>
1620 <xsl:value-of select="$asgnEntity/n1:representedOrganization/n1:name"/>
1621 </xsl:if>
1622 </xsl:when>
1623 <xsl:when test="$asgnEntity/n1:representedOrganization">
1624 <xsl:value-of select="$asgnEntity/n1:representedOrganization/n1:name"/>
1625 </xsl:when>
1626 <xsl:otherwise>
1627 <xsl:for-each select="$asgnEntity/n1:id">
1628 <xsl:call-template name="show-id"/>
1629 <xsl:choose>
1630 <xsl:when test="position()!=last()">
1631 <xsl:text>, </xsl:text>
1632 </xsl:when>
1633 <xsl:otherwise>
1634 <br/>
1635 </xsl:otherwise>
1636 </xsl:choose>
1637 </xsl:for-each>
1638 </xsl:otherwise>
1639 </xsl:choose>
1640 </xsl:template>
1641
1642 <!-- show relatedEntity -->
1643 <xsl:template name="show-relatedEntity">
1644 <xsl:param name="relatedEntity"/>
1645 <xsl:choose>
1646 <xsl:when test="$relatedEntity/n1:relatedPerson/n1:name">
1647 <xsl:call-template name="show-name">
1648 <xsl:with-param name="name" select="$relatedEntity/n1:relatedPerson/n1:name"/>
1649 </xsl:call-template>
1650 </xsl:when>
1651 </xsl:choose>
1652 </xsl:template>
1653
1654 <!-- show associatedEntity -->
1655 <xsl:template name="show-associatedEntity">
1656 <xsl:param name="assoEntity"/>
1657 <xsl:choose>
1658 <xsl:when test="$assoEntity/n1:associatedPerson">
1659 <xsl:for-each select="$assoEntity/n1:associatedPerson/n1:name">
1660 <xsl:call-template name="show-name">
1661 <xsl:with-param name="name" select="."/>
1662 </xsl:call-template>
1663 <br/>
1664 </xsl:for-each>
1665 </xsl:when>
1666 <xsl:when test="$assoEntity/n1:scopingOrganization">
1667 <xsl:for-each select="$assoEntity/n1:scopingOrganization">
1668 <xsl:if test="n1:name">
1669 <xsl:call-template name="show-name">
1670 <xsl:with-param name="name" select="n1:name"/>
1671 </xsl:call-template>
1672 <br/>
1673 </xsl:if>
1674 <xsl:if test="n1:standardIndustryClassCode">
1675 <xsl:value-of select="n1:standardIndustryClassCode/@displayName"/>
1676 <xsl:text> code:</xsl:text>
1677 <xsl:value-of select="n1:standardIndustryClassCode/@code"/>
1678 </xsl:if>
1679 </xsl:for-each>
1680 </xsl:when>
1681 <xsl:when test="$assoEntity/n1:code">
1682 <xsl:call-template name="show-code">
1683 <xsl:with-param name="code" select="$assoEntity/n1:code"/>
1684 </xsl:call-template>
1685 </xsl:when>
1686 <xsl:when test="$assoEntity/n1:id">
1687 <xsl:value-of select="$assoEntity/n1:id/@extension"/>
1688 <xsl:text> </xsl:text>
1689 <xsl:value-of select="$assoEntity/n1:id/@root"/>
1690 </xsl:when>
1691 </xsl:choose>
1692 </xsl:template>
1693 <!-- show code
1694 if originalText present, return it, otherwise, check and return attribute: display name
1695 -->
1696 <xsl:template name="show-code">
1697 <xsl:param name="code"/>
1698 <xsl:variable name="this-codeSystem">
1699 <xsl:value-of select="$code/@codeSystem"/>
1700 </xsl:variable>
1701 <xsl:variable name="this-code">
1702 <xsl:value-of select="$code/@code"/>
1703 </xsl:variable>
1704 <xsl:choose>
1705 <xsl:when test="$code/n1:originalText">
1706 <xsl:value-of select="$code/n1:originalText"/>
1707 </xsl:when>
1708 <xsl:when test="$code/@displayName">
1709 <xsl:value-of select="$code/@displayName"/>
1710 </xsl:when>
1711 <!--
1712 <xsl:when test="$the-valuesets/*/voc:system[@root=$this-codeSystem]/voc:code[@value=$this-code]/@displayName">
1713 <xsl:value-of select="$the-valuesets/*/voc:system[@root=$this-codeSystem]/voc:code[@value=$this-code]/@displayName"/>
1714 </xsl:when>
1715 -->
1716 <xsl:otherwise>
1717 <xsl:value-of select="$this-code"/>
1718 </xsl:otherwise>
1719 </xsl:choose>
1720 </xsl:template> <!-- show classCode -->
1721 <xsl:template name="show-actClassCode">
1722 <xsl:param name="clsCode"/>
1723 <xsl:choose>
1724 <xsl:when test=" $clsCode = 'ACT' ">
1725 <xsl:text>healthcare service</xsl:text>
1726 </xsl:when>
1727 <xsl:when test=" $clsCode = 'ACCM' ">
1728 <xsl:text>accommodation</xsl:text>
1729 </xsl:when>
1730 <xsl:when test=" $clsCode = 'ACCT' ">
1731 <xsl:text>account</xsl:text>
1732 </xsl:when>
1733 <xsl:when test=" $clsCode = 'ACSN' ">
1734 <xsl:text>accession</xsl:text>
1735 </xsl:when>
1736 <xsl:when test=" $clsCode = 'ADJUD' ">
1737 <xsl:text>financial adjudication</xsl:text>
1738 </xsl:when>
1739 <xsl:when test=" $clsCode = 'CONS' ">
1740 <xsl:text>consent</xsl:text>
1741 </xsl:when>
1742 <xsl:when test=" $clsCode = 'CONTREG' ">
1743 <xsl:text>container registration</xsl:text>
1744 </xsl:when>
1745 <xsl:when test=" $clsCode = 'CTTEVENT' ">
1746 <xsl:text>clinical trial timepoint event</xsl:text>
1747 </xsl:when>
1748 <xsl:when test=" $clsCode = 'DISPACT' ">
1749 <xsl:text>disciplinary action</xsl:text>
1750 </xsl:when>
1751 <xsl:when test=" $clsCode = 'ENC' ">
1752 <xsl:text>encounter</xsl:text>
1753 </xsl:when>
1754 <xsl:when test=" $clsCode = 'INC' ">
1755 <xsl:text>incident</xsl:text>
1756 </xsl:when>
1757 <xsl:when test=" $clsCode = 'INFRM' ">
1758 <xsl:text>inform</xsl:text>
1759 </xsl:when>
1760 <xsl:when test=" $clsCode = 'INVE' ">
1761 <xsl:text>invoice element</xsl:text>
1762 </xsl:when>
1763 <xsl:when test=" $clsCode = 'LIST' ">
1764 <xsl:text>working list</xsl:text>
1765 </xsl:when>
1766 <xsl:when test=" $clsCode = 'MPROT' ">
1767 <xsl:text>monitoring program</xsl:text>
1768 </xsl:when>
1769 <xsl:when test=" $clsCode = 'PCPR' ">
1770 <xsl:text>care provision</xsl:text>
1771 </xsl:when>
1772 <xsl:when test=" $clsCode = 'PROC' ">
1773 <xsl:text>procedure</xsl:text>
1774 </xsl:when>
1775 <xsl:when test=" $clsCode = 'REG' ">
1776 <xsl:text>registration</xsl:text>
1777 </xsl:when>
1778 <xsl:when test=" $clsCode = 'REV' ">
1779 <xsl:text>review</xsl:text>
1780 </xsl:when>
1781 <xsl:when test=" $clsCode = 'SBADM' ">
1782 <xsl:text>substance administration</xsl:text>
1783 </xsl:when>
1784 <xsl:when test=" $clsCode = 'SPCTRT' ">
1785 <xsl:text>speciment treatment</xsl:text>
1786 </xsl:when>
1787 <xsl:when test=" $clsCode = 'SUBST' ">
1788 <xsl:text>substitution</xsl:text>
1789 </xsl:when>
1790 <xsl:when test=" $clsCode = 'TRNS' ">
1791 <xsl:text>transportation</xsl:text>
1792 </xsl:when>
1793 <xsl:when test=" $clsCode = 'VERIF' ">
1794 <xsl:text>verification</xsl:text>
1795 </xsl:when>
1796 <xsl:when test=" $clsCode = 'XACT' ">
1797 <xsl:text>financial transaction</xsl:text>
1798 </xsl:when>
1799 </xsl:choose>
1800 </xsl:template>
1801 <!-- show participationType -->
1802 <xsl:template name="show-participationType">
1803 <xsl:param name="ptype"/>
1804 <xsl:choose>
1805 <xsl:when test=" $ptype='PPRF' ">
1806 <xsl:text>primary performer</xsl:text>
1807 </xsl:when>
1808 <xsl:when test=" $ptype='PRF' ">
1809 <xsl:text>performer</xsl:text>
1810 </xsl:when>
1811 <xsl:when test=" $ptype='VRF' ">
1812 <xsl:text>verifier</xsl:text>
1813 </xsl:when>
1814 <xsl:when test=" $ptype='SPRF' ">
1815 <xsl:text>secondary performer</xsl:text>
1816 </xsl:when>
1817 </xsl:choose>
1818 </xsl:template>
1819 <!-- show participationFunction -->
1820 <xsl:template name="show-participationFunction">
1821 <xsl:param name="pFunction"/>
1822 <xsl:choose>
1823 <xsl:when test=" $pFunction = 'ADMPHYS' ">
1824 <xsl:text>admitting physician</xsl:text>
1825 </xsl:when>
1826 <xsl:when test=" $pFunction = 'ANEST' ">
1827 <xsl:text>anesthesist</xsl:text>
1828 </xsl:when>
1829 <xsl:when test=" $pFunction = 'ANRS' ">
1830 <xsl:text>anesthesia nurse</xsl:text>
1831 </xsl:when>
1832 <xsl:when test=" $pFunction = 'ATTPHYS' ">
1833 <xsl:text>attending physician</xsl:text>
1834 </xsl:when>
1835 <xsl:when test=" $pFunction = 'DISPHYS' ">
1836 <xsl:text>discharging physician</xsl:text>
1837 </xsl:when>
1838 <xsl:when test=" $pFunction = 'FASST' ">
1839 <xsl:text>first assistant surgeon</xsl:text>
1840 </xsl:when>
1841 <xsl:when test=" $pFunction = 'MDWF' ">
1842 <xsl:text>midwife</xsl:text>
1843 </xsl:when>
1844 <xsl:when test=" $pFunction = 'NASST' ">
1845 <xsl:text>nurse assistant</xsl:text>
1846 </xsl:when>
1847 <xsl:when test=" $pFunction = 'PCP' ">
1848 <xsl:text>primary care physician</xsl:text>
1849 </xsl:when>
1850 <xsl:when test=" $pFunction = 'PRISURG' ">
1851 <xsl:text>primary surgeon</xsl:text>
1852 </xsl:when>
1853 <xsl:when test=" $pFunction = 'RNDPHYS' ">
1854 <xsl:text>rounding physician</xsl:text>
1855 </xsl:when>
1856 <xsl:when test=" $pFunction = 'SASST' ">
1857 <xsl:text>second assistant surgeon</xsl:text>
1858 </xsl:when>
1859 <xsl:when test=" $pFunction = 'SNRS' ">
1860 <xsl:text>scrub nurse</xsl:text>
1861 </xsl:when>
1862 <xsl:when test=" $pFunction = 'TASST' ">
1863 <xsl:text>third assistant</xsl:text>
1864 </xsl:when>
1865 </xsl:choose>
1866 </xsl:template>
1867 <xsl:template name="formatDateTime">
1868 <xsl:param name="date"/>
1869 <!-- month -->
1870 <xsl:variable name="month" select="substring ($date, 5, 2)"/>
1871 <xsl:choose>
1872 <xsl:when test="$month='01'">
1873 <xsl:text>January </xsl:text>
1874 </xsl:when>
1875 <xsl:when test="$month='02'">
1876 <xsl:text>February </xsl:text>
1877 </xsl:when>
1878 <xsl:when test="$month='03'">
1879 <xsl:text>March </xsl:text>
1880 </xsl:when>
1881 <xsl:when test="$month='04'">
1882 <xsl:text>April </xsl:text>
1883 </xsl:when>
1884 <xsl:when test="$month='05'">
1885 <xsl:text>May </xsl:text>
1886 </xsl:when>
1887 <xsl:when test="$month='06'">
1888 <xsl:text>June </xsl:text>
1889 </xsl:when>
1890 <xsl:when test="$month='07'">
1891 <xsl:text>July </xsl:text>
1892 </xsl:when>
1893 <xsl:when test="$month='08'">
1894 <xsl:text>August </xsl:text>
1895 </xsl:when>
1896 <xsl:when test="$month='09'">
1897 <xsl:text>September </xsl:text>
1898 </xsl:when>
1899 <xsl:when test="$month='10'">
1900 <xsl:text>October </xsl:text>
1901 </xsl:when>
1902 <xsl:when test="$month='11'">
1903 <xsl:text>November </xsl:text>
1904 </xsl:when>
1905 <xsl:when test="$month='12'">
1906 <xsl:text>December </xsl:text>
1907 </xsl:when>
1908 </xsl:choose>
1909 <!-- day -->
1910 <xsl:choose>
1911 <xsl:when test='substring ($date, 7, 1)="0"'>
1912 <xsl:value-of select="substring ($date, 8, 1)"/>
1913 <xsl:text>, </xsl:text>
1914 </xsl:when>
1915 <xsl:otherwise>
1916 <xsl:value-of select="substring ($date, 7, 2)"/>
1917 <xsl:text>, </xsl:text>
1918 </xsl:otherwise>
1919 </xsl:choose>
1920 <!-- year -->
1921 <xsl:value-of select="substring ($date, 1, 4)"/>
1922 <!-- time and US timezone -->
1923 <xsl:if test="string-length($date) > 8">
1924 <xsl:text>, </xsl:text>
1925 <!-- time -->
1926 <xsl:variable name="time">
1927 <xsl:value-of select="substring($date,9,6)"/>
1928 </xsl:variable>
1929 <xsl:variable name="hh">
1930 <xsl:value-of select="substring($time,1,2)"/>
1931 </xsl:variable>
1932 <xsl:variable name="mm">
1933 <xsl:value-of select="substring($time,3,2)"/>
1934 </xsl:variable>
1935 <xsl:variable name="ss">
1936 <xsl:value-of select="substring($time,5,2)"/>
1937 </xsl:variable>
1938 <xsl:if test="string-length($hh)&gt;1">
1939 <xsl:value-of select="$hh"/>
1940 <xsl:if test="string-length($mm)&gt;1 and not(contains($mm,'-')) and not (contains($mm,'+'))">
1941 <xsl:text>:</xsl:text>
1942 <xsl:value-of select="$mm"/>
1943 <xsl:if test="string-length($ss)&gt;1 and not(contains($ss,'-')) and not (contains($ss,'+'))">
1944 <xsl:text>:</xsl:text>
1945 <xsl:value-of select="$ss"/>
1946 </xsl:if>
1947 </xsl:if>
1948 </xsl:if>
1949 <!-- time zone -->
1950 <xsl:variable name="tzon">
1951 <xsl:choose>
1952 <xsl:when test="contains($date,'+')">
1953 <xsl:text>+</xsl:text>
1954 <xsl:value-of select="substring-after($date, '+')"/>
1955 </xsl:when>
1956 <xsl:when test="contains($date,'-')">
1957 <xsl:text>-</xsl:text>
1958 <xsl:value-of select="substring-after($date, '-')"/>
1959 </xsl:when>
1960 </xsl:choose>
1961 </xsl:variable>
1962 <xsl:choose>
1963 <!-- reference: http://www.timeanddate.com/library/abbreviations/timezones/na/ -->
1964 <xsl:when test="$tzon = '-0500' ">
1965 <xsl:text>, EST</xsl:text>
1966 </xsl:when>
1967 <xsl:when test="$tzon = '-0600' ">
1968 <xsl:text>, CST</xsl:text>
1969 </xsl:when>
1970 <xsl:when test="$tzon = '-0700' ">
1971 <xsl:text>, MST</xsl:text>
1972 </xsl:when>
1973 <xsl:when test="$tzon = '-0800' ">
1974 <xsl:text>, PST</xsl:text>
1975 </xsl:when>
1976 <xsl:otherwise>
1977 <xsl:text> </xsl:text>
1978 <xsl:value-of select="$tzon"/>
1979 </xsl:otherwise>
1980 </xsl:choose>
1981 </xsl:if>
1982 </xsl:template>
1983 <!-- convert to lower case -->
1984 <xsl:template name="caseDown">
1985 <xsl:param name="data"/>
1986 <xsl:if test="$data">
1987 <xsl:value-of select="translate($data, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
1988 </xsl:if>
1989 </xsl:template>
1990 <!-- convert to upper case -->
1991 <xsl:template name="caseUp">
1992 <xsl:param name="data"/>
1993 <xsl:if test="$data">
1994 <xsl:value-of select="translate($data,'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
1995 </xsl:if>
1996 </xsl:template>
1997 <!-- convert first character to upper case -->
1998 <xsl:template name="firstCharCaseUp">
1999 <xsl:param name="data"/>
2000 <xsl:if test="$data">
2001 <xsl:call-template name="caseUp">
2002 <xsl:with-param name="data" select="substring($data,1,1)"/>
2003 </xsl:call-template>
2004 <xsl:value-of select="substring($data,2)"/>
2005 </xsl:if>
2006 </xsl:template>
2007 <!-- show-noneFlavor -->
2008 <!-- to do list -->
2009 <xsl:template name="show-noneFlavor">
2010 </xsl:template>
2011</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.