Coverage report generated for Unit Tests to C:/Users/amilineni/Downloads/quality-measure-engine-bump_mongoid/quality-measure-engine-bump_mongoid_2.4/coverage. 0.0 / 0.0 LOC (100.0%) covered. Run options: -n test_map_records_into_measure_groups --seed 7782 # Running: Inside setup() method Inside test_map_records_into_measure_groups() method Inside Executor.initialize() method After calling filters: # Calling map_records_into_measure_groups on map_reduce_executor Map Function:function() { var patient = this; var effective_date = 1421280000; var enable_logging = false; var enable_rationale = false; var short_circuit = false; var test_id = null; hqmfjs = {} if (typeof(map)=="undefined") { map_reduce_utils(); hqmf_utils(); } hqmfjs.effective_date = effective_date; hqmfjs.test_id = test_id; var patient_api = new hQuery.Patient(patient); // ######################### // ##### DATA ELEMENTS ##### // ######################### hqmfjs.nqf_id = '0055'; hqmfjs.hqmf_id = '40280381-51F0-825B-0152-22A24CDD1740'; hqmfjs.sub_id = null; if (typeof(test_id) == 'undefined') hqmfjs.test_id = null; OidDictionary = {'2.16.840.1.113883.3.464.1003.115.12.1088':{'SNOMED-CT':['252779009','252780007','252781006','252782004','252783009','252784003','252788000','252789008','252790004','274795007','274798009','308110009','314971001','314972008','410451008','410452001','410453006','410455004','420213007','425816006','427478009','6615001']},'2.16.840.1.113883.3.464.1003.195.12.1002':{'SNOMED-CT':['442225006']},'2.16.840.1.113883.3.464.1003.103.12.1001':{'SNOMED-CT':['190330002','190331003','190368000','190369008','190372001','190389009','190390000','199223000','199225007','199226008','199227004','199228009','199229001','199230006','23045005','237599002','237618001','237627000','28032008','313435000','313436004','314771006','314772004','314893005','314902007','314903002','314904008','359642000','44054006','46635009','4783006','75682002','76751001','81531005','9859006'],'ICD-9-CM':['250.00','250.01','250.02','250.03','250.10','250.11','250.12','250.13','250.20','250.21','250.22','250.23','250.30','250.31','250.32','250.33','250.40','250.41','250.42','250.43','250.50','250.51','250.52','250.53','250.60','250.61','250.62','250.63','250.70','250.71','250.72','250.73','250.80','250.81','250.82','250.83','250.90','250.91','250.92','250.93','357.2','362.01','362.02','362.03','362.04','362.05','362.06','362.07','366.41','648.00','648.01','648.02','648.03','648.04'],'ICD-10-CM':['E10.10','E10.11','E10.21','E10.22','E10.29','E10.311','E10.319','E10.321','E10.329','E10.331','E10.339','E10.341','E10.349','E10.351','E10.359','E10.36','E10.39','E10.40','E10.41','E10.42','E10.43','E10.44','E10.49','E10.51','E10.52','E10.59','E10.610','E10.618','E10.620','E10.621','E10.622','E10.628','E10.630','E10.638','E10.641','E10.649','E10.65','E10.69','E10.8','E10.9','E11.00','E11.01','E11.21','E11.22','E11.29','E11.311','E11.319','E11.321','E11.329','E11.331','E11.339','E11.341','E11.349','E11.351','E11.359','E11.36','E11.39','E11.40','E11.41','E11.42','E11.43','E11.44','E11.49','E11.51','E11.52','E11.59','E11.610','E11.618','E11.620','E11.621','E11.622','E11.628','E11.630','E11.638','E11.641','E11.649','E11.65','E11.69','E11.8','E11.9','E13.00','E13.01','E13.10','E13.11','E13.21','E13.22','E13.29','E13.311','E13.319','E13.321','E13.329','E13.331','E13.339','E13.341','E13.349','E13.351','E13.359','E13.36','E13.39','E13.40','E13.41','E13.42','E13.43','E13.44','E13.49','E13.51','E13.52','E13.59','E13.610','E13.618','E13.620','E13.621','E13.622','E13.628','E13.630','E13.638','E13.641','E13.649','E13.65','E13.69','E13.8','E13.9','O24.011','O24.012','O24.013','O24.019','O24.02','O24.03','O24.111','O24.112','O24.113','O24.119','O24.12','O24.13','O24.311','O24.312','O24.313','O24.319','O24.32','O24.33','O24.811','O24.812','O24.813','O24.819','O24.82','O24.83']},'2.16.840.1.113883.3.526.3.1285':{'CPT':['92002','92004','92012','92014']},'2.16.840.1.113883.3.464.1003.101.12.1016':{'CPT':['99341','99342','99343','99344','99345','99347','99348','99349','99350']},'2.16.840.1.114222.4.11.3591':{'Source of Payment Typology':['1','11','111','112','113','119','12','121','122','123','129','19','2','21','211','212','213','219','22','23','24','25','29','3','31','311','3111','3112','3113','3114','3115','3116','3119','312','3121','3122','3123','313','32','321','3211','3212','32121','32122','32123','32124','32125','32126','322','3221','3222','3223','3229','33','331','332','333','334','34','341','342','343','349','35','36','361','362','369','37','371','3711','3712','3713','372','379','38','381','3811','3812','3813','3819','382','389','39','4','41','42','43','44','5','51','511','512','513','514','515','519','52','521','522','523','529','53','54','55','59','6','61','611','612','613','619','62','63','64','69','7','71','72','73','79','8','81','82','821','822','823','83','84','85','89','9','91','92','93','94','95','951','953','954','959','96','98','99','9999']},'2.16.840.1.113883.3.526.3.1240':{'HCPCS':['G0438','G0439']},'2.16.840.1.113762.1.4.1':{'AdministrativeGender':['F','M']},'2.16.840.1.114222.4.11.836':{'CDC Race':['1002-5','2028-9','2054-5','2076-8','2106-3','2131-1']},'2.16.840.1.114222.4.11.837':{'CDC Race':['2135-2','2186-5']},'2.16.840.1.113883.3.464.1003.101.12.1025':{'CPT':['99395','99396','99397']},'2.16.840.1.113883.3.464.1003.101.12.1023':{'CPT':['99385','99386','99387']},'2.16.840.1.113883.3.464.1003.101.12.1048':{'SNOMED-CT':['12843005','18170008','185349003','185463005','185465003','19681004','207195004','270427003','270430005','308335008','390906007','406547006','439708006','87790002','90526000']},'2.16.840.1.113883.3.464.1003.101.12.1001':{'CPT':['99201','99202','99203','99204','99205','99212','99213','99214','99215']}}; // Measure variables var MeasurePeriod = { "low": new TS("201201010000", true), "high": new TS("201212312359", true) } hqmfjs.MeasurePeriod = function(patient) { return [new hQuery.CodedEntry( { "start_time": MeasurePeriod.low.asDate().getTime()/1000, "end_time": MeasurePeriod.high.asDate().getTime()/1000, "codes": {} } )]; } if (typeof effective_date === 'number') { MeasurePeriod.high.date = new Date(1000*effective_date); // add one minute before pulling off the year. This turns 12-31-2012 23:59 into 1-1-2013 00:00 => 1-1-2012 00:00 MeasurePeriod.low.date = new Date(1000*(effective_date+60)); MeasurePeriod.low.date.setFullYear(MeasurePeriod.low.date.getFullYear()-1); } // Data critera hqmfjs.AnnualWellnessVisit_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c5c = function(patient, initialSpecificContext) { var eventCriteria = {"type": "encounters", "statuses": ["performed"], "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.526.3.1240"}; var events = patient.getEvents(eventCriteria); hqmf.SpecificsManager.setIfNull(events); return events; } hqmfjs.Face_to_FaceInteraction_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725b0c5e = function(patient, initialSpecificContext) { var eventCriteria = {"type": "encounters", "statuses": ["performed"], "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.464.1003.101.12.1048"}; var events = patient.getEvents(eventCriteria); hqmf.SpecificsManager.setIfNull(events); return events; } hqmfjs.HomeHealthcareServices_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c5d = function(patient, initialSpecificContext) { var eventCriteria = {"type": "encounters", "statuses": ["performed"], "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.464.1003.101.12.1016"}; var events = patient.getEvents(eventCriteria); hqmf.SpecificsManager.setIfNull(events); return events; } hqmfjs.OfficeVisit_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c59 = function(patient, initialSpecificContext) { var eventCriteria = {"type": "encounters", "statuses": ["performed"], "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.464.1003.101.12.1001"}; var events = patient.getEvents(eventCriteria); hqmf.SpecificsManager.setIfNull(events); return events; } hqmfjs.OphthalmologicalServices_EncounterPerformed_92c28176_3c50_4452_ac8e_e045c337e37c = function(patient, initialSpecificContext) { var eventCriteria = {"type": "encounters", "statuses": ["performed"], "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.526.3.1285"}; var events = patient.getEvents(eventCriteria); hqmf.SpecificsManager.setIfNull(events); return events; } hqmfjs.PreventiveCareServices_EstablishedOfficeVisit18andUp_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c5a = function(patient, initialSpecificContext) { var eventCriteria = {"type": "encounters", "statuses": ["performed"], "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.464.1003.101.12.1025"}; var events = patient.getEvents(eventCriteria); hqmf.SpecificsManager.setIfNull(events); return events; } hqmfjs.PreventiveCareServices_InitialOfficeVisit18andUp_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c5b = function(patient, initialSpecificContext) { var eventCriteria = {"type": "encounters", "statuses": ["performed"], "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.464.1003.101.12.1023"}; var events = patient.getEvents(eventCriteria); hqmf.SpecificsManager.setIfNull(events); return events; } hqmfjs.Ethnicity_PatientCharacteristicEthnicity_8a4d92b2_39ca_af4b_0139_d472725a0c49 = function(patient, initialSpecificContext) { var value = patient.ethnicity() || null; matching = matchingValue(value, null); matching.specificContext=hqmf.SpecificsManager.identity(); return matching; } hqmfjs.ONCAdministrativeSex_PatientCharacteristicSex_8a4d92b2_39ca_af4b_0139_d472725a0c47 = function(patient, initialSpecificContext) { var value = patient.gender() || null; matching = matchingValue(value, new CD("F", "Administrative Sex")); matching.specificContext=hqmf.SpecificsManager.identity(); return matching; } hqmfjs.Payer_PatientCharacteristicPayer_8a4d92b2_39ca_af4b_0139_d472725a0c4a = function(patient, initialSpecificContext) { var value = patient.payer() || null; if (value === null) { matching = new Boolean(false); } else { matching = new Boolean(value.includedIn({"Source of Payment Typology":["1","11","111","112","113","119","12","121","122","123","129","19","2","21","211","212","213","219","22","23","24","25","29","3","31","311","3111","3112","3113","3114","3115","3116","3119","312","3121","3122","3123","313","32","321","3211","3212","32121","32122","32123","32124","32125","32126","322","3221","3222","3223","3229","33","331","332","333","334","34","341","342","343","349","35","36","361","362","369","37","371","3711","3712","3713","372","379","38","381","3811","3812","3813","3819","382","389","39","4","41","42","43","44","5","51","511","512","513","514","515","519","52","521","522","523","529","53","54","55","59","6","61","611","612","613","619","62","63","64","69","7","71","72","73","79","8","81","82","821","822","823","83","84","85","89","9","91","92","93","94","95","951","953","954","959","96","98","99","9999"]})); } matching.specificContext=hqmf.SpecificsManager.identity(); return matching; } hqmfjs.Race_PatientCharacteristicRace_8a4d92b2_39ca_af4b_0139_d472725a0c48 = function(patient, initialSpecificContext) { var value = patient.race() || null; if (value === null) { matching = new Boolean(false); } else { matching = new Boolean(value.includedIn({"CDC Race":["1002-5","2028-9","2054-5","2076-8","2106-3","2131-1"]})); } matching.specificContext=hqmf.SpecificsManager.identity(); return matching; } hqmfjs.Agegrtr_thn_eql_18yearsat_9B99C28F_3816_429D_94A2_FFC4F2611A64_FC504401_E9E3_49B6_8CA1_7D747642AC68 = function(patient, initialSpecificContext) { var value = patient.birthtime() || null; var events = value ? [value] : []; events = SBS(events, hqmfjs.MeasurePeriod(patient), new IVL_PQ(new PQ(18, "a", true), null)); events.specificContext=events.specificContext||hqmf.SpecificsManager.identity(); return events; } hqmfjs.Ageless_thn_75yearsat_A5A73D1F_4120_443E_B2D2_6686AB2C85D6_1648BE97_6AFA_4D8F_AFF1_466947B3FBEE = function(patient, initialSpecificContext) { var value = patient.birthtime() || null; var events = value ? [value] : []; events = SBS(events, hqmfjs.MeasurePeriod(patient), new IVL_PQ(null, new PQ(75, "a", false))); events.specificContext=events.specificContext||hqmf.SpecificsManager.identity(); return events; } hqmfjs.Overlaps_1AE43340_8179_4BEA_A845_A54966547591_B4D15F1B_C531_4221_83F8_775F13C28484 = function(patient, initialSpecificContext) { var eventCriteria = {"type": "allProblems", "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.464.1003.103.12.1001"}; var events = patient.getEvents(eventCriteria); if (events.length > 0 || !Logger.short_circuit) events = OVERLAP(events, hqmfjs.MeasurePeriod(patient)); if (events.length == 0) events.specificContext=hqmf.SpecificsManager.empty(); return events; } hqmfjs.During_848524E7_B51E_4993_A13E_A229CCCFB01E_9A8AED90_46D1_4253_ABBE_5C984FADB2E1 = function(patient, initialSpecificContext) { var events = UNION( hqmfjs.OfficeVisit_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c59(patient, initialSpecificContext), hqmfjs.Face_to_FaceInteraction_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725b0c5e(patient, initialSpecificContext), hqmfjs.PreventiveCareServices_EstablishedOfficeVisit18andUp_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c5a(patient, initialSpecificContext), hqmfjs.PreventiveCareServices_InitialOfficeVisit18andUp_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c5b(patient, initialSpecificContext), hqmfjs.HomeHealthcareServices_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c5d(patient, initialSpecificContext), hqmfjs.AnnualWellnessVisit_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c5c(patient, initialSpecificContext), hqmfjs.OphthalmologicalServices_EncounterPerformed_92c28176_3c50_4452_ac8e_e045c337e37c(patient, initialSpecificContext) ); if (events.length > 0 || !Logger.short_circuit) events = DURING(events, hqmfjs.MeasurePeriod(patient)); if (events.length == 0) events.specificContext=hqmf.SpecificsManager.empty(); return events; } hqmfjs.less_thn_eql_12monthsEndsBeforeStartOf_ED92B4B5_7678_44C8_A330_A85BE981F440_8a4d92b2_39ca_af4b_0139_d472725a0c54 = function(patient, initialSpecificContext) { var eventCriteria = {"type": "procedureResults", "statuses": ["performed"], "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.464.1003.115.12.1088"}; var events = patient.getEvents(eventCriteria); events = filterEventsByValue(events, new CodeList(getCodes("2.16.840.1.113883.3.464.1003.195.12.1002"))); if (events.length > 0 || !Logger.short_circuit) events = EBS(events, hqmfjs.MeasurePeriod(patient), new IVL_PQ(null, new PQ(12, "mo", true))); if (events.length == 0) events.specificContext=hqmf.SpecificsManager.empty(); return events; } hqmfjs.During_F8E035BB_9B96_4496_A514_A874E313F228_8a4d92b2_39ca_af4b_0139_d472725a0c54 = function(patient, initialSpecificContext) { var eventCriteria = {"type": "procedureResults", "statuses": ["performed"], "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.464.1003.115.12.1088"}; var events = patient.getEvents(eventCriteria); if (events.length > 0 || !Logger.short_circuit) events = DURING(events, hqmfjs.MeasurePeriod(patient)); if (events.length == 0) events.specificContext=hqmf.SpecificsManager.empty(); return events; } hqmfjs.SatisfiesAny_7C5284AE_2BA3_40D5_86EB_FA7773542CE4_EA895040_F653_4989_97C8_04ACD4C894FE = function(patient, initialSpecificContext) { var events = UNION( hqmfjs.less_thn_eql_12monthsEndsBeforeStartOf_ED92B4B5_7678_44C8_A330_A85BE981F440_8a4d92b2_39ca_af4b_0139_d472725a0c54(patient, initialSpecificContext), hqmfjs.During_F8E035BB_9B96_4496_A514_A874E313F228_8a4d92b2_39ca_af4b_0139_d472725a0c54(patient, initialSpecificContext) ); hqmf.SpecificsManager.setIfNull(events); return events; } // ######################### // ##### MEASURE LOGIC ##### // ######################### hqmfjs.initializeSpecifics = function(patient_api, hqmfjs) { hqmf.SpecificsManager.initialize(patient_api,hqmfjs) } // INITIAL PATIENT POPULATION hqmfjs.IPP = function(patient, initialSpecificContext) { population_criteria_fn = allTrue('IPP', patient, initialSpecificContext, allTrue('5', patient, initialSpecificContext, hqmfjs.Overlaps_1AE43340_8179_4BEA_A845_A54966547591_B4D15F1B_C531_4221_83F8_775F13C28484, hqmfjs.Agegrtr_thn_eql_18yearsat_9B99C28F_3816_429D_94A2_FFC4F2611A64_FC504401_E9E3_49B6_8CA1_7D747642AC68, hqmfjs.Ageless_thn_75yearsat_A5A73D1F_4120_443E_B2D2_6686AB2C85D6_1648BE97_6AFA_4D8F_AFF1_466947B3FBEE, hqmfjs.During_848524E7_B51E_4993_A13E_A229CCCFB01E_9A8AED90_46D1_4253_ABBE_5C984FADB2E1 ) ); if (typeof(population_criteria_fn) == 'function') { return population_criteria_fn(); } else { return population_criteria_fn; } }; // STRATIFICATION hqmfjs.STRAT=null; // DENOMINATOR hqmfjs.DENOM = function(patient) { return new Boolean(true); } // NUMERATOR hqmfjs.NUMER = function(patient, initialSpecificContext) { population_criteria_fn = allTrue('NUMER', patient, initialSpecificContext, allTrue('7', patient, initialSpecificContext, hqmfjs.SatisfiesAny_7C5284AE_2BA3_40D5_86EB_FA7773542CE4_EA895040_F653_4989_97C8_04ACD4C894FE ) ); if (typeof(population_criteria_fn) == 'function') { return population_criteria_fn(); } else { return population_criteria_fn; } }; hqmfjs.NUMEX = function(patient) { return new Boolean(false); } hqmfjs.DENEX = function(patient) { return new Boolean(false); } hqmfjs.DENEXCEP = function(patient) { return new Boolean(false); } // CV hqmfjs.MSRPOPL = function(patient) { return new Boolean(true); } hqmfjs.MSRPOPLEX = function(patient) { return new Boolean(false); } hqmfjs.OBSERV = function(patient) { return new Boolean(false); } // VARIABLES hqmfjs.VARIABLES = function(patient, initialSpecificContext) { return false; } var occurrenceId = null; hqmfjs.initializeSpecifics(patient_api, hqmfjs) var population = function() { return executeIfAvailable(hqmfjs.IPP, patient_api); } var stratification = null; if (hqmfjs.STRAT) { stratification = function() { return hqmf.SpecificsManager.setIfNull(executeIfAvailable(hqmfjs.STRAT, patient_api)); } } var denominator = function() { return executeIfAvailable(hqmfjs.DENOM, patient_api); } var numerator = function() { return executeIfAvailable(hqmfjs.NUMER, patient_api); } var exclusion = function() { return executeIfAvailable(hqmfjs.DENEX, patient_api); } var denexcep = function() { return executeIfAvailable(hqmfjs.DENEXCEP, patient_api); } var numex = function() { return executeIfAvailable(hqmfjs.NUMEX, patient_api); } var msrpopl = function() { return executeIfAvailable(hqmfjs.MSRPOPL, patient_api); } var msrpoplex = function() { return executeIfAvailable(hqmfjs.MSRPOPLEX, patient_api); } var observ = function(specific_context) { var observFunc = hqmfjs.OBSERV if (typeof(observFunc)==='function') return observFunc(patient_api, specific_context); else return []; } var variables = function() { if (Logger.enable_rationale) { return executeIfAvailable(hqmfjs.VARIABLES, patient_api); } } var executeIfAvailable = function(optionalFunction, patient_api) { if (typeof(optionalFunction)==='function') { result = optionalFunction(patient_api); return result; } else { return false; } } if (typeof Logger != 'undefined') { // clear out logger Logger.logger = []; Logger.rationale={}; if (typeof short_circuit == 'undefined') short_circuit = true; // turn on logging if it is enabled if (enable_logging || enable_rationale) { injectLogger(hqmfjs, enable_logging, enable_rationale, short_circuit); } else { Logger.enable_rationale = false; Logger.short_circuit = short_circuit; } } try { map(patient, population, denominator, numerator, exclusion, denexcep, msrpopl, msrpoplex, observ, occurrenceId,false,stratification, variables, numex); } catch(err) { print(err.stack); throw err; } }; finalize function:function (key, value) { var patient = value; patient.measure_id = "40280381-51F0-825B-0152-22A24CDD1740"; patient.nqf_id = "0055"; patient.effective_date = 1421280000; if (patient.provider_performances) { var tmp = []; for(var i=0; i 1389744000)) || // Late Overlap ((value['start_date'] < 1421280000) && (value['end_date'] >= 1421280000 || value['end_date'] == null)) || // Full Overlap ((value['start_date'] <= 1389744000 || value['start_date'] == null) && (value['end_date'] >= 1421280000 || value['end_date'] == null)) || // Full Containment (value['start_date'] > 1389744000 && value['end_date'] < 1421280000) ) tmp.push(value); } if (tmp.length > 0) { patient.provider_performances = tmp; } else { sortedProviders = _.sortBy(patient.provider_performances, function(performance){return performance['end_date']}); patient.provider_performances = [_.last(sortedProviders)]; } } return patient;} PreFilter: {} F Finished in 0.541000s, 1.8484 runs/s, 1.8484 assertions/s. 1) Failure: MapReduceExecutorTest#test_map_records_into_measure_groups [test/unit/qme/map/map_reduce_executor_test.rb:31]: Expected: 4 Actual: 1 1 runs, 1 assertions, 1 failures, 0 errors, 0 skips Coverage report generated for Unit Tests to C:/Users/amilineni/Downloads/quality-measure-engine-bump_mongoid/quality-measure-engine-bump_mongoid_2.4/coverage. 0.0 / 0.0 LOC (100.0%) covered. Run options: -n test_map_records_into_measure_groups --seed 56624 # Running: Inside setup() method Inside test_map_records_into_measure_groups() method Inside Executor.initialize() method After calling filters: # Calling map_records_into_measure_groups on map_reduce_executor Map Function:function() { var patient = this; var effective_date = 1421280000; var enable_logging = false; var enable_rationale = false; var short_circuit = false; var test_id = null; hqmfjs = {} if (typeof(map)=="undefined") { map_reduce_utils(); hqmf_utils(); } hqmfjs.effective_date = effective_date; hqmfjs.test_id = test_id; var patient_api = new hQuery.Patient(patient); // ######################### // ##### DATA ELEMENTS ##### // ######################### hqmfjs.nqf_id = '0055'; hqmfjs.hqmf_id = '40280381-51F0-825B-0152-22A24CDD1740'; hqmfjs.sub_id = null; if (typeof(test_id) == 'undefined') hqmfjs.test_id = null; OidDictionary = {'2.16.840.1.113883.3.464.1003.115.12.1088':{'SNOMED-CT':['252779009','252780007','252781006','252782004','252783009','252784003','252788000','252789008','252790004','274795007','274798009','308110009','314971001','314972008','410451008','410452001','410453006','410455004','420213007','425816006','427478009','6615001']},'2.16.840.1.113883.3.464.1003.195.12.1002':{'SNOMED-CT':['442225006']},'2.16.840.1.113883.3.464.1003.103.12.1001':{'SNOMED-CT':['190330002','190331003','190368000','190369008','190372001','190389009','190390000','199223000','199225007','199226008','199227004','199228009','199229001','199230006','23045005','237599002','237618001','237627000','28032008','313435000','313436004','314771006','314772004','314893005','314902007','314903002','314904008','359642000','44054006','46635009','4783006','75682002','76751001','81531005','9859006'],'ICD-9-CM':['250.00','250.01','250.02','250.03','250.10','250.11','250.12','250.13','250.20','250.21','250.22','250.23','250.30','250.31','250.32','250.33','250.40','250.41','250.42','250.43','250.50','250.51','250.52','250.53','250.60','250.61','250.62','250.63','250.70','250.71','250.72','250.73','250.80','250.81','250.82','250.83','250.90','250.91','250.92','250.93','357.2','362.01','362.02','362.03','362.04','362.05','362.06','362.07','366.41','648.00','648.01','648.02','648.03','648.04'],'ICD-10-CM':['E10.10','E10.11','E10.21','E10.22','E10.29','E10.311','E10.319','E10.321','E10.329','E10.331','E10.339','E10.341','E10.349','E10.351','E10.359','E10.36','E10.39','E10.40','E10.41','E10.42','E10.43','E10.44','E10.49','E10.51','E10.52','E10.59','E10.610','E10.618','E10.620','E10.621','E10.622','E10.628','E10.630','E10.638','E10.641','E10.649','E10.65','E10.69','E10.8','E10.9','E11.00','E11.01','E11.21','E11.22','E11.29','E11.311','E11.319','E11.321','E11.329','E11.331','E11.339','E11.341','E11.349','E11.351','E11.359','E11.36','E11.39','E11.40','E11.41','E11.42','E11.43','E11.44','E11.49','E11.51','E11.52','E11.59','E11.610','E11.618','E11.620','E11.621','E11.622','E11.628','E11.630','E11.638','E11.641','E11.649','E11.65','E11.69','E11.8','E11.9','E13.00','E13.01','E13.10','E13.11','E13.21','E13.22','E13.29','E13.311','E13.319','E13.321','E13.329','E13.331','E13.339','E13.341','E13.349','E13.351','E13.359','E13.36','E13.39','E13.40','E13.41','E13.42','E13.43','E13.44','E13.49','E13.51','E13.52','E13.59','E13.610','E13.618','E13.620','E13.621','E13.622','E13.628','E13.630','E13.638','E13.641','E13.649','E13.65','E13.69','E13.8','E13.9','O24.011','O24.012','O24.013','O24.019','O24.02','O24.03','O24.111','O24.112','O24.113','O24.119','O24.12','O24.13','O24.311','O24.312','O24.313','O24.319','O24.32','O24.33','O24.811','O24.812','O24.813','O24.819','O24.82','O24.83']},'2.16.840.1.113883.3.526.3.1285':{'CPT':['92002','92004','92012','92014']},'2.16.840.1.113883.3.464.1003.101.12.1016':{'CPT':['99341','99342','99343','99344','99345','99347','99348','99349','99350']},'2.16.840.1.114222.4.11.3591':{'Source of Payment Typology':['1','11','111','112','113','119','12','121','122','123','129','19','2','21','211','212','213','219','22','23','24','25','29','3','31','311','3111','3112','3113','3114','3115','3116','3119','312','3121','3122','3123','313','32','321','3211','3212','32121','32122','32123','32124','32125','32126','322','3221','3222','3223','3229','33','331','332','333','334','34','341','342','343','349','35','36','361','362','369','37','371','3711','3712','3713','372','379','38','381','3811','3812','3813','3819','382','389','39','4','41','42','43','44','5','51','511','512','513','514','515','519','52','521','522','523','529','53','54','55','59','6','61','611','612','613','619','62','63','64','69','7','71','72','73','79','8','81','82','821','822','823','83','84','85','89','9','91','92','93','94','95','951','953','954','959','96','98','99','9999']},'2.16.840.1.113883.3.526.3.1240':{'HCPCS':['G0438','G0439']},'2.16.840.1.113762.1.4.1':{'AdministrativeGender':['F','M']},'2.16.840.1.114222.4.11.836':{'CDC Race':['1002-5','2028-9','2054-5','2076-8','2106-3','2131-1']},'2.16.840.1.114222.4.11.837':{'CDC Race':['2135-2','2186-5']},'2.16.840.1.113883.3.464.1003.101.12.1025':{'CPT':['99395','99396','99397']},'2.16.840.1.113883.3.464.1003.101.12.1023':{'CPT':['99385','99386','99387']},'2.16.840.1.113883.3.464.1003.101.12.1048':{'SNOMED-CT':['12843005','18170008','185349003','185463005','185465003','19681004','207195004','270427003','270430005','308335008','390906007','406547006','439708006','87790002','90526000']},'2.16.840.1.113883.3.464.1003.101.12.1001':{'CPT':['99201','99202','99203','99204','99205','99212','99213','99214','99215']}}; // Measure variables var MeasurePeriod = { "low": new TS("201201010000", true), "high": new TS("201212312359", true) } hqmfjs.MeasurePeriod = function(patient) { return [new hQuery.CodedEntry( { "start_time": MeasurePeriod.low.asDate().getTime()/1000, "end_time": MeasurePeriod.high.asDate().getTime()/1000, "codes": {} } )]; } if (typeof effective_date === 'number') { MeasurePeriod.high.date = new Date(1000*effective_date); // add one minute before pulling off the year. This turns 12-31-2012 23:59 into 1-1-2013 00:00 => 1-1-2012 00:00 MeasurePeriod.low.date = new Date(1000*(effective_date+60)); MeasurePeriod.low.date.setFullYear(MeasurePeriod.low.date.getFullYear()-1); } // Data critera hqmfjs.AnnualWellnessVisit_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c5c = function(patient, initialSpecificContext) { var eventCriteria = {"type": "encounters", "statuses": ["performed"], "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.526.3.1240"}; var events = patient.getEvents(eventCriteria); hqmf.SpecificsManager.setIfNull(events); return events; } hqmfjs.Face_to_FaceInteraction_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725b0c5e = function(patient, initialSpecificContext) { var eventCriteria = {"type": "encounters", "statuses": ["performed"], "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.464.1003.101.12.1048"}; var events = patient.getEvents(eventCriteria); hqmf.SpecificsManager.setIfNull(events); return events; } hqmfjs.HomeHealthcareServices_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c5d = function(patient, initialSpecificContext) { var eventCriteria = {"type": "encounters", "statuses": ["performed"], "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.464.1003.101.12.1016"}; var events = patient.getEvents(eventCriteria); hqmf.SpecificsManager.setIfNull(events); return events; } hqmfjs.OfficeVisit_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c59 = function(patient, initialSpecificContext) { var eventCriteria = {"type": "encounters", "statuses": ["performed"], "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.464.1003.101.12.1001"}; var events = patient.getEvents(eventCriteria); hqmf.SpecificsManager.setIfNull(events); return events; } hqmfjs.OphthalmologicalServices_EncounterPerformed_92c28176_3c50_4452_ac8e_e045c337e37c = function(patient, initialSpecificContext) { var eventCriteria = {"type": "encounters", "statuses": ["performed"], "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.526.3.1285"}; var events = patient.getEvents(eventCriteria); hqmf.SpecificsManager.setIfNull(events); return events; } hqmfjs.PreventiveCareServices_EstablishedOfficeVisit18andUp_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c5a = function(patient, initialSpecificContext) { var eventCriteria = {"type": "encounters", "statuses": ["performed"], "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.464.1003.101.12.1025"}; var events = patient.getEvents(eventCriteria); hqmf.SpecificsManager.setIfNull(events); return events; } hqmfjs.PreventiveCareServices_InitialOfficeVisit18andUp_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c5b = function(patient, initialSpecificContext) { var eventCriteria = {"type": "encounters", "statuses": ["performed"], "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.464.1003.101.12.1023"}; var events = patient.getEvents(eventCriteria); hqmf.SpecificsManager.setIfNull(events); return events; } hqmfjs.Ethnicity_PatientCharacteristicEthnicity_8a4d92b2_39ca_af4b_0139_d472725a0c49 = function(patient, initialSpecificContext) { var value = patient.ethnicity() || null; matching = matchingValue(value, null); matching.specificContext=hqmf.SpecificsManager.identity(); return matching; } hqmfjs.ONCAdministrativeSex_PatientCharacteristicSex_8a4d92b2_39ca_af4b_0139_d472725a0c47 = function(patient, initialSpecificContext) { var value = patient.gender() || null; matching = matchingValue(value, new CD("F", "Administrative Sex")); matching.specificContext=hqmf.SpecificsManager.identity(); return matching; } hqmfjs.Payer_PatientCharacteristicPayer_8a4d92b2_39ca_af4b_0139_d472725a0c4a = function(patient, initialSpecificContext) { var value = patient.payer() || null; if (value === null) { matching = new Boolean(false); } else { matching = new Boolean(value.includedIn({"Source of Payment Typology":["1","11","111","112","113","119","12","121","122","123","129","19","2","21","211","212","213","219","22","23","24","25","29","3","31","311","3111","3112","3113","3114","3115","3116","3119","312","3121","3122","3123","313","32","321","3211","3212","32121","32122","32123","32124","32125","32126","322","3221","3222","3223","3229","33","331","332","333","334","34","341","342","343","349","35","36","361","362","369","37","371","3711","3712","3713","372","379","38","381","3811","3812","3813","3819","382","389","39","4","41","42","43","44","5","51","511","512","513","514","515","519","52","521","522","523","529","53","54","55","59","6","61","611","612","613","619","62","63","64","69","7","71","72","73","79","8","81","82","821","822","823","83","84","85","89","9","91","92","93","94","95","951","953","954","959","96","98","99","9999"]})); } matching.specificContext=hqmf.SpecificsManager.identity(); return matching; } hqmfjs.Race_PatientCharacteristicRace_8a4d92b2_39ca_af4b_0139_d472725a0c48 = function(patient, initialSpecificContext) { var value = patient.race() || null; if (value === null) { matching = new Boolean(false); } else { matching = new Boolean(value.includedIn({"CDC Race":["1002-5","2028-9","2054-5","2076-8","2106-3","2131-1"]})); } matching.specificContext=hqmf.SpecificsManager.identity(); return matching; } hqmfjs.Agegrtr_thn_eql_18yearsat_9B99C28F_3816_429D_94A2_FFC4F2611A64_FC504401_E9E3_49B6_8CA1_7D747642AC68 = function(patient, initialSpecificContext) { var value = patient.birthtime() || null; var events = value ? [value] : []; events = SBS(events, hqmfjs.MeasurePeriod(patient), new IVL_PQ(new PQ(18, "a", true), null)); events.specificContext=events.specificContext||hqmf.SpecificsManager.identity(); return events; } hqmfjs.Ageless_thn_75yearsat_A5A73D1F_4120_443E_B2D2_6686AB2C85D6_1648BE97_6AFA_4D8F_AFF1_466947B3FBEE = function(patient, initialSpecificContext) { var value = patient.birthtime() || null; var events = value ? [value] : []; events = SBS(events, hqmfjs.MeasurePeriod(patient), new IVL_PQ(null, new PQ(75, "a", false))); events.specificContext=events.specificContext||hqmf.SpecificsManager.identity(); return events; } hqmfjs.Overlaps_1AE43340_8179_4BEA_A845_A54966547591_B4D15F1B_C531_4221_83F8_775F13C28484 = function(patient, initialSpecificContext) { var eventCriteria = {"type": "allProblems", "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.464.1003.103.12.1001"}; var events = patient.getEvents(eventCriteria); if (events.length > 0 || !Logger.short_circuit) events = OVERLAP(events, hqmfjs.MeasurePeriod(patient)); if (events.length == 0) events.specificContext=hqmf.SpecificsManager.empty(); return events; } hqmfjs.During_848524E7_B51E_4993_A13E_A229CCCFB01E_9A8AED90_46D1_4253_ABBE_5C984FADB2E1 = function(patient, initialSpecificContext) { var events = UNION( hqmfjs.OfficeVisit_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c59(patient, initialSpecificContext), hqmfjs.Face_to_FaceInteraction_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725b0c5e(patient, initialSpecificContext), hqmfjs.PreventiveCareServices_EstablishedOfficeVisit18andUp_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c5a(patient, initialSpecificContext), hqmfjs.PreventiveCareServices_InitialOfficeVisit18andUp_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c5b(patient, initialSpecificContext), hqmfjs.HomeHealthcareServices_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c5d(patient, initialSpecificContext), hqmfjs.AnnualWellnessVisit_EncounterPerformed_8a4d92b2_39ca_af4b_0139_d472725a0c5c(patient, initialSpecificContext), hqmfjs.OphthalmologicalServices_EncounterPerformed_92c28176_3c50_4452_ac8e_e045c337e37c(patient, initialSpecificContext) ); if (events.length > 0 || !Logger.short_circuit) events = DURING(events, hqmfjs.MeasurePeriod(patient)); if (events.length == 0) events.specificContext=hqmf.SpecificsManager.empty(); return events; } hqmfjs.less_thn_eql_12monthsEndsBeforeStartOf_ED92B4B5_7678_44C8_A330_A85BE981F440_8a4d92b2_39ca_af4b_0139_d472725a0c54 = function(patient, initialSpecificContext) { var eventCriteria = {"type": "procedureResults", "statuses": ["performed"], "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.464.1003.115.12.1088"}; var events = patient.getEvents(eventCriteria); events = filterEventsByValue(events, new CodeList(getCodes("2.16.840.1.113883.3.464.1003.195.12.1002"))); if (events.length > 0 || !Logger.short_circuit) events = EBS(events, hqmfjs.MeasurePeriod(patient), new IVL_PQ(null, new PQ(12, "mo", true))); if (events.length == 0) events.specificContext=hqmf.SpecificsManager.empty(); return events; } hqmfjs.During_F8E035BB_9B96_4496_A514_A874E313F228_8a4d92b2_39ca_af4b_0139_d472725a0c54 = function(patient, initialSpecificContext) { var eventCriteria = {"type": "procedureResults", "statuses": ["performed"], "includeEventsWithoutStatus": true, "valueSetId": "2.16.840.1.113883.3.464.1003.115.12.1088"}; var events = patient.getEvents(eventCriteria); if (events.length > 0 || !Logger.short_circuit) events = DURING(events, hqmfjs.MeasurePeriod(patient)); if (events.length == 0) events.specificContext=hqmf.SpecificsManager.empty(); return events; } hqmfjs.SatisfiesAny_7C5284AE_2BA3_40D5_86EB_FA7773542CE4_EA895040_F653_4989_97C8_04ACD4C894FE = function(patient, initialSpecificContext) { var events = UNION( hqmfjs.less_thn_eql_12monthsEndsBeforeStartOf_ED92B4B5_7678_44C8_A330_A85BE981F440_8a4d92b2_39ca_af4b_0139_d472725a0c54(patient, initialSpecificContext), hqmfjs.During_F8E035BB_9B96_4496_A514_A874E313F228_8a4d92b2_39ca_af4b_0139_d472725a0c54(patient, initialSpecificContext) ); hqmf.SpecificsManager.setIfNull(events); return events; } // ######################### // ##### MEASURE LOGIC ##### // ######################### hqmfjs.initializeSpecifics = function(patient_api, hqmfjs) { hqmf.SpecificsManager.initialize(patient_api,hqmfjs) } // INITIAL PATIENT POPULATION hqmfjs.IPP = function(patient, initialSpecificContext) { population_criteria_fn = allTrue('IPP', patient, initialSpecificContext, allTrue('5', patient, initialSpecificContext, hqmfjs.Overlaps_1AE43340_8179_4BEA_A845_A54966547591_B4D15F1B_C531_4221_83F8_775F13C28484, hqmfjs.Agegrtr_thn_eql_18yearsat_9B99C28F_3816_429D_94A2_FFC4F2611A64_FC504401_E9E3_49B6_8CA1_7D747642AC68, hqmfjs.Ageless_thn_75yearsat_A5A73D1F_4120_443E_B2D2_6686AB2C85D6_1648BE97_6AFA_4D8F_AFF1_466947B3FBEE, hqmfjs.During_848524E7_B51E_4993_A13E_A229CCCFB01E_9A8AED90_46D1_4253_ABBE_5C984FADB2E1 ) ); if (typeof(population_criteria_fn) == 'function') { return population_criteria_fn(); } else { return population_criteria_fn; } }; // STRATIFICATION hqmfjs.STRAT=null; // DENOMINATOR hqmfjs.DENOM = function(patient) { return new Boolean(true); } // NUMERATOR hqmfjs.NUMER = function(patient, initialSpecificContext) { population_criteria_fn = allTrue('NUMER', patient, initialSpecificContext, allTrue('7', patient, initialSpecificContext, hqmfjs.SatisfiesAny_7C5284AE_2BA3_40D5_86EB_FA7773542CE4_EA895040_F653_4989_97C8_04ACD4C894FE ) ); if (typeof(population_criteria_fn) == 'function') { return population_criteria_fn(); } else { return population_criteria_fn; } }; hqmfjs.NUMEX = function(patient) { return new Boolean(false); } hqmfjs.DENEX = function(patient) { return new Boolean(false); } hqmfjs.DENEXCEP = function(patient) { return new Boolean(false); } // CV hqmfjs.MSRPOPL = function(patient) { return new Boolean(true); } hqmfjs.MSRPOPLEX = function(patient) { return new Boolean(false); } hqmfjs.OBSERV = function(patient) { return new Boolean(false); } // VARIABLES hqmfjs.VARIABLES = function(patient, initialSpecificContext) { return false; } var occurrenceId = null; hqmfjs.initializeSpecifics(patient_api, hqmfjs) var population = function() { return executeIfAvailable(hqmfjs.IPP, patient_api); } var stratification = null; if (hqmfjs.STRAT) { stratification = function() { return hqmf.SpecificsManager.setIfNull(executeIfAvailable(hqmfjs.STRAT, patient_api)); } } var denominator = function() { return executeIfAvailable(hqmfjs.DENOM, patient_api); } var numerator = function() { return executeIfAvailable(hqmfjs.NUMER, patient_api); } var exclusion = function() { return executeIfAvailable(hqmfjs.DENEX, patient_api); } var denexcep = function() { return executeIfAvailable(hqmfjs.DENEXCEP, patient_api); } var numex = function() { return executeIfAvailable(hqmfjs.NUMEX, patient_api); } var msrpopl = function() { return executeIfAvailable(hqmfjs.MSRPOPL, patient_api); } var msrpoplex = function() { return executeIfAvailable(hqmfjs.MSRPOPLEX, patient_api); } var observ = function(specific_context) { var observFunc = hqmfjs.OBSERV if (typeof(observFunc)==='function') return observFunc(patient_api, specific_context); else return []; } var variables = function() { if (Logger.enable_rationale) { return executeIfAvailable(hqmfjs.VARIABLES, patient_api); } } var executeIfAvailable = function(optionalFunction, patient_api) { if (typeof(optionalFunction)==='function') { result = optionalFunction(patient_api); return result; } else { return false; } } if (typeof Logger != 'undefined') { // clear out logger Logger.logger = []; Logger.rationale={}; if (typeof short_circuit == 'undefined') short_circuit = true; // turn on logging if it is enabled if (enable_logging || enable_rationale) { injectLogger(hqmfjs, enable_logging, enable_rationale, short_circuit); } else { Logger.enable_rationale = false; Logger.short_circuit = short_circuit; } } try { map(patient, population, denominator, numerator, exclusion, denexcep, msrpopl, msrpoplex, observ, occurrenceId,false,stratification, variables, numex); } catch(err) { print(err.stack); throw err; } }; finalize function:function (key, value) { var patient = value; patient.measure_id = "40280381-51F0-825B-0152-22A24CDD1740"; patient.nqf_id = "0055"; patient.effective_date = 1421280000; if (patient.provider_performances) { var tmp = []; for(var i=0; i 1389744000)) || // Late Overlap ((value['start_date'] < 1421280000) && (value['end_date'] >= 1421280000 || value['end_date'] == null)) || // Full Overlap ((value['start_date'] <= 1389744000 || value['start_date'] == null) && (value['end_date'] >= 1421280000 || value['end_date'] == null)) || // Full Containment (value['start_date'] > 1389744000 && value['end_date'] < 1421280000) ) tmp.push(value); } if (tmp.length > 0) { patient.provider_performances = tmp; } else { sortedProviders = _.sortBy(patient.provider_performances, function(performance){return performance['end_date']}); patient.provider_performances = [_.last(sortedProviders)]; } } return patient;} PreFilter: {} E Finished in 0.564000s, 1.7730 runs/s, 0.0000 assertions/s. 1) Error: MapReduceExecutorTest#test_map_records_into_measure_groups: Mongo::Error::OperationFailure: SyntaxError: missing ) in parenthetical @:347:9 (139) C:/SOURCE/APPS/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/mongo-2.4.2/lib/mongo/operation/result.rb:256:in `validate!' C:/SOURCE/APPS/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/mongo-2.4.2/lib/mongo/operation/executable.rb:37:in `block in execute' C:/SOURCE/APPS/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/mongo-2.4.2/lib/mongo/server/connection_pool.rb:107:in `with_connection' C:/SOURCE/APPS/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/mongo-2.4.2/lib/mongo/server.rb:242:in `with_connection' C:/SOURCE/APPS/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/mongo-2.4.2/lib/mongo/operation/executable.rb:35:in `execute' C:/SOURCE/APPS/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/mongo-2.4.2/lib/mongo/database.rb:161:in `command' C:/Users/amilineni/Downloads/quality-measure-engine-bump_mongoid/quality-measure-engine-bump_mongoid_2.4/lib/qme/map/map_reduce_executor.rb:213:in `map_records_into_measure_groups' test/unit/qme/map/map_reduce_executor_test.rb:28:in `test_map_records_into_measure_groups' 1 runs, 0 assertions, 0 failures, 1 errors, 0 skips