Index: /ccr2ccd-xslt/trunk/make/templates/actor.xsl
===================================================================
--- /ccr2ccd-xslt/trunk/make/templates/actor.xsl	(revision 985)
+++ /ccr2ccd-xslt/trunk/make/templates/actor.xsl	(revision 985)
@@ -0,0 +1,76 @@
+<?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:variable name="actor" select="//a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$objID]"/>
+        <xsl:choose>
+            <xsl:when test="$actor/a:Person">
+                <xsl:choose>
+                    <xsl:when test="$actor/a:Person/a:Name/a:DisplayName">
+                        <xsl:value-of select="$actor/a:Person/a:Name/a:DisplayName"/>
+                    </xsl:when>
+                    <xsl:when test="$actor/a:Person/a:Name/a:CurrentName">
+                        <xsl:value-of select="$actor/a:Person/a:Name/a:CurrentName/a:Given"/>
+                        <xsl:text xml:space="preserve"> </xsl:text>
+                        <xsl:value-of select="$actor/a:Person/a:Name/a:CurrentName/a:Middle"/>
+                        <xsl:text xml:space="preserve"> </xsl:text>
+                        <xsl:value-of select="$actor/a:Person/a:Name/a:CurrentName/a:Family"/>
+                        <xsl:text xml:space="preserve"> </xsl:text>
+                        <xsl:value-of select="$actor/a:Person/a:Name/a:CurrentName/a:Suffix"/>
+                        <xsl:text xml:space="preserve"> </xsl:text>
+                        <xsl:value-of select="$actor/a:Person/a:Name/a:CurrentName/a:Title"/>
+                        <xsl:text xml:space="preserve"> </xsl:text>
+                    </xsl:when>
+                    <xsl:when test="$actor/a:Person/a:Name/a:BirthName">
+                        <xsl:value-of select="$actor/a:Person/a:Name/a:BirthName/a:Given"/>
+                        <xsl:text xml:space="preserve"> </xsl:text>
+                        <xsl:value-of select="$actor/a:Person/a:Name/a:BirthName/a:Middle"/>
+                        <xsl:text xml:space="preserve"> </xsl:text>
+                        <xsl:value-of select="$actor/a:Person/a:Name/a:BirthName/a:Family"/>
+                        <xsl:text xml:space="preserve"> </xsl:text>
+                        <xsl:value-of select="$actor/a:Person/a:Name/a:BirthName/a:Suffix"/>
+                        <xsl:text xml:space="preserve"> </xsl:text>
+                        <xsl:value-of select="$actor/a:Person/a:Name/a:BirthName/a:Title"/>
+                        <xsl:text xml:space="preserve"> </xsl:text>
+                    </xsl:when>
+                    <xsl:when test="$actor/a:Person/a:Name/a:AdditionalName">
+                        <xsl:for-each select="$actor/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="$actor/a:Organization">
+                <xsl:value-of select="$actor/a:Organization/a:Name"/>
+            </xsl:when>
+            <xsl:when test="$actor/a:InformationSystem">
+                <xsl:value-of select="$actor/a:InformationSystem/a:Name"/>
+                <xsl:text xml:space="preserve"> </xsl:text>
+                <xsl:if test="$actor/a:InformationSystem/a:Version">
+                    <xsl:value-of select="$actor/a:InformationSystem/a:Version"/>
+                    <xsl:text xml:space="preserve"> </xsl:text>
+                </xsl:if>
+                <xsl:if test="$actor/a:InformationSystem/a:Type">
+                    (<xsl:value-of select="$actor/a:InformationSystem/a:Type"/>)
+                </xsl:if>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:value-of select="$objID"/>
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
+    <!-- End actorname template -->
+</xsl:stylesheet>
Index: /ccr2ccd-xslt/trunk/make/templates/address.xsl
===================================================================
--- /ccr2ccd-xslt/trunk/make/templates/address.xsl	(revision 985)
+++ /ccr2ccd-xslt/trunk/make/templates/address.xsl	(revision 985)
@@ -0,0 +1,49 @@
+<?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 name="address">
+        <xsl:param name="actorID"/>
+        <xsl:variable name="actor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$actorID]"/>
+        <td>
+            <table class="internal" cellpadding="0" cellspacing="0">
+                <tr>
+                    <td valign="top">
+                        <xsl:for-each select="$actor/a:Address">
+                            <xsl:if test="a:Type">
+                                <b>
+                                    <xsl:value-of select="a:Type/a:Text"/>:
+                                </b>
+                                <br/>
+                            </xsl:if>
+                            <xsl:if test="a:Line1">
+                                <xsl:value-of select="a:Line1"/>
+                                <br/>
+                            </xsl:if>
+                            <xsl:if test="a:Line2">
+                                <xsl:value-of select="a:Line2"/>
+                                <br/>
+                            </xsl:if>
+                            <xsl:if test="a:City">
+                                <xsl:value-of select="a:City"/>,<xsl:text xml:space="preserve"> </xsl:text>
+                            </xsl:if>
+                            <xsl:value-of select="a:State"/>
+                            <xsl:text xml:space="preserve"> </xsl:text>
+                            <xsl:value-of select="a:PostalCode"/>
+                            <br/>
+                        </xsl:for-each>
+                    </td>
+                    <td valign="top">
+                        <xsl:for-each select="a:Telephone">
+                            <xsl:if test="a:Type/a:Text">
+                                <xsl:value-of select="a:Type/a:Text"/> Phone:<xsl:text xml:space="preserve"> </xsl:text>
+                            </xsl:if>
+                            <xsl:value-of select="a:Value"/>
+                        </xsl:for-each>
+                        <xsl:for-each select="a:EMail">
+                            Email:<xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Value"/>
+                        </xsl:for-each>
+                    </td>
+                </tr>
+            </table>
+        </td>
+    </xsl:template>
+</xsl:stylesheet>
Index: /ccr2ccd-xslt/trunk/make/templates/cdavocablookup.xsl
===================================================================
--- /ccr2ccd-xslt/trunk/make/templates/cdavocablookup.xsl	(revision 985)
+++ /ccr2ccd-xslt/trunk/make/templates/cdavocablookup.xsl	(revision 985)
@@ -0,0 +1,46 @@
+﻿<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+    <xsl:template name="CDAVocabularyLookup">
+        <xsl:param name="domain"/>
+        <xsl:param name="ccrtext"/>
+
+        <xsl:variable name="map" select="document('cdavocabmap.xml')"/>
+        <xsl:variable name="ccrtext_uc" select="translate($ccrtext, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
+        <xsl:variable name="cdaCodeMatch" select="$map/domains/domain[@name=$domain]/item[translate(cdacode,'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')=$ccrtext_uc]/cdacode"/>
+        <xsl:choose>
+            <xsl:when test="$cdaCodeMatch">
+                <xsl:value-of select="$cdaCodeMatch"/>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:value-of select="$map/domains/domain[@name=$domain]/item[translate(ccrtext,'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')=$ccrtext_uc]/cdacode"/>    
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
+
+    <xsl:template name="CDADisplayNameLookup">
+        <xsl:param name="domain"/>
+        <xsl:param name="cdacode"/>
+        <xsl:variable name="map" select="document('cdavocabmap.xml')"/>
+        <xsl:choose>
+            <xsl:when test="$map/domains/domain[@name=$domain]/item[cdacode=$cdacode]/cdadisplayname">
+                <xsl:value-of select="$map/domains/domain[@name=$domain]/item[cdacode=$cdacode]/cdadisplayname"/>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:value-of select="$map/domains/domain[@name=$domain]/item[cdacode=$cdacode]/ccrtext"/>
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:template>
+
+    <xsl:template name="CDAVocabularyCodeSystemNameLookup">
+        <xsl:param name="domain"/>
+        
+        <xsl:value-of select="document('cdavocabmap.xml')/domains/domain[@name=$domain]/@codeSystemName"/>
+    </xsl:template>
+
+    <xsl:template name="CDAVocabularyCodeSystemLookup">
+        <xsl:param name="domain"/>
+
+        <xsl:value-of select="document('cdavocabmap.xml')/domains/domain[@name=$domain]/@codeSystem"/>
+    </xsl:template>
+    
+</xsl:stylesheet>
Index: /ccr2ccd-xslt/trunk/make/templates/cdavocabmap.xml
===================================================================
--- /ccr2ccd-xslt/trunk/make/templates/cdavocabmap.xml	(revision 985)
+++ /ccr2ccd-xslt/trunk/make/templates/cdavocabmap.xml	(revision 985)
@@ -0,0 +1,172 @@
+﻿<?xml version="1.0" encoding="utf-8" ?>
+<domains>
+    <domain name="telecommunicationsAddressUse">
+        <item>
+            <ccrtext>Home</ccrtext>
+            <cdadisplayname>home address</cdadisplayname>
+            <cdacode>H</cdacode>
+        </item>
+        <item>
+            <ccrtext>Primary Home</ccrtext>
+            <cdadisplayname>primary home</cdadisplayname>
+            <cdacode>HP</cdacode>
+        </item>
+        <item>
+            <ccrtext>Vacation Home</ccrtext>
+            <cdadisplayname>primary home</cdadisplayname>
+            <cdacode>HV</cdacode>
+        </item>
+        <item>
+            <ccrtext>Office</ccrtext>
+            <cdadisplayname>office</cdadisplayname>
+            <cdacode>WP</cdacode>
+        </item>
+        <item>
+            <ccrtext>Work</ccrtext>
+            <cdadisplayname>office</cdadisplayname>
+            <cdacode>WP</cdacode>
+        </item>
+        <item>
+            <ccrtext>Mobile</ccrtext>
+            <cdadisplayname>mobile contact</cdadisplayname>
+            <cdacode>MC</cdacode>
+        </item>
+        <item>
+            <ccrtext>Pager</ccrtext>
+            <cdadisplayname>pager</cdadisplayname>
+            <cdacode>PG</cdacode>
+        </item>
+    </domain>
+    <domain name="HumanLanguage" codeSystemName="IETF RFC 1766">
+        <item>
+            <ccrtext>English</ccrtext>
+            <cdacode>en-us</cdacode>
+        </item>
+        <item>
+            <ccrtext>Spanish</ccrtext>
+            <cdacode>es</cdacode>
+        </item>
+        <item>
+            <ccrtext>French</ccrtext>
+            <cdacode>fr</cdacode>
+        </item>
+        <item>
+            <ccrtext>German</ccrtext>
+            <cdacode>de</cdacode>
+        </item>
+    </domain>
+    <domain name="MaritalStatus" codeSystemName="HL7 Marital status" codeSystem="2.16.840.1.113883.5.2">
+        <item>
+            <ccrtext>Annulled</ccrtext>
+            <cdadisplaytext>Annulled</cdadisplaytext>
+            <cdacode>A</cdacode>
+        </item>
+        <item>
+            <ccrtext>Divorced</ccrtext>
+            <cdadisplaytext>Divorced</cdadisplaytext>
+            <cdacode>D</cdacode>
+        </item>
+        <item>
+            <ccrtext>Interlocutory</ccrtext>
+            <cdadisplaytext>Interlocutory</cdadisplaytext>
+            <cdacode>I</cdacode>
+        </item>
+        <item>
+            <ccrtext>Separated</ccrtext>
+            <cdadisplaytext>Legally Separated</cdadisplaytext>
+            <cdacode>L</cdacode>
+        </item>
+        <item>
+            <ccrtext>Married</ccrtext>
+            <cdadisplaytext>Married</cdadisplaytext>
+            <cdacode>M</cdacode>
+        </item>
+        <item>
+            <ccrtext>Polygamous</ccrtext>
+            <cdadisplaytext>Polygamous</cdadisplaytext>
+            <cdacode>P</cdacode>
+        </item>
+        <item>
+            <ccrtext>Single</ccrtext>
+            <cdadisplaytext>Single</cdadisplaytext>
+            <cdacode>S</cdacode>
+        </item>
+        <item>
+            <ccrtext>Domestic Partner</ccrtext>
+            <cdadisplaytext>Domestic Partner</cdadisplaytext>
+            <cdacode>T</cdacode>
+        </item>
+        <item>
+            <ccrtext>Widowed</ccrtext>
+            <cdacode>W</cdacode>
+        </item>
+    </domain>
+    <domain name="AdministrativeGender" codeSystemName="HL7 Administrative Gender" codeSystem="2.16.840.1.113883.5.1">
+        <item>
+            <ccrtext>Female</ccrtext>
+            <cdadisplayname>Female</cdadisplayname>
+            <cdacode>F</cdacode>
+        </item>
+        <item>
+            <ccrtext>Male</ccrtext>
+            <cdadisplayname>Male</cdadisplayname>
+            <cdacode>M</cdacode>
+        </item>
+        <item>
+            <ccrtext>Undifferentiated</ccrtext>
+            <cdadisplayname>Undifferentiated</cdadisplayname>
+            <cdacode>UN</cdacode>
+        </item>
+    </domain>    
+    <domain name="RouteOfAdministration" codeSystemName="HL7 Route of Administration" codeSystem="2.16.840.1.113883.5.112">
+        <item>
+            <ccrtext>swallow, oral</ccrtext>
+            <cdacode>PO</cdacode>
+        </item>
+        <item>
+            <ccrtext>by mouth</ccrtext>
+            <cdacode>PO</cdacode>
+        </item>
+        <item>
+            <ccrtext>oral, mouth</ccrtext>
+            <cdacode>PO</cdacode>
+        </item>
+        <item>
+            <ccrtext>chew, oral</ccrtext>
+            <cdacode>CHEW</cdacode>
+        </item>
+        <item>
+            <ccrtext>injection, intravenous</ccrtext>
+            <cdacode>IVINJ</cdacode>
+        </item>
+        <item>
+            <ccrtext>injection, intramuscular</ccrtext>
+            <cdacode>IM</cdacode>
+        </item>
+        <item>
+            <ccrtext>injection, subcutaneous</ccrtext>
+            <cdacode>SQ</cdacode>
+        </item>
+    </domain>
+
+    <domain name="ObservationInterpretation" codeSystemName="HL7 Observation Interpretation" codeSystem="2.16.840.1.113883.5.83">
+        <item>
+            <ccrtext>Normal</ccrtext>
+            <cdacode>N</cdacode>
+        </item>
+        <item>
+            <ccrtext>Abnormal</ccrtext>
+            <cdacode>A</cdacode>
+        </item>
+        <item>
+            <ccrtext>Abnormal High</ccrtext>
+            <cdadescription>High</cdadescription>
+            <cdacode>H</cdacode>
+        </item>
+        <item>
+            <ccrtext>Abnormal Low</ccrtext>
+            <cdadescription>High</cdadescription>
+            <cdacode>L</cdacode>
+        </item>
+    </domain>
+</domains>
Index: /ccr2ccd-xslt/trunk/make/templates/code.xsl
===================================================================
--- /ccr2ccd-xslt/trunk/make/templates/code.xsl	(revision 985)
+++ /ccr2ccd-xslt/trunk/make/templates/code.xsl	(revision 985)
@@ -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/make/templates/datetime.xsl
===================================================================
--- /ccr2ccd-xslt/trunk/make/templates/datetime.xsl	(revision 985)
+++ /ccr2ccd-xslt/trunk/make/templates/datetime.xsl	(revision 985)
@@ -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" exclude-result-prefixes="a date">
+	<!-- 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="a: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/make/templates/defaultCSS.xsl
===================================================================
--- /ccr2ccd-xslt/trunk/make/templates/defaultCSS.xsl	(revision 985)
+++ /ccr2ccd-xslt/trunk/make/templates/defaultCSS.xsl	(revision 985)
@@ -0,0 +1,59 @@
+<?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 name="defaultCCS">
+<style type="text/css">
+*{
+	font-size: x-small;
+	font-family: Arial, sans-serif;
+}
+h1{
+	font-weight: bold;
+    font-size: medium;
+}
+strong.clinical {
+	color: #3300FF;
+}
+p {
+	margin-left: 20px
+}
+span.header{
+	font-weight: bold;
+    font-size: medium;
+    line-height: 16pt;
+	padding-top: 10px;
+}
+table.list {
+	padding-bottom: 5px;
+	border: thin solid #cccccc;
+	border-style-internal: thin solid #cccccc;
+	BORDER-COLLAPSE: collapse;
+	background: white;
+	background-image: none
+}
+table.list th {
+	text-align: left;
+	FONT-WEIGHT: bold;
+	COLOR: white;
+	background: #006699;
+	background-image: none
+}
+table.list td {
+	padding: 5px;
+	border: thin solid #cccccc;
+	vertical-align: top;
+}
+table.internal {
+	border: none;	
+}
+table.internal td {
+	vertical-align: top;
+    padding: 1px;
+    border: none;
+}
+table.internal tr.even{
+	background: #CEFFFF;
+	background-image: none
+}
+</style>
+</xsl:template>
+</xsl:stylesheet>
Index: /ccr2ccd-xslt/trunk/make/templates/directions.xsl
===================================================================
--- /ccr2ccd-xslt/trunk/make/templates/directions.xsl	(revision 985)
+++ /ccr2ccd-xslt/trunk/make/templates/directions.xsl	(revision 985)
@@ -0,0 +1,63 @@
+<?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:Directions">
+		<xsl:for-each select="a:Direction">
+			<xsl:choose>
+				<xsl:when test="position() mod 2=0">
+					<tr class="even">
+						<xsl:choose>
+							<xsl:when test="a:Description/a:Text">
+								<td>
+									<xsl:value-of select="a:Description/a:Text"/>
+								</td>
+							</xsl:when>
+							<xsl:otherwise>
+								<td>
+									<xsl:value-of select="a:Dose/a:Value"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Dose/a:Units/a:Unit"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Route/a:Text"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Frequency/a:Value"/>
+									<xsl:if test="a:Duration"><xsl:text xml:space="preserve"> </xsl:text>(for <xsl:value-of select="a:Duration/a:Value"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Duration/a:Units/a:Unit"/>)
+																								</xsl:if>
+								</td>
+								<xsl:if test="a:MultipleDirectionModifier/a:ObjectAttribute">
+									<td>
+										<xsl:for-each select="a:MultipleDirectionModifier/a:ObjectAttribute">
+											<xsl:value-of select="a:Attribute"/>
+											<br/>
+											<xsl:value-of select="a:AttributeValue/a:Value"/>
+										</xsl:for-each>
+									</td>
+								</xsl:if>
+							</xsl:otherwise>
+						</xsl:choose>
+					</tr>
+				</xsl:when>
+				<xsl:otherwise>
+					<tr class="odd">
+						<xsl:choose>
+							<xsl:when test="a:Description/a:Text">
+								<td>
+									<xsl:value-of select="a:Description/a:Text"/>
+								</td>
+							</xsl:when>
+							<xsl:otherwise>
+								<td>
+									<xsl:value-of select="a:Dose/a:Value"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Dose/a:Units/a:Unit"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Route/a:Text"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Frequency/a:Value"/>
+									<xsl:if test="a:Duration"><xsl:text xml:space="preserve"> </xsl:text>(for <xsl:value-of select="a:Duration/a:Value"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Duration/a:Units/a:Unit"/>)
+																								</xsl:if>
+								</td>
+								<xsl:if test="a:MultipleDirectionModifier/a:ObjectAttribute">
+									<td>
+										<xsl:for-each select="a:MultipleDirectionModifier/a:ObjectAttribute">
+											<xsl:value-of select="a:Attribute"/>
+											<br/>
+											<xsl:value-of select="a:AttributeValue/a:Value"/>
+										</xsl:for-each>
+									</td>
+								</xsl:if>
+							</xsl:otherwise>
+						</xsl:choose>
+					</tr>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:for-each>
+	</xsl:template>
+</xsl:stylesheet>
Index: /ccr2ccd-xslt/trunk/make/templates/footer.xsl
===================================================================
--- /ccr2ccd-xslt/trunk/make/templates/footer.xsl	(revision 985)
+++ /ccr2ccd-xslt/trunk/make/templates/footer.xsl	(revision 985)
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
+	<!-- HTML Footer for CCR.XSL -->
+	<xsl:template name="footer">
+		<br/>
+		<hr/>
+		<table cellspacing="3" bgcolor="#006666">
+			<tbody>
+				<tr>
+					<th>
+						<font size="2" color="#FFFF99">
+	This stylesheet is provided by the American Academy of Family Physicians and the CCR Acceleration Task Force
+</font>
+					</th>
+				</tr>
+				<tr>
+					<td/>
+				</tr>
+				<tr>
+					<td>
+						<font size="3" color="#FFFF99"><strong>Powered by the <a style="color:white;" href="http://www.astm.org/cgi-bin/SoftCart.exe/DATABASE.CART/REDLINE_PAGES/E2369.htm?E+mystore">ASTM E2369-05 Specification for the Continuity of Care Record (CCR)</a> which includes:</strong></font>
+					</td>
+				</tr>
+				<tr>
+					<td>
+				<table cellpadding="2" cellspacing="2" width="100%">
+					<tbody>
+						<tr>
+							<td><font size="2" color="#FFFF99">Advance Directives</font></td>
+							<td><font size="2" color="#FFFF99">Alerts / Allergies</font></td>
+							<td><font size="2" color="#FFFF99">Encounters</font></td>
+							<td><font size="2" color="#FFFF99">Family History</font></td>
+							<td><font size="2" color="#FFFF99">Functional Status</font></td>
+						</tr>
+						<tr>
+							<td><font size="2" color="#FFFF99">Health Care Providers</font></td>
+							<td><font size="2" color="#FFFF99">Immunizations</font></td>
+							<td><font size="2" color="#FFFF99">Insurance</font></td>
+							<td><font size="2" color="#FFFF99">Medical Equipment</font></td>
+							<td><font size="2" color="#FFFF99">Medications</font></td>
+						</tr>
+						<tr>
+							<td><font size="2" color="#FFFF99">Plan Of Care</font></td>
+							<td><font size="2" color="#FFFF99">Problems</font></td>
+							<td><font size="2" color="#FFFF99">Procedures</font></td>
+							<td><font size="2" color="#FFFF99">Results</font></td>
+							<td><font size="2" color="#FFFF99">Social History</font></td>
+						</tr>
+						<tr>
+							<td><font size="2" color="#FFFF99">Support Providers</font></td>
+							<td><font size="2" color="#FFFF99">Vital Signs</font></td>
+						</tr>
+					</tbody>
+				</table>
+			
+					</td>
+				</tr>
+			</tbody>
+		</table>		
+	</xsl:template>
+</xsl:stylesheet>
Index: /ccr2ccd-xslt/trunk/make/templates/hl7oid.xml
===================================================================
--- /ccr2ccd-xslt/trunk/make/templates/hl7oid.xml	(revision 985)
+++ /ccr2ccd-xslt/trunk/make/templates/hl7oid.xml	(revision 985)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<entities>
+    <entity>
+        <name>ICD9-CM</name>
+        <oid>2.16.840.1.113883.6.2</oid>        
+    </entity>
+    <entity>
+        <name>ICD10</name>
+        <oid>2.16.840.1.113883.6.3</oid>
+    </entity>
+    <entity>
+        <name>SNOMED-CT</name>
+        <oid>2.16.840.1.113883.6.96</oid>
+    </entity>
+    <entity>
+        <name>CPT-4</name>
+        <oid>2.16.840.1.113883.6.12</oid>
+    </entity>
+    <entity>
+        <name>LOINC</name>
+        <oid>2.16.840.1.113883.6.1</oid>
+    </entity>    
+    <entity>
+    <name>HL7 Administrative Gender</name>
+    <oid>2.16.840.1.113883.5.1</oid>
+    </entity>
+    <entity>
+    <name>VHA</name>
+    <oid>2.16.840.1.113883.6.233</oid>
+    </entity>   
+</entities>
Index: /ccr2ccd-xslt/trunk/make/templates/hl7oidlookup.xsl
===================================================================
--- /ccr2ccd-xslt/trunk/make/templates/hl7oidlookup.xsl	(revision 985)
+++ /ccr2ccd-xslt/trunk/make/templates/hl7oidlookup.xsl	(revision 985)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
+    <xsl:template name="HL7OIDLookup">
+        <xsl:param name="name"/>
+
+        <xsl:value-of select="document('hl7oid.xml')/entities/entity[name=$name]/oid"/>        
+    </xsl:template>
+    <xsl:template name="HL7CodeSystemNameLookup">
+        <xsl:param name="oid"/>
+
+        <xsl:value-of select="document('hl7oid.xml')/entities/entity[oid=$oid]/name"/>        
+    </xsl:template>
+</xsl:stylesheet>
+
Index: /ccr2ccd-xslt/trunk/make/templates/problemDescription.xsl
===================================================================
--- /ccr2ccd-xslt/trunk/make/templates/problemDescription.xsl	(revision 985)
+++ /ccr2ccd-xslt/trunk/make/templates/problemDescription.xsl	(revision 985)
@@ -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>
