304. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 4/5/2017 4:22:11 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.

304.1 Files compared

# Location File Last Modified
1 C:\working_scrub\Unredacted\eHX Code Base\eHX_Bld2_Source Code_CIF_2017-02-14\NHIN_adapter\StyleSheet\C-CDA cda.xsl Fri Feb 10 15:41:44 2017 UTC
2 eHX-CIF.zip\eHX-CIF\eHX Code Base\eHX_Bld2_Source Code_CIF_2017-02-14\NHIN_adapter\StyleSheet\C-CDA cda.xsl Mon Apr 3 14:40:03 2017 UTC

304.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 11 23282
Changed 10 20
Inserted 0 0
Removed 0 0

304.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

304.4 Active regular expressions

No regular expressions were active.

304.5 Comparison detail

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