-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update opioidome.json #2907
Update opioidome.json #2907
Conversation
reinstate measure, using DM+D to automatically create OMEs using strengths.
In brief: I have created a new table (
This table then feeds into a new view, which calculates the OME using the DM+D strength details, prescribing data, and the OME table above:
I have compared the output of the table above with the previous one. The main differences are:
The vast majority of the OMEs were the same for both methods. |
nb. CI fails due to an unrelated issue which we're fixing in another PR |
@richiecroker CI fix now merged, I think if you rebase/merge on the master branch and re-push it here, it should look better |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please could you:
- put the SQL for
vw__opioids_total_ome
andvw__opioids_total_dmd
in the measure_sql directory, including the comment like one that's at the top of opioid_total_ome.sql in the same directory - delete opioid_total_ome.sql
- update the list of tables here
@inglesp done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an impressive piece of work -- for this much SQL it was very easy to review! But unfortunately it's not quite right, because vw__opioid_measure_dmd
is going to contain duplicate rows, which means that some prescribing will be double-counted in the measure.
I think the fix will be to create a subquery (or a view if that's easier) that contains one row per BNF code, with column for ome_dose
. Then, in your main query, you can join against this subquery/view, and sum over the ome_dose
column.
If any of this is unclear, let me know.
openprescribing/frontend/management/commands/measure_sql/vw__opioids_total_dmd.sql
Outdated
Show resolved
Hide resolved
openprescribing/frontend/management/commands/measure_sql/vw__opioids_total_dmd.sql
Outdated
Show resolved
Hide resolved
openprescribing/frontend/management/commands/measure_sql/vw__opioids_total_dmd.sql
Outdated
Show resolved
Hide resolved
openprescribing/frontend/management/commands/measure_sql/vw__opioids_total_dmd.sql
Outdated
Show resolved
Hide resolved
openprescribing/frontend/management/commands/measure_sql/vw__opioids_total_dmd.sql
Outdated
Show resolved
Hide resolved
openprescribing/frontend/management/commands/measure_sql/vw__opioids_total_dmd.sql
Outdated
Show resolved
Hide resolved
Thanks for the review @inglesp - although strangely when i've checked against the existing measure there didn't appear to be an differences in |
How did you check this?
If we've worked out the ADQ per ingredient, is it valid to sum the ADQs over a VMP's ingredients to get a VMP's ADQ? If so, that's in the fiddly/doable quadrant. |
I've had a brief look and I estimate this is going to be at least a half day work to review this measure. It's on my longer TODO list but likely to be awhile before I get to it. |
reviewed and amended - now only uses VMP via link to generic BNF code in order to fix duplication issues
added DISTINCT back in to ensure single vmp, and added in udf calculation
changed SQL to new classification
Agree with the opioid equivalence in the main. A couple of comments:
Otherwise, in general agreement with latest equivalence data, particularly as this should be viewed as an estimate of total ome. |
Thanks to @charliedthomas for the review, I have made changes as recommended, and final table below:
|
whitespace
reordered drug code list into strength order so easier to check
code completely rewritten to take account of VMP/AMP duplication
Updated methodology notebook can be found here.
@CarolineMorton are you able to check and approve this please, from both coding and clinical perspective? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is absolutely fantastic work. So useful from a clinical perspective. Only minor comments. Happy to approve this.
@richiecroker Slack down for me at present so hopefully you see this is approved
CASE WHEN unit_num.descr = 'microgram' THEN vpi.strnt_nmrtr_val / 1000 #creates miligram value from mcg value | ||
WHEN unit_num.descr = 'gram' THEN vpi.strnt_nmrtr_val * 1000 #creates miligram value from gram value | ||
WHEN unit_num.descr = 'mg' THEN vpi.strnt_nmrtr_val #no change if mg value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very nice in terms of documentation.
"numerator_short": "Total opioids prescribed (in OME mg)", | ||
"denominator_short": "1000 patients", | ||
"why_it_matters": [ | ||
"*TO BE AMENDED* The <a href='https://www.rcoa.ac.uk/faculty-of-pain-medicine/opioids-aware'> Opioids Aware</a> project seeks to ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to highlight that the TO BE AMENDED is still there in this text. Is this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, i need to make sure it's right before I publish!
"why_it_matters": [ | ||
"*TO BE AMENDED* The <a href='https://www.rcoa.ac.uk/faculty-of-pain-medicine/opioids-aware'> Opioids Aware</a> project seeks to ", | ||
"improve prescribing of opioid analgesia. There is little evidence that opioids are helpful in long term pain, ", | ||
"and the risk of harm increases significantly above 120mg morphine (or equivalent) per day, without much increase in benefit. ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe either add a reference or harm such as ....
to text
reinstate measure, using DM+D to automatically create OMEs using strengths.