CCR-CCD module (still in development):
[openemr.git] / ccr / ccd / templates / actor.xsl
blob4cb844b691c84a1747327aa1def5a8f6b7ce718b
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 Conversion of CCR to Level 3 CCD
5 Orginal Author: Ken Miller
6 Solventus LLC
7 ken.miller@solventus.coms
9 Contributors:
10 Richard Braman, EHR Doctors, Inc rbraman@ehrdoctors.com
11 George Lilly (WorldVistA glilly@glilly.net)
12 xxxx - Oroville Hospital
14 Date: 2010-05-5
15 Version: 0.1
17 License :
19 This program is free software: you can redistribute it and/or modify
20 it under the terms of the GNU General Public License as published by
21 the Free Software Foundation, either version 3 of the License, or
22 (at your option) any later version.
24 This program is distributed in the hope that it will be useful,
25 but WITHOUT ANY WARRANTY; without even the implied warranty of
26 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 GNU General Public License for more details.
29 You should have received a copy of the GNU General Public License
30 along with this program. If not, see http://www.gnu.org/licenses.
32 -->
33 <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">
34 <!-- Returns the name of the actor, if there is no name it returns the ActorObjectID that was passed in -->
35 <xsl:template name="actorName">
36 <xsl:param name="objID"/>
37 <xsl:variable name="actor" select="//a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$objID]"/>
38 <xsl:choose>
39 <xsl:when test="$actor/a:Person">
40 <xsl:choose>
41 <xsl:when test="$actor/a:Person/a:Name/a:DisplayName">
42 <xsl:value-of select="$actor/a:Person/a:Name/a:DisplayName"/>
43 </xsl:when>
44 <xsl:when test="$actor/a:Person/a:Name/a:CurrentName">
45 <xsl:value-of select="$actor/a:Person/a:Name/a:CurrentName/a:Given"/>
46 <xsl:text xml:space="preserve"> </xsl:text>
47 <xsl:value-of select="$actor/a:Person/a:Name/a:CurrentName/a:Middle"/>
48 <xsl:text xml:space="preserve"> </xsl:text>
49 <xsl:value-of select="$actor/a:Person/a:Name/a:CurrentName/a:Family"/>
50 <xsl:text xml:space="preserve"> </xsl:text>
51 <xsl:value-of select="$actor/a:Person/a:Name/a:CurrentName/a:Suffix"/>
52 <xsl:text xml:space="preserve"> </xsl:text>
53 <xsl:value-of select="$actor/a:Person/a:Name/a:CurrentName/a:Title"/>
54 <xsl:text xml:space="preserve"> </xsl:text>
55 </xsl:when>
56 <xsl:when test="$actor/a:Person/a:Name/a:BirthName">
57 <xsl:value-of select="$actor/a:Person/a:Name/a:BirthName/a:Given"/>
58 <xsl:text xml:space="preserve"> </xsl:text>
59 <xsl:value-of select="$actor/a:Person/a:Name/a:BirthName/a:Middle"/>
60 <xsl:text xml:space="preserve"> </xsl:text>
61 <xsl:value-of select="$actor/a:Person/a:Name/a:BirthName/a:Family"/>
62 <xsl:text xml:space="preserve"> </xsl:text>
63 <xsl:value-of select="$actor/a:Person/a:Name/a:BirthName/a:Suffix"/>
64 <xsl:text xml:space="preserve"> </xsl:text>
65 <xsl:value-of select="$actor/a:Person/a:Name/a:BirthName/a:Title"/>
66 <xsl:text xml:space="preserve"> </xsl:text>
67 </xsl:when>
68 <xsl:when test="$actor/a:Person/a:Name/a:AdditionalName">
69 <xsl:for-each select="$actor/a:Person/a:Name/a:AdditionalName">
70 <xsl:value-of select="a:Given"/>
71 <xsl:text xml:space="preserve"> </xsl:text>
72 <xsl:value-of select="a:Middle"/>
73 <xsl:text xml:space="preserve"> </xsl:text>
74 <xsl:value-of select="a:Family"/>
75 <xsl:text xml:space="preserve"> </xsl:text>
76 <xsl:value-of select="a:Suffix"/>
77 <xsl:text xml:space="preserve"> </xsl:text>
78 <xsl:value-of select="a:Title"/>
79 <xsl:text xml:space="preserve"> </xsl:text>
80 <xsl:if test="position() != last()">
81 <br/>
82 </xsl:if>
83 </xsl:for-each>
84 </xsl:when>
85 </xsl:choose>
86 </xsl:when>
87 <xsl:when test="$actor/a:Organization">
88 <xsl:value-of select="$actor/a:Organization/a:Name"/>
89 </xsl:when>
90 <xsl:when test="$actor/a:InformationSystem">
91 <xsl:value-of select="$actor/a:InformationSystem/a:Name"/>
92 <xsl:text xml:space="preserve"> </xsl:text>
93 <xsl:if test="$actor/a:InformationSystem/a:Version">
94 <xsl:value-of select="$actor/a:InformationSystem/a:Version"/>
95 <xsl:text xml:space="preserve"> </xsl:text>
96 </xsl:if>
97 <xsl:if test="$actor/a:InformationSystem/a:Type">
98 (<xsl:value-of select="$actor/a:InformationSystem/a:Type"/>)
99 </xsl:if>
100 </xsl:when>
101 <xsl:otherwise>
102 <xsl:value-of select="$objID"/>
103 </xsl:otherwise>
104 </xsl:choose>
105 </xsl:template>
106 <!-- End actorname template -->
107 </xsl:stylesheet>