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: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 -->
|
---|
48 | </xsl:stylesheet>
|
---|