hqmf2js 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/.gitignore +10 -0
  2. data/.travis.yml +17 -0
  3. data/Gemfile +41 -0
  4. data/Gemfile.lock +202 -0
  5. data/README.md +7 -0
  6. data/Rakefile +22 -0
  7. data/VERSION +1 -0
  8. data/app/assets/javascripts/hqmf_util.js.coffee +776 -0
  9. data/app/assets/javascripts/logging_utils.js.coffee +150 -0
  10. data/app/assets/javascripts/patient_api_extension.js.coffee +36 -0
  11. data/app/assets/javascripts/specifics.js.coffee +462 -0
  12. data/bin/hqmf2js.rb +25 -0
  13. data/config/warble.rb +144 -0
  14. data/hqmf2js.gemspec +20 -0
  15. data/lib/config/codes.xml +1935 -0
  16. data/lib/generator/characteristic.js.erb +19 -0
  17. data/lib/generator/codes_to_json.rb +81 -0
  18. data/lib/generator/converter.rb +60 -0
  19. data/lib/generator/data_criteria.js.erb +47 -0
  20. data/lib/generator/derived_data.js.erb +5 -0
  21. data/lib/generator/js.rb +263 -0
  22. data/lib/generator/measure_period.js.erb +18 -0
  23. data/lib/generator/patient_data.js.erb +22 -0
  24. data/lib/generator/population_criteria.js.erb +4 -0
  25. data/lib/generator/precondition.js.erb +14 -0
  26. data/lib/hqmf2js.rb +20 -0
  27. data/lib/hquery/engine.rb +4 -0
  28. data/lib/tasks/codes.rake +12 -0
  29. data/lib/tasks/coffee.rake +15 -0
  30. data/lib/tasks/convert.rake +47 -0
  31. data/lib/tasks/cover_me.rake +8 -0
  32. data/test/fixtures/NQF59New.xml +1047 -0
  33. data/test/fixtures/codes/codes.xls +0 -0
  34. data/test/fixtures/codes/codes.xml +1941 -0
  35. data/test/fixtures/i2b2.xml +305 -0
  36. data/test/fixtures/invalid/missing_id.xml +18 -0
  37. data/test/fixtures/invalid/unknown_criteria_type.xml +16 -0
  38. data/test/fixtures/invalid/unknown_demographic_entry.xml +16 -0
  39. data/test/fixtures/invalid/unknown_population_type.xml +9 -0
  40. data/test/fixtures/invalid/unknown_value_type.xml +18 -0
  41. data/test/fixtures/js/59New.js +366 -0
  42. data/test/fixtures/js/test1.js +356 -0
  43. data/test/fixtures/js/test2.js +366 -0
  44. data/test/fixtures/json/0043.json +6 -0
  45. data/test/fixtures/json/0043_hqmf1.json +1 -0
  46. data/test/fixtures/json/0043_hqmf2.json +172 -0
  47. data/test/fixtures/json/59New.json +1352 -0
  48. data/test/fixtures/patient_api.js +2823 -0
  49. data/test/fixtures/patients/francis_drake.json +1180 -0
  50. data/test/fixtures/patients/larry_vanderman.json +645 -0
  51. data/test/test_helper.rb +58 -0
  52. data/test/unit/codes_to_json_test.rb +38 -0
  53. data/test/unit/effective_date_test.rb +48 -0
  54. data/test/unit/hqmf_from_json_javascript_test.rb +108 -0
  55. data/test/unit/hqmf_javascript_test.rb +175 -0
  56. data/test/unit/library_function_test.rb +553 -0
  57. data/test/unit/specifics_test.rb +757 -0
  58. metadata +183 -0
