21. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 5/1/2018 12:02:01 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

21.1 Files compared

# Location File Last Modified
1 C:\AraxisMergeCompare\Pri_un\ZIP\JLV_2.6.2.0.3_src\JLV\web-app\WEB-INF\xslt\c32styles\nhin cdaHFG_dod.xsl Thu Mar 29 22:08:31 2018 UTC
2 C:\AraxisMergeCompare\Pri_re\ZIP\JLV_2.6.2.0.3_src\JLV\web-app\WEB-INF\xslt\c32styles\nhin cdaHFG_dod.xsl Tue May 1 15:02:11 2018 UTC

21.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 27896
Changed 1 2
Inserted 0 0
Removed 0 0

21.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

21.4 Active regular expressions

No regular expressions were active.

21.5 Comparison detail

  1   <?xml 
  2     version="1 .0" 
  3     encoding=" UTF-8"
  4   ?>
  5   <xsl:style sheet 
  6     xmlns:xsl= "http://ww w.w3.org/1 999/XSL/Tr ansform"
  7                    
  8     xmlns:n1=" urn:hl7-or g:v3" 
  9     xmlns:sdtc ="urn:hl7- org:sdtc" 
  10     version="1 .0"
  11   >
  12    
  13         
  14     <xsl:outpu
  15      method="ht ml" 
  16      indent="ye s" 
  17      version="4 .01"
  18                      
  19      encoding=" ISO-8859-1
  20      doctype-sy stem="http ://www.w3. org/TR/htm l4/strict. dtd"
  21                      
  22      doctype-pu blic="-//W 3C//DTD HT ML 4.01//E N" 
  23     />
  24    
  25         
  26     <!-- globa l variable  title -->
  27         
  28     <xsl:varia ble 
  29      name="titl e"
  30     >
  31              
  32      <xsl:choos e>
  33                    
  34       <xsl:when 
  35        test="stri ng-length( /n1:Clinic alDocument /n1:title)   &gt;= 1"
  36       >
  37                         
  38        <xsl:value -of 
  39         select="/n 1:Clinical Document/n 1:title" 
  40        />
  41                     
  42       </xsl:when >
  43                    
  44       <xsl:when 
  45        test="/n1: ClinicalDo cument/n1: code/@disp layName"
  46       >
  47                         
  48        <xsl:value -of 
  49         select="/n 1:Clinical Document/n 1:code/@di splayName"  
  50        />
  51                     
  52       </xsl:when >
  53                    
  54       <xsl:other wise>
  55                         
  56        <xsl:text>
  57         Clinical D ocument
  58        </xsl:text >
  59                     
  60       </xsl:othe rwise>
  61               
  62      </xsl:choo se>
  63          
  64     </xsl:vari able>
  65    
  66         
  67     <!-- Test  to see if  this is a  VA documen t -->
  68         
  69     <xsl:varia ble 
  70      name="isVA "
  71                        
  72      select="bo olean(/n1: ClinicalDo cument/n1: author/n1: assignedAu thor/n1:re presentedO rganizatio n/n1:id[@r oot='2.16. 840.1.1138 83.4.349'] )" 
  73     />
  74    
  75    
  76         
  77     <xsl:varia ble 
  78      name="ccdT emplateIdA rray"
  79     >
  80              
  81      <templateI d>
  82       2.16.840.1 .113883.10 .20.22.2.6
  83      </template Id>
  84              
  85      <templateI d>
  86       2.16.840.1 .113883.10 .20.22.2.5
  87      </template Id>
  88              
  89      <templateI d>
  90       2.16.840.1 .113883.10 .20.22.2.1
  91      </template Id>
  92              
  93      <templateI d>
  94       2.16.840.1 .113883.10 .20.22.2.4
  95      </template Id>
  96              
  97      <templateI d>
  98       2.16.840.1 .113883.10 .20.22.2.3
  99      </template Id>
  100              
  101      <templateI d>
  102       2.16.840.1 .113883.10 .20.22.2.2
  103      </template Id>
  104              
  105      <templateI d>
  106       2.16.840.1 .113883.10 .20.22.2.2 2
  107      </template Id>
  108              
  109      <templateI d>
  110       2.16.840.1 .113883.10 .20.22.2.7
  111      </template Id>
  112              
  113      <templateI d>
  114       2.16.840.1 .113883.10 .20.22.2.1 0
  115      </template Id>
  116              
  117      <templateI d>
  118       2.16.840.1 .113883.10 .20.22.2.1 4
  119      </template Id>
  120              
  121      <templateI d>
  122       2.16.840.1 .113883.10 .20.22.2.1 5
  123      </template Id>
  124              
  125      <templateI d>
  126       2.16.840.1 .113883.10 .20.22.2.1 7
  127      </template Id>
  128              
  129      <templateI d>
  130       2.16.840.1 .113883.10 .20.22.2.1 8
  131      </template Id>
  132              
  133      <templateI d>
  134       2.16.840.1 .113883.10 .20.22.2.2 1
  135      </template Id>
  136          
  137     </xsl:vari able>
  138    
  139         
  140     <xsl:param  
  141      name="ccdT emplateIdA rrayParam"
  142                     
  143      select="do cument('') /*/xsl:var iable[@nam e='ccdTemp lateIdArra y']/*" 
  144     />
  145    
  146         
  147     <xsl:varia ble 
  148      name="ccdA dditionalT emplateIdA rray"
  149     >
  150     
  151              
  152      <templateI d>
  153       2.16.840.1 .113883.10 .20.22.2.2 5
  154      </template Id>
  155              
  156      <templateI d>
  157       2.16.840.1 .113883.10 .20.22.2.9
  158      </template Id>
  159              
  160      <templateI d>
  161       2.16.840.1 .113883.10 .20.22.2.8
  162      </template Id>
  163              
  164      <templateI d>
  165       2.16.840.1 .113883.10 .20.22.2.1 3
  166      </template Id>
  167              
  168      <templateI d>
  169       2.16.840.1 .113883.10 .20.22.2.3 7
  170      </template Id>
  171              
  172      <templateI d>
  173       2.16.840.1 .113883.10 .20.6.1.1
  174      </template Id>
  175              
  176      <templateI d>
  177       1.3.6.1.4. 1.19376.1. 5.3.1.3.33
  178      </template Id>
  179              
  180      <templateI d>
  181       2.16.840.1 .113883.10 .20.6.1.2
  182      </template Id>
  183              
  184      <templateI d>
  185       2.16.840.1 .113883.10 .20.2.5
  186      </template Id>
  187              
  188      <templateI d>
  189       2.16.840.1 .113883.10 .20.22.2.2 0
  190      </template Id>
  191              
  192      <templateI d>
  193       1.3.6.1.4. 1.19376.1. 5.3.1.3.4
  194      </template Id>
  195              
  196      <templateI d>
  197       2.16.840.1 .113883.10 .20.22.2.4 3
  198      </template Id>
  199              
  200      <templateI d>
  201       2.16.840.1 .113883.10 .20.22.2.4 4
  202      </template Id>
  203              
  204      <templateI d>
  205       2.16.840.1 .113883.10 .20.22.2.4 2
  206      </template Id>
  207              
  208      <templateI d>
  209       1.3.6.1.4. 1.19376.1. 5.3.1.3.5
  210      </template Id>
  211              
  212      <templateI d>
  213       2.16.840.1 .113883.10 .20.22.2.2 4
  214      </template Id>
  215              
  216      <templateI d>
  217       2.16.840.1 .113883.10 .20.22.2.4 1
  218      </template Id>
  219              
  220      <templateI d>
  221       2.16.840.1 .113883.10 .20.22.2.1 1.1
  222      </template Id>
  223              
  224      <templateI d>
  225       1.3.6.1.4. 1.19376.1. 5.3.1.3.26
  226      </template Id>
  227              
  228      <templateI d>
  229       2.16.840.1 .113883.10 .20.22.2.1 6
  230      </template Id>
  231              
  232      <templateI d>
  233       2.16.840.1 .113883.10 .20.22.2.4 5
  234      </template Id>
  235              
  236      <templateI d>
  237       2.16.840.1 .113883.10 .20.21.2.3
  238      </template Id>
  239              
  240      <templateI d>
  241       2.16.840.1 .113883.10 .20.22.2.2 3
  242      </template Id>
  243              
  244      <templateI d>
  245       2.16.840.1 .113883.10 .20.22.2.3 9
  246      </template Id>
  247              
  248      <templateI d>
  249       2.16.840.1 .113883.10 .20.22.2.3 8
  250      </template Id>
  251              
  252      <templateI d>
  253       2.16.840.1 .113883.10 .20.21.2.1
  254      </template Id>
  255              
  256      <templateI d>
  257       2.16.840.1 .113883.10 .20.7.12
  258      </template Id>
  259              
  260      <templateI d>
  261       2.16.840.1 .113883.10 .20.7.14
  262      </template Id>
  263              
  264      <templateI d>
  265       2.16.840.1 .113883. IP         
  266      </template Id>
  267              
  268      <templateI d>
  269       2.16.840.1 .113883.10 .20.22.2.3 0
  270      </template Id>
  271              
  272      <templateI d>
  273       2.16.840.1 .113883.10 .20.22.2.3 5
  274      </template Id>
  275              
  276      <templateI d>
  277       2.16.840.1 .113883.10 .20.22.2.3 6
  278      </template Id>
  279              
  280      <templateI d>
  281       2.16.840.1 .113883.10 .20.22.2.3 4
  282      </template Id>
  283              
  284      <templateI d>
  285       2.16.840.1 .113883.10 .20.18.2.1 2
  286      </template Id>
  287              
  288      <templateI d>
  289       2.16.840.1 .113883.10 .20.18.2.9
  290      </template Id>
  291              
  292      <templateI d>
  293       2.16.840.1 .113883.10 .20.22.2.2 8
  294      </template Id>
  295              
  296      <templateI d>
  297       2.16.840.1 .113883.10 .20.22.2.4 0
  298      </template Id>
  299              
  300      <templateI d>
  301       2.16.840.1 .113883.10 .20.22.2.2 9
  302      </template Id>
  303              
  304      <templateI d>
  305       2.16.840.1 .113883.10 .20.22.2.3 1
  306      </template Id>
  307              
  308      <templateI d>
  309       1.3.6.1.4. 1.19376.1. 5.3.1.3.1
  310      </template Id>
  311              
  312      <templateI d>
  313       2.16.840.1 .113883.10 .20.22.2.1 2
  314      </template Id>
  315              
  316      <templateI d>
  317       1.3.6.1.4. 1.19376.1. 5.3.1.3.18
  318      </template Id>
  319              
  320      <templateI d>
  321       2.16.840.1 .113883.10 .20.7.13
  322      </template Id>
  323     
  324          
  325     </xsl:vari able>
  326    
  327         
  328     <xsl:param  
  329      name="ccdA dditionalT emplateIdA rrayParam"
  330                     
  331      select="do cument('') /*/xsl:var iable[@nam e='ccdAddi tionalTemp lateIdArra y']/*" 
  332     />
  333    
  334         
  335     <xsl:varia ble 
  336      name="prog ressAdditi onalTempla teIdArray"
  337     >
  338     
  339              
  340      <templateI d>
  341       2.16.840.1 .113883.10 .20.22.2.2 5
  342      </template Id>
  343              
  344      <templateI d>
  345       2.16.840.1 .113883.10 .20.22.2.9
  346      </template Id>
  347              
  348      <templateI d>
  349       2.16.840.1 .113883.10 .20.22.2.1 3
  350      </template Id>
  351              
  352      <templateI d>
  353       2.16.840.1 .113883.10 .20.22.2.3 7
  354      </template Id>
  355              
  356      <templateI d>
  357       2.16.840.1 .113883.10 .20.6.1.1
  358      </template Id>
  359              
  360      <templateI d>
  361       1.3.6.1.4. 1.19376.1. 5.3.1.3.33
  362      </template Id>
  363              
  364      <templateI d>
  365       2.16.840.1 .113883.10 .20.22.2.1 5
  366      </template Id>
  367              
  368      <templateI d>
  369       2.16.840.1 .113883.10 .20.6.1.2
  370      </template Id>
  371              
  372      <templateI d>
  373       2.16.840.1 .113883.10 .20.2.5
  374      </template Id>
  375              
  376      <templateI d>
  377       2.16.840.1 .113883.10 .20.22.2.2 0
  378      </template Id>
  379              
  380      <templateI d>
  381       1.3.6.1.4. 1.19376.1. 5.3.1.3.4
  382      </template Id>
  383              
  384      <templateI d>
  385       2.16.840.1 .113883.10 .20.22.2.4 3
  386      </template Id>
  387              
  388      <templateI d>
  389       2.16.840.1 .113883.10 .20.22.2.4 4
  390      </template Id>
  391              
  392      <templateI d>
  393       2.16.840.1 .113883.10 .20.22.2.4 2
  394      </template Id>
  395              
  396      <templateI d>
  397       1.3.6.1.4. 1.19376.1. 5.3.1.3.5
  398      </template Id>
  399              
  400      <templateI d>
  401       2.16.840.1 .113883.10 .20.22.2.2 4
  402      </template Id>
  403              
  404      <templateI d>
  405       2.16.840.1 .113883.10 .20.22.2.4 1
  406      </template Id>
  407              
  408      <templateI d>
  409       2.16.840.1 .113883.10 .20.22.2.1 1.1
  410      </template Id>
  411              
  412      <templateI d>
  413       1.3.6.1.4. 1.19376.1. 5.3.1.3.26
  414      </template Id>
  415              
  416      <templateI d>
  417       2.16.840.1 .113883.10 .20.22.2.1 6
  418      </template Id>
  419              
  420      <templateI d>
  421       2.16.840.1 .113883.10 .20.22.2.2 .1
  422      </template Id>
  423              
  424      <templateI d>
  425       2.16.840.1 .113883.10 .20.22.2.2 3
  426      </template Id>
  427              
  428      <templateI d>
  429       2.16.840.1 .113883.10 .20.22.2.3 9
  430      </template Id>
  431              
  432      <templateI d>
  433       2.16.840.1 .113883.10 .20.22.2.3 8
  434      </template Id>
  435              
  436      <templateI d>
  437       2.16.840.1 .113883.10 .20.7.12
  438      </template Id>
  439              
  440      <templateI d>
  441       2.16.840.1 .113883.10 .20.7.14
  442      </template Id>
  443              
  444      <templateI d>
  445       2.16.840.1 .113883.10 .20.22.2.1 8
  446      </template Id>
  447              
  448      <templateI d>
  449       2.16.840.1 .113883.10 .20.22.2.3 0
  450      </template Id>
  451              
  452      <templateI d>
  453       2.16.840.1 .113883.10 .20.22.2.3 5
  454      </template Id>
  455              
  456      <templateI d>
  457       2.16.840.1 .113883.10 .20.22.2.3 6
  458      </template Id>
  459              
  460      <templateI d>
  461       2.16.840.1 .113883.10 .20.22.2.3 4
  462      </template Id>
  463              
  464      <templateI d>
  465       2.16.840.1 .113883.10 .20.18.2.1 2
  466      </template Id>
  467              
  468      <templateI d>
  469       2.16.840.1 .113883.10 .20.18.2.9
  470      </template Id>
  471              
  472      <templateI d>
  473       2.16.840.1 .113883.10 .20.22.2.2 8
  474      </template Id>
  475              
  476      <templateI d>
  477       2.16.840.1 .113883.10 .20.22.2.4 0
  478      </template Id>
  479              
  480      <templateI d>
  481       2.16.840.1 .113883.10 .20.22.2.2 9
  482      </template Id>
  483              
  484      <templateI d>
  485       2.16.840.1 .113883.10 .20.22.2.3 1
  486      </template Id>
  487              
  488      <templateI d>
  489       1.3.6.1.4. 1.19376.1. 5.3.1.3.1
  490      </template Id>
  491              
  492      <templateI d>
  493       2.16.840.1 .113883.10 .20.22.2.1 2
  494      </template Id>
  495              
  496      <templateI d>
  497       2.16.840.1 .113883.10 .20.22.2.1 7
  498      </template Id>
  499              
  500      <templateI d>
  501       2.16.840.1 .113883.10 .20.22.2.2
  502      </template Id>
  503              
  504      <templateI d>
  505       2.16.840.1 .113883.10 .20.7.13
  506      </template Id>
  507              
  508      <templateI d>
  509       2.16.840.1 .113883.10 .20.22.2.2 1
  510      </template Id>
  511              
  512      <templateI d>
  513       2.16.840.1 .113883.10 .20.22.2.2 2
  514      </template Id>
  515     
  516          
  517     </xsl:vari able>
  518    
  519         
  520     <xsl:param  
  521      name="prog ressAdditi onalTempla teIdArrayP aram"
  522                     
  523      select="do cument('') /*/xsl:var iable[@nam e='progres sAdditiona lTemplateI dArray']/*
  524     />
  525    
  526         
  527     <xsl:varia ble 
  528      name="prog ressTempla teIdArray"
  529     >
  530              
  531      <templateI d>
  532       2.16.840.1 .113883.10 .20.22.2.8
  533      </template Id>
  534              
  535      <templateI d>
  536       2.16.840.1 .113883.10 .20.22.2.1 0
  537      </template Id>
  538              
  539      <templateI d>
  540       2.16.840.1 .113883.10 .20.22.2.6
  541      </template Id>
  542              
  543      <templateI d>
  544       1.3.6.1.4. 1.19376.1. 5.3.1.1.13 .2.1
  545      </template Id>
  546              
  547      <templateI d>
  548       2.16.840.1 .113883.10 .20.22.2.4 5
  549      </template Id>
  550              
  551      <templateI d>
  552       2.16.840.1 .113883.10 .20.21.2.3
  553      </template Id>
  554              
  555      <templateI d>
  556       2.16.840.1 .113883.10 .20.22.2.1
  557      </template Id>
  558              
  559      <templateI d>
  560       2.16.840.1 .113883.10 .20.21.2.1
  561      </template Id>
  562              
  563      <templateI d>
  564       2.16.840.1 .113883.10 .20.2.10
  565      </template Id>
  566              
  567      <templateI d>
  568       2.16.840.1 .113883.10 .20.22.2.5
  569      </template Id>
  570              
  571      <templateI d>
  572       2.16.840.1 .113883.10 .20.22.2.3
  573      </template Id>
  574              
  575      <templateI d>
  576       1.3.6.1.4. 1.19376.1. 5.3.1.3.18
  577      </template Id>
  578              
  579      <templateI d>
  580       2.16.840.1 .113883.10 .20.21.2.2
  581      </template Id>
  582              
  583      <templateI d>
  584       2.16.840.1 .113883.10 .20.22.2.4
  585      </template Id>
  586          
  587     </xsl:vari able>
  588    
  589         
  590     <xsl:param  
  591      name="prog ressTempla teIdArrayP aram"
  592                     
  593      select="do cument('') /*/xsl:var iable[@nam e='progres sTemplateI dArray']/*
  594     />
  595    
  596         
  597     <xsl:varia ble 
  598      name="ccdS ectionHead er"
  599     >
  600              
  601      <headerNam e>
  602       Allergies
  603      </headerNa me>
  604              
  605      <headerNam e>
  606       Problems
  607      </headerNa me>
  608              
  609      <headerNam e>
  610       Medication s
  611      </headerNa me>
  612              
  613      <headerNam e>
  614       Vital Sign s
  615      </headerNa me>
  616              
  617      <headerNam e>
  618       Results
  619      </headerNa me>
  620              
  621      <headerNam e>
  622       Immunizati ons
  623      </headerNa me>
  624              
  625      <headerNam e>
  626       Encounters
  627      </headerNa me>
  628              
  629      <headerNam e>
  630       Procedures
  631      </headerNa me>
  632              
  633      <headerNam e>
  634       Plan of Ca re
  635      </headerNa me>
  636              
  637      <headerNam e>
  638       Functional  Status
  639      </headerNa me>
  640              
  641      <headerNam e>
  642       Family His tory
  643      </headerNa me>
  644              
  645      <headerNam e>
  646       Social His tory
  647      </headerNa me>
  648              
  649      <headerNam e>
  650       Insurance  Providers
  651      </headerNa me>
  652              
  653      <headerNam e>
  654       Advance Di rective
  655      </headerNa me>
  656          
  657     </xsl:vari able>
  658    
  659         
  660     <xsl:param  
  661      name="ccdS ectionHead erParam"
  662                     
  663      select="do cument('') /*/xsl:var iable[@nam e='ccdSect ionHeader' ]/*" 
  664     />
  665    
  666         
  667     <xsl:varia ble 
  668      name="ccdA dditionalS ectionHead er"
  669     >
  670              
  671      <headerNam e>
  672       Anesthesia
  673      </headerNa me>
  674              
  675      <headerNam e>
  676       Assessment  And Plan
  677      </headerNa me>
  678              
  679      <headerNam e>
  680       Assessment
  681      </headerNa me>
  682              
  683      <headerNam e>
  684       REASON FOR  VISIT/CHI EF COMPLAI NT
  685      </headerNa me>
  686              
  687      <headerNam e>
  688       Complicati ons
  689      </headerNa me>
  690              
  691      <headerNam e>
  692       DICOM Obje ct Catalog
  693      </headerNa me>
  694              
  695      <headerNam e>
  696       Discharge  Diet
  697      </headerNa me>
  698              
  699      <headerNam e>
  700       Findings
  701      </headerNa me>
  702              
  703      <headerNam e>
  704       General St atus
  705      </headerNa me>
  706              
  707      <headerNam e>
  708       Past Medic al History
  709      </headerNa me>
  710              
  711      <headerNam e>
  712       History Of  Present I llness
  713      </headerNa me>
  714              
  715      <headerNam e>
  716       Hospital A dmission D iagnosis
  717      </headerNa me>
  718              
  719      <headerNam e>
  720       Hospital A dmission M edications  Entries
  721      </headerNa me>
  722              
  723      <headerNam e>
  724       Hospital C onsultatio ns
  725      </headerNa me>
  726              
  727      <headerNam e>
  728       Hospital C ourse
  729      </headerNa me>
  730              
  731      <headerNam e>
  732       Hospital D ischarge D iagnosis
  733      </headerNa me>
  734              
  735      <headerNam e>
  736       Hospital D ischarge I nstruction s
  737      </headerNa me>
  738              
  739      <headerNam e>
  740       Hospital D ischarge M edications
  741      </headerNa me>
  742              
  743      <headerNam e>
  744       Hospital D ischarge P hysical
  745      </headerNa me>
  746              
  747      <headerNam e>
  748       Hospital D ischarge S tudies Sum mary
  749      </headerNa me>
  750              
  751      <headerNam e>
  752       Instructio ns
  753      </headerNa me>
  754              
  755      <headerNam e>
  756       Interventi ons
  757      </headerNa me>
  758              
  759      <headerNam e>
  760       Medical Eq uipment
  761      </headerNa me>
  762              
  763      <headerNam e>
  764       Medical Hi story
  765      </headerNa me>
  766              
  767      <headerNam e>
  768       Medication s Administ ered
  769      </headerNa me>
  770              
  771      <headerNam e>
  772       Objective
  773      </headerNa me>
  774              
  775      <headerNam e>
  776       Operative  Note Fluid
  777      </headerNa me>
  778              
  779      <headerNam e>
  780       Operative  Note Surgi cal Proced ure
  781      </headerNa me>
  782              
  783      <headerNam e>
  784       PhysicalEx am
  785      </headerNa me>
  786              
  787      <headerNam e>
  788       Planned Pr ocedure
  789      </headerNa me>
  790              
  791      <headerNam e>
  792       Postoperat ive Diagno sis
  793      </headerNa me>
  794              
  795      <headerNam e>
  796       Postproced ure Diagno sis
  797      </headerNa me>
  798              
  799      <headerNam e>
  800       Preoperati ve Diagnos is
  801      </headerNa me>
  802              
  803      <headerNam e>
  804       Procedure  Dispositio n
  805      </headerNa me>
  806              
  807      <headerNam e>
  808       Procedure  Estimated  Blood Loss
  809      </headerNa me>
  810              
  811      <headerNam e>
  812       Procedure  Findings
  813      </headerNa me>
  814              
  815      <headerNam e>
  816       Procedure  Implants
  817      </headerNa me>
  818              
  819      <headerNam e>
  820       Procedure  Indication s
  821      </headerNa me>
  822              
  823      <headerNam e>
  824       Procedure  Specimens  Taken
  825      </headerNa me>
  826              
  827      <headerNam e>
  828       Reason For  Referral
  829      </headerNa me>
  830              
  831      <headerNam e>
  832       Reason For  Visit
  833      </headerNa me>
  834              
  835      <headerNam e>
  836       Review Of  Systems
  837      </headerNa me>
  838              
  839      <headerNam e>
  840       Surgical D rains
  841      </headerNa me>
  842          
  843     </xsl:vari able>
  844    
  845         
  846     <xsl:param  
  847      name="ccdA dditionalS ectionHead erParam"
  848                     
  849      select="do cument('') /*/xsl:var iable[@nam e='ccdAddi tionalSect ionHeader' ]/*" 
  850     />
  851    
  852         
  853     <xsl:varia ble 
  854      name="prog ressAdditi onalSectio nHeader"
  855     >
  856              
  857      <headerNam e>
  858       Anesthesia
  859      </headerNa me>
  860              
  861      <headerNam e>
  862       Assessment  And Plan
  863      </headerNa me>
  864              
  865      <headerNam e>
  866       REASON FOR  VISIT/CHI EF COMPLAI NT
  867      </headerNa me>
  868              
  869      <headerNam e>
  870       Complicati ons
  871      </headerNa me>
  872              
  873      <headerNam e>
  874       DICOM Obje ct Catalog
  875      </headerNa me>
  876              
  877      <headerNam e>
  878       Discharge  Diet
  879      </headerNa me>
  880              
  881      <headerNam e>
  882       Family His tory
  883      </headerNa me>
  884              
  885      <headerNam e>
  886       Findings
  887      </headerNa me>
  888              
  889      <headerNam e>
  890       General St atus
  891      </headerNa me>
  892              
  893      <headerNam e>
  894       Past Medic al History
  895      </headerNa me>
  896              
  897      <headerNam e>
  898       History Of  Present I llness
  899      </headerNa me>
  900              
  901      <headerNam e>
  902       Hospital A dmission D iagnosis
  903      </headerNa me>
  904              
  905      <headerNam e>
  906       Hospital A dmission M edications  Entries
  907      </headerNa me>
  908              
  909      <headerNam e>
  910       Hospital C onsultatio ns
  911      </headerNa me>
  912              
  913      <headerNam e>
  914       Hospital C ourse
  915      </headerNa me>
  916              
  917      <headerNam e>
  918       Hospital D ischarge D iagnosis
  919      </headerNa me>
  920              
  921      <headerNam e>
  922       Hospital D ischarge I nstruction s
  923      </headerNa me>
  924              
  925      <headerNam e>
  926       Hospital D ischarge M edications
  927      </headerNa me>
  928              
  929      <headerNam e>
  930       Hospital D ischarge P hysical
  931      </headerNa me>
  932              
  933      <headerNam e>
  934       Hospital D ischarge S tudies Sum mary
  935      </headerNa me>
  936              
  937      <headerNam e>
  938       Immunizati ons
  939      </headerNa me>
  940              
  941      <headerNam e>
  942       Medical Eq uipment
  943      </headerNa me>
  944              
  945      <headerNam e>
  946       Medical Hi story
  947      </headerNa me>
  948              
  949      <headerNam e>
  950       Medication s Administ ered
  951      </headerNa me>
  952              
  953      <headerNam e>
  954       Operative  Note Fluid
  955      </headerNa me>
  956              
  957      <headerNam e>
  958       Operative  Note Surgi cal Proced ure
  959      </headerNa me>
  960              
  961      <headerNam e>
  962       Insurance  Providers
  963      </headerNa me>
  964              
  965      <headerNam e>
  966       Planned Pr ocedure
  967      </headerNa me>
  968              
  969      <headerNam e>
  970       Postoperat ive Diagno sis
  971      </headerNa me>
  972              
  973      <headerNam e>
  974       Postproced ure Diagno sis
  975      </headerNa me>
  976              
  977      <headerNam e>
  978       Preoperati ve Diagnos is
  979      </headerNa me>
  980              
  981      <headerNam e>
  982       Procedure  Dispositio n
  983      </headerNa me>
  984              
  985      <headerNam e>
  986       Procedure  Estimated  Blood Loss
  987      </headerNa me>
  988              
  989      <headerNam e>
  990       Procedure  Findings
  991      </headerNa me>
  992              
  993      <headerNam e>
  994       Procedure  Implants
  995      </headerNa me>
  996              
  997      <headerNam e>
  998       Procedure  Indication s
  999      </headerNa me>
  1000              
  1001      <headerNam e>
  1002       Procedure  Specimens  Taken
  1003      </headerNa me>
  1004              
  1005      <headerNam e>
  1006       Reason For  Referral
  1007      </headerNa me>
  1008              
  1009      <headerNam e>
  1010       Reason For  Visit
  1011      </headerNa me>
  1012              
  1013      <headerNam e>
  1014       Social His tory
  1015      </headerNa me>
  1016              
  1017      <headerNam e>
  1018       Immunizati ons Entrie s
  1019      </headerNa me>
  1020              
  1021      <headerNam e>
  1022       Surgical D rains
  1023      </headerNa me>
  1024              
  1025      <headerNam e>
  1026       Advance Di rective
  1027      </headerNa me>
  1028              
  1029      <headerNam e>
  1030       Encounters
  1031      </headerNa me>
  1032          
  1033     </xsl:vari able>
  1034    
  1035         
  1036     <xsl:param  
  1037      name="prog ressAdditi onalSectio nHeaderPar am"
  1038                     
  1039      select="do cument('') /*/xsl:var iable[@nam e='progres sAdditiona lSectionHe ader']/*" 
  1040     />
  1041    
  1042         
  1043     <xsl:varia ble 
  1044      name="ccdS ectionHead erHref"
  1045     >
  1046              
  1047      <titleId>
  1048                    
  1049       <xsl:value -of 
  1050        select="ge nerate-id( $ccdSectio nHeaderPar am/headerN ame[1])" 
  1051       />
  1052               
  1053      </titleId>
  1054              
  1055      <titleId>
  1056                    
  1057       <xsl:value -of 
  1058        select="ge nerate-id( $ccdSectio nHeaderPar am/headerN ame[2])" 
  1059       />
  1060               
  1061      </titleId>
  1062              
  1063      <titleId>
  1064                    
  1065       <xsl:value -of 
  1066        select="ge nerate-id( $ccdSectio nHeaderPar am/headerN ame[3])" 
  1067       />
  1068               
  1069      </titleId>
  1070              
  1071      <titleId>
  1072                    
  1073       <xsl:value -of 
  1074        select="ge nerate-id( $ccdSectio nHeaderPar am/headerN ame[4])" 
  1075       />
  1076               
  1077      </titleId>
  1078              
  1079      <titleId>
  1080                    
  1081       <xsl:value -of 
  1082        select="ge nerate-id( $ccdSectio nHeaderPar am/headerN ame[5])" 
  1083       />
  1084               
  1085      </titleId>
  1086              
  1087      <titleId>
  1088                    
  1089       <xsl:value -of 
  1090        select="ge nerate-id( $ccdSectio nHeaderPar am/headerN ame[6])" 
  1091       />
  1092               
  1093      </titleId>
  1094              
  1095      <titleId>
  1096                    
  1097       <xsl:value -of 
  1098        select="ge nerate-id( $ccdSectio nHeaderPar am/headerN ame[7])" 
  1099       />
  1100               
  1101      </titleId>
  1102              
  1103      <titleId>
  1104                    
  1105       <xsl:value -of 
  1106        select="ge nerate-id( $ccdSectio nHeaderPar am/headerN ame[8])" 
  1107       />
  1108               
  1109      </titleId>
  1110              
  1111      <titleId>
  1112                    
  1113       <xsl:value -of 
  1114        select="ge nerate-id( $ccdSectio nHeaderPar am/headerN ame[9])" 
  1115       />
  1116               
  1117      </titleId>
  1118              
  1119      <titleId>
  1120                    
  1121       <xsl:value -of 
  1122        select="ge nerate-id( $ccdSectio nHeaderPar am/headerN ame[10])" 
  1123       />
  1124               
  1125      </titleId>
  1126              
  1127      <titleId>
  1128                    
  1129       <xsl:value -of 
  1130        select="ge nerate-id( $ccdSectio nHeaderPar am/headerN ame[11])" 
  1131       />
  1132               
  1133      </titleId>
  1134              
  1135      <titleId>
  1136                    
  1137       <xsl:value -of 
  1138        select="ge nerate-id( $ccdSectio nHeaderPar am/headerN ame[12])" 
  1139       />
  1140               
  1141      </titleId>
  1142              
  1143      <titleId>
  1144                    
  1145       <xsl:value -of 
  1146        select="ge nerate-id( $ccdSectio nHeaderPar am/headerN ame[13])" 
  1147       />
  1148               
  1149      </titleId>
  1150              
  1151      <titleId>
  1152                    
  1153       <xsl:value -of 
  1154        select="ge nerate-id( $ccdSectio nHeaderPar am/headerN ame[14])" 
  1155       />
  1156               
  1157      </titleId>
  1158          
  1159     </xsl:vari able>
  1160    
  1161         
  1162     <xsl:param  
  1163      name="ccdS ectionHead erRefParam "
  1164                     
  1165      select="do cument('') /*/xsl:var iable[@nam e='ccdSect ionHeaderH ref']/*" 
  1166     />
  1167    
  1168         
  1169     <xsl:varia ble 
  1170      name="ccdA dditionalS ectionHead erHref"
  1171     >
  1172              
  1173      <titleId>
  1174                    
  1175       <xsl:value -of
  1176                            
  1177        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[1])" 
  1178       />
  1179               
  1180      </titleId>
  1181              
  1182      <titleId>
  1183                    
  1184       <xsl:value -of
  1185                            
  1186        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[2])" 
  1187       />
  1188               
  1189      </titleId>
  1190              
  1191      <titleId>
  1192                    
  1193       <xsl:value -of
  1194                            
  1195        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[3])" 
  1196       />
  1197               
  1198      </titleId>
  1199              
  1200      <titleId>
  1201                    
  1202       <xsl:value -of
  1203                            
  1204        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[4])" 
  1205       />
  1206               
  1207      </titleId>
  1208              
  1209      <titleId>
  1210                    
  1211       <xsl:value -of
  1212                            
  1213        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[5])" 
  1214       />
  1215               
  1216      </titleId>
  1217              
  1218      <titleId>
  1219                    
  1220       <xsl:value -of
  1221                            
  1222        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[6])" 
  1223       />
  1224               
  1225      </titleId>
  1226              
  1227      <titleId>
  1228                    
  1229       <xsl:value -of
  1230                            
  1231        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[7])" 
  1232       />
  1233               
  1234      </titleId>
  1235              
  1236      <titleId>
  1237                    
  1238       <xsl:value -of
  1239                            
  1240        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[8])" 
  1241       />
  1242               
  1243      </titleId>
  1244              
  1245      <titleId>
  1246                    
  1247       <xsl:value -of
  1248                            
  1249        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[9])" 
  1250       />
  1251               
  1252      </titleId>
  1253              
  1254      <titleId>
  1255                    
  1256       <xsl:value -of
  1257                            
  1258        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[10])" 
  1259       />
  1260               
  1261      </titleId>
  1262              
  1263      <titleId>
  1264                    
  1265       <xsl:value -of
  1266                            
  1267        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[11])" 
  1268       />
  1269               
  1270      </titleId>
  1271              
  1272      <titleId>
  1273                    
  1274       <xsl:value -of
  1275                            
  1276        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[12])" 
  1277       />
  1278               
  1279      </titleId>
  1280              
  1281      <titleId>
  1282                    
  1283       <xsl:value -of
  1284                            
  1285        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[13])" 
  1286       />
  1287               
  1288      </titleId>
  1289              
  1290      <titleId>
  1291                    
  1292       <xsl:value -of
  1293                            
  1294        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[14])" 
  1295       />
  1296               
  1297      </titleId>
  1298              
  1299      <titleId>
  1300                    
  1301       <xsl:value -of
  1302                            
  1303        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[15])" 
  1304       />
  1305               
  1306      </titleId>
  1307              
  1308      <titleId>
  1309                    
  1310       <xsl:value -of
  1311                            
  1312        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[16])" 
  1313       />
  1314               
  1315      </titleId>
  1316              
  1317      <titleId>
  1318                    
  1319       <xsl:value -of
  1320                            
  1321        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[17])" 
  1322       />
  1323               
  1324      </titleId>
  1325              
  1326      <titleId>
  1327                    
  1328       <xsl:value -of
  1329                            
  1330        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[18])" 
  1331       />
  1332               
  1333      </titleId>
  1334              
  1335      <titleId>
  1336                    
  1337       <xsl:value -of
  1338                            
  1339        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[19])" 
  1340       />
  1341               
  1342      </titleId>
  1343              
  1344      <titleId>
  1345                    
  1346       <xsl:value -of
  1347                            
  1348        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[20])" 
  1349       />
  1350               
  1351      </titleId>
  1352              
  1353      <titleId>
  1354                    
  1355       <xsl:value -of
  1356                            
  1357        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[21])" 
  1358       />
  1359               
  1360      </titleId>
  1361              
  1362      <titleId>
  1363                    
  1364       <xsl:value -of
  1365                            
  1366        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[22])" 
  1367       />
  1368               
  1369      </titleId>
  1370              
  1371      <titleId>
  1372                    
  1373       <xsl:value -of
  1374                            
  1375        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[23])" 
  1376       />
  1377               
  1378      </titleId>
  1379              
  1380      <titleId>
  1381                    
  1382       <xsl:value -of
  1383                            
  1384        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[24])" 
  1385       />
  1386               
  1387      </titleId>
  1388              
  1389      <titleId>
  1390                    
  1391       <xsl:value -of
  1392                            
  1393        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[25])" 
  1394       />
  1395               
  1396      </titleId>
  1397              
  1398      <titleId>
  1399                    
  1400       <xsl:value -of
  1401                            
  1402        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[26])" 
  1403       />
  1404               
  1405      </titleId>
  1406              
  1407      <titleId>
  1408                    
  1409       <xsl:value -of
  1410                            
  1411        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[27])" 
  1412       />
  1413               
  1414      </titleId>
  1415              
  1416      <titleId>
  1417                    
  1418       <xsl:value -of
  1419                            
  1420        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[28])" 
  1421       />
  1422               
  1423      </titleId>
  1424              
  1425      <titleId>
  1426                    
  1427       <xsl:value -of
  1428                            
  1429        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[29])" 
  1430       />
  1431               
  1432      </titleId>
  1433              
  1434      <titleId>
  1435                    
  1436       <xsl:value -of
  1437                            
  1438        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[30])" 
  1439       />
  1440               
  1441      </titleId>
  1442              
  1443      <titleId>
  1444                    
  1445       <xsl:value -of
  1446                            
  1447        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[31])" 
  1448       />
  1449               
  1450      </titleId>
  1451              
  1452      <titleId>
  1453                    
  1454       <xsl:value -of
  1455                            
  1456        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[32])" 
  1457       />
  1458               
  1459      </titleId>
  1460              
  1461      <titleId>
  1462                    
  1463       <xsl:value -of
  1464                            
  1465        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[33])" 
  1466       />
  1467               
  1468      </titleId>
  1469              
  1470      <titleId>
  1471                    
  1472       <xsl:value -of
  1473                            
  1474        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[34])" 
  1475       />
  1476               
  1477      </titleId>
  1478              
  1479      <titleId>
  1480                    
  1481       <xsl:value -of
  1482                            
  1483        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[35])" 
  1484       />
  1485               
  1486      </titleId>
  1487              
  1488      <titleId>
  1489                    
  1490       <xsl:value -of
  1491                            
  1492        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[36])" 
  1493       />
  1494               
  1495      </titleId>
  1496              
  1497      <titleId>
  1498                    
  1499       <xsl:value -of
  1500                            
  1501        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[37])" 
  1502       />
  1503               
  1504      </titleId>
  1505              
  1506      <titleId>
  1507                    
  1508       <xsl:value -of
  1509                            
  1510        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[38])" 
  1511       />
  1512               
  1513      </titleId>
  1514              
  1515      <titleId>
  1516                    
  1517       <xsl:value -of
  1518                            
  1519        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[39])" 
  1520       />
  1521               
  1522      </titleId>
  1523              
  1524      <titleId>
  1525                    
  1526       <xsl:value -of
  1527                            
  1528        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[40])" 
  1529       />
  1530               
  1531      </titleId>
  1532              
  1533      <titleId>
  1534                    
  1535       <xsl:value -of
  1536                            
  1537        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[41])" 
  1538       />
  1539               
  1540      </titleId>
  1541              
  1542      <titleId>
  1543                    
  1544       <xsl:value -of
  1545                            
  1546        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[42])" 
  1547       />
  1548               
  1549      </titleId>
  1550              
  1551      <titleId>
  1552                    
  1553       <xsl:value -of
  1554                            
  1555        select="ge nerate-id( $ccdAdditi onalSectio nHeaderPar am/headerN ame[43])" 
  1556       />
  1557               
  1558      </titleId>
  1559          
  1560     </xsl:vari able>
  1561    
  1562         
  1563     <xsl:param  
  1564      name="ccdA dditionalS ectionHead erHrefPara m"
  1565                     
  1566      select="do cument('') /*/xsl:var iable[@nam e='ccdAddi tionalSect ionHeaderH ref']/*" 
  1567     />
  1568    
  1569         
  1570     <xsl:varia ble 
  1571      name="prog ressAdditi onalSectio nHeaderHre f"
  1572     >
  1573              
  1574      <titleId>
  1575                    
  1576       <xsl:value -of
  1577                            
  1578        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[1 ])" 
  1579       />
  1580               
  1581      </titleId>
  1582              
  1583      <titleId>
  1584                    
  1585       <xsl:value -of
  1586                            
  1587        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[2 ])" 
  1588       />
  1589               
  1590      </titleId>
  1591              
  1592      <titleId>
  1593                    
  1594       <xsl:value -of
  1595                            
  1596        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[3 ])" 
  1597       />
  1598               
  1599      </titleId>
  1600              
  1601      <titleId>
  1602                    
  1603       <xsl:value -of
  1604                            
  1605        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[4 ])" 
  1606       />
  1607               
  1608      </titleId>
  1609              
  1610      <titleId>
  1611                    
  1612       <xsl:value -of
  1613                            
  1614        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[5 ])" 
  1615       />
  1616               
  1617      </titleId>
  1618              
  1619      <titleId>
  1620                    
  1621       <xsl:value -of
  1622                            
  1623        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[6 ])" 
  1624       />
  1625               
  1626      </titleId>
  1627              
  1628      <titleId>
  1629                    
  1630       <xsl:value -of
  1631                            
  1632        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[7 ])" 
  1633       />
  1634               
  1635      </titleId>
  1636              
  1637      <titleId>
  1638                    
  1639       <xsl:value -of
  1640                            
  1641        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[8 ])" 
  1642       />
  1643               
  1644      </titleId>
  1645              
  1646      <titleId>
  1647                    
  1648       <xsl:value -of
  1649                            
  1650        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[9 ])" 
  1651       />
  1652               
  1653      </titleId>
  1654              
  1655      <titleId>
  1656                    
  1657       <xsl:value -of
  1658                            
  1659        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[1 0])" 
  1660       />
  1661               
  1662      </titleId>
  1663              
  1664      <titleId>
  1665                    
  1666       <xsl:value -of
  1667                            
  1668        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[1 1])" 
  1669       />
  1670               
  1671      </titleId>
  1672              
  1673      <titleId>
  1674                    
  1675       <xsl:value -of
  1676                            
  1677        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[1 2])" 
  1678       />
  1679               
  1680      </titleId>
  1681              
  1682      <titleId>
  1683                    
  1684       <xsl:value -of
  1685                            
  1686        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[1 3])" 
  1687       />
  1688               
  1689      </titleId>
  1690              
  1691      <titleId>
  1692                    
  1693       <xsl:value -of
  1694                            
  1695        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[1 4])" 
  1696       />
  1697               
  1698      </titleId>
  1699              
  1700      <titleId>
  1701                    
  1702       <xsl:value -of
  1703                            
  1704        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[1 5])" 
  1705       />
  1706               
  1707      </titleId>
  1708              
  1709      <titleId>
  1710                    
  1711       <xsl:value -of
  1712                            
  1713        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[1 6])" 
  1714       />
  1715               
  1716      </titleId>
  1717              
  1718      <titleId>
  1719                    
  1720       <xsl:value -of
  1721                            
  1722        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[1 7])" 
  1723       />
  1724               
  1725      </titleId>
  1726              
  1727      <titleId>
  1728                    
  1729       <xsl:value -of
  1730                            
  1731        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[1 8])" 
  1732       />
  1733               
  1734      </titleId>
  1735              
  1736      <titleId>
  1737                    
  1738       <xsl:value -of
  1739                            
  1740        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[1 9])" 
  1741       />
  1742               
  1743      </titleId>
  1744              
  1745      <titleId>
  1746                    
  1747       <xsl:value -of
  1748                            
  1749        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[2 0])" 
  1750       />
  1751               
  1752      </titleId>
  1753              
  1754      <titleId>
  1755                    
  1756       <xsl:value -of
  1757                            
  1758        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[2 1])" 
  1759       />
  1760               
  1761      </titleId>
  1762              
  1763      <titleId>
  1764                    
  1765       <xsl:value -of
  1766                            
  1767        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[2 2])" 
  1768       />
  1769               
  1770      </titleId>
  1771              
  1772      <titleId>
  1773                    
  1774       <xsl:value -of
  1775                            
  1776        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[2 3])" 
  1777       />
  1778               
  1779      </titleId>
  1780              
  1781      <titleId>
  1782                    
  1783       <xsl:value -of
  1784                            
  1785        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[2 4])" 
  1786       />
  1787               
  1788      </titleId>
  1789              
  1790      <titleId>
  1791                    
  1792       <xsl:value -of
  1793                            
  1794        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[2 5])" 
  1795       />
  1796               
  1797      </titleId>
  1798              
  1799      <titleId>
  1800                    
  1801       <xsl:value -of
  1802                            
  1803        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[2 6])" 
  1804       />
  1805               
  1806      </titleId>
  1807              
  1808      <titleId>
  1809                    
  1810       <xsl:value -of
  1811                            
  1812        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[2 7])" 
  1813       />
  1814               
  1815      </titleId>
  1816              
  1817      <titleId>
  1818                    
  1819       <xsl:value -of
  1820                            
  1821        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[2 8])" 
  1822       />
  1823               
  1824      </titleId>
  1825              
  1826      <titleId>
  1827                    
  1828       <xsl:value -of
  1829                            
  1830        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[2 9])" 
  1831       />
  1832               
  1833      </titleId>
  1834              
  1835      <titleId>
  1836                    
  1837       <xsl:value -of
  1838                            
  1839        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[3 0])" 
  1840       />
  1841               
  1842      </titleId>
  1843              
  1844      <titleId>
  1845                    
  1846       <xsl:value -of
  1847                            
  1848        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[3 1])" 
  1849       />
  1850               
  1851      </titleId>
  1852              
  1853      <titleId>
  1854                    
  1855       <xsl:value -of
  1856                            
  1857        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[3 2])" 
  1858       />
  1859               
  1860      </titleId>
  1861              
  1862      <titleId>
  1863                    
  1864       <xsl:value -of
  1865                            
  1866        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[3 3])" 
  1867       />
  1868               
  1869      </titleId>
  1870              
  1871      <titleId>
  1872                    
  1873       <xsl:value -of
  1874                            
  1875        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[3 4])" 
  1876       />
  1877               
  1878      </titleId>
  1879              
  1880      <titleId>
  1881                    
  1882       <xsl:value -of
  1883                            
  1884        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[3 5])" 
  1885       />
  1886               
  1887      </titleId>
  1888              
  1889      <titleId>
  1890                    
  1891       <xsl:value -of
  1892                            
  1893        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[3 6])" 
  1894       />
  1895               
  1896      </titleId>
  1897              
  1898      <titleId>
  1899                    
  1900       <xsl:value -of
  1901                            
  1902        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[3 7])" 
  1903       />
  1904               
  1905      </titleId>
  1906              
  1907      <titleId>
  1908                    
  1909       <xsl:value -of
  1910                            
  1911        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[3 8])" 
  1912       />
  1913               
  1914      </titleId>
  1915              
  1916      <titleId>
  1917                    
  1918       <xsl:value -of
  1919                            
  1920        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[3 9])" 
  1921       />
  1922               
  1923      </titleId>
  1924              
  1925      <titleId>
  1926                    
  1927       <xsl:value -of
  1928                            
  1929        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[4 0])" 
  1930       />
  1931               
  1932      </titleId>
  1933              
  1934      <titleId>
  1935                    
  1936       <xsl:value -of
  1937                            
  1938        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[4 1])" 
  1939       />
  1940               
  1941      </titleId>
  1942              
  1943      <titleId>
  1944                    
  1945       <xsl:value -of
  1946                            
  1947        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[4 2])" 
  1948       />
  1949               
  1950      </titleId>
  1951              
  1952      <titleId>
  1953                    
  1954       <xsl:value -of
  1955                            
  1956        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[4 3])" 
  1957       />
  1958               
  1959      </titleId>
  1960              
  1961      <titleId>
  1962                    
  1963       <xsl:value -of
  1964                            
  1965        select="ge nerate-id( $progressA dditionalS ectionHead erParam/he aderName[4 4])" 
  1966       />
  1967               
  1968      </titleId>
  1969     
  1970          
  1971     </xsl:vari able>
  1972    
  1973         
  1974     <xsl:param  
  1975      name="prog ressAdditi onalSectio nHeaderHre fParam"
  1976                     
  1977      select="do cument('') /*/xsl:var iable[@nam e='progres sAdditiona lSectionHe aderHref'] /*" 
  1978     />
  1979    
  1980         
  1981     <xsl:varia ble 
  1982      name="prog SectionHea der"
  1983     >
  1984              
  1985      <headerNam e>
  1986       Assesment
  1987      </headerNa me>
  1988              
  1989      <headerNam e>
  1990       Plan of Ca re
  1991      </headerNa me>
  1992              
  1993      <headerNam e>
  1994       Allergies
  1995      </headerNa me>
  1996              
  1997      <headerNam e>
  1998       Chief Comp laint
  1999      </headerNa me>
  2000              
  2001      <headerNam e>
  2002       Instructio ns
  2003      </headerNa me>
  2004              
  2005      <headerNam e>
  2006       Interventi ons
  2007      </headerNa me>
  2008              
  2009      <headerNam e>
  2010       Medication s
  2011      </headerNa me>
  2012              
  2013      <headerNam e>
  2014       Objective
  2015      </headerNa me>
  2016              
  2017      <headerNam e>
  2018       Physical E xam
  2019      </headerNa me>
  2020              
  2021      <headerNam e>
  2022       Problem Li st
  2023      </headerNa me>
  2024              
  2025      <headerNam e>
  2026       Results
  2027      </headerNa me>
  2028              
  2029      <headerNam e>
  2030       Review of  Systems
  2031      </headerNa me>
  2032              
  2033      <headerNam e>
  2034       Subjective s
  2035      </headerNa me>
  2036              
  2037      <headerNam e>
  2038       Vital Sign s
  2039      </headerNa me>
  2040          
  2041     </xsl:vari able>
  2042    
  2043         
  2044     <xsl:param  
  2045      name="prog SectionHea derParam"
  2046                     
  2047      select="do cument('') /*/xsl:var iable[@nam e='progSec tionHeader ']/*" 
  2048     />
  2049    
  2050         
  2051     <xsl:varia ble 
  2052      name="prog SectionHea derHref"
  2053     >
  2054              
  2055      <titleId>
  2056                    
  2057       <xsl:value -of 
  2058        select="ge nerate-id( $progSecti onHeaderPa ram/header Name[1])" 
  2059       />
  2060               
  2061      </titleId>
  2062              
  2063      <titleId>
  2064                    
  2065       <xsl:value -of 
  2066        select="ge nerate-id( $progSecti onHeaderPa ram/header Name[2])" 
  2067       />
  2068               
  2069      </titleId>
  2070              
  2071      <titleId>
  2072                    
  2073       <xsl:value -of 
  2074        select="ge nerate-id( $progSecti onHeaderPa ram/header Name[3])" 
  2075       />
  2076               
  2077      </titleId>
  2078              
  2079      <titleId>
  2080                    
  2081       <xsl:value -of 
  2082        select="ge nerate-id( $progSecti onHeaderPa ram/header Name[4])" 
  2083       />
  2084               
  2085      </titleId>
  2086              
  2087      <titleId>
  2088                    
  2089       <xsl:value -of 
  2090        select="ge nerate-id( $progSecti onHeaderPa ram/header Name[5])" 
  2091       />
  2092               
  2093      </titleId>
  2094              
  2095      <titleId>
  2096                    
  2097       <xsl:value -of 
  2098        select="ge nerate-id( $progSecti onHeaderPa ram/header Name[6])" 
  2099       />
  2100               
  2101      </titleId>
  2102              
  2103      <titleId>
  2104                    
  2105       <xsl:value -of 
  2106        select="ge nerate-id( $progSecti onHeaderPa ram/header Name[7])" 
  2107       />
  2108               
  2109      </titleId>
  2110              
  2111      <titleId>
  2112                    
  2113       <xsl:value -of 
  2114        select="ge nerate-id( $progSecti onHeaderPa ram/header Name[8])" 
  2115       />
  2116               
  2117      </titleId>
  2118              
  2119      <titleId>
  2120                    
  2121       <xsl:value -of 
  2122        select="ge nerate-id( $progSecti onHeaderPa ram/header Name[9])" 
  2123       />
  2124               
  2125      </titleId>
  2126              
  2127      <titleId>
  2128                    
  2129       <xsl:value -of 
  2130        select="ge nerate-id( $progSecti onHeaderPa ram/header Name[10])"  
  2131       />
  2132               
  2133      </titleId>
  2134              
  2135      <titleId>
  2136                    
  2137       <xsl:value -of 
  2138        select="ge nerate-id( $progSecti onHeaderPa ram/header Name[11])"  
  2139       />
  2140               
  2141      </titleId>
  2142              
  2143      <titleId>
  2144                    
  2145       <xsl:value -of 
  2146        select="ge nerate-id( $progSecti onHeaderPa ram/header Name[12])"  
  2147       />
  2148               
  2149      </titleId>
  2150              
  2151      <titleId>
  2152                    
  2153       <xsl:value -of 
  2154        select="ge nerate-id( $progSecti onHeaderPa ram/header Name[13])"  
  2155       />
  2156               
  2157      </titleId>
  2158              
  2159      <titleId>
  2160                    
  2161       <xsl:value -of 
  2162        select="ge nerate-id( $progSecti onHeaderPa ram/header Name[14])"  
  2163       />
  2164               
  2165      </titleId>
  2166          
  2167     </xsl:vari able>
  2168    
  2169         
  2170     <xsl:param  
  2171      name="prog SectionHea derHrefPar am"
  2172                     
  2173      select="do cument('') /*/xsl:var iable[@nam e='progSec tionHeader Href']/*" 
  2174     />
  2175    
  2176         
  2177     <xsl:varia ble 
  2178      name="ccdD ocTemplate Root"
  2179                        
  2180      select="/n 1:Clinical Document/n 1:template Id[@root=' 2.16.840.1 .113883.10 .20.22.1.1 ']/@root" 
  2181     />
  2182         
  2183     <xsl:varia ble 
  2184      name="prog DocTemplat eRoot"
  2185                        
  2186      select="/n 1:Clinical Document/n 1:template Id[@root=' 2.16.840.1 .113883.10 .20.22.1.9 ']/@root" 
  2187     />
  2188    
  2189         
  2190     <xsl:varia ble 
  2191      name="ccda Doc"
  2192     >
  2193              
  2194      <xsl:text>
  2195       2.16.840.1 .113883.10 .20.22.1.1
  2196      </xsl:text >
  2197          
  2198     </xsl:vari able>
  2199         
  2200     <xsl:varia ble 
  2201      name="prog ressDoc"
  2202     >
  2203              
  2204      <xsl:text>
  2205       2.16.840.1 .113883.10 .20.22.1.9
  2206      </xsl:text >
  2207          
  2208     </xsl:vari able>
  2209    
  2210         
  2211     <!-- Main  -->
  2212         
  2213     <xsl:templ ate 
  2214      match="/"
  2215     >
  2216              
  2217      <xsl:apply -templates  
  2218       select="n1 :ClinicalD ocument" 
  2219      />
  2220          
  2221     </xsl:temp late>
  2222         
  2223     <!-- produ ce browser  rendered,  human rea dable clin ical docum ent -->
  2224         
  2225     <xsl:templ ate 
  2226      match="n1: ClinicalDo cument"
  2227     >
  2228              
  2229      <html>
  2230                    
  2231       <head>
  2232                         
  2233        <meta 
  2234         charset="u tf-8" 
  2235        />
  2236                         
  2237        <meta 
  2238         http-equiv ="X-UA-Com patible" 
  2239         content="I E=edge" 
  2240        />
  2241                         
  2242        <title>
  2243         Veterans A ffairs
  2244        </title>
  2245                         
  2246        <meta 
  2247         name="desc ription" 
  2248         content=""  
  2249        />
  2250                         
  2251        <meta 
  2252         name="view port" 
  2253         content="w idth=devic e-width, i nitial-sca le=1" 
  2254        />
  2255       
  2256                         
  2257        <!--link r el="styles heet"
  2258                                                      href="ht tp://fonts .googleapi s.com/css? family=Ope n+Sans:300 italic,400 italic,600 italic,700 italic,300 ,400,600,7 00" /-->
  2259                         
  2260        <link 
  2261         rel="style sheet" 
  2262         href="c32s tyles/nhin /cda_plain .css" 
  2263        />
  2264                         
  2265        <script 
  2266         LANGUAGE=" javascript
  2267         DEFER="tru e"
  2268        >
  2269                              
  2270         <xsl:comme nt>
  2271                                    
  2272          <![CDATA[
  2273                                    docume nt.onready statechang e = functi on()
  2274                                    {
  2275                                             if(docum ent.readyS tate === ' complete')
  2276                                             {
  2277                                                      var count  = 0;
  2278                                                      var sectio ns = docum ent.getEle mentsByTag Name("sect ion");
  2279                                                      while (cou nt<section s.length)
  2280                                                      {
  2281                                                              va r s = sect ions[count ++].id;
  2282                                                              to ggle("open ", s);
  2283                                                      }
  2284         
  2285                                                      toggle("op en","TOC")
  2286                                             }
  2287                                    };
  2288         
  2289         
  2290                                    functi on toggle( state, ele mId) {
  2291                                             var plus  = documen t.getEleme ntById("pl us." + ele mId);
  2292                                             var minu s = docume nt.getElem entById("m inus." + e lemId);
  2293                                             var info  = documen t.getEleme ntById("se ction." +  elemId);
  2294                                             if (stat e == "open ")
  2295                                             {
  2296                                                      info.style .display=" inline";
  2297                                                      plus.style .display=" none";
  2298                                                      minus.styl e.display= "inline";
  2299                                             }
  2300                                             else
  2301                                             {
  2302                                                      info.style .display=" none";
  2303                                                      plus.style .display=" inline";
  2304                                                      minus.styl e.display= "none";
  2305                                             }
  2306                                    }
  2307         
  2308                                    var ha sClass = f unction(el em, classN ame){
  2309                                             return n ew RegExp( ' ' + clas sName + '  ').test('  ' + elem.c lassName +  ' ');
  2310                                    }
  2311         
  2312                                    var ad dClass = f unction(el em, classN ame){
  2313                                             if (!has Class(elem , classNam e)) {
  2314                                                      elem.class Name += '  ' + classN ame;
  2315                                             }
  2316                                    }
  2317         
  2318                                    var re moveClass  = function (elem, cla ssName){
  2319                                             var newC lass = ' '  + elem.cl assName.re place( /[\ t\r\n]/g,  ' ') + ' ' ;
  2320                                             if (hasC lass(elem,  className )) {
  2321                                                      while (new Class.inde xOf(' ' +  className  + ' ') >=  0 ) {
  2322                                                              ne wClass = n ewClass.re place(' '  + classNam e + ' ', '  ');
  2323                                                      }
  2324                                                      elem.class Name = new Class.repl ace(/^\s+| \s+$/g, '' );
  2325                                             }
  2326                                    }
  2327         
  2328                                    functi on getOffs et(el) {
  2329                                             var _x =  0,
  2330                                                      _y = 0;
  2331                                             while( e l && !isNa N( el.offs etLeft ) & & !isNaN(  el.offsetT op ) ) {
  2332                                                      _x += el.o ffsetLeft  - el.scrol lLeft;
  2333                                                      _y += el.o ffsetTop -  el.scroll Top;
  2334                                                      el = el.of fsetParent ;
  2335                                             }
  2336                                             return {  top: _y,  left: _x } ;
  2337                                    }
  2338         
  2339         
  2340                                    var ea sing = {
  2341                                             linear:  function ( t) { retur n t },
  2342                                             easeInQu ad: functi on (t) { r eturn t*t  },
  2343                                             easeOutQ uad: funct ion (t) {  return t*( 2-t) },
  2344                                             easeInOu tQuad: fun ction (t)  { return t <.5 ? 2*t* t : -1+(4- 2*t)*t },
  2345                                             easeInCu bic: funct ion (t) {  return t*t *t },
  2346                                             easeOutC ubic: func tion (t) {  return (- -t)*t*t+1  },
  2347                                             easeInOu tCubic: fu nction (t)  { return  t<.5 ? 4*t *t*t : (t- 1)*(2*t-2) *(2*t-2)+1  },
  2348                                             easeInQu art: funct ion (t) {  return t*t *t*t },
  2349                                             easeOutQ uart: func tion (t) {  return 1- (--t)*t*t* t },
  2350                                             easeInOu tQuart: fu nction (t)  { return  t<.5 ? 8*t *t*t*t : 1 -8*(--t)*t *t*t },
  2351                                             easeInQu int: funct ion (t) {  return t*t *t*t*t },
  2352                                             easeOutQ uint: func tion (t) {  return 1+ (--t)*t*t* t*t },
  2353                                             easeInOu tQuint: fu nction (t)  { return  t<.5 ? 16* t*t*t*t*t  : 1+16*(-- t)*t*t*t*t  }
  2354                                    };
  2355         
  2356                                    if ('q uerySelect or' in doc ument && ' addEventLi stener' in  window &&  Array.pro totype.for Each){
  2357                                             document .addEventL istener('D OMContentL oaded', fu nction(){
  2358         
  2359                                                      var backto top = docu ment.getEl ementById( 'backtotop '),
  2360                                                              ti tlebar = d ocument.ge tElementBy Id('titleb ar'),
  2361                                                              ti tlebar_con tainer = d ocument.ge tElementBy Id('titleb ar-contain er'),
  2362                                                              ti tlebar_hei ght = titl ebar.offse tHeight;
  2363         
  2364                                                      // titleba r isn't fi xed withou t javascri pt
  2365                                                      // we know  we have j avascript  enabled no w, so set  the titleb ar as fixe d, and off set the bo dy with pa dding to m atch
  2366                                                      addClass(t itlebar_co ntainer, ' fixed');
  2367                                                      document.b ody.style. padding =  titlebar_h eight+"px  0 0";
  2368         
  2369                                                      // jumplin ks
  2370                                                      var subnav links = do cument.que rySelector All('.toc  a');
  2371                                                      [].forEach .call(subn avlinks, f unction(l) {
  2372                                                              l. addEventLi stener('cl ick', func tion(e){
  2373                                                                       e.pr eventDefau lt();
  2374                                                                       var  target = l .getAttrib ute('data- target');
  2375                                                                       goTo JumpLink(t arget);
  2376                                                              },  false);
  2377                                                      });
  2378         
  2379                                                      // if the  user comes  to this s creen with  a hash in  the url,  attempt to  jump to t hat sectio n
  2380                                                      var url =  location.h ref;
  2381                                                      var anchor Pos = url. indexOf("# ");
  2382                                                      if (anchor Pos != -1) {
  2383                                                              ta rget = url .substr(an chorPos+1) ;
  2384                                                              go ToJumpLink (target);
  2385                                                      }
  2386         
  2387                                                      // back-to -top butto n
  2388                                                      backtotop. addEventLi stener('cl ick', func tion(e){
  2389                                                              go ToJumpLink ('top');
  2390                                                      }, false);
  2391         
  2392                                                      var listen er = funct ion () {
  2393                                                              va r y = wind ow.pageYOf fset;
  2394         
  2395                                                              if  (y >= tit lebar_heig ht) {
  2396                                                                       addC lass(backt otop, 'act ive');
  2397                                                              }  else {
  2398                                                                       remo veClass(ba cktotop, ' active');
  2399                                                              }
  2400                                                      };
  2401                                                      window.add EventListe ner('scrol l', listen er, false) ;
  2402         
  2403                                                      // animate  to a part icualr anc hor on the  page
  2404                                                      function g oToJumpLin k(el){
  2405                                                              va r titlebar  = documen t.getEleme ntsByClass Name("titl ebar")[0];
  2406                                                              if (titlebar)  {
  2407                                                                       titl ebar_heigh t = titleb ar.offsetH eight;
  2408                                                              }
  2409                                                              va r jump = d ocument.ge tElementBy Id(el),
  2410                                                                       t =  getOffset( jump).top,
  2411                                                                       scro lltop = do cument.bod y.scrollTo p,
  2412                                                                       news crolltop =  (t-(title bar_height -2))+scrol ltop;
  2413         
  2414                                                              wi ndow.scrol l(0, newsc rolltop);
  2415                                                      }
  2416                                             });
  2417                                    }
  2418                                                      ]]>
  2419                               
  2420         </xsl:comm ent>
  2421                          
  2422        </script>
  2423                     
  2424       </head>
  2425                    
  2426       <body>
  2427                         
  2428        <div 
  2429         id="top" 
  2430         class="epi sode-note- container"
  2431        >
  2432        
  2433                              
  2434         <div 
  2435          id="titleb ar-contain er" 
  2436          class="tit lebar-cont ainer"
  2437         >
  2438                                    
  2439          <header 
  2440           id="titleb ar" 
  2441           class="tit lebar"
  2442          >
  2443                                         
  2444           <div 
  2445            class="col umns"
  2446           >
  2447                                               
  2448            <div 
  2449             class="col -3"
  2450            >
  2451                                                    
  2452             <p>
  2453                                                         
  2454              <xsl:value -of 
  2455               select="n1 :title" 
  2456              />
  2457                                                         
  2458              <!-- VA Co ntinuity o f Care Doc ument <xsl :choose> < xsl:when t est="conta ins($docTe mplateRoot ,
  2459                                                                                                              $c cdaDoc)">  (VA CCD) < /xsl:when>  <xsl:when  test="con tains($doc TemplateRo ot,
  2460                                                                                                              $p rogressDoc )"> (VA Pr ogress Not es) </xsl: when> <xsl :otherwise > </xsl:ot herwise>
  2461                                                                                                              </ xsl:choose > -->
  2462                                                         
  2463              <br />
  2464                                                          created on
  2465                                                         
  2466              <strong>
  2467                                                               
  2468               <xsl:call- template 
  2469                name="show -time"
  2470               >
  2471                                                                    
  2472                <xsl:with- param 
  2473                 name="date time" 
  2474                 select="n1 :effective Time" 
  2475                />
  2476                                                                
  2477               </xsl:call -template>
  2478                                                          
  2479              </strong>
  2480                                                     
  2481             </p>
  2482                                                
  2483            </div>
  2484           
  2485                                               
  2486            <div 
  2487             class="col -3" 
  2488             style="tex t-align: c enter;word -wrap: bre ak-word;"
  2489            >
  2490                                                    
  2491             <h1>
  2492                                                         
  2493              <xsl:value -of
  2494                                                                  
  2495               select="n1 :custodian /n1:assign edCustodia n/n1:repre sentedCust odianOrgan ization/n1 :name" 
  2496              />
  2497                                                     
  2498             </h1>
  2499            
  2500                                                
  2501            </div>
  2502           
  2503                                               
  2504            <div 
  2505             class="col -3" 
  2506             style="tex t-align: l eft;word-w rap: break -word;"
  2507            >
  2508                                                    
  2509             <p>
  2510                                                          Patient:
  2511             
  2512                                                         
  2513              <xsl:call- template 
  2514               name="show -name"
  2515              >
  2516                                                               
  2517               <xsl:with- param 
  2518                name="name "
  2519                                                                                
  2520                select="n1 :recordTar get/n1:pat ientRole/n 1:patient/ n1:name" 
  2521               />
  2522                                                          
  2523              </xsl:call -template>
  2524                                                         
  2525              <br />
  2526                                                          DOB:
  2527             
  2528                                                         
  2529              <xsl:call- template 
  2530               name="show -time"
  2531              >
  2532                                                               
  2533               <xsl:with- param 
  2534                name="date time"
  2535                                                                                
  2536                select="n1 :recordTar get/n1:pat ientRole/n 1:patient/ n1:birthTi me" 
  2537               />
  2538                                                          
  2539              </xsl:call -template>
  2540             
  2541                                                         
  2542              <br />
  2543                                                          Gender:
  2544                                                         
  2545              <xsl:for-e ach
  2546                                                                  
  2547               select="/n 1:Clinical Document/n 1:recordTa rget/n1:pa tientRole/ n1:patient /n1:admini strativeGe nderCode"
  2548              >
  2549                                                               
  2550               <xsl:if 
  2551                test="@nul lFlavor"
  2552               >
  2553                                                                    
  2554                <xsl:value -of 
  2555                 select="n1 :originalT ext"
  2556                />
  2557                                                                
  2558               </xsl:if>
  2559                                                               
  2560               <xsl:call- template 
  2561                name="show -gender" 
  2562               />
  2563                                                          
  2564              </xsl:for- each>
  2565                                                     
  2566             </p>
  2567                                                
  2568            </div>
  2569           
  2570           
  2571                                          
  2572           </div>
  2573                                         
  2574           <nav 
  2575            class="toc  infobar"
  2576           >
  2577                                               
  2578            <p>
  2579                                                    
  2580             <label 
  2581              id="plus.T OC" 
  2582              onclick="j avascript: toggle('op en','TOC') "
  2583             >
  2584              [+]  
  2585             </label>
  2586                                                    
  2587             <label 
  2588              id="minus. TOC" 
  2589              onclick="j avascript: toggle('cl ose','TOC' )"
  2590             >
  2591              [-]  
  2592             </label>
  2593                                                    
  2594             <strong>
  2595              Table of C ontents
  2596             </strong>
  2597                                                
  2598            </p>
  2599                                               
  2600            <div 
  2601             id="sectio n.TOC"
  2602            >
  2603                                                    
  2604             <xsl:if 
  2605              test="not( //n1:nonXM LBody)"
  2606             >
  2607                                                         
  2608              <xsl:if
  2609                                                                  
  2610               test="coun t(/n1:Clin icalDocume nt/n1:comp onent/n1:s tructuredB ody/n1:com ponent[n1: section])  &gt; 1"
  2611              >
  2612                                                               
  2613               <xsl:call- template 
  2614                name="make -tableofco ntents-dyn amic" 
  2615               />
  2616                                                          
  2617              </xsl:if>
  2618                                                     
  2619             </xsl:if>
  2620                                                
  2621            </div>
  2622                                          
  2623           </nav>
  2624          
  2625                                         
  2626           <button 
  2627            id="backto top" 
  2628            class="bac ktotop"
  2629           >
  2630            &#x2191; B ack To Top
  2631           </button>
  2632                                     
  2633          </header>
  2634                               
  2635         </div>
  2636                      
  2637         <!-- START  display t op portion  of clinic al documen t -->
  2638                              
  2639         <div 
  2640          class="sec tions"
  2641         >
  2642         
  2643                                    
  2644          <section 
  2645           id="Patien t Informat ion"
  2646          >
  2647                                         
  2648           <header>
  2649                                               
  2650            <h2>
  2651                                                    
  2652             <label 
  2653              id="plus.P atient Inf ormation" 
  2654              onclick="j avascript: toggle('op en','Patie nt Informa tion')"
  2655             >
  2656              [+]  
  2657             </label>
  2658                                                    
  2659             <label 
  2660              id="minus. Patient In formation"  
  2661              onclick="j avascript: toggle('cl ose','Pati ent Inform ation')"
  2662             >
  2663              [-]  
  2664             </label>
  2665                                                    Pati ent Inform ation
  2666            </h2>
  2667                                               
  2668            <!--<p><st rong>Busin ess Rules  for Constr uction of  Medical In formation: </strong>
  2669                                                                                           Business  Rules des cription o f the sect ion goes h ere.</p> - ->
  2670                                          
  2671           </header>
  2672                                         
  2673           <div 
  2674            id="sectio n.Patient  Informatio n"
  2675           >
  2676                                               
  2677            <div 
  2678             class="col umns"
  2679            >
  2680                                                    
  2681             <div 
  2682              class="col -1"
  2683             >
  2684                                                         
  2685              <table>
  2686                                                               
  2687               <thead>
  2688                                                                    
  2689                <tr>
  2690                                                                          
  2691                 <th 
  2692                  colspan="2 "
  2693                 >
  2694                  Patient In formation
  2695                 </th>
  2696                                                                     
  2697                </tr>
  2698                                                                
  2699               </thead>
  2700                                                               
  2701               <tbody>
  2702                                                                    
  2703                <!-- <tr v align="top "> <th wid th="30%">N ame</th> < td width=" 70%">
  2704                                                                         <xsl:cal l-template  name="sho w-name"> < xsl:with-p aram name= "name" sel ect="n1:re cordTarget /n1:patien tRole/n1:p atient/n1: name"/>
  2705                                                                         </xsl:ca ll-templat e> </td> < /tr> <tr v align="top "> <th>Med ical Recor d Number</ th>
  2706                                                                         <td> <xs l:value-of  select="n 1:recordTa rget/n1:pa tientRole/ n1:id/@ext ension"
  2707                                                                         /> </td>  </tr> <tr  valign="t op"> <th>B irthdate</ th> <td> < xsl:call-t emplate
  2708                                                                         name="sh ow-time">  <xsl:with- param name ="datetime " select=" n1:recordT arget/n1:p atientRole /n1:patien t/n1:birth Time"/>
  2709                                                                         </xsl:ca ll-templat e> </td> < /tr> -->
  2710                                                                    
  2711                <tr 
  2712                 valign="to p"
  2713                >
  2714                                                                          
  2715                 <th>
  2716                  Address
  2717                 </th>
  2718                                                                          
  2719                 <td>
  2720                                                                               
  2721                  <xsl:for-e ach
  2722                                                                                        
  2723                   select="/n 1:Clinical Document/n 1:recordTa rget/n1:pa tientRole"
  2724                  >
  2725                                                                                    
  2726                   <xsl:if 
  2727                    test="not( n1:id/@nul lFlavor)"
  2728                   >
  2729                                                                                          
  2730                    <xsl:call- template 
  2731                     name="show -contactIn fo"
  2732                    >
  2733                                                                                               
  2734                     <xsl:with- param 
  2735                      name="cont act" 
  2736                      select="."  
  2737                     />
  2738                                                                                           
  2739                    </xsl:call -template>
  2740                                                                                     
  2741                   </xsl:if>
  2742                                                                                
  2743                  </xsl:for- each>
  2744                                                                           
  2745                 </td>
  2746                                                                     
  2747                </tr>
  2748                                                                    
  2749                <!--<tr va lign="top" > <th>Pati ent Id</th > <td> <xs l:for-each  select="n 1:recordTa rget/n1:pa tientRole/ n1:id">
  2750                                                                         <xsl:cal l-template  name="sho w-id"/> <b r/> </xsl: for-each>  </td> </tr > -->
  2751                                                                    
  2752                <!-- <tr v align="top "> <th>Gen der</th> < td> <xsl:f or-each se lect="/n1: ClinicalDo cument/n1: recordTarg et/n1:pati entRole/n1 :patient/n 1:administ rativeGend erCode">
  2753                                                                         <xsl:cal l-template  name="sho w-gender"/ > </xsl:fo r-each> </ td> </tr>  -->
  2754                                                                    
  2755                <tr 
  2756                 valign="to p"
  2757                >
  2758                                                                          
  2759                 <th>
  2760                  Marital st atus
  2761                 </th>
  2762                                                                          
  2763                 <td>
  2764                                                                               
  2765                  <xsl:choos e>
  2766                                                                                    
  2767                   <xsl:when
  2768                                                                                             
  2769                    test="n1:r ecordTarge t/n1:patie ntRole/n1: patient/n1 :maritalSt atusCode/@ displayNam e"
  2770                   >
  2771                                                                                          
  2772                    <xsl:value -of
  2773                                                                                                   
  2774                     select="n1 :recordTar get/n1:pat ientRole/n 1:patient/ n1:marital StatusCode /@displayN ame" 
  2775                    />
  2776                                                                                     
  2777                   </xsl:when >
  2778                                                                                    
  2779                   <xsl:when
  2780                                                                                             
  2781                    test="n1:r ecordTarge t/n1:patie ntRole/n1: patient/n1 :maritalSt atusCode/n 1:original Text"
  2782                   >
  2783                                                                                          
  2784                    <xsl:value -of
  2785                                                                                                   
  2786                     select="n1 :recordTar get/n1:pat ientRole/n 1:patient/ n1:marital StatusCode /n1:origin alText" 
  2787                    />
  2788                                                                                     
  2789                   </xsl:when >
  2790                                                                                
  2791                  </xsl:choo se>
  2792                                                                           
  2793                 </td>
  2794                                                                     
  2795                </tr>
  2796               
  2797                                                                    
  2798                <tr 
  2799                 valign="to p"
  2800                >
  2801                                                                          
  2802                 <th>
  2803                  Religious  Affiliatio n
  2804                 </th>
  2805                                                                          
  2806                 <td>
  2807                                                                               
  2808                  <xsl:choos e>
  2809                                                                                    
  2810                   <xsl:when 
  2811                    test="n1:r ecordTarge t/n1:patie ntRole/n1: patient/n1 :religious Affiliatio nCode/@dis playName"
  2812                   >
  2813                                                                                          
  2814                    <xsl:value -of 
  2815                     select="n1 :recordTar get/n1:pat ientRole/n 1:patient/ n1:religio usAffiliat ionCode/@d isplayName "
  2816                    />
  2817                                                                                     
  2818                   </xsl:when >
  2819                                                                                    
  2820                   <xsl:when 
  2821                    test="n1:r ecordTarge t/n1:patie ntRole/n1: patient/n1 :religious Affiliatio nCode/n1:o riginalTex t"
  2822                   >
  2823                                                                                          
  2824                    <xsl:value -of 
  2825                     select="n1 :recordTar get/n1:pat ientRole/n 1:patient/ n1:religio usAffiliat ionCode/n1 :originalT ext"
  2826                    />
  2827                                                                                     
  2828                   </xsl:when >
  2829                                                                                
  2830                  </xsl:choo se>
  2831                                                                           
  2832                 </td>
  2833                                                                     
  2834                </tr>
  2835                                                                    
  2836                <tr 
  2837                 valign="to p"
  2838                >
  2839                                                                          
  2840                 <th>
  2841                  Race
  2842                 </th>
  2843                                                                          
  2844                 <td>
  2845                                                                               
  2846                  <xsl:call- template 
  2847                   name="show -race"
  2848                  >
  2849                                                                                    
  2850                   <xsl:with- param 
  2851                    name="race CodeDispla y" 
  2852                    select="n1 :recordTar get/n1:pat ientRole/n 1:patient/ n1:raceCod e/@display Name"
  2853                   />
  2854                                                                                    
  2855                   <xsl:with- param 
  2856                    name="sdtc -raceCodeD isplay" 
  2857                    select="n1 :recordTar get/n1:pat ientRole/n 1:patient/ sdtc:raceC ode/@displ ayName"
  2858                   />
  2859                                                                                    
  2860                   <xsl:with- param 
  2861                    name="race CodeText" 
  2862                    select="n1 :recordTar get/n1:pat ientRole/n 1:patient/ n1:raceCod e/n1:origi nalText"
  2863                   />
  2864                                                                                    
  2865                   <xsl:with- param 
  2866                    name="sdtc -raceCodeT ext" 
  2867                    select="n1 :recordTar get/n1:pat ientRole/n 1:patient/ sdtc:raceC ode/n1:ori ginalText"
  2868                   />
  2869                                                                                
  2870                  </xsl:call -template>
  2871                                                                               
  2872                  <!--
  2873                                                                               <xsl :for-each
  2874                                                                                    select="n1 :recordTar get/n1:pat ientRole/n 1:patient/ n1:raceCod e">
  2875                                                                                    <xsl:call- template n ame="show- race-ethni city" />
  2876                                                                               </xs l:for-each >
  2877                                                                               -->
  2878                 
  2879                                                                           
  2880                 </td>
  2881                                                                     
  2882                </tr>
  2883               
  2884                                                                    
  2885                <tr 
  2886                 valign="to p"
  2887                >
  2888                                                                          
  2889                 <th>
  2890                  Ethnicity
  2891                 </th>
  2892                                                                          
  2893                 <td>
  2894                                                                               
  2895                  <xsl:choos e>
  2896                                                                                    
  2897                   <xsl:when 
  2898                    test="n1:r ecordTarge t/n1:patie ntRole/n1: patient/n1 :ethnicGro upCode/@di splayName"
  2899                   >
  2900                                                                                          
  2901                    <xsl:value -of 
  2902                     select="n1 :recordTar get/n1:pat ientRole/n 1:patient/ n1:ethnicG roupCode/@ displayNam e"
  2903                    />
  2904                                                                                     
  2905                   </xsl:when >
  2906                                                                                    
  2907                   <xsl:when 
  2908                    test="n1:r ecordTarge t/n1:patie ntRole/n1: patient/n1 :ethnicGro upCode/n1: originalTe xt"
  2909                   >
  2910                                                                                          
  2911                    <xsl:value -of 
  2912                     select="n1 :recordTar get/n1:pat ientRole/n 1:patient/ n1:ethnicG roupCode/n 1:original Text"
  2913                    />
  2914                                                                                     
  2915                   </xsl:when >
  2916                                                                                
  2917                  </xsl:choo se>
  2918                                                                               
  2919                  <!--
  2920                                                                               <xsl :for-each
  2921                                                                                    select="n1 :recordTar get/n1:pat ientRole/n 1:patient/ n1:ethnicG roupCode">
  2922                                                                                    <xsl:call- template n ame="show- race-ethni city" />
  2923                                                                               </xs l:for-each >
  2924                                                                               -->
  2925                                                                           
  2926                 </td>
  2927                                                                     
  2928                </tr>
  2929               
  2930                                                                    
  2931                <tr 
  2932                 valign="to p"
  2933                >
  2934                                                                          
  2935                 <th>
  2936                  Language(s )
  2937                 </th>
  2938                                                                          
  2939                 <td>
  2940                                                                               
  2941                  <xsl:for-e ach
  2942                                                                                        
  2943                   select="n1 :recordTar get/n1:pat ientRole/n 1:patient/ n1:languag eCommunica tion"
  2944                  >
  2945                                                                                    
  2946                   <xsl:call- template 
  2947                    name="show -language"
  2948                   >
  2949                                                                                          
  2950                    <xsl:with- param 
  2951                     name="lang Code" 
  2952                     select="n1 :languageC ode" 
  2953                    />
  2954                                                                                          
  2955                    <xsl:with- param 
  2956                     name="mode Code" 
  2957                     select="n1 :modeCode"  
  2958                    />
  2959                                                                                     
  2960                   </xsl:call -template>
  2961                                                                                    
  2962                   <xsl:if 
  2963                    test="posi tion()!=la st()"
  2964                   >
  2965                                                                                          
  2966                    <xsl:text>
  2967                    
  2968                    </xsl:text >
  2969                                                                                     
  2970                   </xsl:if>
  2971                                                                                
  2972                  </xsl:for- each>
  2973                                                                           
  2974                 </td>
  2975                                                                     
  2976                </tr>
  2977                                                                    
  2978                <tr 
  2979                 valign="to p"
  2980                >
  2981                                                                          
  2982                 <th>
  2983                  Preferred  Language
  2984                 </th>
  2985                                                                          
  2986                 <td>
  2987                                                                               
  2988                  <xsl:for-e ach
  2989                                                                                        
  2990                   select="n1 :recordTar get/n1:pat ientRole/n 1:patient/ n1:languag eCommunica tion"
  2991                  >
  2992                                                                                    
  2993                   <xsl:call- template 
  2994                    name="pref -language"
  2995                   >
  2996                                                                                          
  2997                    <xsl:with- param 
  2998                     name="lang Code" 
  2999                     select="n1 :languageC ode" 
  3000                    />
  3001                                                                                          
  3002                    <xsl:with- param 
  3003                     name="pref Lang" 
  3004                     select="n1 :preferenc eInd" 
  3005                    />
  3006                                                                                          
  3007                    <xsl:with- param 
  3008                     name="mode Code" 
  3009                     select="n1 :modeCode"  
  3010                    />
  3011                                                                                     
  3012                   </xsl:call -template>
  3013                                                                                
  3014                  </xsl:for- each>
  3015                                                                           
  3016                 </td>
  3017                                                                     
  3018                </tr>
  3019                                                                    
  3020                <!-- <xsl: for-each s elect="n1: author/n1: assignedAu thor"> <tr  valign="t op">
  3021                                                                         <th> Aut hor </th>  <td> <xsl: choose> <x sl:when te st="n1:ass ignedPerso n/n1:name" >
  3022                                                                         <xsl:cal l-template  name="sho w-name"> < xsl:with-p aram name= "name" sel ect="n1:as signedPers on/n1:name "/>
  3023                                                                         </xsl:ca ll-templat e> </xsl:w hen> <xsl: when test= "n1:assign edAuthorin gDevice/n1 :softwareN ame">
  3024                                                                         <xsl:val ue-of sele ct="n1:ass ignedAutho ringDevice /n1:softwa reName"/>  </xsl:when >
  3025                                                                         <xsl:whe n test="n1 :represent edOrganiza tion"> <xs l:call-tem plate name ="show-nam e">
  3026                                                                         <xsl:wit h-param na me="name"  select="n1 :represent edOrganiza tion/n1:na me"/>
  3027                                                                         </xsl:ca ll-templat e> </xsl:w hen> <xsl: otherwise>  <xsl:for- each selec t="n1:id">
  3028                                                                         <xsl:cal l-template  name="sho w-id"/> <b r/> </xsl: for-each>  </xsl:othe rwise>
  3029                                                                         </xsl:ch oose> </td > </tr> <x sl:if test ="n1:addr  | n1:telec om"> <tr v align="top ">
  3030                                                                         <th> Con tact info  </th> <td>  <xsl:call -template  name="show -contactIn fo">
  3031                                                                         <xsl:wit h-param na me="contac t" select= "."/> </xs l:call-tem plate> </t d> </tr>
  3032                                                                         </xsl:if > </xsl:fo r-each> -- >
  3033                                                                
  3034               </tbody>
  3035                                                          
  3036              </table>
  3037                                                     
  3038             </div>
  3039                                                
  3040            </div>
  3041                                          
  3042           </div>
  3043          
  3044                                     
  3045          </section>
  3046         
  3047                                    
  3048          <xsl:apply -templates
  3049                                             
  3050           select="n1 :component /n1:struct uredBody|n 1:componen t/n1:nonXM LBody" 
  3051          />
  3052         
  3053                                    
  3054          <section 
  3055           id="Health care Provi ders"
  3056          >
  3057                                         
  3058           <header>
  3059                                               
  3060            <h2>
  3061                                                    
  3062             <label 
  3063              id="plus.H ealthcare  Providers"  
  3064              onclick="j avascript: toggle('op en','Healt hcare Prov iders')"
  3065             >
  3066              [+]
  3067             </label>
  3068                                                    
  3069             <label 
  3070              id="minus. Healthcare  Providers
  3071              onclick="j avascript: toggle('cl ose','Heal thcare Pro viders')"
  3072             >
  3073              [-]
  3074             </label>
  3075            
  3076                                                    Heal thcare Pro viders
  3077            </h2>
  3078                                               
  3079            <!--<p><st rong>Busin ess Rules  for Constr uction of  Medical In formation: </strong>
  3080                                                                                           Business  Rules des cription o f the sect ion goes h ere.</p> - ->
  3081                                          
  3082           </header>
  3083                                         
  3084           <div 
  3085            id="sectio n.Healthca re Provide rs"
  3086           >
  3087                                               
  3088            <xsl:choos e>
  3089                                                    
  3090             <xsl:when 
  3091              test="n1:d ocumentati onOf/n1:se rviceEvent /n1:perfor mer/@id =  'PCP' or n 1:document ationOf/n1 :serviceEv ent/n1:per former/n1: functionCo de/@code =  'PCP'"
  3092             >
  3093                                                         
  3094              <xsl:call- template 
  3095               name="docu mentationO f" 
  3096              />
  3097                                                     
  3098             </xsl:when >
  3099                                                    
  3100             <xsl:other wise>
  3101                                                         
  3102              <xsl:text>
  3103               No data pr ovided for  this sect ion.
  3104              </xsl:text >
  3105                                                     
  3106             </xsl:othe rwise>
  3107                                                
  3108            </xsl:choo se>
  3109                                          
  3110           </div>
  3111                                     
  3112          </section>
  3113         
  3114                                    
  3115          <section 
  3116           id="Contac t Informat ion"
  3117          >
  3118                                         
  3119           <header>
  3120                                               
  3121            <h2>
  3122                                                    
  3123             <label 
  3124              id="plus.C ontact Inf ormation" 
  3125              onclick="j avascript: toggle('op en','Conta ct Informa tion')"
  3126             >
  3127              [+]
  3128             </label>
  3129                                                    
  3130             <label 
  3131              id="minus. Contact In formation"  
  3132              onclick="j avascript: toggle('cl ose','Cont act Inform ation')"
  3133             >
  3134              [-]
  3135             </label>
  3136                                                    Cont act Inform ation
  3137            </h2>
  3138                                          
  3139           </header>
  3140                                         
  3141           <div 
  3142            class="col -2"
  3143           >
  3144                                               
  3145            <div 
  3146             id="sectio n.Contact  Informatio n"
  3147            >
  3148                                                    
  3149             <xsl:choos e>
  3150                                                         
  3151              <xsl:when 
  3152               test="n1:p articipant "
  3153              >
  3154                                                               
  3155               <table>
  3156                                                                    
  3157                <thead>
  3158                                                                          
  3159                 <tr>
  3160                                                                               
  3161                  <th 
  3162                   colspan="2 "
  3163                  >
  3164                   Contact In formation
  3165                  </th>
  3166                                                                           
  3167                 </tr>
  3168                                                                     
  3169                </thead>
  3170                                                                    
  3171                <tbody>
  3172                                                                          
  3173                 <xsl:for-e ach 
  3174                  select="n1 :participa nt"
  3175                 >
  3176                                                                               
  3177                  <xsl:call- template 
  3178                   name="part icipant" 
  3179                  />
  3180                                                                           
  3181                 </xsl:for- each>
  3182                                                                     
  3183                </tbody>
  3184                                                                
  3185               </table>
  3186                                                          
  3187              </xsl:when >
  3188                                                         
  3189              <xsl:other wise>
  3190                                                               
  3191               <xsl:text>
  3192                No data pr ovided for  this sect ion.
  3193               </xsl:text >
  3194                                                          
  3195              </xsl:othe rwise>
  3196                                                     
  3197             </xsl:choo se>
  3198                                                
  3199            </div>
  3200                                          
  3201           </div>
  3202                                     
  3203          </section>
  3204                               
  3205         </div>
  3206                          
  3207        </div>
  3208                         
  3209        <!--<xsl:c all-templa te name="r ecordTarge t"/> <p/>  <xsl:call- template
  3210                                                    name="docu mentGenera l"/> <p/>  <xsl:call- template n ame="docum entationOf "/>
  3211                                                    <p/> <xsl: call-templ ate name=" author"/>  <p/> <xsl: call-templ ate name=" componento f"/>
  3212                                                    <p/> <xsl: call-templ ate name=" participan t"/> <p/>  <xsl:call- template n ame="dataE nterer"/>
  3213                                                    <p/> <xsl: call-templ ate name=" authentica tor"/> <p/ > <xsl:cal l-template  name="inf ormant"/>
  3214                                                    <p/> <xsl: call-templ ate name=" informatio nRecipient "/> <p/> < xsl:call-t emplate
  3215                                                    name="lega lAuthentic ator"/> <p /> <xsl:ca ll-templat e name="cu stodian"/>  <p/> -->
  3216                         
  3217        <!-- END d isplay top  portion o f clinical  document  -->
  3218                         
  3219        <!-- produ ce table o f contents  <xsl:if t est="not(/ /n1:nonXML Body)"> <x sl:if
  3220                                                    test="coun t(/n1:Clin icalDocume nt/n1:comp onent/n1:s tructuredB ody/n1:com ponent[n1: section])
  3221                                                    &gt; 1"> < xsl:call-t emplate na me="make-t ableofcont ents"/> </ xsl:if> </ xsl:if>
  3222                                                    <p/> <hr a lign="left " color="t eal" size= "2" width= "80%"/> <p /> -->
  3223                         
  3224        <!-- produ ce human r eadable do cument con tent -->
  3225                     
  3226       </body>
  3227               
  3228      </html>
  3229          
  3230     </xsl:temp late>
  3231         
  3232     <!-- gener ate table  of content s -->
  3233         
  3234     <xsl:templ ate 
  3235      name="make -tableofco ntents"
  3236     >
  3237              
  3238      <xsl:varia ble 
  3239       name="comp TemplateId Roots"
  3240                              
  3241       select="n1 :component /n1:struct uredBody/n 1:componen t/n1:secti on/n1:temp lateId/@ro ot" 
  3242      />
  3243              
  3244      <xsl:varia ble 
  3245       name="sect ions"
  3246                              
  3247       select="n1 :component /n1:struct uredBody/n 1:componen t/n1:secti on" 
  3248      />
  3249     
  3250              
  3251      <!--<h2> < a name="to c">Table o f Contents </a> </h2>  <div styl e="margin- left
  3252                                : 2em; "> -->
  3253              
  3254      <!-- CCD T oC -->
  3255              
  3256      <!-- Progr ess notes  ToC -->
  3257              
  3258      <xsl:choos e>
  3259                    
  3260       <xsl:when 
  3261        test="cont ains($prog DocTemplat eRoot, $pr ogressDoc) "
  3262       >
  3263                         
  3264        <!--<li> < a href="#{ generate-i d(Demograp hics)}"> < xsl:text>D emographic s</xsl:tex t>
  3265                                                    </a> </li>  -->
  3266                         
  3267        <ul>
  3268                              
  3269         <li>
  3270                                    
  3271          <a 
  3272           data-targe t="patient -informati on" 
  3273           href="#pat ient-infor mation"
  3274          >
  3275                                         
  3276           <xsl:value -of 
  3277            select="'P atient Inf ormation'"  
  3278           />
  3279                                     
  3280          </a>
  3281                                    
  3282          <xsl:for-e ach 
  3283           select="$p rogressTem plateIdArr ayParam"
  3284          >
  3285                                         
  3286           <xsl:varia ble 
  3287            name="temp lateId"
  3288           >
  3289                                               
  3290            <xsl:value -of 
  3291             select="."  
  3292            />
  3293                                          
  3294           </xsl:vari able>
  3295          
  3296                                         
  3297           <!--<xsl:i f test="$c ompTemplat eIdRoots =  $template Id or $com pTemplateI dRoots
  3298                                                                                 = conc at($templa teId,'.1') "> -->
  3299                                         
  3300           <xsl:varia ble 
  3301            name="pos- int" 
  3302            select="po sition()" 
  3303           />
  3304                                         
  3305           <!--<xsl:v alue-of se lect="$pos -int" /> - ->
  3306                                         
  3307           <xsl:varia ble 
  3308            name="head erValue"
  3309           >
  3310                                               
  3311            <xsl:value -of 
  3312             select="$p rogSection HeaderPara m[$pos-int ]" 
  3313            />
  3314                                          
  3315           </xsl:vari able>
  3316                                         
  3317           <xsl:varia ble 
  3318            name="head erTxt"
  3319           >
  3320                                               
  3321            <xsl:value -of
  3322                                                       
  3323             select="$s ections[n1 :templateI d[@root =  $templateI d or @root  = concat( $templateI d,'.1')]]/ n1:text" 
  3324            />
  3325                                          
  3326           </xsl:vari able>
  3327          
  3328                                         
  3329           <xsl:choos e>
  3330                                               
  3331            <xsl:when 
  3332             test="cont ains($head erTxt, 'No  Informati on')"
  3333            >
  3334                                                    
  3335             <a 
  3336              data-targe t="{$heade rValue}" 
  3337              href="#{$h eaderValue }" 
  3338              class="dis abled"
  3339             >
  3340                                                         
  3341              <xsl:value -of 
  3342               select="$h eaderValue
  3343              />
  3344                                                     
  3345             </a>
  3346                                                
  3347            </xsl:when >
  3348                                               
  3349            <xsl:when 
  3350             test="stri ng-length( $headerTxt ) &gt; 0"
  3351            >
  3352                                                    
  3353             <a 
  3354              data-targe t="{$heade rValue}" 
  3355              href="#{$h eaderValue }"
  3356             >
  3357                                                         
  3358              <xsl:value -of 
  3359               select="$h eaderValue
  3360              />
  3361                                                     
  3362             </a>
  3363                                                
  3364            </xsl:when >
  3365                                               
  3366            <xsl:other wise>
  3367                                                    
  3368             <a 
  3369              data-targe t="{$heade rValue}" 
  3370              href="#{$h eaderValue }" 
  3371              class="dis abled"
  3372             >
  3373                                                         
  3374              <xsl:value -of 
  3375               select="$h eaderValue
  3376              />
  3377                                                     
  3378             </a>
  3379                                                
  3380            </xsl:othe rwise>
  3381           
  3382                                          
  3383           </xsl:choo se>
  3384                                         
  3385           <!--</xsl: if> -->
  3386                                     
  3387          </xsl:for- each>
  3388                                    
  3389          <xsl:choos e>
  3390                                         
  3391           <xsl:when 
  3392            test="n1:d ocumentati onOf/n1:se rviceEvent /n1:perfor mer"
  3393           >
  3394                                               
  3395            <a 
  3396             data-targe t="healthc are-provid ers" 
  3397             href="#hea lthcare-pr oviders"
  3398            >
  3399                                                    
  3400             <xsl:value -of 
  3401              select="'H ealthcare  Providers'
  3402             />
  3403                                                
  3404            </a>
  3405                                          
  3406           </xsl:when >
  3407                                         
  3408           <xsl:other wise>
  3409                                               
  3410            <a 
  3411             data-targe t="healthc are-provid ers" 
  3412             href="#hea lthcare-pr oviders"
  3413                                                  
  3414             class="dis abled"
  3415            >
  3416                                                    
  3417             <xsl:value -of 
  3418              select="'H ealthcare  Providers'
  3419             />
  3420                                                
  3421            </a>
  3422                                          
  3423           </xsl:othe rwise>
  3424                                     
  3425          </xsl:choo se>
  3426                                    
  3427          <a 
  3428           data-targe t="contact -info" 
  3429           href="#con tact-info"
  3430          >
  3431                                         
  3432           <xsl:value -of 
  3433            select="'C ontact Inf ormation'"  
  3434           />
  3435                                     
  3436          </a>
  3437                               
  3438         </li>
  3439                          
  3440        </ul>
  3441                     
  3442       </xsl:when >
  3443                    
  3444       <xsl:when 
  3445        test="cont ains($ccdD ocTemplate Root, $ccd aDoc)"
  3446       >
  3447                         
  3448        <!-- <li>  <a href="# {generate- id(Demogra phics)}">  <xsl:text> Demographi cs</xsl:te xt>
  3449                                                    </a> </li>  -->
  3450                         
  3451        <ul>
  3452                              
  3453         <li>
  3454                                    
  3455          <a 
  3456           data-targe t="patient -informati on" 
  3457           href="#pat ient-infor mation"
  3458          >
  3459                                         
  3460           <xsl:value -of 
  3461            select="'P atient Inf ormation'"  
  3462           />
  3463                                     
  3464          </a>
  3465         
  3466                                    
  3467          <xsl:for-e ach 
  3468           select="$c cdTemplate IdArrayPar am"
  3469          >
  3470                                         
  3471           <xsl:varia ble 
  3472            name="temp lateId"
  3473           >
  3474                                               
  3475            <xsl:value -of 
  3476             select="."  
  3477            />
  3478                                          
  3479           </xsl:vari able>
  3480          
  3481                                         
  3482           <!--<xsl:i f test="$c ompTemplat eIdRoots =  $template Id or $com pTemplateI dRoots
  3483                                                                                 = conc at($templa teId,'.1') "> -->
  3484                                         
  3485           <xsl:varia ble 
  3486            name="pos- int" 
  3487            select="po sition()" 
  3488           />
  3489                                         
  3490           <!--<xsl:v alue-of se lect="$pos -int" /> - ->
  3491                                         
  3492           <xsl:varia ble 
  3493            name="head erValue"
  3494           >
  3495                                               
  3496            <xsl:value -of 
  3497             select="$c cdSectionH eaderParam [$pos-int]
  3498            />
  3499                                          
  3500           </xsl:vari able>
  3501                                         
  3502           <xsl:varia ble 
  3503            name="head erTxt"
  3504           >
  3505                                               
  3506            <xsl:value -of
  3507                                                       
  3508             select="$s ections[n1 :templateI d[@root =  $templateI d or @root  = concat( $templateI d,'.1')]]/ n1:text" 
  3509            />
  3510                                          
  3511           </xsl:vari able>
  3512          
  3513                                         
  3514           <xsl:choos e>
  3515                                               
  3516            <xsl:when 
  3517             test="cont ains($head erTxt, 'No  Informati on') or co ntains($he aderTxt, ' No data')"
  3518            >
  3519                                                    
  3520             <a 
  3521              data-targe t="{$heade rValue}" 
  3522              href="#{$h eaderValue }" 
  3523              class="dis abled"
  3524             >
  3525                                                         
  3526              <xsl:value -of 
  3527               select="$h eaderValue
  3528              />
  3529                                                     
  3530             </a>
  3531                                                
  3532            </xsl:when >
  3533                                               
  3534            <xsl:when 
  3535             test="stri ng-length( $headerTxt ) &gt; 0"
  3536            >
  3537                                                    
  3538             <a 
  3539              data-targe t="{$heade rValue}" 
  3540              href="#{$h eaderValue }"
  3541             >
  3542                                                         
  3543              <xsl:value -of 
  3544               select="$h eaderValue
  3545              />
  3546                                                     
  3547             </a>
  3548                                                
  3549            </xsl:when >
  3550                                               
  3551            <xsl:other wise>
  3552                                                    
  3553             <a 
  3554              data-targe t="{$heade rValue}" 
  3555              href="#{$h eaderValue }" 
  3556              class="dis abled"
  3557             >
  3558                                                         
  3559              <xsl:value -of 
  3560               select="$h eaderValue
  3561              />
  3562                                                     
  3563             </a>
  3564                                                
  3565            </xsl:othe rwise>
  3566           
  3567                                          
  3568           </xsl:choo se>
  3569                                         
  3570           <!--</xsl: if> -->
  3571                                     
  3572          </xsl:for- each>
  3573                                    
  3574          <xsl:choos e>
  3575                                         
  3576           <xsl:when 
  3577            test="n1:d ocumentati onOf/n1:se rviceEvent /n1:perfor mer"
  3578           >
  3579                                               
  3580            <a 
  3581             data-targe t="healthc are-provid ers" 
  3582             href="#hea lthcare-pr oviders"
  3583            >
  3584                                                    
  3585             <xsl:value -of 
  3586              select="'H ealthcare  Providers'
  3587             />
  3588                                                
  3589            </a>
  3590                                          
  3591           </xsl:when >
  3592                                         
  3593           <xsl:other wise>
  3594                                               
  3595            <a 
  3596             data-targe t="healthc are-provid ers" 
  3597             href="#hea lthcare-pr oviders"
  3598                                                  
  3599             class="dis abled"
  3600            >
  3601                                                    
  3602             <xsl:value -of 
  3603              select="'H ealthcare  Providers'
  3604             />
  3605                                                
  3606            </a>
  3607                                          
  3608           </xsl:othe rwise>
  3609                                     
  3610          </xsl:choo se>
  3611                                    
  3612          <a 
  3613           data-targe t="contact -info" 
  3614           href="#con tact-info"
  3615          >
  3616                                         
  3617           <xsl:value -of 
  3618            select="'C ontact Inf ormation'"  
  3619           />
  3620                                     
  3621          </a>
  3622                               
  3623         </li>
  3624                          
  3625        </ul>
  3626                     
  3627       </xsl:when >
  3628               
  3629      </xsl:choo se>
  3630          
  3631     </xsl:temp late>
  3632    
  3633         
  3634     <!-- DYNAM IC VERSION  generate  table of c ontents -- >
  3635         
  3636     <xsl:templ ate 
  3637      name="make -tableofco ntents-dyn amic"
  3638     >
  3639              
  3640      <xsl:varia ble 
  3641       name="comp TemplateId Roots"
  3642                              
  3643       select="n1 :component /n1:struct uredBody/n 1:componen t/n1:secti on/n1:temp lateId/@ro ot" 
  3644      />
  3645              
  3646      <!--
  3647                       <xsl :variable  name="sect ions"
  3648                                select ="n1:compo nent/n1:st ructuredBo dy/n1:comp onent/n1:s ection" />
  3649                       -->
  3650              
  3651      <xsl:varia ble 
  3652       name="comp onents"
  3653                              
  3654       select="n1 :component /n1:struct uredBody/n 1:componen t" 
  3655      />
  3656     
  3657              
  3658      <!--<h2> < a name="to c">Table o f Contents </a> </h2>  <div styl e="margin- left
  3659                                : 2em; "> -->
  3660              
  3661      <!-- CCD T oC -->
  3662              
  3663      <!-- Progr ess notes  ToC -->
  3664              
  3665      <xsl:choos e>
  3666                    
  3667       <xsl:when 
  3668        test="cont ains($prog DocTemplat eRoot, $pr ogressDoc) "
  3669       >
  3670                         
  3671        <!--<li> < a href="#{ generate-i d(Demograp hics)}"> < xsl:text>D emographic s</xsl:tex t>
  3672                                                    </a> </li>  -->
  3673                         
  3674        <ul>
  3675                              
  3676         <li>
  3677                                    
  3678          <a 
  3679           data-targe t="patient -informati on" 
  3680           href="#pat ient-infor mation"
  3681          >
  3682                                         
  3683           <xsl:value -of 
  3684            select="'P atient Inf ormation'"  
  3685           />
  3686                                     
  3687          </a>
  3688                                    
  3689          <xsl:for-e ach 
  3690           select="$c omponents"
  3691          >
  3692                                         
  3693           <xsl:varia ble 
  3694            name="temp lateId"
  3695           >
  3696                                               
  3697            <xsl:choos e>
  3698                                                    
  3699             <xsl:when 
  3700              test="n1:s ection/n1: templateId [2]//@root "
  3701             >
  3702                                                         
  3703              <xsl:value -of 
  3704               select="n1 :section/n 1:template Id[2]/@roo t"
  3705              />
  3706                                                     
  3707             </xsl:when >
  3708                                                    
  3709             <xsl:other wise>
  3710                                                         
  3711              <xsl:value -of 
  3712               select="n1 :section/n 1:template Id/@root"
  3713              />
  3714                                                     
  3715             </xsl:othe rwise>
  3716                                                
  3717            </xsl:choo se>
  3718                                          
  3719           </xsl:vari able>
  3720                                         
  3721           <xsl:varia ble 
  3722            name="entr yCount"
  3723           >
  3724                                               
  3725            <xsl:value -of 
  3726             select="co unt(n1:ent ry)"
  3727            />
  3728                                          
  3729           </xsl:vari able>
  3730          
  3731                                         
  3732           <xsl:varia ble 
  3733            name="loin cCode"
  3734           >
  3735            <xsl:value -of 
  3736             select="n1 :section/n 1:code/@co de"
  3737            />
  3738           </xsl:vari able>
  3739                                         
  3740           <xsl:varia ble 
  3741            name="head erValue"
  3742           >
  3743                                               
  3744            <xsl:call- template 
  3745             name="getS ectionHead erText"
  3746            >
  3747                                                    
  3748             <xsl:with- param 
  3749              name="loin cCode" 
  3750              select="$l oincCode"
  3751             />
  3752                                                
  3753            </xsl:call -template>
  3754                                          
  3755           </xsl:vari able>
  3756                                         
  3757           <xsl:varia ble 
  3758            name="head erTxt"
  3759           >
  3760                                               
  3761            <xsl:value -of
  3762                                                       
  3763             select="n1 :section/n 1:text" 
  3764            />
  3765                                          
  3766           </xsl:vari able>
  3767          
  3768                                         
  3769           <!-- Decid e to displ ay and/or  disable bu ttons -->
  3770                                         
  3771           <xsl:if 
  3772            test="stri ng-length( $templateI d) &gt; 0"
  3773           >
  3774                                               
  3775            <xsl:if 
  3776             test="stri ng-length( $headerVal ue) &gt; 0 "
  3777            >
  3778                                                    
  3779             <xsl:choos e>
  3780                                                         
  3781              <xsl:when 
  3782               test="n1:s ection/n1: text/n1:li st/n1:item "
  3783              >
  3784                                                               
  3785               <a 
  3786                data-targe t="{$heade rValue}" 
  3787                href="#{$h eaderValue }"
  3788               >
  3789                                                                    
  3790                <xsl:value -of 
  3791                 select="$h eaderValue
  3792                />
  3793                                                                
  3794               </a>
  3795                                                          
  3796              </xsl:when >
  3797                                                         
  3798              <xsl:when 
  3799               test="cont ains($head erTxt, 'No  Data')"
  3800              >
  3801                                                               
  3802               <a 
  3803                data-targe t="{$heade rValue}" 
  3804                href="#{$h eaderValue }" 
  3805                class="dis abled"
  3806               >
  3807                                                                    
  3808                <xsl:value -of 
  3809                 select="$h eaderValue
  3810                />
  3811                                                                
  3812               </a>
  3813                                                          
  3814              </xsl:when >
  3815                                                         
  3816              <xsl:when 
  3817               test="n1:s ection/@nu llFlavor"
  3818              >
  3819                                                               
  3820               <a 
  3821                data-targe t="{$heade rValue}" 
  3822                href="#{$h eaderValue }" 
  3823                class="dis abled"
  3824               >
  3825                                                                    
  3826                <xsl:value -of 
  3827                 select="$h eaderValue
  3828                />
  3829                                                                
  3830               </a>
  3831                                                          
  3832              </xsl:when >
  3833                                                         
  3834              <xsl:when 
  3835               test="$ent ryCount &g t; 0"
  3836              >
  3837                                                               
  3838               <a 
  3839                data-targe t="{$heade rValue}" 
  3840                href="#{$h eaderValue }" 
  3841                class="dis abled"
  3842               >
  3843                                                                    
  3844                <xsl:value -of 
  3845                 select="$h eaderValue
  3846                />
  3847                                                                
  3848               </a>
  3849                                                          
  3850              </xsl:when >
  3851                                                         
  3852              <xsl:other wise>
  3853                                                               
  3854               <a 
  3855                data-targe t="{$heade rValue}" 
  3856                href="#{$h eaderValue }"
  3857               >
  3858                                                                    
  3859                <xsl:value -of 
  3860                 select="$h eaderValue
  3861                />
  3862                                                                
  3863               </a>
  3864                                                          
  3865              </xsl:othe rwise>
  3866                                                     
  3867             </xsl:choo se>
  3868                                                
  3869            </xsl:if>
  3870                                          
  3871           </xsl:if>
  3872          
  3873                                     
  3874          </xsl:for- each>
  3875                                    
  3876          <xsl:choos e>
  3877                                         
  3878           <xsl:when 
  3879            test="n1:d ocumentati onOf/n1:se rviceEvent /n1:perfor mer/@id =  'PCP' or n 1:document ationOf/n1 :serviceEv ent/n1:per former/n1: functionCo de/@code =  'PCP'"
  3880           >
  3881                                               
  3882            <a 
  3883             data-targe t="Healthc are Provid ers" 
  3884             href="#Hea lthcare Pr oviders"
  3885            >
  3886                                                    
  3887             <xsl:value -of 
  3888              select="'H ealthcare  Providers'
  3889             />
  3890                                                
  3891            </a>
  3892                                          
  3893           </xsl:when >
  3894                                         
  3895           <xsl:other wise>
  3896                                               
  3897            <a 
  3898             data-targe t="Healthc are Provid ers" 
  3899             href="#Hea lthcare Pr oviders"
  3900                                                  
  3901             class="dis abled"
  3902            >
  3903                                                    
  3904             <xsl:value -of 
  3905              select="'H ealthcare  Providers'
  3906             />
  3907                                                
  3908            </a>
  3909                                          
  3910           </xsl:othe rwise>
  3911                                     
  3912          </xsl:choo se>
  3913                                    
  3914          <xsl:choos e>
  3915                                         
  3916           <xsl:when 
  3917            test="n1:p articipant "
  3918           >
  3919                                               
  3920            <a 
  3921             data-targe t="Contact  Informati on" 
  3922             href="#Con tact Infor mation"
  3923            >
  3924                                                    
  3925             <xsl:value -of 
  3926              select="'C ontact Inf ormation'"  
  3927             />
  3928                                                
  3929            </a>
  3930                                          
  3931           </xsl:when >
  3932                                         
  3933           <xsl:other wise>
  3934                                               
  3935            <a 
  3936             data-targe t="Contact  Informati on" 
  3937             href="#Con tact Infor mation" 
  3938             class="dis abled"
  3939            >
  3940                                                    
  3941             <xsl:value -of 
  3942              select="'C ontact Inf ormation'"  
  3943             />
  3944                                                
  3945            </a>
  3946                                          
  3947           </xsl:othe rwise>
  3948                                     
  3949          </xsl:choo se>
  3950                               
  3951         </li>
  3952                          
  3953        </ul>
  3954                     
  3955       </xsl:when >
  3956                    
  3957       <xsl:when 
  3958        test="cont ains($ccdD ocTemplate Root, $ccd aDoc)"
  3959       >
  3960                         
  3961        <ul>
  3962                              
  3963         <li>
  3964                                    
  3965          <a 
  3966           data-targe t="patient -informati on" 
  3967           href="#pat ient-infor mation"
  3968          >
  3969                                         
  3970           <xsl:value -of 
  3971            select="'P atient Inf ormation'"  
  3972           />
  3973                                     
  3974          </a>
  3975         
  3976                                    
  3977          <xsl:for-e ach 
  3978           select="$c omponents"
  3979          >
  3980                                         
  3981           <xsl:varia ble 
  3982            name="temp lateId"
  3983           >
  3984                                               
  3985            <xsl:choos e>
  3986                                                    
  3987             <xsl:when 
  3988              test="n1:s ection/n1: templateId [2]"
  3989             >
  3990                                                         
  3991              <xsl:value -of 
  3992               select="n1 :section/n 1:template Id[2]/@roo t"
  3993              />
  3994                                                     
  3995             </xsl:when >
  3996                                                    
  3997             <xsl:other wise>
  3998                                                         
  3999              <xsl:value -of 
  4000               select="n1 :section/n 1:template Id/@root"
  4001              />
  4002                                                     
  4003             </xsl:othe rwise>
  4004                                                
  4005            </xsl:choo se>
  4006                                          
  4007           </xsl:vari able>
  4008                                         
  4009           <xsl:varia ble 
  4010            name="entr yCount"
  4011           >
  4012                                               
  4013            <xsl:value -of 
  4014             select="co unt(n1:ent ry)"
  4015            />
  4016                                          
  4017           </xsl:vari able>
  4018                                         
  4019           <xsl:varia ble 
  4020            name="loin cCode"
  4021           >
  4022            <xsl:value -of 
  4023             select="n1 :section/n 1:code/@co de"
  4024            />
  4025           </xsl:vari able>
  4026                                         
  4027           <xsl:varia ble 
  4028            name="head erValue"
  4029           >
  4030                                               
  4031            <xsl:call- template 
  4032             name="getS ectionHead erText"
  4033            >
  4034                                                    
  4035             <xsl:with- param 
  4036              name="loin cCode" 
  4037              select="$l oincCode"
  4038             />
  4039                                                
  4040            </xsl:call -template>
  4041                                          
  4042           </xsl:vari able>
  4043                                         
  4044           <xsl:varia ble 
  4045            name="head erTxt"
  4046           >
  4047                                               
  4048            <xsl:value -of
  4049                                                       
  4050             select="n1 :section/n 1:text" 
  4051            />
  4052                                          
  4053           </xsl:vari able>
  4054          
  4055                                         
  4056           <!-- Decid e to displ ay and/or  disable bu ttons -->
  4057                                         
  4058           <xsl:if 
  4059            test="stri ng-length( $templateI d) &gt; 0"
  4060           >
  4061                                               
  4062            <xsl:if 
  4063             test="stri ng-length( $headerVal ue) &gt; 0 "
  4064            >
  4065                                                    
  4066             <xsl:choos e>
  4067                                                         
  4068              <xsl:when 
  4069               test="$ent ryCount &g t; 0"
  4070              >
  4071                                                               
  4072               <a 
  4073                data-targe t="{$heade rValue}" 
  4074                href="#{$h eaderValue }" 
  4075                class="dis abled"
  4076               >
  4077                                                                    
  4078                <xsl:value -of 
  4079                 select="$h eaderValue
  4080                />
  4081                                                                
  4082               </a>
  4083                                                          
  4084              </xsl:when >
  4085                                                         
  4086              <xsl:when 
  4087               test="cont ains($head erTxt, 'No  Data')"
  4088              >
  4089                                                               
  4090               <a 
  4091                data-targe t="{$heade rValue}" 
  4092                href="#{$h eaderValue }" 
  4093                class="dis abled"
  4094               >
  4095                                                                    
  4096                <xsl:value -of 
  4097                 select="$h eaderValue
  4098                />
  4099                                                                
  4100               </a>
  4101                                                          
  4102              </xsl:when >
  4103                                                         
  4104              <xsl:when 
  4105               test="n1:s ection/@nu llFlavor"
  4106              >
  4107                                                               
  4108               <a 
  4109                data-targe t="{$heade rValue}" 
  4110                href="#{$h eaderValue }" 
  4111                class="dis abled"
  4112               >
  4113                                                                    
  4114                <xsl:value -of 
  4115                 select="$h eaderValue
  4116                />
  4117                                                                
  4118               </a>
  4119                                                          
  4120              </xsl:when >
  4121                                                         
  4122              <xsl:other wise>
  4123                                                               
  4124               <a 
  4125                data-targe t="{$heade rValue}" 
  4126                href="#{$h eaderValue }"
  4127               >
  4128                                                                    
  4129                <xsl:value -of 
  4130                 select="$h eaderValue
  4131                />
  4132                                                                
  4133               </a>
  4134                                                          
  4135              </xsl:othe rwise>
  4136                                                     
  4137             </xsl:choo se>
  4138                                                
  4139            </xsl:if>
  4140                                          
  4141           </xsl:if>
  4142                                     
  4143          </xsl:for- each>
  4144                                    
  4145          <xsl:choos e>
  4146                                         
  4147           <xsl:when 
  4148            test="n1:d ocumentati onOf/n1:se rviceEvent /n1:perfor mer/@id =  'PCP' or n 1:document ationOf/n1 :serviceEv ent/n1:per former/n1: functionCo de/@code =  'PCP'"
  4149           >
  4150                                               
  4151            <a 
  4152             data-targe t="Healthc are Provid ers" 
  4153             href="#Hea lthcare Pr oviders"
  4154            >
  4155                                                    
  4156             <xsl:value -of 
  4157              select="'H ealthcare  Providers'
  4158             />
  4159                                                
  4160            </a>
  4161                                          
  4162           </xsl:when >
  4163                                         
  4164           <xsl:other wise>
  4165                                               
  4166            <a 
  4167             data-targe t="Healthc are Provid ers" 
  4168             href="#Hea lthcare Pr oviders"
  4169                                                  
  4170             class="dis abled"
  4171            >
  4172                                                    
  4173             <xsl:value -of 
  4174              select="'H ealthcare  Providers'
  4175             />
  4176                                                
  4177            </a>
  4178                                          
  4179           </xsl:othe rwise>
  4180                                     
  4181          </xsl:choo se>
  4182                                    
  4183          <xsl:choos e>
  4184                                         
  4185           <xsl:when 
  4186            test="n1:p articipant "
  4187           >
  4188                                               
  4189            <a 
  4190             data-targe t="Contact  Informati on" 
  4191             href="#Con tact Infor mation"
  4192            >
  4193                                                    
  4194             <xsl:value -of 
  4195              select="'C ontact Inf ormation'"  
  4196             />
  4197                                                
  4198            </a>
  4199                                          
  4200           </xsl:when >
  4201                                         
  4202           <xsl:other wise>
  4203                                               
  4204            <a 
  4205             data-targe t="Contact  Informati on" 
  4206             href="#Con tact Infor mation" 
  4207             class="dis abled"
  4208            >
  4209                                                    
  4210             <xsl:value -of 
  4211              select="'C ontact Inf ormation'"  
  4212             />
  4213                                                
  4214            </a>
  4215                                          
  4216           </xsl:othe rwise>
  4217                                     
  4218          </xsl:choo se>
  4219                               
  4220         </li>
  4221                          
  4222        </ul>
  4223                     
  4224       </xsl:when >
  4225               
  4226      </xsl:choo se>
  4227          
  4228     </xsl:temp late>
  4229         
  4230     <!-- heade r elements  -->
  4231         
  4232     <xsl:templ ate 
  4233      name="docu mentGenera l"
  4234     >
  4235              
  4236      <fieldset>
  4237                    
  4238       <legend>
  4239                         
  4240        <b>
  4241         Document I nformation
  4242        </b>
  4243                     
  4244       </legend>
  4245                    
  4246       <table>
  4247                         
  4248        <tbody>
  4249                              
  4250         <tr>
  4251                                    
  4252          <td>
  4253                                         
  4254           <label>
  4255                                               
  4256            <b>
  4257             Document I d: 
  4258            </b>
  4259                                          
  4260           </label>
  4261                                     
  4262          </td>
  4263                                    
  4264          <td>
  4265                                         
  4266           <xsl:call- template 
  4267            name="show -id"
  4268           >
  4269                                               
  4270            <xsl:with- param 
  4271             name="id" 
  4272             select="n1 :id" 
  4273            />
  4274                                          
  4275           </xsl:call -template>
  4276                                     
  4277          </td>
  4278                               
  4279         </tr>
  4280                              
  4281         <tr>
  4282                                    
  4283          <td>
  4284                                         
  4285           <label>
  4286                                               
  4287            <b>
  4288             Document C reated: 
  4289            </b>
  4290                                          
  4291           </label>
  4292                                     
  4293          </td>
  4294                                    
  4295          <td>
  4296                                         
  4297           <xsl:call- template 
  4298            name="show -time"
  4299           >
  4300                                               
  4301            <xsl:with- param 
  4302             name="date time" 
  4303             select="n1 :effective Time" 
  4304            />
  4305                                          
  4306           </xsl:call -template>
  4307                                     
  4308          </td>
  4309                               
  4310         </tr>
  4311                          
  4312        </tbody>
  4313                     
  4314       </table>
  4315               
  4316      </fieldset >
  4317          
  4318     </xsl:temp late>
  4319         
  4320     <!-- confi dentiality  -->
  4321         
  4322     <xsl:templ ate 
  4323      name="conf identialit y"
  4324     >
  4325              
  4326      <table 
  4327       class="hea der_table"
  4328      >
  4329                    
  4330       <tbody>
  4331                         
  4332        <td 
  4333         width="20%
  4334         bgcolor="# 3399ff"
  4335        >
  4336                              
  4337         <xsl:text>
  4338          Confidenti ality
  4339         </xsl:text >
  4340                          
  4341        </td>
  4342                         
  4343        <td 
  4344         width="80% "
  4345        >
  4346                              
  4347         <xsl:choos e>
  4348                                    
  4349          <xsl:when 
  4350           test="n1:c onfidentia lityCode/@ code  = &a pos;N&apos ;"
  4351          >
  4352                                         
  4353           <xsl:text>
  4354            Normal
  4355           </xsl:text >
  4356                                     
  4357          </xsl:when >
  4358                                    
  4359          <xsl:when 
  4360           test="n1:c onfidentia lityCode/@ code  = &a pos;R&apos ;"
  4361          >
  4362                                         
  4363           <xsl:text>
  4364            Restricted
  4365           </xsl:text >
  4366                                     
  4367          </xsl:when >
  4368                                    
  4369          <xsl:when 
  4370           test="n1:c onfidentia lityCode/@ code  = &a pos;V&apos ;"
  4371          >
  4372                                         
  4373           <xsl:text>
  4374            Very restr icted
  4375           </xsl:text >
  4376                                     
  4377          </xsl:when >
  4378                               
  4379         </xsl:choo se>
  4380                              
  4381         <xsl:if 
  4382          test="n1:c onfidentia lityCode/n 1:original Text"
  4383         >
  4384                                    
  4385          <xsl:text>
  4386            
  4387          </xsl:text >
  4388                                    
  4389          <xsl:value -of 
  4390           select="n1 :confident ialityCode /n1:origin alText" 
  4391          />
  4392                               
  4393         </xsl:if>
  4394                          
  4395        </td>
  4396                     
  4397       </tbody>
  4398               
  4399      </table>
  4400          
  4401     </xsl:temp late>
  4402         
  4403     <!-- autho r -->
  4404         
  4405     <xsl:templ ate 
  4406      name="auth or"
  4407     >
  4408              
  4409      <xsl:if 
  4410       test="n1:a uthor"
  4411      >
  4412                    
  4413       <div 
  4414        class="col umns"
  4415       >
  4416                         
  4417        <div 
  4418         class="col -2"
  4419        >
  4420                              
  4421         <table>
  4422                                    
  4423          <thead>
  4424                                         
  4425           <tr>
  4426                                               
  4427            <th 
  4428             colspan="2 "
  4429            >
  4430             Author Inf ormation
  4431            </th>
  4432                                          
  4433           </tr>
  4434                                     
  4435          </thead>
  4436                                    
  4437          <tbody>
  4438                                         
  4439           <xsl:for-e ach 
  4440            select="n1 :author/n1 :assignedA uthor"
  4441           >
  4442                                               
  4443            <tr 
  4444             valign="to p"
  4445            >
  4446                                                    
  4447             <th>
  4448                                                          Author
  4449                                                     
  4450             </th>
  4451                                                    
  4452             <td>
  4453                                                         
  4454              <xsl:choos e>
  4455                                                               
  4456               <xsl:when 
  4457                test="n1:a ssignedPer son/n1:nam e"
  4458               >
  4459                                                                    
  4460                <xsl:call- template 
  4461                 name="show -name"
  4462                >
  4463                                                                          
  4464                 <xsl:with- param 
  4465                  name="name "
  4466                                                                                           
  4467                  select="n1 :assignedP erson/n1:n ame" 
  4468                 />
  4469                                                                     
  4470                </xsl:call -template>
  4471                                                                    
  4472                <!--<xsl:i f test="n1 :represent edOrganiza tion"> <xs l:text>, < /xsl:text>
  4473                                                                                                                                  <xsl:c all-templa te name="s how-name">  <xsl:with -param nam e="name" s elect="n1: represente dOrganizat ion/n1:nam e"/>
  4474                                                                                                                                  </xsl: call-templ ate> </xsl :if> -->
  4475                                                                
  4476               </xsl:when >
  4477                                                               
  4478               <xsl:when 
  4479                test="n1:a ssignedAut horingDevi ce/n1:soft wareName"
  4480               >
  4481                                                                    
  4482                <xsl:value -of 
  4483                 select="n1 :assignedA uthoringDe vice/n1:so ftwareName
  4484                />
  4485                                                                
  4486               </xsl:when >
  4487                                                               
  4488               <xsl:when 
  4489                test="n1:r epresented Organizati on"
  4490               >
  4491                                                                    
  4492                <xsl:call- template 
  4493                 name="show -name"
  4494                >
  4495                                                                          
  4496                 <xsl:with- param 
  4497                  name="name "
  4498                                                                                           
  4499                  select="n1 :represent edOrganiza tion/n1:na me" 
  4500                 />
  4501                                                                     
  4502                </xsl:call -template>
  4503                                                                
  4504               </xsl:when >
  4505                                                               
  4506               <xsl:other wise>
  4507                                                                    
  4508                <xsl:for-e ach 
  4509                 select="n1 :id"
  4510                >
  4511                                                                          
  4512                 <xsl:call- template 
  4513                  name="show -id" 
  4514                 />
  4515                                                                          
  4516                 <br />
  4517                                                                     
  4518                </xsl:for- each>
  4519                                                                
  4520               </xsl:othe rwise>
  4521                                                          
  4522              </xsl:choo se>
  4523                                                     
  4524             </td>
  4525                                                
  4526            </tr>
  4527                                               
  4528            <xsl:if 
  4529             test="n1:a ddr | n1:t elecom"
  4530            >
  4531                                                    
  4532             <tr 
  4533              valign="to p"
  4534             >
  4535                                                         
  4536              <th>
  4537                                                               Contac t info
  4538                                                          
  4539              </th>
  4540                                                         
  4541              <td>
  4542                                                               
  4543               <xsl:call- template 
  4544                name="show -contactIn fo"
  4545               >
  4546                                                                    
  4547                <xsl:with- param 
  4548                 name="cont act" 
  4549                 select="."  
  4550                />
  4551                                                                
  4552               </xsl:call -template>
  4553                                                          
  4554              </td>
  4555                                                     
  4556             </tr>
  4557                                                
  4558            </xsl:if>
  4559                                          
  4560           </xsl:for- each>
  4561                                     
  4562          </tbody>
  4563                               
  4564         </table>
  4565                          
  4566        </div>
  4567                     
  4568       </div>
  4569               
  4570      </xsl:if>
  4571          
  4572     </xsl:temp late>
  4573         
  4574     <!-- authe nticator - ->
  4575         
  4576     <xsl:templ ate 
  4577      name="auth enticator"
  4578     >
  4579              
  4580      <xsl:if 
  4581       test="n1:a uthenticat or"
  4582      >
  4583                    
  4584       <fieldset>
  4585                         
  4586        <legend>
  4587                              
  4588         <b>
  4589          Authentica tor Inform ation
  4590         </b>
  4591                          
  4592        </legend>
  4593                         
  4594        <table>
  4595                              
  4596         <tbody>
  4597                                    
  4598          <xsl:for-e ach 
  4599           select="n1 :authentic ator"
  4600          >
  4601                                         
  4602           <tr>
  4603                                               
  4604            <td>
  4605                                                    
  4606             <label>
  4607                                                         
  4608              <b>
  4609               Signed: 
  4610              </b>
  4611                                                     
  4612             </label>
  4613                                                
  4614            </td>
  4615                                               
  4616            <td>
  4617                                                    
  4618             <xsl:call- template 
  4619              name="show -name"
  4620             >
  4621                                                         
  4622              <xsl:with- param 
  4623               name="name "
  4624                                                                           
  4625               select="n1 :assignedE ntity/n1:a ssignedPer son/n1:nam e" 
  4626              />
  4627                                                     
  4628             </xsl:call -template>
  4629                                                    
  4630             <xsl:text>
  4631               at 
  4632             </xsl:text >
  4633                                                    
  4634             <xsl:call- template 
  4635              name="show -time"
  4636             >
  4637                                                         
  4638              <xsl:with- param 
  4639               name="date
  4640               select="n1 :time" 
  4641              />
  4642                                                     
  4643             </xsl:call -template>
  4644                                                
  4645            </td>
  4646                                          
  4647           </tr>
  4648                                         
  4649           <xsl:if
  4650                                                  
  4651            test="n1:a ssignedEnt ity/n1:add r | n1:ass ignedEntit y/n1:telec om"
  4652           >
  4653                                               
  4654            <tr>
  4655                                                    
  4656             <td>
  4657                                                         
  4658              <label>
  4659                                                               
  4660               <b>
  4661                Contact in fo: 
  4662               </b>
  4663                                                          
  4664              </label>
  4665                                                     
  4666             </td>
  4667                                                    
  4668             <td>
  4669                                                         
  4670              <xsl:call- template 
  4671               name="show -contactIn fo"
  4672              >
  4673                                                               
  4674               <xsl:with- param 
  4675                name="cont act" 
  4676                select="n1 :assignedE ntity" 
  4677               />
  4678                                                          
  4679              </xsl:call -template>
  4680                                                     
  4681             </td>
  4682                                                
  4683            </tr>
  4684                                          
  4685           </xsl:if>
  4686                                     
  4687          </xsl:for- each>
  4688                               
  4689         </tbody>
  4690                          
  4691        </table>
  4692                     
  4693       </fieldset >
  4694               
  4695      </xsl:if>
  4696          
  4697     </xsl:temp late>
  4698    
  4699         
  4700     <!-- legal Authentica tor -->
  4701         
  4702     <xsl:templ ate 
  4703      name="lega lAuthentic ator"
  4704     >
  4705              
  4706      <xsl:if 
  4707       test="n1:l egalAuthen ticator"
  4708      >
  4709                    
  4710       <fieldset>
  4711                         
  4712        <legend>
  4713                              
  4714         <b>
  4715          Legal Auth enticator  Informatio n
  4716         </b>
  4717                          
  4718        </legend>
  4719                         
  4720        <table>
  4721                              
  4722         <tbody>
  4723                                    
  4724          <tr>
  4725                                         
  4726           <td>
  4727                                               
  4728            <label>
  4729                                                    
  4730             <b>
  4731              Legal auth enticator:  
  4732             </b>
  4733                                                
  4734            </label>
  4735                                          
  4736           </td>
  4737                                         
  4738           <td>
  4739                                               
  4740            <xsl:call- template 
  4741             name="show -assignedE ntity"
  4742            >
  4743                                                    
  4744             <xsl:with- param 
  4745              name="asgn Entity"
  4746                                                                      
  4747              select="n1 :legalAuth enticator/ n1:assigne dEntity" 
  4748             />
  4749                                                
  4750            </xsl:call -template>
  4751                                               
  4752            <xsl:text>
  4753              
  4754            </xsl:text >
  4755                                               
  4756            <xsl:call- template 
  4757             name="show -sig"
  4758            >
  4759                                                    
  4760             <xsl:with- param 
  4761              name="sig"
  4762                                                                      
  4763              select="n1 :legalAuth enticator/ n1:signatu reCode" 
  4764             />
  4765                                                
  4766            </xsl:call -template>
  4767                                               
  4768            <xsl:if 
  4769             test="n1:l egalAuthen ticator/n1 :time/@val ue"
  4770            >
  4771                                                    
  4772             <xsl:text>
  4773               at 
  4774             </xsl:text >
  4775                                                    
  4776             <xsl:call- template 
  4777              name="show -time"
  4778             >
  4779                                                         
  4780              <xsl:with- param 
  4781               name="date time"
  4782                                                                           
  4783               select="n1 :legalAuth enticator/ n1:time" 
  4784              />
  4785                                                     
  4786             </xsl:call -template>
  4787                                                
  4788            </xsl:if>
  4789                                          
  4790           </td>
  4791                                     
  4792          </tr>
  4793                                    
  4794          <xsl:if
  4795                                             
  4796           test="n1:l egalAuthen ticator/n1 :assignedE ntity/n1:a ddr | n1:l egalAuthen ticator/n1 :assignedE ntity/n1:t elecom"
  4797          >
  4798                                         
  4799           <tr>
  4800                                               
  4801            <td>
  4802                                                    
  4803             <label>
  4804                                                         
  4805              <b>
  4806               Contact in fo: 
  4807              </b>
  4808                                                     
  4809             </label>
  4810                                                
  4811            </td>
  4812                                               
  4813            <td>
  4814                                                    
  4815             <xsl:call- template 
  4816              name="show -contactIn fo"
  4817             >
  4818                                                         
  4819              <xsl:with- param 
  4820               name="cont act"
  4821                                                                           
  4822               select="n1 :legalAuth enticator/ n1:assigne dEntity" 
  4823              />
  4824                                                     
  4825             </xsl:call -template>
  4826                                                
  4827            </td>
  4828                                          
  4829           </tr>
  4830                                     
  4831          </xsl:if>
  4832                               
  4833         </tbody>
  4834                          
  4835        </table>
  4836                     
  4837       </fieldset >
  4838               
  4839      </xsl:if>
  4840          
  4841     </xsl:temp late>
  4842    
  4843         
  4844     <!-- dataE nterer -->
  4845         
  4846     <xsl:templ ate 
  4847      name="data Enterer"
  4848     >
  4849              
  4850      <xsl:if 
  4851       test="n1:d ataEnterer "
  4852      >
  4853                    
  4854       <fieldset>
  4855                         
  4856        <legend>
  4857                              
  4858         <b>
  4859          Data Enter er Informa tion
  4860         </b>
  4861                          
  4862        </legend>
  4863                         
  4864        <table>
  4865                              
  4866         <tbody>
  4867                                    
  4868          <tr>
  4869                                         
  4870           <td>
  4871                                               
  4872            <label>
  4873                                                    
  4874             <b>
  4875              Entered by
  4876             </b>
  4877                                                
  4878            </label>
  4879                                          
  4880           </td>
  4881                                         
  4882           <td 
  4883            width="80% "
  4884           >
  4885                                               
  4886            <xsl:call- template 
  4887             name="show -assignedE ntity"
  4888            >
  4889                                                    
  4890             <xsl:with- param 
  4891              name="asgn Entity"
  4892                                                                      
  4893              select="n1 :dataEnter er/n1:assi gnedEntity
  4894             />
  4895                                                
  4896            </xsl:call -template>
  4897                                          
  4898           </td>
  4899                                     
  4900          </tr>
  4901                                    
  4902          <xsl:if
  4903                                             
  4904           test="n1:d ataEnterer /n1:assign edEntity/n 1:addr | n 1:dataEnte rer/n1:ass ignedEntit y/n1:telec om"
  4905          >
  4906                                         
  4907           <tr>
  4908                                               
  4909            <td>
  4910                                                    
  4911             <label>
  4912                                                         
  4913              <b>
  4914               Contact in fo: 
  4915              </b>
  4916                                                     
  4917             </label>
  4918                                                
  4919            </td>
  4920                                               
  4921            <td>
  4922                                                    
  4923             <xsl:call- template 
  4924              name="show -contactIn fo"
  4925             >
  4926                                                         
  4927              <xsl:with- param 
  4928               name="cont act"
  4929                                                                           
  4930               select="n1 :dataEnter er/n1:assi gnedEntity
  4931              />
  4932                                                     
  4933             </xsl:call -template>
  4934                                                
  4935            </td>
  4936                                          
  4937           </tr>
  4938                                     
  4939          </xsl:if>
  4940                               
  4941         </tbody>
  4942                          
  4943        </table>
  4944                     
  4945       </fieldset >
  4946               
  4947      </xsl:if>
  4948          
  4949     </xsl:temp late>
  4950    
  4951         
  4952     <!-- compo nentOf -->
  4953         
  4954     <xsl:templ ate 
  4955      name="comp onentof"
  4956     >
  4957              
  4958      <xsl:if 
  4959       test="n1:c omponentOf "
  4960      >
  4961                    
  4962       <fieldset>
  4963                         
  4964        <legend>
  4965                              
  4966         <b>
  4967          Component  Informatio n
  4968         </b>
  4969                          
  4970        </legend>
  4971                         
  4972        <table>
  4973                              
  4974         <tbody>
  4975                                    
  4976          <xsl:for-e ach 
  4977           select="n1 :component Of/n1:enco mpassingEn counter"
  4978          >
  4979                                         
  4980           <xsl:if 
  4981            test="n1:i d"
  4982           >
  4983                                               
  4984            <tr>
  4985                                                    
  4986             <xsl:choos e>
  4987                                                         
  4988              <xsl:when 
  4989               test="n1:c ode"
  4990              >
  4991                                                               
  4992               <td>
  4993                                                                    
  4994                <label>
  4995                                                                          
  4996                 <b>
  4997                  Encounter  Id: 
  4998                 </b>
  4999                                                                     
  5000                </label>
  5001                                                                
  5002               </td>
  5003                                                               
  5004               <td>
  5005                                                                    
  5006                <xsl:call- template 
  5007                 name="show -id"
  5008                >
  5009                                                                          
  5010                 <xsl:with- param 
  5011                  name="id" 
  5012                  select="n1 :id" 
  5013                 />
  5014                                                                     
  5015                </xsl:call -template>
  5016                                                                
  5017               </td>
  5018                                                               
  5019               <td>
  5020                                                                    
  5021                <label>
  5022                                                                          
  5023                 <b>
  5024                  Encounter  Type: 
  5025                 </b>
  5026                                                                     
  5027                </label>
  5028                                                                
  5029               </td>
  5030                                                               
  5031               <td>
  5032                                                                    
  5033                <xsl:call- template 
  5034                 name="show -code"
  5035                >
  5036                                                                          
  5037                 <xsl:with- param 
  5038                  name="code
  5039                  select="n1 :code" 
  5040                 />
  5041                                                                     
  5042                </xsl:call -template>
  5043                                                                
  5044               </td>
  5045                                                          
  5046              </xsl:when >
  5047                                                         
  5048              <xsl:other wise>
  5049                                                               
  5050               <td>
  5051                                                                    
  5052                <label>
  5053                                                                          
  5054                 <b>
  5055                  Encounter  Id: 
  5056                 </b>
  5057                                                                     
  5058                </label>
  5059                                                                
  5060               </td>
  5061                                                               
  5062               <td>
  5063                                                                    
  5064                <xsl:call- template 
  5065                 name="show -id"
  5066                >
  5067                                                                          
  5068                 <xsl:with- param 
  5069                  name="id" 
  5070                  select="n1 :id" 
  5071                 />
  5072                                                                     
  5073                </xsl:call -template>
  5074                                                                
  5075               </td>
  5076                                                          
  5077              </xsl:othe rwise>
  5078                                                     
  5079             </xsl:choo se>
  5080                                                
  5081            </tr>
  5082                                          
  5083           </xsl:if>
  5084                                         
  5085           <tr>
  5086                                               
  5087            <td>
  5088                                                    
  5089             <label>
  5090                                                         
  5091              <b>
  5092               Encounter  Date: 
  5093              </b>
  5094                                                     
  5095             </label>
  5096                                                
  5097            </td>
  5098                                               
  5099            <td>
  5100                                                    
  5101             <xsl:if 
  5102              test="n1:e ffectiveTi me"
  5103             >
  5104                                                         
  5105              <xsl:choos e>
  5106                                                               
  5107               <xsl:when 
  5108                test="n1:e ffectiveTi me/@value"
  5109               >
  5110                                                                    
  5111                <xsl:text>
  5112                 &#160;at&# 160;
  5113                </xsl:text >
  5114                                                                    
  5115                <xsl:call- template 
  5116                 name="show -time"
  5117                >
  5118                                                                          
  5119                 <xsl:with- param 
  5120                  name="date time" 
  5121                  select="n1 :effective Time" 
  5122                 />
  5123                                                                     
  5124                </xsl:call -template>
  5125                                                                
  5126               </xsl:when >
  5127                                                               
  5128               <xsl:when 
  5129                test="n1:e ffectiveTi me/n1:low"
  5130               >
  5131                                                                    
  5132                <xsl:text>
  5133                 &#160;From &#160;
  5134                </xsl:text >
  5135                                                                    
  5136                <xsl:call- template 
  5137                 name="show -time"
  5138                >
  5139                                                                          
  5140                 <xsl:with- param 
  5141                  name="date time"
  5142                                                                                           
  5143                  select="n1 :effective Time/n1:lo w" 
  5144                 />
  5145                                                                     
  5146                </xsl:call -template>
  5147                                                                    
  5148                <xsl:if 
  5149                 test="n1:e ffectiveTi me/n1:high "
  5150                >
  5151                                                                          
  5152                 <xsl:text>
  5153                   to 
  5154                 </xsl:text >
  5155                                                                          
  5156                 <xsl:call- template 
  5157                  name="show -time"
  5158                 >
  5159                                                                               
  5160                  <xsl:with- param 
  5161                   name="date time"
  5162                                                                                                 
  5163                   select="n1 :effective Time/n1:hi gh" 
  5164                  />
  5165                                                                           
  5166                 </xsl:call -template>
  5167                                                                     
  5168                </xsl:if>
  5169                                                                
  5170               </xsl:when >
  5171                                                          
  5172              </xsl:choo se>
  5173                                                     
  5174             </xsl:if>
  5175                                                
  5176            </td>
  5177                                          
  5178           </tr>
  5179                                         
  5180           <xsl:if 
  5181            test="n1:l ocation/n1 :healthCar eFacility"
  5182           >
  5183                                               
  5184            <tr>
  5185                                                    
  5186             <td>
  5187                                                         
  5188              <label>
  5189                                                               
  5190               <b>
  5191                Encounter  Location: 
  5192               </b>
  5193                                                          
  5194              </label>
  5195                                                     
  5196             </td>
  5197                                                    
  5198             <td>
  5199                                                         
  5200              <xsl:choos e>
  5201                                                               
  5202               <xsl:when
  5203                                                                        
  5204                test="n1:l ocation/n1 :healthCar eFacility/ n1:locatio n/n1:name"
  5205               >
  5206                                                                    
  5207                <xsl:call- template 
  5208                 name="show -name"
  5209                >
  5210                                                                          
  5211                 <xsl:with- param 
  5212                  name="name "
  5213                                                                                           
  5214                  select="n1 :location/ n1:healthC areFacilit y/n1:locat ion/n1:nam e" 
  5215                 />
  5216                                                                     
  5217                </xsl:call -template>
  5218                                                                    
  5219                <xsl:for-e ach
  5220                                                                             
  5221                 select="n1 :location/ n1:healthC areFacilit y/n1:servi ceProvider Organizati on/n1:name "
  5222                >
  5223                                                                          
  5224                 <xsl:text>
  5225                   of 
  5226                 </xsl:text >
  5227                                                                          
  5228                 <xsl:call- template 
  5229                  name="show -name"
  5230                 >
  5231                                                                               
  5232                  <xsl:with- param 
  5233                   name="name "
  5234                                                                                                 
  5235                   select="n1 :location/ n1:healthC areFacilit y/n1:servi ceProvider Organizati on/n1:name
  5236                  />
  5237                                                                           
  5238                 </xsl:call -template>
  5239                                                                     
  5240                </xsl:for- each>
  5241                                                                
  5242               </xsl:when >
  5243                                                               
  5244               <xsl:when 
  5245                test="n1:l ocation/n1 :healthCar eFacility/ n1:code"
  5246               >
  5247                                                                    
  5248                <xsl:call- template 
  5249                 name="show -code"
  5250                >
  5251                                                                          
  5252                 <xsl:with- param 
  5253                  name="code "
  5254                                                                                           
  5255                  select="n1 :location/ n1:healthC areFacilit y/n1:code"  
  5256                 />
  5257                                                                     
  5258                </xsl:call -template>
  5259                                                                
  5260               </xsl:when >
  5261                                                               
  5262               <xsl:other wise>
  5263                                                                    
  5264                <xsl:if 
  5265                 test="n1:l ocation/n1 :healthCar eFacility/ n1:id"
  5266                >
  5267                                                                          
  5268                 <xsl:text>
  5269                  id: 
  5270                 </xsl:text >
  5271                                                                          
  5272                 <xsl:for-e ach 
  5273                  select="n1 :location/ n1:healthC areFacilit y/n1:id"
  5274                 >
  5275                                                                               
  5276                  <xsl:call- template 
  5277                   name="show -id"
  5278                  >
  5279                                                                                    
  5280                   <xsl:with- param 
  5281                    name="id" 
  5282                    select="."  
  5283                   />
  5284                                                                                
  5285                  </xsl:call -template>
  5286                                                                           
  5287                 </xsl:for- each>
  5288                                                                     
  5289                </xsl:if>
  5290                                                                
  5291               </xsl:othe rwise>
  5292                                                          
  5293              </xsl:choo se>
  5294                                                     
  5295             </td>
  5296                                                
  5297            </tr>
  5298                                          
  5299           </xsl:if>
  5300                                         
  5301           <xsl:if 
  5302            test="n1:r esponsible Party"
  5303           >
  5304                                               
  5305            <tr>
  5306                                                    
  5307             <td>
  5308                                                         
  5309              <label>
  5310                                                               
  5311               <b>
  5312                Responsibl e party: 
  5313               </b>
  5314                                                          
  5315              </label>
  5316                                                     
  5317             </td>
  5318                                                    
  5319             <td>
  5320                                                         
  5321              <xsl:call- template 
  5322               name="show -assignedE ntity"
  5323              >
  5324                                                               
  5325               <xsl:with- param 
  5326                name="asgn Entity"
  5327                                                                                
  5328                select="n1 :responsib leParty/n1 :assignedE ntity" 
  5329               />
  5330                                                          
  5331              </xsl:call -template>
  5332                                                     
  5333             </td>
  5334                                                
  5335            </tr>
  5336                                          
  5337           </xsl:if>
  5338                                         
  5339           <xsl:if
  5340                                                  
  5341            test="n1:r esponsible Party/n1:a ssignedEnt ity/n1:add r | n1:res ponsiblePa rty/n1:ass ignedEntit y/n1:telec om"
  5342           >
  5343                                               
  5344            <tr>
  5345                                                    
  5346             <td>
  5347                                                         
  5348              <label>
  5349                                                               
  5350               <b>
  5351                Contact in fo: 
  5352               </b>
  5353                                                          
  5354              </label>
  5355                                                     
  5356             </td>
  5357                                                    
  5358             <td>
  5359                                                         
  5360              <xsl:call- template 
  5361               name="show -contactIn fo"
  5362              >
  5363                                                               
  5364               <xsl:with- param 
  5365                name="cont act"
  5366                                                                                
  5367                select="n1 :responsib leParty/n1 :assignedE ntity" 
  5368               />
  5369                                                          
  5370              </xsl:call -template>
  5371                                                     
  5372             </td>
  5373                                                
  5374            </tr>
  5375                                          
  5376           </xsl:if>
  5377                                     
  5378          </xsl:for- each>
  5379                               
  5380         </tbody>
  5381                          
  5382        </table>
  5383                     
  5384       </fieldset >
  5385               
  5386      </xsl:if>
  5387          
  5388     </xsl:temp late>
  5389         
  5390     <!-- custo dian -->
  5391         
  5392     <xsl:templ ate 
  5393      name="cust odian"
  5394     >
  5395              
  5396      <xsl:if 
  5397       test="n1:c ustodian"
  5398      >
  5399                    
  5400       <fieldset>
  5401                         
  5402        <legend>
  5403                              
  5404         <b>
  5405          Legal Auth enticator  Informatio n
  5406         </b>
  5407                          
  5408        </legend>
  5409                         
  5410        <table>
  5411                              
  5412         <tbody>
  5413                                    
  5414          <tr>
  5415                                         
  5416           <td>
  5417                                               
  5418            <label>
  5419                                                    
  5420             <b>
  5421              Document m aintained  by: 
  5422             </b>
  5423                                                
  5424            </label>
  5425                                          
  5426           </td>
  5427                                         
  5428           <td>
  5429                                               
  5430            <xsl:choos e>
  5431                                                    
  5432             <xsl:when
  5433                                                             
  5434              test="n1:c ustodian/n 1:assigned Custodian/ n1:represe ntedCustod ianOrganiz ation/n1:n ame"
  5435             >
  5436                                                         
  5437              <xsl:call- template 
  5438               name="show -name"
  5439              >
  5440                                                               
  5441               <xsl:with- param 
  5442                name="name "
  5443                                                                                
  5444                select="n1 :custodian /n1:assign edCustodia n/n1:repre sentedCust odianOrgan ization/n1 :name" 
  5445               />
  5446                                                          
  5447              </xsl:call -template>
  5448                                                     
  5449             </xsl:when >
  5450                                                    
  5451             <xsl:other wise>
  5452                                                         
  5453              <xsl:for-e ach
  5454                                                                  
  5455               select="n1 :custodian /n1:assign edCustodia n/n1:repre sentedCust odianOrgan ization/n1 :id"
  5456              >
  5457                                                               
  5458               <xsl:call- template 
  5459                name="show -id" 
  5460               />
  5461                                                               
  5462               <xsl:if 
  5463                test="posi tion()!=la st()"
  5464               >
  5465                                                                    
  5466                <br />
  5467                                                                
  5468               </xsl:if>
  5469                                                          
  5470              </xsl:for- each>
  5471                                                     
  5472             </xsl:othe rwise>
  5473                                                
  5474            </xsl:choo se>
  5475                                          
  5476           </td>
  5477                                     
  5478          </tr>
  5479                                    
  5480          <xsl:if
  5481                                             
  5482           test="n1:c ustodian/n 1:assigned Custodian/ n1:represe ntedCustod ianOrganiz ation/n1:a ddr |              n1 :custodian /n1:assign edCustodia n/n1:repre sentedCust odianOrgan ization/n1 :telecom"
  5483          >
  5484                                         
  5485           <tr>
  5486                                               
  5487            <td>
  5488                                                    
  5489             <label>
  5490                                                         
  5491              <b>
  5492               Contact in fo: 
  5493              </b>
  5494                                                     
  5495             </label>
  5496                                                
  5497            </td>
  5498                                               
  5499            <td>
  5500                                                    
  5501             <xsl:call- template 
  5502              name="show -contactIn fo"
  5503             >
  5504                                                         
  5505              <xsl:with- param 
  5506               name="cont act"
  5507                                                                           
  5508               select="n1 :custodian /n1:assign edCustodia n/n1:repre sentedCust odianOrgan ization" 
  5509              />
  5510                                                     
  5511             </xsl:call -template>
  5512                                                
  5513            </td>
  5514                                          
  5515           </tr>
  5516                                     
  5517          </xsl:if>
  5518                               
  5519         </tbody>
  5520                          
  5521        </table>
  5522                     
  5523       </fieldset >
  5524               
  5525      </xsl:if>
  5526          
  5527     </xsl:temp late>
  5528    
  5529         
  5530     <!-- docum entationOf  -->
  5531         
  5532     <xsl:templ ate 
  5533      name="docu mentationO f"
  5534     >
  5535              
  5536      <xsl:if 
  5537       test="n1:d ocumentati onOf"
  5538      >
  5539                    
  5540       <table>
  5541                         
  5542        <thead>
  5543                              
  5544         <tr>
  5545                                    
  5546          <th>
  5547           Name
  5548          </th>
  5549                                    
  5550          <th>
  5551           Provider T ype
  5552          </th>
  5553                                    
  5554          <th>
  5555           Address
  5556          </th>
  5557                                    
  5558          <th>
  5559           Telephone  Number
  5560          </th>
  5561                                    
  5562          <th>
  5563           Facility
  5564          </th>
  5565                               
  5566         </tr>
  5567                          
  5568        </thead>
  5569                         
  5570        <tbody>
  5571                              
  5572         <xsl:for-e ach 
  5573          select="n1 :documenta tionOf"
  5574         >
  5575                                    
  5576          <xsl:if 
  5577           test="n1:s erviceEven t/@classCo de and n1: serviceEve nt/n1:code "
  5578          >
  5579                                         
  5580           <xsl:varia ble 
  5581            name="disp layName"
  5582           >
  5583                                               
  5584            <xsl:call- template 
  5585             name="show -actClassC ode"
  5586            >
  5587                                                    
  5588             <xsl:with- param 
  5589              name="clsC ode"
  5590                                                                      
  5591              select="n1 :serviceEv ent/@class Code" 
  5592             />
  5593                                                
  5594            </xsl:call -template>
  5595                                          
  5596           </xsl:vari able>
  5597                                         
  5598           <xsl:if 
  5599            test="$dis playName"
  5600           >
  5601                                               
  5602            <tr 
  5603             valign="to p"
  5604            >
  5605                                                    
  5606             <td>
  5607                                                         
  5608              <xsl:call- template 
  5609               name="show -code"
  5610              >
  5611                                                               
  5612               <xsl:with- param 
  5613                name="code
  5614                select="n1 :serviceEv ent/n1:cod e" 
  5615               />
  5616                                                          
  5617              </xsl:call -template>
  5618                                                         
  5619              <xsl:if 
  5620               test="n1:s erviceEven t/n1:effec tiveTime"
  5621              >
  5622                                                               
  5623               <xsl:choos e>
  5624                                                                    
  5625                <xsl:when 
  5626                 test="n1:s erviceEven t/n1:effec tiveTime/@ value"
  5627                >
  5628                                                                          
  5629                 <xsl:text>
  5630                  &#160;at&# 160;
  5631                 </xsl:text >
  5632                                                                          
  5633                 <xsl:call- template 
  5634                  name="show -time"
  5635                 >
  5636                                                                               
  5637                  <xsl:with- param 
  5638                   name="date time"
  5639                                                                                                 
  5640                   select="n1 :serviceEv ent/n1:eff ectiveTime
  5641                  />
  5642                                                                           
  5643                 </xsl:call -template>
  5644                                                                     
  5645                </xsl:when >
  5646                                                                    
  5647                <xsl:when 
  5648                 test="n1:s erviceEven t/n1:effec tiveTime/n 1:low"
  5649                >
  5650                                                                          
  5651                 <xsl:text>
  5652                  &#160;from &#160;
  5653                 </xsl:text >
  5654                                                                          
  5655                 <xsl:call- template 
  5656                  name="show -time"
  5657                 >
  5658                                                                               
  5659                  <xsl:with- param 
  5660                   name="date time"
  5661                                                                                                 
  5662                   select="n1 :serviceEv ent/n1:eff ectiveTime /n1:low" 
  5663                  />
  5664                                                                           
  5665                 </xsl:call -template>
  5666                                                                          
  5667                 <xsl:if 
  5668                  test="n1:s erviceEven t/n1:effec tiveTime/n 1:high"
  5669                 >
  5670                                                                               
  5671                  <xsl:text>
  5672                    to 
  5673                  </xsl:text >
  5674                                                                               
  5675                  <xsl:call- template 
  5676                   name="show -time"
  5677                  >
  5678                                                                                    
  5679                   <xsl:with- param 
  5680                    name="date time"
  5681                                                                                                      
  5682                    select="n1 :serviceEv ent/n1:eff ectiveTime /n1:high" 
  5683                   />
  5684                                                                                
  5685                  </xsl:call -template>
  5686                                                                           
  5687                 </xsl:if>
  5688                                                                     
  5689                </xsl:when >
  5690                                                                
  5691               </xsl:choo se>
  5692                                                          
  5693              </xsl:if>
  5694                                                     
  5695             </td>
  5696                                                
  5697            </tr>
  5698                                          
  5699           </xsl:if>
  5700                                     
  5701          </xsl:if>
  5702                                    
  5703          <xsl:for-e ach 
  5704           select="n1 :serviceEv ent/n1:per former"
  5705          >
  5706                                         
  5707           <xsl:if 
  5708            test="@id  = 'PCP' or  n1:functi onCode/@co de = 'PCP' "
  5709           >
  5710                                               
  5711            <xsl:varia ble 
  5712             name="disp layName"
  5713            >
  5714                                                    
  5715             <!-- DEFEC T#177018:  Display or iginalText  instead o f displayN ame -->
  5716                                                    
  5717             <xsl:if 
  5718              test="n1:f unctionCod e/n1:origi nalText"
  5719             >
  5720                                                         
  5721              <xsl:value -of 
  5722               select="n1 :functionC ode/n1:ori ginalText"  
  5723              />
  5724                                                     
  5725             </xsl:if>
  5726                                                    
  5727             <!-- <xsl: call-templ ate name=" show-parti cipationTy pe"> <xsl: with-param
  5728                                                                                                     name="ptyp e" select= "@typeCode "/> </xsl: call-templ ate> <xsl: text> </xs l:text>
  5729                                                                                                     <xsl:if te st="n1:fun ctionCode/ @code"> <x sl:call-te mplate nam e="show-pa rticipatio nFunction" >
  5730                                                                                                     <xsl:with- param name ="pFunctio n" select= "n1:functi onCode/@co de"/> </xs l:call-tem plate>
  5731                                                                                                     </xsl:if>  -->
  5732                                                
  5733            </xsl:vari able>
  5734                                               
  5735            <!-- CCM-0 28 remove  facility n ame from p rovider na me -->
  5736                                               
  5737            <xsl:varia ble 
  5738             name="prov iderName"
  5739            >
  5740                                                    
  5741             <xsl:choos e>
  5742                                                         
  5743              <xsl:when 
  5744               test="n1:a ssignedEnt ity/n1:ass ignedPerso n/n1:name"
  5745              >
  5746                                                               
  5747               <xsl:value -of 
  5748                select="n1 :assignedE ntity/n1:a ssignedPer son/n1:nam e"
  5749               />
  5750                                                          
  5751              </xsl:when >
  5752                                                         
  5753              <xsl:other wise>
  5754                                                               
  5755               <xsl:call- template 
  5756                name="show -assignedE ntity"
  5757               >
  5758                                                                    
  5759                <xsl:with- param 
  5760                 name="asgn Entity" 
  5761                 select="n1 :assignedE ntity" 
  5762                />
  5763                                                                
  5764               </xsl:call -template>
  5765                                                          
  5766              </xsl:othe rwise>
  5767                                                     
  5768             </xsl:choo se>
  5769                                                
  5770            </xsl:vari able>
  5771                                               
  5772            <tr 
  5773             valign="to p"
  5774            >
  5775                                                    
  5776             <th>
  5777                                                         
  5778              <xsl:value -of 
  5779               select="$p roviderNam e" 
  5780              />
  5781                                                     
  5782             </th>
  5783                                                    
  5784             <th>
  5785                                                         
  5786              <xsl:value -of 
  5787               select="$d isplayName
  5788              />
  5789                                                     
  5790             </th>
  5791                                                    
  5792             <th>
  5793                                                         
  5794              <xsl:if 
  5795               test="not( n1:assigne dEntity/n1 :addr/@nul lFlavor)"
  5796              >
  5797                                                               
  5798               <xsl:call- template 
  5799                name="show -address"
  5800               >
  5801                                                                    
  5802                <xsl:with- param 
  5803                 name="addr ess"
  5804                                                                                      
  5805                 select="n1 :assignedE ntity/n1:a ddr" 
  5806                />
  5807                                                                
  5808               </xsl:call -template>
  5809                                                          
  5810              </xsl:if>
  5811                                                     
  5812             </th>
  5813                                                    
  5814             <th>
  5815                                                         
  5816              <xsl:if 
  5817               test="not( n1:assigne dEntity/n1 :telecom/@ nullFlavor )"
  5818              >
  5819                                                               
  5820               <xsl:call- template 
  5821                name="show -telecom"
  5822               >
  5823                                                                    
  5824                <xsl:with- param 
  5825                 name="tele com"
  5826                                                                                      
  5827                 select="n1 :assignedE ntity/n1:t elecom" 
  5828                />
  5829                                                                
  5830               </xsl:call -template>
  5831                                                          
  5832              </xsl:if>
  5833                                                     
  5834             </th>
  5835                                                    
  5836             <th>
  5837                                                         
  5838              <xsl:if 
  5839               test="n1:a ssignedEnt ity/n1:rep resentedOr ganization "
  5840              >
  5841                                                               
  5842               <xsl:value -of 
  5843                select="n1 :assignedE ntity/n1:r epresented Organizati on/n1:name "
  5844               />
  5845                                                          
  5846              </xsl:if>
  5847                                                     
  5848             </th>
  5849                                                
  5850            </tr>
  5851                                          
  5852           </xsl:if>
  5853                                     
  5854          </xsl:for- each>
  5855                               
  5856         </xsl:for- each>
  5857                          
  5858        </tbody>
  5859                     
  5860       </table>
  5861               
  5862      </xsl:if>
  5863          
  5864     </xsl:temp late>
  5865    
  5866         
  5867     <!-- inFul fillmentOf  -->
  5868         
  5869     <xsl:templ ate 
  5870      name="inFu lfillmentO f"
  5871     >
  5872              
  5873      <xsl:if 
  5874       test="n1:i nfulfillme ntOf"
  5875      >
  5876                    
  5877       <table 
  5878        class="hea der_table"
  5879       >
  5880                         
  5881        <tbody>
  5882                              
  5883         <xsl:for-e ach 
  5884          select="n1 :inFulfill mentOf"
  5885         >
  5886                                    
  5887          <tr>
  5888                                         
  5889           <td 
  5890            width="20%
  5891            bgcolor="# 3399ff"
  5892           >
  5893                                               
  5894            <span 
  5895             class="td_ label"
  5896            >
  5897                                                    
  5898             <xsl:text>
  5899              In fulfill ment of
  5900             </xsl:text >
  5901                                                
  5902            </span>
  5903                                          
  5904           </td>
  5905                                         
  5906           <td 
  5907            width="80% "
  5908           >
  5909                                               
  5910            <xsl:for-e ach 
  5911             select="n1 :order"
  5912            >
  5913                                                    
  5914             <xsl:for-e ach 
  5915              select="n1 :id"
  5916             >
  5917                                                         
  5918              <xsl:call- template 
  5919               name="show -id" 
  5920              />
  5921                                                     
  5922             </xsl:for- each>
  5923                                                    
  5924             <xsl:for-e ach 
  5925              select="n1 :code"
  5926             >
  5927                                                         
  5928              <xsl:text>
  5929               &#160;
  5930              </xsl:text >
  5931                                                         
  5932              <xsl:call- template 
  5933               name="show -code"
  5934              >
  5935                                                               
  5936               <xsl:with- param 
  5937                name="code
  5938                select="."  
  5939               />
  5940                                                          
  5941              </xsl:call -template>
  5942                                                     
  5943             </xsl:for- each>
  5944                                                    
  5945             <xsl:for-e ach 
  5946              select="n1 :priorityC ode"
  5947             >
  5948                                                         
  5949              <xsl:text>
  5950               &#160;
  5951              </xsl:text >
  5952                                                         
  5953              <xsl:call- template 
  5954               name="show -code"
  5955              >
  5956                                                               
  5957               <xsl:with- param 
  5958                name="code
  5959                select="."  
  5960               />
  5961                                                          
  5962              </xsl:call -template>
  5963                                                     
  5964             </xsl:for- each>
  5965                                                
  5966            </xsl:for- each>
  5967                                          
  5968           </td>
  5969                                     
  5970          </tr>
  5971                               
  5972         </xsl:for- each>
  5973                          
  5974        </tbody>
  5975                     
  5976       </table>
  5977               
  5978      </xsl:if>
  5979          
  5980     </xsl:temp late>
  5981         
  5982     <!-- infor mant -->
  5983         
  5984     <xsl:templ ate 
  5985      name="info rmant"
  5986     >
  5987              
  5988      <xsl:if 
  5989       test="n1:i nformant"
  5990      >
  5991                    
  5992       <fieldset>
  5993                         
  5994        <legend>
  5995                              
  5996         <b>
  5997          Informant  Informatio n
  5998         </b>
  5999                          
  6000        </legend>
  6001                         
  6002        <table>
  6003                              
  6004         <tbody>
  6005                                    
  6006          <xsl:for-e ach 
  6007           select="n1 :informant "
  6008          >
  6009                                         
  6010           <tr>
  6011                                               
  6012            <td>
  6013                                                    
  6014             <label>
  6015                                                         
  6016              <b>
  6017               Informant:  
  6018              </b>
  6019                                                     
  6020             </label>
  6021                                                
  6022            </td>
  6023                                               
  6024            <td>
  6025                                                    
  6026             <xsl:if 
  6027              test="n1:a ssignedEnt ity"
  6028             >
  6029                                                         
  6030              <xsl:call- template 
  6031               name="show -assignedE ntity"
  6032              >
  6033                                                               
  6034               <xsl:with- param 
  6035                name="asgn Entity" 
  6036                select="n1 :assignedE ntity" 
  6037               />
  6038                                                          
  6039              </xsl:call -template>
  6040                                                     
  6041             </xsl:if>
  6042                                                    
  6043             <xsl:if 
  6044              test="n1:r elatedEnti ty"
  6045             >
  6046                                                         
  6047              <xsl:call- template 
  6048               name="show -relatedEn tity"
  6049              >
  6050                                                               
  6051               <xsl:with- param 
  6052                name="rela tedEntity"  
  6053                select="n1 :relatedEn tity" 
  6054               />
  6055                                                          
  6056              </xsl:call -template>
  6057                                                     
  6058             </xsl:if>
  6059                                                
  6060            </td>
  6061                                          
  6062           </tr>
  6063                                         
  6064           <xsl:choos e>
  6065                                               
  6066            <xsl:when
  6067                                                       
  6068             test="n1:a ssignedEnt ity/n1:add r | n1:ass ignedEntit y/n1:telec om"
  6069            >
  6070                                                    
  6071             <tr>
  6072                                                         
  6073              <td>
  6074                                                               
  6075               <label>
  6076                                                                    
  6077                <b>
  6078                 Contact in fo: 
  6079                </b>
  6080                                                                
  6081               </label>
  6082                                                          
  6083              </td>
  6084                                                         
  6085              <td>
  6086                                                               
  6087               <xsl:if 
  6088                test="n1:a ssignedEnt ity"
  6089               >
  6090                                                                    
  6091                <xsl:call- template 
  6092                 name="show -contactIn fo"
  6093                >
  6094                                                                          
  6095                 <xsl:with- param 
  6096                  name="cont act" 
  6097                  select="n1 :assignedE ntity" 
  6098                 />
  6099                                                                     
  6100                </xsl:call -template>
  6101                                                                
  6102               </xsl:if>
  6103                                                          
  6104              </td>
  6105                                                     
  6106             </tr>
  6107                                                
  6108            </xsl:when >
  6109                                               
  6110            <xsl:when
  6111                                                       
  6112             test="n1:r elatedEnti ty/n1:addr  | n1:rela tedEntity/ n1:telecom "
  6113            >
  6114                                                    
  6115             <tr>
  6116                                                         
  6117              <td>
  6118                                                               
  6119               <label>
  6120                                                                    
  6121                <b>
  6122                 Contact in fo: 
  6123                </b>
  6124                                                                
  6125               </label>
  6126                                                          
  6127              </td>
  6128                                                         
  6129              <td>
  6130                                                               
  6131               <xsl:if 
  6132                test="n1:r elatedEnti ty"
  6133               >
  6134                                                                    
  6135                <xsl:call- template 
  6136                 name="show -contactIn fo"
  6137                >
  6138                                                                          
  6139                 <xsl:with- param 
  6140                  name="cont act" 
  6141                  select="n1 :relatedEn tity" 
  6142                 />
  6143                                                                     
  6144                </xsl:call -template>
  6145                                                                
  6146               </xsl:if>
  6147                                                          
  6148              </td>
  6149                                                     
  6150             </tr>
  6151                                                
  6152            </xsl:when >
  6153                                          
  6154           </xsl:choo se>
  6155                                     
  6156          </xsl:for- each>
  6157                               
  6158         </tbody>
  6159                          
  6160        </table>
  6161                     
  6162       </fieldset >
  6163               
  6164      </xsl:if>
  6165          
  6166     </xsl:temp late>
  6167    
  6168         
  6169     <!-- infor mantionRec ipient -->
  6170         
  6171     <xsl:templ ate 
  6172      name="info rmationRec ipient"
  6173     >
  6174              
  6175      <xsl:if 
  6176       test="n1:i nformation Recipient"
  6177      >
  6178                    
  6179       <fieldset>
  6180                         
  6181        <legend>
  6182                              
  6183         <b>
  6184          Recipient  Informatio n
  6185         </b>
  6186                          
  6187        </legend>
  6188                         
  6189        <table>
  6190                              
  6191         <tbody>
  6192                                    
  6193          <xsl:for-e ach 
  6194           select="n1 :informati onRecipien t"
  6195          >
  6196                                         
  6197           <tr>
  6198                                               
  6199            <td>
  6200                                                    
  6201             <label>
  6202                                                         
  6203              <b>
  6204               Informatio n recipien t: 
  6205              </b>
  6206                                                     
  6207             </label>
  6208                                                
  6209            </td>
  6210                                               
  6211            <td>
  6212                                                    
  6213             <xsl:choos e>
  6214                                                         
  6215              <xsl:when
  6216                                                                  
  6217               test="n1:i ntendedRec ipient/n1: informatio nRecipient /n1:name"
  6218              >
  6219                                                               
  6220               <xsl:for-e ach 
  6221                select="n1 :intendedR ecipient/n 1:informat ionRecipie nt"
  6222               >
  6223                                                                    
  6224                <xsl:call- template 
  6225                 name="show -name"
  6226                >
  6227                                                                          
  6228                 <xsl:with- param 
  6229                  name="name
  6230                  select="n1 :name" 
  6231                 />
  6232                                                                     
  6233                </xsl:call -template>
  6234                                                                    
  6235                <xsl:if 
  6236                 test="posi tion() !=  last()"
  6237                >
  6238                                                                          
  6239                 <br />
  6240                                                                     
  6241                </xsl:if>
  6242                                                                
  6243               </xsl:for- each>
  6244                                                          
  6245              </xsl:when >
  6246                                                         
  6247              <xsl:other wise>
  6248                                                               
  6249               <xsl:for-e ach 
  6250                select="n1 :intendedR ecipient"
  6251               >
  6252                                                                    
  6253                <xsl:for-e ach 
  6254                 select="n1 :id"
  6255                >
  6256                                                                          
  6257                 <xsl:call- template 
  6258                  name="show -id" 
  6259                 />
  6260                                                                     
  6261                </xsl:for- each>
  6262                                                                    
  6263                <xsl:if 
  6264                 test="posi tion() !=  last()"
  6265                >
  6266                                                                          
  6267                 <br />
  6268                                                                     
  6269                </xsl:if>
  6270                                                                    
  6271                <br />
  6272                                                                
  6273               </xsl:for- each>
  6274                                                          
  6275              </xsl:othe rwise>
  6276                                                     
  6277             </xsl:choo se>
  6278                                                
  6279            </td>
  6280                                          
  6281           </tr>
  6282                                         
  6283           <xsl:if
  6284                                                  
  6285            test="n1:i ntendedRec ipient/n1: addr | n1: intendedRe cipient/n1 :telecom"
  6286           >
  6287                                               
  6288            <tr>
  6289                                                    
  6290             <td>
  6291                                                         
  6292              <label>
  6293                                                               
  6294               <b>
  6295                Contact in fo: 
  6296               </b>
  6297                                                          
  6298              </label>
  6299                                                     
  6300             </td>
  6301                                                    
  6302             <td>
  6303                                                         
  6304              <xsl:call- template 
  6305               name="show -contactIn fo"
  6306              >
  6307                                                               
  6308               <xsl:with- param 
  6309                name="cont act" 
  6310                select="n1 :intendedR ecipient" 
  6311               />
  6312                                                          
  6313              </xsl:call -template>
  6314                                                     
  6315             </td>
  6316                                                
  6317            </tr>
  6318                                          
  6319           </xsl:if>
  6320                                     
  6321          </xsl:for- each>
  6322                               
  6323         </tbody>
  6324                          
  6325        </table>
  6326                     
  6327       </fieldset >
  6328               
  6329      </xsl:if>
  6330          
  6331     </xsl:temp late>
  6332    
  6333         
  6334     <!-- parti cipant -->
  6335         
  6336     <xsl:templ ate 
  6337      name="part icipant"
  6338     >
  6339              
  6340      <tr 
  6341       valign="to p"
  6342      >
  6343                    
  6344       <th>
  6345                         
  6346        <xsl:varia ble 
  6347         name="part iciptRole"
  6348        >
  6349                              
  6350         <xsl:call- template 
  6351          name="tran slateRoleA ssoCode"
  6352         >
  6353                                    
  6354          <xsl:with- param 
  6355           name="clas sCode"
  6356                                                     
  6357           select="n1 :associate dEntity/@c lassCode" 
  6358          />
  6359                                    
  6360          <xsl:with- param 
  6361           name="code
  6362           select="n1 :associate dEntity/n1 :code" 
  6363          />
  6364                               
  6365         </xsl:call -template>
  6366                          
  6367        </xsl:vari able>
  6368                         
  6369        <xsl:choos e>
  6370                              
  6371         <xsl:when 
  6372          test="$par ticiptRole "
  6373         >
  6374                                    
  6375          <xsl:call- template 
  6376           name="firs tCharCaseU p"
  6377          >
  6378                                         
  6379           <xsl:with- param 
  6380            name="data
  6381            select="$p articiptRo le" 
  6382           />
  6383                                     
  6384          </xsl:call -template>
  6385                               
  6386         </xsl:when >
  6387                              
  6388         <xsl:other wise>
  6389                                    Partic ipant
  6390                               
  6391         </xsl:othe rwise>
  6392                          
  6393        </xsl:choo se>
  6394                     
  6395       </th>
  6396                    
  6397       <td>
  6398                         
  6399        <xsl:if 
  6400         test="n1:f unctionCod e"
  6401        >
  6402                              
  6403         <xsl:call- template 
  6404          name="show -code"
  6405         >
  6406                                    
  6407          <xsl:with- param 
  6408           name="code
  6409           select="n1 :functionC ode" 
  6410          />
  6411                               
  6412         </xsl:call -template>
  6413                              
  6414         <xsl:text>
  6415           
  6416         </xsl:text >
  6417                          
  6418        </xsl:if>
  6419                         
  6420        <xsl:call- template 
  6421         name="show -associate dEntity"
  6422        >
  6423                              
  6424         <xsl:with- param 
  6425          name="asso Entity" 
  6426          select="n1 :associate dEntity" 
  6427         />
  6428                          
  6429        </xsl:call -template>
  6430                         
  6431        <xsl:if
  6432                                  
  6433         test="n1:a ssociatedE ntity/n1:a ddr | n1:a ssociatedE ntity/n1:t elecom"
  6434        >
  6435                              
  6436         <xsl:call- template 
  6437          name="show -contactIn fo"
  6438         >
  6439                                    
  6440          <xsl:with- param 
  6441           name="cont act" 
  6442           select="n1 :associate dEntity" 
  6443          />
  6444                               
  6445         </xsl:call -template>
  6446                          
  6447        </xsl:if>
  6448                         
  6449        <!-- <xsl: if test="n 1:time"> < xsl:if tes t="n1:time /n1:low">  <xsl:text>
  6450                                                    from </xsl :text> <xs l:call-tem plate name ="show-tim e"> <xsl:w ith-param  name="date time"
  6451                                                    select="n1 :time/n1:l ow"/> </xs l:call-tem plate> </x sl:if> <xs l:if test= "n1:time/n 1:high">
  6452                                                    <xsl:text>  to </xsl: text> <xsl :call-temp late name= "show-time "> <xsl:wi th-param
  6453                                                    name="date time" sele ct="n1:tim e/n1:high" /> </xsl:c all-templa te> </xsl: if>
  6454                                                    </xsl:if>  -->
  6455                     
  6456       </td>
  6457               
  6458      </tr>
  6459          
  6460     </xsl:temp late>
  6461    
  6462         
  6463     <!-- recor dTarget -- >
  6464         
  6465     <xsl:templ ate 
  6466      name="reco rdTarget"
  6467     >
  6468              
  6469      <fieldset>
  6470                    
  6471       <legend>
  6472                         
  6473        <b>
  6474         Demographi c Informat ion
  6475        </b>
  6476                     
  6477       </legend>
  6478                    
  6479       <table>
  6480                         
  6481        <tbody>
  6482                              
  6483         <xsl:for-e ach 
  6484          select="/n 1:Clinical Document/n 1:recordTa rget/n1:pa tientRole"
  6485         >
  6486                                    
  6487          <xsl:if 
  6488           test="not( n1:id/@nul lFlavor)"
  6489          >
  6490                                         
  6491           <tr>
  6492                                               
  6493            <td>
  6494                                                    
  6495             <label>
  6496                                                         
  6497              <b>
  6498               Patient: 
  6499              </b>
  6500                                                     
  6501             </label>
  6502                                                
  6503            </td>
  6504                                               
  6505            <td>
  6506                                                    
  6507             <xsl:call- template 
  6508              name="show -name"
  6509             >
  6510                                                         
  6511              <xsl:with- param 
  6512               name="name
  6513               select="n1 :patient/n 1:name" 
  6514              />
  6515                                                     
  6516             </xsl:call -template>
  6517                                                
  6518            </td>
  6519                                          
  6520           </tr>
  6521                                         
  6522           <tr>
  6523                                               
  6524            <td>
  6525                                                    
  6526             <label>
  6527                                                         
  6528              <b>
  6529               Date of bi rth: 
  6530              </b>
  6531                                                     
  6532             </label>
  6533                                                
  6534            </td>
  6535                                               
  6536            <td>
  6537                                                    
  6538             <xsl:call- template 
  6539              name="show -time"
  6540             >
  6541                                                         
  6542              <xsl:with- param 
  6543               name="date time" 
  6544               select="n1 :patient/n 1:birthTim e" 
  6545              />
  6546                                                     
  6547             </xsl:call -template>
  6548                                                
  6549            </td>
  6550                                          
  6551           </tr>
  6552                                         
  6553           <tr>
  6554                                               
  6555            <td>
  6556                                                    
  6557             <label>
  6558                                                         
  6559              <b>
  6560               Gender: 
  6561              </b>
  6562                                                     
  6563             </label>
  6564                                                
  6565            </td>
  6566                                               
  6567            <td>
  6568                                                    
  6569             <xsl:for-e ach 
  6570              select="n1 :patient/n 1:administ rativeGend erCode"
  6571             >
  6572                                                         
  6573              <xsl:call- template 
  6574               name="show -gender" 
  6575              />
  6576                                                     
  6577             </xsl:for- each>
  6578                                                
  6579            </td>
  6580                                          
  6581           </tr>
  6582                                         
  6583           <xsl:if
  6584                                                  
  6585            test="n1:p atient/n1: raceCode |  (n1:patie nt/n1:ethn icGroupCod e)"
  6586           >
  6587                                               
  6588            <tr>
  6589                                                    
  6590             <td>
  6591                                                         
  6592              <label>
  6593                                                               
  6594               <b>
  6595                Race: 
  6596               </b>
  6597                                                          
  6598              </label>
  6599                                                     
  6600             </td>
  6601                                                    
  6602             <td>
  6603                                                         
  6604              <xsl:choos e>
  6605                                                               
  6606               <xsl:when 
  6607                test="n1:p atient/n1: raceCode"
  6608               >
  6609                                                                    
  6610                <xsl:for-e ach 
  6611                 select="n1 :patient/n 1:raceCode "
  6612                >
  6613                                                                          
  6614                 <xsl:call- template 
  6615                  name="show -race-ethn icity" 
  6616                 />
  6617                                                                     
  6618                </xsl:for- each>
  6619                                                                
  6620               </xsl:when >
  6621                                                               
  6622               <xsl:other wise>
  6623                                                                    
  6624                <xsl:text>
  6625                 Informatio n not avai lable
  6626                </xsl:text >
  6627                                                                
  6628               </xsl:othe rwise>
  6629                                                          
  6630              </xsl:choo se>
  6631                                                     
  6632             </td>
  6633                                                
  6634            </tr>
  6635                                          
  6636           </xsl:if>
  6637                                         
  6638           <tr>
  6639                                               
  6640            <td>
  6641                                                    
  6642             <label>
  6643                                                         
  6644              <b>
  6645               Ethnicity:  
  6646              </b>
  6647                                                     
  6648             </label>
  6649                                                
  6650            </td>
  6651                                               
  6652            <td>
  6653                                                    
  6654             <xsl:choos e>
  6655                                                         
  6656              <xsl:when 
  6657               test="n1:p atient/n1: ethnicGrou pCode"
  6658              >
  6659                                                               
  6660               <xsl:for-e ach 
  6661                select="n1 :patient/n 1:ethnicGr oupCode"
  6662               >
  6663                                                                    
  6664                <xsl:call- template 
  6665                 name="show -race-ethn icity" 
  6666                />
  6667                                                                
  6668               </xsl:for- each>
  6669                                                          
  6670              </xsl:when >
  6671                                                         
  6672              <xsl:other wise>
  6673                                                               
  6674               <xsl:text>
  6675                Informatio n not avai lable
  6676               </xsl:text >
  6677                                                          
  6678              </xsl:othe rwise>
  6679                                                     
  6680             </xsl:choo se>
  6681                                                
  6682            </td>
  6683                                          
  6684           </tr>
  6685                                         
  6686           <tr>
  6687                                               
  6688            <td 
  6689             style="ver tical-alig n: top;"
  6690            >
  6691                                                    
  6692             <label>
  6693                                                         
  6694              <b>
  6695               Contact in fo: 
  6696              </b>
  6697                                                     
  6698             </label>
  6699                                                
  6700            </td>
  6701                                               
  6702            <td>
  6703                                                    
  6704             <xsl:call- template 
  6705              name="show -contactIn fo"
  6706             >
  6707                                                         
  6708              <xsl:with- param 
  6709               name="cont act" 
  6710               select="."  
  6711              />
  6712                                                     
  6713             </xsl:call -template>
  6714                                                
  6715            </td>
  6716                                          
  6717           </tr>
  6718                                         
  6719           <tr>
  6720                                               
  6721            <td>
  6722                                                    
  6723             <label>
  6724                                                         
  6725              <b>
  6726               Patient ID s: 
  6727              </b>
  6728                                                     
  6729             </label>
  6730                                                
  6731            </td>
  6732                                               
  6733            <td>
  6734                                                    
  6735             <xsl:for-e ach 
  6736              select="n1 :id"
  6737             >
  6738                                                         
  6739              <xsl:call- template 
  6740               name="show -id" 
  6741              />
  6742                                                         
  6743              <br />
  6744                                                     
  6745             </xsl:for- each>
  6746                                                
  6747            </td>
  6748                                          
  6749           </tr>
  6750                                     
  6751          </xsl:if>
  6752                               
  6753         </xsl:for- each>
  6754                          
  6755        </tbody>
  6756                     
  6757       </table>
  6758               
  6759      </fieldset >
  6760          
  6761     </xsl:temp late>
  6762    
  6763         
  6764     <!-- relat edDocument  -->
  6765         
  6766     <xsl:templ ate 
  6767      name="rela tedDocumen t"
  6768     >
  6769              
  6770      <xsl:if 
  6771       test="n1:r elatedDocu ment"
  6772      >
  6773                    
  6774       <table 
  6775        class="hea der_table"
  6776       >
  6777                         
  6778        <tbody>
  6779                              
  6780         <xsl:for-e ach 
  6781          select="n1 :relatedDo cument"
  6782         >
  6783                                    
  6784          <tr>
  6785                                         
  6786           <td 
  6787            width="20%
  6788            bgcolor="# 3399ff"
  6789           >
  6790                                               
  6791            <span 
  6792             class="td_ label"
  6793            >
  6794                                                    
  6795             <xsl:text>
  6796              Related do cument
  6797             </xsl:text >
  6798                                                
  6799            </span>
  6800                                          
  6801           </td>
  6802                                         
  6803           <td 
  6804            width="80% "
  6805           >
  6806                                               
  6807            <xsl:for-e ach 
  6808             select="n1 :parentDoc ument"
  6809            >
  6810                                                    
  6811             <xsl:for-e ach 
  6812              select="n1 :id"
  6813             >
  6814                                                         
  6815              <xsl:call- template 
  6816               name="show -id" 
  6817              />
  6818                                                         
  6819              <br />
  6820                                                     
  6821             </xsl:for- each>
  6822                                                
  6823            </xsl:for- each>
  6824                                          
  6825           </td>
  6826                                     
  6827          </tr>
  6828                               
  6829         </xsl:for- each>
  6830                          
  6831        </tbody>
  6832                     
  6833       </table>
  6834               
  6835      </xsl:if>
  6836          
  6837     </xsl:temp late>
  6838         
  6839     <!-- autho rization ( consent) - ->
  6840         
  6841     <xsl:templ ate 
  6842      name="auth orization"
  6843     >
  6844              
  6845      <xsl:if 
  6846       test="n1:a uthorizati on"
  6847      >
  6848                    
  6849       <table 
  6850        class="hea der_table"
  6851       >
  6852                         
  6853        <tbody>
  6854                              
  6855         <xsl:for-e ach 
  6856          select="n1 :authoriza tion"
  6857         >
  6858                                    
  6859          <tr>
  6860                                         
  6861           <td 
  6862            width="20%
  6863            bgcolor="# 3399ff"
  6864           >
  6865                                               
  6866            <span 
  6867             class="td_ label"
  6868            >
  6869                                                    
  6870             <xsl:text>
  6871              Consent
  6872             </xsl:text >
  6873                                                
  6874            </span>
  6875                                          
  6876           </td>
  6877                                         
  6878           <td 
  6879            width="80% "
  6880           >
  6881                                               
  6882            <xsl:choos e>
  6883                                                    
  6884             <xsl:when 
  6885              test="n1:c onsent/n1: code"
  6886             >
  6887                                                         
  6888              <xsl:call- template 
  6889               name="show -code"
  6890              >
  6891                                                               
  6892               <xsl:with- param 
  6893                name="code
  6894                select="n1 :consent/n 1:code" 
  6895               />
  6896                                                          
  6897              </xsl:call -template>
  6898                                                     
  6899             </xsl:when >
  6900                                                    
  6901             <xsl:other wise>
  6902                                                         
  6903              <xsl:call- template 
  6904               name="show -code"
  6905              >
  6906                                                               
  6907               <xsl:with- param 
  6908                name="code "
  6909                                                                                
  6910                select="n1 :consent/n 1:statusCo de" 
  6911               />
  6912                                                          
  6913              </xsl:call -template>
  6914                                                     
  6915             </xsl:othe rwise>
  6916                                                
  6917            </xsl:choo se>
  6918                                               
  6919            <br />
  6920                                          
  6921           </td>
  6922                                     
  6923          </tr>
  6924                               
  6925         </xsl:for- each>
  6926                          
  6927        </tbody>
  6928                     
  6929       </table>
  6930               
  6931      </xsl:if>
  6932          
  6933     </xsl:temp late>
  6934         
  6935     <!-- setAn dVersion - ->
  6936         
  6937     <xsl:templ ate 
  6938      name="setA ndVersion"
  6939     >
  6940              
  6941      <xsl:if 
  6942       test="n1:s etId and n 1:versionN umber"
  6943      >
  6944                    
  6945       <table 
  6946        class="hea der_table"
  6947       >
  6948                         
  6949        <tbody>
  6950                              
  6951         <tr>
  6952                                    
  6953          <td 
  6954           width="20% "
  6955          >
  6956                                         
  6957           <xsl:text>
  6958            SetId and  Version
  6959           </xsl:text >
  6960                                     
  6961          </td>
  6962                                    
  6963          <td 
  6964           colspan="3 "
  6965          >
  6966                                         
  6967           <xsl:text>
  6968            SetId: 
  6969           </xsl:text >
  6970                                         
  6971           <xsl:call- template 
  6972            name="show -id"
  6973           >
  6974                                               
  6975            <xsl:with- param 
  6976             name="id" 
  6977             select="n1 :setId" 
  6978            />
  6979                                          
  6980           </xsl:call -template>
  6981                                         
  6982           <xsl:text>
  6983              Version:  
  6984           </xsl:text >
  6985                                         
  6986           <xsl:value -of 
  6987            select="n1 :versionNu mber/@valu e" 
  6988           />
  6989                                     
  6990          </td>
  6991                               
  6992         </tr>
  6993                          
  6994        </tbody>
  6995                     
  6996       </table>
  6997               
  6998      </xsl:if>
  6999          
  7000     </xsl:temp late>
  7001         
  7002     <!-- show  Structured Body -->
  7003         
  7004     <xsl:templ ate 
  7005      match="n1: component/ n1:structu redBody"
  7006     >
  7007              
  7008      <xsl:for-e ach 
  7009       select="."
  7010      >
  7011                    
  7012       <xsl:call- template 
  7013        name="sect ion-dynami c" 
  7014       />
  7015               
  7016      </xsl:for- each>
  7017          
  7018     </xsl:temp late>
  7019         
  7020     <!-- show  nonXMLBody  -->
  7021         
  7022     <xsl:templ ate 
  7023      match='n1: component/ n1:nonXMLB ody'
  7024     >
  7025              
  7026      <xsl:choos e>
  7027                    
  7028       <!-- if th ere is a r eference,  use that i n an IFRAM E -->
  7029                    
  7030       <xsl:when 
  7031        test='n1:t ext/n1:ref erence'
  7032       >
  7033                         
  7034        <IFRAME 
  7035         name='nonX MLBody' 
  7036         id='nonXML Body' 
  7037         WIDTH='80%
  7038         HEIGHT='60 0'
  7039                                  
  7040         src='{n1:t ext/n1:ref erence/@va lue}' 
  7041        />
  7042                     
  7043       </xsl:when >
  7044                    
  7045       <xsl:when 
  7046        test='n1:t ext/@media Type="text /plain"'
  7047       >
  7048                         
  7049        <pre>
  7050                              
  7051         <xsl:value -of 
  7052          select='n1 :text/text ()' 
  7053         />
  7054                          
  7055        </pre>
  7056                     
  7057       </xsl:when >
  7058                    
  7059       <xsl:other wise>
  7060                         
  7061        <CENTER>
  7062         Cannot dis play the t ext
  7063        </CENTER>
  7064                     
  7065       </xsl:othe rwise>
  7066               
  7067      </xsl:choo se>
  7068          
  7069     </xsl:temp late>
  7070         
  7071     <!-- Templ ates to ac t as looku p tables o r maps for  determini ng section  headers a nd heading s
  7072                      base d upon LOI NC codes - ->
  7073         
  7074     <xsl:templ ate 
  7075      name="getS ectionHead erText"
  7076     >
  7077              
  7078      <xsl:param  
  7079       name="loin cCode" 
  7080      />
  7081              
  7082      <xsl:choos e>
  7083                    
  7084       <xsl:when 
  7085        test="$loi ncCode='42 348-3'"
  7086       >
  7087        <xsl:copy- of 
  7088         select="st ring('Adva nce Direct ives')"
  7089        />
  7090       </xsl:when >
  7091                    
  7092       <xsl:when 
  7093        test="$loi ncCode='48 765-2'"
  7094       >
  7095        <xsl:copy- of 
  7096         select="st ring('Alle rgies')"
  7097        />
  7098       </xsl:when >
  7099                    
  7100       <xsl:when 
  7101        test="$loi ncCode='59 774-0'"
  7102       >
  7103        <xsl:copy- of 
  7104         select="st ring('Anes thesia')"
  7105        />
  7106       </xsl:when >
  7107                    
  7108       <xsl:when 
  7109        test="$loi ncCode='51 848-0'"
  7110       >
  7111        <xsl:copy- of 
  7112         select="st ring('Asse ssment ')"
  7113        />
  7114       </xsl:when >
  7115                    
  7116       <xsl:when 
  7117        test="$loi ncCode='51 847-2'"
  7118       >
  7119        <xsl:copy- of 
  7120         select="st ring('Asse ssment and  Plan')"
  7121        />
  7122       </xsl:when >
  7123                    
  7124       <xsl:when 
  7125        test="$loi ncCode='10 154-3'"
  7126       >
  7127        <xsl:copy- of 
  7128         select="st ring('Chie f Complain t')"
  7129        />
  7130       </xsl:when >
  7131                    
  7132       <xsl:when 
  7133        test="$loi ncCode='46 239-0'"
  7134       >
  7135        <xsl:copy- of 
  7136         select="st ring('Chie f Complain t and Reas on for Vis it')"
  7137        />
  7138       </xsl:when >
  7139                    
  7140       <xsl:when 
  7141        test="$loi ncCode='55 109-3'"
  7142       >
  7143        <xsl:copy- of 
  7144         select="st ring('Comp lications' )"
  7145        />
  7146       </xsl:when >
  7147                    
  7148       <xsl:when 
  7149        test="$loi ncCode='12 1181'"
  7150       >
  7151        <xsl:copy- of 
  7152         select="st ring('DICO M Object C atalog')"
  7153        />
  7154       </xsl:when >
  7155                    
  7156       <xsl:when 
  7157        test="$loi ncCode='42 344-2'"
  7158       >
  7159        <xsl:copy- of 
  7160         select="st ring('Disc harge Diet ')"
  7161        />
  7162       </xsl:when >
  7163                    
  7164       <xsl:when 
  7165        test="$loi ncCode='46 240-8'"
  7166       >
  7167        <xsl:copy- of 
  7168         select="st ring('Enco unters')"
  7169        />
  7170       </xsl:when >
  7171                    
  7172       <xsl:when 
  7173        test="$loi ncCode='10 157-6'"
  7174       >
  7175        <xsl:copy- of 
  7176         select="st ring('Fami ly History ')"
  7177        />
  7178       </xsl:when >
  7179                    
  7180       <xsl:when 
  7181        test="$loi ncCode='18 782-3'"
  7182       >
  7183        <xsl:copy- of 
  7184         select="st ring('Find ings (Radi ology Stud y - Observ ation)')"
  7185        />
  7186       </xsl:when >
  7187                    
  7188       <xsl:when 
  7189        test="$loi ncCode='47 420-5'"
  7190       >
  7191        <xsl:copy- of 
  7192         select="st ring('Func tional Sta tus')"
  7193        />
  7194       </xsl:when >
  7195                    
  7196       <xsl:when 
  7197        test="$loi ncCode='10 210-3'"
  7198       >
  7199        <xsl:copy- of 
  7200         select="st ring('Gene ral Status ')"
  7201        />
  7202       </xsl:when >
  7203                    
  7204       <xsl:when 
  7205        test="$loi ncCode='11 348-0'"
  7206       >
  7207        <xsl:copy- of 
  7208         select="st ring('Hist ory of Pas t Illness  (Past Medi cal Histor y)')"
  7209        />
  7210       </xsl:when >
  7211                    
  7212       <xsl:when 
  7213        test="$loi ncCode='10 164-2'"
  7214       >
  7215        <xsl:copy- of 
  7216         select="st ring('Hist ory of Pre sent Illne ss')"
  7217        />
  7218       </xsl:when >
  7219                    
  7220       <xsl:when 
  7221        test="$loi ncCode='46 241-6'"
  7222       >
  7223        <xsl:copy- of 
  7224         select="st ring('Hosp ital Admis sion Diagn osis')"
  7225        />
  7226       </xsl:when >
  7227                    
  7228       <xsl:when 
  7229        test="$loi ncCode='18 841-7'"
  7230       >
  7231        <xsl:copy- of 
  7232         select="st ring('Hosp ital Consu ltation')"
  7233        />
  7234       </xsl:when >
  7235                    
  7236       <xsl:when 
  7237        test="$loi ncCode='86 48-8'"
  7238       >
  7239        <xsl:copy- of 
  7240         select="st ring('Disc harge Summ ary')"
  7241        />
  7242       </xsl:when >
  7243                    
  7244       <xsl:when 
  7245        test="$loi ncCode='11 535-2'"
  7246       >
  7247        <xsl:copy- of 
  7248         select="st ring('Hosp ital Disch arge Diagn osis')"
  7249        />
  7250       </xsl:when >
  7251                    
  7252       <xsl:when 
  7253        test="$loi ncCode='86 53-8'"
  7254       >
  7255        <xsl:copy- of 
  7256         select="st ring('Hosp ital Disch arge Instr uctions')"
  7257        />
  7258       </xsl:when >
  7259                    
  7260       <xsl:when 
  7261        test="$loi ncCode='10 183-2'"
  7262       >
  7263        <xsl:copy- of 
  7264         select="st ring('Hosp ital Disch arge Medic ations')"
  7265        />
  7266       </xsl:when >
  7267                    
  7268       <xsl:when 
  7269        test="$loi ncCode='10 184-0'"
  7270       >
  7271        <xsl:copy- of 
  7272         select="st ring('Hosp ital Disch arge Physi cal')"
  7273        />
  7274       </xsl:when >
  7275                    
  7276       <xsl:when 
  7277        test="$loi ncCode='11 493-4'"
  7278       >
  7279        <xsl:copy- of 
  7280         select="st ring('Hosp ital Disch arge Studi es Summary ')"
  7281        />
  7282       </xsl:when >
  7283                    
  7284       <xsl:when 
  7285        test="$loi ncCode='11 369-6'"
  7286       >
  7287        <xsl:copy- of 
  7288         select="st ring('Immu nizations' )"
  7289        />
  7290       </xsl:when >
  7291                    
  7292       <xsl:when 
  7293        test="$loi ncCode='69 730-0'"
  7294       >
  7295        <xsl:copy- of 
  7296         select="st ring('Inst ructions') "
  7297        />
  7298       </xsl:when >
  7299                    
  7300       <xsl:when 
  7301        test="$loi ncCode='62 387-6'"
  7302       >
  7303        <xsl:copy- of 
  7304         select="st ring('Inte rventions' )"
  7305        />
  7306       </xsl:when >
  7307                    
  7308       <xsl:when 
  7309        test="$loi ncCode='46 264-8'"
  7310       >
  7311        <xsl:copy- of 
  7312         select="st ring('Medi cal Equipm ent')"
  7313        />
  7314       </xsl:when >
  7315                    
  7316       <xsl:when 
  7317        test="$loi ncCode='11 329-0'"
  7318       >
  7319        <xsl:copy- of 
  7320         select="st ring('Medi cal (Gener al) Histor y')"
  7321        />
  7322       </xsl:when >
  7323                    
  7324       <xsl:when 
  7325        test="$loi ncCode='10 160-0'"
  7326       >
  7327        <xsl:copy- of 
  7328         select="st ring('Medi cations')"
  7329        />
  7330       </xsl:when >
  7331                    
  7332       <xsl:when 
  7333        test="$loi ncCode='29 549-3'"
  7334       >
  7335        <xsl:copy- of 
  7336         select="st ring('Medi cations Ad ministered ')"
  7337        />
  7338       </xsl:when >
  7339                    
  7340       <xsl:when 
  7341        test="$loi ncCode='61 149-1'"
  7342       >
  7343        <xsl:copy- of 
  7344         select="st ring('Obje ctive')"
  7345        />
  7346       </xsl:when >
  7347                    
  7348       <xsl:when 
  7349        test="$loi ncCode='10 216-0'"
  7350       >
  7351        <xsl:copy- of 
  7352         select="st ring('Oper ative Note  Fluids')"
  7353        />
  7354       </xsl:when >
  7355                    
  7356       <xsl:when 
  7357        test="$loi ncCode='10 223-6'"
  7358       >
  7359        <xsl:copy- of 
  7360         select="st ring('Oper ative Note  Surgical  Procedure' )"
  7361        />
  7362       </xsl:when >
  7363                    
  7364       <xsl:when 
  7365        test="$loi ncCode='48 768-6'"
  7366       >
  7367        <xsl:copy- of 
  7368         select="st ring('Insu rance Prov iders')"
  7369        />
  7370       </xsl:when >
  7371                    
  7372       <xsl:when 
  7373        test="$loi ncCode='29 545-1'"
  7374       >
  7375        <xsl:copy- of 
  7376         select="st ring('Phys ical Exam' )"
  7377        />
  7378       </xsl:when >
  7379                    
  7380       <xsl:when 
  7381        test="$loi ncCode='18 776-5'"
  7382       >
  7383        <xsl:copy- of 
  7384         select="st ring('Plan  of Care') "
  7385        />
  7386       </xsl:when >
  7387                    
  7388       <xsl:when 
  7389        test="$loi ncCode='59 772-4'"
  7390       >
  7391        <xsl:copy- of 
  7392         select="st ring('Plan ned Proced ure')"
  7393        />
  7394       </xsl:when >
  7395                    
  7396       <xsl:when 
  7397        test="$loi ncCode='10 218-6'"
  7398       >
  7399        <xsl:copy- of 
  7400         select="st ring('Post -operative  Diagnosis ')"
  7401        />
  7402       </xsl:when >
  7403                    
  7404       <xsl:when 
  7405        test="$loi ncCode='59 769-0'"
  7406       >
  7407        <xsl:copy- of 
  7408         select="st ring('Post -procedure  Diagnosis ')"
  7409        />
  7410       </xsl:when >
  7411                    
  7412       <xsl:when 
  7413        test="$loi ncCode='10 219-4'"
  7414       >
  7415        <xsl:copy- of 
  7416         select="st ring('Preo perative D iagnosis') "
  7417        />
  7418       </xsl:when >
  7419                    
  7420       <xsl:when 
  7421        test="$loi ncCode='11 450-4'"
  7422       >
  7423        <xsl:copy- of 
  7424         select="st ring('Prob lem')"
  7425        />
  7426       </xsl:when >
  7427                    
  7428       <xsl:when 
  7429        test="$loi ncCode='29 554-3'"
  7430       >
  7431        <xsl:copy- of 
  7432         select="st ring('Proc edure Desc ription')"
  7433        />
  7434       </xsl:when >
  7435                    
  7436       <xsl:when 
  7437        test="$loi ncCode='59 775-7'"
  7438       >
  7439        <xsl:copy- of 
  7440         select="st ring('Proc edure Disp osition')"
  7441        />
  7442       </xsl:when >
  7443                    
  7444       <xsl:when 
  7445        test="$loi ncCode='59 770-8'"
  7446       >
  7447        <xsl:copy- of 
  7448         select="st ring('Proc edure Esti mated Bloo d Loss')"
  7449        />
  7450       </xsl:when >
  7451                    
  7452       <xsl:when 
  7453        test="$loi ncCode='59 776-5'"
  7454       >
  7455        <xsl:copy- of 
  7456         select="st ring('Proc edure Find ings')"
  7457        />
  7458       </xsl:when >
  7459                    
  7460       <xsl:when 
  7461        test="$loi ncCode='59 771-6'"
  7462       >
  7463        <xsl:copy- of 
  7464         select="st ring('Proc edure Impl ants')"
  7465        />
  7466       </xsl:when >
  7467                    
  7468       <xsl:when 
  7469        test="$loi ncCode='59 768-2'"
  7470       >
  7471        <xsl:copy- of 
  7472         select="st ring('Proc edure Indi cations')"
  7473        />
  7474       </xsl:when >
  7475                    
  7476       <xsl:when 
  7477        test="$loi ncCode='59 773-2'"
  7478       >
  7479        <xsl:copy- of 
  7480         select="st ring('Proc edure Spec imens Take n')"
  7481        />
  7482       </xsl:when >
  7483                    
  7484       <xsl:when 
  7485        test="$loi ncCode='47 519-4'"
  7486       >
  7487        <xsl:copy- of 
  7488         select="st ring('Proc edures')"
  7489        />
  7490       </xsl:when >
  7491                    
  7492       <xsl:when 
  7493        test="$loi ncCode='42 349-1'"
  7494       >
  7495        <xsl:copy- of 
  7496         select="st ring('Reas on for Ref erral')"
  7497        />
  7498       </xsl:when >
  7499                    
  7500       <xsl:when 
  7501        test="$loi ncCode='29 299-5'"
  7502       >
  7503        <xsl:copy- of 
  7504         select="st ring('Reas on for Vis it')"
  7505        />
  7506       </xsl:when >
  7507                    
  7508       <xsl:when 
  7509        test="$loi ncCode='55 115-0'"
  7510       >
  7511        <xsl:copy- of 
  7512         select="st ring('Requ ested Imag ing Studie s Informat ion')"
  7513        />
  7514       </xsl:when >
  7515                    
  7516       <xsl:when 
  7517        test="$loi ncCode='30 954-2'"
  7518       >
  7519        <xsl:copy- of 
  7520         select="st ring('Resu lts')"
  7521        />
  7522       </xsl:when >
  7523                    
  7524       <xsl:when 
  7525        test="$loi ncCode='10 187-3'"
  7526       >
  7527        <xsl:copy- of 
  7528         select="st ring('Revi ew of Syst ems')"
  7529        />
  7530       </xsl:when >
  7531                    
  7532       <xsl:when 
  7533        test="$loi ncCode='29 762-2'"
  7534       >
  7535        <xsl:copy- of 
  7536         select="st ring('Soci al History ')"
  7537        />
  7538       </xsl:when >
  7539                    
  7540       <xsl:when 
  7541        test="$loi ncCode='61 150-9'"
  7542       >
  7543        <xsl:copy- of 
  7544         select="st ring('Subj ective')"
  7545        />
  7546       </xsl:when >
  7547                    
  7548       <xsl:when 
  7549        test="$loi ncCode='11 537-8'"
  7550       >
  7551        <xsl:copy- of 
  7552         select="st ring('Surg ical Drain s')"
  7553        />
  7554       </xsl:when >
  7555                    
  7556       <xsl:when 
  7557        test="$loi ncCode='87 16-3'"
  7558       >
  7559        <xsl:copy- of 
  7560         select="st ring('Vita l Signs')"
  7561        />
  7562       </xsl:when >
  7563                    
  7564       <xsl:when 
  7565        test="$loi ncCode='34 133-9'"
  7566       >
  7567        <xsl:copy- of 
  7568         select="st ring('Summ arization  of Episode  Note')"
  7569        />
  7570       </xsl:when >
  7571                    
  7572       <xsl:when 
  7573        test="$loi ncCode='11 488-4'"
  7574       >
  7575        <xsl:copy- of 
  7576         select="st ring('Cons ultation N otes')"
  7577        />
  7578       </xsl:when >
  7579                    
  7580       <xsl:when 
  7581        test="$loi ncCode='18 748-4'"
  7582       >
  7583        <xsl:copy- of 
  7584         select="st ring('Diag nostic Ima ging Repor t')"
  7585        />
  7586       </xsl:when >
  7587                    
  7588       <xsl:when 
  7589        test="$loi ncCode='34 117-2'"
  7590       >
  7591        <xsl:copy- of 
  7592         select="st ring('Hist ory and Ph ysical')"
  7593        />
  7594       </xsl:when >
  7595                    
  7596       <xsl:when 
  7597        test="$loi ncCode='11 504-8'"
  7598       >
  7599        <xsl:copy- of 
  7600         select="st ring('Surg ical Opera tion Note' )"
  7601        />
  7602       </xsl:when >
  7603                    
  7604       <xsl:when 
  7605        test="$loi ncCode='28 570-0'"
  7606       >
  7607        <xsl:copy- of 
  7608         select="st ring('Proc edure Note ')"
  7609        />
  7610       </xsl:when >
  7611                    
  7612       <xsl:when 
  7613        test="$loi ncCode='34 746-8'"
  7614       >
  7615        <xsl:copy- of 
  7616         select="st ring('Nurs es Note')"
  7617        />
  7618       </xsl:when >
  7619                    
  7620       <xsl:when 
  7621        test="$loi ncCode='11 056-3'"
  7622       >
  7623        <xsl:copy- of 
  7624         select="st ring('Prog ress Note' )"
  7625        />
  7626       </xsl:when >
  7627                    
  7628       <xsl:when 
  7629        test="$loi ncCode='34 109-9'"
  7630       >
  7631        <xsl:copy- of 
  7632         select="st ring('Misc ellaneous  Notes')"
  7633        />
  7634       </xsl:when >
  7635               
  7636      </xsl:choo se>
  7637          
  7638     </xsl:temp late>
  7639    
  7640         
  7641     <!-- DYNAM IC VERSION  top level  component /section:  display ti tle and te xt, and pr ocess any
  7642                      nest ed compone nt/section s -->
  7643         
  7644     <xsl:templ ate 
  7645      name="sect ion-dynami c"
  7646     >
  7647              
  7648      <xsl:varia ble 
  7649       name="sect ions" 
  7650       select="n1 :component /n1:sectio n" 
  7651      />
  7652     
  7653              
  7654      <xsl:choos e>
  7655                    
  7656       <xsl:when 
  7657        test="cont ains($ccdD ocTemplate Root, $ccd aDoc)"
  7658       >
  7659                         
  7660        <xsl:for-e ach 
  7661         select="$s ections"
  7662        >
  7663                              
  7664         <xsl:varia ble 
  7665          name="pos- int"
  7666         >
  7667          <xsl:value -of 
  7668           select="po sition()"
  7669          />
  7670         </xsl:vari able>
  7671                              
  7672         <xsl:varia ble 
  7673          name="temp lateId"
  7674         >
  7675                                    
  7676          <xsl:choos e>
  7677                                         
  7678           <xsl:when 
  7679            test="n1:t emplateId[ 2]"
  7680           >
  7681                                               
  7682            <xsl:value -of 
  7683             select="n1 :templateI d[2]/@root "
  7684            />
  7685                                          
  7686           </xsl:when >
  7687                                         
  7688           <xsl:other wise>
  7689                                               
  7690            <xsl:value -of 
  7691             select="n1 :templateI d/@root"
  7692            />
  7693                                          
  7694           </xsl:othe rwise>
  7695                                     
  7696          </xsl:choo se>
  7697                               
  7698         </xsl:vari able>
  7699                              
  7700         <xsl:varia ble 
  7701          name="curr entSection "
  7702                                              
  7703          select="n1 :text" 
  7704         />
  7705                              
  7706         <xsl:varia ble 
  7707          name="loin cCode"
  7708         >
  7709          <xsl:value -of 
  7710           select="n1 :code/@cod e"
  7711          />
  7712         </xsl:vari able>
  7713                              
  7714         <xsl:varia ble 
  7715          name="head erValue"
  7716         >
  7717                                    
  7718          <xsl:call- template 
  7719           name="getS ectionHead erText"
  7720          >
  7721                                         
  7722           <xsl:with- param 
  7723            name="loin cCode" 
  7724            select="$l oincCode"
  7725           />
  7726                                     
  7727          </xsl:call -template>
  7728                               
  7729         </xsl:vari able>
  7730                              
  7731         <xsl:varia ble 
  7732          name="head erHrefTitl eId"
  7733         >
  7734                                    
  7735          <xsl:value -of 
  7736           select="st ring('')" 
  7737          />
  7738                               
  7739         </xsl:vari able>
  7740        
  7741                              
  7742         <xsl:choos e>
  7743                                    
  7744          <xsl:when 
  7745           test="stri ng-length( $currentSe ction) &gt ; 0"
  7746          >
  7747                                         
  7748           <!--<xsl:c all-templa te name="s ection-tit le"> <xsl: with-param  name="tit le"
  7749                                                                                 select ="$headerV alue"/> <x sl:with-pa ram name=" titleId" s elect="$he aderHrefTi tleId"/>
  7750                                                                                 <xsl:w ith-param  name="sect ionCount"  select="$s ectionsCou nt"/> </xs l:call-tem plate>
  7751                                                                                 <xsl:c all-templa te name="s ection-aut hor"> <xsl :with-para m name="te mplateId"
  7752                                                                                 select ="$templat eId"/> </x sl:call-te mplate> -- >
  7753                                         
  7754           <xsl:call- template 
  7755            name="sect ion-text"
  7756           >
  7757                                               
  7758            <xsl:with- param 
  7759             name="titl e" 
  7760             select="$h eaderValue
  7761            />
  7762                                               
  7763            <xsl:with- param 
  7764             name="titl eId" 
  7765             select="$h eaderHrefT itleId" 
  7766            />
  7767                                               
  7768            <xsl:with- param 
  7769             name="html Text" 
  7770             select="$c urrentSect ion" 
  7771            />
  7772                                               
  7773            <xsl:with- param 
  7774             name="sect ionPositio n" 
  7775             select="$p os-int" 
  7776            />
  7777                                          
  7778           </xsl:call -template>
  7779                                     
  7780          </xsl:when >
  7781                                    
  7782          <xsl:other wise>
  7783                                         
  7784           <section 
  7785            id="{$head erValue}"
  7786           >
  7787                                               
  7788            <header>
  7789                                                    
  7790             <h2>
  7791                                                         
  7792              <xsl:value -of 
  7793               select="$h eaderValue
  7794              />
  7795                                                         
  7796              <!--<span  class="cou nt"><xsl:v alue-of se lect="$pos -int"/></s pan> -->
  7797                                                     
  7798             </h2>
  7799            
  7800                                                    No d ata provid ed for thi s section.
  7801                                                
  7802            </header>
  7803                                          
  7804           </section>
  7805                                     
  7806          </xsl:othe rwise>
  7807                               
  7808         </xsl:choo se>
  7809                          
  7810        </xsl:for- each>
  7811                     
  7812       </xsl:when >
  7813                    
  7814       <xsl:when 
  7815        test="cont ains($prog DocTemplat eRoot, $pr ogressDoc) "
  7816       >
  7817                         
  7818        <xsl:for-e ach 
  7819         select="$s ections"
  7820        >
  7821                              
  7822         <xsl:varia ble 
  7823          name="pos- int"
  7824         >
  7825          <xsl:value -of 
  7826           select="po sition()"
  7827          />
  7828         </xsl:vari able>
  7829                              
  7830         <xsl:varia ble 
  7831          name="temp lateId"
  7832         >
  7833                                    
  7834          <xsl:choos e>
  7835                                         
  7836           <xsl:when 
  7837            test="n1:t emplateId[ 2]"
  7838           >
  7839                                               
  7840            <xsl:value -of 
  7841             select="n1 :templateI d[2]/@root "
  7842            />
  7843                                          
  7844           </xsl:when >
  7845                                         
  7846           <xsl:other wise>
  7847                                               
  7848            <xsl:value -of 
  7849             select="n1 :templateI d/@root"
  7850            />
  7851                                          
  7852           </xsl:othe rwise>
  7853                                     
  7854          </xsl:choo se>
  7855                               
  7856         </xsl:vari able>
  7857                              
  7858         <xsl:varia ble 
  7859          name="curr entSection "
  7860                                              
  7861          select="n1 :text" 
  7862         />
  7863                              
  7864         <xsl:varia ble 
  7865          name="loin cCode"
  7866         >
  7867          <xsl:value -of 
  7868           select="n1 :code/@cod e"
  7869          />
  7870         </xsl:vari able>
  7871                              
  7872         <xsl:varia ble 
  7873          name="head erValue"
  7874         >
  7875                                    
  7876          <xsl:call- template 
  7877           name="getS ectionHead erText"
  7878          >
  7879                                         
  7880           <xsl:with- param 
  7881            name="loin cCode" 
  7882            select="$l oincCode"
  7883           />
  7884                                     
  7885          </xsl:call -template>
  7886                               
  7887         </xsl:vari able>
  7888                              
  7889         <xsl:varia ble 
  7890          name="head erHrefTitl eId"
  7891         >
  7892                                    
  7893          <xsl:value -of 
  7894           select="st ring('')" 
  7895          />
  7896                               
  7897         </xsl:vari able>
  7898        
  7899                              
  7900         <xsl:choos e>
  7901                                    
  7902          <xsl:when 
  7903           test="stri ng-length( $currentSe ction) &gt ; 0"
  7904          >
  7905                                         
  7906           <xsl:call- template 
  7907            name="sect ion-text"
  7908           >
  7909                                               
  7910            <xsl:with- param 
  7911             name="titl e" 
  7912             select="$h eaderValue
  7913            />
  7914                                               
  7915            <xsl:with- param 
  7916             name="titl eId" 
  7917             select="$h eaderHrefT itleId" 
  7918            />
  7919                                               
  7920            <xsl:with- param 
  7921             name="html Text" 
  7922             select="$c urrentSect ion" 
  7923            />
  7924                                               
  7925            <xsl:with- param 
  7926             name="sect ionPositio n" 
  7927             select="$p os-int" 
  7928            />
  7929                                          
  7930           </xsl:call -template>
  7931                                     
  7932          </xsl:when >
  7933                                    
  7934          <xsl:other wise>
  7935                                         
  7936           <section 
  7937            id="{$head erValue}"
  7938           >
  7939                                               
  7940            <header>
  7941                                                    
  7942             <h2>
  7943                                                         
  7944              <xsl:value -of 
  7945               select="$h eaderValue
  7946              />
  7947                                                         
  7948              <!--<span  class="cou nt"><xsl:v alue-of se lect="$pos -int"/></s pan> -->
  7949                                                     
  7950             </h2>
  7951            
  7952                                                    No d ata provid ed for thi s section.
  7953                                                
  7954            </header>
  7955                                          
  7956           </section>
  7957                                     
  7958          </xsl:othe rwise>
  7959                               
  7960         </xsl:choo se>
  7961                          
  7962        </xsl:for- each>
  7963       
  7964                     
  7965       </xsl:when >
  7966                    
  7967       <xsl:other wise>
  7968       </xsl:othe rwise>
  7969               
  7970      </xsl:choo se>
  7971          
  7972     </xsl:temp late>
  7973    
  7974         
  7975     <!-- top l evel compo nent/secti on: displa y title an d text, an d process  any
  7976                      nest ed compone nt/section s -->
  7977         
  7978     <xsl:templ ate 
  7979      name="sect ion"
  7980     >
  7981              
  7982      <xsl:varia ble 
  7983       name="comp TemplateId Roots"
  7984                              
  7985       select="n1 :component /n1:sectio n/n1:templ ateId/@roo t" 
  7986      />
  7987              
  7988      <xsl:varia ble 
  7989       name="sect ionsCount"  
  7990       select="co unt(n1:com ponent/n1: section)" 
  7991      />
  7992              
  7993      <xsl:varia ble 
  7994       name="sect ions" 
  7995       select="n1 :component /n1:sectio n" 
  7996      />
  7997     
  7998              
  7999      <xsl:choos e>
  8000                    
  8001       <xsl:when 
  8002        test="cont ains($ccdD ocTemplate Root, $ccd aDoc)"
  8003       >
  8004                         
  8005        <xsl:for-e ach 
  8006         select="$s ections"
  8007        >
  8008                              
  8009         <xsl:varia ble 
  8010          name="pos- int"
  8011         >
  8012          <xsl:value -of 
  8013           select="po sition()"
  8014          />
  8015         </xsl:vari able>
  8016                              
  8017         <xsl:varia ble 
  8018          name="temp lateId"
  8019         >
  8020                                    
  8021          <xsl:choos e>
  8022                                         
  8023           <xsl:when 
  8024            test="n1:t emplateId[ 2]"
  8025           >
  8026                                               
  8027            <xsl:value -of 
  8028             select="n1 :templateI d[2]/@root "
  8029            />
  8030                                          
  8031           </xsl:when >
  8032                                         
  8033           <xsl:other wise>
  8034                                               
  8035            <xsl:value -of 
  8036             select="n1 :templateI d/@root"
  8037            />
  8038                                          
  8039           </xsl:othe rwise>
  8040                                     
  8041          </xsl:choo se>
  8042                               
  8043         </xsl:vari able>
  8044                              
  8045         <xsl:varia ble 
  8046          name="curr entSection "
  8047                                              
  8048          select="n1 :text" 
  8049         />
  8050                              
  8051         <xsl:varia ble 
  8052          name="loin cCode"
  8053         >
  8054          <xsl:value -of 
  8055           select="n1 :code/@cod e"
  8056          />
  8057         </xsl:vari able>
  8058                              
  8059         <xsl:varia ble 
  8060          name="head erValue"
  8061         >
  8062                                    
  8063          <xsl:call- template 
  8064           name="getS ectionHead erText"
  8065          >
  8066                                         
  8067           <xsl:with- param 
  8068            name="loin cCode" 
  8069            select="$l oincCode"
  8070           />
  8071                                     
  8072          </xsl:call -template>
  8073                               
  8074         </xsl:vari able>
  8075                              
  8076         <xsl:varia ble 
  8077          name="head erHrefTitl eId"
  8078         >
  8079                                    
  8080          <xsl:value -of 
  8081           select="$c cdSectionH eaderRefPa ram[$pos-i nt]" 
  8082          />
  8083                               
  8084         </xsl:vari able>
  8085        
  8086                              
  8087         <xsl:choos e>
  8088                                    
  8089          <xsl:when
  8090                                             
  8091           test="$com pTemplateI dRoots  =  $templateI d or $comp TemplateId Roots  = c oncat($tem plateId,'. 1')"
  8092          >
  8093                                         
  8094           <!--<xsl:c all-templa te name="s ection-tit le"> <xsl: with-param  name="tit le"
  8095                                                                                 select ="$headerV alue"/> <x sl:with-pa ram name=" titleId" s elect="$he aderHrefTi tleId"/>
  8096                                                                                 <xsl:w ith-param  name="sect ionCount"  select="$s ectionsCou nt"/> </xs l:call-tem plate>
  8097                                                                                 <xsl:c all-templa te name="s ection-aut hor"> <xsl :with-para m name="te mplateId"
  8098                                                                                 select ="$templat eId"/> </x sl:call-te mplate> -- >
  8099                                         
  8100           <xsl:call- template 
  8101            name="sect ion-text"
  8102           >
  8103                                               
  8104            <xsl:with- param 
  8105             name="titl e" 
  8106             select="$h eaderValue
  8107            />
  8108                                               
  8109            <xsl:with- param 
  8110             name="titl eId" 
  8111             select="$h eaderHrefT itleId" 
  8112            />
  8113                                               
  8114            <xsl:with- param 
  8115             name="html Text" 
  8116             select="$c urrentSect ion" 
  8117            />
  8118                                               
  8119            <xsl:with- param 
  8120             name="sect ionPositio n" 
  8121             select="$p os-int" 
  8122            />
  8123                                          
  8124           </xsl:call -template>
  8125                                     
  8126          </xsl:when >
  8127                                    
  8128          <xsl:other wise>
  8129                                         
  8130           <section 
  8131            id="{$head erValue}"
  8132           >
  8133                                               
  8134            <header>
  8135                                                    
  8136             <h2>
  8137                                                         
  8138              <xsl:value -of 
  8139               select="$h eaderValue
  8140              />
  8141                                                         
  8142              <!--<span  class="cou nt"><xsl:v alue-of se lect="$pos -int"/></s pan> -->
  8143                                                     
  8144             </h2>
  8145            
  8146                                                    No d ata provid ed for thi s section.
  8147                                                
  8148            </header>
  8149                                          
  8150           </section>
  8151                                     
  8152          </xsl:othe rwise>
  8153                               
  8154         </xsl:choo se>
  8155                          
  8156        </xsl:for- each>
  8157                         
  8158        <xsl:for-e ach 
  8159         select="$c cdAddition alTemplate IdArrayPar am"
  8160        >
  8161                              
  8162         <xsl:varia ble 
  8163          name="temp lateId"
  8164         >
  8165                                    
  8166          <xsl:value -of 
  8167           select="."  
  8168          />
  8169                               
  8170         </xsl:vari able>
  8171                              
  8172         <xsl:varia ble 
  8173          name="pos- int" 
  8174          select="po sition()" 
  8175         />
  8176                              
  8177         <xsl:varia ble 
  8178          name="curr entSection "
  8179                                              
  8180          select="$s ections[n1 :templateI d[@root =  $templateI d or @root  = concat( $templateI d,'.1')]]/ n1:text" 
  8181         />
  8182                              
  8183         <xsl:varia ble 
  8184          name="head erValue"
  8185         >
  8186                                    
  8187          <xsl:value -of 
  8188           select="$c cdAddition alSectionH eaderParam [$pos-int]
  8189          />
  8190                               
  8191         </xsl:vari able>
  8192                              
  8193         <xsl:varia ble 
  8194          name="head erHrefTitl eId"
  8195         >
  8196                                    
  8197          <xsl:value -of 
  8198           select="$c cdAddition alSectionH eaderHrefP aram[$pos- int]" 
  8199          />
  8200                               
  8201         </xsl:vari able>
  8202        
  8203                              
  8204         <xsl:choos e>
  8205                                    
  8206          <xsl:when
  8207                                             
  8208           test="$com pTemplateI dRoots  =  $templateI d or $comp TemplateId Roots  = c oncat($tem plateId,'. 1')"
  8209          >
  8210                                         
  8211           <xsl:call- template 
  8212            name="sect ion-text"
  8213           >
  8214                                               
  8215            <xsl:with- param 
  8216             name="titl e" 
  8217             select="$h eaderValue
  8218            />
  8219                                               
  8220            <xsl:with- param 
  8221             name="titl eId" 
  8222             select="$h eaderHrefT itleId" 
  8223            />
  8224                                               
  8225            <xsl:with- param 
  8226             name="html Text" 
  8227             select="$c urrentSect ion" 
  8228            />
  8229                                               
  8230            <xsl:with- param 
  8231             name="sect ionPositio n" 
  8232             select="$p os-int" 
  8233            />
  8234                                          
  8235           </xsl:call -template>
  8236                                     
  8237          </xsl:when >
  8238                                    
  8239          <!-- <xsl: otherwise>  <section  id="{$head erValue}">  <header>  <h2> <xsl: value-of
  8240                                                                       sele ct="$heade rValue"/>  </h2> No d ata availa ble within  defined d ate range
  8241                                                                       for  this secti on. </head er> </sect ion> </xsl :otherwise > -->
  8242                               
  8243         </xsl:choo se>
  8244                          
  8245        </xsl:for- each>
  8246                     
  8247       </xsl:when >
  8248                    
  8249       <xsl:when 
  8250        test="cont ains($prog DocTemplat eRoot, $pr ogressDoc) "
  8251       >
  8252                         
  8253        <xsl:for-e ach 
  8254         select="$s ections"
  8255        >
  8256                              
  8257         <xsl:varia ble 
  8258          name="pos- int"
  8259         >
  8260          <xsl:value -of 
  8261           select="po sition()"
  8262          />
  8263         </xsl:vari able>
  8264                              
  8265         <xsl:varia ble 
  8266          name="temp lateId"
  8267         >
  8268                                    
  8269          <xsl:choos e>
  8270                                         
  8271           <xsl:when 
  8272            test="n1:t emplateId[ 2]"
  8273           >
  8274                                               
  8275            <xsl:value -of 
  8276             select="n1 :templateI d[2]/@root "
  8277            />
  8278                                          
  8279           </xsl:when >
  8280                                         
  8281           <xsl:other wise>
  8282                                               
  8283            <xsl:value -of 
  8284             select="n1 :templateI d/@root"
  8285            />
  8286                                          
  8287           </xsl:othe rwise>
  8288                                     
  8289          </xsl:choo se>
  8290                               
  8291         </xsl:vari able>
  8292                              
  8293         <xsl:varia ble 
  8294          name="curr entSection "
  8295                                              
  8296          select="n1 :text" 
  8297         />
  8298                              
  8299         <xsl:varia ble 
  8300          name="loin cCode"
  8301         >
  8302          <xsl:value -of 
  8303           select="n1 :code/@cod e"
  8304          />
  8305         </xsl:vari able>
  8306                              
  8307         <xsl:varia ble 
  8308          name="head erValue"
  8309         >
  8310                                    
  8311          <xsl:call- template 
  8312           name="getS ectionHead erText"
  8313          >
  8314                                         
  8315           <xsl:with- param 
  8316            name="loin cCode" 
  8317            select="$l oincCode"
  8318           />
  8319                                     
  8320          </xsl:call -template>
  8321                               
  8322         </xsl:vari able>
  8323                              
  8324         <xsl:varia ble 
  8325          name="head erHrefTitl eId"
  8326         >
  8327                                    
  8328          <xsl:value -of 
  8329           select="$p rogSection HeaderHref Param[$pos -int]" 
  8330          />
  8331                               
  8332         </xsl:vari able>
  8333        
  8334                              
  8335         <xsl:choos e>
  8336                                    
  8337          <xsl:when
  8338                                             
  8339           test="$com pTemplateI dRoots  =  $templateI d or $comp TemplateId Roots  = c oncat($tem plateId,'. 1')"
  8340          >
  8341                                         
  8342           <xsl:call- template 
  8343            name="sect ion-text"
  8344           >
  8345                                               
  8346            <xsl:with- param 
  8347             name="titl e" 
  8348             select="$h eaderValue
  8349            />
  8350                                               
  8351            <xsl:with- param 
  8352             name="titl eId" 
  8353             select="$h eaderHrefT itleId" 
  8354            />
  8355                                               
  8356            <xsl:with- param 
  8357             name="html Text" 
  8358             select="$c urrentSect ion" 
  8359            />
  8360                                               
  8361            <xsl:with- param 
  8362             name="sect ionPositio n" 
  8363             select="$p os-int" 
  8364            />
  8365                                          
  8366           </xsl:call -template>
  8367                                     
  8368          </xsl:when >
  8369                                    
  8370          <xsl:other wise>
  8371                                         
  8372           <section 
  8373            id="{$head erValue}"
  8374           >
  8375                                               
  8376            <header>
  8377                                                    
  8378             <h2>
  8379                                                         
  8380              <xsl:value -of 
  8381               select="$h eaderValue
  8382              />
  8383                                                         
  8384              <!--<span  class="cou nt"><xsl:v alue-of se lect="$pos -int"/></s pan> -->
  8385                                                     
  8386             </h2>
  8387            
  8388                                                    No d ata provid ed for thi s section.
  8389                                                
  8390            </header>
  8391                                          
  8392           </section>
  8393                                     
  8394          </xsl:othe rwise>
  8395                               
  8396         </xsl:choo se>
  8397                          
  8398        </xsl:for- each>
  8399                         
  8400        <xsl:for-e ach 
  8401         select="$p rogressAdd itionalTem plateIdArr ayParam"
  8402        >
  8403                              
  8404         <xsl:varia ble 
  8405          name="temp lateId"
  8406         >
  8407                                    
  8408          <xsl:value -of 
  8409           select="."  
  8410          />
  8411                               
  8412         </xsl:vari able>
  8413                              
  8414         <xsl:varia ble 
  8415          name="pos- int" 
  8416          select="po sition()" 
  8417         />
  8418                              
  8419         <xsl:varia ble 
  8420          name="curr entSection "
  8421                                              
  8422          select="$s ections[n1 :templateI d[@root =  $templateI d or @root  = concat( $templateI d,'.1')]]/ n1:text" 
  8423         />
  8424                              
  8425         <xsl:varia ble 
  8426          name="head erValue"
  8427         >
  8428                                    
  8429          <xsl:value -of 
  8430           select="$p rogressAdd itionalSec tionHeader Param[$pos -int]" 
  8431          />
  8432                               
  8433         </xsl:vari able>
  8434                              
  8435         <xsl:varia ble 
  8436          name="head erHrefTitl eId"
  8437         >
  8438                                    
  8439          <xsl:value -of
  8440                                             
  8441           select="$p rogressAdd itionalSec tionHeader HrefParam[ $pos-int]"  
  8442          />
  8443                               
  8444         </xsl:vari able>
  8445        
  8446                              
  8447         <xsl:choos e>
  8448                                    
  8449          <xsl:when
  8450                                             
  8451           test="$com pTemplateI dRoots  =  $templateI d or $comp TemplateId Roots  = c oncat($tem plateId,'. 1')"
  8452          >
  8453                                         
  8454           <xsl:call- template 
  8455            name="sect ion-text"
  8456           >
  8457                                               
  8458            <xsl:with- param 
  8459             name="titl e" 
  8460             select="$h eaderValue
  8461            />
  8462                                               
  8463            <xsl:with- param 
  8464             name="titl eId" 
  8465             select="$h eaderHrefT itleId" 
  8466            />
  8467                                               
  8468            <xsl:with- param 
  8469             name="html Text" 
  8470             select="$c urrentSect ion" 
  8471            />
  8472                                               
  8473            <xsl:with- param 
  8474             name="sect ionPositio n" 
  8475             select="$p os-int" 
  8476            />
  8477                                          
  8478           </xsl:call -template>
  8479                                     
  8480          </xsl:when >
  8481         
  8482                               
  8483         </xsl:choo se>
  8484                          
  8485        </xsl:for- each>
  8486                     
  8487       </xsl:when >
  8488                    
  8489       <xsl:other wise>
  8490       </xsl:othe rwise>
  8491               
  8492      </xsl:choo se>
  8493          
  8494     </xsl:temp late>
  8495         
  8496     <!-- top l evel secti on title - ->
  8497         
  8498     <xsl:templ ate 
  8499      name="sect ion-title"
  8500     >
  8501              
  8502      <xsl:param  
  8503       name="titl e" 
  8504      />
  8505              
  8506      <xsl:param  
  8507       name="titl eId" 
  8508      />
  8509              
  8510      <xsl:param  
  8511       name="sect ionCount" 
  8512      />
  8513     
  8514              
  8515      <xsl:choos e>
  8516                    
  8517       <xsl:when 
  8518        test="$sec tionCount  &gt; 1"
  8519       >
  8520                         
  8521        <h3>
  8522                              
  8523         <a 
  8524          name="{$ti tleId}" 
  8525          href="#toc "
  8526         >
  8527                                    
  8528          <xsl:value -of 
  8529           select="$t itle" 
  8530          />
  8531                               
  8532         </a>
  8533                          
  8534        </h3>
  8535                     
  8536       </xsl:when >
  8537                    
  8538       <xsl:other wise>
  8539                         
  8540        <h3>
  8541                              
  8542         <xsl:value -of 
  8543          select="$t itle" 
  8544         />
  8545                          
  8546        </h3>
  8547                     
  8548       </xsl:othe rwise>
  8549               
  8550      </xsl:choo se>
  8551          
  8552     </xsl:temp late>
  8553         
  8554     <!-- secti on author  -->
  8555         
  8556     <xsl:templ ate 
  8557      name="sect ion-author "
  8558     >
  8559              
  8560      <xsl:param  
  8561       name="temp lateId" 
  8562      />
  8563     
  8564              
  8565      <xsl:if
  8566                       
  8567       test="coun t(n1:compo nent/n1:se ction/n1:t emplateId[ @root = $t emplateId  or @root =  concat($t emplateId, '.1')]/*/n 1:author)& gt;0"
  8568      >
  8569                    
  8570       <div 
  8571        style="mar gin-left :  2em;"
  8572       >
  8573                         
  8574        <b>
  8575                              
  8576         <xsl:text>
  8577          Section Au thor: 
  8578         </xsl:text >
  8579                          
  8580        </b>
  8581                         
  8582        <xsl:for-e ach
  8583                                  
  8584         select="n1 :component /n1:sectio n/n1:templ ateId[@roo t = $templ ateId or @ root = con cat($templ ateId,'.1' )]/n1:auth or/n1:assi gnedAuthor "
  8585        >
  8586                              
  8587         <xsl:choos e>
  8588                                    
  8589          <xsl:when 
  8590           test="n1:a ssignedPer son/n1:nam e"
  8591          >
  8592                                         
  8593           <xsl:call- template 
  8594            name="show -name"
  8595           >
  8596                                               
  8597            <xsl:with- param 
  8598             name="name
  8599             select="n1 :assignedP erson/n1:n ame" 
  8600            />
  8601                                          
  8602           </xsl:call -template>
  8603                                         
  8604           <xsl:if 
  8605            test="n1:r epresented Organizati on"
  8606           >
  8607                                               
  8608            <xsl:text>
  8609            
  8610            </xsl:text >
  8611                                               
  8612            <xsl:call- template 
  8613             name="show -name"
  8614            >
  8615                                                    
  8616             <xsl:with- param 
  8617              name="name "
  8618                                                                      
  8619              select="n1 :represent edOrganiza tion/n1:na me" 
  8620             />
  8621                                                
  8622            </xsl:call -template>
  8623                                          
  8624           </xsl:if>
  8625                                     
  8626          </xsl:when >
  8627                                    
  8628          <xsl:when 
  8629           test="n1:a ssignedAut horingDevi ce/n1:soft wareName"
  8630          >
  8631                                         
  8632           <xsl:value -of 
  8633            select="n1 :assignedA uthoringDe vice/n1:so ftwareName
  8634           />
  8635                                     
  8636          </xsl:when >
  8637                                    
  8638          <xsl:other wise>
  8639                                         
  8640           <xsl:for-e ach 
  8641            select="n1 :id"
  8642           >
  8643                                               
  8644            <xsl:call- template 
  8645             name="show -id" 
  8646            />
  8647                                               
  8648            <br />
  8649                                          
  8650           </xsl:for- each>
  8651                                     
  8652          </xsl:othe rwise>
  8653                               
  8654         </xsl:choo se>
  8655                          
  8656        </xsl:for- each>
  8657                         
  8658        <br />
  8659                     
  8660       </div>
  8661               
  8662      </xsl:if>
  8663          
  8664     </xsl:temp late>
  8665         
  8666     <!-- top-l evel secti on Text -- >
  8667         
  8668     <xsl:templ ate 
  8669      name="sect ion-text"
  8670     >
  8671              
  8672      <xsl:param  
  8673       name="html Text" 
  8674      />
  8675              
  8676      <xsl:param  
  8677       name="titl e" 
  8678      />
  8679              
  8680      <xsl:param  
  8681       name="titl eId" 
  8682      />
  8683              
  8684      <xsl:param  
  8685       name="sect ionPositio n" 
  8686      />
  8687     
  8688              
  8689      <xsl:varia ble 
  8690       name="alph a" 
  8691       select="$h tmlText" 
  8692      />
  8693     
  8694              
  8695      <section 
  8696       id="{$titl e}"
  8697      >
  8698                    
  8699       <header>
  8700                         
  8701        <h2>
  8702                              
  8703         <label 
  8704          id="plus.{ $title}" 
  8705          onclick="j avascript: toggle('op en','{$tit le}')"
  8706         >
  8707          [+]  
  8708         </label>
  8709                              
  8710         <label 
  8711          id="minus. {$title}" 
  8712          onclick="j avascript: toggle('cl ose','{$ti tle}')"
  8713         >
  8714          [-]  
  8715         </label>
  8716        
  8717                              
  8718         <xsl:value -of 
  8719          select="$t itle" 
  8720         />
  8721                              
  8722         <!--<span  class="cou nt"><xsl:v alue-of se lect="$sec tionPositi on"/></spa n> -->
  8723                          
  8724        </h2>
  8725       
  8726                         
  8727        <xsl:choos e>
  8728                              
  8729         <xsl:when 
  8730          test="$htm lText[cont ains(., 'N o Informat ion')]"
  8731         >
  8732                                    
  8733          <xsl:text>
  8734           No data pr ovided for  this sect ion.
  8735          </xsl:text >
  8736                               
  8737         </xsl:when >
  8738                              
  8739         <xsl:when 
  8740          test="coun t($htmlTex t/n1:table ) &gt; 1"
  8741         >
  8742                                    
  8743          <!--<p> <s trong> Bus iness Rule s for Cons truction o f Medical  Informatio n:
  8744                                                                       </st rong> <xsl :value-of  select="$h tmlText/n1 :table[pos ition() =  1]/n1:tbod y/n1:tr/n1 :td[positi on()
  8745                                                                       = 2] "/> </p> - ->
  8746                               
  8747         </xsl:when >
  8748                              
  8749         <xsl:other wise>
  8750                               
  8751         </xsl:othe rwise>
  8752                          
  8753        </xsl:choo se>
  8754       
  8755                     
  8756       </header>
  8757                    
  8758       <div 
  8759        id="sectio n.{$title} "
  8760       >
  8761                         
  8762        <xsl:choos e>
  8763                              
  8764         <xsl:when 
  8765          test="$htm lText[cont ains(., 'N o Informat ion')]"
  8766         >
  8767                               
  8768         </xsl:when >
  8769                              
  8770         <xsl:other wise>
  8771                                    
  8772          <xsl:apply -templates  
  8773           select="$h tmlText" 
  8774          />
  8775                               
  8776         </xsl:othe rwise>
  8777                          
  8778        </xsl:choo se>
  8779                     
  8780       </div>
  8781               
  8782      </section>
  8783          
  8784     </xsl:temp late>
  8785    
  8786         
  8787     <!-- parag raph -->
  8788         
  8789     <xsl:templ ate 
  8790      match="n1: paragraph"
  8791     >
  8792              
  8793      <p>
  8794                    
  8795       <xsl:apply -templates  />
  8796               
  8797      </p>
  8798          
  8799     </xsl:temp late>
  8800         
  8801     <!-- pre f ormat -->
  8802         
  8803     <xsl:templ ate 
  8804      match="n1: pre"
  8805     >
  8806              
  8807      <pre>
  8808                    
  8809       <xsl:apply -templates  />
  8810               
  8811      </pre>
  8812          
  8813     </xsl:temp late>
  8814         
  8815     <!-- Conte nt w/ dele ted text i s hidden - ->
  8816         
  8817     <xsl:templ ate 
  8818      match="n1: content[@r evised='de lete']" 
  8819     />
  8820         
  8821     <!-- conte nt -->
  8822         
  8823     <xsl:templ ate 
  8824      match="n1: content"
  8825     >
  8826              
  8827      <xsl:apply -templates  />
  8828          
  8829     </xsl:temp late>
  8830         
  8831     <!-- line  break -->
  8832         
  8833     <xsl:templ ate 
  8834      match="n1: br"
  8835     >
  8836              
  8837      <xsl:eleme nt 
  8838       name='br'
  8839      >
  8840                    
  8841       <xsl:apply -templates  />
  8842               
  8843      </xsl:elem ent>
  8844          
  8845     </xsl:temp late>
  8846    
  8847         
  8848     <!-- under lining -->
  8849         
  8850     <xsl:templ ate 
  8851      match="n1: u"
  8852     >
  8853              
  8854      <u>
  8855                    
  8856       <xsl:apply -templates  />
  8857               
  8858      </u>
  8859          
  8860     </xsl:temp late>
  8861    
  8862         
  8863     <!-- list  -->
  8864         
  8865     <xsl:templ ate 
  8866      match="n1: list"
  8867     >
  8868              
  8869      <xsl:if 
  8870       test="n1:c aption"
  8871      >
  8872                    
  8873       <p>
  8874                         
  8875        <b>
  8876                              
  8877         <xsl:apply -templates  
  8878          select="n1 :caption" 
  8879         />
  8880                          
  8881        </b>
  8882                     
  8883       </p>
  8884               
  8885      </xsl:if>
  8886              
  8887      <ul>
  8888                    
  8889       <xsl:for-e ach 
  8890        select="n1 :item"
  8891       >
  8892                         
  8893        <li>
  8894                              
  8895         <xsl:apply -templates  />
  8896                          
  8897        </li>
  8898                     
  8899       </xsl:for- each>
  8900               
  8901      </ul>
  8902          
  8903     </xsl:temp late>
  8904         
  8905     <xsl:templ ate 
  8906      match="n1: list[@list Type='orde red']"
  8907     >
  8908              
  8909      <xsl:if 
  8910       test="n1:c aption"
  8911      >
  8912                    
  8913       <span 
  8914        style="fon t-weight:b old; "
  8915       >
  8916                         
  8917        <xsl:apply -templates  
  8918         select="n1 :caption" 
  8919        />
  8920                     
  8921       </span>
  8922               
  8923      </xsl:if>
  8924              
  8925      <ol>
  8926                    
  8927       <xsl:for-e ach 
  8928        select="n1 :item"
  8929       >
  8930                         
  8931        <li>
  8932                              
  8933         <xsl:apply -templates  />
  8934                          
  8935        </li>
  8936                     
  8937       </xsl:for- each>
  8938               
  8939      </ol>
  8940          
  8941     </xsl:temp late>
  8942         
  8943     <!-- capti on -->
  8944         
  8945     <xsl:templ ate 
  8946      match="n1: caption"
  8947     >
  8948              
  8949      <xsl:apply -templates  />
  8950              
  8951      <xsl:text>
  8952      
  8953      </xsl:text >
  8954          
  8955     </xsl:temp late>
  8956         
  8957     <!-- Table s -->
  8958         
  8959     <xsl:templ ate
  8960                  
  8961      match="n1: table/@*|n 1:thead/@* |n1:tfoot/ @*|n1:tbod y/@*|n1:co lgroup/@*| n1:col/@*| n1:tr/@*|n 1:th/@*|n1 :td/@*"
  8962     >
  8963              
  8964      <xsl:copy>
  8965                    
  8966       <xsl:copy- of 
  8967        select="@*
  8968       />
  8969                    
  8970       <xsl:apply -templates  />
  8971               
  8972      </xsl:copy >
  8973          
  8974     </xsl:temp late>
  8975         
  8976     <xsl:templ ate 
  8977      match="n1: table"
  8978     >
  8979              
  8980      <table 
  8981       class="nar r_table"
  8982      >
  8983                    
  8984       <xsl:copy- of 
  8985        select="@*
  8986       />
  8987                    
  8988       <xsl:apply -templates  />
  8989               
  8990      </table>
  8991          
  8992     </xsl:temp late>
  8993         
  8994     <xsl:templ ate 
  8995      match="n1: thead"
  8996     >
  8997              
  8998      <thead>
  8999                    
  9000       <xsl:copy- of 
  9001        select="@*
  9002       />
  9003                    
  9004       <xsl:apply -templates  />
  9005               
  9006      </thead>
  9007          
  9008     </xsl:temp late>
  9009         
  9010     <xsl:templ ate 
  9011      match="n1: tfoot"
  9012     >
  9013              
  9014      <tfoot>
  9015                    
  9016       <xsl:copy- of 
  9017        select="@*
  9018       />
  9019                    
  9020       <xsl:apply -templates  />
  9021               
  9022      </tfoot>
  9023          
  9024     </xsl:temp late>
  9025         
  9026     <xsl:templ ate 
  9027      match="n1: tbody"
  9028     >
  9029              
  9030      <tbody>
  9031                    
  9032       <xsl:copy- of 
  9033        select="@*
  9034       />
  9035                    
  9036       <xsl:apply -templates  />
  9037               
  9038      </tbody>
  9039          
  9040     </xsl:temp late>
  9041         
  9042     <xsl:templ ate 
  9043      match="n1: colgroup"
  9044     >
  9045              
  9046      <colgroup>
  9047                    
  9048       <xsl:copy- of 
  9049        select="@*
  9050       />
  9051                    
  9052       <xsl:apply -templates  />
  9053               
  9054      </colgroup >
  9055          
  9056     </xsl:temp late>
  9057         
  9058     <xsl:templ ate 
  9059      match="n1: col"
  9060     >
  9061              
  9062      <col>
  9063                    
  9064       <xsl:copy- of 
  9065        select="@*
  9066       />
  9067                    
  9068       <xsl:apply -templates  />
  9069               
  9070      </col>
  9071          
  9072     </xsl:temp late>
  9073         
  9074     <xsl:templ ate 
  9075      match="n1: tr"
  9076     >
  9077              
  9078      <tr 
  9079       class="nar r_tr"
  9080      >
  9081                    
  9082       <xsl:copy- of 
  9083        select="@*
  9084       />
  9085                    
  9086       <xsl:apply -templates  />
  9087               
  9088      </tr>
  9089          
  9090     </xsl:temp late>
  9091         
  9092     <xsl:templ ate 
  9093      match="n1: th"
  9094     >
  9095              
  9096      <th 
  9097       class="nar r_th"
  9098      >
  9099                    
  9100       <xsl:copy- of 
  9101        select="@*
  9102       />
  9103                    
  9104       <xsl:apply -templates  />
  9105               
  9106      </th>
  9107          
  9108     </xsl:temp late>
  9109         
  9110     <xsl:templ ate 
  9111      match="n1: td"
  9112     >
  9113              
  9114      <td>
  9115                    
  9116       <xsl:copy- of 
  9117        select="@*
  9118       />
  9119                    
  9120       <xsl:apply -templates  />
  9121               
  9122      </td>
  9123          
  9124     </xsl:temp late>
  9125         
  9126     <xsl:templ ate 
  9127      match="n1: table/n1:c aption"
  9128     >
  9129              
  9130      <span 
  9131       style="fon t-weight:b old; "
  9132      >
  9133                    
  9134       <xsl:apply -templates  />
  9135               
  9136      </span>
  9137          
  9138     </xsl:temp late>
  9139         
  9140     <!-- Rende rMultiMedi a this cur rently onl y handles  GIF's and  JPEG's. It  could,
  9141                      howe ver, be ex tended by  including  other imag e MIME typ es in the  predicate
  9142                      and/ or by gene rating <ob ject> or < applet> ta g with the  correct p arams depe nding
  9143                      on t he media t ype @ID =$ imageRef r eferencedO bject -->
  9144         
  9145     <xsl:templ ate 
  9146      match="n1: renderMult iMedia"
  9147     >
  9148              
  9149      <xsl:varia ble 
  9150       name="imag eRef" 
  9151       select="@r eferencedO bject" 
  9152      />
  9153              
  9154      <xsl:choos e>
  9155                    
  9156       <xsl:when 
  9157        test="//n1 :regionOfI nterest[@I D=$imageRe f]"
  9158       >
  9159                         
  9160        <!-- Here  is where t he Region  of Interes t image re ferencing  goes -->
  9161                         
  9162        <xsl:if
  9163                                  
  9164         test="//n1 :regionOfI nterest[@I D=$imageRe f]//n1:obs ervationMe dia/n1:val ue[@mediaT ype='image /gif' or
  9165          @mediaTyp e='image/j peg']"
  9166        >
  9167                              
  9168         <br 
  9169          clear="all
  9170         />
  9171                              
  9172         <xsl:eleme nt 
  9173          name="img"
  9174         >
  9175                                    
  9176          <xsl:attri bute 
  9177           name="src"
  9178          >
  9179           <xsl:value -of
  9180                                              
  9181            select="// n1:regionO fInterest[ @ID=$image Ref]//n1:o bservation Media/n1:v alue/n1:re ference/@v alue" 
  9182           />
  9183          </xsl:attr ibute>
  9184                               
  9185         </xsl:elem ent>
  9186                          
  9187        </xsl:if>
  9188                     
  9189       </xsl:when >
  9190                    
  9191       <xsl:other wise>
  9192                         
  9193        <!-- Here  is where t he direct  MultiMedia  image ref erencing g oes -->
  9194                         
  9195        <xsl:if
  9196                                  
  9197         test="//n1 :observati onMedia[@I D=$imageRe f]/n1:valu e[@mediaTy pe='image/ gif' or @m ediaType=' image/jpeg ']"
  9198        >
  9199                              
  9200         <br 
  9201          clear="all
  9202         />
  9203                              
  9204         <xsl:eleme nt 
  9205          name="img"
  9206         >
  9207                                    
  9208          <xsl:attri bute 
  9209           name="src"
  9210          >
  9211           <xsl:value -of
  9212                                              
  9213            select="// n1:observa tionMedia[ @ID=$image Ref]/n1:va lue/n1:ref erence/@va lue" 
  9214           />
  9215          </xsl:attr ibute>
  9216                               
  9217         </xsl:elem ent>
  9218                          
  9219        </xsl:if>
  9220                     
  9221       </xsl:othe rwise>
  9222               
  9223      </xsl:choo se>
  9224          
  9225     </xsl:temp late>
  9226         
  9227     <!-- Style code proce ssing Supp orts Bold,  Underline  and Itali cs display  -->
  9228         
  9229     <xsl:templ ate 
  9230      match="@st yleCode"
  9231     >
  9232              
  9233      <xsl:attri bute 
  9234       name="clas s"
  9235      >
  9236       <xsl:value -of 
  9237        select="."  
  9238       />
  9239      </xsl:attr ibute>
  9240          
  9241     </xsl:temp late>
  9242         
  9243     <!-- <xsl: template m atch="//n1 :*[@styleC ode]"> <xs l:if test= "@styleCod e='Bold'">
  9244                      <xsl :element n ame="b"> < xsl:apply- templates/ > </xsl:el ement> </x sl:if> <xs l:if
  9245                      test ="@styleCo de='Italic s'"> <xsl: element na me="i"> <x sl:apply-t emplates/>
  9246                      </xs l:element>  </xsl:if>  <xsl:if t est="@styl eCode='Und erline'">  <xsl:eleme nt
  9247                      name ="u"> <xsl :apply-tem plates/> < /xsl:eleme nt> </xsl: if> <xsl:i f test="co ntains(@st yleCode,'B old')
  9248                      and  contains(@ styleCode, 'Italics')  and not ( contains(@ styleCode,  'Underlin e'))">
  9249                      <xsl :element n ame="b"> < xsl:elemen t name="i" > <xsl:app ly-templat es/> </xsl :element>
  9250                      </xs l:element>  </xsl:if>  <xsl:if t est="conta ins(@style Code,'Bold ') and con tains(@sty leCode,'Un derline')
  9251                      and  not (conta ins(@style Code, 'Ita lics'))">  <xsl:eleme nt name="b "> <xsl:el ement
  9252                      name ="u"> <xsl :apply-tem plates/> < /xsl:eleme nt> </xsl: element> < /xsl:if>
  9253                      <xsl :if test=" contains(@ styleCode, 'Italics')  and conta ins(@style Code,'Unde rline')
  9254                      and  not (conta ins(@style Code, 'Bol d'))"> <xs l:element  name="i">  <xsl:eleme nt
  9255                      name ="u"> <xsl :apply-tem plates/> < /xsl:eleme nt> </xsl: element> < /xsl:if>
  9256                      <xsl :if test=" contains(@ styleCode, 'Italics')  and conta ins(@style Code,'Unde rline')
  9257                      and  contains(@ styleCode,  'Bold')">  <xsl:elem ent name=" b"> <xsl:e lement nam e="i">
  9258                      <xsl :element n ame="u"> < xsl:apply- templates/ > </xsl:el ement> </x sl:element >
  9259                      </xs l:element>  </xsl:if>  <xsl:if t est="not ( contains(@ styleCode, 'Italics')
  9260                      or c ontains(@s tyleCode,' Underline' ) or conta ins(@style Code, 'Bol d'))"> <xs l:apply-te mplates/>
  9261                      </xs l:if> </xs l:template > -->
  9262         
  9263     <!-- Super script or  Subscript  -->
  9264         
  9265     <xsl:templ ate 
  9266      match="n1: sup"
  9267     >
  9268              
  9269      <xsl:eleme nt 
  9270       name="sup"
  9271      >
  9272                    
  9273       <xsl:apply -templates  />
  9274               
  9275      </xsl:elem ent>
  9276          
  9277     </xsl:temp late>
  9278         
  9279     <xsl:templ ate 
  9280      match="n1: sub"
  9281     >
  9282              
  9283      <xsl:eleme nt 
  9284       name="sub"
  9285      >
  9286                    
  9287       <xsl:apply -templates  />
  9288               
  9289      </xsl:elem ent>
  9290          
  9291     </xsl:temp late>
  9292         
  9293     <!-- show- signature  -->
  9294         
  9295     <xsl:templ ate 
  9296      name="show -sig"
  9297     >
  9298              
  9299      <xsl:param  
  9300       name="sig"  
  9301      />
  9302              
  9303      <xsl:choos e>
  9304                    
  9305       <xsl:when 
  9306        test="$sig /@code =&a pos;S&apos ;"
  9307       >
  9308                         
  9309        <xsl:text>
  9310         signed
  9311        </xsl:text >
  9312                     
  9313       </xsl:when >
  9314                    
  9315       <xsl:when 
  9316        test="$sig /@code=&ap os;I&apos; "
  9317       >
  9318                         
  9319        <xsl:text>
  9320         intended
  9321        </xsl:text >
  9322                     
  9323       </xsl:when >
  9324                    
  9325       <xsl:when 
  9326        test="$sig /@code=&ap os;X&apos; "
  9327       >
  9328                         
  9329        <xsl:text>
  9330         signature  required
  9331        </xsl:text >
  9332                     
  9333       </xsl:when >
  9334               
  9335      </xsl:choo se>
  9336          
  9337     </xsl:temp late>
  9338         
  9339     <!-- show- id -->
  9340         
  9341     <xsl:templ ate 
  9342      name="show -id"
  9343     >
  9344              
  9345      <xsl:param  
  9346       name="id" 
  9347      />
  9348              
  9349      <xsl:choos e>
  9350                    
  9351       <xsl:when 
  9352        test="not( $id)"
  9353       >
  9354                         
  9355        <xsl:if 
  9356         test="not( @nullFlavo r)"
  9357        >
  9358                              
  9359         <xsl:if 
  9360          test="@ext ension"
  9361         >
  9362                                    
  9363          <xsl:value -of 
  9364           select="@e xtension" 
  9365          />
  9366                               
  9367         </xsl:if>
  9368                              
  9369         <xsl:text>
  9370           
  9371         </xsl:text >
  9372                              
  9373         <xsl:value -of 
  9374          select="@r oot" 
  9375         />
  9376                          
  9377        </xsl:if>
  9378                     
  9379       </xsl:when >
  9380                    
  9381       <xsl:other wise>
  9382                         
  9383        <xsl:if 
  9384         test="not( $id/@nullF lavor)"
  9385        >
  9386                              
  9387         <xsl:if 
  9388          test="$id/ @extension "
  9389         >
  9390                                    
  9391          <xsl:value -of 
  9392           select="$i d/@extensi on" 
  9393          />
  9394                               
  9395         </xsl:if>
  9396                              
  9397         <xsl:text>
  9398           
  9399         </xsl:text >
  9400                              
  9401         <xsl:value -of 
  9402          select="$i d/@root" 
  9403         />
  9404                          
  9405        </xsl:if>
  9406                     
  9407       </xsl:othe rwise>
  9408               
  9409      </xsl:choo se>
  9410          
  9411     </xsl:temp late>
  9412         
  9413     <!-- show- name -->
  9414         
  9415     <xsl:templ ate 
  9416      name="show -name"
  9417     >
  9418              
  9419      <xsl:param  
  9420       name="name
  9421      />
  9422              
  9423      <xsl:choos e>
  9424                    
  9425       <xsl:when 
  9426        test="$nam e/n1:famil y"
  9427       >
  9428                         
  9429        <xsl:if 
  9430         test="$nam e/n1:prefi x"
  9431        >
  9432                              
  9433         <xsl:value -of 
  9434          select="$n ame/n1:pre fix" 
  9435         />
  9436                              
  9437         <xsl:text>
  9438           
  9439         </xsl:text >
  9440                          
  9441        </xsl:if>
  9442                         
  9443        <xsl:value -of 
  9444         select="$n ame/n1:giv en" 
  9445        />
  9446                         
  9447        <xsl:text>
  9448          
  9449        </xsl:text >
  9450                         
  9451        <xsl:value -of 
  9452         select="$n ame/n1:fam ily" 
  9453        />
  9454                         
  9455        <xsl:if 
  9456         test="$nam e/n1:suffi x"
  9457        >
  9458                              
  9459         <xsl:text>
  9460         
  9461         </xsl:text >
  9462                              
  9463         <xsl:value -of 
  9464          select="$n ame/n1:suf fix" 
  9465         />
  9466                          
  9467        </xsl:if>
  9468                     
  9469       </xsl:when >
  9470                    
  9471       <xsl:other wise>
  9472                         
  9473        <xsl:value -of 
  9474         select="$n ame" 
  9475        />
  9476                     
  9477       </xsl:othe rwise>
  9478               
  9479      </xsl:choo se>
  9480          
  9481     </xsl:temp late>
  9482         
  9483     <!-- show- gender -->
  9484         
  9485     <xsl:templ ate 
  9486      name="show -gender"
  9487     >
  9488              
  9489      <xsl:choos e>
  9490                    
  9491       <xsl:when 
  9492        test="@cod e   = &apo s;M&apos;"
  9493       >
  9494                         
  9495        <xsl:text>
  9496         Male
  9497        </xsl:text >
  9498                     
  9499       </xsl:when >
  9500                    
  9501       <xsl:when 
  9502        test="@cod e  = &apos ;F&apos;"
  9503       >
  9504                         
  9505        <xsl:text>
  9506         Female
  9507        </xsl:text >
  9508                     
  9509       </xsl:when >
  9510                    
  9511       <xsl:when 
  9512        test="@cod e  = &apos ;U&apos;"
  9513       >
  9514                         
  9515        <xsl:text>
  9516         Undifferen tiated
  9517        </xsl:text >
  9518                     
  9519       </xsl:when >
  9520               
  9521      </xsl:choo se>
  9522          
  9523     </xsl:temp late>
  9524         
  9525     <!-- show- race -->
  9526         
  9527     <xsl:templ ate 
  9528      name="show -race"
  9529     >
  9530              
  9531      <xsl:param  
  9532       name="race CodeDispla y" 
  9533      />
  9534              
  9535      <xsl:param  
  9536       name="sdtc -raceCodeD isplay" 
  9537      />
  9538              
  9539      <xsl:param  
  9540       name="race CodeText" 
  9541      />
  9542              
  9543      <xsl:param  
  9544       name="sdtc -raceCodeT ext" 
  9545      />
  9546              
  9547      <xsl:choos e>
  9548                    
  9549       <xsl:when 
  9550        test="$rac eCodeDispl ay and $sd tc-raceCod eDisplay"
  9551       >
  9552                         
  9553        <xsl:value -of 
  9554         select="co ncat($race CodeDispla y,', ',$sd tc-raceCod eDisplay)"  
  9555        />
  9556                     
  9557       </xsl:when >
  9558                    
  9559       <xsl:when 
  9560        test="$rac eCodeText  and $sdtc- raceCodeDi splay"
  9561       >
  9562                         
  9563        <xsl:value -of 
  9564         select="co ncat($race CodeText,' , ',$sdtc- raceCodeDi splay)" 
  9565        />
  9566                     
  9567       </xsl:when >
  9568                    
  9569       <xsl:when 
  9570        test="$rac eCodeDispl ay and $sd tc-raceCod eText"
  9571       >
  9572                         
  9573        <xsl:value -of 
  9574         select="co ncat($race CodeDispla y,', ',$sd tc-raceCod eText)" 
  9575        />
  9576                     
  9577       </xsl:when >
  9578                    
  9579       <xsl:when 
  9580        test="$rac eCodeText  and $sdtc- raceCodeTe xt"
  9581       >
  9582                         
  9583        <xsl:value -of 
  9584         select="co ncat($race CodeText,' , ',$sdtc- raceCodeTe xt)" 
  9585        />
  9586                     
  9587       </xsl:when >
  9588                    
  9589       <xsl:when 
  9590        test="$rac eCodeDispl ay"
  9591       >
  9592                         
  9593        <xsl:value -of 
  9594         select="$r aceCodeDis play" 
  9595        />
  9596                     
  9597       </xsl:when >
  9598                    
  9599       <xsl:when 
  9600        test="$rac eCodeText"
  9601       >
  9602                         
  9603        <xsl:value -of 
  9604         select="$r aceCodeTex t" 
  9605        />
  9606                     
  9607       </xsl:when >
  9608                    
  9609       <xsl:when 
  9610        test="$sdt c-raceCode Display"
  9611       >
  9612                         
  9613        <xsl:value -of 
  9614         select="$s dtc-raceCo deDisplay"  
  9615        />
  9616                     
  9617       </xsl:when >
  9618                    
  9619       <xsl:when 
  9620        test="sdtc -raceCodeT ext"
  9621       >
  9622                         
  9623        <xsl:value -of 
  9624         select="sd tc-raceCod eText" 
  9625        />
  9626                     
  9627       </xsl:when >
  9628                    
  9629       <xsl:other wise>
  9630                         
  9631        <xsl:value -of 
  9632         select="''
  9633        />
  9634                     
  9635       </xsl:othe rwise>
  9636               
  9637      </xsl:choo se>
  9638          
  9639     </xsl:temp late>
  9640         
  9641     <!-- show- race-ethni city -->
  9642         
  9643     <xsl:templ ate 
  9644      name="show -race-ethn icity"
  9645     >
  9646              
  9647      <xsl:choos e>
  9648                    
  9649       <xsl:when 
  9650        test="@dis playName"
  9651       >
  9652                         
  9653        <xsl:value -of 
  9654         select="@d isplayName
  9655        />
  9656                     
  9657       </xsl:when >
  9658                    
  9659       <xsl:other wise>
  9660                         
  9661        <xsl:value -of 
  9662         select="''
  9663        />
  9664                     
  9665       </xsl:othe rwise>
  9666               
  9667      </xsl:choo se>
  9668          
  9669     </xsl:temp late>
  9670         
  9671     <!-- show- contactInf o -->
  9672         
  9673     <xsl:templ ate 
  9674      name="show -contactIn fo"
  9675     >
  9676              
  9677      <xsl:param  
  9678       name="cont act" 
  9679      />
  9680              
  9681      <xsl:call- template 
  9682       name="show -address"
  9683      >
  9684                    
  9685       <xsl:with- param 
  9686        name="addr ess" 
  9687        select="$c ontact/n1: addr" 
  9688       />
  9689               
  9690      </xsl:call -template>
  9691              
  9692      <xsl:call- template 
  9693       name="show -telecom"
  9694      >
  9695                    
  9696       <xsl:with- param 
  9697        name="tele com" 
  9698        select="$c ontact/n1: telecom" 
  9699       />
  9700               
  9701      </xsl:call -template>
  9702          
  9703     </xsl:temp late>
  9704         
  9705     <!-- show- address -- >
  9706         
  9707     <xsl:templ ate 
  9708      name="show -address"
  9709     >
  9710              
  9711      <xsl:param  
  9712       name="addr ess" 
  9713      />
  9714              
  9715      <xsl:choos e>
  9716                    
  9717       <xsl:when 
  9718        test="$add ress"
  9719       >
  9720                         
  9721        <xsl:if 
  9722         test="$add ress/@use"
  9723        >
  9724                              
  9725         <xsl:text>
  9726           
  9727         </xsl:text >
  9728                              
  9729         <xsl:call- template 
  9730          name="tran slateTelec omCode"
  9731         >
  9732                                    
  9733          <xsl:with- param 
  9734           name="code
  9735           select="$a ddress/@us e" 
  9736          />
  9737                               
  9738         </xsl:call -template>
  9739                              
  9740         <xsl:text>
  9741          :
  9742         </xsl:text >
  9743                              
  9744         <br />
  9745                          
  9746        </xsl:if>
  9747                         
  9748        <xsl:for-e ach 
  9749         select="$a ddress/n1: streetAddr essLine"
  9750        >
  9751                              
  9752         <xsl:value -of 
  9753          select="."  
  9754         />
  9755                              
  9756         <br />
  9757                          
  9758        </xsl:for- each>
  9759                         
  9760        <xsl:if 
  9761         test="$add ress/n1:st reetName"
  9762        >
  9763                              
  9764         <xsl:value -of 
  9765          select="$a ddress/n1: streetName
  9766         />
  9767                              
  9768         <xsl:text>
  9769           
  9770         </xsl:text >
  9771                              
  9772         <xsl:value -of 
  9773          select="$a ddress/n1: houseNumbe r" 
  9774         />
  9775                              
  9776         <br />
  9777                          
  9778        </xsl:if>
  9779                         
  9780        <xsl:if 
  9781         test="stri ng-length( $address/n 1:city)>0"
  9782        >
  9783                              
  9784         <xsl:value -of 
  9785          select="$a ddress/n1: city" 
  9786         />
  9787                          
  9788        </xsl:if>
  9789                         
  9790        <xsl:if 
  9791         test="stri ng-length( $address/n 1:state)>0 "
  9792        >
  9793                              
  9794         <xsl:text>
  9795          ,&#160;
  9796         </xsl:text >
  9797                              
  9798         <xsl:value -of 
  9799          select="$a ddress/n1: state" 
  9800         />
  9801                          
  9802        </xsl:if>
  9803                         
  9804        <xsl:if 
  9805         test="stri ng-length( $address/n 1:postalCo de)>0"
  9806        >
  9807                              
  9808         <xsl:text>
  9809          &#160;
  9810         </xsl:text >
  9811                              
  9812         <xsl:value -of 
  9813          select="$a ddress/n1: postalCode
  9814         />
  9815                          
  9816        </xsl:if>
  9817                         
  9818        <xsl:if 
  9819         test="stri ng-length( $address/n 1:country) >0"
  9820        >
  9821                              
  9822         <xsl:text>
  9823          ,&#160;
  9824         </xsl:text >
  9825                              
  9826         <xsl:value -of 
  9827          select="$a ddress/n1: country" 
  9828         />
  9829                          
  9830        </xsl:if>
  9831                     
  9832       </xsl:when >
  9833                    
  9834       <xsl:other wise>
  9835                         
  9836        <xsl:text>
  9837         address no t availabl e
  9838        </xsl:text >
  9839                     
  9840       </xsl:othe rwise>
  9841               
  9842      </xsl:choo se>
  9843              
  9844      <br />
  9845          
  9846     </xsl:temp late>
  9847         
  9848     <!-- show- telecom -- >
  9849         
  9850     <xsl:templ ate 
  9851      name="show -telecom"
  9852     >
  9853              
  9854      <xsl:param  
  9855       name="tele com" 
  9856      />
  9857              
  9858      <xsl:choos e>
  9859                    
  9860       <xsl:when 
  9861        test="$tel ecom"
  9862       >
  9863                         
  9864        <xsl:varia ble 
  9865         name="type "
  9866                                        
  9867         select="su bstring-be fore($tele com/@value , ':')" 
  9868        />
  9869                         
  9870        <xsl:varia ble 
  9871         name="valu e"
  9872                                        
  9873         select="su bstring-af ter($telec om/@value,  ':')" 
  9874        />
  9875                         
  9876        <xsl:if 
  9877         test="$typ e"
  9878        >
  9879                              
  9880         <xsl:call- template 
  9881          name="tran slateTelec omCode"
  9882         >
  9883                                    
  9884          <xsl:with- param 
  9885           name="code
  9886           select="$t ype" 
  9887          />
  9888                               
  9889         </xsl:call -template>
  9890                              
  9891         <xsl:if 
  9892          test="@use "
  9893         >
  9894                                    
  9895          <xsl:text>
  9896            (
  9897          </xsl:text >
  9898                                    
  9899          <xsl:call- template 
  9900           name="tran slateTelec omCode"
  9901          >
  9902                                         
  9903           <xsl:with- param 
  9904            name="code
  9905            select="@u se" 
  9906           />
  9907                                     
  9908          </xsl:call -template>
  9909                                    
  9910          <xsl:text>
  9911           )
  9912          </xsl:text >
  9913                               
  9914         </xsl:if>
  9915                              
  9916         <xsl:text>
  9917         
  9918         </xsl:text >
  9919                              
  9920         <xsl:text>
  9921           
  9922         </xsl:text >
  9923                              
  9924         <xsl:value -of 
  9925          select="$v alue" 
  9926         />
  9927                          
  9928        </xsl:if>
  9929                     
  9930       </xsl:when >
  9931                    
  9932       <xsl:other wise>
  9933                         
  9934        <xsl:text>
  9935         Telecom in formation  not availa ble
  9936        </xsl:text >
  9937                     
  9938       </xsl:othe rwise>
  9939               
  9940      </xsl:choo se>
  9941              
  9942      <br />
  9943          
  9944     </xsl:temp late>
  9945         
  9946     <!-- show- recipientT ype -->
  9947         
  9948     <xsl:templ ate 
  9949      name="show -recipient Type"
  9950     >
  9951              
  9952      <xsl:param  
  9953       name="type Code" 
  9954      />
  9955              
  9956      <xsl:choos e>
  9957                    
  9958       <xsl:when 
  9959        test="$typ eCode='PRC P'"
  9960       >
  9961                         Prim ary Recipi ent:
  9962                     
  9963       </xsl:when >
  9964                    
  9965       <xsl:when 
  9966        test="$typ eCode='TRC '"
  9967       >
  9968                         Seco ndary Reci pient:
  9969                     
  9970       </xsl:when >
  9971                    
  9972       <xsl:other wise>
  9973                         Reci pient:
  9974                     
  9975       </xsl:othe rwise>
  9976               
  9977      </xsl:choo se>
  9978          
  9979     </xsl:temp late>
  9980         
  9981     <!-- Conve rt Telecom  URL to di splay text  -->
  9982         
  9983     <xsl:templ ate 
  9984      name="tran slateTelec omCode"
  9985     >
  9986              
  9987      <xsl:param  
  9988       name="code
  9989      />
  9990              
  9991      <!--xsl:va lue-of sel ect="docum ent('voc.x ml')/syste ms/system[ @root=$cod e/@codeSys tem]/code[ @value=$co de/@code]/ @displayNa me"/ -->
  9992              
  9993      <!--xsl:va lue-of sel ect="docum ent('codes .xml')/*/c ode[@code= $code]/@di splay"/ -- >
  9994              
  9995      <xsl:choos e>
  9996                    
  9997       <!-- looku p table Te lecom URI  -->
  9998                    
  9999       <xsl:when 
  10000        test="$cod e='tel'"
  10001       >
  10002                         
  10003        <xsl:text>
  10004         Tel
  10005        </xsl:text >
  10006                     
  10007       </xsl:when >
  10008                    
  10009       <xsl:when 
  10010        test="$cod e='fax'"
  10011       >
  10012                         
  10013        <xsl:text>
  10014         Fax
  10015        </xsl:text >
  10016                     
  10017       </xsl:when >
  10018                    
  10019       <xsl:when 
  10020        test="$cod e='http'"
  10021       >
  10022                         
  10023        <xsl:text>
  10024         Web
  10025        </xsl:text >
  10026                     
  10027       </xsl:when >
  10028                    
  10029       <xsl:when 
  10030        test="$cod e='mailto' "
  10031       >
  10032                         
  10033        <xsl:text>
  10034         Mail
  10035        </xsl:text >
  10036                     
  10037       </xsl:when >
  10038                    
  10039       <xsl:when 
  10040        test="$cod e='H'"
  10041       >
  10042                         
  10043        <xsl:text>
  10044         Home
  10045        </xsl:text >
  10046                     
  10047       </xsl:when >
  10048                    
  10049       <xsl:when 
  10050        test="$cod e='HV'"
  10051       >
  10052                         
  10053        <xsl:text>
  10054         Vacation H ome
  10055        </xsl:text >
  10056                     
  10057       </xsl:when >
  10058                    
  10059       <xsl:when 
  10060        test="$cod e='HP'"
  10061       >
  10062                         
  10063        <xsl:text>
  10064         Primary Ho me
  10065        </xsl:text >
  10066                     
  10067       </xsl:when >
  10068                    
  10069       <xsl:when 
  10070        test="$cod e='WP'"
  10071       >
  10072                         
  10073        <xsl:text>
  10074         Work Place
  10075        </xsl:text >
  10076                     
  10077       </xsl:when >
  10078                    
  10079       <xsl:when 
  10080        test="$cod e='PUB'"
  10081       >
  10082                         
  10083        <xsl:text>
  10084         Pub
  10085        </xsl:text >
  10086                     
  10087       </xsl:when >
  10088                    
  10089       <xsl:other wise>
  10090                         
  10091        <xsl:text>
  10092         {$code='
  10093        </xsl:text >
  10094                         
  10095        <xsl:value -of 
  10096         select="$c ode" 
  10097        />
  10098                         
  10099        <xsl:text>
  10100         '?}
  10101        </xsl:text >
  10102                     
  10103       </xsl:othe rwise>
  10104               
  10105      </xsl:choo se>
  10106          
  10107     </xsl:temp late>
  10108         
  10109     <!-- conve rt RoleCla ssAssociat ive code t o display  text -->
  10110         
  10111     <xsl:templ ate 
  10112      name="show DisplayNam e"
  10113     >
  10114              
  10115      <xsl:param  
  10116       name="code
  10117      />
  10118     
  10119              
  10120      <xsl:if
  10121                       
  10122       test="($co de/@code)  and ($code /@codeSyst em='2.16.8 40.1.11388 3.5.111')  and ($code /@displayN ame)"
  10123      >
  10124                    
  10125       <xsl:text>
  10126         (
  10127       </xsl:text >
  10128                    
  10129       <xsl:value -of 
  10130        select="$c ode/@displ ayName" 
  10131       />
  10132                    
  10133       <xsl:text>
  10134        )
  10135       </xsl:text >
  10136               
  10137      </xsl:if>
  10138          
  10139     </xsl:temp late>
  10140         
  10141     <xsl:templ ate 
  10142      name="tran slateRoleA ssoCode"
  10143     >
  10144              
  10145      <xsl:param  
  10146       name="clas sCode" 
  10147      />
  10148              
  10149      <xsl:param  
  10150       name="code
  10151      />
  10152              
  10153      <xsl:choos e>
  10154                    
  10155       <xsl:when 
  10156        test="$cla ssCode='AF FL'"
  10157       >
  10158                         
  10159        <xsl:text>
  10160         affiliate
  10161        </xsl:text >
  10162                     
  10163       </xsl:when >
  10164                    
  10165       <xsl:when 
  10166        test="$cla ssCode='AG NT'"
  10167       >
  10168                         
  10169        <xsl:text>
  10170         agent
  10171        </xsl:text >
  10172                     
  10173       </xsl:when >
  10174                    
  10175       <xsl:when 
  10176        test="$cla ssCode='AS SIGNED'"
  10177       >
  10178                         
  10179        <xsl:text>
  10180         assigned e ntity
  10181        </xsl:text >
  10182                     
  10183       </xsl:when >
  10184                    
  10185       <xsl:when 
  10186        test="$cla ssCode='CO MPAR'"
  10187       >
  10188                         
  10189        <xsl:text>
  10190         commission ing party
  10191        </xsl:text >
  10192                     
  10193       </xsl:when >
  10194                    
  10195       <xsl:when 
  10196        test="$cla ssCode='CO N'"
  10197       >
  10198                         
  10199        <xsl:text>
  10200         contact
  10201        </xsl:text >
  10202                     
  10203       </xsl:when >
  10204                    
  10205       <xsl:when 
  10206        test="$cla ssCode='EC ON'"
  10207       >
  10208                         
  10209        <xsl:text>
  10210         emergency  contact
  10211        </xsl:text >
  10212                     
  10213       </xsl:when >
  10214                    
  10215       <xsl:when 
  10216        test="$cla ssCode='NO K'"
  10217       >
  10218                         
  10219        <xsl:text>
  10220         next of ki n
  10221        </xsl:text >
  10222                     
  10223       </xsl:when >
  10224                    
  10225       <xsl:when 
  10226        test="$cla ssCode='SG NOFF'"
  10227       >
  10228                         
  10229        <xsl:text>
  10230         signing au thority
  10231        </xsl:text >
  10232                     
  10233       </xsl:when >
  10234                    
  10235       <xsl:when 
  10236        test="$cla ssCode='GU ARD'"
  10237       >
  10238                         
  10239        <xsl:text>
  10240         guardian
  10241        </xsl:text >
  10242                     
  10243       </xsl:when >
  10244                    
  10245       <xsl:when 
  10246        test="$cla ssCode='GU AR'"
  10247       >
  10248                         
  10249        <xsl:text>
  10250         guardian
  10251        </xsl:text >
  10252                     
  10253       </xsl:when >
  10254                    
  10255       <xsl:when 
  10256        test="$cla ssCode='CI T'"
  10257       >
  10258                         
  10259        <xsl:text>
  10260         citizen
  10261        </xsl:text >
  10262                     
  10263       </xsl:when >
  10264                    
  10265       <xsl:when 
  10266        test="$cla ssCode='CO VPTY'"
  10267       >
  10268                         
  10269        <xsl:text>
  10270         covered pa rty
  10271        </xsl:text >
  10272                     
  10273       </xsl:when >
  10274                    
  10275       <xsl:when 
  10276        test="$cla ssCode='PR S'"
  10277       >
  10278                         
  10279        <xsl:text>
  10280         personal r elationshi p
  10281        </xsl:text >
  10282                     
  10283       </xsl:when >
  10284                    
  10285       <xsl:when 
  10286        test="$cla ssCode='CA REGIVER'"
  10287       >
  10288                         
  10289        <xsl:text>
  10290         care giver
  10291        </xsl:text >
  10292                     
  10293       </xsl:when >
  10294                    
  10295       <xsl:when 
  10296        test="$cla ssCode='PR OV'"
  10297       >
  10298                         
  10299        <xsl:text>
  10300         provider
  10301        </xsl:text >
  10302                     
  10303       </xsl:when >
  10304                    
  10305       <xsl:other wise>
  10306                         
  10307        <xsl:text>
  10308         {$classCod e='
  10309        </xsl:text >
  10310                         
  10311        <xsl:value -of 
  10312         select="$c lassCode" 
  10313        />
  10314                         
  10315        <xsl:text>
  10316         '?}
  10317        </xsl:text >
  10318                     
  10319       </xsl:othe rwise>
  10320               
  10321      </xsl:choo se>
  10322              
  10323      <!--<xsl:i f test="($ code/@code ) and ($co de/@codeSy stem='2.16 .840.1.113 883.5.111' )">
  10324                                <xsl:t ext> </xsl :text> <xs l:choose>  <xsl:when  test="$cod e/@code='F TH'"> <xsl :text>(Fat her)</xsl: text>
  10325                                </xsl: when> <xsl :when test ="$code/@c ode='MTH'" > <xsl:tex t>(Mother) </xsl:text >
  10326                                </xsl: when> <xsl :when test ="$code/@c ode='NPRN' "> <xsl:te xt>(Natura l parent)< /xsl:text>
  10327                                </xsl: when> <xsl :when test ="$code/@c ode='STPPR N'"> <xsl: text>(Step  parent)</ xsl:text>
  10328                                </xsl: when> <xsl :when test ="$code/@c ode='SONC' "> <xsl:te xt>(Son)</ xsl:text>
  10329                                </xsl: when> <xsl :when test ="$code/@c ode='DAUC' "> <xsl:te xt>(Daught er)</xsl:t ext>
  10330                                </xsl: when> <xsl :when test ="$code/@c ode='CHILD '"> <xsl:t ext>(Child )</xsl:tex t>
  10331                                </xsl: when> <xsl :when test ="$code/@c ode='EXT'" > <xsl:tex t>(Extende d family
  10332                                member )</xsl:tex t> </xsl:w hen> <xsl: when test= "$code/@co de='NBOR'" > <xsl:tex t>(Neighbo r)</xsl:te xt>
  10333                                </xsl: when> <xsl :when test ="$code/@c ode='SIGOT HR'"> <xsl :text>(Sig nificant
  10334                                other) </xsl:text > </xsl:wh en> <xsl:o therwise>  <xsl:text> {$code/@co de='</xsl: text>
  10335                                <xsl:v alue-of se lect="$cod e/@code"/>  <xsl:text >'?}</xsl: text> </xs l:otherwis e>
  10336                                </xsl: choose> </ xsl:if> -- >
  10337          
  10338     </xsl:temp late>
  10339         
  10340     <!-- show  time -->
  10341         
  10342     <xsl:templ ate 
  10343      name="show -time"
  10344     >
  10345              
  10346      <xsl:param  
  10347       name="date time" 
  10348      />
  10349              
  10350      <xsl:choos e>
  10351                    
  10352       <xsl:when 
  10353        test="not( $datetime) "
  10354       >
  10355                         
  10356        <xsl:call- template 
  10357         name="form atDateTime "
  10358        >
  10359                              
  10360         <xsl:with- param 
  10361          name="date
  10362          select="@v alue" 
  10363         />
  10364                          
  10365        </xsl:call -template>
  10366                         
  10367        <xsl:text>
  10368          
  10369        </xsl:text >
  10370                     
  10371       </xsl:when >
  10372                    
  10373       <xsl:other wise>
  10374                         
  10375        <xsl:call- template 
  10376         name="form atDateTime "
  10377        >
  10378                              
  10379         <xsl:with- param 
  10380          name="date
  10381          select="$d atetime/@v alue" 
  10382         />
  10383                          
  10384        </xsl:call -template>
  10385                         
  10386        <xsl:text>
  10387          
  10388        </xsl:text >
  10389                     
  10390       </xsl:othe rwise>
  10391               
  10392      </xsl:choo se>
  10393          
  10394     </xsl:temp late>
  10395         
  10396     <!-- patic ipant faci lity and d ate -->
  10397         
  10398     <xsl:templ ate 
  10399      name="faci lityAndDat es"
  10400     >
  10401              
  10402      <table 
  10403       class="hea der_table"
  10404      >
  10405                    
  10406       <tbody>
  10407                         
  10408        <!-- facil ity id -->
  10409                         
  10410        <tr>
  10411                              
  10412         <td 
  10413          width="20%
  10414          bgcolor="# 3399ff"
  10415         >
  10416                                    
  10417          <span 
  10418           class="td_ label"
  10419          >
  10420                                         
  10421           <xsl:text>
  10422            Facility I D
  10423           </xsl:text >
  10424                                     
  10425          </span>
  10426                               
  10427         </td>
  10428                              
  10429         <td 
  10430          colspan="3 "
  10431         >
  10432                                    
  10433          <xsl:choos e>
  10434                                         
  10435           <xsl:when
  10436                                                  
  10437            test="coun t(/n1:Clin icalDocume nt/n1:part icipant
  10438                                                     [@ typeCode=' LOC'][@con textContro lCode='OP' ]
  10439                                                     /n 1:associat edEntity[@ classCode= 'SDLOC']/n 1:id)&gt;0 "
  10440           >
  10441                                               
  10442            <!-- chang e context  node -->
  10443                                               
  10444            <xsl:for-e ach
  10445                                                       
  10446             select="/n 1:Clinical Document/n 1:particip ant
  10447                                                      [@ typeCode=' LOC'][@con textContro lCode='OP' ]
  10448                                                      /n 1:associat edEntity[@ classCode= 'SDLOC']/n 1:id"
  10449            >
  10450                                                    
  10451             <xsl:call- template 
  10452              name="show -id" 
  10453             />
  10454                                                    
  10455             <!-- chang e context  node again , for the  code -->
  10456                                                    
  10457             <xsl:for-e ach 
  10458              select=".. /n1:code"
  10459             >
  10460                                                         
  10461              <xsl:text>
  10462                (
  10463              </xsl:text >
  10464                                                         
  10465              <xsl:call- template 
  10466               name="show -code"
  10467              >
  10468                                                               
  10469               <xsl:with- param 
  10470                name="code
  10471                select="."  
  10472               />
  10473                                                          
  10474              </xsl:call -template>
  10475                                                         
  10476              <xsl:text>
  10477               )
  10478              </xsl:text >
  10479                                                     
  10480             </xsl:for- each>
  10481                                                
  10482            </xsl:for- each>
  10483                                          
  10484           </xsl:when >
  10485                                         
  10486           <xsl:other wise>
  10487                                               Not avai lable
  10488                                          
  10489           </xsl:othe rwise>
  10490                                     
  10491          </xsl:choo se>
  10492                               
  10493         </td>
  10494                          
  10495        </tr>
  10496                         
  10497        <!-- Perio d reported  -->
  10498                         
  10499        <tr>
  10500                              
  10501         <td 
  10502          width="20%
  10503          bgcolor="# 3399ff"
  10504         >
  10505                                    
  10506          <span 
  10507           class="td_ label"
  10508          >
  10509                                         
  10510           <xsl:text>
  10511            First day  of period  reported
  10512           </xsl:text >
  10513                                     
  10514          </span>
  10515                               
  10516         </td>
  10517                              
  10518         <td 
  10519          colspan="3 "
  10520         >
  10521                                    
  10522          <xsl:call- template 
  10523           name="show -time"
  10524          >
  10525                                         
  10526           <xsl:with- param 
  10527            name="date time"
  10528                                                           
  10529            select="/n 1:Clinical Document/n 1:document ationOf
  10530                                                     /n 1:serviceE vent/n1:ef fectiveTim e/n1:low" 
  10531           />
  10532                                     
  10533          </xsl:call -template>
  10534                               
  10535         </td>
  10536                          
  10537        </tr>
  10538                         
  10539        <tr>
  10540                              
  10541         <td 
  10542          width="20%
  10543          bgcolor="# 3399ff"
  10544         >
  10545                                    
  10546          <span 
  10547           class="td_ label"
  10548          >
  10549                                         
  10550           <xsl:text>
  10551            Last day o f period r eported
  10552           </xsl:text >
  10553                                     
  10554          </span>
  10555                               
  10556         </td>
  10557                              
  10558         <td 
  10559          colspan="3 "
  10560         >
  10561                                    
  10562          <xsl:call- template 
  10563           name="show -time"
  10564          >
  10565                                         
  10566           <xsl:with- param 
  10567            name="date time"
  10568                                                           
  10569            select="/n 1:Clinical Document/n 1:document ationOf
  10570                                                     /n 1:serviceE vent/n1:ef fectiveTim e/n1:high"  
  10571           />
  10572                                     
  10573          </xsl:call -template>
  10574                               
  10575         </td>
  10576                          
  10577        </tr>
  10578                     
  10579       </tbody>
  10580               
  10581      </table>
  10582          
  10583     </xsl:temp late>
  10584         
  10585     <!-- show  assignedEn tity -->
  10586         
  10587     <xsl:templ ate 
  10588      name="show -assignedE ntity"
  10589     >
  10590              
  10591      <xsl:param  
  10592       name="asgn Entity" 
  10593      />
  10594              
  10595      <xsl:choos e>
  10596                    
  10597       <xsl:when 
  10598        test="$asg nEntity/n1 :assignedP erson/n1:n ame"
  10599       >
  10600                         
  10601        <xsl:call- template 
  10602         name="show -name"
  10603        >
  10604                              
  10605         <xsl:with- param 
  10606          name="name "
  10607                                                
  10608          select="$a sgnEntity/ n1:assigne dPerson/n1 :name" 
  10609         />
  10610                          
  10611        </xsl:call -template>
  10612                         
  10613        <xsl:if 
  10614         test="$asg nEntity/n1 :represent edOrganiza tion/n1:na me"
  10615        >
  10616                              
  10617         <xsl:text>
  10618           of 
  10619         </xsl:text >
  10620                              
  10621         <xsl:value -of 
  10622          select="$a sgnEntity/ n1:represe ntedOrgani zation/n1: name" 
  10623         />
  10624                          
  10625        </xsl:if>
  10626                     
  10627       </xsl:when >
  10628                    
  10629       <xsl:when 
  10630        test="$asg nEntity/n1 :represent edOrganiza tion"
  10631       >
  10632                         
  10633        <xsl:value -of 
  10634         select="$a sgnEntity/ n1:represe ntedOrgani zation/n1: name" 
  10635        />
  10636                     
  10637       </xsl:when >
  10638                    
  10639       <xsl:other wise>
  10640                         
  10641        <xsl:for-e ach 
  10642         select="$a sgnEntity/ n1:id"
  10643        >
  10644                              
  10645         <xsl:call- template 
  10646          name="show -id" 
  10647         />
  10648                              
  10649         <xsl:choos e>
  10650                                    
  10651          <xsl:when 
  10652           test="posi tion()!=la st()"
  10653          >
  10654                                         
  10655           <xsl:text>
  10656           
  10657           </xsl:text >
  10658                                     
  10659          </xsl:when >
  10660                                    
  10661          <xsl:other wise>
  10662                                         
  10663           <br />
  10664                                     
  10665          </xsl:othe rwise>
  10666                               
  10667         </xsl:choo se>
  10668                          
  10669        </xsl:for- each>
  10670                     
  10671       </xsl:othe rwise>
  10672               
  10673      </xsl:choo se>
  10674          
  10675     </xsl:temp late>
  10676         
  10677     <!-- show  relatedEnt ity -->
  10678         
  10679     <xsl:templ ate 
  10680      name="show -relatedEn tity"
  10681     >
  10682              
  10683      <xsl:param  
  10684       name="rela tedEntity"  
  10685      />
  10686              
  10687      <xsl:choos e>
  10688                    
  10689       <xsl:when 
  10690        test="$rel atedEntity /n1:relate dPerson/n1 :name"
  10691       >
  10692                         
  10693        <xsl:call- template 
  10694         name="show -name"
  10695        >
  10696                              
  10697         <xsl:with- param 
  10698          name="name "
  10699                                                
  10700          select="$r elatedEnti ty/n1:rela tedPerson/ n1:name" 
  10701         />
  10702                          
  10703        </xsl:call -template>
  10704                     
  10705       </xsl:when >
  10706               
  10707      </xsl:choo se>
  10708          
  10709     </xsl:temp late>
  10710         
  10711     <!-- show  associated Entity -->
  10712         
  10713     <xsl:templ ate 
  10714      name="show -associate dEntity"
  10715     >
  10716              
  10717      <xsl:param  
  10718       name="asso Entity" 
  10719      />
  10720              
  10721      <xsl:choos e>
  10722                    
  10723       <xsl:when 
  10724        test="$ass oEntity/n1 :associate dPerson"
  10725       >
  10726                         
  10727        <xsl:for-e ach 
  10728         select="$a ssoEntity/ n1:associa tedPerson/ n1:name"
  10729        >
  10730                              
  10731         <xsl:call- template 
  10732          name="show -name"
  10733         >
  10734                                    
  10735          <xsl:with- param 
  10736           name="name
  10737           select="."  
  10738          />
  10739                               
  10740         </xsl:call -template>
  10741                              
  10742         <xsl:call- template 
  10743          name="show DisplayNam e"
  10744         >
  10745                                    
  10746          <xsl:with- param 
  10747           name="code
  10748           select="$a ssoEntity/ n1:code" 
  10749          />
  10750                               
  10751         </xsl:call -template>
  10752                              
  10753         <br />
  10754                          
  10755        </xsl:for- each>
  10756                     
  10757       </xsl:when >
  10758                    
  10759       <xsl:when 
  10760        test="$ass oEntity/n1 :scopingOr ganization "
  10761       >
  10762                         
  10763        <xsl:for-e ach 
  10764         select="$a ssoEntity/ n1:scoping Organizati on"
  10765        >
  10766                              
  10767         <xsl:if 
  10768          test="n1:n ame"
  10769         >
  10770                                    
  10771          <xsl:call- template 
  10772           name="show -name"
  10773          >
  10774                                         
  10775           <xsl:with- param 
  10776            name="name
  10777            select="n1 :name" 
  10778           />
  10779                                     
  10780          </xsl:call -template>
  10781                                    
  10782          <br />
  10783                               
  10784         </xsl:if>
  10785                              
  10786         <xsl:if 
  10787          test="n1:s tandardInd ustryClass Code"
  10788         >
  10789                                    
  10790          <xsl:value -of 
  10791           select="n1 :standardI ndustryCla ssCode/@di splayName"  
  10792          />
  10793                                    
  10794          <xsl:text>
  10795            code:
  10796          </xsl:text >
  10797                                    
  10798          <xsl:value -of 
  10799           select="n1 :standardI ndustryCla ssCode/@co de" 
  10800          />
  10801                               
  10802         </xsl:if>
  10803                          
  10804        </xsl:for- each>
  10805                     
  10806       </xsl:when >
  10807                    
  10808       <xsl:when 
  10809        test="$ass oEntity/n1 :code"
  10810       >
  10811                         
  10812        <xsl:call- template 
  10813         name="show -code"
  10814        >
  10815                              
  10816         <xsl:with- param 
  10817          name="code
  10818          select="$a ssoEntity/ n1:code" 
  10819         />
  10820                          
  10821        </xsl:call -template>
  10822                     
  10823       </xsl:when >
  10824                    
  10825       <xsl:when 
  10826        test="$ass oEntity/n1 :id"
  10827       >
  10828                         
  10829        <xsl:value -of 
  10830         select="$a ssoEntity/ n1:id/@ext ension" 
  10831        />
  10832                         
  10833        <xsl:text>
  10834          
  10835        </xsl:text >
  10836                         
  10837        <xsl:value -of 
  10838         select="$a ssoEntity/ n1:id/@roo t" 
  10839        />
  10840                     
  10841       </xsl:when >
  10842               
  10843      </xsl:choo se>
  10844          
  10845     </xsl:temp late>
  10846         
  10847     <!-- show  code if or iginalText  present,  return it,  otherwise , check an d
  10848                      retu rn attribu te: displa y name -->
  10849         
  10850     <xsl:templ ate 
  10851      name="show -code"
  10852     >
  10853              
  10854      <xsl:param  
  10855       name="code
  10856      />
  10857              
  10858      <xsl:varia ble 
  10859       name="this -codeSyste m"
  10860      >
  10861                    
  10862       <xsl:value -of 
  10863        select="$c ode/@codeS ystem" 
  10864       />
  10865               
  10866      </xsl:vari able>
  10867              
  10868      <xsl:varia ble 
  10869       name="this -code"
  10870      >
  10871                    
  10872       <xsl:value -of 
  10873        select="$c ode/@code"  
  10874       />
  10875               
  10876      </xsl:vari able>
  10877              
  10878      <xsl:choos e>
  10879                    
  10880       <xsl:when 
  10881        test="$cod e/n1:origi nalText"
  10882       >
  10883                         
  10884        <xsl:value -of 
  10885         select="$c ode/n1:ori ginalText"  
  10886        />
  10887                     
  10888       </xsl:when >
  10889                    
  10890       <xsl:when 
  10891        test="$cod e/@display Name"
  10892       >
  10893                         
  10894        <xsl:value -of 
  10895         select="$c ode/@displ ayName" 
  10896        />
  10897                     
  10898       </xsl:when >
  10899                    
  10900       <!-- <xsl: when test= "$the-valu esets/*/vo c:system[@ root=$this -codeSyste m]/voc:cod e[@value=$ this-code] /@displayN ame">
  10901                                          <xsl:val ue-of sele ct="$the-v aluesets/* /voc:syste m[@root=$t his-codeSy stem]/voc: code[@valu e=$this-co de]/@displ ayName"/>
  10902                                          </xsl:wh en> -->
  10903                    
  10904       <xsl:other wise>
  10905                         
  10906        <xsl:value -of 
  10907         select="$t his-code" 
  10908        />
  10909                     
  10910       </xsl:othe rwise>
  10911               
  10912      </xsl:choo se>
  10913          
  10914     </xsl:temp late>
  10915         
  10916     <!-- show  classCode  -->
  10917         
  10918     <xsl:templ ate 
  10919      name="show -actClassC ode"
  10920     >
  10921              
  10922      <xsl:param  
  10923       name="clsC ode" 
  10924      />
  10925              
  10926      <xsl:choos e>
  10927                    
  10928       <xsl:when 
  10929        test=" $cl sCode = 'A CT' "
  10930       >
  10931                         
  10932        <xsl:text>
  10933         healthcare  service
  10934        </xsl:text >
  10935                     
  10936       </xsl:when >
  10937                    
  10938       <xsl:when 
  10939        test=" $cl sCode = 'A CCM' "
  10940       >
  10941                         
  10942        <xsl:text>
  10943         accommodat ion
  10944        </xsl:text >
  10945                     
  10946       </xsl:when >
  10947                    
  10948       <xsl:when 
  10949        test=" $cl sCode = 'A CCT' "
  10950       >
  10951                         
  10952        <xsl:text>
  10953         account
  10954        </xsl:text >
  10955                     
  10956       </xsl:when >
  10957                    
  10958       <xsl:when 
  10959        test=" $cl sCode = 'A CSN' "
  10960       >
  10961                         
  10962        <xsl:text>
  10963         accession
  10964        </xsl:text >
  10965                     
  10966       </xsl:when >
  10967                    
  10968       <xsl:when 
  10969        test=" $cl sCode = 'A DJUD' "
  10970       >
  10971                         
  10972        <xsl:text>
  10973         financial  adjudicati on
  10974        </xsl:text >
  10975                     
  10976       </xsl:when >
  10977                    
  10978       <xsl:when 
  10979        test=" $cl sCode = 'C ONS' "
  10980       >
  10981                         
  10982        <xsl:text>
  10983         consent
  10984        </xsl:text >
  10985                     
  10986       </xsl:when >
  10987                    
  10988       <xsl:when 
  10989        test=" $cl sCode = 'C ONTREG' "
  10990       >
  10991                         
  10992        <xsl:text>
  10993         container  registrati on
  10994        </xsl:text >
  10995                     
  10996       </xsl:when >
  10997                    
  10998       <xsl:when 
  10999        test=" $cl sCode = 'C TTEVENT' "
  11000       >
  11001                         
  11002        <xsl:text>
  11003         clinical t rial timep oint event
  11004        </xsl:text >
  11005                     
  11006       </xsl:when >
  11007                    
  11008       <xsl:when 
  11009        test=" $cl sCode = 'D ISPACT' "
  11010       >
  11011                         
  11012        <xsl:text>
  11013         disciplina ry action
  11014        </xsl:text >
  11015                     
  11016       </xsl:when >
  11017                    
  11018       <xsl:when 
  11019        test=" $cl sCode = 'E NC' "
  11020       >
  11021                         
  11022        <xsl:text>
  11023         encounter
  11024        </xsl:text >
  11025                     
  11026       </xsl:when >
  11027                    
  11028       <xsl:when 
  11029        test=" $cl sCode = 'I NC' "
  11030       >
  11031                         
  11032        <xsl:text>
  11033         incident
  11034        </xsl:text >
  11035                     
  11036       </xsl:when >
  11037                    
  11038       <xsl:when 
  11039        test=" $cl sCode = 'I NFRM' "
  11040       >
  11041                         
  11042        <xsl:text>
  11043         inform
  11044        </xsl:text >
  11045                     
  11046       </xsl:when >
  11047                    
  11048       <xsl:when 
  11049        test=" $cl sCode = 'I NVE' "
  11050       >
  11051                         
  11052        <xsl:text>
  11053         invoice el ement
  11054        </xsl:text >
  11055                     
  11056       </xsl:when >
  11057                    
  11058       <xsl:when 
  11059        test=" $cl sCode = 'L IST' "
  11060       >
  11061                         
  11062        <xsl:text>
  11063         working li st
  11064        </xsl:text >
  11065                     
  11066       </xsl:when >
  11067                    
  11068       <xsl:when 
  11069        test=" $cl sCode = 'M PROT' "
  11070       >
  11071                         
  11072        <xsl:text>
  11073         monitoring  program
  11074        </xsl:text >
  11075                     
  11076       </xsl:when >
  11077                    
  11078       <xsl:when 
  11079        test=" $cl sCode = 'P CPR' "
  11080       >
  11081                         
  11082        <xsl:text>
  11083         care provi sion
  11084        </xsl:text >
  11085                     
  11086       </xsl:when >
  11087                    
  11088       <xsl:when 
  11089        test=" $cl sCode = 'P ROC' "
  11090       >
  11091                         
  11092        <xsl:text>
  11093         procedure
  11094        </xsl:text >
  11095                     
  11096       </xsl:when >
  11097                    
  11098       <xsl:when 
  11099        test=" $cl sCode = 'R EG' "
  11100       >
  11101                         
  11102        <xsl:text>
  11103         registrati on
  11104        </xsl:text >
  11105                     
  11106       </xsl:when >
  11107                    
  11108       <xsl:when 
  11109        test=" $cl sCode = 'R EV' "
  11110       >
  11111                         
  11112        <xsl:text>
  11113         review
  11114        </xsl:text >
  11115                     
  11116       </xsl:when >
  11117                    
  11118       <xsl:when 
  11119        test=" $cl sCode = 'S BADM' "
  11120       >
  11121                         
  11122        <xsl:text>
  11123         substance  administra tion
  11124        </xsl:text >
  11125                     
  11126       </xsl:when >
  11127                    
  11128       <xsl:when 
  11129        test=" $cl sCode = 'S PCTRT' "
  11130       >
  11131                         
  11132        <xsl:text>
  11133         speciment  treatment
  11134        </xsl:text >
  11135                     
  11136       </xsl:when >
  11137                    
  11138       <xsl:when 
  11139        test=" $cl sCode = 'S UBST' "
  11140       >
  11141                         
  11142        <xsl:text>
  11143         substituti on
  11144        </xsl:text >
  11145                     
  11146       </xsl:when >
  11147                    
  11148       <xsl:when 
  11149        test=" $cl sCode = 'T RNS' "
  11150       >
  11151                         
  11152        <xsl:text>
  11153         transporta tion
  11154        </xsl:text >
  11155                     
  11156       </xsl:when >
  11157                    
  11158       <xsl:when 
  11159        test=" $cl sCode = 'V ERIF' "
  11160       >
  11161                         
  11162        <xsl:text>
  11163         verificati on
  11164        </xsl:text >
  11165                     
  11166       </xsl:when >
  11167                    
  11168       <xsl:when 
  11169        test=" $cl sCode = 'X ACT' "
  11170       >
  11171                         
  11172        <xsl:text>
  11173         financial  transactio n
  11174        </xsl:text >
  11175                     
  11176       </xsl:when >
  11177               
  11178      </xsl:choo se>
  11179          
  11180     </xsl:temp late>
  11181         
  11182     <!-- show  participat ionType -- >
  11183         
  11184     <xsl:templ ate 
  11185      name="show -participa tionType"
  11186     >
  11187              
  11188      <xsl:param  
  11189       name="ptyp e" 
  11190      />
  11191              
  11192      <xsl:choos e>
  11193                    
  11194       <xsl:when 
  11195        test=" $pt ype='PPRF'  "
  11196       >
  11197                         
  11198        <xsl:text>
  11199         primary pe rformer
  11200        </xsl:text >
  11201                     
  11202       </xsl:when >
  11203                    
  11204       <xsl:when 
  11205        test=" $pt ype='PRF'  "
  11206       >
  11207                         
  11208        <xsl:text>
  11209         performer
  11210        </xsl:text >
  11211                     
  11212       </xsl:when >
  11213                    
  11214       <xsl:when 
  11215        test=" $pt ype='VRF'  "
  11216       >
  11217                         
  11218        <xsl:text>
  11219         verifier
  11220        </xsl:text >
  11221                     
  11222       </xsl:when >
  11223                    
  11224       <xsl:when 
  11225        test=" $pt ype='SPRF'  "
  11226       >
  11227                         
  11228        <xsl:text>
  11229         secondary  performer
  11230        </xsl:text >
  11231                     
  11232       </xsl:when >
  11233               
  11234      </xsl:choo se>
  11235          
  11236     </xsl:temp late>
  11237         
  11238     <!-- show  participat ionFunctio n -->
  11239         
  11240     <xsl:templ ate 
  11241      name="show -participa tionFuncti on"
  11242     >
  11243              
  11244      <xsl:param  
  11245       name="pFun ction" 
  11246      />
  11247              
  11248      <xsl:choos e>
  11249                    
  11250       <!-- From  the HL7 v3  Participa tionFuncti on code sy stem -->
  11251                    
  11252       <xsl:when 
  11253        test=" $pF unction =  'ADMPHYS'  "
  11254       >
  11255                         
  11256        <xsl:text>
  11257         (admitting  physician )
  11258        </xsl:text >
  11259                     
  11260       </xsl:when >
  11261                    
  11262       <xsl:when 
  11263        test=" $pF unction =  'ANEST' "
  11264       >
  11265                         
  11266        <xsl:text>
  11267         (anesthesi st)
  11268        </xsl:text >
  11269                     
  11270       </xsl:when >
  11271                    
  11272       <xsl:when 
  11273        test=" $pF unction =  'ANRS' "
  11274       >
  11275                         
  11276        <xsl:text>
  11277         (anesthesi a nurse)
  11278        </xsl:text >
  11279                     
  11280       </xsl:when >
  11281                    
  11282       <xsl:when 
  11283        test=" $pF unction =  'ATTPHYS'  "
  11284       >
  11285                         
  11286        <xsl:text>
  11287         (attending  physician )
  11288        </xsl:text >
  11289                     
  11290       </xsl:when >
  11291                    
  11292       <xsl:when 
  11293        test=" $pF unction =  'DISPHYS'  "
  11294       >
  11295                         
  11296        <xsl:text>
  11297         (dischargi ng physici an)
  11298        </xsl:text >
  11299                     
  11300       </xsl:when >
  11301                    
  11302       <xsl:when 
  11303        test=" $pF unction =  'FASST' "
  11304       >
  11305                         
  11306        <xsl:text>
  11307         (first ass istant sur geon)
  11308        </xsl:text >
  11309                     
  11310       </xsl:when >
  11311                    
  11312       <xsl:when 
  11313        test=" $pF unction =  'MDWF' "
  11314       >
  11315                         
  11316        <xsl:text>
  11317         (midwife)
  11318        </xsl:text >
  11319                     
  11320       </xsl:when >
  11321                    
  11322       <xsl:when 
  11323        test=" $pF unction =  'NASST' "
  11324       >
  11325                         
  11326        <xsl:text>
  11327         (nurse ass istant)
  11328        </xsl:text >
  11329                     
  11330       </xsl:when >
  11331                    
  11332       <xsl:when 
  11333        test=" $pF unction =  'PCP' "
  11334       >
  11335                         
  11336        <xsl:text>
  11337         (primary c are physic ian)
  11338        </xsl:text >
  11339                     
  11340       </xsl:when >
  11341                    
  11342       <xsl:when 
  11343        test=" $pF unction =  'PRISURG'  "
  11344       >
  11345                         
  11346        <xsl:text>
  11347         (primary s urgeon)
  11348        </xsl:text >
  11349                     
  11350       </xsl:when >
  11351                    
  11352       <xsl:when 
  11353        test=" $pF unction =  'RNDPHYS'  "
  11354       >
  11355                         
  11356        <xsl:text>
  11357         (rounding  physician)
  11358        </xsl:text >
  11359                     
  11360       </xsl:when >
  11361                    
  11362       <xsl:when 
  11363        test=" $pF unction =  'SASST' "
  11364       >
  11365                         
  11366        <xsl:text>
  11367         (second as sistant su rgeon)
  11368        </xsl:text >
  11369                     
  11370       </xsl:when >
  11371                    
  11372       <xsl:when 
  11373        test=" $pF unction =  'SNRS' "
  11374       >
  11375                         
  11376        <xsl:text>
  11377         (scrub nur se)
  11378        </xsl:text >
  11379                     
  11380       </xsl:when >
  11381                    
  11382       <xsl:when 
  11383        test=" $pF unction =  'TASST' "
  11384       >
  11385                         
  11386        <xsl:text>
  11387         (third ass istant)
  11388        </xsl:text >
  11389                     
  11390       </xsl:when >
  11391                    
  11392       <!-- From  the HL7 v2  Provider  Role code  system (2. 16.840.1.1 13883.12.4 43)
  11393                                          which is  used by H ITSP -->
  11394                    
  11395       <xsl:when 
  11396        test=" $pF unction =  'CP' "
  11397       >
  11398                         
  11399        <xsl:text>
  11400         (consultin g provider )
  11401        </xsl:text >
  11402                     
  11403       </xsl:when >
  11404                    
  11405       <xsl:when 
  11406        test=" $pF unction =  'PP' "
  11407       >
  11408                         
  11409        <xsl:text>
  11410         (primary c are provid er)
  11411        </xsl:text >
  11412                     
  11413       </xsl:when >
  11414                    
  11415       <xsl:when 
  11416        test=" $pF unction =  'RP' "
  11417       >
  11418                         
  11419        <xsl:text>
  11420         (referring  provider)
  11421        </xsl:text >
  11422                     
  11423       </xsl:when >
  11424                    
  11425       <xsl:when 
  11426        test=" $pF unction =  'MP' "
  11427       >
  11428                         
  11429        <xsl:text>
  11430         (medical h ome provid er)
  11431        </xsl:text >
  11432                     
  11433       </xsl:when >
  11434               
  11435      </xsl:choo se>
  11436          
  11437     </xsl:temp late>
  11438         
  11439     <xsl:templ ate 
  11440      name="form atDateTime "
  11441     >
  11442              
  11443      <xsl:param  
  11444       name="date
  11445      />
  11446              
  11447      <!-- month  -->
  11448              
  11449      <xsl:varia ble 
  11450       name="mont h" 
  11451       select="su bstring ($ date, 5, 2 )" 
  11452      />
  11453              
  11454      <xsl:choos e>
  11455                    
  11456       <xsl:when 
  11457        test="$mon th='01'"
  11458       >
  11459                         
  11460        <xsl:text>
  11461         January 
  11462        </xsl:text >
  11463                     
  11464       </xsl:when >
  11465                    
  11466       <xsl:when 
  11467        test="$mon th='02'"
  11468       >
  11469                         
  11470        <xsl:text>
  11471         February 
  11472        </xsl:text >
  11473                     
  11474       </xsl:when >
  11475                    
  11476       <xsl:when 
  11477        test="$mon th='03'"
  11478       >
  11479                         
  11480        <xsl:text>
  11481         March 
  11482        </xsl:text >
  11483                     
  11484       </xsl:when >
  11485                    
  11486       <xsl:when 
  11487        test="$mon th='04'"
  11488       >
  11489                         
  11490        <xsl:text>
  11491         April 
  11492        </xsl:text >
  11493                     
  11494       </xsl:when >
  11495                    
  11496       <xsl:when 
  11497        test="$mon th='05'"
  11498       >
  11499                         
  11500        <xsl:text>
  11501         May 
  11502        </xsl:text >
  11503                     
  11504       </xsl:when >
  11505                    
  11506       <xsl:when 
  11507        test="$mon th='06'"
  11508       >
  11509                         
  11510        <xsl:text>
  11511         June 
  11512        </xsl:text >
  11513                     
  11514       </xsl:when >
  11515                    
  11516       <xsl:when 
  11517        test="$mon th='07'"
  11518       >
  11519                         
  11520        <xsl:text>
  11521         July 
  11522        </xsl:text >
  11523                     
  11524       </xsl:when >
  11525                    
  11526       <xsl:when 
  11527        test="$mon th='08'"
  11528       >
  11529                         
  11530        <xsl:text>
  11531         August 
  11532        </xsl:text >
  11533                     
  11534       </xsl:when >
  11535                    
  11536       <xsl:when 
  11537        test="$mon th='09'"
  11538       >
  11539                         
  11540        <xsl:text>
  11541         September 
  11542        </xsl:text >
  11543                     
  11544       </xsl:when >
  11545                    
  11546       <xsl:when 
  11547        test="$mon th='10'"
  11548       >
  11549                         
  11550        <xsl:text>
  11551         October 
  11552        </xsl:text >
  11553                     
  11554       </xsl:when >
  11555                    
  11556       <xsl:when 
  11557        test="$mon th='11'"
  11558       >
  11559                         
  11560        <xsl:text>
  11561         November 
  11562        </xsl:text >
  11563                     
  11564       </xsl:when >
  11565                    
  11566       <xsl:when 
  11567        test="$mon th='12'"
  11568       >
  11569                         
  11570        <xsl:text>
  11571         December 
  11572        </xsl:text >
  11573                     
  11574       </xsl:when >
  11575               
  11576      </xsl:choo se>
  11577              
  11578      <!-- day - ->
  11579              
  11580      <xsl:choos e>
  11581                    
  11582       <xsl:when 
  11583        test='subs tring ($da te, 7, 1)= "0"'
  11584       >
  11585                         
  11586        <xsl:value -of 
  11587         select="su bstring ($ date, 8, 1 )" 
  11588        />
  11589                         
  11590        <xsl:text>
  11591        
  11592        </xsl:text >
  11593                     
  11594       </xsl:when >
  11595                    
  11596       <xsl:other wise>
  11597                         
  11598        <xsl:value -of 
  11599         select="su bstring ($ date, 7, 2 )" 
  11600        />
  11601                         
  11602        <xsl:text>
  11603        
  11604        </xsl:text >
  11605                     
  11606       </xsl:othe rwise>
  11607               
  11608      </xsl:choo se>
  11609              
  11610      <!-- year  -->
  11611              
  11612      <xsl:value -of 
  11613       select="su bstring ($ date, 1, 4 )" 
  11614      />
  11615              
  11616      <!-- time  and US tim ezone -->
  11617              
  11618      <xsl:if 
  11619       test="stri ng-length( $date) > 8 "
  11620      >
  11621                    
  11622       <xsl:text>
  11623       
  11624       </xsl:text >
  11625                    
  11626       <!-- time  -->
  11627                    
  11628       <xsl:varia ble 
  11629        name="time "
  11630       >
  11631                         
  11632        <xsl:value -of 
  11633         select="su bstring($d ate,9,6)" 
  11634        />
  11635                     
  11636       </xsl:vari able>
  11637                    
  11638       <xsl:varia ble 
  11639        name="hh"
  11640       >
  11641                         
  11642        <xsl:value -of 
  11643         select="su bstring($t ime,1,2)" 
  11644        />
  11645                     
  11646       </xsl:vari able>
  11647                    
  11648       <xsl:varia ble 
  11649        name="mm"
  11650       >
  11651                         
  11652        <xsl:value -of 
  11653         select="su bstring($t ime,3,2)" 
  11654        />
  11655                     
  11656       </xsl:vari able>
  11657                    
  11658       <xsl:varia ble 
  11659        name="ss"
  11660       >
  11661                         
  11662        <xsl:value -of 
  11663         select="su bstring($t ime,5,2)" 
  11664        />
  11665                     
  11666       </xsl:vari able>
  11667                    
  11668       <xsl:if 
  11669        test="stri ng-length( $hh)&gt;1"
  11670       >
  11671                         
  11672        <xsl:value -of 
  11673         select="$h h" 
  11674        />
  11675                         
  11676        <xsl:if
  11677                                  
  11678         test="stri ng-length( $mm)&gt;1  and not(co ntains($mm ,'-')) and  not (cont ains($mm,' +'))"
  11679        >
  11680                              
  11681         <xsl:text>
  11682          :
  11683         </xsl:text >
  11684                              
  11685         <xsl:value -of 
  11686          select="$m m" 
  11687         />
  11688                              
  11689         <xsl:if
  11690                                       
  11691          test="stri ng-length( $ss)&gt;1  and not(co ntains($ss ,'-')) and  not (cont ains($ss,' +'))"
  11692         >
  11693                                    
  11694          <xsl:text>
  11695           :
  11696          </xsl:text >
  11697                                    
  11698          <xsl:value -of 
  11699           select="$s s" 
  11700          />
  11701                               
  11702         </xsl:if>
  11703                          
  11704        </xsl:if>
  11705                     
  11706       </xsl:if>
  11707                    
  11708       <!-- time  zone -->
  11709                    
  11710       <xsl:varia ble 
  11711        name="tzon "
  11712       >
  11713                         
  11714        <xsl:choos e>
  11715                              
  11716         <xsl:when 
  11717          test="cont ains($date ,'+')"
  11718         >
  11719                                    
  11720          <xsl:text>
  11721           +
  11722          </xsl:text >
  11723                                    
  11724          <xsl:value -of 
  11725           select="su bstring-af ter($date,  '+')" 
  11726          />
  11727                               
  11728         </xsl:when >
  11729                              
  11730         <xsl:when 
  11731          test="cont ains($date ,'-')"
  11732         >
  11733                                    
  11734          <xsl:text>
  11735           -
  11736          </xsl:text >
  11737                                    
  11738          <xsl:value -of 
  11739           select="su bstring-af ter($date,  '-')" 
  11740          />
  11741                               
  11742         </xsl:when >
  11743                          
  11744        </xsl:choo se>
  11745                     
  11746       </xsl:vari able>
  11747                    
  11748       <xsl:choos e>
  11749                         
  11750        <!-- refer ence: http ://www.tim eanddate.c om/library /abbreviat ions/timez ones/na/ - ->
  11751                         
  11752        <xsl:when 
  11753         test="$tzo n = '-0500 ' "
  11754        >
  11755                              
  11756         <xsl:text>
  11757          , EST
  11758         </xsl:text >
  11759                          
  11760        </xsl:when >
  11761                         
  11762        <xsl:when 
  11763         test="$tzo n = '-0600 ' "
  11764        >
  11765                              
  11766         <xsl:text>
  11767          , CST
  11768         </xsl:text >
  11769                          
  11770        </xsl:when >
  11771                         
  11772        <xsl:when 
  11773         test="$tzo n = '-0700 ' "
  11774        >
  11775                              
  11776         <xsl:text>
  11777          , MST
  11778         </xsl:text >
  11779                          
  11780        </xsl:when >
  11781                         
  11782        <xsl:when 
  11783         test="$tzo n = '-0800 ' "
  11784        >
  11785                              
  11786         <xsl:text>
  11787          , PST
  11788         </xsl:text >
  11789                          
  11790        </xsl:when >
  11791                         
  11792        <xsl:other wise>
  11793                              
  11794         <xsl:text>
  11795           
  11796         </xsl:text >
  11797                              
  11798         <xsl:value -of 
  11799          select="$t zon" 
  11800         />
  11801                          
  11802        </xsl:othe rwise>
  11803                     
  11804       </xsl:choo se>
  11805               
  11806      </xsl:if>
  11807          
  11808     </xsl:temp late>
  11809         
  11810     <!-- conve rt to lowe r case -->
  11811         
  11812     <xsl:templ ate 
  11813      name="case Down"
  11814     >
  11815              
  11816      <xsl:param  
  11817       name="data
  11818      />
  11819              
  11820      <xsl:if 
  11821       test="$dat a"
  11822      >
  11823                    
  11824       <xsl:value -of
  11825                            
  11826        select="tr anslate($d ata, 'ABCD EFGHIJKLMN OPQRSTUVWX YZ','abcde fghijklmno pqrstuvwxy z')" 
  11827       />
  11828               
  11829      </xsl:if>
  11830          
  11831     </xsl:temp late>
  11832         
  11833     <!-- conve rt to uppe r case -->
  11834         
  11835     <xsl:templ ate 
  11836      name="case Up"
  11837     >
  11838              
  11839      <xsl:param  
  11840       name="data
  11841      />
  11842              
  11843      <xsl:if 
  11844       test="$dat a"
  11845      >
  11846                    
  11847       <xsl:value -of
  11848                            
  11849        select="tr anslate($d ata,'abcde fghijklmno pqrstuvwxy z', 'ABCDE FGHIJKLMNO PQRSTUVWXY Z')" 
  11850       />
  11851               
  11852      </xsl:if>
  11853          
  11854     </xsl:temp late>
  11855         
  11856     <!-- conve rt first c haracter t o upper ca se -->
  11857         
  11858     <xsl:templ ate 
  11859      name="firs tCharCaseU p"
  11860     >
  11861              
  11862      <xsl:param  
  11863       name="data
  11864      />
  11865              
  11866      <xsl:if 
  11867       test="$dat a"
  11868      >
  11869                    
  11870       <xsl:call- template 
  11871        name="case Up"
  11872       >
  11873                         
  11874        <xsl:with- param 
  11875         name="data
  11876         select="su bstring($d ata,1,1)" 
  11877        />
  11878                     
  11879       </xsl:call -template>
  11880                    
  11881       <xsl:value -of 
  11882        select="su bstring($d ata,2)" 
  11883       />
  11884               
  11885      </xsl:if>
  11886          
  11887     </xsl:temp late>
  11888         
  11889     <!-- show- noneFlavor  -->
  11890         
  11891     <xsl:templ ate 
  11892      name="show -noneFlavo r"
  11893     >
  11894              
  11895      <xsl:param  
  11896       name="nf" 
  11897      />
  11898              
  11899      <xsl:choos e>
  11900                    
  11901       <xsl:when 
  11902        test=" $nf  = 'NI' "
  11903       >
  11904                         
  11905        <xsl:text>
  11906         no informa tion
  11907        </xsl:text >
  11908                     
  11909       </xsl:when >
  11910                    
  11911       <xsl:when 
  11912        test=" $nf  = 'INV' "
  11913       >
  11914                         
  11915        <xsl:text>
  11916         invalid
  11917        </xsl:text >
  11918                     
  11919       </xsl:when >
  11920                    
  11921       <xsl:when 
  11922        test=" $nf  = 'MSK' "
  11923       >
  11924                         
  11925        <xsl:text>
  11926         masked
  11927        </xsl:text >
  11928                     
  11929       </xsl:when >
  11930                    
  11931       <xsl:when 
  11932        test=" $nf  = 'NA' "
  11933       >
  11934                         
  11935        <xsl:text>
  11936         not applic able
  11937        </xsl:text >
  11938                     
  11939       </xsl:when >
  11940                    
  11941       <xsl:when 
  11942        test=" $nf  = 'UNK' "
  11943       >
  11944                         
  11945        <xsl:text>
  11946         unknown
  11947        </xsl:text >
  11948                     
  11949       </xsl:when >
  11950                    
  11951       <xsl:when 
  11952        test=" $nf  = 'OTH' "
  11953       >
  11954                         
  11955        <xsl:text>
  11956         other
  11957        </xsl:text >
  11958                     
  11959       </xsl:when >
  11960               
  11961      </xsl:choo se>
  11962          
  11963     </xsl:temp late>
  11964         
  11965     <!--Langua ge transla tion -->
  11966         
  11967     <xsl:templ ate 
  11968      name="show -language- with-mode"
  11969     >
  11970              
  11971      <xsl:param  
  11972       name="lang Display" 
  11973      />
  11974              
  11975      <xsl:param  
  11976       name="mode Code" 
  11977      />
  11978              
  11979      <xsl:choos e>
  11980                    
  11981       <xsl:when 
  11982        test="$mod eCode = 'E SGN'"
  11983       >
  11984                         
  11985        <xsl:text>
  11986         Signs 
  11987        </xsl:text >
  11988                         
  11989        <xsl:value -of 
  11990         select="$l angDisplay
  11991        />
  11992                     
  11993       </xsl:when >
  11994                    
  11995       <xsl:when 
  11996        test="$mod eCode = 'E SP'"
  11997       >
  11998                         
  11999        <xsl:text>
  12000         Speaks 
  12001        </xsl:text >
  12002                         
  12003        <xsl:value -of 
  12004         select="$l angDisplay
  12005        />
  12006                     
  12007       </xsl:when >
  12008                    
  12009       <xsl:when 
  12010        test="$mod eCode = 'E WR'"
  12011       >
  12012                         
  12013        <xsl:text>
  12014         Writes 
  12015        </xsl:text >
  12016                         
  12017        <xsl:value -of 
  12018         select="$l angDisplay
  12019        />
  12020                     
  12021       </xsl:when >
  12022                    
  12023       <xsl:when 
  12024        test="$mod eCode = 'R SGN'"
  12025       >
  12026                         
  12027        <xsl:text>
  12028         Understand s signed 
  12029        </xsl:text >
  12030                         
  12031        <xsl:value -of 
  12032         select="$l angDisplay
  12033        />
  12034                     
  12035       </xsl:when >
  12036                    
  12037       <xsl:when 
  12038        test="$mod eCode = 'R SP'"
  12039       >
  12040                         
  12041        <xsl:text>
  12042         Understand s spoken 
  12043        </xsl:text >
  12044                         
  12045        <xsl:value -of 
  12046         select="$l angDisplay
  12047        />
  12048                     
  12049       </xsl:when >
  12050                    
  12051       <xsl:when 
  12052        test="$mod eCode = 'R WR'"
  12053       >
  12054                         
  12055        <xsl:text>
  12056         Understand s written 
  12057        </xsl:text >
  12058                         
  12059        <xsl:value -of 
  12060         select="$l angDisplay
  12061        />
  12062                     
  12063       </xsl:when >
  12064               
  12065      </xsl:choo se>
  12066          
  12067     </xsl:temp late>
  12068         
  12069     <xsl:templ ate 
  12070      name="show -language"
  12071     >
  12072              
  12073      <xsl:param  
  12074       name="lang Code" 
  12075      />
  12076              
  12077      <xsl:param  
  12078       name="mode Code" 
  12079      />
  12080              
  12081      <xsl:choos e>
  12082                    
  12083       <xsl:when 
  12084        test="$lan gCode/@cod e = 'sq' o r $langCod e/@code =  'sqi' or $ langCode/@ code = 'al b'"
  12085       >
  12086                         
  12087        <xsl:call- template 
  12088         name="show -language- with-mode"
  12089        >
  12090                              
  12091         <xsl:with- param 
  12092          name="lang Display" 
  12093          select="'A lbanian'" 
  12094         />
  12095                              
  12096         <xsl:with- param 
  12097          name="mode Code" 
  12098          select="$m odeCode/@c ode" 
  12099         />
  12100                          
  12101        </xsl:call -template>
  12102                     
  12103       </xsl:when >
  12104                    
  12105       <xsl:when 
  12106        test="$lan gCode/@cod e = 'apa'"
  12107       >
  12108                         
  12109        <xsl:call- template 
  12110         name="show -language- with-mode"
  12111        >
  12112                              
  12113         <xsl:with- param 
  12114          name="lang Display" 
  12115          select="'A pache lang uages'" 
  12116         />
  12117                              
  12118         <xsl:with- param 
  12119          name="mode Code" 
  12120          select="$m odeCode/@c ode" 
  12121         />
  12122                          
  12123        </xsl:call -template>
  12124                     
  12125       </xsl:when >
  12126                    
  12127       <xsl:when 
  12128        test="$lan gCode/@cod e = 'ar' o r $langCod e/@code =  'ara' or $ langCode/@ code = 'ar -AE' or $l angCode/@c ode = 'ar- SA' or $la ngCode/@co de = 'ar-M A'"
  12129       >
  12130                         
  12131        <xsl:call- template 
  12132         name="show -language- with-mode"
  12133        >
  12134                              
  12135         <xsl:with- param 
  12136          name="lang Display" 
  12137          select="'A rabic'" 
  12138         />
  12139                              
  12140         <xsl:with- param 
  12141          name="mode Code" 
  12142          select="$m odeCode/@c ode" 
  12143         />
  12144                          
  12145        </xsl:call -template>
  12146                     
  12147       </xsl:when >
  12148                    
  12149       <xsl:when 
  12150        test="$lan gCode/@cod e = 'hy' o r $langCod e/@code =  'hye' or $ langCode/@ code = 'ar m'"
  12151       >
  12152                         
  12153        <xsl:call- template 
  12154         name="show -language- with-mode"
  12155        >
  12156                              
  12157         <xsl:with- param 
  12158          name="lang Display" 
  12159          select="'A rmenian'" 
  12160         />
  12161                              
  12162         <xsl:with- param 
  12163          name="mode Code" 
  12164          select="$m odeCode/@c ode" 
  12165         />
  12166                          
  12167        </xsl:call -template>
  12168                     
  12169       </xsl:when >
  12170                    
  12171       <xsl:when 
  12172        test="$lan gCode/@cod e = 'aus'"
  12173       >
  12174                         
  12175        <xsl:call- template 
  12176         name="show -language- with-mode"
  12177        >
  12178                              
  12179         <xsl:with- param 
  12180          name="lang Display" 
  12181          select="'A ustralian  languages'
  12182         />
  12183                              
  12184         <xsl:with- param 
  12185          name="mode Code" 
  12186          select="$m odeCode/@c ode" 
  12187         />
  12188                          
  12189        </xsl:call -template>
  12190                     
  12191       </xsl:when >
  12192                    
  12193       <xsl:when 
  12194        test="$lan gCode/@cod e = 'bs' o r $langCod e/@code =  'bos'"
  12195       >
  12196                         
  12197        <xsl:call- template 
  12198         name="show -language- with-mode"
  12199        >
  12200                              
  12201         <xsl:with- param 
  12202          name="lang Display" 
  12203          select="'B osnian'" 
  12204         />
  12205                              
  12206         <xsl:with- param 
  12207          name="mode Code" 
  12208          select="$m odeCode/@c ode" 
  12209         />
  12210                          
  12211        </xsl:call -template>
  12212                     
  12213       </xsl:when >
  12214                    
  12215       <xsl:when 
  12216        test="$lan gCode/@cod e = 'bg' o r $langCod e/@code =  'bul'"
  12217       >
  12218                         
  12219        <xsl:call- template 
  12220         name="show -language- with-mode"
  12221        >
  12222                              
  12223         <xsl:with- param 
  12224          name="lang Display" 
  12225          select="'B ulgarian'"  
  12226         />
  12227                              
  12228         <xsl:with- param 
  12229          name="mode Code" 
  12230          select="$m odeCode/@c ode" 
  12231         />
  12232                          
  12233        </xsl:call -template>
  12234                     
  12235       </xsl:when >
  12236                    
  12237       <xsl:when 
  12238        test="$lan gCode/@cod e = 'bg' o r $langCod e/@code =  'bul'"
  12239       >
  12240                         
  12241        <xsl:call- template 
  12242         name="show -language- with-mode"
  12243        >
  12244                              
  12245         <xsl:with- param 
  12246          name="lang Display" 
  12247          select="'B ulgarian'"  
  12248         />
  12249                              
  12250         <xsl:with- param 
  12251          name="mode Code" 
  12252          select="$m odeCode/@c ode" 
  12253         />
  12254                          
  12255        </xsl:call -template>
  12256                     
  12257       </xsl:when >
  12258                    
  12259       <xsl:when 
  12260        test="$lan gCode/@cod e = 'ce' o r $langCod e/@code =  'che'"
  12261       >
  12262                         
  12263        <xsl:call- template 
  12264         name="show -language- with-mode"
  12265        >
  12266                              
  12267         <xsl:with- param 
  12268          name="lang Display" 
  12269          select="'C hechen'" 
  12270         />
  12271                              
  12272         <xsl:with- param 
  12273          name="mode Code" 
  12274          select="$m odeCode/@c ode" 
  12275         />
  12276                          
  12277        </xsl:call -template>
  12278                     
  12279       </xsl:when >
  12280                    
  12281       <xsl:when 
  12282        test="$lan gCode/@cod e = 'ce' o r $langCod e/@code =  'che'"
  12283       >
  12284                         
  12285        <xsl:call- template 
  12286         name="show -language- with-mode"
  12287        >
  12288                              
  12289         <xsl:with- param 
  12290          name="lang Display" 
  12291          select="'C hechen'" 
  12292         />
  12293                              
  12294         <xsl:with- param 
  12295          name="mode Code" 
  12296          select="$m odeCode/@c ode" 
  12297         />
  12298                          
  12299        </xsl:call -template>
  12300                     
  12301       </xsl:when >
  12302                    
  12303       <xsl:when 
  12304        test="$lan gCode/@cod e = 'zh' o r $langCod e/@code =  'zho' or $ langCode/@ code = 'ch i'"
  12305       >
  12306                         
  12307        <xsl:call- template 
  12308         name="show -language- with-mode"
  12309        >
  12310                              
  12311         <xsl:with- param 
  12312          name="lang Display" 
  12313          select="'C hinese'" 
  12314         />
  12315                              
  12316         <xsl:with- param 
  12317          name="mode Code" 
  12318          select="$m odeCode/@c ode" 
  12319         />
  12320                          
  12321        </xsl:call -template>
  12322                     
  12323       </xsl:when >
  12324                    
  12325       <xsl:when 
  12326        test="$lan gCode/@cod e = 'chr'"
  12327       >
  12328                         
  12329        <xsl:call- template 
  12330         name="show -language- with-mode"
  12331        >
  12332                              
  12333         <xsl:with- param 
  12334          name="lang Display" 
  12335          select="'C herokee'" 
  12336         />
  12337                              
  12338         <xsl:with- param 
  12339          name="mode Code" 
  12340          select="$m odeCode/@c ode" 
  12341         />
  12342                          
  12343        </xsl:call -template>
  12344                     
  12345       </xsl:when >
  12346                    
  12347       <xsl:when 
  12348        test="$lan gCode/@cod e = 'chy'"
  12349       >
  12350                         
  12351        <xsl:call- template 
  12352         name="show -language- with-mode"
  12353        >
  12354                              
  12355         <xsl:with- param 
  12356          name="lang Display" 
  12357          select="'C heyenne'" 
  12358         />
  12359                              
  12360         <xsl:with- param 
  12361          name="mode Code" 
  12362          select="$m odeCode/@c ode" 
  12363         />
  12364                          
  12365        </xsl:call -template>
  12366                     
  12367       </xsl:when >
  12368                    
  12369       <xsl:when 
  12370        test="$lan gCode/@cod e = 'cs' o r $langCod e/@code =  'ces' or $ langCode/@ code = 'cz e'"
  12371       >
  12372                         
  12373        <xsl:call- template 
  12374         name="show -language- with-mode"
  12375        >
  12376                              
  12377         <xsl:with- param 
  12378          name="lang Display" 
  12379          select="'C zech'" 
  12380         />
  12381                              
  12382         <xsl:with- param 
  12383          name="mode Code" 
  12384          select="$m odeCode/@c ode" 
  12385         />
  12386                          
  12387        </xsl:call -template>
  12388                     
  12389       </xsl:when >
  12390                    
  12391       <xsl:when 
  12392        test="$lan gCode/@cod e = 'da' o r $langCod e/@code =  'dan'"
  12393       >
  12394                         
  12395        <xsl:call- template 
  12396         name="show -language- with-mode"
  12397        >
  12398                              
  12399         <xsl:with- param 
  12400          name="lang Display" 
  12401          select="'D anish'" 
  12402         />
  12403                              
  12404         <xsl:with- param 
  12405          name="mode Code" 
  12406          select="$m odeCode/@c ode" 
  12407         />
  12408                          
  12409        </xsl:call -template>
  12410                     
  12411       </xsl:when >
  12412                    
  12413       <xsl:when 
  12414        test="$lan gCode/@cod e = 'nl' o r $langCod e/@code =  'nld' or $ langCode/@ code = 'du t'"
  12415       >
  12416                         
  12417        <xsl:call- template 
  12418         name="show -language- with-mode"
  12419        >
  12420                              
  12421         <xsl:with- param 
  12422          name="lang Display" 
  12423          select="'D utch; Flem ish'" 
  12424         />
  12425                              
  12426         <xsl:with- param 
  12427          name="mode Code" 
  12428          select="$m odeCode/@c ode" 
  12429         />
  12430                          
  12431        </xsl:call -template>
  12432                     
  12433       </xsl:when >
  12434                    
  12435       <xsl:when 
  12436        test="$lan gCode/@cod e = 'egy'"
  12437       >
  12438                         
  12439        <xsl:call- template 
  12440         name="show -language- with-mode"
  12441        >
  12442                              
  12443         <xsl:with- param 
  12444          name="lang Display" 
  12445          select="'E gyptian (A ncient)'" 
  12446         />
  12447                              
  12448         <xsl:with- param 
  12449          name="mode Code" 
  12450          select="$m odeCode/@c ode" 
  12451         />
  12452                          
  12453        </xsl:call -template>
  12454                     
  12455       </xsl:when >
  12456                    
  12457       <xsl:when 
  12458        test="$lan gCode/@cod e = 'en' o r $langCod e/@code =  'eng' or $ langCode/@ code = 'en -US' or $l angCode/@c ode = 'en- GB' or $la ngCode/@co de = 'en-C A'"
  12459       >
  12460                         
  12461        <xsl:call- template 
  12462         name="show -language- with-mode"
  12463        >
  12464                              
  12465         <xsl:with- param 
  12466          name="lang Display" 
  12467          select="'E nglish'" 
  12468         />
  12469                              
  12470         <xsl:with- param 
  12471          name="mode Code" 
  12472          select="$m odeCode/@c ode" 
  12473         />
  12474                          
  12475        </xsl:call -template>
  12476                     
  12477       </xsl:when >
  12478                    
  12479       <xsl:when 
  12480        test="$lan gCode/@cod e = 'et' o r $langCod e/@code =  'est'"
  12481       >
  12482                         
  12483        <xsl:call- template 
  12484         name="show -language- with-mode"
  12485        >
  12486                              
  12487         <xsl:with- param 
  12488          name="lang Display" 
  12489          select="'E stonian'" 
  12490         />
  12491                              
  12492         <xsl:with- param 
  12493          name="mode Code" 
  12494          select="$m odeCode/@c ode" 
  12495         />
  12496                          
  12497        </xsl:call -template>
  12498                     
  12499       </xsl:when >
  12500                    
  12501       <xsl:when 
  12502        test="$lan gCode/@cod e = 'fil'"
  12503       >
  12504                         
  12505        <xsl:call- template 
  12506         name="show -language- with-mode"
  12507        >
  12508                              
  12509         <xsl:with- param 
  12510          name="lang Display" 
  12511          select="'F ilipino; P ilipino'" 
  12512         />
  12513                              
  12514         <xsl:with- param 
  12515          name="mode Code" 
  12516          select="$m odeCode/@c ode" 
  12517         />
  12518                          
  12519        </xsl:call -template>
  12520                     
  12521       </xsl:when >
  12522                    
  12523       <xsl:when 
  12524        test="$lan gCode/@cod e = 'fi' o r $langCod e/@code =  'fin'"
  12525       >
  12526                         
  12527        <xsl:call- template 
  12528         name="show -language- with-mode"
  12529        >
  12530                              
  12531         <xsl:with- param 
  12532          name="lang Display" 
  12533          select="'F innish'" 
  12534         />
  12535                              
  12536         <xsl:with- param 
  12537          name="mode Code" 
  12538          select="$m odeCode/@c ode" 
  12539         />
  12540                          
  12541        </xsl:call -template>
  12542                     
  12543       </xsl:when >
  12544                    
  12545       <xsl:when 
  12546        test="$lan gCode/@cod e = 'fr' o r $langCod e/@code =  'fra' or $ langCode/@ code = 'fr e' or $lan gCode/@cod e = 'fr-CA ' or $lang Code/@code  = 'fr-FR' "
  12547       >
  12548                         
  12549        <xsl:call- template 
  12550         name="show -language- with-mode"
  12551        >
  12552                              
  12553         <xsl:with- param 
  12554          name="lang Display" 
  12555          select="'F rench'" 
  12556         />
  12557                              
  12558         <xsl:with- param 
  12559          name="mode Code" 
  12560          select="$m odeCode/@c ode" 
  12561         />
  12562                          
  12563        </xsl:call -template>
  12564                     
  12565       </xsl:when >
  12566                    
  12567       <xsl:when 
  12568        test="$lan gCode/@cod e = 'de' o r $langCod e/@code =  'deu' or $ langCode/@ code = 'ge r'"
  12569       >
  12570                         
  12571        <xsl:call- template 
  12572         name="show -language- with-mode"
  12573        >
  12574                              
  12575         <xsl:with- param 
  12576          name="lang Display" 
  12577          select="'G erman'" 
  12578         />
  12579                              
  12580         <xsl:with- param 
  12581          name="mode Code" 
  12582          select="$m odeCode/@c ode" 
  12583         />
  12584                          
  12585        </xsl:call -template>
  12586                     
  12587       </xsl:when >
  12588                    
  12589       <xsl:when 
  12590        test="$lan gCode/@cod e = 'ga' o r $langCod e/@code =  'gle'"
  12591       >
  12592                         
  12593        <xsl:call- template 
  12594         name="show -language- with-mode"
  12595        >
  12596                              
  12597         <xsl:with- param 
  12598          name="lang Display" 
  12599          select="'I rish'" 
  12600         />
  12601                              
  12602         <xsl:with- param 
  12603          name="mode Code" 
  12604          select="$m odeCode/@c ode" 
  12605         />
  12606                          
  12607        </xsl:call -template>
  12608                     
  12609       </xsl:when >
  12610                    
  12611       <xsl:when 
  12612        test="$lan gCode/@cod e = 'gl' o r $langCod e/@code =  'glg'"
  12613       >
  12614                         
  12615        <xsl:call- template 
  12616         name="show -language- with-mode"
  12617        >
  12618                              
  12619         <xsl:with- param 
  12620          name="lang Display" 
  12621          select="'G alician'" 
  12622         />
  12623                              
  12624         <xsl:with- param 
  12625          name="mode Code" 
  12626          select="$m odeCode/@c ode" 
  12627         />
  12628                          
  12629        </xsl:call -template>
  12630                     
  12631       </xsl:when >
  12632                    
  12633       <xsl:when 
  12634        test="$lan gCode/@cod e = 'el' o r $langCod e/@code =  'ell' or $ langCode/@ code = 'gr e'"
  12635       >
  12636                         
  12637        <xsl:call- template 
  12638         name="show -language- with-mode"
  12639        >
  12640                              
  12641         <xsl:with- param 
  12642          name="lang Display" 
  12643          select="'G reek, Mode rn (1453-) '" 
  12644         />
  12645                              
  12646         <xsl:with- param 
  12647          name="mode Code" 
  12648          select="$m odeCode/@c ode" 
  12649         />
  12650                          
  12651        </xsl:call -template>
  12652                     
  12653       </xsl:when >
  12654                    
  12655       <xsl:when 
  12656        test="$lan gCode/@cod e = 'ht' o r $langCod e/@code =  'hat'"
  12657       >
  12658                         
  12659        <xsl:call- template 
  12660         name="show -language- with-mode"
  12661        >
  12662                              
  12663         <xsl:with- param 
  12664          name="lang Display" 
  12665          select="'H aitian; Ha itian Creo le'" 
  12666         />
  12667                              
  12668         <xsl:with- param 
  12669          name="mode Code" 
  12670          select="$m odeCode/@c ode" 
  12671         />
  12672                          
  12673        </xsl:call -template>
  12674                     
  12675       </xsl:when >
  12676                    
  12677       <xsl:when 
  12678        test="$lan gCode/@cod e = 'haw'"
  12679       >
  12680                         
  12681        <xsl:call- template 
  12682         name="show -language- with-mode"
  12683        >
  12684                              
  12685         <xsl:with- param 
  12686          name="lang Display" 
  12687          select="'H awaiian'" 
  12688         />
  12689                              
  12690         <xsl:with- param 
  12691          name="mode Code" 
  12692          select="$m odeCode/@c ode" 
  12693         />
  12694                          
  12695        </xsl:call -template>
  12696                     
  12697       </xsl:when >
  12698                    
  12699       <xsl:when 
  12700        test="$lan gCode/@cod e = 'he' o r $langCod e/@code =  'heb'"
  12701       >
  12702                         
  12703        <xsl:call- template 
  12704         name="show -language- with-mode"
  12705        >
  12706                              
  12707         <xsl:with- param 
  12708          name="lang Display" 
  12709          select="'H ebrew'" 
  12710         />
  12711                              
  12712         <xsl:with- param 
  12713          name="mode Code" 
  12714          select="$m odeCode/@c ode" 
  12715         />
  12716                          
  12717        </xsl:call -template>
  12718                     
  12719       </xsl:when >
  12720                    
  12721       <xsl:when 
  12722        test="$lan gCode/@cod e = 'hi' o r $langCod e/@code =  'hin'"
  12723       >
  12724                         
  12725        <xsl:call- template 
  12726         name="show -language- with-mode"
  12727        >
  12728                              
  12729         <xsl:with- param 
  12730          name="lang Display" 
  12731          select="'H indi'" 
  12732         />
  12733                              
  12734         <xsl:with- param 
  12735          name="mode Code" 
  12736          select="$m odeCode/@c ode" 
  12737         />
  12738                          
  12739        </xsl:call -template>
  12740                     
  12741       </xsl:when >
  12742                    
  12743       <xsl:when 
  12744        test="$lan gCode/@cod e = 'hr' o r $langCod e/@code =  'hrv'"
  12745       >
  12746                         
  12747        <xsl:call- template 
  12748         name="show -language- with-mode"
  12749        >
  12750                              
  12751         <xsl:with- param 
  12752          name="lang Display" 
  12753          select="'C roatian'" 
  12754         />
  12755                              
  12756         <xsl:with- param 
  12757          name="mode Code" 
  12758          select="$m odeCode/@c ode" 
  12759         />
  12760                          
  12761        </xsl:call -template>
  12762                     
  12763       </xsl:when >
  12764                    
  12765       <xsl:when 
  12766        test="$lan gCode/@cod e = 'hu' o r $langCod e/@code =  'hun'"
  12767       >
  12768                         
  12769        <xsl:call- template 
  12770         name="show -language- with-mode"
  12771        >
  12772                              
  12773         <xsl:with- param 
  12774          name="lang Display" 
  12775          select="'H ungarian'"  
  12776         />
  12777                              
  12778         <xsl:with- param 
  12779          name="mode Code" 
  12780          select="$m odeCode/@c ode" 
  12781         />
  12782                          
  12783        </xsl:call -template>
  12784                     
  12785       </xsl:when >
  12786                    
  12787       <xsl:when 
  12788        test="$lan gCode/@cod e = 'is' o r $langCod e/@code =  'isl' or $ langCode/@ code = 'ic e'"
  12789       >
  12790                         
  12791        <xsl:call- template 
  12792         name="show -language- with-mode"
  12793        >
  12794                              
  12795         <xsl:with- param 
  12796          name="lang Display" 
  12797          select="'I celandic'"  
  12798         />
  12799                              
  12800         <xsl:with- param 
  12801          name="mode Code" 
  12802          select="$m odeCode/@c ode" 
  12803         />
  12804                          
  12805        </xsl:call -template>
  12806                     
  12807       </xsl:when >
  12808                    
  12809       <xsl:when 
  12810        test="$lan gCode/@cod e = 'id' o r $langCod e/@code =  'ind'"
  12811       >
  12812                         
  12813        <xsl:call- template 
  12814         name="show -language- with-mode"
  12815        >
  12816                              
  12817         <xsl:with- param 
  12818          name="lang Display" 
  12819          select="'I ndonesian'
  12820         />
  12821                              
  12822         <xsl:with- param 
  12823          name="mode Code" 
  12824          select="$m odeCode/@c ode" 
  12825         />
  12826                          
  12827        </xsl:call -template>
  12828                     
  12829       </xsl:when >
  12830                    
  12831       <xsl:when 
  12832        test="$lan gCode/@cod e = 'id' o r $langCod e/@code =  'ind'"
  12833       >
  12834                         
  12835        <xsl:call- template 
  12836         name="show -language- with-mode"
  12837        >
  12838                              
  12839         <xsl:with- param 
  12840          name="lang Display" 
  12841          select="'I ndonesian'
  12842         />
  12843                              
  12844         <xsl:with- param 
  12845          name="mode Code" 
  12846          select="$m odeCode/@c ode" 
  12847         />
  12848                          
  12849        </xsl:call -template>
  12850                     
  12851       </xsl:when >
  12852                    
  12853       <xsl:when 
  12854        test="$lan gCode/@cod e = 'ira'"
  12855       >
  12856                         
  12857        <xsl:call- template 
  12858         name="show -language- with-mode"
  12859        >
  12860                              
  12861         <xsl:with- param 
  12862          name="lang Display" 
  12863          select="'I ranian lan guages'" 
  12864         />
  12865                              
  12866         <xsl:with- param 
  12867          name="mode Code" 
  12868          select="$m odeCode/@c ode" 
  12869         />
  12870                          
  12871        </xsl:call -template>
  12872                     
  12873       </xsl:when >
  12874                    
  12875       <xsl:when 
  12876        test="$lan gCode/@cod e = 'it' o r $langCod e/@code =  'ita'"
  12877       >
  12878                         
  12879        <xsl:call- template 
  12880         name="show -language- with-mode"
  12881        >
  12882                              
  12883         <xsl:with- param 
  12884          name="lang Display" 
  12885          select="'I talian'" 
  12886         />
  12887                              
  12888         <xsl:with- param 
  12889          name="mode Code" 
  12890          select="$m odeCode/@c ode" 
  12891         />
  12892                          
  12893        </xsl:call -template>
  12894                     
  12895       </xsl:when >
  12896                    
  12897       <xsl:when 
  12898        test="$lan gCode/@cod e = 'ja' o r $langCod e/@code =  'jpn'"
  12899       >
  12900                         
  12901        <xsl:call- template 
  12902         name="show -language- with-mode"
  12903        >
  12904                              
  12905         <xsl:with- param 
  12906          name="lang Display" 
  12907          select="'J apanese'" 
  12908         />
  12909                              
  12910         <xsl:with- param 
  12911          name="mode Code" 
  12912          select="$m odeCode/@c ode" 
  12913         />
  12914                          
  12915        </xsl:call -template>
  12916                     
  12917       </xsl:when >
  12918                    
  12919       <xsl:when 
  12920        test="$lan gCode/@cod e = 'ko' o r $langCod e/@code =  'kor'"
  12921       >
  12922                         
  12923        <xsl:call- template 
  12924         name="show -language- with-mode"
  12925        >
  12926                              
  12927         <xsl:with- param 
  12928          name="lang Display" 
  12929          select="'K orean'" 
  12930         />
  12931                              
  12932         <xsl:with- param 
  12933          name="mode Code" 
  12934          select="$m odeCode/@c ode" 
  12935         />
  12936                          
  12937        </xsl:call -template>
  12938                     
  12939       </xsl:when >
  12940                    
  12941       <xsl:when 
  12942        test="$lan gCode/@cod e = 'la' o r $langCod e/@code =  'lat'"
  12943       >
  12944                         
  12945        <xsl:call- template 
  12946         name="show -language- with-mode"
  12947        >
  12948                              
  12949         <xsl:with- param 
  12950          name="lang Display" 
  12951          select="'L atin'" 
  12952         />
  12953                              
  12954         <xsl:with- param 
  12955          name="mode Code" 
  12956          select="$m odeCode/@c ode" 
  12957         />
  12958                          
  12959        </xsl:call -template>
  12960                     
  12961       </xsl:when >
  12962                    
  12963       <xsl:when 
  12964        test="$lan gCode/@cod e = 'lv' o r $langCod e/@code =  'lav'"
  12965       >
  12966                         
  12967        <xsl:call- template 
  12968         name="show -language- with-mode"
  12969        >
  12970                              
  12971         <xsl:with- param 
  12972          name="lang Display" 
  12973          select="'L atvian'" 
  12974         />
  12975                              
  12976         <xsl:with- param 
  12977          name="mode Code" 
  12978          select="$m odeCode/@c ode" 
  12979         />
  12980                          
  12981        </xsl:call -template>
  12982                     
  12983       </xsl:when >
  12984                    
  12985       <xsl:when 
  12986        test="$lan gCode/@cod e = 'lb' o r $langCod e/@code =  'ltz'"
  12987       >
  12988                         
  12989        <xsl:call- template 
  12990         name="show -language- with-mode"
  12991        >
  12992                              
  12993         <xsl:with- param 
  12994          name="lang Display" 
  12995          select="'L uxembourgi sh; Letzeb urgesch'" 
  12996         />
  12997                              
  12998         <xsl:with- param 
  12999          name="mode Code" 
  13000          select="$m odeCode/@c ode" 
  13001         />
  13002                          
  13003        </xsl:call -template>
  13004                     
  13005       </xsl:when >
  13006                    
  13007       <xsl:when 
  13008        test="$lan gCode/@cod e = 'mk' o r $langCod e/@code =  'mkd' or $ langCode/@ code = 'ma c'"
  13009       >
  13010                         
  13011        <xsl:call- template 
  13012         name="show -language- with-mode"
  13013        >
  13014                              
  13015         <xsl:with- param 
  13016          name="lang Display" 
  13017          select="'M acedonian'
  13018         />
  13019                              
  13020         <xsl:with- param 
  13021          name="mode Code" 
  13022          select="$m odeCode/@c ode" 
  13023         />
  13024                          
  13025        </xsl:call -template>
  13026                     
  13027       </xsl:when >
  13028                    
  13029       <xsl:when 
  13030        test="$lan gCode/@cod e = 'mt' o r $langCod e/@code =  'mlt'"
  13031       >
  13032                         
  13033        <xsl:call- template 
  13034         name="show -language- with-mode"
  13035        >
  13036                              
  13037         <xsl:with- param 
  13038          name="lang Display" 
  13039          select="'M altese'" 
  13040         />
  13041                              
  13042         <xsl:with- param 
  13043          name="mode Code" 
  13044          select="$m odeCode/@c ode" 
  13045         />
  13046                          
  13047        </xsl:call -template>
  13048                     
  13049       </xsl:when >
  13050                    
  13051       <xsl:when 
  13052        test="$lan gCode/@cod e = 'mt' o r $langCod e/@code =  'mlt'"
  13053       >
  13054                         
  13055        <xsl:call- template 
  13056         name="show -language- with-mode"
  13057        >
  13058                              
  13059         <xsl:with- param 
  13060          name="lang Display" 
  13061          select="'M altese'" 
  13062         />
  13063                              
  13064         <xsl:with- param 
  13065          name="mode Code" 
  13066          select="$m odeCode/@c ode" 
  13067         />
  13068                          
  13069        </xsl:call -template>
  13070                     
  13071       </xsl:when >
  13072                    
  13073       <xsl:when 
  13074        test="$lan gCode/@cod e = 'mnc'"
  13075       >
  13076                         
  13077        <xsl:call- template 
  13078         name="show -language- with-mode"
  13079        >
  13080                              
  13081         <xsl:with- param 
  13082          name="lang Display" 
  13083          select="'M anchu'" 
  13084         />
  13085                              
  13086         <xsl:with- param 
  13087          name="mode Code" 
  13088          select="$m odeCode/@c ode" 
  13089         />
  13090                          
  13091        </xsl:call -template>
  13092                     
  13093       </xsl:when >
  13094                    
  13095       <xsl:when 
  13096        test="$lan gCode/@cod e = 'moh'"
  13097       >
  13098                         
  13099        <xsl:call- template 
  13100         name="show -language- with-mode"
  13101        >
  13102                              
  13103         <xsl:with- param 
  13104          name="lang Display" 
  13105          select="'M ohawk'" 
  13106         />
  13107                              
  13108         <xsl:with- param 
  13109          name="mode Code" 
  13110          select="$m odeCode/@c ode" 
  13111         />
  13112                          
  13113        </xsl:call -template>
  13114                     
  13115       </xsl:when >
  13116                    
  13117       <xsl:when 
  13118        test="$lan gCode/@cod e = 'mn' o r $langCod e/@code =  'mon'"
  13119       >
  13120                         
  13121        <xsl:call- template 
  13122         name="show -language- with-mode"
  13123        >
  13124                              
  13125         <xsl:with- param 
  13126          name="lang Display" 
  13127          select="'M ongolian'"  
  13128         />
  13129                              
  13130         <xsl:with- param 
  13131          name="mode Code" 
  13132          select="$m odeCode/@c ode" 
  13133         />
  13134                          
  13135        </xsl:call -template>
  13136                     
  13137       </xsl:when >
  13138                    
  13139       <xsl:when 
  13140        test="$lan gCode/@cod e = 'myn'"
  13141       >
  13142                         
  13143        <xsl:call- template 
  13144         name="show -language- with-mode"
  13145        >
  13146                              
  13147         <xsl:with- param 
  13148          name="lang Display" 
  13149          select="'M ayan langu ages'" 
  13150         />
  13151                              
  13152         <xsl:with- param 
  13153          name="mode Code" 
  13154          select="$m odeCode/@c ode" 
  13155         />
  13156                          
  13157        </xsl:call -template>
  13158                     
  13159       </xsl:when >
  13160                    
  13161       <xsl:when 
  13162        test="$lan gCode/@cod e = 'nai'"
  13163       >
  13164                         
  13165        <xsl:call- template 
  13166         name="show -language- with-mode"
  13167        >
  13168                              
  13169         <xsl:with- param 
  13170          name="lang Display" 
  13171          select="'N orth Ameri can Indian  languages '" 
  13172         />
  13173                              
  13174         <xsl:with- param 
  13175          name="mode Code" 
  13176          select="$m odeCode/@c ode" 
  13177         />
  13178                          
  13179        </xsl:call -template>
  13180                     
  13181       </xsl:when >
  13182                    
  13183       <xsl:when 
  13184        test="$lan gCode/@cod e = 'nn' o r $langCod e/@code =  'nno'"
  13185       >
  13186                         
  13187        <xsl:call- template 
  13188         name="show -language- with-mode"
  13189        >
  13190                              
  13191         <xsl:with- param 
  13192          name="lang Display" 
  13193          select="'N orwegian N ynorsk; Ny norsk, Nor wegian'" 
  13194         />
  13195                              
  13196         <xsl:with- param 
  13197          name="mode Code" 
  13198          select="$m odeCode/@c ode" 
  13199         />
  13200                          
  13201        </xsl:call -template>
  13202                     
  13203       </xsl:when >
  13204                    
  13205       <xsl:when 
  13206        test="$lan gCode/@cod e = 'no' o r $langCod e/@code =  'nor'"
  13207       >
  13208                         
  13209        <xsl:call- template 
  13210         name="show -language- with-mode"
  13211        >
  13212                              
  13213         <xsl:with- param 
  13214          name="lang Display" 
  13215          select="'N orwegian'"  
  13216         />
  13217                              
  13218         <xsl:with- param 
  13219          name="mode Code" 
  13220          select="$m odeCode/@c ode" 
  13221         />
  13222                          
  13223        </xsl:call -template>
  13224                     
  13225       </xsl:when >
  13226                    
  13227       <xsl:when 
  13228        test="$lan gCode/@cod e = 'ota'"
  13229       >
  13230                         
  13231        <xsl:call- template 
  13232         name="show -language- with-mode"
  13233        >
  13234                              
  13235         <xsl:with- param 
  13236          name="lang Display" 
  13237          select="'T urkish, Ot toman (150 0-1928)'" 
  13238         />
  13239                              
  13240         <xsl:with- param 
  13241          name="mode Code" 
  13242          select="$m odeCode/@c ode" 
  13243         />
  13244                          
  13245        </xsl:call -template>
  13246                     
  13247       </xsl:when >
  13248                    
  13249       <xsl:when 
  13250        test="$lan gCode/@cod e = 'fa' o r $langCod e/@code =  'fas' or $ langCode/@ code = 'pe r'"
  13251       >
  13252                         
  13253        <xsl:call- template 
  13254         name="show -language- with-mode"
  13255        >
  13256                              
  13257         <xsl:with- param 
  13258          name="lang Display" 
  13259          select="'P ersian'" 
  13260         />
  13261                              
  13262         <xsl:with- param 
  13263          name="mode Code" 
  13264          select="$m odeCode/@c ode" 
  13265         />
  13266                          
  13267        </xsl:call -template>
  13268                     
  13269       </xsl:when >
  13270                    
  13271       <xsl:when 
  13272        test="$lan gCode/@cod e = 'phi'"
  13273       >
  13274                         
  13275        <xsl:call- template 
  13276         name="show -language- with-mode"
  13277        >
  13278                              
  13279         <xsl:with- param 
  13280          name="lang Display" 
  13281          select="'P ersian'" 
  13282         />
  13283                              
  13284         <xsl:with- param 
  13285          name="mode Code" 
  13286          select="$m odeCode/@c ode" 
  13287         />
  13288                          
  13289        </xsl:call -template>
  13290                     
  13291       </xsl:when >
  13292                    
  13293       <xsl:when 
  13294        test="$lan gCode/@cod e = 'pl' o r $langCod e/@code =  'pol'"
  13295       >
  13296                         
  13297        <xsl:call- template 
  13298         name="show -language- with-mode"
  13299        >
  13300                              
  13301         <xsl:with- param 
  13302          name="lang Display" 
  13303          select="'P olish'" 
  13304         />
  13305                              
  13306         <xsl:with- param 
  13307          name="mode Code" 
  13308          select="$m odeCode/@c ode" 
  13309         />
  13310                          
  13311        </xsl:call -template>
  13312                     
  13313       </xsl:when >
  13314                    
  13315       <xsl:when 
  13316        test="$lan gCode/@cod e = 'pl' o r $langCod e/@code =  'pol'"
  13317       >
  13318                         
  13319        <xsl:call- template 
  13320         name="show -language- with-mode"
  13321        >
  13322                              
  13323         <xsl:with- param 
  13324          name="lang Display" 
  13325          select="'P olish'" 
  13326         />
  13327                              
  13328         <xsl:with- param 
  13329          name="mode Code" 
  13330          select="$m odeCode/@c ode" 
  13331         />
  13332                          
  13333        </xsl:call -template>
  13334                     
  13335       </xsl:when >
  13336                    
  13337       <xsl:when 
  13338        test="$lan gCode/@cod e = 'pt' o r $langCod e/@code =  'por'"
  13339       >
  13340                         
  13341        <xsl:call- template 
  13342         name="show -language- with-mode"
  13343        >
  13344                              
  13345         <xsl:with- param 
  13346          name="lang Display" 
  13347          select="'P ortuguese'
  13348         />
  13349                              
  13350         <xsl:with- param 
  13351          name="mode Code" 
  13352          select="$m odeCode/@c ode" 
  13353         />
  13354                          
  13355        </xsl:call -template>
  13356                     
  13357       </xsl:when >
  13358                    
  13359       <xsl:when 
  13360        test="$lan gCode/@cod e = 'ru' o r $langCod e/@code =  'rus'"
  13361       >
  13362                         
  13363        <xsl:call- template 
  13364         name="show -language- with-mode"
  13365        >
  13366                              
  13367         <xsl:with- param 
  13368          name="lang Display" 
  13369          select="'R ussian'" 
  13370         />
  13371                              
  13372         <xsl:with- param 
  13373          name="mode Code" 
  13374          select="$m odeCode/@c ode" 
  13375         />
  13376                          
  13377        </xsl:call -template>
  13378                     
  13379       </xsl:when >
  13380                    
  13381       <xsl:when 
  13382        test="$lan gCode/@cod e = 'sai'"
  13383       >
  13384                         
  13385        <xsl:call- template 
  13386         name="show -language- with-mode"
  13387        >
  13388                              
  13389         <xsl:with- param 
  13390          name="lang Display" 
  13391          select="'S outh Ameri can Indian  (Other)'"  
  13392         />
  13393                              
  13394         <xsl:with- param 
  13395          name="mode Code" 
  13396          select="$m odeCode/@c ode" 
  13397         />
  13398                          
  13399        </xsl:call -template>
  13400                     
  13401       </xsl:when >
  13402                    
  13403       <xsl:when 
  13404        test="$lan gCode/@cod e = 'sa' o r $langCod e/@code =  'san'"
  13405       >
  13406                         
  13407        <xsl:call- template 
  13408         name="show -language- with-mode"
  13409        >
  13410                              
  13411         <xsl:with- param 
  13412          name="lang Display" 
  13413          select="'S anskrit'" 
  13414         />
  13415                              
  13416         <xsl:with- param 
  13417          name="mode Code" 
  13418          select="$m odeCode/@c ode" 
  13419         />
  13420                          
  13421        </xsl:call -template>
  13422                     
  13423       </xsl:when >
  13424                    
  13425       <xsl:when 
  13426        test="$lan gCode/@cod e = 'scn'"
  13427       >
  13428                         
  13429        <xsl:call- template 
  13430         name="show -language- with-mode"
  13431        >
  13432                              
  13433         <xsl:with- param 
  13434          name="lang Display" 
  13435          select="'S icilian'" 
  13436         />
  13437                              
  13438         <xsl:with- param 
  13439          name="mode Code" 
  13440          select="$m odeCode/@c ode" 
  13441         />
  13442                          
  13443        </xsl:call -template>
  13444                     
  13445       </xsl:when >
  13446                    
  13447       <xsl:when 
  13448        test="$lan gCode/@cod e = 'scn'"
  13449       >
  13450                         
  13451        <xsl:call- template 
  13452         name="show -language- with-mode"
  13453        >
  13454                              
  13455         <xsl:with- param 
  13456          name="lang Display" 
  13457          select="'S icilian'" 
  13458         />
  13459                              
  13460         <xsl:with- param 
  13461          name="mode Code" 
  13462          select="$m odeCode/@c ode" 
  13463         />
  13464                          
  13465        </xsl:call -template>
  13466                     
  13467       </xsl:when >
  13468                    
  13469       <xsl:when 
  13470        test="$lan gCode/@cod e = 'sgn'"
  13471       >
  13472                         
  13473        <xsl:call- template 
  13474         name="show -language- with-mode"
  13475        >
  13476                              
  13477         <xsl:with- param 
  13478          name="lang Display" 
  13479          select="'S ign Langua ges'" 
  13480         />
  13481                              
  13482         <xsl:with- param 
  13483          name="mode Code" 
  13484          select="$m odeCode/@c ode" 
  13485         />
  13486                          
  13487        </xsl:call -template>
  13488                     
  13489       </xsl:when >
  13490                    
  13491       <xsl:when 
  13492        test="$lan gCode/@cod e = 'sgn'"
  13493       >
  13494                         
  13495        <xsl:call- template 
  13496         name="show -language- with-mode"
  13497        >
  13498                              
  13499         <xsl:with- param 
  13500          name="lang Display" 
  13501          select="'S ign Langua ges'" 
  13502         />
  13503                              
  13504         <xsl:with- param 
  13505          name="mode Code" 
  13506          select="$m odeCode/@c ode" 
  13507         />
  13508                          
  13509        </xsl:call -template>
  13510                     
  13511       </xsl:when >
  13512                    
  13513       <xsl:when 
  13514        test="$lan gCode/@cod e = 'sla'"
  13515       >
  13516                         
  13517        <xsl:call- template 
  13518         name="show -language- with-mode"
  13519        >
  13520                              
  13521         <xsl:with- param 
  13522          name="lang Display" 
  13523          select="'S lavic lang uages'" 
  13524         />
  13525                              
  13526         <xsl:with- param 
  13527          name="mode Code" 
  13528          select="$m odeCode/@c ode" 
  13529         />
  13530                          
  13531        </xsl:call -template>
  13532                     
  13533       </xsl:when >
  13534                    
  13535       <xsl:when 
  13536        test="$lan gCode/@cod e = 'sk' o r $langCod e/@code =  'slk' or $ langCode/@ code = 'sl o'"
  13537       >
  13538                         
  13539        <xsl:call- template 
  13540         name="show -language- with-mode"
  13541        >
  13542                              
  13543         <xsl:with- param 
  13544          name="lang Display" 
  13545          select="'S lovak'" 
  13546         />
  13547                              
  13548         <xsl:with- param 
  13549          name="mode Code" 
  13550          select="$m odeCode/@c ode" 
  13551         />
  13552                          
  13553        </xsl:call -template>
  13554                     
  13555       </xsl:when >
  13556                    
  13557       <xsl:when 
  13558        test="$lan gCode/@cod e = 'sk' o r $langCod e/@code =  'slk' or $ langCode/@ code = 'sl o'"
  13559       >
  13560                         
  13561        <xsl:call- template 
  13562         name="show -language- with-mode"
  13563        >
  13564                              
  13565         <xsl:with- param 
  13566          name="lang Display" 
  13567          select="'S lovak'" 
  13568         />
  13569                              
  13570         <xsl:with- param 
  13571          name="mode Code" 
  13572          select="$m odeCode/@c ode" 
  13573         />
  13574                          
  13575        </xsl:call -template>
  13576                     
  13577       </xsl:when >
  13578                    
  13579       <xsl:when 
  13580        test="$lan gCode/@cod e = 'sl' o r $langCod e/@code =  'slv'"
  13581       >
  13582                         
  13583        <xsl:call- template 
  13584         name="show -language- with-mode"
  13585        >
  13586                              
  13587         <xsl:with- param 
  13588          name="lang Display" 
  13589          select="'S lovenian'"  
  13590         />
  13591                              
  13592         <xsl:with- param 
  13593          name="mode Code" 
  13594          select="$m odeCode/@c ode" 
  13595         />
  13596                          
  13597        </xsl:call -template>
  13598                     
  13599       </xsl:when >
  13600                    
  13601       <xsl:when 
  13602        test="$lan gCode/@cod e = 'sm' o r $langCod e/@code =  'smo'"
  13603       >
  13604                         
  13605        <xsl:call- template 
  13606         name="show -language- with-mode"
  13607        >
  13608                              
  13609         <xsl:with- param 
  13610          name="lang Display" 
  13611          select="'S amoan'" 
  13612         />
  13613                              
  13614         <xsl:with- param 
  13615          name="mode Code" 
  13616          select="$m odeCode/@c ode" 
  13617         />
  13618                          
  13619        </xsl:call -template>
  13620                     
  13621       </xsl:when >
  13622                    
  13623       <xsl:when 
  13624        test="$lan gCode/@cod e = 'so' o r $langCod e/@code =  'som'"
  13625       >
  13626                         
  13627        <xsl:call- template 
  13628         name="show -language- with-mode"
  13629        >
  13630                              
  13631         <xsl:with- param 
  13632          name="lang Display" 
  13633          select="'S omali'" 
  13634         />
  13635                              
  13636         <xsl:with- param 
  13637          name="mode Code" 
  13638          select="$m odeCode/@c ode" 
  13639         />
  13640                          
  13641        </xsl:call -template>
  13642                     
  13643       </xsl:when >
  13644                    
  13645       <xsl:when 
  13646        test="$lan gCode/@cod e = 'es' o r $langCod e/@code =  'spa' or $ langCode/@ code = 'es -ES' or $l angCode/@c ode = 'es- MX' or $la ngCode/@co de = 'es-P R' or $lan gCode/@cod e = 'es-AR '"
  13647       >
  13648                         
  13649        <xsl:call- template 
  13650         name="show -language- with-mode"
  13651        >
  13652                              
  13653         <xsl:with- param 
  13654          name="lang Display" 
  13655          select="'S omali'" 
  13656         />
  13657                              
  13658         <xsl:with- param 
  13659          name="mode Code" 
  13660          select="$m odeCode/@c ode" 
  13661         />
  13662                          
  13663        </xsl:call -template>
  13664                     
  13665       </xsl:when >
  13666                    
  13667       <xsl:when 
  13668        test="$lan gCode/@cod e = 'sr' o r $langCod e/@code =  'srp'"
  13669       >
  13670                         
  13671        <xsl:call- template 
  13672         name="show -language- with-mode"
  13673        >
  13674                              
  13675         <xsl:with- param 
  13676          name="lang Display" 
  13677          select="'S erbian'" 
  13678         />
  13679                              
  13680         <xsl:with- param 
  13681          name="mode Code" 
  13682          select="$m odeCode/@c ode" 
  13683         />
  13684                          
  13685        </xsl:call -template>
  13686                     
  13687       </xsl:when >
  13688                    
  13689       <xsl:when 
  13690        test="$lan gCode/@cod e = 'sv' o r $langCod e/@code =  'swe'"
  13691       >
  13692                         
  13693        <xsl:call- template 
  13694         name="show -language- with-mode"
  13695        >
  13696                              
  13697         <xsl:with- param 
  13698          name="lang Display" 
  13699          select="'S wedish'" 
  13700         />
  13701                              
  13702         <xsl:with- param 
  13703          name="mode Code" 
  13704          select="$m odeCode/@c ode" 
  13705         />
  13706                          
  13707        </xsl:call -template>
  13708                     
  13709       </xsl:when >
  13710                    
  13711       <xsl:when 
  13712        test="$lan gCode/@cod e = 'ty' o r $langCod e/@code =  'tah'"
  13713       >
  13714                         
  13715        <xsl:call- template 
  13716         name="show -language- with-mode"
  13717        >
  13718                              
  13719         <xsl:with- param 
  13720          name="lang Display" 
  13721          select="'T ahitian'" 
  13722         />
  13723                              
  13724         <xsl:with- param 
  13725          name="mode Code" 
  13726          select="$m odeCode/@c ode" 
  13727         />
  13728                          
  13729        </xsl:call -template>
  13730                     
  13731       </xsl:when >
  13732                    
  13733       <xsl:when 
  13734        test="$lan gCode/@cod e = 'th' o r $langCod e/@code =  'tha'"
  13735       >
  13736                         
  13737        <xsl:call- template 
  13738         name="show -language- with-mode"
  13739        >
  13740                              
  13741         <xsl:with- param 
  13742          name="lang Display" 
  13743          select="'T hai'" 
  13744         />
  13745                              
  13746         <xsl:with- param 
  13747          name="mode Code" 
  13748          select="$m odeCode/@c ode" 
  13749         />
  13750                          
  13751        </xsl:call -template>
  13752                     
  13753       </xsl:when >
  13754                    
  13755       <xsl:when 
  13756        test="$lan gCode/@cod e = 'bo' o r $langCod e/@code =  'bod' or $ langCode/@ code = 'ti b'"
  13757       >
  13758                         
  13759        <xsl:call- template 
  13760         name="show -language- with-mode"
  13761        >
  13762                              
  13763         <xsl:with- param 
  13764          name="lang Display" 
  13765          select="'T ibetan'" 
  13766         />
  13767                              
  13768         <xsl:with- param 
  13769          name="mode Code" 
  13770          select="$m odeCode/@c ode" 
  13771         />
  13772                          
  13773        </xsl:call -template>
  13774                     
  13775       </xsl:when >
  13776                    
  13777       <xsl:when 
  13778        test="$lan gCode/@cod e = 'tr' o r $langCod e/@code =  'tur'"
  13779       >
  13780                         
  13781        <xsl:call- template 
  13782         name="show -language- with-mode"
  13783        >
  13784                              
  13785         <xsl:with- param 
  13786          name="lang Display" 
  13787          select="'T urkish'" 
  13788         />
  13789                              
  13790         <xsl:with- param 
  13791          name="mode Code" 
  13792          select="$m odeCode/@c ode" 
  13793         />
  13794                          
  13795        </xsl:call -template>
  13796                     
  13797       </xsl:when >
  13798                    
  13799       <xsl:when 
  13800        test="$lan gCode/@cod e = 'vi' o r $langCod e/@code =  'vie'"
  13801       >
  13802                         
  13803        <xsl:call- template 
  13804         name="show -language- with-mode"
  13805        >
  13806                              
  13807         <xsl:with- param 
  13808          name="lang Display" 
  13809          select="'V ietnamese'
  13810         />
  13811                              
  13812         <xsl:with- param 
  13813          name="mode Code" 
  13814          select="$m odeCode/@c ode" 
  13815         />
  13816                          
  13817        </xsl:call -template>
  13818                     
  13819       </xsl:when >
  13820                    
  13821       <xsl:when 
  13822        test="$lan gCode/@cod e = 'cy' o r $langCod e/@code =  'cym' or $ langCode/@ code = 'we l'"
  13823       >
  13824                         
  13825        <xsl:call- template 
  13826         name="show -language- with-mode"
  13827        >
  13828                              
  13829         <xsl:with- param 
  13830          name="lang Display" 
  13831          select="'W elsh'" 
  13832         />
  13833                              
  13834         <xsl:with- param 
  13835          name="mode Code" 
  13836          select="$m odeCode/@c ode" 
  13837         />
  13838                          
  13839        </xsl:call -template>
  13840                     
  13841       </xsl:when >
  13842               
  13843      </xsl:choo se>
  13844          
  13845     </xsl:temp late>
  13846         
  13847     <xsl:templ ate 
  13848      name="pref -language"
  13849     >
  13850              
  13851      <xsl:param  
  13852       name="lang Code" 
  13853      />
  13854              
  13855      <xsl:param  
  13856       name="pref Lang" 
  13857      />
  13858              
  13859      <xsl:param  
  13860       name="mode Code" 
  13861      />
  13862              
  13863      <xsl:choos e>
  13864                    
  13865       <xsl:when 
  13866        test="$pre fLang/@val ue='true'"
  13867       >
  13868                         
  13869        <xsl:call- template 
  13870         name="show -language"
  13871        >
  13872                              
  13873         <xsl:with- param 
  13874          name="lang Code" 
  13875          select="$l angCode" 
  13876         />
  13877                              
  13878         <xsl:with- param 
  13879          name="mode Code" 
  13880          select="$m odeCode" 
  13881         />
  13882                          
  13883        </xsl:call -template>
  13884                     
  13885       </xsl:when >
  13886                    
  13887       <xsl:other wise>
  13888                         
  13889        <xsl:text>
  13890        </xsl:text >
  13891                     
  13892       </xsl:othe rwise>
  13893               
  13894      </xsl:choo se>
  13895          
  13896     </xsl:temp late>
  13897    
  13898         
  13899     <!-- Add s paces in t he view of  notes. -- >
  13900         
  13901     <xsl:templ ate 
  13902      match="n1: table/n1:t body/n1:tr /n1:td/n1: content"
  13903                        
  13904      name="inse rtBreaks"
  13905     >
  13906              
  13907      <xsl:param  
  13908       name="pTex t" 
  13909       select="."  
  13910      />
  13911              
  13912      <xsl:choos e>
  13913                    
  13914       <xsl:when 
  13915        test="not( contains($ pText, '&# xA;'))  or  not($isVA )"
  13916       >
  13917                         
  13918        <xsl:copy- of 
  13919         select="$p Text" 
  13920        />
  13921                     
  13922       </xsl:when >
  13923                    
  13924       <xsl:other wise>
  13925                         
  13926        <xsl:value -of 
  13927         select="su bstring-be fore($pTex t, '&#xA;' )" 
  13928        />
  13929                         
  13930        <br />
  13931                         
  13932        <xsl:call- template 
  13933         name="inse rtBreaks"
  13934        >
  13935                              
  13936         <xsl:with- param 
  13937          name="pTex t"
  13938                                                
  13939          select="su bstring-af ter($pText , '&#xA;')
  13940         />
  13941                          
  13942        </xsl:call -template>
  13943                     
  13944       </xsl:othe rwise>
  13945               
  13946      </xsl:choo se>
  13947          
  13948     </xsl:temp late>
  13949   </xsl:styl esheet>