forked from HL7/CDA-core-xsl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCDA.xsl
6902 lines (6716 loc) · 361 KB
/
CDA.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
xmlns:hl7="urn:hl7-org:v3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:sdtc="urn:hl7-org:sdtc"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="xd hl7 xsi xhtml sdtc">
<xd:doc scope="stylesheet">
<xd:desc>
<xd:p><xd:b>Title:</xd:b> CDA R2 StyleSheet</xd:p>
<xd:p><xd:b>Version:</xd:b> 4.0.2 beta 11</xd:p>
<xd:p><xd:b>Maintained by:</xd:b> HL7 <xd:a href="https://confluence.hl7.org/display/SD/Structured+Documents">Structured Documents Work Group</xd:a></xd:p>
<xd:p><xd:b>Purpose:</xd:b> Provides general purpose display of CDA release 2.0 and 2.1 (Specification: ANSI/HL7 CDAR2) and CDA release 3 (Specification was pulled after ballot) documents. It may also be a starting point for people interested in extending the display. This stylesheet displays all section content, but does not try to render each and every header attribute. For header attributes it tries to be smart in displaying essentials, which is still a lot.</xd:p>
<xd:p><xd:b>License:</xd:b> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a></xd:p>
<xd:p><xd:b>Warranty</xd:b> The CDA XSL is a sample rendering and should be used in that fashion without warranty or guarantees of suitability for a particular purpose. The stylesheet should be tested locally by implementers before production usage.</xd:p>
<xd:p><xd:b>Project Link:</xd:b> <xd:a href="https://github.com/HL7/cda-core-xsl">https://github.com/HL7/cda-core-xsl</xd:a>. Including downloads of releases, documentation, issue tracker and more.</xd:p>
<xd:p><xd:b>History:</xd:b> This stylesheet stands on the shoulders of giants. The stylesheet is the cumulative work of several developers; the most significant prior milestones were the foundation work from HL7 Germany and Finland (Tyylitiedosto) and HL7 US (Calvin Beebe), and the presentation approach from Tony Schaller, medshare GmbH provided at IHIC 2009. The stylesheet has subsequently been maintained/updated by Lantana Group (US) and Nictiz (NL).</xd:p>
<xd:p><xd:b>Revisions:</xd:b> The release notes previously contained in the stylesheet, have moved to the <xd:a href="https://github.com/HL7/cda-core-xsl/wiki/Revisions">GitHub</xd:a> where the project is maintained.</xd:p>
</xd:desc>
</xd:doc>
<xd:doc>
<xd:desc>
<xd:p>XSLT 1.0 does not have date function, so we need something to compare against e.g. to get someones age</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="currentDate" select="(/hl7:ClinicalDocument/hl7:effectiveTime/@value)[1]"/>
<xd:doc>
<xd:desc>
<xd:p>Vocabulary file containing language dependant strings such as labels</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="vocFile" select="'cda_l10n.xml'"/>
<xd:doc>
<xd:desc>
<xd:p>Cache language dependant strings</xd:p>
</xd:desc>
</xd:doc>
<xsl:variable name="vocMessages" select="document($vocFile)"/>
<xd:doc>
<xd:desc>
<xd:p>Default language for retrieval of language dependant strings such as labels, e.g. 'en-US'. This is the fallback language in case the string is not available in the actual language. See also <xd:ref name="textLang" type="parameter">textLang</xd:ref>.</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="textlangDefault" select="'en-US'"/>
<xd:doc>
<xd:desc>
<xd:p>Actual language for retrieval of language dependant strings such as labels, e.g. 'en-US'. Unless supplied, this is taken from the ClinicalDocument/language/@code attribute, or in case that is not present from <xd:ref name="textlangDefault" type="parameter">textlangDefault</xd:ref>.</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="textLang">
<xsl:choose>
<xsl:when test="/hl7:ClinicalDocument/hl7:languageCode/@code">
<xsl:value-of select="/hl7:ClinicalDocument/hl7:languageCode/@code"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$textlangDefault"/>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xd:doc>
<xd:desc>
<xd:p>Currently unused. Unsupported by Internet Explorer. Text encoding to render the output in. Defaults to UTF-8 which is fine for most environments. Could change into more localized encodings such as cp-1252 (Windows Latin 1), iso-8859-1 (Latin 1), or shift-jis (Japanese Kanji table))</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="textEncoding" select="'utf-8'"/>
<xd:doc>
<xd:desc>
<xd:p>Boolean value for whether the result document may contain JavaScript. Some environments forbid the use of JavaScript. Without JavaScript, certain more dynamic features may not work.</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="useJavascript" select="'true'"/>
<xd:doc>
<xd:desc>
<xd:p>Absolute or relative URI to an external Cascading Stylesheet (CSS) file that contains style attributes for custom markup, e.g. in the @styleCode attribute in Section.text</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="externalCss"/>
<xd:doc>
<xd:desc>
<xd:p>Determines the font family for the whole document unless overruled somewhere</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="font-family" select="'Verdana, Tahoma, sans-serif'"/>
<xd:doc>
<xd:desc>
<xd:p>Determines the font size for all text unless otherwise specified, and is the base value for other font sizes</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="font-size-main" select="'9pt'"/>
<xd:doc>
<xd:desc>
<xd:p>Determines the font size for text in the h1 tag, defaults to <xd:ref name="font-size-main" type="parameter">font-size-main</xd:ref> + 3</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="font-size-h1">
<xsl:call-template name="raiseFontSize">
<xsl:with-param name="with" select="3"/>
</xsl:call-template>
</xsl:param>
<xd:doc>
<xd:desc>
<xd:p>Determines the font size for text in the h2 tag, defaults to <xd:ref name="font-size-main" type="parameter">font-size-main</xd:ref> + 2</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="font-size-h2">
<xsl:call-template name="raiseFontSize">
<xsl:with-param name="with" select="2"/>
</xsl:call-template>
</xsl:param>
<xd:doc>
<xd:desc>
<xd:p>Determines the font size for text in the h3 tag, defaults to <xd:ref name="font-size-main" type="parameter">font-size-main</xd:ref> + 1</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="font-size-h3">
<xsl:call-template name="raiseFontSize">
<xsl:with-param name="with" select="1"/>
</xsl:call-template>
</xsl:param>
<xd:doc>
<xd:desc>
<xd:p>Determines the font size for text in the h4 tag, defaults to <xd:ref name="font-size-main" type="parameter">font-size-main</xd:ref></xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="font-size-h4" select="$font-size-main"/>
<xd:doc>
<xd:desc>
<xd:p>Determines the font size for text in the h5 tag, defaults to <xd:ref name="font-size-main" type="parameter">font-size-main</xd:ref></xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="font-size-h5" select="$font-size-main"/>
<xd:doc>
<xd:desc>
<xd:p>Determines the font size for text in the h6 tag, defaults to <xd:ref name="font-size-main" type="parameter">font-size-main</xd:ref></xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="font-size-h6" select="$font-size-main"/>
<xd:doc>
<xd:desc>
<xd:p>Determines the font size for footnote text, defaults to <xd:ref name="font-size-main" type="parameter">font-size-main</xd:ref> - 1</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="font-size-footnote">
<xsl:call-template name="raiseFontSize">
<xsl:with-param name="with" select="-1"/>
</xsl:call-template>
</xsl:param>
<xd:doc>
<xd:desc>
<xd:p>Determines the background-color, as any legal hex, rgb or named color, for header like table elements, e.g. th tags, defaults to "LightGrey".</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="bgcolor-th">LightGrey</xsl:param>
<xd:doc>
<xd:desc>
<xd:p>Determines the background-color, as any legal hex, rgb or named color, for body like table elements, e.g. td tags, defaults to "#f2f2f2".</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="bgcolor-td">#f2f2f2</xsl:param>
<xd:doc>
<xd:desc>
<xd:p>Determines if the document title and top level summary of header information (patient/guardian/author/encounter/documentationOf, inFulfillmentOf) should be rendered. Defaults to "true", any other value is interpreted as "do not render". Some systems may have a context around the rendering of the document that would make rendering the header superfluous. Note that the footer, which may be switched off separately contains everything that the header does and more.</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="dohtmlheader">true</xsl:param>
<xd:doc>
<xd:desc>
<xd:p>Determines if the document footer containing a listing of everything in the CDA Header should be rendered. Defaults to "true", any other value is interpreted as "do not render". Some systems may have a context around the rendering of the document that would make rendering the footer superfluous, or just want to concentrate on document contents.</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="dohtmlfooter">true</xsl:param>
<xd:doc>
<xd:desc>
<xd:p>Security parameter. May contain a vertical bar separated list of URI prefixes, such as "http://www.example.com|https://www.example.com". See parameter <xd:ref name="limit-external-images" type="parameter">limit-external-images</xd:ref> for more detail.</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="external-image-whitelist"/>
<xd:doc>
<xd:desc>
<xd:p>Security parameter. When set to 'yes' limits the URIs to images (if any) to locally attached images and/or images that are on the <xd:ref name="external-image-whitelist" type="parameter">external-image-whitelist</xd:ref>. When set to anything other than 'yes' also allows for arbitrary external images (e.g. through http:// or https://). Default value is 'yes' which is considered defensive against potential security risks that could stem from resources loaded from arbitrary source.</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="limit-external-images" select="'yes'"/>
<xd:doc>
<xd:desc>
<xd:p>Security parameter. When set to 'yes' <xd:a href="https://html.spec.whatwg.org/multipage/origin.html#sandboxed-plugins-browsing-context-flag">sandboxes the iframe for pdfs</xd:a>. Sandboxed iframe disallow plug-ins, including the plug-in needed to render pdf. Effectively this setting thus prohibits pdf rendering. When set to anything other than 'yes', pdf carrying iframes are not sandboxed and pdf rendering is possible. Default value is 'yes' which is considered defensive against potential security risks that could stem from resources loaded from arbitrary source.</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="limit-pdf" select="'yes'"/>
<xd:doc>
<xd:desc>Determines depth of menu at the top of the document. Default is 1, which means just head section. Max is 3 which is head section + 2 levels (if any)</xd:desc>
</xd:doc>
<xsl:param name="menu-depth" select="3"/>
<xd:doc>
<xd:desc>Privacy parameter. Accepts a comma separated list of patient ID root values (normally OID's). When a patient ID is encountered with a root value in this list, then the rendering of the extension will be xxx-xxx-xxx regardless of what the actual value is. This is useful to prevent public display of for example the US SSN. Default is to render any ID as it occurs in the document. Note that this setting only affects human rendering and that it does not affect automated processing of the underlying document. If the same value also occurs in the <xd:ref name="skip-ids" type="parameter">skip-ids</xd:ref> list, then that takes precedence.</xd:desc>
</xd:doc>
<xsl:param name="skip-ids"/>
<xsl:variable name="skip-ids-var" select="concat(',',$skip-ids,',')"/>
<xd:doc>
<xd:desc>Privacy parameter. Accepts a comma separated list of patient ID root values (normally OID's). When a patient ID is encountered with a root value in this list, then the rendering of this ID will be skipped. This is useful to prevent public display of for example the US SSN. Default is to render any ID as it occurs in the document. Note that this setting only affects human rendering and that it does not affect automated processing of the underlying document.</xd:desc>
</xd:doc>
<xsl:param name="mask-ids"/>
<xsl:variable name="mask-ids-var" select="concat(',',$mask-ids,',')"/>
<xd:doc>
<xd:desc>Determines if sections will receive numbering according to ClinicalDocument order. Value 'true' activates numbering. Top level sections are 1, 2, 3, 4, sub level sections are 1.1, 1.2, 1.2.1, 1.2.2 etc.</xd:desc>
</xd:doc>
<xsl:param name="dosectionnumbering" select="'false'"/>
<xd:doc>
<xd:desc>
<xd:p>Do lowercase compare of language+region</xd:p>
</xd:desc>
</xd:doc>
<xsl:variable name="textLangLowerCase">
<xsl:call-template name="caseDown">
<xsl:with-param name="data" select="$textLang"/>
</xsl:call-template>
</xsl:variable>
<xd:doc>
<xd:desc>
<xd:p>Do lowercase compare of language (assume alpha2 not alpha3)</xd:p>
</xd:desc>
</xd:doc>
<xsl:variable name="textLangPartLowerCase" select="substring($textLangLowerCase,1,2)"/>
<xd:doc>
<xd:desc>
<xd:p>Do lowercase compare of default language+region</xd:p>
</xd:desc>
</xd:doc>
<xsl:variable name="textLangDefaultLowerCase">
<xsl:call-template name="caseDown">
<xsl:with-param name="data" select="$textlangDefault"/>
</xsl:call-template>
</xsl:variable>
<xd:doc>
<xd:desc>
<xd:p>Do lowercase compare of default language (assume alpha2 not alpha3)</xd:p>
</xd:desc>
</xd:doc>
<xsl:variable name="textLangDefaultPartLowerCase" select="substring($textLangDefaultLowerCase,1,2)"/>
<xd:doc>
<xd:desc>
<xd:p>String processing variable. Lower-case alphabet</xd:p>
</xd:desc>
</xd:doc>
<xsl:variable name="lc" select="'abcdefghijklmnopqrstuvwxyz'" />
<xd:doc>
<xd:desc>
<xd:p>String processing variable. Upper-case alphabet</xd:p>
</xd:desc>
</xd:doc>
<xsl:variable name="uc" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xd:doc>
<xd:desc>
<xd:p>String processing variable. Removes the following characters, in addition to line breaks "':;?`{}“”„‚’</xd:p>
</xd:desc>
</xd:doc>
<xsl:variable name="simple-sanitizer-match"><xsl:text> "':;?`{}“”„‚’</xsl:text></xsl:variable>
<xd:doc>
<xd:desc>
<xd:p>String processing variable.</xd:p>
</xd:desc>
</xd:doc>
<xsl:variable name="simple-sanitizer-replace" select="'***************'"/>
<xd:doc>
<xd:desc>
<xd:p>Use XHTML 1.0 Strict with UTF-8 encoding. CDAr3 specifies an XHTML subset of tags in Section.text so that makes mapping easier.</xd:p>
</xd:desc>
</xd:doc>
<xsl:output indent="yes" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
<xd:doc>
<xd:desc>
<xd:p>Main template. Triggers on all top level ClinicalDocument elements</xd:p>
</xd:desc>
</xd:doc>
<xsl:template match="/">
<xsl:apply-templates select="/hl7:ClinicalDocument"/>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Starts an HTML document containing a rendering of the ClinicalDocument</xd:p>
</xd:desc>
</xd:doc>
<xsl:template match="hl7:ClinicalDocument[not(ancestor::hl7:ClinicalDocument)]">
<xsl:comment> Do NOT edit this HTML directly: it was generated via an XSLT transformation from a CDA Release 2 or 3 XML document. </xsl:comment>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{substring($textLangLowerCase,1,2)}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>
<xsl:call-template name="show-title"/>
</title>
<xsl:comment> General CSS </xsl:comment>
<style type="text/css" media="all">
*{
font-family: <xsl:value-of select="$font-family"/>;
font-size: <xsl:value-of select="$font-size-main"/>;
}
body{
padding: 2px;
color: #003366;
background-color: white;
font-size: <xsl:value-of select="$font-size-main"/>;
}
#documentheader,
#documentbody,
#documentfooter{
width: 100%;
}
#documentheader{
border-bottom: 1px solid grey;
margin-bottom: 1em;
}
#documentfooter{
border-top: 1px solid grey;
margin-top: 1em;
}
a{
color: #003366;
background-color: white;
}
h1{
font-size: <xsl:value-of select="$font-size-h1"/>;
font-weight: bold;
}
h1.title{
text-align: center;
}
h2{
font-size: <xsl:value-of select="$font-size-h2"/>;
font-weight: bold;
}
h3{
font-size: <xsl:value-of select="$font-size-h3"/>;
font-weight: bold;
}
h4{
font-size: <xsl:value-of select="$font-size-h4"/>;
font-weight: bold;
}
h5{
font-size: <xsl:value-of select="$font-size-h5"/>;
font-weight: bold;
}
h6{
font-size: <xsl:value-of select="$font-size-h6"/>;
font-weight: bold;
}
hr{
width: 100%;
}
span {
font-size: <xsl:value-of select="$font-size-main"/>; /* IE8 hack: doesn't understand inheritance */
display: inline; /* IE8 hack: would go to next line otherwise */
}
table{
line-height: 10pt;
width: 100%;
}
thead tr, th{
background-color: <xsl:value-of select="$bgcolor-th"/>;
}
tbody tr{
background-color: <xsl:value-of select="$bgcolor-td"/>;
}
td{
font-size: <xsl:value-of select="$font-size-main"/>; /* IE8 hack: doesn't understand inheritance */
padding: 0.1cm 0.2cm;
vertical-align: top;
}
.table_simple{
width: auto;
color: inherit;
background-color: inherit;
}
.table_simple td{
padding: 0;
}
.table_simple td.td_label{
font-size: <xsl:value-of select="$font-size-main"/>; /* IE8 hack: doesn't understand inheritance */
font-weight: inherit;
font-style: italic;
padding-right: 0.2cm;
}
.header_table{
border: 1pt solid #00008b;
}
.narr_table{
width: 100%;
margin: 0.3em 0;
}
.narr_tr{
//background-color: #ffffcc;
}
.narr_th{
background-color: <xsl:value-of select="$bgcolor-th"/>;
font-size: <xsl:value-of select="$font-size-main"/>; /* IE8 hack: doesn't understand inheritance */
}
.narr_footnote{
font-size: <xsl:value-of select="$font-size-footnote"/>;
font-style: italic;
}
.td_label{
font-size: <xsl:value-of select="$font-size-main"/>; /* IE8 hack: doesn't understand inheritance */
font-weight: bold;
background-color: <xsl:value-of select="$bgcolor-th"/>;
}
.td_label_width{
width: 20%;
}
.span_label{
font-size: <xsl:value-of select="$font-size-main"/>; /* IE8 hack: doesn't understand inheritance */
font-weight: bold;
}
.span_value{
font-size: <xsl:value-of select="$font-size-main"/>; /* IE8 hack: doesn't understand inheritance */
font-weight: normal;
}
.revision_insert{
text-decoration: underline overline;
}
.revision_insert_final{
}
.revision_delete{
text-decoration: line-through;
}
.revision_delete_final{
display: none;
}
.span_button {
display: table-cell;
cursor: pointer;
border: 2pt inset #585858;
border-radius: 15px;
-moz-border-radius: 15px;
padding: 0.1cm 0.2cm;
background-color: <xsl:value-of select="$bgcolor-td"/>;
font-weight: bold;
vertical-align: baseline;
width: 150px;
}
div.separator {
height: 1em;
}
div.caption {
font-weight: bold;
text-align: center;
}
</style>
<xsl:comment> Stylecode CSS </xsl:comment>
<style type="text/css" media="all">
.Bold{
font-weight: bold;
}
.Italics{
font-style: italic;
}
.Underline{
text-decoration: underline;
}
.Emphasis{
font-weight: bold;
font-style: italic;
}
.Lrule{
border-left-width: 2px;
border-left-style: solid;
}
.Rrule{
border-right-width: 2px;
border-right-style: solid;
}
.Toprule{
border-top-width: 2px;
border-top-style: solid;
}
.Botrule{
border-bottom-width: 2px;
border-bottom-style: solid;
}
.Arabic{
list-style: arabic;
}
.LittleRoman{
list-style: lower-roman;
}
.BigRoman{
list-style: upper-roman;
}
.LittleAlpha{
list-style: lower-alpha;
}
.BigAlpha{
list-style: upper-alpha
}
.Disc{
list-style: disc;
}
.Circle{
list-style: circle;
}
.Square{
list-style: square;
}</style>
<!--<xsl:comment> Stylecode CSS IHE PCC MCV, Revision 1.2, Trial Implementation, November 2, 2018</xsl:comment>
<style type="text/css" media="all">
.xOrganizerRow > td, .organizer-row > td {
padding-bottom: 4px;
}
.xOrganizerRow, .organizer-row {
border-bottom: none;
}
.xWhitespace {
padding-left: 4px;
}
.xContentSpacing {
padding-left: 2.5em;
}
.xRowGroup > tr {
border-bottom: none;
}
table:first-of-type > tbody:first-of-type {
border-top: none;
}
.xRowGroup {
border-top: 1px dotted #222;
}
.xSectionComments {
text-decoration: underline;
}
.xSectionComments, .xReconciliation {
margin-top: 15px;
}
.xLabel {
font-style:italic;
}
.xAlert, .xReaction{
color: red;
}
tr.xAlert {
background-color: #FDE7EC
}
tr.xAlert > td:first-of-type:before {
content: "\25B2";
}
.xContentWrapping {
display: table-cell;
padding-left: 5px;
}
.xIndent, .xIndention{
white-space: pre;
vertical-align: top;
display: table-cell;
}
.xlistForTable {
list-style: none;
padding: 0;
}
.xtableWithinTable > tr > td {
margin: 0;
padding: 0;
}
xCenter {
text-align: center;
}
xRight {
text-align: right;
}
xLeft {
text-align: left;
}
xTop {
vertical-align: top;
}
xMiddle {
vertical-align: middle;
}
xBottom {
vertical-align: bottom;
}
xMono {
font-family: monospace;
}
xHighlight {
background-color: yellow;
color: black;
}
</style>-->
<xsl:comment> Section Button Toggle CSS </xsl:comment>
<style type="text/css" media="screen">
div.button.expandCollapse {
float: left;
margin-right: 10px;
cursor: pointer;
}
</style>
<xsl:comment> Revision Toggle CSS </xsl:comment>
<style type="text/css" media="print">
button,
div.button,
#buttontable {
display: none;
}
div.section-content {
display: block !important;
}
.print_visible {
display: block;
float: none;
margin-right: 0;
}
</style>
<xsl:comment> Table of Contents CSS </xsl:comment>
<style type="text/css" media="screen">
<xsl:text disable-output-escaping="yes">
#nav, #nav ul {
padding: 0;
margin: 0;
list-style: none;
}
#nav li {
float: left;
width: 300px;
}
#nav ul {
position: absolute;
width: 300px;
left: -1000px;
}
#nav li ul li ul {
display: none;
}
#nav li ul li:hover > ul {
display: block;
position: absolute;
left: 50px !important;
}
#nav li ul li:hover > ul > li > a {
border: 1px solid #585858;
}
#nav li:hover ul, #nav li.ie_does_hover ul {
left: auto;
background-position: 0 0;
}
#nav * a {
display: block;
padding: 2px 8px;
text-decoration: none;
font-weight: bold;
font-size: 11px;
}
</xsl:text>
#nav ul * a {
font-weight: bold;
color: #585858;
background-color: <xsl:value-of select="$bgcolor-td"/>;
cursor: pointer;
}
#nav ul ul a:link, #nav ul ul a:visited {
font-weight: normal;
color: #585858;
background-color: <xsl:value-of select="$bgcolor-td"/>;
cursor: pointer;
}
#nav * li a:hover, #nav * li a:active,
#nav * li * li a:hover, #nav * li * li a:active {
/*font-weight: normal;*/
color: white;
background-color: #585858;
cursor: pointer;
}
#nav * li {
border-left: 2px solid white;
}
#nav * ul li {
border-top: 2px solid white;
border-left: 0;
}
/* IE only hack */
* html ul li, * html ul ul li{
border-bottom: 2px solid white;
}
* html ul ul li{
border-top: 0;
}
/* End IE only hack */
</style>
<xsl:if test="string-length($externalCss)>0">
<xsl:comment> External CSS </xsl:comment>
<link type="text/css" rel="stylesheet" href="{$externalCss}"/>
</xsl:if>
<xsl:if test="string($useJavascript)='true'">
<xsl:comment> Javascript for Revisions switch </xsl:comment>
<script type="text/javascript">
<xsl:text>var gStringCollapse = "</xsl:text>
<xsl:call-template name="getLocalizedString">
<xsl:with-param name="key" select="'Collapse'"/>
</xsl:call-template>
<xsl:text>"; </xsl:text>
<xsl:text>var gStringExpand = "</xsl:text>
<xsl:call-template name="getLocalizedString">
<xsl:with-param name="key" select="'Expand'"/>
</xsl:call-template>
<xsl:text>";</xsl:text>
<xsl:text>
function expandAllSections() {
var toggleButtons = document.getElementsByClassName("expandCollapse");
if (toggleButtons != null) {
var i = 0;
while (i != toggleButtons.length) {
expandSection(toggleButtons[i]);
i++;
}
}
toggle('sectionsToggleExpand');
toggle('sectionsToggleCollapse');
}
function expandSection(sectionTitleButton) {
sectionTitleButton.title = gStringCollapse;
sectionTitleButton.innerText = '▼';
sectionTitleButton.onclick = function (){collapseSection(this);};
var sectionContent = sectionTitleButton.parentElement.parentElement.children[1]
if (sectionContent != null) {
sectionContent.style.display = '';
}
}
function collapseAllSections() {
var toggleButtons = document.getElementsByClassName("expandCollapse");
if (toggleButtons != null) {
var i = 0;
while (i != toggleButtons.length) {
collapseSection(toggleButtons[i]);
i++;
}
}
toggle('sectionsToggleExpand');
toggle('sectionsToggleCollapse');
}
function collapseSection(sectionTitleButton) {
sectionTitleButton.title = gStringExpand;
sectionTitleButton.innerText = '▶';
sectionTitleButton.onclick = function (){expandSection(this);};
var sectionContent = sectionTitleButton.parentElement.parentElement.children[1]
if (sectionContent != null) {
sectionContent.style.display = 'none';
}
}
function showReviewMarks() {
var allHTMLTags=document.getElementsByTagName("*");
for (i in allHTMLTags) {
//Get all tags with the specified class name.
if (allHTMLTags[i].className=='revision_insert_final') {
allHTMLTags[i].className = 'revision_insert';
}
if (allHTMLTags[i].className=='revision_delete_final') {
allHTMLTags[i].className = 'revision_delete';
}
}
toggle('revisionToggleOn');
toggle('revisionToggleOff');
}
function hideReviewMarks() {
var allHTMLTags=document.getElementsByTagName("*");
for (i in allHTMLTags) {
//Get all tags with the specified class name.
if (allHTMLTags[i].className=='revision_insert') {
allHTMLTags[i].className = 'revision_insert_final';
}
if (allHTMLTags[i].className=='revision_delete') {
allHTMLTags[i].className = 'revision_delete_final';
}
}
toggle('revisionToggleOn');
toggle('revisionToggleOff');
}
function toggle(obj) {
var el = document.getElementById(obj);
el.style.display = (el.style.display != 'none' ? 'none' : '' );
}
</xsl:text>
</script>
<xsl:comment> Javascript for Table of Contents menu </xsl:comment>
<script type="text/javascript">
sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("li");
for (i in sfEls) {
sfEls[i].onmouseover=function() {
this.className+=" ie_does_hover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" ie_does_hover"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
</script>
</xsl:if>
</head>
<body>
<div id="documentheader">
<a id="_toc"> </a>
<xsl:if test="$dohtmlheader = 'true'">
<h1 class="title">
<xsl:call-template name="show-title"/>
</h1>
<xsl:call-template name="show-header"/>
</xsl:if>
<!-- START TOC and Revision toggle -->
<xsl:if test="string($useJavascript)='true'">
<xsl:if test="//hl7:content[@revised] or count(hl7:component/hl7:structuredBody/hl7:component[hl7:section]) > 1">
<div id="buttontable">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<xsl:call-template name="make-tableofcontents"/>
<xsl:call-template name="make-revisiontoggle"/>
<xsl:call-template name="make-sectiontoggle"/>
</tr>
</tbody>
</table>
</div>
</xsl:if>
</xsl:if>
<!-- END TOC and Revision toggle -->
</div>
<div id="documentbody">
<xsl:apply-templates select="hl7:component/hl7:structuredBody | hl7:component/hl7:nonXMLBody"/>
</div>
<xsl:if test="$dohtmlfooter = 'true'">
<div id="documentfooter">
<xsl:call-template name="documentGeneral"/>
<xsl:call-template name="relatedDocument"/>
<xsl:call-template name="custodian"/>
<div class="separator"> </div>
<xsl:call-template name="recordTarget"/>
<xsl:call-template name="authorization"/>
<div class="separator"> </div>
<xsl:call-template name="documentationOf"/>
<xsl:call-template name="inFulfillmentOf"/>
<xsl:call-template name="componentOf"/>
<div class="separator"> </div>
<xsl:call-template name="author"/>
<xsl:call-template name="participant"/>
<!--xsl:call-template name="participant1"/-->
<!--xsl:call-template name="participant2"/-->
<xsl:call-template name="dataEnterer"/>
<xsl:call-template name="informant"/>
<xsl:call-template name="informationRecipient"/>
<xsl:call-template name="authenticator"/>
<xsl:call-template name="legalAuthenticator"/>
</div>
</xsl:if>
</body>
</html>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Handle structuredBody</xd:p>
</xd:desc>
</xd:doc>
<xsl:template match="hl7:component/hl7:structuredBody">
<xsl:for-each select="hl7:component/hl7:section">
<xsl:call-template name="section">
<xsl:with-param name="level" select="3"/>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>Handle nonXMLBody</xd:p>
</xd:desc>
<xd:param name="usemap"/>
</xd:doc>
<xsl:template match="hl7:component/hl7:nonXMLBody | hl7:observationMedia">
<xsl:param name="usemap"/>
<xsl:variable name="renderID">
<xsl:choose>
<xsl:when test="@ID">
<xsl:value-of select="@ID"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(generate-id(.), '_', local-name(.))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="renderAltText">
<xsl:variable name="i18nid">
<xsl:call-template name="getLocalizedString">
<xsl:with-param name="key" select="'id'"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="hl7:id">
<xsl:value-of select="concat($i18nid, ' = ',hl7:id[1]/@root, ' ', hl7:id[1]/@extension)"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="renderElement" select="self::hl7:nonXMLBody/hl7:text | self::hl7:observationMedia/hl7:value"/>
<xsl:choose>
<!-- Minimal mitigation for security risk based on malicious input -->
<xsl:when test="$renderElement/hl7:reference[starts-with(translate(normalize-space(@value),'JAVASCRIPT','javascript'),'javascript')]">
<pre title="{$renderAltText}">
<xsl:call-template name="getLocalizedString">
<xsl:with-param name="key" select="'securityRiskURLLabel'"/>
</xsl:call-template>
<b><i><xsl:value-of select="$renderElement/hl7:reference/@value"/></i></b>
</pre>
</xsl:when>
<!-- if there is a reference, use that in an iframe -->
<xsl:when test="$renderElement/hl7:reference">
<xsl:variable name="source" select="string($renderElement/hl7:reference/@value)"/>
<xsl:variable name="lcSource" select="translate($source, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/>
<xsl:variable name="scrubbedSource" select="translate($source, $simple-sanitizer-match, $simple-sanitizer-replace)"/>
<xsl:message><xsl:value-of select="$source"/>, <xsl:value-of select="$lcSource"/></xsl:message>
<xsl:choose>
<xsl:when test="contains($lcSource,'javascript')">
<p>
<xsl:call-template name="getLocalizedString">
<xsl:with-param name="key" select="'javascript-injection-warning'"/>
</xsl:call-template>
</p>
<xsl:message>
<xsl:call-template name="getLocalizedString">
<xsl:with-param name="key" select="'javascript-injection-warning'"/>
</xsl:call-template>
</xsl:message>
</xsl:when>
<xsl:when test="not($source = $scrubbedSource)">
<p>
<xsl:call-template name="getLocalizedString">
<xsl:with-param name="key" select="'malicious-content-warning'"/>
</xsl:call-template>
</p>
<xsl:message>
<xsl:call-template name="getLocalizedString">
<xsl:with-param name="key" select="'malicious-content-warning'"/>
</xsl:call-template>
</xsl:message>
</xsl:when>
<xsl:when test="$renderElement[starts-with(@mediaType, 'image/')]">
<img alt="{$renderAltText}" title="{$renderAltText}" src="{$scrubbedSource}">
<xsl:if test="string-length($usemap) > 0">
<xsl:attribute name="usemap">
<xsl:value-of select="$usemap"/>
</xsl:attribute>
</xsl:if>
</img>
</xsl:when>
<xsl:otherwise>