@@ -0,0 +1,1047 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <QualityMeasureDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+ xsi:schemaLocation="urn:hl7-org:v3 ../../../hqmf-parser/test/fixtures/2.0/schema/EMeasure.xsd"
4
+ xmlns="urn:hl7-org:v3"
5
+ classCode="DOC">
6
+ <typeId root="2.16.840.1.113883.1.3" extension="POQM_HD00001"/>
7
+ <id root="0" extension="foo"/>
8
+ <code code="57024-2" codeSystem="2.16.840.1.113883.6.1"/>
9
+ <title value="Sample Quality Measure Document"/>
10
+ <text value="This is the measure description."/>
11
+ <statusCode code="completed"/>
12
+ <setId root="0"/>
13
+ <versionNumber value="1"/>
14
+ <author typeCode="AUT" contextControlCode="OP">
15
+ <responsibleParty classCode="ASSIGNED"/>
16
+ </author>
17
+ <custodian typeCode="CST">
18
+ <responsibleParty classCode="ASSIGNED"/>
19
+ </custodian>
20
+ <controlVariable>
21
+ <measurePeriod>
22
+ <code code="MSRTP" codeSystem="2.16.840.1.113883.3.560">
23
+ <displayName value="Measurement period"/>
24
+ </code>
25
+ <value>
26
+ <low value="20110101"/>
27
+ <high value="20111231"/>
28
+ </value>
29
+ </measurePeriod>
30
+ </controlVariable>
31
+ <component>
32
+ <measureDescriptionSection>
33
+ <code code="34089-3" codeSystem="2.16.840.1.113883.6.1"/>
34
+ <title value="Measure Description Section"/>
35
+ <text>This is a description of the measure.</text>
36
+ </measureDescriptionSection>
37
+ </component>
38
+ <component>
39
+ <dataCriteriaSection>
40
+ <code code="57025-9" codeSystem="2.16.840.1.113883.6.1"/>
41
+ <title value="Data Criteria Section"/>
42
+ <text>This section describes the data criteria.</text>
43
+ <!-- Define the measure parameters as observations in event mood -->
44
+ <definition>
45
+ <observationDefinition moodCode="DEF">
46
+ <id root="0" extension="Derived"/>
47
+ </observationDefinition>
48
+ </definition>
49
+ <definition>
50
+ <observationDefinition moodCode="DEF">
51
+ <id root="0" extension="Demographics"/>
52
+ </observationDefinition>
53
+ </definition>
54
+ <definition>
55
+ <encounterDefinition moodCode="DEF" classCode="ENC">
56
+ <id root="0" extension="Encounters"/>
57
+ </encounterDefinition>
58
+ </definition>
59
+ <definition>
60
+ <observationDefinition moodCode="DEF">
61
+ <id root="0" extension="Problems"/>
62
+ </observationDefinition>
63
+ </definition>
64
+ <definition>
65
+ <observationDefinition moodCode="DEF">
66
+ <id root="0" extension="Allergies"/>
67
+ </observationDefinition>
68
+ </definition>
69
+ <definition>
70
+ <procedureDefinition moodCode="DEF">
71
+ <id root="0" extension="Procedures"/>
72
+ </procedureDefinition>
73
+ </definition>
74
+ <definition>
75
+ <observationDefinition moodCode="DEF">
76
+ <id root="0" extension="Results"/>
77
+ </observationDefinition>
78
+ </definition>
79
+ <definition>
80
+ <observationDefinition moodCode="DEF">
81
+ <id root="0" extension="Vitals"/>
82
+ </observationDefinition>
83
+ </definition>
84
+ <definition>
85
+ <substanceAdministrationDefinition moodCode="DEF">
86
+ <id root="0" extension="Medications"/>
87
+ </substanceAdministrationDefinition>
88
+ </definition>
89
+ <definition>
90
+ <supplyDefinition moodCode="DEF">
91
+ <id root="0" extension="RX"/>
92
+ </supplyDefinition>
93
+ </definition>
94
+ <entry typeCode="DRIV">
95
+ <observationCriteria moodCode="EVN" classCode="OBS">
96
+ <id>
97
+ <item root="0" extension="birthdateThirtyYearsBeforeMeasurementPeriod"/>
98
+ </id>
99
+ <code code="21112-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC">
100
+ <displayName value="Birthdate"/>
101
+ </code>
102
+ <definition>
103
+ <observationReference moodCode="EVN" classCode="OBS">
104
+ <id root="0" extension="Demographics"/>
105
+ </observationReference>
106
+ </definition>
107
+ <temporallyRelatedInformation typeCode="SBS">
108
+ <pauseQuantity xsi:type="IVL_PQ">
109
+ <low value="30" unit="a"/>
110
+ </pauseQuantity>
111
+ <observationReference moodCode="EVN" classCode="OBS">
112
+ <id root="0" extension="MeasurePeriod"/>
113
+ </observationReference>
114
+ </temporallyRelatedInformation>
115
+ </observationCriteria>
116
+ </entry>
117
+ <entry typeCode="DRIV">
118
+ <observationCriteria moodCode="EVN" classCode="OBS">
119
+ <id>
120
+ <item root="0" extension="birthdateFiftyYearsBeforeMeasurementPeriod"/>
121
+ </id>
122
+ <code code="21112-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC">
123
+ <displayName value="Birthdate"/>
124
+ </code>
125
+ <definition>
126
+ <observationReference moodCode="EVN" classCode="OBS">
127
+ <id root="0" extension="Demographics"/>
128
+ </observationReference>
129
+ </definition>
130
+ <temporallyRelatedInformation typeCode="SBS">
131
+ <pauseQuantity xsi:type="IVL_PQ">
132
+ <low value="50" unit="a"/>
133
+ </pauseQuantity>
134
+ <observationReference moodCode="EVN" classCode="OBS">
135
+ <id root="0" extension="MeasurePeriod"/>
136
+ </observationReference>
137
+ </temporallyRelatedInformation>
138
+ </observationCriteria>
139
+ </entry>
140
+ <entry typeCode="DRIV">
141
+ <observationCriteria moodCode="EVN" classCode="OBS">
142
+ <id>
143
+ <item root="0" extension="ageFiftyBeforeMeasurementPeriod"/>
144
+ </id>
145
+ <code code="424144002" codeSystem="2.16.840.1.113883.6.96">
146
+ <displayName value="Age"/>
147
+ </code>
148
+ <value xsi:type="IVL_PQ">
149
+ <low value="50" unit="a"/>
150
+ </value>
151
+ <definition>
152
+ <observationReference moodCode="EVN" classCode="OBS">
153
+ <id root="0" extension="Demographics"/>
154
+ </observationReference>
155
+ </definition>
156
+ <temporallyRelatedInformation typeCode="SBS">
157
+ <observationReference moodCode="EVN" classCode="OBS">
158
+ <id root="0" extension="MeasurePeriod"/>
159
+ </observationReference>
160
+ </temporallyRelatedInformation>
161
+ </observationCriteria>
162
+ </entry>
163
+ <entry typeCode="DRIV">
164
+ <observationCriteria moodCode="EVN" classCode="OBS">
165
+ <id>
166
+ <item root="0" extension="ageBetween17and64"/>
167
+ </id>
168
+ <code code="424144002" codeSystem="2.16.840.1.113883.6.96"/>
169
+ <value xsi:type="IVL_PQ">
170
+ <low value="17" unit="a"/>
171
+ <high value="64" unit="a"/>
172
+ </value>
173
+ <definition>
174
+ <observationReference moodCode="EVN" classCode="OBS">
175
+ <id root="0" extension="Demographics"/>
176
+ </observationReference>
177
+ </definition>
178
+ </observationCriteria>
179
+ </entry>
180
+ <entry typeCode="DRIV">
181
+ <observationCriteria moodCode="EVN" classCode="OBS">
182
+ <id>
183
+ <item root="0" extension="ageBetween17and21"/>
184
+ </id>
185
+ <code code="424144002" codeSystem="2.16.840.1.113883.6.96"/>
186
+ <value xsi:type="IVL_PQ">
187
+ <low value="17" unit="a"/>
188
+ <high value="21" unit="a"/>
189
+ </value>
190
+ <definition>
191
+ <observationReference moodCode="EVN" classCode="OBS">
192
+ <id root="0" extension="Demographics"/>
193
+ </observationReference>
194
+ </definition>
195
+ </observationCriteria>
196
+ </entry>
197
+ <entry typeCode="DRIV">
198
+ <observationCriteria moodCode="EVN" classCode="OBS">
199
+ <id>
200
+ <item root="0" extension="ageBetween22and29"/>
201
+ </id>
202
+ <code code="424144002" codeSystem="2.16.840.1.113883.6.96"/>
203
+ <value xsi:type="IVL_PQ">
204
+ <low value="22" unit="a"/>
205
+ <high value="29" unit="a"/>
206
+ </value>
207
+ <definition>
208
+ <observationReference moodCode="EVN" classCode="OBS">
209
+ <id root="0" extension="Demographics"/>
210
+ </observationReference>
211
+ </definition>
212
+ </observationCriteria>
213
+ </entry>
214
+ <entry typeCode="DRIV">
215
+ <observationCriteria moodCode="EVN" classCode="OBS">
216
+ <id>
217
+ <item root="0" extension="ageBetween30and39"/>
218
+ </id>
219
+ <code code="424144002" codeSystem="2.16.840.1.113883.6.96"/>
220
+ <value xsi:type="IVL_PQ">
221
+ <low value="30" unit="a"/>
222
+ <high value="39" unit="a"/>
223
+ </value>
224
+ <definition>
225
+ <observationReference moodCode="EVN" classCode="OBS">
226
+ <id root="0" extension="Demographics"/>
227
+ </observationReference>
228
+ </definition>
229
+ </observationCriteria>
230
+ </entry>
231
+ <entry typeCode="DRIV">
232
+ <observationCriteria moodCode="EVN" classCode="OBS">
233
+ <id>
234
+ <item root="0" extension="ageBetween40and49"/>
235
+ </id>
236
+ <code code="424144002" codeSystem="2.16.840.1.113883.6.96">
237
+ <displayName value="Age"></displayName>
238
+ </code>
239
+ <value xsi:type="IVL_PQ">
240
+ <low value="40" unit="a"/>
241
+ <high value="49" unit="a"/>
242
+ </value>
243
+ <definition>
244
+ <observationReference moodCode="EVN" classCode="OBS">
245
+ <id root="0" extension="Demographics"/>
246
+ </observationReference>
247
+ </definition>
248
+ </observationCriteria>
249
+ </entry>
250
+ <entry typeCode="DRIV">
251
+ <observationCriteria moodCode="EVN" classCode="OBS">
252
+ <id>
253
+ <item root="0" extension="ageBetween50and59"/>
254
+ </id>
255
+ <code code="424144002" codeSystem="2.16.840.1.113883.6.96">
256
+ <displayName value="Age"/>
257
+ </code>
258
+ <value xsi:type="IVL_PQ">
259
+ <low value="50" unit="a"/>
260
+ <high value="59" unit="a"/>
261
+ </value>
262
+ <definition>
263
+ <observationReference moodCode="EVN" classCode="OBS">
264
+ <id root="0" extension="Demographics"/>
265
+ </observationReference>
266
+ </definition>
267
+ </observationCriteria>
268
+ </entry>
269
+ <entry typeCode="DRIV">
270
+ <observationCriteria moodCode="EVN" classCode="OBS">
271
+ <id>
272
+ <item root="0" extension="ageBetween60and64"/>
273
+ </id>
274
+ <code code="424144002" codeSystem="2.16.840.1.113883.6.96">
275
+ <displayName value="Age"></displayName>
276
+ </code>
277
+ <value xsi:type="IVL_PQ">
278
+ <low value="60" unit="a"/>
279
+ <high value="64" unit="a"/>
280
+ </value>
281
+ <definition>
282
+ <observationReference moodCode="EVN" classCode="OBS">
283
+ <id root="0" extension="Demographics"/>
284
+ </observationReference>
285
+ </definition>
286
+ </observationCriteria>
287
+ </entry>
288
+ <entry typeCode="DRIV">
289
+ <observationCriteria moodCode="EVN" classCode="OBS">
290
+ <id>
291
+ <item root="0" extension="dummyAge1"/>
292
+ </id>
293
+ <code code="424144002" codeSystem="2.16.840.1.113883.6.96">
294
+ <displayName value="Age"/>
295
+ </code>
296
+ <effectiveTime xsi:type="IVL_TS">
297
+ <low value="20100101"/>
298
+ <high value="20111231"/>
299
+ </effectiveTime>
300
+ <value xsi:type="IVL_PQ">
301
+ <low value="60" unit="a"/>
302
+ <high value="64" unit="a"/>
303
+ </value>
304
+ <definition>
305
+ <observationReference moodCode="EVN" classCode="OBS">
306
+ <id root="0" extension="Demographics"/>
307
+ </observationReference>
308
+ </definition>
309
+ </observationCriteria>
310
+ </entry>
311
+ <entry typeCode="DRIV">
312
+ <observationCriteria moodCode="EVN" classCode="OBS">
313
+ <id>
314
+ <item root="0" extension="dummyAge2"/>
315
+ </id>
316
+ <code code="424144002" codeSystem="2.16.840.1.113883.6.96">
317
+ <displayName value="Age"/>
318
+ </code>
319
+ <effectiveTime xsi:type="IVL_TS">
320
+ <low value="20100101"/>
321
+ </effectiveTime>
322
+ <value xsi:type="IVL_PQ">
323
+ <low value="60" unit="a"/>
324
+ <high value="64" unit="a"/>
325
+ </value>
326
+ <definition>
327
+ <observationReference moodCode="EVN" classCode="OBS">
328
+ <id root="0" extension="Demographics"/>
329
+ </observationReference>
330
+ </definition>
331
+ </observationCriteria>
332
+ </entry>
333
+ <entry typeCode="DRIV">
334
+ <observationCriteria moodCode="EVN" classCode="OBS">
335
+ <id>
336
+ <item root="0" extension="genderMale"/>
337
+ </id>
338
+ <code code="263495000" codeSystem="2.16.840.1.113883.6.96">
339
+ <displayName value="Gender"></displayName>
340
+ </code>
341
+ <value xsi:type="CD" codeSystem="2.16.840.1.113883.5.1"
342
+ code="M"/>
343
+ <definition>
344
+ <observationReference moodCode="EVN" classCode="OBS">
345
+ <id root="0" extension="Demographics"/>
346
+ </observationReference>
347
+ </definition>
348
+ </observationCriteria>
349
+ </entry>
350
+ <entry typeCode="DRIV">
351
+ <observationCriteria moodCode="EVN" classCode="OBS">
352
+ <id>
353
+ <item root="0" extension="genderFemale"/>
354
+ </id>
355
+ <code code="263495000" codeSystem="2.16.840.1.113883.6.96">
356
+ <displayName value="Gender"></displayName>
357
+ </code>
358
+ <value xsi:type="CD" codeSystem="2.16.840.1.113883.5.1"
359
+ code="F"/>
360
+ <definition>
361
+ <observationReference moodCode="EVN" classCode="OBS">
362
+ <id root="0" extension="Demographics"/>
363
+ </observationReference>
364
+ </definition>
365
+ </observationCriteria>
366
+ </entry>
367
+ <entry typeCode="DRIV">
368
+ <encounterCriteria moodCode="EVN" classCode="ENC">
369
+ <id>
370
+ <item root="0" extension="EDorInpatientEncounter"/>
371
+ </id>
372
+ <code valueSet="2.16.840.1.113883.3.464.1.42"/>
373
+ <!-- EDorInpatientEncounterValueSet -->
374
+ <effectiveTime xsi:type="IVL_TS">
375
+ <high nullFlavor="DER">
376
+ <expression value="MeasurePeriod.high.add(new PQ(-2,'a'))"/>
377
+ </high>
378
+ </effectiveTime>
379
+ <definition>
380
+ <encounterReference moodCode="EVN" classCode="ENC">
381
+ <id root="0" extension="Encounters"/>
382
+ </encounterReference>
383
+ </definition>
384
+ </encounterCriteria>
385
+ </entry>
386
+ <entry typeCode="DRIV">
387
+ <encounterCriteria moodCode="EVN" classCode="ENC">
388
+ <id>
389
+ <item root="0" extension="AmbulatoryEncounter"/>
390
+ </id>
391
+ <code valueSet="2.16.840.1.113883.3.464.1.1142"/>
392
+ <!-- AmbulatoryEncounterValueSet -->
393
+ <effectiveTime xsi:type="IVL_TS">
394
+ <high nullFlavor="DER">
395
+ <expression value="MeasurePeriod.high.add(new PQ(-2,'a'))"/>
396
+ </high>
397
+ </effectiveTime>
398
+ <repeatNumber>
399
+ <low value="2"/>
400
+ </repeatNumber>
401
+ <definition>
402
+ <encounterReference moodCode="EVN" classCode="ENC">
403
+ <id root="0" extension="Encounters"/>
404
+ </encounterReference>
405
+ </definition>
406
+ </encounterCriteria>
407
+ </entry>
408
+ <entry typeCode="DRIV">
409
+ <observationCriteria moodCode="EVN" classCode="OBS">
410
+ <id>
411
+ <item extension="DummyLanguage_Arabic" root="2.16.840.1.113883.3.1619.5148.3.20120403.150314222"/>
412
+ </id>
413
+ <code codeSystemName="SNOMED CT" codeSystem="2.16.840.1.113883.6.96" code="102902016">
414
+ <displayName value="Language"/>
415
+ </code>
416
+ <value xsi:type="CD" code="ar" codeSystem="1.0.639.1" codeSystemName="Language">
417
+ <displayName value="Arabic"/>
418
+ </value>
419
+ <definition>
420
+ <observationReference moodCode="EVN" classCode="OBS">
421
+ <id extension="Demographics" root="0"/>
422
+ </observationReference>
423
+ </definition>
424
+ </observationCriteria>
425
+ </entry>
426
+ <entry typeCode="DRIV">
427
+ <observationCriteria moodCode="EVN" classCode="OBS">
428
+ <id>
429
+ <item extension="DummyMaritalStatus_Divorced" root="2.16.840.1.113883.3.1619.5148.3.20120403.150314222"/>
430
+ </id>
431
+ <code codeSystemName="SNOMED CT" codeSystem="2.16.840.1.113883.6.96" code="125680007">
432
+ <displayName value="Marital Status"/>
433
+ </code>
434
+ <value xsi:type="CD" code="D" codeSystem="2.16.840.1.113883.5.2" codeSystemName="MaritalStatus">
435
+ <displayName value="Divorced"/>
436
+ </value>
437
+ <definition>
438
+ <observationReference moodCode="EVN" classCode="OBS">
439
+ <id extension="Demographics" root="0"/>
440
+ </observationReference>
441
+ </definition>
442
+ </observationCriteria>
443
+ </entry>
444
+ <entry typeCode="DRIV">
445
+ <observationCriteria moodCode="EVN" classCode="OBS">
446
+ <id>
447
+ <item extension="DummyRace_Latin_American" root="2.16.840.1.113883.3.1619.5148.3.20120403.150314222"/>
448
+ </id>
449
+ <code codeSystemName="SNOMED CT" codeSystem="2.16.840.1.113883.6.96" code="103579009">
450
+ <displayName value="Race"></displayName>
451
+ </code>
452
+ <value xsi:type="CD" code="2178-2" codeSystem="2.16.840.1.113883.6.238" codeSystemName="Race">
453
+ <displayName value="Latin American"/>
454
+ </value>
455
+ <definition>
456
+ <observationReference moodCode="EVN" classCode="OBS">
457
+ <id extension="Demographics" root="0"/>
458
+ </observationReference>
459
+ </definition>
460
+ </observationCriteria>
461
+ </entry>
462
+ <entry typeCode="DRIV">
463
+ <procedureCriteria moodCode="EVN" classCode="PROC">
464
+ <id>
465
+ <item root="0" extension="DummyProcedureAfterHasDiabetes"/>
466
+ </id>
467
+ <code codeSystemName="SNOMED-CT" codeSystem="2.16.840.1.113883.6.96"
468
+ code="127355002"/>
469
+ <statusCode code="completed"/>
470
+ <effectiveTime xsi:type="IVL_TS">
471
+ <low value="20100101"/>
472
+ <high value="20111231"/>
473
+ </effectiveTime>
474
+ <definition>
475
+ <procedureReference moodCode="EVN" classCode="PROC">
476
+ <id root="0" extension="Procedures"/>
477
+ </procedureReference>
478
+ </definition>
479
+ <temporallyRelatedInformation typeCode="SAS">
480
+ <pauseQuantity>
481
+ <high value="1" unit="a"/>
482
+ </pauseQuantity>
483
+ <observationReference moodCode="EVN" classCode="OBS">
484
+ <id root="0" extension="HasDiabetes"/>
485
+ </observationReference>
486
+ </temporallyRelatedInformation>
487
+ </procedureCriteria>
488
+ </entry>
489
+ <entry typeCode="DRIV">
490
+ <procedureCriteria moodCode="EVN" classCode="PROC">
491
+ <id>
492
+ <item root="0" extension="DummyProcedureBeforeMeasurePeriod"/>
493
+ </id>
494
+ <code codeSystemName="SNOMED-CT" codeSystem="2.16.840.1.113883.6.1"
495
+ code="127355002">
496
+ <displayName value="some kind of procedure"/>
497
+ </code>
498
+ <statusCode code="completed"/>
499
+ <effectiveTime xsi:type="IVL_TS">
500
+ <low value="20100101"/>
501
+ <high value="20111231"/>
502
+ </effectiveTime>
503
+ <definition>
504
+ <procedureReference moodCode="EVN" classCode="PROC">
505
+ <id root="0" extension="Procedures"/>
506
+ </procedureReference>
507
+ </definition>
508
+ <temporallyRelatedInformation typeCode="SBS">
509
+ <observationReference moodCode="EVN" classCode="OBS">
510
+ <id root="0" extension="MeasurePeriod"/>
511
+ </observationReference>
512
+ </temporallyRelatedInformation>
513
+ </procedureCriteria>
514
+ </entry>
515
+ <entry typeCode="DRIV">
516
+ <procedureCriteria moodCode="EVN" classCode="PROC">
517
+ <id>
518
+ <item root="0" extension="DummyProcedureAfterHasDiabetesAndBeforeEncounter"/>
519
+ </id>
520
+ <code codeSystemName="SNOMED-CT" codeSystem="2.16.840.1.113883.6.1"
521
+ code="127355002">
522
+ <displayName value="some kind of procedure"/>
523
+ </code>
524
+ <statusCode code="completed"/>
525
+ <effectiveTime xsi:type="IVL_TS">
526
+ <low value="20100101"/>
527
+ <high value="20111231"/>
528
+ </effectiveTime>
529
+ <definition>
530
+ <procedureReference moodCode="EVN" classCode="PROC">
531
+ <id root="0" extension="Procedures"/>
532
+ </procedureReference>
533
+ </definition>
534
+ <temporallyRelatedInformation typeCode="SAS">
535
+ <pauseQuantity>
536
+ <high value="-1" unit="a"/>
537
+ </pauseQuantity>
538
+ <observationReference moodCode="EVN" classCode="OBS">
539
+ <id root="0" extension="HasDiabetes"/>
540
+ </observationReference>
541
+ </temporallyRelatedInformation>
542
+ <temporallyRelatedInformation typeCode="SBS">
543
+ <encounterReference moodCode="EVN" classCode="ENC">
544
+ <id root="0" extension="AmbulatoryEncounter"/>
545
+ </encounterReference>
546
+ </temporallyRelatedInformation>
547
+ </procedureCriteria>
548
+ </entry>
549
+ <entry typeCode="DRIV">
550
+ <procedureCriteria moodCode="EVN" classCode="PROC">
551
+ <id>
552
+ <item root="0" extension="DummyProcedureAfterHasDiabetesWithCount"/>
553
+ </id>
554
+ <code codeSystemName="SNOMED-CT" codeSystem="2.16.840.1.113883.6.96"
555
+ code="127355002"/>
556
+ <statusCode code="completed"/>
557
+ <effectiveTime xsi:type="IVL_TS">
558
+ <low value="20100101"/>
559
+ <high value="20111231"/>
560
+ </effectiveTime>
561
+ <definition>
562
+ <procedureReference moodCode="EVN" classCode="PROC">
563
+ <id root="0" extension="Procedures"/>
564
+ </procedureReference>
565
+ </definition>
566
+ <temporallyRelatedInformation typeCode="SAS">
567
+ <pauseQuantity>
568
+ <high value="1" unit="a"/>
569
+ </pauseQuantity>
570
+ <observationReference moodCode="EVN" classCode="OBS">
571
+ <id root="0" extension="HasDiabetes"/>
572
+ </observationReference>
573
+ </temporallyRelatedInformation>
574
+ <excerpt typeCode="XCRPT">
575
+ <subsetCode code="SUMMARY"/>
576
+ <procedureCriteria moodCode="EVN" classCode="PROC">
577
+ <repeatNumber>
578
+ <low value="2"/>
579
+ </repeatNumber>
580
+ </procedureCriteria>
581
+ </excerpt>
582
+ </procedureCriteria>
583
+ </entry>
584
+ <entry typeCode="DRIV">
585
+ <observationCriteria moodCode="EVN" classCode="OBS">
586
+ <id>
587
+ <item root="0" extension="anyDiabetes"/>
588
+ </id>
589
+ <definition>
590
+ <observationReference moodCode="EVN" classCode="OBS">
591
+ <id root="0" extension="Derived"/>
592
+ </observationReference>
593
+ </definition>
594
+ <excerpt typeCode="XCRPT">
595
+ <subsetCode code="UNION"/>
596
+ <observationReference moodCode="EVN" classCode="OBS">
597
+ <id root="0" extension="HasDiabetes"/>
598
+ </observationReference>
599
+ <observationReference moodCode="EVN" classCode="OBS">
600
+ <id root="0" extension="HasGestationalDiabetes"/>
601
+ </observationReference>
602
+ <observationReference moodCode="EVN" classCode="OBS">
603
+ <id root="0" extension="HasSteroidInducedDiabetes"/>
604
+ </observationReference>
605
+ </excerpt>
606
+ </observationCriteria>
607
+ </entry>
608
+ <entry typeCode="DRIV">
609
+ <observationCriteria moodCode="EVN" classCode="OBS">
610
+ <id>
611
+ <item root="0" extension="allDiabetes"/>
612
+ </id>
613
+ <definition>
614
+ <observationReference moodCode="EVN" classCode="OBS">
615
+ <id root="0" extension="Derived"/>
616
+ </observationReference>
617
+ </definition>
618
+ <excerpt typeCode="XCRPT">
619
+ <subsetCode code="XPRODUCT"/>
620
+ <observationReference moodCode="EVN" classCode="OBS">
621
+ <id root="0" extension="HasDiabetes"/>
622
+ </observationReference>
623
+ <observationReference moodCode="EVN" classCode="OBS">
624
+ <id root="0" extension="HasGestationalDiabetes"/>
625
+ </observationReference>
626
+ <observationReference moodCode="EVN" classCode="OBS">
627
+ <id root="0" extension="HasSteroidInducedDiabetes"/>
628
+ </observationReference>
629
+ </excerpt>
630
+ </observationCriteria>
631
+ </entry>
632
+ <entry typeCode="DRIV">
633
+ <observationCriteria moodCode="EVN" classCode="OBS">
634
+ <id>
635
+ <item root="0" extension="HasDiabetes"/>
636
+ </id>
637
+ <statusCode code="completed"/>
638
+ <value xsi:type="CD" valueSet="2.16.840.1.113883.3.464.1.37"/>
639
+ <definition>
640
+ <observationReference moodCode="EVN" classCode="OBS">
641
+ <id root="0" extension="Problems"/>
642
+ </observationReference>
643
+ </definition>
644
+ </observationCriteria>
645
+ </entry>
646
+ <entry typeCode="DRIV">
647
+ <observationCriteria moodCode="EVN" classCode="OBS">
648
+ <id>
649
+ <item root="0" extension="HasGestationalDiabetes"/>
650
+ </id>
651
+ <effectiveTime xsi:type="IVL_TS">
652
+ <low nullFlavor="DER">
653
+ <expression value="MeasurePeriod.low"/>
654
+ </low>
655
+ <high nullFlavor="DER">
656
+ <expression value="MeasurePeriod.high"/>
657
+ </high>
658
+ </effectiveTime>
659
+ <value xsi:type="CD" valueSet="2.16.840.1.113883.3.464.1.67"/>
660
+ <definition>
661
+ <observationReference moodCode="EVN" classCode="OBS">
662
+ <id root="0" extension="Problems"/>
663
+ </observationReference>
664
+ </definition>
665
+ </observationCriteria>
666
+ </entry>
667
+ <entry typeCode="DRIV">
668
+ <observationCriteria moodCode="EVN" classCode="OBS">
669
+ <id>
670
+ <item root="0" extension="HasPolycysticOvaries"/>
671
+ </id>
672
+ <effectiveTime xsi:type="IVL_TS">
673
+ <low nullFlavor="DER">
674
+ <expression value="MeasurePeriod.low.add(new PQ(-1,'a'))"/>
675
+ </low>
676
+ <high nullFlavor="DER">
677
+ <expression value="MeasurePeriod.high"/>
678
+ </high>
679
+ </effectiveTime>
680
+ <value xsi:type="CD" valueSet="2.16.840.1.113883.3.464.1.98"/>
681
+ <definition>
682
+ <observationReference moodCode="EVN" classCode="OBS">
683
+ <id root="0" extension="Problems"/>
684
+ </observationReference>
685
+ </definition>
686
+ </observationCriteria>
687
+ </entry>
688
+ <entry typeCode="DRIV">
689
+ <observationCriteria moodCode="EVN" classCode="OBS">
690
+ <id>
691
+ <item root="0" extension="HasSteroidInducedDiabetes"/>
692
+ </id>
693
+ <effectiveTime xsi:type="IVL_TS">
694
+ <low nullFlavor="DER">
695
+ <expression value="MeasurePeriod.low"/>
696
+ </low>
697
+ <high nullFlavor="DER">
698
+ <expression value="MeasurePeriod.high"/>
699
+ </high>
700
+ </effectiveTime>
701
+ <value xsi:type="CD" valueSet="2.16.840.1.113883.3.464.1.113"/>
702
+ <definition>
703
+ <observationReference moodCode="EVN" classCode="OBS">
704
+ <id root="0" extension="Problems"/>
705
+ </observationReference>
706
+ </definition>
707
+ </observationCriteria>
708
+ </entry>
709
+ <entry typeCode="DRIV">
710
+ <observationCriteria moodCode="EVN" classCode="OBS" actionNegationInd="true">
711
+ <id>
712
+ <item root="0" extension="HbA1CNotDone"/>
713
+ </id>
714
+ <code valueSet="2.16.840.1.113883.3.464.1.72"/>
715
+ <statusCode code="completed"/>
716
+ <reasonCode>
717
+ <item valueSet="1.2.3.4"/>
718
+ </reasonCode>
719
+ <definition>
720
+ <observationReference moodCode="EVN" classCode="OBS">
721
+ <id root="0" extension="Results"/>
722
+ </observationReference>
723
+ </definition>
724
+ </observationCriteria>
725
+ </entry>
726
+ <entry typeCode="DRIV">
727
+ <observationCriteria moodCode="EVN" classCode="OBS">
728
+ <id>
729
+ <item root="0" extension="HbA1C"/>
730
+ </id>
731
+ <code valueSet="2.16.840.1.113883.3.464.1.72"/>
732
+ <statusCode code="completed"/>
733
+ <value xsi:type="IVL_PQ">
734
+ <low value="9" unit="%"/>
735
+ </value>
736
+ <definition>
737
+ <observationReference moodCode="EVN" classCode="OBS">
738
+ <id root="0" extension="Results"/>
739
+ </observationReference>
740
+ </definition>
741
+ </observationCriteria>
742
+ </entry>
743
+ <entry typeCode="DRIV">
744
+ <observationCriteria moodCode="EVN" classCode="OBS">
745
+ <id>
746
+ <item root="0" extension="DummyInlineCodedResult"/>
747
+ </id>
748
+ <code valueSet="2.16.840.1.113883.3.464.1.72"/>
749
+ <statusCode code="completed"/>
750
+ <value xsi:type="CD" code="xyzzy" codeSystem="1.2.3.4"/>
751
+ <definition>
752
+ <observationReference moodCode="EVN" classCode="OBS">
753
+ <id root="0" extension="Results"/>
754
+ </observationReference>
755
+ </definition>
756
+ </observationCriteria>
757
+ </entry>
758
+ <entry typeCode="DRIV">
759
+ <observationCriteria moodCode="EVN" classCode="OBS">
760
+ <id>
761
+ <item root="0" extension="DummyExternalCodedResult"/>
762
+ </id>
763
+ <code valueSet="2.16.840.1.113883.3.464.1.72"/>
764
+ <statusCode code="completed"/>
765
+ <value xsi:type="CD" valueSet="1.2.3.4"/>
766
+ <definition>
767
+ <observationReference moodCode="EVN" classCode="OBS">
768
+ <id root="0" extension="Results"/>
769
+ </observationReference>
770
+ </definition>
771
+ </observationCriteria>
772
+ </entry>
773
+ <entry typeCode="DRIV">
774
+ <observationCriteria moodCode="EVN" classCode="OBS">
775
+ <id>
776
+ <item root="0" extension="moreThanTwoHbA1CTests"/>
777
+ </id>
778
+ <code valueSet="2.16.840.1.113883.3.464.1.72"/>
779
+ <statusCode code="completed"/>
780
+ <definition>
781
+ <observationReference moodCode="EVN" classCode="OBS">
782
+ <id root="0" extension="Results"/>
783
+ </observationReference>
784
+ </definition>
785
+ <excerpt typeCode="XCRPT">
786
+ <subsetCode code="COUNT"/>
787
+ <procedureCriteria moodCode="EVN" classCode="PROC">
788
+ <repeatNumber>
789
+ <low value="3"/>
790
+ </repeatNumber>
791
+ </procedureCriteria>
792
+ </excerpt>
793
+ </observationCriteria>
794
+ </entry>
795
+ <entry typeCode="DRIV">
796
+ <observationCriteria moodCode="EVN" classCode="OBS">
797
+ <id>
798
+ <item root="0" extension="moreThanFourHbA1CTests"/>
799
+ </id>
800
+ <code valueSet="2.16.840.1.113883.3.464.1.72"/>
801
+ <statusCode code="completed"/>
802
+ <definition>
803
+ <observationReference moodCode="EVN" classCode="OBS">
804
+ <id root="0" extension="Results"/>
805
+ </observationReference>
806
+ </definition>
807
+ <excerpt typeCode="XCRPT">
808
+ <subsetCode code="COUNT"/>
809
+ <procedureCriteria moodCode="EVN" classCode="PROC">
810
+ <repeatNumber>
811
+ <low value="5"/>
812
+ </repeatNumber>
813
+ </procedureCriteria>
814
+ </excerpt>
815
+ </observationCriteria>
816
+ </entry>
817
+ <entry typeCode="DRIV">
818
+ <substanceAdministrationCriteria moodCode="EVN" classCode="SBADM">
819
+ <id>
820
+ <item root="0" extension="DiabetesMedAdministered"/>
821
+ </id>
822
+ <effectiveTime xsi:type="IVL_TS">
823
+ <low nullFlavor="DER">
824
+ <expression value="MeasurePeriod.low.add(new PQ(-2,'a'))"/>
825
+ </low>
826
+ </effectiveTime>
827
+ <participation typeCode="CSM">
828
+ <role classCode="THER">
829
+ <code valueSet="2.16.840.1.113883.3.464.1.94"/>
830
+ </role>
831
+ </participation>
832
+ <definition>
833
+ <substanceAdministrationReference moodCode="EVN" classCode="SBADM">
834
+ <id root="0" extension="Medications"/>
835
+ </substanceAdministrationReference>
836
+ </definition>
837
+ </substanceAdministrationCriteria>
838
+ </entry>
839
+ <entry typeCode="DRIV">
840
+ <substanceAdministrationCriteria moodCode="INT" classCode="SBADM">
841
+ <id>
842
+ <item root="0" extension="DiabetesMedIntended"/>
843
+ </id>
844
+ <effectiveTime xsi:type="IVL_TS">
845
+ <high nullFlavor="DER">
846
+ <expression value="MeasurePeriod.high.add(new PQ(-2,'a'))"/>
847
+ </high>
848
+ </effectiveTime>
849
+ <participation typeCode="CSM">
850
+ <role classCode="THER">
851
+ <code valueSet="2.16.840.1.113883.3.464.1.94"/>
852
+ </role>
853
+ </participation>
854
+ <definition>
855
+ <substanceAdministrationReference moodCode="EVN" classCode="SBADM">
856
+ <id root="0" extension="Medications"/>
857
+ </substanceAdministrationReference>
858
+ </definition>
859
+ </substanceAdministrationCriteria>
860
+ </entry>
861
+ <entry typeCode="DRIV">
862
+ <supplyCriteria moodCode="EVN" classCode="SPLY">
863
+ <id>
864
+ <item root="0" extension="DiabetesMedSupplied"/>
865
+ </id>
866
+ <effectiveTime xsi:type="IVL_TS">
867
+ <high nullFlavor="DER">
868
+ <expression value="MeasurePeriod.high.add(new PQ(-2,'a'))"/>
869
+ </high>
870
+ </effectiveTime>
871
+ <participation typeCode="PRD">
872
+ <role classCode="THER">
873
+ <code valueSet="2.16.840.1.113883.3.464.1.94"/>
874
+ </role>
875
+ </participation>
876
+ <definition>
877
+ <supplyReference moodCode="EVN" classCode="SPLY">
878
+ <id root="0" extension="RX"/>
879
+ </supplyReference>
880
+ </definition>
881
+ </supplyCriteria>
882
+ </entry>
883
+ <entry typeCode="DRIV">
884
+ <supplyCriteria moodCode="RQO" classCode="SPLY">
885
+ <id>
886
+ <item root="0" extension="DiabetesMedOrdered"/>
887
+ </id>
888
+ <effectiveTime xsi:type="IVL_TS">
889
+ <high nullFlavor="DER">
890
+ <expression value="MeasurePeriod.high.add(new PQ(-2,'a'))"/>
891
+ </high>
892
+ </effectiveTime>
893
+ <participation typeCode="PRD">
894
+ <role classCode="THER">
895
+ <code valueSet="2.16.840.1.113883.3.464.1.94"/>
896
+ </role>
897
+ </participation>
898
+ <definition>
899
+ <supplyReference moodCode="EVN" classCode="SPLY">
900
+ <id root="0" extension="RX"/>
901
+ </supplyReference>
902
+ </definition>
903
+ </supplyCriteria>
904
+ </entry>
905
+ </dataCriteriaSection>
906
+ </component>
907
+ <component>
908
+ <populationCriteriaSection>
909
+ <id root="0" extension="Population1"/>
910
+ <code code="57026-7" codeSystem="2.16.840.1.113883.6.1"/>
911
+ <title value="Population Criteria Section"/>
912
+ <text>This section describes the Initial Patient Population,
913
+ Numerator, Denominator, Denominator Exceptions, and Measure
914
+ Populations</text>
915
+ <component typeCode="COMP">
916
+ <patientPopulationCriteria classCode="OBS" moodCode="EVN">
917
+ <id root="c75181d0-73eb-11de-8a39-0800200c9a66"
918
+ extension="IPP"/>
919
+ <code code="IPP" codeSystem="2.16.840.1.113883.5.1063"
920
+ codeSystemName="HL7 Observation Value">
921
+ <displayName value="Initial Patient Population"/>
922
+ </code>
923
+ <isCriterionInd value="true"/>
924
+ <precondition>
925
+ <observationReference moodCode="EVN" classCode="OBS">
926
+ <id root="0" extension="ageBetween17and64"/>
927
+ </observationReference>
928
+ </precondition>
929
+ </patientPopulationCriteria>
930
+ </component>
931
+ <component typeCode="COMP">
932
+ <denominatorCriteria moodCode="EVN" classCode="OBS">
933
+ <id root="c75181d0-73eb-11de-8a39-0800200c9a66"
934
+ extension="DENOM"/>
935
+ <code xsi:type="CD" code="DENOM" codeSystem="2.16.840.1.113883.5.1063"
936
+ codeSystemName="HL7 Observation Value">
937
+ <displayName value="Denominator"/>
938
+ </code>
939
+ <isCriterionInd value="true"/>
940
+ <precondition>
941
+ <atLeastOneTrue>
942
+ <id/>
943
+ <precondition typeCode="PRCN">
944
+ <allTrue>
945
+ <id/>
946
+ <precondition typeCode="PRCN">
947
+ <observationReference moodCode="EVN" classCode="OBS">
948
+ <id root="0" extension="HasDiabetes"/>
949
+ </observationReference>
950
+ </precondition>
951
+ <precondition typeCode="PRCN">
952
+ <atLeastOneTrue>
953
+ <id/>
954
+ <precondition typeCode="PRCN">
955
+ <encounterReference moodCode="EVN" classCode="ENC">
956
+ <id root="0"
957
+ extension="EDorInpatientEncounter"/>
958
+ </encounterReference>
959
+ </precondition>
960
+ <precondition typeCode="PRCN">
961
+ <encounterReference moodCode="EVN" classCode="ENC">
962
+ <id root="0" extension="AmbulatoryEncounter"/>
963
+ </encounterReference>
964
+ </precondition>
965
+ </atLeastOneTrue>
966
+ </precondition>
967
+ </allTrue>
968
+ </precondition>
969
+ <precondition typeCode="PRCN">
970
+ <substanceAdministrationReference moodCode="EVN" classCode="SBADM">
971
+ <id root="0" extension="DiabetesMedAdministered"/>
972
+ </substanceAdministrationReference>
973
+ </precondition>
974
+ <precondition typeCode="PRCN">
975
+ <substanceAdministrationReference moodCode="INT" classCode="SBADM">
976
+ <id root="0" extension="DiabetesMedIntended"/>
977
+ </substanceAdministrationReference>
978
+ </precondition>
979
+ <precondition typeCode="PRCN">
980
+ <supplyReference moodCode="EVN" classCode="SPLY">
981
+ <id root="0" extension="DiabetesMedSupplied"/>
982
+ </supplyReference>
983
+ </precondition>
984
+ <precondition typeCode="PRCN">
985
+ <supplyReference moodCode="RQO" classCode="SPLY">
986
+ <id root="0" extension="DiabetesMedOrdered"/>
987
+ </supplyReference>
988
+ </precondition>
989
+ </atLeastOneTrue>
990
+ </precondition>
991
+ </denominatorCriteria>
992
+ </component>
993
+ <component typeCode="COMP">
994
+ <numeratorCriteria moodCode="EVN" classCode="OBS">
995
+ <id root="c75181d0-73eb-11de-8a39-0800200c9a66"
996
+ extension="NUMER"/>
997
+ <code code="NUMER" codeSystem="2.16.840.1.113883.5.1063"
998
+ codeSystemName="HL7 Observation Value">
999
+ <displayName value="Numerator"/>
1000
+ </code>
1001
+ <isCriterionInd value="true"/>
1002
+ <precondition>
1003
+ <observationReference moodCode="EVN" classCode="OBS">
1004
+ <id root="0" extension="HbA1C"/>
1005
+ </observationReference>
1006
+ </precondition>
1007
+ </numeratorCriteria>
1008
+ </component>
1009
+ <component typeCode="COMP">
1010
+ <denominatorExceptionCriteria moodCode="EVN" classCode="OBS">
1011
+ <id root="c75181d0-73eb-11de-8a39-0800200c9a66"
1012
+ extension="EXCEP"/>
1013
+ <code code="EXCEP" codeSystem="2.16.840.1.113883.5.1063"
1014
+ codeSystemName="HL7 Observation Value">
1015
+ <displayName value="Denominator exception"/>
1016
+ </code>
1017
+ <isCriterionInd value="true"/>
1018
+ <precondition>
1019
+ <allTrue>
1020
+ <id/>
1021
+ <precondition typeCode="PRCN">
1022
+ <observationReference moodCode="EVN" classCode="OBS">
1023
+ <id root="0" extension="HasPolycysticOvaries"/>
1024
+ </observationReference>
1025
+ </precondition>
1026
+ <precondition typeCode="PRCN">
1027
+ <observationReference moodCode="EVN" classCode="OBS">
1028
+ <id root="0" extension="HasDiabetes"/>
1029
+ </observationReference>
1030
+ </precondition>
1031
+ </allTrue>
1032
+ </precondition>
1033
+ <precondition>
1034
+ <observationReference moodCode="EVN" classCode="OBS">
1035
+ <id root="0" extension="HasSteroidInducedDiabetes"/>
1036
+ </observationReference>
1037
+ </precondition>
1038
+ <precondition>
1039
+ <observationReference moodCode="EVN" classCode="OBS">
1040
+ <id root="0" extension="HasGestationalDiabetes"/>
1041
+ </observationReference>
1042
+ </precondition>
1043
+ </denominatorExceptionCriteria>
1044
+ </component>
1045
+ </populationCriteriaSection>
1046
+ </component>
1047
+ </QualityMeasureDocument>