3157. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 6/9/2017 3:49:52 PM Eastern 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.

3157.1 Files compared

# Location File Last Modified
1 Fri Jun 9 19:49:52 2017 UTC
2 eHealth_Exch (eHealth Exchange Enhancements) Build 3 docs & code_May_2017.zip\VAP_CIF_CODE0502.zip\VAP_CIF_CODE0502\VAP_CIF_CODE0502\nvap-client\src\main\resources\gov\va\nvap\document\xsl\lantana cda.xsl Fri Apr 21 20:03:26 2017 UTC

3157.2 Comparison summary

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

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

3157.4 Active regular expressions

No regular expressions were active.

3157.5 Comparison detail

        1   <?xml 
        2     version="1 .0" 
        3     encoding=" UTF-8"
        4   ?>
        5   <!-- Title : CDA XSL  StyleSheet  Original  Filename:  cda.xsl Ve rsion: 3.0  Revision 
        6           Hi story: 08/ 12/08 Jing dong Li up dated Revi sion Histo ry: 12/11/ 09 KH upda ted 
        7           Re vision His tory: 03/3 0/10 Jingd ong Li upd ated. Revi sion Histo ry: 08/25/ 10 
        8           Ji ngdong Li  updated Re vision His tory: 09/1 7/10 Jingd ong Li upd ated Revis ion 
        9           Hi story: 01/ 05/11 Jing dong Li up dated Spec ification:  ANSI/HL7  CDAR2 The  current 
        10           ve rsion and  documentat ion are av ailable at  http://ww w.lantanag roup.com/r esources/t ools/. 
        11           We  welcome f eedback an d contribu tions to t ools@lanta nagroup.co m The styl esheet 
        12           is  the cumul ative work  of severa l develope rs; the mo st signifi cant prior  
        13           mi lestones w ere the fo undation w ork from H L7 Germany  and Finla nd (Tyylit iedosto) 
        14           an d HL7 US ( Calvin Bee be), and t he present ation appr oach from  Tony Schal ler, 
        15           me dshare Gmb H provided  at IHIC 2 009. -->
        16   <!-- LICEN SE INFORMA TION Licen sed under  the Apache  License,  Version 2. 0 (the 
        17           "L icense");  you may no t use this  file exce pt in comp liance wit h the Lice nse. 
        18           Yo u may obta in a copy  of the Lic ense at ht tp://www.a pache.org/ licenses/L ICENSE-2.0  -->
        19   <xsl:style sheet 
        20     version="1 .0"
        21           
        22     xmlns:xsl= "http://ww w.w3.org/1 999/XSL/Tr ansform" 
        23     xmlns:n1=" urn:hl7-or g:v3"
        24           
        25     xmlns:xsi= "http://ww w.w3.org/2 001/XMLSch ema-instan ce"
        26   >
        27             
        28     <xsl:outpu
        29      method="ht ml" 
        30      indent="ye s" 
        31      version="4 .01"
        32                      
        33      encoding=" ISO-8859-1
        34      doctype-sy stem="http ://www.w3. org/TR/htm l4/strict. dtd"
        35                      
        36      doctype-pu blic="-//W 3C//DTD HT ML 4.01//E N" 
        37     />
        38             
        39     <!-- globa l variable  title -->
        40             
        41     <xsl:varia ble 
        42      name="titl e"
        43     >
        44                       
        45      <xsl:choos e>
        46                                 
        47       <xsl:when 
        48        test="stri ng-length( /n1:Clinic alDocument /n1:title)   &gt;= 1"
        49       >
        50                                           
        51        <xsl:value -of 
        52         select="/n 1:Clinical Document/n 1:title" 
        53        />
        54                                  
        55       </xsl:when >
        56                                 
        57       <xsl:when 
        58        test="/n1: ClinicalDo cument/n1: code/@disp layName"
        59       >
        60                                           
        61        <xsl:value -of 
        62         select="/n 1:Clinical Document/n 1:code/@di splayName"  
        63        />
        64                                  
        65       </xsl:when >
        66                                 
        67       <xsl:other wise>
        68                                           
        69        <xsl:text>
        70         Clinical D ocument
        71        </xsl:text >
        72                                  
        73       </xsl:othe rwise>
        74                        
        75      </xsl:choo se>
        76              
        77     </xsl:vari able>
        78             
        79     <!-- Main  -->
        80             
        81     <xsl:templ ate 
        82      match="/"
        83     >
        84                       
        85      <xsl:apply -templates  
        86       select="n1 :ClinicalD ocument" 
        87      />
        88              
        89     </xsl:temp late>
        90             
        91     <!-- produ ce browser  rendered,  human rea dable clin ical docum ent -->
        92             
        93     <xsl:templ ate 
        94      match="n1: ClinicalDo cument"
        95     >
        96                       
        97      <!-- <html > <head> < xsl:commen t> Do NOT  edit this  HTML direc tly: it wa
        98                                genera ted via an  XSLT tran sformation  from a CD A Release  2 XML docu ment. </xs l:comment>  
        99                                <title > <xsl:val ue-of sele ct="$title "/> </titl e> <xsl:ca ll-templat e name="ad dCSS"/> 
        100                                </head > <body> - ->
        101                       
        102      <div 
        103       id="cdaXsl Body"
        104      >
        105                                 
        106       <h1 
        107        class="h1c enter"
        108       >
        109                                           
        110        <xsl:value -of 
        111         select="$t itle" 
        112        />
        113                                  
        114       </h1>
        115                                 
        116       <!-- START  display t op portion  of clinic al documen t -->
        117                                 
        118       <xsl:call- template 
        119        name="reco rdTarget" 
        120       />
        121                                 
        122       <xsl:call- template 
        123        name="docu mentGenera l" 
        124       />
        125                                 
        126       <xsl:call- template 
        127        name="docu mentationO f" 
        128       />
        129                                 
        130       <xsl:call- template 
        131        name="auth or" 
        132       />
        133                                 
        134       <xsl:call- template 
        135        name="comp onentof" 
        136       />
        137                                 
        138       <xsl:call- template 
        139        name="part icipant" 
        140       />
        141                                 
        142       <xsl:call- template 
        143        name="data Enterer" 
        144       />
        145                                 
        146       <xsl:call- template 
        147        name="auth enticator"  
        148       />
        149                                 
        150       <xsl:call- template 
        151        name="info rmant" 
        152       />
        153                                 
        154       <xsl:call- template 
        155        name="info rmationRec ipient" 
        156       />
        157                                 
        158       <xsl:call- template 
        159        name="lega lAuthentic ator" 
        160       />
        161                                 
        162       <xsl:call- template 
        163        name="cust odian" 
        164       />
        165                                 
        166       <!-- END d isplay top  portion o f clinical  document  -->
        167                                 
        168       <!-- produ ce table o f contents  -->
        169                                 
        170       <xsl:if 
        171        test="not( //n1:nonXM LBody)"
        172       >
        173                                           
        174        <xsl:if
        175                                                   
        176         test="coun t(/n1:Clin icalDocume nt/n1:comp onent/n1:s tructuredB ody/n1:com ponent[n1: section])  &gt; 1"
        177        >
        178                                                    
        179         <xsl:call- template 
        180          name="make -tableofco ntents" 
        181         />
        182                                            
        183        </xsl:if>
        184                                  
        185       </xsl:if>
        186                                 
        187       <hr 
        188        align="lef t" 
        189        color="tea l" 
        190        size="2" 
        191        width="80%
        192       />
        193                                 
        194       <!-- produ ce human r eadable do cument con tent -->
        195                                 
        196       <xsl:apply -templates
        197                                          
        198        select="n1 :component /n1:struct uredBody|n 1:componen t/n1:nonXM LBody" 
        199       />
        200                                 
        201       <!-- produ ce human r eadable do cument con tent -->
        202                                 
        203       <xsl:apply -templates
        204                                          
        205        select="n1 :component /n1:struct uredBody/n 1:componen t/n1:secti on/n1:entr y/n1:act/n 1:entryRel ationship"  
        206       />
        207                                 
        208       <br />
        209                                 
        210       <br />
        211                        
        212      </div>
        213                       
        214      <!-- </bod y> </html>  -->
        215              
        216     </xsl:temp late>
        217             
        218     <!-- gener ate table  of content s -->
        219             
        220     <xsl:templ ate 
        221      name="make -tableofco ntents"
        222     >
        223                       
        224      <h2>
        225                                 
        226       <a 
        227        name="toc"
        228       >
        229        Table of C ontents
        230       </a>
        231                        
        232      </h2>
        233                       
        234      <ul>
        235                                 
        236       <xsl:for-e ach
        237                                          
        238        select="n1 :component /n1:struct uredBody/n 1:componen t/n1:secti on/n1:titl e"
        239       >
        240                                           
        241        <li>
        242                                                    
        243         <a 
        244          href="#{ge nerate-id( .)}"
        245         >
        246                                                              
        247          <xsl:value -of 
        248           select="."  
        249          />
        250                                                     
        251         </a>
        252                                            
        253        </li>
        254                                  
        255       </xsl:for- each>
        256                        
        257      </ul>
        258              
        259     </xsl:temp late>
        260             
        261     <!-- heade r elements  -->
        262             
        263     <xsl:templ ate 
        264      name="docu mentGenera l"
        265     >
        266                       
        267      <table 
        268       class="hea der_table"
        269      >
        270                                 
        271       <tbody>
        272                                           
        273        <tr>
        274                                                    
        275         <td 
        276          width="20%
        277          bgcolor="# 3399ff"
        278         >
        279                                                              
        280          <span 
        281           class="td_ label"
        282          >
        283                                                                        
        284           <xsl:text>
        285            Document I d
        286           </xsl:text >
        287                                                               
        288          </span>
        289                                                     
        290         </td>
        291                                                    
        292         <td 
        293          width="80% "
        294         >
        295                                                              
        296          <xsl:call- template 
        297           name="show -id"
        298          >
        299                                                                        
        300           <xsl:with- param 
        301            name="id" 
        302            select="n1 :id" 
        303           />
        304                                                               
        305          </xsl:call -template>
        306                                                     
        307         </td>
        308                                            
        309        </tr>
        310                                           
        311        <tr>
        312                                                    
        313         <td 
        314          width="20%
        315          bgcolor="# 3399ff"
        316         >
        317                                                              
        318          <span 
        319           class="td_ label"
        320          >
        321                                                                        
        322           <xsl:text>
        323            Document C reated:
        324           </xsl:text >
        325                                                               
        326          </span>
        327                                                     
        328         </td>
        329                                                    
        330         <td 
        331          width="80% "
        332         >
        333                                                              
        334          <xsl:call- template 
        335           name="show -time"
        336          >
        337                                                                        
        338           <xsl:with- param 
        339            name="date time" 
        340            select="n1 :effective Time" 
        341           />
        342                                                               
        343          </xsl:call -template>
        344                                                     
        345         </td>
        346                                            
        347        </tr>
        348                                  
        349       </tbody>
        350                        
        351      </table>
        352              
        353     </xsl:temp late>
        354             
        355     <!-- confi dentiality  -->
        356             
        357     <xsl:templ ate 
        358      name="conf identialit y"
        359     >
        360                       
        361      <table 
        362       class="hea der_table"
        363      >
        364                                 
        365       <tbody>
        366                                           
        367        <td 
        368         width="20%
        369         bgcolor="# 3399ff"
        370        >
        371                                                    
        372         <xsl:text>
        373          Confidenti ality
        374         </xsl:text >
        375                                            
        376        </td>
        377                                           
        378        <td 
        379         width="80% "
        380        >
        381                                                    
        382         <xsl:choos e>
        383                                                              
        384          <xsl:when 
        385           test="n1:c onfidentia lityCode/@ code  = &a pos;N&apos ;"
        386          >
        387                                                                        
        388           <xsl:text>
        389            Normal
        390           </xsl:text >
        391                                                               
        392          </xsl:when >
        393                                                              
        394          <xsl:when 
        395           test="n1:c onfidentia lityCode/@ code  = &a pos;R&apos ;"
        396          >
        397                                                                        
        398           <xsl:text>
        399            Restricted
        400           </xsl:text >
        401                                                               
        402          </xsl:when >
        403                                                              
        404          <xsl:when 
        405           test="n1:c onfidentia lityCode/@ code  = &a pos;V&apos ;"
        406          >
        407                                                                        
        408           <xsl:text>
        409            Very restr icted
        410           </xsl:text >
        411                                                               
        412          </xsl:when >
        413                                                     
        414         </xsl:choo se>
        415                                                    
        416         <xsl:if 
        417          test="n1:c onfidentia lityCode/n 1:original Text"
        418         >
        419                                                              
        420          <xsl:text>
        421            
        422          </xsl:text >
        423                                                              
        424          <xsl:value -of 
        425           select="n1 :confident ialityCode /n1:origin alText" 
        426          />
        427                                                     
        428         </xsl:if>
        429                                            
        430        </td>
        431                                  
        432       </tbody>
        433                        
        434      </table>
        435              
        436     </xsl:temp late>
        437             
        438     <!-- autho r -->
        439             
        440     <xsl:templ ate 
        441      name="auth or"
        442     >
        443                       
        444      <xsl:if 
        445       test="n1:a uthor"
        446      >
        447                                 
        448       <table 
        449        class="hea der_table"
        450       >
        451                                           
        452        <tbody>
        453                                                    
        454         <xsl:for-e ach 
        455          select="n1 :author/n1 :assignedA uthor"
        456         >
        457                                                              
        458          <tr>
        459                                                                        
        460           <td 
        461            width="20%
        462            bgcolor="# 3399ff"
        463           >
        464                                                                                  
        465            <span 
        466             class="td_ label"
        467            >
        468                                                                                            
        469             <xsl:text>
        470              Author
        471             </xsl:text >
        472                                                                                   
        473            </span>
        474                                                                         
        475           </td>
        476                                                                        
        477           <td 
        478            width="80% "
        479           >
        480                                                                                  
        481            <xsl:choos e>
        482                                                                                            
        483             <xsl:when 
        484              test="n1:a ssignedPer son/n1:nam e"
        485             >
        486                                                                                                     
        487              <xsl:call- template 
        488               name="show -name"
        489              >
        490                                                                                                               
        491               <xsl:with- param 
        492                name="name "
        493                                                                                                                        
        494                select="n1 :assignedP erson/n1:n ame" 
        495               />
        496                                                                                                      
        497              </xsl:call -template>
        498                                                                                                     
        499              <xsl:if 
        500               test="n1:r epresented Organizati on"
        501              >
        502                                                                                                               
        503               <xsl:text>
        504               
        505               </xsl:text >
        506                                                                                                               
        507               <xsl:call- template 
        508                name="show -name"
        509               >
        510                                                                                                                         
        511                <xsl:with- param 
        512                 name="name "
        513                                                                                                                                  
        514                 select="n1 :represent edOrganiza tion/n1:na me" 
        515                />
        516                                                                                                                
        517               </xsl:call -template>
        518                                                                                                      
        519              </xsl:if>
        520                                                                                             
        521             </xsl:when >
        522                                                                                            
        523             <xsl:when 
        524              test="n1:a ssignedAut horingDevi ce/n1:soft wareName"
        525             >
        526                                                                                                     
        527              <xsl:value -of 
        528               select="n1 :assignedA uthoringDe vice/n1:so ftwareName
        529              />
        530                                                                                             
        531             </xsl:when >
        532                                                                                            
        533             <xsl:when 
        534              test="n1:r epresented Organizati on"
        535             >
        536                                                                                                     
        537              <xsl:call- template 
        538               name="show -name"
        539              >
        540                                                                                                               
        541               <xsl:with- param 
        542                name="name "
        543                                                                                                                        
        544                select="n1 :represent edOrganiza tion/n1:na me" 
        545               />
        546                                                                                                      
        547              </xsl:call -template>
        548                                                                                             
        549             </xsl:when >
        550                                                                                            
        551             <xsl:other wise>
        552                                                                                                     
        553              <xsl:for-e ach 
        554               select="n1 :id"
        555              >
        556                                                                                                               
        557               <xsl:call- template 
        558                name="show -id" 
        559               />
        560                                                                                                               
        561               <br />
        562                                                                                                      
        563              </xsl:for- each>
        564                                                                                             
        565             </xsl:othe rwise>
        566                                                                                   
        567            </xsl:choo se>
        568                                                                         
        569           </td>
        570                                                               
        571          </tr>
        572                                                              
        573          <xsl:if 
        574           test="n1:a ddr | n1:t elecom"
        575          >
        576                                                                        
        577           <tr>
        578                                                                                  
        579            <td 
        580             bgcolor="# 3399ff"
        581            >
        582                                                                                            
        583             <span 
        584              class="td_ label"
        585             >
        586                                                                                                     
        587              <xsl:text>
        588               Contact in fo
        589              </xsl:text >
        590                                                                                             
        591             </span>
        592                                                                                   
        593            </td>
        594                                                                                  
        595            <td>
        596                                                                                            
        597             <xsl:call- template 
        598              name="show -contactIn fo"
        599             >
        600                                                                                                     
        601              <xsl:with- param 
        602               name="cont act" 
        603               select="."  
        604              />
        605                                                                                             
        606             </xsl:call -template>
        607                                                                                   
        608            </td>
        609                                                                         
        610           </tr>
        611                                                               
        612          </xsl:if>
        613                                                     
        614         </xsl:for- each>
        615                                            
        616        </tbody>
        617                                  
        618       </table>
        619                        
        620      </xsl:if>
        621              
        622     </xsl:temp late>
        623             
        624     <!-- authe nticator - ->
        625             
        626     <xsl:templ ate 
        627      name="auth enticator"
        628     >
        629                       
        630      <xsl:if 
        631       test="n1:a uthenticat or"
        632      >
        633                                 
        634       <table 
        635        class="hea der_table"
        636       >
        637                                           
        638        <tbody>
        639                                                    
        640         <tr>
        641                                                              
        642          <xsl:for-e ach 
        643           select="n1 :authentic ator"
        644          >
        645                                                                        
        646           <tr>
        647                                                                                  
        648            <td 
        649             width="20%
        650             bgcolor="# 3399ff"
        651            >
        652                                                                                            
        653             <span 
        654              class="td_ label"
        655             >
        656                                                                                                     
        657              <xsl:text>
        658               Signed 
        659              </xsl:text >
        660                                                                                             
        661             </span>
        662                                                                                   
        663            </td>
        664                                                                                  
        665            <td 
        666             width="80% "
        667            >
        668                                                                                            
        669             <xsl:call- template 
        670              name="show -name"
        671             >
        672                                                                                                     
        673              <xsl:with- param 
        674               name="name "
        675                                                                                                              
        676               select="n1 :assignedE ntity/n1:a ssignedPer son/n1:nam e" 
        677              />
        678                                                                                             
        679             </xsl:call -template>
        680                                                                                            
        681             <xsl:text>
        682               at 
        683             </xsl:text >
        684                                                                                            
        685             <xsl:call- template 
        686              name="show -time"
        687             >
        688                                                                                                     
        689              <xsl:with- param 
        690               name="date
        691               select="n1 :time" 
        692              />
        693                                                                                             
        694             </xsl:call -template>
        695                                                                                   
        696            </td>
        697                                                                         
        698           </tr>
        699                                                                        
        700           <xsl:if
        701                                                                                 
        702            test="n1:a ssignedEnt ity/n1:add r | n1:ass ignedEntit y/n1:telec om"
        703           >
        704                                                                                  
        705            <tr>
        706                                                                                            
        707             <td 
        708              bgcolor="# 3399ff"
        709             >
        710                                                                                                     
        711              <span 
        712               class="td_ label"
        713              >
        714                                                                                                               
        715               <xsl:text>
        716                Contact in fo
        717               </xsl:text >
        718                                                                                                      
        719              </span>
        720                                                                                             
        721             </td>
        722                                                                                            
        723             <td 
        724              width="80% "
        725             >
        726                                                                                                     
        727              <xsl:call- template 
        728               name="show -contactIn fo"
        729              >
        730                                                                                                               
        731               <xsl:with- param 
        732                name="cont act" 
        733                select="n1 :assignedE ntity" 
        734               />
        735                                                                                                      
        736              </xsl:call -template>
        737                                                                                             
        738             </td>
        739                                                                                   
        740            </tr>
        741                                                                         
        742           </xsl:if>
        743                                                               
        744          </xsl:for- each>
        745                                                     
        746         </tr>
        747                                            
        748        </tbody>
        749                                  
        750       </table>
        751                        
        752      </xsl:if>
        753              
        754     </xsl:temp late>
        755             
        756     <!-- legal Authentica tor -->
        757             
        758     <xsl:templ ate 
        759      name="lega lAuthentic ator"
        760     >
        761                       
        762      <xsl:if 
        763       test="n1:l egalAuthen ticator"
        764      >
        765                                 
        766       <table 
        767        class="hea der_table"
        768       >
        769                                           
        770        <tbody>
        771                                                    
        772         <tr>
        773                                                              
        774          <td 
        775           width="20%
        776           bgcolor="# 3399ff"
        777          >
        778                                                                        
        779           <span 
        780            class="td_ label"
        781           >
        782                                                                                  
        783            <xsl:text>
        784             Legal auth enticator
        785            </xsl:text >
        786                                                                         
        787           </span>
        788                                                               
        789          </td>
        790                                                              
        791          <td 
        792           width="80% "
        793          >
        794                                                                        
        795           <xsl:call- template 
        796            name="show -assignedE ntity"
        797           >
        798                                                                                  
        799            <xsl:with- param 
        800             name="asgn Entity"
        801                                                                                           
        802             select="n1 :legalAuth enticator/ n1:assigne dEntity" 
        803            />
        804                                                                         
        805           </xsl:call -template>
        806                                                                        
        807           <xsl:text>
        808             
        809           </xsl:text >
        810                                                                        
        811           <xsl:call- template 
        812            name="show -sig"
        813           >
        814                                                                                  
        815            <xsl:with- param 
        816             name="sig"
        817                                                                                           
        818             select="n1 :legalAuth enticator/ n1:signatu reCode" 
        819            />
        820                                                                         
        821           </xsl:call -template>
        822                                                                        
        823           <xsl:if 
        824            test="n1:l egalAuthen ticator/n1 :time/@val ue"
        825           >
        826                                                                                  
        827            <xsl:text>
        828              at 
        829            </xsl:text >
        830                                                                                  
        831            <xsl:call- template 
        832             name="show -time"
        833            >
        834                                                                                            
        835             <xsl:with- param 
        836              name="date time"
        837                                                                                                    
        838              select="n1 :legalAuth enticator/ n1:time" 
        839             />
        840                                                                                   
        841            </xsl:call -template>
        842                                                                         
        843           </xsl:if>
        844                                                               
        845          </td>
        846                                                     
        847         </tr>
        848                                                    
        849         <xsl:if
        850                                                             
        851          test="n1:l egalAuthen ticator/n1 :assignedE ntity/n1:a ddr | n1:l egalAuthen ticator/n1 :assignedE ntity/n1:t elecom"
        852         >
        853                                                              
        854          <tr>
        855                                                                        
        856           <td 
        857            bgcolor="# 3399ff"
        858           >
        859                                                                                  
        860            <span 
        861             class="td_ label"
        862            >
        863                                                                                            
        864             <xsl:text>
        865              Contact in fo
        866             </xsl:text >
        867                                                                                   
        868            </span>
        869                                                                         
        870           </td>
        871                                                                        
        872           <td>
        873                                                                                  
        874            <xsl:call- template 
        875             name="show -contactIn fo"
        876            >
        877                                                                                            
        878             <xsl:with- param 
        879              name="cont act"
        880                                                                                                    
        881              select="n1 :legalAuth enticator/ n1:assigne dEntity" 
        882             />
        883                                                                                   
        884            </xsl:call -template>
        885                                                                         
        886           </td>
        887                                                               
        888          </tr>
        889                                                     
        890         </xsl:if>
        891                                            
        892        </tbody>
        893                                  
        894       </table>
        895                        
        896      </xsl:if>
        897              
        898     </xsl:temp late>
        899             
        900     <!-- dataE nterer -->
        901             
        902     <xsl:templ ate 
        903      name="data Enterer"
        904     >
        905                       
        906      <xsl:if 
        907       test="n1:d ataEnterer "
        908      >
        909                                 
        910       <table 
        911        class="hea der_table"
        912       >
        913                                           
        914        <tbody>
        915                                                    
        916         <tr>
        917                                                              
        918          <td 
        919           width="20%
        920           bgcolor="# 3399ff"
        921          >
        922                                                                        
        923           <span 
        924            class="td_ label"
        925           >
        926                                                                                  
        927            <xsl:text>
        928             Entered by
        929            </xsl:text >
        930                                                                         
        931           </span>
        932                                                               
        933          </td>
        934                                                              
        935          <td 
        936           width="80% "
        937          >
        938                                                                        
        939           <xsl:call- template 
        940            name="show -assignedE ntity"
        941           >
        942                                                                                  
        943            <xsl:with- param 
        944             name="asgn Entity"
        945                                                                                           
        946             select="n1 :dataEnter er/n1:assi gnedEntity
        947            />
        948                                                                         
        949           </xsl:call -template>
        950                                                               
        951          </td>
        952                                                     
        953         </tr>
        954                                                    
        955         <xsl:if
        956                                                             
        957          test="n1:d ataEnterer /n1:assign edEntity/n 1:addr | n 1:dataEnte rer/n1:ass ignedEntit y/n1:telec om"
        958         >
        959                                                              
        960          <tr>
        961                                                                        
        962           <td 
        963            bgcolor="# 3399ff"
        964           >
        965                                                                                  
        966            <span 
        967             class="td_ label"
        968            >
        969                                                                                            
        970             <xsl:text>
        971              Contact in fo
        972             </xsl:text >
        973                                                                                   
        974            </span>
        975                                                                         
        976           </td>
        977                                                                        
        978           <td>
        979                                                                                  
        980            <xsl:call- template 
        981             name="show -contactIn fo"
        982            >
        983                                                                                            
        984             <xsl:with- param 
        985              name="cont act"
        986                                                                                                    
        987              select="n1 :dataEnter er/n1:assi gnedEntity
        988             />
        989                                                                                   
        990            </xsl:call -template>
        991                                                                         
        992           </td>
        993                                                               
        994          </tr>
        995                                                     
        996         </xsl:if>
        997                                            
        998        </tbody>
        999                                  
        1000       </table>
        1001                        
        1002      </xsl:if>
        1003              
        1004     </xsl:temp late>
        1005             
        1006     <!-- compo nentOf -->
        1007             
        1008     <xsl:templ ate 
        1009      name="comp onentof"
        1010     >
        1011                       
        1012      <xsl:if 
        1013       test="n1:c omponentOf "
        1014      >
        1015                                 
        1016       <table 
        1017        class="hea der_table"
        1018       >
        1019                                           
        1020        <tbody>
        1021                                                    
        1022         <xsl:for-e ach 
        1023          select="n1 :component Of/n1:enco mpassingEn counter"
        1024         >
        1025                                                              
        1026          <xsl:if 
        1027           test="n1:i d"
        1028          >
        1029                                                                        
        1030           <tr>
        1031                                                                                  
        1032            <xsl:choos e>
        1033                                                                                            
        1034             <xsl:when 
        1035              test="n1:c ode"
        1036             >
        1037                                                                                                     
        1038              <td 
        1039               width="20%
        1040               bgcolor="# 3399ff"
        1041              >
        1042                                                                                                               
        1043               <span 
        1044                class="td_ label"
        1045               >
        1046                                                                                                                         
        1047                <xsl:text>
        1048                 Encounter  Id
        1049                </xsl:text >
        1050                                                                                                                
        1051               </span>
        1052                                                                                                      
        1053              </td>
        1054                                                                                                     
        1055              <td 
        1056               width="30% "
        1057              >
        1058                                                                                                               
        1059               <xsl:call- template 
        1060                name="show -id"
        1061               >
        1062                                                                                                                         
        1063                <xsl:with- param 
        1064                 name="id" 
        1065                 select="n1 :id" 
        1066                />
        1067                                                                                                                
        1068               </xsl:call -template>
        1069                                                                                                      
        1070              </td>
        1071                                                                                                     
        1072              <td 
        1073               width="15%
        1074               bgcolor="# 3399ff"
        1075              >
        1076                                                                                                               
        1077               <span 
        1078                class="td_ label"
        1079               >
        1080                                                                                                                         
        1081                <xsl:text>
        1082                 Encounter  Type
        1083                </xsl:text >
        1084                                                                                                                
        1085               </span>
        1086                                                                                                      
        1087              </td>
        1088                                                                                                     
        1089              <td>
        1090                                                                                                               
        1091               <xsl:call- template 
        1092                name="show -code"
        1093               >
        1094                                                                                                                         
        1095                <xsl:with- param 
        1096                 name="code
        1097                 select="n1 :code" 
        1098                />
        1099                                                                                                                
        1100               </xsl:call -template>
        1101                                                                                                      
        1102              </td>
        1103                                                                                             
        1104             </xsl:when >
        1105                                                                                            
        1106             <xsl:other wise>
        1107                                                                                                     
        1108              <td 
        1109               width="20%
        1110               bgcolor="# 3399ff"
        1111              >
        1112                                                                                                               
        1113               <span 
        1114                class="td_ label"
        1115               >
        1116                                                                                                                         
        1117                <xsl:text>
        1118                 Encounter  Id
        1119                </xsl:text >
        1120                                                                                                                
        1121               </span>
        1122                                                                                                      
        1123              </td>
        1124                                                                                                     
        1125              <td>
        1126                                                                                                               
        1127               <xsl:call- template 
        1128                name="show -id"
        1129               >
        1130                                                                                                                         
        1131                <xsl:with- param 
        1132                 name="id" 
        1133                 select="n1 :id" 
        1134                />
        1135                                                                                                                
        1136               </xsl:call -template>
        1137                                                                                                      
        1138              </td>
        1139                                                                                             
        1140             </xsl:othe rwise>
        1141                                                                                   
        1142            </xsl:choo se>
        1143                                                                         
        1144           </tr>
        1145                                                               
        1146          </xsl:if>
        1147                                                              
        1148          <tr>
        1149                                                                        
        1150           <td 
        1151            width="20%
        1152            bgcolor="# 3399ff"
        1153           >
        1154                                                                                  
        1155            <span 
        1156             class="td_ label"
        1157            >
        1158                                                                                            
        1159             <xsl:text>
        1160              Encounter  Date
        1161             </xsl:text >
        1162                                                                                   
        1163            </span>
        1164                                                                         
        1165           </td>
        1166                                                                        
        1167           <td 
        1168            colspan="3 "
        1169           >
        1170                                                                                  
        1171            <xsl:if 
        1172             test="n1:e ffectiveTi me"
        1173            >
        1174                                                                                            
        1175             <xsl:choos e>
        1176                                                                                                     
        1177              <xsl:when 
        1178               test="n1:e ffectiveTi me/@value"
        1179              >
        1180                                                                                                               
        1181               <xsl:text>
        1182                &#160;at&# 160;
        1183               </xsl:text >
        1184                                                                                                               
        1185               <xsl:call- template 
        1186                name="show -time"
        1187               >
        1188                                                                                                                         
        1189                <xsl:with- param 
        1190                 name="date time" 
        1191                 select="n1 :effective Time" 
        1192                />
        1193                                                                                                                
        1194               </xsl:call -template>
        1195                                                                                                      
        1196              </xsl:when >
        1197                                                                                                     
        1198              <xsl:when 
        1199               test="n1:e ffectiveTi me/n1:low"
        1200              >
        1201                                                                                                               
        1202               <xsl:text>
        1203                &#160;From &#160;
        1204               </xsl:text >
        1205                                                                                                               
        1206               <xsl:call- template 
        1207                name="show -time"
        1208               >
        1209                                                                                                                         
        1210                <xsl:with- param 
        1211                 name="date time"
        1212                                                                                                                                  
        1213                 select="n1 :effective Time/n1:lo w" 
        1214                />
        1215                                                                                                                
        1216               </xsl:call -template>
        1217                                                                                                               
        1218               <xsl:if 
        1219                test="n1:e ffectiveTi me/n1:high "
        1220               >
        1221                                                                                                                         
        1222                <xsl:text>
        1223                  to 
        1224                </xsl:text >
        1225                                                                                                                         
        1226                <xsl:call- template 
        1227                 name="show -time"
        1228                >
        1229                                                                                                                                   
        1230                 <xsl:with- param 
        1231                  name="date time"
        1232                                                                                                                                            
        1233                  select="n1 :effective Time/n1:hi gh" 
        1234                 />
        1235                                                                                                                          
        1236                </xsl:call -template>
        1237                                                                                                                
        1238               </xsl:if>
        1239                                                                                                      
        1240              </xsl:when >
        1241                                                                                             
        1242             </xsl:choo se>
        1243                                                                                   
        1244            </xsl:if>
        1245                                                                         
        1246           </td>
        1247                                                               
        1248          </tr>
        1249                                                              
        1250          <xsl:if 
        1251           test="n1:l ocation/n1 :healthCar eFacility"
        1252          >
        1253                                                                        
        1254           <tr>
        1255                                                                                  
        1256            <td 
        1257             width="20%
        1258             bgcolor="# 3399ff"
        1259            >
        1260                                                                                            
        1261             <span 
        1262              class="td_ label"
        1263             >
        1264                                                                                                     
        1265              <xsl:text>
        1266               Encounter  Location
        1267              </xsl:text >
        1268                                                                                             
        1269             </span>
        1270                                                                                   
        1271            </td>
        1272                                                                                  
        1273            <td 
        1274             colspan="3 "
        1275            >
        1276                                                                                            
        1277             <xsl:choos e>
        1278                                                                                                     
        1279              <xsl:when
        1280                                                                                                              
        1281               test="n1:l ocation/n1 :healthCar eFacility/ n1:locatio n/n1:name"
        1282              >
        1283                                                                                                               
        1284               <xsl:call- template 
        1285                name="show -name"
        1286               >
        1287                                                                                                                         
        1288                <xsl:with- param 
        1289                 name="name "
        1290                                                                                                                                  
        1291                 select="n1 :location/ n1:healthC areFacilit y/n1:locat ion/n1:nam e" 
        1292                />
        1293                                                                                                                
        1294               </xsl:call -template>
        1295                                                                                                               
        1296               <xsl:for-e ach
        1297                                                                                                                        
        1298                select="n1 :location/ n1:healthC areFacilit y/n1:servi ceProvider Organizati on/n1:name "
        1299               >
        1300                                                                                                                         
        1301                <xsl:text>
        1302                  of 
        1303                </xsl:text >
        1304                                                                                                                         
        1305                <xsl:call- template 
        1306                 name="show -name"
        1307                >
        1308                                                                                                                                   
        1309                 <xsl:with- param 
        1310                  name="name "
        1311                                                                                                                                            
        1312                  select="n1 :location/ n1:healthC areFacilit y/n1:servi ceProvider Organizati on/n1:name
        1313                 />
        1314                                                                                                                          
        1315                </xsl:call -template>
        1316                                                                                                                
        1317               </xsl:for- each>
        1318                                                                                                      
        1319              </xsl:when >
        1320                                                                                                     
        1321              <xsl:when 
        1322               test="n1:l ocation/n1 :healthCar eFacility/ n1:code"
        1323              >
        1324                                                                                                               
        1325               <xsl:call- template 
        1326                name="show -code"
        1327               >
        1328                                                                                                                         
        1329                <xsl:with- param 
        1330                 name="code "
        1331                                                                                                                                  
        1332                 select="n1 :location/ n1:healthC areFacilit y/n1:code"  
        1333                />
        1334                                                                                                                
        1335               </xsl:call -template>
        1336                                                                                                      
        1337              </xsl:when >
        1338                                                                                                     
        1339              <xsl:other wise>
        1340                                                                                                               
        1341               <xsl:if 
        1342                test="n1:l ocation/n1 :healthCar eFacility/ n1:id"
        1343               >
        1344                                                                                                                         
        1345                <xsl:text>
        1346                 id: 
        1347                </xsl:text >
        1348                                                                                                                         
        1349                <xsl:for-e ach 
        1350                 select="n1 :location/ n1:healthC areFacilit y/n1:id"
        1351                >
        1352                                                                                                                                   
        1353                 <xsl:call- template 
        1354                  name="show -id"
        1355                 >
        1356                                                                                                                                             
        1357                  <xsl:with- param 
        1358                   name="id" 
        1359                   select="."  
        1360                  />
        1361                                                                                                                                    
        1362                 </xsl:call -template>
        1363                                                                                                                          
        1364                </xsl:for- each>
        1365                                                                                                                
        1366               </xsl:if>
        1367                                                                                                      
        1368              </xsl:othe rwise>
        1369                                                                                             
        1370             </xsl:choo se>
        1371                                                                                   
        1372            </td>
        1373                                                                         
        1374           </tr>
        1375                                                               
        1376          </xsl:if>
        1377                                                              
        1378          <xsl:if 
        1379           test="n1:r esponsible Party"
        1380          >
        1381                                                                        
        1382           <tr>
        1383                                                                                  
        1384            <td 
        1385             width="20%
        1386             bgcolor="# 3399ff"
        1387            >
        1388                                                                                            
        1389             <span 
        1390              class="td_ label"
        1391             >
        1392                                                                                                     
        1393              <xsl:text>
        1394               Responsibl e party
        1395              </xsl:text >
        1396                                                                                             
        1397             </span>
        1398                                                                                   
        1399            </td>
        1400                                                                                  
        1401            <td 
        1402             colspan="3 "
        1403            >
        1404                                                                                            
        1405             <xsl:call- template 
        1406              name="show -assignedE ntity"
        1407             >
        1408                                                                                                     
        1409              <xsl:with- param 
        1410               name="asgn Entity"
        1411                                                                                                              
        1412               select="n1 :responsib leParty/n1 :assignedE ntity" 
        1413              />
        1414                                                                                             
        1415             </xsl:call -template>
        1416                                                                                   
        1417            </td>
        1418                                                                         
        1419           </tr>
        1420                                                               
        1421          </xsl:if>
        1422                                                              
        1423          <xsl:if
        1424                                                                       
        1425           test="n1:r esponsible Party/n1:a ssignedEnt ity/n1:add r | n1:res ponsiblePa rty/n1:ass ignedEntit y/n1:telec om"
        1426          >
        1427                                                                        
        1428           <tr>
        1429                                                                                  
        1430            <td 
        1431             width="20%
        1432             bgcolor="# 3399ff"
        1433            >
        1434                                                                                            
        1435             <span 
        1436              class="td_ label"
        1437             >
        1438                                                                                                     
        1439              <xsl:text>
        1440               Contact in fo
        1441              </xsl:text >
        1442                                                                                             
        1443             </span>
        1444                                                                                   
        1445            </td>
        1446                                                                                  
        1447            <td 
        1448             colspan="3 "
        1449            >
        1450                                                                                            
        1451             <xsl:call- template 
        1452              name="show -contactIn fo"
        1453             >
        1454                                                                                                     
        1455              <xsl:with- param 
        1456               name="cont act"
        1457                                                                                                              
        1458               select="n1 :responsib leParty/n1 :assignedE ntity" 
        1459              />
        1460                                                                                             
        1461             </xsl:call -template>
        1462                                                                                   
        1463            </td>
        1464                                                                         
        1465           </tr>
        1466                                                               
        1467          </xsl:if>
        1468                                                     
        1469         </xsl:for- each>
        1470                                            
        1471        </tbody>
        1472                                  
        1473       </table>
        1474                        
        1475      </xsl:if>
        1476              
        1477     </xsl:temp late>
        1478             
        1479     <!-- custo dian -->
        1480             
        1481     <xsl:templ ate 
        1482      name="cust odian"
        1483     >
        1484                       
        1485      <xsl:if 
        1486       test="n1:c ustodian"
        1487      >
        1488                                 
        1489       <table 
        1490        class="hea der_table"
        1491       >
        1492                                           
        1493        <tbody>
        1494                                                    
        1495         <tr>
        1496                                                              
        1497          <td 
        1498           width="20%
        1499           bgcolor="# 3399ff"
        1500          >
        1501                                                                        
        1502           <span 
        1503            class="td_ label"
        1504           >
        1505                                                                                  
        1506            <xsl:text>
        1507             Document m aintained  by
        1508            </xsl:text >
        1509                                                                         
        1510           </span>
        1511                                                               
        1512          </td>
        1513                                                              
        1514          <td 
        1515           width="80% "
        1516          >
        1517                                                                        
        1518           <xsl:choos e>
        1519                                                                                  
        1520            <xsl:when
        1521                                                                                           
        1522             test="n1:c ustodian/n 1:assigned Custodian/ n1:represe ntedCustod ianOrganiz ation/n1:n ame"
        1523            >
        1524                                                                                            
        1525             <xsl:call- template 
        1526              name="show -name"
        1527             >
        1528                                                                                                     
        1529              <xsl:with- param 
        1530               name="name "
        1531                                                                                                              
        1532               select="n1 :custodian /n1:assign edCustodia n/n1:repre sentedCust odianOrgan ization/n1 :name" 
        1533              />
        1534                                                                                             
        1535             </xsl:call -template>
        1536                                                                                   
        1537            </xsl:when >
        1538                                                                                  
        1539            <xsl:other wise>
        1540                                                                                            
        1541             <xsl:for-e ach
        1542                                                                                                    
        1543              select="n1 :custodian /n1:assign edCustodia n/n1:repre sentedCust odianOrgan ization/n1 :id"
        1544             >
        1545                                                                                                     
        1546              <xsl:call- template 
        1547               name="show -id" 
        1548              />
        1549                                                                                                     
        1550              <xsl:if 
        1551               test="posi tion()!=la st()"
        1552              >
        1553                                                                                                               
        1554               <br />
        1555                                                                                                      
        1556              </xsl:if>
        1557                                                                                             
        1558             </xsl:for- each>
        1559                                                                                   
        1560            </xsl:othe rwise>
        1561                                                                         
        1562           </xsl:choo se>
        1563                                                               
        1564          </td>
        1565                                                     
        1566         </tr>
        1567                                                    
        1568         <xsl:if
        1569                                                             
        1570          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"
        1571         >
        1572                                                              
        1573          <tr>
        1574                                                                        
        1575           <td 
        1576            bgcolor="# 3399ff"
        1577           >
        1578                                                                                  
        1579            <span 
        1580             class="td_ label"
        1581            >
        1582                                                                                            
        1583             <xsl:text>
        1584              Contact in fo
        1585             </xsl:text >
        1586                                                                                   
        1587            </span>
        1588                                                                         
        1589           </td>
        1590                                                                        
        1591           <td 
        1592            width="80% "
        1593           >
        1594                                                                                  
        1595            <xsl:call- template 
        1596             name="show -contactIn fo"
        1597            >
        1598                                                                                            
        1599             <xsl:with- param 
        1600              name="cont act"
        1601                                                                                                    
        1602              select="n1 :custodian /n1:assign edCustodia n/n1:repre sentedCust odianOrgan ization" 
        1603             />
        1604                                                                                   
        1605            </xsl:call -template>
        1606                                                                         
        1607           </td>
        1608                                                               
        1609          </tr>
        1610                                                     
        1611         </xsl:if>
        1612                                            
        1613        </tbody>
        1614                                  
        1615       </table>
        1616                        
        1617      </xsl:if>
        1618              
        1619     </xsl:temp late>
        1620             
        1621     <!-- docum entationOf  -->
        1622             
        1623     <xsl:templ ate 
        1624      name="docu mentationO f"
        1625     >
        1626                       
        1627      <xsl:if 
        1628       test="n1:d ocumentati onOf"
        1629      >
        1630                                 
        1631       <table 
        1632        class="hea der_table"
        1633       >
        1634                                           
        1635        <tbody>
        1636                                                    
        1637         <xsl:for-e ach 
        1638          select="n1 :documenta tionOf"
        1639         >
        1640                                                              
        1641          <xsl:if 
        1642           test="n1:s erviceEven t/@classCo de and n1: serviceEve nt/n1:code "
        1643          >
        1644                                                                        
        1645           <xsl:varia ble 
        1646            name="disp layName"
        1647           >
        1648                                                                                  
        1649            <xsl:call- template 
        1650             name="show -actClassC ode"
        1651            >
        1652                                                                                            
        1653             <xsl:with- param 
        1654              name="clsC ode"
        1655                                                                                                    
        1656              select="n1 :serviceEv ent/@class Code" 
        1657             />
        1658                                                                                   
        1659            </xsl:call -template>
        1660                                                                         
        1661           </xsl:vari able>
        1662                                                                        
        1663           <xsl:if 
        1664            test="$dis playName"
        1665           >
        1666                                                                                  
        1667            <tr>
        1668                                                                                            
        1669             <td 
        1670              width="20%
        1671              bgcolor="# 3399ff"
        1672             >
        1673                                                                                                     
        1674              <span 
        1675               class="td_ label"
        1676              >
        1677                                                                                                               
        1678               <xsl:call- template 
        1679                name="firs tCharCaseU p"
        1680               >
        1681                                                                                                                         
        1682                <xsl:with- param 
        1683                 name="data
        1684                 select="$d isplayName
        1685                />
        1686                                                                                                                
        1687               </xsl:call -template>
        1688                                                                                                      
        1689              </span>
        1690                                                                                             
        1691             </td>
        1692                                                                                            
        1693             <td 
        1694              width="80%
        1695              colspan="3 "
        1696             >
        1697                                                                                                     
        1698              <xsl:call- template 
        1699               name="show -code"
        1700              >
        1701                                                                                                               
        1702               <xsl:with- param 
        1703                name="code
        1704                select="n1 :serviceEv ent/n1:cod e" 
        1705               />
        1706                                                                                                      
        1707              </xsl:call -template>
        1708                                                                                                     
        1709              <xsl:if 
        1710               test="n1:s erviceEven t/n1:effec tiveTime"
        1711              >
        1712                                                                                                               
        1713               <xsl:choos e>
        1714                                                                                                                         
        1715                <xsl:when 
        1716                 test="n1:s erviceEven t/n1:effec tiveTime/@ value"
        1717                >
        1718                                                                                                                                   
        1719                 <xsl:text>
        1720                  &#160;at&# 160;
        1721                 </xsl:text >
        1722                                                                                                                                   
        1723                 <xsl:call- template 
        1724                  name="show -time"
        1725                 >
        1726                                                                                                                                             
        1727                  <xsl:with- param 
        1728                   name="date time"
        1729                                                                                                                                                     
        1730                   select="n1 :serviceEv ent/n1:eff ectiveTime
        1731                  />
        1732                                                                                                                                    
        1733                 </xsl:call -template>
        1734                                                                                                                          
        1735                </xsl:when >
        1736                                                                                                                         
        1737                <xsl:when 
        1738                 test="n1:s erviceEven t/n1:effec tiveTime/n 1:low"
        1739                >
        1740                                                                                                                                   
        1741                 <xsl:text>
        1742                  &#160;from &#160;
        1743                 </xsl:text >
        1744                                                                                                                                   
        1745                 <xsl:call- template 
        1746                  name="show -time"
        1747                 >
        1748                                                                                                                                             
        1749                  <xsl:with- param 
        1750                   name="date time"
        1751                                                                                                                                                     
        1752                   select="n1 :serviceEv ent/n1:eff ectiveTime /n1:low" 
        1753                  />
        1754                                                                                                                                    
        1755                 </xsl:call -template>
        1756                                                                                                                                   
        1757                 <xsl:if 
        1758                  test="n1:s erviceEven t/n1:effec tiveTime/n 1:high"
        1759                 >
        1760                                                                                                                                             
        1761                  <xsl:text>
        1762                    to 
        1763                  </xsl:text >
        1764                                                                                                                                             
        1765                  <xsl:call- template 
        1766                   name="show -time"
        1767                  >
        1768                                                                                                                                                      
        1769                   <xsl:with- param 
        1770                    name="date time"
        1771                                                                                                                                                               
        1772                    select="n1 :serviceEv ent/n1:eff ectiveTime /n1:high" 
        1773                   />
        1774                                                                                                                                              
        1775                  </xsl:call -template>
        1776                                                                                                                                    
        1777                 </xsl:if>
        1778                                                                                                                          
        1779                </xsl:when >
        1780                                                                                                                
        1781               </xsl:choo se>
        1782                                                                                                      
        1783              </xsl:if>
        1784                                                                                             
        1785             </td>
        1786                                                                                   
        1787            </tr>
        1788                                                                         
        1789           </xsl:if>
        1790                                                               
        1791          </xsl:if>
        1792                                                              
        1793          <xsl:for-e ach 
        1794           select="n1 :serviceEv ent/n1:per former"
        1795          >
        1796                                                                        
        1797           <xsl:varia ble 
        1798            name="disp layName"
        1799           >
        1800                                                                                  
        1801            <xsl:call- template 
        1802             name="show -participa tionType"
        1803            >
        1804                                                                                            
        1805             <xsl:with- param 
        1806              name="ptyp e" 
        1807              select="@t ypeCode" 
        1808             />
        1809                                                                                   
        1810            </xsl:call -template>
        1811                                                                                  
        1812            <xsl:text>
        1813              
        1814            </xsl:text >
        1815                                                                                  
        1816            <xsl:if 
        1817             test="n1:f unctionCod e/@code"
        1818            >
        1819                                                                                            
        1820             <xsl:call- template 
        1821              name="show -participa tionFuncti on"
        1822             >
        1823                                                                                                     
        1824              <xsl:with- param 
        1825               name="pFun ction" 
        1826               select="n1 :functionC ode/@code"  
        1827              />
        1828                                                                                             
        1829             </xsl:call -template>
        1830                                                                                   
        1831            </xsl:if>
        1832                                                                         
        1833           </xsl:vari able>
        1834                                                                        
        1835           <tr>
        1836                                                                                  
        1837            <td 
        1838             width="20%
        1839             bgcolor="# 3399ff"
        1840            >
        1841                                                                                            
        1842             <span 
        1843              class="td_ label"
        1844             >
        1845                                                                                                     
        1846              <xsl:call- template 
        1847               name="firs tCharCaseU p"
        1848              >
        1849                                                                                                               
        1850               <xsl:with- param 
        1851                name="data
        1852                select="$d isplayName
        1853               />
        1854                                                                                                      
        1855              </xsl:call -template>
        1856                                                                                             
        1857             </span>
        1858                                                                                   
        1859            </td>
        1860                                                                                  
        1861            <td 
        1862             width="80%
        1863             colspan="3 "
        1864            >
        1865                                                                                            
        1866             <xsl:call- template 
        1867              name="show -assignedE ntity"
        1868             >
        1869                                                                                                     
        1870              <xsl:with- param 
        1871               name="asgn Entity" 
        1872               select="n1 :assignedE ntity" 
        1873              />
        1874                                                                                             
        1875             </xsl:call -template>
        1876                                                                                   
        1877            </td>
        1878                                                                         
        1879           </tr>
        1880                                                               
        1881          </xsl:for- each>
        1882                                                     
        1883         </xsl:for- each>
        1884                                            
        1885        </tbody>
        1886                                  
        1887       </table>
        1888                        
        1889      </xsl:if>
        1890              
        1891     </xsl:temp late>
        1892             
        1893     <!-- inFul fillmentOf  -->
        1894             
        1895     <xsl:templ ate 
        1896      name="inFu lfillmentO f"
        1897     >
        1898                       
        1899      <xsl:if 
        1900       test="n1:i nfulfillme ntOf"
        1901      >
        1902                                 
        1903       <table 
        1904        class="hea der_table"
        1905       >
        1906                                           
        1907        <tbody>
        1908                                                    
        1909         <xsl:for-e ach 
        1910          select="n1 :inFulfill mentOf"
        1911         >
        1912                                                              
        1913          <tr>
        1914                                                                        
        1915           <td 
        1916            width="20%
        1917            bgcolor="# 3399ff"
        1918           >
        1919                                                                                  
        1920            <span 
        1921             class="td_ label"
        1922            >
        1923                                                                                            
        1924             <xsl:text>
        1925              In fulfill ment of
        1926             </xsl:text >
        1927                                                                                   
        1928            </span>
        1929                                                                         
        1930           </td>
        1931                                                                        
        1932           <td 
        1933            width="80% "
        1934           >
        1935                                                                                  
        1936            <xsl:for-e ach 
        1937             select="n1 :order"
        1938            >
        1939                                                                                            
        1940             <xsl:for-e ach 
        1941              select="n1 :id"
        1942             >
        1943                                                                                                     
        1944              <xsl:call- template 
        1945               name="show -id" 
        1946              />
        1947                                                                                             
        1948             </xsl:for- each>
        1949                                                                                            
        1950             <xsl:for-e ach 
        1951              select="n1 :code"
        1952             >
        1953                                                                                                     
        1954              <xsl:text>
        1955               &#160;
        1956              </xsl:text >
        1957                                                                                                     
        1958              <xsl:call- template 
        1959               name="show -code"
        1960              >
        1961                                                                                                               
        1962               <xsl:with- param 
        1963                name="code
        1964                select="."  
        1965               />
        1966                                                                                                      
        1967              </xsl:call -template>
        1968                                                                                             
        1969             </xsl:for- each>
        1970                                                                                            
        1971             <xsl:for-e ach 
        1972              select="n1 :priorityC ode"
        1973             >
        1974                                                                                                     
        1975              <xsl:text>
        1976               &#160;
        1977              </xsl:text >
        1978                                                                                                     
        1979              <xsl:call- template 
        1980               name="show -code"
        1981              >
        1982                                                                                                               
        1983               <xsl:with- param 
        1984                name="code
        1985                select="."  
        1986               />
        1987                                                                                                      
        1988              </xsl:call -template>
        1989                                                                                             
        1990             </xsl:for- each>
        1991                                                                                   
        1992            </xsl:for- each>
        1993                                                                         
        1994           </td>
        1995                                                               
        1996          </tr>
        1997                                                     
        1998         </xsl:for- each>
        1999                                            
        2000        </tbody>
        2001                                  
        2002       </table>
        2003                        
        2004      </xsl:if>
        2005              
        2006     </xsl:temp late>
        2007             
        2008     <!-- infor mant -->
        2009             
        2010     <xsl:templ ate 
        2011      name="info rmant"
        2012     >
        2013                       
        2014      <xsl:if 
        2015       test="n1:i nformant"
        2016      >
        2017                                 
        2018       <table 
        2019        class="hea der_table"
        2020       >
        2021                                           
        2022        <tbody>
        2023                                                    
        2024         <xsl:for-e ach 
        2025          select="n1 :informant "
        2026         >
        2027                                                              
        2028          <tr>
        2029                                                                        
        2030           <td 
        2031            width="20%
        2032            bgcolor="# 3399ff"
        2033           >
        2034                                                                                  
        2035            <span 
        2036             class="td_ label"
        2037            >
        2038                                                                                            
        2039             <xsl:text>
        2040              Informant
        2041             </xsl:text >
        2042                                                                                   
        2043            </span>
        2044                                                                         
        2045           </td>
        2046                                                                        
        2047           <td 
        2048            width="80% "
        2049           >
        2050                                                                                  
        2051            <xsl:if 
        2052             test="n1:a ssignedEnt ity"
        2053            >
        2054                                                                                            
        2055             <xsl:call- template 
        2056              name="show -assignedE ntity"
        2057             >
        2058                                                                                                     
        2059              <xsl:with- param 
        2060               name="asgn Entity" 
        2061               select="n1 :assignedE ntity" 
        2062              />
        2063                                                                                             
        2064             </xsl:call -template>
        2065                                                                                   
        2066            </xsl:if>
        2067                                                                                  
        2068            <xsl:if 
        2069             test="n1:r elatedEnti ty"
        2070            >
        2071                                                                                            
        2072             <xsl:call- template 
        2073              name="show -relatedEn tity"
        2074             >
        2075                                                                                                     
        2076              <xsl:with- param 
        2077               name="rela tedEntity"  
        2078               select="n1 :relatedEn tity" 
        2079              />
        2080                                                                                             
        2081             </xsl:call -template>
        2082                                                                                   
        2083            </xsl:if>
        2084                                                                         
        2085           </td>
        2086                                                               
        2087          </tr>
        2088                                                              
        2089          <xsl:choos e>
        2090                                                                        
        2091           <xsl:when
        2092                                                                                 
        2093            test="n1:a ssignedEnt ity/n1:add r | n1:ass ignedEntit y/n1:telec om"
        2094           >
        2095                                                                                  
        2096            <tr>
        2097                                                                                            
        2098             <td 
        2099              bgcolor="# 3399ff"
        2100             >
        2101                                                                                                     
        2102              <span 
        2103               class="td_ label"
        2104              >
        2105                                                                                                               
        2106               <xsl:text>
        2107                Contact in fo
        2108               </xsl:text >
        2109                                                                                                      
        2110              </span>
        2111                                                                                             
        2112             </td>
        2113                                                                                            
        2114             <td>
        2115                                                                                                     
        2116              <xsl:if 
        2117               test="n1:a ssignedEnt ity"
        2118              >
        2119                                                                                                               
        2120               <xsl:call- template 
        2121                name="show -contactIn fo"
        2122               >
        2123                                                                                                                         
        2124                <xsl:with- param 
        2125                 name="cont act" 
        2126                 select="n1 :assignedE ntity" 
        2127                />
        2128                                                                                                                
        2129               </xsl:call -template>
        2130                                                                                                      
        2131              </xsl:if>
        2132                                                                                             
        2133             </td>
        2134                                                                                   
        2135            </tr>
        2136                                                                         
        2137           </xsl:when >
        2138                                                                        
        2139           <xsl:when
        2140                                                                                 
        2141            test="n1:r elatedEnti ty/n1:addr  | n1:rela tedEntity/ n1:telecom "
        2142           >
        2143                                                                                  
        2144            <tr>
        2145                                                                                            
        2146             <td 
        2147              bgcolor="# 3399ff"
        2148             >
        2149                                                                                                     
        2150              <span 
        2151               class="td_ label"
        2152              >
        2153                                                                                                               
        2154               <xsl:text>
        2155                Contact in fo
        2156               </xsl:text >
        2157                                                                                                      
        2158              </span>
        2159                                                                                             
        2160             </td>
        2161                                                                                            
        2162             <td>
        2163                                                                                                     
        2164              <xsl:if 
        2165               test="n1:r elatedEnti ty"
        2166              >
        2167                                                                                                               
        2168               <xsl:call- template 
        2169                name="show -contactIn fo"
        2170               >
        2171                                                                                                                         
        2172                <xsl:with- param 
        2173                 name="cont act" 
        2174                 select="n1 :relatedEn tity" 
        2175                />
        2176                                                                                                                
        2177               </xsl:call -template>
        2178                                                                                                      
        2179              </xsl:if>
        2180                                                                                             
        2181             </td>
        2182                                                                                   
        2183            </tr>
        2184                                                                         
        2185           </xsl:when >
        2186                                                               
        2187          </xsl:choo se>
        2188                                                     
        2189         </xsl:for- each>
        2190                                            
        2191        </tbody>
        2192                                  
        2193       </table>
        2194                        
        2195      </xsl:if>
        2196              
        2197     </xsl:temp late>
        2198             
        2199     <!-- infor mantionRec ipient -->
        2200             
        2201     <xsl:templ ate 
        2202      name="info rmationRec ipient"
        2203     >
        2204                       
        2205      <xsl:if 
        2206       test="n1:i nformation Recipient"
        2207      >
        2208                                 
        2209       <table 
        2210        class="hea der_table"
        2211       >
        2212                                           
        2213        <tbody>
        2214                                                    
        2215         <xsl:for-e ach 
        2216          select="n1 :informati onRecipien t"
        2217         >
        2218                                                              
        2219          <tr>
        2220                                                                        
        2221           <td 
        2222            width="20%
        2223            bgcolor="# 3399ff"
        2224           >
        2225                                                                                  
        2226            <span 
        2227             class="td_ label"
        2228            >
        2229                                                                                            
        2230             <xsl:text>
        2231              Informatio n recipien t:
        2232             </xsl:text >
        2233                                                                                   
        2234            </span>
        2235                                                                         
        2236           </td>
        2237                                                                        
        2238           <td 
        2239            width="80% "
        2240           >
        2241                                                                                  
        2242            <xsl:choos e>
        2243                                                                                            
        2244             <xsl:when
        2245                                                                                                    
        2246              test="n1:i ntendedRec ipient/n1: informatio nRecipient /n1:name"
        2247             >
        2248                                                                                                     
        2249              <xsl:for-e ach 
        2250               select="n1 :intendedR ecipient/n 1:informat ionRecipie nt"
        2251              >
        2252                                                                                                               
        2253               <xsl:call- template 
        2254                name="show -name"
        2255               >
        2256                                                                                                                         
        2257                <xsl:with- param 
        2258                 name="name
        2259                 select="n1 :name" 
        2260                />
        2261                                                                                                                
        2262               </xsl:call -template>
        2263                                                                                                               
        2264               <xsl:if 
        2265                test="posi tion() !=  last()"
        2266               >
        2267                                                                                                                         
        2268                <br />
        2269                                                                                                                
        2270               </xsl:if>
        2271                                                                                                      
        2272              </xsl:for- each>
        2273                                                                                             
        2274             </xsl:when >
        2275                                                                                            
        2276             <xsl:other wise>
        2277                                                                                                     
        2278              <xsl:for-e ach 
        2279               select="n1 :intendedR ecipient"
        2280              >
        2281                                                                                                               
        2282               <xsl:for-e ach 
        2283                select="n1 :id"
        2284               >
        2285                                                                                                                         
        2286                <xsl:call- template 
        2287                 name="show -id" 
        2288                />
        2289                                                                                                                
        2290               </xsl:for- each>
        2291                                                                                                               
        2292               <xsl:if 
        2293                test="posi tion() !=  last()"
        2294               >
        2295                                                                                                                         
        2296                <br />
        2297                                                                                                                
        2298               </xsl:if>
        2299                                                                                                               
        2300               <br />
        2301                                                                                                      
        2302              </xsl:for- each>
        2303                                                                                             
        2304             </xsl:othe rwise>
        2305                                                                                   
        2306            </xsl:choo se>
        2307                                                                         
        2308           </td>
        2309                                                               
        2310          </tr>
        2311                                                              
        2312          <xsl:if
        2313                                                                       
        2314           test="n1:i ntendedRec ipient/n1: addr | n1: intendedRe cipient/n1 :telecom"
        2315          >
        2316                                                                        
        2317           <tr>
        2318                                                                                  
        2319            <td 
        2320             bgcolor="# 3399ff"
        2321            >
        2322                                                                                            
        2323             <span 
        2324              class="td_ label"
        2325             >
        2326                                                                                                     
        2327              <xsl:text>
        2328               Contact in fo
        2329              </xsl:text >
        2330                                                                                             
        2331             </span>
        2332                                                                                   
        2333            </td>
        2334                                                                                  
        2335            <td>
        2336                                                                                            
        2337             <xsl:call- template 
        2338              name="show -contactIn fo"
        2339             >
        2340                                                                                                     
        2341              <xsl:with- param 
        2342               name="cont act" 
        2343               select="n1 :intendedR ecipient" 
        2344              />
        2345                                                                                             
        2346             </xsl:call -template>
        2347                                                                                   
        2348            </td>
        2349                                                                         
        2350           </tr>
        2351                                                               
        2352          </xsl:if>
        2353                                                     
        2354         </xsl:for- each>
        2355                                            
        2356        </tbody>
        2357                                  
        2358       </table>
        2359                        
        2360      </xsl:if>
        2361              
        2362     </xsl:temp late>
        2363             
        2364     <!-- parti cipant -->
        2365             
        2366     <xsl:templ ate 
        2367      name="part icipant"
        2368     >
        2369                       
        2370      <xsl:if 
        2371       test="n1:p articipant "
        2372      >
        2373                                 
        2374       <table 
        2375        class="hea der_table"
        2376       >
        2377                                           
        2378        <tbody>
        2379                                                    
        2380         <xsl:for-e ach 
        2381          select="n1 :participa nt"
        2382         >
        2383                                                              
        2384          <tr>
        2385                                                                        
        2386           <td 
        2387            width="20%
        2388            bgcolor="# 3399ff"
        2389           >
        2390                                                                                  
        2391            <xsl:varia ble 
        2392             name="part iciptRole"
        2393            >
        2394                                                                                            
        2395             <xsl:call- template 
        2396              name="tran slateRoleA ssoCode"
        2397             >
        2398                                                                                                     
        2399              <xsl:with- param 
        2400               name="clas sCode"
        2401                                                                                                              
        2402               select="n1 :associate dEntity/@c lassCode" 
        2403              />
        2404                                                                                                     
        2405              <xsl:with- param 
        2406               name="code "
        2407                                                                                                              
        2408               select="n1 :associate dEntity/n1 :code" 
        2409              />
        2410                                                                                             
        2411             </xsl:call -template>
        2412                                                                                   
        2413            </xsl:vari able>
        2414                                                                                  
        2415            <xsl:choos e>
        2416                                                                                            
        2417             <xsl:when 
        2418              test="$par ticiptRole "
        2419             >
        2420                                                                                                     
        2421              <span 
        2422               class="td_ label"
        2423              >
        2424                                                                                                               
        2425               <xsl:call- template 
        2426                name="firs tCharCaseU p"
        2427               >
        2428                                                                                                                         
        2429                <xsl:with- param 
        2430                 name="data
        2431                 select="$p articiptRo le" 
        2432                />
        2433                                                                                                                
        2434               </xsl:call -template>
        2435                                                                                                      
        2436              </span>
        2437                                                                                             
        2438             </xsl:when >
        2439                                                                                            
        2440             <xsl:other wise>
        2441                                                                                                     
        2442              <span 
        2443               class="td_ label"
        2444              >
        2445                                                                                                               
        2446               <xsl:text>
        2447                Participan t
        2448               </xsl:text >
        2449                                                                                                      
        2450              </span>
        2451                                                                                             
        2452             </xsl:othe rwise>
        2453                                                                                   
        2454            </xsl:choo se>
        2455                                                                         
        2456           </td>
        2457                                                                        
        2458           <td 
        2459            width="80% "
        2460           >
        2461                                                                                  
        2462            <xsl:if 
        2463             test="n1:f unctionCod e"
        2464            >
        2465                                                                                            
        2466             <xsl:call- template 
        2467              name="show -code"
        2468             >
        2469                                                                                                     
        2470              <xsl:with- param 
        2471               name="code
        2472               select="n1 :functionC ode" 
        2473              />
        2474                                                                                             
        2475             </xsl:call -template>
        2476                                                                                   
        2477            </xsl:if>
        2478                                                                                  
        2479            <xsl:call- template 
        2480             name="show -associate dEntity"
        2481            >
        2482                                                                                            
        2483             <xsl:with- param 
        2484              name="asso Entity" 
        2485              select="n1 :associate dEntity" 
        2486             />
        2487                                                                                   
        2488            </xsl:call -template>
        2489                                                                                  
        2490            <xsl:if 
        2491             test="n1:t ime"
        2492            >
        2493                                                                                            
        2494             <xsl:if 
        2495              test="n1:t ime/n1:low "
        2496             >
        2497                                                                                                     
        2498              <xsl:text>
        2499                from 
        2500              </xsl:text >
        2501                                                                                                     
        2502              <xsl:call- template 
        2503               name="show -time"
        2504              >
        2505                                                                                                               
        2506               <xsl:with- param 
        2507                name="date time" 
        2508                select="n1 :time/n1:l ow" 
        2509               />
        2510                                                                                                      
        2511              </xsl:call -template>
        2512                                                                                             
        2513             </xsl:if>
        2514                                                                                            
        2515             <xsl:if 
        2516              test="n1:t ime/n1:hig h"
        2517             >
        2518                                                                                                     
        2519              <xsl:text>
        2520                to 
        2521              </xsl:text >
        2522                                                                                                     
        2523              <xsl:call- template 
        2524               name="show -time"
        2525              >
        2526                                                                                                               
        2527               <xsl:with- param 
        2528                name="date time" 
        2529                select="n1 :time/n1:h igh" 
        2530               />
        2531                                                                                                      
        2532              </xsl:call -template>
        2533                                                                                             
        2534             </xsl:if>
        2535                                                                                   
        2536            </xsl:if>
        2537                                                                                  
        2538            <xsl:if 
        2539             test="posi tion() !=  last()"
        2540            >
        2541                                                                                            
        2542             <br />
        2543                                                                                   
        2544            </xsl:if>
        2545                                                                         
        2546           </td>
        2547                                                               
        2548          </tr>
        2549                                                              
        2550          <xsl:if
        2551                                                                       
        2552           test="n1:a ssociatedE ntity/n1:a ddr | n1:a ssociatedE ntity/n1:t elecom"
        2553          >
        2554                                                                        
        2555           <tr>
        2556                                                                                  
        2557            <td 
        2558             bgcolor="# 3399ff"
        2559            >
        2560                                                                                            
        2561             <span 
        2562              class="td_ label"
        2563             >
        2564                                                                                                     
        2565              <xsl:text>
        2566               Contact in fo
        2567              </xsl:text >
        2568                                                                                             
        2569             </span>
        2570                                                                                   
        2571            </td>
        2572                                                                                  
        2573            <td>
        2574                                                                                            
        2575             <xsl:call- template 
        2576              name="show -contactIn fo"
        2577             >
        2578                                                                                                     
        2579              <xsl:with- param 
        2580               name="cont act" 
        2581               select="n1 :associate dEntity" 
        2582              />
        2583                                                                                             
        2584             </xsl:call -template>
        2585                                                                                   
        2586            </td>
        2587                                                                         
        2588           </tr>
        2589                                                               
        2590          </xsl:if>
        2591                                                     
        2592         </xsl:for- each>
        2593                                            
        2594        </tbody>
        2595                                  
        2596       </table>
        2597                        
        2598      </xsl:if>
        2599              
        2600     </xsl:temp late>
        2601             
        2602     <!-- recor dTarget -- >
        2603             
        2604     <xsl:templ ate 
        2605      name="reco rdTarget"
        2606     >
        2607                       
        2608      <table 
        2609       class="hea der_table"
        2610      >
        2611                                 
        2612       <tbody>
        2613                                           
        2614        <xsl:for-e ach 
        2615         select="/n 1:Clinical Document/n 1:recordTa rget/n1:pa tientRole"
        2616        >
        2617                                                    
        2618         <xsl:if 
        2619          test="not( n1:id/@nul lFlavor)"
        2620         >
        2621                                                              
        2622          <tr>
        2623                                                                        
        2624           <td 
        2625            width="20%
        2626            bgcolor="# 3399ff"
        2627           >
        2628                                                                                  
        2629            <span 
        2630             class="td_ label"
        2631            >
        2632                                                                                            
        2633             <xsl:text>
        2634              Patient
        2635             </xsl:text >
        2636                                                                                   
        2637            </span>
        2638                                                                         
        2639           </td>
        2640                                                                        
        2641           <td 
        2642            colspan="3 "
        2643           >
        2644                                                                                  
        2645            <xsl:call- template 
        2646             name="show -name"
        2647            >
        2648                                                                                            
        2649             <xsl:with- param 
        2650              name="name
        2651              select="n1 :patient/n 1:name" 
        2652             />
        2653                                                                                   
        2654            </xsl:call -template>
        2655                                                                         
        2656           </td>
        2657                                                               
        2658          </tr>
        2659                                                              
        2660          <tr>
        2661                                                                        
        2662           <td 
        2663            width="20%
        2664            bgcolor="# 3399ff"
        2665           >
        2666                                                                                  
        2667            <span 
        2668             class="td_ label"
        2669            >
        2670                                                                                            
        2671             <xsl:text>
        2672              Date of bi rth
        2673             </xsl:text >
        2674                                                                                   
        2675            </span>
        2676                                                                         
        2677           </td>
        2678                                                                        
        2679           <td 
        2680            width="30% "
        2681           >
        2682                                                                                  
        2683            <xsl:call- template 
        2684             name="show -time"
        2685            >
        2686                                                                                            
        2687             <xsl:with- param 
        2688              name="date time" 
        2689              select="n1 :patient/n 1:birthTim e" 
        2690             />
        2691                                                                                   
        2692            </xsl:call -template>
        2693                                                                         
        2694           </td>
        2695                                                                        
        2696           <td 
        2697            width="15%
        2698            bgcolor="# 3399ff"
        2699           >
        2700                                                                                  
        2701            <span 
        2702             class="td_ label"
        2703            >
        2704                                                                                            
        2705             <xsl:text>
        2706              Sex
        2707             </xsl:text >
        2708                                                                                   
        2709            </span>
        2710                                                                         
        2711           </td>
        2712                                                                        
        2713           <td>
        2714                                                                                  
        2715            <xsl:for-e ach 
        2716             select="n1 :patient/n 1:administ rativeGend erCode"
        2717            >
        2718                                                                                            
        2719             <xsl:call- template 
        2720              name="show -gender" 
        2721             />
        2722                                                                                   
        2723            </xsl:for- each>
        2724                                                                         
        2725           </td>
        2726                                                               
        2727          </tr>
        2728                                                              
        2729          <xsl:if 
        2730           test="n1:p atient/n1: raceCode |  (n1:patie nt/n1:ethn icGroupCod e)"
        2731          >
        2732                                                                        
        2733           <tr>
        2734                                                                                  
        2735            <td 
        2736             width="20%
        2737             bgcolor="# 3399ff"
        2738            >
        2739                                                                                            
        2740             <span 
        2741              class="td_ label"
        2742             >
        2743                                                                                                     
        2744              <xsl:text>
        2745               Race
        2746              </xsl:text >
        2747                                                                                             
        2748             </span>
        2749                                                                                   
        2750            </td>
        2751                                                                                  
        2752            <td 
        2753             width="30% "
        2754            >
        2755                                                                                            
        2756             <xsl:choos e>
        2757                                                                                                     
        2758              <xsl:when 
        2759               test="n1:p atient/n1: raceCode"
        2760              >
        2761                                                                                                               
        2762               <xsl:for-e ach 
        2763                select="n1 :patient/n 1:raceCode "
        2764               >
        2765                                                                                                                         
        2766                <xsl:call- template 
        2767                 name="show -race-ethn icity" 
        2768                />
        2769                                                                                                                
        2770               </xsl:for- each>
        2771                                                                                                      
        2772              </xsl:when >
        2773                                                                                                     
        2774              <xsl:other wise>
        2775                                                                                                               
        2776               <xsl:text>
        2777                Informatio n not avai lable
        2778               </xsl:text >
        2779                                                                                                      
        2780              </xsl:othe rwise>
        2781                                                                                             
        2782             </xsl:choo se>
        2783                                                                                   
        2784            </td>
        2785                                                                                  
        2786            <td 
        2787             width="15%
        2788             bgcolor="# 3399ff"
        2789            >
        2790                                                                                            
        2791             <span 
        2792              class="td_ label"
        2793             >
        2794                                                                                                     
        2795              <xsl:text>
        2796               Ethnicity
        2797              </xsl:text >
        2798                                                                                             
        2799             </span>
        2800                                                                                   
        2801            </td>
        2802                                                                                  
        2803            <td>
        2804                                                                                            
        2805             <xsl:choos e>
        2806                                                                                                     
        2807              <xsl:when 
        2808               test="n1:p atient/n1: ethnicGrou pCode"
        2809              >
        2810                                                                                                               
        2811               <xsl:for-e ach 
        2812                select="n1 :patient/n 1:ethnicGr oupCode"
        2813               >
        2814                                                                                                                         
        2815                <xsl:call- template 
        2816                 name="show -race-ethn icity" 
        2817                />
        2818                                                                                                                
        2819               </xsl:for- each>
        2820                                                                                                      
        2821              </xsl:when >
        2822                                                                                                     
        2823              <xsl:other wise>
        2824                                                                                                               
        2825               <xsl:text>
        2826                Informatio n not avai lable
        2827               </xsl:text >
        2828                                                                                                      
        2829              </xsl:othe rwise>
        2830                                                                                             
        2831             </xsl:choo se>
        2832                                                                                   
        2833            </td>
        2834                                                                         
        2835           </tr>
        2836                                                               
        2837          </xsl:if>
        2838                                                              
        2839          <tr>
        2840                                                                        
        2841           <td 
        2842            bgcolor="# 3399ff"
        2843           >
        2844                                                                                  
        2845            <span 
        2846             class="td_ label"
        2847            >
        2848                                                                                            
        2849             <xsl:text>
        2850              Contact in fo
        2851             </xsl:text >
        2852                                                                                   
        2853            </span>
        2854                                                                         
        2855           </td>
        2856                                                                        
        2857           <td>
        2858                                                                                  
        2859            <xsl:call- template 
        2860             name="show -contactIn fo"
        2861            >
        2862                                                                                            
        2863             <xsl:with- param 
        2864              name="cont act" 
        2865              select="."  
        2866             />
        2867                                                                                   
        2868            </xsl:call -template>
        2869                                                                         
        2870           </td>
        2871                                                                        
        2872           <td 
        2873            bgcolor="# 3399ff"
        2874           >
        2875                                                                                  
        2876            <span 
        2877             class="td_ label"
        2878            >
        2879                                                                                            
        2880             <xsl:text>
        2881              Patient ID s
        2882             </xsl:text >
        2883                                                                                   
        2884            </span>
        2885                                                                         
        2886           </td>
        2887                                                                        
        2888           <td>
        2889                                                                                  
        2890            <xsl:for-e ach 
        2891             select="n1 :id"
        2892            >
        2893                                                                                            
        2894             <xsl:call- template 
        2895              name="show -id" 
        2896             />
        2897                                                                                            
        2898             <br />
        2899                                                                                   
        2900            </xsl:for- each>
        2901                                                                         
        2902           </td>
        2903                                                               
        2904          </tr>
        2905                                                     
        2906         </xsl:if>
        2907                                            
        2908        </xsl:for- each>
        2909                                  
        2910       </tbody>
        2911                        
        2912      </table>
        2913              
        2914     </xsl:temp late>
        2915             
        2916     <!-- relat edDocument  -->
        2917             
        2918     <xsl:templ ate 
        2919      name="rela tedDocumen t"
        2920     >
        2921                       
        2922      <xsl:if 
        2923       test="n1:r elatedDocu ment"
        2924      >
        2925                                 
        2926       <table 
        2927        class="hea der_table"
        2928       >
        2929                                           
        2930        <tbody>
        2931                                                    
        2932         <xsl:for-e ach 
        2933          select="n1 :relatedDo cument"
        2934         >
        2935                                                              
        2936          <tr>
        2937                                                                        
        2938           <td 
        2939            width="20%
        2940            bgcolor="# 3399ff"
        2941           >
        2942                                                                                  
        2943            <span 
        2944             class="td_ label"
        2945            >
        2946                                                                                            
        2947             <xsl:text>
        2948              Related do cument
        2949             </xsl:text >
        2950                                                                                   
        2951            </span>
        2952                                                                         
        2953           </td>
        2954                                                                        
        2955           <td 
        2956            width="80% "
        2957           >
        2958                                                                                  
        2959            <xsl:for-e ach 
        2960             select="n1 :parentDoc ument"
        2961            >
        2962                                                                                            
        2963             <xsl:for-e ach 
        2964              select="n1 :id"
        2965             >
        2966                                                                                                     
        2967              <xsl:call- template 
        2968               name="show -id" 
        2969              />
        2970                                                                                                     
        2971              <br />
        2972                                                                                             
        2973             </xsl:for- each>
        2974                                                                                   
        2975            </xsl:for- each>
        2976                                                                         
        2977           </td>
        2978                                                               
        2979          </tr>
        2980                                                     
        2981         </xsl:for- each>
        2982                                            
        2983        </tbody>
        2984                                  
        2985       </table>
        2986                        
        2987      </xsl:if>
        2988              
        2989     </xsl:temp late>
        2990             
        2991     <!-- autho rization ( consent) - ->
        2992             
        2993     <xsl:templ ate 
        2994      name="auth orization"
        2995     >
        2996                       
        2997      <xsl:if 
        2998       test="n1:a uthorizati on"
        2999      >
        3000                                 
        3001       <table 
        3002        class="hea der_table"
        3003       >
        3004                                           
        3005        <tbody>
        3006                                                    
        3007         <xsl:for-e ach 
        3008          select="n1 :authoriza tion"
        3009         >
        3010                                                              
        3011          <tr>
        3012                                                                        
        3013           <td 
        3014            width="20%
        3015            bgcolor="# 3399ff"
        3016           >
        3017                                                                                  
        3018            <span 
        3019             class="td_ label"
        3020            >
        3021                                                                                            
        3022             <xsl:text>
        3023              Consent
        3024             </xsl:text >
        3025                                                                                   
        3026            </span>
        3027                                                                         
        3028           </td>
        3029                                                                        
        3030           <td 
        3031            width="80% "
        3032           >
        3033                                                                                  
        3034            <xsl:choos e>
        3035                                                                                            
        3036             <xsl:when 
        3037              test="n1:c onsent/n1: code"
        3038             >
        3039                                                                                                     
        3040              <xsl:call- template 
        3041               name="show -code"
        3042              >
        3043                                                                                                               
        3044               <xsl:with- param 
        3045                name="code
        3046                select="n1 :consent/n 1:code" 
        3047               />
        3048                                                                                                      
        3049              </xsl:call -template>
        3050                                                                                             
        3051             </xsl:when >
        3052                                                                                            
        3053             <xsl:other wise>
        3054                                                                                                     
        3055              <xsl:call- template 
        3056               name="show -code"
        3057              >
        3058                                                                                                               
        3059               <xsl:with- param 
        3060                name="code "
        3061                                                                                                                        
        3062                select="n1 :consent/n 1:statusCo de" 
        3063               />
        3064                                                                                                      
        3065              </xsl:call -template>
        3066                                                                                             
        3067             </xsl:othe rwise>
        3068                                                                                   
        3069            </xsl:choo se>
        3070                                                                                  
        3071            <br />
        3072                                                                         
        3073           </td>
        3074                                                               
        3075          </tr>
        3076                                                     
        3077         </xsl:for- each>
        3078                                            
        3079        </tbody>
        3080                                  
        3081       </table>
        3082                        
        3083      </xsl:if>
        3084              
        3085     </xsl:temp late>
        3086             
        3087     <!-- setAn dVersion - ->
        3088             
        3089     <xsl:templ ate 
        3090      name="setA ndVersion"
        3091     >
        3092                       
        3093      <xsl:if 
        3094       test="n1:s etId and n 1:versionN umber"
        3095      >
        3096                                 
        3097       <table 
        3098        class="hea der_table"
        3099       >
        3100                                           
        3101        <tbody>
        3102                                                    
        3103         <tr>
        3104                                                              
        3105          <td 
        3106           width="20% "
        3107          >
        3108                                                                        
        3109           <xsl:text>
        3110            SetId and  Version
        3111           </xsl:text >
        3112                                                               
        3113          </td>
        3114                                                              
        3115          <td 
        3116           colspan="3 "
        3117          >
        3118                                                                        
        3119           <xsl:text>
        3120            SetId: 
        3121           </xsl:text >
        3122                                                                        
        3123           <xsl:call- template 
        3124            name="show -id"
        3125           >
        3126                                                                                  
        3127            <xsl:with- param 
        3128             name="id" 
        3129             select="n1 :setId" 
        3130            />
        3131                                                                         
        3132           </xsl:call -template>
        3133                                                                        
        3134           <xsl:text>
        3135              Version:  
        3136           </xsl:text >
        3137                                                                        
        3138           <xsl:value -of 
        3139            select="n1 :versionNu mber/@valu e" 
        3140           />
        3141                                                               
        3142          </td>
        3143                                                     
        3144         </tr>
        3145                                            
        3146        </tbody>
        3147                                  
        3148       </table>
        3149                        
        3150      </xsl:if>
        3151              
        3152     </xsl:temp late>
        3153             
        3154     <!-- show  Structured Body -->
        3155             
        3156     <xsl:templ ate 
        3157      match="n1: component/ n1:structu redBody"
        3158     >
        3159                       
        3160      <xsl:for-e ach 
        3161       select="n1 :component /n1:sectio n"
        3162      >
        3163                                 
        3164       <xsl:call- template 
        3165        name="sect ion" 
        3166       />
        3167                        
        3168      </xsl:for- each>
        3169              
        3170     </xsl:temp late>
        3171             
        3172     <!-- show  nonXMLBody  -->
        3173             
        3174     <xsl:templ ate 
        3175      match='n1: component/ n1:nonXMLB ody'
        3176     >
        3177                       
        3178      <xsl:choos e>
        3179                                 
        3180       <!-- if th ere is a r eference,  use that i n an IFRAM E -->
        3181                                 
        3182       <xsl:when 
        3183        test='n1:t ext/n1:ref erence'
        3184       >
        3185                                           
        3186        <IFRAME 
        3187         name='nonX MLBody' 
        3188         id='nonXML Body' 
        3189         WIDTH='80%
        3190         HEIGHT='60 0'
        3191                                                   
        3192         src='{n1:t ext/n1:ref erence/@va lue}' 
        3193        />
        3194                                  
        3195       </xsl:when >
        3196                                 
        3197       <!-- Hardc oded link  for suppor ting attac hments - A sha Amritr aj : START  -->
        3198                                 
        3199       <xsl:when 
        3200        test='n1:t ext/@repre sentation= "B64"'
        3201       >
        3202                                           
        3203        <pre>
        3204                                                    
        3205         <!-- TODO:  Asha Amri traj - Har dcoded C62  for now.  Make it ge neric in 
        3206                                                             ne xt release  -->
        3207                                                    
        3208         <a
        3209                                                             
        3210          href="View Attachment .do_sec?me diaType={n 1:text/@me diaType}&a mp;represe ntation={n 1:text/@re presentati on}&amp;do cType=C62"
        3211         >
        3212          View attac hment
        3213         </a>
        3214                                            
        3215        </pre>
        3216                                  
        3217       </xsl:when >
        3218                                 
        3219       <xsl:when 
        3220        test='n1:t ext/@media Type="text /plain"'
        3221       >
        3222                                           
        3223        <pre>
        3224                                                    
        3225         <xsl:value -of 
        3226          select='n1 :text/text ()' 
        3227         />
        3228                                            
        3229        </pre>
        3230                                  
        3231       </xsl:when >
        3232                                 
        3233       <!-- Hardc oded link  for suppor ting attac hments - A sha Amritr aj : END - ->
        3234                                 
        3235       <xsl:other wise>
        3236                                           
        3237        <CENTER>
        3238         Cannot dis play the t ext
        3239        </CENTER>
        3240                                  
        3241       </xsl:othe rwise>
        3242                        
        3243      </xsl:choo se>
        3244              
        3245     </xsl:temp late>
        3246             
        3247     <!-- top l evel compo nent/secti on: displa y title an d text, an d process  any 
        3248                      nest ed compone nt/section s -->
        3249             
        3250     <xsl:templ ate 
        3251      name="sect ion"
        3252     >
        3253                       
        3254      <xsl:call- template 
        3255       name="sect ion-title"
        3256      >
        3257                                 
        3258       <xsl:with- param 
        3259        name="titl e" 
        3260        select="n1 :title" 
        3261       />
        3262                        
        3263      </xsl:call -template>
        3264                       
        3265      <xsl:call- template 
        3266       name="sect ion-author
        3267      />
        3268                       
        3269      <xsl:call- template 
        3270       name="sect ion-text" 
        3271      />
        3272                       
        3273      <xsl:for-e ach 
        3274       select="n1 :component /n1:sectio n"
        3275      >
        3276                                 
        3277       <xsl:call- template 
        3278        name="nest edSection"
        3279       >
        3280                                           
        3281        <xsl:with- param 
        3282         name="marg in" 
        3283         select="2"  
        3284        />
        3285                                  
        3286       </xsl:call -template>
        3287                        
        3288      </xsl:for- each>
        3289              
        3290     </xsl:temp late>
        3291             
        3292     <!-- top l evel secti on title - ->
        3293             
        3294     <xsl:templ ate 
        3295      name="sect ion-title"
        3296     >
        3297                       
        3298      <xsl:param  
        3299       name="titl e" 
        3300      />
        3301                       
        3302      <xsl:choos e>
        3303                                 
        3304       <xsl:when
        3305                                          
        3306        test="coun t(/n1:Clin icalDocume nt/n1:comp onent/n1:s tructuredB ody/n1:com ponent[n1: section])  &gt; 1"
        3307       >
        3308                                           
        3309        <h3>
        3310                                                    
        3311         <a 
        3312          name="{gen erate-id($ title)}" 
        3313          href="#toc "
        3314         >
        3315                                                              
        3316          <xsl:value -of 
        3317           select="$t itle" 
        3318          />
        3319                                                     
        3320         </a>
        3321                                            
        3322        </h3>
        3323                                  
        3324       </xsl:when >
        3325                                 
        3326       <xsl:other wise>
        3327                                           
        3328        <h3>
        3329                                                    
        3330         <xsl:value -of 
        3331          select="$t itle" 
        3332         />
        3333                                            
        3334        </h3>
        3335                                  
        3336       </xsl:othe rwise>
        3337                        
        3338      </xsl:choo se>
        3339              
        3340     </xsl:temp late>
        3341             
        3342     <!-- secti on author  -->
        3343             
        3344     <xsl:templ ate 
        3345      name="sect ion-author "
        3346     >
        3347                       
        3348      <xsl:if 
        3349       test="coun t(n1:autho r)&gt;0"
        3350      >
        3351                                 
        3352       <div 
        3353        style="mar gin-left :  2em;"
        3354       >
        3355                                           
        3356        <b>
        3357                                                    
        3358         <xsl:text>
        3359          Section Au thor: 
        3360         </xsl:text >
        3361                                            
        3362        </b>
        3363                                           
        3364        <xsl:for-e ach 
        3365         select="n1 :author/n1 :assignedA uthor"
        3366        >
        3367                                                    
        3368         <xsl:choos e>
        3369                                                              
        3370          <xsl:when 
        3371           test="n1:a ssignedPer son/n1:nam e"
        3372          >
        3373                                                                        
        3374           <xsl:call- template 
        3375            name="show -name"
        3376           >
        3377                                                                                  
        3378            <xsl:with- param 
        3379             name="name
        3380             select="n1 :assignedP erson/n1:n ame" 
        3381            />
        3382                                                                         
        3383           </xsl:call -template>
        3384                                                                        
        3385           <xsl:if 
        3386            test="n1:r epresented Organizati on"
        3387           >
        3388                                                                                  
        3389            <xsl:text>
        3390            
        3391            </xsl:text >
        3392                                                                                  
        3393            <xsl:call- template 
        3394             name="show -name"
        3395            >
        3396                                                                                            
        3397             <xsl:with- param 
        3398              name="name "
        3399                                                                                                    
        3400              select="n1 :represent edOrganiza tion/n1:na me" 
        3401             />
        3402                                                                                   
        3403            </xsl:call -template>
        3404                                                                         
        3405           </xsl:if>
        3406                                                               
        3407          </xsl:when >
        3408                                                              
        3409          <xsl:when 
        3410           test="n1:a ssignedAut horingDevi ce/n1:soft wareName"
        3411          >
        3412                                                                        
        3413           <xsl:value -of 
        3414            select="n1 :assignedA uthoringDe vice/n1:so ftwareName
        3415           />
        3416                                                               
        3417          </xsl:when >
        3418                                                              
        3419          <xsl:other wise>
        3420                                                                        
        3421           <xsl:for-e ach 
        3422            select="n1 :id"
        3423           >
        3424                                                                                  
        3425            <xsl:call- template 
        3426             name="show -id" 
        3427            />
        3428                                                                                  
        3429            <br />
        3430                                                                         
        3431           </xsl:for- each>
        3432                                                               
        3433          </xsl:othe rwise>
        3434                                                     
        3435         </xsl:choo se>
        3436                                            
        3437        </xsl:for- each>
        3438                                           
        3439        <br />
        3440                                  
        3441       </div>
        3442                        
        3443      </xsl:if>
        3444              
        3445     </xsl:temp late>
        3446             
        3447     <!-- top-l evel secti on Text -- >
        3448             
        3449     <xsl:templ ate 
        3450      name="sect ion-text"
        3451     >
        3452                       
        3453      <div>
        3454                                 
        3455       <xsl:apply -templates  
        3456        select="n1 :text" 
        3457       />
        3458                        
        3459      </div>
        3460              
        3461     </xsl:temp late>
        3462             
        3463     <!-- neste d componen t/section  -->
        3464             
        3465     <xsl:templ ate 
        3466      name="nest edSection"
        3467     >
        3468                       
        3469      <xsl:param  
        3470       name="marg in" 
        3471      />
        3472                       
        3473      <h4 
        3474       style="mar gin-left :  {$margin} em;"
        3475      >
        3476                                 
        3477       <xsl:value -of 
        3478        select="n1 :title" 
        3479       />
        3480                        
        3481      </h4>
        3482                       
        3483      <div 
        3484       style="mar gin-left :  {$margin} em;"
        3485      >
        3486                                 
        3487       <xsl:apply -templates  
        3488        select="n1 :text" 
        3489       />
        3490                        
        3491      </div>
        3492                       
        3493      <xsl:for-e ach 
        3494       select="n1 :component /n1:sectio n"
        3495      >
        3496                                 
        3497       <xsl:call- template 
        3498        name="nest edSection"
        3499       >
        3500                                           
        3501        <xsl:with- param 
        3502         name="marg in" 
        3503         select="2* $margin" 
        3504        />
        3505                                  
        3506       </xsl:call -template>
        3507                        
        3508      </xsl:for- each>
        3509              
        3510     </xsl:temp late>
        3511             
        3512     <!-- parag raph -->
        3513             
        3514     <xsl:templ ate 
        3515      match="n1: paragraph"
        3516     >
        3517                       
        3518      <p>
        3519                                 
        3520       <xsl:apply -templates  />
        3521                        
        3522      </p>
        3523              
        3524     </xsl:temp late>
        3525             
        3526     <!-- pre f ormat -->
        3527             
        3528     <xsl:templ ate 
        3529      match="n1: pre"
        3530     >
        3531                       
        3532      <pre>
        3533                                 
        3534       <xsl:apply -templates  />
        3535                        
        3536      </pre>
        3537              
        3538     </xsl:temp late>
        3539             
        3540     <!-- Conte nt w/ dele ted text i s hidden - ->
        3541             
        3542     <xsl:templ ate 
        3543      match="n1: content[@r evised='de lete']" 
        3544     />
        3545             
        3546     <!-- conte nt -->
        3547             
        3548     <xsl:templ ate 
        3549      match="n1: content"
        3550     >
        3551                       
        3552      <xsl:apply -templates  />
        3553              
        3554     </xsl:temp late>
        3555             
        3556     <!-- line  break -->
        3557             
        3558     <xsl:templ ate 
        3559      match="n1: br"
        3560     >
        3561                       
        3562      <xsl:eleme nt 
        3563       name='br'
        3564      >
        3565                                 
        3566       <xsl:apply -templates  />
        3567                        
        3568      </xsl:elem ent>
        3569              
        3570     </xsl:temp late>
        3571             
        3572     <!-- list  -->
        3573             
        3574     <xsl:templ ate 
        3575      match="n1: list"
        3576     >
        3577                       
        3578      <xsl:if 
        3579       test="n1:c aption"
        3580      >
        3581                                 
        3582       <p>
        3583                                           
        3584        <b>
        3585                                                    
        3586         <xsl:apply -templates  
        3587          select="n1 :caption" 
        3588         />
        3589                                            
        3590        </b>
        3591                                  
        3592       </p>
        3593                        
        3594      </xsl:if>
        3595                       
        3596      <ul>
        3597                                 
        3598       <xsl:for-e ach 
        3599        select="n1 :item"
        3600       >
        3601                                           
        3602        <li>
        3603                                                    
        3604         <xsl:apply -templates  />
        3605                                            
        3606        </li>
        3607                                  
        3608       </xsl:for- each>
        3609                        
        3610      </ul>
        3611              
        3612     </xsl:temp late>
        3613             
        3614     <xsl:templ ate 
        3615      match="n1: list[@list Type='orde red']"
        3616     >
        3617                       
        3618      <xsl:if 
        3619       test="n1:c aption"
        3620      >
        3621                                 
        3622       <span 
        3623        style="fon t-weight:b old; "
        3624       >
        3625                                           
        3626        <xsl:apply -templates  
        3627         select="n1 :caption" 
        3628        />
        3629                                  
        3630       </span>
        3631                        
        3632      </xsl:if>
        3633                       
        3634      <ol>
        3635                                 
        3636       <xsl:for-e ach 
        3637        select="n1 :item"
        3638       >
        3639                                           
        3640        <li>
        3641                                                    
        3642         <xsl:apply -templates  />
        3643                                            
        3644        </li>
        3645                                  
        3646       </xsl:for- each>
        3647                        
        3648      </ol>
        3649              
        3650     </xsl:temp late>
        3651             
        3652     <!-- capti on -->
        3653             
        3654     <xsl:templ ate 
        3655      match="n1: caption"
        3656     >
        3657                       
        3658      <xsl:apply -templates  />
        3659                       
        3660      <xsl:text>
        3661      
        3662      </xsl:text >
        3663              
        3664     </xsl:temp late>
        3665             
        3666     <!-- Table s -->
        3667             
        3668     <xsl:templ ate
        3669                      
        3670      match="n1: table/@*|n 1:thead/@* |n1:tfoot/ @*|n1:tbod y/@*|n1:co lgroup/@*| n1:col/@*| n1:tr/@*|n 1:th/@*|n1 :td/@*"
        3671     >
        3672                       
        3673      <xsl:copy>
        3674                                 
        3675       <xsl:copy- of 
        3676        select="@*
        3677       />
        3678                                 
        3679       <xsl:apply -templates  />
        3680                        
        3681      </xsl:copy >
        3682              
        3683     </xsl:temp late>
        3684             
        3685     <xsl:templ ate 
        3686      match="n1: table"
        3687     >
        3688                       
        3689      <table 
        3690       class="nar r_table"
        3691      >
        3692                                 
        3693       <xsl:copy- of 
        3694        select="@*
        3695       />
        3696                                 
        3697       <xsl:apply -templates  />
        3698                        
        3699      </table>
        3700              
        3701     </xsl:temp late>
        3702             
        3703     <xsl:templ ate 
        3704      match="n1: thead"
        3705     >
        3706                       
        3707      <thead>
        3708                                 
        3709       <xsl:copy- of 
        3710        select="@*
        3711       />
        3712                                 
        3713       <xsl:apply -templates  />
        3714                        
        3715      </thead>
        3716              
        3717     </xsl:temp late>
        3718             
        3719     <xsl:templ ate 
        3720      match="n1: tfoot"
        3721     >
        3722                       
        3723      <tfoot>
        3724                                 
        3725       <xsl:copy- of 
        3726        select="@*
        3727       />
        3728                                 
        3729       <xsl:apply -templates  />
        3730                        
        3731      </tfoot>
        3732              
        3733     </xsl:temp late>
        3734             
        3735     <xsl:templ ate 
        3736      match="n1: tbody"
        3737     >
        3738                       
        3739      <tbody>
        3740                                 
        3741       <xsl:copy- of 
        3742        select="@*
        3743       />
        3744                                 
        3745       <xsl:apply -templates  />
        3746                        
        3747      </tbody>
        3748              
        3749     </xsl:temp late>
        3750             
        3751     <xsl:templ ate 
        3752      match="n1: colgroup"
        3753     >
        3754                       
        3755      <colgroup>
        3756                                 
        3757       <xsl:copy- of 
        3758        select="@*
        3759       />
        3760                                 
        3761       <xsl:apply -templates  />
        3762                        
        3763      </colgroup >
        3764              
        3765     </xsl:temp late>
        3766             
        3767     <xsl:templ ate 
        3768      match="n1: col"
        3769     >
        3770                       
        3771      <col>
        3772                                 
        3773       <xsl:copy- of 
        3774        select="@*
        3775       />
        3776                                 
        3777       <xsl:apply -templates  />
        3778                        
        3779      </col>
        3780              
        3781     </xsl:temp late>
        3782             
        3783     <xsl:templ ate 
        3784      match="n1: tr"
        3785     >
        3786                       
        3787      <tr 
        3788       class="nar r_tr"
        3789      >
        3790                                 
        3791       <xsl:copy- of 
        3792        select="@*
        3793       />
        3794                                 
        3795       <xsl:apply -templates  />
        3796                        
        3797      </tr>
        3798              
        3799     </xsl:temp late>
        3800             
        3801     <xsl:templ ate 
        3802      match="n1: th"
        3803     >
        3804                       
        3805      <th 
        3806       class="nar r_th"
        3807      >
        3808                                 
        3809       <xsl:copy- of 
        3810        select="@*
        3811       />
        3812                                 
        3813       <xsl:apply -templates  />
        3814                        
        3815      </th>
        3816              
        3817     </xsl:temp late>
        3818             
        3819     <xsl:templ ate 
        3820      match="n1: td"
        3821     >
        3822                       
        3823      <td>
        3824                                 
        3825       <xsl:copy- of 
        3826        select="@*
        3827       />
        3828                                 
        3829       <xsl:apply -templates  />
        3830                        
        3831      </td>
        3832              
        3833     </xsl:temp late>
        3834             
        3835     <xsl:templ ate 
        3836      match="n1: table/n1:c aption"
        3837     >
        3838                       
        3839      <span 
        3840       style="fon t-weight:b old; "
        3841      >
        3842                                 
        3843       <xsl:apply -templates  />
        3844                        
        3845      </span>
        3846              
        3847     </xsl:temp late>
        3848    
        3849             
        3850     <!-- Asha  Amritraj:  Attachment  Links - S TART -->
        3851             
        3852     <xsl:templ ate 
        3853      match="n1: observatio nMedia"
        3854     >
        3855                       
        3856      <!-- Hardc oded Link  - TODO: Re place to d ynamic lin k -->
        3857                       
        3858      <pre>
        3859                                 
        3860       <a
        3861                                          
        3862        href="View Attachment .do_sec?me diaType={n 1:value/@m ediaType}& amp;repres entation={ n1:value/@ representa tion}&amp; docType=Pr ivacyConse ntDirectiv e"
        3863       >
        3864        View attac hment
        3865       </a>
        3866                        
        3867      </pre>
        3868              
        3869     </xsl:temp late>
        3870             
        3871     <!-- Asha  Amritraj:  Attachment  Links - E ND -->
        3872    
        3873    
        3874             
        3875     <!-- Rende rMultiMedi a this cur rently onl y handles  GIF's and  JPEG's. It  could, 
        3876                      howe ver, be ex tended by  including  other imag e MIME typ es in the  predicate 
        3877                      and/ or by gene rating <ob ject> or < applet> ta g with the  correct p arams depe nding 
        3878                      on t he media t ype @ID =$ imageRef r eferencedO bject -->
        3879             
        3880     <xsl:templ ate 
        3881      match="n1: renderMult iMedia"
        3882     >
        3883                       
        3884      <xsl:varia ble 
        3885       name="imag eRef" 
        3886       select="@r eferencedO bject" 
        3887      />
        3888                       
        3889      <xsl:choos e>
        3890                                 
        3891       <xsl:when 
        3892        test="//n1 :regionOfI nterest[@I D=$imageRe f]"
        3893       >
        3894                                           
        3895        <!-- Here  is where t he Region  of Interes t image re ferencing  goes -->
        3896                                           
        3897        <xsl:if
        3898                                                   
        3899         test="//n1 :regionOfI nterest[@I D=$imageRe f]//n1:obs ervationMe dia/n1:val ue[@mediaT ype='image /gif' or
        3900          @mediaTyp e='image/j peg']"
        3901        >
        3902                                                    
        3903         <br 
        3904          clear="all
        3905         />
        3906                                                    
        3907         <xsl:eleme nt 
        3908          name="img"
        3909         >
        3910                                                              
        3911          <xsl:attri bute 
        3912           name="src"
        3913          >
        3914           <xsl:value -of
        3915                                                                        
        3916            select="// n1:regionO fInterest[ @ID=$image Ref]//n1:o bservation Media/n1:v alue/n1:re ference/@v alue" 
        3917           />
        3918          </xsl:attr ibute>
        3919                                                     
        3920         </xsl:elem ent>
        3921                                            
        3922        </xsl:if>
        3923                                  
        3924       </xsl:when >
        3925                                 
        3926       <xsl:other wise>
        3927                                           
        3928        <!-- Here  is where t he direct  MultiMedia  image ref erencing g oes -->
        3929                                           
        3930        <xsl:if
        3931                                                   
        3932         test="//n1 :observati onMedia[@I D=$imageRe f]/n1:valu e[@mediaTy pe='image/ gif' or @m ediaType=' image/jpeg ']"
        3933        >
        3934                                                    
        3935         <br 
        3936          clear="all
        3937         />
        3938                                                    
        3939         <xsl:eleme nt 
        3940          name="img"
        3941         >
        3942                                                              
        3943          <xsl:attri bute 
        3944           name="src"
        3945          >
        3946           <xsl:value -of
        3947                                                                        
        3948            select="// n1:observa tionMedia[ @ID=$image Ref]/n1:va lue/n1:ref erence/@va lue" 
        3949           />
        3950          </xsl:attr ibute>
        3951                                                     
        3952         </xsl:elem ent>
        3953                                            
        3954        </xsl:if>
        3955                                  
        3956       </xsl:othe rwise>
        3957                        
        3958      </xsl:choo se>
        3959              
        3960     </xsl:temp late>
        3961             
        3962     <!-- Style code proce ssing Supp orts Bold,  Underline  and Itali cs display  -->
        3963             
        3964     <xsl:templ ate 
        3965      match="//n 1:*[@style Code]"
        3966     >
        3967                       
        3968      <xsl:if 
        3969       test="@sty leCode='Bo ld'"
        3970      >
        3971                                 
        3972       <xsl:eleme nt 
        3973        name="b"
        3974       >
        3975                                           
        3976        <xsl:apply -templates  />
        3977                                  
        3978       </xsl:elem ent>
        3979                        
        3980      </xsl:if>
        3981                       
        3982      <xsl:if 
        3983       test="@sty leCode='It alics'"
        3984      >
        3985                                 
        3986       <xsl:eleme nt 
        3987        name="i"
        3988       >
        3989                                           
        3990        <xsl:apply -templates  />
        3991                                  
        3992       </xsl:elem ent>
        3993                        
        3994      </xsl:if>
        3995                       
        3996      <xsl:if 
        3997       test="@sty leCode='Un derline'"
        3998      >
        3999                                 
        4000       <xsl:eleme nt 
        4001        name="u"
        4002       >
        4003                                           
        4004        <xsl:apply -templates  />
        4005                                  
        4006       </xsl:elem ent>
        4007                        
        4008      </xsl:if>
        4009                       
        4010      <xsl:if
        4011                                
        4012       test="cont ains(@styl eCode,'Bol d') and co ntains(@st yleCode,'I talics') a nd not (co ntains(@st yleCode, ' Underline' ))"
        4013      >
        4014                                 
        4015       <xsl:eleme nt 
        4016        name="b"
        4017       >
        4018                                           
        4019        <xsl:eleme nt 
        4020         name="i"
        4021        >
        4022                                                    
        4023         <xsl:apply -templates  />
        4024                                            
        4025        </xsl:elem ent>
        4026                                  
        4027       </xsl:elem ent>
        4028                        
        4029      </xsl:if>
        4030                       
        4031      <xsl:if
        4032                                
        4033       test="cont ains(@styl eCode,'Bol d') and co ntains(@st yleCode,'U nderline')  and not ( contains(@ styleCode,  'Italics' ))"
        4034      >
        4035                                 
        4036       <xsl:eleme nt 
        4037        name="b"
        4038       >
        4039                                           
        4040        <xsl:eleme nt 
        4041         name="u"
        4042        >
        4043                                                    
        4044         <xsl:apply -templates  />
        4045                                            
        4046        </xsl:elem ent>
        4047                                  
        4048       </xsl:elem ent>
        4049                        
        4050      </xsl:if>
        4051                       
        4052      <xsl:if
        4053                                
        4054       test="cont ains(@styl eCode,'Ita lics') and  contains( @styleCode ,'Underlin e') and no t (contain s(@styleCo de, 'Bold' ))"
        4055      >
        4056                                 
        4057       <xsl:eleme nt 
        4058        name="i"
        4059       >
        4060                                           
        4061        <xsl:eleme nt 
        4062         name="u"
        4063        >
        4064                                                    
        4065         <xsl:apply -templates  />
        4066                                            
        4067        </xsl:elem ent>
        4068                                  
        4069       </xsl:elem ent>
        4070                        
        4071      </xsl:if>
        4072                       
        4073      <xsl:if
        4074                                
        4075       test="cont ains(@styl eCode,'Ita lics') and  contains( @styleCode ,'Underlin e') and co ntains(@st yleCode, ' Bold')"
        4076      >
        4077                                 
        4078       <xsl:eleme nt 
        4079        name="b"
        4080       >
        4081                                           
        4082        <xsl:eleme nt 
        4083         name="i"
        4084        >
        4085                                                    
        4086         <xsl:eleme nt 
        4087          name="u"
        4088         >
        4089                                                              
        4090          <xsl:apply -templates  />
        4091                                                     
        4092         </xsl:elem ent>
        4093                                            
        4094        </xsl:elem ent>
        4095                                  
        4096       </xsl:elem ent>
        4097                        
        4098      </xsl:if>
        4099                       
        4100      <xsl:if
        4101                                
        4102       test="not  (contains( @styleCode ,'Italics' ) or conta ins(@style Code,'Unde rline') or  contains( @styleCode , 'Bold')) "
        4103      >
        4104                                 
        4105       <xsl:apply -templates  />
        4106                        
        4107      </xsl:if>
        4108              
        4109     </xsl:temp late>
        4110             
        4111     <!-- Super script or  Subscript  -->
        4112             
        4113     <xsl:templ ate 
        4114      match="n1: sup"
        4115     >
        4116                       
        4117      <xsl:eleme nt 
        4118       name="sup"
        4119      >
        4120                                 
        4121       <xsl:apply -templates  />
        4122                        
        4123      </xsl:elem ent>
        4124              
        4125     </xsl:temp late>
        4126             
        4127     <xsl:templ ate 
        4128      match="n1: sub"
        4129     >
        4130                       
        4131      <xsl:eleme nt 
        4132       name="sub"
        4133      >
        4134                                 
        4135       <xsl:apply -templates  />
        4136                        
        4137      </xsl:elem ent>
        4138              
        4139     </xsl:temp late>
        4140             
        4141     <!-- show- signature  -->
        4142             
        4143     <xsl:templ ate 
        4144      name="show -sig"
        4145     >
        4146                       
        4147      <xsl:param  
        4148       name="sig"  
        4149      />
        4150                       
        4151      <xsl:choos e>
        4152                                 
        4153       <xsl:when 
        4154        test="$sig /@code =&a pos;S&apos ;"
        4155       >
        4156                                           
        4157        <xsl:text>
        4158         signed
        4159        </xsl:text >
        4160                                  
        4161       </xsl:when >
        4162                                 
        4163       <xsl:when 
        4164        test="$sig /@code=&ap os;I&apos; "
        4165       >
        4166                                           
        4167        <xsl:text>
        4168         intended
        4169        </xsl:text >
        4170                                  
        4171       </xsl:when >
        4172                                 
        4173       <xsl:when 
        4174        test="$sig /@code=&ap os;X&apos; "
        4175       >
        4176                                           
        4177        <xsl:text>
        4178         signature  required
        4179        </xsl:text >
        4180                                  
        4181       </xsl:when >
        4182                        
        4183      </xsl:choo se>
        4184              
        4185     </xsl:temp late>
        4186             
        4187     <!-- show- id -->
        4188             
        4189     <xsl:templ ate 
        4190      name="show -id"
        4191     >
        4192                       
        4193      <xsl:param  
        4194       name="id" 
        4195      />
        4196                       
        4197      <xsl:choos e>
        4198                                 
        4199       <xsl:when 
        4200        test="not( $id)"
        4201       >
        4202                                           
        4203        <xsl:if 
        4204         test="not( @nullFlavo r)"
        4205        >
        4206                                                    
        4207         <xsl:if 
        4208          test="@ext ension"
        4209         >
        4210                                                              
        4211          <xsl:value -of 
        4212           select="@e xtension" 
        4213          />
        4214                                                     
        4215         </xsl:if>
        4216                                                    
        4217         <xsl:text>
        4218           
        4219         </xsl:text >
        4220                                                    
        4221         <xsl:value -of 
        4222          select="@r oot" 
        4223         />
        4224                                            
        4225        </xsl:if>
        4226                                  
        4227       </xsl:when >
        4228                                 
        4229       <xsl:other wise>
        4230                                           
        4231        <xsl:if 
        4232         test="not( $id/@nullF lavor)"
        4233        >
        4234                                                    
        4235         <xsl:if 
        4236          test="$id/ @extension "
        4237         >
        4238                                                              
        4239          <xsl:value -of 
        4240           select="$i d/@extensi on" 
        4241          />
        4242                                                     
        4243         </xsl:if>
        4244                                                    
        4245         <xsl:text>
        4246           
        4247         </xsl:text >
        4248                                                    
        4249         <xsl:value -of 
        4250          select="$i d/@root" 
        4251         />
        4252                                            
        4253        </xsl:if>
        4254                                  
        4255       </xsl:othe rwise>
        4256                        
        4257      </xsl:choo se>
        4258              
        4259     </xsl:temp late>
        4260             
        4261     <!-- show- name -->
        4262             
        4263     <xsl:templ ate 
        4264      name="show -name"
        4265     >
        4266                       
        4267      <xsl:param  
        4268       name="name
        4269      />
        4270                       
        4271      <xsl:choos e>
        4272                                 
        4273       <xsl:when 
        4274        test="$nam e/n1:famil y"
        4275       >
        4276                                           
        4277        <xsl:if 
        4278         test="$nam e/n1:prefi x"
        4279        >
        4280                                                    
        4281         <xsl:value -of 
        4282          select="$n ame/n1:pre fix" 
        4283         />
        4284                                                    
        4285         <xsl:text>
        4286           
        4287         </xsl:text >
        4288                                            
        4289        </xsl:if>
        4290                                           
        4291        <xsl:value -of 
        4292         select="$n ame/n1:giv en" 
        4293        />
        4294                                           
        4295        <xsl:text>
        4296          
        4297        </xsl:text >
        4298                                           
        4299        <xsl:value -of 
        4300         select="$n ame/n1:fam ily" 
        4301        />
        4302                                           
        4303        <xsl:if 
        4304         test="$nam e/n1:suffi x"
        4305        >
        4306                                                    
        4307         <xsl:text>
        4308         
        4309         </xsl:text >
        4310                                                    
        4311         <xsl:value -of 
        4312          select="$n ame/n1:suf fix" 
        4313         />
        4314                                            
        4315        </xsl:if>
        4316                                  
        4317       </xsl:when >
        4318                                 
        4319       <xsl:other wise>
        4320                                           
        4321        <xsl:value -of 
        4322         select="$n ame" 
        4323        />
        4324                                  
        4325       </xsl:othe rwise>
        4326                        
        4327      </xsl:choo se>
        4328              
        4329     </xsl:temp late>
        4330             
        4331     <!-- show- gender -->
        4332             
        4333     <xsl:templ ate 
        4334      name="show -gender"
        4335     >
        4336                       
        4337      <xsl:choos e>
        4338                                 
        4339       <xsl:when 
        4340        test="@cod e   = &apo s;M&apos;"
        4341       >
        4342                                           
        4343        <xsl:text>
        4344         Male
        4345        </xsl:text >
        4346                                  
        4347       </xsl:when >
        4348                                 
        4349       <xsl:when 
        4350        test="@cod e  = &apos ;F&apos;"
        4351       >
        4352                                           
        4353        <xsl:text>
        4354         Female
        4355        </xsl:text >
        4356                                  
        4357       </xsl:when >
        4358                                 
        4359       <xsl:when 
        4360        test="@cod e  = &apos ;U&apos;"
        4361       >
        4362                                           
        4363        <xsl:text>
        4364         Undifferen tiated
        4365        </xsl:text >
        4366                                  
        4367       </xsl:when >
        4368                        
        4369      </xsl:choo se>
        4370              
        4371     </xsl:temp late>
        4372             
        4373     <!-- show- race-ethni city -->
        4374             
        4375     <xsl:templ ate 
        4376      name="show -race-ethn icity"
        4377     >
        4378                       
        4379      <xsl:choos e>
        4380                                 
        4381       <xsl:when 
        4382        test="@dis playName"
        4383       >
        4384                                           
        4385        <xsl:value -of 
        4386         select="@d isplayName
        4387        />
        4388                                  
        4389       </xsl:when >
        4390                                 
        4391       <xsl:other wise>
        4392                                           
        4393        <xsl:value -of 
        4394         select="@c ode" 
        4395        />
        4396                                  
        4397       </xsl:othe rwise>
        4398                        
        4399      </xsl:choo se>
        4400              
        4401     </xsl:temp late>
        4402             
        4403     <!-- show- contactInf o -->
        4404             
        4405     <xsl:templ ate 
        4406      name="show -contactIn fo"
        4407     >
        4408                       
        4409      <xsl:param  
        4410       name="cont act" 
        4411      />
        4412                       
        4413      <xsl:call- template 
        4414       name="show -address"
        4415      >
        4416                                 
        4417       <xsl:with- param 
        4418        name="addr ess" 
        4419        select="$c ontact/n1: addr" 
        4420       />
        4421                        
        4422      </xsl:call -template>
        4423                       
        4424      <xsl:call- template 
        4425       name="show -telecom"
        4426      >
        4427                                 
        4428       <xsl:with- param 
        4429        name="tele com" 
        4430        select="$c ontact/n1: telecom" 
        4431       />
        4432                        
        4433      </xsl:call -template>
        4434              
        4435     </xsl:temp late>
        4436             
        4437     <!-- show- address -- >
        4438             
        4439     <xsl:templ ate 
        4440      name="show -address"
        4441     >
        4442                       
        4443      <xsl:param  
        4444       name="addr ess" 
        4445      />
        4446                       
        4447      <xsl:choos e>
        4448                                 
        4449       <xsl:when 
        4450        test="$add ress"
        4451       >
        4452                                           
        4453        <xsl:if 
        4454         test="$add ress/@use"
        4455        >
        4456                                                    
        4457         <xsl:text>
        4458           
        4459         </xsl:text >
        4460                                                    
        4461         <xsl:call- template 
        4462          name="tran slateTelec omCode"
        4463         >
        4464                                                              
        4465          <xsl:with- param 
        4466           name="code
        4467           select="$a ddress/@us e" 
        4468          />
        4469                                                     
        4470         </xsl:call -template>
        4471                                                    
        4472         <xsl:text>
        4473          :
        4474         </xsl:text >
        4475                                                    
        4476         <br />
        4477                                            
        4478        </xsl:if>
        4479                                           
        4480        <xsl:for-e ach 
        4481         select="$a ddress/n1: streetAddr essLine"
        4482        >
        4483                                                    
        4484         <xsl:value -of 
        4485          select="."  
        4486         />
        4487                                                    
        4488         <br />
        4489                                            
        4490        </xsl:for- each>
        4491                                           
        4492        <xsl:if 
        4493         test="$add ress/n1:st reetName"
        4494        >
        4495                                                    
        4496         <xsl:value -of 
        4497          select="$a ddress/n1: streetName
        4498         />
        4499                                                    
        4500         <xsl:text>
        4501           
        4502         </xsl:text >
        4503                                                    
        4504         <xsl:value -of 
        4505          select="$a ddress/n1: houseNumbe r" 
        4506         />
        4507                                                    
        4508         <br />
        4509                                            
        4510        </xsl:if>
        4511                                           
        4512        <xsl:if 
        4513         test="stri ng-length( $address/n 1:city)>0"
        4514        >
        4515                                                    
        4516         <xsl:value -of 
        4517          select="$a ddress/n1: city" 
        4518         />
        4519                                            
        4520        </xsl:if>
        4521                                           
        4522        <xsl:if 
        4523         test="stri ng-length( $address/n 1:state)>0 "
        4524        >
        4525                                                    
        4526         <xsl:text>
        4527          ,&#160;
        4528         </xsl:text >
        4529                                                    
        4530         <xsl:value -of 
        4531          select="$a ddress/n1: state" 
        4532         />
        4533                                            
        4534        </xsl:if>
        4535                                           
        4536        <xsl:if 
        4537         test="stri ng-length( $address/n 1:postalCo de)>0"
        4538        >
        4539                                                    
        4540         <xsl:text>
        4541          &#160;
        4542         </xsl:text >
        4543                                                    
        4544         <xsl:value -of 
        4545          select="$a ddress/n1: postalCode
        4546         />
        4547                                            
        4548        </xsl:if>
        4549                                           
        4550        <xsl:if 
        4551         test="stri ng-length( $address/n 1:country) >0"
        4552        >
        4553                                                    
        4554         <xsl:text>
        4555          ,&#160;
        4556         </xsl:text >
        4557                                                    
        4558         <xsl:value -of 
        4559          select="$a ddress/n1: country" 
        4560         />
        4561                                            
        4562        </xsl:if>
        4563                                  
        4564       </xsl:when >
        4565                                 
        4566       <xsl:other wise>
        4567                                           
        4568        <xsl:text>
        4569         address no t availabl e
        4570        </xsl:text >
        4571                                  
        4572       </xsl:othe rwise>
        4573                        
        4574      </xsl:choo se>
        4575                       
        4576      <br />
        4577              
        4578     </xsl:temp late>
        4579             
        4580     <!-- show- telecom -- >
        4581             
        4582     <xsl:templ ate 
        4583      name="show -telecom"
        4584     >
        4585                       
        4586      <xsl:param  
        4587       name="tele com" 
        4588      />
        4589                       
        4590      <xsl:choos e>
        4591                                 
        4592       <xsl:when 
        4593        test="$tel ecom"
        4594       >
        4595                                           
        4596        <xsl:varia ble 
        4597         name="type "
        4598                                                   
        4599         select="su bstring-be fore($tele com/@value , ':')" 
        4600        />
        4601                                           
        4602        <xsl:varia ble 
        4603         name="valu e"
        4604                                                   
        4605         select="su bstring-af ter($telec om/@value,  ':')" 
        4606        />
        4607                                           
        4608        <xsl:if 
        4609         test="$typ e"
        4610        >
        4611                                                    
        4612         <xsl:call- template 
        4613          name="tran slateTelec omCode"
        4614         >
        4615                                                              
        4616          <xsl:with- param 
        4617           name="code
        4618           select="$t ype" 
        4619          />
        4620                                                     
        4621         </xsl:call -template>
        4622                                                    
        4623         <xsl:if 
        4624          test="@use "
        4625         >
        4626                                                              
        4627          <xsl:text>
        4628            (
        4629          </xsl:text >
        4630                                                              
        4631          <xsl:call- template 
        4632           name="tran slateTelec omCode"
        4633          >
        4634                                                                        
        4635           <xsl:with- param 
        4636            name="code
        4637            select="@u se" 
        4638           />
        4639                                                               
        4640          </xsl:call -template>
        4641                                                              
        4642          <xsl:text>
        4643           )
        4644          </xsl:text >
        4645                                                     
        4646         </xsl:if>
        4647                                                    
        4648         <xsl:text>
        4649         
        4650         </xsl:text >
        4651                                                    
        4652         <xsl:text>
        4653           
        4654         </xsl:text >
        4655                                                    
        4656         <xsl:value -of 
        4657          select="$v alue" 
        4658         />
        4659                                            
        4660        </xsl:if>
        4661                                  
        4662       </xsl:when >
        4663                                 
        4664       <xsl:other wise>
        4665                                           
        4666        <xsl:text>
        4667         Telecom in formation  not availa ble
        4668        </xsl:text >
        4669                                  
        4670       </xsl:othe rwise>
        4671                        
        4672      </xsl:choo se>
        4673                       
        4674      <br />
        4675              
        4676     </xsl:temp late>
        4677             
        4678     <!-- show- recipientT ype -->
        4679             
        4680     <xsl:templ ate 
        4681      name="show -recipient Type"
        4682     >
        4683                       
        4684      <xsl:param  
        4685       name="type Code" 
        4686      />
        4687                       
        4688      <xsl:choos e>
        4689                                 
        4690       <xsl:when 
        4691        test="$typ eCode='PRC P'"
        4692       >
        4693                                           Primary  Recipient:
        4694                                  
        4695       </xsl:when >
        4696                                 
        4697       <xsl:when 
        4698        test="$typ eCode='TRC '"
        4699       >
        4700                                           Secondar y Recipien t:
        4701                                  
        4702       </xsl:when >
        4703                                 
        4704       <xsl:other wise>
        4705                                           Recipien t:
        4706                                  
        4707       </xsl:othe rwise>
        4708                        
        4709      </xsl:choo se>
        4710              
        4711     </xsl:temp late>
        4712             
        4713     <!-- Conve rt Telecom  URL to di splay text  -->
        4714             
        4715     <xsl:templ ate 
        4716      name="tran slateTelec omCode"
        4717     >
        4718                       
        4719      <xsl:param  
        4720       name="code
        4721      />
        4722                       
        4723      <!--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"/ -->
        4724                       
        4725      <!--xsl:va lue-of sel ect="docum ent('codes .xml')/*/c ode[@code= $code]/@di splay"/ -- >
        4726                       
        4727      <xsl:choos e>
        4728                                 
        4729       <!-- looku p table Te lecom URI  -->
        4730                                 
        4731       <xsl:when 
        4732        test="$cod e='tel'"
        4733       >
        4734                                           
        4735        <xsl:text>
        4736         Tel
        4737        </xsl:text >
        4738                                  
        4739       </xsl:when >
        4740                                 
        4741       <xsl:when 
        4742        test="$cod e='fax'"
        4743       >
        4744                                           
        4745        <xsl:text>
        4746         Fax
        4747        </xsl:text >
        4748                                  
        4749       </xsl:when >
        4750                                 
        4751       <xsl:when 
        4752        test="$cod e='http'"
        4753       >
        4754                                           
        4755        <xsl:text>
        4756         Web
        4757        </xsl:text >
        4758                                  
        4759       </xsl:when >
        4760                                 
        4761       <xsl:when 
        4762        test="$cod e='mailto' "
        4763       >
        4764                                           
        4765        <xsl:text>
        4766         Mail
        4767        </xsl:text >
        4768                                  
        4769       </xsl:when >
        4770                                 
        4771       <xsl:when 
        4772        test="$cod e='H'"
        4773       >
        4774                                           
        4775        <xsl:text>
        4776         Home
        4777        </xsl:text >
        4778                                  
        4779       </xsl:when >
        4780                                 
        4781       <xsl:when 
        4782        test="$cod e='HV'"
        4783       >
        4784                                           
        4785        <xsl:text>
        4786         Vacation H ome
        4787        </xsl:text >
        4788                                  
        4789       </xsl:when >
        4790                                 
        4791       <xsl:when 
        4792        test="$cod e='HP'"
        4793       >
        4794                                           
        4795        <xsl:text>
        4796         Pirmary Ho me
        4797        </xsl:text >
        4798                                  
        4799       </xsl:when >
        4800                                 
        4801       <xsl:when 
        4802        test="$cod e='WP'"
        4803       >
        4804                                           
        4805        <xsl:text>
        4806         Work Place
        4807        </xsl:text >
        4808                                  
        4809       </xsl:when >
        4810                                 
        4811       <xsl:when 
        4812        test="$cod e='PUB'"
        4813       >
        4814                                           
        4815        <xsl:text>
        4816         Pub
        4817        </xsl:text >
        4818                                  
        4819       </xsl:when >
        4820                                 
        4821       <xsl:other wise>
        4822                                           
        4823        <xsl:text>
        4824         {$code='
        4825        </xsl:text >
        4826                                           
        4827        <xsl:value -of 
        4828         select="$c ode" 
        4829        />
        4830                                           
        4831        <xsl:text>
        4832         '?}
        4833        </xsl:text >
        4834                                  
        4835       </xsl:othe rwise>
        4836                        
        4837      </xsl:choo se>
        4838              
        4839     </xsl:temp late>
        4840             
        4841     <!-- conve rt RoleCla ssAssociat ive code t o display  text -->
        4842             
        4843     <xsl:templ ate 
        4844      name="tran slateRoleA ssoCode"
        4845     >
        4846                       
        4847      <xsl:param  
        4848       name="clas sCode" 
        4849      />
        4850                       
        4851      <xsl:param  
        4852       name="code
        4853      />
        4854                       
        4855      <xsl:choos e>
        4856                                 
        4857       <xsl:when 
        4858        test="$cla ssCode='AF FL'"
        4859       >
        4860                                           
        4861        <xsl:text>
        4862         affiliate
        4863        </xsl:text >
        4864                                  
        4865       </xsl:when >
        4866                                 
        4867       <xsl:when 
        4868        test="$cla ssCode='AG NT'"
        4869       >
        4870                                           
        4871        <xsl:text>
        4872         agent
        4873        </xsl:text >
        4874                                  
        4875       </xsl:when >
        4876                                 
        4877       <xsl:when 
        4878        test="$cla ssCode='AS SIGNED'"
        4879       >
        4880                                           
        4881        <xsl:text>
        4882         assigned e ntity
        4883        </xsl:text >
        4884                                  
        4885       </xsl:when >
        4886                                 
        4887       <xsl:when 
        4888        test="$cla ssCode='CO MPAR'"
        4889       >
        4890                                           
        4891        <xsl:text>
        4892         commission ing party
        4893        </xsl:text >
        4894                                  
        4895       </xsl:when >
        4896                                 
        4897       <xsl:when 
        4898        test="$cla ssCode='CO N'"
        4899       >
        4900                                           
        4901        <xsl:text>
        4902         contact
        4903        </xsl:text >
        4904                                  
        4905       </xsl:when >
        4906                                 
        4907       <xsl:when 
        4908        test="$cla ssCode='EC ON'"
        4909       >
        4910                                           
        4911        <xsl:text>
        4912         emergency  contact
        4913        </xsl:text >
        4914                                  
        4915       </xsl:when >
        4916                                 
        4917       <xsl:when 
        4918        test="$cla ssCode='NO K'"
        4919       >
        4920                                           
        4921        <xsl:text>
        4922         next of ki n
        4923        </xsl:text >
        4924                                  
        4925       </xsl:when >
        4926                                 
        4927       <xsl:when 
        4928        test="$cla ssCode='SG NOFF'"
        4929       >
        4930                                           
        4931        <xsl:text>
        4932         signing au thority
        4933        </xsl:text >
        4934                                  
        4935       </xsl:when >
        4936                                 
        4937       <xsl:when 
        4938        test="$cla ssCode='GU ARD'"
        4939       >
        4940                                           
        4941        <xsl:text>
        4942         guardian
        4943        </xsl:text >
        4944                                  
        4945       </xsl:when >
        4946                                 
        4947       <xsl:when 
        4948        test="$cla ssCode='GU AR'"
        4949       >
        4950                                           
        4951        <xsl:text>
        4952         guardian
        4953        </xsl:text >
        4954                                  
        4955       </xsl:when >
        4956                                 
        4957       <xsl:when 
        4958        test="$cla ssCode='CI T'"
        4959       >
        4960                                           
        4961        <xsl:text>
        4962         citizen
        4963        </xsl:text >
        4964                                  
        4965       </xsl:when >
        4966                                 
        4967       <xsl:when 
        4968        test="$cla ssCode='CO VPTY'"
        4969       >
        4970                                           
        4971        <xsl:text>
        4972         covered pa rty
        4973        </xsl:text >
        4974                                  
        4975       </xsl:when >
        4976                                 
        4977       <xsl:when 
        4978        test="$cla ssCode='PR S'"
        4979       >
        4980                                           
        4981        <xsl:text>
        4982         personal r elationshi p
        4983        </xsl:text >
        4984                                  
        4985       </xsl:when >
        4986                                 
        4987       <xsl:when 
        4988        test="$cla ssCode='CA REGIVER'"
        4989       >
        4990                                           
        4991        <xsl:text>
        4992         care giver
        4993        </xsl:text >
        4994                                  
        4995       </xsl:when >
        4996                                 
        4997       <xsl:other wise>
        4998                                           
        4999        <xsl:text>
        5000         {$classCod e='
        5001        </xsl:text >
        5002                                           
        5003        <xsl:value -of 
        5004         select="$c lassCode" 
        5005        />
        5006                                           
        5007        <xsl:text>
        5008         '?}
        5009        </xsl:text >
        5010                                  
        5011       </xsl:othe rwise>
        5012                        
        5013      </xsl:choo se>
        5014                       
        5015      <xsl:if
        5016                                
        5017       test="($co de/@code)  and ($code /@codeSyst em='2.16.8 40.1.11388 3.5.111')"
        5018      >
        5019                                 
        5020       <xsl:text>
        5021         
        5022       </xsl:text >
        5023                                 
        5024       <xsl:choos e>
        5025                                           
        5026        <xsl:when 
        5027         test="$cod e/@code='F TH'"
        5028        >
        5029                                                    
        5030         <xsl:text>
        5031          (Father)
        5032         </xsl:text >
        5033                                            
        5034        </xsl:when >
        5035                                           
        5036        <xsl:when 
        5037         test="$cod e/@code='M TH'"
        5038        >
        5039                                                    
        5040         <xsl:text>
        5041          (Mother)
        5042         </xsl:text >
        5043                                            
        5044        </xsl:when >
        5045                                           
        5046        <xsl:when 
        5047         test="$cod e/@code='N PRN'"
        5048        >
        5049                                                    
        5050         <xsl:text>
        5051          (Natural p arent)
        5052         </xsl:text >
        5053                                            
        5054        </xsl:when >
        5055                                           
        5056        <xsl:when 
        5057         test="$cod e/@code='S TPPRN'"
        5058        >
        5059                                                    
        5060         <xsl:text>
        5061          (Step pare nt)
        5062         </xsl:text >
        5063                                            
        5064        </xsl:when >
        5065                                           
        5066        <xsl:when 
        5067         test="$cod e/@code='S ONC'"
        5068        >
        5069                                                    
        5070         <xsl:text>
        5071          (Son)
        5072         </xsl:text >
        5073                                            
        5074        </xsl:when >
        5075                                           
        5076        <xsl:when 
        5077         test="$cod e/@code='D AUC'"
        5078        >
        5079                                                    
        5080         <xsl:text>
        5081          (Daughter)
        5082         </xsl:text >
        5083                                            
        5084        </xsl:when >
        5085                                           
        5086        <xsl:when 
        5087         test="$cod e/@code='C HILD'"
        5088        >
        5089                                                    
        5090         <xsl:text>
        5091          (Child)
        5092         </xsl:text >
        5093                                            
        5094        </xsl:when >
        5095                                           
        5096        <xsl:when 
        5097         test="$cod e/@code='E XT'"
        5098        >
        5099                                                    
        5100         <xsl:text>
        5101          (Extended  family mem ber)
        5102         </xsl:text >
        5103                                            
        5104        </xsl:when >
        5105                                           
        5106        <xsl:when 
        5107         test="$cod e/@code='N BOR'"
        5108        >
        5109                                                    
        5110         <xsl:text>
        5111          (Neighbor)
        5112         </xsl:text >
        5113                                            
        5114        </xsl:when >
        5115                                           
        5116        <xsl:when 
        5117         test="$cod e/@code='S IGOTHR'"
        5118        >
        5119                                                    
        5120         <xsl:text>
        5121          (Significa nt other)
        5122         </xsl:text >
        5123                                            
        5124        </xsl:when >
        5125                                           
        5126        <xsl:when 
        5127         test="$cod e/@code='U NK'"
        5128        >
        5129                                                    
        5130         <xsl:text>
        5131          (Unknown r elation)
        5132         </xsl:text >
        5133                                            
        5134        </xsl:when >
        5135                                           
        5136        <xsl:other wise>
        5137                                                    
        5138         <xsl:text>
        5139          {$code/@co de='
        5140         </xsl:text >
        5141                                                    
        5142         <xsl:value -of 
        5143          select="$c ode/@code"  
        5144         />
        5145                                                    
        5146         <xsl:text>
        5147          '?}
        5148         </xsl:text >
        5149                                            
        5150        </xsl:othe rwise>
        5151                                  
        5152       </xsl:choo se>
        5153                        
        5154      </xsl:if>
        5155              
        5156     </xsl:temp late>
        5157             
        5158     <!-- show  time -->
        5159             
        5160     <xsl:templ ate 
        5161      name="show -time"
        5162     >
        5163                       
        5164      <xsl:param  
        5165       name="date time" 
        5166      />
        5167                       
        5168      <xsl:choos e>
        5169                                 
        5170       <xsl:when 
        5171        test="not( $datetime) "
        5172       >
        5173                                           
        5174        <xsl:call- template 
        5175         name="form atDateTime "
        5176        >
        5177                                                    
        5178         <xsl:with- param 
        5179          name="date
        5180          select="@v alue" 
        5181         />
        5182                                            
        5183        </xsl:call -template>
        5184                                           
        5185        <xsl:text>
        5186          
        5187        </xsl:text >
        5188                                  
        5189       </xsl:when >
        5190                                 
        5191       <xsl:other wise>
        5192                                           
        5193        <xsl:call- template 
        5194         name="form atDateTime "
        5195        >
        5196                                                    
        5197         <xsl:with- param 
        5198          name="date
        5199          select="$d atetime/@v alue" 
        5200         />
        5201                                            
        5202        </xsl:call -template>
        5203                                           
        5204        <xsl:text>
        5205          
        5206        </xsl:text >
        5207                                  
        5208       </xsl:othe rwise>
        5209                        
        5210      </xsl:choo se>
        5211              
        5212     </xsl:temp late>
        5213             
        5214     <!-- patic ipant faci lity and d ate -->
        5215             
        5216     <xsl:templ ate 
        5217      name="faci lityAndDat es"
        5218     >
        5219                       
        5220      <table 
        5221       class="hea der_table"
        5222      >
        5223                                 
        5224       <tbody>
        5225                                           
        5226        <!-- facil ity id -->
        5227                                           
        5228        <tr>
        5229                                                    
        5230         <td 
        5231          width="20%
        5232          bgcolor="# 3399ff"
        5233         >
        5234                                                              
        5235          <span 
        5236           class="td_ label"
        5237          >
        5238                                                                        
        5239           <xsl:text>
        5240            Facility I D
        5241           </xsl:text >
        5242                                                               
        5243          </span>
        5244                                                     
        5245         </td>
        5246                                                    
        5247         <td 
        5248          colspan="3 "
        5249         >
        5250                                                              
        5251          <xsl:choos e>
        5252                                                                        
        5253           <xsl:when
        5254                                                                                 
        5255            test="coun t(/n1:Clin icalDocume nt/n1:part icipant
        5256                                                     [@ typeCode=' LOC'][@con textContro lCode='OP' ]
        5257                                                     /n 1:associat edEntity[@ classCode= 'SDLOC']/n 1:id)&gt;0 "
        5258           >
        5259                                                                                  
        5260            <!-- chang e context  node -->
        5261                                                                                  
        5262            <xsl:for-e ach
        5263                                                                                           
        5264             select="/n 1:Clinical Document/n 1:particip ant
        5265                                                      [@ typeCode=' LOC'][@con textContro lCode='OP' ]
        5266                                                      /n 1:associat edEntity[@ classCode= 'SDLOC']/n 1:id"
        5267            >
        5268                                                                                            
        5269             <xsl:call- template 
        5270              name="show -id" 
        5271             />
        5272                                                                                            
        5273             <!-- chang e context  node again , for the  code -->
        5274                                                                                            
        5275             <xsl:for-e ach 
        5276              select=".. /n1:code"
        5277             >
        5278                                                                                                     
        5279              <xsl:text>
        5280                (
        5281              </xsl:text >
        5282                                                                                                     
        5283              <xsl:call- template 
        5284               name="show -code"
        5285              >
        5286                                                                                                               
        5287               <xsl:with- param 
        5288                name="code
        5289                select="."  
        5290               />
        5291                                                                                                      
        5292              </xsl:call -template>
        5293                                                                                                     
        5294              <xsl:text>
        5295               )
        5296              </xsl:text >
        5297                                                                                             
        5298             </xsl:for- each>
        5299                                                                                   
        5300            </xsl:for- each>
        5301                                                                         
        5302           </xsl:when >
        5303                                                                        
        5304           <xsl:other wise>
        5305                                                                                  Not av ailable
        5306                                                                         
        5307           </xsl:othe rwise>
        5308                                                               
        5309          </xsl:choo se>
        5310                                                     
        5311         </td>
        5312                                            
        5313        </tr>
        5314                                           
        5315        <!-- Perio d reported  -->
        5316                                           
        5317        <tr>
        5318                                                    
        5319         <td 
        5320          width="20%
        5321          bgcolor="# 3399ff"
        5322         >
        5323                                                              
        5324          <span 
        5325           class="td_ label"
        5326          >
        5327                                                                        
        5328           <xsl:text>
        5329            First day  of period  reported
        5330           </xsl:text >
        5331                                                               
        5332          </span>
        5333                                                     
        5334         </td>
        5335                                                    
        5336         <td 
        5337          colspan="3 "
        5338         >
        5339                                                              
        5340          <xsl:call- template 
        5341           name="show -time"
        5342          >
        5343                                                                        
        5344           <xsl:with- param 
        5345            name="date time"
        5346                                                                                 
        5347            select="/n 1:Clinical Document/n 1:document ationOf
        5348                                                     /n 1:serviceE vent/n1:ef fectiveTim e/n1:low" 
        5349           />
        5350                                                               
        5351          </xsl:call -template>
        5352                                                     
        5353         </td>
        5354                                            
        5355        </tr>
        5356                                           
        5357        <tr>
        5358                                                    
        5359         <td 
        5360          width="20%
        5361          bgcolor="# 3399ff"
        5362         >
        5363                                                              
        5364          <span 
        5365           class="td_ label"
        5366          >
        5367                                                                        
        5368           <xsl:text>
        5369            Last day o f period r eported
        5370           </xsl:text >
        5371                                                               
        5372          </span>
        5373                                                     
        5374         </td>
        5375                                                    
        5376         <td 
        5377          colspan="3 "
        5378         >
        5379                                                              
        5380          <xsl:call- template 
        5381           name="show -time"
        5382          >
        5383                                                                        
        5384           <xsl:with- param 
        5385            name="date time"
        5386                                                                                 
        5387            select="/n 1:Clinical Document/n 1:document ationOf
        5388                                                     /n 1:serviceE vent/n1:ef fectiveTim e/n1:high"  
        5389           />
        5390                                                               
        5391          </xsl:call -template>
        5392                                                     
        5393         </td>
        5394                                            
        5395        </tr>
        5396                                  
        5397       </tbody>
        5398                        
        5399      </table>
        5400              
        5401     </xsl:temp late>
        5402             
        5403     <!-- show  assignedEn tity -->
        5404             
        5405     <xsl:templ ate 
        5406      name="show -assignedE ntity"
        5407     >
        5408                       
        5409      <xsl:param  
        5410       name="asgn Entity" 
        5411      />
        5412                       
        5413      <xsl:choos e>
        5414                                 
        5415       <xsl:when 
        5416        test="$asg nEntity/n1 :assignedP erson/n1:n ame"
        5417       >
        5418                                           
        5419        <xsl:call- template 
        5420         name="show -name"
        5421        >
        5422                                                    
        5423         <xsl:with- param 
        5424          name="name "
        5425                                                             
        5426          select="$a sgnEntity/ n1:assigne dPerson/n1 :name" 
        5427         />
        5428                                            
        5429        </xsl:call -template>
        5430                                           
        5431        <xsl:if 
        5432         test="$asg nEntity/n1 :represent edOrganiza tion/n1:na me"
        5433        >
        5434                                                    
        5435         <xsl:text>
        5436           of 
        5437         </xsl:text >
        5438                                                    
        5439         <xsl:value -of 
        5440          select="$a sgnEntity/ n1:represe ntedOrgani zation/n1: name" 
        5441         />
        5442                                            
        5443        </xsl:if>
        5444                                  
        5445       </xsl:when >
        5446                                 
        5447       <xsl:when 
        5448        test="$asg nEntity/n1 :represent edOrganiza tion"
        5449       >
        5450                                           
        5451        <xsl:value -of 
        5452         select="$a sgnEntity/ n1:represe ntedOrgani zation/n1: name" 
        5453        />
        5454                                  
        5455       </xsl:when >
        5456                                 
        5457       <xsl:other wise>
        5458                                           
        5459        <xsl:for-e ach 
        5460         select="$a sgnEntity/ n1:id"
        5461        >
        5462                                                    
        5463         <xsl:call- template 
        5464          name="show -id" 
        5465         />
        5466                                                    
        5467         <xsl:choos e>
        5468                                                              
        5469          <xsl:when 
        5470           test="posi tion()!=la st()"
        5471          >
        5472                                                                        
        5473           <xsl:text>
        5474           
        5475           </xsl:text >
        5476                                                               
        5477          </xsl:when >
        5478                                                              
        5479          <xsl:other wise>
        5480                                                                        
        5481           <br />
        5482                                                               
        5483          </xsl:othe rwise>
        5484                                                     
        5485         </xsl:choo se>
        5486                                            
        5487        </xsl:for- each>
        5488                                  
        5489       </xsl:othe rwise>
        5490                        
        5491      </xsl:choo se>
        5492              
        5493     </xsl:temp late>
        5494             
        5495     <!-- show  relatedEnt ity -->
        5496             
        5497     <xsl:templ ate 
        5498      name="show -relatedEn tity"
        5499     >
        5500                       
        5501      <xsl:param  
        5502       name="rela tedEntity"  
        5503      />
        5504                       
        5505      <xsl:choos e>
        5506                                 
        5507       <xsl:when 
        5508        test="$rel atedEntity /n1:relate dPerson/n1 :name"
        5509       >
        5510                                           
        5511        <xsl:call- template 
        5512         name="show -name"
        5513        >
        5514                                                    
        5515         <xsl:with- param 
        5516          name="name "
        5517                                                             
        5518          select="$r elatedEnti ty/n1:rela tedPerson/ n1:name" 
        5519         />
        5520                                            
        5521        </xsl:call -template>
        5522                                  
        5523       </xsl:when >
        5524                        
        5525      </xsl:choo se>
        5526              
        5527     </xsl:temp late>
        5528             
        5529     <!-- show  associated Entity -->
        5530             
        5531     <xsl:templ ate 
        5532      name="show -associate dEntity"
        5533     >
        5534                       
        5535      <xsl:param  
        5536       name="asso Entity" 
        5537      />
        5538                       
        5539      <xsl:choos e>
        5540                                 
        5541       <xsl:when 
        5542        test="$ass oEntity/n1 :associate dPerson"
        5543       >
        5544                                           
        5545        <xsl:for-e ach 
        5546         select="$a ssoEntity/ n1:associa tedPerson/ n1:name"
        5547        >
        5548                                                    
        5549         <xsl:call- template 
        5550          name="show -name"
        5551         >
        5552                                                              
        5553          <xsl:with- param 
        5554           name="name
        5555           select="."  
        5556          />
        5557                                                     
        5558         </xsl:call -template>
        5559                                                    
        5560         <br />
        5561                                            
        5562        </xsl:for- each>
        5563                                  
        5564       </xsl:when >
        5565                                 
        5566       <xsl:when 
        5567        test="$ass oEntity/n1 :scopingOr ganization "
        5568       >
        5569                                           
        5570        <xsl:for-e ach 
        5571         select="$a ssoEntity/ n1:scoping Organizati on"
        5572        >
        5573                                                    
        5574         <xsl:if 
        5575          test="n1:n ame"
        5576         >
        5577                                                              
        5578          <xsl:call- template 
        5579           name="show -name"
        5580          >
        5581                                                                        
        5582           <xsl:with- param 
        5583            name="name
        5584            select="n1 :name" 
        5585           />
        5586                                                               
        5587          </xsl:call -template>
        5588                                                              
        5589          <br />
        5590                                                     
        5591         </xsl:if>
        5592                                                    
        5593         <xsl:if 
        5594          test="n1:s tandardInd ustryClass Code"
        5595         >
        5596                                                              
        5597          <xsl:value -of 
        5598           select="n1 :standardI ndustryCla ssCode/@di splayName"  
        5599          />
        5600                                                              
        5601          <xsl:text>
        5602            code:
        5603          </xsl:text >
        5604                                                              
        5605          <xsl:value -of 
        5606           select="n1 :standardI ndustryCla ssCode/@co de" 
        5607          />
        5608                                                     
        5609         </xsl:if>
        5610                                            
        5611        </xsl:for- each>
        5612                                  
        5613       </xsl:when >
        5614                                 
        5615       <xsl:when 
        5616        test="$ass oEntity/n1 :code"
        5617       >
        5618                                           
        5619        <xsl:call- template 
        5620         name="show -code"
        5621        >
        5622                                                    
        5623         <xsl:with- param 
        5624          name="code
        5625          select="$a ssoEntity/ n1:code" 
        5626         />
        5627                                            
        5628        </xsl:call -template>
        5629                                  
        5630       </xsl:when >
        5631                                 
        5632       <xsl:when 
        5633        test="$ass oEntity/n1 :id"
        5634       >
        5635                                           
        5636        <xsl:value -of 
        5637         select="$a ssoEntity/ n1:id/@ext ension" 
        5638        />
        5639                                           
        5640        <xsl:text>
        5641          
        5642        </xsl:text >
        5643                                           
        5644        <xsl:value -of 
        5645         select="$a ssoEntity/ n1:id/@roo t" 
        5646        />
        5647                                  
        5648       </xsl:when >
        5649                        
        5650      </xsl:choo se>
        5651              
        5652     </xsl:temp late>
        5653             
        5654     <!-- show  code if or iginalText  present,  return it,  otherwise , check an
        5655                      retu rn attribu te: displa y name -->
        5656             
        5657     <xsl:templ ate 
        5658      name="show -code"
        5659     >
        5660                       
        5661      <xsl:param  
        5662       name="code
        5663      />
        5664                       
        5665      <xsl:varia ble 
        5666       name="this -codeSyste m"
        5667      >
        5668                                 
        5669       <xsl:value -of 
        5670        select="$c ode/@codeS ystem" 
        5671       />
        5672                        
        5673      </xsl:vari able>
        5674                       
        5675      <xsl:varia ble 
        5676       name="this -code"
        5677      >
        5678                                 
        5679       <xsl:value -of 
        5680        select="$c ode/@code"  
        5681       />
        5682                        
        5683      </xsl:vari able>
        5684                       
        5685      <xsl:choos e>
        5686                                 
        5687       <xsl:when 
        5688        test="$cod e/n1:origi nalText"
        5689       >
        5690                                           
        5691        <xsl:value -of 
        5692         select="$c ode/n1:ori ginalText"  
        5693        />
        5694                                  
        5695       </xsl:when >
        5696                                 
        5697       <xsl:when 
        5698        test="$cod e/@display Name"
        5699       >
        5700                                           
        5701        <xsl:value -of 
        5702         select="$c ode/@displ ayName" 
        5703        />
        5704                                  
        5705       </xsl:when >
        5706                                 
        5707       <!-- <xsl: when test= "$the-valu esets/*/vo c:system[@ root=$this -codeSyste m]/voc:cod e[@value=$ this-code] /@displayN ame"> 
        5708                                          <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"/> 
        5709                                          </xsl:wh en> -->
        5710                                 
        5711       <xsl:other wise>
        5712                                           
        5713        <xsl:value -of 
        5714         select="$t his-code" 
        5715        />
        5716                                  
        5717       </xsl:othe rwise>
        5718                        
        5719      </xsl:choo se>
        5720              
        5721     </xsl:temp late>
        5722             
        5723     <!-- show  classCode  -->
        5724             
        5725     <xsl:templ ate 
        5726      name="show -actClassC ode"
        5727     >
        5728                       
        5729      <xsl:param  
        5730       name="clsC ode" 
        5731      />
        5732                       
        5733      <xsl:choos e>
        5734                                 
        5735       <xsl:when 
        5736        test=" $cl sCode = 'A CT' "
        5737       >
        5738                                           
        5739        <xsl:text>
        5740         healthcare  service
        5741        </xsl:text >
        5742                                  
        5743       </xsl:when >
        5744                                 
        5745       <xsl:when 
        5746        test=" $cl sCode = 'A CCM' "
        5747       >
        5748                                           
        5749        <xsl:text>
        5750         accommodat ion
        5751        </xsl:text >
        5752                                  
        5753       </xsl:when >
        5754                                 
        5755       <xsl:when 
        5756        test=" $cl sCode = 'A CCT' "
        5757       >
        5758                                           
        5759        <xsl:text>
        5760         account
        5761        </xsl:text >
        5762                                  
        5763       </xsl:when >
        5764                                 
        5765       <xsl:when 
        5766        test=" $cl sCode = 'A CSN' "
        5767       >
        5768                                           
        5769        <xsl:text>
        5770         accession
        5771        </xsl:text >
        5772                                  
        5773       </xsl:when >
        5774                                 
        5775       <xsl:when 
        5776        test=" $cl sCode = 'A DJUD' "
        5777       >
        5778                                           
        5779        <xsl:text>
        5780         financial  adjudicati on
        5781        </xsl:text >
        5782                                  
        5783       </xsl:when >
        5784                                 
        5785       <xsl:when 
        5786        test=" $cl sCode = 'C ONS' "
        5787       >
        5788                                           
        5789        <xsl:text>
        5790         consent
        5791        </xsl:text >
        5792                                  
        5793       </xsl:when >
        5794                                 
        5795       <xsl:when 
        5796        test=" $cl sCode = 'C ONTREG' "
        5797       >
        5798                                           
        5799        <xsl:text>
        5800         container  registrati on
        5801        </xsl:text >
        5802                                  
        5803       </xsl:when >
        5804                                 
        5805       <xsl:when 
        5806        test=" $cl sCode = 'C TTEVENT' "
        5807       >
        5808                                           
        5809        <xsl:text>
        5810         clinical t rial timep oint event
        5811        </xsl:text >
        5812                                  
        5813       </xsl:when >
        5814                                 
        5815       <xsl:when 
        5816        test=" $cl sCode = 'D ISPACT' "
        5817       >
        5818                                           
        5819        <xsl:text>
        5820         disciplina ry action
        5821        </xsl:text >
        5822                                  
        5823       </xsl:when >
        5824                                 
        5825       <xsl:when 
        5826        test=" $cl sCode = 'E NC' "
        5827       >
        5828                                           
        5829        <xsl:text>
        5830         encounter
        5831        </xsl:text >
        5832                                  
        5833       </xsl:when >
        5834                                 
        5835       <xsl:when 
        5836        test=" $cl sCode = 'I NC' "
        5837       >
        5838                                           
        5839        <xsl:text>
        5840         incident
        5841        </xsl:text >
        5842                                  
        5843       </xsl:when >
        5844                                 
        5845       <xsl:when 
        5846        test=" $cl sCode = 'I NFRM' "
        5847       >
        5848                                           
        5849        <xsl:text>
        5850         inform
        5851        </xsl:text >
        5852                                  
        5853       </xsl:when >
        5854                                 
        5855       <xsl:when 
        5856        test=" $cl sCode = 'I NVE' "
        5857       >
        5858                                           
        5859        <xsl:text>
        5860         invoice el ement
        5861        </xsl:text >
        5862                                  
        5863       </xsl:when >
        5864                                 
        5865       <xsl:when 
        5866        test=" $cl sCode = 'L IST' "
        5867       >
        5868                                           
        5869        <xsl:text>
        5870         working li st
        5871        </xsl:text >
        5872                                  
        5873       </xsl:when >
        5874                                 
        5875       <xsl:when 
        5876        test=" $cl sCode = 'M PROT' "
        5877       >
        5878                                           
        5879        <xsl:text>
        5880         monitoring  program
        5881        </xsl:text >
        5882                                  
        5883       </xsl:when >
        5884                                 
        5885       <xsl:when 
        5886        test=" $cl sCode = 'P CPR' "
        5887       >
        5888                                           
        5889        <xsl:text>
        5890         care provi sion
        5891        </xsl:text >
        5892                                  
        5893       </xsl:when >
        5894                                 
        5895       <xsl:when 
        5896        test=" $cl sCode = 'P ROC' "
        5897       >
        5898                                           
        5899        <xsl:text>
        5900         procedure
        5901        </xsl:text >
        5902                                  
        5903       </xsl:when >
        5904                                 
        5905       <xsl:when 
        5906        test=" $cl sCode = 'R EG' "
        5907       >
        5908                                           
        5909        <xsl:text>
        5910         registrati on
        5911        </xsl:text >
        5912                                  
        5913       </xsl:when >
        5914                                 
        5915       <xsl:when 
        5916        test=" $cl sCode = 'R EV' "
        5917       >
        5918                                           
        5919        <xsl:text>
        5920         review
        5921        </xsl:text >
        5922                                  
        5923       </xsl:when >
        5924                                 
        5925       <xsl:when 
        5926        test=" $cl sCode = 'S BADM' "
        5927       >
        5928                                           
        5929        <xsl:text>
        5930         substance  administra tion
        5931        </xsl:text >
        5932                                  
        5933       </xsl:when >
        5934                                 
        5935       <xsl:when 
        5936        test=" $cl sCode = 'S PCTRT' "
        5937       >
        5938                                           
        5939        <xsl:text>
        5940         speciment  treatment
        5941        </xsl:text >
        5942                                  
        5943       </xsl:when >
        5944                                 
        5945       <xsl:when 
        5946        test=" $cl sCode = 'S UBST' "
        5947       >
        5948                                           
        5949        <xsl:text>
        5950         substituti on
        5951        </xsl:text >
        5952                                  
        5953       </xsl:when >
        5954                                 
        5955       <xsl:when 
        5956        test=" $cl sCode = 'T RNS' "
        5957       >
        5958                                           
        5959        <xsl:text>
        5960         transporta tion
        5961        </xsl:text >
        5962                                  
        5963       </xsl:when >
        5964                                 
        5965       <xsl:when 
        5966        test=" $cl sCode = 'V ERIF' "
        5967       >
        5968                                           
        5969        <xsl:text>
        5970         verificati on
        5971        </xsl:text >
        5972                                  
        5973       </xsl:when >
        5974                                 
        5975       <xsl:when 
        5976        test=" $cl sCode = 'X ACT' "
        5977       >
        5978                                           
        5979        <xsl:text>
        5980         financial  transactio n
        5981        </xsl:text >
        5982                                  
        5983       </xsl:when >
        5984                        
        5985      </xsl:choo se>
        5986              
        5987     </xsl:temp late>
        5988             
        5989     <!-- show  participat ionType -- >
        5990             
        5991     <xsl:templ ate 
        5992      name="show -participa tionType"
        5993     >
        5994                       
        5995      <xsl:param  
        5996       name="ptyp e" 
        5997      />
        5998                       
        5999      <xsl:choos e>
        6000                                 
        6001       <xsl:when 
        6002        test=" $pt ype='PPRF'  "
        6003       >
        6004                                           
        6005        <xsl:text>
        6006         primary pe rformer
        6007        </xsl:text >
        6008                                  
        6009       </xsl:when >
        6010                                 
        6011       <xsl:when 
        6012        test=" $pt ype='PRF'  "
        6013       >
        6014                                           
        6015        <xsl:text>
        6016         performer
        6017        </xsl:text >
        6018                                  
        6019       </xsl:when >
        6020                                 
        6021       <xsl:when 
        6022        test=" $pt ype='VRF'  "
        6023       >
        6024                                           
        6025        <xsl:text>
        6026         verifier
        6027        </xsl:text >
        6028                                  
        6029       </xsl:when >
        6030                                 
        6031       <xsl:when 
        6032        test=" $pt ype='SPRF'  "
        6033       >
        6034                                           
        6035        <xsl:text>
        6036         secondary  performer
        6037        </xsl:text >
        6038                                  
        6039       </xsl:when >
        6040                        
        6041      </xsl:choo se>
        6042              
        6043     </xsl:temp late>
        6044             
        6045     <!-- show  participat ionFunctio n -->
        6046             
        6047     <xsl:templ ate 
        6048      name="show -participa tionFuncti on"
        6049     >
        6050                       
        6051      <xsl:param  
        6052       name="pFun ction" 
        6053      />
        6054                       
        6055      <xsl:choos e>
        6056                                 
        6057       <!-- From  the HL7 v3  Participa tionFuncti on code sy stem -->
        6058                                 
        6059       <xsl:when 
        6060        test=" $pF unction =  'ADMPHYS'  "
        6061       >
        6062                                           
        6063        <xsl:text>
        6064         (admitting  physician )
        6065        </xsl:text >
        6066                                  
        6067       </xsl:when >
        6068                                 
        6069       <xsl:when 
        6070        test=" $pF unction =  'ANEST' "
        6071       >
        6072                                           
        6073        <xsl:text>
        6074         (anesthesi st)
        6075        </xsl:text >
        6076                                  
        6077       </xsl:when >
        6078                                 
        6079       <xsl:when 
        6080        test=" $pF unction =  'ANRS' "
        6081       >
        6082                                           
        6083        <xsl:text>
        6084         (anesthesi a nurse)
        6085        </xsl:text >
        6086                                  
        6087       </xsl:when >
        6088                                 
        6089       <xsl:when 
        6090        test=" $pF unction =  'ATTPHYS'  "
        6091       >
        6092                                           
        6093        <xsl:text>
        6094         (attending  physician )
        6095        </xsl:text >
        6096                                  
        6097       </xsl:when >
        6098                                 
        6099       <xsl:when 
        6100        test=" $pF unction =  'DISPHYS'  "
        6101       >
        6102                                           
        6103        <xsl:text>
        6104         (dischargi ng physici an)
        6105        </xsl:text >
        6106                                  
        6107       </xsl:when >
        6108                                 
        6109       <xsl:when 
        6110        test=" $pF unction =  'FASST' "
        6111       >
        6112                                           
        6113        <xsl:text>
        6114         (first ass istant sur geon)
        6115        </xsl:text >
        6116                                  
        6117       </xsl:when >
        6118                                 
        6119       <xsl:when 
        6120        test=" $pF unction =  'MDWF' "
        6121       >
        6122                                           
        6123        <xsl:text>
        6124         (midwife)
        6125        </xsl:text >
        6126                                  
        6127       </xsl:when >
        6128                                 
        6129       <xsl:when 
        6130        test=" $pF unction =  'NASST' "
        6131       >
        6132                                           
        6133        <xsl:text>
        6134         (nurse ass istant)
        6135        </xsl:text >
        6136                                  
        6137       </xsl:when >
        6138                                 
        6139       <xsl:when 
        6140        test=" $pF unction =  'PCP' "
        6141       >
        6142                                           
        6143        <xsl:text>
        6144         (primary c are physic ian)
        6145        </xsl:text >
        6146                                  
        6147       </xsl:when >
        6148                                 
        6149       <xsl:when 
        6150        test=" $pF unction =  'PRISURG'  "
        6151       >
        6152                                           
        6153        <xsl:text>
        6154         (primary s urgeon)
        6155        </xsl:text >
        6156                                  
        6157       </xsl:when >
        6158                                 
        6159       <xsl:when 
        6160        test=" $pF unction =  'RNDPHYS'  "
        6161       >
        6162                                           
        6163        <xsl:text>
        6164         (rounding  physician)
        6165        </xsl:text >
        6166                                  
        6167       </xsl:when >
        6168                                 
        6169       <xsl:when 
        6170        test=" $pF unction =  'SASST' "
        6171       >
        6172                                           
        6173        <xsl:text>
        6174         (second as sistant su rgeon)
        6175        </xsl:text >
        6176                                  
        6177       </xsl:when >
        6178                                 
        6179       <xsl:when 
        6180        test=" $pF unction =  'SNRS' "
        6181       >
        6182                                           
        6183        <xsl:text>
        6184         (scrub nur se)
        6185        </xsl:text >
        6186                                  
        6187       </xsl:when >
        6188                                 
        6189       <xsl:when 
        6190        test=" $pF unction =  'TASST' "
        6191       >
        6192                                           
        6193        <xsl:text>
        6194         (third ass istant)
        6195        </xsl:text >
        6196                                  
        6197       </xsl:when >
        6198                                 
        6199       <!-- From  the HL7 v2  Provider  Role code  system (2. 16.840.1.1 13883.12.4 43) 
        6200                                          which is  used by H ITSP -->
        6201                                 
        6202       <xsl:when 
        6203        test=" $pF unction =  'CP' "
        6204       >
        6205                                           
        6206        <xsl:text>
        6207         (consultin g provider )
        6208        </xsl:text >
        6209                                  
        6210       </xsl:when >
        6211                                 
        6212       <xsl:when 
        6213        test=" $pF unction =  'PP' "
        6214       >
        6215                                           
        6216        <xsl:text>
        6217         (primary c are provid er)
        6218        </xsl:text >
        6219                                  
        6220       </xsl:when >
        6221                                 
        6222       <xsl:when 
        6223        test=" $pF unction =  'RP' "
        6224       >
        6225                                           
        6226        <xsl:text>
        6227         (referring  provider)
        6228        </xsl:text >
        6229                                  
        6230       </xsl:when >
        6231                                 
        6232       <xsl:when 
        6233        test=" $pF unction =  'MP' "
        6234       >
        6235                                           
        6236        <xsl:text>
        6237         (medical h ome provid er)
        6238        </xsl:text >
        6239                                  
        6240       </xsl:when >
        6241                        
        6242      </xsl:choo se>
        6243              
        6244     </xsl:temp late>
        6245             
        6246     <xsl:templ ate 
        6247      name="form atDateTime "
        6248     >
        6249                       
        6250      <xsl:param  
        6251       name="date
        6252      />
        6253                       
        6254      <!-- month  -->
        6255                       
        6256      <xsl:varia ble 
        6257       name="mont h" 
        6258       select="su bstring ($ date, 5, 2 )" 
        6259      />
        6260                       
        6261      <xsl:choos e>
        6262                                 
        6263       <xsl:when 
        6264        test="$mon th='01'"
        6265       >
        6266                                           
        6267        <xsl:text>
        6268         January 
        6269        </xsl:text >
        6270                                  
        6271       </xsl:when >
        6272                                 
        6273       <xsl:when 
        6274        test="$mon th='02'"
        6275       >
        6276                                           
        6277        <xsl:text>
        6278         February 
        6279        </xsl:text >
        6280                                  
        6281       </xsl:when >
        6282                                 
        6283       <xsl:when 
        6284        test="$mon th='03'"
        6285       >
        6286                                           
        6287        <xsl:text>
        6288         March 
        6289        </xsl:text >
        6290                                  
        6291       </xsl:when >
        6292                                 
        6293       <xsl:when 
        6294        test="$mon th='04'"
        6295       >
        6296                                           
        6297        <xsl:text>
        6298         April 
        6299        </xsl:text >
        6300                                  
        6301       </xsl:when >
        6302                                 
        6303       <xsl:when 
        6304        test="$mon th='05'"
        6305       >
        6306                                           
        6307        <xsl:text>
        6308         May 
        6309        </xsl:text >
        6310                                  
        6311       </xsl:when >
        6312                                 
        6313       <xsl:when 
        6314        test="$mon th='06'"
        6315       >
        6316                                           
        6317        <xsl:text>
        6318         June 
        6319        </xsl:text >
        6320                                  
        6321       </xsl:when >
        6322                                 
        6323       <xsl:when 
        6324        test="$mon th='07'"
        6325       >
        6326                                           
        6327        <xsl:text>
        6328         July 
        6329        </xsl:text >
        6330                                  
        6331       </xsl:when >
        6332                                 
        6333       <xsl:when 
        6334        test="$mon th='08'"
        6335       >
        6336                                           
        6337        <xsl:text>
        6338         August 
        6339        </xsl:text >
        6340                                  
        6341       </xsl:when >
        6342                                 
        6343       <xsl:when 
        6344        test="$mon th='09'"
        6345       >
        6346                                           
        6347        <xsl:text>
        6348         September 
        6349        </xsl:text >
        6350                                  
        6351       </xsl:when >
        6352                                 
        6353       <xsl:when 
        6354        test="$mon th='10'"
        6355       >
        6356                                           
        6357        <xsl:text>
        6358         October 
        6359        </xsl:text >
        6360                                  
        6361       </xsl:when >
        6362                                 
        6363       <xsl:when 
        6364        test="$mon th='11'"
        6365       >
        6366                                           
        6367        <xsl:text>
        6368         November 
        6369        </xsl:text >
        6370                                  
        6371       </xsl:when >
        6372                                 
        6373       <xsl:when 
        6374        test="$mon th='12'"
        6375       >
        6376                                           
        6377        <xsl:text>
        6378         December 
        6379        </xsl:text >
        6380                                  
        6381       </xsl:when >
        6382                        
        6383      </xsl:choo se>
        6384                       
        6385      <!-- day - ->
        6386                       
        6387      <xsl:choos e>
        6388                                 
        6389       <xsl:when 
        6390        test='subs tring ($da te, 7, 1)= "0"'
        6391       >
        6392                                           
        6393        <xsl:value -of 
        6394         select="su bstring ($ date, 8, 1 )" 
        6395        />
        6396                                           
        6397        <xsl:text>
        6398        
        6399        </xsl:text >
        6400                                  
        6401       </xsl:when >
        6402                                 
        6403       <xsl:other wise>
        6404                                           
        6405        <xsl:value -of 
        6406         select="su bstring ($ date, 7, 2 )" 
        6407        />
        6408                                           
        6409        <xsl:text>
        6410        
        6411        </xsl:text >
        6412                                  
        6413       </xsl:othe rwise>
        6414                        
        6415      </xsl:choo se>
        6416                       
        6417      <!-- year  -->
        6418                       
        6419      <xsl:value -of 
        6420       select="su bstring ($ date, 1, 4 )" 
        6421      />
        6422                       
        6423      <!-- time  and US tim ezone -->
        6424                       
        6425      <xsl:if 
        6426       test="stri ng-length( $date) > 8 "
        6427      >
        6428                                 
        6429       <xsl:text>
        6430       
        6431       </xsl:text >
        6432                                 
        6433       <!-- time  -->
        6434                                 
        6435       <xsl:varia ble 
        6436        name="time "
        6437       >
        6438                                           
        6439        <xsl:value -of 
        6440         select="su bstring($d ate,9,6)" 
        6441        />
        6442                                  
        6443       </xsl:vari able>
        6444                                 
        6445       <xsl:varia ble 
        6446        name="hh"
        6447       >
        6448                                           
        6449        <xsl:value -of 
        6450         select="su bstring($t ime,1,2)" 
        6451        />
        6452                                  
        6453       </xsl:vari able>
        6454                                 
        6455       <xsl:varia ble 
        6456        name="mm"
        6457       >
        6458                                           
        6459        <xsl:value -of 
        6460         select="su bstring($t ime,3,2)" 
        6461        />
        6462                                  
        6463       </xsl:vari able>
        6464                                 
        6465       <xsl:varia ble 
        6466        name="ss"
        6467       >
        6468                                           
        6469        <xsl:value -of 
        6470         select="su bstring($t ime,5,2)" 
        6471        />
        6472                                  
        6473       </xsl:vari able>
        6474                                 
        6475       <xsl:if 
        6476        test="stri ng-length( $hh)&gt;1"
        6477       >
        6478                                           
        6479        <xsl:value -of 
        6480         select="$h h" 
        6481        />
        6482                                           
        6483        <xsl:if
        6484                                                   
        6485         test="stri ng-length( $mm)&gt;1  and not(co ntains($mm ,'-')) and  not (cont ains($mm,' +'))"
        6486        >
        6487                                                    
        6488         <xsl:text>
        6489          :
        6490         </xsl:text >
        6491                                                    
        6492         <xsl:value -of 
        6493          select="$m m" 
        6494         />
        6495                                                    
        6496         <xsl:if
        6497                                                             
        6498          test="stri ng-length( $ss)&gt;1  and not(co ntains($ss ,'-')) and  not (cont ains($ss,' +'))"
        6499         >
        6500                                                              
        6501          <xsl:text>
        6502           :
        6503          </xsl:text >
        6504                                                              
        6505          <xsl:value -of 
        6506           select="$s s" 
        6507          />
        6508                                                     
        6509         </xsl:if>
        6510                                            
        6511        </xsl:if>
        6512                                  
        6513       </xsl:if>
        6514                                 
        6515       <!-- time  zone -->
        6516                                 
        6517       <xsl:varia ble 
        6518        name="tzon "
        6519       >
        6520                                           
        6521        <xsl:choos e>
        6522                                                    
        6523         <xsl:when 
        6524          test="cont ains($date ,'+')"
        6525         >
        6526                                                              
        6527          <xsl:text>
        6528           +
        6529          </xsl:text >
        6530                                                              
        6531          <xsl:value -of 
        6532           select="su bstring-af ter($date,  '+')" 
        6533          />
        6534                                                     
        6535         </xsl:when >
        6536                                                    
        6537         <xsl:when 
        6538          test="cont ains($date ,'-')"
        6539         >
        6540                                                              
        6541          <xsl:text>
        6542           -
        6543          </xsl:text >
        6544                                                              
        6545          <xsl:value -of 
        6546           select="su bstring-af ter($date,  '-')" 
        6547          />
        6548                                                     
        6549         </xsl:when >
        6550                                            
        6551        </xsl:choo se>
        6552                                  
        6553       </xsl:vari able>
        6554                                 
        6555       <xsl:choos e>
        6556                                           
        6557        <!-- refer ence: http ://www.tim eanddate.c om/library /abbreviat ions/timez ones/na/ - ->
        6558                                           
        6559        <xsl:when 
        6560         test="$tzo n = '-0500 ' "
        6561        >
        6562                                                    
        6563         <xsl:text>
        6564          , EST
        6565         </xsl:text >
        6566                                            
        6567        </xsl:when >
        6568                                           
        6569        <xsl:when 
        6570         test="$tzo n = '-0600 ' "
        6571        >
        6572                                                    
        6573         <xsl:text>
        6574          , CST
        6575         </xsl:text >
        6576                                            
        6577        </xsl:when >
        6578                                           
        6579        <xsl:when 
        6580         test="$tzo n = '-0700 ' "
        6581        >
        6582                                                    
        6583         <xsl:text>
        6584          , MST
        6585         </xsl:text >
        6586                                            
        6587        </xsl:when >
        6588                                           
        6589        <xsl:when 
        6590         test="$tzo n = '-0800 ' "
        6591        >
        6592                                                    
        6593         <xsl:text>
        6594          , PST
        6595         </xsl:text >
        6596                                            
        6597        </xsl:when >
        6598                                           
        6599        <xsl:other wise>
        6600                                                    
        6601         <xsl:text>
        6602           
        6603         </xsl:text >
        6604                                                    
        6605         <xsl:value -of 
        6606          select="$t zon" 
        6607         />
        6608                                            
        6609        </xsl:othe rwise>
        6610                                  
        6611       </xsl:choo se>
        6612                        
        6613      </xsl:if>
        6614              
        6615     </xsl:temp late>
        6616             
        6617     <!-- conve rt to lowe r case -->
        6618             
        6619     <xsl:templ ate 
        6620      name="case Down"
        6621     >
        6622                       
        6623      <xsl:param  
        6624       name="data
        6625      />
        6626                       
        6627      <xsl:if 
        6628       test="$dat a"
        6629      >
        6630                                 
        6631       <xsl:value -of
        6632                                          
        6633        select="tr anslate($d ata, 'ABCD EFGHIJKLMN OPQRSTUVWX YZ','abcde fghijklmno pqrstuvwxy z')" 
        6634       />
        6635                        
        6636      </xsl:if>
        6637              
        6638     </xsl:temp late>
        6639             
        6640     <!-- conve rt to uppe r case -->
        6641             
        6642     <xsl:templ ate 
        6643      name="case Up"
        6644     >
        6645                       
        6646      <xsl:param  
        6647       name="data
        6648      />
        6649                       
        6650      <xsl:if 
        6651       test="$dat a"
        6652      >
        6653                                 
        6654       <xsl:value -of
        6655                                          
        6656        select="tr anslate($d ata,'abcde fghijklmno pqrstuvwxy z', 'ABCDE FGHIJKLMNO PQRSTUVWXY Z')" 
        6657       />
        6658                        
        6659      </xsl:if>
        6660              
        6661     </xsl:temp late>
        6662             
        6663     <!-- conve rt first c haracter t o upper ca se -->
        6664             
        6665     <xsl:templ ate 
        6666      name="firs tCharCaseU p"
        6667     >
        6668                       
        6669      <xsl:param  
        6670       name="data
        6671      />
        6672                       
        6673      <xsl:if 
        6674       test="$dat a"
        6675      >
        6676                                 
        6677       <xsl:call- template 
        6678        name="case Up"
        6679       >
        6680                                           
        6681        <xsl:with- param 
        6682         name="data
        6683         select="su bstring($d ata,1,1)" 
        6684        />
        6685                                  
        6686       </xsl:call -template>
        6687                                 
        6688       <xsl:value -of 
        6689        select="su bstring($d ata,2)" 
        6690       />
        6691                        
        6692      </xsl:if>
        6693              
        6694     </xsl:temp late>
        6695             
        6696     <!-- show- noneFlavor  -->
        6697             
        6698     <xsl:templ ate 
        6699      name="show -noneFlavo r"
        6700     >
        6701                       
        6702      <xsl:param  
        6703       name="nf" 
        6704      />
        6705                       
        6706      <xsl:choos e>
        6707                                 
        6708       <xsl:when 
        6709        test=" $nf  = 'NI' "
        6710       >
        6711                                           
        6712        <xsl:text>
        6713         no informa tion
        6714        </xsl:text >
        6715                                  
        6716       </xsl:when >
        6717                                 
        6718       <xsl:when 
        6719        test=" $nf  = 'INV' "
        6720       >
        6721                                           
        6722        <xsl:text>
        6723         invalid
        6724        </xsl:text >
        6725                                  
        6726       </xsl:when >
        6727                                 
        6728       <xsl:when 
        6729        test=" $nf  = 'MSK' "
        6730       >
        6731                                           
        6732        <xsl:text>
        6733         masked
        6734        </xsl:text >
        6735                                  
        6736       </xsl:when >
        6737                                 
        6738       <xsl:when 
        6739        test=" $nf  = 'NA' "
        6740       >
        6741                                           
        6742        <xsl:text>
        6743         not applic able
        6744        </xsl:text >
        6745                                  
        6746       </xsl:when >
        6747                                 
        6748       <xsl:when 
        6749        test=" $nf  = 'UNK' "
        6750       >
        6751                                           
        6752        <xsl:text>
        6753         unknown
        6754        </xsl:text >
        6755                                  
        6756       </xsl:when >
        6757                                 
        6758       <xsl:when 
        6759        test=" $nf  = 'OTH' "
        6760       >
        6761                                           
        6762        <xsl:text>
        6763         other
        6764        </xsl:text >
        6765                                  
        6766       </xsl:when >
        6767                        
        6768      </xsl:choo se>
        6769              
        6770     </xsl:temp late>
        6771             
        6772     <xsl:templ ate 
        6773      name="addC SS"
        6774     >
        6775                       
        6776      <style 
        6777       type="text /css"
        6778      >
        6779                                 
        6780       <xsl:text>
        6781                  
        6782       </xsl:text >
        6783                        
        6784      </style>
        6785              
        6786     </xsl:temp late>
        6787   </xsl:styl esheet>