295. EPMO Open Source Coordination Office Redaction File Detail Report

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

295.1 Files compared

# Location File Last Modified
1 C:\working_scrub\Unredacted\eHX Code Base\eHX_Bld2_Source Code_CIF_2017-02-14\NHIN_adapter\SpecProcessor\src\test\resources\NewStyleSheets\nhin cda2detail.sean.xsl Fri Feb 10 15:41:44 2017 UTC
2 eHX-CIF.zip\eHX-CIF\eHX Code Base\eHX_Bld2_Source Code_CIF_2017-02-14\NHIN_adapter\SpecProcessor\src\test\resources\NewStyleSheets\nhin cda2detail.sean.xsl Mon Apr 3 14:39:42 2017 UTC

295.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 7 16090
Changed 6 12
Inserted 0 0
Removed 0 0

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

295.4 Active regular expressions

No regular expressions were active.

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