Skip to content

Commit

Permalink
Update saba.json
Browse files Browse the repository at this point in the history
fix duplication issues
  • Loading branch information
richiecroker committed Dec 2, 2024
1 parent 16c324e commit c94b318
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions openprescribing/measures/definitions/saba.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,15 @@
"numerator_from": [
"{hscic}.normalised_prescribing p ",
"INNER JOIN {dmd}.vmp vmp ON CONCAT(SUBSTR(p.bnf_code,0,9),'AA', SUBSTR(p.bnf_code,-2), SUBSTR(p.bnf_code,-2)) = vmp.bnf_code -- joins prescribing data to vmp table using generic BNF code \n",
"INNER JOIN {measures}.vw__dmd_objs_with_form_route AS route ON vmp.id = route.vpid",
"INNER JOIN {measures}.vw__inhaler_quantity_adjustment AS adj ON p.bnf_code = adj.bnf_code AND p.month = adj.date"
"INNER JOIN (",
"SELECT DISTINCT bnf_code, form_route FROM measures.vw__dmd_objs_with_form_route",
"WHERE form_route IN ('pressurizedinhalation.inhalation', 'powderinhalation.inhalation', 'inhalationsolution.inhalation')",
") AS route",
"ON p.bnf_code = route.bnf_code",
"INNER JOIN (",
"SELECT DISTINCT bnf_code, date, qtyadj FROM measures.vw__inhaler_quantity_adjustment",
") AS adj",
"ON p.bnf_code = adj.bnf_code AND p.month = adj.date"
],
"numerator_where": [
"route.form_route IN ('pressurizedinhalation.inhalation', 'powderinhalation.inhalation', 'inhalationsolution.inhalation')",
Expand All @@ -43,8 +50,15 @@
"denominator_from": [
"{hscic}.normalised_prescribing p ",
"INNER JOIN {dmd}.vmp vmp ON CONCAT(SUBSTR(p.bnf_code,0,9),'AA', SUBSTR(p.bnf_code,-2), SUBSTR(p.bnf_code,-2)) = vmp.bnf_code -- joins prescribing data to vmp table using generic BNF code \n",
"INNER JOIN {measures}.vw__dmd_objs_with_form_route AS route ON vmp.id = route.vpid",
"INNER JOIN {measures}.vw__inhaler_quantity_adjustment AS adj ON p.bnf_code = adj.bnf_code AND p.month = adj.date"
"INNER JOIN (",
"SELECT DISTINCT bnf_code, form_route FROM measures.vw__dmd_objs_with_form_route",
"WHERE form_route IN ('pressurizedinhalation.inhalation', 'powderinhalation.inhalation', 'inhalationsolution.inhalation')",
") AS route",
"ON p.bnf_code = route.bnf_code",
"INNER JOIN (",
"SELECT DISTINCT bnf_code, date, qtyadj FROM measures.vw__inhaler_quantity_adjustment",
") AS adj",
"ON p.bnf_code = adj.bnf_code AND p.month = adj.date"
],
"denominator_where": [
"route.form_route IN ('pressurizedinhalation.inhalation', 'powderinhalation.inhalation', 'inhalationsolution.inhalation')",
Expand Down

0 comments on commit c94b318

Please sign in to comment.