diff --git a/fixtures/measures/0061_diabetes_bp/patients/denominator1.json b/fixtures/measures/0061_diabetes_bp/patients/denominator1.json new file mode 100644 index 0000000..163199a --- /dev/null +++ b/fixtures/measures/0061_diabetes_bp/patients/denominator1.json @@ -0,0 +1,11 @@ +{ + "first": "Bert", // personal data + "last": "Bloggs", + "gender": "M", + "birthdate": -290390400, // Time.gm(1960, 10, 19).to_i + "measures": { // bag of measures, one entry per measure + "0061": { + "medications_indicative_of_diabetes_medication_dispensed": 1277856000 // Time.gm(2010, 6, 30).to_i + } + } +} \ No newline at end of file diff --git a/fixtures/measures/0061_diabetes_bp/patients/denominator2.json b/fixtures/measures/0061_diabetes_bp/patients/denominator2.json new file mode 100644 index 0000000..b9bd10f --- /dev/null +++ b/fixtures/measures/0061_diabetes_bp/patients/denominator2.json @@ -0,0 +1,12 @@ +{ + "first": "Sarah", // personal data + "last": "Bloggs", + "gender": "F", + "birthdate": -290390400, // Time.gm(1960, 10, 19).to_i + "measures": { // bag of measures, one entry per measure + "0061": { + "diabetes_diagnosis_active": 1277856000, // Time.gm(2010, 6, 30).to_i + "encounter_acute_inpatient_or_ed_encounter": 1277856000 // Time.gm(2010, 6, 30).to_i + } + } +} \ No newline at end of file diff --git a/fixtures/measures/0061_diabetes_bp/patients/denominator3.json b/fixtures/measures/0061_diabetes_bp/patients/denominator3.json new file mode 100644 index 0000000..120dc82 --- /dev/null +++ b/fixtures/measures/0061_diabetes_bp/patients/denominator3.json @@ -0,0 +1,12 @@ +{ + "first": "Paul", // personal data + "last": "Hewson", + "gender": "M", + "birthdate": 340761600, // Time.gm(1980, 10, 19).to_i + "measures": { // bag of measures, one entry per measure + "0061": { + "diabetes_diagnosis_active": 1277856000, // Time.gm(2010, 6, 30).to_i + "encounter_non_acute_inpatient_outpatient_or_ophthalmology_encounter": [1275177600, 1277856000] // Time.gm(2010, 5, 30).to_i and Time.gm(2010, 6, 30).to_i + } + } +} \ No newline at end of file diff --git a/fixtures/measures/0061_diabetes_bp/patients/denominator4.json b/fixtures/measures/0061_diabetes_bp/patients/denominator4.json new file mode 100644 index 0000000..0c25095 --- /dev/null +++ b/fixtures/measures/0061_diabetes_bp/patients/denominator4.json @@ -0,0 +1,32 @@ +{ // not in the numerator since bp result is normal + "first": "Curt", // personal data + "last": "Smith", + "gender": "M", + "birthdate": -290390400, // Time.gm(1960, 10, 19).to_i + "measures": { // bag of measures, one entry per measure + "0061": { + "medications_indicative_of_diabetes_medication_dispensed": 1277856000, // Time.gm(2010, 6, 30).to_i + "encounter_non_acute_inpatient_outpatient_or_ophthalmology_encounter": [1275177600, 1277856000], // Time.gm(2010, 5, 30).to_i and Time.gm(2010, 6, 30).to_i + "systolic_blood_pressure_physical_exam_finding": [ + { + "date": 1277856000, // Time.gm(2010, 6, 30).to_i + "value": 130 + }, + { + "date": 1277856000, // Time.gm(2010, 6, 30).to_i + "value": 150 + } + ], + "diastolic_blood_pressure_physical_exam_finding": [ + { + "date": 1277856000, // Time.gm(2010, 6, 30).to_i + "value": 85 + }, + { + "date": 1277856000, // Time.gm(2010, 6, 30).to_i + "value": 100 + } + ] + } + } +} \ No newline at end of file diff --git a/fixtures/measures/0061_diabetes_bp/patients/exclusion.json b/fixtures/measures/0061_diabetes_bp/patients/exclusion.json new file mode 100644 index 0000000..3d12d8f --- /dev/null +++ b/fixtures/measures/0061_diabetes_bp/patients/exclusion.json @@ -0,0 +1,12 @@ +{ + "first": "Sarah", // personal data + "last": "Evans", + "gender": "F", + "birthdate": -467337600, // Time.gm(1955, 3, 12).to_i + "measures": { // bag of measures, one entry per measure + "0061": { + "medications_indicative_of_diabetes_medication_dispensed": 1277856000, // Time.gm(2010, 6, 30).to_i + "polycystic_ovaries_diagnosis_active": 1272585600 // Time.gm(2010, 4, 30).to_i + } + } +} \ No newline at end of file diff --git a/fixtures/measures/0061_diabetes_bp/patients/numerator1.json b/fixtures/measures/0061_diabetes_bp/patients/numerator1.json new file mode 100644 index 0000000..3d39e67 --- /dev/null +++ b/fixtures/measures/0061_diabetes_bp/patients/numerator1.json @@ -0,0 +1,24 @@ +{ + "first": "Suzanne", + "last": "Smith", + "gender": "F", + "birthdate": -290390400, // Time.gm(1960, 10, 19).to_i + "measures": { + "0061": { + "medications_indicative_of_diabetes_medication_dispensed": 1277856000, // Time.gm(2010, 6, 30).to_i + "encounter_non_acute_inpatient_outpatient_or_ophthalmology_encounter": [1275177600, 1277856000], // Time.gm(2010, 5, 30).to_i and Time.gm(2010, 6, 30).to_i + "systolic_blood_pressure_physical_exam_finding": [ + { + "date": 1277856000, // Time.gm(2010, 6, 30).to_i + "value": 145 + } + ], + "diastolic_blood_pressure_physical_exam_finding": [ + { + "date": 1277856000, // Time.gm(2010, 6, 30).to_i + "value": 85 + } + ] + } + } +} \ No newline at end of file diff --git a/fixtures/measures/0061_diabetes_bp/patients/numerator_eye2.json b/fixtures/measures/0061_diabetes_bp/patients/numerator_eye2.json new file mode 100644 index 0000000..ab18886 --- /dev/null +++ b/fixtures/measures/0061_diabetes_bp/patients/numerator_eye2.json @@ -0,0 +1,8 @@ +{ + "first": "Lilian", // personal data + "last": "Smith", + "gender": "F", + "birthdate": -290390400, // Time.gm(1960, 10, 19).to_i + "measures": { // bag of measures, one entry per measure + } +} \ No newline at end of file diff --git a/fixtures/measures/0061_diabetes_bp/patients/population_all1.json b/fixtures/measures/0061_diabetes_bp/patients/population_all1.json new file mode 100644 index 0000000..528a6a5 --- /dev/null +++ b/fixtures/measures/0061_diabetes_bp/patients/population_all1.json @@ -0,0 +1,8 @@ +{ + "first": "Jennifer", // personal data + "last": "Thompson", + "gender": "F", + "birthdate": -290390400, // Time.gm(1960, 10, 19).to_i + "measures": { // bag of measures, one entry per measure + } +} \ No newline at end of file diff --git a/fixtures/measures/0061_diabetes_bp/patients/population_all2.json b/fixtures/measures/0061_diabetes_bp/patients/population_all2.json new file mode 100644 index 0000000..b9bb10c --- /dev/null +++ b/fixtures/measures/0061_diabetes_bp/patients/population_all2.json @@ -0,0 +1,8 @@ +{ + "first": "Emily", // personal data + "last": "Jones", + "gender": "F", + "birthdate": -290390400, // Time.gm(1960, 10, 19).to_i + "measures": { // bag of measures, one entry per measure + } +} \ No newline at end of file diff --git a/fixtures/measures/0061_diabetes_bp/result.json b/fixtures/measures/0061_diabetes_bp/result.json new file mode 100644 index 0000000..035fb61 --- /dev/null +++ b/fixtures/measures/0061_diabetes_bp/result.json @@ -0,0 +1,7 @@ +{ + "id": "0061", + "initialPopulation": 9, + "numerator": 1, + "denominator": 5, + "exclusions": 1 +} diff --git a/measure_props/NQF_Retooled_Measure_0061.xlsx.json.patch b/measure_props/NQF_Retooled_Measure_0061.xlsx.json.patch new file mode 100644 index 0000000..8a39b6e --- /dev/null +++ b/measure_props/NQF_Retooled_Measure_0061.xlsx.json.patch @@ -0,0 +1,19 @@ +{ + "N_364": { + "standard_code_list": "163031004, 174255007, 23154005, 251073000, 271650006, 314451001, 314452008, 314453003, 314454009, 314455005, 314456006, 314457002, 314458007, 314459004, 314460009, 314461008, 314462001, 314465004, 315613000, 400975005, 407555005, 407557002, 42689008, 53813002", + "value": { + "type": "number", + "description": "diastolic blood pressure", + "date_description": "Date of diastolic blood pressure" + } + }, + "N_1279": { + "standard_code_list": "12929001, 163030003, 251070002, 251071003, 271649006, 314438006, 314439003, 314440001, 314441002, 314442009, 314443004, 314444005, 314445006, 314446007, 314447003, 314448008, 314449000, 314464000, 315612005, 399304008, 400974009, 407554009, 407556006, 72313002, 81010002", + "value": { + "type": "number", + "description": "systolic blood pressure", + "date_description": "Date of systolic blood pressure" + } + } +} + diff --git a/measures/0055_diabetes_foot/0055_NQF_Diabetes_Eye_Exam.js b/measures/0055_diabetes_foot/0055_NQF_Diabetes_Eye_Exam.js deleted file mode 100644 index 9c8c3dd..0000000 --- a/measures/0055_diabetes_foot/0055_NQF_Diabetes_Eye_Exam.js +++ /dev/null @@ -1,44 +0,0 @@ -function () { - var patient = this; - var measure = patient.measures["0055"]; - if (measure==null) - measure={}; - - <%= init_js_frameworks %> - - // TODO: rjm Get these definitions into the 'diabetes_utils.js' file - // that is located in the /js directory of the project for shared - // code across all of the diabetes measures. - var year = 365 * 24 * 60 * 60; - var effective_date = <%= effective_date %>; - var earliest_birthdate = effective_date - 74 * year; - var latest_birthdate = effective_date - 17 * year; - var earliest_diagnosis = effective_date - 2 * year; - var year_prior_to_measurement_period = effective_date - 3 * year; - - var population = function() { - return diabetes_population(patient, earliest_birthdate, latest_birthdate); - } - - var denominator = function() { - return diabetes_denominator(measure, earliest_diagnosis, effective_date); - } - - // This numerator function is the only code that is specific to this particular - // MU diabetes measure. All of the other definitions for the initial population, - // the denominator, and the exclusions are shared in the 'diabetes_utils.js' file - // that is located in the /js directory of the project - var numerator = function() { - return (inRange(measure.procedure_eye_exam, earliest_diagnosis, effective_date) - || (inRange(measure.procedure_eye_exam, year_prior_to_measurement_period, effective_date) - && - !inRange(measure.diabetic_retinopathy, year_prior_to_measurement_period, effective_date)) - ); - } - - var exclusion = function() { - return diabetes_exclusions(measure, earliest_diagnosis, effective_date); - } - - map(patient, population, denominator, numerator, exclusion); -}; \ No newline at end of file diff --git a/stage/diabetes/components/0061_NQF_Diabetes_Blood_Pressure_Management.js b/measures/0061_diabetes_bp/0061_NQF_Diabetes_Blood_Pressure_Management.js similarity index 57% rename from stage/diabetes/components/0061_NQF_Diabetes_Blood_Pressure_Management.js rename to measures/0061_diabetes_bp/0061_NQF_Diabetes_Blood_Pressure_Management.js index 5b5d4ab..25623c5 100644 --- a/stage/diabetes/components/0061_NQF_Diabetes_Blood_Pressure_Management.js +++ b/measures/0061_diabetes_bp/0061_NQF_Diabetes_Blood_Pressure_Management.js @@ -28,16 +28,12 @@ function () { // the denominator, and the exclusions are shared in the 'diabetes_utils.js' file // that is located in the /js directory of the project var numerator = function() { - var latest_encounter_acute_inpatient=null, latest_encounter_non_acute_inpatient=null, latest_encounter_outpatient=null, latest_encounter_outpatient_ophthamological_services=null; - if (measure.encounter_acute_inpatient) - latest_encounter_acute_inpatient = _.max(_.select(measure.encounter_acute_inpatient, function(when){return inRange(when, period_start, effective_date); })); - if (measure.encounter_non_acute_inpatient) - latest_encounter_non_acute_inpatient = _.max(_.select(measure.encounter_non_acute_inpatient, function(when){return inRange(when, period_start, effective_date); })); - if (measure.encounter_outpatient) - latest_encounter_outpatient = _.max(_.select(measure.encounter_outpatient, function(when){return inRange(when, period_start, effective_date); })); - if (measure.encounter_outpatient_ophthamological_services) - latest_encounter_outpatient_ophthamological_services = _.max(_.select(measure.encounter_outpatient_ophthamological_services, function(when){return inRange(when, period_start, effective_date); })); - latest_encounter = _.max([latest_encounter_acute_inpatient, latest_encounter_non_acute_inpatient, latest_encounter_outpatient, latest_encounter_outpatient_ophthamological_services]); + var latest_encounter_acute=null, latest_encounter_other=null; + if (measure.encounter_acute_inpatient_or_ed_encounter) + latest_encounter_acute = _.max(_.select(measure.encounter_acute_inpatient_or_ed_encounter, function(when){return inRange(when, period_start, effective_date); })); + if (measure.encounter_non_acute_inpatient_outpatient_or_ophthalmology_encounter) + latest_encounter_other = _.max(_.select(measure.encounter_non_acute_inpatient_outpatient_or_ophthalmology_encounter, function(when){return inRange(when, period_start, effective_date); })); + latest_encounter = _.max([latest_encounter_acute, latest_encounter_other]); if (latest_encounter==null) return false; @@ -47,8 +43,8 @@ function () { start_latest_encounter = latest_encounter-day; end_latest_encounter = latest_encounter+day; - systolic_min = minValueInDateRange(measure.systolic_blood_pressure, start_latest_encounter, end_latest_encounter, 200); - diastolic_min = minValueInDateRange(measure.diastolic_blood_pressure, start_latest_encounter, end_latest_encounter, 200); + systolic_min = minValueInDateRange(measure.systolic_blood_pressure_physical_exam_finding, start_latest_encounter, end_latest_encounter, 200); + diastolic_min = minValueInDateRange(measure.diastolic_blood_pressure_physical_exam_finding, start_latest_encounter, end_latest_encounter, 200); return (systolic_min<140 && diastolic_min<90); } diff --git a/measures/0061_diabetes_bp/0061_NQF_Diabetes_Blood_Pressure_Management.json b/measures/0061_diabetes_bp/0061_NQF_Diabetes_Blood_Pressure_Management.json new file mode 100644 index 0000000..72acb00 --- /dev/null +++ b/measures/0061_diabetes_bp/0061_NQF_Diabetes_Blood_Pressure_Management.json @@ -0,0 +1,136 @@ +{ + "id": "0061", + "properties": "NQF_Retooled_Measure_0061.xlsx.json", + "name": "Diabetes Blood Pressure Management", + "description": "The percentage of patients 18–75 years of age with diabetes (type 1 or type 2) who had BP <140/90 mmHg.", + "category": "Diabetes", + "steward": "NCQA", + "parameters": { + "effective_date": { + "description": "Effective end date for measure", + "type": "number", + "format": "utc-sec" + } + }, + "patient": { + "birthdate": { + "description": "Date of birth", + "critical": true, + "type": "number", + "format": "utc-sec", + "codes": [ + { + "set": "HL7", + "version": "3.0", + "values": [ + "00110" + ] + } + ] + } + }, + "population": { + "category": "Patient Characteristic", + "title": "Age between 17 and 74" + }, + "denominator": { + "or": [ + { + "category": "Medication", + "title": "Medication Indicative of Diabetes Within 2 years" + }, + { + "and": [ + { + "category": "Diagnosis", + "title": "Diabetes Active Within 2 years" + }, + { + "or": [ + { + "category": "Encounter", + "title": "Acute Inpatient or ED" + }, + { + "category": "Encounter", + "title": "Non‐Acute Inpatient, Outpatient, or Ophthalmology" + } + ] + } + ] + } + ] + }, + "numerator": { + "and": [ + { + "category": "Physical Exam Finding", + "title": "Minimum diastolic BP during most recent encounter < 90" + }, + { + "category": "Physical Exam Finding", + "title": "Minimum systolic BP during most recent encounter < 140" + } + ] + }, + "exclusions": { + "or": [ + { + "and": [ + { + "category": "Diagnosis", + "title": "Polycystic Ovaries" + }, + { + "and": [ + { + "category": "Diagnosis", + "title": "Diabetes Not Active Within 2 years" + }, + { + "or": [ + { + "category": "Encounter", + "title": "No Acute Inpatient or ED" + }, + { + "category": "Encounter", + "title": "No Non‐Acute Inpatient, Outpatient, or Ophthalmology" + } + ] + } + ] + } + ] + }, + { + "and": [ + { + "category": "Diagnosis", + "title": "Gestational Diabetes or Steroid Induced Diabetes Within 2 years" + }, + { + "category": "Medication", + "title": "Medications Indicative of Diabetes Within 2 years" + }, + { + "category": "Diagnosis", + "title": "Diabetes Active within 2 years" + }, + { + "or": [ + { + "category": "Encounter", + "title": "Acute Inpatient or ED Within 2 years" + }, + { + "category": "Encounter", + "title": "Non‐Acute Inpatient, Outpatient, or Opthalmology" + } + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/stage/diabetes/diabetes.col b/stage/diabetes/diabetes.col index 2bbd263..b5e6381 100644 --- a/stage/diabetes/diabetes.col +++ b/stage/diabetes/diabetes.col @@ -2,118 +2,6 @@ "root": "root.json", "combinations": [ - { - "metadata": { - "id": "0061", - "name": "Diabetes Blood Pressure Management", - "description": "The percentage of patients 18–75 years of age with diabetes (type 1 or type 2) who had BP <140/90 mmHg.", - "numerator": { - "and": [ - { - "category": "Physical Exam Finding", - "title": "Minimum diastolic BP during most recent encounter < 90" - }, - { - "category": "Physical Exam Finding", - "title": "Minimum systolic BP during most recent encounter < 140" - } - ] - } - }, - "measure": { - "diastolic_blood_pressure": { - "description": "DBP", - "standard_category": "physical_exam", - "type": "array", - "items": { - "type": "object", - "properties": { - "value": { - "description": "DBP", - "type": "number" - }, - "date": { - "description": "DBP Measurement Date", - "type": "number", - "format": "utc-sec" - } - } - }, - "codes": [ - { - "set": "SNOMED-CT", - "version": "Jul-09", - "values": [ - "271649006", - "314438006", - "314439003", - "314440001", - "314441002", - "314442009", - "314443004", - "314444005", - "314445006", - "314446007", - "72313002" - ] - } - ] - }, - "systolic_blood_pressure": { - "description": "SBP", - "standard_category": "physical_exam", - "type": "array", - "items": { - "type": "object", - "properties": { - "value": { - "description": "SBP", - "type": "number" - }, - "date": { - "description": "SBP Measurement Date", - "type": "number", - "format": "utc-sec" - } - } - }, - "codes": [ - { - "set": "SNOMED-CT", - "version": "Jul-09", - "values": [ - "12929001", - "163030003", - "251070002", - "251071003", - "271649006", - "314438006", - "314439003", - "314440001", - "314441002", - "314442009", - "314443004", - "314444005", - "314445006", - "314446007", - "314447003", - "314448008", - "314449000", - "314464000", - "315612005", - "399304008", - "400974009", - "407554009", - "407556006", - "72313002", - "81010002" - ] - } - ] - } - }, - "map_fn": "0061_NQF_Diabetes_Blood_Pressure_Management.js" - }, { "metadata": { "id": "0062",