Index: /ccr2ccd-xslt/trunk/templates/actor.xsl
===================================================================
--- /ccr2ccd-xslt/trunk/templates/actor.xsl	(revision 747)
+++ /ccr2ccd-xslt/trunk/templates/actor.xsl	(revision 747)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+	<!-- Returns the name of the actor, if there is no name it returns the ActorObjectID that was passed in -->
+	<xsl:template name="actorName">
+		<xsl:param name="objID"/>
+		<xsl:for-each select="/a:ContinuityOfCareRecord/a:Actors/a:Actor">
+			<xsl:variable name="thisObjID" select="a:ActorObjectID"/>
+			<xsl:if test="$objID = $thisObjID">
+				<xsl:choose>
+					<xsl:when test="a:Person">
+						<xsl:choose>
+							<xsl:when test="a:Person/a:Name/a:DisplayName">
+								<xsl:value-of select="a:Person/a:Name/a:DisplayName"/>
+							</xsl:when>
+							<xsl:when test="a:Person/a:Name/a:CurrentName">
+								<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>
+								</xsl:when>
+							<xsl:when test="a:Person/a:Name/a:BirthName">
+								<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>
+								</xsl:when>
+							<xsl:when test="a:Person/a:Name/a:AdditionalName">
+								<xsl:for-each select="a:Person/a:Name/a:AdditionalName">
+									<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>
+									<xsl:if test="position() != last()">
+										<br/>
+									</xsl:if>
+								</xsl:for-each>
+							</xsl:when>
+						</xsl:choose>
+					</xsl:when>
+					<xsl:when test="a:Organization">
+						<xsl:value-of select="a:Organization/a:Name"/>
+					</xsl:when>
+					<xsl:when test="a:InformationSystem">
+						<xsl:value-of select="a:InformationSystem/a:Name"/><xsl:text xml:space="preserve"> </xsl:text>
+						<xsl:if test="a:InformationSystem/a:Version">
+							<xsl:value-of select="a:InformationSystem/a:Version"/><xsl:text xml:space="preserve"> </xsl:text></xsl:if>
+						<xsl:if test="a:InformationSystem/a:Type">(<xsl:value-of select="a:InformationSystem/a:Type"/>)</xsl:if>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="$objID"/>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:if>
+		</xsl:for-each>
+	</xsl:template>
+	<!-- End actorname template -->
+</xsl:stylesheet>
Index: /ccr2ccd-xslt/trunk/templates/code.xsl
===================================================================
--- /ccr2ccd-xslt/trunk/templates/code.xsl	(revision 747)
+++ /ccr2ccd-xslt/trunk/templates/code.xsl	(revision 747)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+<xsl:template match="a:Code">
+		<xsl:value-of select="a:Value"/>
+		<xsl:if test="a:CodingSystem">
+			<xsl:text xml:space="preserve"> </xsl:text>(<xsl:value-of select="a:CodingSystem"/>)
+		</xsl:if>
+</xsl:template>
+</xsl:stylesheet>
Index: /ccr2ccd-xslt/trunk/templates/datetime.xsl
===================================================================
--- /ccr2ccd-xslt/trunk/templates/datetime.xsl	(revision 747)
+++ /ccr2ccd-xslt/trunk/templates/datetime.xsl	(revision 747)
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="urn:astm-org:CCR" xmlns:date="http://exslt.org/dates-and-times" xmlns:fo="http://www.w3.org/1999/XSL/Format">
+	<!-- Displays the DateTime.  If ExactDateTime is present, it will format according
+		 to the 'fmt' variable. The default format is: Oct 31, 2005 -->
+  <xsl:import href="../lib/date.format-date.template.xsl"/>  
+  <xsl:template name="dateTime" match="DateTime">
+		<xsl:param name="dt" select="."/>
+		<xsl:param name="fmt">MMM dd, yyyy</xsl:param>
+    <xsl:for-each select="$dt">
+      <tr>
+        <xsl:if test="$dt/a:Type/a:Text">
+          <td>
+            <xsl:value-of select="a:Type/a:Text"/>:
+          </td>
+        </xsl:if>
+        <xsl:choose>
+          <xsl:when test="a:ExactDateTime">
+            <td>
+              <xsl:call-template name="date:format-date">
+                <xsl:with-param name="date-time">
+                  <xsl:value-of select="a:ExactDateTime"/>
+                </xsl:with-param>
+                <xsl:with-param name="pattern" select="$fmt"/>
+              </xsl:call-template>
+            </td>
+          </xsl:when>
+          <xsl:when test="$dt/a:Age">
+            <td>
+              <xsl:value-of select="$dt/a:Age/a:Value"/>
+              <xsl:text xml:space="preserve"> </xsl:text>
+              <xsl:value-of select="$dt/a:Age/a:Units/a:Unit"/>
+            </td>
+          </xsl:when>
+          <xsl:when test="$dt/a:ApproximateDateTime">
+            <td>
+              <xsl:value-of select="$dt/a:ApproximateDateTime/a:Text"/>
+            </td>
+          </xsl:when>
+          <xsl:when test="$dt/a:DateTimeRange">
+            <td>
+              <xsl:for-each select="$dt/a:DateTimeRange/a:BeginRange">
+                <xsl:choose>
+                  <xsl:when test="$dt/a:ExactDateTime">
+                    <xsl:call-template name="date:format-date">
+                      <xsl:with-param name="date-time">
+                        <xsl:value-of select="$dt/a:ExactDateTime"/>
+                      </xsl:with-param>
+                      <xsl:with-param name="pattern" select="$fmt"/>
+                    </xsl:call-template>
+                  </xsl:when>
+                  <xsl:when test="$dt/a:Age">
+                    <xsl:value-of select="$dt/a:Age/a:Value"/>
+                    <xsl:text xml:space="preserve"> </xsl:text>
+                    <xsl:value-of select="$dt/a:Age/a:Units/a:Unit"/>
+                  </xsl:when>
+                  <xsl:when test="$dt/a:ApproximateDateTime">
+                    <xsl:value-of select="$dt/a:ApproximateDateTime/a:Text"/>
+                  </xsl:when>
+                  <xsl:otherwise/>
+                </xsl:choose>
+              </xsl:for-each><xsl:text xml:space="preserve"> </xsl:text>
+              -<xsl:text xml:space="preserve"> </xsl:text>
+              <xsl:for-each select="$dt/a:DateTimeRange/a:EndRange">
+                <xsl:choose>
+                  <xsl:when test="$dt/a:ExactDateTime">
+                    <xsl:call-template name="date:format-date">
+                      <xsl:with-param name="date-time">
+                        <xsl:value-of select="$dt/a:ExactDateTime"/>
+                      </xsl:with-param>
+                      <xsl:with-param name="pattern" select="$fmt"/>
+                    </xsl:call-template>
+                  </xsl:when>
+                  <xsl:when test="$dt/a:Age">
+                    <xsl:value-of select="$dt/a:Age/a:Value"/>
+                    <xsl:text xml:space="preserve"> </xsl:text>
+                    <xsl:value-of select="$dt/a:Age/a:Units/a:Unit"/>
+                  </xsl:when>
+                  <xsl:when test="$dt/a:ApproximateDateTime">
+                    <xsl:value-of select="$dt/a:ApproximateDateTime/a:Text"/>
+                  </xsl:when>
+                  <xsl:otherwise/>
+                </xsl:choose>
+              </xsl:for-each>
+            </td>
+          </xsl:when>
+          <xsl:otherwise/>
+        </xsl:choose>
+      </tr>
+    </xsl:for-each>
+	</xsl:template>
+</xsl:stylesheet>
Index: /ccr2ccd-xslt/trunk/templates/problemDescription.xsl
===================================================================
--- /ccr2ccd-xslt/trunk/templates/problemDescription.xsl	(revision 747)
+++ /ccr2ccd-xslt/trunk/templates/problemDescription.xsl	(revision 747)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+	<!-- Returns the description of the problem, if there is no name it returns the ObjectID that was passed in -->
+	<xsl:template name="problemDescription">
+		<xsl:param name="objID"/>
+		<xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Problems/a:Problem">
+			<xsl:variable name="thisObjID" select="a:CCRDataObjectID"/>
+			<xsl:if test="$objID = $thisObjID">
+				<xsl:choose>
+					<xsl:when test="a:Description/a:Text">
+						<xsl:value-of select="a:Description/a:Text"/>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:value-of select="$objID"/>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:if>
+		</xsl:for-each>
+	</xsl:template>
+	<!-- End problemDescription template -->
+</xsl:stylesheet>
