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

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

generated ccr_qrda.xsl transform

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