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

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

remake

File size: 165.2 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 <!-- WV? for this group of 10 documents we are submitting-->
70 <id root="2.16.840.1.113883.3.543" extension="01.01.01.100000001.1"/>
71 <!--WVP next two lines fixed-->
72 <code code="55182-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Quality Measure Report"/>
73 <title>QRDA Incidence Report</title>
74 <!--WVV time-->
75 <effectiveTime value="20100703"/>
76 <!--WVP for next two lines-->
77 <confidentialityCode codeSystem="2.16.840.1.113883.5.25" code="N"/>
78 <languageCode code="en-US"/>
79 <!--WV? Don't change this in the document set we are working on-->
80 <setId root="2.16.840.1.113883.3.543" extension="01.01.01.100000001"/>
81 <versionNumber value="1"/>
82 <!--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-->
83
84 <!--
85 *******************
86 Patient Information
87 ****************
88 -->
89 <!-- This is the patient for which the report is describing. -->
90 <recordTarget>
91 <patientRole>
92 <!--WVV Id coding system is in the downloadable resoure and SSN is the extension. Edit the extension here-->
93 <!--Can't change during the reporting period-->
94 <id root="2.16.840.1.113883.4.1" extension="002386407"/>
95 <!--WVV address is not required-->
96 <addr>
97 <streetAddressLine>1200 Sanders Lane</streetAddressLine>
98 <city>Rockville</city>
99 <state>MD</state>
100 <postalCode>20850</postalCode>
101 </addr>
102 <patient>
103<!-- WVV something called use="L" found in some samples - not sure what it is or need for it -->
104 <name>
105 <!-- WV Edit -->
106 <given>Jody</given>
107 <family>Jones</family>
108 </name >
109
110 <!--VV Gender code can be M, F or UN for undifferentiated-->
111 <administrativeGenderCode code="F" codeSystem="2.16.840.1.113883.5.1"/>
112 <!--WVV Birth Time at least to the day-->
113 <birthTime value="19450101"/>
114 <!--WVV Edit-->
115 <!--WVV race is in there too, tab L in downloadable resources 2054-5 is Back or African American -->
116 <!--WVV 2106-3 is white and there are no hispanic and a huge number of indian tribes-->
117 <raceCode code="2106.3" codeSystem="2.16.840.1.113883.5.104"/>
118 <!--WVVEdit from downloadable resource tab M for Ethnicity -->
119 <!--WV 2186-5 is Not Hispanic or Latino -->
120 <ethnicGroupCode code="2186-5" codeSystem="2.16.840.1.113883.5.50"/>
121 </patient>
122 <!--WV Added to sample document and required NPI as extension and root is permanent-->
123 <providerOrganization>
124 <id root="2.16.840.1.113883.4.6" extension="6558574524" />
125 <name>WorldVistA Test Clinic</name>
126 <!--WVV address of organization which must have NPI is optional-->
127 <addr>
128 <streetAddressLine>123 Maple Ave</streetAddressLine>
129 <city>Gaithersburg</city>
130 <state>MD</state>
131 <postalCode>20877</postalCode>
132 </addr>
133 <!--WVP required asOrganizationPartOf added to sample-->
134 <asOrganizationPartOf>
135 <wholeOrganization>
136 <!--WVV tax ID (SS# or EIN)for the organizaton is the extension and the root is required and WVP2.16.840.1.113883.4.2-->
137 <id root="2.16.840.1.113883.4.2" extension="002345678"/>
138 </wholeOrganization>
139 </asOrganizationPartOf>
140 </providerOrganization>
141 </patientRole>
142 </recordTarget>
143
144<!--
145*****************************
146Author
147**************
148-->
149 <!-- This example assumes the doctor is creating the report and it is Required. -->
150 <author>
151 <!--WVV Edit time has to be precise at least to the day-->
152 <time value="20100703" />
153 <assignedAuthor>
154 <!--WVP eventually id this is required, the root is fixed -->
155 <!--andn the extension is the SOFTWARE version number assigned by CMS to WV EHR-->
156 <id root="2.16.840.1.113883.3.249.6" extension="100001" />
157 <!--WVVassignedPerson not required-->
158 <assignedPerson>
159 <name>
160 <!--WV Edit-->
161 <given>Nancy</given>
162 <family>Anthracite</family>
163 <suffix>MD</suffix>
164 </name>
165 </assignedPerson>
166 <representedOrganization>
167 <!--WV? id root is OID for the organization so I made one up for this document set-->
168 <id root="2.16.840.1.113883.3.543" extension="1558574526" />
169 <name>WorldVistA Test Clinic</name>
170 </representedOrganization>
171 </assignedAuthor>
172 </author>
173 <!-- The reporting healthcare facility is represented using the CCD "Source of Information" construct, via the Informant participant. -->
174 <informant>
175 <assignedEntity>
176 <!--WV this null flavor is required as is-->
177 <id nullFlavor="NA"/>
178 <representedOrganization>
179 <!--WV root is the OID of the organization. ID is required but name is not and id is OID stated earlier-->
180 <id root="2.16.840.1.113883.3.543" extension="1558574526" />
181 <name>World VistA Test Clinic</name>
182 </representedOrganization>
183 </assignedEntity>
184 </informant>
185
186 <!-- This example assumes that the institution responsible for the data is serving as custodian. -->
187 <!--WV This element is required as is the sSD which is not stated if it is an OID but assumed it is-->
188 <!--WV Name is not required, only ID is required.-->
189 <custodian>
190 <assignedCustodian>
191 <representedCustodianOrganization>
192 <id root="2.16.840.1.113883.3.543" extension="1558574526" />
193 <name>WorldVistA Test Clinic</name>
194 </representedCustodianOrganization>
195 </assignedCustodian>
196 </custodian>
197
198 <!-- In this example, the author is also serving as legal authenticator. -->
199 <!--WV section is this is not required-->
200<legalAuthenticator>
201 <time value="20100703" />
202 <!--WV the signature code of S is required-->
203 <signatureCode code="S" />
204 <assignedEntity>
205 <!--WV document does not specify the requirements of the id but it is required-->
206 <!--WVP and the sample suggests it is the number below and extension is ???-->
207 <id root="2.16.840.1.113883.3.543" extension="111111" />
208 <assignedPerson>
209 <name>
210 <given>Nancy</given>
211 <family>Anthracite</family>
212 <suffix>MD</suffix>
213 </name>
214 </assignedPerson>
215 <representedOrganization>
216 <!--WV? and is fixed for the WorldVistA Test Clinic in this submitted document series-->
217 <id root="2.16.840.1.113883.3.543" extension="1558574526" />
218 <name>WorldVistA Test Clinic</name>
219 </representedOrganization>
220 </assignedEntity>
221 </legalAuthenticator>
222
223
224
225 <!--Added to sample as it is new since 2008-->
226 <!--WVP permanent for participant in the primary care provider participant-->
227<!--WVP performer type codes are numerous but PRF is performer or the person who did it-->
228 <participant typeCode="PRF">
229 <!--WVP required as is for function-->
230 <!-- WVP I believe PCP is primary care provider but not sure-->
231 <functionCode code="PCP" codeSystem="2.16.840.1.113883.5.88"/>
232 <!--WVP Associated Entity is required ti be there with this PROV-->
233 <associatedEntity classCode="PROV">
234 <!--WV? OID of the provider fixed for this series of documents-->
235 <id root="2.16.840.1.113883.3.249.6" extension="111111" />
236 <!--WV associated person is not required so presumabley the code will suffice not sure??-->
237 <associatedPerson>
238 <name>
239 <prefix>Dr.</prefix>
240 <given>Nancy</given>
241 <family>Anthracite</family>
242 </name>
243 </associatedPerson>
244 </associatedEntity>
245 </participant>
246
247 <!--The service event is the encounter that describes tehe encunter as well as the provider, location and time-->
248 <!--!There can be one or more documentation elements depending on the number of encounters during the reporting period-->
249 <!--WVV IMPORTANT!! The encounter codeds are recorded here-->
250 <!-- They are in appendix B of the downloadable resource document-->
251 <!-- Each documentation of is a single service event-->
252
253<!--Occurence of Measures episode documention-->
254<!--Like an encounter section only for QRDA-->
255<!--Same doctor, same clinic, different date and different enconter code-->
256
257
258 <!--First Visit documentationOf section-->
259
260 <documentationOf>
261 <serviceEvent>
262 <!--WV serviceEvent codes from Tab B from the downloadabe resource coding system is -->
263 <!--WVF codeSystem is 2.16.840.1.113883 -->
264 <!--WV code root shall be WVP 2.16.840.1.113883.6.12 and the extension shall be the encounter code -->
265 <!-- WV? like the length of visit and complexity codes for example-->
266
267 <code code="99202" codeSystem="2.16.840.1.113883.6.12" codeSystemName="C4"/>
268 <effectiveTime>
269 <!--WV Edit-->
270 <!-- 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-->
271 <low value="20100205"/>
272 <high value="20100205"/>
273 </effectiveTime>
274 <performer typeCode="PRF">
275 <assignedEntity>
276 <!-- WV? Provider NPI Required root 2.16.840.1.113883.9.96 is ?? and the NPI is an extension for the provider-->
277 <!--This is variable but may remain unchanged for this document set-->
278 <id root="2.16.840.1.113883.3.543" extension="6558574524"/>
279 <!--<id root="2.16.840.1.113883.3.543" extension="1457402711"/>-->
280 <!--WV this element should be present and the code is probably for a General Physician for!-->
281 <!--It may be the type of provider as the example as I think 2.16.840.1.113883.6.69is the NDC-->
282 <!-- codeSystemName is SNOMED CT and code is an 8 digit num and display name is for a physician-->
283 <!--O6120 is SPECIALIZED PHYSICIAN when I looked it up so I don't know where to look for this 8 digit number-->
284 <!-- http://terminology.vetmed.vt.edu/SCT/menu.cfm to look up codes-->
285 <!--59058001 is general physician ;Family Medicine specialist is 62247001-->
286 <code code="62247001" codeSystem="2.16.840.1.113883.6.69" codeSystemName="SNOMED CT" displayName="Internal Medician Specialist"/>
287 <addr>
288 <streetAddressLine>123 Maple Ave</streetAddressLine>
289 <city>Gaithersburg</city>
290 <state>MD</state>
291 <postalCode>20877</postalCode>
292 </addr>
293 <assignedPerson>
294 <name>
295 <given>Nancy</given>
296 <family>Anthracite</family>
297 <suffix>MD</suffix>
298 </name>
299 </assignedPerson>
300 </assignedEntity>
301 </performer>
302 </serviceEvent>
303 </documentationOf>
304
305
306 <!--Second Visit documentationOf section-->
307
308 <documentationOf>
309 <serviceEvent>
310 <!--WV serviceEvent codes from Tab B from the downloadabe resource coding system is -->
311 <!--WVF codeSystem is 2.16.840.1.113883 -->
312 <!--WV code root shall be WVP 2.16.840.1.113883.6.12 and the extension shall be the encounter code -->
313 <!-- WV? like the length of visit and complexity codes for example-->
314
315 <code code="99204" codeSystem="2.16.840.1.113883.6.12" codeSystemName="C4"/>
316 <effectiveTime>
317 <!--WV Edit-->
318 <!-- 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-->
319 <low value="20100703"/>
320 <high value="20100703"/>
321 </effectiveTime>
322 <performer typeCode="PRF">
323 <assignedEntity>
324 <!-- WV? Provider NPI Required root 2.16.840.1.113883.9.96 is ?? and the NPI is an extension for the provider-->
325 <!--This is variable but may remain unchanged for this document set-->
326 <id root="2.16.840.1.113883.3.543" extension="6558574524"/>
327 <!--<id root="2.16.840.1.113883.3.543" extension="1457402711"/>-->
328 <!--WV this element should be present and the code is probably for a General Physician for!-->
329 <!--It may be the type of provider as the example as I think 2.16.840.1.113883.6.69is the NDC-->
330 <!-- codeSystemName is SNOMED CT and code is an 8 digit num and display name is for a physician-->
331 <!--O6120 is SPECIALIZED PHYSICIAN when I looked it up so I don't know where to look for this 8 digit number-->
332 <!-- http://terminology.vetmed.vt.edu/SCT/menu.cfm to look up codes-->
333 <!--59058001 is general physician ;Family Medicine specialist is 62247001-->
334 <code code="62247001" codeSystem="2.16.840.1.113883.6.69" codeSystemName="SNOMED CT" displayName="Internal Medician Specialist"/>
335 <addr>
336 <streetAddressLine>123 Maple Ave</streetAddressLine>
337 <city>Gaithersburg</city>
338 <state>MD</state>
339 <postalCode>20877</postalCode>
340 </addr>
341 <assignedPerson>
342 <name>
343 <given>Nancy</given>
344 <family>Anthracite</family>
345 <suffix>MD</suffix>
346 </name>
347 </assignedPerson>
348 </assignedEntity>
349 </performer>
350 </serviceEvent>
351 </documentationOf>
352 <!--
353********************************************************
354CDA Body
355********************************************************
356-->
357 <component>
358 <structuredBody>
359 <!--
360 ********************************************************
361 Measure Set Section
362 ********************************************************
363 -->
364 <component>
365 <section>
366 <!-- WVP QRDA Category I measure-specific template ID for 2010 #1. -->
367 <!--WP Next 3 lines do not change during the reporting period, for the measures section-->
368 <templateId root="2.16.840.1.113883.3.249.11.12" />
369 <code code="55185-3" codeSystem="2.16.840.1.113883.6.1" />
370 <title>Measure set: CMS EHR Measure Set</title>
371 <text>2010 Measures Set Measures</text>
372 <!--
373 ***************************************************
374 Measure Section
375 ***************************************************
376 -->
377 <component>
378 <section>
379 <!--template ID for each measure being reported-->
380 <templateId root="2.16.840.1.113883.3.249.11.2" />
381 <templateId root="2.16.840.1.113883.3.249.11.3" />
382 <templateId root="2.16.840.1.113883.3.249.11.4" />
383 <templateId root="2.16.840.1.113883.3.249.11.5" />
384 <templateId root="2.16.840.1.113883.3.249.11.6" />
385 <templateId root="2.16.840.1.113883.3.249.11.7" />
386 <templateId root="2.16.840.1.113883.3.249.11.8" />
387 <templateId root="2.16.840.1.113883.3.249.11.9" />
388 <templateId root="2.16.840.1.113883.3.249.11.10" />
389 <templateId root="2.16.840.1.113883.3.249.11.11" />
390 <templateId root="2.16.840.1.113883.3.249.11.15" />
391 <code code="55186-1" codeSystem="2.16.840.1.113883.6.1" />
392 <title>Measure Section</title>
393 <!--Here is where the HTML begins for the above and it is optional-->
394 <text>
395 <list>
396 <item>CMS Measure #1: Diabetes Mellitus: Hemoglobin A1c Poor Control in Diabetes Mellitus</item>
397 <item>CMS Measure #2: Diabetes Mellitus: Low Density Lipoprotein (LDL-C) Control in Diabetes Mellitus</item>
398 <item>CMS Measure #3: Diabetes Mellitus: High Blood Pressure Control in Diabetes Mellitus</item>
399 <item>CMS Measure #5: Heart Failure: Angiotensin-Converting Enzyme (ACE) Inhibitor or Angiotensin Receptor Blocker (ARB) Therapy for Left Ventricular Systolic Dysfunction (LVSD)</item>
400 <item>CMS Measure #7: Coronary Artery Disease (CAD): Beta-Blocker Therapy for CAD Patients with Prior Myocardial Infarction (MI)</item>
401 <item>CMS Measure #110: Preventive Care and Screening: Influenza Immunization for Patients >= 50 Years</item>
402 <item>CMS Measure #111: Preventive Care and Screening: Pneumonia Vaccination for Patients 65 Years and Older</item>
403 <item>CMS Measure #112: Preventive Care and Screening: Screening Mammography</item>
404 <item>CMS Measure #113: Preventive Care and Screening: Colorectal Cancer Screening</item>
405 <item>CMS Measure #124: Health Information Technology (HIT): Adoption/Use of Electronic Health Records (EHR)</item>
406 <item>CMS Measure eRx:Adoption/Use of Medication Electronic Prescribing Measure</item>
407 </list>
408 </text>
409 <!--Begin listing of acts-->
410 <entry typeCode="DRIV">
411 <act classCode="ACT" moodCode="DEF">
412 <id root="3944fd20-865c-11df-a4ee-0800200c9a66"/>
413 <code code="PQRI-1" codeSystem="2.16.840.1.113883.3.249.12" displayName="Hemoglobin A1c Poor Control in Diabetes Mellitus"/>
414 <text>Percentage of patients 18 through 75 years with diabetes mellitus who had most recent hemoglobin A1C greater than 9.0%</text>
415 <statusCode code="completed"/>
416 </act>
417 </entry>
418 <entry typeCode="DRIV">
419 <act classCode="ACT" moodCode="DEF">
420 <id root="3944fd21-865c-11df-a4ee-0800200c9a66"/>
421 <code code="PQRI-2" codeSystem="2.16.840.1.113883.3.249.12" displayName="Low Density Lipoprotein (LDL-C) Control in Diabetes Mellitus"/>
422 <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>
423 <statusCode code="completed"/>
424 </act>
425 </entry>
426 <entry typeCode="DRIV">
427 <act classCode="ACT" moodCode="DEF">
428 <id root="3944fd22-865c-11df-a4ee-0800200c9a66"/>
429 <code code="PQRI-3" codeSystem="2.16.840.1.113883.3.249.12" displayName="Hemoglobin A1c Poor Control in Diabetes Mellitus"/>
430 <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>
431 <statusCode code="completed"/>
432 </act>
433 </entry>
434 <entry typeCode="DRIV">
435 <act classCode="ACT" moodCode="DEF">
436 <id root="3944fd23-865c-11df-a4ee-0800200c9a66"/>
437 <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)"/>
438 <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>
439 <statusCode code="completed"/>
440 </act>
441 </entry>
442 <entry typeCode="DRIV">
443 <act classCode="ACT" moodCode="DEF">
444 <id root="3944fd24-865c-11df-a4ee-0800200c9a66"/>
445 <code code="PQRI-7" codeSystem="2.16.840.1.113883.3.249.12" displayName="Beta-Blocker Therapy for CAD Patients with Prior Myocardial Infarction"/>
446 <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>
447 <statusCode code="completed"/>
448 </act>
449 </entry>
450 <entry typeCode="DRIV">
451 <act classCode="ACT" moodCode="DEF">
452 <id root="3944fd25-865c-11df-a4ee-0800200c9a66"/>
453 <code code="PQRI-110" codeSystem="2.16.840.1.113883.3.249.12" displayName="Influenza Immunization for Patients >= 50 Years"/>
454 <text>Percentage of patients aged 50 years and older who received an influenza immunization during the flu season (September through February)</text>
455 <statusCode code="completed"/>
456 </act>
457 </entry>
458 <entry typeCode="DRIV">
459 <act classCode="ACT" moodCode="DEF">
460 <id root="3944fd26-865c-11df-a4ee-0800200c9a66"/>
461 <code code="PQRI-111" codeSystem="2.16.840.1.113883.3.249.12" displayName="Pneumonia Vaccination for Patients 65 Years and Older"/>
462 <text>Percentage of patients afed 65 years and older who have ever received a pneumoccal vaccine</text>
463 <statusCode code="completed"/>
464 </act>
465 </entry>
466 <entry typeCode="DRIV">
467 <act classCode="ACT" moodCode="DEF">
468 <id root="3944fd27-865c-11df-a4ee-0800200c9a66"/>
469 <code code="PQRI-112" codeSystem="2.16.840.1.113883.3.249.12" displayName="Screening Mammography"/>
470 <text>Percentage of womaen aged 40 through 69 years who had a mammogram to screen for breast cancer within 24 months</text>
471 <statusCode code="completed"/>
472 </act>
473 </entry>
474 <entry typeCode="DRIV">
475 <act classCode="ACT" moodCode="DEF">
476 <id root="3944fd28-865c-11df-a4ee-0800200c9a66"/>
477 <code code="PQRI-113" codeSystem="2.16.840.1.113883.3.249.12" displayName="Colorectal Cancer Screening"/>
478 <text>Percentage of patients aged 50 through 80 who received the appropriate colorectal cancer screening</text>
479 <statusCode code="completed"/>
480 </act>
481 </entry>
482 <entry typeCode="DRIV">
483 <act classCode="ACT" moodCode="DEF">
484 <id root="3944fd29-865c-11df-a4ee-0800200c9a66"/>
485 <code code="PQRI-124" codeSystem="2.16.840.1.113883.3.249.12" displayName="Adoption/Use of Electronic Health Records (EHR)"/>
486 <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>
487 <statusCode code="completed"/>
488 </act>
489 </entry>
490 <entry typeCode="DRIV">
491 <act classCode="ACT" moodCode="DEF">
492 <id root="3944fd30-865c-11df-a4ee-0800200c9a66"/>
493 <code code="eRx" codeSystem="2.16.840.1.113883.3.249.12" displayName="Adoption/Use of Medication Electronic Prescribing Measure"/>
494 <text>Documents whether provider has adopted and is using ePrescribing</text>
495 <statusCode code="completed"/>
496 </act>
497 </entry>
498 <!--
499 *******************************
500 Reporting Parameters Section
501 *****************************
502 -->
503 <component>
504 <section>
505 <code code="55187-9" codeSystem="2.16.840.1.113883.6.1"/>
506 <title>Reporting Parameters</title>
507 <text>
508 <list>
509 <item>Reporting Period Jan 1, 2010 to Dec 31, 2010</item>
510 </list>
511 </text>
512 <entry>
513 <act classCode="ACT" moodCode="EVN">
514 <code code="252116004" codeSystem="2.16.840.1.113883.6.96" displayName="Observation Parameters"/>
515 <effectiveTime>
516 <low value="20100101"/>
517 <high value="20101231"/>
518 </effectiveTime>
519 </act>
520 </entry>
521 </section>
522 </component>
523 <component>
524 <section>
525 <templateId root="2.16.840.1.113883.10.20.1.13"/>
526 <code code="48764-5" codeSystem="2.16.840.1.113883.6.1" />
527 <title>Purpose</title>
528 <text>
529 <xsl:value-of select="/a:ContinuityOfCareRecord/a:Purpose/a:Description/a:Text"></xsl:value-of>
530 </text>
531 </section>
532 </component>
533 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Alerts">
534 <component>
535 <section>
536 <templateId root="2.16.840.1.113883.10.20.1.2" />
537 <!--C83 Allergies and Other Adverse Reactions Section Conformance Identifier-->
538 <templateId root="2.16.840.1.113883.3.88.11.83.102" />
539 <!--IHE Allergies and Other Adverse Reactions Section Conformance Identifier-->
540 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.13" />
541 <code code="48765-2" displayName="Allergies, adverse reactions, alerts" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" />
542 <title>Alerts</title>
543 <text>
544 <table>
545 <tbody>
546 <tr>
547 <th>Type</th>
548 <th>Date</th>
549 <th>Code</th>
550 <th>Description</th>
551 <th>Reaction</th>
552 <th>Source</th>
553 </tr>
554 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Alerts/a:Alert">
555 <tr>
556 <td>
557 <xsl:value-of select="a:Type/a:Text"/>
558 </td>
559 <td>
560 <xsl:call-template name="date:format-date">
561 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
562 </xsl:call-template>
563 </td>
564 <td>
565 <xsl:apply-templates select="a:Description/a:Code"/>
566 </td>
567 <td>
568 <xsl:attribute name="ID">
569 <xsl:value-of select="a:CCRDataObjectID"/>
570 </xsl:attribute>
571 <xsl:value-of select="a:Description/a:Text"/>
572 </td>
573 <td>
574 <xsl:value-of select="a:Reaction/a:Description/a:Text"/>
575 <xsl:if test="a:Reaction/a:Severity/a:Text">
576 -<xsl:value-of select="a:Reaction/a:Severity/a:Text"/>
577 </xsl:if>
578 </td>
579 <td>
580 <xsl:call-template name="actorName">
581 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
582 </xsl:call-template>
583 </td>
584 </tr>
585 </xsl:for-each>
586 </tbody>
587 </table>
588 </text>
589 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Alerts/a:Alert">
590 <entry typeCode="DRIV">
591 <act classCode="ACT" moodCode="EVN">
592 <!--CCD Problem Act Identifier-->
593 <templateId root="2.16.840.1.113883.10.20.1.27"></templateId>
594 <!--C83 Allergy Entry-->
595 <templateId root="2.16.840.1.113883.3.88.11.83.6" />
596 <!--IHE Concern Entry Conformance Identifier-->
597 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5.1"></templateId>
598 <!--IHE Allergy and Intolerance Concerns Entry-->
599 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5.3"></templateId>
600
601 <!-- <id> -->
602 <xsl:call-template name="ccdID">
603 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
604 </xsl:call-template>
605
606 <code nullFlavor="NA"/>
607 <entryRelationship typeCode="SUBJ">
608 <observation classCode="OBS" moodCode="EVN">
609 <!--CCD Alert Observation-->
610 <templateId root="2.16.840.1.113883.10.20.1.18"></templateId>
611 <!--CCD Problem Observation-->
612 <templateId root="2.16.840.1.113883.10.20.1.28" />
613 <!--IHE Problem Entry-->
614 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5" />
615 <!--IHE Allergies and Intolerances Entry-->
616 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.6" />
617 <!-- <id> -->
618 <xsl:call-template name="ccdID">
619 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
620 <xsl:with-param name="suffix"></xsl:with-param>
621 </xsl:call-template>
622
623 <code code="416098002" codeSystem="2.16.840.1.113883.6.96" displayName="drug allergy" codeSystemName="SNOMED CT"/>
624
625 <text>
626 <reference>
627 <xsl:attribute name="value">
628 <xsl:text>#</xsl:text>
629 <xsl:value-of select="a:CCRDataObjectID"/>
630 </xsl:attribute>
631 </reference>
632 </text>
633
634 <statusCode code="completed"/>
635 <value xsi:type="CD" />
636
637 <participant typeCode="CSM">
638 <xsl:choose>
639 <xsl:when test="a:Agent/a:Products/a:Product/a:Product">
640 <xsl:call-template name="ccdParticipantRoleCodedDescription">
641 <xsl:with-param name="ccrCodedDescription" select="a:Product/a:Description"/>
642 </xsl:call-template>
643 </xsl:when>
644
645 </xsl:choose>
646 </participant>
647
648 <xsl:if test="a:Reaction">
649 <entryRelationship typeCode="MFST" inversionInd="true">
650 <observation classCode="OBS" moodCode="EVN">
651 <templateId root="2.16.840.1.113883.10.20.1.54"/>
652 <!--Reaction observation template -->
653 <code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
654 <statusCode code="completed"/>
655 <xsl:call-template name="ccdCodedValue">
656 <xsl:with-param name="ccrCodedDescription" select="a:Reaction/a:Description"/>
657 </xsl:call-template>
658 </observation>
659 </entryRelationship>
660 </xsl:if>
661
662 <xsl:call-template name="ccdStatus">
663 <xsl:with-param name="ccrStatus" select="a:Status"/>
664 </xsl:call-template>
665
666 </observation>
667 </entryRelationship>
668 </act>
669 </entry>
670 </xsl:for-each>
671 </section>
672 </component>
673 </xsl:if>
674 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Problems">
675 <component>
676 <section>
677 <templateId root="2.16.840.1.113883.3.88.11.83.103" assigningAuthorityName="HITSP/C83"/>
678 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.6" assigningAuthorityName="IHE PCC"/>
679 <templateId root="2.16.840.1.113883.10.20.1.11" assigningAuthorityName="HL7 CCD"/>
680 <code code="11450-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Problem list"/>
681 <title>Problems</title>
682 <text>
683 <table>
684 <tbody>
685 <tr>
686 <th>Type</th>
687 <th>Date</th>
688 <th>Code</th>
689 <th>Description</th>
690 <th>Status</th>
691 <th>Source</th>
692 </tr>
693 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Problems/a:Problem">
694 <tr>
695 <td>
696 <xsl:value-of select="a:Type/a:Text"/>
697 </td>
698 <td>
699 <table>
700 <tbody>
701 <xsl:apply-templates select="a:DateTime"/>
702 </tbody>
703 </table>
704 </td>
705 <td>
706 <xsl:apply-templates select="a:Description/a:Code"/>
707 </td>
708 <td>
709 <xsl:attribute name="ID">
710 <xsl:value-of select="a:CCRDataObjectID"></xsl:value-of>
711 </xsl:attribute>
712 <xsl:value-of select="a:Description/a:Text"/>
713 </td>
714 <td>
715 <xsl:value-of select="a:Status/a:Text"/>
716 </td>
717 <td>
718 <xsl:call-template name="actorName">
719 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
720 </xsl:call-template>
721 </td>
722 </tr>
723 </xsl:for-each>
724 </tbody>
725 </table>
726 </text>
727 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Problems/a:Problem">
728 <entry typeCode="DRIV">
729 <act classCode="ACT" moodCode="EVN">
730 <templateId root="2.16.840.1.113883.10.20.1.27"/>
731 <!-- Problem act template -->
732
733 <!-- <id> -->
734 <xsl:call-template name="ccdID">
735 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
736 </xsl:call-template>
737
738 <code nullFlavor="NA"/>
739
740 <xsl:call-template name="ccdPerformer">
741 <xsl:with-param name="ccrActorReference" select="a:Source/a:Actor"/>
742 </xsl:call-template>
743
744 <entryRelationship typeCode="SUBJ">
745 <observation classCode="OBS" moodCode="EVN">
746 <templateId root="2.16.840.1.113883.10.20.1.28" assigningAuthorityName="CCD"/>
747 <!--Problem observation template-->
748
749 <!-- <id> -->
750 <xsl:call-template name="ccdID">
751 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
752 <xsl:with-param name="suffix"></xsl:with-param>
753 </xsl:call-template>
754
755 <code code="55607006" displayName="Problem" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED-CT"/>
756
757 <text>
758 <reference>
759 <xsl:attribute name="value">
760 <xsl:text>#</xsl:text>
761 <xsl:value-of select="a:CCRDataObjectID"/>
762 </xsl:attribute>
763 </reference>
764 </text>
765
766 <statusCode code="completed"/>
767
768 <xsl:call-template name="ccdDateTime">
769 <xsl:with-param name="dt" select="a:DateTime"/>
770 </xsl:call-template>
771
772 <xsl:call-template name="ccdCodedValue">
773 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
774 </xsl:call-template>
775
776 <xsl:call-template name="ccdStatus">
777 <xsl:with-param name="ccrStatus" select="a:Status"/>
778 </xsl:call-template>
779 </observation>
780 </entryRelationship>
781
782 </act>
783 </entry>
784 </xsl:for-each>
785 </section>
786 </component>
787 </xsl:if>
788 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Procedures">
789 <component>
790 <section>
791 <templateId root="2.16.840.1.113883.10.20.1.12"/>
792 <code code="47519-4" codeSystem="2.16.840.1.113883.6.1"/>
793 <title>Procedures</title>
794 <text>
795 <table>
796 <tbody>
797 <tr>
798 <th>Type</th>
799 <th>Date</th>
800 <th>Code</th>
801 <th>Description</th>
802 <th>Location</th>
803 <th>Substance</th>
804 <th>Method</th>
805 <th>Position</th>
806 <th>Site</th>
807 <th>Status</th>
808 <th>Source</th>
809 </tr>
810 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
811 <tr>
812 <xsl:attribute name="id">
813 <xsl:value-of select="a:CCRDataObjectID"/>
814 </xsl:attribute>
815
816 <td>
817 <xsl:value-of select="a:Type/a:Text"/>
818 </td>
819 <table>
820 <tbody>
821 <xsl:apply-templates select="a:DateTime"/>
822 </tbody>
823 </table>
824 <td>
825 <xsl:apply-templates select="a:Description/a:Code"/>
826 </td>
827 <td>
828 <xsl:value-of select="a:Description/a:Text"/>
829 </td>
830 <td>
831 <xsl:for-each select="a:Locations/a:Location">
832 <xsl:value-of select="a:Description/a:Text"/>
833 <xsl:if test="a:Actor">
834 (<xsl:call-template name="actorName">
835 <xsl:with-param name="objID" select="a:Actor/a:ActorID"/>
836 </xsl:call-template>
837 <xsl:if test="a:Actor/a:ActorRole/a:Text">
838 <xsl:text xml:space="preserve"> - </xsl:text><xsl:value-of select="a:ActorRole/a:Text"/>)
839 </xsl:if>
840 </xsl:if>)
841 <xsl:if test="position() != last()">
842 <br/>
843 </xsl:if>
844 </xsl:for-each>
845 </td>
846 <td>
847 <xsl:for-each select="a:Substance">
848 <xsl:value-of select="a:Text"/>
849 </xsl:for-each>
850 </td>
851 <td>
852 <xsl:value-of select="a:Method/a:Text"/>
853 </td>
854 <td>
855 <xsl:value-of select="a:Position/a:Text"/>
856 </td>
857 <td>
858 <xsl:value-of select="a:Site/a:Text"/>
859 </td>
860 <td>
861 <xsl:value-of select="a:Status/a:Text"/>
862 </td>
863 <td>
864 <xsl:call-template name="actorName">
865 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
866 </xsl:call-template>
867 </td>
868 </tr>
869 </xsl:for-each>
870 </tbody>
871 </table>
872 </text>
873
874 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
875 <entry typeCode="DRIV">
876 <procedure classCode="PROC" moodCode="EVN">
877 <templateId root="2.16.840.1.113883.3.88.11.83.17" assigningAuthorityName="HITSP C83"/>
878 <templateId root="2.16.840.1.113883.10.20.1.29" assigningAuthorityName="CCD"/>
879 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.19" assigningAuthorityName="IHE PCC"/>
880
881 <!-- <id> -->
882 <xsl:call-template name="ccdID">
883 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
884 </xsl:call-template>
885
886 <!-- <code> -->
887 <xsl:call-template name="ccdCodedValue">
888 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
889 <xsl:with-param name="nodeName" select="'code'"/>
890 </xsl:call-template>
891
892 <text>
893 <reference>
894 <xsl:attribute name="value">
895 <xsl:text>#</xsl:text>
896 <xsl:value-of select="a:CCRDataObjectID"/>
897 </xsl:attribute>
898 </reference>
899 </text>
900
901 <xsl:call-template name="ccdStatusProcedure">
902 <xsl:with-param name="status" select="a:Status"/>
903 </xsl:call-template>
904
905 <xsl:call-template name="ccdDateTime">
906 <xsl:with-param name="dt" select="a:DateTime"/>
907 </xsl:call-template>
908
909 <xsl:if test="a:Method">
910 <xsl:call-template name="ccdCodedValue">
911 <xsl:with-param name="ccrCodedDescription" select="a:Method"/>
912 <xsl:with-param name="nodeName" select="'approachSiteCode'"/>
913 </xsl:call-template>
914 </xsl:if>
915
916 <xsl:if test="a:Site">
917 <xsl:call-template name="ccdCodedValue">
918 <xsl:with-param name="ccrCodedDescription" select="a:Site"/>
919 <xsl:with-param name="nodeName" select="'targetSiteCode'"/>
920 </xsl:call-template>
921 </xsl:if>
922
923 <xsl:if test="a:Practitioners/a:Practitioner">
924 <xsl:call-template name="ccdPerformer">
925 <xsl:with-param name="ccrActorReference" select="a:Practitioners/a:Practitioner[1]"/>
926 </xsl:call-template>
927 </xsl:if>
928 </procedure>
929 </entry>
930 </xsl:for-each>
931 </section>
932 </component>
933 </xsl:if>
934 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Medications">
935 <component>
936 <section>
937 <templateId root="2.16.840.1.113883.3.88.11.83.112" assigningAuthorityName="HITSP/C83"/>
938 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.19" assigningAuthorityName="IHE PCC"/>
939 <templateId root="2.16.840.1.113883.10.20.1.8" assigningAuthorityName="HL7 CCD"/>
940 <!--Medications section template-->
941 <code code="10160-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of medication use"/>
942 <title>Medications</title>
943 <text>
944 <table>
945 <tbody>
946 <tr>
947 <th>Medication</th>
948 <th>Date</th>
949 <th>Status</th>
950 <th>Form</th>
951 <th>Strength</th>
952 <th>Quantity</th>
953 <th>SIG</th>
954 <th>Indications</th>
955 <th>Instruction</th>
956 <th>Refills</th>
957 <th>Source</th>
958 </tr>
959 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Medications/a:Medication">
960 <tr>
961 <td>
962 <xsl:value-of select="a:Product/a:ProductName/a:Text"/>
963 <xsl:if test="a:Product/a:BrandName">
964 <xsl:text xml:space="preserve"> </xsl:text>(<xsl:value-of select="a:Product/a:BrandName/a:Text"/>)
965 </xsl:if>
966 </td>
967 <td>
968 <xsl:call-template name="date:format-date">
969 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
970 </xsl:call-template>
971 </td>
972 <td>
973 <xsl:value-of select="a:Status/a:Text"/>
974 </td>
975 <td>
976 <xsl:value-of select="a:Product/a:Form/a:Text"/>
977 </td>
978 <td>
979 <xsl:for-each select="a:Product/a:Strength">
980 <xsl:if test="position() > 1">
981 <xsl:text>/</xsl:text>
982 </xsl:if>
983 <xsl:value-of select="a:Value"/>
984 <xsl:text xml:space="preserve"> </xsl:text>
985 <xsl:value-of select="a:Units/a:Unit"/>
986 </xsl:for-each>
987 </td>
988 <td>
989 <xsl:value-of select="a:Quantity/a:Value"/>
990 <xsl:text xml:space="preserve"> </xsl:text>
991 <xsl:value-of select="a:Quantity/a:Units/a:Unit"/>
992 </td>
993 <td>
994 <xsl:for-each select="a:Directions/a:Direction">
995 <xsl:choose>
996 <xsl:when test="a:Description/a:Text">
997 <xsl:value-of select="a:Description/a:Text"/>
998 </xsl:when>
999 <xsl:otherwise>
1000 <xsl:value-of select="a:Dose/a:Value"/>
1001 <xsl:text xml:space="preserve"> </xsl:text>
1002 <xsl:value-of select="a:Dose/a:Units/a:Unit"/>
1003 <xsl:text xml:space="preserve"> </xsl:text>
1004 <xsl:value-of select="a:Route/a:Text"/>
1005 <xsl:text xml:space="preserve"> </xsl:text>
1006 <xsl:value-of select="a:Frequency/a:Value"/>
1007 <xsl:if test="a:Duration">
1008 <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>
1009 </xsl:if>
1010 <xsl:if test="a:MultipleDirectionModifier/a:ObjectAttribute">
1011 <xsl:for-each select="a:MultipleDirectionModifier/a:ObjectAttribute">
1012 <xsl:value-of select="a:Attribute"/>
1013 <br/>
1014 <xsl:value-of select="a:AttributeValue/a:Value"/>
1015 </xsl:for-each>
1016 </xsl:if>
1017 </xsl:otherwise>
1018 </xsl:choose>
1019 </xsl:for-each>
1020 </td>
1021 <td>
1022 <xsl:for-each select="a:Directions/a:Direction[1]/a:Indication">
1023 <xsl:call-template name="problemDescription">
1024 <xsl:with-param name="objID" select="a:InternalCCRLink/a:LinkID"/>
1025 </xsl:call-template>
1026 <br/>
1027 </xsl:for-each>
1028 </td>
1029 <td>
1030 <xsl:for-each select="a:PatientInstructions/a:Instruction">
1031 <xsl:value-of select="a:Text"/>
1032 <br/>
1033 </xsl:for-each>
1034 </td>
1035 <td>
1036 <xsl:for-each select="a:Refills/a:Refill">
1037 <xsl:value-of select="a:Number"/>
1038 <xsl:text xml:space="preserve"> </xsl:text>
1039 </xsl:for-each>
1040 </td>
1041 <td>
1042 <xsl:call-template name="actorName">
1043 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1044 </xsl:call-template>
1045 </td>
1046 </tr>
1047 </xsl:for-each>
1048 </tbody>
1049 </table>
1050 </text>
1051 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Medications/a:Medication">
1052 <entry typeCode="DRIV">
1053 <substanceAdministration classCode="SBADM" moodCode="EVN">
1054 <templateId root="2.16.840.1.113883.10.20.1.24" assigningAuthorityName="CCD"/>
1055 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1" assigningAuthorityName="IHE PCC"/>
1056
1057 <!--Medication activity template -->
1058
1059 <!-- <id> -->
1060 <xsl:call-template name="ccdID">
1061 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
1062 </xsl:call-template>
1063
1064 <statusCode code='completed'/>
1065
1066 <xsl:call-template name="ccdDateTime">
1067 <xsl:with-param name="dt" select="a:DateTime"/>
1068 <xsl:with-param name="type" select="'IVL_TS'"/>
1069 </xsl:call-template>
1070
1071 <xsl:call-template name="ccdMedicationFrequency">
1072 <xsl:with-param name="frequency" select="a:Directions/a:Direction/a:Frequency"/>
1073 </xsl:call-template>
1074
1075 <xsl:call-template name="ccdCodedValue">
1076 <xsl:with-param name="ccrCodedDescription" select="a:Directions/a:Direction/a:Route"/>
1077 <xsl:with-param name="nodeName" select="'routeCode'"/>
1078 <xsl:with-param name="domain" select="'RouteOfAdministration'"/>
1079 </xsl:call-template>
1080
1081 <xsl:if test="a:Directions/a:Direction/a:Dose">
1082 <doseQuantity>
1083 <low>
1084 <xsl:attribute name="value">
1085 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Value"></xsl:value-of>
1086 </xsl:attribute>
1087 <xsl:attribute name="unit">
1088 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Unit"></xsl:value-of>
1089 </xsl:attribute>
1090 </low>
1091 <high>
1092 <xsl:attribute name="value">
1093 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Value"></xsl:value-of>
1094 </xsl:attribute>
1095 <xsl:attribute name="unit">
1096 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Unit"></xsl:value-of>
1097 </xsl:attribute>
1098 </high>
1099 </doseQuantity>
1100 </xsl:if>
1101 <consumable>
1102 <manufacturedProduct>
1103 <templateId root="2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName="HITSP C83"/>
1104 <templateId root="2.16.840.1.113883.10.20.1.53" assigningAuthorityName="CCD"/>
1105 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName="IHE PCC"/>
1106
1107 <!-- Product template -->
1108
1109 <manufacturedMaterial>
1110 <xsl:call-template name="ccdCodedValue">
1111 <xsl:with-param name="ccrCodedDescription" select="a:Product/a:ProductName"/>
1112 <xsl:with-param name="nodeName" select="'code'"/>
1113 </xsl:call-template>
1114 <name>
1115 <xsl:value-of select="a:Product/a:BrandName/a:Text"/>
1116 </name>
1117 </manufacturedMaterial>
1118 </manufacturedProduct>
1119 </consumable>
1120 </substanceAdministration>
1121 </entry>
1122 </xsl:for-each>
1123 </section>
1124 </component>
1125 </xsl:if>
1126 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Immunizations">
1127 <component>
1128 <section>
1129 <templateId root="2.16.840.1.113883.10.20.1.6"/>
1130 <code code="11369-6" codeSystem="2.16.840.1.113883.6.1"/>
1131 <title>Immunizations</title>
1132 <text>
1133 <table>
1134 <tbody>
1135 <tr>
1136 <th>Code</th>
1137 <th>Vaccine</th>
1138 <th>Date</th>
1139 <th>Route</th>
1140 <th>Site</th>
1141 <th>Source</th>
1142 </tr>
1143 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Immunizations/a:Immunization">
1144 <tr>
1145 <xsl:attribute name="id">
1146 <xsl:value-of select="a:CCRDataObjectID"/>
1147 </xsl:attribute>
1148 <td>
1149 <xsl:apply-templates select="a:Product/a:ProductName/a:Code"/>
1150 </td>
1151 <td>
1152
1153 <xsl:value-of select="a:Product/a:ProductName/a:Text"/>
1154 <xsl:if test="a:Product/a:Form">
1155 <xsl:text xml:space="preserve"> </xsl:text>(<xsl:value-of select="a:Product/a:Form/a:Text"/>)
1156 </xsl:if>
1157 </td>
1158 <td>
1159 <xsl:call-template name="date:format-date">
1160 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
1161 </xsl:call-template>
1162 </td>
1163 <td>
1164 <xsl:value-of select="a:Directions/a:Direction/a:Route/a:Text"/>
1165 </td>
1166 <td>
1167 <xsl:attribute name="id">
1168 <xsl:value-of select="a:CCRDataObjectID"/>
1169 <xsl:text>:Site</xsl:text>
1170 </xsl:attribute>
1171
1172 <xsl:value-of select="a:Directions/a:Direction/a:Site/a:Text"/>
1173 </td>
1174 <td>
1175 <xsl:call-template name="actorName">
1176 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1177 </xsl:call-template>
1178 </td>
1179 </tr>
1180 </xsl:for-each>
1181 </tbody>
1182 </table>
1183 </text>
1184 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Immunizations/a:Immunization">
1185 <entry typeCode="DRIV">
1186 <substanceAdministration classCode="SBADM" moodCode="EVN">
1187 <templateId root="2.16.840.1.113883.10.20.1.24" assigningAuthorityName="CCD"/>
1188 <templateId root="2.16.840.1.113883.3.88.11.83.13" assigningAuthorityName="HITSP C83"/>
1189 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.12" assigningAuthorityName="IHE PCC"/>
1190
1191 <!-- Medication activity template -->
1192
1193 <!-- <id> -->
1194 <xsl:call-template name="ccdID">
1195 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
1196 </xsl:call-template>
1197
1198 <code code="IMMUNIZ" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7 ActCode"/>
1199 <text>
1200 <reference>
1201 <xsl:attribute name="value">
1202 <xsl:text>#</xsl:text>
1203 <xsl:value-of select="a:CCRDataObjectID"/>
1204 </xsl:attribute>
1205 </reference>
1206 </text>
1207
1208 <statusCode code='completed'/>
1209
1210 <xsl:call-template name="ccdDateTime">
1211 <xsl:with-param name="dt" select="a:DateTime"/>
1212 <xsl:with-param name="type" select="'IVL_TS'"/>
1213 </xsl:call-template>
1214
1215 <xsl:call-template name="ccdCodedValue">
1216 <xsl:with-param name="ccrCodedDescription" select="a:Directions/a:Direction/a:Route"/>
1217 <xsl:with-param name="nodeName" select="'routeCode'"/>
1218 <xsl:with-param name="domain" select="'RouteOfAdministration'"/>
1219 </xsl:call-template>
1220
1221 <xsl:if test="a:Directions/a:Direction/a:Site">
1222 <xsl:call-template name="ccdCodedValue">
1223 <xsl:with-param name="ccrCodedDescription" select="a:Directions/a:Direction/a:Site"/>
1224 <xsl:with-param name="nodeName" select="'approachSiteCode'"/>
1225 <xsl:with-param name="originalTextReference">
1226 <xsl:text>#</xsl:text>
1227 <xsl:value-of select="a:CCRDataObjectID"/>
1228 <xsl:text>:Site</xsl:text>
1229 </xsl:with-param>
1230 </xsl:call-template>
1231 </xsl:if>
1232
1233 <consumable>
1234 <manufacturedProduct>
1235 <templateId root="2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName="HITSP C83"/>
1236 <templateId root="2.16.840.1.113883.10.20.1.53" assigningAuthorityName="CCD"/>
1237 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName="IHE PCC"/>
1238
1239 <!-- Product template -->
1240
1241 <manufacturedMaterial>
1242 <xsl:call-template name="ccdCodedValue">
1243 <xsl:with-param name="ccrCodedDescription" select="a:Product/a:ProductName"/>
1244 <xsl:with-param name="nodeName" select="'code'"/>
1245 </xsl:call-template>
1246 <name>
1247 <xsl:value-of select="a:Product/a:BrandName/a:Text"/>
1248 </name>
1249 </manufacturedMaterial>
1250 </manufacturedProduct>
1251 </consumable>
1252
1253 </substanceAdministration>
1254 </entry>
1255 </xsl:for-each>
1256 </section>
1257 </component>
1258 </xsl:if>
1259 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:VitalSigns">
1260 <component>
1261 <section>
1262 <templateId root="2.16.840.1.113883.10.20.1.16"/>
1263 <code code="8716-3" codeSystem="2.16.840.1.113883.6.1"/>
1264 <title>Vital Signs</title>
1265 <text>
1266 <table>
1267 <tbody>
1268 <tr>
1269 <th>Vital Sign</th>
1270 <th>Date</th>
1271 <th>Result</th>
1272 <th>Source</th>
1273 </tr>
1274 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:VitalSigns/a:Result">
1275 <tr>
1276 <xsl:attribute name="id">
1277 <xsl:value-of select="a:CCRDataObjectID"/>
1278 </xsl:attribute>
1279
1280 <td>
1281 <xsl:value-of select="a:Description/a:Text"/>
1282 </td>
1283 <td>
1284 <xsl:call-template name="date:format-date">
1285 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
1286 </xsl:call-template>
1287 </td>
1288 <td>
1289 <xsl:for-each select="a:Test">
1290 <xsl:value-of select="a:Description/a:Text"/>
1291 <xsl:text xml:space="preserve"> </xsl:text>
1292 <xsl:value-of select="a:TestResult/a:Value"/>
1293 <xsl:text xml:space="preserve"> </xsl:text>
1294 <xsl:value-of select="a:TestResult/a:Units/a:Unit"/>
1295 <xsl:text xml:space="preserve"> </xsl:text>
1296 <xsl:value-of select="a:Flag/a:Text"/>
1297 <br/>
1298 </xsl:for-each>
1299 </td>
1300 <td>
1301 <xsl:call-template name="actorName">
1302 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1303 </xsl:call-template>
1304 </td>
1305 </tr>
1306 </xsl:for-each>
1307 </tbody>
1308 </table>
1309 </text>
1310 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:VitalSigns/a:Result">
1311 <entry typeCode="DRIV">
1312 <organizer classCode="CLUSTER" moodCode="EVN">
1313 <templateId root="2.16.840.1.113883.10.20.1.32" assigningAuthorityName="CCD"/>
1314 <templateId root="2.16.840.1.113883.10.20.1.35" assigningAuthorityName="CCD"/>
1315 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.1" assigningAuthorityName="IHE PCC"/>
1316 <!-- Vital signs organizer template -->
1317
1318 <xsl:variable name="testDate" select="a:DateTime"/>
1319
1320 <!-- <id> -->
1321 <xsl:call-template name="ccdID">
1322 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
1323 </xsl:call-template>
1324
1325 <code code="46680005" codeSystem="2.16.840.1.113883.6.96" displayName="Vital signs" codeSystemName="SNOMED CT"/>
1326 <statusCode code="completed"/>
1327 <xsl:call-template name="ccdDateTime">
1328 <xsl:with-param name="dt" select="$testDate"/>
1329 </xsl:call-template>
1330
1331 <xsl:call-template name="ccdObservation">
1332 <xsl:with-param name="ccrTestNode" select="a:Test[1]"/>
1333 <xsl:with-param name="testDate" select="$testDate"/>
1334 </xsl:call-template>
1335
1336 </organizer>
1337 </entry>
1338 </xsl:for-each>
1339 </section>
1340 </component>
1341 </xsl:if>
1342 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Encounters">
1343 <component>
1344 <section>
1345 <templateId root="2.16.840.1.113883.3.88.11.83.127" assigningAuthorityName="HITSP/C83"/>
1346 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.5.3.3" assigningAuthorityName="IHE PCC"/>
1347 <templateId root="2.16.840.1.113883.10.20.1.3" assigningAuthorityName="HL7 CCD"/>
1348 <!--Encounters section template-->
1349 <code code="46240-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of encounters"/>
1350 <title>Encounters</title>
1351 <text>
1352 <table>
1353 <tbody>
1354 <tr>
1355 <th>Type</th>
1356 <th>Date</th>
1357 <th>Location</th>
1358 <th>Status</th>
1359 <th>Practitioner</th>
1360 <th>Description</th>
1361 <th>Indications</th>
1362 <th>Source</th>
1363 </tr>
1364 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Encounters/a:Encounter">
1365 <tr>
1366 <xsl:attribute name="id">
1367 <xsl:value-of select="a:CCRDataObjectID"/>
1368 </xsl:attribute>
1369
1370 <td>
1371 <xsl:value-of select="a:Type/a:Text"/>
1372 </td>
1373 <td>
1374 <xsl:call-template name="date:format-date">
1375 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
1376 </xsl:call-template>
1377 </td>
1378 <td>
1379 <xsl:for-each select="a:Locations/a:Location">
1380 <xsl:value-of select="a:Description/a:Text"/>
1381 <xsl:call-template name="actorName">
1382 <xsl:with-param name="objID" select="a:Actor/a:ActorID"/>
1383 </xsl:call-template>
1384 <br/>
1385 </xsl:for-each>
1386 </td>
1387 <td>
1388 <xsl:value-of select="a:Status/a:Text"/>
1389 </td>
1390 <td>
1391 <xsl:for-each select="a:Practitioners/a:Practitioner">
1392 <xsl:call-template name="actorName">
1393 <xsl:with-param name="objID" select="a:ActorID"/>
1394 </xsl:call-template>
1395 <br/>
1396 </xsl:for-each>
1397 </td>
1398 <td>
1399 <xsl:value-of select="a:Description/a:Text"/>
1400 </td>
1401 <td>
1402 <xsl:for-each select="a:Indications/a:Indication">
1403 <xsl:call-template name="problemDescription">
1404 <xsl:with-param name="objID" select="a:InternalCCRLink/a:LinkID"/>
1405 </xsl:call-template>
1406 <br/>
1407 </xsl:for-each>
1408 </td>
1409 <td>
1410 <xsl:call-template name="actorName">
1411 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1412 </xsl:call-template>
1413 </td>
1414 </tr>
1415 </xsl:for-each>
1416 </tbody>
1417 </table>
1418 </text>
1419 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Encounters/a:Encounter">
1420 <entry typeCode="DRIV">
1421 <encounter classCode="ENC" moodCode="EVN">
1422 <templateId root="2.16.840.1.113883.3.88.11.83.16" assigningAuthorityName="HITSP C83"/>
1423 <templateId root="2.16.840.1.113883.10.20.1.21" assigningAuthorityName="CCD"/>
1424 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.14" assigningAuthorityName="IHE PCC"/>
1425
1426 <!-- Encounter activity template -->
1427
1428 <!-- <id> -->
1429 <xsl:call-template name="ccdID">
1430 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
1431 </xsl:call-template>
1432
1433 <xsl:call-template name="ccdCodedValue">
1434 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
1435 <xsl:with-param name="nodeName" select="'code'"/>
1436 </xsl:call-template>
1437
1438 <text>
1439 <reference>
1440 <xsl:attribute name="value">
1441 <xsl:text>#</xsl:text>
1442 <xsl:value-of select="a:CCRDataObjectID"/>
1443 </xsl:attribute>
1444 </reference>
1445 </text>
1446
1447 <xsl:call-template name="ccdDateTime">
1448 <xsl:with-param name="dt" select="a:DateTime"/>
1449 </xsl:call-template>
1450
1451 <xsl:if test="a:Practitioners[1]/a:Practitioner">
1452 <xsl:call-template name="ccdPerformer">
1453 <xsl:with-param name="ccrActorReference" select="a:Practitioners/a:Practitioner[1]"/>
1454 </xsl:call-template>
1455 </xsl:if>
1456
1457 <xsl:if test="a:Locations[1]/a:Location">
1458 <participant typeCode="LOC">
1459 <templateId root="2.16.840.1.113883.10.20.1.45"/>
1460 <!-- Location participation template -->
1461 <xsl:choose>
1462 <xsl:when test="a:Locations[1]/a:Location/a:ActorID">
1463 <xsl:call-template name="ccdParticipantRoleActor">
1464 <xsl:with-param name="ccrActorObjectID" select="a:Locations[1]/a:Location/a:ActorID"/>
1465 </xsl:call-template>
1466 </xsl:when>
1467 <xsl:otherwise>
1468 <xsl:call-template name="ccdParticipantRoleCodedDescription">
1469 <xsl:with-param name="ccrCodedDescription" select="a:Locations[1]/a:Location/a:Description"/>
1470 </xsl:call-template>
1471 </xsl:otherwise>
1472 </xsl:choose>
1473 </participant>
1474 </xsl:if>
1475 </encounter>
1476 </entry>
1477 </xsl:for-each>
1478 </section>
1479 </component>
1480 </xsl:if>
1481 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Results/a:Result">
1482 <component>
1483 <section>
1484 <templateId root="2.16.840.1.113883.10.20.1.14"/>
1485 <code code="30954-2" codeSystem="2.16.840.1.113883.6.1"/>
1486 <title>Results</title>
1487 <text>
1488 <table>
1489 <tbody>
1490 <tr>
1491 <th>Test</th>
1492 <th>Date</th>
1493 <th>Result</th>
1494 <th>Source</th>
1495 </tr>
1496 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Results/a:Result">
1497 <tr>
1498 <xsl:attribute name="id">
1499 <xsl:value-of select="a:CCRDataObjectID"/>
1500 </xsl:attribute>
1501 <td>
1502 <xsl:value-of select="a:Description/a:Text"/>
1503 </td>
1504 <td>
1505 <xsl:call-template name="date:format-date">
1506 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
1507 </xsl:call-template>
1508 </td>
1509 <td>
1510 <xsl:for-each select="a:Test[a:TestResult/a:Value!='']">
1511 <div>
1512 <xsl:attribute name="id">
1513 <xsl:value-of select="a:CCRDataObjectID"/>
1514 </xsl:attribute>
1515
1516 <xsl:value-of select="a:Description/a:Text"/>
1517 <xsl:text xml:space="preserve"> </xsl:text>
1518 <xsl:value-of select="a:TestResult/a:Value"/>
1519 <xsl:text xml:space="preserve"> </xsl:text>
1520 <xsl:value-of select="a:TestResult/a:Units/a:Unit"/>
1521 <xsl:text xml:space="preserve"> </xsl:text>
1522 <xsl:value-of select="a:Flag/a:Text"/>
1523 <br/>
1524 </div>
1525 </xsl:for-each>
1526 <xsl:for-each select="a:Test[a:TestResult/a:Description/a:Text!='']">
1527 <div>
1528 <xsl:attribute name="id">
1529 <xsl:value-of select="a:CCRDataObjectID"/>
1530 </xsl:attribute>
1531
1532 <xsl:value-of select="a:Description/a:Text"/>
1533 <xsl:text xml:space="preserve"> </xsl:text>
1534 <xsl:value-of select="a:TestResult/a:Description/a:Text" disable-output-escaping="yes"/>
1535 <xsl:text xml:space="preserve"> </xsl:text>
1536 <xsl:value-of select="a:Flag/a:Text"/>
1537 <br/>
1538 </div>
1539 </xsl:for-each>
1540 </td>
1541 <td>
1542 <xsl:call-template name="actorName">
1543 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1544 </xsl:call-template>
1545 </td>
1546 </tr>
1547 </xsl:for-each>
1548 </tbody>
1549 </table>
1550 </text>
1551 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Results/a:Result">
1552 <entry typeCode="DRIV">
1553 <xsl:variable name="testDate" select="a:DateTime"/>
1554
1555 <xsl:choose>
1556 <xsl:when test="count(a:Test)>1">
1557 <organizer classCode="BATTERY" moodCode="EVN">
1558 <templateId root="2.16.840.1.113883.10.20.1.32"/>
1559 <!--Result organizer template -->
1560
1561 <!-- <id> -->
1562 <xsl:call-template name="ccdID">
1563 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
1564 </xsl:call-template>
1565
1566 <!-- <code> -->
1567 <xsl:call-template name="ccdCodedValue">
1568 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
1569 <xsl:with-param name="nodeName" select="'code'"/>
1570 </xsl:call-template>
1571
1572 <statusCode code="completed"/>
1573
1574 <!-- <effectiveTime> -->
1575 <xsl:call-template name="ccdDateTime">
1576 <xsl:with-param name="dt" select="$testDate"/>
1577 </xsl:call-template>
1578
1579 <xsl:call-template name="ccdPerformer">
1580 <xsl:with-param name="ccrActorReference" select="a:Source/a:Actor"/>
1581 </xsl:call-template>
1582
1583 <xsl:for-each select="a:Test">
1584 <xsl:call-template name="ccdObservation">
1585 <xsl:with-param name="ccrTestNode" select="."/>
1586 <xsl:with-param name="testDate" select="$testDate"/>
1587 </xsl:call-template>
1588 </xsl:for-each>
1589
1590 </organizer>
1591
1592 </xsl:when>
1593 <xsl:otherwise>
1594 <xsl:call-template name="ccdObservation">
1595 <xsl:with-param name="ccrTestNode" select="a:Test[1]"/>
1596 <xsl:with-param name="testDate" select="$testDate"/>
1597 </xsl:call-template>
1598 </xsl:otherwise>
1599 </xsl:choose>
1600 </entry>
1601 </xsl:for-each>
1602 </section>
1603 </component>
1604 </xsl:if>
1605 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Payers">
1606 <component>
1607 <section>
1608 <templateId root="2.16.840.1.113883.10.20.1.9"/>
1609 <code code="48768-6" codeSystem="2.16.840.1.113883.6.1"/>
1610 <title>Insurance</title>
1611 <text>
1612 <table>
1613 <tbody>
1614 <tr>
1615 <th>Type</th>
1616 <th>Date</th>
1617 <th>Identification Numbers</th>
1618 <th>Payment Provider</th>
1619 <th>Subscriber</th>
1620 <th>Source</th>
1621 </tr>
1622 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Payers/a:Payer">
1623 <tr>
1624 <td>
1625 <xsl:value-of select="a:Type/a:Text"/>
1626 </td>
1627 <td>
1628 <xsl:call-template name="date:format-date">
1629 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
1630 </xsl:call-template>
1631 </td>
1632 <td>
1633 <xsl:for-each select="a:IDs">
1634 <xsl:value-of select="a:Type/a:Text"/>:<xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:ID"/><br/>
1635 </xsl:for-each>
1636 </td>
1637 <td>
1638 <xsl:call-template name="actorName">
1639 <xsl:with-param name="objID" select="a:PaymentProvider/a:ActorID"/>
1640 </xsl:call-template>
1641 </td>
1642 <td>
1643 <xsl:call-template name="actorName">
1644 <xsl:with-param name="objID" select="a:Subscriber/a:ActorID"/>
1645 </xsl:call-template>
1646 </td>
1647 <td>
1648 <xsl:call-template name="actorName">
1649 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1650 </xsl:call-template>
1651 </td>
1652 </tr>
1653 </xsl:for-each>
1654 </tbody>
1655 </table>
1656 </text>
1657 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Payers/a:Payer">
1658 <entry typeCode="DRIV">
1659 <act classCode="ACT" moodCode="DEF">
1660 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.17" assigningAuthorityName="IHE PCC"/>
1661 <templateId root="2.16.840.1.113883.10.20.1.20" assigningAuthorityName="CCD"/>
1662 <!-- Coverage entry template -->
1663 <!-- <id> -->
1664 <xsl:call-template name="ccdID">
1665 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
1666 </xsl:call-template>
1667 <code code="48768-6" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Payment sources"/>
1668 <statusCode code="completed"/>
1669 <entryRelationship typeCode="COMP">
1670 <act classCode="ACT" moodCode="EVN">
1671 <templateId root="2.16.840.1.113883.3.88.11.83.5" assigningAuthorityName="HITSP C83"/>
1672 <templateId root="2.16.840.1.113883.10.20.1.26" assigningAuthorityName="CCD"/>
1673 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.18" assigningAuthorityName="IHE PCC"/>
1674 <!--Insurance provider template -->
1675 <id>
1676 <xsl:attribute name="root">
1677 <xsl:value-of select="a:IDs[1]/a:ID"/>
1678 </xsl:attribute>
1679 <xsl:attribute name="extension">
1680 <xsl:value-of select="a:IDs[1]/a:Type/a:Text"/>
1681 </xsl:attribute>
1682 </id>
1683
1684 <!-- <code> -->
1685 <xsl:call-template name="ccdCodedValue">
1686 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
1687 <xsl:with-param name="nodeName" select="'code'"/>
1688 </xsl:call-template>
1689
1690 <statusCode code="completed"/>
1691
1692 <xsl:call-template name="ccdPerformer">
1693 <xsl:with-param name="ccrActorReference" select="a:PaymentProvider"/>
1694 </xsl:call-template>
1695
1696 <participant typeCode="HLD">
1697 <xsl:call-template name="ccdParticipantRoleActor">
1698 <xsl:with-param name="ccrActorReference" select="a:Subscriber"/>
1699 </xsl:call-template>
1700 </participant>
1701 </act>
1702 </entryRelationship>
1703 </act>
1704 </entry>
1705 </xsl:for-each>
1706 </section>
1707 </component>
1708 </xsl:if>
1709 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:HealthCareProviders">
1710 <component>
1711 <section>
1712 <title>Health Care Providers</title>
1713 <text>
1714 <table>
1715 <tbody>
1716 <tr>
1717 <th>Role</th>
1718 <th>Name</th>
1719 </tr>
1720 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:HealthCareProviders/a:Provider">
1721 <tr>
1722 <td>
1723 <xsl:value-of select="a:ActorRole/a:Text"/>
1724 </td>
1725 <td>
1726 <xsl:call-template name="actorName">
1727 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1728 </xsl:call-template>
1729 </td>
1730 </tr>
1731 </xsl:for-each>
1732 </tbody>
1733 </table>
1734 </text>
1735 </section>
1736 </component>
1737 </xsl:if>
1738 <!--
1739 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:SupportProviders">
1740 <component>
1741 <section>
1742 <title>Support Providers</title>
1743 <text>
1744 <table>
1745 <tbody>
1746 <tr>
1747 <th>Role</th>
1748 <th>Name</th>
1749 </tr>
1750 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Support/a:SupportProvider">
1751 <tr>
1752 <td>
1753 <xsl:value-of select="a:ActorRole/a:Text"/>
1754 </td>
1755 <td>
1756 <xsl:call-template name="actorName">
1757 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1758 </xsl:call-template>
1759 </td>
1760 </tr>
1761 </xsl:for-each>
1762 </tbody>
1763 </table>
1764 </text>
1765 </section>
1766 </component>
1767 </xsl:if>
1768 <xsl:if test="a:ContinuityOfCareRecord/a:References">
1769 <component>
1770 <section>
1771 <title>References</title>
1772 <text>
1773 <table>
1774 <tbody>
1775 <tr>
1776 <th>Type</th>
1777 <th>Date</th>
1778 <th>Description</th>
1779 <th>Location</th>
1780 <th>Source</th>
1781 </tr>
1782 <xsl:for-each select="/a:ContinuityOfCareRecord/a:References/a:Reference">
1783 <tr>
1784 <td>
1785 <xsl:value-of select="a:Type/a:Text"/>
1786 </td>
1787 <td>
1788 <xsl:call-template name="date:format-date">
1789 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
1790 </xsl:call-template>
1791 </td>
1792 <td>
1793 <strong class="clinical">
1794 <xsl:value-of select="a:Description/a:Text"/>
1795 </strong>
1796 </td>
1797 <td>
1798 <xsl:value-of select="a:Locations/a:Location/a:Description/a:Text"/>
1799 </td>
1800 <td>
1801 <xsl:call-template name="actorName">
1802 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
1803 </xsl:call-template>
1804 </td>
1805 </tr>
1806 </xsl:for-each>
1807 </tbody>
1808 </table>
1809 </text>
1810 </section>
1811 </component>
1812 </xsl:if>
1813 -->
1814 <!--
1815 <component>
1816 <section>
1817 <title>Additional Information About People &amp; Organizations</title>
1818 <text>
1819 <xsl:if test="a:ContinuityOfCareRecord/a:Actors/a:Actor[a:Person]">
1820 <table>
1821 <tbody>
1822 <tr>
1823 <th>Name</th>
1824 <th>Specialty</th>
1825 <th>Relation</th>
1826 <th>Identification Numbers</th>
1827 <th>Phone</th>
1828 <th>Address/ E-mail</th>
1829 </tr>
1830 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Actors/a:Actor">
1831 <xsl:sort select="a:Person/a:Name/a:DisplayName|a:Person/a:Name/a:CurrentName/a:Family" data-type="text" order="ascending"/>
1832 <xsl:if test="a:Person">
1833 <tr>
1834 <td>
1835 <xsl:call-template name="actorName">
1836 <xsl:with-param name="objID" select="a:ActorObjectID"/>
1837 </xsl:call-template>
1838 </td>
1839 <td>
1840 <xsl:value-of select="a:Specialty/a:Text"/>
1841 </td>
1842 <td>
1843 <xsl:value-of select="a:Relation/a:Text"/>
1844 </td>
1845 <td>
1846 <xsl:for-each select="a:IDs">
1847 <xsl:value-of select="a:Type/a:Text"/>
1848 <xsl:text>: </xsl:text>
1849 <xsl:value-of select="a:ID"/>
1850 </xsl:for-each>
1851 </td>
1852 <td>
1853 <xsl:for-each select="a:Telephone">
1854 <xsl:value-of select="a:Type/a:Text"/>
1855 <xsl:text>: </xsl:text>
1856 <xsl:value-of select="a:Value"/>
1857 </xsl:for-each>
1858 </td>
1859 <td>
1860 <xsl:for-each select="a:Address">
1861 <xsl:if test="a:Type">
1862 <xsl:value-of select="a:Type/a:Text"/>
1863 <xsl:text>:</xsl:text>
1864 <br/>
1865 </xsl:if>
1866 <xsl:if test="a:Line1">
1867 <xsl:value-of select="a:Line1"/>
1868 <br/>
1869 </xsl:if>
1870 <xsl:if test="a:Line2">
1871 <xsl:value-of select="a:Line2"/>
1872 <br/>
1873 </xsl:if>
1874 <xsl:if test="a:City">
1875 <xsl:value-of select="a:City"/>
1876 <xsl:text>, </xsl:text>
1877 </xsl:if>
1878 <xsl:value-of select="a:State"/>
1879 <xsl:value-of select="a:PostalCode"/>
1880 <br/>
1881 </xsl:for-each>
1882 <xsl:for-each select="a:EMail">
1883 <br/>
1884 <xsl:value-of select="a:Value"/>
1885 </xsl:for-each>
1886 </td>
1887 </tr>
1888 </xsl:if>
1889 </xsl:for-each>
1890 </tbody>
1891 </table>
1892 </xsl:if>
1893 <xsl:if test="a:ContinuityOfCareRecord/a:Actors/a:Actor[a:Organization]">
1894 <table>
1895 <tbody>
1896 <tr>
1897 <th>Name</th>
1898 <th>Specialty</th>
1899 <th>Relation</th>
1900 <th>Identification Numbers</th>
1901 <th>Phone</th>
1902 <th>Address/ E-mail</th>
1903 </tr>
1904 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Actors/a:Actor">
1905 <xsl:sort select="a:Organization/a:Name" data-type="text" order="ascending"/>
1906 <xsl:if test="a:Organization">
1907 <tr>
1908 <td>
1909 <xsl:value-of select="a:Organization/a:Name"/>
1910 </td>
1911 <td>
1912 <xsl:value-of select="a:Specialty/a:Text"/>
1913 </td>
1914 <td>
1915 <xsl:value-of select="a:Relation/a:Text"/>
1916 </td>
1917 <td>
1918 <xsl:for-each select="a:IDs">
1919 <xsl:value-of select="a:Type/a:Text"/>
1920 <xsl:text>: </xsl:text>
1921 <xsl:value-of select="a:ID"/>
1922 </xsl:for-each>
1923 </td>
1924 <td>
1925 <xsl:for-each select="a:Telephone">
1926 <xsl:value-of select="a:Type/a:Text"/>
1927 <xsl:text>: </xsl:text>
1928 <xsl:value-of select="a:Value"/>
1929 </xsl:for-each>
1930 </td>
1931 <td>
1932 <xsl:for-each select="a:Address">
1933 <xsl:if test="a:Type">
1934 <xsl:value-of select="a:Type/a:Text"/>
1935 <xsl:text>:</xsl:text>
1936 <br/>
1937 </xsl:if>
1938 <xsl:if test="a:Line1">
1939 <xsl:value-of select="a:Line1"/>
1940 <br/>
1941 </xsl:if>
1942 <xsl:if test="a:Line2">
1943 <xsl:value-of select="a:Line2"/>
1944 <br/>
1945 </xsl:if>
1946 <xsl:if test="a:City">
1947 <xsl:value-of select="a:City"/>
1948 <xsl:text>, </xsl:text>
1949 </xsl:if>
1950 <xsl:value-of select="a:State"/>
1951 <xsl:value-of select="a:PostalCode"/>
1952 <br/>
1953 </xsl:for-each>
1954 <xsl:for-each select="a:EMail">
1955 <br/>
1956 <xsl:value-of select="a:Value"/>
1957 </xsl:for-each>
1958 </td>
1959 </tr>
1960 </xsl:if>
1961 </xsl:for-each>
1962 </tbody>
1963 </table>
1964 </xsl:if>
1965 <xsl:if test="a:ContinuityOfCareRecord/a:Actors/a:Actor[a:InformationSystem]">
1966 <table>
1967 <tbody>
1968 <tr>
1969 <th>Name</th>
1970 <th>Type</th>
1971 <th>Version</th>
1972 <th>Identification Numbers</th>
1973 <th>Phone</th>
1974 <th>Address/ E-mail</th>
1975 </tr>
1976 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Actors/a:Actor">
1977 <xsl:sort select="a:InformationSystem/a:Name" data-type="text" order="ascending"/>
1978 <xsl:if test="a:InformationSystem">
1979 <tr>
1980 <td>
1981 <xsl:value-of select="a:InformationSystem/a:Name"/>
1982 </td>
1983 <td>
1984 <xsl:value-of select="a:InformationSystem/a:Type"/>
1985 </td>
1986 <td>
1987 <xsl:value-of select="a:InformationSystem/a:Version"/>
1988 </td>
1989 <td>
1990 <xsl:for-each select="a:IDs">
1991 <xsl:value-of select="a:Type/a:Text"/>
1992 <xsl:text>: </xsl:text>
1993 <xsl:value-of select="a:ID"/>
1994 </xsl:for-each>
1995 </td>
1996 <td>
1997 <xsl:for-each select="a:Telephone">
1998 <xsl:value-of select="a:Type/a:Text"/>
1999 <xsl:text>: </xsl:text>
2000 <xsl:value-of select="a:Value"/>
2001 </xsl:for-each>
2002 </td>
2003 <td>
2004 <xsl:for-each select="a:Address">
2005 <xsl:if test="Type">
2006 <xsl:value-of select="a:Type/a:Text"/>
2007 <xsl:text>:</xsl:text>
2008 <br/>
2009 </xsl:if>
2010 <xsl:if test="a:Line1">
2011 <xsl:value-of select="a:Line1"/>
2012 <br/>
2013 </xsl:if>
2014 <xsl:if test="a:Line2">
2015 <xsl:value-of select="a:Line2"/>
2016 <br/>
2017 </xsl:if>
2018 <xsl:if test="a:City">
2019 <xsl:value-of select="a:City"/>
2020 <xsl:text>, </xsl:text>
2021 </xsl:if>
2022 <xsl:value-of select="a:State"/>
2023 <xsl:value-of select="a:PostalCode"/>
2024 <br/>
2025 </xsl:for-each>
2026 <xsl:for-each select="a:EMail">
2027 <br/>
2028 <xsl:value-of select="a:Value"/>
2029 </xsl:for-each>
2030 </td>
2031 </tr>
2032 </xsl:if>
2033 </xsl:for-each>
2034 </tbody>
2035 </table>
2036 </xsl:if>
2037 </text>
2038 </section>
2039 </component>
2040 -->
2041</section>
2042</component>
2043</section>
2044</component>
2045</structuredBody>
2046</component>
2047</ClinicalDocument>
2048 </xsl:template>
2049 <xsl:template name="ccdAssignedEntity">
2050 <xsl:param name="ccrActorObjectID"/>
2051
2052 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2053
2054 <assignedEntity>
2055 <xsl:call-template name="ccdEntityID">
2056 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2057 </xsl:call-template>
2058
2059 <xsl:call-template name="ccdAddress">
2060 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address"/>
2061 </xsl:call-template>
2062
2063 <xsl:call-template name="ccdTelecom">
2064 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2065 </xsl:call-template>
2066
2067 <xsl:if test="$CCRActor/a:Person">
2068 <xsl:call-template name="ccdPerson">
2069 <xsl:with-param name="CCRActorPerson" select="$CCRActor/a:Person"/>
2070 <xsl:with-param name="personNodeName" select="'assignedPerson'"/>
2071 </xsl:call-template>
2072 </xsl:if>
2073
2074 <xsl:if test="$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']">
2075 <xsl:call-template name="ccdOrganization">
2076 <xsl:with-param name="ccrActorObjectID" select="$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']/a:LinkID"/>
2077 <xsl:with-param name="organizationNodeName" select="'representedOrganization'"/>
2078 </xsl:call-template>
2079 </xsl:if>
2080
2081 </assignedEntity>
2082 </xsl:template>
2083
2084 <xsl:template name="ccdPatient">
2085 <xsl:param name="CCRActorPerson"/>
2086 <patient>
2087 <xsl:call-template name="ccdPersonName">
2088 <xsl:with-param name="CCRActorName" select="$CCRActorPerson/a:Name"/>
2089 </xsl:call-template>
2090
2091 <xsl:if test="$CCRActorPerson/a:Gender">
2092 <xsl:call-template name="ccdCodedValue">
2093 <xsl:with-param name="ccrCodedDescription" select="$CCRActorPerson/a:Gender"/>
2094 <xsl:with-param name="domain" select="'AdministrativeGender'"/>
2095 <xsl:with-param name="nodeName" select="'administrativeGenderCode'"/>
2096 </xsl:call-template>
2097 </xsl:if>
2098
2099 <xsl:if test="$CCRActorPerson/a:DateOfBirth">
2100 <birthTime>
2101 <xsl:attribute name="value">
2102 <xsl:call-template name="date:format-date">
2103 <xsl:with-param name="date-time" select="$CCRActorPerson/a:DateOfBirth/a:ExactDateTime"/>
2104 <xsl:with-param name="pattern">yyyyMMddhhmmss</xsl:with-param>
2105 </xsl:call-template>
2106 </xsl:attribute>
2107 </birthTime>
2108 </xsl:if>
2109
2110 <xsl:if test="/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Marital Status']">
2111 <xsl:call-template name="ccdCodedValue">
2112 <xsl:with-param name="ccrCodedDescription" select="/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Marital Status']/a:Description"/>
2113 <xsl:with-param name="domain" select="'MaritalStatus'"/>
2114 <xsl:with-param name="nodeName" select="'maritalStatusCode'"/>
2115 </xsl:call-template>
2116 </xsl:if>
2117
2118 <xsl:if test="/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Language']">
2119 <languageCommunication>
2120 <templateId root="2.16.840.1.113883.3.88.11.83.2" assigningAuthorityName="HITSP/C83"/>
2121 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.2.1" assigningAuthorityName="IHE/PCC"/>
2122 <xsl:call-template name="ccdCodedValue">
2123 <xsl:with-param name="ccrCodedDescription" select="/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Language']/a:Description"></xsl:with-param>
2124 <xsl:with-param name="domain" select="'HumanLanguage'"/>
2125 <xsl:with-param name="nodeName" select="'languageCode'"/>
2126 </xsl:call-template>
2127 </languageCommunication>
2128 </xsl:if>
2129 </patient>
2130 </xsl:template>
2131
2132 <xsl:template name="ccdPerformer">
2133 <xsl:param name="ccrActorReference"/>
2134 <performer typeCode="PRF">
2135 <xsl:if test="$ccrActorReference/a:ActorRole">
2136 <xsl:call-template name="ccdCodedValue">
2137 <xsl:with-param name="ccrCodedDescription" select="$ccrActorReference/a:ActorRole"/>
2138 <xsl:with-param name="nodeName" select="'functionCode'"/>
2139 </xsl:call-template>
2140 </xsl:if>
2141 <xsl:call-template name="ccdAssignedEntity">
2142 <xsl:with-param name="ccrActorObjectID" select="$ccrActorReference/a:ActorID"/>
2143 </xsl:call-template>
2144 </performer>
2145 </xsl:template>
2146
2147 <xsl:template name="ccdPerson">
2148 <xsl:param name="CCRActorPerson"/>
2149 <xsl:param name="personNodeName">assignedPerson</xsl:param>
2150 <xsl:element name="{$personNodeName}">
2151 <xsl:call-template name="ccdPersonName">
2152 <xsl:with-param name="CCRActorName" select="$CCRActorPerson/a:Name"/>
2153 </xsl:call-template>
2154 </xsl:element>
2155 </xsl:template>
2156
2157 <xsl:template name="ccdPersonName">
2158 <xsl:param name="CCRActorName"/>
2159 <name>
2160 <xsl:if test="$CCRActorName/a:CurrentName/a:Title">
2161 <prefix>
2162 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Title"/>
2163 </prefix>
2164 </xsl:if>
2165 <xsl:if test="$CCRActorName/a:CurrentName/a:Given">
2166 <given>
2167 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Given"/>
2168 </given>
2169 </xsl:if>
2170 <xsl:if test="$CCRActorName/a:CurrentName/a:Middle">
2171 <given>
2172 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Middle"/>
2173 </given>
2174 </xsl:if>
2175 <xsl:if test="$CCRActorName/a:CurrentName/a:Family">
2176 <family>
2177 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Family"/>
2178 </family>
2179 </xsl:if>
2180 <xsl:if test="$CCRActorName/a:CurrentName/a:Suffix">
2181 <suffix>
2182 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Suffix"/>
2183 </suffix>
2184 </xsl:if>
2185 </name>
2186 </xsl:template>
2187
2188 <xsl:template name="ccdOrganization">
2189 <xsl:param name="ccrActorObjectID"/>
2190 <xsl:param name="organizationNodeName"/>
2191
2192 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2193
2194 <xsl:element name="{$organizationNodeName}">
2195 <xsl:call-template name="ccdEntityID">
2196 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2197 </xsl:call-template>
2198 <xsl:call-template name="ccdTelecom">
2199 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2200 </xsl:call-template>
2201
2202 <xsl:call-template name="ccdAddress">
2203 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address[1]"/>
2204 </xsl:call-template>
2205 </xsl:element>
2206 </xsl:template>
2207
2208 <xsl:template name="ccdPatientRole">
2209 <xsl:param name="ccrActorObjectID"/>
2210
2211 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2212
2213 <xsl:call-template name="ccdEntityID">
2214 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2215 </xsl:call-template>
2216
2217 <xsl:call-template name="ccdAddress">
2218 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address[1]"/>
2219 </xsl:call-template>
2220
2221 <xsl:call-template name="ccdTelecom">
2222 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2223 </xsl:call-template>
2224
2225 <xsl:call-template name="ccdPatient">
2226 <xsl:with-param name="CCRActorPerson" select="$CCRActor/a:Person"/>
2227 </xsl:call-template>
2228 </xsl:template>
2229
2230 <xsl:template name="ccdAssignedAuthor">
2231 <xsl:param name="ccrActorObjectID"/>
2232 <assignedAuthor>
2233 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2234
2235 <xsl:call-template name="ccdEntityID">
2236 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2237 </xsl:call-template>
2238
2239 <xsl:call-template name="ccdAddress">
2240 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address[1]"/>
2241 </xsl:call-template>
2242
2243 <xsl:call-template name="ccdTelecom">
2244 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2245 </xsl:call-template>
2246
2247 <xsl:call-template name="ccdPerson">
2248 <xsl:with-param name="CCRActorPerson" select="$CCRActor/a:Person"/>
2249 </xsl:call-template>
2250
2251 <xsl:if test="$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']">
2252 <representedOrganization>
2253 <xsl:call-template name="ccdOrganization">
2254 <xsl:with-param name="ccrActorObjectID" select="$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']/a:LinkID"/>
2255 </xsl:call-template>
2256 </representedOrganization>
2257 </xsl:if>
2258 </assignedAuthor>
2259 </xsl:template>
2260
2261 <xsl:template name="ccdParticipantRoleActor">
2262 <xsl:param name="ccrActorObjectID"/>
2263
2264 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
2265
2266 <xsl:call-template name="ccdEntityID">
2267 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2268 </xsl:call-template>
2269
2270 <xsl:call-template name="ccdAddress">
2271 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address[1]"/>
2272 </xsl:call-template>
2273
2274 <xsl:call-template name="ccdTelecom">
2275 <xsl:with-param name="CCRActor" select="$CCRActor"/>
2276 </xsl:call-template>
2277
2278 <xsl:if test="$CCRActor/a:Organization/a:Name">
2279 <playingEntity classCode="PLC">
2280 <name>
2281 <xsl:value-of select="$CCRActor/a:Organization/a:Name"/>
2282 </name>
2283 </playingEntity>
2284 </xsl:if>
2285 </xsl:template>
2286
2287 <xsl:template name="ccdParticipantRoleCodedDescription">
2288 <xsl:param name="ccrCodedDescription"/>
2289 <participantRole classCode="MANU">
2290 <!--Product Detail-->
2291 <playingEntity classCode="MMAT">
2292 <xsl:if test="$ccrCodedDescription/a:Code">
2293 <xsl:call-template name="ccdCodedValue">
2294 <xsl:with-param name="ccrCodedDescription" select="$ccrCodedDescription"/>
2295 <xsl:with-param name="nodeName" select="'code'"/>
2296 </xsl:call-template>
2297 </xsl:if>
2298 <name>
2299 <xsl:value-of select="$ccrCodedDescription/a:Text"/>
2300 </name>
2301 </playingEntity>
2302 </participantRole>
2303 </xsl:template>
2304
2305 <xsl:template name="ccdEntityID">
2306 <xsl:param name="CCRActor"/>
2307 <id>
2308 <xsl:choose>
2309 <xsl:when test="$CCRActor/a:IDs">
2310 <xsl:attribute name="extension">
2311 <xsl:value-of select="$CCRActor/a:IDs[1]/a:ID"/>
2312 </xsl:attribute>
2313 <xsl:attribute name="root">
2314 <xsl:value-of select="$CCRActor/a:IDs[1]/a:Type/a:Text"/>
2315 </xsl:attribute>
2316 </xsl:when>
2317 <xsl:otherwise>
2318 <xsl:attribute name="extension">
2319 <xsl:value-of select="$CCRActor/a:ActorObjectID"/>
2320 </xsl:attribute>
2321 <xsl:attribute name="root">
2322 <xsl:text>CCRActorID</xsl:text>
2323 </xsl:attribute>
2324 </xsl:otherwise>
2325 </xsl:choose>
2326 </id>
2327 <xsl:if test="$CCRActor/a:Organization">
2328 <name><xsl:value-of select="$CCRActor/a:Organization/a:Name"></xsl:value-of></name>
2329 </xsl:if>
2330 </xsl:template>
2331 <xsl:template name="ccdAddress">
2332 <xsl:param name="CCRActorAddress"/>
2333 <addr>
2334 <xsl:choose>
2335 <xsl:when test="$CCRActorAddress">
2336 <xsl:attribute name="use">
2337 <xsl:call-template name="CDAVocabularyLookup">
2338 <xsl:with-param name="domain" select="'telecommunicationsAddressUse'"/>
2339 <xsl:with-param name="ccrtext" select="$CCRActorAddress/a:Type/a:Text"/>
2340 </xsl:call-template>
2341 </xsl:attribute>
2342 <streetAddressLine>
2343 <xsl:value-of select="$CCRActorAddress/a:Line1"/>
2344 </streetAddressLine>
2345 <city>
2346 <xsl:value-of select="$CCRActorAddress/a:City"/>
2347 </city>
2348 <state>
2349 <xsl:value-of select="$CCRActorAddress/a:State"/>
2350 </state>
2351 <postalCode>
2352 <xsl:value-of select="$CCRActorAddress/a:PostalCode"/>
2353 </postalCode>
2354 </xsl:when>
2355 <xsl:otherwise>
2356 <streetAddressLine/>
2357 </xsl:otherwise>
2358 </xsl:choose>
2359 </addr>
2360 </xsl:template>
2361
2362 <xsl:template name="ccdTelecom">
2363 <xsl:param name="CCRActor"/>
2364 <telecom>
2365 <xsl:if test="$CCRActor/a:Telephone">
2366 <xsl:attribute name="use">
2367 <xsl:call-template name="CDAVocabularyLookup">
2368 <xsl:with-param name="domain" select="'telecommunicationsAddressUse'"/>
2369 <xsl:with-param name="ccrtext" select="$CCRActor/a:Telephone/a:Type/a:Text"/>
2370 </xsl:call-template>
2371 </xsl:attribute>
2372 <xsl:attribute name="value">
2373 <xsl:text>tel:+1-</xsl:text>
2374 <xsl:value-of select="$CCRActor/a:Telephone[1]/a:Value"/>
2375 </xsl:attribute>
2376 </xsl:if>
2377 </telecom>
2378
2379 <xsl:if test="$CCRActor/a:Email">
2380 <telecom>
2381 <xsl:choose>
2382 <xsl:when test="$CCRActor/a:Telephone">
2383 <xsl:attribute name="use">
2384 <xsl:call-template name="CDAVocabularyLookup">
2385 <xsl:with-param name="domain" select="'telecommunicationsAddressUse'"/>
2386 <xsl:with-param name="ccrtext" select="$CCRActor/a:Telephone/a:Type/a:Text"/>
2387 </xsl:call-template>
2388 </xsl:attribute>
2389 <xsl:attribute name="value">
2390 <xsl:text>mailto:</xsl:text>
2391 <xsl:value-of select="$CCRActor/a:Email[1]/a:Value"/>
2392 </xsl:attribute>
2393 </xsl:when>
2394 <xsl:otherwise>
2395 <xsl:attribute name="value">
2396 <xsl:text>Unknown</xsl:text>
2397 </xsl:attribute>
2398 </xsl:otherwise>
2399 </xsl:choose>
2400 </telecom>
2401 </xsl:if>
2402 </xsl:template>
2403
2404 <xsl:template name="ccdID">
2405 <xsl:param name="ccrObjectID"/>
2406 <xsl:param name="suffix"/>
2407 <id>
2408 <xsl:attribute name="root">
2409 <xsl:value-of select="$ccrObjectID"></xsl:value-of>
2410 </xsl:attribute>
2411 <xsl:attribute name="extension">CCRObjectID</xsl:attribute>
2412 </id>
2413 </xsl:template>
2414
2415 <xsl:template name="ccdCodedValue">
2416 <xsl:param name="ccrCodedDescription"/>
2417 <xsl:param name="type"/>
2418 <xsl:param name="domain"/>
2419 <xsl:param name="nodeName">value</xsl:param>
2420 <xsl:param name="originalTextReference"/>
2421
2422 <xsl:element name="{$nodeName}">
2423 <xsl:if test="$type">
2424 <xsl:attribute name="xsi:type">
2425 <xsl:value-of select="$type"/>
2426 </xsl:attribute>
2427 </xsl:if>
2428 <xsl:choose>
2429 <xsl:when test="$ccrCodedDescription/a:Code">
2430 <xsl:attribute name="displayName">
2431 <xsl:value-of select="$ccrCodedDescription/a:Text"/>
2432 </xsl:attribute>
2433 <xsl:attribute name="code">
2434 <xsl:value-of select="$ccrCodedDescription/a:Code/a:Value"/>
2435 </xsl:attribute>
2436 <xsl:attribute name="codeSystemName">
2437 <xsl:value-of select="$ccrCodedDescription/a:Code/a:CodingSystem"/>
2438 </xsl:attribute>
2439 <xsl:attribute name="codeSystem">
2440 <xsl:call-template name="HL7OIDLookup">
2441 <xsl:with-param name="name" select="$ccrCodedDescription/a:Code/a:CodingSystem"/>
2442 </xsl:call-template>
2443 </xsl:attribute>
2444 </xsl:when>
2445 <xsl:when test="$domain">
2446 <xsl:variable name="cdaCode">
2447 <xsl:call-template name="CDAVocabularyLookup">
2448 <xsl:with-param name="domain" select="$domain"/>
2449 <xsl:with-param name="ccrtext" select="$ccrCodedDescription/a:Text"/>
2450 </xsl:call-template>
2451 </xsl:variable>
2452 <xsl:attribute name="displayName">
2453 <xsl:call-template name="CDADisplayNameLookup">
2454 <xsl:with-param name="domain" select="$domain"/>
2455 <xsl:with-param name="cdacode" select="$cdaCode"/>
2456 </xsl:call-template>
2457 </xsl:attribute>
2458 <xsl:attribute name="code">
2459 <xsl:value-of select="$cdaCode"></xsl:value-of>
2460 </xsl:attribute>
2461 <xsl:attribute name="codeSystemName">
2462 <xsl:call-template name="CDAVocabularyCodeSystemNameLookup">
2463 <xsl:with-param name="domain" select="$domain"/>
2464 </xsl:call-template>
2465 </xsl:attribute>
2466 <xsl:attribute name="codeSystemName">
2467 <xsl:call-template name="CDAVocabularyCodeSystemLookup">
2468 <xsl:with-param name="domain" select="$domain"/>
2469 </xsl:call-template>
2470 </xsl:attribute>
2471 </xsl:when>
2472 <xsl:otherwise>
2473 <originalText>
2474 <xsl:value-of select="$ccrCodedDescription/a:Text"/>
2475 <xsl:if test="$originalTextReference">
2476 <reference>
2477 <xsl:attribute name="value">
2478 <xsl:value-of select="$originalTextReference"/>
2479 </xsl:attribute>
2480 </reference>
2481 </xsl:if>
2482 </originalText>
2483 </xsl:otherwise>
2484 </xsl:choose>
2485 </xsl:element>
2486 </xsl:template>
2487
2488 <xsl:template name="ccdDateTime">
2489 <xsl:param name="dt"/>
2490 <xsl:param name="type"/>
2491 <xsl:if test="$dt">
2492 <xsl:if test="$dt[1]/a:ExactDateTime">
2493 <effectiveTime>
2494 <xsl:if test="$type">
2495 <xsl:attribute name="xsi:type">
2496 <xsl:value-of select="$type"></xsl:value-of>
2497 </xsl:attribute>
2498 </xsl:if>
2499 <low>
2500 <xsl:attribute name="value">
2501 <xsl:call-template name="date:format-date">
2502 <xsl:with-param name="date-time" select="$dt[1]/a:ExactDateTime"/>
2503 <xsl:with-param name="pattern">yyyyMMdd</xsl:with-param>
2504 </xsl:call-template>
2505 </xsl:attribute>
2506 </low>
2507 <high nullFlavor="UNK"/>
2508 </effectiveTime>
2509 </xsl:if>
2510 <xsl:if test="$dt[1]/a:DateTimeRange">
2511 <effectiveTime>
2512 <low>
2513 <xsl:attribute name="value">
2514 <xsl:call-template name="date:format-date">
2515 <xsl:with-param name="date-time" select="$dt[1]/a:DateTimeRange/a:BeginRange/a:ExactDateTime"/>
2516 <xsl:with-param name="pattern">yyyyMMdd</xsl:with-param>
2517 </xsl:call-template>
2518 </xsl:attribute>
2519 </low>
2520 <high>
2521 <xsl:attribute name="value">
2522 <xsl:call-template name="date:format-date">
2523 <xsl:with-param name="date-time" select="$dt[1]/a:DateTimeRange/a:EndRange/a:ExactDateTime"/>
2524 <xsl:with-param name="pattern">yyyyMMdd</xsl:with-param>
2525 </xsl:call-template>
2526 </xsl:attribute>
2527 </high>
2528 </effectiveTime>
2529 </xsl:if>
2530 </xsl:if>
2531 </xsl:template>
2532
2533 <xsl:template name="ccdMedicationFrequency">
2534 <xsl:param name="frequency"/>
2535 <xsl:if test="$frequency">
2536 <xsl:choose>
2537 <xsl:when test="$frequency/a:Value='qd'">
2538 <effectiveTime xsi:type="PIVL_TS" operator="A">
2539 <xsl:attribute name="institutionSpecified">true</xsl:attribute>
2540 <period>
2541 <xsl:attribute name="value">24</xsl:attribute>
2542 <xsl:attribute name="unit">h</xsl:attribute>
2543 </period>
2544 </effectiveTime>
2545 </xsl:when>
2546 <xsl:when test="$frequency/a:Value='bid'">
2547 <effectiveTime xsi:type="PIVL_TS" operator="A">
2548 <xsl:attribute name="institutionSpecified">true</xsl:attribute>
2549 <period>
2550 <xsl:attribute name="value">12</xsl:attribute>
2551 <xsl:attribute name="unit">h</xsl:attribute>
2552 </period>
2553 </effectiveTime>
2554 </xsl:when>
2555 <xsl:when test="$frequency/a:Value='tid'">
2556 <effectiveTime xsi:type="PIVL_TS" operator="A">
2557 <xsl:attribute name="institutionSpecified">true</xsl:attribute>
2558 <period>
2559 <xsl:attribute name="value">8</xsl:attribute>
2560 <xsl:attribute name="unit">h</xsl:attribute>
2561 </period>
2562 </effectiveTime>
2563 </xsl:when>
2564 <xsl:when test="$frequency/a:Value='qid'">
2565 <effectiveTime xsi:type="PIVL_TS" operator="A">
2566 <xsl:attribute name="institutionSpecified">true</xsl:attribute>
2567 <period>
2568 <xsl:attribute name="value">6</xsl:attribute>
2569 <xsl:attribute name="unit">h</xsl:attribute>
2570 </period>
2571 </effectiveTime>
2572 </xsl:when>
2573 <xsl:when test="$frequency/a:Value='qam'">
2574 <effectiveTime xsi:type='EIVL' operator='A'>
2575 <event code='ACM'/>
2576 </effectiveTime>
2577 </xsl:when>
2578 <xsl:when test="$frequency/a:Value='qpm'">
2579 <effectiveTime xsi:type='EIVL' operator='A'>
2580 <event code='PCV'/>
2581 </effectiveTime>
2582 </xsl:when>
2583 </xsl:choose>
2584 </xsl:if>
2585 </xsl:template>
2586
2587 <xsl:template name="ccdStatus">
2588 <xsl:param name="ccrStatus"/>
2589
2590 <entryRelationship typeCode="REFR">
2591 <observation classCode="OBS" moodCode="EVN">
2592 <templateId root="2.16.840.1.113883.10.20.1.50"/>
2593 <!-- Problem status observation template -->
2594 <code code="33999-4" codeSystem="2.16.840.1.113883.6.1" displayName="Status"/>
2595 <statusCode code="completed"/>
2596 <xsl:call-template name="ccdCodedValue">
2597 <xsl:with-param name="ccrCodedDescription" select="$ccrStatus"/>
2598 </xsl:call-template>
2599 </observation>
2600 </entryRelationship>
2601 </xsl:template>
2602
2603 <xsl:template name="ccdStatusObservation">
2604 <xsl:param name="status"/>
2605 <xsl:variable name="statusText" select="$status/a:Text"></xsl:variable>
2606 <xsl:choose>
2607 <xsl:when test="$statusText='Active'">
2608 <xsl:call-template name="ccdStatusElement">
2609 <xsl:with-param name="statusCode" select="'55561003'"/>
2610 <xsl:with-param name="statusDisplayName" select="$statusText"/>
2611 </xsl:call-template>
2612 </xsl:when>
2613 <xsl:when test="$statusText='Inactive'">
2614 <xsl:call-template name="ccdStatusElement">
2615 <xsl:with-param name="statusCode" select="'73425007'"/>
2616 <xsl:with-param name="statusDisplayName" select="$statusText"/>
2617 </xsl:call-template>
2618 </xsl:when>
2619 <xsl:when test="$statusText='Chronic'">
2620 <xsl:call-template name="ccdStatusElement">
2621 <xsl:with-param name="statusCode" select="'90734009'"/>
2622 <xsl:with-param name="statusDisplayName" select="$statusText"/>
2623 </xsl:call-template>
2624 </xsl:when>
2625 </xsl:choose>
2626 </xsl:template>
2627
2628 <xsl:template name="ccdStatusProcedure">
2629 <xsl:param name="status"/>
2630 <xsl:variable name="statusText" select="$status/a:Text"></xsl:variable>
2631 <xsl:choose>
2632 <xsl:when test="$statusText='Completed'">
2633 <statusCode code="completed"/>
2634 </xsl:when>
2635 <xsl:when test="$statusText='Active'">
2636 <statusCode code="active"/>
2637 </xsl:when>
2638 <xsl:when test="$statusText='Aborted'">
2639 <statusCode code="aborted"/>
2640 </xsl:when>
2641 <xsl:when test="$statusText='Cancelled' or $statusText='Canceled'">
2642 <statusCode code="cancelled"/>
2643 </xsl:when>
2644 <xsl:otherwise>
2645 <statusCode>
2646 <xsl:attribute name="code">
2647 <xsl:value-of select="$statusText"></xsl:value-of>
2648 </xsl:attribute>
2649 </statusCode>
2650 </xsl:otherwise>
2651 </xsl:choose>
2652 </xsl:template>
2653
2654 <xsl:template name="ccdStatusElement">
2655 <xsl:param name="statusCode"/>
2656 <xsl:param name="statusDisplayName"/>
2657 <value>
2658 <xsl:attribute name="xsi:type">CE</xsl:attribute>
2659 <xsl:attribute name="code">
2660 <xsl:value-of select="$statusCode"></xsl:value-of>
2661 </xsl:attribute>
2662 <xsl:attribute name="codeSystem">2.16.840.1.113883.6.96</xsl:attribute>
2663 <xsl:attribute name="displayName">
2664 <xsl:value-of select="$statusDisplayName"></xsl:value-of>
2665 </xsl:attribute>
2666 </value>
2667 </xsl:template>
2668
2669 <xsl:template name="ccdObservation">
2670 <xsl:param name="ccrTestNode"/>
2671 <xsl:param name="testDate"/>
2672
2673 <component>
2674 <observation classCode="OBS" moodCode="EVN">
2675 <templateId root="2.16.840.1.113883.3.88.11.83.15" assigningAuthorityName="HITSP C83"/>
2676 <templateId root="2.16.840.1.113883.10.20.1.31" assigningAuthorityName="CCD"/>
2677 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13" assigningAuthorityName="IHE PCC"/>
2678
2679 <!-- Result observation template -->
2680
2681 <xsl:call-template name="ccdID">
2682 <xsl:with-param name="ccrObjectID" select="$ccrTestNode/a:CCRDataObjectID"/>
2683 </xsl:call-template>
2684
2685 <!-- <code> -->
2686 <xsl:call-template name="ccdCodedValue">
2687 <xsl:with-param name="ccrCodedDescription" select="$ccrTestNode/a:Description"/>
2688 <xsl:with-param name="nodeName" select="'code'"/>
2689 </xsl:call-template>
2690
2691 <text>
2692 <reference>
2693 <xsl:attribute name="value">
2694 <xsl:text>#</xsl:text>
2695 <xsl:value-of select="$ccrTestNode/a:CCRDataObjectID"/>
2696 </xsl:attribute>
2697 </reference>
2698 </text>
2699
2700 <statusCode code="completed"/>
2701
2702 <!-- <effectiveTime> -->
2703 <xsl:choose>
2704 <xsl:when test="$ccrTestNode/a:DateTime">
2705 <xsl:call-template name="ccdDateTime">
2706 <xsl:with-param name="dt" select="$ccrTestNode/a:DateTime"/>
2707 </xsl:call-template>
2708 </xsl:when>
2709 <xsl:otherwise>
2710 <xsl:call-template name="ccdDateTime">
2711 <xsl:with-param name="dt" select="$testDate"/>
2712 </xsl:call-template>
2713 </xsl:otherwise>
2714 </xsl:choose>
2715
2716 <xsl:choose>
2717 <xsl:when test="$ccrTestNode/a:TestResult[a:Value!='']">
2718 <value xsi:type="PQ">
2719 <xsl:attribute name="value">
2720 <xsl:value-of select="$ccrTestNode/a:TestResult/a:Value"/>
2721 </xsl:attribute>
2722 <xsl:attribute name="unit">
2723 <xsl:value-of select="$ccrTestNode/a:TestResult/a:Units/a:Unit"/>
2724 </xsl:attribute>
2725 </value>
2726 </xsl:when>
2727 <xsl:when test="$ccrTestNode/a:TestResult[a:Description/a:Text!='']">
2728 <value xsi:type="TX">
2729 <xsl:attribute name="value">
2730 <xsl:value-of select="$ccrTestNode/a:TestResult/a:Description/a:Text"/>
2731 </xsl:attribute>
2732 </value>
2733 </xsl:when>
2734 </xsl:choose>
2735
2736 <xsl:if test="$ccrTestNode/a:Flag">
2737 <xsl:call-template name="ccdCodedValue">
2738 <xsl:with-param name="ccrCodedDescription" select="$ccrTestNode/a:Flag"/>
2739 <xsl:with-param name="nodeName" select="'interpretationCode'"/>
2740 <xsl:with-param name="domain" select="'ObservationInterpretation'"/>
2741 </xsl:call-template>
2742 </xsl:if>
2743
2744 <xsl:if test="$ccrTestNode/a:NormalResult">
2745 <referenceRange>
2746 <xsl:if test="$ccrTestNode/a:NormalResult/a:Normal/a:Description/a:Text">
2747 <observationRange>
2748 <text>
2749 <xsl:value-of select="$ccrTestNode/a:NormalResult/a:Normal/a:Description/a:Text"/>
2750 </text>
2751 </observationRange>
2752 </xsl:if>
2753 </referenceRange>
2754 </xsl:if>
2755
2756 </observation>
2757 </component>
2758
2759 </xsl:template>
2760</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.