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"/>
628 <xsl:apply-templates select=
"a:DateTime"/>
633 <xsl:apply-templates select=
"a:Description/a:Code"/>
636 <xsl:value-of select=
"a:Description/a:Text"/>
639 <xsl:for-each select=
"a:Locations/a:Location">
640 <xsl:value-of select=
"a:Description/a:Text"/>
641 <xsl:if test=
"a:Actor">
642 (
<xsl:call-template name=
"actorName">
643 <xsl:with-param name=
"objID" select=
"a:Actor/a:ActorID"/>
645 <xsl:if test=
"a:Actor/a:ActorRole/a:Text">
646 <xsl:text xml:
space=
"preserve"> -
</xsl:text><xsl:value-of select=
"a:ActorRole/a:Text"/>)
649 <xsl:if test=
"position() != last()">
655 <xsl:for-each select=
"a:Substance">
656 <xsl:value-of select=
"a:Text"/>
660 <xsl:value-of select=
"a:Method/a:Text"/>
663 <xsl:value-of select=
"a:Position/a:Text"/>
666 <xsl:value-of select=
"a:Site/a:Text"/>
669 <xsl:value-of select=
"a:Status/a:Text"/>
672 <xsl:call-template name=
"actorName">
673 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
682 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
683 <entry typeCode=
"DRIV">
684 <procedure classCode=
"PROC" moodCode=
"EVN">
685 <templateId root=
"2.16.840.1.113883.3.88.11.83.17" assigningAuthorityName=
"HITSP C83"/>
686 <templateId root=
"2.16.840.1.113883.10.20.1.29" assigningAuthorityName=
"CCD"/>
687 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.19" assigningAuthorityName=
"IHE PCC"/>
690 <xsl:call-template name=
"ccdID">
691 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
695 <xsl:call-template name=
"ccdCodedValue">
696 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Description"/>
697 <xsl:with-param name=
"nodeName" select=
"'code'"/>
702 <xsl:attribute name=
"value">
703 <xsl:text>#
</xsl:text>
704 <xsl:value-of select=
"a:CCRDataObjectID"/>
709 <xsl:call-template name=
"ccdStatusProcedure">
710 <xsl:with-param name=
"status" select=
"a:Status"/>
713 <xsl:call-template name=
"ccdDateTime">
714 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
717 <xsl:if test=
"a:Method">
718 <xsl:call-template name=
"ccdCodedValue">
719 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Method"/>
720 <xsl:with-param name=
"nodeName" select=
"'approachSiteCode'"/>
724 <xsl:if test=
"a:Site">
725 <xsl:call-template name=
"ccdCodedValue">
726 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Site"/>
727 <xsl:with-param name=
"nodeName" select=
"'targetSiteCode'"/>
731 <xsl:if test=
"a:Practitioners/a:Practitioner">
732 <xsl:call-template name=
"ccdPerformer">
733 <xsl:with-param name=
"ccrActorReference" select=
"a:Practitioners/a:Practitioner[1]"/>
742 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:Medications">
745 <templateId root=
"2.16.840.1.113883.3.88.11.83.112" assigningAuthorityName=
"HITSP/C83"/>
746 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.3.19" assigningAuthorityName=
"IHE PCC"/>
747 <templateId root=
"2.16.840.1.113883.10.20.1.8" assigningAuthorityName=
"HL7 CCD"/>
748 <!--Medications section template-->
749 <code code=
"10160-0" codeSystem=
"2.16.840.1.113883.6.1" codeSystemName=
"LOINC" displayName=
"History of medication use"/>
750 <title>Medications
</title>
767 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Medications/a:Medication">
770 <xsl:value-of select=
"a:Product/a:ProductName/a:Text"/>
771 <xsl:if test=
"a:Product/a:BrandName">
772 <xsl:text xml:
space=
"preserve"> </xsl:text>(
<xsl:value-of select=
"a:Product/a:BrandName/a:Text"/>)
776 <xsl:call-template name=
"date:format-date">
777 <xsl:with-param name=
"date-time" select=
"a:DateTime/a:ExactDateTime"/>
781 <xsl:value-of select=
"a:Status/a:Text"/>
784 <xsl:value-of select=
"a:Product/a:Form/a:Text"/>
787 <xsl:for-each select=
"a:Product/a:Strength">
788 <xsl:if test=
"position() > 1">
789 <xsl:text>/
</xsl:text>
791 <xsl:value-of select=
"a:Value"/>
792 <xsl:text xml:
space=
"preserve"> </xsl:text>
793 <xsl:value-of select=
"a:Units/a:Unit"/>
797 <xsl:value-of select=
"a:Quantity/a:Value"/>
798 <xsl:text xml:
space=
"preserve"> </xsl:text>
799 <xsl:value-of select=
"a:Quantity/a:Units/a:Unit"/>
802 <xsl:for-each select=
"a:Directions/a:Direction">
804 <xsl:when test=
"a:Description/a:Text">
805 <xsl:value-of select=
"a:Description/a:Text"/>
808 <xsl:value-of select=
"a:Dose/a:Value"/>
809 <xsl:text xml:
space=
"preserve"> </xsl:text>
810 <xsl:value-of select=
"a:Dose/a:Units/a:Unit"/>
811 <xsl:text xml:
space=
"preserve"> </xsl:text>
812 <xsl:value-of select=
"a:Route/a:Text"/>
813 <xsl:text xml:
space=
"preserve"> </xsl:text>
814 <xsl:value-of select=
"a:Frequency/a:Value"/>
815 <xsl:if test=
"a:Duration">
816 <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>
818 <xsl:if test=
"a:MultipleDirectionModifier/a:ObjectAttribute">
819 <xsl:for-each select=
"a:MultipleDirectionModifier/a:ObjectAttribute">
820 <xsl:value-of select=
"a:Attribute"/>
822 <xsl:value-of select=
"a:AttributeValue/a:Value"/>
830 <xsl:for-each select=
"a:Directions/a:Direction[1]/a:Indication">
831 <xsl:call-template name=
"problemDescription">
832 <xsl:with-param name=
"objID" select=
"a:InternalCCRLink/a:LinkID"/>
838 <xsl:for-each select=
"a:PatientInstructions/a:Instruction">
839 <xsl:value-of select=
"a:Text"/>
844 <xsl:for-each select=
"a:Refills/a:Refill">
845 <xsl:value-of select=
"a:Number"/>
846 <xsl:text xml:
space=
"preserve"> </xsl:text>
850 <xsl:call-template name=
"actorName">
851 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
859 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Medications/a:Medication">
860 <entry typeCode=
"DRIV">
861 <substanceAdministration classCode=
"SBADM" moodCode=
"EVN">
862 <templateId root=
"2.16.840.1.113883.10.20.1.24" assigningAuthorityName=
"CCD"/>
863 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.7.1" assigningAuthorityName=
"IHE PCC"/>
865 <!--Medication activity template -->
868 <xsl:call-template name=
"ccdID">
869 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
872 <statusCode code='completed'
/>
874 <xsl:call-template name=
"ccdDateTime">
875 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
876 <xsl:with-param name=
"type" select=
"'IVL_TS'"/>
879 <xsl:call-template name=
"ccdMedicationFrequency">
880 <xsl:with-param name=
"frequency" select=
"a:Directions/a:Direction/a:Frequency"/>
883 <xsl:call-template name=
"ccdCodedValue">
884 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Directions/a:Direction/a:Route"/>
885 <xsl:with-param name=
"nodeName" select=
"'routeCode'"/>
886 <xsl:with-param name=
"domain" select=
"'RouteOfAdministration'"/>
889 <xsl:if test=
"a:Directions/a:Direction/a:Dose">
892 <xsl:attribute name=
"value">
893 <xsl:value-of select=
"a:Directions/a:Direction/a:Dose/a:Value"></xsl:value-of>
895 <xsl:attribute name=
"unit">
896 <xsl:value-of select=
"a:Directions/a:Direction/a:Dose/a:Unit"></xsl:value-of>
900 <xsl:attribute name=
"value">
901 <xsl:value-of select=
"a:Directions/a:Direction/a:Dose/a:Value"></xsl:value-of>
903 <xsl:attribute name=
"unit">
904 <xsl:value-of select=
"a:Directions/a:Direction/a:Dose/a:Unit"></xsl:value-of>
910 <manufacturedProduct>
911 <templateId root=
"2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName=
"HITSP C83"/>
912 <templateId root=
"2.16.840.1.113883.10.20.1.53" assigningAuthorityName=
"CCD"/>
913 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName=
"IHE PCC"/>
915 <!-- Product template -->
917 <manufacturedMaterial>
918 <xsl:call-template name=
"ccdCodedValue">
919 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Product/a:ProductName"/>
920 <xsl:with-param name=
"nodeName" select=
"'code'"/>
923 <xsl:value-of select=
"a:Product/a:BrandName/a:Text"/>
925 </manufacturedMaterial>
926 </manufacturedProduct>
928 </substanceAdministration>
934 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:Immunizations">
937 <templateId root=
"2.16.840.1.113883.10.20.1.6"/>
938 <code code=
"11369-6" codeSystem=
"2.16.840.1.113883.6.1"/>
939 <title>Immunizations
</title>
951 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Immunizations/a:Immunization">
953 <xsl:attribute name=
"id">
954 <xsl:value-of select=
"a:CCRDataObjectID"/>
957 <xsl:apply-templates select=
"a:Product/a:ProductName/a:Code"/>
961 <xsl:value-of select=
"a:Product/a:ProductName/a:Text"/>
962 <xsl:if test=
"a:Product/a:Form">
963 <xsl:text xml:
space=
"preserve"> </xsl:text>(
<xsl:value-of select=
"a:Product/a:Form/a:Text"/>)
967 <xsl:call-template name=
"date:format-date">
968 <xsl:with-param name=
"date-time" select=
"a:DateTime/a:ExactDateTime"/>
972 <xsl:value-of select=
"a:Directions/a:Direction/a:Route/a:Text"/>
975 <xsl:attribute name=
"id">
976 <xsl:value-of select=
"a:CCRDataObjectID"/>
977 <xsl:text>:Site
</xsl:text>
980 <xsl:value-of select=
"a:Directions/a:Direction/a:Site/a:Text"/>
983 <xsl:call-template name=
"actorName">
984 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
992 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Immunizations/a:Immunization">
993 <entry typeCode=
"DRIV">
994 <substanceAdministration classCode=
"SBADM" moodCode=
"EVN">
995 <templateId root=
"2.16.840.1.113883.10.20.1.24" assigningAuthorityName=
"CCD"/>
996 <templateId root=
"2.16.840.1.113883.3.88.11.83.13" assigningAuthorityName=
"HITSP C83"/>
997 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.12" assigningAuthorityName=
"IHE PCC"/>
999 <!-- Medication activity template -->
1002 <xsl:call-template name=
"ccdID">
1003 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1004 </xsl:call-template>
1006 <code code=
"IMMUNIZ" codeSystem=
"2.16.840.1.113883.5.4" codeSystemName=
"HL7 ActCode"/>
1009 <xsl:attribute name=
"value">
1010 <xsl:text>#
</xsl:text>
1011 <xsl:value-of select=
"a:CCRDataObjectID"/>
1016 <statusCode code='completed'
/>
1018 <xsl:call-template name=
"ccdDateTime">
1019 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
1020 <xsl:with-param name=
"type" select=
"'IVL_TS'"/>
1021 </xsl:call-template>
1023 <xsl:call-template name=
"ccdCodedValue">
1024 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Directions/a:Direction/a:Route"/>
1025 <xsl:with-param name=
"nodeName" select=
"'routeCode'"/>
1026 <xsl:with-param name=
"domain" select=
"'RouteOfAdministration'"/>
1027 </xsl:call-template>
1029 <xsl:if test=
"a:Directions/a:Direction/a:Site">
1030 <xsl:call-template name=
"ccdCodedValue">
1031 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Directions/a:Direction/a:Site"/>
1032 <xsl:with-param name=
"nodeName" select=
"'approachSiteCode'"/>
1033 <xsl:with-param name=
"originalTextReference">
1034 <xsl:text>#
</xsl:text>
1035 <xsl:value-of select=
"a:CCRDataObjectID"/>
1036 <xsl:text>:Site
</xsl:text>
1038 </xsl:call-template>
1042 <manufacturedProduct>
1043 <templateId root=
"2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName=
"HITSP C83"/>
1044 <templateId root=
"2.16.840.1.113883.10.20.1.53" assigningAuthorityName=
"CCD"/>
1045 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName=
"IHE PCC"/>
1047 <!-- Product template -->
1049 <manufacturedMaterial>
1050 <xsl:call-template name=
"ccdCodedValue">
1051 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Product/a:ProductName"/>
1052 <xsl:with-param name=
"nodeName" select=
"'code'"/>
1053 </xsl:call-template>
1055 <xsl:value-of select=
"a:Product/a:BrandName/a:Text"/>
1057 </manufacturedMaterial>
1058 </manufacturedProduct>
1061 </substanceAdministration>
1067 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:VitalSigns">
1070 <templateId root=
"2.16.840.1.113883.10.20.1.16"/>
1071 <code code=
"8716-3" codeSystem=
"2.16.840.1.113883.6.1"/>
1072 <title>Vital Signs
</title>
1082 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:VitalSigns/a:Result">
1084 <xsl:attribute name=
"id">
1085 <xsl:value-of select=
"a:CCRDataObjectID"/>
1089 <xsl:value-of select=
"a:Description/a:Text"/>
1092 <xsl:call-template name=
"date:format-date">
1093 <xsl:with-param name=
"date-time" select=
"a:DateTime/a:ExactDateTime"/>
1094 </xsl:call-template>
1097 <xsl:for-each select=
"a:Test">
1098 <xsl:value-of select=
"a:Description/a:Text"/>
1099 <xsl:text xml:
space=
"preserve"> </xsl:text>
1100 <xsl:value-of select=
"a:TestResult/a:Value"/>
1101 <xsl:text xml:
space=
"preserve"> </xsl:text>
1102 <xsl:value-of select=
"a:TestResult/a:Units/a:Unit"/>
1103 <xsl:text xml:
space=
"preserve"> </xsl:text>
1104 <xsl:value-of select=
"a:Flag/a:Text"/>
1109 <xsl:call-template name=
"actorName">
1110 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
1111 </xsl:call-template>
1118 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:VitalSigns/a:Result">
1119 <entry typeCode=
"DRIV">
1120 <organizer classCode=
"CLUSTER" moodCode=
"EVN">
1121 <templateId root=
"2.16.840.1.113883.10.20.1.32" assigningAuthorityName=
"CCD"/>
1122 <templateId root=
"2.16.840.1.113883.10.20.1.35" assigningAuthorityName=
"CCD"/>
1123 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.13.1" assigningAuthorityName=
"IHE PCC"/>
1124 <!-- Vital signs organizer template -->
1126 <xsl:variable name=
"testDate" select=
"a:DateTime"/>
1129 <xsl:call-template name=
"ccdID">
1130 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1131 </xsl:call-template>
1133 <code code=
"46680005" codeSystem=
"2.16.840.1.113883.6.96" displayName=
"Vital signs" codeSystemName=
"SNOMED CT"/>
1134 <statusCode code=
"completed"/>
1135 <xsl:call-template name=
"ccdDateTime">
1136 <xsl:with-param name=
"dt" select=
"$testDate"/>
1137 </xsl:call-template>
1139 <xsl:call-template name=
"ccdObservation">
1140 <xsl:with-param name=
"ccrTestNode" select=
"a:Test[1]"/>
1141 <xsl:with-param name=
"testDate" select=
"$testDate"/>
1142 </xsl:call-template>
1150 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:Encounters">
1153 <templateId root=
"2.16.840.1.113883.3.88.11.83.127" assigningAuthorityName=
"HITSP/C83"/>
1154 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.1.5.3.3" assigningAuthorityName=
"IHE PCC"/>
1155 <templateId root=
"2.16.840.1.113883.10.20.1.3" assigningAuthorityName=
"HL7 CCD"/>
1156 <!--Encounters section template-->
1157 <code code=
"46240-8" codeSystem=
"2.16.840.1.113883.6.1" codeSystemName=
"LOINC" displayName=
"History of encounters"/>
1158 <title>Encounters
</title>
1167 <th>Practitioner
</th>
1168 <th>Description
</th>
1169 <th>Indications
</th>
1172 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Encounters/a:Encounter">
1174 <xsl:attribute name=
"id">
1175 <xsl:value-of select=
"a:CCRDataObjectID"/>
1179 <xsl:value-of select=
"a:Type/a:Text"/>
1182 <xsl:call-template name=
"date:format-date">
1183 <xsl:with-param name=
"date-time" select=
"a:DateTime/a:ExactDateTime"/>
1184 </xsl:call-template>
1187 <xsl:for-each select=
"a:Locations/a:Location">
1188 <xsl:value-of select=
"a:Description/a:Text"/>
1189 <xsl:call-template name=
"actorName">
1190 <xsl:with-param name=
"objID" select=
"a:Actor/a:ActorID"/>
1191 </xsl:call-template>
1196 <xsl:value-of select=
"a:Status/a:Text"/>
1199 <xsl:for-each select=
"a:Practitioners/a:Practitioner">
1200 <xsl:call-template name=
"actorName">
1201 <xsl:with-param name=
"objID" select=
"a:ActorID"/>
1202 </xsl:call-template>
1207 <xsl:value-of select=
"a:Description/a:Text"/>
1210 <xsl:for-each select=
"a:Indications/a:Indication">
1211 <xsl:call-template name=
"problemDescription">
1212 <xsl:with-param name=
"objID" select=
"a:InternalCCRLink/a:LinkID"/>
1213 </xsl:call-template>
1218 <xsl:call-template name=
"actorName">
1219 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
1220 </xsl:call-template>
1227 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Encounters/a:Encounter">
1228 <entry typeCode=
"DRIV">
1229 <encounter classCode=
"ENC" moodCode=
"EVN">
1230 <templateId root=
"2.16.840.1.113883.3.88.11.83.16" assigningAuthorityName=
"HITSP C83"/>
1231 <templateId root=
"2.16.840.1.113883.10.20.1.21" assigningAuthorityName=
"CCD"/>
1232 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.14" assigningAuthorityName=
"IHE PCC"/>
1234 <!-- Encounter activity template -->
1237 <xsl:call-template name=
"ccdID">
1238 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1239 </xsl:call-template>
1241 <xsl:call-template name=
"ccdCodedValue">
1242 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Description"/>
1243 <xsl:with-param name=
"nodeName" select=
"'code'"/>
1244 </xsl:call-template>
1248 <xsl:attribute name=
"value">
1249 <xsl:text>#
</xsl:text>
1250 <xsl:value-of select=
"a:CCRDataObjectID"/>
1255 <xsl:call-template name=
"ccdDateTime">
1256 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
1257 </xsl:call-template>
1259 <xsl:if test=
"a:Practitioners[1]/a:Practitioner">
1260 <xsl:call-template name=
"ccdPerformer">
1261 <xsl:with-param name=
"ccrActorReference" select=
"a:Practitioners/a:Practitioner[1]"/>
1262 </xsl:call-template>
1265 <xsl:if test=
"a:Locations[1]/a:Location">
1266 <participant typeCode=
"LOC">
1267 <templateId root=
"2.16.840.1.113883.10.20.1.45"/>
1268 <!-- Location participation template -->
1270 <xsl:when test=
"a:Locations[1]/a:Location/a:ActorID">
1271 <xsl:call-template name=
"ccdParticipantRoleActor">
1272 <xsl:with-param name=
"ccrActorObjectID" select=
"a:Locations[1]/a:Location/a:ActorID"/>
1273 </xsl:call-template>
1276 <xsl:call-template name=
"ccdParticipantRoleCodedDescription">
1277 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Locations[1]/a:Location/a:Description"/>
1278 </xsl:call-template>
1289 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:SocialHistory">
1292 <templateId root=
"2.16.840.1.113883.10.20.1.15"/>
1293 <code code=
"29762-2" codeSystem=
"2.16.840.1.113883.6.1"/>
1294 <title>Social History
</title>
1302 <th>Description
</th>
1306 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement">
1309 <xsl:value-of select=
"a:Type/a:Text"/>
1312 <xsl:call-template name=
"date:format-date">
1313 <xsl:with-param name=
"date-time" select=
"a:DateTime/a:ExactDateTime"/>
1314 </xsl:call-template>
1317 <xsl:apply-templates select=
"a:Description/a:Code"/>
1320 <xsl:value-of select=
"a:Description/a:Text" disable-output-escaping=
"yes"/>
1323 <xsl:value-of select=
"a:Status/a:Text"/>
1326 <xsl:call-template name=
"actorName">
1327 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
1328 </xsl:call-template>
1335 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement">
1336 <entry typeCode=
"DRIV">
1337 <observation classCode=
"OBS" moodCode=
"EVN">
1338 <templateId root=
"2.16.840.1.113883.3.88.11.83.19" assigningAuthorityName=
"HITSP C83"/>
1339 <templateId root=
"2.16.840.1.113883.10.20.1.33" assigningAuthorityName=
"CCD"/>
1340 <!-- Social history observation template -->
1342 <xsl:call-template name=
"ccdID">
1343 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1344 </xsl:call-template>
1345 <statusCode code=
"completed"/>
1346 <xsl:call-template name=
"ccdDateTime">
1347 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
1348 </xsl:call-template>
1349 <entryRelationship typeCode=
"SUBJ" inversionInd=
"true">
1350 <observation classCode=
"OBS" moodCode=
"EVN">
1351 <templateId root=
"2.16.840.1.113883.10.20.1.41"/>
1352 <!-- Episode observation template -->
1353 <statusCode code=
"completed"/>
1354 <entryRelationship typeCode=
"SAS">
1355 <observation classCode=
"OBS" moodCode=
"EVN">
1356 <xsl:call-template name=
"ccdCodedValue">
1357 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Description"/>
1358 <xsl:with-param name=
"nodeName" select=
"'code'"/>
1359 </xsl:call-template>
1361 </entryRelationship>
1363 </entryRelationship>
1370 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:FamilyHistory">
1373 <templateId root=
"2.16.840.1.113883.10.20.1.4"/>
1374 <code code=
"10157-6" codeSystem=
"2.16.840.1.113883.6.1"/>
1375 <title>Family History
</title>
1383 <th>Description
</th>
1384 <th>Relationship(s)
</th>
1388 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:FamilyHistory/a:FamilyProblemHistory">
1391 <xsl:value-of select=
"a:Type/a:Text"/>
1394 <xsl:call-template name=
"date:format-date">
1395 <xsl:with-param name=
"date-time" select=
"a:DateTime/a:ExactDateTime"/>
1396 </xsl:call-template>
1399 <xsl:apply-templates select=
"a:Problem/a:Description/a:Code"/>
1402 <xsl:for-each select=
"a:Problem">
1403 <xsl:value-of select=
"a:Description/a:Text"/>
1408 <xsl:value-of select=
"a:FamilyMember/a:ActorRole/a:Text"/>
1411 <xsl:value-of select=
"a:Status/a:Text"/>
1414 <xsl:call-template name=
"actorName">
1415 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
1416 </xsl:call-template>
1426 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:Results/a:Result">
1429 <templateId root=
"2.16.840.1.113883.10.20.1.14"/>
1430 <code code=
"30954-2" codeSystem=
"2.16.840.1.113883.6.1"/>
1431 <title>Results
</title>
1441 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Results/a:Result">
1443 <xsl:attribute name=
"id">
1444 <xsl:value-of select=
"a:CCRDataObjectID"/>
1447 <xsl:value-of select=
"a:Description/a:Text"/>
1450 <xsl:call-template name=
"date:format-date">
1451 <xsl:with-param name=
"date-time" select=
"a:DateTime/a:ExactDateTime"/>
1452 </xsl:call-template>
1455 <xsl:for-each select=
"a:Test[a:TestResult/a:Value!='']">
1457 <xsl:attribute name=
"id">
1458 <xsl:value-of select=
"a:CCRDataObjectID"/>
1461 <xsl:value-of select=
"a:Description/a:Text"/>
1462 <xsl:text xml:
space=
"preserve"> </xsl:text>
1463 <xsl:value-of select=
"a:TestResult/a:Value"/>
1464 <xsl:text xml:
space=
"preserve"> </xsl:text>
1465 <xsl:value-of select=
"a:TestResult/a:Units/a:Unit"/>
1466 <xsl:text xml:
space=
"preserve"> </xsl:text>
1467 <xsl:value-of select=
"a:Flag/a:Text"/>
1473 <xsl:call-template name=
"actorName">
1474 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
1475 </xsl:call-template>
1482 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Results/a:Result">
1483 <entry typeCode=
"DRIV">
1484 <xsl:variable name=
"testDate" select=
"a:DateTime"/>
1487 <xsl:when test=
"count(a:Test)>1">
1488 <organizer classCode=
"BATTERY" moodCode=
"EVN">
1489 <templateId root=
"2.16.840.1.113883.10.20.1.32"/>
1490 <!--Result organizer template -->
1493 <xsl:call-template name=
"ccdID">
1494 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1495 </xsl:call-template>
1498 <xsl:call-template name=
"ccdCodedValue">
1499 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Description"/>
1500 <xsl:with-param name=
"nodeName" select=
"'code'"/>
1501 </xsl:call-template>
1503 <statusCode code=
"completed"/>
1505 <!-- <effectiveTime> -->
1506 <xsl:call-template name=
"ccdDateTime">
1507 <xsl:with-param name=
"dt" select=
"$testDate"/>
1508 </xsl:call-template>
1510 <xsl:call-template name=
"ccdPerformer">
1511 <xsl:with-param name=
"ccrActorReference" select=
"a:Source/a:Actor"/>
1512 </xsl:call-template>
1514 <xsl:for-each select=
"a:Test">
1515 <xsl:call-template name=
"ccdObservation">
1516 <xsl:with-param name=
"ccrTestNode" select=
"."/>
1517 <xsl:with-param name=
"testDate" select=
"$testDate"/>
1518 </xsl:call-template>
1525 <xsl:call-template name=
"ccdObservation">
1526 <xsl:with-param name=
"ccrTestNode" select=
"a:Test[1]"/>
1527 <xsl:with-param name=
"testDate" select=
"$testDate"/>
1528 </xsl:call-template>
1536 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:Payers">
1539 <templateId root=
"2.16.840.1.113883.10.20.1.9"/>
1540 <code code=
"48768-6" codeSystem=
"2.16.840.1.113883.6.1"/>
1541 <title>Insurance
</title>
1548 <th>Identification Numbers
</th>
1549 <th>Payment Provider
</th>
1553 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Payers/a:Payer">
1556 <xsl:value-of select=
"a:Type/a:Text"/>
1559 <xsl:call-template name=
"date:format-date">
1560 <xsl:with-param name=
"date-time" select=
"a:DateTime/a:ExactDateTime"/>
1561 </xsl:call-template>
1564 <xsl:for-each select=
"a:IDs">
1565 <xsl:value-of select=
"a:Type/a:Text"/>:
<xsl:text xml:
space=
"preserve"> </xsl:text><xsl:value-of select=
"a:ID"/><br/>
1569 <xsl:call-template name=
"actorName">
1570 <xsl:with-param name=
"objID" select=
"a:PaymentProvider/a:ActorID"/>
1571 </xsl:call-template>
1574 <xsl:call-template name=
"actorName">
1575 <xsl:with-param name=
"objID" select=
"a:Subscriber/a:ActorID"/>
1576 </xsl:call-template>
1579 <xsl:call-template name=
"actorName">
1580 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
1581 </xsl:call-template>
1588 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:Payers/a:Payer">
1589 <entry typeCode=
"DRIV">
1590 <act classCode=
"ACT" moodCode=
"DEF">
1591 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.17" assigningAuthorityName=
"IHE PCC"/>
1592 <templateId root=
"2.16.840.1.113883.10.20.1.20" assigningAuthorityName=
"CCD"/>
1593 <!-- Coverage entry template -->
1595 <xsl:call-template name=
"ccdID">
1596 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1597 </xsl:call-template>
1598 <code code=
"48768-6" codeSystem=
"2.16.840.1.113883.6.1" codeSystemName=
"LOINC" displayName=
"Payment sources"/>
1599 <statusCode code=
"completed"/>
1600 <entryRelationship typeCode=
"COMP">
1601 <act classCode=
"ACT" moodCode=
"EVN">
1602 <templateId root=
"2.16.840.1.113883.3.88.11.83.5" assigningAuthorityName=
"HITSP C83"/>
1603 <templateId root=
"2.16.840.1.113883.10.20.1.26" assigningAuthorityName=
"CCD"/>
1604 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.18" assigningAuthorityName=
"IHE PCC"/>
1605 <!--Insurance provider template -->
1607 <xsl:attribute name=
"root">
1608 <xsl:value-of select=
"a:IDs[1]/a:ID"/>
1610 <xsl:attribute name=
"extension">
1611 <xsl:value-of select=
"a:IDs[1]/a:Type/a:Text"/>
1616 <xsl:call-template name=
"ccdCodedValue">
1617 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Description"/>
1618 <xsl:with-param name=
"nodeName" select=
"'code'"/>
1619 </xsl:call-template>
1621 <statusCode code=
"completed"/>
1623 <xsl:call-template name=
"ccdPerformer">
1624 <xsl:with-param name=
"ccrActorReference" select=
"a:PaymentProvider"/>
1625 </xsl:call-template>
1627 <participant typeCode=
"HLD">
1628 <xsl:call-template name=
"ccdParticipantRoleActor">
1629 <xsl:with-param name=
"ccrActorReference" select=
"a:Subscriber"/>
1630 </xsl:call-template>
1633 </entryRelationship>
1640 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:PlanOfCare">
1643 <templateId root=
"2.16.840.1.113883.10.20.1.10"/>
1644 <code code=
"18776-5" codeSystem=
"2.16.840.1.113883.6.1"/>
1645 <title>Plan Of Care
</title>
1647 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Treatment Recommendation']">
1648 <xsl:text>Plan Of Care Recommendations
</xsl:text>
1653 <th>Description
</th>
1654 <th>Recommendation
</th>
1659 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Treatment Recommendation']">
1662 <xsl:value-of select=
"a:Description/a:Text"/>
1665 <xsl:value-of select=
"a:OrderRequest/a:Description/a:Text" disable-output-escaping=
"yes"/>
1668 <xsl:value-of select=
"a:OrderRequest/a:Goals/a:Goal/a:Description/a:Text" disable-output-escaping=
"yes"/>
1671 <xsl:value-of select=
"a:Status/a:Text"/>
1674 <xsl:call-template name=
"actorName">
1675 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
1676 </xsl:call-template>
1683 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Order']">
1684 <xsl:text>Plan Of Care Orders
</xsl:text>
1690 <th>Plan Status
</th>
1703 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Order']">
1706 <xsl:apply-templates select=
"a:Description/a:Text"/>
1709 <xsl:value-of select=
"a:Status/a:Text"/>
1712 <xsl:value-of select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Type/a:Text"/>
1715 <xsl:call-template name=
"date:format-date">
1716 <xsl:with-param name=
"date-time" select=
"a:OrderRequest/a:Procedures/a:Procedure/a:DateTime/a:ExactDateTime"/>
1717 </xsl:call-template>
1720 <xsl:apply-templates select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Description/a:Text"/>
1723 <xsl:text xml:
space=
"preserve">Every
</xsl:text>
1724 <xsl:apply-templates select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Interval/a:Value"/>
1725 <xsl:text xml:
space=
"preserve"> </xsl:text>
1726 <xsl:value-of select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Interval/a:Units/a:Unit"/>
1727 <xsl:text xml:
space=
"preserve"> for
</xsl:text>
1728 <xsl:value-of select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Duration/a:Value"/>
1729 <xsl:text xml:
space=
"preserve"> </xsl:text>
1730 <xsl:value-of select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Duration/a:Units/a:Unit"/>
1733 <xsl:for-each select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Locations">
1734 <xsl:value-of select=
"a:Location/a:Description/a:Text"/>
1735 <xsl:if test=
"position() != last()">
1741 <xsl:value-of select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Substance/a:Text"/>
1744 <xsl:value-of select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Method/a:Text"/>
1747 <xsl:value-of select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Position/a:Text"/>
1750 <xsl:value-of select=
"a:OrderRequest/a:Procedures/a:Procedure/a:Site/a:Text"/>
1754 <xsl:call-template name=
"actorName">
1755 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
1756 </xsl:call-template>
1764 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan/a:OrderRequest/a:Procedures/a:Procedure">
1765 <entry typeCode=
"DRIV">
1766 <observation classCode=
"OBS" moodCode=
"RQO">
1767 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.1.20.3.1"/>
1770 <xsl:call-template name=
"ccdID">
1771 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1772 </xsl:call-template>
1775 <xsl:call-template name=
"ccdCodedValue">
1776 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Description"/>
1777 <xsl:with-param name=
"nodeName" select=
"'code'"/>
1778 </xsl:call-template>
1780 <statusCode code=
"new"/>
1784 <xsl:when test=
"a:DateTime">
1785 <xsl:call-template name=
"ccdDateTime">
1786 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
1787 </xsl:call-template>
1789 <xsl:when test=
"a:Interval">
1790 <xsl:attribute name=
"xsi:type">PIVL_TS
</xsl:attribute>
1791 <xsl:attribute name=
"operator">A
</xsl:attribute>
1792 <xsl:attribute name=
"institutionSpecified">true
</xsl:attribute>
1794 <xsl:attribute name=
"value">
1795 <xsl:value-of select=
"a:Interval/a:Value"/>
1797 <xsl:attribute name=
"unit">
1798 <xsl:value-of select=
"a:Interval/a:Units/a:Unit"/>
1808 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan/a:OrderRequest/a:Medications/a:Medication">
1809 <entry typeCode=
"DRIV">
1810 <substanceAdministration classCode=
"SBADM" moodCode=
"INT">
1811 <templateId root=
"2.16.840.1.113883.10.20.1.24" assigningAuthorityName=
"CCD"/>
1812 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.7.1" assigningAuthorityName=
"IHE PCC"/>
1814 <!--Medication activity template -->
1817 <xsl:call-template name=
"ccdID">
1818 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1819 </xsl:call-template>
1821 <statusCode code='completed'
/>
1823 <xsl:call-template name=
"ccdDateTime">
1824 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
1825 <xsl:with-param name=
"type" select=
"'IVL_TS'"/>
1826 </xsl:call-template>
1828 <xsl:call-template name=
"ccdMedicationFrequency">
1829 <xsl:with-param name=
"frequency" select=
"a:Directions/a:Direction/a:Frequency"/>
1830 </xsl:call-template>
1832 <xsl:call-template name=
"ccdCodedValue">
1833 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Directions/a:Direction/a:Route"/>
1834 <xsl:with-param name=
"nodeName" select=
"'routeCode'"/>
1835 <xsl:with-param name=
"domain" select=
"'RouteOfAdministration'"/>
1836 </xsl:call-template>
1838 <xsl:if test=
"a:Directions/a:Direction/a:Dose">
1841 <xsl:attribute name=
"value">
1842 <xsl:value-of select=
"a:Directions/a:Direction/a:Dose/a:Value"></xsl:value-of>
1844 <xsl:attribute name=
"unit">
1845 <xsl:value-of select=
"a:Directions/a:Direction/a:Dose/a:Unit"></xsl:value-of>
1849 <xsl:attribute name=
"value">
1850 <xsl:value-of select=
"a:Directions/a:Direction/a:Dose/a:Value"></xsl:value-of>
1852 <xsl:attribute name=
"unit">
1853 <xsl:value-of select=
"a:Directions/a:Direction/a:Dose/a:Unit"></xsl:value-of>
1859 <manufacturedProduct>
1860 <templateId root=
"2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName=
"HITSP C83"/>
1861 <templateId root=
"2.16.840.1.113883.10.20.1.53" assigningAuthorityName=
"CCD"/>
1862 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName=
"IHE PCC"/>
1864 <!-- Product template -->
1866 <manufacturedMaterial>
1867 <xsl:call-template name=
"ccdCodedValue">
1868 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Product/a:ProductName"/>
1869 <xsl:with-param name=
"nodeName" select=
"'code'"/>
1870 </xsl:call-template>
1872 <xsl:value-of select=
"a:Product/a:BrandName/a:Text"/>
1874 </manufacturedMaterial>
1875 </manufacturedProduct>
1877 </substanceAdministration>
1880 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan/a:OrderRequest/a:Immunizations/a:Immunization">
1882 <entry typeCode=
"DRIV">
1883 <substanceAdministration classCode=
"SBADM" moodCode=
"EVN">
1884 <templateId root=
"2.16.840.1.113883.10.20.1.24" assigningAuthorityName=
"CCD"/>
1885 <templateId root=
"2.16.840.1.113883.3.88.11.83.13" assigningAuthorityName=
"HITSP C83"/>
1886 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.12" assigningAuthorityName=
"IHE PCC"/>
1888 <!-- Medication activity template -->
1891 <xsl:call-template name=
"ccdID">
1892 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1893 </xsl:call-template>
1895 <code code=
"IMMUNIZ" codeSystem=
"2.16.840.1.113883.5.4" codeSystemName=
"HL7 ActCode"/>
1898 <xsl:attribute name=
"value">
1899 <xsl:text>#
</xsl:text>
1900 <xsl:value-of select=
"a:CCRDataObjectID"/>
1905 <statusCode code='completed'
/>
1907 <xsl:call-template name=
"ccdDateTime">
1908 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
1909 <xsl:with-param name=
"type" select=
"'IVL_TS'"/>
1910 </xsl:call-template>
1912 <xsl:call-template name=
"ccdCodedValue">
1913 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Directions/a:Direction/a:Route"/>
1914 <xsl:with-param name=
"nodeName" select=
"'routeCode'"/>
1915 <xsl:with-param name=
"domain" select=
"'RouteOfAdministration'"/>
1916 </xsl:call-template>
1918 <xsl:if test=
"a:Directions/a:Direction/a:Site">
1919 <xsl:call-template name=
"ccdCodedValue">
1920 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Directions/a:Direction/a:Site"/>
1921 <xsl:with-param name=
"nodeName" select=
"'approachSiteCode'"/>
1922 <xsl:with-param name=
"originalTextReference">
1923 <xsl:text>#
</xsl:text>
1924 <xsl:value-of select=
"a:CCRDataObjectID"/>
1925 <xsl:text>:Site
</xsl:text>
1927 </xsl:call-template>
1931 <manufacturedProduct>
1932 <templateId root=
"2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName=
"HITSP C83"/>
1933 <templateId root=
"2.16.840.1.113883.10.20.1.53" assigningAuthorityName=
"CCD"/>
1934 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName=
"IHE PCC"/>
1936 <!-- Product template -->
1938 <manufacturedMaterial>
1939 <xsl:call-template name=
"ccdCodedValue">
1940 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Product/a:ProductName"/>
1941 <xsl:with-param name=
"nodeName" select=
"'code'"/>
1942 </xsl:call-template>
1944 <xsl:value-of select=
"a:Product/a:BrandName/a:Text"/>
1946 </manufacturedMaterial>
1947 </manufacturedProduct>
1950 </substanceAdministration>
1954 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan/a:OrderRequest/a:Encounters/a:Encounter">
1955 <entry typeCode=
"DRIV">
1956 <encounter classCode=
"ENC" moodCode=
"INT">
1957 <templateId root=
"2.16.840.1.113883.3.88.11.83.16" assigningAuthorityName=
"HITSP C83"/>
1958 <templateId root=
"2.16.840.1.113883.10.20.1.21" assigningAuthorityName=
"CCD"/>
1959 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.14" assigningAuthorityName=
"IHE PCC"/>
1961 <!-- Encounter activity template -->
1964 <xsl:call-template name=
"ccdID">
1965 <xsl:with-param name=
"ccrObjectID" select=
"a:CCRDataObjectID"/>
1966 </xsl:call-template>
1968 <xsl:call-template name=
"ccdCodedValue">
1969 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Description"/>
1970 <xsl:with-param name=
"nodeName" select=
"'code'"/>
1971 </xsl:call-template>
1975 <xsl:attribute name=
"value">
1976 <xsl:text>#
</xsl:text>
1977 <xsl:value-of select=
"a:CCRDataObjectID"/>
1982 <xsl:call-template name=
"ccdDateTime">
1983 <xsl:with-param name=
"dt" select=
"a:DateTime"/>
1984 </xsl:call-template>
1986 <xsl:if test=
"a:Practitioners[1]/a:Practitioner">
1987 <xsl:call-template name=
"ccdPerformer">
1988 <xsl:with-param name=
"ccrActorReference" select=
"a:Practitioners/a:Practitioner[1]"/>
1989 </xsl:call-template>
1992 <xsl:if test=
"a:Locations[1]/a:Location">
1993 <participant typeCode=
"LOC">
1994 <templateId root=
"2.16.840.1.113883.10.20.1.45"/>
1995 <!-- Location participation template -->
1997 <xsl:when test=
"a:Locations[1]/a:Location/a:ActorID">
1998 <xsl:call-template name=
"ccdParticipantRoleActor">
1999 <xsl:with-param name=
"ccrActorObjectID" select=
"a:Locations[1]/a:Location/a:ActorID"/>
2000 </xsl:call-template>
2003 <xsl:call-template name=
"ccdParticipantRoleCodedDescription">
2004 <xsl:with-param name=
"ccrCodedDescription" select=
"a:Locations[1]/a:Location/a:Description"/>
2005 </xsl:call-template>
2016 <xsl:if test=
"a:ContinuityOfCareRecord/a:Body/a:HealthCareProviders">
2019 <title>Health Care Providers
</title>
2027 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Body/a:HealthCareProviders/a:Provider">
2030 <xsl:value-of select=
"a:ActorRole/a:Text"/>
2033 <xsl:call-template name=
"actorName">
2034 <xsl:with-param name=
"objID" select=
"a:Source/a:Actor/a:ActorID"/>
2035 </xsl:call-template>
2046 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:SupportProviders">
2049 <title>Support Providers</title>
2057 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Support/a:SupportProvider">
2060 <xsl:value-of select="a:ActorRole/a:Text"/>
2063 <xsl:call-template name="actorName">
2064 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
2065 </xsl:call-template>
2075 <xsl:if test="a:ContinuityOfCareRecord/a:References">
2078 <title>References</title>
2085 <th>Description</th>
2089 <xsl:for-each select="/a:ContinuityOfCareRecord/a:References/a:Reference">
2092 <xsl:value-of select="a:Type/a:Text"/>
2095 <xsl:call-template name="date:format-date">
2096 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
2097 </xsl:call-template>
2100 <strong class="clinical">
2101 <xsl:value-of select="a:Description/a:Text"/>
2105 <xsl:value-of select="a:Locations/a:Location/a:Description/a:Text"/>
2108 <xsl:call-template name="actorName">
2109 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
2110 </xsl:call-template>
2124 <title>Additional Information About People
& Organizations
</title>
2126 <xsl:if test=
"a:ContinuityOfCareRecord/a:Actors/a:Actor[a:Person]">
2133 <th>Identification Numbers
</th>
2135 <th>Address/ E-mail
</th>
2137 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor">
2138 <xsl:sort select=
"a:Person/a:Name/a:DisplayName|a:Person/a:Name/a:CurrentName/a:Family" data-type=
"text" order=
"ascending"/>
2139 <xsl:if test=
"a:Person">
2142 <xsl:call-template name=
"actorName">
2143 <xsl:with-param name=
"objID" select=
"a:ActorObjectID"/>
2144 </xsl:call-template>
2147 <xsl:value-of select=
"a:Specialty/a:Text"/>
2150 <xsl:value-of select=
"a:Relation/a:Text"/>
2153 <xsl:for-each select=
"a:IDs">
2154 <xsl:value-of select=
"a:Type/a:Text"/>
2155 <xsl:text>:
</xsl:text>
2156 <xsl:value-of select=
"a:ID"/>
2160 <xsl:for-each select=
"a:Telephone">
2161 <xsl:value-of select=
"a:Type/a:Text"/>
2162 <xsl:text>:
</xsl:text>
2163 <xsl:value-of select=
"a:Value"/>
2167 <xsl:for-each select=
"a:Address">
2168 <xsl:if test=
"a:Type">
2169 <xsl:value-of select=
"a:Type/a:Text"/>
2170 <xsl:text>:
</xsl:text>
2173 <xsl:if test=
"a:Line1">
2174 <xsl:value-of select=
"a:Line1"/>
2177 <xsl:if test=
"a:Line2">
2178 <xsl:value-of select=
"a:Line2"/>
2181 <xsl:if test=
"a:City">
2182 <xsl:value-of select=
"a:City"/>
2183 <xsl:text>,
</xsl:text>
2185 <xsl:value-of select=
"a:State"/>
2186 <xsl:value-of select=
"a:PostalCode"/>
2189 <xsl:for-each select=
"a:EMail">
2191 <xsl:value-of select=
"a:Value"/>
2200 <xsl:if test=
"a:ContinuityOfCareRecord/a:Actors/a:Actor[a:Organization]">
2207 <th>Identification Numbers
</th>
2209 <th>Address/ E-mail
</th>
2211 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor">
2212 <xsl:sort select=
"a:Organization/a:Name" data-type=
"text" order=
"ascending"/>
2213 <xsl:if test=
"a:Organization">
2216 <xsl:value-of select=
"a:Organization/a:Name"/>
2219 <xsl:value-of select=
"a:Specialty/a:Text"/>
2222 <xsl:value-of select=
"a:Relation/a:Text"/>
2225 <xsl:for-each select=
"a:IDs">
2226 <xsl:value-of select=
"a:Type/a:Text"/>
2227 <xsl:text>:
</xsl:text>
2228 <xsl:value-of select=
"a:ID"/>
2232 <xsl:for-each select=
"a:Telephone">
2233 <xsl:value-of select=
"a:Type/a:Text"/>
2234 <xsl:text>:
</xsl:text>
2235 <xsl:value-of select=
"a:Value"/>
2239 <xsl:for-each select=
"a:Address">
2240 <xsl:if test=
"a:Type">
2241 <xsl:value-of select=
"a:Type/a:Text"/>
2242 <xsl:text>:
</xsl:text>
2245 <xsl:if test=
"a:Line1">
2246 <xsl:value-of select=
"a:Line1"/>
2249 <xsl:if test=
"a:Line2">
2250 <xsl:value-of select=
"a:Line2"/>
2253 <xsl:if test=
"a:City">
2254 <xsl:value-of select=
"a:City"/>
2255 <xsl:text>,
</xsl:text>
2257 <xsl:value-of select=
"a:State"/>
2258 <xsl:value-of select=
"a:PostalCode"/>
2261 <xsl:for-each select=
"a:EMail">
2263 <xsl:value-of select=
"a:Value"/>
2272 <xsl:if test=
"a:ContinuityOfCareRecord/a:Actors/a:Actor[a:InformationSystem]">
2279 <th>Identification Numbers
</th>
2281 <th>Address/ E-mail
</th>
2283 <xsl:for-each select=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor">
2284 <xsl:sort select=
"a:InformationSystem/a:Name" data-type=
"text" order=
"ascending"/>
2285 <xsl:if test=
"a:InformationSystem">
2288 <xsl:value-of select=
"a:InformationSystem/a:Name"/>
2291 <xsl:value-of select=
"a:InformationSystem/a:Type"/>
2294 <xsl:value-of select=
"a:InformationSystem/a:Version"/>
2297 <xsl:for-each select=
"a:IDs">
2298 <xsl:value-of select=
"a:Type/a:Text"/>
2299 <xsl:text>:
</xsl:text>
2300 <xsl:value-of select=
"a:ID"/>
2304 <xsl:for-each select=
"a:Telephone">
2305 <xsl:value-of select=
"a:Type/a:Text"/>
2306 <xsl:text>:
</xsl:text>
2307 <xsl:value-of select=
"a:Value"/>
2311 <xsl:for-each select=
"a:Address">
2312 <xsl:if test=
"Type">
2313 <xsl:value-of select=
"a:Type/a:Text"/>
2314 <xsl:text>:
</xsl:text>
2317 <xsl:if test=
"a:Line1">
2318 <xsl:value-of select=
"a:Line1"/>
2321 <xsl:if test=
"a:Line2">
2322 <xsl:value-of select=
"a:Line2"/>
2325 <xsl:if test=
"a:City">
2326 <xsl:value-of select=
"a:City"/>
2327 <xsl:text>,
</xsl:text>
2329 <xsl:value-of select=
"a:State"/>
2330 <xsl:value-of select=
"a:PostalCode"/>
2333 <xsl:for-each select=
"a:EMail">
2335 <xsl:value-of select=
"a:Value"/>
2353 <xsl:template name=
"ccdAssignedEntity">
2354 <xsl:param name=
"ccrActorObjectID"/>
2356 <xsl:variable name=
"CCRActor" select=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2359 <xsl:call-template name=
"ccdEntityID">
2360 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2361 </xsl:call-template>
2363 <xsl:call-template name=
"ccdAddress">
2364 <xsl:with-param name=
"CCRActorAddress" select=
"$CCRActor/a:Address"/>
2365 </xsl:call-template>
2367 <xsl:call-template name=
"ccdTelecom">
2368 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2369 </xsl:call-template>
2371 <xsl:if test=
"$CCRActor/a:Person">
2372 <xsl:call-template name=
"ccdPerson">
2373 <xsl:with-param name=
"CCRActorPerson" select=
"$CCRActor/a:Person"/>
2374 <xsl:with-param name=
"personNodeName" select=
"'assignedPerson'"/>
2375 </xsl:call-template>
2378 <xsl:if test=
"$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']">
2379 <xsl:call-template name=
"ccdOrganization">
2380 <xsl:with-param name=
"ccrActorObjectID" select=
"$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']/a:LinkID"/>
2381 <xsl:with-param name=
"organizationNodeName" select=
"'representedOrganization'"/>
2382 </xsl:call-template>
2388 <xsl:template name=
"ccdPatient">
2389 <xsl:param name=
"CCRActorPerson"/>
2391 <xsl:call-template name=
"ccdPersonName">
2392 <xsl:with-param name=
"CCRActorName" select=
"$CCRActorPerson/a:Name"/>
2393 </xsl:call-template>
2395 <xsl:if test=
"$CCRActorPerson/a:Gender">
2396 <xsl:call-template name=
"ccdCodedValue">
2397 <xsl:with-param name=
"ccrCodedDescription" select=
"$CCRActorPerson/a:Gender"/>
2398 <xsl:with-param name=
"domain" select=
"'AdministrativeGender'"/>
2399 <xsl:with-param name=
"nodeName" select=
"'administrativeGenderCode'"/>
2400 </xsl:call-template>
2403 <xsl:if test=
"$CCRActorPerson/a:DateOfBirth">
2405 <xsl:attribute name=
"value">
2406 <xsl:call-template name=
"date:format-date">
2407 <xsl:with-param name=
"date-time" select=
"$CCRActorPerson/a:DateOfBirth/a:ExactDateTime"/>
2408 <xsl:with-param name=
"pattern">yyyyMMddhhmmss
</xsl:with-param>
2409 </xsl:call-template>
2414 <xsl:if test=
"/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Marital Status']">
2415 <xsl:call-template name=
"ccdCodedValue">
2416 <xsl:with-param name=
"ccrCodedDescription" select=
"/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Marital Status']/a:Description"/>
2417 <xsl:with-param name=
"domain" select=
"'MaritalStatus'"/>
2418 <xsl:with-param name=
"nodeName" select=
"'maritalStatusCode'"/>
2419 </xsl:call-template>
2422 <xsl:if test=
"/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Language']">
2423 <languageCommunication>
2424 <templateId root=
"2.16.840.1.113883.3.88.11.83.2" assigningAuthorityName=
"HITSP/C83"/>
2425 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.2.1" assigningAuthorityName=
"IHE/PCC"/>
2426 <xsl:call-template name=
"ccdCodedValue">
2427 <xsl:with-param name=
"ccrCodedDescription" select=
"/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Language']/a:Description"></xsl:with-param>
2428 <xsl:with-param name=
"domain" select=
"'HumanLanguage'"/>
2429 <xsl:with-param name=
"nodeName" select=
"'languageCode'"/>
2430 </xsl:call-template>
2431 </languageCommunication>
2436 <xsl:template name=
"ccdPerformer">
2437 <xsl:param name=
"ccrActorReference"/>
2438 <performer typeCode=
"PRF">
2439 <xsl:if test=
"$ccrActorReference/a:ActorRole">
2440 <xsl:call-template name=
"ccdCodedValue">
2441 <xsl:with-param name=
"ccrCodedDescription" select=
"$ccrActorReference/a:ActorRole"/>
2442 <xsl:with-param name=
"nodeName" select=
"'functionCode'"/>
2443 </xsl:call-template>
2445 <xsl:call-template name=
"ccdAssignedEntity">
2446 <xsl:with-param name=
"ccrActorObjectID" select=
"$ccrActorReference/a:ActorID"/>
2447 </xsl:call-template>
2451 <xsl:template name=
"ccdPerson">
2452 <xsl:param name=
"CCRActorPerson"/>
2453 <xsl:param name=
"personNodeName">assignedPerson
</xsl:param>
2454 <xsl:element name=
"{$personNodeName}">
2455 <xsl:call-template name=
"ccdPersonName">
2456 <xsl:with-param name=
"CCRActorName" select=
"$CCRActorPerson/a:Name"/>
2457 </xsl:call-template>
2461 <xsl:template name=
"ccdPersonName">
2462 <xsl:param name=
"CCRActorName"/>
2464 <xsl:if test=
"$CCRActorName/a:CurrentName/a:Title">
2466 <xsl:value-of select=
"$CCRActorName/a:CurrentName/a:Title"/>
2469 <xsl:if test=
"$CCRActorName/a:CurrentName/a:Given">
2471 <xsl:value-of select=
"$CCRActorName/a:CurrentName/a:Given"/>
2474 <xsl:if test=
"$CCRActorName/a:CurrentName/a:Middle">
2476 <xsl:value-of select=
"$CCRActorName/a:CurrentName/a:Middle"/>
2479 <xsl:if test=
"$CCRActorName/a:CurrentName/a:Family">
2481 <xsl:value-of select=
"$CCRActorName/a:CurrentName/a:Family"/>
2484 <xsl:if test=
"$CCRActorName/a:CurrentName/a:Suffix">
2486 <xsl:value-of select=
"$CCRActorName/a:CurrentName/a:Suffix"/>
2492 <xsl:template name=
"ccdOrganization">
2493 <xsl:param name=
"ccrActorObjectID"/>
2494 <xsl:param name=
"organizationNodeName"/>
2496 <xsl:variable name=
"CCRActor" select=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2498 <xsl:element name=
"{$organizationNodeName}">
2499 <xsl:call-template name=
"ccdEntityID">
2500 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2501 </xsl:call-template>
2502 <xsl:call-template name=
"ccdTelecom">
2503 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2504 </xsl:call-template>
2506 <xsl:call-template name=
"ccdAddress">
2507 <xsl:with-param name=
"CCRActorAddress" select=
"$CCRActor/a:Address[1]"/>
2508 </xsl:call-template>
2512 <xsl:template name=
"ccdPatientRole">
2513 <xsl:param name=
"ccrActorObjectID"/>
2515 <xsl:variable name=
"CCRActor" select=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2517 <xsl:call-template name=
"ccdEntityID">
2518 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2519 </xsl:call-template>
2521 <xsl:call-template name=
"ccdAddress">
2522 <xsl:with-param name=
"CCRActorAddress" select=
"$CCRActor/a:Address[1]"/>
2523 </xsl:call-template>
2525 <xsl:call-template name=
"ccdTelecom">
2526 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2527 </xsl:call-template>
2529 <xsl:call-template name=
"ccdPatient">
2530 <xsl:with-param name=
"CCRActorPerson" select=
"$CCRActor/a:Person"/>
2531 </xsl:call-template>
2534 <xsl:template name=
"ccdAssignedAuthor">
2535 <xsl:param name=
"ccrActorObjectID"/>
2537 <xsl:variable name=
"CCRActor" select=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2539 <xsl:call-template name=
"ccdEntityID">
2540 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2541 </xsl:call-template>
2543 <xsl:call-template name=
"ccdAddress">
2544 <xsl:with-param name=
"CCRActorAddress" select=
"$CCRActor/a:Address[1]"/>
2545 </xsl:call-template>
2547 <xsl:call-template name=
"ccdTelecom">
2548 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2549 </xsl:call-template>
2551 <xsl:call-template name=
"ccdPerson">
2552 <xsl:with-param name=
"CCRActorPerson" select=
"$CCRActor/a:Person"/>
2553 </xsl:call-template>
2555 <xsl:if test=
"$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']">
2556 <representedOrganization>
2557 <xsl:call-template name=
"ccdOrganization">
2558 <xsl:with-param name=
"ccrActorObjectID" select=
"$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']/a:LinkID"/>
2559 </xsl:call-template>
2560 </representedOrganization>
2565 <xsl:template name=
"ccdParticipantRoleActor">
2566 <xsl:param name=
"ccrActorObjectID"/>
2568 <xsl:variable name=
"CCRActor" select=
"/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2570 <xsl:call-template name=
"ccdEntityID">
2571 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2572 </xsl:call-template>
2574 <xsl:call-template name=
"ccdAddress">
2575 <xsl:with-param name=
"CCRActorAddress" select=
"$CCRActor/a:Address[1]"/>
2576 </xsl:call-template>
2578 <xsl:call-template name=
"ccdTelecom">
2579 <xsl:with-param name=
"CCRActor" select=
"$CCRActor"/>
2580 </xsl:call-template>
2582 <xsl:if test=
"$CCRActor/a:Organization/a:Name">
2583 <playingEntity classCode=
"PLC">
2585 <xsl:value-of select=
"$CCRActor/a:Organization/a:Name"/>
2591 <xsl:template name=
"ccdParticipantRoleCodedDescription">
2592 <xsl:param name=
"ccrCodedDescription"/>
2593 <participantRole classCode=
"MANU">
2594 <!--Product Detail-->
2595 <playingEntity classCode=
"MMAT">
2596 <xsl:if test=
"$ccrCodedDescription/a:Code">
2597 <xsl:call-template name=
"ccdCodedValue">
2598 <xsl:with-param name=
"ccrCodedDescription" select=
"$ccrCodedDescription"/>
2599 <xsl:with-param name=
"nodeName" select=
"'code'"/>
2600 </xsl:call-template>
2603 <xsl:value-of select=
"$ccrCodedDescription/a:Text"/>
2609 <xsl:template name=
"ccdEntityID">
2610 <xsl:param name=
"CCRActor"/>
2613 <xsl:when test=
"$CCRActor/a:IDs">
2614 <xsl:attribute name=
"extension">
2615 <xsl:value-of select=
"$CCRActor/a:IDs[1]/a:ID"/>
2617 <xsl:attribute name=
"root">
2618 <xsl:value-of select=
"$CCRActor/a:IDs[1]/a:Type/a:Text"/>
2622 <xsl:attribute name=
"extension">
2623 <xsl:value-of select=
"$CCRActor/a:ActorObjectID"/>
2625 <xsl:attribute name=
"root">
2626 <xsl:text>CCRActorID
</xsl:text>
2631 <xsl:if test=
"$CCRActor/a:Organization">
2632 <name><xsl:value-of select=
"$CCRActor/a:Organization/a:Name"></xsl:value-of></name>
2635 <xsl:template name=
"ccdAddress">
2636 <xsl:param name=
"CCRActorAddress"/>
2639 <xsl:when test=
"$CCRActorAddress">
2640 <xsl:attribute name=
"use">
2641 <xsl:call-template name=
"CDAVocabularyLookup">
2642 <xsl:with-param name=
"domain" select=
"'telecommunicationsAddressUse'"/>
2643 <xsl:with-param name=
"ccrtext" select=
"$CCRActorAddress/a:Type/a:Text"/>
2644 </xsl:call-template>
2647 <xsl:value-of select=
"$CCRActorAddress/a:Line1"/>
2648 </streetAddressLine>
2650 <xsl:value-of select=
"$CCRActorAddress/a:City"/>
2653 <xsl:value-of select=
"$CCRActorAddress/a:State"/>
2656 <xsl:value-of select=
"$CCRActorAddress/a:PostalCode"/>
2660 <streetAddressLine/>
2666 <xsl:template name=
"ccdTelecom">
2667 <xsl:param name=
"CCRActor"/>
2669 <xsl:if test=
"$CCRActor/a:Telephone">
2670 <xsl:attribute name=
"use">
2671 <xsl:call-template name=
"CDAVocabularyLookup">
2672 <xsl:with-param name=
"domain" select=
"'telecommunicationsAddressUse'"/>
2673 <xsl:with-param name=
"ccrtext" select=
"$CCRActor/a:Telephone/a:Type/a:Text"/>
2674 </xsl:call-template>
2676 <xsl:attribute name=
"value">
2677 <xsl:text>tel:+
1-
</xsl:text>
2678 <xsl:value-of select=
"$CCRActor/a:Telephone[1]/a:Value"/>
2683 <xsl:if test=
"$CCRActor/a:Email">
2686 <xsl:when test=
"$CCRActor/a:Telephone">
2687 <xsl:attribute name=
"use">
2688 <xsl:call-template name=
"CDAVocabularyLookup">
2689 <xsl:with-param name=
"domain" select=
"'telecommunicationsAddressUse'"/>
2690 <xsl:with-param name=
"ccrtext" select=
"$CCRActor/a:Telephone/a:Type/a:Text"/>
2691 </xsl:call-template>
2693 <xsl:attribute name=
"value">
2694 <xsl:text>mailto:
</xsl:text>
2695 <xsl:value-of select=
"$CCRActor/a:Email[1]/a:Value"/>
2699 <xsl:attribute name=
"value">
2700 <xsl:text>Unknown
</xsl:text>
2708 <xsl:template name=
"ccdID">
2709 <xsl:param name=
"ccrObjectID"/>
2710 <xsl:param name=
"suffix"/>
2712 <xsl:attribute name=
"root">
2713 <xsl:value-of select=
"$ccrObjectID"></xsl:value-of>
2715 <xsl:attribute name=
"extension">CCRObjectID
</xsl:attribute>
2719 <xsl:template name=
"ccdCodedValue">
2720 <xsl:param name=
"ccrCodedDescription"/>
2721 <xsl:param name=
"type"/>
2722 <xsl:param name=
"domain"/>
2723 <xsl:param name=
"nodeName">value
</xsl:param>
2724 <xsl:param name=
"originalTextReference"/>
2726 <xsl:element name=
"{$nodeName}">
2727 <xsl:if test=
"$type">
2728 <xsl:attribute name=
"xsi:type">
2729 <xsl:value-of select=
"$type"/>
2733 <xsl:when test=
"$ccrCodedDescription/a:Code">
2734 <xsl:attribute name=
"displayName">
2735 <xsl:value-of select=
"$ccrCodedDescription/a:Text"/>
2737 <xsl:attribute name=
"code">
2738 <xsl:value-of select=
"$ccrCodedDescription/a:Code/a:Value"/>
2740 <xsl:attribute name=
"codeSystemName">
2741 <xsl:value-of select=
"$ccrCodedDescription/a:Code/a:CodingSystem"/>
2743 <xsl:attribute name=
"codeSystem">
2744 <xsl:call-template name=
"HL7OIDLookup">
2745 <xsl:with-param name=
"name" select=
"$ccrCodedDescription/a:Code/a:CodingSystem"/>
2746 </xsl:call-template>
2749 <xsl:when test=
"$domain">
2750 <xsl:variable name=
"cdaCode">
2751 <xsl:call-template name=
"CDAVocabularyLookup">
2752 <xsl:with-param name=
"domain" select=
"$domain"/>
2753 <xsl:with-param name=
"ccrtext" select=
"$ccrCodedDescription/a:Text"/>
2754 </xsl:call-template>
2756 <xsl:attribute name=
"displayName">
2757 <xsl:call-template name=
"CDADisplayNameLookup">
2758 <xsl:with-param name=
"domain" select=
"$domain"/>
2759 <xsl:with-param name=
"cdacode" select=
"$cdaCode"/>
2760 </xsl:call-template>
2762 <xsl:attribute name=
"code">
2763 <xsl:value-of select=
"$cdaCode"></xsl:value-of>
2765 <xsl:attribute name=
"codeSystemName">
2766 <xsl:call-template name=
"CDAVocabularyCodeSystemNameLookup">
2767 <xsl:with-param name=
"domain" select=
"$domain"/>
2768 </xsl:call-template>
2770 <xsl:attribute name=
"codeSystemName">
2771 <xsl:call-template name=
"CDAVocabularyCodeSystemLookup">
2772 <xsl:with-param name=
"domain" select=
"$domain"/>
2773 </xsl:call-template>
2778 <xsl:value-of select=
"$ccrCodedDescription/a:Text"/>
2779 <xsl:if test=
"$originalTextReference">
2781 <xsl:attribute name=
"value">
2782 <xsl:value-of select=
"$originalTextReference"/>
2792 <xsl:template name=
"ccdDateTime">
2793 <xsl:param name=
"dt"/>
2794 <xsl:param name=
"type"/>
2796 <xsl:if test=
"$dt[1]/a:ExactDateTime">
2798 <xsl:if test=
"$type">
2799 <xsl:attribute name=
"xsi:type">
2800 <xsl:value-of select=
"$type"></xsl:value-of>
2804 <xsl:attribute name=
"value">
2805 <xsl:call-template name=
"date:format-date">
2806 <xsl:with-param name=
"date-time" select=
"$dt[1]/a:ExactDateTime"/>
2807 <xsl:with-param name=
"pattern">yyyyMMdd
</xsl:with-param>
2808 </xsl:call-template>
2811 <high nullFlavor=
"UNK"/>
2814 <xsl:if test=
"$dt[1]/a:DateTimeRange">
2817 <xsl:attribute name=
"value">
2818 <xsl:call-template name=
"date:format-date">
2819 <xsl:with-param name=
"date-time" select=
"$dt[1]/a:DateTimeRange/a:BeginRange/a:ExactDateTime"/>
2820 <xsl:with-param name=
"pattern">yyyyMMdd
</xsl:with-param>
2821 </xsl:call-template>
2825 <xsl:attribute name=
"value">
2826 <xsl:call-template name=
"date:format-date">
2827 <xsl:with-param name=
"date-time" select=
"$dt[1]/a:DateTimeRange/a:EndRange/a:ExactDateTime"/>
2828 <xsl:with-param name=
"pattern">yyyyMMdd
</xsl:with-param>
2829 </xsl:call-template>
2837 <xsl:template name=
"ccdMedicationFrequency">
2838 <xsl:param name=
"frequency"/>
2839 <xsl:if test=
"$frequency">
2841 <xsl:when test=
"$frequency/a:Value='qd'">
2842 <effectiveTime xsi:
type=
"PIVL_TS" operator=
"A">
2843 <xsl:attribute name=
"institutionSpecified">true
</xsl:attribute>
2845 <xsl:attribute name=
"value">24</xsl:attribute>
2846 <xsl:attribute name=
"unit">h
</xsl:attribute>
2850 <xsl:when test=
"$frequency/a:Value='bid'">
2851 <effectiveTime xsi:
type=
"PIVL_TS" operator=
"A">
2852 <xsl:attribute name=
"institutionSpecified">true
</xsl:attribute>
2854 <xsl:attribute name=
"value">12</xsl:attribute>
2855 <xsl:attribute name=
"unit">h
</xsl:attribute>
2859 <xsl:when test=
"$frequency/a:Value='tid'">
2860 <effectiveTime xsi:
type=
"PIVL_TS" operator=
"A">
2861 <xsl:attribute name=
"institutionSpecified">true
</xsl:attribute>
2863 <xsl:attribute name=
"value">8</xsl:attribute>
2864 <xsl:attribute name=
"unit">h
</xsl:attribute>
2868 <xsl:when test=
"$frequency/a:Value='qid'">
2869 <effectiveTime xsi:
type=
"PIVL_TS" operator=
"A">
2870 <xsl:attribute name=
"institutionSpecified">true
</xsl:attribute>
2872 <xsl:attribute name=
"value">6</xsl:attribute>
2873 <xsl:attribute name=
"unit">h
</xsl:attribute>
2877 <xsl:when test=
"$frequency/a:Value='qam'">
2878 <effectiveTime xsi:type='EIVL' operator='A'
>
2882 <xsl:when test=
"$frequency/a:Value='qpm'">
2883 <effectiveTime xsi:type='EIVL' operator='A'
>
2891 <xsl:template name=
"ccdStatus">
2892 <xsl:param name=
"ccrStatus"/>
2894 <entryRelationship typeCode=
"REFR">
2895 <observation classCode=
"OBS" moodCode=
"EVN">
2896 <templateId root=
"2.16.840.1.113883.10.20.1.50"/>
2897 <!-- Problem status observation template -->
2898 <code code=
"33999-4" codeSystem=
"2.16.840.1.113883.6.1" displayName=
"Status"/>
2899 <statusCode code=
"completed"/>
2900 <xsl:call-template name=
"ccdCodedValue">
2901 <xsl:with-param name=
"ccrCodedDescription" select=
"$ccrStatus"/>
2902 </xsl:call-template>
2904 </entryRelationship>
2907 <xsl:template name=
"ccdStatusObservation">
2908 <xsl:param name=
"status"/>
2909 <xsl:variable name=
"statusText" select=
"$status/a:Text"></xsl:variable>
2911 <xsl:when test=
"$statusText='Active'">
2912 <xsl:call-template name=
"ccdStatusElement">
2913 <xsl:with-param name=
"statusCode" select=
"'55561003'"/>
2914 <xsl:with-param name=
"statusDisplayName" select=
"$statusText"/>
2915 </xsl:call-template>
2917 <xsl:when test=
"$statusText='Inactive'">
2918 <xsl:call-template name=
"ccdStatusElement">
2919 <xsl:with-param name=
"statusCode" select=
"'73425007'"/>
2920 <xsl:with-param name=
"statusDisplayName" select=
"$statusText"/>
2921 </xsl:call-template>
2923 <xsl:when test=
"$statusText='Chronic'">
2924 <xsl:call-template name=
"ccdStatusElement">
2925 <xsl:with-param name=
"statusCode" select=
"'90734009'"/>
2926 <xsl:with-param name=
"statusDisplayName" select=
"$statusText"/>
2927 </xsl:call-template>
2932 <xsl:template name=
"ccdStatusProcedure">
2933 <xsl:param name=
"status"/>
2934 <xsl:variable name=
"statusText" select=
"$status/a:Text"></xsl:variable>
2936 <xsl:when test=
"$statusText='Completed'">
2937 <statusCode code=
"completed"/>
2939 <xsl:when test=
"$statusText='Active'">
2940 <statusCode code=
"active"/>
2942 <xsl:when test=
"$statusText='Aborted'">
2943 <statusCode code=
"aborted"/>
2945 <xsl:when test=
"$statusText='Cancelled' or $statusText='Canceled'">
2946 <statusCode code=
"cancelled"/>
2950 <xsl:attribute name=
"code">
2951 <xsl:value-of select=
"$statusText"></xsl:value-of>
2958 <xsl:template name=
"ccdStatusElement">
2959 <xsl:param name=
"statusCode"/>
2960 <xsl:param name=
"statusDisplayName"/>
2962 <xsl:attribute name=
"xsi:type">CE
</xsl:attribute>
2963 <xsl:attribute name=
"code">
2964 <xsl:value-of select=
"$statusCode"></xsl:value-of>
2966 <xsl:attribute name=
"codeSystem">2.16.840.1.113883.6.96</xsl:attribute>
2967 <xsl:attribute name=
"displayName">
2968 <xsl:value-of select=
"$statusDisplayName"></xsl:value-of>
2973 <xsl:template name=
"ccdObservation">
2974 <xsl:param name=
"ccrTestNode"/>
2975 <xsl:param name=
"testDate"/>
2978 <observation classCode=
"OBS" moodCode=
"EVN">
2979 <templateId root=
"2.16.840.1.113883.3.88.11.83.15" assigningAuthorityName=
"HITSP C83"/>
2980 <templateId root=
"2.16.840.1.113883.10.20.1.31" assigningAuthorityName=
"CCD"/>
2981 <templateId root=
"1.3.6.1.4.1.19376.1.5.3.1.4.13" assigningAuthorityName=
"IHE PCC"/>
2983 <!-- Result observation template -->
2985 <xsl:call-template name=
"ccdID">
2986 <xsl:with-param name=
"ccrObjectID" select=
"$ccrTestNode/a:CCRDataObjectID"/>
2987 </xsl:call-template>
2990 <xsl:call-template name=
"ccdCodedValue">
2991 <xsl:with-param name=
"ccrCodedDescription" select=
"$ccrTestNode/a:Description"/>
2992 <xsl:with-param name=
"nodeName" select=
"'code'"/>
2993 </xsl:call-template>
2997 <xsl:attribute name=
"value">
2998 <xsl:text>#
</xsl:text>
2999 <xsl:value-of select=
"$ccrTestNode/a:CCRDataObjectID"/>
3004 <statusCode code=
"completed"/>
3006 <!-- <effectiveTime> -->
3008 <xsl:when test=
"$ccrTestNode/a:DateTime">
3009 <xsl:call-template name=
"ccdDateTime">
3010 <xsl:with-param name=
"dt" select=
"$ccrTestNode/a:DateTime"/>
3011 </xsl:call-template>
3014 <xsl:call-template name=
"ccdDateTime">
3015 <xsl:with-param name=
"dt" select=
"$testDate"/>
3016 </xsl:call-template>
3021 <xsl:when test=
"$ccrTestNode/a:TestResult[a:Value!='']">
3022 <value xsi:
type=
"PQ">
3023 <xsl:attribute name=
"value">
3024 <xsl:value-of select=
"$ccrTestNode/a:TestResult/a:Value"/>
3026 <xsl:attribute name=
"unit">
3027 <xsl:value-of select=
"$ccrTestNode/a:TestResult/a:Units/a:Unit"/>
3031 <xsl:when test=
"$ccrTestNode/a:TestResult[a:Description/a:Text!='']">
3032 <value xsi:
type=
"TX">
3033 <xsl:attribute name=
"value">
3034 <xsl:value-of select=
"$ccrTestNode/a:TestResult/a:Description/a:Text"/>
3040 <xsl:if test=
"$ccrTestNode/a:Flag">
3041 <xsl:call-template name=
"ccdCodedValue">
3042 <xsl:with-param name=
"ccrCodedDescription" select=
"$ccrTestNode/a:Flag"/>
3043 <xsl:with-param name=
"nodeName" select=
"'interpretationCode'"/>
3044 <xsl:with-param name=
"domain" select=
"'ObservationInterpretation'"/>
3045 </xsl:call-template>
3048 <xsl:if test=
"$ccrTestNode/a:NormalResult">
3050 <xsl:if test=
"$ccrTestNode/a:NormalResult/a:Normal/a:Description/a:Text">
3053 <xsl:value-of select=
"$ccrTestNode/a:NormalResult/a:Normal/a:Description/a:Text"/>