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=
"urn:hl7-org:v3" xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform" xmlns:
a=
"urn:astm-org:CCR" xmlns:
date=
"http://exslt.org/dates-and-times"
34 xmlns:
xsi=
"http://www.w3.org/2001/XMLSchema-instance" exclude-result-prefixes=
"a date">
35 <xsl:import href=
"./templates/cdavocablookup.xsl"/>
36 <xsl:import href=
"./templates/hl7oidlookup.xsl"/>
37 <xsl:import href=
"./templates/code.xsl"/>
38 <xsl:import href=
"./templates/actor.xsl"/>
39 <xsl:import href=
"./templates/datetime.xsl"/>
40 <xsl:import href=
"./templates/problemDescription.xsl"/>
42 <xsl:output method=
"xml" encoding=
"utf-8" version=
"1.0" indent=
"yes"/>
43 <xsl:template match=
"/">
44 <ClinicalDocument xmlns=
"urn:hl7-org:v3" xmlns:
voc=
"urn:hl7-org:v3/voc" xmlns:
sdtc=
"urn:hl7-org:sdtc" xsi:
schemaLocation=
"urn:hl7-org:v3 http://xreg2.nist.gov:8080/hitspValidation/schema/cdar2c32/infrastructure/cda/C32_CDA.xsd" classCode=
"DOCCLIN" moodCode=
"EVN">
45 <realmCode code=
"US"/>
46 <typeId root=
"2.16.840.1.113883.1.3" extension=
"POCD_HD000040"/>
47 <templateId root=
"2.16.840.1.113883.10.20.1"/>
48 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.1.1"/>
49 <templateId root=
"2.16.840.1.113883.10.20.3"/>
50 <templateId root=
"2.16.840.1.113883.3.88.11.32.1"/>
53 <xsl:attribute name=
"root">
54 <xsl:value-of select=
"/a:ContinuityOfCareRecord/a:CCRDocumentObjectID"></xsl:value-of>
57 <code code=
"34133-9" codeSystem=
"2.16.840.1.113883.6.1" codeSystemName=
"LOINC" displayName=
"Summarization of episode note"/>
58 <xsl:variable name=
"fromID" select=
"/a:ContinuityOfCareRecord/a:From/a:ActorLink[1]/a:ActorID"/>
59 <xsl:variable name=
"ccrFromActorObjectID" select=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$fromID]/a:InternalCCRLink[a:LinkRelationship='representedOrganization']/a:LinkID"/>
60 <title>Continuity of Care Document from
<xsl:value-of select=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrFromActorObjectID]/a:Organization/a:Name"/></title>
62 <xsl:attribute name=
"value">
63 <xsl:call-template name=
"date:format-date">
64 <xsl:with-param name=
"date-time" select=
"/a:ContinuityOfCareRecord/a:DateTime/a:ExactDateTime"/>
65 <xsl:with-param name=
"pattern">yyyyMMddhhmmss+
0000</xsl:with-param>
69 <confidentialityCode code=
"N" codeSystem=
"2.16.840.1.113883.5.25"/>
70 <languageCode code=
"en-US"/>
72 <recordTarget typeCode=
"RCT" contextControlCode=
"OP">
74 <xsl:call-template name=
"ccdPatientRole">
75 <xsl:with-param name=
"ccrActorObjectID" select=
"/a:ContinuityOfCareRecord/a:Patient[1]/a:ActorID"/>
82 <xsl:attribute name=
"value">
83 <xsl:call-template name=
"date:format-date">
84 <xsl:with-param name=
"date-time" select=
"/a:ContinuityOfCareRecord/a:DateTime/a:ExactDateTime"/>
85 <xsl:with-param name=
"pattern">yyyyMMddhhmmss
</xsl:with-param>
89 <xsl:call-template name=
"ccdAssignedAuthor">
90 <xsl:with-param name=
"ccrActorObjectID" select=
"$fromID"/>
94 <xsl:if test=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$fromID]/a:InternalCCRLink[a:LinkRelationship='representedOrganization']">
97 <xsl:call-template name=
"ccdOrganization">
98 <xsl:with-param name=
"ccrActorObjectID" select=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$fromID]/a:InternalCCRLink[a:LinkRelationship='representedOrganization']/a:LinkID"/>
99 <xsl:with-param name=
"organizationNodeName" select=
"'representedCustodianOrganization'"/>
106 <serviceEvent classCode=
"PCPR">
109 <xsl:attribute name=
"value">
110 <xsl:call-template name=
"date:format-date">
111 <xsl:with-param name=
"date-time">
112 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body//a:DateTime//a:ExactDateTime">
113 <xsl:sort order=
"ascending"/>
114 <xsl:if test=
"position()=1">
115 <xsl:value-of select=
"."/>
119 <xsl:with-param name=
"pattern">yyyyMMdd
</xsl:with-param>
124 <xsl:attribute name=
"value">
125 <xsl:call-template name=
"date:format-date">
126 <xsl:with-param name=
"date-time">
127 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body//a:DateTime//a:ExactDateTime">
128 <xsl:sort order=
"descending"/>
129 <xsl:if test=
"position()=1">
130 <xsl:value-of select=
"."/>
134 <xsl:with-param name=
"pattern">yyyyMMdd
</xsl:with-param>
141 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:HealthCareProviders/a:Provider">
142 <xsl:call-template name=
"ccdAssignedEntity">
143 <xsl:with-param name=
"ccrActorObjectID" select=
"a:ActorID"/>
153 <templateId root=
"2.16.840.1.113883.10.20.1.13"/>
154 <code code=
"48764-5" codeSystem=
"2.16.840.1.113883.6.1" />
155 <title>Purpose
</title>
157 <xsl:value-of select=
"/a:ContinuityOfCareRecord/a:Purpose/a:Description/a:Text"></xsl:value-of>
161 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:Alerts">
164 <templateId root=
"2.16.840.1.113883.10.20.1.2" />
165 <!--C83 Allergies and Other Adverse Reactions Section Conformance Identifier-->
166 <templateId root=
"2.16.840.1.113883.3.88.11.83.102" />
167 <!--IHE Allergies and Other Adverse Reactions Section Conformance Identifier-->
168 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.3.13" />
169 <code code=
"48765-2" displayName=
"Allergies, adverse reactions, alerts" codeSystem=
"2.16.840.1.113883.6.1" codeSystemName=
"LOINC" />
170 <title>Alerts
</title>
182 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Alerts/a:Alert">
185 <xsl:value-of select=
"a:Type/a:Text"/>
188 <xsl:call-template name=
"date:format-date">
189 <xsl:with-param name=
"date-time" select=
"a:DateTime/a:ExactDateTime"/>
193 <xsl:apply-templates select=
"a:Description/a:Code"/>
196 <xsl:attribute name=
"ID">
197 <xsl:value-of select=
"a:CCRDataObjectID"/>
199 <xsl:value-of select=
"a:Description/a:Text"/>
202 <xsl:value-of select=
"a:Reaction/a:Description/a:Text"/>
203 <xsl:if test=
"a:Reaction/a:Severity/a:Text">
204 -
<xsl:value-of select=
"a:Reaction/a:Severity/a:Text"/>
208 <xsl:call-template name=
"actorName">
209 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
217 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Alerts/a:Alert">
218 <entry typeCode=
"DRIV">
219 <act classCode=
"ACT" moodCode=
"EVN">
220 <!--CCD Problem Act Identifier-->
221 <templateId root=
"2.16.840.1.113883.10.20.1.27"></templateId>
222 <!--C83 Allergy Entry-->
223 <templateId root=
"2.16.840.1.113883.3.88.11.83.6" />
224 <!--IHE Concern Entry Conformance Identifier-->
225 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.5.1"></templateId>
226 <!--IHE Allergy and Intolerance Concerns Entry-->
227 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.5.3"></templateId>
230 <xsl:call-template name=
"ccdID">
231 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
234 <code nullFlavor=
"NA"/>
235 <entryRelationship typeCode=
"SUBJ">
236 <observation classCode=
"OBS" moodCode=
"EVN">
237 <!--CCD Alert Observation-->
238 <templateId root=
"2.16.840.1.113883.10.20.1.18"></templateId>
239 <!--CCD Problem Observation-->
240 <templateId root=
"2.16.840.1.113883.10.20.1.28" />
241 <!--IHE Problem Entry-->
242 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.5" />
243 <!--IHE Allergies and Intolerances Entry-->
244 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.6" />
246 <xsl:call-template name=
"ccdID">
247 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
248 <xsl:with-param name=
"suffix"></xsl:with-param>
251 <code code=
"416098002" codeSystem=
"2.16.840.1.113883.6.96" displayName=
"drug allergy" codeSystemName=
"SNOMED CT"/>
255 <xsl:attribute name=
"value">
256 <xsl:text>#
</xsl:text>
257 <xsl:value-of select=
"a:CCRDataObjectID"/>
262 <statusCode code=
"completed"/>
263 <value xsi:
type=
"CD" />
265 <participant typeCode=
"CSM">
267 <xsl:when test=
"a:Agent/a:Products/a:Product/a:Product">
268 <xsl:call-template name=
"ccdParticipantRoleCodedDescription">
269 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Product/a:Description"/>
276 <xsl:if test=
"a:Reaction">
277 <entryRelationship typeCode=
"MFST" inversionInd=
"true">
278 <observation classCode=
"OBS" moodCode=
"EVN">
279 <templateId root=
"2.16.840.1.113883.10.20.1.54"/>
280 <!--Reaction observation template -->
281 <code code=
"ASSERTION" codeSystem=
"2.16.840.1.113883.5.4"/>
282 <statusCode code=
"completed"/>
283 <xsl:call-template name=
"ccdCodedValue">
284 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Reaction/a:Description"/>
290 <xsl:call-template name=
"ccdStatus">
291 <xsl:with-param name=
"ccrStatus" select=
"a:Status"/>
302 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:AdvanceDirectives">
305 <templateId root=
"2.16.840.1.113883.10.20.1.1" assigningAuthorityName=
"HL7 CCD"/>
306 <templateId root=
"2.16.840.1.113883.3.88.11.83.116" assigningAuthorityName=
"HITSP/C83"/>
307 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.3.35" assigningAuthorityName=
"IHE PCC"/>
308 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.3.34" assigningAuthorityName=
"IHE PCC"/>
309 <!--Advance Directives section template-->
310 <code code=
"42348-3" codeSystem=
"2.16.840.1.113883.6.1" codeSystemName=
"LOINC" displayName=
"Advance directives"/>
311 <title>Advance Directives
</title>
322 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:AdvanceDirectives/a:AdvanceDirective">
324 <xsl:attribute name=
"id">
325 <xsl:value-of select=
"a:CCRDataObjectID"/>
328 <xsl:value-of select=
"a:Type/a:Text"/>
331 <xsl:call-template name=
"date:format-date">
332 <xsl:with-param name=
"date-time" select=
"a:DateTime/a:ExactDateTime"/>
336 <xsl:attribute name=
"id">
337 <xsl:value-of select=
"a:CCRDataObjectID"/>
338 <xsl:text>:Narrative
</xsl:text>
341 <xsl:value-of select=
"a:Description/a:Text"/>
344 <xsl:value-of select=
"a:Status/a:Text"/>
347 <xsl:call-template name=
"actorName">
348 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
356 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:AdvanceDirectives/a:AdvanceDirective">
357 <entry typeCode=
"DRIV">
358 <observation classCode=
"OBS" moodCode=
"EVN">
359 <templateId root=
"2.16.840.1.113883.3.88.11.83.12" assigningAuthorityName=
"HITSP C83"/>
360 <templateId root=
"2.16.840.1.113883.10.20.1.17" assigningAuthorityName=
"CCD"/>
361 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.13" assigningAuthorityName=
"IHE PCC"/>
362 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.13.7" assigningAuthorityName=
"IHE PCC"/>
363 <!-- Advance directive observation template -->
366 <xsl:call-template name=
"ccdID">
367 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
372 <xsl:attribute name=
"value">
373 <xsl:text>#
</xsl:text>
374 <xsl:value-of select=
"a:CCRDataObjectID"/>
379 <statusCode code=
"completed"/>
381 <xsl:call-template name=
"ccdDateTime">
382 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
385 <xsl:call-template name=
"ccdCodedValue">
386 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Description"/>
387 <xsl:with-param name=
"originalTextReference">
388 <xsl:text>#
</xsl:text>
389 <xsl:value-of select=
"a:CCRDataObjectID"/>
390 <xsl:text>:Narrative
</xsl:text>
394 <participant typeCode=
"VRF">
395 <templateId root=
"2.16.840.1.113883.10.20.1.58"/>
396 <!--Verification of an advance directive observation template -->
397 <time nullFlavor=
"UNK"/>
398 <xsl:call-template name=
"ccdParticipantRoleActor">
399 <xsl:with-param name=
"ccrActorObjectID" select=
"a:Source[1]/a:ActorID"/>
403 <xsl:if test=
"a:ReferenceID">
404 <reference typeCode=
"REFR">
406 <templateId root=
"2.16.840.1.113883.10.20.1.36"/>
407 <!-- Advance directive reference template -->
408 <xsl:variable name=
"referenceID" select=
"a:ReferenceID"/>
410 <xsl:call-template name=
"ccdID">
411 <xsl:with-param name=
"ccrObjectID" select=
"$referenceID"/>
413 <code code=
"371538006" codeSystem=
"2.16.840.1.113883.6.96" displayName=
"Advance directive"/>
414 <xsl:variable name=
"reference" select=
"/a:ContinuityOfCareRecord/a:References/a:Reference[a:ReferenceObjectID=$referenceID]"/>
416 <xsl:attribute name=
"mediaType">
417 <xsl:value-of select=
"$reference/a:Type/a:Text"/>
420 <xsl:value-of select=
"$reference/a:Location[1]/a:Description/a:Text"/>
433 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:FunctionalStatus">
436 <templateId root=
"2.16.840.1.113883.10.20.1.5"/>
437 <code code=
"47420-5" codeSystem=
"2.16.840.1.113883.6.1"/>
438 <title>Functional Status
</title>
452 <xsl:value-of select=
"a:Type/a:Text"/>
455 <xsl:call-template name=
"date:format-date">
456 <xsl:with-param name=
"date-time" select=
"a:DateTime/a:ExactDateTime"/>
460 <xsl:apply-templates select=
"a:Description/a:Code"/>
463 <xsl:value-of select=
"a:Description/a:Text"/>
466 <xsl:value-of select=
"a:Status/a:Text"/>
469 <xsl:call-template name=
"actorName">
470 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
480 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:Problems">
483 <templateId root=
"2.16.840.1.113883.3.88.11.83.103" assigningAuthorityName=
"HITSP/C83"/>
484 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.3.6" assigningAuthorityName=
"IHE PCC"/>
485 <templateId root=
"2.16.840.1.113883.10.20.1.11" assigningAuthorityName=
"HL7 CCD"/>
486 <code code=
"11450-4" codeSystem=
"2.16.840.1.113883.6.1" codeSystemName=
"LOINC" displayName=
"Problem list"/>
487 <title>Problems
</title>
499 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Problems/a:Problem">
502 <xsl:value-of select=
"a:Type/a:Text"/>
507 <xsl:apply-templates select=
"a:DateTime"/>
512 <xsl:apply-templates select=
"a:Description/a:Code"/>
515 <xsl:attribute name=
"ID">
516 <xsl:value-of select=
"a:CCRDataObjectID"></xsl:value-of>
518 <xsl:value-of select=
"a:Description/a:Text"/>
521 <xsl:value-of select=
"a:Status/a:Text"/>
524 <xsl:call-template name=
"actorName">
525 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
533 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Problems/a:Problem">
534 <entry typeCode=
"DRIV">
535 <act classCode=
"ACT" moodCode=
"EVN">
536 <templateId root=
"2.16.840.1.113883.10.20.1.27"/>
537 <!-- Problem act template -->
540 <xsl:call-template name=
"ccdID">
541 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
544 <code nullFlavor=
"NA"/>
546 <xsl:call-template name=
"ccdPerformer">
547 <xsl:with-param name=
"ccrActorReference" select=
"a:Source/a:Actor"/>
550 <entryRelationship typeCode=
"SUBJ">
551 <observation classCode=
"OBS" moodCode=
"EVN">
552 <templateId root=
"2.16.840.1.113883.10.20.1.28" assigningAuthorityName=
"CCD"/>
553 <!--Problem observation template-->
556 <xsl:call-template name=
"ccdID">
557 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
558 <xsl:with-param name=
"suffix"></xsl:with-param>
561 <code code=
"55607006" displayName=
"Problem" codeSystem=
"2.16.840.1.113883.6.96" codeSystemName=
"SNOMED-CT"/>
565 <xsl:attribute name=
"value">
566 <xsl:text>#
</xsl:text>
567 <xsl:value-of select=
"a:CCRDataObjectID"/>
572 <statusCode code=
"completed"/>
574 <xsl:call-template name=
"ccdDateTime">
575 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
578 <xsl:call-template name=
"ccdCodedValue">
579 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Description"/>
582 <xsl:call-template name=
"ccdStatus">
583 <xsl:with-param name=
"ccrStatus" select=
"a:Status"/>
594 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:Procedures">
597 <templateId root=
"2.16.840.1.113883.10.20.1.12"/>
598 <code code=
"47519-4" codeSystem=
"2.16.840.1.113883.6.1"/>
599 <title>Procedures
</title>
616 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
618 <xsl:attribute name=
"id">
619 <xsl:value-of select=
"a:CCRDataObjectID"/>
623 <xsl:value-of select=
"a:Type/a:Text"/>
627 <xsl:apply-templates select=
"a:DateTime"/>
631 <xsl:apply-templates select=
"a:Description/a:Code"/>
634 <xsl:value-of select=
"a:Description/a:Text"/>
637 <xsl:for-each select=
"a:Locations/a:Location">
638 <xsl:value-of select=
"a:Description/a:Text"/>
639 <xsl:if test=
"a:Actor">
640 (
<xsl:call-template name=
"actorName">
641 <xsl:with-param name=
"objID" select=
"a:Actor/a:ActorID"/>
643 <xsl:if test=
"a:Actor/a:ActorRole/a:Text">
644 <xsl:text xml:
space=
"preserve"> -
</xsl:text><xsl:value-of select=
"a:ActorRole/a:Text"/>)
647 <xsl:if test=
"position() != last()">
653 <xsl:for-each select=
"a:Substance">
654 <xsl:value-of select=
"a:Text"/>
658 <xsl:value-of select=
"a:Method/a:Text"/>
661 <xsl:value-of select=
"a:Position/a:Text"/>
664 <xsl:value-of select=
"a:Site/a:Text"/>
667 <xsl:value-of select=
"a:Status/a:Text"/>
670 <xsl:call-template name=
"actorName">
671 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
680 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
681 <entry typeCode=
"DRIV">
682 <procedure classCode=
"PROC" moodCode=
"EVN">
683 <templateId root=
"2.16.840.1.113883.3.88.11.83.17" assigningAuthorityName=
"HITSP C83"/>
684 <templateId root=
"2.16.840.1.113883.10.20.1.29" assigningAuthorityName=
"CCD"/>
685 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.19" assigningAuthorityName=
"IHE PCC"/>
688 <xsl:call-template name=
"ccdID">
689 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
693 <xsl:call-template name=
"ccdCodedValue">
694 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Description"/>
695 <xsl:with-param name=
"nodeName" select=
"'code'"/>
700 <xsl:attribute name=
"value">
701 <xsl:text>#
</xsl:text>
702 <xsl:value-of select=
"a:CCRDataObjectID"/>
707 <xsl:call-template name=
"ccdStatusProcedure">
708 <xsl:with-param name=
"status" select=
"a:Status"/>
711 <xsl:call-template name=
"ccdDateTime">
712 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
715 <xsl:if test=
"a:Method">
716 <xsl:call-template name=
"ccdCodedValue">
717 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Method"/>
718 <xsl:with-param name=
"nodeName" select=
"'approachSiteCode'"/>
722 <xsl:if test=
"a:Site">
723 <xsl:call-template name=
"ccdCodedValue">
724 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Site"/>
725 <xsl:with-param name=
"nodeName" select=
"'targetSiteCode'"/>
729 <xsl:if test=
"a:Practitioners/a:Practitioner">
730 <xsl:call-template name=
"ccdPerformer">
731 <xsl:with-param name=
"ccrActorReference" select=
"a:Practitioners/a:Practitioner[1]"/>
740 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:Medications">
743 <templateId root=
"2.16.840.1.113883.3.88.11.83.112" assigningAuthorityName=
"HITSP/C83"/>
744 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.3.19" assigningAuthorityName=
"IHE PCC"/>
745 <templateId root=
"2.16.840.1.113883.10.20.1.8" assigningAuthorityName=
"HL7 CCD"/>
746 <!--Medications section template-->
747 <code code=
"10160-0" codeSystem=
"2.16.840.1.113883.6.1" codeSystemName=
"LOINC" displayName=
"History of medication use"/>
748 <title>Medications
</title>
765 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Medications/a:Medication">
768 <xsl:value-of select=
"a:Product/a:ProductName/a:Text"/>
769 <xsl:if test=
"a:Product/a:BrandName">
770 <xsl:text xml:
space=
"preserve"> </xsl:text>(
<xsl:value-of select=
"a:Product/a:BrandName/a:Text"/>)
774 <xsl:call-template name=
"date:format-date">
775 <xsl:with-param name=
"date-time" select=
"a:DateTime/a:ExactDateTime"/>
779 <xsl:value-of select=
"a:Status/a:Text"/>
782 <xsl:value-of select=
"a:Product/a:Form/a:Text"/>
785 <xsl:for-each select=
"a:Product/a:Strength">
786 <xsl:if test=
"position() > 1">
787 <xsl:text>/
</xsl:text>
789 <xsl:value-of select=
"a:Value"/>
790 <xsl:text xml:
space=
"preserve"> </xsl:text>
791 <xsl:value-of select=
"a:Units/a:Unit"/>
795 <xsl:value-of select=
"a:Quantity/a:Value"/>
796 <xsl:text xml:
space=
"preserve"> </xsl:text>
797 <xsl:value-of select=
"a:Quantity/a:Units/a:Unit"/>
800 <xsl:for-each select=
"a:Directions/a:Direction">
802 <xsl:when test=
"a:Description/a:Text">
803 <xsl:value-of select=
"a:Description/a:Text"/>
806 <xsl:value-of select=
"a:Dose/a:Value"/>
807 <xsl:text xml:
space=
"preserve"> </xsl:text>
808 <xsl:value-of select=
"a:Dose/a:Units/a:Unit"/>
809 <xsl:text xml:
space=
"preserve"> </xsl:text>
810 <xsl:value-of select=
"a:Route/a:Text"/>
811 <xsl:text xml:
space=
"preserve"> </xsl:text>
812 <xsl:value-of select=
"a:Frequency/a:Value"/>
813 <xsl:if test=
"a:Duration">
814 <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:text xml:
space=
"preserve"> )
</xsl:text>
816 <xsl:if test=
"a:MultipleDirectionModifier/a:ObjectAttribute">
817 <xsl:for-each select=
"a:MultipleDirectionModifier/a:ObjectAttribute">
818 <xsl:value-of select=
"a:Attribute"/>
820 <xsl:value-of select=
"a:AttributeValue/a:Value"/>
828 <xsl:for-each select=
"a:Directions/a:Direction[1]/a:Indication">
829 <xsl:call-template name=
"problemDescription">
830 <xsl:with-param name=
"objID" select=
"a:InternalCCRLink/a:LinkID"/>
836 <xsl:for-each select=
"a:PatientInstructions/a:Instruction">
837 <xsl:value-of select=
"a:Text"/>
842 <xsl:for-each select=
"a:Refills/a:Refill">
843 <xsl:value-of select=
"a:Number"/>
844 <xsl:text xml:
space=
"preserve"> </xsl:text>
848 <xsl:call-template name=
"actorName">
849 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
857 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Medications/a:Medication">
858 <entry typeCode=
"DRIV">
859 <substanceAdministration classCode=
"SBADM" moodCode=
"EVN">
860 <templateId root=
"2.16.840.1.113883.10.20.1.24" assigningAuthorityName=
"CCD"/>
861 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.7.1" assigningAuthorityName=
"IHE PCC"/>
863 <!--Medication activity template -->
866 <xsl:call-template name=
"ccdID">
867 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
870 <statusCode code='completed'
/>
872 <xsl:call-template name=
"ccdDateTime">
873 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
874 <xsl:with-param name=
"type" select=
"'IVL_TS'"/>
877 <xsl:call-template name=
"ccdMedicationFrequency">
878 <xsl:with-param name=
"frequency" select=
"a:Directions/a:Direction/a:Frequency"/>
881 <xsl:call-template name=
"ccdCodedValue">
882 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Directions/a:Direction/a:Route"/>
883 <xsl:with-param name=
"nodeName" select=
"'routeCode'"/>
884 <xsl:with-param name=
"domain" select=
"'RouteOfAdministration'"/>
887 <xsl:if test=
"a:Directions/a:Direction/a:Dose">
890 <xsl:attribute name=
"value">
891 <xsl:value-of select=
"a:Directions/a:Direction/a:Dose/a:Value"></xsl:value-of>
893 <xsl:attribute name=
"unit">
894 <xsl:value-of select=
"a:Directions/a:Direction/a:Dose/a:Unit"></xsl:value-of>
898 <xsl:attribute name=
"value">
899 <xsl:value-of select=
"a:Directions/a:Direction/a:Dose/a:Value"></xsl:value-of>
901 <xsl:attribute name=
"unit">
902 <xsl:value-of select=
"a:Directions/a:Direction/a:Dose/a:Unit"></xsl:value-of>
908 <manufacturedProduct>
909 <templateId root=
"2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName=
"HITSP C83"/>
910 <templateId root=
"2.16.840.1.113883.10.20.1.53" assigningAuthorityName=
"CCD"/>
911 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName=
"IHE PCC"/>
913 <!-- Product template -->
915 <manufacturedMaterial>
916 <xsl:call-template name=
"ccdCodedValue">
917 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Product/a:ProductName"/>
918 <xsl:with-param name=
"nodeName" select=
"'code'"/>
921 <xsl:value-of select=
"a:Product/a:BrandName/a:Text"/>
923 </manufacturedMaterial>
924 </manufacturedProduct>
926 </substanceAdministration>
932 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:Immunizations">
935 <templateId root=
"2.16.840.1.113883.10.20.1.6"/>
936 <code code=
"11369-6" codeSystem=
"2.16.840.1.113883.6.1"/>
937 <title>Immunizations
</title>
949 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Immunizations/a:Immunization">
951 <xsl:attribute name=
"id">
952 <xsl:value-of select=
"a:CCRDataObjectID"/>
955 <xsl:apply-templates select=
"a:Product/a:ProductName/a:Code"/>
959 <xsl:value-of select=
"a:Product/a:ProductName/a:Text"/>
960 <xsl:if test=
"a:Product/a:Form">
961 <xsl:text xml:
space=
"preserve"> </xsl:text>(
<xsl:value-of select=
"a:Product/a:Form/a:Text"/>)
965 <xsl:call-template name=
"date:format-date">
966 <xsl:with-param name=
"date-time" select=
"a:DateTime/a:ExactDateTime"/>
970 <xsl:value-of select=
"a:Directions/a:Direction/a:Route/a:Text"/>
973 <xsl:attribute name=
"id">
974 <xsl:value-of select=
"a:CCRDataObjectID"/>
975 <xsl:text>:Site
</xsl:text>
978 <xsl:value-of select=
"a:Directions/a:Direction/a:Site/a:Text"/>
981 <xsl:call-template name=
"actorName">
982 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
990 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Immunizations/a:Immunization">
991 <entry typeCode=
"DRIV">
992 <substanceAdministration classCode=
"SBADM" moodCode=
"EVN">
993 <templateId root=
"2.16.840.1.113883.10.20.1.24" assigningAuthorityName=
"CCD"/>
994 <templateId root=
"2.16.840.1.113883.3.88.11.83.13" assigningAuthorityName=
"HITSP C83"/>
995 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.12" assigningAuthorityName=
"IHE PCC"/>
997 <!-- Medication activity template -->
1000 <xsl:call-template name=
"ccdID">
1001 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1002 </xsl:call-template>
1004 <code code=
"IMMUNIZ" codeSystem=
"2.16.840.1.113883.5.4" codeSystemName=
"HL7 ActCode"/>
1007 <xsl:attribute name=
"value">
1008 <xsl:text>#
</xsl:text>
1009 <xsl:value-of select=
"a:CCRDataObjectID"/>
1014 <statusCode code='completed'
/>
1016 <xsl:call-template name=
"ccdDateTime">
1017 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
1018 <xsl:with-param name=
"type" select=
"'IVL_TS'"/>
1019 </xsl:call-template>
1021 <xsl:call-template name=
"ccdCodedValue">
1022 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Directions/a:Direction/a:Route"/>
1023 <xsl:with-param name=
"nodeName" select=
"'routeCode'"/>
1024 <xsl:with-param name=
"domain" select=
"'RouteOfAdministration'"/>
1025 </xsl:call-template>
1027 <xsl:if test=
"a:Directions/a:Direction/a:Site">
1028 <xsl:call-template name=
"ccdCodedValue">
1029 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Directions/a:Direction/a:Site"/>
1030 <xsl:with-param name=
"nodeName" select=
"'approachSiteCode'"/>
1031 <xsl:with-param name=
"originalTextReference">
1032 <xsl:text>#
</xsl:text>
1033 <xsl:value-of select=
"a:CCRDataObjectID"/>
1034 <xsl:text>:Site
</xsl:text>
1036 </xsl:call-template>
1040 <manufacturedProduct>
1041 <templateId root=
"2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName=
"HITSP C83"/>
1042 <templateId root=
"2.16.840.1.113883.10.20.1.53" assigningAuthorityName=
"CCD"/>
1043 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName=
"IHE PCC"/>
1045 <!-- Product template -->
1047 <manufacturedMaterial>
1048 <xsl:call-template name=
"ccdCodedValue">
1049 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Product/a:ProductName"/>
1050 <xsl:with-param name=
"nodeName" select=
"'code'"/>
1051 </xsl:call-template>
1053 <xsl:value-of select=
"a:Product/a:BrandName/a:Text"/>
1055 </manufacturedMaterial>
1056 </manufacturedProduct>
1059 </substanceAdministration>
1065 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:VitalSigns">
1068 <templateId root=
"2.16.840.1.113883.10.20.1.16"/>
1069 <code code=
"8716-3" codeSystem=
"2.16.840.1.113883.6.1"/>
1070 <title>Vital Signs
</title>
1080 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:VitalSigns/a:Result">
1082 <xsl:attribute name=
"id">
1083 <xsl:value-of select=
"a:CCRDataObjectID"/>
1087 <xsl:value-of select=
"a:Description/a:Text"/>
1090 <xsl:call-template name=
"date:format-date">
1091 <xsl:with-param name=
"date-time" select=
"a:DateTime/a:ExactDateTime"/>
1092 </xsl:call-template>
1095 <xsl:for-each select=
"a:Test">
1096 <xsl:value-of select=
"a:Description/a:Text"/>
1097 <xsl:text xml:
space=
"preserve"> </xsl:text>
1098 <xsl:value-of select=
"a:TestResult/a:Value"/>
1099 <xsl:text xml:
space=
"preserve"> </xsl:text>
1100 <xsl:value-of select=
"a:TestResult/a:Units/a:Unit"/>
1101 <xsl:text xml:
space=
"preserve"> </xsl:text>
1102 <xsl:value-of select=
"a:Flag/a:Text"/>
1107 <xsl:call-template name=
"actorName">
1108 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
1109 </xsl:call-template>
1116 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:VitalSigns/a:Result">
1117 <entry typeCode=
"DRIV">
1118 <organizer classCode=
"CLUSTER" moodCode=
"EVN">
1119 <templateId root=
"2.16.840.1.113883.10.20.1.32" assigningAuthorityName=
"CCD"/>
1120 <templateId root=
"2.16.840.1.113883.10.20.1.35" assigningAuthorityName=
"CCD"/>
1121 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.13.1" assigningAuthorityName=
"IHE PCC"/>
1122 <!-- Vital signs organizer template -->
1124 <xsl:variable name=
"testDate" select=
"a:DateTime"/>
1127 <xsl:call-template name=
"ccdID">
1128 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1129 </xsl:call-template>
1131 <code code=
"46680005" codeSystem=
"2.16.840.1.113883.6.96" displayName=
"Vital signs" codeSystemName=
"SNOMED CT"/>
1132 <statusCode code=
"completed"/>
1133 <xsl:call-template name=
"ccdDateTime">
1134 <xsl:with-param name=
"dt" select=
"$testDate"/>
1135 </xsl:call-template>
1137 <xsl:call-template name=
"ccdObservation">
1138 <xsl:with-param name=
"ccrTestNode" select=
"a:Test[1]"/>
1139 <xsl:with-param name=
"testDate" select=
"$testDate"/>
1140 </xsl:call-template>
1148 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:Encounters">
1151 <templateId root=
"2.16.840.1.113883.3.88.11.83.127" assigningAuthorityName=
"HITSP/C83"/>
1152 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.1.5.3.3" assigningAuthorityName=
"IHE PCC"/>
1153 <templateId root=
"2.16.840.1.113883.10.20.1.3" assigningAuthorityName=
"HL7 CCD"/>
1154 <!--Encounters section template-->
1155 <code code=
"46240-8" codeSystem=
"2.16.840.1.113883.6.1" codeSystemName=
"LOINC" displayName=
"History of encounters"/>
1156 <title>Encounters
</title>
1165 <th>Practitioner
</th>
1166 <th>Description
</th>
1167 <th>Indications
</th>
1170 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Encounters/a:Encounter">
1172 <xsl:attribute name=
"id">
1173 <xsl:value-of select=
"a:CCRDataObjectID"/>
1177 <xsl:value-of select=
"a:Type/a:Text"/>
1180 <xsl:call-template name=
"date:format-date">
1181 <xsl:with-param name=
"date-time" select=
"a:DateTime/a:ExactDateTime"/>
1182 </xsl:call-template>
1185 <xsl:for-each select=
"a:Locations/a:Location">
1186 <xsl:value-of select=
"a:Description/a:Text"/>
1187 <xsl:call-template name=
"actorName">
1188 <xsl:with-param name=
"objID" select=
"a:Actor/a:ActorID"/>
1189 </xsl:call-template>
1194 <xsl:value-of select=
"a:Status/a:Text"/>
1197 <xsl:for-each select=
"a:Practitioners/a:Practitioner">
1198 <xsl:call-template name=
"actorName">
1199 <xsl:with-param name=
"objID" select=
"a:ActorID"/>
1200 </xsl:call-template>
1205 <xsl:value-of select=
"a:Description/a:Text"/>
1208 <xsl:for-each select=
"a:Indications/a:Indication">
1209 <xsl:call-template name=
"problemDescription">
1210 <xsl:with-param name=
"objID" select=
"a:InternalCCRLink/a:LinkID"/>
1211 </xsl:call-template>
1216 <xsl:call-template name=
"actorName">
1217 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
1218 </xsl:call-template>
1225 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Encounters/a:Encounter">
1226 <entry typeCode=
"DRIV">
1227 <encounter classCode=
"ENC" moodCode=
"EVN">
1228 <templateId root=
"2.16.840.1.113883.3.88.11.83.16" assigningAuthorityName=
"HITSP C83"/>
1229 <templateId root=
"2.16.840.1.113883.10.20.1.21" assigningAuthorityName=
"CCD"/>
1230 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.14" assigningAuthorityName=
"IHE PCC"/>
1232 <!-- Encounter activity template -->
1235 <xsl:call-template name=
"ccdID">
1236 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1237 </xsl:call-template>
1239 <xsl:call-template name=
"ccdCodedValue">
1240 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Description"/>
1241 <xsl:with-param name=
"nodeName" select=
"'code'"/>
1242 </xsl:call-template>
1246 <xsl:attribute name=
"value">
1247 <xsl:text>#
</xsl:text>
1248 <xsl:value-of select=
"a:CCRDataObjectID"/>
1253 <xsl:call-template name=
"ccdDateTime">
1254 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
1255 </xsl:call-template>
1257 <xsl:if test=
"a:Practitioners[1]/a:Practitioner">
1258 <xsl:call-template name=
"ccdPerformer">
1259 <xsl:with-param name=
"ccrActorReference" select=
"a:Practitioners/a:Practitioner[1]"/>
1260 </xsl:call-template>
1263 <xsl:if test=
"a:Locations[1]/a:Location">
1264 <participant typeCode=
"LOC">
1265 <templateId root=
"2.16.840.1.113883.10.20.1.45"/>
1266 <!-- Location participation template -->
1268 <xsl:when test=
"a:Locations[1]/a:Location/a:ActorID">
1269 <xsl:call-template name=
"ccdParticipantRoleActor">
1270 <xsl:with-param name=
"ccrActorObjectID" select=
"a:Locations[1]/a:Location/a:ActorID"/>
1271 </xsl:call-template>
1274 <xsl:call-template name=
"ccdParticipantRoleCodedDescription">
1275 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Locations[1]/a:Location/a:Description"/>
1276 </xsl:call-template>
1287 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:SocialHistory">
1290 <templateId root=
"2.16.840.1.113883.10.20.1.15"/>
1291 <code code=
"29762-2" codeSystem=
"2.16.840.1.113883.6.1"/>
1292 <title>Social History
</title>
1300 <th>Description
</th>
1304 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement">
1307 <xsl:value-of select=
"a:Type/a:Text"/>
1310 <xsl:call-template name=
"date:format-date">
1311 <xsl:with-param name=
"date-time" select=
"a:DateTime/a:ExactDateTime"/>
1312 </xsl:call-template>
1315 <xsl:apply-templates select=
"a:Description/a:Code"/>
1318 <xsl:value-of select=
"a:Description/a:Text" disable-output-escaping=
"yes"/>
1321 <xsl:value-of select=
"a:Status/a:Text"/>
1324 <xsl:call-template name=
"actorName">
1325 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
1326 </xsl:call-template>
1333 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement">
1334 <entry typeCode=
"DRIV">
1335 <observation classCode=
"OBS" moodCode=
"EVN">
1336 <templateId root=
"2.16.840.1.113883.3.88.11.83.19" assigningAuthorityName=
"HITSP C83"/>
1337 <templateId root=
"2.16.840.1.113883.10.20.1.33" assigningAuthorityName=
"CCD"/>
1338 <!-- Social history observation template -->
1340 <xsl:call-template name=
"ccdID">
1341 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1342 </xsl:call-template>
1343 <statusCode code=
"completed"/>
1344 <xsl:call-template name=
"ccdDateTime">
1345 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
1346 </xsl:call-template>
1347 <entryRelationship typeCode=
"SUBJ" inversionInd=
"true">
1348 <observation classCode=
"OBS" moodCode=
"EVN">
1349 <templateId root=
"2.16.840.1.113883.10.20.1.41"/>
1350 <!-- Episode observation template -->
1351 <statusCode code=
"completed"/>
1352 <entryRelationship typeCode=
"SAS">
1353 <observation classCode=
"OBS" moodCode=
"EVN">
1354 <xsl:call-template name=
"ccdCodedValue">
1355 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Description"/>
1356 <xsl:with-param name=
"nodeName" select=
"'code'"/>
1357 </xsl:call-template>
1359 </entryRelationship>
1361 </entryRelationship>
1368 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:FamilyHistory">
1371 <templateId root=
"2.16.840.1.113883.10.20.1.4"/>
1372 <code code=
"10157-6" codeSystem=
"2.16.840.1.113883.6.1"/>
1373 <title>Family History
</title>
1381 <th>Description
</th>
1382 <th>Relationship(s)
</th>
1386 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:FamilyHistory/a:FamilyProblemHistory">
1389 <xsl:value-of select=
"a:Type/a:Text"/>
1392 <xsl:call-template name=
"date:format-date">
1393 <xsl:with-param name=
"date-time" select=
"a:DateTime/a:ExactDateTime"/>
1394 </xsl:call-template>
1397 <xsl:apply-templates select=
"a:Problem/a:Description/a:Code"/>
1400 <xsl:for-each select=
"a:Problem">
1401 <xsl:value-of select=
"a:Description/a:Text"/>
1406 <xsl:value-of select=
"a:FamilyMember/a:ActorRole/a:Text"/>
1409 <xsl:value-of select=
"a:Status/a:Text"/>
1412 <xsl:call-template name=
"actorName">
1413 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
1414 </xsl:call-template>
1424 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:Results/a:Result">
1427 <templateId root=
"2.16.840.1.113883.10.20.1.14"/>
1428 <code code=
"30954-2" codeSystem=
"2.16.840.1.113883.6.1"/>
1429 <title>Results
</title>
1439 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Results/a:Result">
1441 <xsl:attribute name=
"id">
1442 <xsl:value-of select=
"a:CCRDataObjectID"/>
1445 <xsl:value-of select=
"a:Description/a:Text"/>
1448 <xsl:call-template name=
"date:format-date">
1449 <xsl:with-param name=
"date-time" select=
"a:DateTime/a:ExactDateTime"/>
1450 </xsl:call-template>
1453 <xsl:for-each select=
"a:Test[a:TestResult/a:Value!='']">
1455 <xsl:attribute name=
"id">
1456 <xsl:value-of select=
"a:CCRDataObjectID"/>
1459 <xsl:value-of select=
"a:Description/a:Text"/>
1460 <xsl:text xml:
space=
"preserve"> </xsl:text>
1461 <xsl:value-of select=
"a:TestResult/a:Value"/>
1462 <xsl:text xml:
space=
"preserve"> </xsl:text>
1463 <xsl:value-of select=
"a:TestResult/a:Units/a:Unit"/>
1464 <xsl:text xml:
space=
"preserve"> </xsl:text>
1465 <xsl:value-of select=
"a:Flag/a:Text"/>
1469 <xsl:for-each select=
"a:Test[a:TestResult/a:Description/a:Text!='']">
1471 <xsl:attribute name=
"id">
1472 <xsl:value-of select=
"a:CCRDataObjectID"/>
1475 <xsl:value-of select=
"a:Description/a:Text"/>
1476 <xsl:text xml:
space=
"preserve"> </xsl:text>
1477 <xsl:value-of select=
"a:TestResult/a:Description/a:Text" disable-output-escaping=
"yes"/>
1478 <xsl:text xml:
space=
"preserve"> </xsl:text>
1479 <xsl:value-of select=
"a:Flag/a:Text"/>
1485 <xsl:call-template name=
"actorName">
1486 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
1487 </xsl:call-template>
1494 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Results/a:Result">
1495 <entry typeCode=
"DRIV">
1496 <xsl:variable name=
"testDate" select=
"a:DateTime"/>
1499 <xsl:when test=
"count(a:Test)>1">
1500 <organizer classCode=
"BATTERY" moodCode=
"EVN">
1501 <templateId root=
"2.16.840.1.113883.10.20.1.32"/>
1502 <!--Result organizer template -->
1505 <xsl:call-template name=
"ccdID">
1506 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1507 </xsl:call-template>
1510 <xsl:call-template name=
"ccdCodedValue">
1511 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Description"/>
1512 <xsl:with-param name=
"nodeName" select=
"'code'"/>
1513 </xsl:call-template>
1515 <statusCode code=
"completed"/>
1517 <!-- <effectiveTime> -->
1518 <xsl:call-template name=
"ccdDateTime">
1519 <xsl:with-param name=
"dt" select=
"$testDate"/>
1520 </xsl:call-template>
1522 <xsl:call-template name=
"ccdPerformer">
1523 <xsl:with-param name=
"ccrActorReference" select=
"a:Source/a:Actor"/>
1524 </xsl:call-template>
1526 <xsl:for-each select=
"a:Test">
1527 <xsl:call-template name=
"ccdObservation">
1528 <xsl:with-param name=
"ccrTestNode" select=
"."/>
1529 <xsl:with-param name=
"testDate" select=
"$testDate"/>
1530 </xsl:call-template>
1537 <xsl:call-template name=
"ccdObservation">
1538 <xsl:with-param name=
"ccrTestNode" select=
"a:Test[1]"/>
1539 <xsl:with-param name=
"testDate" select=
"$testDate"/>
1540 </xsl:call-template>
1548 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:Payers">
1551 <templateId root=
"2.16.840.1.113883.10.20.1.9"/>
1552 <code code=
"48768-6" codeSystem=
"2.16.840.1.113883.6.1"/>
1553 <title>Insurance
</title>
1560 <th>Identification Numbers
</th>
1561 <th>Payment Provider
</th>
1565 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Payers/a:Payer">
1568 <xsl:value-of select=
"a:Type/a:Text"/>
1571 <xsl:call-template name=
"date:format-date">
1572 <xsl:with-param name=
"date-time" select=
"a:DateTime/a:ExactDateTime"/>
1573 </xsl:call-template>
1576 <xsl:for-each select=
"a:IDs">
1577 <xsl:value-of select=
"a:Type/a:Text"/>:
<xsl:text xml:
space=
"preserve"> </xsl:text><xsl:value-of select=
"a:ID"/><br/>
1581 <xsl:call-template name=
"actorName">
1582 <xsl:with-param name=
"objID" select=
"a:PaymentProvider/a:ActorID"/>
1583 </xsl:call-template>
1586 <xsl:call-template name=
"actorName">
1587 <xsl:with-param name=
"objID" select=
"a:Subscriber/a:ActorID"/>
1588 </xsl:call-template>
1591 <xsl:call-template name=
"actorName">
1592 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
1593 </xsl:call-template>
1600 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Payers/a:Payer">
1601 <entry typeCode=
"DRIV">
1602 <act classCode=
"ACT" moodCode=
"DEF">
1603 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.17" assigningAuthorityName=
"IHE PCC"/>
1604 <templateId root=
"2.16.840.1.113883.10.20.1.20" assigningAuthorityName=
"CCD"/>
1605 <!-- Coverage entry template -->
1607 <xsl:call-template name=
"ccdID">
1608 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1609 </xsl:call-template>
1610 <code code=
"48768-6" codeSystem=
"2.16.840.1.113883.6.1" codeSystemName=
"LOINC" displayName=
"Payment sources"/>
1611 <statusCode code=
"completed"/>
1612 <entryRelationship typeCode=
"COMP">
1613 <act classCode=
"ACT" moodCode=
"EVN">
1614 <templateId root=
"2.16.840.1.113883.3.88.11.83.5" assigningAuthorityName=
"HITSP C83"/>
1615 <templateId root=
"2.16.840.1.113883.10.20.1.26" assigningAuthorityName=
"CCD"/>
1616 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.18" assigningAuthorityName=
"IHE PCC"/>
1617 <!--Insurance provider template -->
1619 <xsl:attribute name=
"root">
1620 <xsl:value-of select=
"a:IDs[1]/a:ID"/>
1622 <xsl:attribute name=
"extension">
1623 <xsl:value-of select=
"a:IDs[1]/a:Type/a:Text"/>
1628 <xsl:call-template name=
"ccdCodedValue">
1629 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Description"/>
1630 <xsl:with-param name=
"nodeName" select=
"'code'"/>
1631 </xsl:call-template>
1633 <statusCode code=
"completed"/>
1635 <xsl:call-template name=
"ccdPerformer">
1636 <xsl:with-param name=
"ccrActorReference" select=
"a:PaymentProvider"/>
1637 </xsl:call-template>
1639 <participant typeCode=
"HLD">
1640 <xsl:call-template name=
"ccdParticipantRoleActor">
1641 <xsl:with-param name=
"ccrActorReference" select=
"a:Subscriber"/>
1642 </xsl:call-template>
1645 </entryRelationship>
1652 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:PlanOfCare">
1655 <templateId root=
"2.16.840.1.113883.10.20.1.10"/>
1656 <code code=
"18776-5" codeSystem=
"2.16.840.1.113883.6.1"/>
1657 <title>Plan Of Care
</title>
1659 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Treatment Recommendation']">
1660 <xsl:text>Plan Of Care Recommendations
</xsl:text>
1665 <th>Description
</th>
1666 <th>Recommendation
</th>
1671 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Treatment Recommendation']">
1674 <xsl:value-of select=
"a:Description/a:Text"/>
1677 <xsl:value-of select=
"a:OrderRequest/a:Description/a:Text" disable-output-escaping=
"yes"/>
1680 <xsl:value-of select=
"a:OrderRequest/a:Goals/a:Goal/a:Description/a:Text" disable-output-escaping=
"yes"/>
1683 <xsl:value-of select=
"a:Status/a:Text"/>
1686 <xsl:call-template name=
"actorName">
1687 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
1688 </xsl:call-template>
1695 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Order']">
1696 <xsl:text>Plan Of Care Orders
</xsl:text>
1702 <th>Plan Status
</th>
1715 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Order']">
1718 <xsl:apply-templates select=
"a:Description/a:Text"/>
1721 <xsl:value-of select=
"a:Status/a:Text"/>
1724 <xsl:value-of select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Type/a:Text"/>
1727 <xsl:call-template name=
"date:format-date">
1728 <xsl:with-param name=
"date-time" select=
"a:OrderRequest/a:Procedures/a:Procedure/a:DateTime/a:ExactDateTime"/>
1729 </xsl:call-template>
1732 <xsl:apply-templates select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Description/a:Text"/>
1735 <xsl:text xml:
space=
"preserve">Every
</xsl:text>
1736 <xsl:apply-templates select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Interval/a:Value"/>
1737 <xsl:text xml:
space=
"preserve"> </xsl:text>
1738 <xsl:value-of select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Interval/a:Units/a:Unit"/>
1739 <xsl:text xml:
space=
"preserve"> for
</xsl:text>
1740 <xsl:value-of select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Duration/a:Value"/>
1741 <xsl:text xml:
space=
"preserve"> </xsl:text>
1742 <xsl:value-of select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Duration/a:Units/a:Unit"/>
1745 <xsl:for-each select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Locations">
1746 <xsl:value-of select=
"a:Location/a:Description/a:Text"/>
1747 <xsl:if test=
"position() != last()">
1753 <xsl:value-of select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Substance/a:Text"/>
1756 <xsl:value-of select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Method/a:Text"/>
1759 <xsl:value-of select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Position/a:Text"/>
1762 <xsl:value-of select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Site/a:Text"/>
1766 <xsl:call-template name=
"actorName">
1767 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
1768 </xsl:call-template>
1776 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan/a:OrderRequest/a:Procedures/a:Procedure">
1777 <entry typeCode=
"DRIV">
1778 <observation classCode=
"OBS" moodCode=
"RQO">
1779 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.1.20.3.1"/>
1782 <xsl:call-template name=
"ccdID">
1783 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1784 </xsl:call-template>
1787 <xsl:call-template name=
"ccdCodedValue">
1788 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Description"/>
1789 <xsl:with-param name=
"nodeName" select=
"'code'"/>
1790 </xsl:call-template>
1792 <statusCode code=
"new"/>
1796 <xsl:when test=
"a:DateTime">
1797 <xsl:call-template name=
"ccdDateTime">
1798 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
1799 </xsl:call-template>
1801 <xsl:when test=
"a:Interval">
1802 <xsl:attribute name=
"xsi:type">PIVL_TS
</xsl:attribute>
1803 <xsl:attribute name=
"operator">A
</xsl:attribute>
1804 <xsl:attribute name=
"institutionSpecified">true
</xsl:attribute>
1806 <xsl:attribute name=
"value">
1807 <xsl:value-of select=
"a:Interval/a:Value"/>
1809 <xsl:attribute name=
"unit">
1810 <xsl:value-of select=
"a:Interval/a:Units/a:Unit"/>
1820 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan/a:OrderRequest/a:Medications/a:Medication">
1821 <entry typeCode=
"DRIV">
1822 <substanceAdministration classCode=
"SBADM" moodCode=
"INT">
1823 <templateId root=
"2.16.840.1.113883.10.20.1.24" assigningAuthorityName=
"CCD"/>
1824 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.7.1" assigningAuthorityName=
"IHE PCC"/>
1826 <!--Medication activity template -->
1829 <xsl:call-template name=
"ccdID">
1830 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1831 </xsl:call-template>
1833 <statusCode code='completed'
/>
1835 <xsl:call-template name=
"ccdDateTime">
1836 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
1837 <xsl:with-param name=
"type" select=
"'IVL_TS'"/>
1838 </xsl:call-template>
1840 <xsl:call-template name=
"ccdMedicationFrequency">
1841 <xsl:with-param name=
"frequency" select=
"a:Directions/a:Direction/a:Frequency"/>
1842 </xsl:call-template>
1844 <xsl:call-template name=
"ccdCodedValue">
1845 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Directions/a:Direction/a:Route"/>
1846 <xsl:with-param name=
"nodeName" select=
"'routeCode'"/>
1847 <xsl:with-param name=
"domain" select=
"'RouteOfAdministration'"/>
1848 </xsl:call-template>
1850 <xsl:if test=
"a:Directions/a:Direction/a:Dose">
1853 <xsl:attribute name=
"value">
1854 <xsl:value-of select=
"a:Directions/a:Direction/a:Dose/a:Value"></xsl:value-of>
1856 <xsl:attribute name=
"unit">
1857 <xsl:value-of select=
"a:Directions/a:Direction/a:Dose/a:Unit"></xsl:value-of>
1861 <xsl:attribute name=
"value">
1862 <xsl:value-of select=
"a:Directions/a:Direction/a:Dose/a:Value"></xsl:value-of>
1864 <xsl:attribute name=
"unit">
1865 <xsl:value-of select=
"a:Directions/a:Direction/a:Dose/a:Unit"></xsl:value-of>
1871 <manufacturedProduct>
1872 <templateId root=
"2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName=
"HITSP C83"/>
1873 <templateId root=
"2.16.840.1.113883.10.20.1.53" assigningAuthorityName=
"CCD"/>
1874 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName=
"IHE PCC"/>
1876 <!-- Product template -->
1878 <manufacturedMaterial>
1879 <xsl:call-template name=
"ccdCodedValue">
1880 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Product/a:ProductName"/>
1881 <xsl:with-param name=
"nodeName" select=
"'code'"/>
1882 </xsl:call-template>
1884 <xsl:value-of select=
"a:Product/a:BrandName/a:Text"/>
1886 </manufacturedMaterial>
1887 </manufacturedProduct>
1889 </substanceAdministration>
1892 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan/a:OrderRequest/a:Immunizations/a:Immunization">
1894 <entry typeCode=
"DRIV">
1895 <substanceAdministration classCode=
"SBADM" moodCode=
"EVN">
1896 <templateId root=
"2.16.840.1.113883.10.20.1.24" assigningAuthorityName=
"CCD"/>
1897 <templateId root=
"2.16.840.1.113883.3.88.11.83.13" assigningAuthorityName=
"HITSP C83"/>
1898 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.12" assigningAuthorityName=
"IHE PCC"/>
1900 <!-- Medication activity template -->
1903 <xsl:call-template name=
"ccdID">
1904 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1905 </xsl:call-template>
1907 <code code=
"IMMUNIZ" codeSystem=
"2.16.840.1.113883.5.4" codeSystemName=
"HL7 ActCode"/>
1910 <xsl:attribute name=
"value">
1911 <xsl:text>#
</xsl:text>
1912 <xsl:value-of select=
"a:CCRDataObjectID"/>
1917 <statusCode code='completed'
/>
1919 <xsl:call-template name=
"ccdDateTime">
1920 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
1921 <xsl:with-param name=
"type" select=
"'IVL_TS'"/>
1922 </xsl:call-template>
1924 <xsl:call-template name=
"ccdCodedValue">
1925 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Directions/a:Direction/a:Route"/>
1926 <xsl:with-param name=
"nodeName" select=
"'routeCode'"/>
1927 <xsl:with-param name=
"domain" select=
"'RouteOfAdministration'"/>
1928 </xsl:call-template>
1930 <xsl:if test=
"a:Directions/a:Direction/a:Site">
1931 <xsl:call-template name=
"ccdCodedValue">
1932 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Directions/a:Direction/a:Site"/>
1933 <xsl:with-param name=
"nodeName" select=
"'approachSiteCode'"/>
1934 <xsl:with-param name=
"originalTextReference">
1935 <xsl:text>#
</xsl:text>
1936 <xsl:value-of select=
"a:CCRDataObjectID"/>
1937 <xsl:text>:Site
</xsl:text>
1939 </xsl:call-template>
1943 <manufacturedProduct>
1944 <templateId root=
"2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName=
"HITSP C83"/>
1945 <templateId root=
"2.16.840.1.113883.10.20.1.53" assigningAuthorityName=
"CCD"/>
1946 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName=
"IHE PCC"/>
1948 <!-- Product template -->
1950 <manufacturedMaterial>
1951 <xsl:call-template name=
"ccdCodedValue">
1952 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Product/a:ProductName"/>
1953 <xsl:with-param name=
"nodeName" select=
"'code'"/>
1954 </xsl:call-template>
1956 <xsl:value-of select=
"a:Product/a:BrandName/a:Text"/>
1958 </manufacturedMaterial>
1959 </manufacturedProduct>
1962 </substanceAdministration>
1966 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan/a:OrderRequest/a:Encounters/a:Encounter">
1967 <entry typeCode=
"DRIV">
1968 <encounter classCode=
"ENC" moodCode=
"INT">
1969 <templateId root=
"2.16.840.1.113883.3.88.11.83.16" assigningAuthorityName=
"HITSP C83"/>
1970 <templateId root=
"2.16.840.1.113883.10.20.1.21" assigningAuthorityName=
"CCD"/>
1971 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.14" assigningAuthorityName=
"IHE PCC"/>
1973 <!-- Encounter activity template -->
1976 <xsl:call-template name=
"ccdID">
1977 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1978 </xsl:call-template>
1980 <xsl:call-template name=
"ccdCodedValue">
1981 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Description"/>
1982 <xsl:with-param name=
"nodeName" select=
"'code'"/>
1983 </xsl:call-template>
1987 <xsl:attribute name=
"value">
1988 <xsl:text>#
</xsl:text>
1989 <xsl:value-of select=
"a:CCRDataObjectID"/>
1994 <xsl:call-template name=
"ccdDateTime">
1995 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
1996 </xsl:call-template>
1998 <xsl:if test=
"a:Practitioners[1]/a:Practitioner">
1999 <xsl:call-template name=
"ccdPerformer">
2000 <xsl:with-param name=
"ccrActorReference" select=
"a:Practitioners/a:Practitioner[1]"/>
2001 </xsl:call-template>
2004 <xsl:if test=
"a:Locations[1]/a:Location">
2005 <participant typeCode=
"LOC">
2006 <templateId root=
"2.16.840.1.113883.10.20.1.45"/>
2007 <!-- Location participation template -->
2009 <xsl:when test=
"a:Locations[1]/a:Location/a:ActorID">
2010 <xsl:call-template name=
"ccdParticipantRoleActor">
2011 <xsl:with-param name=
"ccrActorObjectID" select=
"a:Locations[1]/a:Location/a:ActorID"/>
2012 </xsl:call-template>
2015 <xsl:call-template name=
"ccdParticipantRoleCodedDescription">
2016 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Locations[1]/a:Location/a:Description"/>
2017 </xsl:call-template>
2028 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:HealthCareProviders">
2031 <title>Health Care Providers
</title>
2039 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:HealthCareProviders/a:Provider">
2042 <xsl:value-of select=
"a:ActorRole/a:Text"/>
2045 <xsl:call-template name=
"actorName">
2046 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
2047 </xsl:call-template>
2058 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:SupportProviders">
2061 <title>Support Providers</title>
2069 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Support/a:SupportProvider">
2072 <xsl:value-of select="a:ActorRole/a:Text"/>
2075 <xsl:call-template name="actorName">
2076 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
2077 </xsl:call-template>
2087 <xsl:if test="a:ContinuityOfCareRecord/a:References">
2090 <title>References</title>
2097 <th>Description</th>
2101 <xsl:for-each select="/a:ContinuityOfCareRecord/a:References/a:Reference">
2104 <xsl:value-of select="a:Type/a:Text"/>
2107 <xsl:call-template name="date:format-date">
2108 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
2109 </xsl:call-template>
2112 <strong class="clinical">
2113 <xsl:value-of select="a:Description/a:Text"/>
2117 <xsl:value-of select="a:Locations/a:Location/a:Description/a:Text"/>
2120 <xsl:call-template name="actorName">
2121 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
2122 </xsl:call-template>
2136 <title>Additional Information About People
& Organizations
</title>
2138 <xsl:if test=
"a:ContinuityOfCareRecord/a:Actors/a:Actor[a:Person]">
2145 <th>Identification Numbers
</th>
2147 <th>Address/ E-mail
</th>
2149 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor">
2150 <xsl:sort select=
"a:Person/a:Name/a:DisplayName|a:Person/a:Name/a:CurrentName/a:Family" data-type=
"text" order=
"ascending"/>
2151 <xsl:if test=
"a:Person">
2154 <xsl:call-template name=
"actorName">
2155 <xsl:with-param name=
"objID" select=
"a:ActorObjectID"/>
2156 </xsl:call-template>
2159 <xsl:value-of select=
"a:Specialty/a:Text"/>
2162 <xsl:value-of select=
"a:Relation/a:Text"/>
2165 <xsl:for-each select=
"a:IDs">
2166 <xsl:value-of select=
"a:Type/a:Text"/>
2167 <xsl:text>:
</xsl:text>
2168 <xsl:value-of select=
"a:ID"/>
2172 <xsl:for-each select=
"a:Telephone">
2173 <xsl:value-of select=
"a:Type/a:Text"/>
2174 <xsl:text>:
</xsl:text>
2175 <xsl:value-of select=
"a:Value"/>
2179 <xsl:for-each select=
"a:Address">
2180 <xsl:if test=
"a:Type">
2181 <xsl:value-of select=
"a:Type/a:Text"/>
2182 <xsl:text>:
</xsl:text>
2185 <xsl:if test=
"a:Line1">
2186 <xsl:value-of select=
"a:Line1"/>
2189 <xsl:if test=
"a:Line2">
2190 <xsl:value-of select=
"a:Line2"/>
2193 <xsl:if test=
"a:City">
2194 <xsl:value-of select=
"a:City"/>
2195 <xsl:text>,
</xsl:text>
2197 <xsl:value-of select=
"a:State"/>
2198 <xsl:value-of select=
"a:PostalCode"/>
2201 <xsl:for-each select=
"a:EMail">
2203 <xsl:value-of select=
"a:Value"/>
2212 <xsl:if test=
"a:ContinuityOfCareRecord/a:Actors/a:Actor[a:Organization]">
2219 <th>Identification Numbers
</th>
2221 <th>Address/ E-mail
</th>
2223 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor">
2224 <xsl:sort select=
"a:Organization/a:Name" data-type=
"text" order=
"ascending"/>
2225 <xsl:if test=
"a:Organization">
2228 <xsl:value-of select=
"a:Organization/a:Name"/>
2231 <xsl:value-of select=
"a:Specialty/a:Text"/>
2234 <xsl:value-of select=
"a:Relation/a:Text"/>
2237 <xsl:for-each select=
"a:IDs">
2238 <xsl:value-of select=
"a:Type/a:Text"/>
2239 <xsl:text>:
</xsl:text>
2240 <xsl:value-of select=
"a:ID"/>
2244 <xsl:for-each select=
"a:Telephone">
2245 <xsl:value-of select=
"a:Type/a:Text"/>
2246 <xsl:text>:
</xsl:text>
2247 <xsl:value-of select=
"a:Value"/>
2251 <xsl:for-each select=
"a:Address">
2252 <xsl:if test=
"a:Type">
2253 <xsl:value-of select=
"a:Type/a:Text"/>
2254 <xsl:text>:
</xsl:text>
2257 <xsl:if test=
"a:Line1">
2258 <xsl:value-of select=
"a:Line1"/>
2261 <xsl:if test=
"a:Line2">
2262 <xsl:value-of select=
"a:Line2"/>
2265 <xsl:if test=
"a:City">
2266 <xsl:value-of select=
"a:City"/>
2267 <xsl:text>,
</xsl:text>
2269 <xsl:value-of select=
"a:State"/>
2270 <xsl:value-of select=
"a:PostalCode"/>
2273 <xsl:for-each select=
"a:EMail">
2275 <xsl:value-of select=
"a:Value"/>
2284 <xsl:if test=
"a:ContinuityOfCareRecord/a:Actors/a:Actor[a:InformationSystem]">
2291 <th>Identification Numbers
</th>
2293 <th>Address/ E-mail
</th>
2295 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor">
2296 <xsl:sort select=
"a:InformationSystem/a:Name" data-type=
"text" order=
"ascending"/>
2297 <xsl:if test=
"a:InformationSystem">
2300 <xsl:value-of select=
"a:InformationSystem/a:Name"/>
2303 <xsl:value-of select=
"a:InformationSystem/a:Type"/>
2306 <xsl:value-of select=
"a:InformationSystem/a:Version"/>
2309 <xsl:for-each select=
"a:IDs">
2310 <xsl:value-of select=
"a:Type/a:Text"/>
2311 <xsl:text>:
</xsl:text>
2312 <xsl:value-of select=
"a:ID"/>
2316 <xsl:for-each select=
"a:Telephone">
2317 <xsl:value-of select=
"a:Type/a:Text"/>
2318 <xsl:text>:
</xsl:text>
2319 <xsl:value-of select=
"a:Value"/>
2323 <xsl:for-each select=
"a:Address">
2324 <xsl:if test=
"Type">
2325 <xsl:value-of select=
"a:Type/a:Text"/>
2326 <xsl:text>:
</xsl:text>
2329 <xsl:if test=
"a:Line1">
2330 <xsl:value-of select=
"a:Line1"/>
2333 <xsl:if test=
"a:Line2">
2334 <xsl:value-of select=
"a:Line2"/>
2337 <xsl:if test=
"a:City">
2338 <xsl:value-of select=
"a:City"/>
2339 <xsl:text>,
</xsl:text>
2341 <xsl:value-of select=
"a:State"/>
2342 <xsl:value-of select=
"a:PostalCode"/>
2345 <xsl:for-each select=
"a:EMail">
2347 <xsl:value-of select=
"a:Value"/>
2365 <xsl:template name=
"ccdAssignedEntity">
2366 <xsl:param name=
"ccrActorObjectID"/>
2368 <xsl:variable name=
"CCRActor" select=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2371 <xsl:call-template name=
"ccdEntityID">
2372 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2373 </xsl:call-template>
2375 <xsl:call-template name=
"ccdAddress">
2376 <xsl:with-param name=
"CCRActorAddress" select=
"$CCRActor/a:Address"/>
2377 </xsl:call-template>
2379 <xsl:call-template name=
"ccdTelecom">
2380 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2381 </xsl:call-template>
2383 <xsl:if test=
"$CCRActor/a:Person">
2384 <xsl:call-template name=
"ccdPerson">
2385 <xsl:with-param name=
"CCRActorPerson" select=
"$CCRActor/a:Person"/>
2386 <xsl:with-param name=
"personNodeName" select=
"'assignedPerson'"/>
2387 </xsl:call-template>
2390 <xsl:if test=
"$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']">
2391 <xsl:call-template name=
"ccdOrganization">
2392 <xsl:with-param name=
"ccrActorObjectID" select=
"$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']/a:LinkID"/>
2393 <xsl:with-param name=
"organizationNodeName" select=
"'representedOrganization'"/>
2394 </xsl:call-template>
2400 <xsl:template name=
"ccdPatient">
2401 <xsl:param name=
"CCRActorPerson"/>
2403 <xsl:call-template name=
"ccdPersonName">
2404 <xsl:with-param name=
"CCRActorName" select=
"$CCRActorPerson/a:Name"/>
2405 </xsl:call-template>
2407 <xsl:if test=
"$CCRActorPerson/a:Gender">
2408 <xsl:call-template name=
"ccdCodedValue">
2409 <xsl:with-param name=
"ccrCodedDescription" select=
"$CCRActorPerson/a:Gender"/>
2410 <xsl:with-param name=
"domain" select=
"'AdministrativeGender'"/>
2411 <xsl:with-param name=
"nodeName" select=
"'administrativeGenderCode'"/>
2412 </xsl:call-template>
2415 <xsl:if test=
"$CCRActorPerson/a:DateOfBirth">
2417 <xsl:attribute name=
"value">
2418 <xsl:call-template name=
"date:format-date">
2419 <xsl:with-param name=
"date-time" select=
"$CCRActorPerson/a:DateOfBirth/a:ExactDateTime"/>
2420 <xsl:with-param name=
"pattern">yyyyMMddhhmmss
</xsl:with-param>
2421 </xsl:call-template>
2426 <xsl:if test=
"/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Marital Status']">
2427 <xsl:call-template name=
"ccdCodedValue">
2428 <xsl:with-param name=
"ccrCodedDescription" select=
"/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Marital Status']/a:Description"/>
2429 <xsl:with-param name=
"domain" select=
"'MaritalStatus'"/>
2430 <xsl:with-param name=
"nodeName" select=
"'maritalStatusCode'"/>
2431 </xsl:call-template>
2434 <xsl:if test=
"/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Language']">
2435 <languageCommunication>
2436 <templateId root=
"2.16.840.1.113883.3.88.11.83.2" assigningAuthorityName=
"HITSP/C83"/>
2437 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.2.1" assigningAuthorityName=
"IHE/PCC"/>
2438 <xsl:call-template name=
"ccdCodedValue">
2439 <xsl:with-param name=
"ccrCodedDescription" select=
"/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Language']/a:Description"></xsl:with-param>
2440 <xsl:with-param name=
"domain" select=
"'HumanLanguage'"/>
2441 <xsl:with-param name=
"nodeName" select=
"'languageCode'"/>
2442 </xsl:call-template>
2443 </languageCommunication>
2448 <xsl:template name=
"ccdPerformer">
2449 <xsl:param name=
"ccrActorReference"/>
2450 <performer typeCode=
"PRF">
2451 <xsl:if test=
"$ccrActorReference/a:ActorRole">
2452 <xsl:call-template name=
"ccdCodedValue">
2453 <xsl:with-param name=
"ccrCodedDescription" select=
"$ccrActorReference/a:ActorRole"/>
2454 <xsl:with-param name=
"nodeName" select=
"'functionCode'"/>
2455 </xsl:call-template>
2457 <xsl:call-template name=
"ccdAssignedEntity">
2458 <xsl:with-param name=
"ccrActorObjectID" select=
"$ccrActorReference/a:ActorID"/>
2459 </xsl:call-template>
2463 <xsl:template name=
"ccdPerson">
2464 <xsl:param name=
"CCRActorPerson"/>
2465 <xsl:param name=
"personNodeName">assignedPerson
</xsl:param>
2466 <xsl:element name=
"{$personNodeName}">
2467 <xsl:call-template name=
"ccdPersonName">
2468 <xsl:with-param name=
"CCRActorName" select=
"$CCRActorPerson/a:Name"/>
2469 </xsl:call-template>
2473 <xsl:template name=
"ccdPersonName">
2474 <xsl:param name=
"CCRActorName"/>
2476 <xsl:if test=
"$CCRActorName/a:CurrentName/a:Title">
2478 <xsl:value-of select=
"$CCRActorName/a:CurrentName/a:Title"/>
2481 <xsl:if test=
"$CCRActorName/a:CurrentName/a:Given">
2483 <xsl:value-of select=
"$CCRActorName/a:CurrentName/a:Given"/>
2486 <xsl:if test=
"$CCRActorName/a:CurrentName/a:Middle">
2488 <xsl:value-of select=
"$CCRActorName/a:CurrentName/a:Middle"/>
2491 <xsl:if test=
"$CCRActorName/a:CurrentName/a:Family">
2493 <xsl:value-of select=
"$CCRActorName/a:CurrentName/a:Family"/>
2496 <xsl:if test=
"$CCRActorName/a:CurrentName/a:Suffix">
2498 <xsl:value-of select=
"$CCRActorName/a:CurrentName/a:Suffix"/>
2504 <xsl:template name=
"ccdOrganization">
2505 <xsl:param name=
"ccrActorObjectID"/>
2506 <xsl:param name=
"organizationNodeName"/>
2508 <xsl:variable name=
"CCRActor" select=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2510 <xsl:element name=
"{$organizationNodeName}">
2511 <xsl:call-template name=
"ccdEntityID">
2512 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2513 </xsl:call-template>
2514 <xsl:call-template name=
"ccdTelecom">
2515 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2516 </xsl:call-template>
2518 <xsl:call-template name=
"ccdAddress">
2519 <xsl:with-param name=
"CCRActorAddress" select=
"$CCRActor/a:Address[1]"/>
2520 </xsl:call-template>
2524 <xsl:template name=
"ccdPatientRole">
2525 <xsl:param name=
"ccrActorObjectID"/>
2527 <xsl:variable name=
"CCRActor" select=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2529 <xsl:call-template name=
"ccdEntityID">
2530 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2531 </xsl:call-template>
2533 <xsl:call-template name=
"ccdAddress">
2534 <xsl:with-param name=
"CCRActorAddress" select=
"$CCRActor/a:Address[1]"/>
2535 </xsl:call-template>
2537 <xsl:call-template name=
"ccdTelecom">
2538 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2539 </xsl:call-template>
2541 <xsl:call-template name=
"ccdPatient">
2542 <xsl:with-param name=
"CCRActorPerson" select=
"$CCRActor/a:Person"/>
2543 </xsl:call-template>
2546 <xsl:template name=
"ccdAssignedAuthor">
2547 <xsl:param name=
"ccrActorObjectID"/>
2549 <xsl:variable name=
"CCRActor" select=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2551 <xsl:call-template name=
"ccdEntityID">
2552 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2553 </xsl:call-template>
2555 <xsl:call-template name=
"ccdAddress">
2556 <xsl:with-param name=
"CCRActorAddress" select=
"$CCRActor/a:Address[1]"/>
2557 </xsl:call-template>
2559 <xsl:call-template name=
"ccdTelecom">
2560 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2561 </xsl:call-template>
2563 <xsl:call-template name=
"ccdPerson">
2564 <xsl:with-param name=
"CCRActorPerson" select=
"$CCRActor/a:Person"/>
2565 </xsl:call-template>
2567 <xsl:if test=
"$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']">
2568 <representedOrganization>
2569 <xsl:call-template name=
"ccdOrganization">
2570 <xsl:with-param name=
"ccrActorObjectID" select=
"$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']/a:LinkID"/>
2571 </xsl:call-template>
2572 </representedOrganization>
2577 <xsl:template name=
"ccdParticipantRoleActor">
2578 <xsl:param name=
"ccrActorObjectID"/>
2580 <xsl:variable name=
"CCRActor" select=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2582 <xsl:call-template name=
"ccdEntityID">
2583 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2584 </xsl:call-template>
2586 <xsl:call-template name=
"ccdAddress">
2587 <xsl:with-param name=
"CCRActorAddress" select=
"$CCRActor/a:Address[1]"/>
2588 </xsl:call-template>
2590 <xsl:call-template name=
"ccdTelecom">
2591 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2592 </xsl:call-template>
2594 <xsl:if test=
"$CCRActor/a:Organization/a:Name">
2595 <playingEntity classCode=
"PLC">
2597 <xsl:value-of select=
"$CCRActor/a:Organization/a:Name"/>
2603 <xsl:template name=
"ccdParticipantRoleCodedDescription">
2604 <xsl:param name=
"ccrCodedDescription"/>
2605 <participantRole classCode=
"MANU">
2606 <!--Product Detail-->
2607 <playingEntity classCode=
"MMAT">
2608 <xsl:if test=
"$ccrCodedDescription/a:Code">
2609 <xsl:call-template name=
"ccdCodedValue">
2610 <xsl:with-param name=
"ccrCodedDescription" select=
"$ccrCodedDescription"/>
2611 <xsl:with-param name=
"nodeName" select=
"'code'"/>
2612 </xsl:call-template>
2615 <xsl:value-of select=
"$ccrCodedDescription/a:Text"/>
2621 <xsl:template name=
"ccdEntityID">
2622 <xsl:param name=
"CCRActor"/>
2625 <xsl:when test=
"$CCRActor/a:IDs">
2626 <xsl:attribute name=
"extension">
2627 <xsl:value-of select=
"$CCRActor/a:IDs[1]/a:ID"/>
2629 <xsl:attribute name=
"root">
2630 <xsl:value-of select=
"$CCRActor/a:IDs[1]/a:Type/a:Text"/>
2634 <xsl:attribute name=
"extension">
2635 <xsl:value-of select=
"$CCRActor/a:ActorObjectID"/>
2637 <xsl:attribute name=
"root">
2638 <xsl:text>CCRActorID
</xsl:text>
2643 <xsl:if test=
"$CCRActor/a:Organization">
2644 <name><xsl:value-of select=
"$CCRActor/a:Organization/a:Name"></xsl:value-of></name>
2647 <xsl:template name=
"ccdAddress">
2648 <xsl:param name=
"CCRActorAddress"/>
2651 <xsl:when test=
"$CCRActorAddress">
2652 <xsl:attribute name=
"use">
2653 <xsl:call-template name=
"CDAVocabularyLookup">
2654 <xsl:with-param name=
"domain" select=
"'telecommunicationsAddressUse'"/>
2655 <xsl:with-param name=
"ccrtext" select=
"$CCRActorAddress/a:Type/a:Text"/>
2656 </xsl:call-template>
2659 <xsl:value-of select=
"$CCRActorAddress/a:Line1"/>
2660 </streetAddressLine>
2662 <xsl:value-of select=
"$CCRActorAddress/a:City"/>
2665 <xsl:value-of select=
"$CCRActorAddress/a:State"/>
2668 <xsl:value-of select=
"$CCRActorAddress/a:PostalCode"/>
2672 <streetAddressLine/>
2678 <xsl:template name=
"ccdTelecom">
2679 <xsl:param name=
"CCRActor"/>
2681 <xsl:if test=
"$CCRActor/a:Telephone">
2682 <xsl:attribute name=
"use">
2683 <xsl:call-template name=
"CDAVocabularyLookup">
2684 <xsl:with-param name=
"domain" select=
"'telecommunicationsAddressUse'"/>
2685 <xsl:with-param name=
"ccrtext" select=
"$CCRActor/a:Telephone/a:Type/a:Text"/>
2686 </xsl:call-template>
2688 <xsl:attribute name=
"value">
2689 <xsl:text>tel:+
1-
</xsl:text>
2690 <xsl:value-of select=
"$CCRActor/a:Telephone[1]/a:Value"/>
2695 <xsl:if test=
"$CCRActor/a:Email">
2698 <xsl:when test=
"$CCRActor/a:Telephone">
2699 <xsl:attribute name=
"use">
2700 <xsl:call-template name=
"CDAVocabularyLookup">
2701 <xsl:with-param name=
"domain" select=
"'telecommunicationsAddressUse'"/>
2702 <xsl:with-param name=
"ccrtext" select=
"$CCRActor/a:Telephone/a:Type/a:Text"/>
2703 </xsl:call-template>
2705 <xsl:attribute name=
"value">
2706 <xsl:text>mailto:
</xsl:text>
2707 <xsl:value-of select=
"$CCRActor/a:Email[1]/a:Value"/>
2711 <xsl:attribute name=
"value">
2712 <xsl:text>Unknown
</xsl:text>
2720 <xsl:template name=
"ccdID">
2721 <xsl:param name=
"ccrObjectID"/>
2722 <xsl:param name=
"suffix"/>
2724 <xsl:attribute name=
"root">
2725 <xsl:value-of select=
"$ccrObjectID"></xsl:value-of>
2727 <xsl:attribute name=
"extension">CCRObjectID
</xsl:attribute>
2731 <xsl:template name=
"ccdCodedValue">
2732 <xsl:param name=
"ccrCodedDescription"/>
2733 <xsl:param name=
"type"/>
2734 <xsl:param name=
"domain"/>
2735 <xsl:param name=
"nodeName">value
</xsl:param>
2736 <xsl:param name=
"originalTextReference"/>
2738 <xsl:element name=
"{$nodeName}">
2739 <xsl:if test=
"$type">
2740 <xsl:attribute name=
"xsi:type">
2741 <xsl:value-of select=
"$type"/>
2745 <xsl:when test=
"$ccrCodedDescription/a:Code">
2746 <xsl:attribute name=
"displayName">
2747 <xsl:value-of select=
"$ccrCodedDescription/a:Text"/>
2749 <xsl:attribute name=
"code">
2750 <xsl:value-of select=
"$ccrCodedDescription/a:Code/a:Value"/>
2752 <xsl:attribute name=
"codeSystemName">
2753 <xsl:value-of select=
"$ccrCodedDescription/a:Code/a:CodingSystem"/>
2755 <xsl:attribute name=
"codeSystem">
2756 <xsl:call-template name=
"HL7OIDLookup">
2757 <xsl:with-param name=
"name" select=
"$ccrCodedDescription/a:Code/a:CodingSystem"/>
2758 </xsl:call-template>
2761 <xsl:when test=
"$domain">
2762 <xsl:variable name=
"cdaCode">
2763 <xsl:call-template name=
"CDAVocabularyLookup">
2764 <xsl:with-param name=
"domain" select=
"$domain"/>
2765 <xsl:with-param name=
"ccrtext" select=
"$ccrCodedDescription/a:Text"/>
2766 </xsl:call-template>
2768 <xsl:attribute name=
"displayName">
2769 <xsl:call-template name=
"CDADisplayNameLookup">
2770 <xsl:with-param name=
"domain" select=
"$domain"/>
2771 <xsl:with-param name=
"cdacode" select=
"$cdaCode"/>
2772 </xsl:call-template>
2774 <xsl:attribute name=
"code">
2775 <xsl:value-of select=
"$cdaCode"></xsl:value-of>
2777 <xsl:attribute name=
"codeSystemName">
2778 <xsl:call-template name=
"CDAVocabularyCodeSystemNameLookup">
2779 <xsl:with-param name=
"domain" select=
"$domain"/>
2780 </xsl:call-template>
2782 <xsl:attribute name=
"codeSystemName">
2783 <xsl:call-template name=
"CDAVocabularyCodeSystemLookup">
2784 <xsl:with-param name=
"domain" select=
"$domain"/>
2785 </xsl:call-template>
2790 <xsl:value-of select=
"$ccrCodedDescription/a:Text"/>
2791 <xsl:if test=
"$originalTextReference">
2793 <xsl:attribute name=
"value">
2794 <xsl:value-of select=
"$originalTextReference"/>
2804 <xsl:template name=
"ccdDateTime">
2805 <xsl:param name=
"dt"/>
2806 <xsl:param name=
"type"/>
2808 <xsl:if test=
"$dt[1]/a:ExactDateTime">
2810 <xsl:if test=
"$type">
2811 <xsl:attribute name=
"xsi:type">
2812 <xsl:value-of select=
"$type"></xsl:value-of>
2816 <xsl:attribute name=
"value">
2817 <xsl:call-template name=
"date:format-date">
2818 <xsl:with-param name=
"date-time" select=
"$dt[1]/a:ExactDateTime"/>
2819 <xsl:with-param name=
"pattern">yyyyMMdd
</xsl:with-param>
2820 </xsl:call-template>
2823 <high nullFlavor=
"UNK"/>
2826 <xsl:if test=
"$dt[1]/a:DateTimeRange">
2829 <xsl:attribute name=
"value">
2830 <xsl:call-template name=
"date:format-date">
2831 <xsl:with-param name=
"date-time" select=
"$dt[1]/a:DateTimeRange/a:BeginRange/a:ExactDateTime"/>
2832 <xsl:with-param name=
"pattern">yyyyMMdd
</xsl:with-param>
2833 </xsl:call-template>
2837 <xsl:attribute name=
"value">
2838 <xsl:call-template name=
"date:format-date">
2839 <xsl:with-param name=
"date-time" select=
"$dt[1]/a:DateTimeRange/a:EndRange/a:ExactDateTime"/>
2840 <xsl:with-param name=
"pattern">yyyyMMdd
</xsl:with-param>
2841 </xsl:call-template>
2849 <xsl:template name=
"ccdMedicationFrequency">
2850 <xsl:param name=
"frequency"/>
2851 <xsl:if test=
"$frequency">
2853 <xsl:when test=
"$frequency/a:Value='qd'">
2854 <effectiveTime xsi:
type=
"PIVL_TS" operator=
"A">
2855 <xsl:attribute name=
"institutionSpecified">true
</xsl:attribute>
2857 <xsl:attribute name=
"value">24</xsl:attribute>
2858 <xsl:attribute name=
"unit">h
</xsl:attribute>
2862 <xsl:when test=
"$frequency/a:Value='bid'">
2863 <effectiveTime xsi:
type=
"PIVL_TS" operator=
"A">
2864 <xsl:attribute name=
"institutionSpecified">true
</xsl:attribute>
2866 <xsl:attribute name=
"value">12</xsl:attribute>
2867 <xsl:attribute name=
"unit">h
</xsl:attribute>
2871 <xsl:when test=
"$frequency/a:Value='tid'">
2872 <effectiveTime xsi:
type=
"PIVL_TS" operator=
"A">
2873 <xsl:attribute name=
"institutionSpecified">true
</xsl:attribute>
2875 <xsl:attribute name=
"value">8</xsl:attribute>
2876 <xsl:attribute name=
"unit">h
</xsl:attribute>
2880 <xsl:when test=
"$frequency/a:Value='qid'">
2881 <effectiveTime xsi:
type=
"PIVL_TS" operator=
"A">
2882 <xsl:attribute name=
"institutionSpecified">true
</xsl:attribute>
2884 <xsl:attribute name=
"value">6</xsl:attribute>
2885 <xsl:attribute name=
"unit">h
</xsl:attribute>
2889 <xsl:when test=
"$frequency/a:Value='qam'">
2890 <effectiveTime xsi:type='EIVL' operator='A'
>
2894 <xsl:when test=
"$frequency/a:Value='qpm'">
2895 <effectiveTime xsi:type='EIVL' operator='A'
>
2903 <xsl:template name=
"ccdStatus">
2904 <xsl:param name=
"ccrStatus"/>
2906 <entryRelationship typeCode=
"REFR">
2907 <observation classCode=
"OBS" moodCode=
"EVN">
2908 <templateId root=
"2.16.840.1.113883.10.20.1.50"/>
2909 <!-- Problem status observation template -->
2910 <code code=
"33999-4" codeSystem=
"2.16.840.1.113883.6.1" displayName=
"Status"/>
2911 <statusCode code=
"completed"/>
2912 <xsl:call-template name=
"ccdCodedValue">
2913 <xsl:with-param name=
"ccrCodedDescription" select=
"$ccrStatus"/>
2914 </xsl:call-template>
2916 </entryRelationship>
2919 <xsl:template name=
"ccdStatusObservation">
2920 <xsl:param name=
"status"/>
2921 <xsl:variable name=
"statusText" select=
"$status/a:Text"></xsl:variable>
2923 <xsl:when test=
"$statusText='Active'">
2924 <xsl:call-template name=
"ccdStatusElement">
2925 <xsl:with-param name=
"statusCode" select=
"'55561003'"/>
2926 <xsl:with-param name=
"statusDisplayName" select=
"$statusText"/>
2927 </xsl:call-template>
2929 <xsl:when test=
"$statusText='Inactive'">
2930 <xsl:call-template name=
"ccdStatusElement">
2931 <xsl:with-param name=
"statusCode" select=
"'73425007'"/>
2932 <xsl:with-param name=
"statusDisplayName" select=
"$statusText"/>
2933 </xsl:call-template>
2935 <xsl:when test=
"$statusText='Chronic'">
2936 <xsl:call-template name=
"ccdStatusElement">
2937 <xsl:with-param name=
"statusCode" select=
"'90734009'"/>
2938 <xsl:with-param name=
"statusDisplayName" select=
"$statusText"/>
2939 </xsl:call-template>
2944 <xsl:template name=
"ccdStatusProcedure">
2945 <xsl:param name=
"status"/>
2946 <xsl:variable name=
"statusText" select=
"$status/a:Text"></xsl:variable>
2948 <xsl:when test=
"$statusText='Completed'">
2949 <statusCode code=
"completed"/>
2951 <xsl:when test=
"$statusText='Active'">
2952 <statusCode code=
"active"/>
2954 <xsl:when test=
"$statusText='Aborted'">
2955 <statusCode code=
"aborted"/>
2957 <xsl:when test=
"$statusText='Cancelled' or $statusText='Canceled'">
2958 <statusCode code=
"cancelled"/>
2962 <xsl:attribute name=
"code">
2963 <xsl:value-of select=
"$statusText"></xsl:value-of>
2970 <xsl:template name=
"ccdStatusElement">
2971 <xsl:param name=
"statusCode"/>
2972 <xsl:param name=
"statusDisplayName"/>
2974 <xsl:attribute name=
"xsi:type">CE
</xsl:attribute>
2975 <xsl:attribute name=
"code">
2976 <xsl:value-of select=
"$statusCode"></xsl:value-of>
2978 <xsl:attribute name=
"codeSystem">2.16.840.1.113883.6.96</xsl:attribute>
2979 <xsl:attribute name=
"displayName">
2980 <xsl:value-of select=
"$statusDisplayName"></xsl:value-of>
2985 <xsl:template name=
"ccdObservation">
2986 <xsl:param name=
"ccrTestNode"/>
2987 <xsl:param name=
"testDate"/>
2990 <observation classCode=
"OBS" moodCode=
"EVN">
2991 <templateId root=
"2.16.840.1.113883.3.88.11.83.15" assigningAuthorityName=
"HITSP C83"/>
2992 <templateId root=
"2.16.840.1.113883.10.20.1.31" assigningAuthorityName=
"CCD"/>
2993 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.13" assigningAuthorityName=
"IHE PCC"/>
2995 <!-- Result observation template -->
2997 <xsl:call-template name=
"ccdID">
2998 <xsl:with-param name=
"ccrObjectID" select=
"$ccrTestNode/a:CCRDataObjectID"/>
2999 </xsl:call-template>
3002 <xsl:call-template name=
"ccdCodedValue">
3003 <xsl:with-param name=
"ccrCodedDescription" select=
"$ccrTestNode/a:Description"/>
3004 <xsl:with-param name=
"nodeName" select=
"'code'"/>
3005 </xsl:call-template>
3009 <xsl:attribute name=
"value">
3010 <xsl:text>#
</xsl:text>
3011 <xsl:value-of select=
"$ccrTestNode/a:CCRDataObjectID"/>
3016 <statusCode code=
"completed"/>
3018 <!-- <effectiveTime> -->
3020 <xsl:when test=
"$ccrTestNode/a:DateTime">
3021 <xsl:call-template name=
"ccdDateTime">
3022 <xsl:with-param name=
"dt" select=
"$ccrTestNode/a:DateTime"/>
3023 </xsl:call-template>
3026 <xsl:call-template name=
"ccdDateTime">
3027 <xsl:with-param name=
"dt" select=
"$testDate"/>
3028 </xsl:call-template>
3033 <xsl:when test=
"$ccrTestNode/a:TestResult[a:Value!='']">
3034 <value xsi:
type=
"PQ">
3035 <xsl:attribute name=
"value">
3036 <xsl:value-of select=
"$ccrTestNode/a:TestResult/a:Value"/>
3038 <xsl:attribute name=
"unit">
3039 <xsl:value-of select=
"$ccrTestNode/a:TestResult/a:Units/a:Unit"/>
3043 <xsl:when test=
"$ccrTestNode/a:TestResult[a:Description/a:Text!='']">
3044 <value xsi:
type=
"TX">
3045 <xsl:attribute name=
"value">
3046 <xsl:value-of select=
"$ccrTestNode/a:TestResult/a:Description/a:Text"/>
3052 <xsl:if test=
"$ccrTestNode/a:Flag">
3053 <xsl:call-template name=
"ccdCodedValue">
3054 <xsl:with-param name=
"ccrCodedDescription" select=
"$ccrTestNode/a:Flag"/>
3055 <xsl:with-param name=
"nodeName" select=
"'interpretationCode'"/>
3056 <xsl:with-param name=
"domain" select=
"'ObservationInterpretation'"/>
3057 </xsl:call-template>
3060 <xsl:if test=
"$ccrTestNode/a:NormalResult">
3062 <xsl:if test=
"$ccrTestNode/a:NormalResult/a:Normal/a:Description/a:Text">
3065 <xsl:value-of select=
"$ccrTestNode/a:NormalResult/a:Normal/a:Description/a:Text"/>