source: ccr2ccd-xslt/trunk/templates/actor.xsl@ 1416

Last change on this file since 1416 was 761, checked in by Richard Braman, 15 years ago

removed unneeded for-each

File size: 4.6 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<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: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 -->
76</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.