Changeset 761 for ccr2ccd-xslt


Ignore:
Timestamp:
May 18, 2010, 11:45:42 AM (14 years ago)
Author:
Richard Braman
Message:

removed unneeded for-each

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ccr2ccd-xslt/trunk/templates/actor.xsl

    r747 r761  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="urn:astm-org:CCR"  xmlns:fo="http://www.w3.org/1999/XSL/Format">
    3         <!-- Returns the name of the actor, if there is no name it returns the ActorObjectID that was passed in -->
    4         <xsl:template name="actorName">
    5                 <xsl:param name="objID"/>
    6                 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Actors/a:Actor">
    7                         <xsl:variable name="thisObjID" select="a:ActorObjectID"/>
    8                         <xsl:if test="$objID = $thisObjID">
    9                                 <xsl:choose>
    10                                         <xsl:when test="a:Person">
    11                                                 <xsl:choose>
    12                                                         <xsl:when test="a:Person/a:Name/a:DisplayName">
    13                                                                 <xsl:value-of select="a:Person/a:Name/a:DisplayName"/>
    14                                                         </xsl:when>
    15                                                         <xsl:when test="a:Person/a:Name/a:CurrentName">
    16                                                                 <xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Given"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Middle"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Family"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Suffix"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Title"/><xsl:text xml:space="preserve"> </xsl:text>
    17                                                                 </xsl:when>
    18                                                         <xsl:when test="a:Person/a:Name/a:BirthName">
    19                                                                 <xsl:value-of select="a:Person/a:Name/a:BirthName/a:Given"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Person/a:Name/a:BirthName/a:Middle"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Person/a:Name/a:BirthName/a:Family"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Person/a:Name/a:BirthName/a:Suffix"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Person/a:Name/a:BirthName/a:Title"/><xsl:text xml:space="preserve"> </xsl:text>
    20                                                                 </xsl:when>
    21                                                         <xsl:when test="a:Person/a:Name/a:AdditionalName">
    22                                                                 <xsl:for-each select="a:Person/a:Name/a:AdditionalName">
    23                                                                         <xsl:value-of select="a:Given"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Middle"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Family"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Suffix"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Title"/><xsl:text xml:space="preserve"> </xsl:text>
    24                                                                         <xsl:if test="position() != last()">
    25                                                                                 <br/>
    26                                                                         </xsl:if>
    27                                                                 </xsl:for-each>
    28                                                         </xsl:when>
    29                                                 </xsl:choose>
    30                                         </xsl:when>
    31                                         <xsl:when test="a:Organization">
    32                                                 <xsl:value-of select="a:Organization/a:Name"/>
    33                                         </xsl:when>
    34                                         <xsl:when test="a:InformationSystem">
    35                                                 <xsl:value-of select="a:InformationSystem/a:Name"/><xsl:text xml:space="preserve"> </xsl:text>
    36                                                 <xsl:if test="a:InformationSystem/a:Version">
    37                                                         <xsl:value-of select="a:InformationSystem/a:Version"/><xsl:text xml:space="preserve"> </xsl:text></xsl:if>
    38                                                 <xsl:if test="a:InformationSystem/a:Type">(<xsl:value-of select="a:InformationSystem/a:Type"/>)</xsl:if>
    39                                         </xsl:when>
    40                                         <xsl:otherwise>
    41                                                 <xsl:value-of select="$objID"/>
    42                                         </xsl:otherwise>
    43                                 </xsl:choose>
    44                         </xsl:if>
    45                 </xsl:for-each>
    46         </xsl:template>
    47         <!-- End actorname template -->
     3    <!-- Returns the name of the actor, if there is no name it returns the ActorObjectID that was passed in -->
     4    <xsl:template name="actorName">
     5        <xsl:param name="objID"/>
     6        <xsl:variable name="actor" select="//a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$objID]"/>
     7        <xsl:choose>
     8            <xsl:when test="$actor/a:Person">
     9                <xsl:choose>
     10                    <xsl:when test="$actor/a:Person/a:Name/a:DisplayName">
     11                        <xsl:value-of select="$actor/a:Person/a:Name/a:DisplayName"/>
     12                    </xsl:when>
     13                    <xsl:when test="$actor/a:Person/a:Name/a:CurrentName">
     14                        <xsl:value-of select="$actor/a:Person/a:Name/a:CurrentName/a:Given"/>
     15                        <xsl:text xml:space="preserve"> </xsl:text>
     16                        <xsl:value-of select="$actor/a:Person/a:Name/a:CurrentName/a:Middle"/>
     17                        <xsl:text xml:space="preserve"> </xsl:text>
     18                        <xsl:value-of select="$actor/a:Person/a:Name/a:CurrentName/a:Family"/>
     19                        <xsl:text xml:space="preserve"> </xsl:text>
     20                        <xsl:value-of select="$actor/a:Person/a:Name/a:CurrentName/a:Suffix"/>
     21                        <xsl:text xml:space="preserve"> </xsl:text>
     22                        <xsl:value-of select="$actor/a:Person/a:Name/a:CurrentName/a:Title"/>
     23                        <xsl:text xml:space="preserve"> </xsl:text>
     24                    </xsl:when>
     25                    <xsl:when test="$actor/a:Person/a:Name/a:BirthName">
     26                        <xsl:value-of select="$actor/a:Person/a:Name/a:BirthName/a:Given"/>
     27                        <xsl:text xml:space="preserve"> </xsl:text>
     28                        <xsl:value-of select="$actor/a:Person/a:Name/a:BirthName/a:Middle"/>
     29                        <xsl:text xml:space="preserve"> </xsl:text>
     30                        <xsl:value-of select="$actor/a:Person/a:Name/a:BirthName/a:Family"/>
     31                        <xsl:text xml:space="preserve"> </xsl:text>
     32                        <xsl:value-of select="$actor/a:Person/a:Name/a:BirthName/a:Suffix"/>
     33                        <xsl:text xml:space="preserve"> </xsl:text>
     34                        <xsl:value-of select="$actor/a:Person/a:Name/a:BirthName/a:Title"/>
     35                        <xsl:text xml:space="preserve"> </xsl:text>
     36                    </xsl:when>
     37                    <xsl:when test="$actor/a:Person/a:Name/a:AdditionalName">
     38                        <xsl:for-each select="$actor/a:Person/a:Name/a:AdditionalName">
     39                            <xsl:value-of select="a:Given"/>
     40                            <xsl:text xml:space="preserve"> </xsl:text>
     41                            <xsl:value-of select="a:Middle"/>
     42                            <xsl:text xml:space="preserve"> </xsl:text>
     43                            <xsl:value-of select="a:Family"/>
     44                            <xsl:text xml:space="preserve"> </xsl:text>
     45                            <xsl:value-of select="a:Suffix"/>
     46                            <xsl:text xml:space="preserve"> </xsl:text>
     47                            <xsl:value-of select="a:Title"/>
     48                            <xsl:text xml:space="preserve"> </xsl:text>
     49                            <xsl:if test="position() != last()">
     50                                <br/>
     51                            </xsl:if>
     52                        </xsl:for-each>
     53                    </xsl:when>
     54                </xsl:choose>
     55            </xsl:when>
     56            <xsl:when test="$actor/a:Organization">
     57                <xsl:value-of select="$actor/a:Organization/a:Name"/>
     58            </xsl:when>
     59            <xsl:when test="$actor/a:InformationSystem">
     60                <xsl:value-of select="$actor/a:InformationSystem/a:Name"/>
     61                <xsl:text xml:space="preserve"> </xsl:text>
     62                <xsl:if test="$actor/a:InformationSystem/a:Version">
     63                    <xsl:value-of select="$actor/a:InformationSystem/a:Version"/>
     64                    <xsl:text xml:space="preserve"> </xsl:text>
     65                </xsl:if>
     66                <xsl:if test="$actor/a:InformationSystem/a:Type">
     67                    (<xsl:value-of select="$actor/a:InformationSystem/a:Type"/>)
     68                </xsl:if>
     69            </xsl:when>
     70            <xsl:otherwise>
     71                <xsl:value-of select="$objID"/>
     72            </xsl:otherwise>
     73        </xsl:choose>
     74    </xsl:template>
     75    <!-- End actorname template -->
    4876</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.