hqmf2js 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +15 -0
  2. data/.travis.yml +2 -5
  3. data/Gemfile +6 -4
  4. data/Gemfile.lock +83 -86
  5. data/Rakefile +9 -5
  6. data/app/assets/javascripts/hqmf_util.js.coffee +98 -23
  7. data/app/assets/javascripts/logging_utils.js.coffee +25 -16
  8. data/app/assets/javascripts/patient_api_extension.js.coffee +85 -0
  9. data/app/assets/javascripts/specifics.js.coffee +60 -14
  10. data/hqmf2js.gemspec +8 -8
  11. data/lib/assets/javascripts/libraries/map_reduce_utils.js +130 -0
  12. data/lib/generator/characteristic.js.erb +28 -17
  13. data/lib/generator/codes_to_json.rb +5 -5
  14. data/lib/generator/data_criteria.js.erb +5 -5
  15. data/lib/generator/execution.rb +144 -0
  16. data/lib/generator/js.rb +46 -21
  17. data/lib/generator/observation_criteria.js.erb +1 -1
  18. data/lib/generator/patient_data.js.erb +22 -19
  19. data/lib/generator/population_criteria.js.erb +6 -1
  20. data/lib/generator/precondition.js.erb +5 -7
  21. data/lib/hqmf2js.rb +1 -0
  22. data/test/fixtures/codes/codes.json +54 -0
  23. data/test/fixtures/json/0495.json +1014 -0
  24. data/test/fixtures/json/59New.json +148 -0
  25. data/test/fixtures/json/data_criteria/specific_occurrence.json +27 -0
  26. data/test/fixtures/json/data_criteria/temporals_with_anynonnull.json +27 -0
  27. data/test/fixtures/patients/larry_vanderman.json +4 -4
  28. data/test/simplecov.rb +19 -0
  29. data/test/test_helper.rb +1 -1
  30. data/test/unit/cmd_test.rb +92 -0
  31. data/test/unit/codes_to_json_test.rb +32 -0
  32. data/test/unit/erb_context_test.rb +64 -0
  33. data/test/unit/hqmf_from_json_javascript_test.rb +37 -2
  34. data/test/unit/hqmf_javascript_test.rb +18 -0
  35. data/test/unit/js_object_test.rb +27 -0
  36. data/test/unit/library_function_test.rb +22 -21
  37. data/test/unit/specifics_test.rb +7 -2
  38. metadata +16 -121
  39. data/lib/tasks/cover_me.rake +0 -8
