3162. EPMO Open Source Coordination Office Redaction File Detail Report

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

3162.1 Files compared

# Location File Last Modified
1 Fri Jun 9 19:49:53 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\vistaweb\nhin cda2detail.xsl Wed Jun 7 05:20:20 2017 UTC

3162.2 Comparison summary

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

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

3162.4 Active regular expressions

No regular expressions were active.

3162.5 Comparison detail

        1   <?xml 
        2     version="1 .0"
        3   ?>
        4   <xsl:style sheet 
        5     version="1 .0"
        6           
        7     xmlns:xsl= "http://ww w.w3.org/1 999/XSL/Tr ansform"
        8           
        9     xmlns:n3=" http://www .w3.org/19 99/xhtml"
        10           
        11     xmlns:n1=" urn:hl7-or g:v3"
        12           
        13     xmlns:n2=" urn:hl7-or g:v3/meta/ voc"
        14           
        15     xmlns:voc= "urn:hl7-o rg:v3/voc"
        16           
        17     xmlns:xsi= "http://ww w.w3.org/2 001/XMLSch ema-instan ce"
        18           
        19     xmlns:sect ion="urn:g ov.va.med"
        20           
        21     xmlns:msxs l="urn:sch emas-micro soft-com:x slt"
        22   >
        23    
        24             
        25     <xsl:impor
        26      href="/gov /va/nvap/d ocument/xs l/vistaweb /common.xs l"
        27     />
        28             
        29     <xsl:impor
        30      href="/gov /va/nvap/d ocument/xs l/vistaweb /nhin/cda2 detailComm on.xslt"
        31     />
        32             
        33     <xsl:impor
        34      href="/gov /va/nvap/d ocument/xs l/vistaweb /nhin/deta ilCommon.x sl"
        35     />
        36             
        37     <xsl:impor
        38      href="/gov /va/nvap/d ocument/xs l/vistaweb /nhin/nhin Common.xsl "
        39     />
        40             
        41     <xsl:impor
        42      href="/gov /va/nvap/d ocument/xs l/vistaweb /nhin/form atting.xsl "
        43     />
        44             
        45             
        46     <xsl:outpu
        47      method="ht ml" 
        48      indent="ye s" 
        49      version="4 .01" 
        50      encoding=" ISO-8859-1 "
        51     />
        52    
        53             
        54     <xsl:templ ate 
        55      name="disp laySource"
        56     >
        57                       
        58      <head>
        59                                 
        60       <link 
        61        type="text /css" 
        62        href="reso urces/css/ nhin.css" 
        63        rel="style sheet"
        64       />
        65      
        66                                 
        67       <h2 
        68        align="cen ter"
        69       >
        70                                           
        71        <xsl:call- template 
        72         name="docu mentTitle"
        73        >
        74                                                    
        75         <xsl:with- param 
        76          name="root
        77          select="."
        78         />
        79                                            
        80        </xsl:call -template>
        81                                  
        82       </h2>
        83                        
        84      </head>
        85              
        86     </xsl:temp late>
        87    
        88             
        89     <xsl:templ ate 
        90      name="disp layTitle"
        91     >
        92                       
        93      <div 
        94       style="tex t-align:ce nter;"
        95      >
        96                                 
        97       <span 
        98        style="fon t-size:lar ger;font-w eight:bold "
        99       >
        100                                           
        101        <xsl:value -of 
        102         select="n1 :code/@dis playName"
        103        />
        104                                  
        105       </span>
        106                        
        107      </div>
        108              
        109     </xsl:temp late>
        110    
        111             
        112     <xsl:templ ate 
        113      name="disp layReportD ates"
        114     >
        115                       
        116      <b>
        117                                 
        118       <xsl:text>
        119        Created On
        120       </xsl:text >
        121                        
        122      </b>
        123                       
        124      <xsl:call- template 
        125       name="getC reatedOnDa te"
        126      />
        127                       
        128      <xsl:if 
        129       test="n1:d ocumentati onOf/n1:se rviceEvent /n1:perfor mer/n1:eff ectiveTime /n1:low/@v alue"
        130      >
        131                                 
        132       <xsl:text 
        133        disable-ou tput-escap ing="yes"
        134       >
        135        &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
        136       </xsl:text >
        137                                 
        138       <b>
        139                                           
        140        <xsl:text>
        141         Date Range
        142        </xsl:text >
        143                                  
        144       </b>
        145                                 
        146       <xsl:choos e>
        147                                           
        148        <xsl:when 
        149         test="stri ng-length( n1:documen tationOf/n 1:serviceE vent/n1:pe rformer/n1 :effective Time/n1:lo w/@value)= 0"
        150        >
        151                                                    
        152         <xsl:call- template 
        153          name="na"
        154         />
        155                                            
        156        </xsl:when >
        157                                           
        158        <xsl:when 
        159         test="star ts-with(n1 :documenta tionOf/n1: serviceEve nt/n1:perf ormer/n1:e ffectiveTi me/n1:low/ @value,' ' )"
        160        >
        161                                                    
        162         <xsl:call- template 
        163          name="na"
        164         />
        165                                            
        166        </xsl:when >
        167                                           
        168        <xsl:other wise>
        169                                                    
        170         <xsl:call- template 
        171          name="form atDateLong "
        172         >
        173                                                              
        174          <xsl:with- param 
        175           name="date String" 
        176           select="n1 :documenta tionOf/n1: serviceEve nt/n1:perf ormer/n1:e ffectiveTi me/n1:low/ @value"
        177          />
        178                                                     
        179         </xsl:call -template>
        180                                            
        181        </xsl:othe rwise>
        182                                  
        183       </xsl:choo se>
        184                                 
        185       <b>
        186                                           
        187        <xsl:text 
        188         disable-ou tput-escap ing="yes"
        189        >
        190          - 
        191        </xsl:text >
        192                                  
        193       </b>
        194                                 
        195       <xsl:choos e>
        196                                           
        197        <xsl:when 
        198         test="stri ng-length( n1:documen tationOf/n 1:serviceE vent/n1:pe rformer/n1 :effective Time/n1:hi gh/@value) =0"
        199        >
        200                                                    
        201         <xsl:call- template 
        202          name="na"
        203         />
        204                                            
        205        </xsl:when >
        206                                           
        207        <xsl:when 
        208         test="star ts-with(n1 :documenta tionOf/n1: serviceEve nt/n1:perf ormer/n1:e ffectiveTi me/n1:high /@value,'  ')"
        209        >
        210                                                    
        211         <xsl:call- template 
        212          name="na"
        213         />
        214                                            
        215        </xsl:when >
        216                                           
        217        <xsl:other wise>
        218                                                    
        219         <xsl:call- template 
        220          name="form atDateLong "
        221         >
        222                                                              
        223          <xsl:with- param 
        224           name="date String" 
        225           select="n1 :documenta tionOf/n1: serviceEve nt/n1:perf ormer/n1:e ffectiveTi me/n1:high /@value"
        226          />
        227                                                     
        228         </xsl:call -template>
        229                                            
        230        </xsl:othe rwise>
        231                                  
        232       </xsl:choo se>
        233                        
        234      </xsl:if>
        235              
        236     </xsl:temp late>
        237    
        238       
        239     <xsl:templ ate 
        240      name="disp layPatient Block"
        241     >
        242          
        243      <table 
        244       width='100 %' 
        245       class="fir st"
        246      >
        247             
        248       <xsl:varia ble 
        249        name="pati entRole" 
        250        select="n1 :recordTar get/n1:pat ientRole"
        251       />
        252             
        253       <tr>
        254                
        255        <td 
        256         width='15%
        257         valign="to p"
        258        >
        259                   
        260         <b>
        261                       
        262          <xsl:text>
        263           Patient: 
        264          </xsl:text >
        265                    
        266         </b>
        267                 
        268        </td>
        269                
        270        <td 
        271         width='35%
        272         valign="to p"
        273        >
        274                   
        275         <xsl:for-e ach 
        276          select="$p atientRole /n1:patien t/n1:name"
        277         >
        278                       
        279          <!-- The b usiness pa rtner (VLE R Health P rogram) is  okay with  bypassing  the "use"  attribute  at this t ime (build  v16.1.6)  -->
        280                       
        281          <!--Patien t legal na me-->
        282                       
        283          <xsl:if 
        284           test ="pos ition()=1"
        285          >
        286                          
        287           <xsl:call- template 
        288            name="getN ame"
        289           >
        290                             
        291            <xsl:with- param 
        292             name="name
        293             select="."
        294            />
        295                           
        296           </xsl:call -template>
        297                        
        298          </xsl:if>
        299                    
        300         </xsl:for- each>
        301                   
        302         <xsl:for-e ach 
        303          select="$p atientRole /n1:patien t/n1:name"
        304         >
        305                       
        306          <!-- Alias  names -->
        307                       
        308          <xsl:if 
        309           test ="pos ition()>1  and string -length(no rmalize-sp ace(curren t()))!=0"
        310          >
        311                          
        312           <br/>
        313                          
        314           <xsl:text>
        315            Alias: 
        316           </xsl:text >
        317                          
        318           <xsl:call- template 
        319            name="getN ame"
        320           >
        321                             
        322            <xsl:with- param 
        323             name="name
        324             select="."
        325            />
        326                           
        327           </xsl:call -template>
        328                        
        329          </xsl:if>
        330                    
        331         </xsl:for- each>
        332                   
        333         <xsl:if 
        334          test="$pat ientRole/n 1:addr"
        335         >
        336                       
        337          <xsl:call- template 
        338           name="getA ddress"
        339          >
        340                          
        341           <xsl:with- param 
        342            name="addr
        343            select="$p atientRole /n1:addr"
        344           />
        345                        
        346          </xsl:call -template>
        347                    
        348         </xsl:if>
        349                                                    
        350         <xsl:choos e>
        351                                                              
        352          <xsl:when 
        353           test="$pat ientRole/n 1:telecom/ @value"
        354          >
        355                                                                        
        356           <xsl:for-e ach 
        357            select="$p atientRole /n1:teleco m"
        358           >
        359                                                                                  
        360            <xsl:call- template 
        361             name="getT elecom"
        362            >
        363                                                                                            
        364             <xsl:with- param 
        365              name="tele com" 
        366              select="."
        367             />
        368                                                                                   
        369            </xsl:call -template>
        370                                                                         
        371           </xsl:for- each>
        372                                                               
        373          </xsl:when >
        374                                                              
        375          <xsl:other wise>
        376                                                                        
        377           <br/>
        378                                                                        
        379           <b>
        380                                                                                  
        381            <xsl:text>
        382             tel: PATIE NT PHONE M ISSING
        383            </xsl:text >
        384                                                                         
        385           </b>
        386                                                               
        387          </xsl:othe rwise>
        388                                                     
        389         </xsl:choo se>
        390                                            
        391        </td>
        392                                           
        393        <td 
        394         width='15%
        395         align='rig ht' 
        396         valign="to p"
        397        >
        398                                                    
        399         <b>
        400                                                              
        401          <xsl:text>
        402           Patient ID
        403          </xsl:text >
        404                                                     
        405         </b>
        406                                            
        407        </td>
        408                                           
        409        <td 
        410         width='35%
        411         valign="to p"
        412        >
        413                                                    
        414         <xsl:if 
        415          test="stri ng-length( $patientRo le/n1:id/@ extension) >0"
        416         >
        417                                                              
        418          <xsl:value -of 
        419           select="$p atientRole /n1:id/@ex tension"
        420          />
        421                                                     
        422         </xsl:if>
        423                                            
        424        </td>
        425                                  
        426       </tr>
        427                                 
        428       <tr>
        429                                           
        430        <td 
        431         width='15%
        432         valign="to p"
        433        >
        434                                                    
        435         <b>
        436                                                              
        437          <xsl:text>
        438           Birthdate:  
        439          </xsl:text >
        440                                                     
        441         </b>
        442                                            
        443        </td>
        444                                           
        445        <td 
        446         width='35%
        447         valign="to p"
        448        >
        449                                                    
        450         <xsl:call- template 
        451          name="form atDateLong "
        452         >
        453                                                              
        454          <xsl:with- param 
        455           name="date String" 
        456           select="$p atientRole /n1:patien t/n1:birth Time/@valu e"
        457          />
        458                                                     
        459         </xsl:call -template>
        460                                            
        461        </td>
        462                                           
        463        <td 
        464         width='15%
        465         align='rig ht' 
        466         valign="to p"
        467        >
        468                                                    
        469         <b>
        470                                                              
        471          <xsl:text>
        472           Sex: 
        473          </xsl:text >
        474                                                     
        475         </b>
        476                                            
        477        </td>
        478                                           
        479        <td 
        480         width='35%
        481         valign="to p"
        482        >
        483                                                    
        484         <xsl:call- template 
        485          name="getG enderStrin g"
        486         />
        487                                            
        488        </td>
        489                                  
        490       </tr>
        491                                 
        492       <xsl:varia ble 
        493        name="hasL anguages"
        494       >
        495                                           
        496        <xsl:call- template 
        497         name="isLa nguageFoun d"
        498        >
        499                                                    
        500         <xsl:with- param 
        501          name="pati entRole" 
        502          select="$p atientRole "
        503         />
        504                                            
        505        </xsl:call -template>
        506                                  
        507       </xsl:vari able>
        508                                 
        509       <xsl:if 
        510        test="$has Languages= 'true'"
        511       >
        512                                           
        513        <tr>
        514                                                    
        515         <td 
        516          width="15%
        517          valign="to p"
        518         >
        519                                                              
        520          <b>
        521                                                                        
        522           <xsl:text>
        523            Language(s ):
        524           </xsl:text >
        525                                                               
        526          </b>
        527                                                     
        528         </td>
        529                                                    
        530         <td 
        531          width="35%
        532          valign="to p"
        533         >
        534                                                     
        535          <xsl:call- template 
        536           name="disp layLanguag es"
        537          >
        538                                                               
        539           <xsl:with- param 
        540            name="pati entRole" 
        541            select="$p atientRole "
        542           />
        543                                                      
        544          </xsl:call -template>
        545                                                     
        546         </td>
        547                                                    
        548         <td 
        549          width="15%
        550          valign="to p"
        551         >
        552         </td>
        553                                                    
        554         <td 
        555          width="35%
        556          valign="to p"
        557         >
        558         </td>
        559                                            
        560        </tr>
        561                                  
        562       </xsl:if>
        563                        
        564      </table>
        565              
        566     </xsl:temp late>
        567    
        568             
        569     <xsl:templ ate 
        570      match="n1: languageCo de"
        571     >
        572                       
        573      <xsl:varia ble 
        574       name="code String"
        575      >
        576                                 
        577       <xsl:apply -templates  
        578        select="."  
        579        mode="data "
        580       />
        581                        
        582      </xsl:vari able>
        583                       
        584      <xsl:if 
        585       test="stri ng-length( normalize- space($cod eString))> 0"
        586      >
        587                                 
        588       <li>
        589                                           
        590        <xsl:value -of 
        591         select="$c odeString"
        592        />
        593                                  
        594       </li>
        595                        
        596      </xsl:if>
        597              
        598     </xsl:temp late>
        599             
        600             
        601     <xsl:templ ate 
        602      name="disp layAuthorB lock"
        603     >
        604                       
        605      <xsl:if 
        606       test="n1:a uthor"
        607      >
        608                                 
        609       <table 
        610        width="100 %" 
        611        class="sec ond"
        612       >
        613                                           
        614        <tr>
        615                                                    
        616         <td 
        617          width="15% "
        618         >
        619                                                              
        620          <b>
        621           Source:
        622          </b>
        623                                                     
        624         </td>
        625                                                    
        626         <td 
        627          width="85% "
        628         >
        629                                                              
        630          <xsl:value -of 
        631           select="n1 :author/n1 :assignedA uthor/n1:r epresented Organizati on/n1:name /text()"
        632          />
        633                                                     
        634         </td>
        635                                            
        636        </tr>
        637                                           
        638        <xsl:choos e>
        639                                                    
        640         <xsl:when 
        641          test="not( $isMVA)"
        642         >
        643                                                              
        644          <xsl:if 
        645           test="stri ng-length( normalize- space(n1:a uthor/n1:a ssignedAut hor/n1:ass ignedPerso n/n1:name) )>1"
        646          >
        647                                                                        
        648           <tr>
        649                                                                         
        650            <td 
        651             width="15%
        652             valign="to p"
        653            >
        654            </td>
        655                                                                         
        656            <td 
        657             width="85%
        658             valign="to p"
        659            >
        660                                                                                   Author :
        661                                                                                   
        662             <xsl:call- template 
        663              name="getP ersonNameF romRoot"
        664             >
        665                                                                                             
        666              <xsl:with- param 
        667               name="name Root" 
        668               select="n1 :author/n1 :assignedA uthor/n1:a ssignedPer son/n1:nam e"
        669              />
        670                                                                                    
        671             </xsl:call -template>
        672                                                                          
        673            </td>
        674                                                                         
        675           </tr>
        676                                                               
        677          </xsl:if>
        678                                                     
        679         </xsl:when >
        680                                            
        681        </xsl:choo se>
        682                                  
        683       </table>
        684                        
        685      </xsl:if>
        686              
        687     </xsl:temp late>
        688    
        689             
        690     <xsl:templ ate 
        691      name="disp layTableOf Contents"
        692     >
        693                       
        694      <div 
        695       style="mar gin-bottom :35px"
        696      >
        697                                 
        698       <h3>
        699                                           
        700        <a 
        701         name="toc"
        702        >
        703         Table of C ontents
        704        </a>
        705                                  
        706       </h3>
        707                                 
        708       <ul>
        709                                           
        710        <xsl:for-e ach 
        711         select="n1 :component /n1:struct uredBody/n 1:componen t/n1:secti on/n1:titl e"
        712        >
        713                                                    
        714         <xsl:sort/ >
        715                                                    
        716         <xsl:varia ble 
        717          name="comp Found"
        718         >
        719                                                              
        720          <xsl:call- template 
        721           name="comp onentFound "
        722          >
        723                                                                        
        724           <xsl:with- param 
        725            name="comp Section" 
        726            select=".. /."
        727           />
        728                                                               
        729          </xsl:call -template>
        730                                                     
        731         </xsl:vari able>
        732                                                    
        733         <xsl:choos e>
        734                                                              
        735          <xsl:when 
        736           test="stri ng-length( $compFound )>0"
        737          >
        738                                                                        
        739           <li>
        740                                                                                  
        741            <a 
        742             style="fon t-family:g eorgia;fon t-size:12p t"  
        743             href="#{ge nerate-id( .)}"
        744            >
        745                                                                                            
        746             <xsl:value -of 
        747              select="."
        748             />
        749                                                                                   
        750            </a>
        751                                                                         
        752           </li>
        753                                                               
        754          </xsl:when >
        755                                                     
        756         </xsl:choo se>
        757                                            
        758        </xsl:for- each>
        759                                  
        760       </ul>
        761                        
        762      </div>
        763              
        764     </xsl:temp late>
        765    
        766             
        767     <xsl:templ ate 
        768      name="disp layContent s"
        769     >
        770                       
        771      <xsl:apply -templates  
        772       select="n1 :component /n1:struct uredBody/n 1:componen t"
        773      >
        774                                 
        775       <xsl:sort 
        776        select="n1 :section/n 1:title"
        777       />
        778                        
        779      </xsl:appl y-template s>
        780                       
        781      <br>
        782      </br>
        783              
        784     </xsl:temp late>
        785    
        786       
        787     <xsl:templ ate 
        788      name="disp layContact InfoBlock"
        789     >
        790          
        791      <xsl:choos e>
        792             
        793       <xsl:when 
        794        test="stri ng-length( n1:partici pant[@type Code='IND' ]/n1:assoc iatedEntit y)>0"
        795       >
        796                
        797        <table 
        798         class="fir st"
        799        >
        800                   
        801         <tr>
        802                       
        803          <td 
        804           width="100 px" 
        805           valign="to p" 
        806           align='lef t'
        807          >
        808                          
        809           <b>
        810            Contact(s)
        811           </b>
        812                        
        813          </td>
        814                       
        815          <td 
        816           valign="to p"
        817          >
        818                          
        819           <xsl:call- template 
        820            name="getP articipant info"
        821           >
        822                             
        823            <xsl:with- param 
        824             name="part icipant" 
        825             select="n1 :participa nt[@typeCo de='IND']/ n1:associa tedEntity"
        826            />
        827                           
        828           </xsl:call -template>
        829                        
        830          </td>
        831                       
        832          <td 
        833           width="50p x"
        834          >
        835            
        836          </td>
        837                    
        838         </tr>
        839                 
        840        </table>
        841              
        842       </xsl:when >
        843             
        844       <xsl:other wise>
        845                
        846        <xsl:text 
        847         disable-ou tput-escap ing="yes"
        848        >
        849         &amp;nbsp;
        850        </xsl:text >
        851                
        852        <span 
        853         style="fon t-weight:b old; borde r:2px soli d;"
        854        >
        855                   
        856         <xsl:text>
        857           EMERGENCY  CONTACT I NFO MISSIN G! 
        858         </xsl:text >
        859                 
        860        </span>
        861              
        862       </xsl:othe rwise>
        863           
        864      </xsl:choo se>
        865        
        866     </xsl:temp late>
        867    
        868       
        869     <xsl:templ ate 
        870      name="getP articipant info"
        871     >
        872          
        873      <xsl:param  
        874       name="part icipant"
        875      />
        876          
        877      <p>
        878             
        879       <xsl:for-e ach 
        880        select="$p articipant "
        881       >
        882                
        883        <xsl:call- template 
        884         name="emer Name"
        885        >
        886                   
        887         <xsl:with- param 
        888          name="part icipant" 
        889          select="."
        890         />
        891                 
        892        </xsl:call -template>
        893                
        894        <xsl:call- template 
        895         name="emer Address"
        896        >
        897                   
        898         <xsl:with- param 
        899          name="part icipant" 
        900          select="."
        901         />
        902                 
        903        </xsl:call -template>
        904                
        905        <xsl:call- template 
        906         name="emer Telecom"
        907        >
        908                   
        909         <xsl:with- param 
        910          name="part icipant" 
        911          select="."
        912         />
        913                 
        914        </xsl:call -template>
        915                
        916        <xsl:call- template 
        917         name="emer Relationsh ip"
        918        >
        919                   
        920         <xsl:with- param 
        921          name="part icipant" 
        922          select="."
        923         />
        924                 
        925        </xsl:call -template>
        926                
        927        <xsl:call- template 
        928         name="emer Type"
        929        >
        930                   
        931         <xsl:with- param 
        932          name="part icipant" 
        933          select="."
        934         />
        935                 
        936        </xsl:call -template>
        937                
        938        <br/>
        939              
        940       </xsl:for- each>
        941           
        942      </p>
        943        
        944     </xsl:temp late>
        945    
        946       
        947     <xsl:templ ate 
        948      name="emer Name"
        949     >
        950          
        951      <xsl:param  
        952       name="part icipant"
        953      />
        954          
        955      <br/>
        956          
        957      <xsl:call- template 
        958       name="getN ame"
        959      >
        960             
        961       <xsl:with- param 
        962        name="name
        963        select="$p articipant /n1:associ atedPerson /n1:name"
        964       />
        965           
        966      </xsl:call -template>
        967        
        968     </xsl:temp late>
        969    
        970       
        971     <xsl:templ ate 
        972      name="emer Address"
        973     >
        974          
        975      <xsl:param  
        976       name="part icipant"
        977      />
        978          
        979      <xsl:if 
        980       test="$par ticipant/n 1:addr/n1: streetAddr essLine"
        981      >
        982             
        983       <xsl:for-e ach 
        984        select="$p articipant /n1:addr/n 1:streetAd dressLine"
        985       >
        986                
        987        <xsl:if 
        988         test="stri ng-length( normalize- space(curr ent()))!=0 "
        989        >
        990                   
        991         <br/>
        992                   
        993         <xsl:value -of 
        994          select="."
        995         />
        996                 
        997        </xsl:if>
        998              
        999       </xsl:for- each>
        1000           
        1001      </xsl:if>
        1002          
        1003      <xsl:if 
        1004       test="$par ticipant/n 1:addr/n1: city"
        1005      >
        1006             
        1007       <br/>
        1008             
        1009       <xsl:value -of 
        1010        select="$p articipant /n1:addr/n 1:city"
        1011       />
        1012             
        1013       <xsl:text>
        1014       
        1015       </xsl:text >
        1016           
        1017      </xsl:if>
        1018          
        1019      <xsl:if 
        1020       test="$par ticipant/n 1:addr/n1: state"
        1021      >
        1022             
        1023       <xsl:value -of 
        1024        select="$p articipant /n1:addr/n 1:state"
        1025       />
        1026             
        1027       <xsl:text>
        1028         
        1029       </xsl:text >
        1030           
        1031      </xsl:if>
        1032          
        1033      <xsl:if 
        1034       test="$par ticipant/n 1:addr/n1: postalCode "
        1035      >
        1036             
        1037       <xsl:value -of 
        1038        select="$p articipant /n1:addr/n 1:postalCo de"
        1039       />
        1040           
        1041      </xsl:if>
        1042        
        1043     </xsl:temp late>
        1044    
        1045       
        1046     <xsl:templ ate 
        1047      name="emer Telecom"
        1048     >
        1049          
        1050      <xsl:param  
        1051       name="part icipant"
        1052      />
        1053          
        1054      <xsl:choos e>
        1055             
        1056       <xsl:when 
        1057        test="$par ticipant/n 1:telecom/ @value"
        1058       >
        1059                
        1060        <xsl:for-e ach 
        1061         select="$p articipant /n1:teleco m"
        1062        >
        1063                   
        1064         <xsl:call- template 
        1065          name="getT elecom"
        1066         >
        1067                       
        1068          <xsl:with- param 
        1069           name="tele com" 
        1070           select="."
        1071          />
        1072                    
        1073         </xsl:call -template>
        1074                 
        1075        </xsl:for- each>
        1076              
        1077       </xsl:when >
        1078             
        1079       <xsl:other wise>
        1080                
        1081        <br/>
        1082                
        1083        <b>
        1084                   
        1085         <xsl:text>
        1086          tel: CONTA CT PHONE M ISSING
        1087         </xsl:text >
        1088                 
        1089        </b>
        1090              
        1091       </xsl:othe rwise>
        1092           
        1093      </xsl:choo se>
        1094        
        1095     </xsl:temp late>
        1096    
        1097       
        1098     <xsl:templ ate 
        1099      name="emer Relationsh ip"
        1100     >
        1101          
        1102      <xsl:param  
        1103       name="part icipant"
        1104      />
        1105          
        1106      <xsl:choos e>
        1107             
        1108       <xsl:when 
        1109        test="$par ticipant/n 1:code/@di splayName"
        1110       >
        1111                
        1112        <br/>
        1113                
        1114        <b>
        1115         Relationsh ip: 
        1116        </b>
        1117                
        1118        <xsl:value -of 
        1119         select="$p articipant /n1:code/@ displayNam e"
        1120        />
        1121              
        1122       </xsl:when >
        1123             
        1124       <xsl:when 
        1125        test="$par ticipant/n 1:code/n1: originalTe xt"
        1126       >
        1127                
        1128        <br/>
        1129                
        1130        <b>
        1131         Relationsh ip: 
        1132        </b>
        1133                
        1134        <xsl:value -of 
        1135         select="$p articipant /n1:code/n 1:original Text"
        1136        />
        1137              
        1138       </xsl:when >
        1139           
        1140      </xsl:choo se>
        1141        
        1142     </xsl:temp late>
        1143    
        1144       
        1145     <xsl:templ ate 
        1146      name="emer Type"
        1147     >
        1148          
        1149      <xsl:param  
        1150       name="part icipant"
        1151      />
        1152          
        1153      <xsl:if 
        1154       test="$par ticipant/@ classCode"
        1155      >
        1156             
        1157       <br/>
        1158             
        1159       <b>
        1160        Contact Ty pe: 
        1161       </b>
        1162             
        1163       <xsl:choos e>
        1164                
        1165        <xsl:when 
        1166         test="$par ticipant/@ classCode= 'AGNT'"
        1167        >
        1168                   
        1169         <xsl:text>
        1170          Agent
        1171         </xsl:text >
        1172                 
        1173        </xsl:when >
        1174                
        1175        <xsl:when 
        1176         test="$par ticipant/@ classCode= 'CAREGIVER '"
        1177        >
        1178                   
        1179         <xsl:text>
        1180          Caregiver
        1181         </xsl:text >
        1182                 
        1183        </xsl:when >
        1184                
        1185        <xsl:when 
        1186         test="$par ticipant/@ classCode= 'ECON'"
        1187        >
        1188                   
        1189         <xsl:text>
        1190          Emergency  Contact
        1191         </xsl:text >
        1192                 
        1193        </xsl:when >
        1194                
        1195        <xsl:when 
        1196         test="$par ticipant/@ classCode= 'GUARD'"
        1197        >
        1198                   
        1199         <xsl:text>
        1200          Guardian
        1201         </xsl:text >
        1202                 
        1203        </xsl:when >
        1204                
        1205        <xsl:when 
        1206         test="$par ticipant/@ classCode= 'NOK'"
        1207        >
        1208                   
        1209         <xsl:text>
        1210          Next of ki n
        1211         </xsl:text >
        1212                 
        1213        </xsl:when >
        1214                
        1215        <xsl:when 
        1216         test="$par ticipant/@ classCode= 'PRS'"
        1217        >
        1218                   
        1219         <xsl:text>
        1220          Personal
        1221         </xsl:text >
        1222                 
        1223        </xsl:when >
        1224              
        1225       </xsl:choo se>
        1226           
        1227      </xsl:if>
        1228        
        1229     </xsl:temp late>
        1230    
        1231       
        1232     <xsl:templ ate 
        1233      name="getP articipant "
        1234     >
        1235                       
        1236      <xsl:param  
        1237       name="part icipant"
        1238      />
        1239                       
        1240      <p>
        1241                                 
        1242       <xsl:call- template 
        1243        name="getN ame"
        1244       >
        1245                                           
        1246        <xsl:with- param 
        1247         name="name
        1248         select="$p articipant /n1:associ atedPerson /n1:name"
        1249        />
        1250                                  
        1251       </xsl:call -template>
        1252                                 
        1253       <xsl:if 
        1254        test="$par ticipant/n 1:addr"
        1255       >
        1256                                           
        1257        <xsl:choos e>
        1258                                                    
        1259         <xsl:when 
        1260          test="$isK aiser"
        1261         >
        1262                                                              
        1263          <xsl:call- template 
        1264           name="getS ingleAddre ss"
        1265          >
        1266                                                                        
        1267           <xsl:with- param 
        1268            name="addr
        1269            select="$p articipant /n1:addr"
        1270           />
        1271                                                               
        1272          </xsl:call -template>
        1273                                                     
        1274         </xsl:when >
        1275                                                    
        1276         <xsl:other wise>
        1277                                                              
        1278          <xsl:call- template 
        1279           name="getA ddress"
        1280          >
        1281                                                                        
        1282           <xsl:with- param 
        1283            name="addr
        1284            select="$p articipant /n1:addr"
        1285           />
        1286                                                               
        1287          </xsl:call -template>
        1288                                                     
        1289         </xsl:othe rwise>
        1290                                            
        1291        </xsl:choo se>
        1292                                  
        1293       </xsl:if>
        1294                                 
        1295       <xsl:choos e>
        1296                                           
        1297        <xsl:when 
        1298         test="$par ticipant/n 1:telecom/ @value"
        1299        >
        1300                                                    
        1301         <xsl:for-e ach 
        1302          select="$p articipant /n1:teleco m"
        1303         >
        1304                                                              
        1305          <xsl:call- template 
        1306           name="getT elecom"
        1307          >
        1308                                                                        
        1309           <xsl:with- param 
        1310            name="tele com" 
        1311            select="."
        1312           />
        1313                                                               
        1314          </xsl:call -template>
        1315                                                     
        1316         </xsl:for- each>
        1317                                            
        1318        </xsl:when >
        1319                                           
        1320        <xsl:other wise>
        1321                                                    
        1322         <br/>
        1323                                                    
        1324         <b>
        1325                                                              
        1326          <xsl:text>
        1327           tel: CONTA CT PHONE M ISSING
        1328          </xsl:text >
        1329                                                     
        1330         </b>
        1331                                            
        1332        </xsl:othe rwise>
        1333                                  
        1334       </xsl:choo se>
        1335                                 
        1336       <xsl:if 
        1337        test="$par ticipant/n 1:code/n1: originalTe xt"
        1338       >
        1339                                           
        1340        <br/>
        1341                                           
        1342        <b>
        1343         Relationsh ip: 
        1344        </b>
        1345                                           
        1346        <xsl:value -of 
        1347         select="$p articipant /n1:code/n 1:original Text"
        1348        />
        1349                                  
        1350       </xsl:if>
        1351                        
        1352      </p>
        1353              
        1354     </xsl:temp late>
        1355    
        1356             
        1357     <xsl:templ ate 
        1358      name="getS ingleAddre ss"
        1359     >
        1360                       
        1361      <xsl:param  
        1362       name="addr "
        1363      />
        1364                       
        1365      <xsl:if 
        1366       test="$add r/n1:stree tAddressLi ne != ' '"
        1367      >
        1368                                 
        1369       <br/>
        1370                                 
        1371       <xsl:if 
        1372        test="stri ng-length( $addr/n1:s treetAddre ssLine)>0"
        1373       >
        1374                                           
        1375        <xsl:value -of 
        1376         select="$a ddr/n1:str eetAddress Line"
        1377        />
        1378                                  
        1379       </xsl:if>
        1380      
        1381                                 
        1382       <br/>
        1383                                 
        1384       <xsl:value -of 
        1385        select="$a ddr/n1:cit y"
        1386       />
        1387       ,
        1388                                 
        1389       <xsl:value -of 
        1390        select="$a ddr/n1:sta te"
        1391       />
        1392       ,
        1393                                 
        1394       <xsl:value -of 
        1395        select="$a ddr/n1:pos talCode"
        1396       />
        1397                        
        1398      </xsl:if>
        1399              
        1400     </xsl:temp late>
        1401    
        1402             
        1403     <xsl:templ ate 
        1404      name="getA ddress"
        1405     >
        1406                       
        1407      <xsl:param  
        1408       name="addr "
        1409      />
        1410                       
        1411      <xsl:if 
        1412       test="$add r/n1:stree tAddressLi ne != ' '"
        1413      >
        1414                                 
        1415       <xsl:for-e ach 
        1416        select="$a ddr/n1:str eetAddress Line"
        1417       >
        1418                                           
        1419        <br/>
        1420                                           
        1421        <xsl:if 
        1422         test="stri ng-length( $addr/n1:s treetAddre ssLine)>0"
        1423        >
        1424                                                    
        1425         <xsl:value -of 
        1426          select="."
        1427         />
        1428                                            
        1429        </xsl:if>
        1430                                  
        1431       </xsl:for- each>
        1432                        
        1433      </xsl:if>
        1434                       
        1435      <br/>
        1436                       
        1437      <xsl:value -of 
        1438       select="$a ddr/n1:cit y"
        1439      />
        1440      ,
        1441                       
        1442      <xsl:value -of 
        1443       select="$a ddr/n1:sta te"
        1444      />
        1445      ,
        1446                       
        1447      <xsl:value -of 
        1448       select="$a ddr/n1:pos talCode"
        1449      />
        1450              
        1451     </xsl:temp late>
        1452    
        1453             
        1454     <xsl:templ ate 
        1455      name="getT elecom"
        1456     >
        1457                       
        1458      <xsl:param  
        1459       name="tele com"
        1460      />
        1461                       
        1462      <br/>
        1463                       
        1464      <xsl:if 
        1465       test="stri ng-length( $telecom/@ value)>0"
        1466      >
        1467                                 
        1468       <xsl:value -of 
        1469        select="$t elecom/@va lue"
        1470       />
        1471                                 
        1472       <xsl:choos e>
        1473                                           
        1474        <xsl:when 
        1475         test="./@u se='HP' "
        1476        >
        1477                                                    
        1478         <b>
        1479                                                              
        1480          <xsl:text>
        1481            Home
        1482          </xsl:text >
        1483                                                     
        1484         </b>
        1485                                            
        1486        </xsl:when >
        1487                                           
        1488        <xsl:when 
        1489         test="./@u se='WP' "
        1490        >
        1491                                                    
        1492         <b>
        1493                                                              
        1494          <xsl:text>
        1495            Work
        1496          </xsl:text >
        1497                                                     
        1498         </b>
        1499                                            
        1500        </xsl:when >
        1501                                           
        1502        <xsl:when 
        1503         test="./@u se='HV' "
        1504        >
        1505                                                    
        1506         <b>
        1507                                                              
        1508          <xsl:text>
        1509            Vacation
        1510          </xsl:text >
        1511                                                     
        1512         </b>
        1513                                            
        1514        </xsl:when >
        1515                                           
        1516        <xsl:when 
        1517         test="./@u se='MC' "
        1518        >
        1519                                                    
        1520         <b>
        1521                                                              
        1522          <xsl:text>
        1523            Mobile
        1524          </xsl:text >
        1525                                                     
        1526         </b>
        1527                                            
        1528        </xsl:when >
        1529                                           
        1530        <xsl:other wise>
        1531                                                    
        1532         <b>
        1533                                                              
        1534          <xsl:text>
        1535          </xsl:text >
        1536                                                     
        1537         </b>
        1538                                            
        1539        </xsl:othe rwise>
        1540                                  
        1541       </xsl:choo se>
        1542                        
        1543      </xsl:if>
        1544              
        1545     </xsl:temp late>
        1546    
        1547             
        1548     <!-- Get A uthor  -->
        1549             
        1550     <xsl:templ ate 
        1551      name="getA uthor"
        1552     >
        1553                       
        1554      <xsl:varia ble 
        1555       name="auth or"
        1556      />
        1557                       
        1558      <xsl:call- template 
        1559       name="getN ame"
        1560      >
        1561                                 
        1562       <xsl:with- param 
        1563        name="name
        1564        select="n1 :author/n1 :assignedA uthor/n1:a ssignedPer son/n1:nam e"
        1565       />
        1566                        
        1567      </xsl:call -template>
        1568                       
        1569      <xsl:choos e>
        1570                                 
        1571       <xsl:when 
        1572        test="$aut hor"
        1573       >
        1574                                           
        1575        <xsl:value -of 
        1576         select="n1 :author/n1 :assignedA uthor/n1:a ssignedPer son/n1:nam e"
        1577        />
        1578                                  
        1579       </xsl:when >
        1580                        
        1581      </xsl:choo se>
        1582              
        1583     </xsl:temp late>
        1584    
        1585             
        1586     <!-- Struc turedBody  -->
        1587    
        1588             
        1589     <xsl:templ ate 
        1590      name="disp layProblem ComponentS ection"
        1591     >
        1592                       
        1593      <xsl:call- template 
        1594       name="getC ommonForma tComments"
        1595      />
        1596                       
        1597      <xsl:call- template 
        1598       name="prob lemDetails "
        1599      >
        1600                                 
        1601       <xsl:with- param 
        1602        select="."  
        1603        name="sect ion"
        1604       />
        1605                        
        1606      </xsl:call -template>
        1607              
        1608     </xsl:temp late>
        1609    
        1610             
        1611     <xsl:templ ate 
        1612      name="disp layAllergy ComponentS ection"
        1613     >
        1614                       
        1615      <xsl:call- template 
        1616       name="getC ommonForma tComments"
        1617      />
        1618                       
        1619      <xsl:call- template 
        1620       name="alle rgyDetails "
        1621      >
        1622                                 
        1623       <xsl:with- param 
        1624        select="."  
        1625        name="sect ion"
        1626       />
        1627                        
        1628      </xsl:call -template>
        1629              
        1630     </xsl:temp late>
        1631    
        1632             
        1633     <xsl:templ ate 
        1634      name="disp layMedsCom ponentSect ion"
        1635     >
        1636                       
        1637      <xsl:call- template 
        1638       name="getC ommonForma tComments"
        1639      />
        1640                       
        1641      <xsl:call- template 
        1642       name="medD etails"
        1643      >
        1644                                 
        1645       <xsl:with- param 
        1646        select="."  
        1647        name="sect ion"
        1648       />
        1649                        
        1650      </xsl:call -template>
        1651              
        1652     </xsl:temp late>
        1653    
        1654             
        1655     <xsl:templ ate 
        1656      name="disp layEncount erComponen tSection"
        1657     >
        1658                       
        1659      <xsl:call- template 
        1660       name="enco unterNotic e"
        1661      >
        1662                                 
        1663       <xsl:with- param 
        1664        select="."  
        1665        name="sect ion"
        1666       />
        1667                        
        1668      </xsl:call -template>
        1669                       
        1670      <xsl:call- template 
        1671       name="enco unterDetai ls"
        1672      >
        1673                                 
        1674       <xsl:with- param 
        1675        select="."  
        1676        name="sect ion"
        1677       />
        1678                        
        1679      </xsl:call -template>
        1680              
        1681     </xsl:temp late>
        1682    
        1683             
        1684     <xsl:templ ate 
        1685      name="disp layResults ComponentS ection"
        1686     >
        1687                       
        1688      <xsl:call- template 
        1689       name="getC ommonForma tComments"
        1690      />
        1691                       
        1692      <xsl:call- template 
        1693       name="resu ltsDetails "
        1694      >
        1695                                 
        1696       <xsl:with- param 
        1697        select="."  
        1698        name="sect ion"
        1699       />
        1700                        
        1701      </xsl:call -template>
        1702              
        1703     </xsl:temp late>
        1704    
        1705             
        1706     <xsl:templ ate 
        1707      name="disp layProcedu resCompone ntSection"
        1708     >
        1709                       
        1710      <xsl:call- template 
        1711       name="proc eduresNoti ce"
        1712      >
        1713                                 
        1714       <xsl:with- param 
        1715        select="."  
        1716        name="sect ion"
        1717       />
        1718                        
        1719      </xsl:call -template>
        1720                       
        1721      <xsl:call- template 
        1722       name="proc eduresDeta ils"
        1723      >
        1724                                 
        1725       <xsl:with- param 
        1726        select="."  
        1727        name="sect ion"
        1728       />
        1729                        
        1730      </xsl:call -template>
        1731              
        1732     </xsl:temp late>
        1733    
        1734             
        1735     <xsl:templ ate 
        1736      name="disp layImmuniz ationsComp onentSecti on"
        1737     >
        1738                       
        1739      <xsl:call- template 
        1740       name="getC ommonForma tComments"
        1741      />
        1742                       
        1743      <xsl:call- template 
        1744       name="immu nizationsD etails"
        1745      >
        1746                                 
        1747       <xsl:with- param 
        1748        select="."  
        1749        name="sect ion"
        1750       />
        1751                        
        1752      </xsl:call -template>
        1753              
        1754     </xsl:temp late>
        1755    
        1756             
        1757     <xsl:templ ate 
        1758      name="disp layVitalsC omponentSe ction"
        1759     >
        1760                       
        1761      <xsl:call- template 
        1762       name="getC ommonForma tComments"
        1763      />
        1764                       
        1765      <xsl:call- template 
        1766       name="vita lsDetails"
        1767      >
        1768                                 
        1769       <xsl:with- param 
        1770        select="."  
        1771        name="sect ion"
        1772       />
        1773                        
        1774      </xsl:call -template>
        1775              
        1776     </xsl:temp late>
        1777             
        1778             
        1779     <!-- Encou nter Detai l Section- ->
        1780       
        1781     <xsl:templ ate 
        1782      name="enco unterDetai ls"
        1783     >
        1784          
        1785      <xsl:param  
        1786       name="sect ion"
        1787      />
        1788          
        1789      <xsl:if 
        1790       test="$sec tion/n1:en try"
        1791      >
        1792             
        1793       <table 
        1794        border="1"  
        1795        style="fon t-size:14p x;"
        1796       >
        1797                
        1798        <thead>
        1799                   
        1800         <tr>
        1801                       
        1802          <th 
        1803           class="fir st"
        1804          >
        1805                          
        1806           <xsl:text>
        1807            Date/Time
        1808           </xsl:text >
        1809                          
        1810           <xsl:if 
        1811            test="n1:e ntry/n1:en counter"
        1812           >
        1813                             
        1814            <xsl:text>
        1815              - Count (
        1816            </xsl:text >
        1817                             
        1818            <xsl:value -of 
        1819             select="co unt(n1:ent ry/n1:enco unter)"
        1820            />
        1821                             
        1822            <xsl:text>
        1823             )
        1824            </xsl:text >
        1825                           
        1826           </xsl:if>
        1827                        
        1828          </th>
        1829                       
        1830          <th 
        1831           class="fir st"
        1832          >
        1833           Encounter  Type
        1834          </th>
        1835                       
        1836          <th 
        1837           class="fir st"
        1838          >
        1839           Encounter  Comments
        1840          </th>
        1841                       
        1842          <th 
        1843           class="fir st"
        1844          >
        1845           Provider
        1846          </th>
        1847                    
        1848         </tr>
        1849                 
        1850        </thead>
        1851                
        1852        <tbody>
        1853                   
        1854         <xsl:apply -templates  
        1855          select="$s ection/n1: entry"
        1856         >
        1857                       
        1858          <xsl:sort 
        1859           select="n1 :encounter /n1:effect iveTime/n1 :low/@valu e" 
        1860           order="des cending"
        1861          />
        1862                    
        1863         </xsl:appl y-template s>
        1864                 
        1865        </tbody>
        1866              
        1867       </table>
        1868           
        1869      </xsl:if>
        1870          
        1871      <br>
        1872      </br>
        1873          
        1874      <xsl:choos e>
        1875             
        1876       <xsl:when 
        1877        test="not( boolean(n1 :entry/n1: encounter) )"
        1878       >
        1879                
        1880        <xsl:call- template 
        1881         name="noDa ta"
        1882        />
        1883              
        1884       </xsl:when >
        1885             
        1886       <xsl:other wise>
        1887                
        1888        <br>
        1889        </br>
        1890              
        1891       </xsl:othe rwise>
        1892           
        1893      </xsl:choo se>
        1894        
        1895     </xsl:temp late>
        1896    
        1897       
        1898     <!-- Meds  Detail Sec tion -->
        1899       
        1900     <xsl:templ ate 
        1901      name="medD etails"
        1902     >
        1903          
        1904      <xsl:param  
        1905       name="sect ion"
        1906      />
        1907          
        1908      <xsl:if 
        1909       test="$sec tion/n1:en try"
        1910      >
        1911             
        1912       <table 
        1913        border="1"  
        1914        style="fon t-size:14p x"
        1915       >
        1916                
        1917        <thead>
        1918                   
        1919         <tr>
        1920                       
        1921          <th 
        1922           class="fir st"
        1923          >
        1924                          
        1925           <xsl:text>
        1926            Medication s
        1927           </xsl:text >
        1928                          
        1929           <xsl:if 
        1930            test="n1:e ntry/n1:su bstanceAdm inistratio n"
        1931           >
        1932                             
        1933            <xsl:text>
        1934              - Count (
        1935            </xsl:text >
        1936                             
        1937            <xsl:value -of 
        1938             select="co unt(n1:ent ry/n1:subs tanceAdmin istration) "
        1939            />
        1940                             
        1941            <xsl:text>
        1942             )
        1943            </xsl:text >
        1944                           
        1945           </xsl:if>
        1946                        
        1947          </th>
        1948                       
        1949          <!--<th cl ass="first ">Route</t h>-->
        1950                       
        1951          <!--<th cl ass="first ">Interval </th>-->
        1952                       
        1953          <th 
        1954           class="fir st"
        1955          >
        1956           Status
        1957          </th>
        1958                       
        1959          <th 
        1960           class="fir st"
        1961          >
        1962           Quantity
        1963          </th>
        1964                       
        1965          <th 
        1966           class="fir st"
        1967          >
        1968           Order Expi ration
        1969          </th>
        1970                       
        1971          <th 
        1972           class="fir st"
        1973          >
        1974           Provider
        1975          </th>
        1976                       
        1977          <th 
        1978           class="fir st"
        1979          >
        1980           Prescripti on #
        1981          </th>
        1982                       
        1983          <th 
        1984           class="fir st"
        1985          >
        1986           Dispense D ate
        1987          </th>
        1988                       
        1989          <th 
        1990           class="fir st"
        1991          >
        1992           Sig
        1993          </th>
        1994                       
        1995          <th 
        1996           class="fir st"
        1997          >
        1998           Source
        1999          </th>
        2000                    
        2001         </tr>
        2002                 
        2003        </thead>
        2004                
        2005        <tbody>
        2006                   
        2007         <xsl:choos e>
        2008                       
        2009          <xsl:when 
        2010           test="$sec tion/n1:en try/n1:sub stanceAdmi nistration /n1:effect iveTime/n1 :high"
        2011          >
        2012                          
        2013           <xsl:apply -templates  
        2014            select="$s ection/n1: entry"
        2015           >
        2016                             
        2017            <xsl:sort 
        2018             select="n1 :substance Administra tion/n1:ef fectiveTim e/n1:high/ @value"
        2019            />
        2020                           
        2021           </xsl:appl y-template s>
        2022                        
        2023          </xsl:when >
        2024                       
        2025          <xsl:other wise>
        2026                          
        2027           <xsl:apply -templates  
        2028            select="$s ection/n1: entry"
        2029           >
        2030                             
        2031            <xsl:sort 
        2032             select="n1 :substance Administra tion/n1:en tryRelatio nship/n1:s upply/n1:e ffectiveTi me/@value"
        2033            />
        2034                           
        2035           </xsl:appl y-template s>
        2036                        
        2037          </xsl:othe rwise>
        2038                    
        2039         </xsl:choo se>
        2040                 
        2041        </tbody>
        2042              
        2043       </table>
        2044           
        2045      </xsl:if>
        2046          
        2047      <br>
        2048      </br>
        2049          
        2050      <xsl:choos e>
        2051             
        2052       <xsl:when 
        2053        test="not( boolean(n1 :entry/n1: substanceA dministrat ion))"
        2054       >
        2055                
        2056        <xsl:call- template 
        2057         name="noDa ta"
        2058        />
        2059                
        2060        <br>
        2061        </br>
        2062              
        2063       </xsl:when >
        2064             
        2065       <xsl:other wise>
        2066                
        2067        <br>
        2068        </br>
        2069              
        2070       </xsl:othe rwise>
        2071           
        2072      </xsl:choo se>
        2073        
        2074     </xsl:temp late>
        2075    
        2076       
        2077     <!-- Probl em Detail  Section -- >
        2078       
        2079     <xsl:templ ate 
        2080      name="prob lemDetails "
        2081     >
        2082          
        2083      <xsl:param  
        2084       name="sect ion"
        2085      />
        2086          
        2087      <xsl:if 
        2088       test="$sec tion/n1:en try"
        2089      >
        2090             
        2091       <table 
        2092        border="1"  
        2093        style="fon t-size:14p x"
        2094       >
        2095                
        2096        <thead>
        2097                   
        2098         <tr>
        2099                       
        2100          <th 
        2101           class="fir st"
        2102          >
        2103                          
        2104           <xsl:text>
        2105            Problems
        2106           </xsl:text >
        2107                          
        2108           <xsl:if 
        2109            test="n1:e ntry/n1:ac t/n1:entry Relationsh ip[@typeCo de='SUBJ'] /n1:observ ation"
        2110           >
        2111                             
        2112            <xsl:text>
        2113              - Count (
        2114            </xsl:text >
        2115                             
        2116            <xsl:value -of 
        2117             select="co unt(n1:ent ry/n1:act/ n1:entryRe lationship [@typeCode ='SUBJ']/n 1:observat ion)"
        2118            />
        2119                             
        2120            <xsl:text>
        2121             )
        2122            </xsl:text >
        2123                           
        2124           </xsl:if>
        2125                        
        2126          </th>
        2127                       
        2128          <th 
        2129           class="fir st"
        2130          >
        2131           Status
        2132          </th>
        2133                       
        2134          <th 
        2135           class="fir st"
        2136          >
        2137           Problem Co de
        2138          </th>
        2139                       
        2140          <th 
        2141           class="fir st"
        2142          >
        2143           Date of On set
        2144          </th>
        2145                       
        2146          <th 
        2147           class="fir st"
        2148          >
        2149           Provider
        2150          </th>
        2151                       
        2152          <th 
        2153           class="fir st"
        2154          >
        2155           Source
        2156          </th>
        2157                    
        2158         </tr>
        2159                 
        2160        </thead>
        2161                
        2162        <tbody>
        2163                   
        2164         <xsl:choos e>
        2165                       
        2166          <xsl:when 
        2167           test="$sec tion/n1:en try/n1:act /n1:entryR elationshi p/n1:obser vation/n1: effectiveT ime/n1:low "
        2168          >
        2169                          
        2170           <xsl:apply -templates  
        2171            select="$s ection/n1: entry"
        2172           >
        2173                             
        2174            <xsl:sort 
        2175             select="n1 :act/n1:en tryRelatio nship/n1:o bservation /n1:effect iveTime/n1 :low/@valu e" 
        2176             order="des cending"
        2177            />
        2178                           
        2179           </xsl:appl y-template s>
        2180                        
        2181          </xsl:when >
        2182                       
        2183          <xsl:other wise>
        2184                          
        2185           <xsl:apply -templates  
        2186            select="$s ection/n1: entry"
        2187           >
        2188                             
        2189            <xsl:sort 
        2190             select="n1 :act/n1:ef fectiveTim e/n1:low/@ value" 
        2191             order="des cending"
        2192            />
        2193                           
        2194           </xsl:appl y-template s>
        2195                        
        2196          </xsl:othe rwise>
        2197                    
        2198         </xsl:choo se>
        2199                 
        2200        </tbody>
        2201              
        2202       </table>
        2203           
        2204      </xsl:if>
        2205          
        2206      <br>
        2207      </br>
        2208          
        2209      <xsl:choos e>
        2210             
        2211       <xsl:when 
        2212        test="not( boolean(n1 :entry/n1: act/n1:ent ryRelation ship[@type Code='SUBJ ']/n1:obse rvation))"
        2213       >
        2214                
        2215        <xsl:call- template 
        2216         name="noDa ta"
        2217        />
        2218              
        2219       </xsl:when >
        2220             
        2221       <xsl:other wise>
        2222                
        2223        <br>
        2224        </br>
        2225              
        2226       </xsl:othe rwise>
        2227           
        2228      </xsl:choo se>
        2229        
        2230     </xsl:temp late>
        2231    
        2232       
        2233     <!-- Aller gy Detail  Section -- >
        2234       
        2235     <xsl:templ ate 
        2236      name="alle rgyDetails "
        2237     >
        2238          
        2239      <xsl:param  
        2240       name="sect ion"
        2241      />
        2242          
        2243      <xsl:if 
        2244       test="$sec tion/n1:en try"
        2245      >
        2246             
        2247       <table 
        2248        border="1"  
        2249        style="fon t-size:14p x"
        2250       >
        2251                
        2252        <thead>
        2253                   
        2254         <tr>
        2255                       
        2256          <th 
        2257           class="fir st"
        2258          >
        2259                          
        2260           <xsl:text>
        2261            Allergens
        2262           </xsl:text >
        2263                          
        2264           <xsl:if 
        2265            test="n1:e ntry/n1:ac t/n1:entry Relationsh ip/n1:obse rvation"
        2266           >
        2267                             
        2268            <xsl:text>
        2269              - Count (
        2270            </xsl:text >
        2271                             
        2272            <xsl:value -of 
        2273             select="co unt(n1:ent ry/n1:act/ n1:entryRe lationship /n1:observ ation)"
        2274            />
        2275                             
        2276            <xsl:text>
        2277             )
        2278            </xsl:text >
        2279                           
        2280           </xsl:if>
        2281                        
        2282          </th>
        2283                       
        2284          <th 
        2285           class="fir st"
        2286          >
        2287           Verificati on Date
        2288          </th>
        2289                       
        2290          <th 
        2291           class="fir st"
        2292          >
        2293           Event Type
        2294          </th>
        2295                       
        2296          <th 
        2297           class="fir st"
        2298          >
        2299           Reaction
        2300          </th>
        2301                       
        2302          <th 
        2303           class="fir st"
        2304          >
        2305           Severity
        2306          </th>
        2307                       
        2308          <th 
        2309           class="fir st"
        2310          >
        2311           Source
        2312          </th>
        2313                    
        2314         </tr>
        2315                 
        2316        </thead>
        2317                
        2318        <tbody>
        2319                   
        2320         <xsl:choos e>
        2321                       
        2322          <xsl:when 
        2323           test="$sec tion/n1:en try/n1:act /n1:entryR elationshi p/n1:obser vation/n1: effectiveT ime/n1:low "
        2324          >
        2325                          
        2326           <xsl:apply -templates  
        2327            select="$s ection/n1: entry"
        2328           >
        2329                             
        2330            <xsl:sort 
        2331             select="n1 :act/n1:en tryRelatio nship/n1:o bservation /n1:effect iveTime/n1 :low/@valu e" 
        2332             order="des cending"
        2333            />
        2334                           
        2335           </xsl:appl y-template s>
        2336                        
        2337          </xsl:when >
        2338                       
        2339          <xsl:other wise>
        2340                          
        2341           <xsl:apply -templates  
        2342            select="$s ection/n1: entry"
        2343           >
        2344                             
        2345            <xsl:sort 
        2346             select="n1 :act/n1:ef fectiveTim e/n1:low/@ value" 
        2347             order="des cending"
        2348            />
        2349                           
        2350           </xsl:appl y-template s>
        2351                        
        2352          </xsl:othe rwise>
        2353                    
        2354         </xsl:choo se>
        2355                 
        2356        </tbody>
        2357              
        2358       </table>
        2359           
        2360      </xsl:if>
        2361          
        2362      <br>
        2363      </br>
        2364          
        2365      <xsl:choos e>
        2366             
        2367       <xsl:when 
        2368        test="not( boolean(n1 :entry/n1: act/n1:ent ryRelation ship/n1:ob servation) )"
        2369       >
        2370                
        2371        <xsl:call- template 
        2372         name="noDa ta"
        2373        />
        2374              
        2375       </xsl:when >
        2376             
        2377       <xsl:other wise>
        2378                
        2379        <br>
        2380        </br>
        2381              
        2382       </xsl:othe rwise>
        2383           
        2384      </xsl:choo se>
        2385        
        2386     </xsl:temp late>
        2387    
        2388       
        2389     <!-- (Lab) Results De tail Secti on-->
        2390       
        2391     <xsl:templ ate 
        2392      name="resu ltsDetails "
        2393     >
        2394          
        2395      <xsl:param  
        2396       name="sect ion"
        2397      />
        2398          
        2399      <xsl:if 
        2400       test="$sec tion/n1:en try"
        2401      >
        2402             
        2403       <table 
        2404        border="1"  
        2405        style="fon t-size:14p x"
        2406       >
        2407                
        2408        <thead>
        2409                   
        2410         <tr>
        2411                       
        2412          <th 
        2413           class="fir st"
        2414          >
        2415                          
        2416           <xsl:text>
        2417            Date/Time
        2418           </xsl:text >
        2419                          
        2420           <xsl:choos e>
        2421                             
        2422            <xsl:when 
        2423             test="n1:e ntry/n1:or ganizer/n1 :component /n1:observ ation and  not(boolea n(n1:entry /n1:observ ation))"
        2424            >
        2425                                
        2426             <xsl:text>
        2427               - Count (
        2428             </xsl:text >
        2429                                
        2430             <xsl:value -of 
        2431              select="co unt(n1:ent ry/n1:orga nizer/n1:c omponent)"
        2432             />
        2433                                
        2434             <xsl:text>
        2435              )
        2436             </xsl:text >
        2437                              
        2438            </xsl:when >
        2439                             
        2440            <xsl:when 
        2441             test="n1:e ntry/n1:or ganizer/n1 :component /n1:observ ation and  n1:entry/n 1:observat ion"
        2442            >
        2443                                
        2444             <xsl:text>
        2445               - Count (
        2446             </xsl:text >
        2447                                
        2448             <xsl:value -of 
        2449              select="co unt(n1:ent ry/n1:orga nizer/n1:c omponent)+ count(n1:e ntry/n1:ob servation) "
        2450             />
        2451                                
        2452             <xsl:text>
        2453              )
        2454             </xsl:text >
        2455                              
        2456            </xsl:when >
        2457                             
        2458            <xsl:other wise>
        2459                                
        2460             <xsl:if 
        2461              test="n1:e ntry/n1:ob servation"
        2462             >
        2463                                   
        2464              <xsl:text>
        2465                - Count (
        2466              </xsl:text >
        2467                                   
        2468              <xsl:value -of 
        2469               select="co unt(n1:ent ry/n1:obse rvation)"
        2470              />
        2471                                   
        2472              <xsl:text>
        2473               )
        2474              </xsl:text >
        2475                                 
        2476             </xsl:if>
        2477                              
        2478            </xsl:othe rwise>
        2479                           
        2480           </xsl:choo se>
        2481                        
        2482          </th>
        2483                       
        2484          <th 
        2485           class="fir st"
        2486          >
        2487           Result Typ e
        2488          </th>
        2489                       
        2490          <th 
        2491           class="fir st"
        2492          >
        2493           Source
        2494          </th>
        2495                       
        2496          <th 
        2497           class="fir st"
        2498          >
        2499           Result - U nit
        2500          </th>
        2501                       
        2502          <th 
        2503           class="fir st"
        2504          >
        2505           Interpreta tion
        2506          </th>
        2507                       
        2508          <th 
        2509           class="fir st"
        2510          >
        2511           Reference  Range
        2512          </th>
        2513                       
        2514          <th 
        2515           class="fir st"
        2516          >
        2517           Status
        2518          </th>
        2519                    
        2520         </tr>
        2521                 
        2522        </thead>
        2523                
        2524        <tbody>
        2525                   
        2526         <xsl:choos e>
        2527                       
        2528          <xsl:when 
        2529           test="n1:o bservation /n1:effect iveTime/@v alue"
        2530          >
        2531                          
        2532           <xsl:apply -templates  
        2533            select="$s ection/n1: entry"
        2534           >
        2535                             
        2536            <xsl:sort 
        2537             select="n1 :observati on/n1:effe ctiveTime/ @value" 
        2538             order="des cending"
        2539            />
        2540                           
        2541           </xsl:appl y-template s>
        2542                        
        2543          </xsl:when >
        2544                       
        2545          <xsl:other wise>
        2546                          
        2547           <xsl:apply -templates  
        2548            select="$s ection/n1: entry"
        2549           >
        2550                             
        2551            <xsl:sort 
        2552             select="n1 :organizer /n1:compon ent/n1:obs ervation/n 1:effectiv eTime/@val ue" 
        2553             order="des cending"
        2554            />
        2555                           
        2556           </xsl:appl y-template s>
        2557                        
        2558          </xsl:othe rwise>
        2559                    
        2560         </xsl:choo se>
        2561                 
        2562        </tbody>
        2563              
        2564       </table>
        2565           
        2566      </xsl:if>
        2567          
        2568      <br>
        2569      </br>
        2570          
        2571      <xsl:choos e>
        2572             
        2573       <xsl:when 
        2574        test="not( boolean(n1 :entry/n1: observatio n)) and no t(boolean( n1:entry/n 1:organize r/n1:compo nent/n1:ob servation[ @classCode ='OBS' and  @moodCode ='EVN']))"
        2575       >
        2576                
        2577        <xsl:call- template 
        2578         name="noDa ta"
        2579        />
        2580              
        2581       </xsl:when >
        2582             
        2583       <xsl:other wise>
        2584                
        2585        <br>
        2586        </br>
        2587              
        2588       </xsl:othe rwise>
        2589           
        2590      </xsl:choo se>
        2591        
        2592     </xsl:temp late>
        2593    
        2594       
        2595     <!-- Proce dures Deta il Section -->
        2596       
        2597     <xsl:templ ate 
        2598      name="proc eduresDeta ils"
        2599     >
        2600          
        2601      <xsl:param  
        2602       name="sect ion"
        2603      />
        2604          
        2605      <xsl:if 
        2606       test="$sec tion/n1:en try"
        2607      >
        2608             
        2609       <table 
        2610        border="1"  
        2611        style="fon t-size:14p x"
        2612       >
        2613                
        2614        <thead>
        2615                   
        2616         <tr>
        2617                       
        2618          <th 
        2619           class="fir st"
        2620          >
        2621                          
        2622           <xsl:text>
        2623            Date/Time
        2624           </xsl:text >
        2625                          
        2626           <xsl:if 
        2627            test="n1:e ntry/n1:pr ocedure"
        2628           >
        2629                             
        2630            <xsl:text>
        2631              - Count (
        2632            </xsl:text >
        2633                             
        2634            <xsl:value -of 
        2635             select="co unt(n1:ent ry/n1:proc edure)"
        2636            />
        2637                             
        2638            <xsl:text>
        2639             )
        2640            </xsl:text >
        2641                           
        2642           </xsl:if>
        2643                        
        2644          </th>
        2645                       
        2646          <th 
        2647           class="fir st"
        2648          >
        2649           Procedure  Type
        2650          </th>
        2651                       
        2652          <th 
        2653           class="fir st"
        2654          >
        2655           Procedure  Comments
        2656          </th>
        2657                       
        2658          <th 
        2659           class="fir st"
        2660          >
        2661           Provider
        2662          </th>
        2663                    
        2664         </tr>
        2665                 
        2666        </thead>
        2667                
        2668        <tbody>
        2669                   
        2670         <xsl:apply -templates  
        2671          select="$s ection/n1: entry"
        2672         >
        2673                       
        2674          <xsl:sort 
        2675           select="n1 :procedure /n1:effect iveTime/n1 :low/@valu e" 
        2676           order="des cending"
        2677          />
        2678                    
        2679         </xsl:appl y-template s>
        2680                 
        2681        </tbody>
        2682              
        2683       </table>
        2684           
        2685      </xsl:if>
        2686          
        2687      <br>
        2688      </br>
        2689          
        2690      <xsl:choos e>
        2691             
        2692       <xsl:when 
        2693        test="not( boolean(n1 :entry/n1: procedure) )"
        2694       >
        2695                
        2696        <xsl:call- template 
        2697         name="noDa ta"
        2698        />
        2699              
        2700       </xsl:when >
        2701             
        2702       <xsl:other wise>
        2703                
        2704        <br>
        2705        </br>
        2706              
        2707       </xsl:othe rwise>
        2708           
        2709      </xsl:choo se>
        2710        
        2711     </xsl:temp late>
        2712    
        2713       
        2714     <!-- Immun izations D etail Sect ion -->
        2715       
        2716     <xsl:templ ate 
        2717      name="immu nizationsD etails"
        2718     >
        2719          
        2720      <xsl:param  
        2721       name="sect ion"
        2722      />
        2723          
        2724      <xsl:if 
        2725       test="$sec tion/n1:en try"
        2726      >
        2727             
        2728       <table 
        2729        border="1"  
        2730        style="fon t-size:14p x"
        2731       >
        2732                
        2733        <thead>
        2734                   
        2735         <tr>
        2736                       
        2737          <th 
        2738           class="fir st"
        2739          >
        2740                          
        2741           <xsl:text>
        2742            Immunizati ons
        2743           </xsl:text >
        2744                          
        2745           <xsl:if 
        2746            test="n1:e ntry/n1:su bstanceAdm inistratio n"
        2747           >
        2748                             
        2749            <xsl:text>
        2750              - Count (
        2751            </xsl:text >
        2752                             
        2753            <xsl:value -of 
        2754             select="co unt(n1:ent ry/n1:subs tanceAdmin istration) "
        2755            />
        2756                             
        2757            <xsl:text>
        2758             )
        2759            </xsl:text >
        2760                           
        2761           </xsl:if>
        2762                        
        2763          </th>
        2764                       
        2765          <th 
        2766           class="fir st"
        2767          >
        2768           Series
        2769          </th>
        2770                       
        2771          <th 
        2772           class="fir st"
        2773          >
        2774           Date Issue d
        2775          </th>
        2776                       
        2777          <th 
        2778           class="fir st"
        2779          >
        2780           Reaction
        2781          </th>
        2782                       
        2783          <th 
        2784           class="fir st"
        2785          >
        2786           Comments
        2787          </th>
        2788                    
        2789         </tr>
        2790                 
        2791        </thead>
        2792                
        2793        <tbody>
        2794                   
        2795         <xsl:apply -templates  
        2796          select="$s ection/n1: entry"
        2797         >
        2798                       
        2799          <xsl:sort 
        2800           select="n1 :substance Administra tion/n1:ef fectiveTim e/@value" 
        2801           order="des cending"
        2802          />
        2803                    
        2804         </xsl:appl y-template s>
        2805                 
        2806        </tbody>
        2807              
        2808       </table>
        2809           
        2810      </xsl:if>
        2811          
        2812      <br>
        2813      </br>
        2814          
        2815      <br>
        2816      </br>
        2817        
        2818     </xsl:temp late>
        2819    
        2820       
        2821     <!-- Vital s Detail S ection -->
        2822       
        2823     <xsl:templ ate 
        2824      name="vita lsDetails"
        2825     >
        2826          
        2827      <xsl:param  
        2828       name="sect ion"
        2829      />
        2830          
        2831      <xsl:if 
        2832       test="$sec tion/n1:en try"
        2833      >
        2834             
        2835       <table 
        2836        border="1"  
        2837        style="fon t-size:14p x"
        2838       >
        2839                
        2840        <thead>
        2841                   
        2842         <tr>
        2843                       
        2844          <th 
        2845           class="fir st"
        2846          >
        2847                          
        2848           <xsl:text>
        2849            Date
        2850           </xsl:text >
        2851                          
        2852           <xsl:if 
        2853            test="n1:e ntry/n1:or ganizer"
        2854           >
        2855                             
        2856            <xsl:text>
        2857              - Count (
        2858            </xsl:text >
        2859                             
        2860            <xsl:value -of 
        2861             select="co unt(n1:ent ry/n1:orga nizer)"
        2862            />
        2863                             
        2864            <xsl:text>
        2865             )
        2866            </xsl:text >
        2867                           
        2868           </xsl:if>
        2869                        
        2870          </th>
        2871                       
        2872          <th 
        2873           class="fir st"
        2874          >
        2875           TEMP
        2876          </th>
        2877                       
        2878          <th 
        2879           class="fir st"
        2880          >
        2881           PULSE
        2882          </th>
        2883                       
        2884          <th 
        2885           class="fir st"
        2886          >
        2887           RESP
        2888          </th>
        2889                       
        2890          <th 
        2891           class="fir st"
        2892          >
        2893           BP
        2894          </th>
        2895                       
        2896          <th 
        2897           class="fir st"
        2898          >
        2899           Ht
        2900          </th>
        2901                       
        2902          <th 
        2903           class="fir st"
        2904          >
        2905           HT-Lying
        2906          </th>
        2907                       
        2908          <th 
        2909           class="fir st"
        2910          >
        2911           Wt
        2912          </th>
        2913                       
        2914          <th 
        2915           class="fir st"
        2916          >
        2917           POx
        2918          </th>
        2919                       
        2920          <th 
        2921           class="fir st"
        2922          >
        2923           OFC
        2924          </th>
        2925                       
        2926          <th 
        2927           class="fir st"
        2928          >
        2929           Source
        2930          </th>
        2931                    
        2932         </tr>
        2933                 
        2934        </thead>
        2935                
        2936        <tbody>
        2937                   
        2938         <xsl:apply -templates  
        2939          select="$s ection/n1: entry"
        2940         >
        2941                       
        2942          <xsl:sort 
        2943           select="n1 :organizer /n1:compon ent/n1:obs ervation/n 1:effectiv eTime/@val ue" 
        2944           order="des cending"
        2945          />
        2946                    
        2947         </xsl:appl y-template s>
        2948                   
        2949         <br/>
        2950                 
        2951        </tbody>
        2952              
        2953       </table>
        2954           
        2955      </xsl:if>
        2956          
        2957      <br>
        2958      </br>
        2959          
        2960      <br>
        2961      </br>
        2962        
        2963     </xsl:temp late>
        2964    
        2965             
        2966     <!-- Encou nter row e ntry -->
        2967             
        2968     <xsl:templ ate 
        2969      name="encR ow"
        2970     >
        2971                       
        2972      <xsl:param  
        2973       name="row"
        2974      />
        2975                       
        2976      <tr 
        2977       class="sec ond"
        2978      >
        2979      
        2980                                 
        2981       <!-- Encou nter Date/ Time-->
        2982                                 
        2983       <td>
        2984                                           
        2985        <div 
        2986         style="ove rflow:hidd en; white- space:nowr ap; width: auto;"
        2987        >
        2988                                                    
        2989         <xsl:choos e>
        2990                                                              
        2991          <xsl:when 
        2992           test="$row /n1:encoun ter/n1:eff ectiveTime /n1:low/@v alue"
        2993          >
        2994                                                                        
        2995           <xsl:call- template 
        2996            name="form atDateShor t"
        2997           >
        2998                                                                                  
        2999            <xsl:with- param 
        3000             name="date String" 
        3001             select="$r ow/n1:enco unter/n1:e ffectiveTi me/n1:low/ @value"
        3002            />
        3003                                                                         
        3004           </xsl:call -template>
        3005                                                               
        3006          </xsl:when >
        3007                                                              
        3008          <xsl:when 
        3009           test="$row /n1:encoun ter/n1:eff ectiveTime /@value"
        3010          >
        3011                                                                        
        3012           <xsl:call- template 
        3013            name="form atDateShor t"
        3014           >
        3015                                                                                  
        3016            <xsl:with- param 
        3017             name="date String" 
        3018             select="$r ow/n1:enco unter/n1:e ffectiveTi me/@value"
        3019            />
        3020                                                                         
        3021           </xsl:call -template>
        3022                                                               
        3023          </xsl:when >
        3024                                                              
        3025          <xsl:other wise>
        3026                                                                        
        3027           <xsl:call- template 
        3028            name="na"
        3029           />
        3030                                                               
        3031          </xsl:othe rwise>
        3032                                                     
        3033         </xsl:choo se>
        3034                                            
        3035        </div>
        3036                                  
        3037       </td>
        3038      
        3039                                 
        3040       <!-- Encou nter Type   -->
        3041                                 
        3042       <td>
        3043                                           
        3044        <div 
        3045         style="ove rflow:hidd en; white- space:nowr ap; width: auto;"
        3046        >
        3047                                                    
        3048         <xsl:varia ble 
        3049          name="type Result"
        3050         >
        3051                                                              
        3052          <xsl:call- template 
        3053           name="getE ncounterTy pe"
        3054          >
        3055                                                                        
        3056           <xsl:with- param 
        3057            name="enco unter" 
        3058            select="$r ow/n1:enco unter"
        3059           />
        3060                                                               
        3061          </xsl:call -template>
        3062                                                     
        3063         </xsl:vari able>
        3064                                                    
        3065         <xsl:choos e>
        3066                                                              
        3067          <xsl:when 
        3068           test="stri ng-length( $typeResul t)>0"
        3069          >
        3070                                                                        
        3071           <xsl:call- template 
        3072            name="flyo verSpan"
        3073           >
        3074                                                                                  
        3075            <xsl:with- param 
        3076             name="data
        3077             select="$t ypeResult"
        3078            />
        3079                                                                         
        3080           </xsl:call -template>
        3081                                                               
        3082          </xsl:when >
        3083                                                              
        3084          <xsl:other wise>
        3085                                                                        
        3086           <xsl:call- template 
        3087            name="na"
        3088           />
        3089                                                               
        3090          </xsl:othe rwise>
        3091                                                     
        3092         </xsl:choo se>
        3093        
        3094                                            
        3095        </div>
        3096                                  
        3097       </td>
        3098      
        3099                                 
        3100       <!-- Encou nter Free  Text -->
        3101                                 
        3102       <td>
        3103                                           
        3104        <div 
        3105         style="ove rflow:hidd en; white- space:nowr ap; width: 360px;heig ht:1em"
        3106        >
        3107                                                    
        3108         <xsl:varia ble 
        3109          name="encF reeText"
        3110         >
        3111                                                              
        3112          <xsl:call- template 
        3113           name="ltri m"
        3114          >
        3115                                                                        
        3116           <xsl:with- param 
        3117            name="text "
        3118           >
        3119                                                                                  
        3120            <xsl:call- template 
        3121             name="getE ncounterFr eeText"
        3122            >
        3123                                                                                            
        3124             <xsl:with- param 
        3125              name="enco unter" 
        3126              select="$r ow/n1:enco unter"
        3127             />
        3128                                                                                   
        3129            </xsl:call -template>
        3130                                                                         
        3131           </xsl:with -param>
        3132                                                                        
        3133           <xsl:with- param 
        3134            name="star tChar" 
        3135            select="'~ '"
        3136           />
        3137                                                               
        3138          </xsl:call -template>
        3139                                                     
        3140         </xsl:vari able>
        3141                                                    
        3142         <xsl:choos e>
        3143                                                              
        3144          <xsl:when 
        3145           test="stri ng-length( $encFreeTe xt)>1"
        3146          >
        3147                                                                        
        3148           <xsl:call- template 
        3149            name="flyo verSpan"
        3150           >
        3151                                                                                  
        3152            <xsl:with- param 
        3153             name="data
        3154             select="$e ncFreeText "
        3155            />
        3156                                                                                  
        3157            <xsl:with- param 
        3158             name="free Text" 
        3159             select="'y es'"
        3160            />
        3161                                                                                  
        3162            <xsl:with- param 
        3163             name="deSq uigglefy" 
        3164             select="'y es'"
        3165            />
        3166                                                                         
        3167           </xsl:call -template>
        3168                                                               
        3169          </xsl:when >
        3170                                                              
        3171          <xsl:other wise>
        3172                                                                        
        3173           <xsl:call- template 
        3174            name="na"
        3175           />
        3176                                                               
        3177          </xsl:othe rwise>
        3178                                                     
        3179         </xsl:choo se>
        3180                                            
        3181        </div>
        3182                                  
        3183       </td>
        3184      
        3185                                 
        3186       <!-- Encou nter Provi der-->
        3187                                 
        3188       <td>
        3189                                           
        3190        <div 
        3191         style="ove rflow:hidd en; white- space:nowr ap; width: 160px;"
        3192        >
        3193                                                    
        3194         <xsl:varia ble 
        3195          name="encP rovider"
        3196         >
        3197                                                              
        3198          <xsl:call- template 
        3199           name="getE ncounterPr ovider"
        3200          >
        3201                                                                        
        3202           <xsl:with- param 
        3203            name="enco unter" 
        3204            select="$r ow/n1:enco unter"
        3205           />
        3206                                                               
        3207          </xsl:call -template>
        3208                                                     
        3209         </xsl:vari able>
        3210                                                    
        3211         <xsl:choos e>
        3212                                                              
        3213          <xsl:when 
        3214           test="stri ng-length( $encProvid er)>1"
        3215          >
        3216                                                                        
        3217           <xsl:call- template 
        3218            name="flyo verSpan"
        3219           >
        3220                                                                                  
        3221            <xsl:with- param 
        3222             name="data
        3223             select="$e ncProvider "
        3224            />
        3225                                                                         
        3226           </xsl:call -template>
        3227                                                               
        3228          </xsl:when >
        3229                                                              
        3230          <xsl:other wise>
        3231                                                                        
        3232           <xsl:call- template 
        3233            name="na"
        3234           />
        3235                                                               
        3236          </xsl:othe rwise>
        3237                                                     
        3238         </xsl:choo se>
        3239                                            
        3240        </div>
        3241                                  
        3242       </td>
        3243                        
        3244      </tr>
        3245              
        3246     </xsl:temp late>
        3247    
        3248             
        3249     <xsl:templ ate 
        3250      name="medR ow"
        3251     >
        3252                       
        3253      <xsl:param  
        3254       name="row"
        3255      />
        3256                       
        3257      <tr 
        3258       class="sec ond"
        3259      >
        3260                                 
        3261       <!-- Name  -->
        3262                                 
        3263       <td>
        3264                                           
        3265        <div 
        3266         style="ove rflow:hidd en; white- space:nowr ap; width: 180px;"
        3267        >
        3268                                                    
        3269         <xsl:call- template 
        3270          name="flyo verSpan"
        3271         >
        3272                                                              
        3273          <xsl:with- param 
        3274           name="data "
        3275          >
        3276                                                                        
        3277           <xsl:call- template 
        3278            name="getM edicationN ame"
        3279           >
        3280                                                                                  
        3281            <xsl:with- param 
        3282             name="row"  
        3283             select="$r ow"
        3284            />
        3285                                                                         
        3286           </xsl:call -template>
        3287                                                               
        3288          </xsl:with -param>
        3289                                                     
        3290         </xsl:call -template>
        3291                                            
        3292        </div>
        3293                                  
        3294       </td>
        3295      
        3296                                 
        3297       <!-- Statu s -->
        3298                                 
        3299       <td>
        3300                                           
        3301        <div 
        3302         style="ove rflow:hidd en; white- space:nowr ap; width: 80px;"
        3303        >
        3304                                                    
        3305         <xsl:varia ble 
        3306          name="medS tat"
        3307         >
        3308                                                              
        3309          <xsl:call- template 
        3310           name="medS tatus"
        3311          >
        3312                                                                        
        3313           <xsl:with- param 
        3314            name="subs tanceAdmin
        3315            select="$r ow/n1:subs tanceAdmin istration"
        3316           />
        3317                                                               
        3318          </xsl:call -template>
        3319                                                     
        3320         </xsl:vari able>
        3321                                                    
        3322         <xsl:choos e>
        3323                                                              
        3324          <xsl:when 
        3325           test="stri ng-length( $medStat)> 1"
        3326          >
        3327                                                                        
        3328           <xsl:call- template 
        3329            name="flyo verSpan"
        3330           >
        3331                                                                                  
        3332            <xsl:with- param 
        3333             name="data
        3334             select="$m edStat"
        3335            />
        3336                                                                         
        3337           </xsl:call -template>
        3338                                                               
        3339          </xsl:when >
        3340                                                              
        3341          <xsl:other wise>
        3342                                                                        
        3343           <xsl:call- template 
        3344            name="na"
        3345           />
        3346                                                               
        3347          </xsl:othe rwise>
        3348                                                     
        3349         </xsl:choo se>
        3350                                            
        3351        </div>
        3352                                  
        3353       </td>
        3354      
        3355                                 
        3356       <!-- Quant ity -->
        3357                                 
        3358       <td>
        3359                                           
        3360        <div 
        3361         style="ove rflow:hidd en; white- space:nowr ap; width: 40px;"
        3362        >
        3363                                                    
        3364         <xsl:call- template 
        3365          name="medQ uantity"
        3366         >
        3367                                                              
        3368          <xsl:with- param 
        3369           name="subs tanceAdmin
        3370           select="$r ow/n1:subs tanceAdmin istration"
        3371          />
        3372                                                     
        3373         </xsl:call -template>
        3374                                            
        3375        </div>
        3376                                  
        3377       </td>
        3378      
        3379                                 
        3380       <!-- Order  Expiratio n Date/Tim e -->
        3381                                 
        3382       <td>
        3383                                           
        3384        <div 
        3385         style="ove rflow:hidd en; white- space:nowr ap; width: 80px;"
        3386        >
        3387                                                    
        3388         <xsl:call- template 
        3389          name="medE xpiretime"
        3390         >
        3391                                                              
        3392          <xsl:with- param 
        3393           name="subs tanceAdmin
        3394           select="$r ow/n1:subs tanceAdmin istration"
        3395          />
        3396                                                     
        3397         </xsl:call -template>
        3398                                            
        3399        </div>
        3400                                  
        3401       </td>
        3402      
        3403                                 
        3404       <!-- Provi der -->
        3405                                 
        3406       <td>
        3407                                           
        3408        <div 
        3409         style="ove rflow:hidd en; white- space:nowr ap; width: 140px;"
        3410        >
        3411                                                    
        3412         <xsl:varia ble 
        3413          name="medP rovider"
        3414         >
        3415                                                              
        3416          <xsl:call- template 
        3417           name="getM edProvider "
        3418          >
        3419                                                                        
        3420           <xsl:with- param 
        3421            name="subs tanceAdmin
        3422            select="$r ow/n1:subs tanceAdmin istration"
        3423           />
        3424                                                               
        3425          </xsl:call -template>
        3426                                                     
        3427         </xsl:vari able>
        3428                                                    
        3429         <xsl:choos e>
        3430                                                              
        3431          <xsl:when 
        3432           test="stri ng-length( $medProvid er)>1"
        3433          >
        3434                                                                        
        3435           <xsl:call- template 
        3436            name="flyo verSpan"
        3437           >
        3438                                                                                  
        3439            <xsl:with- param 
        3440             name="data
        3441             select="$m edProvider "
        3442            />
        3443                                                                         
        3444           </xsl:call -template>
        3445                                                               
        3446          </xsl:when >
        3447                                                              
        3448          <xsl:other wise>
        3449                                                                        
        3450           <xsl:call- template 
        3451            name="na"
        3452           />
        3453                                                               
        3454          </xsl:othe rwise>
        3455                                                     
        3456         </xsl:choo se>
        3457                                            
        3458        </div>
        3459                                  
        3460       </td>
        3461      
        3462                                 
        3463       <!-- Presc ription ID  (Nbr) -->
        3464                                 
        3465       <td>
        3466                                           
        3467        <div 
        3468         style="ove rflow:hidd en; white- space:nowr ap; width: 80px;"
        3469        >
        3470                                                    
        3471         <xsl:varia ble 
        3472          name="rxNu m"
        3473         >
        3474                                                              
        3475          <xsl:call- template 
        3476           name="getR xNumString "
        3477          >
        3478                                                                        
        3479           <xsl:with- param 
        3480            name="subs tanceAdmin
        3481            select="$r ow/n1:subs tanceAdmin istration"
        3482           />
        3483                                                               
        3484          </xsl:call -template>
        3485                                                     
        3486         </xsl:vari able>
        3487                                                    
        3488         <xsl:choos e>
        3489                                                              
        3490          <xsl:when 
        3491           test="stri ng-length( $rxNum)>1"
        3492          >
        3493                                                                        
        3494           <xsl:value -of 
        3495            select="$r xNum"
        3496           />
        3497                                                               
        3498          </xsl:when >
        3499                                                              
        3500          <xsl:other wise>
        3501                                                                        
        3502           <xsl:call- template 
        3503            name="na"
        3504           />
        3505                                                               
        3506          </xsl:othe rwise>
        3507                                                     
        3508         </xsl:choo se>
        3509                                            
        3510        </div>
        3511                                  
        3512       </td>
        3513      
        3514                                 
        3515       <!-- dispe nse time - ->
        3516                                 
        3517       <td>
        3518                                           
        3519        <div 
        3520         style="ove rflow:hidd en; white- space:nowr ap; width: 80px;"
        3521        >
        3522                                                    
        3523         <xsl:call- template 
        3524          name="medB egintime"
        3525         >
        3526                                                              
        3527          <xsl:with- param 
        3528           name="row"  
        3529           select="$r ow"
        3530          />
        3531                                                     
        3532         </xsl:call -template>
        3533                                            
        3534        </div>
        3535                                  
        3536       </td>
        3537      
        3538                                 
        3539       <!-- Sig - ->
        3540                                 
        3541       <td>
        3542                                           
        3543        <div 
        3544         style="ove rflow:hidd en; white- space:nowr ap; width: 160px;"
        3545        >
        3546                                                    
        3547         <xsl:varia ble 
        3548          name="sig"
        3549         >
        3550                                                              
        3551          <xsl:call- template 
        3552           name="getS ig"
        3553          >
        3554                                                                        
        3555           <xsl:with- param 
        3556            name="subs tanceAdmin
        3557            select="$r ow/n1:subs tanceAdmin istration"
        3558           />
        3559                                                               
        3560          </xsl:call -template>
        3561                                                     
        3562         </xsl:vari able>
        3563                                                    
        3564         <xsl:choos e>
        3565                                                              
        3566          <xsl:when 
        3567           test="stri ng-length( $sig)>1"
        3568          >
        3569                                                                        
        3570           <xsl:call- template 
        3571            name="flyo verSpan"
        3572           >
        3573                                                                                  
        3574            <xsl:with- param 
        3575             name="data
        3576             select="$s ig"
        3577            />
        3578                                                                         
        3579           </xsl:call -template>
        3580                                                               
        3581          </xsl:when >
        3582                                                              
        3583          <xsl:other wise>
        3584                                                                        
        3585           <xsl:call- template 
        3586            name="na"
        3587           />
        3588                                                               
        3589          </xsl:othe rwise>
        3590                                                     
        3591         </xsl:choo se>
        3592                                            
        3593        </div>
        3594                                  
        3595       </td>
        3596      
        3597                                 
        3598       <!-- sourc e -->
        3599                                 
        3600       <td>
        3601                                           
        3602        <div 
        3603         style="ove rflow:hidd en; white- space:nowr ap; width: 100px;"
        3604        >
        3605                                                    
        3606         <xsl:varia ble 
        3607          name="sour ceResult"
        3608         >
        3609                                                              
        3610          <xsl:call- template 
        3611           name="getM edSource"
        3612          >
        3613                                                                        
        3614           <xsl:with- param 
        3615            name="subs tanceAdmin
        3616            select="$r ow/n1:subs tanceAdmin istration"
        3617           />
        3618                                                               
        3619          </xsl:call -template>
        3620                                                     
        3621         </xsl:vari able>
        3622                                                    
        3623         <xsl:if 
        3624          test="stri ng-length( $sourceRes ult)>1"
        3625         >
        3626                                                              
        3627          <xsl:call- template 
        3628           name="flyo verSpan"
        3629          >
        3630                                                                        
        3631           <xsl:with- param 
        3632            name="data
        3633            select="$s ourceResul t"
        3634           />
        3635                                                               
        3636          </xsl:call -template>
        3637                                                     
        3638         </xsl:if>
        3639                                            
        3640        </div>
        3641                                  
        3642       </td>
        3643                        
        3644      </tr>
        3645              
        3646     </xsl:temp late>
        3647    
        3648             
        3649     <xsl:templ ate 
        3650      name="prob lemRow"
        3651     >
        3652                       
        3653      <xsl:param  
        3654       name="row"
        3655      />
        3656                       
        3657      <xsl:varia ble 
        3658       name="rowD ata" 
        3659       select="$r ow/n1:act/ n1:entryRe lationship /n1:observ ation"
        3660      />
        3661                       
        3662      <tr 
        3663       class="sec ond"
        3664      >
        3665      
        3666                                 
        3667       <!-- name  -->
        3668                                 
        3669       <td>
        3670                                           
        3671        <div 
        3672         style="ove rflow:hidd en; white- space:nowr ap; width: 240px;"
        3673        >
        3674                                                    
        3675         <xsl:varia ble 
        3676          name="prob Result"
        3677         >
        3678                                                              
        3679          <xsl:call- template 
        3680           name="prob Name"
        3681          >
        3682                                                                        
        3683           <xsl:with- param 
        3684            name="prob Entry" 
        3685            select="$r ow"
        3686           />
        3687                                                               
        3688          </xsl:call -template>
        3689                                                     
        3690         </xsl:vari able>
        3691                                                    
        3692         <xsl:if 
        3693          test="stri ng-length( $probResul t)>1"
        3694         >
        3695                                                              
        3696          <xsl:call- template 
        3697           name="flyo verSpan"
        3698          >
        3699                                                                        
        3700           <xsl:with- param 
        3701            name="data
        3702            select="$p robResult"  
        3703           />
        3704                                                               
        3705          </xsl:call -template>
        3706                                                     
        3707         </xsl:if>
        3708                                            
        3709        </div>
        3710                                  
        3711       </td>
        3712      
        3713                                 
        3714       <!-- statu s -->
        3715                                 
        3716       <td>
        3717                                           
        3718        <div 
        3719         style="ove rflow:hidd en; white- space:nowr ap; width: 80px;"
        3720        >
        3721                                                    
        3722         <xsl:call- template 
        3723          name="prob Status"
        3724         >
        3725                                                              
        3726          <xsl:with- param 
        3727           name="row"  
        3728           select="$r ow"
        3729          />
        3730                                                     
        3731         </xsl:call -template>
        3732                                            
        3733        </div>
        3734                                  
        3735       </td>
        3736      
        3737                                 
        3738       <!-- Probl em Code -- >
        3739                                 
        3740       <td>
        3741                                           
        3742        <div 
        3743         style="ove rflow:hidd en; white- space:nowr ap; width: 150px"
        3744        >
        3745                                                    
        3746         <xsl:call- template 
        3747          name="getP roblemCode "
        3748         >
        3749                                                              
        3750          <xsl:with- param 
        3751           name="rowD ata" 
        3752           select="$r owData"
        3753          />
        3754                                                     
        3755         </xsl:call -template>
        3756                                            
        3757        </div>
        3758                                  
        3759       </td>
        3760      
        3761                                 
        3762       <!-- probl em effecti ve date -- >
        3763                                 
        3764       <td>
        3765                                           
        3766        <div 
        3767         style="ove rflow:hidd en; white- space:nowr ap;"
        3768        >
        3769                                                    
        3770         <xsl:call- template 
        3771          name="prob Date"
        3772         >
        3773                                                              
        3774          <xsl:with- param 
        3775           name="row"  
        3776           select="$r ow"
        3777          />
        3778                                                     
        3779         </xsl:call -template>
        3780                                            
        3781        </div>
        3782                                  
        3783       </td>
        3784      
        3785                                 
        3786       <!-- provi der -->
        3787                                 
        3788       <td>
        3789                                           
        3790        <div 
        3791         style="ove rflow:hidd en; white- space:nowr ap; width: 160px;"
        3792        >
        3793                                                    
        3794         <xsl:varia ble 
        3795          name="prov ider"
        3796         />
        3797                                                    
        3798         <xsl:call- template 
        3799          name="getP roblemProv ider"
        3800         >
        3801                                                              
        3802          <xsl:with- param 
        3803           name="act"  
        3804           select="$r ow/n1:act"
        3805          />
        3806                                                     
        3807         </xsl:call -template>
        3808                                                    
        3809         <xsl:if 
        3810          test="stri ng-length( $provider) >2"
        3811         >
        3812                                                              
        3813          <xsl:call- template 
        3814           name="flyo verSpan"
        3815          >
        3816                                                                        
        3817           <xsl:with- param 
        3818            name="data
        3819            select="$p rovider" 
        3820           />
        3821                                                               
        3822          </xsl:call -template>
        3823                                                     
        3824         </xsl:if>
        3825                                            
        3826        </div>
        3827                                  
        3828       </td>
        3829      
        3830                                 
        3831       <!-- sourc e -->
        3832                                 
        3833       <td>
        3834                                           
        3835        <div 
        3836         style="ove rflow:hidd en; white- space:nowr ap; width: 150px;"
        3837        >
        3838                                                    
        3839         <xsl:varia ble 
        3840          name="sour ce"
        3841         >
        3842                                                              
        3843          <xsl:call- template 
        3844           name="getP roblemSour ce"
        3845          >
        3846                                                                        
        3847           <xsl:with- param 
        3848            name="row"  
        3849            select="$r ow"
        3850           />
        3851                                                               
        3852          </xsl:call -template>
        3853                                                     
        3854         </xsl:vari able>
        3855                                                    
        3856         <xsl:choos e>
        3857                                                              
        3858          <xsl:when 
        3859           test="stri ng-length( $source)>1 "
        3860          >
        3861                                                                        
        3862           <xsl:call- template 
        3863            name="flyo verSpan"
        3864           >
        3865                                                                                  
        3866            <xsl:with- param 
        3867             name="data
        3868             select="$s ource"
        3869            />
        3870                                                                         
        3871           </xsl:call -template>
        3872                                                               
        3873          </xsl:when >
        3874                                                              
        3875          <xsl:other wise>
        3876                                                                        
        3877           <xsl:call- template 
        3878            name="na"
        3879           />
        3880                                                               
        3881          </xsl:othe rwise>
        3882                                                     
        3883         </xsl:choo se>
        3884                                            
        3885        </div>
        3886                                  
        3887       </td>
        3888                        
        3889      </tr>
        3890              
        3891     </xsl:temp late>
        3892    
        3893             
        3894     <!-- Aller gy entry r ow -->
        3895             
        3896     <xsl:templ ate 
        3897      name="alle rgyRow"
        3898     >
        3899                       
        3900      <xsl:param  
        3901       name="row"
        3902      />
        3903                       
        3904      <xsl:varia ble 
        3905       name="obse rvation" 
        3906       select="$r ow/n1:act/ n1:entryRe lationship /n1:observ ation"
        3907      />
        3908                       
        3909      <xsl:varia ble 
        3910       name="eR" 
        3911       select="$r ow/n1:act/ n1:entryRe lationship "
        3912      />
        3913                       
        3914      <tr 
        3915       class="sec ond"
        3916      >
        3917      
        3918                                 
        3919       <!--Allerg ens-->
        3920                                 
        3921       <td>
        3922                                           
        3923        <div 
        3924         style="ove rflow:hidd en; white- space:nowr ap; width: 180px; pad ding-right :5px;"
        3925        >                         
        3926                                                    
        3927         <xsl:varia ble 
        3928          name="alle rgen"
        3929         >
        3930                                                              
        3931          <xsl:call- template 
        3932           name="getA llergen"
        3933          >
        3934                                                                        
        3935           <xsl:with- param 
        3936            name="obse rvation" 
        3937            select="$o bservation "
        3938           />
        3939                                                               
        3940          </xsl:call -template>
        3941                                                     
        3942         </xsl:vari able>
        3943                                                    
        3944         <xsl:choos e>
        3945                                                              
        3946          <xsl:when 
        3947           test="stri ng-length( $allergen) >1"
        3948          >
        3949                                                                        
        3950           <xsl:call- template 
        3951            name="flyo verSpan"
        3952           >
        3953                                                                                  
        3954            <xsl:with- param 
        3955             name="data
        3956             select="$a llergen"
        3957            />
        3958                                                                         
        3959           </xsl:call -template>
        3960                                                               
        3961          </xsl:when >
        3962                                                              
        3963          <xsl:other wise>
        3964                                                                        
        3965           <xsl:call- template 
        3966            name="na"
        3967           />
        3968                                                               
        3969          </xsl:othe rwise>
        3970                                                     
        3971         </xsl:choo se>
        3972                                            
        3973        </div>
        3974                                  
        3975       </td>
        3976      
        3977                                 
        3978       <!--Verifi cation Dat e-->
        3979                                 
        3980       <td>
        3981                                           
        3982        <div 
        3983         style="ove rflow:hidd en; white- space:nowr ap; width: 100px;"
        3984        >
        3985                                                    
        3986         <xsl:call- template 
        3987          name="disp layAllergy Verificati onDate"
        3988         >
        3989                                                              
        3990          <xsl:with- param 
        3991           name="obse rvation" 
        3992           select="$o bservation "
        3993          />
        3994                                                     
        3995         </xsl:call -template>
        3996                                            
        3997        </div>
        3998                                  
        3999       </td>
        4000      
        4001                                 
        4002       <!--Event  Type-->
        4003                                 
        4004       <td>
        4005                                           
        4006        <div 
        4007         style="ove rflow:hidd en; white- space:nowr ap; width: 180px;"
        4008        >
        4009                                                    
        4010         <xsl:varia ble 
        4011          name="alle rgenType"
        4012         >
        4013                                                              
        4014          <xsl:call- template 
        4015           name="getE ventType"
        4016          >
        4017                                                                        
        4018           <xsl:with- param 
        4019            name="obs"  
        4020            select="$o bservation "
        4021           />
        4022                                                               
        4023          </xsl:call -template>
        4024                                                     
        4025         </xsl:vari able>
        4026                                                    
        4027         <xsl:choos e>
        4028                                                              
        4029          <xsl:when 
        4030           test="stri ng-length( $allergenT ype)>1"
        4031          >
        4032                                                                        
        4033           <xsl:call- template 
        4034            name="flyo verSpan"
        4035           >
        4036                                                                                  
        4037            <xsl:with- param 
        4038             name="data
        4039             select="$a llergenTyp e"
        4040            />
        4041                                                                         
        4042           </xsl:call -template>
        4043                                                               
        4044          </xsl:when >
        4045                                                              
        4046          <xsl:other wise>
        4047                                                                        
        4048           <xsl:call- template 
        4049            name="na"
        4050           />
        4051                                                               
        4052          </xsl:othe rwise>
        4053                                                     
        4054         </xsl:choo se>
        4055                                            
        4056        </div>
        4057                                  
        4058       </td>
        4059      
        4060                                 
        4061       <!--Reacti on-->
        4062                                 
        4063       <td>
        4064                                           
        4065        <div 
        4066         style="ove rflow:hidd en; white- space:nowr ap; width: 180px;"
        4067        >
        4068                                                    
        4069         <!--<xsl:f or-each se lect="$obs ervation/n 1:entryRel ationship[ @typeCode= 'MFST']">- ->
        4070                                                    
        4071         <xsl:varia ble 
        4072          name="valu eResult"
        4073         >
        4074                                                              
        4075          <xsl:call- template 
        4076           name="getR eactionVal ue"
        4077          >
        4078                                                                        
        4079           <xsl:with- param 
        4080            name="entr yRelations hip" 
        4081            select="$r ow/n1:act/ n1:entryRe lationship "
        4082           />
        4083                                                               
        4084          </xsl:call -template>
        4085                                                     
        4086         </xsl:vari able>
        4087                                                    
        4088         <xsl:choos e>
        4089                                                              
        4090          <xsl:when 
        4091           test="stri ng-length( $valueResu lt)>1"
        4092          >
        4093                                                                        
        4094           <xsl:call- template 
        4095            name="flyo verSpan"
        4096           >
        4097                                                                                  
        4098            <xsl:with- param 
        4099             name="data
        4100             select="$v alueResult "
        4101            />
        4102                                                                         
        4103           </xsl:call -template>
        4104                                                               
        4105          </xsl:when >
        4106                                                              
        4107          <xsl:other wise>
        4108                                                                        
        4109           <xsl:call- template 
        4110            name="na"
        4111           />
        4112                                                               
        4113          </xsl:othe rwise>
        4114                                                     
        4115         </xsl:choo se>
        4116                                                    
        4117         <!--</xsl: for-each>- ->
        4118                                            
        4119        </div>
        4120                                  
        4121       </td>
        4122      
        4123                                 
        4124       <!--Severi ty-->
        4125                                 
        4126       <td>
        4127                                           
        4128        <div 
        4129         style="ove rflow:hidd en; white- space:nowr ap; width: 100px;"
        4130        >
        4131                                                    
        4132         <xsl:varia ble 
        4133          name="seve rity"
        4134         >
        4135                                                              
        4136          <xsl:call- template 
        4137           name="getS everity"
        4138          >
        4139                                                                        
        4140           <xsl:with- param 
        4141            name="obse rvation" 
        4142            select="$o bservation "
        4143           />
        4144                                                               
        4145          </xsl:call -template>
        4146                                                     
        4147         </xsl:vari able>
        4148                                                    
        4149         <xsl:choos e>
        4150                                                              
        4151          <xsl:when 
        4152           test="stri ng-length( $severity) >1"
        4153          >
        4154                                                                        
        4155           <xsl:value -of 
        4156            select="$s everity"
        4157           />
        4158                                                               
        4159          </xsl:when >
        4160                                                              
        4161          <xsl:other wise>
        4162                                                                        
        4163           <xsl:call- template 
        4164            name="na"
        4165           />
        4166                                                               
        4167          </xsl:othe rwise>
        4168                                                     
        4169         </xsl:choo se>
        4170                                            
        4171        </div>
        4172                                  
        4173       </td>
        4174      
        4175                                 
        4176       <!--source -->
        4177                                 
        4178       <td>
        4179                                           
        4180        <div 
        4181         style="ove rflow:hidd en; white- space:nowr ap; width: 150px;"
        4182        >
        4183                                                    
        4184         <xsl:varia ble 
        4185          name="sour ce"
        4186         >
        4187                                                              
        4188          <xsl:call- template 
        4189           name="getA llergySour ce"
        4190          >
        4191                                                                        
        4192           <xsl:with- param 
        4193            name="row"  
        4194            select="$r ow"
        4195           />
        4196                                                               
        4197          </xsl:call -template>
        4198                                                     
        4199         </xsl:vari able>
        4200                                                    
        4201         <xsl:choos e>
        4202                                                              
        4203          <xsl:when 
        4204           test="stri ng-length( $source)>0 "
        4205          >
        4206                                                                        
        4207           <xsl:call- template 
        4208            name="flyo verSpan"
        4209           >
        4210                                                                                  
        4211            <xsl:with- param 
        4212             name="data
        4213             select="$s ource"
        4214            />
        4215                                                                         
        4216           </xsl:call -template>
        4217                                                               
        4218          </xsl:when >
        4219                                                              
        4220          <xsl:other wise>
        4221                                                                        
        4222           <xsl:call- template 
        4223            name="na"
        4224           />
        4225                                                               
        4226          </xsl:othe rwise>
        4227                                                     
        4228         </xsl:choo se>
        4229                                            
        4230        </div>
        4231                                  
        4232       </td>
        4233                        
        4234      </tr>
        4235     
        4236              
        4237     </xsl:temp late>
        4238    
        4239             
        4240     <!-- Proce dures row  entry -->
        4241             
        4242     <xsl:templ ate 
        4243      name="proc edureRow"
        4244     >
        4245                       
        4246      <xsl:param  
        4247       name="row"
        4248      />
        4249                       
        4250      <tr 
        4251       class="sec ond"
        4252      >
        4253                                 
        4254       <!-- Proce dure Date/ Time-->
        4255                                 
        4256       <td>
        4257                                           
        4258        <div 
        4259         style="ove rflow:hidd en; white- space:nowr ap;"
        4260        >
        4261                                                    
        4262         <xsl:choos e>
        4263                                                              
        4264          <xsl:when 
        4265           test="$row /n1:proced ure/n1:eff ectiveTime /n1:low/@v alue"
        4266          >
        4267                                                                        
        4268           <xsl:call- template 
        4269            name="form atDateShor t"
        4270           >
        4271                                                                                  
        4272            <xsl:with- param 
        4273             name="date String" 
        4274             select="$r ow/n1:proc edure/n1:e ffectiveTi me/n1:low/ @value"
        4275            />
        4276                                                                         
        4277           </xsl:call -template>
        4278                                                               
        4279          </xsl:when >
        4280                       
        4281          <xsl:when 
        4282           test="$row /n1:proced ure/n1:eff ectiveTime /@value"
        4283          >
        4284                          
        4285           <xsl:call- template 
        4286            name="form atDateShor t"
        4287           >
        4288                             
        4289            <xsl:with- param 
        4290             name="date String" 
        4291             select="$r ow/n1:proc edure/n1:e ffectiveTi me/@value"
        4292            />
        4293                           
        4294           </xsl:call -template>
        4295                        
        4296          </xsl:when >
        4297                       
        4298          <xsl:other wise>
        4299                          
        4300           <xsl:call- template 
        4301            name="na"
        4302           />
        4303                        
        4304          </xsl:othe rwise>
        4305                                                     
        4306         </xsl:choo se>
        4307                                            
        4308        </div>
        4309                                  
        4310       </td>
        4311                                 
        4312       <!-- Proce dure Type   -->
        4313                                 
        4314       <td>
        4315                                           
        4316        <div 
        4317         style="ove rflow:hidd en; white- space:nowr ap; width: 260px;"
        4318        >
        4319                                                    
        4320         <xsl:varia ble 
        4321          name="type "
        4322         >
        4323                                                              
        4324          <xsl:call- template 
        4325           name="getP rocedureTy pe"
        4326          >
        4327                                                                        
        4328           <xsl:with- param 
        4329            name="proc edure" 
        4330            select="$r ow/n1:proc edure"
        4331           />
        4332                                                               
        4333          </xsl:call -template>
        4334                                                     
        4335         </xsl:vari able>
        4336                                                    
        4337         <xsl:choos e>
        4338                                                              
        4339          <xsl:when 
        4340           test="stri ng-length( $type)>1"
        4341          >
        4342                                                                        
        4343           <xsl:call- template 
        4344            name="flyo verSpan"
        4345           >
        4346                                                                                  
        4347            <xsl:with- param 
        4348             name="data
        4349             select="$t ype"
        4350            />
        4351                                                                         
        4352           </xsl:call -template>
        4353                                                               
        4354          </xsl:when >
        4355                                                              
        4356          <xsl:other wise>
        4357                                                                        
        4358           <xsl:call- template 
        4359            name="na"
        4360           />
        4361                                                               
        4362          </xsl:othe rwise>
        4363                                                     
        4364         </xsl:choo se>
        4365                                            
        4366        </div>
        4367                                  
        4368       </td>
        4369                                 
        4370       <!-- Proce dure Free  Text Type- ->
        4371                                 
        4372       <td>
        4373                                           
        4374        <div 
        4375         style="ove rflow:hidd en; white- space:nowr ap; width: 260px;heig ht:1em"
        4376        >
        4377                                                    
        4378         <xsl:varia ble 
        4379          name="proc FreeText"
        4380         >
        4381                                                              
        4382          <xsl:call- template 
        4383           name="ltri m"
        4384          >
        4385                                                                        
        4386           <xsl:with- param 
        4387            name="text "
        4388           >
        4389                                                                                  
        4390            <xsl:call- template 
        4391             name="getP rocedureFr eeText"
        4392            >
        4393                                                                                            
        4394             <xsl:with- param 
        4395              name="proc edure" 
        4396              select="$r ow/n1:proc edure"
        4397             />
        4398                                                                                   
        4399            </xsl:call -template>
        4400                                                                         
        4401           </xsl:with -param>
        4402                                                                        
        4403           <xsl:with- param 
        4404            name="star tChar" 
        4405            select="'~ '"
        4406           />
        4407                                                               
        4408          </xsl:call -template>
        4409                                                     
        4410         </xsl:vari able>
        4411                                                    
        4412         <xsl:choos e>
        4413                                                              
        4414          <xsl:when 
        4415           test="stri ng-length( $procFreeT ext)>1"
        4416          >
        4417                                                                        
        4418           <xsl:call- template 
        4419            name="flyo verSpan"
        4420           >
        4421                                                                                  
        4422            <xsl:with- param 
        4423             name="data
        4424             select="$p rocFreeTex t"
        4425            />
        4426                                                                                  
        4427            <xsl:with- param 
        4428             name="free Text" 
        4429             select="'y es'"
        4430            />
        4431                                                                                  
        4432            <xsl:with- param 
        4433             name="deSq uigglefy" 
        4434             select="'y es'"
        4435            />
        4436                                                                         
        4437           </xsl:call -template>
        4438                                                               
        4439          </xsl:when >
        4440                                                              
        4441          <xsl:other wise>
        4442                                                                        
        4443           <xsl:call- template 
        4444            name="na"
        4445           />
        4446                                                               
        4447          </xsl:othe rwise>
        4448                                                     
        4449         </xsl:choo se>
        4450                                            
        4451        </div>
        4452                                  
        4453       </td>
        4454                                 
        4455       <!-- Proce dure Provi der-->
        4456                                 
        4457       <td>
        4458                                           
        4459        <div 
        4460         style="ove rflow:hidd en; white- space:nowr ap; width: 180px;"
        4461        >
        4462                                                    
        4463         <xsl:varia ble 
        4464          name="proc Provider"
        4465         >
        4466                                                              
        4467          <xsl:call- template 
        4468           name="getP rocedurePr ovider"
        4469          >
        4470                                                                        
        4471           <xsl:with- param 
        4472            name="proc edure" 
        4473            select="$r ow/n1:proc edure"
        4474           />
        4475                                                               
        4476          </xsl:call -template>
        4477                                                     
        4478         </xsl:vari able>
        4479                                                    
        4480         <xsl:choos e>
        4481                                                              
        4482          <xsl:when 
        4483           test="stri ng-length( $procProvi der)>1"
        4484          >
        4485                                                                        
        4486           <xsl:call- template 
        4487            name="flyo verSpan"
        4488           >
        4489                                                                                  
        4490            <xsl:with- param 
        4491             name="data
        4492             select="$p rocProvide r"
        4493            />
        4494                                                                         
        4495           </xsl:call -template>
        4496                                                               
        4497          </xsl:when >
        4498                                                              
        4499          <xsl:other wise>
        4500                                                                        
        4501           <xsl:call- template 
        4502            name="na"
        4503           />
        4504                                                               
        4505          </xsl:othe rwise>
        4506                                                     
        4507         </xsl:choo se>
        4508                                            
        4509        </div>
        4510                                  
        4511       </td>
        4512                        
        4513      </tr>
        4514              
        4515     </xsl:temp late>
        4516    
        4517             
        4518     <!-- Labs  entry row  (organizer  capable)  -->
        4519             
        4520     <xsl:templ ate 
        4521      name="labs Row"
        4522     >
        4523                       
        4524      <xsl:param  
        4525       name="row"
        4526      />
        4527                       
        4528      <xsl:varia ble 
        4529       name="obse rvation1" 
        4530       select="$r ow/n1:comp onent/n1:o bservation "
        4531      />
        4532                       
        4533      <xsl:varia ble 
        4534       name="obse rvation2" 
        4535       select="$r ow/n1:orga nizer/n1:c omponent/n 1:observat ion"
        4536      />
        4537                       
        4538      <xsl:choos e>
        4539                                 
        4540       <xsl:when   
        4541        test="stri ng-length( $row/n1:or ganizer)!= 0"
        4542       >
        4543                                           
        4544        <tr 
        4545         class="sec ond"
        4546        >
        4547                                                    
        4548         <!-- Resul t Date/Tim e -->
        4549                                                    
        4550         <td>
        4551                                                              
        4552          <div 
        4553           style="ove rflow:hidd en; white- space:nowr ap; width: 100px; pad ding-right :5px;"
        4554          >
        4555                                                                        
        4556           <xsl:varia ble 
        4557            name="date "
        4558           >
        4559                                                                                  
        4560            <xsl:call- template 
        4561             name="getP anelDT"
        4562            >
        4563                                                                                            
        4564             <xsl:with- param 
        4565              name="orga nizer" 
        4566              select="$r ow/n1:orga nizer"
        4567             />
        4568                                                                                   
        4569            </xsl:call -template>
        4570                                                                         
        4571           </xsl:vari able>
        4572                                                                        
        4573           <xsl:choos e>
        4574                                                                                  
        4575            <xsl:when 
        4576             test="stri ng-length( $date)>0"
        4577            >
        4578                                                                                            
        4579             <xsl:call- template 
        4580              name="flyo verSpan"
        4581             >
        4582                                                                                                     
        4583              <xsl:with- param 
        4584               name="data
        4585               select="$d ate"
        4586              />
        4587                                                                                             
        4588             </xsl:call -template>
        4589                                                                                   
        4590            </xsl:when >
        4591                                                                                  
        4592            <xsl:other wise>
        4593                                                                                            
        4594             <xsl:call- template 
        4595              name="na"
        4596             />
        4597                                                                                   
        4598            </xsl:othe rwise>
        4599                                                                         
        4600           </xsl:choo se>
        4601                                                               
        4602          </div>
        4603                                                     
        4604         </td>
        4605                                                    
        4606         <!-- Organ izer Name  -->
        4607                                                    
        4608         <td>
        4609                                                              
        4610          <div 
        4611           style="ove rflow:hidd en; white- space:nowr ap; width: auto;"
        4612          >
        4613                                                                        
        4614           <xsl:varia ble 
        4615            name="orga nizerName"
        4616           >
        4617                                                                                  
        4618            <xsl:call- template 
        4619             name="getO rganizerNa me"
        4620            >
        4621                                                                                            
        4622             <xsl:with- param 
        4623              name="row"  
        4624              select="$r ow"
        4625             />
        4626                                                                                   
        4627            </xsl:call -template>
        4628                                                                         
        4629           </xsl:vari able>
        4630                                                                        
        4631           <xsl:choos e>
        4632                                                                                  
        4633            <xsl:when 
        4634             test="stri ng-length( $organizer Name)>0"
        4635            >
        4636                                                                                            
        4637             <xsl:call- template 
        4638              name="flyo verSpan"
        4639             >
        4640                                                                                                     
        4641              <xsl:with- param 
        4642               name="data
        4643               select="$o rganizerNa me"
        4644              />
        4645                                                                                             
        4646             </xsl:call -template>
        4647                                                                                   
        4648            </xsl:when >
        4649                                                                                  
        4650            <xsl:other wise>
        4651                                                                                            
        4652             <xsl:call- template 
        4653              name="na"
        4654             />
        4655                                                                                   
        4656            </xsl:othe rwise>
        4657                                                                         
        4658           </xsl:choo se>
        4659                                                               
        4660          </div>
        4661                                                     
        4662         </td>
        4663                                                    
        4664         <!-- sourc e -->
        4665                                                    
        4666         <td>
        4667                                                              
        4668          <div 
        4669           style="ove rflow:hidd en; white- space:nowr ap; width: auto;"
        4670          >
        4671                                                                        
        4672           <xsl:choos e>
        4673                                                                                  
        4674            <xsl:when 
        4675             test="$row /n1:organi zer/n1:aut hor/n1:ass ignedAutho r/n1:repre sentedOrga nization/n 1:name"
        4676            >
        4677                                                                                            
        4678             <xsl:value -of 
        4679              select="$r ow/n1:orga nizer/n1:a uthor/n1:a ssignedAut hor/n1:rep resentedOr ganization /n1:name"
        4680             />
        4681                                                                                   
        4682            </xsl:when >
        4683                                                                                  
        4684            <xsl:when 
        4685             test="$row /n1:organi zer/n1:per former/n1: assignedEn tity/n1:re presentedO rganizatio n/n1:name"
        4686            >
        4687                                                                                            
        4688             <xsl:value -of 
        4689              select="$r ow/n1:orga nizer/n1:p erformer/n 1:assigned Entity/n1: represente dOrganizat ion/n1:nam e"
        4690             />
        4691                                                                                   
        4692            </xsl:when >
        4693                                                                                  
        4694            <xsl:when 
        4695             test="$row /n1:organi zer/n1:com ponent/n1: observatio n/n1:parti cipant[@ty peCode='AU T']/n1:par ticipantRo le/n1:scop ingEntity/ n1:desc"
        4696            >
        4697                                                                                            
        4698             <xsl:value -of 
        4699              select="$r ow/n1:orga nizer/n1:c omponent/n 1:observat ion/n1:par ticipant[@ typeCode=' AUT']/n1:p articipant Role/n1:sc opingEntit y/n1:desc"
        4700             />
        4701                                                                                   
        4702            </xsl:when >
        4703                             
        4704            <xsl:when 
        4705             test="$row /n1:organi zer/n1:com ponent/n1: procedure/ n1:partici pant[@type Code='ORG' ]/n1:parti cipantRole /n1:playin gEntity/n1 :name"
        4706            >
        4707                                
        4708             <xsl:value -of 
        4709              select="$r ow/n1:orga nizer/n1:c omponent/n 1:procedur e/n1:parti cipant[@ty peCode='OR G']/n1:par ticipantRo le/n1:play ingEntity/ n1:name"
        4710             />
        4711                              
        4712            </xsl:when >
        4713                                                                                  
        4714            <xsl:other wise>
        4715                                                                                            
        4716             <xsl:call- template 
        4717              name="na"
        4718             />
        4719                                                                                   
        4720            </xsl:othe rwise>
        4721                                                                         
        4722           </xsl:choo se>
        4723                                                               
        4724          </div>
        4725                                                     
        4726         </td>
        4727                                                    
        4728         <td>
        4729                                                              
        4730          <xsl:call- template 
        4731           name="na"
        4732          />
        4733                                                     
        4734         </td>
        4735                                                    
        4736         <td>
        4737                                                              
        4738          <xsl:call- template 
        4739           name="na"
        4740          />
        4741                                                     
        4742         </td>
        4743                                                    
        4744         <td>
        4745                                                              
        4746          <xsl:call- template 
        4747           name="na"
        4748          />
        4749                                                     
        4750         </td>
        4751                                                    
        4752         <!-- Resul t Status - ->
        4753                                                    
        4754         <td>
        4755                                                              
        4756          <div 
        4757           style="ove rflow:hidd en; white- space:nowr ap; width: 80px;"
        4758          >
        4759                                                                        
        4760           <xsl:choos e>
        4761                                                                                  
        4762            <xsl:when 
        4763             test="stri ng-length( $row/n1:or ganizer/n1 :statusCod e/@code)>0 "
        4764            >
        4765                                                                                            
        4766             <xsl:call- template 
        4767              name="flyo verSpan"
        4768             >
        4769                                                                                                     
        4770              <xsl:with- param 
        4771               name="data
        4772               select="$r ow/n1:orga nizer/n1:s tatusCode/ @code"
        4773              />
        4774                                                                                             
        4775             </xsl:call -template>
        4776                                                                                   
        4777            </xsl:when >
        4778                                                                                  
        4779            <xsl:other wise>
        4780                                                                                            
        4781             <xsl:call- template 
        4782              name="na"
        4783             />
        4784                                                                                   
        4785            </xsl:othe rwise>
        4786                                                                         
        4787           </xsl:choo se>
        4788                                                               
        4789          </div>
        4790                                                     
        4791         </td>
        4792                                            
        4793        </tr>
        4794                                           
        4795        <xsl:for-e ach 
        4796         select="$r ow/n1:orga nizer/n1:c omponent/n 1:observat ion"
        4797        >
        4798                                                    
        4799         <tr 
        4800          class="thi rd"
        4801         >
        4802                                                              
        4803          <td>
        4804                          
        4805           <span>
        4806                             
        4807            <xsl:text 
        4808             disable-ou tput-escap ing="yes"
        4809            >
        4810              &amp;nbsp
        4811            </xsl:text >
        4812                           
        4813           </span>
        4814                                                               
        4815          </td>
        4816                                                              
        4817          <!-- Resul t Type (Fr ee-text)-- >
        4818                                                              
        4819          <td>
        4820                                                                        
        4821           <div 
        4822            style="ove rflow:hidd en; white- space:nowr ap; width: auto;"
        4823           >
        4824                                                                                  
        4825            <xsl:varia ble 
        4826             name="type Result2"
        4827            >
        4828                                                                                            
        4829             <xsl:call- template 
        4830              name="getR esultType2 "
        4831             >
        4832                                                                                                     
        4833              <xsl:with- param 
        4834               name="obse rvation" 
        4835               select="."
        4836              />
        4837                                                                                             
        4838             </xsl:call -template>
        4839                                                                                   
        4840            </xsl:vari able>
        4841                                                                                  
        4842            <xsl:choos e>
        4843                                                                                            
        4844             <xsl:when 
        4845              test="stri ng-length( $typeResul t2)>0"
        4846             >
        4847                                                                                                     
        4848              <xsl:call- template 
        4849               name="flyo verSpan"
        4850              >
        4851                                                                                                               
        4852               <xsl:with- param 
        4853                name="data
        4854                select="$t ypeResult2 "
        4855               />
        4856                                                                                                      
        4857              </xsl:call -template>
        4858                                                                                             
        4859             </xsl:when >
        4860                                                                                            
        4861             <xsl:other wise>
        4862                                                                                                     
        4863              <xsl:varia ble 
        4864               name="type Result3"
        4865              >
        4866                                                                                                               
        4867               <xsl:call- template 
        4868                name="getR esultType"
        4869               >
        4870                                                                                                                         
        4871                <xsl:with- param 
        4872                 name="obse rvation" 
        4873                 select="."
        4874                />
        4875                                                                                                                
        4876               </xsl:call -template>
        4877                                                                                                      
        4878              </xsl:vari able>
        4879                                                                                                     
        4880              <xsl:choos e>
        4881                                                                                                               
        4882               <xsl:when 
        4883                test="stri ng-length( $typeResul t3)>0"
        4884               >
        4885                                                                                                                         
        4886                <xsl:call- template 
        4887                 name="flyo verSpan"
        4888                >
        4889                                                                                                                                   
        4890                 <xsl:with- param 
        4891                  name="data
        4892                  select="$t ypeResult3 "
        4893                 />
        4894                                                                                                                          
        4895                </xsl:call -template>
        4896                                                                                                                
        4897               </xsl:when >
        4898                                                                                                               
        4899               <xsl:other wise>
        4900                                                                                                                         
        4901                <xsl:call- template 
        4902                 name="na"
        4903                />
        4904                                                                                                                
        4905               </xsl:othe rwise>
        4906                                                                                                      
        4907              </xsl:choo se>
        4908                                                                                             
        4909             </xsl:othe rwise>
        4910                                                                                   
        4911            </xsl:choo se>
        4912                                                                         
        4913           </div>
        4914                                                               
        4915          </td>
        4916                                                              
        4917          <td>
        4918                                                                        
        4919           <xsl:call- template 
        4920            name="na"
        4921           />
        4922                                                               
        4923          </td>
        4924                                                              
        4925          <!-- Resul t Value -- >
        4926                                                              
        4927          <td>
        4928                                                                        
        4929           <div 
        4930            style="ove rflow:hidd en; white- space:nowr ap; width: 110px;"
        4931           >
        4932                                                                                  
        4933            <xsl:varia ble 
        4934             name="valu eResult2"
        4935            >
        4936                                                                                            
        4937             <xsl:call- template 
        4938              name="getR esultValue "
        4939             >
        4940                                                                                                     
        4941              <xsl:with- param 
        4942               name="obse rvation" 
        4943               select="."
        4944              />
        4945                                                                                             
        4946             </xsl:call -template>
        4947                                                                                   
        4948            </xsl:vari able>
        4949                                                                                  
        4950            <xsl:choos e>
        4951                                                                                            
        4952             <xsl:when 
        4953              test="stri ng-length( $valueResu lt2)>0"
        4954             >
        4955                                                                                                     
        4956              <xsl:call- template 
        4957               name="flyo verSpan"
        4958              >
        4959                                                                                                               
        4960               <xsl:with- param 
        4961                name="data
        4962                select="$v alueResult 2"
        4963               />
        4964                                                                                                      
        4965              </xsl:call -template>
        4966                                                                                             
        4967             </xsl:when >
        4968                                                                                            
        4969             <xsl:other wise>
        4970                                                                                                     
        4971              <xsl:call- template 
        4972               name="na"
        4973              />
        4974                                                                                             
        4975             </xsl:othe rwise>
        4976                                                                                   
        4977            </xsl:choo se>
        4978                                                                         
        4979           </div>
        4980                                                               
        4981          </td>
        4982                                                              
        4983          <!-- inter pretation  -->
        4984                                                              
        4985          <td>
        4986                                                                        
        4987           <div 
        4988            style="ove rflow:hidd en; white- space:nowr ap; width: auto;"
        4989           >
        4990                                                                                  
        4991            <xsl:varia ble 
        4992             name="inte rpResult1"
        4993            >
        4994                                                                                            
        4995             <xsl:call- template 
        4996              name="getI nterpretat ion"
        4997             >
        4998                                                                                                     
        4999              <xsl:with- param 
        5000               name="obse rvation" 
        5001               select="."
        5002              />
        5003                                                                                             
        5004             </xsl:call -template>
        5005                                                                                   
        5006            </xsl:vari able>
        5007                                                                                  
        5008            <xsl:choos e>
        5009                                                                                            
        5010             <xsl:when 
        5011              test="stri ng-length( $interpRes ult1)>0"
        5012             >
        5013                                                                                                     
        5014              <xsl:call- template 
        5015               name="flyo verSpan"
        5016              >
        5017                                                                                                               
        5018               <xsl:with- param 
        5019                name="data
        5020                select="$i nterpResul t1"
        5021               />
        5022                                                                                                      
        5023              </xsl:call -template>
        5024                                                                                             
        5025             </xsl:when >
        5026                                                                                            
        5027             <xsl:other wise>
        5028                                                                                                     
        5029              <xsl:varia ble 
        5030               name="inte rpResult2"
        5031              >
        5032                                                                                                               
        5033               <xsl:call- template 
        5034                name="getI nterpretat ion2"
        5035               >
        5036                                                                                                                         
        5037                <xsl:with- param 
        5038                 name="obse rvation" 
        5039                 select="."
        5040                />
        5041                                                                                                                
        5042               </xsl:call -template>
        5043                                                                                                      
        5044              </xsl:vari able>
        5045                                                                                                     
        5046              <xsl:choos e>
        5047                                                                                                               
        5048               <xsl:when 
        5049                test="stri ng-length( $interpRes ult2)>0"
        5050               >
        5051                                                                                                                         
        5052                <xsl:call- template 
        5053                 name="flyo verSpan"
        5054                >
        5055                                                                                                                                   
        5056                 <xsl:with- param 
        5057                  name="data
        5058                  select="$i nterpResul t2"
        5059                 />
        5060                                                                                                                          
        5061                </xsl:call -template>
        5062                                                                                                                
        5063               </xsl:when >
        5064                                                                                                               
        5065               <xsl:other wise>
        5066                                                                                                                         
        5067                <xsl:call- template 
        5068                 name="na"
        5069                />
        5070                                                                                                                
        5071               </xsl:othe rwise>
        5072                                                                                                      
        5073              </xsl:choo se>
        5074                                                                                             
        5075             </xsl:othe rwise>
        5076                                                                                   
        5077            </xsl:choo se>
        5078                                                                         
        5079           </div>
        5080                                                               
        5081          </td>
        5082                                                              
        5083          <!-- ref r ange -->
        5084                                                              
        5085          <td>
        5086                                                                        
        5087           <div 
        5088            style="ove rflow:hidd en; white- space:nowr ap; width: 130px;"
        5089           >
        5090                                                                                  
        5091            <xsl:varia ble 
        5092             name="ref"
        5093            >
        5094                                                                                            
        5095             <xsl:call- template 
        5096              name="getR efRange"
        5097             >
        5098                                                                                                     
        5099              <xsl:with- param 
        5100               name="obse rvation" 
        5101               select="."
        5102              />
        5103                                                                                             
        5104             </xsl:call -template>
        5105                                                                                   
        5106            </xsl:vari able>
        5107                                                                                  
        5108            <xsl:choos e>
        5109                                                                                            
        5110             <xsl:when 
        5111              test="stri ng-length( $ref)>0"
        5112             >
        5113                                                                                                     
        5114              <xsl:call- template 
        5115               name="flyo verSpan"
        5116              >
        5117                                                                                                               
        5118               <xsl:with- param 
        5119                name="data
        5120                select="$r ef"
        5121               />
        5122                                                                                                      
        5123              </xsl:call -template>
        5124                                                                                             
        5125             </xsl:when >
        5126                                                                                            
        5127             <xsl:other wise>
        5128                                                                                                     
        5129              <xsl:call- template 
        5130               name="na"
        5131              />
        5132                                                                                             
        5133             </xsl:othe rwise>
        5134                                                                                   
        5135            </xsl:choo se>
        5136                                                                         
        5137           </div>
        5138                                                               
        5139          </td>
        5140                                                              
        5141          <!-- Resul t Status - ->
        5142                                                              
        5143          <td>
        5144                                                                        
        5145           <div 
        5146            style="ove rflow:hidd en; white- space:nowr ap; width: 80px;"
        5147           >
        5148                                                                                  
        5149            <xsl:choos e>
        5150                                                                                            
        5151             <xsl:when 
        5152              test="stri ng-length( ./n1:statu sCode/@cod e)>0"
        5153             >
        5154                                                                                                     
        5155              <xsl:call- template 
        5156               name="flyo verSpan"
        5157              >
        5158                                                                                                               
        5159               <xsl:with- param 
        5160                name="data
        5161                select="./ n1:statusC ode/@code"
        5162               />
        5163                                                                                                      
        5164              </xsl:call -template>
        5165                                                                                             
        5166             </xsl:when >
        5167                                                                                            
        5168             <xsl:other wise>
        5169                                                                                                     
        5170              <xsl:call- template 
        5171               name="na"
        5172              />
        5173                                                                                             
        5174             </xsl:othe rwise>
        5175                                                                                   
        5176            </xsl:choo se>
        5177                                                                         
        5178           </div>
        5179                                                               
        5180          </td>
        5181                                                     
        5182         </tr>
        5183                                            
        5184        </xsl:for- each>
        5185                                  
        5186       </xsl:when >
        5187                                 
        5188       <!-- No or ganizer wi th lab -->
        5189                                 
        5190       <xsl:other wise>
        5191                                           
        5192        <xsl:choos e>
        5193                                                    
        5194         <xsl:when 
        5195          test="stri ng-length( $row/n1:ob servation/ n1:code/@d isplayName )!=0 or $r ow/n1:obse rvation/n1 :text/n1:r eference/@ value"
        5196         >
        5197                                                              
        5198          <tr 
        5199           class="sec ond"
        5200          >
        5201                                                                        
        5202           <!-- Resul t Date/Tim e -->
        5203                                                                        
        5204           <td>
        5205                                                                                  
        5206            <div 
        5207             style="ove rflow:hidd en; white- space:nowr ap; width: auto; padd ing-right: 5px;"
        5208            >
        5209                                                                                            
        5210             <xsl:varia ble 
        5211              name="date 2"
        5212             >
        5213                                                                                                     
        5214              <xsl:call- template 
        5215               name="getR esultDT"
        5216              >
        5217                                                                                                               
        5218               <xsl:with- param 
        5219                name="obse rvation" 
        5220                select="$r ow/n1:obse rvation"
        5221               />
        5222                                                                                                      
        5223              </xsl:call -template>
        5224                                                                                             
        5225             </xsl:vari able>
        5226                                                                                            
        5227             <xsl:choos e>
        5228                                                                                                     
        5229              <xsl:when 
        5230               test="stri ng-length( $date2)>0"
        5231              >
        5232                                                                                                               
        5233               <xsl:call- template 
        5234                name="flyo verSpan"
        5235               >
        5236                                                                                                                         
        5237                <xsl:with- param 
        5238                 name="data
        5239                 select="$d ate2"
        5240                />
        5241                                                                                                                
        5242               </xsl:call -template>
        5243                                                                                                      
        5244              </xsl:when >
        5245                                                                                                     
        5246              <xsl:other wise>
        5247                                                                                                               
        5248               <xsl:call- template 
        5249                name="na"
        5250               />
        5251                                                                                                      
        5252              </xsl:othe rwise>
        5253                                                                                             
        5254             </xsl:choo se>
        5255                                                                                   
        5256            </div>
        5257                                                                         
        5258           </td>
        5259                                                                        
        5260           <!-- Resul t Type (Fr ee-text)-- >
        5261                                                                        
        5262           <td>
        5263                                                                                  
        5264            <div 
        5265             style="ove rflow:hidd en; white- space:nowr ap; width: auto;"
        5266            >
        5267                                                                                            
        5268             <xsl:varia ble 
        5269              name="type Result2"
        5270             >
        5271                                                                                                     
        5272              <xsl:call- template 
        5273               name="getR esultType2 "
        5274              >
        5275                                                                                                               
        5276               <xsl:with- param 
        5277                name="obse rvation" 
        5278                select="$r ow/n1:obse rvation"
        5279               />
        5280                                                                                                      
        5281              </xsl:call -template>
        5282                                                                                             
        5283             </xsl:vari able>
        5284                                                                                            
        5285             <xsl:choos e>
        5286                                                                                                     
        5287              <xsl:when 
        5288               test="stri ng-length( $typeResul t2)>0"
        5289              >
        5290                                                                                                               
        5291               <xsl:call- template 
        5292                name="flyo verSpan"
        5293               >
        5294                                                                                                                         
        5295                <xsl:with- param 
        5296                 name="data
        5297                 select="$t ypeResult2 "
        5298                />
        5299                                                                                                                
        5300               </xsl:call -template>
        5301                                                                                                      
        5302              </xsl:when >
        5303                                                                                                     
        5304              <xsl:other wise>
        5305                                                                                                               
        5306               <xsl:varia ble 
        5307                name="type Result3"
        5308               >
        5309                                                                                                                         
        5310                <xsl:call- template 
        5311                 name="getR esultType"
        5312                >
        5313                                                                                                                                   
        5314                 <xsl:with- param 
        5315                  name="obse rvation" 
        5316                  select="$r ow/n1:obse rvation"
        5317                 />
        5318                                                                                                                          
        5319                </xsl:call -template>
        5320                                                                                                                
        5321               </xsl:vari able>
        5322                                                                                                               
        5323               <xsl:choos e>
        5324                                                                                                                         
        5325                <xsl:when 
        5326                 test="stri ng-length( $typeResul t3)>0"
        5327                >
        5328                                                                                                                                   
        5329                 <xsl:call- template 
        5330                  name="flyo verSpan"
        5331                 >
        5332                                                                                                                                             
        5333                  <xsl:with- param 
        5334                   name="data
        5335                   select="$t ypeResult3 "
        5336                  />
        5337                                                                                                                                    
        5338                 </xsl:call -template>
        5339                                                                                                                          
        5340                </xsl:when >
        5341                                                                                                                         
        5342                <xsl:other wise>
        5343                                                                                                                                   
        5344                 <xsl:call- template 
        5345                  name="na"
        5346                 />
        5347                                                                                                                          
        5348                </xsl:othe rwise>
        5349                                                                                                                
        5350               </xsl:choo se>
        5351                                                                                                      
        5352              </xsl:othe rwise>
        5353                                                                                             
        5354             </xsl:choo se>
        5355                                                                                   
        5356            </div>
        5357                                                                         
        5358           </td>
        5359                                                                        
        5360           <td>
        5361                                                                                  
        5362            <xsl:call- template 
        5363             name="na"
        5364            />
        5365                                                                         
        5366           </td>
        5367                                                                        
        5368           <!-- Resul t Value -- >
        5369                                                                        
        5370           <td>
        5371                                                                                  
        5372            <div 
        5373             style="ove rflow:hidd en; width: 120px;"
        5374            >
        5375                                                                                            
        5376             <xsl:varia ble 
        5377              name="valu eResult"
        5378             >
        5379                                                                                                     
        5380              <xsl:call- template 
        5381               name="getR esultValue "
        5382              >
        5383                                                                                                               
        5384               <xsl:with- param 
        5385                name="obse rvation" 
        5386                select="$r ow/n1:obse rvation"
        5387               />
        5388                                                                                                      
        5389              </xsl:call -template>
        5390                                                                                             
        5391             </xsl:vari able>
        5392                                                                                            
        5393             <xsl:choos e>
        5394                                                                                                     
        5395              <xsl:when 
        5396               test="stri ng-length( $valueResu lt)>0"
        5397              >
        5398                                                                                                               
        5399               <xsl:call- template 
        5400                name="flyo verSpan"
        5401               >
        5402                                                                                                                         
        5403                <xsl:with- param 
        5404                 name="data
        5405                 select="$v alueResult "
        5406                />
        5407                                                                                                                
        5408               </xsl:call -template>
        5409                                                                                                      
        5410              </xsl:when >
        5411                                                                                                     
        5412              <xsl:other wise>
        5413                                                                                                               
        5414               <xsl:call- template 
        5415                name="na"
        5416               />
        5417                                                                                                      
        5418              </xsl:othe rwise>
        5419                                                                                             
        5420             </xsl:choo se>
        5421                                                                                   
        5422            </div>
        5423                                                                         
        5424           </td>
        5425                                                                        
        5426           <!-- inter pretation  -->
        5427                                                                        
        5428           <td>
        5429                                                                                  
        5430            <div 
        5431             style="ove rflow:hidd en; white- space:nowr ap; width: 120px;"
        5432            >
        5433                                                                                            
        5434             <xsl:varia ble 
        5435              name="inte rpResult1"
        5436             >
        5437                                                                                                     
        5438              <xsl:call- template 
        5439               name="getI nterpretat ion2"
        5440              >
        5441                                                                                                               
        5442               <xsl:with- param 
        5443                name="obse rvation" 
        5444                select="$r ow/n1:obse rvation"
        5445               />
        5446                                                                                                      
        5447              </xsl:call -template>
        5448                                                                                             
        5449             </xsl:vari able>
        5450                                                                                            
        5451             <xsl:choos e>
        5452                                                                                                     
        5453              <xsl:when 
        5454               test="stri ng-length( $interpRes ult1)>0"
        5455              >
        5456                                                                                                               
        5457               <xsl:call- template 
        5458                name="flyo verSpan"
        5459               >
        5460                                                                                                                         
        5461                <xsl:with- param 
        5462                 name="data
        5463                 select="$i nterpResul t1"
        5464                />
        5465                                                                                                                
        5466               </xsl:call -template>
        5467                                                                                                      
        5468              </xsl:when >
        5469                                                                                                     
        5470              <xsl:other wise>
        5471                                                                                                               
        5472               <xsl:varia ble 
        5473                name="inte rpResult2"
        5474               >
        5475                                                                                                                         
        5476                <xsl:call- template 
        5477                 name="getI nterpretat ion"
        5478                >
        5479                                                                                                                                   
        5480                 <xsl:with- param 
        5481                  name="obse rvation" 
        5482                  select="$r ow/n1:obse rvation"
        5483                 />
        5484                                                                                                                          
        5485                </xsl:call -template>
        5486                                                                                                                
        5487               </xsl:vari able>
        5488                                                                                                               
        5489               <xsl:choos e>
        5490                                                                                                                         
        5491                <xsl:when 
        5492                 test="stri ng-length( $interpRes ult2)>0"
        5493                >
        5494                                                                                                                                   
        5495                 <xsl:call- template 
        5496                  name="flyo verSpan"
        5497                 >
        5498                                                                                                                                             
        5499                  <xsl:with- param 
        5500                   name="data
        5501                   select="$i nterpResul t2"
        5502                  />
        5503                                                                                                                                    
        5504                 </xsl:call -template>
        5505                                                                                                                          
        5506                </xsl:when >
        5507                                                                                                                         
        5508                <xsl:other wise>
        5509                                                                                                                                   
        5510                 <xsl:call- template 
        5511                  name="na"
        5512                 />
        5513                                                                                                                          
        5514                </xsl:othe rwise>
        5515                                                                                                                
        5516               </xsl:choo se>
        5517                                                                                                      
        5518              </xsl:othe rwise>
        5519                                                                                             
        5520             </xsl:choo se>
        5521                                                                                   
        5522            </div>
        5523                                                                         
        5524           </td>
        5525                                                                        
        5526           <!-- ref r ange -->
        5527                                                                        
        5528           <td>
        5529                                                                                  
        5530            <div 
        5531             style="ove rflow:hidd en; white- space:nowr ap; width: 120px;"
        5532            >
        5533                                                                                            
        5534             <xsl:varia ble 
        5535              name="ref"
        5536             >
        5537                                                                                                     
        5538              <xsl:call- template 
        5539               name="getR efRange"
        5540              >
        5541                                                                                                               
        5542               <xsl:with- param 
        5543                name="obse rvation" 
        5544                select="$r ow/n1:obse rvation"
        5545               />
        5546                                                                                                      
        5547              </xsl:call -template>
        5548                                                                                             
        5549             </xsl:vari able>
        5550                                                                                            
        5551             <xsl:choos e>
        5552                                                                                                     
        5553              <xsl:when 
        5554               test="stri ng-length( $ref)>0"
        5555              >
        5556                                                                                                               
        5557               <xsl:call- template 
        5558                name="flyo verSpan"
        5559               >
        5560                                                                                                                         
        5561                <xsl:with- param 
        5562                 name="data
        5563                 select="$r ef"
        5564                />
        5565                                                                                                                
        5566               </xsl:call -template>
        5567                                                                                                      
        5568              </xsl:when >
        5569                                                                                                     
        5570              <xsl:other wise>
        5571                                                                                                               
        5572               <xsl:call- template 
        5573                name="na"
        5574               />
        5575                                                                                                      
        5576              </xsl:othe rwise>
        5577                                                                                             
        5578             </xsl:choo se>
        5579                                                                                   
        5580            </div>
        5581                                                                         
        5582           </td>
        5583                                                                        
        5584           <!-- Resul t Status - ->
        5585                                                                        
        5586           <td>
        5587                                                                                  
        5588            <div 
        5589             style="ove rflow:hidd en; white- space:nowr ap; width: 80px;"
        5590            >
        5591                                                                                            
        5592             <xsl:choos e>
        5593                                                                                                     
        5594              <xsl:when 
        5595               test="stri ng-length( $row/n1:ob servation/ n1:statusC ode/@code) >0"
        5596              >
        5597                                                                                                               
        5598               <xsl:call- template 
        5599                name="flyo verSpan"
        5600               >
        5601                                                                                                                         
        5602                <xsl:with- param 
        5603                 name="data
        5604                 select="$r ow/n1:obse rvation/n1 :statusCod e/@code"
        5605                />
        5606                                                                                                                
        5607               </xsl:call -template>
        5608                                                                                                      
        5609              </xsl:when >
        5610                                                                                                     
        5611              <xsl:other wise>
        5612                                                                                                               
        5613               <xsl:call- template 
        5614                name="na"
        5615               />
        5616                                                                                                      
        5617              </xsl:othe rwise>
        5618                                                                                             
        5619             </xsl:choo se>
        5620                                                                                   
        5621            </div>
        5622                                                                         
        5623           </td>
        5624                                                                        
        5625           <td>
        5626                                                                                  
        5627            <xsl:call- template 
        5628             name="na"
        5629            />
        5630                                                                         
        5631           </td>
        5632                                                               
        5633          </tr>
        5634                                                     
        5635         </xsl:when >
        5636                                            
        5637        </xsl:choo se>
        5638                                  
        5639       </xsl:othe rwise>
        5640                        
        5641      </xsl:choo se>
        5642              
        5643     </xsl:temp late>
        5644    
        5645       
        5646     <!-- immun ization en try row -- >
        5647       
        5648     <xsl:templ ate 
        5649      name="immu nizationsR ow"
        5650     >
        5651          
        5652      <xsl:param  
        5653       name="row"
        5654      />
        5655          
        5656      <xsl:varia ble 
        5657       name="rowD ata" 
        5658       select="$r ow/n1:subs tanceAdmin istration/ n1:consuma ble/n1:man ufacturedP roduct/n1: manufactur edMaterial "
        5659      />
        5660          
        5661      <xsl:varia ble 
        5662       name="rowS ubj" 
        5663       select="$r ow/n1:subs tanceAdmin istration/ n1:entryRe lationship [@typeCode ='SUBJ']/n 1:observat ion"
        5664      />
        5665          
        5666      <xsl:varia ble 
        5667       name="rowC ause" 
        5668       select="$r ow/n1:subs tanceAdmin istration[ @classCode ='SBADM']/ n1:entryRe lationship [@typeCode ='CAUS' an d @inversi onInd='fal se']/n1:ob servation"
        5669      />
        5670          
        5671      <xsl:varia ble 
        5672       name="subs tanceAdmin istration"  
        5673       select="$r ow/n1:subs tanceAdmin istration"
        5674      />
        5675          
        5676      <tr 
        5677       class="sec ond"
        5678      >
        5679             
        5680       <!-- name  -->
        5681             
        5682       <td>
        5683                
        5684        <div 
        5685         style="ove rflow:hidd en; white- space:nowr ap; width: 200px;"
        5686        >
        5687                   
        5688         <xsl:varia ble 
        5689          name="immu nizationRe sult"
        5690         >
        5691                       
        5692          <xsl:call- template 
        5693           name="getI mmunizatio n"
        5694          >
        5695                          
        5696           <xsl:with- param 
        5697            name="subs tanceAdmin istration"  
        5698            select="$s ubstanceAd ministrati on"
        5699           />
        5700                        
        5701          </xsl:call -template>
        5702                    
        5703         </xsl:vari able>
        5704                   
        5705         <xsl:choos e>
        5706                       
        5707          <xsl:when 
        5708           test="stri ng-length( $immunizat ionResult) >0"
        5709          >
        5710                          
        5711           <xsl:call- template 
        5712            name="flyo verSpan"
        5713           >
        5714                             
        5715            <xsl:with- param 
        5716             name="data
        5717             select="$i mmunizatio nResult"
        5718            />
        5719                           
        5720           </xsl:call -template>
        5721                        
        5722          </xsl:when >
        5723                       
        5724          <xsl:other wise>
        5725                          
        5726           <xsl:call- template 
        5727            name="na"
        5728           />
        5729                        
        5730          </xsl:othe rwise>
        5731                    
        5732         </xsl:choo se>
        5733                 
        5734        </div>
        5735              
        5736       </td>
        5737             
        5738       <!-- serie s -->
        5739             
        5740       <td>
        5741                
        5742        <div 
        5743         style="ove rflow:hidd en; white- space:nowr ap; width: 100px;"
        5744        >
        5745                   
        5746         <xsl:call- template 
        5747          name="flyo verSpan"
        5748         >
        5749                       
        5750          <xsl:with- param 
        5751           name="data
        5752           select="$r owSubj/n1: value/@val ue"
        5753          />
        5754                    
        5755         </xsl:call -template>
        5756                 
        5757        </div>
        5758              
        5759       </td>
        5760             
        5761       <!--  effe ctive date  -->
        5762             
        5763       <td>
        5764                
        5765        <div 
        5766         style="ove rflow:hidd en; white- space:nowr ap; width: 100px;"
        5767        >
        5768                   
        5769         <xsl:choos e>
        5770                       
        5771          <xsl:when 
        5772           test="stri ng-length( $row/n1:su bstanceAdm inistratio n/n1:effec tiveTime/@ value)=0"
        5773          >
        5774                          
        5775           <xsl:text>
        5776            -- Not Ava ilable --
        5777           </xsl:text >
        5778                        
        5779          </xsl:when >
        5780                       
        5781          <xsl:other wise>
        5782                          
        5783           <xsl:call- template 
        5784            name="form atDateShor t"
        5785           >
        5786                             
        5787            <xsl:with- param 
        5788             name="date String" 
        5789             select="$r ow/n1:subs tanceAdmin istration/ n1:effecti veTime/@va lue"
        5790            />
        5791                           
        5792           </xsl:call -template>
        5793                        
        5794          </xsl:othe rwise>
        5795                    
        5796         </xsl:choo se>
        5797                 
        5798        </div>
        5799              
        5800       </td>
        5801             
        5802       <!-- react ion -->
        5803             
        5804       <td>
        5805                
        5806        <div 
        5807         style="ove rflow:hidd en; white- space:nowr ap; width: 260px;"
        5808        >
        5809                   
        5810         <xsl:varia ble 
        5811          name="reac tionRefere nce" 
        5812          select="$r owCause/n1 :text/n1:r eference/@ value"
        5813         />
        5814                   
        5815         <xsl:varia ble 
        5816          name="reac tion" 
        5817          select=".. /n1:text// n1:content [@ID=subst ring-after ($reaction Reference, '#')]"
        5818         />
        5819                   
        5820         <xsl:call- template 
        5821          name="flyo verSpan"
        5822         >
        5823                       
        5824          <xsl:with- param 
        5825           name="data
        5826           select="$r eaction"
        5827          />
        5828                    
        5829         </xsl:call -template>
        5830                 
        5831        </div>
        5832              
        5833       </td>
        5834             
        5835       <!-- comme nts -->
        5836             
        5837       <td>
        5838                
        5839        <xsl:varia ble 
        5840         name="comm entReferen ce" 
        5841         select="$r ow/n1:subs tanceAdmin istration/ n1:text/n1 :reference /@value"
        5842        />
        5843                
        5844        <div 
        5845         style="ove rflow:hidd en; white- space:nowr ap; width: 240px;"
        5846        >
        5847                   
        5848         <xsl:call- template 
        5849          name="flyo verSpan"
        5850         >
        5851                       
        5852          <xsl:with- param 
        5853           name="data
        5854           select=".. /n1:text// n1:content [@ID=subst ring-after ($commentR eference,' #')]"
        5855          />
        5856                    
        5857         </xsl:call -template>
        5858                 
        5859        </div>
        5860              
        5861       </td>
        5862           
        5863      </tr>
        5864        
        5865     </xsl:temp late>
        5866    
        5867       
        5868     <!-- vital s entry ro w -->
        5869       
        5870     <xsl:templ ate 
        5871      name="vita lsRow"
        5872     >
        5873          
        5874      <xsl:param  
        5875       name="row"
        5876      />
        5877          
        5878      <xsl:varia ble 
        5879       name="rowD ata" 
        5880       select="$r ow/n1:orga nizer/n1:c omponent/n 1:observat ion"
        5881      />
        5882          
        5883      <xsl:varia ble 
        5884       name="heig ht" 
        5885       select="$r ow/n1:orga nizer/n1:c omponent/n 1:observat ion[n1:cod e/@code=$l oincHeight ]"
        5886      />
        5887          
        5888      <xsl:varia ble 
        5889       name="weig ht" 
        5890       select="$r ow/n1:orga nizer/n1:c omponent/n 1:observat ion[n1:cod e/@code=$l oincWeight ]"
        5891      />
        5892          
        5893      <xsl:varia ble 
        5894       name="syst olic" 
        5895       select="$r ow/n1:orga nizer/n1:c omponent/n 1:observat ion[n1:cod e/@code=$l oincBpSyst olic]"
        5896      />
        5897          
        5898      <xsl:varia ble 
        5899       name="dias tolic" 
        5900       select="$r ow/n1:orga nizer/n1:c omponent/n 1:observat ion[n1:cod e/@code=$l oincBpDias tolic]"
        5901      />
        5902          
        5903      <xsl:varia ble 
        5904       name="temp
        5905       select="$r ow/n1:orga nizer/n1:c omponent/n 1:observat ion[n1:cod e/@code=$l oincTemper ature]"
        5906      />
        5907          
        5908      <xsl:varia ble 
        5909       name="puls e" 
        5910       select="$r ow/n1:orga nizer/n1:c omponent/n 1:observat ion[n1:cod e/@code=$l oincPulse] "
        5911      />
        5912          
        5913      <xsl:varia ble 
        5914       name="resp
        5915       select="$r ow/n1:orga nizer/n1:c omponent/n 1:observat ion[n1:cod e/@code=$l oincRespir ation]"
        5916      />
        5917          
        5918      <xsl:varia ble 
        5919       name="pox"  
        5920       select="$r ow/n1:orga nizer/n1:c omponent/n 1:observat ion[n1:cod e/@code=$l oincPulseO ximetry]"
        5921      />
        5922          
        5923      <xsl:varia ble 
        5924       name="bloo dPressure"  
        5925       select="$r ow/n1:orga nizer/n1:c omponent/n 1:observat ion[n1:cod e/@code=$l oincBloodP ressure]"
        5926      />
        5927          
        5928      <xsl:varia ble 
        5929       name="body HtLying" 
        5930       select="$r ow/n1:orga nizer/n1:c omponent/n 1:observat ion[n1:cod e/@code=$l oincBodyHt Lying]"
        5931      />
        5932          
        5933      <xsl:varia ble 
        5934       name="head CircumOCF"  
        5935       select="$r ow/n1:orga nizer/n1:c omponent/n 1:observat ion[n1:cod e/@code=$l oincOCF]"
        5936      />
        5937          
        5938      <xsl:varia ble 
        5939       name="weig ht2" 
        5940       select="$r ow/n1:orga nizer/n1:c omponent/n 1:observat ion[n1:cod e/@code=$l oincWeight 2]"
        5941      />
        5942          
        5943      <tr 
        5944       class="sec ond"
        5945      >
        5946             
        5947       <!-- Date  -->
        5948             
        5949       <td>
        5950                
        5951        <div 
        5952         style="ove rflow:hidd en; white- space:nowr ap; width: 80px;"
        5953        >
        5954                   
        5955         <xsl:choos e>
        5956                       
        5957          <xsl:when 
        5958           test="stri ng-length( $rowData/n 1:effectiv eTime/@val ue)=0"
        5959          >
        5960                          
        5961           <xsl:text>
        5962            -- Not Ava ilable --
        5963           </xsl:text >
        5964                        
        5965          </xsl:when >
        5966                       
        5967          <xsl:other wise>
        5968                          
        5969           <xsl:call- template 
        5970            name="form atDateShor t"
        5971           >
        5972                             
        5973            <xsl:with- param 
        5974             name="date String" 
        5975             select="$r owData/n1: effectiveT ime/@value "
        5976            />
        5977                           
        5978           </xsl:call -template>
        5979                        
        5980          </xsl:othe rwise>
        5981                    
        5982         </xsl:choo se>
        5983                 
        5984        </div>
        5985              
        5986       </td>
        5987             
        5988       <!-- temp  -->
        5989             
        5990       <td>
        5991                
        5992        <div 
        5993         style="ove rflow:hidd en; white- space:nowr ap; width: 70px;"
        5994        >
        5995                   
        5996         <xsl:choos e>
        5997                       
        5998          <xsl:when 
        5999           test="$tem p"
        6000          >
        6001                          
        6002           <xsl:for-e ach 
        6003            select="$t emp"
        6004           >
        6005                             
        6006            <xsl:if 
        6007             test="posi tion()>1"
        6008            >
        6009                                
        6010             <br/>
        6011                              
        6012            </xsl:if>
        6013                             
        6014            <xsl:choos e>
        6015                                
        6016             <xsl:when 
        6017              test="stri ng-length( n1:value/@ value)>1"
        6018             >
        6019                                   
        6020              <xsl:varia ble 
        6021               name="temp Result" 
        6022               select="n1 :value/@va lue"
        6023              />
        6024                                   
        6025              <xsl:choos e>
        6026                                       
        6027               <xsl:when 
        6028                test="n1:v alue/@unit "
        6029               >
        6030                                          
        6031                <xsl:call- template 
        6032                 name="flyo verSpan"
        6033                >
        6034                                             
        6035                 <xsl:with- param 
        6036                  name="data
        6037                  select="co ncat($temp Result,n1: value/@uni t)"
        6038                 />
        6039                                           
        6040                </xsl:call -template>
        6041                                        
        6042               </xsl:when >
        6043                                       
        6044               <xsl:other wise>
        6045                                          
        6046                <xsl:call- template 
        6047                 name="flyo verSpan"
        6048                >
        6049                                             
        6050                 <xsl:with- param 
        6051                  name="data
        6052                  select="$t empResult"
        6053                 />
        6054                                           
        6055                </xsl:call -template>
        6056                                        
        6057               </xsl:othe rwise>
        6058                                    
        6059              </xsl:choo se>
        6060                                 
        6061             </xsl:when >
        6062                              
        6063            </xsl:choo se>
        6064                           
        6065           </xsl:for- each>
        6066                        
        6067          </xsl:when >
        6068                       
        6069          <xsl:other wise>
        6070                          
        6071           <xsl:call- template 
        6072            name="na"
        6073           />
        6074                        
        6075          </xsl:othe rwise>
        6076                    
        6077         </xsl:choo se>
        6078                 
        6079        </div>
        6080              
        6081       </td>
        6082             
        6083       <!-- pulse  -->
        6084             
        6085       <td>
        6086                
        6087        <div 
        6088         style="ove rflow:hidd en; white- space:nowr ap; width: 70px;"
        6089        >
        6090                   
        6091         <xsl:choos e>
        6092                       
        6093          <xsl:when 
        6094           test="$pul se"
        6095          >
        6096                          
        6097           <xsl:for-e ach 
        6098            select="$p ulse"
        6099           >
        6100                             
        6101            <xsl:if 
        6102             test="posi tion()>1"
        6103            >
        6104                                
        6105             <br/>
        6106                              
        6107            </xsl:if>
        6108                             
        6109            <xsl:choos e>
        6110                                
        6111             <xsl:when 
        6112              test="stri ng-length( n1:value/@ value)>1"
        6113             >
        6114                                   
        6115              <xsl:varia ble 
        6116               name="puls eResult" 
        6117               select="n1 :value/@va lue"
        6118              />
        6119                                   
        6120              <xsl:choos e>
        6121                                       
        6122               <xsl:when 
        6123                test="n1:v alue/@unit "
        6124               >
        6125                                          
        6126                <xsl:call- template 
        6127                 name="flyo verSpan"
        6128                >
        6129                                             
        6130                 <xsl:with- param 
        6131                  name="data
        6132                  select="co ncat($puls eResult,n1 :value/@un it)"
        6133                 />
        6134                                           
        6135                </xsl:call -template>
        6136                                        
        6137               </xsl:when >
        6138                                       
        6139               <xsl:other wise>
        6140                                          
        6141                <xsl:call- template 
        6142                 name="flyo verSpan"
        6143                >
        6144                                             
        6145                 <xsl:with- param 
        6146                  name="data
        6147                  select="$p ulseResult "
        6148                 />
        6149                                           
        6150                </xsl:call -template>
        6151                                        
        6152               </xsl:othe rwise>
        6153                                    
        6154              </xsl:choo se>
        6155                                 
        6156             </xsl:when >
        6157                              
        6158            </xsl:choo se>
        6159                           
        6160           </xsl:for- each>
        6161                        
        6162          </xsl:when >
        6163                       
        6164          <xsl:other wise>
        6165                          
        6166           <xsl:call- template 
        6167            name="na"
        6168           />
        6169                        
        6170          </xsl:othe rwise>
        6171                    
        6172         </xsl:choo se>
        6173                 
        6174        </div>
        6175              
        6176       </td>
        6177             
        6178       <!-- resp  -->
        6179             
        6180       <td>
        6181                
        6182        <div 
        6183         style="ove rflow:hidd en; white- space:nowr ap; width: 70px;"
        6184        >
        6185                   
        6186         <xsl:choos e>
        6187                       
        6188          <xsl:when 
        6189           test="$res p"
        6190          >
        6191                          
        6192           <xsl:for-e ach 
        6193            select="$r esp"
        6194           >
        6195                             
        6196            <xsl:if 
        6197             test="posi tion()>1"
        6198            >
        6199                                
        6200             <br/>
        6201                              
        6202            </xsl:if>
        6203                             
        6204            <xsl:choos e>
        6205                                
        6206             <xsl:when 
        6207              test="stri ng-length( n1:value/@ value)>1"
        6208             >
        6209                                   
        6210              <xsl:varia ble 
        6211               name="resp Result" 
        6212               select="n1 :value/@va lue"
        6213              />
        6214                                   
        6215              <xsl:choos e>
        6216                                       
        6217               <xsl:when 
        6218                test="n1:v alue/@unit "
        6219               >
        6220                                          
        6221                <xsl:call- template 
        6222                 name="flyo verSpan"
        6223                >
        6224                                             
        6225                 <xsl:with- param 
        6226                  name="data
        6227                  select="co ncat($resp Result,n1: value/@uni t)"
        6228                 />
        6229                                           
        6230                </xsl:call -template>
        6231                                        
        6232               </xsl:when >
        6233                                       
        6234               <xsl:other wise>
        6235                                          
        6236                <xsl:call- template 
        6237                 name="flyo verSpan"
        6238                >
        6239                                             
        6240                 <xsl:with- param 
        6241                  name="data
        6242                  select="$r espResult"
        6243                 />
        6244                                           
        6245                </xsl:call -template>
        6246                                        
        6247               </xsl:othe rwise>
        6248                                    
        6249              </xsl:choo se>
        6250                                 
        6251             </xsl:when >
        6252                              
        6253            </xsl:choo se>
        6254                           
        6255           </xsl:for- each>
        6256                        
        6257          </xsl:when >
        6258                       
        6259          <xsl:other wise>
        6260                          
        6261           <xsl:call- template 
        6262            name="na"
        6263           />
        6264                        
        6265          </xsl:othe rwise>
        6266                    
        6267         </xsl:choo se>
        6268                 
        6269        </div>
        6270              
        6271       </td>
        6272             
        6273       <!-- BP  s ystolic /  diastolic  -->
        6274             
        6275       <td>
        6276                
        6277        <div 
        6278         style="ove rflow:hidd en; white- space:nowr ap; width: 70px;"
        6279        >
        6280                   
        6281         <xsl:choos e>
        6282                       
        6283          <xsl:when 
        6284           test="$sys tolic/n1:v alue/@valu e or $dias tolic/n1:v alue/@valu e or $bloo dPressure/ n1:value/@ value"
        6285          >
        6286                          
        6287           <xsl:call- template 
        6288            name="bpDe tailLister "
        6289           >
        6290                             
        6291            <xsl:with- param 
        6292             name="syst olics" 
        6293             select="$s ystolic"
        6294            />
        6295                             
        6296            <xsl:with- param 
        6297             name="dias tolics" 
        6298             select="$d iastolic"
        6299            />
        6300                           
        6301           </xsl:call -template>
        6302                          
        6303           <xsl:if 
        6304            test="$sys tolic/n1:v alue/@valu e and $blo odPressure /n1:value/ @value"
        6305           >
        6306                             
        6307            <br/>
        6308                           
        6309           </xsl:if>
        6310                          
        6311           <xsl:for-e ach 
        6312            select="$b loodPressu re"
        6313           >
        6314                             
        6315            <xsl:if 
        6316             test="posi tion()>1"
        6317            >
        6318                                
        6319             <br/>
        6320                              
        6321            </xsl:if>
        6322                             
        6323            <xsl:value -of 
        6324             select="n1 :value/@va lue"
        6325            />
        6326                           
        6327           </xsl:for- each>
        6328                        
        6329          </xsl:when >
        6330                       
        6331          <xsl:other wise>
        6332                          
        6333           <xsl:call- template 
        6334            name="na"
        6335           />
        6336                        
        6337          </xsl:othe rwise>
        6338                    
        6339         </xsl:choo se>
        6340                 
        6341        </div>
        6342              
        6343       </td>
        6344             
        6345       <!-- heigh t -->
        6346             
        6347       <td>
        6348                
        6349        <div 
        6350         style="ove rflow:hidd en; white- space:nowr ap; width: 70px;"
        6351        >
        6352                   
        6353         <xsl:choos e>
        6354                       
        6355          <xsl:when 
        6356           test="$hei ght"
        6357          >
        6358                          
        6359           <xsl:for-e ach 
        6360            select="$h eight"
        6361           >
        6362                             
        6363            <xsl:if 
        6364             test="posi tion()>1"
        6365            >
        6366                                
        6367             <br/>
        6368                              
        6369            </xsl:if>
        6370                             
        6371            <xsl:choos e>
        6372                                
        6373             <xsl:when 
        6374              test="stri ng-length( n1:value/@ value)>1"
        6375             >
        6376                                   
        6377              <xsl:varia ble 
        6378               name="heig htResult" 
        6379               select="n1 :value/@va lue"
        6380              />
        6381                                   
        6382              <xsl:choos e>
        6383                                       
        6384               <xsl:when 
        6385                test="n1:v alue/@unit "
        6386               >
        6387                                          
        6388                <xsl:call- template 
        6389                 name="flyo verSpan"
        6390                >
        6391                                             
        6392                 <xsl:with- param 
        6393                  name="data
        6394                  select="co ncat($heig htResult,n 1:value/@u nit)"
        6395                 />
        6396                                           
        6397                </xsl:call -template>
        6398                                        
        6399               </xsl:when >
        6400                                       
        6401               <xsl:other wise>
        6402                                          
        6403                <xsl:call- template 
        6404                 name="flyo verSpan"
        6405                >
        6406                                             
        6407                 <xsl:with- param 
        6408                  name="data
        6409                  select="$h eightResul t"
        6410                 />
        6411                                           
        6412                </xsl:call -template>
        6413                                        
        6414               </xsl:othe rwise>
        6415                                    
        6416              </xsl:choo se>
        6417                                 
        6418             </xsl:when >
        6419                              
        6420            </xsl:choo se>
        6421                           
        6422           </xsl:for- each>
        6423                        
        6424          </xsl:when >
        6425                       
        6426          <xsl:other wise>
        6427                          
        6428           <xsl:call- template 
        6429            name="na"
        6430           />
        6431                        
        6432          </xsl:othe rwise>
        6433                    
        6434         </xsl:choo se>
        6435                 
        6436        </div>
        6437              
        6438       </td>
        6439             
        6440       <!-- heigh t lying-->
        6441             
        6442       <td>
        6443                
        6444        <div 
        6445         style="ove rflow:hidd en; white- space:nowr ap; width: 70px;"
        6446        >
        6447                   
        6448         <xsl:choos e>
        6449                       
        6450          <xsl:when 
        6451           test="$bod yHtLying"
        6452          >
        6453                          
        6454           <xsl:for-e ach 
        6455            select="$b odyHtLying "
        6456           >
        6457                             
        6458            <xsl:if 
        6459             test="posi tion()>1"
        6460            >
        6461                                
        6462             <br/>
        6463                              
        6464            </xsl:if>
        6465                             
        6466            <xsl:choos e>
        6467                                
        6468             <xsl:when 
        6469              test="stri ng-length( n1:value/@ value)>1"
        6470             >
        6471                                   
        6472              <xsl:varia ble 
        6473               name="heig htLyResult
        6474               select="n1 :value/@va lue"
        6475              />
        6476                                   
        6477              <xsl:choos e>
        6478                                       
        6479               <xsl:when 
        6480                test="n1:v alue/@unit "
        6481               >
        6482                                          
        6483                <xsl:call- template 
        6484                 name="flyo verSpan"
        6485                >
        6486                                             
        6487                 <xsl:with- param 
        6488                  name="data
        6489                  select="co ncat($heig htLyResult ,n1:value/ @unit)"
        6490                 />
        6491                                           
        6492                </xsl:call -template>
        6493                                        
        6494               </xsl:when >
        6495                                       
        6496               <xsl:other wise>
        6497                                          
        6498                <xsl:call- template 
        6499                 name="flyo verSpan"
        6500                >
        6501                                             
        6502                 <xsl:with- param 
        6503                  name="data
        6504                  select="$h eightLyRes ult"
        6505                 />
        6506                                           
        6507                </xsl:call -template>
        6508                                        
        6509               </xsl:othe rwise>
        6510                                    
        6511              </xsl:choo se>
        6512                                 
        6513             </xsl:when >
        6514                              
        6515            </xsl:choo se>
        6516                           
        6517           </xsl:for- each>
        6518                        
        6519          </xsl:when >
        6520                       
        6521          <xsl:other wise>
        6522                          
        6523           <xsl:call- template 
        6524            name="na"
        6525           />
        6526                        
        6527          </xsl:othe rwise>
        6528                    
        6529         </xsl:choo se>
        6530        
        6531                 
        6532        </div>
        6533              
        6534       </td>
        6535             
        6536       <!-- weigh t -->
        6537             
        6538       <td>
        6539                
        6540        <div 
        6541         style="ove rflow:hidd en; white- space:nowr ap; width: 70px;"
        6542        >
        6543                   
        6544         <xsl:choos e>
        6545                       
        6546          <xsl:when 
        6547           test="stri ng-length( $weight2)> 1"
        6548          >
        6549                          
        6550           <xsl:call- template 
        6551            name="getW eightResul t"
        6552           >
        6553                             
        6554            <xsl:with- param 
        6555             name="wt" 
        6556             select="$w eight2"
        6557            />
        6558                           
        6559           </xsl:call -template>
        6560                        
        6561          </xsl:when >
        6562                       
        6563          <xsl:when 
        6564           test="$wei ght"
        6565          >
        6566                          
        6567           <xsl:call- template 
        6568            name="getW eightResul t"
        6569           >
        6570                             
        6571            <xsl:with- param 
        6572             name="wt" 
        6573             select="$w eight"
        6574            />
        6575                           
        6576           </xsl:call -template>
        6577                        
        6578          </xsl:when >
        6579                       
        6580          <xsl:other wise>
        6581                          
        6582           <xsl:call- template 
        6583            name="na"
        6584           />
        6585                        
        6586          </xsl:othe rwise>
        6587                    
        6588         </xsl:choo se>
        6589                 
        6590        </div>
        6591              
        6592       </td>
        6593             
        6594       <!-- pox - ->
        6595             
        6596       <td>
        6597                
        6598        <div 
        6599         style="ove rflow:hidd en; white- space:nowr ap; width: 70px;"
        6600        >
        6601                   
        6602         <xsl:choos e>
        6603                       
        6604          <xsl:when 
        6605           test="$pox "
        6606          >
        6607                          
        6608           <xsl:for-e ach 
        6609            select="$p ox"
        6610           >
        6611                             
        6612            <xsl:if 
        6613             test="posi tion()>1"
        6614            >
        6615                                
        6616             <br/>
        6617                              
        6618            </xsl:if>
        6619                             
        6620            <xsl:choos e>
        6621                                
        6622             <xsl:when 
        6623              test="stri ng-length( n1:value/@ value)>1"
        6624             >
        6625                                   
        6626              <xsl:varia ble 
        6627               name="poxR esult" 
        6628               select="n1 :value/@va lue"
        6629              />
        6630                                   
        6631              <xsl:choos e>
        6632                                       
        6633               <xsl:when 
        6634                test="n1:v alue/@unit "
        6635               >
        6636                                          
        6637                <xsl:call- template 
        6638                 name="flyo verSpan"
        6639                >
        6640                                             
        6641                 <xsl:with- param 
        6642                  name="data
        6643                  select="co ncat($poxR esult,n1:v alue/@unit )"
        6644                 />
        6645                                           
        6646                </xsl:call -template>
        6647                                        
        6648               </xsl:when >
        6649                                       
        6650               <xsl:other wise>
        6651                                          
        6652                <xsl:call- template 
        6653                 name="flyo verSpan"
        6654                >
        6655                                             
        6656                 <xsl:with- param 
        6657                  name="data
        6658                  select="$p oxResult"
        6659                 />
        6660                                           
        6661                </xsl:call -template>
        6662                                        
        6663               </xsl:othe rwise>
        6664                                    
        6665              </xsl:choo se>
        6666                                 
        6667             </xsl:when >
        6668                              
        6669            </xsl:choo se>
        6670                           
        6671           </xsl:for- each>
        6672                        
        6673          </xsl:when >
        6674                       
        6675          <xsl:other wise>
        6676                          
        6677           <xsl:call- template 
        6678            name="na"
        6679           />
        6680                        
        6681          </xsl:othe rwise>
        6682                    
        6683         </xsl:choo se>
        6684                 
        6685        </div>
        6686              
        6687       </td>
        6688             
        6689       <!-- OCF - ->
        6690             
        6691       <td>
        6692                
        6693        <div 
        6694         style="ove rflow:hidd en; white- space:nowr ap; width: 70px;"
        6695        >
        6696                   
        6697         <xsl:choos e>
        6698                       
        6699          <xsl:when 
        6700           test="$hea dCircumOCF "
        6701          >
        6702                          
        6703           <xsl:for-e ach 
        6704            select="$h eadCircumO CF"
        6705           >
        6706                             
        6707            <xsl:if 
        6708             test="posi tion()>1"
        6709            >
        6710                                
        6711             <br/>
        6712                              
        6713            </xsl:if>
        6714                             
        6715            <xsl:choos e>
        6716                                
        6717             <xsl:when 
        6718              test="stri ng-length( n1:value/@ value)>1"
        6719             >
        6720                                   
        6721              <xsl:varia ble 
        6722               name="OCFR esult" 
        6723               select="n1 :value/@va lue"
        6724              />
        6725                                   
        6726              <xsl:choos e>
        6727                                       
        6728               <xsl:when 
        6729                test="n1:v alue/@unit "
        6730               >
        6731                                          
        6732                <xsl:call- template 
        6733                 name="flyo verSpan"
        6734                >
        6735                                             
        6736                 <xsl:with- param 
        6737                  name="data
        6738                  select="co ncat($OCFR esult,n1:v alue/@unit )"
        6739                 />
        6740                                           
        6741                </xsl:call -template>
        6742                                        
        6743               </xsl:when >
        6744                                       
        6745               <xsl:other wise>
        6746                                          
        6747                <xsl:call- template 
        6748                 name="flyo verSpan"
        6749                >
        6750                                             
        6751                 <xsl:with- param 
        6752                  name="data
        6753                  select="$O CFResult"
        6754                 />
        6755                                           
        6756                </xsl:call -template>
        6757                                        
        6758               </xsl:othe rwise>
        6759                                    
        6760              </xsl:choo se>
        6761                                 
        6762             </xsl:when >
        6763                              
        6764            </xsl:choo se>
        6765                           
        6766           </xsl:for- each>
        6767                        
        6768          </xsl:when >
        6769                       
        6770          <xsl:other wise>
        6771                          
        6772           <xsl:call- template 
        6773            name="na"
        6774           />
        6775                        
        6776          </xsl:othe rwise>
        6777                    
        6778         </xsl:choo se>
        6779                 
        6780        </div>
        6781              
        6782       </td>
        6783             
        6784       <!-- sourc e -->
        6785             
        6786       <td>
        6787                
        6788        <div 
        6789         style="ove rflow:hidd en; white- space:nowr ap; width: 150px;"
        6790        >
        6791                   
        6792         <xsl:choos e>
        6793                       
        6794          <xsl:when 
        6795           test="stri ng-length( $row/n1:or ganizer/n1 :author/n1 :assignedA uthor/n1:r epresented Organizati on/n1:name )>1"
        6796          >
        6797                          
        6798           <xsl:call- template 
        6799            name="flyo verSpan"
        6800           >
        6801                             
        6802            <xsl:with- param 
        6803             name="data
        6804             select="$r ow/n1:orga nizer/n1:a uthor/n1:a ssignedAut hor/n1:rep resentedOr ganization /n1:name"
        6805            />
        6806                           
        6807           </xsl:call -template>
        6808                        
        6809          </xsl:when >
        6810                       
        6811          <xsl:other wise>
        6812                          
        6813           <xsl:call- template 
        6814            name="na"
        6815           />
        6816                        
        6817          </xsl:othe rwise>
        6818                    
        6819         </xsl:choo se>
        6820                 
        6821        </div>
        6822              
        6823       </td>
        6824           
        6825      </tr>
        6826        
        6827     </xsl:temp late>
        6828    
        6829             
        6830     <!--   fly over -->
        6831             
        6832     <xsl:templ ate 
        6833      name="flyo verSpan"
        6834     >
        6835                       
        6836      <xsl:param  
        6837       name="data "
        6838      />
        6839                       
        6840      <xsl:param  
        6841       name="free Text"
        6842      />
        6843                       
        6844      <xsl:param  
        6845       name="deSq uigglefy"
        6846      />
        6847                       
        6848      <xsl:eleme nt 
        6849       name="span "
        6850      >
        6851                                 
        6852       <xsl:attri bute 
        6853        name="onmo useover"
        6854       >
        6855                                           
        6856        <xsl:choos e>
        6857                                                    
        6858         <xsl:when 
        6859          test="$fre eText"
        6860         >
        6861                                                              
        6862          <xsl:text>
        6863           DisplayTip (this,25,- 50,1)
        6864          </xsl:text >
        6865                                                     
        6866         </xsl:when >
        6867                                                    
        6868         <xsl:other wise>
        6869                                                              
        6870          <xsl:text>
        6871           DisplayTip (this,25,- 50,0)
        6872          </xsl:text >
        6873                                                     
        6874         </xsl:othe rwise>
        6875                                            
        6876        </xsl:choo se>
        6877                                  
        6878       </xsl:attr ibute>
        6879                                 
        6880       <xsl:choos e>
        6881                                           
        6882        <xsl:when 
        6883         test="$dat a"
        6884        >
        6885                                                    
        6886         <xsl:choos e>
        6887                                                              
        6888          <xsl:when 
        6889           test="$deS quigglefy"
        6890          >
        6891                                                                        
        6892           <xsl:call- template 
        6893            name="repl aceSquiggl esWithBrea ks"
        6894           >
        6895                                                                                  
        6896            <xsl:with- param 
        6897             name="text
        6898             select="$d ata"
        6899            />
        6900                                                                         
        6901           </xsl:call -template>
        6902                                                               
        6903          </xsl:when >
        6904                                                              
        6905          <xsl:other wise>
        6906                                                                        
        6907           <xsl:value -of 
        6908            select="$d ata"
        6909           />
        6910                                                               
        6911          </xsl:othe rwise>
        6912                                                     
        6913         </xsl:choo se>
        6914                                            
        6915        </xsl:when >
        6916                                           
        6917        <xsl:other wise>
        6918                                                    
        6919         <xsl:call- template 
        6920          name="na"
        6921         />
        6922                                            
        6923        </xsl:othe rwise>
        6924                                  
        6925       </xsl:choo se>
        6926                        
        6927      </xsl:elem ent>
        6928              
        6929     </xsl:temp late>
        6930    
        6931             
        6932     <xsl:templ ate 
        6933      name="repl aceSquiggl esWithBrea ks"
        6934     >
        6935                       
        6936      <xsl:param  
        6937       name="text "
        6938      />
        6939                       
        6940      <xsl:if 
        6941       test="$tex t"
        6942      >
        6943                                 
        6944       <xsl:choos e>
        6945                                           
        6946        <xsl:when 
        6947         test="cont ains($text ,'~')"
        6948        >
        6949                                                    
        6950         <xsl:value -of 
        6951          select="su bstring-be fore($text ,'~')"
        6952         />
        6953                                                    
        6954         <br/>
        6955                                                    
        6956         <xsl:call- template 
        6957          name="repl aceSquiggl esWithBrea ks"
        6958         >
        6959                                                              
        6960          <xsl:with- param 
        6961           name="text
        6962           select="su bstring-af ter($text, '~')"
        6963          />
        6964                                                     
        6965         </xsl:call -template>
        6966                                            
        6967        </xsl:when >
        6968                                           
        6969        <xsl:other wise>
        6970                                                    
        6971         <xsl:value -of 
        6972          select="$t ext"
        6973         />
        6974                                            
        6975        </xsl:othe rwise>
        6976                                  
        6977       </xsl:choo se>
        6978                        
        6979      </xsl:if>
        6980              
        6981     </xsl:temp late>
        6982    
        6983             
        6984     <!--   Tit le  -->
        6985             
        6986     <xsl:templ ate 
        6987      match="n1: title"
        6988     >
        6989                       
        6990      <xsl:varia ble 
        6991       name="comp Found"
        6992      >
        6993                                 
        6994       <xsl:call- template 
        6995        name="comp onentFound "
        6996       >
        6997                                           
        6998        <xsl:with- param 
        6999         name="comp Section" 
        7000         select=".. /."
        7001        />
        7002                                  
        7003       </xsl:call -template>
        7004                        
        7005      </xsl:vari able>
        7006                       
        7007      <xsl:choos e>
        7008                                 
        7009       <xsl:when 
        7010        test="stri ng-length( $compFound )>0"
        7011       >
        7012                                           
        7013        <h3>
        7014                                                    
        7015         <span 
        7016          style="fon t-weight:b old;line-h eight:40%"
        7017         >
        7018                                                              
        7019          <a 
        7020           name="{gen erate-id(. )}" 
        7021           href="#toc "
        7022          >
        7023                                                                        
        7024           <xsl:value -of 
        7025            select="."
        7026           />
        7027                                                               
        7028          </a>
        7029                                                     
        7030         </span>
        7031                                            
        7032        </h3>
        7033                                  
        7034       </xsl:when >
        7035                        
        7036      </xsl:choo se>
        7037              
        7038     </xsl:temp late>
        7039    
        7040             
        7041     <!--   Tex t   -->
        7042             
        7043     <xsl:templ ate 
        7044      match="n1: text"
        7045     >
        7046                       
        7047      <xsl:apply -templates  />
        7048              
        7049     </xsl:temp late>
        7050    
        7051             
        7052     <!--   par agraph  -- >
        7053             
        7054     <xsl:templ ate 
        7055      match="n1: paragraph"
        7056     >
        7057                       
        7058      <p>
        7059                                 
        7060       <xsl:apply -templates />
        7061                        
        7062      </p>
        7063              
        7064     </xsl:temp late>
        7065    
        7066             
        7067     <!--     C ontent w/  deleted te xt is hidd en -->
        7068             
        7069     <xsl:templ ate 
        7070      match="n1: content[@r evised='de lete']"
        7071     />
        7072    
        7073             
        7074     <!--   con tent  -->
        7075             
        7076     <xsl:templ ate 
        7077      match="n1: content"
        7078     >
        7079                       
        7080      <xsl:apply -templates />
        7081              
        7082     </xsl:temp late>
        7083    
        7084    
        7085             
        7086     <!--   lis t  -->
        7087             
        7088     <xsl:templ ate 
        7089      match="n1: list"
        7090     >
        7091                       
        7092      <xsl:if 
        7093       test="n1:c aption"
        7094      >
        7095                                 
        7096       <span 
        7097        style="fon t-weight:b old; "
        7098       >
        7099                                           
        7100        <xsl:apply -templates  
        7101         select="n1 :caption"
        7102        />
        7103                                  
        7104       </span>
        7105                        
        7106      </xsl:if>
        7107                       
        7108      <ul>
        7109                                 
        7110       <xsl:for-e ach 
        7111        select="n1 :item"
        7112       >
        7113                                           
        7114        <li>
        7115                                                    
        7116         <xsl:apply -templates  />
        7117                                            
        7118        </li>
        7119                                  
        7120       </xsl:for- each>
        7121                        
        7122      </ul>
        7123              
        7124     </xsl:temp late>
        7125    
        7126             
        7127     <xsl:templ ate 
        7128      match="n1: list[@list Type='orde red']"
        7129     >
        7130                       
        7131      <xsl:if 
        7132       test="n1:c aption"
        7133      >
        7134                                 
        7135       <span 
        7136        style="fon t-weight:b old; "
        7137       >
        7138                                           
        7139        <xsl:apply -templates  
        7140         select="n1 :caption"
        7141        />
        7142                                  
        7143       </span>
        7144                        
        7145      </xsl:if>
        7146                       
        7147      <ol>
        7148                                 
        7149       <xsl:for-e ach 
        7150        select="n1 :item"
        7151       >
        7152                                           
        7153        <li>
        7154                                                    
        7155         <xsl:apply -templates  />
        7156                                            
        7157        </li>
        7158                                  
        7159       </xsl:for- each>
        7160                        
        7161      </ol>
        7162              
        7163     </xsl:temp late>
        7164    
        7165    
        7166             
        7167     <!--   cap tion  -->
        7168             
        7169     <xsl:templ ate 
        7170      match="n1: caption"
        7171     >
        7172                       
        7173      <xsl:apply -templates />
        7174                       
        7175      <xsl:text>
        7176      
        7177      </xsl:text >
        7178              
        7179     </xsl:temp late>
        7180    
        7181             
        7182     <!--       Tables   - ->
        7183             
        7184     <xsl:templ ate 
        7185      match="n1: table/@*|n 1:thead/@* |n1:tfoot/ @*|n1:tbod y/@*|n1:co lgroup/@*| n1:col/@*| n1:tr/@*|n 1:th/@*|n1 :td/@*"
        7186     >
        7187                       
        7188      <xsl:copy>
        7189      
        7190                                 
        7191       <xsl:copy- of 
        7192        select="@* "
        7193       />
        7194                                 
        7195       <xsl:apply -templates />
        7196                        
        7197      </xsl:copy >
        7198              
        7199     </xsl:temp late>
        7200    
        7201             
        7202     <xsl:templ ate 
        7203      match="n1: table"
        7204     >
        7205                       
        7206      <table>
        7207      
        7208                                 
        7209       <xsl:copy- of 
        7210        select="@* "
        7211       />
        7212                                 
        7213       <xsl:apply -templates />
        7214                        
        7215      </table>
        7216              
        7217     </xsl:temp late>
        7218    
        7219             
        7220     <xsl:templ ate 
        7221      match="n1: thead"
        7222     >
        7223                       
        7224      <thead>
        7225      
        7226                                 
        7227       <xsl:copy- of 
        7228        select="@* "
        7229       />
        7230                                 
        7231       <xsl:apply -templates />
        7232                        
        7233      </thead>
        7234              
        7235     </xsl:temp late>
        7236    
        7237             
        7238     <xsl:templ ate 
        7239      match="n1: tfoot"
        7240     >
        7241                       
        7242      <tfoot>
        7243      
        7244                                 
        7245       <xsl:copy- of 
        7246        select="@* "
        7247       />
        7248                                 
        7249       <xsl:apply -templates />
        7250                        
        7251      </tfoot>
        7252              
        7253     </xsl:temp late>
        7254    
        7255             
        7256     <xsl:templ ate 
        7257      match="n1: tbody"
        7258     >
        7259                       
        7260      <tbody>
        7261      
        7262                                 
        7263       <xsl:copy- of 
        7264        select="@* "
        7265       />
        7266                                 
        7267       <xsl:apply -templates />
        7268                        
        7269      </tbody>
        7270              
        7271     </xsl:temp late>
        7272    
        7273             
        7274     <xsl:templ ate 
        7275      match="n1: colgroup"
        7276     >
        7277                       
        7278      <colgroup>
        7279      
        7280                                 
        7281       <xsl:copy- of 
        7282        select="@* "
        7283       />
        7284                                 
        7285       <xsl:apply -templates />
        7286                        
        7287      </colgroup >
        7288              
        7289     </xsl:temp late>
        7290    
        7291             
        7292     <xsl:templ ate 
        7293      match="n1: col"
        7294     >
        7295                       
        7296      <col>
        7297      
        7298                                 
        7299       <xsl:copy- of 
        7300        select="@* "
        7301       />
        7302                                 
        7303       <xsl:apply -templates />
        7304                        
        7305      </col>
        7306              
        7307     </xsl:temp late>
        7308    
        7309             
        7310     <xsl:templ ate 
        7311      match="n1: tr"
        7312     >
        7313                       
        7314      <tr>
        7315      
        7316                                 
        7317       <xsl:copy- of 
        7318        select="@* "
        7319       />
        7320                                 
        7321       <xsl:apply -templates />
        7322                        
        7323      </tr>
        7324              
        7325     </xsl:temp late>
        7326    
        7327             
        7328     <xsl:templ ate 
        7329      match="n1: th"
        7330     >
        7331                       
        7332      <th>
        7333                                 
        7334       <xsl:copy- of 
        7335        select="@* "
        7336       />
        7337                                 
        7338       <xsl:apply -templates />
        7339                        
        7340      </th>
        7341              
        7342     </xsl:temp late>
        7343    
        7344             
        7345     <xsl:templ ate 
        7346      match="n1: td"
        7347     >
        7348                       
        7349      <td>
        7350                                 
        7351       <xsl:copy- of 
        7352        select="@* "
        7353       />
        7354                                 
        7355       <xsl:apply -templates />
        7356                        
        7357      </td>
        7358              
        7359     </xsl:temp late>
        7360    
        7361             
        7362     <xsl:templ ate 
        7363      match="n1: table/n1:c aption"
        7364     >
        7365                       
        7366      <span 
        7367       style="fon t-weight:b old; "
        7368      >
        7369                                 
        7370       <xsl:apply -templates />
        7371                        
        7372      </span>
        7373              
        7374     </xsl:temp late>
        7375    
        7376             
        7377     <!--   Ren derMultiMe dia 
        7378    
        7379              t his curren tly only h andles GIF 's and JPE G's.  It c ould, howe ver,
        7380              b e extended  by includ ing other  image MIME  types in  the predic ate
        7381              a nd/or by g enerating  <object> o r <applet>  tag with  the correc t
        7382              p arams depe nding on t he media t ype  @ID   =$imageRef      refer encedObjec t
        7383      -->
        7384             
        7385     <xsl:templ ate 
        7386      match="n1: renderMult iMedia"
        7387     >
        7388                       
        7389      <xsl:varia ble 
        7390       name="imag eRef" 
        7391       select="@r eferencedO bject"
        7392      />
        7393                       
        7394      <xsl:choos e>
        7395                                 
        7396       <xsl:when 
        7397        test="//n1 :regionOfI nterest[@I D=$imageRe f]"
        7398       >
        7399                                           
        7400        <!-- Here  is where t he Region  of Interes t image re ferencing  goes -->
        7401                                           
        7402        <xsl:if 
        7403         test='//n1 :regionOfI nterest[@I D=$imageRe f]//n1:obs ervationMe dia/n1:val ue[@mediaT ype="image /gif" or @ mediaType= "image/jpe g"]'
        7404        >
        7405                                                    
        7406         <br 
        7407          clear='all '
        7408         />
        7409                                                    
        7410         <xsl:eleme nt 
        7411          name='img'
        7412         >
        7413                                                              
        7414          <xsl:attri bute 
        7415           name='src'
        7416          >
        7417                                                                        
        7418           <xsl:value -of 
        7419            select='// n1:regionO fInterest[ @ID=$image Ref]//n1:o bservation Media/n1:v alue/n1:re ference/@v alue'
        7420           />
        7421                                                               
        7422          </xsl:attr ibute>
        7423                                                     
        7424         </xsl:elem ent>
        7425                                            
        7426        </xsl:if>
        7427                                  
        7428       </xsl:when >
        7429                                 
        7430       <xsl:other wise>
        7431                                           
        7432        <!-- Here  is where t he direct  MultiMedia  image ref erencing g oes -->
        7433                                           
        7434        <xsl:if 
        7435         test='//n1 :observati onMedia[@I D=$imageRe f]/n1:valu e[@mediaTy pe="image/ gif" or @m ediaType=" image/jpeg "]'
        7436        >
        7437                                                    
        7438         <br 
        7439          clear='all '
        7440         />
        7441                                                    
        7442         <xsl:eleme nt 
        7443          name='img'
        7444         >
        7445                                                              
        7446          <xsl:attri bute 
        7447           name='src'
        7448          >
        7449                                                                        
        7450           <xsl:value -of 
        7451            select='// n1:observa tionMedia[ @ID=$image Ref]/n1:va lue/n1:ref erence/@va lue'
        7452           />
        7453                                                               
        7454          </xsl:attr ibute>
        7455                                                     
        7456         </xsl:elem ent>
        7457                                            
        7458        </xsl:if>
        7459                                  
        7460       </xsl:othe rwise>
        7461                        
        7462      </xsl:choo se>
        7463              
        7464     </xsl:temp late>
        7465    
        7466             
        7467     <!--    St ylecode pr ocessing    
        7468                Supports B old, Under line and I talics dis play
        7469    
        7470     -->
        7471    
        7472             
        7473     <xsl:templ ate 
        7474      match="//n 1:*[@style Code]"
        7475     >
        7476     
        7477                       
        7478      <xsl:if 
        7479       test="@sty leCode='Bo ld'"
        7480      >
        7481                                 
        7482       <xsl:eleme nt 
        7483        name='b'
        7484       >
        7485                                           
        7486        <xsl:apply -templates />
        7487                                  
        7488       </xsl:elem ent>
        7489                        
        7490      </xsl:if>
        7491     
        7492                       
        7493      <xsl:if 
        7494       test="@sty leCode='It alics'"
        7495      >
        7496                                 
        7497       <xsl:eleme nt 
        7498        name='i'
        7499       >
        7500                                           
        7501        <xsl:apply -templates />
        7502                                  
        7503       </xsl:elem ent>
        7504                        
        7505      </xsl:if>
        7506     
        7507                       
        7508      <xsl:if 
        7509       test="@sty leCode='Un derline'"
        7510      >
        7511                                 
        7512       <xsl:eleme nt 
        7513        name='u'
        7514       >
        7515                                           
        7516        <xsl:apply -templates />
        7517                                  
        7518       </xsl:elem ent>
        7519                        
        7520      </xsl:if>
        7521     
        7522                       
        7523      <xsl:if 
        7524       test="cont ains(@styl eCode,'Bol d') and co ntains(@st yleCode,'I talics') a nd not (co ntains(@st yleCode, ' Underline' ))"
        7525      >
        7526                                 
        7527       <xsl:eleme nt 
        7528        name='b'
        7529       >
        7530                                           
        7531        <xsl:eleme nt 
        7532         name='i'
        7533        >
        7534                                                    
        7535         <xsl:apply -templates />
        7536                                            
        7537        </xsl:elem ent>
        7538                                  
        7539       </xsl:elem ent>
        7540                        
        7541      </xsl:if>
        7542     
        7543                       
        7544      <xsl:if 
        7545       test="cont ains(@styl eCode,'Bol d') and co ntains(@st yleCode,'U nderline')  and not ( contains(@ styleCode,  'Italics' ))"
        7546      >
        7547                                 
        7548       <xsl:eleme nt 
        7549        name='b'
        7550       >
        7551                                           
        7552        <xsl:eleme nt 
        7553         name='u'
        7554        >
        7555                                                    
        7556         <xsl:apply -templates />
        7557                                            
        7558        </xsl:elem ent>
        7559                                  
        7560       </xsl:elem ent>
        7561                        
        7562      </xsl:if>
        7563     
        7564                       
        7565      <xsl:if 
        7566       test="cont ains(@styl eCode,'Ita lics') and  contains( @styleCode ,'Underlin e') and no t (contain s(@styleCo de, 'Bold' ))"
        7567      >
        7568                                 
        7569       <xsl:eleme nt 
        7570        name='i'
        7571       >
        7572                                           
        7573        <xsl:eleme nt 
        7574         name='u'
        7575        >
        7576                                                    
        7577         <xsl:apply -templates />
        7578                                            
        7579        </xsl:elem ent>
        7580                                  
        7581       </xsl:elem ent>
        7582                        
        7583      </xsl:if>
        7584     
        7585                       
        7586      <xsl:if 
        7587       test="cont ains(@styl eCode,'Ita lics') and  contains( @styleCode ,'Underlin e') and co ntains(@st yleCode, ' Bold')"
        7588      >
        7589                                 
        7590       <xsl:eleme nt 
        7591        name='b'
        7592       >
        7593                                           
        7594        <xsl:eleme nt 
        7595         name='i'
        7596        >
        7597                                                    
        7598         <xsl:eleme nt 
        7599          name='u'
        7600         >
        7601                                                              
        7602          <xsl:apply -templates />
        7603                                                     
        7604         </xsl:elem ent>
        7605                                            
        7606        </xsl:elem ent>
        7607                                  
        7608       </xsl:elem ent>
        7609                        
        7610      </xsl:if>
        7611     
        7612              
        7613     </xsl:temp late>
        7614    
        7615             
        7616     <!--    Su perscript  or Subscri pt   -->
        7617             
        7618     <xsl:templ ate 
        7619      match="n1: sup"
        7620     >
        7621                       
        7622      <xsl:eleme nt 
        7623       name='sup'
        7624      >
        7625                                 
        7626       <xsl:apply -templates />
        7627                        
        7628      </xsl:elem ent>
        7629              
        7630     </xsl:temp late>
        7631             
        7632     <xsl:templ ate 
        7633      match="n1: sub"
        7634     >
        7635                       
        7636      <xsl:eleme nt 
        7637       name='sub'
        7638      >
        7639                                 
        7640       <xsl:apply -templates />
        7641                        
        7642      </xsl:elem ent>
        7643              
        7644     </xsl:temp late>
        7645    
        7646             
        7647     <!--  Bott omline  -- >
        7648    
        7649             
        7650     <xsl:templ ate 
        7651      name="disp layBottomL ine"
        7652     >
        7653                       
        7654      <p>
        7655                                 
        7656       <xsl:varia ble 
        7657        name="foun d"
        7658       />
        7659                                 
        7660       <xsl:call- template 
        7661        name="getN ame"
        7662       >
        7663                                           
        7664        <xsl:with- param 
        7665         name="name
        7666         select="n1 :legalAuth enticator/ n1:assigne dEntity/n1 :represent edOrganiza tion/n1:na me"
        7667        />
        7668                                  
        7669       </xsl:call -template>
        7670                                 
        7671       <xsl:choos e>
        7672                                           
        7673        <xsl:when 
        7674         test="$fou nd"
        7675        >
        7676                                                    
        7677         <b>
        7678                                                              
        7679          <xsl:text>
        7680           Electronic ally gener ated by: 
        7681          </xsl:text >
        7682                                                              
        7683          <xsl:value -of 
        7684           select="$f ound"
        7685          />
        7686                                                     
        7687         </b>
        7688                                            
        7689        </xsl:when >
        7690                                           
        7691        <xsl:other wise>
        7692                                                    
        7693         <b>
        7694                                                              
        7695          <xsl:text 
        7696           disable-ou tput-escap ing="yes"
        7697          >
        7698           Electronic ally gener ated on:&a mp;nbsp; 
        7699          </xsl:text >
        7700                                                              
        7701          <xsl:value -of 
        7702           select="$f ound"
        7703          />
        7704                                                     
        7705         </b>
        7706                                            
        7707        </xsl:othe rwise>
        7708                                  
        7709       </xsl:choo se>
        7710                                 
        7711       <xsl:choos e>
        7712                                           
        7713        <xsl:when 
        7714         test="stri ng-length( n1:effecti veTime/@va lue)=0"
        7715        >
        7716                                                    
        7717         <xsl:call- template 
        7718          name="na"
        7719         />
        7720                                            
        7721        </xsl:when >
        7722                                           
        7723        <xsl:when 
        7724         test="star ts-with(n1 :effective Time/@valu e,' ')"
        7725        >
        7726                                                    
        7727         <xsl:call- template 
        7728          name="na"
        7729         />
        7730                                            
        7731        </xsl:when >
        7732                                           
        7733        <xsl:other wise>
        7734                                                    
        7735         <xsl:varia ble 
        7736          name="date Found"
        7737         />
        7738                                                    
        7739         <xsl:call- template 
        7740          name="form atDateLong "
        7741         >
        7742                                                              
        7743          <xsl:with- param 
        7744           name="date String" 
        7745           select="n1 :effective Time/@valu e"
        7746          />
        7747                                                     
        7748         </xsl:call -template>
        7749                                                    
        7750         <xsl:if 
        7751          test="($da teFound) a nd not ($f ound)"
        7752         >
        7753                                                              
        7754          <xsl:text 
        7755           disable-ou tput-escap ing="yes"
        7756          >
        7757           &amp;nbsp; on&amp;nbs p; 
        7758          </xsl:text >
        7759                                                              
        7760          <xsl:value -of 
        7761           select="$d ateFound"
        7762          />
        7763                                                     
        7764         </xsl:if>
        7765                                                    
        7766         <xsl:if 
        7767          test="($da teFound) a nd ($found )"
        7768         >
        7769                                                              
        7770          <xsl:value -of 
        7771           select="$d ateFound"
        7772          />
        7773                                                     
        7774         </xsl:if>
        7775                                            
        7776        </xsl:othe rwise>
        7777                                  
        7778       </xsl:choo se>
        7779                        
        7780      </p>
        7781                       
        7782      <div 
        7783       id="TipBox
        7784       style="dis play:none; position:a bsolute;fo nt-size:12 px;font-we ight:bold; font-famil y:verdana; border:#72 B0E6 solid  1px;paddi ng:15px;co lor:black; background -color:#FF FFFF;"
        7785      >
        7786                                 
        7787       <xsl:text 
        7788        disable-ou tput-escap ing="yes"
        7789       >
        7790        &amp;nbsp;
        7791       </xsl:text >
        7792                        
        7793      </div>
        7794              
        7795     </xsl:temp late>
        7796    
        7797             
        7798     <xsl:templ ate 
        7799      match="n1: component/ n1:section [n1:templa teId/@root ='2.16.840 .1.113883. 10.20.1.11 ']/n1:text /n1:table/ n1:tbody"
        7800     >
        7801                       
        7802      <xsl:apply -templates >
        7803                                 
        7804       <xsl:sort 
        7805        select="n1 :td[3]" 
        7806        order="des cending"
        7807       />
        7808                        
        7809      </xsl:appl y-template s>
        7810              
        7811     </xsl:temp late>
        7812    
        7813             
        7814     <xsl:templ ate 
        7815      match="n1: component/ n1:section [n1:templa teId/@root ='2.16.840 .1.113883. 10.20.1.8' ]/n1:text/ n1:table/n 1:tbody"
        7816     >
        7817                       
        7818      <xsl:apply -templates >
        7819                                 
        7820       <xsl:sort 
        7821        select="n1 :td[5]" 
        7822        order="des cending"
        7823       />
        7824                        
        7825      </xsl:appl y-template s>
        7826              
        7827     </xsl:temp late>
        7828    
        7829             
        7830     <xsl:templ ate 
        7831      match="n1: component/ n1:section [n1:templa teId/@root ='2.16.840 .1.113883. 10.20.1.16 ' or n1:te mplateId/@ root='2.16 .840.1.113 883.10.20. 1.14' or n 1:template Id/@root=' 2.16.840.1 .113883.10 .20.1.6' o r n1:templ ateId/@roo t='2.16.84 0.1.113883 .10.20.1.3 ']/n1:text /n1:table/ n1:tbody"
        7832     >
        7833                       
        7834      <xsl:apply -templates >
        7835                                 
        7836       <xsl:sort 
        7837        select="n1 :td[2]" 
        7838        order="des cending"
        7839       />
        7840                        
        7841      </xsl:appl y-template s>
        7842              
        7843     </xsl:temp late>
        7844    
        7845             
        7846     <xsl:templ ate 
        7847      match="n1: component/ n1:section [n1:templa teId/@root ='2.16.840 .1.113883. 10.20.1.11 ']/n1:text /n1:table/ n1:tbody/n 1:tr/n1:td [3]"
        7848     >
        7849                       
        7850      <td>
        7851                                 
        7852       <xsl:call- template 
        7853        name="form atDateShor t"
        7854       >
        7855                                           
        7856        <xsl:with- param 
        7857         name="date String"
        7858                                            
        7859         select="te xt()"
        7860        />
        7861                                  
        7862       </xsl:call -template>
        7863                        
        7864      </td>
        7865              
        7866     </xsl:temp late>
        7867    
        7868             
        7869     <xsl:templ ate 
        7870      match="n1: component/ n1:section [n1:templa teId/@root ='2.16.840 .1.113883. 10.20.1.8' ]/n1:text/ n1:table/n 1:tbody/n1 :tr/n1:td[ 5]"
        7871     >
        7872                       
        7873      <td>
        7874                                 
        7875       <xsl:call- template 
        7876        name="form atDateShor t"
        7877       >
        7878                                           
        7879        <xsl:with- param 
        7880         name="date String"
        7881                                                     
        7882         select="te xt()"
        7883        />
        7884                                  
        7885       </xsl:call -template>
        7886                        
        7887      </td>
        7888              
        7889     </xsl:temp late>
        7890    
        7891             
        7892     <xsl:templ ate 
        7893      match="n1: component/ n1:section [n1:templa teId/@root ='2.16.840 .1.113883. 10.20.1.16 ' or n1:te mplateId/@ root='2.16 .840.1.113 883.10.20. 1.14' or n 1:template Id/@root=' 2.16.840.1 .113883.10 .20.1.6' o r n1:templ ateId/@roo t='2.16.84 0.1.113883 .10.20.1.3 ']/n1:text /n1:table/ n1:tbody/n 1:tr/n1:td [2]"
        7894     >
        7895                       
        7896      <td>
        7897                                 
        7898       <xsl:call- template 
        7899        name="form atDateShor t"
        7900       >
        7901                                           
        7902        <xsl:with- param 
        7903         name="date String"
        7904                                                     
        7905         select="co ncat(subst ring(text( ),1,4),sub string(tex t(),6,2),s ubstring(t ext(),9,2) )"
        7906        />
        7907                                  
        7908       </xsl:call -template>
        7909                        
        7910      </td>
        7911              
        7912     </xsl:temp late>
        7913    
        7914             
        7915     <xsl:templ ate 
        7916      name="na"
        7917     >
        7918                       
        7919      <span 
        7920       title="Not  Available "
        7921      >
        7922                                 
        7923       <xsl:text>
        7924        --
        7925       </xsl:text >
        7926                        
        7927      </span>
        7928              
        7929     </xsl:temp late>
        7930    
        7931             
        7932     <!-- free  text proce ssing -->
        7933    
        7934             
        7935     <xsl:templ ate 
        7936      name="free Text"
        7937     >
        7938                       
        7939      <xsl:param  
        7940       name="text "
        7941      />
        7942     
        7943              
        7944     </xsl:temp late>
        7945    
        7946             
        7947     <xsl:templ ate 
        7948      name="disp lay1LineBr eak"
        7949     >
        7950                       
        7951      <br/>
        7952              
        7953     </xsl:temp late>
        7954    
        7955             
        7956     <xsl:templ ate 
        7957      name="disp layVitalsM ultiSepara tor"
        7958     >
        7959                       
        7960      <xsl:call- template 
        7961       name="disp lay1LineBr eak"
        7962      />
        7963              
        7964     </xsl:temp late>
        7965    
        7966             
        7967     <xsl:templ ate 
        7968      name="disp layVitalRo w"
        7969     >
        7970                       
        7971      <xsl:param  
        7972       name="row"
        7973      />
        7974                       
        7975      <tr 
        7976       class="sec ond"
        7977      >
        7978                                 
        7979       <xsl:call- template 
        7980        name="disp layVitalIt ems"
        7981       >
        7982                                           
        7983        <xsl:with- param 
        7984         name="row"  
        7985         select="$r ow"
        7986        />
        7987                                  
        7988       </xsl:call -template>
        7989                        
        7990      </tr>
        7991              
        7992     </xsl:temp late>
        7993    
        7994             
        7995     <xsl:templ ate 
        7996      name="disp layVitalsD ateItem"
        7997     >
        7998                       
        7999      <xsl:param  
        8000       name="rowD ata"
        8001      />
        8002                       
        8003      <td>
        8004                                 
        8005       <div 
        8006        style="ove rflow:hidd en; white- space:nowr ap; width: 80px;"
        8007       >
        8008                                           
        8009        <xsl:call- template 
        8010         name="disp layVitalsD ate"
        8011        >
        8012                                                    
        8013         <xsl:with- param 
        8014          name="rowD ata" 
        8015          select="$r owData"
        8016         />
        8017                                            
        8018        </xsl:call -template>
        8019                                  
        8020       </div>
        8021                        
        8022      </td>
        8023              
        8024     </xsl:temp late>
        8025    
        8026             
        8027     <xsl:templ ate 
        8028      name="disp layVitalsT empItem"
        8029     >
        8030                       
        8031      <xsl:param  
        8032       name="temp "
        8033      />
        8034                       
        8035      <td>
        8036                                 
        8037       <div 
        8038        style="ove rflow:hidd en; white- space:nowr ap; width: 70px;"
        8039       >
        8040                                           
        8041        <xsl:call- template 
        8042         name="disp layVitalsT emp"
        8043        >
        8044                                                    
        8045         <xsl:with- param 
        8046          name="temp
        8047          select="$t emp"
        8048         />
        8049                                            
        8050        </xsl:call -template>
        8051                                  
        8052       </div>
        8053                        
        8054      </td>
        8055              
        8056     </xsl:temp late>
        8057    
        8058             
        8059     <xsl:templ ate 
        8060      name="disp layVitalsS ourceItem"
        8061     >
        8062                       
        8063      <xsl:param  
        8064       name="row"
        8065      />
        8066                       
        8067      <td>
        8068                                 
        8069       <div 
        8070        style="ove rflow:hidd en; white- space:nowr ap; width: 150px;"
        8071       >
        8072                                           
        8073        <xsl:call- template 
        8074         name="disp layVitalsS ource"
        8075        >
        8076                                                    
        8077         <xsl:with- param 
        8078          name="row"  
        8079          select="$r ow"
        8080         />
        8081                                            
        8082        </xsl:call -template>
        8083                                  
        8084       </div>
        8085                        
        8086      </td>
        8087              
        8088     </xsl:temp late>
        8089    
        8090             
        8091     <xsl:templ ate 
        8092      name="disp layVitalsP oxItem"
        8093     >
        8094                       
        8095      <xsl:param  
        8096       name="pox"
        8097      />
        8098                       
        8099      <td>
        8100                                 
        8101       <div 
        8102        style="ove rflow:hidd en; white- space:nowr ap; width: 70px;"
        8103       >
        8104                                           
        8105        <xsl:call- template 
        8106         name="disp layVitalsP ox"
        8107        >
        8108                                                    
        8109         <xsl:with- param 
        8110          name="pox"  
        8111          select="$p ox"
        8112         />
        8113                                            
        8114        </xsl:call -template>
        8115                                  
        8116       </div>
        8117                        
        8118      </td>
        8119              
        8120     </xsl:temp late>
        8121    
        8122             
        8123     <xsl:templ ate 
        8124      name="disp layVitalsW eightItem"
        8125     >
        8126                       
        8127      <xsl:param  
        8128       name="weig ht"
        8129      />
        8130                       
        8131      <td>
        8132                                 
        8133       <div 
        8134        style="ove rflow:hidd en; white- space:nowr ap; width: 70px;"
        8135       >
        8136                                           
        8137        <xsl:call- template 
        8138         name="disp layVitalsW eight"
        8139        >
        8140                                                    
        8141         <xsl:with- param 
        8142          name="weig ht" 
        8143          select="$w eight"
        8144         />
        8145                                            
        8146        </xsl:call -template>
        8147                                  
        8148       </div>
        8149                        
        8150      </td>
        8151              
        8152     </xsl:temp late>
        8153    
        8154             
        8155     <xsl:templ ate 
        8156      name="disp layVitalsH eightItem"
        8157     >
        8158                       
        8159      <xsl:param  
        8160       name="heig ht"
        8161      />
        8162                       
        8163      <td>
        8164                                 
        8165       <div 
        8166        style="ove rflow:hidd en; white- space:nowr ap; width: 70px;"
        8167       >
        8168                                           
        8169        <xsl:call- template 
        8170         name="disp layVitalsH eight"
        8171        >
        8172                                                    
        8173         <xsl:with- param 
        8174          name="heig ht" 
        8175          select="$h eight"
        8176         />
        8177                                            
        8178        </xsl:call -template>
        8179                                  
        8180       </div>
        8181                        
        8182      </td>
        8183              
        8184     </xsl:temp late>
        8185    
        8186             
        8187     <xsl:templ ate 
        8188      name="disp layVitalsB pItem"
        8189     >
        8190                       
        8191      <xsl:param  
        8192       name="row"
        8193      />
        8194                       
        8195      <td>
        8196                                 
        8197       <div 
        8198        style="ove rflow:hidd en; white- space:nowr ap; width: 70px;"
        8199       >
        8200                                           
        8201        <xsl:call- template 
        8202         name="disp layVitalsB p"
        8203        >
        8204                                                    
        8205         <xsl:with- param 
        8206          name="row"  
        8207          select="$r ow"
        8208         />
        8209                                            
        8210        </xsl:call -template>
        8211                                  
        8212       </div>
        8213                        
        8214      </td>
        8215              
        8216     </xsl:temp late>
        8217    
        8218             
        8219     <xsl:templ ate 
        8220      name="disp layVitalsR espItem"
        8221     >
        8222                       
        8223      <xsl:param  
        8224       name="resp "
        8225      />
        8226                       
        8227      <td>
        8228                                 
        8229       <div 
        8230        style="ove rflow:hidd en; white- space:nowr ap; width: 70px;"
        8231       >
        8232                                           
        8233        <xsl:call- template 
        8234         name="disp layVitalsR esp"
        8235        >
        8236                                                    
        8237         <xsl:with- param 
        8238          name="resp
        8239          select="$r esp"
        8240         />
        8241                                            
        8242        </xsl:call -template>
        8243                                  
        8244       </div>
        8245                        
        8246      </td>
        8247              
        8248     </xsl:temp late>
        8249    
        8250             
        8251     <xsl:templ ate 
        8252      name="disp layVitalsP ulseItem"
        8253     >
        8254                       
        8255      <xsl:param  
        8256       name="puls e"
        8257      />
        8258                       
        8259      <td>
        8260                                 
        8261       <div 
        8262        style="ove rflow:hidd en; white- space:nowr ap; width: 70px;"
        8263       >
        8264                                           
        8265        <xsl:call- template 
        8266         name="disp layVitalsP ulse"
        8267        >
        8268                                                    
        8269         <xsl:with- param 
        8270          name="puls e" 
        8271          select="$p ulse"
        8272         />
        8273                                            
        8274        </xsl:call -template>
        8275                                  
        8276       </div>
        8277                        
        8278      </td>
        8279              
        8280     </xsl:temp late>
        8281    
        8282             
        8283     <xsl:templ ate 
        8284      name="getW eightResul t"
        8285     >
        8286                       
        8287      <xsl:param  
        8288       name="wt" 
        8289      />
        8290                       
        8291      <xsl:for-e ach 
        8292       select="$w t"
        8293      >
        8294                                 
        8295       <xsl:if 
        8296        test="posi tion()>1"
        8297       >
        8298                                           
        8299        <br/>
        8300                                  
        8301       </xsl:if>
        8302                                 
        8303       <xsl:choos e>
        8304                                           
        8305        <xsl:when 
        8306         test="stri ng-length( n1:value/@ value)>1"
        8307        >
        8308                                                    
        8309         <xsl:varia ble 
        8310          name="weig htResult" 
        8311          select="n1 :value/@va lue"
        8312         />
        8313                                                    
        8314         <xsl:choos e>
        8315                                                              
        8316          <xsl:when 
        8317           test="n1:v alue/@unit "
        8318          >
        8319                                                                        
        8320           <xsl:call- template 
        8321            name="flyo verSpan"
        8322           >
        8323                                                                                  
        8324            <xsl:with- param 
        8325             name="data
        8326             select="co ncat($weig htResult,n 1:value/@u nit)"
        8327            />
        8328                                                                         
        8329           </xsl:call -template>
        8330                                                               
        8331          </xsl:when >
        8332                                                              
        8333          <xsl:other wise>
        8334                                                                        
        8335           <xsl:call- template 
        8336            name="flyo verSpan"
        8337           >
        8338                                                                                  
        8339            <xsl:with- param 
        8340             name="data
        8341             select="$w eightResul t"
        8342            />
        8343                                                                         
        8344           </xsl:call -template>
        8345                                                               
        8346          </xsl:othe rwise>
        8347                                                     
        8348         </xsl:choo se>
        8349                                            
        8350        </xsl:when >
        8351                                           
        8352        <xsl:other wise>
        8353                                                    
        8354         <xsl:call- template 
        8355          name="na"
        8356         />
        8357                                            
        8358        </xsl:othe rwise>
        8359                                  
        8360       </xsl:choo se>
        8361                        
        8362      </xsl:for- each>
        8363     
        8364              
        8365     </xsl:temp late>
        8366    
        8367   </xsl:styl esheet>