source: ccr2ccd-xslt/trunk/make/ccr_qrda.xsl@ 1550

Last change on this file since 1550 was 994, checked in by George Lilly, 14 years ago

latest

File size: 248.1 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3Conversion of CCR to Level 3 CCD
4
5Orginal Author: Ken Miller
6Solventus LLC
7ken.miller@solventus.coms
8
9Contributors:
10Richard Braman, EHR Doctors, Inc rbraman@ehrdoctors.com
11George Lilly (WorldVistA glilly@glilly.net)
12Nancy Antracite, WorldVistA
13xxxx - Oroville Hospital
14
15Date: 2010-05-5
16Version: 0.1
17
18License :
19
20 This program is free software: you can redistribute it and/or modify
21 it under the terms of the GNU General Public License as published by
22 the Free Software Foundation, either version 3 of the License, or
23 (at your option) any later version.
24
25 This program is distributed in the hope that it will be useful,
26 but WITHOUT ANY WARRANTY; without even the implied warranty of
27 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 GNU General Public License for more details.
29
30 You should have received a copy of the GNU General Public License
31 along with this program. If not, see http://www.gnu.org/licenses.
32
33-->
34<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"
35xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exclude-result-prefixes="a date">
36 <xsl:import href="./templates/cdavocablookup.xsl"/>
37 <xsl:import href="./templates/hl7oidlookup.xsl"/>
38 <xsl:import href="./templates/code.xsl"/>
39 <xsl:import href="./templates/actor.xsl"/>
40 <xsl:import href="./templates/datetime.xsl"/>
41 <xsl:import href="./templates/problemDescription.xsl"/>
42
43 <xsl:output method="xml" encoding="utf-8" version="1.0" indent="yes"/>
44 <xsl:template match="/">
45<!--WV Added new munltiple documentation of added have to do with encounter times, etc.-->
46
47<!--
48********************************************************
49CDA Header
50********************************************************
51-->
52
53<!--
54******************
55Document Information
56**********************
57-->
58<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:voc="urn:hl7-org:v3/voc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
59 <!-- Created with XML Copy Editor Open Source Sourceforge project. -->
60<!--WVP This is the clinical document type ID-->
61 <realmCode code="US"/>
62 <typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/>
63 <!-- QRDA Category I generic template ID. -->
64 <!--WVP these next two lines are fixed-->
65 <templateId root="2.16.840.1.113883.10.20.12" />
66 <!--only in the july spec so not sure if it should be here-->
67 <templateId root="2.16.840.1.113883.3.249.11.100.1"/>
68 <!--WVV 2.16.840.1.113883.3.543 is fixed and is the beginninng of WorldVistAs OID, change the extension for a new document and the version for changes to this one-->
69 <id>
70 <xsl:attribute name="root">
71 <xsl:value-of select="/a:ContinuityOfCareRecord/a:CCRDocumentObjectID"></xsl:value-of>
72 </xsl:attribute>
73 </id>
74 <!--WVP next two lines fixed-->
75 <code code="55182-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Quality Measure Report"/>
76 <title>QRDA Incidence Report</title>
77 <!--WVV time-->
78 <effectiveTime value="20100703"/>
79 <!--WVP for next two lines-->
80 <confidentialityCode codeSystem="2.16.840.1.113883.5.25" code="N"/>
81 <languageCode code="en-US"/>
82 <!--WV? Don't change this in the document set we are working on-->
83 <setId root="2.16.840.1.113883.3.543" extension="01.01.01.100000001"/>
84 <versionNumber value="1"/>
85 <!--WVP I made one up but we will have to have an OID for the Clincal Document SET which we will make up for ourselves eventually-->
86
87 <!--
88 *******************
89 Patient Information
90 ****************
91 -->
92 <!-- This is the patient for which the report is describing. -->
93 <recordTarget>
94<patientRole>
95 <xsl:call-template name="ccdPatientRole">
96 <xsl:with-param name="ccrActorObjectID" select="/a:ContinuityOfCareRecord/a:Patient[1]/a:ActorID"/>
97 </xsl:call-template>
98 </patientRole>
99 </recordTarget>
100
101<!--
102*****************************
103Author
104**************
105-->
106 <!-- This example assumes the doctor is creating the report and it is Required. -->
107 <author>
108 <!--WVV Edit time has to be precise at least to the day-->
109 <time value="20100703" />
110 <assignedAuthor>
111 <!--WVP eventually id this is required, the root is fixed -->
112 <!--andn the extension is the SOFTWARE version number assigned by CMS to WV EHR-->
113 <id root="2.16.840.1.113883.3.249.6" extension="100001" />
114 <!--WVVassignedPerson not required-->
115 <assignedPerson>
116 <name>
117 <!--WV Edit-->
118 <given>Nancy</given>
119 <family>Anthracite</family>
120 <suffix>MD</suffix>
121 </name>
122 </assignedPerson>
123 <representedOrganization>
124 <!--WV? id root is OID for the organization so I made one up for this document set-->
125 <id root="2.16.840.1.113883.3.543" extension="1558574526" />
126 <name>WorldVistA Test Clinic</name>
127 </representedOrganization>
128 </assignedAuthor>
129 </author>
130 <!-- The reporting healthcare facility is represented using the CCD "Source of Information" construct, via the Informant participant. -->
131 <informant>
132 <assignedEntity>
133 <!--WV this null flavor is required as is-->
134 <id nullFlavor="NA"/>
135 <representedOrganization>
136 <!--WV root is the OID of the organization. ID is required but name is not and id is OID stated earlier-->
137 <id root="2.16.840.1.113883.3.543" extension="1558574526" />
138 <name>World VistA Test Clinic</name>
139 </representedOrganization>
140 </assignedEntity>
141 </informant>
142
143 <!-- This example assumes that the institution responsible for the data is serving as custodian. -->
144 <!--WV This element is required as is the sSD which is not stated if it is an OID but assumed it is-->
145 <!--WV Name is not required, only ID is required.-->
146 <custodian>
147 <assignedCustodian>
148 <representedCustodianOrganization>
149 <id root="2.16.840.1.113883.3.543" extension="1558574526" />
150 <name>WorldVistA Test Clinic</name>
151 </representedCustodianOrganization>
152 </assignedCustodian>
153 </custodian>
154
155 <!-- In this example, the author is also serving as legal authenticator. -->
156 <!--WV section is this is not required-->
157<legalAuthenticator>
158 <time value="20100703" />
159 <!--WV the signature code of S is required-->
160 <signatureCode code="S" />
161 <assignedEntity>
162 <!--WV document does not specify the requirements of the id but it is required-->
163 <!--WVP and the sample suggests it is the number below and extension is ???-->
164 <id root="2.16.840.1.113883.3.543" extension="111111" />
165 <assignedPerson>
166 <name>
167 <given>Nancy</given>
168 <family>Anthracite</family>
169 <suffix>MD</suffix>
170 </name>
171 </assignedPerson>
172 <representedOrganization>
173 <!--WV? and is fixed for the WorldVistA Test Clinic in this submitted document series-->
174 <id root="2.16.840.1.113883.3.543" extension="1558574526" />
175 <name>WorldVistA Test Clinic</name>
176 </representedOrganization>
177 </assignedEntity>
178 </legalAuthenticator>
179
180
181
182 <!--Added to sample as it is new since 2008-->
183 <!--WVP permanent for participant in the primary care provider participant-->
184<!--WVP performer type codes are numerous but PRF is performer or the person who did it-->
185 <participant typeCode="PRF">
186 <!--WVP required as is for function-->
187 <!-- WVP I believe PCP is primary care provider but not sure-->
188 <functionCode code="PCP" codeSystem="2.16.840.1.113883.5.88"/>
189 <!--WVP Associated Entity is required ti be there with this PROV-->
190 <associatedEntity classCode="PROV">
191 <!--WV? OID of the provider fixed for this series of documents-->
192 <id root="2.16.840.1.113883.3.249.6" extension="111111" />
193 <!--WV associated person is not required so presumabley the code will suffice not sure??-->
194 <associatedPerson>
195 <name>
196 <prefix>Dr.</prefix>
197 <given>Nancy</given>
198 <family>Anthracite</family>
199 </name>
200 </associatedPerson>
201 </associatedEntity>
202 </participant>
203
204 <!--The service event is the encounter that describes tehe encunter as well as the provider, location and time-->
205 <!--!There can be one or more documentation elements depending on the number of encounters during the reporting period-->
206 <!--WVV IMPORTANT!! The encounter codeds are recorded here-->
207 <!-- They are in appendix B of the downloadable resource document-->
208 <!-- Each documentation of is a single service event-->
209
210<!--Occurence of Measures episode documention-->
211<!--Like an encounter section only for QRDA-->
212<!--Same doctor, same clinic, different date and different enconter code-->
213
214
215 <!--First Visit documentationOf section-->
216
217 <documentationOf>
218 <serviceEvent>
219 <!--WV serviceEvent codes from Tab B from the downloadabe resource coding system is -->
220 <!--WVF codeSystem is 2.16.840.1.113883 -->
221 <!--WV code root shall be WVP 2.16.840.1.113883.6.12 and the extension shall be the encounter code -->
222 <!-- WV? like the length of visit and complexity codes for example-->
223
224 <code code="99202" codeSystem="2.16.840.1.113883.6.12" codeSystemName="C4"/>
225 <effectiveTime>
226 <!--WV Edit-->
227 <!-- This has to be precise at least to the day. Something with time would be better. Not sure of the necessary format so did not add time-->
228 <low value="20100205"/>
229 <high value="20100205"/>
230 </effectiveTime>
231 <performer typeCode="PRF">
232 <assignedEntity>
233 <!-- WV? Provider NPI Required root 2.16.840.1.113883.9.96 is ?? and the NPI is an extension for the provider-->
234 <!--This is variable but may remain unchanged for this document set-->
235 <id root="2.16.840.1.113883.3.543" extension="6558574524"/>
236 <!--<id root="2.16.840.1.113883.3.543" extension="1457402711"/>-->
237 <!--WV this element should be present and the code is probably for a General Physician for!-->
238 <!--It may be the type of provider as the example as I think 2.16.840.1.113883.6.69is the NDC-->
239 <!-- codeSystemName is SNOMED CT and code is an 8 digit num and display name is for a physician-->
240 <!--O6120 is SPECIALIZED PHYSICIAN when I looked it up so I don't know where to look for this 8 digit number-->
241 <!-- http://terminology.vetmed.vt.edu/SCT/menu.cfm to look up codes-->
242 <!--59058001 is general physician ;Family Medicine specialist is 62247001-->
243 <code code="62247001" codeSystem="2.16.840.1.113883.6.69" codeSystemName="SNOMED CT" displayName="Internal Medician Specialist"/>
244 <addr>
245 <streetAddressLine>123 Maple Ave</streetAddressLine>
246 <city>Gaithersburg</city>
247 <state>MD</state>
248 <postalCode>20877</postalCode>
249 </addr>
250 <assignedPerson>
251 <name>
252 <given>Nancy</given>
253 <family>Anthracite</family>
254 <suffix>MD</suffix>
255 </name>
256 </assignedPerson>
257 </assignedEntity>
258 </performer>
259 </serviceEvent>
260 </documentationOf>
261
262
263 <!--Second Visit documentationOf section-->
264
265 <documentationOf>
266 <serviceEvent>
267 <!--WV serviceEvent codes from Tab B from the downloadabe resource coding system is -->
268 <!--WVF codeSystem is 2.16.840.1.113883 -->
269 <!--WV code root shall be WVP 2.16.840.1.113883.6.12 and the extension shall be the encounter code -->
270 <!-- WV? like the length of visit and complexity codes for example-->
271
272 <code code="99204" codeSystem="2.16.840.1.113883.6.12" codeSystemName="C4"/>
273 <effectiveTime>
274 <!--WV Edit-->
275 <!-- This has to be precise at least to the day. Something with time would be better. Not sure of the necessary format so did not add time-->
276 <low value="20100703"/>
277 <high value="20100703"/>
278 </effectiveTime>
279 <performer typeCode="PRF">
280 <assignedEntity>
281 <!-- WV? Provider NPI Required root 2.16.840.1.113883.9.96 is ?? and the NPI is an extension for the provider-->
282 <!--This is variable but may remain unchanged for this document set-->
283 <id root="2.16.840.1.113883.3.543" extension="6558574524"/>
284 <!--<id root="2.16.840.1.113883.3.543" extension="1457402711"/>-->
285 <!--WV this element should be present and the code is probably for a General Physician for!-->
286 <!--It may be the type of provider as the example as I think 2.16.840.1.113883.6.69is the NDC-->
287 <!-- codeSystemName is SNOMED CT and code is an 8 digit num and display name is for a physician-->
288 <!--O6120 is SPECIALIZED PHYSICIAN when I looked it up so I don't know where to look for this 8 digit number-->
289 <!-- http://terminology.vetmed.vt.edu/SCT/menu.cfm to look up codes-->
290 <!--59058001 is general physician ;Family Medicine specialist is 62247001-->
291 <code code="62247001" codeSystem="2.16.840.1.113883.6.69" codeSystemName="SNOMED CT" displayName="Internal Medician Specialist"/>
292 <addr>
293 <streetAddressLine>123 Maple Ave</streetAddressLine>
294 <city>Gaithersburg</city>
295 <state>MD</state>
296 <postalCode>20877</postalCode>
297 </addr>
298 <assignedPerson>
299 <name>
300 <given>Nancy</given>
301 <family>Anthracite</family>
302 <suffix>MD</suffix>
303 </name>
304 </assignedPerson>
305 </assignedEntity>
306 </performer>
307 </serviceEvent>
308 </documentationOf>
309 <!--
310********************************************************
311CDA Body
312********************************************************
313-->
314 <component>
315 <structuredBody>
316 <!--
317 ********************************************************
318 Measure Set Section
319 ********************************************************
320 -->
321 <component>
322 <section>
323 <!-- WVP QRDA Category I measure-specific template ID for 2010 #1. -->
324 <!--WP Next 3 lines do not change during the reporting period, for the measures section-->
325 <templateId root="2.16.840.1.113883.3.249.11.12" />
326 <code code="55185-3" codeSystem="2.16.840.1.113883.6.1" />
327 <title>Measure set: CMS EHR Measure Set</title>
328 <text>2010 Measures Set Measures</text>
329 <!--
330 ***************************************************
331 Measure Section
332 ***************************************************
333 -->
334 <component>
335 <section>
336 <!--template ID for each measure being reported-->
337 <templateId root="2.16.840.1.113883.3.249.11.2" />
338 <templateId root="2.16.840.1.113883.3.249.11.3" />
339 <templateId root="2.16.840.1.113883.3.249.11.4" />
340 <templateId root="2.16.840.1.113883.3.249.11.5" />
341 <templateId root="2.16.840.1.113883.3.249.11.6" />
342 <templateId root="2.16.840.1.113883.3.249.11.7" />
343 <templateId root="2.16.840.1.113883.3.249.11.8" />
344 <templateId root="2.16.840.1.113883.3.249.11.9" />
345 <templateId root="2.16.840.1.113883.3.249.11.10" />
346 <templateId root="2.16.840.1.113883.3.249.11.11" />
347 <templateId root="2.16.840.1.113883.3.249.11.15" />
348 <code code="55186-1" codeSystem="2.16.840.1.113883.6.1" />
349 <title>Measure Section</title>
350 <!--Here is where the HTML begins for the above and it is optional-->
351 <text>
352 <list>
353 <item>CMS Measure #1: Diabetes Mellitus: Hemoglobin A1c Poor Control in Diabetes Mellitus</item>
354 <item>CMS Measure #2: Diabetes Mellitus: Low Density Lipoprotein (LDL-C) Control in Diabetes Mellitus</item>
355 <item>CMS Measure #3: Diabetes Mellitus: High Blood Pressure Control in Diabetes Mellitus</item>
356 <item>CMS Measure #5: Heart Failure: Angiotensin-Converting Enzyme (ACE) Inhibitor or Angiotensin Receptor Blocker (ARB) Therapy for Left Ventricular Systolic Dysfunction (LVSD)</item>
357 <item>CMS Measure #7: Coronary Artery Disease (CAD): Beta-Blocker Therapy for CAD Patients with Prior Myocardial Infarction (MI)</item>
358 <item>CMS Measure #110: Preventive Care and Screening: Influenza Immunization for Patients >= 50 Years</item>
359 <item>CMS Measure #111: Preventive Care and Screening: Pneumonia Vaccination for Patients 65 Years and Older</item>
360 <item>CMS Measure #112: Preventive Care and Screening: Screening Mammography</item>
361 <item>CMS Measure #113: Preventive Care and Screening: Colorectal Cancer Screening</item>
362 <item>CMS Measure #124: Health Information Technology (HIT): Adoption/Use of Electronic Health Records (EHR)</item>
363 <item>CMS Measure eRx:Adoption/Use of Medication Electronic Prescribing Measure</item>
364 </list>
365 </text>
366 <!--Begin listing of acts-->
367 <entry typeCode="DRIV">
368 <act classCode="ACT" moodCode="DEF">
369 <id root="3944fd20-865c-11df-a4ee-0800200c9a66"/>
370 <code code="PQRI-1" codeSystem="2.16.840.1.113883.3.249.12" displayName="Hemoglobin A1c Poor Control in Diabetes Mellitus"/>
371 <text>Percentage of patients 18 through 75 years with diabetes mellitus who had most recent hemoglobin A1C greater than 9.0%</text>
372 <statusCode code="completed"/>
373 </act>
374 </entry>
375 <entry typeCode="DRIV">
376 <act classCode="ACT" moodCode="DEF">
377 <id root="3944fd21-865c-11df-a4ee-0800200c9a66"/>
378 <code code="PQRI-2" codeSystem="2.16.840.1.113883.3.249.12" displayName="Low Density Lipoprotein (LDL-C) Control in Diabetes Mellitus"/>
379 <text>Percentage of patients 18 through 75 years with diabetes mellitus who had most recent LDL-C level in control (less than 100 mg./dL)</text>
380 <statusCode code="completed"/>
381 </act>
382 </entry>
383 <entry typeCode="DRIV">
384 <act classCode="ACT" moodCode="DEF">
385 <id root="3944fd22-865c-11df-a4ee-0800200c9a66"/>
386 <code code="PQRI-3" codeSystem="2.16.840.1.113883.3.249.12" displayName="Hemoglobin A1c Poor Control in Diabetes Mellitus"/>
387 <text>Percentage of patients 18 through 75 years with diabetes mellitus who had most recent blood pressure in control (less than 140/80 mmHg)</text>
388 <statusCode code="completed"/>
389 </act>
390 </entry>
391 <entry typeCode="DRIV">
392 <act classCode="ACT" moodCode="DEF">
393 <id root="3944fd23-865c-11df-a4ee-0800200c9a66"/>
394 <code code="PQRI-5" codeSystem="2.16.840.1.113883.3.249.12" displayName="Heart Failure: Angiotensin-Converting Enzyme (ACE) Inhibitor or Angiotensin Receptor Blocker (ARB) Therapy for Left Ventricular Systolic Dysfunction (LVSD)"/>
395 <text>Percentage of patients 18 years and older with a diagnosis of heart frilure and LVSD who were prescribed ACE inhibitor or ARB therapy</text>
396 <statusCode code="completed"/>
397 </act>
398 </entry>
399 <entry typeCode="DRIV">
400 <act classCode="ACT" moodCode="DEF">
401 <id root="3944fd24-865c-11df-a4ee-0800200c9a66"/>
402 <code code="PQRI-7" codeSystem="2.16.840.1.113883.3.249.12" displayName="Beta-Blocker Therapy for CAD Patients with Prior Myocardial Infarction"/>
403 <text>Percentage of patients 18 aged 18 years and older wit a diagnosis of CAD and prior MI who were prescribed beta-blocker therapy</text>
404 <statusCode code="completed"/>
405 </act>
406 </entry>
407 <entry typeCode="DRIV">
408 <act classCode="ACT" moodCode="DEF">
409 <id root="3944fd25-865c-11df-a4ee-0800200c9a66"/>
410 <code code="PQRI-110" codeSystem="2.16.840.1.113883.3.249.12" displayName="Influenza Immunization for Patients >= 50 Years"/>
411 <text>Percentage of patients aged 50 years and older who received an influenza immunization during the flu season (September through February)</text>
412 <statusCode code="completed"/>
413 </act>
414 </entry>
415 <entry typeCode="DRIV">
416 <act classCode="ACT" moodCode="DEF">
417 <id root="3944fd26-865c-11df-a4ee-0800200c9a66"/>
418 <code code="PQRI-111" codeSystem="2.16.840.1.113883.3.249.12" displayName="Pneumonia Vaccination for Patients 65 Years and Older"/>
419 <text>Percentage of patients afed 65 years and older who have ever received a pneumoccal vaccine</text>
420 <statusCode code="completed"/>
421 </act>
422 </entry>
423 <entry typeCode="DRIV">
424 <act classCode="ACT" moodCode="DEF">
425 <id root="3944fd27-865c-11df-a4ee-0800200c9a66"/>
426 <code code="PQRI-112" codeSystem="2.16.840.1.113883.3.249.12" displayName="Screening Mammography"/>
427 <text>Percentage of womaen aged 40 through 69 years who had a mammogram to screen for breast cancer within 24 months</text>
428 <statusCode code="completed"/>
429 </act>
430 </entry>
431 <entry typeCode="DRIV">
432 <act classCode="ACT" moodCode="DEF">
433 <id root="3944fd28-865c-11df-a4ee-0800200c9a66"/>
434 <code code="PQRI-113" codeSystem="2.16.840.1.113883.3.249.12" displayName="Colorectal Cancer Screening"/>
435 <text>Percentage of patients aged 50 through 80 who received the appropriate colorectal cancer screening</text>
436 <statusCode code="completed"/>
437 </act>
438 </entry>
439 <entry typeCode="DRIV">
440 <act classCode="ACT" moodCode="DEF">
441 <id root="3944fd29-865c-11df-a4ee-0800200c9a66"/>
442 <code code="PQRI-124" codeSystem="2.16.840.1.113883.3.249.12" displayName="Adoption/Use of Electronic Health Records (EHR)"/>
443 <text>Documents whether provider has adopted and is using health information technology. To qualify, the provider must havea adopted and be using a certified/qualified electronic health record (EHR)</text>
444 <statusCode code="completed"/>
445 </act>
446 </entry>
447 <entry typeCode="DRIV">
448 <act classCode="ACT" moodCode="DEF">
449 <id root="3944fd30-865c-11df-a4ee-0800200c9a66"/>
450 <code code="eRx" codeSystem="2.16.840.1.113883.3.249.12" displayName="Adoption/Use of Medication Electronic Prescribing Measure"/>
451 <text>Documents whether provider has adopted and is using ePrescribing</text>
452 <statusCode code="completed"/>
453 </act>
454 </entry>
455 <!--
456 *******************************
457 Reporting Parameters Section
458 *****************************
459 -->
460 <component>
461 <section>
462 <code code="55187-9" codeSystem="2.16.840.1.113883.6.1"/>
463 <title>Reporting Parameters</title>
464 <text>
465 <list>
466 <item>Reporting Period Jan 1, 2010 to Dec 31, 2010</item>
467 </list>
468 </text>
469 <entry>
470 <act classCode="ACT" moodCode="EVN">
471 <code code="252116004" codeSystem="2.16.840.1.113883.6.96" displayName="Observation Parameters"/>
472 <effectiveTime>
473 <low value="20100101"/>
474 <high value="20101231"/>
475 </effectiveTime>
476 </act>
477 </entry>
478 </section>
479 </component>
480 <component>
481 <section>
482 <templateId root="2.16.840.1.113883.10.20.1.13"/>
483 <code code="48764-5" codeSystem="2.16.840.1.113883.6.1" />
484 <title>Purpose</title>
485 <text>
486 <xsl:value-of select="/a:ContinuityOfCareRecord/a:Purpose/a:Description/a:Text"></xsl:value-of>
487 </text>
488 </section>
489 </component>
490 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Alerts">
491 <component>
492 <section>
493 <templateId root="2.16.840.1.113883.10.20.1.2" />
494 <!--C83 Allergies and Other Adverse Reactions Section Conformance Identifier-->
495 <templateId root="2.16.840.1.113883.3.88.11.83.102" />
496 <!--IHE Allergies and Other Adverse Reactions Section Conformance Identifier-->
497 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.13" />
498 <code code="48765-2" displayName="Allergies, adverse reactions, alerts" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" />
499 <title>Alerts</title>
500 <text>
501 <table>
502 <tbody>
503 <tr>
504 <th>Type</th>
505 <th>Date</th>
506 <th>Code</th>
507 <th>Description</th>
508 <th>Reaction</th>
509 <th>Source</th>
510 </tr>
511 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Alerts/a:Alert">
512 <tr>
513 <td>
514 <xsl:value-of select="a:Type/a:Text"/>
515 </td>
516 <td>
517 <xsl:call-template name="date:format-date">
518 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
519 </xsl:call-template>
520 </td>
521 <td>
522 <xsl:apply-templates select="a:Description/a:Code"/>
523 </td>
524 <td>
525 <xsl:attribute name="ID">
526 <xsl:value-of select="a:CCRDataObjectID"/>
527 </xsl:attribute>
528 <xsl:value-of select="a:Description/a:Text"/>
529 </td>
530 <td>
531 <xsl:value-of select="a:Reaction/a:Description/a:Text"/>
532 <xsl:if test="a:Reaction/a:Severity/a:Text">
533 -<xsl:value-of select="a:Reaction/a:Severity/a:Text"/>
534 </xsl:if>
535 </td>
536 <td>
537 <xsl:call-template name="actorName">
538 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
539 </xsl:call-template>
540 </td>
541 </tr>
542 </xsl:for-each>
543 </tbody>
544 </table>
545 </text>
546 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Alerts/a:Alert">
547 <entry typeCode="DRIV">
548 <act classCode="ACT" moodCode="EVN">
549 <!--CCD Problem Act Identifier-->
550 <templateId root="2.16.840.1.113883.10.20.1.27"></templateId>
551 <!--C83 Allergy Entry-->
552 <templateId root="2.16.840.1.113883.3.88.11.83.6" />
553 <!--IHE Concern Entry Conformance Identifier-->
554 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5.1"></templateId>
555 <!--IHE Allergy and Intolerance Concerns Entry-->
556 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5.3"></templateId>
557
558 <!-- <id> -->
559 <xsl:call-template name="ccdID">
560 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
561 </xsl:call-template>
562
563 <code nullFlavor="NA"/>
564 <entryRelationship typeCode="SUBJ">
565 <observation classCode="OBS" moodCode="EVN">
566 <!--CCD Alert Observation-->
567 <templateId root="2.16.840.1.113883.10.20.1.18"></templateId>
568 <!--CCD Problem Observation-->
569 <templateId root="2.16.840.1.113883.10.20.1.28" />
570 <!--IHE Problem Entry-->
571 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5" />
572 <!--IHE Allergies and Intolerances Entry-->
573 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.6" />
574 <!-- <id> -->
575 <xsl:call-template name="ccdID">
576 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
577 <xsl:with-param name="suffix"></xsl:with-param>
578 </xsl:call-template>
579
580 <code code="416098002" codeSystem="2.16.840.1.113883.6.96" displayName="drug allergy" codeSystemName="SNOMED CT"/>
581
582 <text>
583 <reference>
584 <xsl:attribute name="value">
585 <xsl:text>#</xsl:text>
586 <xsl:value-of select="a:CCRDataObjectID"/>
587 </xsl:attribute>
588 </reference>
589 </text>
590
591 <statusCode code="completed"/>
592 <value xsi:type="CD" />
593
594 <participant typeCode="CSM">
595 <xsl:choose>
596 <xsl:when test="a:Agent/a:Products/a:Product/a:Product">
597 <xsl:call-template name="ccdParticipantRoleCodedDescription">
598 <xsl:with-param name="ccrCodedDescription" select="a:Product/a:Description"/>
599 </xsl:call-template>
600 </xsl:when>
601
602 </xsl:choose>
603 </participant>
604
605 <xsl:if test="a:Reaction">
606 <entryRelationship typeCode="MFST" inversionInd="true">
607 <observation classCode="OBS" moodCode="EVN">
608 <templateId root="2.16.840.1.113883.10.20.1.54"/>
609 <!--Reaction observation template -->
610 <code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
611 <statusCode code="completed"/>
612 <xsl:call-template name="ccdCodedValue">
613 <xsl:with-param name="ccrCodedDescription" select="a:Reaction/a:Description"/>
614 </xsl:call-template>
615 </observation>
616 </entryRelationship>
617 </xsl:if>
618
619 <xsl:call-template name="ccdStatus">
620 <xsl:with-param name="ccrStatus" select="a:Status"/>
621 </xsl:call-template>
622
623 </observation>
624 </entryRelationship>
625 </act>
626 </entry>
627 </xsl:for-each>
628 </section>
629 </component>
630 </xsl:if>
631 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Problems">
632 <component>
633 <section>
634 <templateId root="2.16.840.1.113883.3.88.11.83.103" assigningAuthorityName="HITSP/C83"/>
635 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.6" assigningAuthorityName="IHE PCC"/>
636 <templateId root="2.16.840.1.113883.10.20.1.11" assigningAuthorityName="HL7 CCD"/>
637 <code code="11450-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Problem list"/>
638 <title>Problems</title>
639 <text>
640 <table>
641 <tbody>
642 <tr>
643 <th>Type</th>
644 <th>Date</th>
645 <th>Code</th>
646 <th>Description</th>
647 <th>Status</th>
648 <th>Source</th>
649 </tr>
650 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Problems/a:Problem">
651 <tr>
652 <td>
653 <xsl:value-of select="a:Type/a:Text"/>
654 </td>
655 <td>
656 <table>
657 <tbody>
658 <xsl:apply-templates select="a:DateTime"/>
659 </tbody>
660 </table>
661 </td>
662 <td>
663 <xsl:apply-templates select="a:Description/a:Code"/>
664 </td>
665 <td>
666 <xsl:attribute name="ID">
667 <xsl:value-of select="a:CCRDataObjectID"></xsl:value-of>
668 </xsl:attribute>
669 <xsl:value-of select="a:Description/a:Text"/>
670 </td>
671 <td>
672 <xsl:value-of select="a:Status/a:Text"/>
673 </td>
674 <td>
675 <xsl:call-template name="actorName">
676 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
677 </xsl:call-template>
678 </td>
679 </tr>
680 </xsl:for-each>
681 </tbody>
682 </table>
683 </text>
684 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Problems/a:Problem">
685 <entry typeCode="DRIV">
686 <act classCode="ACT" moodCode="EVN">
687 <templateId root="2.16.840.1.113883.10.20.1.27"/>
688 <!-- Problem act template -->
689
690 <!-- <id> -->
691 <xsl:call-template name="ccdID">
692 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
693 </xsl:call-template>
694
695 <code nullFlavor="NA"/>
696
697 <xsl:call-template name="ccdPerformer">
698 <xsl:with-param name="ccrActorReference" select="a:Source/a:Actor"/>
699 </xsl:call-template>
700
701 <entryRelationship typeCode="SUBJ">
702 <observation classCode="OBS" moodCode="EVN">
703 <templateId root="2.16.840.1.113883.10.20.1.28" assigningAuthorityName="CCD"/>
704 <!--Problem observation template-->
705
706 <!-- <id> -->
707 <xsl:call-template name="ccdID">
708 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
709 <xsl:with-param name="suffix"></xsl:with-param>
710 </xsl:call-template>
711
712 <code code="55607006" displayName="Problem" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED-CT"/>
713
714 <text>
715 <reference>
716 <xsl:attribute name="value">
717 <xsl:text>#</xsl:text>
718 <xsl:value-of select="a:CCRDataObjectID"/>
719 </xsl:attribute>
720 </reference>
721 </text>
722
723 <statusCode code="completed"/>
724
725 <xsl:call-template name="ccdDateTime">
726 <xsl:with-param name="dt" select="a:DateTime"/>
727 </xsl:call-template>
728
729 <xsl:call-template name="ccdCodedValue">
730 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
731 </xsl:call-template>
732
733 <xsl:call-template name="ccdStatus">
734 <xsl:with-param name="ccrStatus" select="a:Status"/>
735 </xsl:call-template>
736 </observation>
737 </entryRelationship>
738
739 </act>
740 </entry>
741 </xsl:for-each>
742 </section>
743 </component>
744 </xsl:if>
745 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Procedures">
746 <component>
747 <section>
748 <templateId root="2.16.840.1.113883.10.20.1.12"/>
749 <code code="47519-4" codeSystem="2.16.840.1.113883.6.1"/>
750 <title>Procedures</title>
751 <text>
752 <table>
753 <tbody>
754 <tr>
755 <th>Type</th>
756 <th>Date</th>
757 <th>Code</th>
758 <th>Description</th>
759 <th>Location</th>
760 <th>Substance</th>
761 <th>Method</th>
762 <th>Position</th>
763 <th>Site</th>
764 <th>Status</th>
765 <th>Source</th>
766 </tr>
767 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
768 <tr>
769 <xsl:attribute name="id">
770 <xsl:value-of select="a:CCRDataObjectID"/>
771 </xsl:attribute>
772
773 <td>
774 <xsl:value-of select="a:Type/a:Text"/>
775 </td>
776 <table>
777 <tbody>
778 <xsl:apply-templates select="a:DateTime"/>
779 </tbody>
780 </table>
781 <td>
782 <xsl:apply-templates select="a:Description/a:Code"/>
783 </td>
784 <td>
785 <xsl:value-of select="a:Description/a:Text"/>
786 </td>
787 <td>
788 <xsl:for-each select="a:Locations/a:Location">
789 <xsl:value-of select="a:Description/a:Text"/>
790 <xsl:if test="a:Actor">
791 (<xsl:call-template name="actorName">
792 <xsl:with-param name="objID" select="a:Actor/a:ActorID"/>
793 </xsl:call-template>
794 <xsl:if test="a:Actor/a:ActorRole/a:Text">
795 <xsl:text xml:space="preserve"> - </xsl:text><xsl:value-of select="a:ActorRole/a:Text"/>)
796 </xsl:if>
797 </xsl:if>)
798 <xsl:if test="position() != last()">
799 <br/>
800 </xsl:if>
801 </xsl:for-each>
802 </td>
803 <td>
804 <xsl:for-each select="a:Substance">
805 <xsl:value-of select="a:Text"/>
806 </xsl:for-each>
807 </td>
808 <td>
809 <xsl:value-of select="a:Method/a:Text"/>
810 </td>
811 <td>
812 <xsl:value-of select="a:Position/a:Text"/>
813 </td>
814 <td>
815 <xsl:value-of select="a:Site/a:Text"/>
816 </td>
817 <td>
818 <xsl:value-of select="a:Status/a:Text"/>
819 </td>
820 <td>
821 <xsl:call-template name="actorName">
822 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
823 </xsl:call-template>
824 </td>
825 </tr>
826 </xsl:for-each>
827 </tbody>
828 </table>
829 </text>
830
831 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
832 <entry typeCode="DRIV">
833 <procedure classCode="PROC" moodCode="EVN">
834 <templateId root="2.16.840.1.113883.3.88.11.83.17" assigningAuthorityName="HITSP C83"/>
835 <templateId root="2.16.840.1.113883.10.20.1.29" assigningAuthorityName="CCD"/>
836 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.19" assigningAuthorityName="IHE PCC"/>
837
838 <!-- <id> -->
839 <xsl:call-template name="ccdID">
840 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
841 </xsl:call-template>
842
843 <!-- <code> -->
844 <xsl:call-template name="ccdCodedValue">
845 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
846 <xsl:with-param name="nodeName" select="'code'"/>
847 </xsl:call-template>
848
849 <text>
850 <reference>
851 <xsl:attribute name="value">
852 <xsl:text>#</xsl:text>
853 <xsl:value-of select="a:CCRDataObjectID"/>
854 </xsl:attribute>
855 </reference>
856 </text>
857
858 <xsl:call-template name="ccdStatusProcedure">
859 <xsl:with-param name="status" select="a:Status"/>
860 </xsl:call-template>
861
862 <xsl:call-template name="ccdDateTime">
863 <xsl:with-param name="dt" select="a:DateTime"/>
864 </xsl:call-template>
865
866 <xsl:if test="a:Method">
867 <xsl:call-template name="ccdCodedValue">
868 <xsl:with-param name="ccrCodedDescription" select="a:Method"/>
869 <xsl:with-param name="nodeName" select="'approachSiteCode'"/>
870 </xsl:call-template>
871 </xsl:if>
872
873 <xsl:if test="a:Site">
874 <xsl:call-template name="ccdCodedValue">
875 <xsl:with-param name="ccrCodedDescription" select="a:Site"/>
876 <xsl:with-param name="nodeName" select="'targetSiteCode'"/>
877 </xsl:call-template>
878 </xsl:if>
879
880 <xsl:if test="a:Practitioners/a:Practitioner">
881 <xsl:call-template name="ccdPerformer">
882 <xsl:with-param name="ccrActorReference" select="a:Practitioners/a:Practitioner[1]"/>
883 </xsl:call-template>
884 </xsl:if>
885 </procedure>
886 </entry>
887 </xsl:for-each>
888 </section>
889 </component>
890 </xsl:if>
891 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Medications">
892 <component>
893 <section>
894 <templateId root="2.16.840.1.113883.3.88.11.83.112" assigningAuthorityName="HITSP/C83"/>
895 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.19" assigningAuthorityName="IHE PCC"/>
896 <templateId root="2.16.840.1.113883.10.20.1.8" assigningAuthorityName="HL7 CCD"/>
897 <!--Medications section template-->
898 <code code="10160-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of medication use"/>
899 <title>Medications</title>
900 <text>
901 <table>
902 <tbody>
903 <tr>
904 <th>Medication</th>
905 <th>Date</th>
906 <th>Status</th>
907 <th>Form</th>
908 <th>Strength</th>
909 <th>Quantity</th>
910 <th>SIG</th>
911 <th>Indications</th>
912 <th>Instruction</th>
913 <th>Refills</th>
914 <th>Source</th>
915 </tr>
916 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Medications/a:Medication">
917 <tr>
918 <td>
919 <xsl:value-of select="a:Product/a:ProductName/a:Text"/>
920 <xsl:if test="a:Product/a:BrandName">
921 <xsl:text xml:space="preserve"> </xsl:text>(<xsl:value-of select="a:Product/a:BrandName/a:Text"/>)
922 </xsl:if>
923 </td>
924 <td>
925 <xsl:call-template name="date:format-date">
926 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
927 </xsl:call-template>
928 </td>
929 <td>
930 <xsl:value-of select="a:Status/a:Text"/>
931 </td>
932 <td>
933 <xsl:value-of select="a:Product/a:Form/a:Text"/>
934 </td>
935 <td>
936 <xsl:for-each select="a:Product/a:Strength">
937 <xsl:if test="position() > 1">
938 <xsl:text>/</xsl:text>
939 </xsl:if>
940 <xsl:value-of select="a:Value"/>
941 <xsl:text xml:space="preserve"> </xsl:text>
942 <xsl:value-of select="a:Units/a:Unit"/>
943 </xsl:for-each>
944 </td>
945 <td>
946 <xsl:value-of select="a:Quantity/a:Value"/>
947 <xsl:text xml:space="preserve"> </xsl:text>
948 <xsl:value-of select="a:Quantity/a:Units/a:Unit"/>
949 </td>
950 <td>
951 <xsl:for-each select="a:Directions/a:Direction">
952 <xsl:choose>
953 <xsl:when test="a:Description/a:Text">
954 <xsl:value-of select="a:Description/a:Text"/>
955 </xsl:when>
956 <xsl:otherwise>
957 <xsl:value-of select="a:Dose/a:Value"/>
958 <xsl:text xml:space="preserve"> </xsl:text>
959 <xsl:value-of select="a:Dose/a:Units/a:Unit"/>
960 <xsl:text xml:space="preserve"> </xsl:text>
961 <xsl:value-of select="a:Route/a:Text"/>
962 <xsl:text xml:space="preserve"> </xsl:text>
963 <xsl:value-of select="a:Frequency/a:Value"/>
964 <xsl:if test="a:Duration">
965 <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>
966 </xsl:if>
967 <xsl:if test="a:MultipleDirectionModifier/a:ObjectAttribute">
968 <xsl:for-each select="a:MultipleDirectionModifier/a:ObjectAttribute">
969 <xsl:value-of select="a:Attribute"/>
970 <br/>
971 <xsl:value-of select="a:AttributeValue/a:Value"/>
972 </xsl:for-each>
973 </xsl:if>
974 </xsl:otherwise>
975 </xsl:choose>
976 </xsl:for-each>
977 </td>
978 <td>
979 <xsl:for-each select="a:Directions/a:Direction[1]/a:Indication">
980 <xsl:call-template name="problemDescription">
981 <xsl:with-param name="objID" select="a:InternalCCRLink/a:LinkID"/>
982 </xsl:call-template>
983 <br/>
984 </xsl:for-each>
985 </td>
986 <td>
987 <xsl:for-each select="a:PatientInstructions/a:Instruction">
988 <xsl:value-of select="a:Text"/>
989 <br/>
990 </xsl:for-each>
991 </td>
992 <td>
993 <xsl:for-each select="a:Refills/a:Refill">
994 <xsl:value-of select="a:Number"/>
995 <xsl:text xml:space="preserve"> </xsl:text>
996 </xsl:for-each>
997 </td>
998 <td>
999 <xsl:call-template name="actorName">
1000 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1001 </xsl:call-template>
1002 </td>
1003 </tr>
1004 </xsl:for-each>
1005 </tbody>
1006 </table>
1007 </text>
1008 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Medications/a:Medication">
1009 <entry typeCode="DRIV">
1010 <substanceAdministration classCode="SBADM" moodCode="EVN">
1011 <templateId root="2.16.840.1.113883.10.20.1.24" assigningAuthorityName="CCD"/>
1012 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1" assigningAuthorityName="IHE PCC"/>
1013
1014 <!--Medication activity template -->
1015
1016 <!-- <id> -->
1017 <xsl:call-template name="ccdID">
1018 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
1019 </xsl:call-template>
1020
1021 <statusCode code='completed'/>
1022
1023 <xsl:call-template name="ccdDateTime">
1024 <xsl:with-param name="dt" select="a:DateTime"/>
1025 <xsl:with-param name="type" select="'IVL_TS'"/>
1026 </xsl:call-template>
1027
1028 <xsl:call-template name="ccdMedicationFrequency">
1029 <xsl:with-param name="frequency" select="a:Directions/a:Direction/a:Frequency"/>
1030 </xsl:call-template>
1031
1032 <xsl:call-template name="ccdCodedValue">
1033 <xsl:with-param name="ccrCodedDescription" select="a:Directions/a:Direction/a:Route"/>
1034 <xsl:with-param name="nodeName" select="'routeCode'"/>
1035 <xsl:with-param name="domain" select="'RouteOfAdministration'"/>
1036 </xsl:call-template>
1037
1038 <xsl:if test="a:Directions/a:Direction/a:Dose">
1039 <doseQuantity>
1040 <low>
1041 <xsl:attribute name="value">
1042 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Value"></xsl:value-of>
1043 </xsl:attribute>
1044 <xsl:attribute name="unit">
1045 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Unit"></xsl:value-of>
1046 </xsl:attribute>
1047 </low>
1048 <high>
1049 <xsl:attribute name="value">
1050 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Value"></xsl:value-of>
1051 </xsl:attribute>
1052 <xsl:attribute name="unit">
1053 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Unit"></xsl:value-of>
1054 </xsl:attribute>
1055 </high>
1056 </doseQuantity>
1057 </xsl:if>
1058 <consumable>
1059 <manufacturedProduct>
1060 <templateId root="2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName="HITSP C83"/>
1061 <templateId root="2.16.840.1.113883.10.20.1.53" assigningAuthorityName="CCD"/>
1062 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName="IHE PCC"/>
1063
1064 <!-- Product template -->
1065
1066 <manufacturedMaterial>
1067 <xsl:call-template name="ccdCodedValue">
1068 <xsl:with-param name="ccrCodedDescription" select="a:Product/a:ProductName"/>
1069 <xsl:with-param name="nodeName" select="'code'"/>
1070 </xsl:call-template>
1071 <name>
1072 <xsl:value-of select="a:Product/a:BrandName/a:Text"/>
1073 </name>
1074 </manufacturedMaterial>
1075 </manufacturedProduct>
1076 </consumable>
1077 </substanceAdministration>
1078 </entry>
1079 </xsl:for-each>
1080 </section>
1081 </component>
1082 </xsl:if>
1083 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Immunizations">
1084 <component>
1085 <section>
1086 <templateId root="2.16.840.1.113883.10.20.1.6"/>
1087 <code code="11369-6" codeSystem="2.16.840.1.113883.6.1"/>
1088 <title>Immunizations</title>
1089 <text>
1090 <table>
1091 <tbody>
1092 <tr>
1093 <th>Code</th>
1094 <th>Vaccine</th>
1095 <th>Date</th>
1096 <th>Route</th>
1097 <th>Site</th>
1098 <th>Source</th>
1099 </tr>
1100 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Immunizations/a:Immunization">
1101 <tr>
1102 <xsl:attribute name="id">
1103 <xsl:value-of select="a:CCRDataObjectID"/>
1104 </xsl:attribute>
1105 <td>
1106 <xsl:apply-templates select="a:Product/a:ProductName/a:Code"/>
1107 </td>
1108 <td>
1109
1110 <xsl:value-of select="a:Product/a:ProductName/a:Text"/>
1111 <xsl:if test="a:Product/a:Form">
1112 <xsl:text xml:space="preserve"> </xsl:text>(<xsl:value-of select="a:Product/a:Form/a:Text"/>)
1113 </xsl:if>
1114 </td>
1115 <td>
1116 <xsl:call-template name="date:format-date">
1117 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
1118 </xsl:call-template>
1119 </td>
1120 <td>
1121 <xsl:value-of select="a:Directions/a:Direction/a:Route/a:Text"/>
1122 </td>
1123 <td>
1124 <xsl:attribute name="id">
1125 <xsl:value-of select="a:CCRDataObjectID"/>
1126 <xsl:text>:Site</xsl:text>
1127 </xsl:attribute>
1128
1129 <xsl:value-of select="a:Directions/a:Direction/a:Site/a:Text"/>
1130 </td>
1131 <td>
1132 <xsl:call-template name="actorName">
1133 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1134 </xsl:call-template>
1135 </td>
1136 </tr>
1137 </xsl:for-each>
1138 </tbody>
1139 </table>
1140 </text>
1141 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Immunizations/a:Immunization">
1142 <entry typeCode="DRIV">
1143 <substanceAdministration classCode="SBADM" moodCode="EVN">
1144 <templateId root="2.16.840.1.113883.10.20.1.24" assigningAuthorityName="CCD"/>
1145 <templateId root="2.16.840.1.113883.3.88.11.83.13" assigningAuthorityName="HITSP C83"/>
1146 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.12" assigningAuthorityName="IHE PCC"/>
1147
1148 <!-- Medication activity template -->
1149
1150 <!-- <id> -->
1151 <xsl:call-template name="ccdID">
1152 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
1153 </xsl:call-template>
1154
1155 <code code="IMMUNIZ" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7 ActCode"/>
1156 <text>
1157 <reference>
1158 <xsl:attribute name="value">
1159 <xsl:text>#</xsl:text>
1160 <xsl:value-of select="a:CCRDataObjectID"/>
1161 </xsl:attribute>
1162 </reference>
1163 </text>
1164
1165 <statusCode code='completed'/>
1166
1167 <xsl:call-template name="ccdDateTime">
1168 <xsl:with-param name="dt" select="a:DateTime"/>
1169 <xsl:with-param name="type" select="'IVL_TS'"/>
1170 </xsl:call-template>
1171
1172 <xsl:call-template name="ccdCodedValue">
1173 <xsl:with-param name="ccrCodedDescription" select="a:Directions/a:Direction/a:Route"/>
1174 <xsl:with-param name="nodeName" select="'routeCode'"/>
1175 <xsl:with-param name="domain" select="'RouteOfAdministration'"/>
1176 </xsl:call-template>
1177
1178 <xsl:if test="a:Directions/a:Direction/a:Site">
1179 <xsl:call-template name="ccdCodedValue">
1180 <xsl:with-param name="ccrCodedDescription" select="a:Directions/a:Direction/a:Site"/>
1181 <xsl:with-param name="nodeName" select="'approachSiteCode'"/>
1182 <xsl:with-param name="originalTextReference">
1183 <xsl:text>#</xsl:text>
1184 <xsl:value-of select="a:CCRDataObjectID"/>
1185 <xsl:text>:Site</xsl:text>
1186 </xsl:with-param>
1187 </xsl:call-template>
1188 </xsl:if>
1189
1190 <consumable>
1191 <manufacturedProduct>
1192 <templateId root="2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName="HITSP C83"/>
1193 <templateId root="2.16.840.1.113883.10.20.1.53" assigningAuthorityName="CCD"/>
1194 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName="IHE PCC"/>
1195
1196 <!-- Product template -->
1197
1198 <manufacturedMaterial>
1199 <xsl:call-template name="ccdCodedValue">
1200 <xsl:with-param name="ccrCodedDescription" select="a:Product/a:ProductName"/>
1201 <xsl:with-param name="nodeName" select="'code'"/>
1202 </xsl:call-template>
1203 <name>
1204 <xsl:value-of select="a:Product/a:BrandName/a:Text"/>
1205 </name>
1206 </manufacturedMaterial>
1207 </manufacturedProduct>
1208 </consumable>
1209
1210 </substanceAdministration>
1211 </entry>
1212 </xsl:for-each>
1213 </section>
1214 </component>
1215 </xsl:if>
1216 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:VitalSigns">
1217 <component>
1218 <section>
1219 <templateId root="2.16.840.1.113883.10.20.1.16"/>
1220 <code code="8716-3" codeSystem="2.16.840.1.113883.6.1"/>
1221 <title>Vital Signs</title>
1222 <text>
1223 <table>
1224 <tbody>
1225 <tr>
1226 <th>Vital Sign</th>
1227 <th>Date</th>
1228 <th>Result</th>
1229 <th>Source</th>
1230 </tr>
1231 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:VitalSigns/a:Result">
1232 <tr>
1233 <xsl:attribute name="id">
1234 <xsl:value-of select="a:CCRDataObjectID"/>
1235 </xsl:attribute>
1236
1237 <td>
1238 <xsl:value-of select="a:Description/a:Text"/>
1239 </td>
1240 <td>
1241 <xsl:call-template name="date:format-date">
1242 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
1243 </xsl:call-template>
1244 </td>
1245 <td>
1246 <xsl:for-each select="a:Test">
1247 <xsl:value-of select="a:Description/a:Text"/>
1248 <xsl:text xml:space="preserve"> </xsl:text>
1249 <xsl:value-of select="a:TestResult/a:Value"/>
1250 <xsl:text xml:space="preserve"> </xsl:text>
1251 <xsl:value-of select="a:TestResult/a:Units/a:Unit"/>
1252 <xsl:text xml:space="preserve"> </xsl:text>
1253 <xsl:value-of select="a:Flag/a:Text"/>
1254 <br/>
1255 </xsl:for-each>
1256 </td>
1257 <td>
1258 <xsl:call-template name="actorName">
1259 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1260 </xsl:call-template>
1261 </td>
1262 </tr>
1263 </xsl:for-each>
1264 </tbody>
1265 </table>
1266 </text>
1267 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:VitalSigns/a:Result">
1268 <entry typeCode="DRIV">
1269 <organizer classCode="CLUSTER" moodCode="EVN">
1270 <templateId root="2.16.840.1.113883.10.20.1.32" assigningAuthorityName="CCD"/>
1271 <templateId root="2.16.840.1.113883.10.20.1.35" assigningAuthorityName="CCD"/>
1272 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.1" assigningAuthorityName="IHE PCC"/>
1273 <!-- Vital signs organizer template -->
1274
1275 <xsl:variable name="testDate" select="a:DateTime"/>
1276
1277 <!-- <id> -->
1278 <xsl:call-template name="ccdID">
1279 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
1280 </xsl:call-template>
1281
1282 <code code="46680005" codeSystem="2.16.840.1.113883.6.96" displayName="Vital signs" codeSystemName="SNOMED CT"/>
1283 <statusCode code="completed"/>
1284 <xsl:call-template name="ccdDateTime">
1285 <xsl:with-param name="dt" select="$testDate"/>
1286 </xsl:call-template>
1287
1288 <xsl:call-template name="ccdObservation">
1289 <xsl:with-param name="ccrTestNode" select="a:Test[1]"/>
1290 <xsl:with-param name="testDate" select="$testDate"/>
1291 </xsl:call-template>
1292
1293 </organizer>
1294 </entry>
1295 </xsl:for-each>
1296 </section>
1297 </component>
1298 </xsl:if>
1299 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Encounters">
1300 <component>
1301 <section>
1302 <templateId root="2.16.840.1.113883.3.88.11.83.127" assigningAuthorityName="HITSP/C83"/>
1303 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.5.3.3" assigningAuthorityName="IHE PCC"/>
1304 <templateId root="2.16.840.1.113883.10.20.1.3" assigningAuthorityName="HL7 CCD"/>
1305 <!--Encounters section template-->
1306 <code code="46240-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of encounters"/>
1307 <title>Encounters</title>
1308 <text>
1309 <table>
1310 <tbody>
1311 <tr>
1312 <th>Type</th>
1313 <th>Date</th>
1314 <th>Location</th>
1315 <th>Status</th>
1316 <th>Practitioner</th>
1317 <th>Description</th>
1318 <th>Indications</th>
1319 <th>Source</th>
1320 </tr>
1321 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Encounters/a:Encounter">
1322 <tr>
1323 <xsl:attribute name="id">
1324 <xsl:value-of select="a:CCRDataObjectID"/>
1325 </xsl:attribute>
1326
1327 <td>
1328 <xsl:value-of select="a:Type/a:Text"/>
1329 </td>
1330 <td>
1331 <xsl:call-template name="date:format-date">
1332 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
1333 </xsl:call-template>
1334 </td>
1335 <td>
1336 <xsl:for-each select="a:Locations/a:Location">
1337 <xsl:value-of select="a:Description/a:Text"/>
1338 <xsl:call-template name="actorName">
1339 <xsl:with-param name="objID" select="a:Actor/a:ActorID"/>
1340 </xsl:call-template>
1341 <br/>
1342 </xsl:for-each>
1343 </td>
1344 <td>
1345 <xsl:value-of select="a:Status/a:Text"/>
1346 </td>
1347 <td>
1348 <xsl:for-each select="a:Practitioners/a:Practitioner">
1349 <xsl:call-template name="actorName">
1350 <xsl:with-param name="objID" select="a:ActorID"/>
1351 </xsl:call-template>
1352 <br/>
1353 </xsl:for-each>
1354 </td>
1355 <td>
1356 <xsl:value-of select="a:Description/a:Text"/>
1357 </td>
1358 <td>
1359 <xsl:for-each select="a:Indications/a:Indication">
1360 <xsl:call-template name="problemDescription">
1361 <xsl:with-param name="objID" select="a:InternalCCRLink/a:LinkID"/>
1362 </xsl:call-template>
1363 <br/>
1364 </xsl:for-each>
1365 </td>
1366 <td>
1367 <xsl:call-template name="actorName">
1368 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1369 </xsl:call-template>
1370 </td>
1371 </tr>
1372 </xsl:for-each>
1373 </tbody>
1374 </table>
1375 </text>
1376 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Encounters/a:Encounter">
1377 <entry typeCode="DRIV">
1378 <encounter classCode="ENC" moodCode="EVN">
1379 <templateId root="2.16.840.1.113883.3.88.11.83.16" assigningAuthorityName="HITSP C83"/>
1380 <templateId root="2.16.840.1.113883.10.20.1.21" assigningAuthorityName="CCD"/>
1381 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.14" assigningAuthorityName="IHE PCC"/>
1382
1383 <!-- Encounter activity template -->
1384
1385 <!-- <id> -->
1386 <xsl:call-template name="ccdID">
1387 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
1388 </xsl:call-template>
1389
1390 <xsl:call-template name="ccdCodedValue">
1391 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
1392 <xsl:with-param name="nodeName" select="'code'"/>
1393 </xsl:call-template>
1394
1395 <text>
1396 <reference>
1397 <xsl:attribute name="value">
1398 <xsl:text>#</xsl:text>
1399 <xsl:value-of select="a:CCRDataObjectID"/>
1400 </xsl:attribute>
1401 </reference>
1402 </text>
1403
1404 <xsl:call-template name="ccdDateTime">
1405 <xsl:with-param name="dt" select="a:DateTime"/>
1406 </xsl:call-template>
1407
1408 <xsl:if test="a:Practitioners[1]/a:Practitioner">
1409 <xsl:call-template name="ccdPerformer">
1410 <xsl:with-param name="ccrActorReference" select="a:Practitioners/a:Practitioner[1]"/>
1411 </xsl:call-template>
1412 </xsl:if>
1413
1414 <xsl:if test="a:Locations[1]/a:Location">
1415 <participant typeCode="LOC">
1416 <templateId root="2.16.840.1.113883.10.20.1.45"/>
1417 <!-- Location participation template -->
1418 <xsl:choose>
1419 <xsl:when test="a:Locations[1]/a:Location/a:ActorID">
1420 <xsl:call-template name="ccdParticipantRoleActor">
1421 <xsl:with-param name="ccrActorObjectID" select="a:Locations[1]/a:Location/a:ActorID"/>
1422 </xsl:call-template>
1423 </xsl:when>
1424 <xsl:otherwise>
1425 <xsl:call-template name="ccdParticipantRoleCodedDescription">
1426 <xsl:with-param name="ccrCodedDescription" select="a:Locations[1]/a:Location/a:Description"/>
1427 </xsl:call-template>
1428 </xsl:otherwise>
1429 </xsl:choose>
1430 </participant>
1431 </xsl:if>
1432 </encounter>
1433 </entry>
1434 </xsl:for-each>
1435 </section>
1436 </component>
1437 </xsl:if>
1438 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Results/a:Result">
1439 <component>
1440 <section>
1441 <templateId root="2.16.840.1.113883.10.20.1.14"/>
1442 <code code="30954-2" codeSystem="2.16.840.1.113883.6.1"/>
1443 <title>Results</title>
1444 <text>
1445 <table>
1446 <tbody>
1447 <tr>
1448 <th>Test</th>
1449 <th>Date</th>
1450 <th>Result</th>
1451 <th>Source</th>
1452 </tr>
1453 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Results/a:Result">
1454 <tr>
1455 <xsl:attribute name="id">
1456 <xsl:value-of select="a:CCRDataObjectID"/>
1457 </xsl:attribute>
1458 <td>
1459 <xsl:value-of select="a:Description/a:Text"/>
1460 </td>
1461 <td>
1462 <xsl:call-template name="date:format-date">
1463 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
1464 </xsl:call-template>
1465 </td>
1466 <td>
1467 <xsl:for-each select="a:Test[a:TestResult/a:Value!='']">
1468 <div>
1469 <xsl:attribute name="id">
1470 <xsl:value-of select="a:CCRDataObjectID"/>
1471 </xsl:attribute>
1472
1473 <xsl:value-of select="a:Description/a:Text"/>
1474 <xsl:text xml:space="preserve"> </xsl:text>
1475 <xsl:value-of select="a:TestResult/a:Value"/>
1476 <xsl:text xml:space="preserve"> </xsl:text>
1477 <xsl:value-of select="a:TestResult/a:Units/a:Unit"/>
1478 <xsl:text xml:space="preserve"> </xsl:text>
1479 <xsl:value-of select="a:Flag/a:Text"/>
1480 <br/>
1481 </div>
1482 </xsl:for-each>
1483 <xsl:for-each select="a:Test[a:TestResult/a:Description/a:Text!='']">
1484 <div>
1485 <xsl:attribute name="id">
1486 <xsl:value-of select="a:CCRDataObjectID"/>
1487 </xsl:attribute>
1488
1489 <xsl:value-of select="a:Description/a:Text"/>
1490 <xsl:text xml:space="preserve"> </xsl:text>
1491 <xsl:value-of select="a:TestResult/a:Description/a:Text" disable-output-escaping="yes"/>
1492 <xsl:text xml:space="preserve"> </xsl:text>
1493 <xsl:value-of select="a:Flag/a:Text"/>
1494 <br/>
1495 </div>
1496 </xsl:for-each>
1497 </td>
1498 <td>
1499 <xsl:call-template name="actorName">
1500 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1501 </xsl:call-template>
1502 </td>
1503 </tr>
1504 </xsl:for-each>
1505 </tbody>
1506 </table>
1507 </text>
1508 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Results/a:Result">
1509 <entry typeCode="DRIV">
1510 <xsl:variable name="testDate" select="a:DateTime"/>
1511
1512 <xsl:choose>
1513 <xsl:when test="count(a:Test)>1">
1514 <organizer classCode="BATTERY" moodCode="EVN">
1515 <templateId root="2.16.840.1.113883.10.20.1.32"/>
1516 <!--Result organizer template -->
1517
1518 <!-- <id> -->
1519 <xsl:call-template name="ccdID">
1520 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
1521 </xsl:call-template>
1522
1523 <!-- <code> -->
1524 <xsl:call-template name="ccdCodedValue">
1525 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
1526 <xsl:with-param name="nodeName" select="'code'"/>
1527 </xsl:call-template>
1528
1529 <statusCode code="completed"/>
1530
1531 <!-- <effectiveTime> -->
1532 <xsl:call-template name="ccdDateTime">
1533 <xsl:with-param name="dt" select="$testDate"/>
1534 </xsl:call-template>
1535
1536 <xsl:call-template name="ccdPerformer">
1537 <xsl:with-param name="ccrActorReference" select="a:Source/a:Actor"/>
1538 </xsl:call-template>
1539
1540 <xsl:for-each select="a:Test">
1541 <xsl:call-template name="ccdObservation">
1542 <xsl:with-param name="ccrTestNode" select="."/>
1543 <xsl:with-param name="testDate" select="$testDate"/>
1544 </xsl:call-template>
1545 </xsl:for-each>
1546
1547 </organizer>
1548
1549 </xsl:when>
1550 <xsl:otherwise>
1551 <xsl:call-template name="ccdObservation">
1552 <xsl:with-param name="ccrTestNode" select="a:Test[1]"/>
1553 <xsl:with-param name="testDate" select="$testDate"/>
1554 </xsl:call-template>
1555 </xsl:otherwise>
1556 </xsl:choose>
1557 </entry>
1558 </xsl:for-each>
1559 </section>
1560 </component>
1561 </xsl:if>
1562 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Payers">
1563 <component>
1564 <section>
1565 <templateId root="2.16.840.1.113883.10.20.1.9"/>
1566 <code code="48768-6" codeSystem="2.16.840.1.113883.6.1"/>
1567 <title>Insurance</title>
1568 <text>
1569 <table>
1570 <tbody>
1571 <tr>
1572 <th>Type</th>
1573 <th>Date</th>
1574 <th>Identification Numbers</th>
1575 <th>Payment Provider</th>
1576 <th>Subscriber</th>
1577 <th>Source</th>
1578 </tr>
1579 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Payers/a:Payer">
1580 <tr>
1581 <td>
1582 <xsl:value-of select="a:Type/a:Text"/>
1583 </td>
1584 <td>
1585 <xsl:call-template name="date:format-date">
1586 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
1587 </xsl:call-template>
1588 </td>
1589 <td>
1590 <xsl:for-each select="a:IDs">
1591 <xsl:value-of select="a:Type/a:Text"/>:<xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:ID"/><br/>
1592 </xsl:for-each>
1593 </td>
1594 <td>
1595 <xsl:call-template name="actorName">
1596 <xsl:with-param name="objID" select="a:PaymentProvider/a:ActorID"/>
1597 </xsl:call-template>
1598 </td>
1599 <td>
1600 <xsl:call-template name="actorName">
1601 <xsl:with-param name="objID" select="a:Subscriber/a:ActorID"/>
1602 </xsl:call-template>
1603 </td>
1604 <td>
1605 <xsl:call-template name="actorName">
1606 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1607 </xsl:call-template>
1608 </td>
1609 </tr>
1610 </xsl:for-each>
1611 </tbody>
1612 </table>
1613 </text>
1614 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Payers/a:Payer">
1615 <entry typeCode="DRIV">
1616 <act classCode="ACT" moodCode="DEF">
1617 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.17" assigningAuthorityName="IHE PCC"/>
1618 <templateId root="2.16.840.1.113883.10.20.1.20" assigningAuthorityName="CCD"/>
1619 <!-- Coverage entry template -->
1620 <!-- <id> -->
1621 <xsl:call-template name="ccdID">
1622 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
1623 </xsl:call-template>
1624 <code code="48768-6" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Payment sources"/>
1625 <statusCode code="completed"/>
1626 <entryRelationship typeCode="COMP">
1627 <act classCode="ACT" moodCode="EVN">
1628 <templateId root="2.16.840.1.113883.3.88.11.83.5" assigningAuthorityName="HITSP C83"/>
1629 <templateId root="2.16.840.1.113883.10.20.1.26" assigningAuthorityName="CCD"/>
1630 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.18" assigningAuthorityName="IHE PCC"/>
1631 <!--Insurance provider template -->
1632 <id>
1633 <xsl:attribute name="root">
1634 <xsl:value-of select="a:IDs[1]/a:ID"/>
1635 </xsl:attribute>
1636 <xsl:attribute name="extension">
1637 <xsl:value-of select="a:IDs[1]/a:Type/a:Text"/>
1638 </xsl:attribute>
1639 </id>
1640
1641 <!-- <code> -->
1642 <xsl:call-template name="ccdCodedValue">
1643 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
1644 <xsl:with-param name="nodeName" select="'code'"/>
1645 </xsl:call-template>
1646
1647 <statusCode code="completed"/>
1648
1649 <xsl:call-template name="ccdPerformer">
1650 <xsl:with-param name="ccrActorReference" select="a:PaymentProvider"/>
1651 </xsl:call-template>
1652
1653 <participant typeCode="HLD">
1654 <xsl:call-template name="ccdParticipantRoleActor">
1655 <xsl:with-param name="ccrActorReference" select="a:Subscriber"/>
1656 </xsl:call-template>
1657 </participant>
1658 </act>
1659 </entryRelationship>
1660 </act>
1661 </entry>
1662 </xsl:for-each>
1663 </section>
1664 </component>
1665 </xsl:if>
1666 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:HealthCareProviders">
1667 <component>
1668 <section>
1669 <title>Health Care Providers</title>
1670 <text>
1671 <table>
1672 <tbody>
1673 <tr>
1674 <th>Role</th>
1675 <th>Name</th>
1676 </tr>
1677 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:HealthCareProviders/a:Provider">
1678 <tr>
1679 <td>
1680 <xsl:value-of select="a:ActorRole/a:Text"/>
1681 </td>
1682 <td>
1683 <xsl:call-template name="actorName">
1684 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1685 </xsl:call-template>
1686 </td>
1687 </tr>
1688 </xsl:for-each>
1689 </tbody>
1690 </table>
1691 </text>
1692 </section>
1693 </component>
1694 </xsl:if>
1695 <!--
1696 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:SupportProviders">
1697 <component>
1698 <section>
1699 <title>Support Providers</title>
1700 <text>
1701 <table>
1702 <tbody>
1703 <tr>
1704 <th>Role</th>
1705 <th>Name</th>
1706 </tr>
1707 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Support/a:SupportProvider">
1708 <tr>
1709 <td>
1710 <xsl:value-of select="a:ActorRole/a:Text"/>
1711 </td>
1712 <td>
1713 <xsl:call-template name="actorName">
1714 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1715 </xsl:call-template>
1716 </td>
1717 </tr>
1718 </xsl:for-each>
1719 </tbody>
1720 </table>
1721 </text>
1722 </section>
1723 </component>
1724 </xsl:if>
1725 <xsl:if test="a:ContinuityOfCareRecord/a:References">
1726 <component>
1727 <section>
1728 <title>References</title>
1729 <text>
1730 <table>
1731 <tbody>
1732 <tr>
1733 <th>Type</th>
1734 <th>Date</th>
1735 <th>Description</th>
1736 <th>Location</th>
1737 <th>Source</th>
1738 </tr>
1739 <xsl:for-each select="/a:ContinuityOfCareRecord/a:References/a:Reference">
1740 <tr>
1741 <td>
1742 <xsl:value-of select="a:Type/a:Text"/>
1743 </td>
1744 <td>
1745 <xsl:call-template name="date:format-date">
1746 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
1747 </xsl:call-template>
1748 </td>
1749 <td>
1750 <strong class="clinical">
1751 <xsl:value-of select="a:Description/a:Text"/>
1752 </strong>
1753 </td>
1754 <td>
1755 <xsl:value-of select="a:Locations/a:Location/a:Description/a:Text"/>
1756 </td>
1757 <td>
1758 <xsl:call-template name="actorName">
1759 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1760 </xsl:call-template>
1761 </td>
1762 </tr>
1763 </xsl:for-each>
1764 </tbody>
1765 </table>
1766 </text>
1767 </section>
1768 </component>
1769 </xsl:if>
1770 -->
1771 <!--
1772 <component>
1773 <section>
1774 <title>Additional Information About People &amp; Organizations</title>
1775 <text>
1776 <xsl:if test="a:ContinuityOfCareRecord/a:Actors/a:Actor[a:Person]">
1777 <table>
1778 <tbody>
1779 <tr>
1780 <th>Name</th>
1781 <th>Specialty</th>
1782 <th>Relation</th>
1783 <th>Identification Numbers</th>
1784 <th>Phone</th>
1785 <th>Address/ E-mail</th>
1786 </tr>
1787 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Actors/a:Actor">
1788 <xsl:sort select="a:Person/a:Name/a:DisplayName|a:Person/a:Name/a:CurrentName/a:Family" data-type="text" order="ascending"/>
1789 <xsl:if test="a:Person">
1790 <tr>
1791 <td>
1792 <xsl:call-template name="actorName">
1793 <xsl:with-param name="objID" select="a:ActorObjectID"/>
1794 </xsl:call-template>
1795 </td>
1796 <td>
1797 <xsl:value-of select="a:Specialty/a:Text"/>
1798 </td>
1799 <td>
1800 <xsl:value-of select="a:Relation/a:Text"/>
1801 </td>
1802 <td>
1803 <xsl:for-each select="a:IDs">
1804 <xsl:value-of select="a:Type/a:Text"/>
1805 <xsl:text>: </xsl:text>
1806 <xsl:value-of select="a:ID"/>
1807 </xsl:for-each>
1808 </td>
1809 <td>
1810 <xsl:for-each select="a:Telephone">
1811 <xsl:value-of select="a:Type/a:Text"/>
1812 <xsl:text>: </xsl:text>
1813 <xsl:value-of select="a:Value"/>
1814 </xsl:for-each>
1815 </td>
1816 <td>
1817 <xsl:for-each select="a:Address">
1818 <xsl:if test="a:Type">
1819 <xsl:value-of select="a:Type/a:Text"/>
1820 <xsl:text>:</xsl:text>
1821 <br/>
1822 </xsl:if>
1823 <xsl:if test="a:Line1">
1824 <xsl:value-of select="a:Line1"/>
1825 <br/>
1826 </xsl:if>
1827 <xsl:if test="a:Line2">
1828 <xsl:value-of select="a:Line2"/>
1829 <br/>
1830 </xsl:if>
1831 <xsl:if test="a:City">
1832 <xsl:value-of select="a:City"/>
1833 <xsl:text>, </xsl:text>
1834 </xsl:if>
1835 <xsl:value-of select="a:State"/>
1836 <xsl:value-of select="a:PostalCode"/>
1837 <br/>
1838 </xsl:for-each>
1839 <xsl:for-each select="a:EMail">
1840 <br/>
1841 <xsl:value-of select="a:Value"/>
1842 </xsl:for-each>
1843 </td>
1844 </tr>
1845 </xsl:if>
1846 </xsl:for-each>
1847 </tbody>
1848 </table>
1849 </xsl:if>
1850 <xsl:if test="a:ContinuityOfCareRecord/a:Actors/a:Actor[a:Organization]">
1851 <table>
1852 <tbody>
1853 <tr>
1854 <th>Name</th>
1855 <th>Specialty</th>
1856 <th>Relation</th>
1857 <th>Identification Numbers</th>
1858 <th>Phone</th>
1859 <th>Address/ E-mail</th>
1860 </tr>
1861 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Actors/a:Actor">
1862 <xsl:sort select="a:Organization/a:Name" data-type="text" order="ascending"/>
1863 <xsl:if test="a:Organization">
1864 <tr>
1865 <td>
1866 <xsl:value-of select="a:Organization/a:Name"/>
1867 </td>
1868 <td>
1869 <xsl:value-of select="a:Specialty/a:Text"/>
1870 </td>
1871 <td>
1872 <xsl:value-of select="a:Relation/a:Text"/>
1873 </td>
1874 <td>
1875 <xsl:for-each select="a:IDs">
1876 <xsl:value-of select="a:Type/a:Text"/>
1877 <xsl:text>: </xsl:text>
1878 <xsl:value-of select="a:ID"/>
1879 </xsl:for-each>
1880 </td>
1881 <td>
1882 <xsl:for-each select="a:Telephone">
1883 <xsl:value-of select="a:Type/a:Text"/>
1884 <xsl:text>: </xsl:text>
1885 <xsl:value-of select="a:Value"/>
1886 </xsl:for-each>
1887 </td>
1888 <td>
1889 <xsl:for-each select="a:Address">
1890 <xsl:if test="a:Type">
1891 <xsl:value-of select="a:Type/a:Text"/>
1892 <xsl:text>:</xsl:text>
1893 <br/>
1894 </xsl:if>
1895 <xsl:if test="a:Line1">
1896 <xsl:value-of select="a:Line1"/>
1897 <br/>
1898 </xsl:if>
1899 <xsl:if test="a:Line2">
1900 <xsl:value-of select="a:Line2"/>
1901 <br/>
1902 </xsl:if>
1903 <xsl:if test="a:City">
1904 <xsl:value-of select="a:City"/>
1905 <xsl:text>, </xsl:text>
1906 </xsl:if>
1907 <xsl:value-of select="a:State"/>
1908 <xsl:value-of select="a:PostalCode"/>
1909 <br/>
1910 </xsl:for-each>
1911 <xsl:for-each select="a:EMail">
1912 <br/>
1913 <xsl:value-of select="a:Value"/>
1914 </xsl:for-each>
1915 </td>
1916 </tr>
1917 </xsl:if>
1918 </xsl:for-each>
1919 </tbody>
1920 </table>
1921 </xsl:if>
1922 <xsl:if test="a:ContinuityOfCareRecord/a:Actors/a:Actor[a:InformationSystem]">
1923 <table>
1924 <tbody>
1925 <tr>
1926 <th>Name</th>
1927 <th>Type</th>
1928 <th>Version</th>
1929 <th>Identification Numbers</th>
1930 <th>Phone</th>
1931 <th>Address/ E-mail</th>
1932 </tr>
1933 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Actors/a:Actor">
1934 <xsl:sort select="a:InformationSystem/a:Name" data-type="text" order="ascending"/>
1935 <xsl:if test="a:InformationSystem">
1936 <tr>
1937 <td>
1938 <xsl:value-of select="a:InformationSystem/a:Name"/>
1939 </td>
1940 <td>
1941 <xsl:value-of select="a:InformationSystem/a:Type"/>
1942 </td>
1943 <td>
1944 <xsl:value-of select="a:InformationSystem/a:Version"/>
1945 </td>
1946 <td>
1947 <xsl:for-each select="a:IDs">
1948 <xsl:value-of select="a:Type/a:Text"/>
1949 <xsl:text>: </xsl:text>
1950 <xsl:value-of select="a:ID"/>
1951 </xsl:for-each>
1952 </td>
1953 <td>
1954 <xsl:for-each select="a:Telephone">
1955 <xsl:value-of select="a:Type/a:Text"/>
1956 <xsl:text>: </xsl:text>
1957 <xsl:value-of select="a:Value"/>
1958 </xsl:for-each>
1959 </td>
1960 <td>
1961 <xsl:for-each select="a:Address">
1962 <xsl:if test="Type">
1963 <xsl:value-of select="a:Type/a:Text"/>
1964 <xsl:text>:</xsl:text>
1965 <br/>
1966 </xsl:if>
1967 <xsl:if test="a:Line1">
1968 <xsl:value-of select="a:Line1"/>
1969 <br/>
1970 </xsl:if>
1971 <xsl:if test="a:Line2">
1972 <xsl:value-of select="a:Line2"/>
1973 <br/>
1974 </xsl:if>
1975 <xsl:if test="a:City">
1976 <xsl:value-of select="a:City"/>
1977 <xsl:text>, </xsl:text>
1978 </xsl:if>
1979 <xsl:value-of select="a:State"/>
1980 <xsl:value-of select="a:PostalCode"/>
1981 <br/>
1982 </xsl:for-each>
1983 <xsl:for-each select="a:EMail">
1984 <br/>
1985 <xsl:value-of select="a:Value"/>
1986 </xsl:for-each>
1987 </td>
1988 </tr>
1989 </xsl:if>
1990 </xsl:for-each>
1991 </tbody>
1992 </table>
1993 </xsl:if>
1994 </text>
1995 </section>
1996 </component>
1997 -->
1998</section>
1999</component>
2000</section>
2001</component>
2002</structuredBody>
2003</component>
2004</ClinicalDocument>
2005 </xsl:template>
2006 <xsl:template name="ccdAssignedEntity">
2007 <xsl:param name="ccrActorObjectID"/>
2008
2009 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2010
2011 <assignedEntity>
2012 <xsl:call-template name="ccdEntityID">
2013 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2014 </xsl:call-template>
2015
2016 <xsl:call-template name="ccdAddress">
2017 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address"/>
2018 </xsl:call-template>
2019
2020 <xsl:call-template name="ccdTelecom">
2021 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2022 </xsl:call-template>
2023
2024 <xsl:if test="$CCRActor/a:Person">
2025 <xsl:call-template name="ccdPerson">
2026 <xsl:with-param name="CCRActorPerson" select="$CCRActor/a:Person"/>
2027 <xsl:with-param name="personNodeName" select="'assignedPerson'"/>
2028 </xsl:call-template>
2029 </xsl:if>
2030
2031 <xsl:if test="$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']">
2032 <xsl:call-template name="ccdOrganization">
2033 <xsl:with-param name="ccrActorObjectID" select="$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']/a:LinkID"/>
2034 <xsl:with-param name="organizationNodeName" select="'representedOrganization'"/>
2035 </xsl:call-template>
2036 </xsl:if>
2037
2038 </assignedEntity>
2039 </xsl:template>
2040
2041 <xsl:template name="ccdPatient">
2042 <xsl:param name="CCRActorPerson"/>
2043 <patient>
2044 <xsl:call-template name="ccdPersonName">
2045 <xsl:with-param name="CCRActorName" select="$CCRActorPerson/a:Name"/>
2046 </xsl:call-template>
2047
2048 <xsl:if test="$CCRActorPerson/a:Gender">
2049 <xsl:call-template name="ccdCodedValue">
2050 <xsl:with-param name="ccrCodedDescription" select="$CCRActorPerson/a:Gender"/>
2051 <xsl:with-param name="domain" select="'AdministrativeGender'"/>
2052 <xsl:with-param name="nodeName" select="'administrativeGenderCode'"/>
2053 </xsl:call-template>
2054 </xsl:if>
2055
2056 <xsl:if test="$CCRActorPerson/a:DateOfBirth">
2057 <birthTime>
2058 <xsl:attribute name="value">
2059 <xsl:call-template name="date:format-date">
2060 <xsl:with-param name="date-time" select="$CCRActorPerson/a:DateOfBirth/a:ExactDateTime"/>
2061 <xsl:with-param name="pattern">yyyyMMddhhmmss</xsl:with-param>
2062 </xsl:call-template>
2063 </xsl:attribute>
2064 </birthTime>
2065 </xsl:if>
2066
2067 <xsl:if test="/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Marital Status']">
2068 <xsl:call-template name="ccdCodedValue">
2069 <xsl:with-param name="ccrCodedDescription" select="/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Marital Status']/a:Description"/>
2070 <xsl:with-param name="domain" select="'MaritalStatus'"/>
2071 <xsl:with-param name="nodeName" select="'maritalStatusCode'"/>
2072 </xsl:call-template>
2073 </xsl:if>
2074
2075 <xsl:if test="/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Language']">
2076 <languageCommunication>
2077 <templateId root="2.16.840.1.113883.3.88.11.83.2" assigningAuthorityName="HITSP/C83"/>
2078 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.2.1" assigningAuthorityName="IHE/PCC"/>
2079 <xsl:call-template name="ccdCodedValue">
2080 <xsl:with-param name="ccrCodedDescription" select="/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Language']/a:Description"></xsl:with-param>
2081 <xsl:with-param name="domain" select="'HumanLanguage'"/>
2082 <xsl:with-param name="nodeName" select="'languageCode'"/>
2083 </xsl:call-template>
2084 </languageCommunication>
2085 </xsl:if>
2086 </patient>
2087 </xsl:template>
2088
2089 <xsl:template name="ccdPerformer">
2090 <xsl:param name="ccrActorReference"/>
2091 <performer typeCode="PRF">
2092 <xsl:if test="$ccrActorReference/a:ActorRole">
2093 <xsl:call-template name="ccdCodedValue">
2094 <xsl:with-param name="ccrCodedDescription" select="$ccrActorReference/a:ActorRole"/>
2095 <xsl:with-param name="nodeName" select="'functionCode'"/>
2096 </xsl:call-template>
2097 </xsl:if>
2098 <xsl:call-template name="ccdAssignedEntity">
2099 <xsl:with-param name="ccrActorObjectID" select="$ccrActorReference/a:ActorID"/>
2100 </xsl:call-template>
2101 </performer>
2102 </xsl:template>
2103
2104 <xsl:template name="ccdPerson">
2105 <xsl:param name="CCRActorPerson"/>
2106 <xsl:param name="personNodeName">assignedPerson</xsl:param>
2107 <xsl:element name="{$personNodeName}">
2108 <xsl:call-template name="ccdPersonName">
2109 <xsl:with-param name="CCRActorName" select="$CCRActorPerson/a:Name"/>
2110 </xsl:call-template>
2111 </xsl:element>
2112 </xsl:template>
2113
2114 <xsl:template name="ccdPersonName">
2115 <xsl:param name="CCRActorName"/>
2116 <name>
2117 <xsl:if test="$CCRActorName/a:CurrentName/a:Title">
2118 <prefix>
2119 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Title"/>
2120 </prefix>
2121 </xsl:if>
2122 <xsl:if test="$CCRActorName/a:CurrentName/a:Given">
2123 <given>
2124 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Given"/>
2125 </given>
2126 </xsl:if>
2127 <xsl:if test="$CCRActorName/a:CurrentName/a:Middle">
2128 <given>
2129 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Middle"/>
2130 </given>
2131 </xsl:if>
2132 <xsl:if test="$CCRActorName/a:CurrentName/a:Family">
2133 <family>
2134 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Family"/>
2135 </family>
2136 </xsl:if>
2137 <xsl:if test="$CCRActorName/a:CurrentName/a:Suffix">
2138 <suffix>
2139 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Suffix"/>
2140 </suffix>
2141 </xsl:if>
2142 </name>
2143 </xsl:template>
2144
2145 <xsl:template name="ccdOrganization">
2146 <xsl:param name="ccrActorObjectID"/>
2147 <xsl:param name="organizationNodeName"/>
2148
2149 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2150
2151 <xsl:element name="{$organizationNodeName}">
2152 <xsl:call-template name="ccdEntityID">
2153 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2154 </xsl:call-template>
2155 <xsl:call-template name="ccdTelecom">
2156 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2157 </xsl:call-template>
2158
2159 <xsl:call-template name="ccdAddress">
2160 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address[1]"/>
2161 </xsl:call-template>
2162 </xsl:element>
2163 </xsl:template>
2164
2165 <xsl:template name="ccdPatientRole">
2166 <xsl:param name="ccrActorObjectID"/>
2167
2168 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2169
2170 <xsl:call-template name="ccdEntityID">
2171 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2172 </xsl:call-template>
2173
2174 <xsl:call-template name="ccdAddress">
2175 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address[1]"/>
2176 </xsl:call-template>
2177
2178 <xsl:call-template name="ccdTelecom">
2179 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2180 </xsl:call-template>
2181
2182 <xsl:call-template name="ccdPatient">
2183 <xsl:with-param name="CCRActorPerson" select="$CCRActor/a:Person"/>
2184 </xsl:call-template>
2185 </xsl:template>
2186
2187 <xsl:template name="ccdAssignedAuthor">
2188 <xsl:param name="ccrActorObjectID"/>
2189 <assignedAuthor>
2190 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2191
2192 <xsl:call-template name="ccdEntityID">
2193 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2194 </xsl:call-template>
2195
2196 <xsl:call-template name="ccdAddress">
2197 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address[1]"/>
2198 </xsl:call-template>
2199
2200 <xsl:call-template name="ccdTelecom">
2201 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2202 </xsl:call-template>
2203
2204 <xsl:call-template name="ccdPerson">
2205 <xsl:with-param name="CCRActorPerson" select="$CCRActor/a:Person"/>
2206 </xsl:call-template>
2207
2208 <xsl:if test="$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']">
2209 <representedOrganization>
2210 <xsl:call-template name="ccdOrganization">
2211 <xsl:with-param name="ccrActorObjectID" select="$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']/a:LinkID"/>
2212 </xsl:call-template>
2213 </representedOrganization>
2214 </xsl:if>
2215 </assignedAuthor>
2216 </xsl:template>
2217
2218 <xsl:template name="ccdParticipantRoleActor">
2219 <xsl:param name="ccrActorObjectID"/>
2220
2221 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2222
2223 <xsl:call-template name="ccdEntityID">
2224 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2225 </xsl:call-template>
2226
2227 <xsl:call-template name="ccdAddress">
2228 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address[1]"/>
2229 </xsl:call-template>
2230
2231 <xsl:call-template name="ccdTelecom">
2232 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2233 </xsl:call-template>
2234
2235 <xsl:if test="$CCRActor/a:Organization/a:Name">
2236 <playingEntity classCode="PLC">
2237 <name>
2238 <xsl:value-of select="$CCRActor/a:Organization/a:Name"/>
2239 </name>
2240 </playingEntity>
2241 </xsl:if>
2242 </xsl:template>
2243
2244 <xsl:template name="ccdParticipantRoleCodedDescription">
2245 <xsl:param name="ccrCodedDescription"/>
2246 <participantRole classCode="MANU">
2247 <!--Product Detail-->
2248 <playingEntity classCode="MMAT">
2249 <xsl:if test="$ccrCodedDescription/a:Code">
2250 <xsl:call-template name="ccdCodedValue">
2251 <xsl:with-param name="ccrCodedDescription" select="$ccrCodedDescription"/>
2252 <xsl:with-param name="nodeName" select="'code'"/>
2253 </xsl:call-template>
2254 </xsl:if>
2255 <name>
2256 <xsl:value-of select="$ccrCodedDescription/a:Text"/>
2257 </name>
2258 </playingEntity>
2259 </participantRole>
2260 </xsl:template>
2261
2262 <xsl:template name="ccdEntityID">
2263 <xsl:param name="CCRActor"/>
2264 <id>
2265 <xsl:choose>
2266 <xsl:when test="$CCRActor/a:IDs">
2267 <xsl:attribute name="extension">
2268 <xsl:value-of select="$CCRActor/a:IDs[1]/a:ID"/>
2269 </xsl:attribute>
2270 <xsl:attribute name="root">
2271 <xsl:value-of select="$CCRActor/a:IDs[1]/a:Type/a:Text"/>
2272 </xsl:attribute>
2273 </xsl:when>
2274 <xsl:otherwise>
2275 <xsl:attribute name="extension">
2276 <xsl:value-of select="$CCRActor/a:ActorObjectID"/>
2277 </xsl:attribute>
2278 <xsl:attribute name="root">
2279 <xsl:text>CCRActorID</xsl:text>
2280 </xsl:attribute>
2281 </xsl:otherwise>
2282 </xsl:choose>
2283 </id>
2284 <xsl:if test="$CCRActor/a:Organization">
2285 <name><xsl:value-of select="$CCRActor/a:Organization/a:Name"></xsl:value-of></name>
2286 </xsl:if>
2287 </xsl:template>
2288 <xsl:template name="ccdAddress">
2289 <xsl:param name="CCRActorAddress"/>
2290 <addr>
2291 <xsl:choose>
2292 <xsl:when test="$CCRActorAddress">
2293 <xsl:attribute name="use">
2294 <xsl:call-template name="CDAVocabularyLookup">
2295 <xsl:with-param name="domain" select="'telecommunicationsAddressUse'"/>
2296 <xsl:with-param name="ccrtext" select="$CCRActorAddress/a:Type/a:Text"/>
2297 </xsl:call-template>
2298 </xsl:attribute>
2299 <streetAddressLine>
2300 <xsl:value-of select="$CCRActorAddress/a:Line1"/>
2301 </streetAddressLine>
2302 <city>
2303 <xsl:value-of select="$CCRActorAddress/a:City"/>
2304 </city>
2305 <state>
2306 <xsl:value-of select="$CCRActorAddress/a:State"/>
2307 </state>
2308 <postalCode>
2309 <xsl:value-of select="$CCRActorAddress/a:PostalCode"/>
2310 </postalCode>
2311 </xsl:when>
2312 <xsl:otherwise>
2313 <streetAddressLine/>
2314 </xsl:otherwise>
2315 </xsl:choose>
2316 </addr>
2317 </xsl:template>
2318
2319 <xsl:template name="ccdTelecom">
2320 <xsl:param name="CCRActor"/>
2321 <telecom>
2322 <xsl:if test="$CCRActor/a:Telephone">
2323 <xsl:attribute name="use">
2324 <xsl:call-template name="CDAVocabularyLookup">
2325 <xsl:with-param name="domain" select="'telecommunicationsAddressUse'"/>
2326 <xsl:with-param name="ccrtext" select="$CCRActor/a:Telephone/a:Type/a:Text"/>
2327 </xsl:call-template>
2328 </xsl:attribute>
2329 <xsl:attribute name="value">
2330 <xsl:text>tel:+1-</xsl:text>
2331 <xsl:value-of select="$CCRActor/a:Telephone[1]/a:Value"/>
2332 </xsl:attribute>
2333 </xsl:if>
2334 </telecom>
2335
2336 <xsl:if test="$CCRActor/a:Email">
2337 <telecom>
2338 <xsl:choose>
2339 <xsl:when test="$CCRActor/a:Telephone">
2340 <xsl:attribute name="use">
2341 <xsl:call-template name="CDAVocabularyLookup">
2342 <xsl:with-param name="domain" select="'telecommunicationsAddressUse'"/>
2343 <xsl:with-param name="ccrtext" select="$CCRActor/a:Telephone/a:Type/a:Text"/>
2344 </xsl:call-template>
2345 </xsl:attribute>
2346 <xsl:attribute name="value">
2347 <xsl:text>mailto:</xsl:text>
2348 <xsl:value-of select="$CCRActor/a:Email[1]/a:Value"/>
2349 </xsl:attribute>
2350 </xsl:when>
2351 <xsl:otherwise>
2352 <xsl:attribute name="value">
2353 <xsl:text>Unknown</xsl:text>
2354 </xsl:attribute>
2355 </xsl:otherwise>
2356 </xsl:choose>
2357 </telecom>
2358 </xsl:if>
2359 </xsl:template>
2360
2361 <xsl:template name="ccdID">
2362 <xsl:param name="ccrObjectID"/>
2363 <xsl:param name="suffix"/>
2364 <id>
2365 <xsl:attribute name="root">
2366 <xsl:value-of select="$ccrObjectID"></xsl:value-of>
2367 </xsl:attribute>
2368 <xsl:attribute name="extension">CCRObjectID</xsl:attribute>
2369 </id>
2370 </xsl:template>
2371
2372 <xsl:template name="ccdCodedValue">
2373 <xsl:param name="ccrCodedDescription"/>
2374 <xsl:param name="type"/>
2375 <xsl:param name="domain"/>
2376 <xsl:param name="nodeName">value</xsl:param>
2377 <xsl:param name="originalTextReference"/>
2378
2379 <xsl:element name="{$nodeName}">
2380 <xsl:if test="$type">
2381 <xsl:attribute name="xsi:type">
2382 <xsl:value-of select="$type"/>
2383 </xsl:attribute>
2384 </xsl:if>
2385 <xsl:choose>
2386 <xsl:when test="$ccrCodedDescription/a:Code">
2387 <xsl:attribute name="displayName">
2388 <xsl:value-of select="$ccrCodedDescription/a:Text"/>
2389 </xsl:attribute>
2390 <xsl:attribute name="code">
2391 <xsl:value-of select="$ccrCodedDescription/a:Code/a:Value"/>
2392 </xsl:attribute>
2393 <xsl:attribute name="codeSystemName">
2394 <xsl:value-of select="$ccrCodedDescription/a:Code/a:CodingSystem"/>
2395 </xsl:attribute>
2396 <xsl:attribute name="codeSystem">
2397 <xsl:call-template name="HL7OIDLookup">
2398 <xsl:with-param name="name" select="$ccrCodedDescription/a:Code/a:CodingSystem"/>
2399 </xsl:call-template>
2400 </xsl:attribute>
2401 </xsl:when>
2402 <xsl:when test="$domain">
2403 <xsl:variable name="cdaCode">
2404 <xsl:call-template name="CDAVocabularyLookup">
2405 <xsl:with-param name="domain" select="$domain"/>
2406 <xsl:with-param name="ccrtext" select="$ccrCodedDescription/a:Text"/>
2407 </xsl:call-template>
2408 </xsl:variable>
2409 <xsl:attribute name="displayName">
2410 <xsl:call-template name="CDADisplayNameLookup">
2411 <xsl:with-param name="domain" select="$domain"/>
2412 <xsl:with-param name="cdacode" select="$cdaCode"/>
2413 </xsl:call-template>
2414 </xsl:attribute>
2415 <xsl:attribute name="code">
2416 <xsl:value-of select="$cdaCode"></xsl:value-of>
2417 </xsl:attribute>
2418 <xsl:attribute name="codeSystemName">
2419 <xsl:call-template name="CDAVocabularyCodeSystemNameLookup">
2420 <xsl:with-param name="domain" select="$domain"/>
2421 </xsl:call-template>
2422 </xsl:attribute>
2423 <xsl:attribute name="codeSystemName">
2424 <xsl:call-template name="CDAVocabularyCodeSystemLookup">
2425 <xsl:with-param name="domain" select="$domain"/>
2426 </xsl:call-template>
2427 </xsl:attribute>
2428 </xsl:when>
2429 <xsl:otherwise>
2430 <originalText>
2431 <xsl:value-of select="$ccrCodedDescription/a:Text"/>
2432 <xsl:if test="$originalTextReference">
2433 <reference>
2434 <xsl:attribute name="value">
2435 <xsl:value-of select="$originalTextReference"/>
2436 </xsl:attribute>
2437 </reference>
2438 </xsl:if>
2439 </originalText>
2440 </xsl:otherwise>
2441 </xsl:choose>
2442 </xsl:element>
2443 </xsl:template>
2444
2445 <xsl:template name="ccdDateTime">
2446 <xsl:param name="dt"/>
2447 <xsl:param name="type"/>
2448 <xsl:if test="$dt">
2449 <xsl:if test="$dt[1]/a:ExactDateTime">
2450 <effectiveTime>
2451 <xsl:if test="$type">
2452 <xsl:attribute name="xsi:type">
2453 <xsl:value-of select="$type"></xsl:value-of>
2454 </xsl:attribute>
2455 </xsl:if>
2456 <low>
2457 <xsl:attribute name="value">
2458 <xsl:call-template name="date:format-date">
2459 <xsl:with-param name="date-time" select="$dt[1]/a:ExactDateTime"/>
2460 <xsl:with-param name="pattern">yyyyMMdd</xsl:with-param>
2461 </xsl:call-template>
2462 </xsl:attribute>
2463 </low>
2464 <high nullFlavor="UNK"/>
2465 </effectiveTime>
2466 </xsl:if>
2467 <xsl:if test="$dt[1]/a:DateTimeRange">
2468 <effectiveTime>
2469 <low>
2470 <xsl:attribute name="value">
2471 <xsl:call-template name="date:format-date">
2472 <xsl:with-param name="date-time" select="$dt[1]/a:DateTimeRange/a:BeginRange/a:ExactDateTime"/>
2473 <xsl:with-param name="pattern">yyyyMMdd</xsl:with-param>
2474 </xsl:call-template>
2475 </xsl:attribute>
2476 </low>
2477 <high>
2478 <xsl:attribute name="value">
2479 <xsl:call-template name="date:format-date">
2480 <xsl:with-param name="date-time" select="$dt[1]/a:DateTimeRange/a:EndRange/a:ExactDateTime"/>
2481 <xsl:with-param name="pattern">yyyyMMdd</xsl:with-param>
2482 </xsl:call-template>
2483 </xsl:attribute>
2484 </high>
2485 </effectiveTime>
2486 </xsl:if>
2487 </xsl:if>
2488 </xsl:template>
2489
2490 <xsl:template name="ccdMedicationFrequency">
2491 <xsl:param name="frequency"/>
2492 <xsl:if test="$frequency">
2493 <xsl:choose>
2494 <xsl:when test="$frequency/a:Value='qd'">
2495 <effectiveTime xsi:type="PIVL_TS" operator="A">
2496 <xsl:attribute name="institutionSpecified">true</xsl:attribute>
2497 <period>
2498 <xsl:attribute name="value">24</xsl:attribute>
2499 <xsl:attribute name="unit">h</xsl:attribute>
2500 </period>
2501 </effectiveTime>
2502 </xsl:when>
2503 <xsl:when test="$frequency/a:Value='bid'">
2504 <effectiveTime xsi:type="PIVL_TS" operator="A">
2505 <xsl:attribute name="institutionSpecified">true</xsl:attribute>
2506 <period>
2507 <xsl:attribute name="value">12</xsl:attribute>
2508 <xsl:attribute name="unit">h</xsl:attribute>
2509 </period>
2510 </effectiveTime>
2511 </xsl:when>
2512 <xsl:when test="$frequency/a:Value='tid'">
2513 <effectiveTime xsi:type="PIVL_TS" operator="A">
2514 <xsl:attribute name="institutionSpecified">true</xsl:attribute>
2515 <period>
2516 <xsl:attribute name="value">8</xsl:attribute>
2517 <xsl:attribute name="unit">h</xsl:attribute>
2518 </period>
2519 </effectiveTime>
2520 </xsl:when>
2521 <xsl:when test="$frequency/a:Value='qid'">
2522 <effectiveTime xsi:type="PIVL_TS" operator="A">
2523 <xsl:attribute name="institutionSpecified">true</xsl:attribute>
2524 <period>
2525 <xsl:attribute name="value">6</xsl:attribute>
2526 <xsl:attribute name="unit">h</xsl:attribute>
2527 </period>
2528 </effectiveTime>
2529 </xsl:when>
2530 <xsl:when test="$frequency/a:Value='qam'">
2531 <effectiveTime xsi:type='EIVL' operator='A'>
2532 <event code='ACM'/>
2533 </effectiveTime>
2534 </xsl:when>
2535 <xsl:when test="$frequency/a:Value='qpm'">
2536 <effectiveTime xsi:type='EIVL' operator='A'>
2537 <event code='PCV'/>
2538 </effectiveTime>
2539 </xsl:when>
2540 </xsl:choose>
2541 </xsl:if>
2542 </xsl:template>
2543
2544 <xsl:template name="ccdStatus">
2545 <xsl:param name="ccrStatus"/>
2546
2547 <entryRelationship typeCode="REFR">
2548 <observation classCode="OBS" moodCode="EVN">
2549 <templateId root="2.16.840.1.113883.10.20.1.50"/>
2550 <!-- Problem status observation template -->
2551 <code code="33999-4" codeSystem="2.16.840.1.113883.6.1" displayName="Status"/>
2552 <statusCode code="completed"/>
2553 <xsl:call-template name="ccdCodedValue">
2554 <xsl:with-param name="ccrCodedDescription" select="$ccrStatus"/>
2555 </xsl:call-template>
2556 </observation>
2557 </entryRelationship>
2558 </xsl:template>
2559
2560 <xsl:template name="ccdStatusObservation">
2561 <xsl:param name="status"/>
2562 <xsl:variable name="statusText" select="$status/a:Text"></xsl:variable>
2563 <xsl:choose>
2564 <xsl:when test="$statusText='Active'">
2565 <xsl:call-template name="ccdStatusElement">
2566 <xsl:with-param name="statusCode" select="'55561003'"/>
2567 <xsl:with-param name="statusDisplayName" select="$statusText"/>
2568 </xsl:call-template>
2569 </xsl:when>
2570 <xsl:when test="$statusText='Inactive'">
2571 <xsl:call-template name="ccdStatusElement">
2572 <xsl:with-param name="statusCode" select="'73425007'"/>
2573 <xsl:with-param name="statusDisplayName" select="$statusText"/>
2574 </xsl:call-template>
2575 </xsl:when>
2576 <xsl:when test="$statusText='Chronic'">
2577 <xsl:call-template name="ccdStatusElement">
2578 <xsl:with-param name="statusCode" select="'90734009'"/>
2579 <xsl:with-param name="statusDisplayName" select="$statusText"/>
2580 </xsl:call-template>
2581 </xsl:when>
2582 </xsl:choose>
2583 </xsl:template>
2584
2585 <xsl:template name="ccdStatusProcedure">
2586 <xsl:param name="status"/>
2587 <xsl:variable name="statusText" select="$status/a:Text"></xsl:variable>
2588 <xsl:choose>
2589 <xsl:when test="$statusText='Completed'">
2590 <statusCode code="completed"/>
2591 </xsl:when>
2592 <xsl:when test="$statusText='Active'">
2593 <statusCode code="active"/>
2594 </xsl:when>
2595 <xsl:when test="$statusText='Aborted'">
2596 <statusCode code="aborted"/>
2597 </xsl:when>
2598 <xsl:when test="$statusText='Cancelled' or $statusText='Canceled'">
2599 <statusCode code="cancelled"/>
2600 </xsl:when>
2601 <xsl:otherwise>
2602 <statusCode>
2603 <xsl:attribute name="code">
2604 <xsl:value-of select="$statusText"></xsl:value-of>
2605 </xsl:attribute>
2606 </statusCode>
2607 </xsl:otherwise>
2608 </xsl:choose>
2609 </xsl:template>
2610
2611 <xsl:template name="ccdStatusElement">
2612 <xsl:param name="statusCode"/>
2613 <xsl:param name="statusDisplayName"/>
2614 <value>
2615 <xsl:attribute name="xsi:type">CE</xsl:attribute>
2616 <xsl:attribute name="code">
2617 <xsl:value-of select="$statusCode"></xsl:value-of>
2618 </xsl:attribute>
2619 <xsl:attribute name="codeSystem">2.16.840.1.113883.6.96</xsl:attribute>
2620 <xsl:attribute name="displayName">
2621 <xsl:value-of select="$statusDisplayName"></xsl:value-of>
2622 </xsl:attribute>
2623 </value>
2624 </xsl:template>
2625
2626 <xsl:template name="ccdObservation">
2627 <xsl:param name="ccrTestNode"/>
2628 <xsl:param name="testDate"/>
2629
2630 <component>
2631 <observation classCode="OBS" moodCode="EVN">
2632 <templateId root="2.16.840.1.113883.3.88.11.83.15" assigningAuthorityName="HITSP C83"/>
2633 <templateId root="2.16.840.1.113883.10.20.1.31" assigningAuthorityName="CCD"/>
2634 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13" assigningAuthorityName="IHE PCC"/>
2635
2636 <!-- Result observation template -->
2637
2638 <xsl:call-template name="ccdID">
2639 <xsl:with-param name="ccrObjectID" select="$ccrTestNode/a:CCRDataObjectID"/>
2640 </xsl:call-template>
2641
2642 <!-- <code> -->
2643 <xsl:call-template name="ccdCodedValue">
2644 <xsl:with-param name="ccrCodedDescription" select="$ccrTestNode/a:Description"/>
2645 <xsl:with-param name="nodeName" select="'code'"/>
2646 </xsl:call-template>
2647
2648 <text>
2649 <reference>
2650 <xsl:attribute name="value">
2651 <xsl:text>#</xsl:text>
2652 <xsl:value-of select="$ccrTestNode/a:CCRDataObjectID"/>
2653 </xsl:attribute>
2654 </reference>
2655 </text>
2656
2657 <statusCode code="completed"/>
2658
2659 <!-- <effectiveTime> -->
2660 <xsl:choose>
2661 <xsl:when test="$ccrTestNode/a:DateTime">
2662 <xsl:call-template name="ccdDateTime">
2663 <xsl:with-param name="dt" select="$ccrTestNode/a:DateTime"/>
2664 </xsl:call-template>
2665 </xsl:when>
2666 <xsl:otherwise>
2667 <xsl:call-template name="ccdDateTime">
2668 <xsl:with-param name="dt" select="$testDate"/>
2669 </xsl:call-template>
2670 </xsl:otherwise>
2671 </xsl:choose>
2672
2673 <xsl:choose>
2674 <xsl:when test="$ccrTestNode/a:TestResult[a:Value!='']">
2675 <value xsi:type="PQ">
2676 <xsl:attribute name="value">
2677 <xsl:value-of select="$ccrTestNode/a:TestResult/a:Value"/>
2678 </xsl:attribute>
2679 <xsl:attribute name="unit">
2680 <xsl:value-of select="$ccrTestNode/a:TestResult/a:Units/a:Unit"/>
2681 </xsl:attribute>
2682 </value>
2683 </xsl:when>
2684 <xsl:when test="$ccrTestNode/a:TestResult[a:Description/a:Text!='']">
2685 <value xsi:type="TX">
2686 <xsl:attribute name="value">
2687 <xsl:value-of select="$ccrTestNode/a:TestResult/a:Description/a:Text"/>
2688 </xsl:attribute>
2689 </value>
2690 </xsl:when>
2691 </xsl:choose>
2692
2693 <xsl:if test="$ccrTestNode/a:Flag">
2694 <xsl:call-template name="ccdCodedValue">
2695 <xsl:with-param name="ccrCodedDescription" select="$ccrTestNode/a:Flag"/>
2696 <xsl:with-param name="nodeName" select="'interpretationCode'"/>
2697 <xsl:with-param name="domain" select="'ObservationInterpretation'"/>
2698 </xsl:call-template>
2699 </xsl:if>
2700
2701 <xsl:if test="$ccrTestNode/a:NormalResult">
2702 <referenceRange>
2703 <xsl:if test="$ccrTestNode/a:NormalResult/a:Normal/a:Description/a:Text">
2704 <observationRange>
2705 <text>
2706 <xsl:value-of select="$ccrTestNode/a:NormalResult/a:Normal/a:Description/a:Text"/>
2707 </text>
2708 </observationRange>
2709 </xsl:if>
2710 </referenceRange>
2711 </xsl:if>
2712
2713 </observation>
2714 </component>
2715
2716 </xsl:template>
2717</xsl:stylesheet>
2718 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Procedures">
2719 <component>
2720 <section>
2721 <templateId root="2.16.840.1.113883.10.20.1.12"/>
2722 <code code="47519-4" codeSystem="2.16.840.1.113883.6.1"/>
2723 <title>Procedures</title>
2724 <text>
2725 <table>
2726 <tbody>
2727 <tr>
2728 <th>Type</th>
2729 <th>Date</th>
2730 <th>Code</th>
2731 <th>Description</th>
2732 <th>Location</th>
2733 <th>Substance</th>
2734 <th>Method</th>
2735 <th>Position</th>
2736 <th>Site</th>
2737 <th>Status</th>
2738 <th>Source</th>
2739 </tr>
2740 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
2741 <tr>
2742 <xsl:attribute name="id">
2743 <xsl:value-of select="a:CCRDataObjectID"/>
2744 </xsl:attribute>
2745
2746 <td>
2747 <xsl:value-of select="a:Type/a:Text"/>
2748 </td>
2749 <table>
2750 <tbody>
2751 <xsl:apply-templates select="a:DateTime"/>
2752 </tbody>
2753 </table>
2754 <td>
2755 <xsl:apply-templates select="a:Description/a:Code"/>
2756 </td>
2757 <td>
2758 <xsl:value-of select="a:Description/a:Text"/>
2759 </td>
2760 <td>
2761 <xsl:for-each select="a:Locations/a:Location">
2762 <xsl:value-of select="a:Description/a:Text"/>
2763 <xsl:if test="a:Actor">
2764 (<xsl:call-template name="actorName">
2765 <xsl:with-param name="objID" select="a:Actor/a:ActorID"/>
2766 </xsl:call-template>
2767 <xsl:if test="a:Actor/a:ActorRole/a:Text">
2768 <xsl:text xml:space="preserve"> - </xsl:text><xsl:value-of select="a:ActorRole/a:Text"/>)
2769 </xsl:if>
2770 </xsl:if>)
2771 <xsl:if test="position() != last()">
2772 <br/>
2773 </xsl:if>
2774 </xsl:for-each>
2775 </td>
2776 <td>
2777 <xsl:for-each select="a:Substance">
2778 <xsl:value-of select="a:Text"/>
2779 </xsl:for-each>
2780 </td>
2781 <td>
2782 <xsl:value-of select="a:Method/a:Text"/>
2783 </td>
2784 <td>
2785 <xsl:value-of select="a:Position/a:Text"/>
2786 </td>
2787 <td>
2788 <xsl:value-of select="a:Site/a:Text"/>
2789 </td>
2790 <td>
2791 <xsl:value-of select="a:Status/a:Text"/>
2792 </td>
2793 <td>
2794 <xsl:call-template name="actorName">
2795 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
2796 </xsl:call-template>
2797 </td>
2798 </tr>
2799 </xsl:for-each>
2800 </tbody>
2801 </table>
2802 </text>
2803
2804 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
2805 <entry typeCode="DRIV">
2806 <procedure classCode="PROC" moodCode="EVN">
2807 <templateId root="2.16.840.1.113883.3.88.11.83.17" assigningAuthorityName="HITSP C83"/>
2808 <templateId root="2.16.840.1.113883.10.20.1.29" assigningAuthorityName="CCD"/>
2809 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.19" assigningAuthorityName="IHE PCC"/>
2810
2811 <!-- <id> -->
2812 <xsl:call-template name="ccdID">
2813 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
2814 </xsl:call-template>
2815
2816 <!-- <code> -->
2817 <xsl:call-template name="ccdCodedValue">
2818 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
2819 <xsl:with-param name="nodeName" select="'code'"/>
2820 </xsl:call-template>
2821
2822 <text>
2823 <reference>
2824 <xsl:attribute name="value">
2825 <xsl:text>#</xsl:text>
2826 <xsl:value-of select="a:CCRDataObjectID"/>
2827 </xsl:attribute>
2828 </reference>
2829 </text>
2830
2831 <xsl:call-template name="ccdStatusProcedure">
2832 <xsl:with-param name="status" select="a:Status"/>
2833 </xsl:call-template>
2834
2835 <xsl:call-template name="ccdDateTime">
2836 <xsl:with-param name="dt" select="a:DateTime"/>
2837 </xsl:call-template>
2838
2839 <xsl:if test="a:Method">
2840 <xsl:call-template name="ccdCodedValue">
2841 <xsl:with-param name="ccrCodedDescription" select="a:Method"/>
2842 <xsl:with-param name="nodeName" select="'approachSiteCode'"/>
2843 </xsl:call-template>
2844 </xsl:if>
2845
2846 <xsl:if test="a:Site">
2847 <xsl:call-template name="ccdCodedValue">
2848 <xsl:with-param name="ccrCodedDescription" select="a:Site"/>
2849 <xsl:with-param name="nodeName" select="'targetSiteCode'"/>
2850 </xsl:call-template>
2851 </xsl:if>
2852
2853 <xsl:if test="a:Practitioners/a:Practitioner">
2854 <xsl:call-template name="ccdPerformer">
2855 <xsl:with-param name="ccrActorReference" select="a:Practitioners/a:Practitioner[1]"/>
2856 </xsl:call-template>
2857 </xsl:if>
2858 </procedure>
2859 </entry>
2860 </xsl:for-each>
2861 </section>
2862 </component>
2863 </xsl:if>
2864 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Procedures">
2865 <component>
2866 <section>
2867 <templateId root="2.16.840.1.113883.10.20.1.12"/>
2868 <code code="47519-4" codeSystem="2.16.840.1.113883.6.1"/>
2869 <title>Procedures</title>
2870 <text>
2871 <table>
2872 <tbody>
2873 <tr>
2874 <th>Type</th>
2875 <th>Date</th>
2876 <th>Code</th>
2877 <th>Description</th>
2878 <th>Location</th>
2879 <th>Substance</th>
2880 <th>Method</th>
2881 <th>Position</th>
2882 <th>Site</th>
2883 <th>Status</th>
2884 <th>Source</th>
2885 </tr>
2886 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
2887 <tr>
2888 <xsl:attribute name="id">
2889 <xsl:value-of select="a:CCRDataObjectID"/>
2890 </xsl:attribute>
2891
2892 <td>
2893 <xsl:value-of select="a:Type/a:Text"/>
2894 </td>
2895 <table>
2896 <tbody>
2897 <xsl:apply-templates select="a:DateTime"/>
2898 </tbody>
2899 </table>
2900 <td>
2901 <xsl:apply-templates select="a:Description/a:Code"/>
2902 </td>
2903 <td>
2904 <xsl:value-of select="a:Description/a:Text"/>
2905 </td>
2906 <td>
2907 <xsl:for-each select="a:Locations/a:Location">
2908 <xsl:value-of select="a:Description/a:Text"/>
2909 <xsl:if test="a:Actor">
2910 (<xsl:call-template name="actorName">
2911 <xsl:with-param name="objID" select="a:Actor/a:ActorID"/>
2912 </xsl:call-template>
2913 <xsl:if test="a:Actor/a:ActorRole/a:Text">
2914 <xsl:text xml:space="preserve"> - </xsl:text><xsl:value-of select="a:ActorRole/a:Text"/>)
2915 </xsl:if>
2916 </xsl:if>)
2917 <xsl:if test="position() != last()">
2918 <br/>
2919 </xsl:if>
2920 </xsl:for-each>
2921 </td>
2922 <td>
2923 <xsl:for-each select="a:Substance">
2924 <xsl:value-of select="a:Text"/>
2925 </xsl:for-each>
2926 </td>
2927 <td>
2928 <xsl:value-of select="a:Method/a:Text"/>
2929 </td>
2930 <td>
2931 <xsl:value-of select="a:Position/a:Text"/>
2932 </td>
2933 <td>
2934 <xsl:value-of select="a:Site/a:Text"/>
2935 </td>
2936 <td>
2937 <xsl:value-of select="a:Status/a:Text"/>
2938 </td>
2939 <td>
2940 <xsl:call-template name="actorName">
2941 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
2942 </xsl:call-template>
2943 </td>
2944 </tr>
2945 </xsl:for-each>
2946 </tbody>
2947 </table>
2948 </text>
2949
2950 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
2951 <entry typeCode="DRIV">
2952 <procedure classCode="PROC" moodCode="EVN">
2953 <templateId root="2.16.840.1.113883.3.88.11.83.17" assigningAuthorityName="HITSP C83"/>
2954 <templateId root="2.16.840.1.113883.10.20.1.29" assigningAuthorityName="CCD"/>
2955 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.19" assigningAuthorityName="IHE PCC"/>
2956
2957 <!-- <id> -->
2958 <xsl:call-template name="ccdID">
2959 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
2960 </xsl:call-template>
2961
2962 <!-- <code> -->
2963 <xsl:call-template name="ccdCodedValue">
2964 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
2965 <xsl:with-param name="nodeName" select="'code'"/>
2966 </xsl:call-template>
2967
2968 <text>
2969 <reference>
2970 <xsl:attribute name="value">
2971 <xsl:text>#</xsl:text>
2972 <xsl:value-of select="a:CCRDataObjectID"/>
2973 </xsl:attribute>
2974 </reference>
2975 </text>
2976
2977 <xsl:call-template name="ccdStatusProcedure">
2978 <xsl:with-param name="status" select="a:Status"/>
2979 </xsl:call-template>
2980
2981 <xsl:call-template name="ccdDateTime">
2982 <xsl:with-param name="dt" select="a:DateTime"/>
2983 </xsl:call-template>
2984
2985 <xsl:if test="a:Method">
2986 <xsl:call-template name="ccdCodedValue">
2987 <xsl:with-param name="ccrCodedDescription" select="a:Method"/>
2988 <xsl:with-param name="nodeName" select="'approachSiteCode'"/>
2989 </xsl:call-template>
2990 </xsl:if>
2991
2992 <xsl:if test="a:Site">
2993 <xsl:call-template name="ccdCodedValue">
2994 <xsl:with-param name="ccrCodedDescription" select="a:Site"/>
2995 <xsl:with-param name="nodeName" select="'targetSiteCode'"/>
2996 </xsl:call-template>
2997 </xsl:if>
2998
2999 <xsl:if test="a:Practitioners/a:Practitioner">
3000 <xsl:call-template name="ccdPerformer">
3001 <xsl:with-param name="ccrActorReference" select="a:Practitioners/a:Practitioner[1]"/>
3002 </xsl:call-template>
3003 </xsl:if>
3004 </procedure>
3005 </entry>
3006 </xsl:for-each>
3007 </section>
3008 </component>
3009 </xsl:if>
3010 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Problems">
3011 <component>
3012 <section>
3013 <templateId root="2.16.840.1.113883.3.88.11.83.103" assigningAuthorityName="HITSP/C83"/>
3014 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.6" assigningAuthorityName="IHE PCC"/>
3015 <templateId root="2.16.840.1.113883.10.20.1.11" assigningAuthorityName="HL7 CCD"/>
3016 <code code="11450-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Problem list"/>
3017 <title>Problems</title>
3018 <text>
3019 <table>
3020 <tbody>
3021 <tr>
3022 <th>Type</th>
3023 <th>Date</th>
3024 <th>Code</th>
3025 <th>Description</th>
3026 <th>Status</th>
3027 <th>Source</th>
3028 </tr>
3029 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Problems/a:Problem">
3030 <tr>
3031 <td>
3032 <xsl:value-of select="a:Type/a:Text"/>
3033 </td>
3034 <td>
3035 <table>
3036 <tbody>
3037 <xsl:apply-templates select="a:DateTime"/>
3038 </tbody>
3039 </table>
3040 </td>
3041 <td>
3042 <xsl:apply-templates select="a:Description/a:Code"/>
3043 </td>
3044 <td>
3045 <xsl:attribute name="ID">
3046 <xsl:value-of select="a:CCRDataObjectID"></xsl:value-of>
3047 </xsl:attribute>
3048 <xsl:value-of select="a:Description/a:Text"/>
3049 </td>
3050 <td>
3051 <xsl:value-of select="a:Status/a:Text"/>
3052 </td>
3053 <td>
3054 <xsl:call-template name="actorName">
3055 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
3056 </xsl:call-template>
3057 </td>
3058 </tr>
3059 </xsl:for-each>
3060 </tbody>
3061 </table>
3062 </text>
3063 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Problems/a:Problem">
3064 <entry typeCode="DRIV">
3065 <act classCode="ACT" moodCode="EVN">
3066 <templateId root="2.16.840.1.113883.10.20.1.27"/>
3067 <!-- Problem act template -->
3068
3069 <!-- <id> -->
3070 <xsl:call-template name="ccdID">
3071 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
3072 </xsl:call-template>
3073
3074 <code nullFlavor="NA"/>
3075
3076 <xsl:call-template name="ccdPerformer">
3077 <xsl:with-param name="ccrActorReference" select="a:Source/a:Actor"/>
3078 </xsl:call-template>
3079
3080 <entryRelationship typeCode="SUBJ">
3081 <observation classCode="OBS" moodCode="EVN">
3082 <templateId root="2.16.840.1.113883.10.20.1.28" assigningAuthorityName="CCD"/>
3083 <!--Problem observation template-->
3084
3085 <!-- <id> -->
3086 <xsl:call-template name="ccdID">
3087 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
3088 <xsl:with-param name="suffix"></xsl:with-param>
3089 </xsl:call-template>
3090
3091 <code code="55607006" displayName="Problem" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED-CT"/>
3092
3093 <text>
3094 <reference>
3095 <xsl:attribute name="value">
3096 <xsl:text>#</xsl:text>
3097 <xsl:value-of select="a:CCRDataObjectID"/>
3098 </xsl:attribute>
3099 </reference>
3100 </text>
3101
3102 <statusCode code="completed"/>
3103
3104 <xsl:call-template name="ccdDateTime">
3105 <xsl:with-param name="dt" select="a:DateTime"/>
3106 </xsl:call-template>
3107
3108 <xsl:call-template name="ccdCodedValue">
3109 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
3110 </xsl:call-template>
3111
3112 <xsl:call-template name="ccdStatus">
3113 <xsl:with-param name="ccrStatus" select="a:Status"/>
3114 </xsl:call-template>
3115 </observation>
3116 </entryRelationship>
3117
3118 </act>
3119 </entry>
3120 </xsl:for-each>
3121 </section>
3122 </component>
3123 </xsl:if>
3124 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Procedures">
3125 <component>
3126 <section>
3127 <templateId root="2.16.840.1.113883.10.20.1.12"/>
3128 <code code="47519-4" codeSystem="2.16.840.1.113883.6.1"/>
3129 <title>Procedures</title>
3130 <text>
3131 <table>
3132 <tbody>
3133 <tr>
3134 <th>Type</th>
3135 <th>Date</th>
3136 <th>Code</th>
3137 <th>Description</th>
3138 <th>Location</th>
3139 <th>Substance</th>
3140 <th>Method</th>
3141 <th>Position</th>
3142 <th>Site</th>
3143 <th>Status</th>
3144 <th>Source</th>
3145 </tr>
3146 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
3147 <tr>
3148 <xsl:attribute name="id">
3149 <xsl:value-of select="a:CCRDataObjectID"/>
3150 </xsl:attribute>
3151
3152 <td>
3153 <xsl:value-of select="a:Type/a:Text"/>
3154 </td>
3155 <table>
3156 <tbody>
3157 <xsl:apply-templates select="a:DateTime"/>
3158 </tbody>
3159 </table>
3160 <td>
3161 <xsl:apply-templates select="a:Description/a:Code"/>
3162 </td>
3163 <td>
3164 <xsl:value-of select="a:Description/a:Text"/>
3165 </td>
3166 <td>
3167 <xsl:for-each select="a:Locations/a:Location">
3168 <xsl:value-of select="a:Description/a:Text"/>
3169 <xsl:if test="a:Actor">
3170 (<xsl:call-template name="actorName">
3171 <xsl:with-param name="objID" select="a:Actor/a:ActorID"/>
3172 </xsl:call-template>
3173 <xsl:if test="a:Actor/a:ActorRole/a:Text">
3174 <xsl:text xml:space="preserve"> - </xsl:text><xsl:value-of select="a:ActorRole/a:Text"/>)
3175 </xsl:if>
3176 </xsl:if>)
3177 <xsl:if test="position() != last()">
3178 <br/>
3179 </xsl:if>
3180 </xsl:for-each>
3181 </td>
3182 <td>
3183 <xsl:for-each select="a:Substance">
3184 <xsl:value-of select="a:Text"/>
3185 </xsl:for-each>
3186 </td>
3187 <td>
3188 <xsl:value-of select="a:Method/a:Text"/>
3189 </td>
3190 <td>
3191 <xsl:value-of select="a:Position/a:Text"/>
3192 </td>
3193 <td>
3194 <xsl:value-of select="a:Site/a:Text"/>
3195 </td>
3196 <td>
3197 <xsl:value-of select="a:Status/a:Text"/>
3198 </td>
3199 <td>
3200 <xsl:call-template name="actorName">
3201 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
3202 </xsl:call-template>
3203 </td>
3204 </tr>
3205 </xsl:for-each>
3206 </tbody>
3207 </table>
3208 </text>
3209
3210 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
3211 <entry typeCode="DRIV">
3212 <procedure classCode="PROC" moodCode="EVN">
3213 <templateId root="2.16.840.1.113883.3.88.11.83.17" assigningAuthorityName="HITSP C83"/>
3214 <templateId root="2.16.840.1.113883.10.20.1.29" assigningAuthorityName="CCD"/>
3215 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.19" assigningAuthorityName="IHE PCC"/>
3216
3217 <!-- <id> -->
3218 <xsl:call-template name="ccdID">
3219 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
3220 </xsl:call-template>
3221
3222 <!-- <code> -->
3223 <xsl:call-template name="ccdCodedValue">
3224 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
3225 <xsl:with-param name="nodeName" select="'code'"/>
3226 </xsl:call-template>
3227
3228 <text>
3229 <reference>
3230 <xsl:attribute name="value">
3231 <xsl:text>#</xsl:text>
3232 <xsl:value-of select="a:CCRDataObjectID"/>
3233 </xsl:attribute>
3234 </reference>
3235 </text>
3236
3237 <xsl:call-template name="ccdStatusProcedure">
3238 <xsl:with-param name="status" select="a:Status"/>
3239 </xsl:call-template>
3240
3241 <xsl:call-template name="ccdDateTime">
3242 <xsl:with-param name="dt" select="a:DateTime"/>
3243 </xsl:call-template>
3244
3245 <xsl:if test="a:Method">
3246 <xsl:call-template name="ccdCodedValue">
3247 <xsl:with-param name="ccrCodedDescription" select="a:Method"/>
3248 <xsl:with-param name="nodeName" select="'approachSiteCode'"/>
3249 </xsl:call-template>
3250 </xsl:if>
3251
3252 <xsl:if test="a:Site">
3253 <xsl:call-template name="ccdCodedValue">
3254 <xsl:with-param name="ccrCodedDescription" select="a:Site"/>
3255 <xsl:with-param name="nodeName" select="'targetSiteCode'"/>
3256 </xsl:call-template>
3257 </xsl:if>
3258
3259 <xsl:if test="a:Practitioners/a:Practitioner">
3260 <xsl:call-template name="ccdPerformer">
3261 <xsl:with-param name="ccrActorReference" select="a:Practitioners/a:Practitioner[1]"/>
3262 </xsl:call-template>
3263 </xsl:if>
3264 </procedure>
3265 </entry>
3266 </xsl:for-each>
3267 </section>
3268 </component>
3269 </xsl:if>
3270 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Problems">
3271 <component>
3272 <section>
3273 <templateId root="2.16.840.1.113883.3.88.11.83.103" assigningAuthorityName="HITSP/C83"/>
3274 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.6" assigningAuthorityName="IHE PCC"/>
3275 <templateId root="2.16.840.1.113883.10.20.1.11" assigningAuthorityName="HL7 CCD"/>
3276 <code code="11450-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Problem list"/>
3277 <title>Problems</title>
3278 <text>
3279 <table>
3280 <tbody>
3281 <tr>
3282 <th>Type</th>
3283 <th>Date</th>
3284 <th>Code</th>
3285 <th>Description</th>
3286 <th>Status</th>
3287 <th>Source</th>
3288 </tr>
3289 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Problems/a:Problem">
3290 <tr>
3291 <td>
3292 <xsl:value-of select="a:Type/a:Text"/>
3293 </td>
3294 <td>
3295 <table>
3296 <tbody>
3297 <xsl:apply-templates select="a:DateTime"/>
3298 </tbody>
3299 </table>
3300 </td>
3301 <td>
3302 <xsl:apply-templates select="a:Description/a:Code"/>
3303 </td>
3304 <td>
3305 <xsl:attribute name="ID">
3306 <xsl:value-of select="a:CCRDataObjectID"></xsl:value-of>
3307 </xsl:attribute>
3308 <xsl:value-of select="a:Description/a:Text"/>
3309 </td>
3310 <td>
3311 <xsl:value-of select="a:Status/a:Text"/>
3312 </td>
3313 <td>
3314 <xsl:call-template name="actorName">
3315 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
3316 </xsl:call-template>
3317 </td>
3318 </tr>
3319 </xsl:for-each>
3320 </tbody>
3321 </table>
3322 </text>
3323 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Problems/a:Problem">
3324 <entry typeCode="DRIV">
3325 <act classCode="ACT" moodCode="EVN">
3326 <templateId root="2.16.840.1.113883.10.20.1.27"/>
3327 <!-- Problem act template -->
3328
3329 <!-- <id> -->
3330 <xsl:call-template name="ccdID">
3331 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
3332 </xsl:call-template>
3333
3334 <code nullFlavor="NA"/>
3335
3336 <xsl:call-template name="ccdPerformer">
3337 <xsl:with-param name="ccrActorReference" select="a:Source/a:Actor"/>
3338 </xsl:call-template>
3339
3340 <entryRelationship typeCode="SUBJ">
3341 <observation classCode="OBS" moodCode="EVN">
3342 <templateId root="2.16.840.1.113883.10.20.1.28" assigningAuthorityName="CCD"/>
3343 <!--Problem observation template-->
3344
3345 <!-- <id> -->
3346 <xsl:call-template name="ccdID">
3347 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
3348 <xsl:with-param name="suffix"></xsl:with-param>
3349 </xsl:call-template>
3350
3351 <code code="55607006" displayName="Problem" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED-CT"/>
3352
3353 <text>
3354 <reference>
3355 <xsl:attribute name="value">
3356 <xsl:text>#</xsl:text>
3357 <xsl:value-of select="a:CCRDataObjectID"/>
3358 </xsl:attribute>
3359 </reference>
3360 </text>
3361
3362 <statusCode code="completed"/>
3363
3364 <xsl:call-template name="ccdDateTime">
3365 <xsl:with-param name="dt" select="a:DateTime"/>
3366 </xsl:call-template>
3367
3368 <xsl:call-template name="ccdCodedValue">
3369 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
3370 </xsl:call-template>
3371
3372 <xsl:call-template name="ccdStatus">
3373 <xsl:with-param name="ccrStatus" select="a:Status"/>
3374 </xsl:call-template>
3375 </observation>
3376 </entryRelationship>
3377
3378 </act>
3379 </entry>
3380 </xsl:for-each>
3381 </section>
3382 </component>
3383 </xsl:if>
3384 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Encounters">
3385 <component>
3386 <section>
3387 <templateId root="2.16.840.1.113883.3.88.11.83.127" assigningAuthorityName="HITSP/C83"/>
3388 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.5.3.3" assigningAuthorityName="IHE PCC"/>
3389 <templateId root="2.16.840.1.113883.10.20.1.3" assigningAuthorityName="HL7 CCD"/>
3390 <!--Encounters section template-->
3391 <code code="46240-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of encounters"/>
3392 <title>Encounters</title>
3393 <text>
3394 <table>
3395 <tbody>
3396 <tr>
3397 <th>Type</th>
3398 <th>Date</th>
3399 <th>Location</th>
3400 <th>Status</th>
3401 <th>Practitioner</th>
3402 <th>Description</th>
3403 <th>Indications</th>
3404 <th>Source</th>
3405 </tr>
3406 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Encounters/a:Encounter">
3407 <tr>
3408 <xsl:attribute name="id">
3409 <xsl:value-of select="a:CCRDataObjectID"/>
3410 </xsl:attribute>
3411
3412 <td>
3413 <xsl:value-of select="a:Type/a:Text"/>
3414 </td>
3415 <td>
3416 <xsl:call-template name="date:format-date">
3417 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
3418 </xsl:call-template>
3419 </td>
3420 <td>
3421 <xsl:for-each select="a:Locations/a:Location">
3422 <xsl:value-of select="a:Description/a:Text"/>
3423 <xsl:call-template name="actorName">
3424 <xsl:with-param name="objID" select="a:Actor/a:ActorID"/>
3425 </xsl:call-template>
3426 <br/>
3427 </xsl:for-each>
3428 </td>
3429 <td>
3430 <xsl:value-of select="a:Status/a:Text"/>
3431 </td>
3432 <td>
3433 <xsl:for-each select="a:Practitioners/a:Practitioner">
3434 <xsl:call-template name="actorName">
3435 <xsl:with-param name="objID" select="a:ActorID"/>
3436 </xsl:call-template>
3437 <br/>
3438 </xsl:for-each>
3439 </td>
3440 <td>
3441 <xsl:value-of select="a:Description/a:Text"/>
3442 </td>
3443 <td>
3444 <xsl:for-each select="a:Indications/a:Indication">
3445 <xsl:call-template name="problemDescription">
3446 <xsl:with-param name="objID" select="a:InternalCCRLink/a:LinkID"/>
3447 </xsl:call-template>
3448 <br/>
3449 </xsl:for-each>
3450 </td>
3451 <td>
3452 <xsl:call-template name="actorName">
3453 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
3454 </xsl:call-template>
3455 </td>
3456 </tr>
3457 </xsl:for-each>
3458 </tbody>
3459 </table>
3460 </text>
3461 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Encounters/a:Encounter">
3462 <entry typeCode="DRIV">
3463 <encounter classCode="ENC" moodCode="EVN">
3464 <templateId root="2.16.840.1.113883.3.88.11.83.16" assigningAuthorityName="HITSP C83"/>
3465 <templateId root="2.16.840.1.113883.10.20.1.21" assigningAuthorityName="CCD"/>
3466 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.14" assigningAuthorityName="IHE PCC"/>
3467
3468 <!-- Encounter activity template -->
3469
3470 <!-- <id> -->
3471 <xsl:call-template name="ccdID">
3472 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
3473 </xsl:call-template>
3474
3475 <xsl:call-template name="ccdCodedValue">
3476 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
3477 <xsl:with-param name="nodeName" select="'code'"/>
3478 </xsl:call-template>
3479
3480 <text>
3481 <reference>
3482 <xsl:attribute name="value">
3483 <xsl:text>#</xsl:text>
3484 <xsl:value-of select="a:CCRDataObjectID"/>
3485 </xsl:attribute>
3486 </reference>
3487 </text>
3488
3489 <xsl:call-template name="ccdDateTime">
3490 <xsl:with-param name="dt" select="a:DateTime"/>
3491 </xsl:call-template>
3492
3493 <xsl:if test="a:Practitioners[1]/a:Practitioner">
3494 <xsl:call-template name="ccdPerformer">
3495 <xsl:with-param name="ccrActorReference" select="a:Practitioners/a:Practitioner[1]"/>
3496 </xsl:call-template>
3497 </xsl:if>
3498
3499 <xsl:if test="a:Locations[1]/a:Location">
3500 <participant typeCode="LOC">
3501 <templateId root="2.16.840.1.113883.10.20.1.45"/>
3502 <!-- Location participation template -->
3503 <xsl:choose>
3504 <xsl:when test="a:Locations[1]/a:Location/a:ActorID">
3505 <xsl:call-template name="ccdParticipantRoleActor">
3506 <xsl:with-param name="ccrActorObjectID" select="a:Locations[1]/a:Location/a:ActorID"/>
3507 </xsl:call-template>
3508 </xsl:when>
3509 <xsl:otherwise>
3510 <xsl:call-template name="ccdParticipantRoleCodedDescription">
3511 <xsl:with-param name="ccrCodedDescription" select="a:Locations[1]/a:Location/a:Description"/>
3512 </xsl:call-template>
3513 </xsl:otherwise>
3514 </xsl:choose>
3515 </participant>
3516 </xsl:if>
3517 </encounter>
3518 </entry>
3519 </xsl:for-each>
3520 </section>
3521 </component>
3522 </xsl:if>
3523 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Procedures">
3524 <component>
3525 <section>
3526 <templateId root="2.16.840.1.113883.10.20.1.12"/>
3527 <code code="47519-4" codeSystem="2.16.840.1.113883.6.1"/>
3528 <title>Procedures</title>
3529 <text>
3530 <table>
3531 <tbody>
3532 <tr>
3533 <th>Type</th>
3534 <th>Date</th>
3535 <th>Code</th>
3536 <th>Description</th>
3537 <th>Location</th>
3538 <th>Substance</th>
3539 <th>Method</th>
3540 <th>Position</th>
3541 <th>Site</th>
3542 <th>Status</th>
3543 <th>Source</th>
3544 </tr>
3545 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
3546 <tr>
3547 <xsl:attribute name="id">
3548 <xsl:value-of select="a:CCRDataObjectID"/>
3549 </xsl:attribute>
3550
3551 <td>
3552 <xsl:value-of select="a:Type/a:Text"/>
3553 </td>
3554 <table>
3555 <tbody>
3556 <xsl:apply-templates select="a:DateTime"/>
3557 </tbody>
3558 </table>
3559 <td>
3560 <xsl:apply-templates select="a:Description/a:Code"/>
3561 </td>
3562 <td>
3563 <xsl:value-of select="a:Description/a:Text"/>
3564 </td>
3565 <td>
3566 <xsl:for-each select="a:Locations/a:Location">
3567 <xsl:value-of select="a:Description/a:Text"/>
3568 <xsl:if test="a:Actor">
3569 (<xsl:call-template name="actorName">
3570 <xsl:with-param name="objID" select="a:Actor/a:ActorID"/>
3571 </xsl:call-template>
3572 <xsl:if test="a:Actor/a:ActorRole/a:Text">
3573 <xsl:text xml:space="preserve"> - </xsl:text><xsl:value-of select="a:ActorRole/a:Text"/>)
3574 </xsl:if>
3575 </xsl:if>)
3576 <xsl:if test="position() != last()">
3577 <br/>
3578 </xsl:if>
3579 </xsl:for-each>
3580 </td>
3581 <td>
3582 <xsl:for-each select="a:Substance">
3583 <xsl:value-of select="a:Text"/>
3584 </xsl:for-each>
3585 </td>
3586 <td>
3587 <xsl:value-of select="a:Method/a:Text"/>
3588 </td>
3589 <td>
3590 <xsl:value-of select="a:Position/a:Text"/>
3591 </td>
3592 <td>
3593 <xsl:value-of select="a:Site/a:Text"/>
3594 </td>
3595 <td>
3596 <xsl:value-of select="a:Status/a:Text"/>
3597 </td>
3598 <td>
3599 <xsl:call-template name="actorName">
3600 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
3601 </xsl:call-template>
3602 </td>
3603 </tr>
3604 </xsl:for-each>
3605 </tbody>
3606 </table>
3607 </text>
3608
3609 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
3610 <entry typeCode="DRIV">
3611 <procedure classCode="PROC" moodCode="EVN">
3612 <templateId root="2.16.840.1.113883.3.88.11.83.17" assigningAuthorityName="HITSP C83"/>
3613 <templateId root="2.16.840.1.113883.10.20.1.29" assigningAuthorityName="CCD"/>
3614 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.19" assigningAuthorityName="IHE PCC"/>
3615
3616 <!-- <id> -->
3617 <xsl:call-template name="ccdID">
3618 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
3619 </xsl:call-template>
3620
3621 <!-- <code> -->
3622 <xsl:call-template name="ccdCodedValue">
3623 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
3624 <xsl:with-param name="nodeName" select="'code'"/>
3625 </xsl:call-template>
3626
3627 <text>
3628 <reference>
3629 <xsl:attribute name="value">
3630 <xsl:text>#</xsl:text>
3631 <xsl:value-of select="a:CCRDataObjectID"/>
3632 </xsl:attribute>
3633 </reference>
3634 </text>
3635
3636 <xsl:call-template name="ccdStatusProcedure">
3637 <xsl:with-param name="status" select="a:Status"/>
3638 </xsl:call-template>
3639
3640 <xsl:call-template name="ccdDateTime">
3641 <xsl:with-param name="dt" select="a:DateTime"/>
3642 </xsl:call-template>
3643
3644 <xsl:if test="a:Method">
3645 <xsl:call-template name="ccdCodedValue">
3646 <xsl:with-param name="ccrCodedDescription" select="a:Method"/>
3647 <xsl:with-param name="nodeName" select="'approachSiteCode'"/>
3648 </xsl:call-template>
3649 </xsl:if>
3650
3651 <xsl:if test="a:Site">
3652 <xsl:call-template name="ccdCodedValue">
3653 <xsl:with-param name="ccrCodedDescription" select="a:Site"/>
3654 <xsl:with-param name="nodeName" select="'targetSiteCode'"/>
3655 </xsl:call-template>
3656 </xsl:if>
3657
3658 <xsl:if test="a:Practitioners/a:Practitioner">
3659 <xsl:call-template name="ccdPerformer">
3660 <xsl:with-param name="ccrActorReference" select="a:Practitioners/a:Practitioner[1]"/>
3661 </xsl:call-template>
3662 </xsl:if>
3663 </procedure>
3664 </entry>
3665 </xsl:for-each>
3666 </section>
3667 </component>
3668 </xsl:if>
3669 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Procedures">
3670 <component>
3671 <section>
3672 <templateId root="2.16.840.1.113883.10.20.1.12"/>
3673 <code code="47519-4" codeSystem="2.16.840.1.113883.6.1"/>
3674 <title>Procedures</title>
3675 <text>
3676 <table>
3677 <tbody>
3678 <tr>
3679 <th>Type</th>
3680 <th>Date</th>
3681 <th>Code</th>
3682 <th>Description</th>
3683 <th>Location</th>
3684 <th>Substance</th>
3685 <th>Method</th>
3686 <th>Position</th>
3687 <th>Site</th>
3688 <th>Status</th>
3689 <th>Source</th>
3690 </tr>
3691 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
3692 <tr>
3693 <xsl:attribute name="id">
3694 <xsl:value-of select="a:CCRDataObjectID"/>
3695 </xsl:attribute>
3696
3697 <td>
3698 <xsl:value-of select="a:Type/a:Text"/>
3699 </td>
3700 <table>
3701 <tbody>
3702 <xsl:apply-templates select="a:DateTime"/>
3703 </tbody>
3704 </table>
3705 <td>
3706 <xsl:apply-templates select="a:Description/a:Code"/>
3707 </td>
3708 <td>
3709 <xsl:value-of select="a:Description/a:Text"/>
3710 </td>
3711 <td>
3712 <xsl:for-each select="a:Locations/a:Location">
3713 <xsl:value-of select="a:Description/a:Text"/>
3714 <xsl:if test="a:Actor">
3715 (<xsl:call-template name="actorName">
3716 <xsl:with-param name="objID" select="a:Actor/a:ActorID"/>
3717 </xsl:call-template>
3718 <xsl:if test="a:Actor/a:ActorRole/a:Text">
3719 <xsl:text xml:space="preserve"> - </xsl:text><xsl:value-of select="a:ActorRole/a:Text"/>)
3720 </xsl:if>
3721 </xsl:if>)
3722 <xsl:if test="position() != last()">
3723 <br/>
3724 </xsl:if>
3725 </xsl:for-each>
3726 </td>
3727 <td>
3728 <xsl:for-each select="a:Substance">
3729 <xsl:value-of select="a:Text"/>
3730 </xsl:for-each>
3731 </td>
3732 <td>
3733 <xsl:value-of select="a:Method/a:Text"/>
3734 </td>
3735 <td>
3736 <xsl:value-of select="a:Position/a:Text"/>
3737 </td>
3738 <td>
3739 <xsl:value-of select="a:Site/a:Text"/>
3740 </td>
3741 <td>
3742 <xsl:value-of select="a:Status/a:Text"/>
3743 </td>
3744 <td>
3745 <xsl:call-template name="actorName">
3746 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
3747 </xsl:call-template>
3748 </td>
3749 </tr>
3750 </xsl:for-each>
3751 </tbody>
3752 </table>
3753 </text>
3754
3755 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
3756 <entry typeCode="DRIV">
3757 <procedure classCode="PROC" moodCode="EVN">
3758 <templateId root="2.16.840.1.113883.3.88.11.83.17" assigningAuthorityName="HITSP C83"/>
3759 <templateId root="2.16.840.1.113883.10.20.1.29" assigningAuthorityName="CCD"/>
3760 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.19" assigningAuthorityName="IHE PCC"/>
3761
3762 <!-- <id> -->
3763 <xsl:call-template name="ccdID">
3764 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
3765 </xsl:call-template>
3766
3767 <!-- <code> -->
3768 <xsl:call-template name="ccdCodedValue">
3769 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
3770 <xsl:with-param name="nodeName" select="'code'"/>
3771 </xsl:call-template>
3772
3773 <text>
3774 <reference>
3775 <xsl:attribute name="value">
3776 <xsl:text>#</xsl:text>
3777 <xsl:value-of select="a:CCRDataObjectID"/>
3778 </xsl:attribute>
3779 </reference>
3780 </text>
3781
3782 <xsl:call-template name="ccdStatusProcedure">
3783 <xsl:with-param name="status" select="a:Status"/>
3784 </xsl:call-template>
3785
3786 <xsl:call-template name="ccdDateTime">
3787 <xsl:with-param name="dt" select="a:DateTime"/>
3788 </xsl:call-template>
3789
3790 <xsl:if test="a:Method">
3791 <xsl:call-template name="ccdCodedValue">
3792 <xsl:with-param name="ccrCodedDescription" select="a:Method"/>
3793 <xsl:with-param name="nodeName" select="'approachSiteCode'"/>
3794 </xsl:call-template>
3795 </xsl:if>
3796
3797 <xsl:if test="a:Site">
3798 <xsl:call-template name="ccdCodedValue">
3799 <xsl:with-param name="ccrCodedDescription" select="a:Site"/>
3800 <xsl:with-param name="nodeName" select="'targetSiteCode'"/>
3801 </xsl:call-template>
3802 </xsl:if>
3803
3804 <xsl:if test="a:Practitioners/a:Practitioner">
3805 <xsl:call-template name="ccdPerformer">
3806 <xsl:with-param name="ccrActorReference" select="a:Practitioners/a:Practitioner[1]"/>
3807 </xsl:call-template>
3808 </xsl:if>
3809 </procedure>
3810 </entry>
3811 </xsl:for-each>
3812 </section>
3813 </component>
3814 </xsl:if>
3815 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Procedures">
3816 <component>
3817 <section>
3818 <templateId root="2.16.840.1.113883.10.20.1.12"/>
3819 <code code="47519-4" codeSystem="2.16.840.1.113883.6.1"/>
3820 <title>Procedures</title>
3821 <text>
3822 <table>
3823 <tbody>
3824 <tr>
3825 <th>Type</th>
3826 <th>Date</th>
3827 <th>Code</th>
3828 <th>Description</th>
3829 <th>Location</th>
3830 <th>Substance</th>
3831 <th>Method</th>
3832 <th>Position</th>
3833 <th>Site</th>
3834 <th>Status</th>
3835 <th>Source</th>
3836 </tr>
3837 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
3838 <tr>
3839 <xsl:attribute name="id">
3840 <xsl:value-of select="a:CCRDataObjectID"/>
3841 </xsl:attribute>
3842
3843 <td>
3844 <xsl:value-of select="a:Type/a:Text"/>
3845 </td>
3846 <table>
3847 <tbody>
3848 <xsl:apply-templates select="a:DateTime"/>
3849 </tbody>
3850 </table>
3851 <td>
3852 <xsl:apply-templates select="a:Description/a:Code"/>
3853 </td>
3854 <td>
3855 <xsl:value-of select="a:Description/a:Text"/>
3856 </td>
3857 <td>
3858 <xsl:for-each select="a:Locations/a:Location">
3859 <xsl:value-of select="a:Description/a:Text"/>
3860 <xsl:if test="a:Actor">
3861 (<xsl:call-template name="actorName">
3862 <xsl:with-param name="objID" select="a:Actor/a:ActorID"/>
3863 </xsl:call-template>
3864 <xsl:if test="a:Actor/a:ActorRole/a:Text">
3865 <xsl:text xml:space="preserve"> - </xsl:text><xsl:value-of select="a:ActorRole/a:Text"/>)
3866 </xsl:if>
3867 </xsl:if>)
3868 <xsl:if test="position() != last()">
3869 <br/>
3870 </xsl:if>
3871 </xsl:for-each>
3872 </td>
3873 <td>
3874 <xsl:for-each select="a:Substance">
3875 <xsl:value-of select="a:Text"/>
3876 </xsl:for-each>
3877 </td>
3878 <td>
3879 <xsl:value-of select="a:Method/a:Text"/>
3880 </td>
3881 <td>
3882 <xsl:value-of select="a:Position/a:Text"/>
3883 </td>
3884 <td>
3885 <xsl:value-of select="a:Site/a:Text"/>
3886 </td>
3887 <td>
3888 <xsl:value-of select="a:Status/a:Text"/>
3889 </td>
3890 <td>
3891 <xsl:call-template name="actorName">
3892 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
3893 </xsl:call-template>
3894 </td>
3895 </tr>
3896 </xsl:for-each>
3897 </tbody>
3898 </table>
3899 </text>
3900
3901 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
3902 <entry typeCode="DRIV">
3903 <procedure classCode="PROC" moodCode="EVN">
3904 <templateId root="2.16.840.1.113883.3.88.11.83.17" assigningAuthorityName="HITSP C83"/>
3905 <templateId root="2.16.840.1.113883.10.20.1.29" assigningAuthorityName="CCD"/>
3906 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.19" assigningAuthorityName="IHE PCC"/>
3907
3908 <!-- <id> -->
3909 <xsl:call-template name="ccdID">
3910 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
3911 </xsl:call-template>
3912
3913 <!-- <code> -->
3914 <xsl:call-template name="ccdCodedValue">
3915 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
3916 <xsl:with-param name="nodeName" select="'code'"/>
3917 </xsl:call-template>
3918
3919 <text>
3920 <reference>
3921 <xsl:attribute name="value">
3922 <xsl:text>#</xsl:text>
3923 <xsl:value-of select="a:CCRDataObjectID"/>
3924 </xsl:attribute>
3925 </reference>
3926 </text>
3927
3928 <xsl:call-template name="ccdStatusProcedure">
3929 <xsl:with-param name="status" select="a:Status"/>
3930 </xsl:call-template>
3931
3932 <xsl:call-template name="ccdDateTime">
3933 <xsl:with-param name="dt" select="a:DateTime"/>
3934 </xsl:call-template>
3935
3936 <xsl:if test="a:Method">
3937 <xsl:call-template name="ccdCodedValue">
3938 <xsl:with-param name="ccrCodedDescription" select="a:Method"/>
3939 <xsl:with-param name="nodeName" select="'approachSiteCode'"/>
3940 </xsl:call-template>
3941 </xsl:if>
3942
3943 <xsl:if test="a:Site">
3944 <xsl:call-template name="ccdCodedValue">
3945 <xsl:with-param name="ccrCodedDescription" select="a:Site"/>
3946 <xsl:with-param name="nodeName" select="'targetSiteCode'"/>
3947 </xsl:call-template>
3948 </xsl:if>
3949
3950 <xsl:if test="a:Practitioners/a:Practitioner">
3951 <xsl:call-template name="ccdPerformer">
3952 <xsl:with-param name="ccrActorReference" select="a:Practitioners/a:Practitioner[1]"/>
3953 </xsl:call-template>
3954 </xsl:if>
3955 </procedure>
3956 </entry>
3957 </xsl:for-each>
3958 </section>
3959 </component>
3960 </xsl:if>
Note: See TracBrowser for help on using the repository browser.