@@ -0,0 +1,1014 @@
1
+ {
2
+ "id": "0495",
3
+ "hqmf_id": "40280381-3D27-5493-013D-4D86B2B36480",
4
+ "hqmf_set_id": "9A033274-3D9B-11E1-8634-00237D5BF174",
5
+ "hqmf_version_number": 2,
6
+ "title": "Median Time from ED Arrival to ED Departure for Admitted ED Patients",
7
+ "description": "Median time from emergency department arrival to time of departure from the emergency room for patients admitted to the facility from the emergency department.",
8
+ "cms_id": "CMS55v2",
9
+ "population_criteria": {
10
+ "IPP": {
11
+ "conjunction?": true,
12
+ "type": "IPP",
13
+ "title": "Initial Patient Population",
14
+ "hqmf_id": "80F48AE9-C427-49EE-BD12-18F9626AA73F",
15
+ "preconditions": [
16
+ {
17
+ "id": 7,
18
+ "preconditions": [
19
+ {
20
+ "id": 3,
21
+ "reference": "OccurrenceAEncounterInpatient2_precondition_3"
22
+ },
23
+ {
24
+ "id": 5,
25
+ "reference": "OccurrenceAEncounterInpatient2_precondition_5"
26
+ }
27
+ ],
28
+ "conjunction_code": "allTrue"
29
+ }
30
+ ]
31
+ },
32
+ "MSRPOPL": {
33
+ "conjunction?": true,
34
+ "type": "MSRPOPL",
35
+ "title": "Measure Population",
36
+ "hqmf_id": "A2E13D5C-2746-4A6D-8B1F-BE54E7CE1D0C",
37
+ "preconditions": [
38
+ {
39
+ "id": 10,
40
+ "preconditions": [
41
+ {
42
+ "id": 8,
43
+ "reference": "OccurrenceAEmergencyDepartmentVisit1_precondition_8"
44
+ }
45
+ ],
46
+ "conjunction_code": "allTrue"
47
+ }
48
+ ]
49
+ },
50
+ "OBSERV": {
51
+ "conjunction?": false,
52
+ "type": "OBSERV",
53
+ "title": "Measure Observation",
54
+ "hqmf_id": "70A15131-4F69-4D76-841F-25DF09F63D51",
55
+ "aggregator": "MEDIAN",
56
+ "preconditions": [
57
+ {
58
+ "id": 17,
59
+ "reference": "GROUP_TIMEDIFF_43"
60
+ }
61
+ ]
62
+ },
63
+ "IPP_1": {
64
+ "conjunction?": true,
65
+ "type": "IPP",
66
+ "title": "Initial Patient Population",
67
+ "hqmf_id": "80F48AE9-C427-49EE-BD12-18F9626AA73F",
68
+ "preconditions": [
69
+ {
70
+ "id": 26,
71
+ "preconditions": [
72
+ {
73
+ "id": 20,
74
+ "reference": "OccurrenceAEmergencyDepartmentVisit1_precondition_20"
75
+ },
76
+ {
77
+ "id": 22,
78
+ "reference": "OccurrenceAEncounterInpatient2_precondition_22"
79
+ },
80
+ {
81
+ "id": 24,
82
+ "reference": "OccurrenceAEncounterInpatient2_precondition_24"
83
+ }
84
+ ],
85
+ "conjunction_code": "allTrue"
86
+ }
87
+ ]
88
+ },
89
+ "IPP_2": {
90
+ "conjunction?": true,
91
+ "type": "IPP",
92
+ "title": "Initial Patient Population",
93
+ "hqmf_id": "80F48AE9-C427-49EE-BD12-18F9626AA73F",
94
+ "preconditions": [
95
+ {
96
+ "id": 34,
97
+ "preconditions": [
98
+ {
99
+ "id": 29,
100
+ "reference": "OccurrenceAEncounterInpatient2_precondition_29"
101
+ },
102
+ {
103
+ "id": 31,
104
+ "reference": "OccurrenceAEncounterInpatient2_precondition_31"
105
+ },
106
+ {
107
+ "id": 33,
108
+ "preconditions": [
109
+ {
110
+ "id": 27,
111
+ "reference": "DiagnosisActivePsychiatricMentalHealthPatient_precondition_27"
112
+ }
113
+ ],
114
+ "conjunction_code": "atLeastOneTrue",
115
+ "negation": true
116
+ }
117
+ ],
118
+ "conjunction_code": "allTrue"
119
+ }
120
+ ]
121
+ },
122
+ "IPP_3": {
123
+ "conjunction?": true,
124
+ "type": "IPP",
125
+ "title": "Initial Patient Population",
126
+ "hqmf_id": "80F48AE9-C427-49EE-BD12-18F9626AA73F",
127
+ "preconditions": [
128
+ {
129
+ "id": 41,
130
+ "preconditions": [
131
+ {
132
+ "id": 35,
133
+ "reference": "DiagnosisActivePsychiatricMentalHealthPatient_precondition_35"
134
+ },
135
+ {
136
+ "id": 37,
137
+ "reference": "OccurrenceAEncounterInpatient2_precondition_37"
138
+ },
139
+ {
140
+ "id": 39,
141
+ "reference": "OccurrenceAEncounterInpatient2_precondition_39"
142
+ }
143
+ ],
144
+ "conjunction_code": "allTrue"
145
+ }
146
+ ]
147
+ }
148
+ },
149
+ "data_criteria": {
150
+ "EncounterPerformedEmergencyDepartmentVisit": {
151
+ "title": "Emergency Department Visit",
152
+ "description": "Encounter, Performed: Emergency Department Visit",
153
+ "standard_category": "encounter",
154
+ "qds_data_type": "encounter",
155
+ "code_list_id": "2.16.840.1.113883.3.117.1.7.1.292",
156
+ "type": "encounters",
157
+ "definition": "encounter",
158
+ "status": "performed",
159
+ "hard_status": false,
160
+ "negation": false,
161
+ "source_data_criteria": "EncounterPerformedEmergencyDepartmentVisit"
162
+ },
163
+ "EncounterPerformedEncounterInpatient": {
164
+ "title": "Encounter Inpatient",
165
+ "description": "Encounter, Performed: Encounter Inpatient",
166
+ "standard_category": "encounter",
167
+ "qds_data_type": "encounter",
168
+ "code_list_id": "2.16.840.1.113883.3.666.5.307",
169
+ "type": "encounters",
170
+ "definition": "encounter",
171
+ "status": "performed",
172
+ "hard_status": false,
173
+ "negation": false,
174
+ "source_data_criteria": "EncounterPerformedEncounterInpatient"
175
+ },
176
+ "OccurrenceAEmergencyDepartmentVisit1": {
177
+ "title": "Emergency Department Visit",
178
+ "description": "Encounter, Performed: Emergency Department Visit",
179
+ "standard_category": "encounter",
180
+ "qds_data_type": "encounter",
181
+ "code_list_id": "2.16.840.1.113883.3.117.1.7.1.292",
182
+ "type": "encounters",
183
+ "definition": "encounter",
184
+ "status": "performed",
185
+ "hard_status": false,
186
+ "negation": false,
187
+ "specific_occurrence": "A",
188
+ "specific_occurrence_const": "ENCOUNTER_PERFORMED_EMERGENCY_DEPARTMENT_VISIT",
189
+ "source_data_criteria": "OccurrenceAEmergencyDepartmentVisit1"
190
+ },
191
+ "OccurrenceAEncounterInpatient2": {
192
+ "title": "Encounter Inpatient",
193
+ "description": "Encounter, Performed: Encounter Inpatient",
194
+ "standard_category": "encounter",
195
+ "qds_data_type": "encounter",
196
+ "code_list_id": "2.16.840.1.113883.3.666.5.307",
197
+ "type": "encounters",
198
+ "definition": "encounter",
199
+ "status": "performed",
200
+ "hard_status": false,
201
+ "negation": false,
202
+ "specific_occurrence": "A",
203
+ "specific_occurrence_const": "ENCOUNTER_PERFORMED_ENCOUNTER_INPATIENT",
204
+ "source_data_criteria": "OccurrenceAEncounterInpatient2"
205
+ },
206
+ "PatientCharacteristicSexOncAdministrativeSex": {
207
+ "title": "ONC Administrative Sex",
208
+ "description": "Patient Characteristic Sex: ONC Administrative Sex",
209
+ "standard_category": "individual_characteristic",
210
+ "qds_data_type": "individual_characteristic",
211
+ "code_list_id": "2.16.840.1.113762.1.4.1",
212
+ "property": "gender",
213
+ "type": "characteristic",
214
+ "definition": "patient_characteristic_gender",
215
+ "hard_status": false,
216
+ "negation": false,
217
+ "source_data_criteria": "PatientCharacteristicSexOncAdministrativeSex",
218
+ "value": {
219
+ "type": "CD",
220
+ "system": "Administrative Sex",
221
+ "code": "F"
222
+ }
223
+ },
224
+ "PatientCharacteristicRaceRace": {
225
+ "title": "Race",
226
+ "description": "Patient Characteristic Race: Race",
227
+ "standard_category": "individual_characteristic",
228
+ "qds_data_type": "individual_characteristic",
229
+ "code_list_id": "2.16.840.1.114222.4.11.836",
230
+ "property": "race",
231
+ "type": "characteristic",
232
+ "definition": "patient_characteristic_race",
233
+ "hard_status": false,
234
+ "negation": false,
235
+ "source_data_criteria": "PatientCharacteristicRaceRace",
236
+ "inline_code_list": {
237
+ "CDC Race": [
238
+ "1002-5",
239
+ "2028-9",
240
+ "2054-5",
241
+ "2076-8",
242
+ "2106-3",
243
+ "2131-1"
244
+ ]
245
+ }
246
+ },
247
+ "PatientCharacteristicEthnicityEthnicity": {
248
+ "title": "Ethnicity",
249
+ "description": "Patient Characteristic Ethnicity: Ethnicity",
250
+ "standard_category": "individual_characteristic",
251
+ "qds_data_type": "individual_characteristic",
252
+ "code_list_id": "2.16.840.1.114222.4.11.837",
253
+ "property": "ethnicity",
254
+ "type": "characteristic",
255
+ "definition": "patient_characteristic_ethnicity",
256
+ "hard_status": false,
257
+ "negation": false,
258
+ "source_data_criteria": "PatientCharacteristicEthnicityEthnicity",
259
+ "inline_code_list": {
260
+ "CDC Race": [
261
+ "2135-2",
262
+ "2186-5"
263
+ ]
264
+ }
265
+ },
266
+ "PatientCharacteristicPayerPayer": {
267
+ "title": "Payer",
268
+ "description": "Patient Characteristic Payer: Payer",
269
+ "standard_category": "individual_characteristic",
270
+ "qds_data_type": "individual_characteristic",
271
+ "code_list_id": "2.16.840.1.114222.4.11.3591",
272
+ "property": "payer",
273
+ "type": "characteristic",
274
+ "definition": "patient_characteristic_payer",
275
+ "hard_status": false,
276
+ "negation": false,
277
+ "source_data_criteria": "PatientCharacteristicPayerPayer",
278
+ "inline_code_list": {
279
+ "SOP": []
280
+ }
281
+ },
282
+ "OccurrenceAEncounterInpatient2_precondition_3": {
283
+ "title": "Encounter Inpatient",
284
+ "description": "Encounter, Performed: Encounter Inpatient",
285
+ "standard_category": "encounter",
286
+ "qds_data_type": "encounter",
287
+ "code_list_id": "2.16.840.1.113883.3.666.5.307",
288
+ "type": "encounters",
289
+ "definition": "encounter",
290
+ "status": "performed",
291
+ "hard_status": false,
292
+ "negation": false,
293
+ "specific_occurrence": "A",
294
+ "specific_occurrence_const": "ENCOUNTER_PERFORMED_ENCOUNTER_INPATIENT",
295
+ "source_data_criteria": "OccurrenceAEncounterInpatient2",
296
+ "field_values": {
297
+ "LENGTH_OF_STAY": {
298
+ "type": "IVL_PQ",
299
+ "high": {
300
+ "type": "PQ",
301
+ "unit": "d",
302
+ "value": "120",
303
+ "inclusive?": true,
304
+ "derived?": false
305
+ }
306
+ }
307
+ }
308
+ },
309
+ "OccurrenceAEncounterInpatient2_precondition_5": {
310
+ "title": "Encounter Inpatient",
311
+ "description": "Encounter, Performed: Encounter Inpatient",
312
+ "standard_category": "encounter",
313
+ "qds_data_type": "encounter",
314
+ "code_list_id": "2.16.840.1.113883.3.666.5.307",
315
+ "type": "encounters",
316
+ "definition": "encounter",
317
+ "status": "performed",
318
+ "hard_status": false,
319
+ "negation": false,
320
+ "specific_occurrence": "A",
321
+ "specific_occurrence_const": "ENCOUNTER_PERFORMED_ENCOUNTER_INPATIENT",
322
+ "source_data_criteria": "OccurrenceAEncounterInpatient2",
323
+ "field_values": {
324
+ "DISCHARGE_DATETIME": {
325
+ "type": "ANYNonNull"
326
+ }
327
+ },
328
+ "temporal_references": [
329
+ {
330
+ "type": "DURING",
331
+ "reference": "MeasurePeriod"
332
+ }
333
+ ]
334
+ },
335
+ "OccurrenceAEmergencyDepartmentVisit1_precondition_8": {
336
+ "title": "Emergency Department Visit",
337
+ "description": "Encounter, Performed: Emergency Department Visit",
338
+ "standard_category": "encounter",
339
+ "qds_data_type": "encounter",
340
+ "code_list_id": "2.16.840.1.113883.3.117.1.7.1.292",
341
+ "type": "encounters",
342
+ "definition": "encounter",
343
+ "status": "performed",
344
+ "hard_status": false,
345
+ "negation": false,
346
+ "specific_occurrence": "A",
347
+ "specific_occurrence_const": "ENCOUNTER_PERFORMED_EMERGENCY_DEPARTMENT_VISIT",
348
+ "source_data_criteria": "OccurrenceAEmergencyDepartmentVisit1",
349
+ "temporal_references": [
350
+ {
351
+ "type": "EBS",
352
+ "reference": "OccurrenceAEncounterInpatient2",
353
+ "range": {
354
+ "type": "IVL_PQ",
355
+ "high": {
356
+ "type": "PQ",
357
+ "unit": "h",
358
+ "value": "1",
359
+ "inclusive?": true,
360
+ "derived?": false
361
+ }
362
+ }
363
+ }
364
+ ]
365
+ },
366
+ "OccurrenceAEmergencyDepartmentVisit1_precondition_11": {
367
+ "title": "Emergency Department Visit",
368
+ "description": "Encounter, Performed: Emergency Department Visit",
369
+ "standard_category": "encounter",
370
+ "qds_data_type": "encounter",
371
+ "code_list_id": "2.16.840.1.113883.3.117.1.7.1.292",
372
+ "type": "encounters",
373
+ "definition": "encounter",
374
+ "status": "performed",
375
+ "hard_status": false,
376
+ "negation": false,
377
+ "specific_occurrence": "A",
378
+ "specific_occurrence_const": "ENCOUNTER_PERFORMED_EMERGENCY_DEPARTMENT_VISIT",
379
+ "source_data_criteria": "OccurrenceAEmergencyDepartmentVisit1",
380
+ "field_values": {
381
+ "FACILITY_LOCATION_ARRIVAL_DATETIME": null
382
+ }
383
+ },
384
+ "OccurrenceAEmergencyDepartmentVisit1_precondition_13": {
385
+ "title": "Emergency Department Visit",
386
+ "description": "Encounter, Performed: Emergency Department Visit",
387
+ "standard_category": "encounter",
388
+ "qds_data_type": "encounter",
389
+ "code_list_id": "2.16.840.1.113883.3.117.1.7.1.292",
390
+ "type": "encounters",
391
+ "definition": "encounter",
392
+ "status": "performed",
393
+ "hard_status": false,
394
+ "negation": false,
395
+ "specific_occurrence": "A",
396
+ "specific_occurrence_const": "ENCOUNTER_PERFORMED_EMERGENCY_DEPARTMENT_VISIT",
397
+ "source_data_criteria": "OccurrenceAEmergencyDepartmentVisit1",
398
+ "field_values": {
399
+ "FACILITY_LOCATION_DEPARTURE_DATETIME": null
400
+ }
401
+ },
402
+ "GROUP_TIMEDIFF_43": {
403
+ "title": "GROUP_TIMEDIFF_43",
404
+ "description": "",
405
+ "standard_category": "",
406
+ "qds_data_type": "",
407
+ "children_criteria": [
408
+ "OccurrenceAEmergencyDepartmentVisit1_precondition_11",
409
+ "OccurrenceAEmergencyDepartmentVisit1_precondition_13"
410
+ ],
411
+ "derivation_operator": "XPRODUCT",
412
+ "type": "derived",
413
+ "definition": "derived",
414
+ "hard_status": false,
415
+ "negation": false,
416
+ "source_data_criteria": "GROUP_TIMEDIFF_43",
417
+ "subset_operators": [
418
+ {
419
+ "type": "TIMEDIFF",
420
+ "value": {
421
+ "type": "ANYNonNull"
422
+ }
423
+ }
424
+ ]
425
+ },
426
+ "OccurrenceAEmergencyDepartmentVisit1_precondition_20": {
427
+ "title": "Emergency Department Visit",
428
+ "description": "Encounter, Performed: Emergency Department Visit",
429
+ "standard_category": "encounter",
430
+ "qds_data_type": "encounter",
431
+ "code_list_id": "2.16.840.1.113883.3.117.1.7.1.292",
432
+ "type": "encounters",
433
+ "definition": "encounter",
434
+ "status": "performed",
435
+ "hard_status": false,
436
+ "negation": false,
437
+ "specific_occurrence": "A",
438
+ "specific_occurrence_const": "ENCOUNTER_PERFORMED_EMERGENCY_DEPARTMENT_VISIT",
439
+ "source_data_criteria": "OccurrenceAEmergencyDepartmentVisit1",
440
+ "temporal_references": [
441
+ {
442
+ "type": "EBS",
443
+ "reference": "OccurrenceAEncounterInpatient2",
444
+ "range": {
445
+ "type": "IVL_PQ",
446
+ "high": {
447
+ "type": "PQ",
448
+ "unit": "h",
449
+ "value": "1",
450
+ "inclusive?": true,
451
+ "derived?": false
452
+ }
453
+ }
454
+ }
455
+ ]
456
+ },
457
+ "OccurrenceAEncounterInpatient2_precondition_22": {
458
+ "title": "Encounter Inpatient",
459
+ "description": "Encounter, Performed: Encounter Inpatient",
460
+ "standard_category": "encounter",
461
+ "qds_data_type": "encounter",
462
+ "code_list_id": "2.16.840.1.113883.3.666.5.307",
463
+ "type": "encounters",
464
+ "definition": "encounter",
465
+ "status": "performed",
466
+ "hard_status": false,
467
+ "negation": false,
468
+ "specific_occurrence": "A",
469
+ "specific_occurrence_const": "ENCOUNTER_PERFORMED_ENCOUNTER_INPATIENT",
470
+ "source_data_criteria": "OccurrenceAEncounterInpatient2",
471
+ "field_values": {
472
+ "LENGTH_OF_STAY": {
473
+ "type": "IVL_PQ",
474
+ "high": {
475
+ "type": "PQ",
476
+ "unit": "d",
477
+ "value": "120",
478
+ "inclusive?": true,
479
+ "derived?": false
480
+ }
481
+ }
482
+ }
483
+ },
484
+ "OccurrenceAEncounterInpatient2_precondition_24": {
485
+ "title": "Encounter Inpatient",
486
+ "description": "Encounter, Performed: Encounter Inpatient",
487
+ "standard_category": "encounter",
488
+ "qds_data_type": "encounter",
489
+ "code_list_id": "2.16.840.1.113883.3.666.5.307",
490
+ "type": "encounters",
491
+ "definition": "encounter",
492
+ "status": "performed",
493
+ "hard_status": false,
494
+ "negation": false,
495
+ "specific_occurrence": "A",
496
+ "specific_occurrence_const": "ENCOUNTER_PERFORMED_ENCOUNTER_INPATIENT",
497
+ "source_data_criteria": "OccurrenceAEncounterInpatient2",
498
+ "field_values": {
499
+ "DISCHARGE_DATETIME": {
500
+ "type": "ANYNonNull"
501
+ }
502
+ },
503
+ "temporal_references": [
504
+ {
505
+ "type": "DURING",
506
+ "reference": "MeasurePeriod"
507
+ }
508
+ ]
509
+ },
510
+ "OccurrenceAEncounterInpatient2_precondition_29": {
511
+ "title": "Encounter Inpatient",
512
+ "description": "Encounter, Performed: Encounter Inpatient",
513
+ "standard_category": "encounter",
514
+ "qds_data_type": "encounter",
515
+ "code_list_id": "2.16.840.1.113883.3.666.5.307",
516
+ "type": "encounters",
517
+ "definition": "encounter",
518
+ "status": "performed",
519
+ "hard_status": false,
520
+ "negation": false,
521
+ "specific_occurrence": "A",
522
+ "specific_occurrence_const": "ENCOUNTER_PERFORMED_ENCOUNTER_INPATIENT",
523
+ "source_data_criteria": "OccurrenceAEncounterInpatient2",
524
+ "field_values": {
525
+ "LENGTH_OF_STAY": {
526
+ "type": "IVL_PQ",
527
+ "high": {
528
+ "type": "PQ",
529
+ "unit": "d",
530
+ "value": "120",
531
+ "inclusive?": true,
532
+ "derived?": false
533
+ }
534
+ }
535
+ }
536
+ },
537
+ "OccurrenceAEncounterInpatient2_precondition_31": {
538
+ "title": "Encounter Inpatient",
539
+ "description": "Encounter, Performed: Encounter Inpatient",
540
+ "standard_category": "encounter",
541
+ "qds_data_type": "encounter",
542
+ "code_list_id": "2.16.840.1.113883.3.666.5.307",
543
+ "type": "encounters",
544
+ "definition": "encounter",
545
+ "status": "performed",
546
+ "hard_status": false,
547
+ "negation": false,
548
+ "specific_occurrence": "A",
549
+ "specific_occurrence_const": "ENCOUNTER_PERFORMED_ENCOUNTER_INPATIENT",
550
+ "source_data_criteria": "OccurrenceAEncounterInpatient2",
551
+ "field_values": {
552
+ "DISCHARGE_DATETIME": {
553
+ "type": "ANYNonNull"
554
+ }
555
+ },
556
+ "temporal_references": [
557
+ {
558
+ "type": "DURING",
559
+ "reference": "MeasurePeriod"
560
+ }
561
+ ]
562
+ },
563
+ "DiagnosisActivePsychiatricMentalHealthPatient_precondition_27": {
564
+ "title": "Psychiatric/Mental Health Patient",
565
+ "description": "Diagnosis, Active: Psychiatric/Mental Health Patient",
566
+ "standard_category": "diagnosis_condition_problem",
567
+ "qds_data_type": "diagnosis_active",
568
+ "code_list_id": "2.16.840.1.113883.3.117.1.7.1.299",
569
+ "type": "conditions",
570
+ "definition": "diagnosis",
571
+ "status": "active",
572
+ "hard_status": false,
573
+ "negation": false,
574
+ "source_data_criteria": "DiagnosisActivePsychiatricMentalHealthPatient",
575
+ "field_values": {
576
+ "ORDINAL": {
577
+ "type": "CD",
578
+ "code_list_id": "2.16.840.1.113883.3.117.2.7.1.14",
579
+ "title": "Principal Diagnosis"
580
+ }
581
+ },
582
+ "temporal_references": [
583
+ {
584
+ "type": "SDU",
585
+ "reference": "OccurrenceAEmergencyDepartmentVisit1"
586
+ }
587
+ ]
588
+ },
589
+ "DiagnosisActivePsychiatricMentalHealthPatient_precondition_35": {
590
+ "title": "Psychiatric/Mental Health Patient",
591
+ "description": "Diagnosis, Active: Psychiatric/Mental Health Patient",
592
+ "standard_category": "diagnosis_condition_problem",
593
+ "qds_data_type": "diagnosis_active",
594
+ "code_list_id": "2.16.840.1.113883.3.117.1.7.1.299",
595
+ "type": "conditions",
596
+ "definition": "diagnosis",
597
+ "status": "active",
598
+ "hard_status": false,
599
+ "negation": false,
600
+ "source_data_criteria": "DiagnosisActivePsychiatricMentalHealthPatient",
601
+ "field_values": {
602
+ "ORDINAL": {
603
+ "type": "CD",
604
+ "code_list_id": "2.16.840.1.113883.3.117.2.7.1.14",
605
+ "title": "Principal Diagnosis"
606
+ }
607
+ },
608
+ "temporal_references": [
609
+ {
610
+ "type": "SDU",
611
+ "reference": "OccurrenceAEmergencyDepartmentVisit1"
612
+ }
613
+ ]
614
+ },
615
+ "OccurrenceAEncounterInpatient2_precondition_37": {
616
+ "title": "Encounter Inpatient",
617
+ "description": "Encounter, Performed: Encounter Inpatient",
618
+ "standard_category": "encounter",
619
+ "qds_data_type": "encounter",
620
+ "code_list_id": "2.16.840.1.113883.3.666.5.307",
621
+ "type": "encounters",
622
+ "definition": "encounter",
623
+ "status": "performed",
624
+ "hard_status": false,
625
+ "negation": false,
626
+ "specific_occurrence": "A",
627
+ "specific_occurrence_const": "ENCOUNTER_PERFORMED_ENCOUNTER_INPATIENT",
628
+ "source_data_criteria": "OccurrenceAEncounterInpatient2",
629
+ "field_values": {
630
+ "LENGTH_OF_STAY": {
631
+ "type": "IVL_PQ",
632
+ "high": {
633
+ "type": "PQ",
634
+ "unit": "d",
635
+ "value": "120",
636
+ "inclusive?": true,
637
+ "derived?": false
638
+ }
639
+ }
640
+ }
641
+ },
642
+ "OccurrenceAEncounterInpatient2_precondition_39": {
643
+ "title": "Encounter Inpatient",
644
+ "description": "Encounter, Performed: Encounter Inpatient",
645
+ "standard_category": "encounter",
646
+ "qds_data_type": "encounter",
647
+ "code_list_id": "2.16.840.1.113883.3.666.5.307",
648
+ "type": "encounters",
649
+ "definition": "encounter",
650
+ "status": "performed",
651
+ "hard_status": false,
652
+ "negation": false,
653
+ "specific_occurrence": "A",
654
+ "specific_occurrence_const": "ENCOUNTER_PERFORMED_ENCOUNTER_INPATIENT",
655
+ "source_data_criteria": "OccurrenceAEncounterInpatient2",
656
+ "field_values": {
657
+ "DISCHARGE_DATETIME": {
658
+ "type": "ANYNonNull"
659
+ }
660
+ },
661
+ "temporal_references": [
662
+ {
663
+ "type": "DURING",
664
+ "reference": "MeasurePeriod"
665
+ }
666
+ ]
667
+ }
668
+ },
669
+ "source_data_criteria": {
670
+ "EncounterPerformedEmergencyDepartmentVisit": {
671
+ "title": "Emergency Department Visit",
672
+ "description": "Encounter, Performed: Emergency Department Visit",
673
+ "standard_category": "encounter",
674
+ "qds_data_type": "encounter",
675
+ "code_list_id": "2.16.840.1.113883.3.117.1.7.1.292",
676
+ "type": "encounters",
677
+ "definition": "encounter",
678
+ "status": "performed",
679
+ "hard_status": false,
680
+ "negation": false,
681
+ "source_data_criteria": "EncounterPerformedEmergencyDepartmentVisit"
682
+ },
683
+ "DiagnosisActivePsychiatricMentalHealthPatient": {
684
+ "title": "Psychiatric/Mental Health Patient",
685
+ "description": "Diagnosis, Active: Psychiatric/Mental Health Patient",
686
+ "standard_category": "diagnosis_condition_problem",
687
+ "qds_data_type": "diagnosis_active",
688
+ "code_list_id": "2.16.840.1.113883.3.117.1.7.1.299",
689
+ "type": "conditions",
690
+ "definition": "diagnosis",
691
+ "status": "active",
692
+ "hard_status": false,
693
+ "negation": false,
694
+ "source_data_criteria": "DiagnosisActivePsychiatricMentalHealthPatient"
695
+ },
696
+ "EncounterPerformedEncounterInpatient": {
697
+ "title": "Encounter Inpatient",
698
+ "description": "Encounter, Performed: Encounter Inpatient",
699
+ "standard_category": "encounter",
700
+ "qds_data_type": "encounter",
701
+ "code_list_id": "2.16.840.1.113883.3.666.5.307",
702
+ "type": "encounters",
703
+ "definition": "encounter",
704
+ "status": "performed",
705
+ "hard_status": false,
706
+ "negation": false,
707
+ "source_data_criteria": "EncounterPerformedEncounterInpatient"
708
+ },
709
+ "OccurrenceAEmergencyDepartmentVisit1": {
710
+ "title": "Emergency Department Visit",
711
+ "description": "Encounter, Performed: Emergency Department Visit",
712
+ "standard_category": "encounter",
713
+ "qds_data_type": "encounter",
714
+ "code_list_id": "2.16.840.1.113883.3.117.1.7.1.292",
715
+ "type": "encounters",
716
+ "definition": "encounter",
717
+ "status": "performed",
718
+ "hard_status": false,
719
+ "negation": false,
720
+ "specific_occurrence": "A",
721
+ "specific_occurrence_const": "ENCOUNTER_PERFORMED_EMERGENCY_DEPARTMENT_VISIT",
722
+ "source_data_criteria": "OccurrenceAEmergencyDepartmentVisit1"
723
+ },
724
+ "OccurrenceAEncounterInpatient2": {
725
+ "title": "Encounter Inpatient",
726
+ "description": "Encounter, Performed: Encounter Inpatient",
727
+ "standard_category": "encounter",
728
+ "qds_data_type": "encounter",
729
+ "code_list_id": "2.16.840.1.113883.3.666.5.307",
730
+ "type": "encounters",
731
+ "definition": "encounter",
732
+ "status": "performed",
733
+ "hard_status": false,
734
+ "negation": false,
735
+ "specific_occurrence": "A",
736
+ "specific_occurrence_const": "ENCOUNTER_PERFORMED_ENCOUNTER_INPATIENT",
737
+ "source_data_criteria": "OccurrenceAEncounterInpatient2"
738
+ },
739
+ "PatientCharacteristicSexOncAdministrativeSex": {
740
+ "title": "ONC Administrative Sex",
741
+ "description": "Patient Characteristic Sex: ONC Administrative Sex",
742
+ "standard_category": "individual_characteristic",
743
+ "qds_data_type": "individual_characteristic",
744
+ "code_list_id": "2.16.840.1.113762.1.4.1",
745
+ "property": "gender",
746
+ "type": "characteristic",
747
+ "definition": "patient_characteristic_gender",
748
+ "hard_status": false,
749
+ "negation": false,
750
+ "source_data_criteria": "PatientCharacteristicSexOncAdministrativeSex",
751
+ "value": {
752
+ "type": "CD",
753
+ "system": "Administrative Sex",
754
+ "code": "F"
755
+ }
756
+ },
757
+ "PatientCharacteristicRaceRace": {
758
+ "title": "Race",
759
+ "description": "Patient Characteristic Race: Race",
760
+ "standard_category": "individual_characteristic",
761
+ "qds_data_type": "individual_characteristic",
762
+ "code_list_id": "2.16.840.1.114222.4.11.836",
763
+ "property": "race",
764
+ "type": "characteristic",
765
+ "definition": "patient_characteristic_race",
766
+ "hard_status": false,
767
+ "negation": false,
768
+ "source_data_criteria": "PatientCharacteristicRaceRace",
769
+ "inline_code_list": {
770
+ "CDC Race": []
771
+ }
772
+ },
773
+ "PatientCharacteristicEthnicityEthnicity": {
774
+ "title": "Ethnicity",
775
+ "description": "Patient Characteristic Ethnicity: Ethnicity",
776
+ "standard_category": "individual_characteristic",
777
+ "qds_data_type": "individual_characteristic",
778
+ "code_list_id": "2.16.840.1.114222.4.11.837",
779
+ "property": "ethnicity",
780
+ "type": "characteristic",
781
+ "definition": "patient_characteristic_ethnicity",
782
+ "hard_status": false,
783
+ "negation": false,
784
+ "source_data_criteria": "PatientCharacteristicEthnicityEthnicity",
785
+ "inline_code_list": {
786
+ "CDC Race": [
787
+ "2135-2",
788
+ "2186-5"
789
+ ]
790
+ }
791
+ },
792
+ "PatientCharacteristicPayerPayer": {
793
+ "title": "Payer",
794
+ "description": "Patient Characteristic Payer: Payer",
795
+ "standard_category": "individual_characteristic",
796
+ "qds_data_type": "individual_characteristic",
797
+ "code_list_id": "2.16.840.1.114222.4.11.3591",
798
+ "property": "payer",
799
+ "type": "characteristic",
800
+ "definition": "patient_characteristic_payer",
801
+ "hard_status": false,
802
+ "negation": false,
803
+ "source_data_criteria": "PatientCharacteristicPayerPayer",
804
+ "inline_code_list": {
805
+ "SOP": []
806
+ }
807
+ }
808
+ },
809
+ "attributes": [
810
+ {
811
+ "id": "COPYRIGHT",
812
+ "code": "COPY",
813
+ "value": "Measure specifications are in the Public Domain\r\n\r\nLOINC(R) is a registered trademark of the Regenstrief Institute.\r\n\r\nThis material contains SNOMED Clinical Terms(R) (SNOMED CT(c)) copyright 2004-2010 International Health Terminology Standards Development Organization. All rights reserved.",
814
+ "name": "Copyright"
815
+ },
816
+ {
817
+ "id": "MEASURE_SCORING",
818
+ "code": "MSRSCORE",
819
+ "name": "Measure Scoring"
820
+ },
821
+ {
822
+ "id": "MEASURE_TYPE",
823
+ "code": "MSRTYPE",
824
+ "name": "Measure Type"
825
+ },
826
+ {
827
+ "id": "STRATIFICATION",
828
+ "code": "STRAT",
829
+ "value": "The measure is stratified. \r\n\r\nStratum 1 - all patients seen in the ED and admitted as an inpatient\r\nStratum 2 - all patients seen in the ED and admitted as an inpatient who do not have a diagnosis consistent with psychiatric/mental health disorders\r\nStratum 3 - all patients seen in the ED and admitted as an inpatient who have a diagnosis consistent with psychiatric/mental health disorders",
830
+ "name": "Stratification"
831
+ },
832
+ {
833
+ "id": "RISK_ADJUSTMENT",
834
+ "code": "MSRADJ",
835
+ "value": "None",
836
+ "name": "Risk Adjustment"
837
+ },
838
+ {
839
+ "id": "RATE_AGGREGATION",
840
+ "code": "MSRAGG",
841
+ "value": "Calculate the ED time in minutes for each person in the measure population; report the median time for all calculations performed. The specification provides elements from the clinical electronic record required to calculate for each ED encounter, i.e., the length of time the patient was in the Emergency Department, also stated as: the TIMEDIFF between the Emergency Department departure time and the Emergency Department arrival time. The calculation requires the median across all ED encounter durations.",
842
+ "name": "Rate Aggregation"
843
+ },
844
+ {
845
+ "id": "RATIONALE",
846
+ "code": "RAT",
847
+ "value": "In recent times, EDs have experienced significant overcrowding. Although once only a problem in large, urban, teaching hospitals, the phenomenon has spread to other suburban and rural healthcare organizations. According to a 2002 national U.S. survey, more than 90% of large hospitals report EDs operating \"at\" or \"over\" capacity. Approximately one third of hospitals in the US report increases in ambulance diversion in a given year, whereas up to half report crowded conditions in the ED. In a recent national survey, 40% of hospital leaders viewed ED crowding as a symptom of workforce shortages. ED crowding may result in delays in the administration of medication such as antibiotics for pneumonia and has been associated with perceptions of compromised emergency care. For patients with non-ST-segment-elevation myocardial infarction, long ED stays were associated with decreased use of guideline-recommended therapies and a higher risk of recurrent myocardial infarction. Overcrowding and heavy emergency resource demand have led to a number of problems, including ambulance refusals, prolonged patient waiting times, increased suffering for those who wait, rushed and unpleasant treatment environments, and potentially poor patient outcomes. When EDs are overwhelmed, their ability to respond to community emergencies and disasters may be compromised.",
848
+ "name": "Rationale"
849
+ },
850
+ {
851
+ "id": "CLINICAL_RECOMMENDATION_STATEMENT",
852
+ "code": "CRS",
853
+ "value": "Reducing the time patients remain in the emergency department (ED) can improve access to treatment and increase quality of care. Reducing this time potentially improves access to care specific to the patient condition and increases the capability to provide additional treatment.",
854
+ "name": "Clinical Recommendation Statement"
855
+ },
856
+ {
857
+ "id": "IMPROVEMENT_NOTATION",
858
+ "code": "IDUR",
859
+ "value": "A decrease in the median value indicates less time in the emergency department and enhanced throughput.",
860
+ "name": "Improvement Notation"
861
+ },
862
+ {
863
+ "id": "NQF_ID_NUMBER",
864
+ "code": "OTH",
865
+ "value": "0495",
866
+ "name": "NQF ID Number"
867
+ },
868
+ {
869
+ "id": "DISCLAIMER",
870
+ "code": "DISC",
871
+ "value": "None",
872
+ "name": "Disclaimer"
873
+ },
874
+ {
875
+ "id": "EMEASURE_IDENTIFIER",
876
+ "code": "OTH",
877
+ "value": "55",
878
+ "name": "eMeasure Identifier"
879
+ },
880
+ {
881
+ "id": "REFERENCE",
882
+ "code": "REF",
883
+ "value": "Wilper AP, Woolhandler S, Lasser KE, McCormick D, Cutrona SL, Bor DH, Himmelstein DU. Waits to see an emergency department physician: U.S. trends and predictors, 1997-2004. Health Aff (Millwood). 2008;27:w84-95.",
884
+ "name": "Reference"
885
+ },
886
+ {
887
+ "id": "DEFINITION",
888
+ "code": "DEF",
889
+ "value": "None",
890
+ "name": "Definition"
891
+ },
892
+ {
893
+ "id": "GUIDANCE",
894
+ "code": "GUIDE",
895
+ "value": "This measure specification defines how to determine an individual Emergency Department stay. Reporting requires the median of all patient stays [Encounter: encounter ED] arrival date and time - [Encounter: encounter ED] ED departure date and time. \r\n\r\nCalculate the ED time in minutes for each person in the measure population; report the median time for all calculations performed. The specification provides elements from the clinical electronic record required to calculate for each ED encounter, i.e., the length of time the patient was in the Emergency Department, also stated as: the TIMEDIFF for the Emergency Department departure time minus the Emergency Department arrival time. The calculation requires the median across all ED encounter durations.",
896
+ "name": "Guidance"
897
+ },
898
+ {
899
+ "id": "TRANSMISSION_FORMAT",
900
+ "code": "OTH",
901
+ "value": "None",
902
+ "name": "Transmission Format"
903
+ },
904
+ {
905
+ "id": "INITIAL_PATIENT_POPULATION",
906
+ "code": "IPP",
907
+ "value": "All patients discharged from acute inpatient care with Length of Stay (Discharge Date minus Admission Date) less than or equal to 120 days.",
908
+ "name": "Initial Patient Population"
909
+ },
910
+ {
911
+ "id": "DENOMINATOR",
912
+ "code": "DENOM",
913
+ "value": "Not Applicable",
914
+ "name": "Denominator"
915
+ },
916
+ {
917
+ "id": "DENOMINATOR_EXCLUSIONS",
918
+ "code": "OTH",
919
+ "value": "Not Applicable",
920
+ "name": "Denominator Exclusions"
921
+ },
922
+ {
923
+ "id": "NUMERATOR",
924
+ "code": "NUMER",
925
+ "value": "Not Applicable",
926
+ "name": "Numerator"
927
+ },
928
+ {
929
+ "id": "NUMERATOR_EXCLUSIONS",
930
+ "code": "OTH",
931
+ "value": "Not Applicable",
932
+ "name": "Numerator Exclusions"
933
+ },
934
+ {
935
+ "id": "DENOMINATOR_EXCEPTIONS",
936
+ "code": "DENEXCEP",
937
+ "value": "Not Applicable",
938
+ "name": "Denominator Exceptions"
939
+ },
940
+ {
941
+ "id": "MEASURE_POPULATION",
942
+ "code": "MSRPOPL",
943
+ "value": "Any ED Patient from the facility’s emergency department",
944
+ "name": "Measure Population"
945
+ },
946
+ {
947
+ "id": "MEASURE_OBSERVATIONS",
948
+ "code": "OTH",
949
+ "value": "Time (in minutes) from ED arrival to ED departure for patients admitted to the facility from the emergency department.",
950
+ "name": "Measure Observations"
951
+ },
952
+ {
953
+ "id": "SUPPLEMENTAL_DATA_ELEMENTS",
954
+ "code": "OTH",
955
+ "value": "For every patient evaluated by this measure, also identify payer, race, ethnicity and sex.",
956
+ "name": "Supplemental Data Elements"
957
+ }
958
+ ],
959
+ "populations": [
960
+ {
961
+ "MSRPOPL": "MSRPOPL",
962
+ "IPP": "IPP",
963
+ "OBSERV": "OBSERV",
964
+ "title": "Unstratified",
965
+ "id": "Population1"
966
+ },
967
+ {
968
+ "IPP": "IPP_1",
969
+ "MSRPOPL": "MSRPOPL",
970
+ "OBSERV": "OBSERV",
971
+ "stratification": "E22BCA10-81DD-46C0-8158-C1C92A44605A",
972
+ "title": "RS1: ED and inpatient",
973
+ "id": "Population2"
974
+ },
975
+ {
976
+ "IPP": "IPP_2",
977
+ "MSRPOPL": "MSRPOPL",
978
+ "OBSERV": "OBSERV",
979
+ "stratification": "65AABBEC-488E-4BF0-A311-F47AAA12266D",
980
+ "title": "RS2: ED and inpatient w/out psych",
981
+ "id": "Population3"
982
+ },
983
+ {
984
+ "IPP": "IPP_3",
985
+ "MSRPOPL": "MSRPOPL",
986
+ "OBSERV": "OBSERV",
987
+ "stratification": "A954308C-B2F5-47A3-BC33-7B2F3E3808D1",
988
+ "title": "RS3: ED and inpatient w/ psych",
989
+ "id": "Population4"
990
+ }
991
+ ],
992
+ "measure_period": {
993
+ "type": "IVL_TS",
994
+ "low": {
995
+ "type": "TS",
996
+ "value": "201201010000",
997
+ "inclusive?": true,
998
+ "derived?": false
999
+ },
1000
+ "high": {
1001
+ "type": "TS",
1002
+ "value": "201212312359",
1003
+ "inclusive?": true,
1004
+ "derived?": false
1005
+ },
1006
+ "width": {
1007
+ "type": "PQ",
1008
+ "unit": "a",
1009
+ "value": "1",
1010
+ "inclusive?": true,
1011
+ "derived?": false
1012
+ }
1013
+ }
1014
+ }