1 <?xml version=
"1.0" encoding=
"UTF-8"?>
3 Conversion of CCR to Level 3 CCD
5 Orginal Author: Ken Miller
7 ken.miller@solventus.coms
10 Richard Braman, EHR Doctors, Inc rbraman@ehrdoctors.com
11 George Lilly (WorldVistA glilly@glilly.net)
12 xxxx - Oroville Hospital
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.
33 <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">
34 <!-- Displays the DateTime. If ExactDateTime is present, it will format according
35 to the 'fmt' variable. The default format is: Oct 31, 2005 -->
36 <xsl:import href=
"../lib/date.format-date.template.xsl"/>
37 <xsl:template name=
"dateTime" match=
"a:DateTime">
38 <xsl:param name=
"dt" select=
"."/>
39 <xsl:param name=
"fmt">MMM dd, yyyy
</xsl:param>
40 <xsl:for-each select=
"$dt">
42 <xsl:if test=
"$dt/a:Type/a:Text">
44 <xsl:value-of select=
"a:Type/a:Text"/>:
48 <xsl:when test=
"a:ExactDateTime">
50 <xsl:call-template name=
"date:format-date">
51 <xsl:with-param name=
"date-time">
52 <xsl:value-of select=
"a:ExactDateTime"/>
54 <xsl:with-param name=
"pattern" select=
"$fmt"/>
58 <xsl:when test=
"$dt/a:Age">
60 <xsl:value-of select=
"$dt/a:Age/a:Value"/>
61 <xsl:text xml:
space=
"preserve"> </xsl:text>
62 <xsl:value-of select=
"$dt/a:Age/a:Units/a:Unit"/>
65 <xsl:when test=
"$dt/a:ApproximateDateTime">
67 <xsl:value-of select=
"$dt/a:ApproximateDateTime/a:Text"/>
70 <xsl:when test=
"$dt/a:DateTimeRange">
72 <xsl:for-each select=
"$dt/a:DateTimeRange/a:BeginRange">
74 <xsl:when test=
"$dt/a:ExactDateTime">
75 <xsl:call-template name=
"date:format-date">
76 <xsl:with-param name=
"date-time">
77 <xsl:value-of select=
"$dt/a:ExactDateTime"/>
79 <xsl:with-param name=
"pattern" select=
"$fmt"/>
82 <xsl:when test=
"$dt/a:Age">
83 <xsl:value-of select=
"$dt/a:Age/a:Value"/>
84 <xsl:text xml:
space=
"preserve"> </xsl:text>
85 <xsl:value-of select=
"$dt/a:Age/a:Units/a:Unit"/>
87 <xsl:when test=
"$dt/a:ApproximateDateTime">
88 <xsl:value-of select=
"$dt/a:ApproximateDateTime/a:Text"/>
92 </xsl:for-each><xsl:text xml:
space=
"preserve"> </xsl:text>
93 -
<xsl:text xml:
space=
"preserve"> </xsl:text>
94 <xsl:for-each select=
"$dt/a:DateTimeRange/a:EndRange">
96 <xsl:when test=
"$dt/a:ExactDateTime">
97 <xsl:call-template name=
"date:format-date">
98 <xsl:with-param name=
"date-time">
99 <xsl:value-of select=
"$dt/a:ExactDateTime"/>
101 <xsl:with-param name=
"pattern" select=
"$fmt"/>
104 <xsl:when test=
"$dt/a:Age">
105 <xsl:value-of select=
"$dt/a:Age/a:Value"/>
106 <xsl:text xml:
space=
"preserve"> </xsl:text>
107 <xsl:value-of select=
"$dt/a:Age/a:Units/a:Unit"/>
109 <xsl:when test=
"$dt/a:ApproximateDateTime">
110 <xsl:value-of select=
"$dt/a:ApproximateDateTime/a:Text"/>