In order to check whether the GW formulary extract from FDB seems appropriate, we can link the extract to prescribing data, and see whether the majority of prescribing sits within the formulary. As a very rough rule of thumb, we should expect 80% or greater of primary care prescribing to be in the first and second line areas (marked as "preferred" or "green" in this formulary (available here).
The different categories on the formulary are:
#import libraries required for analysis
import pandas as pd
import numpy as np
projectid = "ebmdatalab"
#obtain overall data for formulary prescribing at Guildford and Waveney CCG
form_df = pd.read_gbq("""
SELECT
rx.bnf_name,
rx.bnf_code,
form.RAG_status,
SUM(rx.items) AS items,
SUM(rx.actual_cost) AS actual_cost
FROM
dmd.product AS dmd
JOIN
`tmp_eu.guildford_formulary` AS form
ON
form.snomed_product_code=dmd.dmdid
RIGHT JOIN
`hscic.normalised_prescribing_standard_latest_month` AS rx
ON
dmd.bnf_code = rx.bnf_code
WHERE
rx.pct='09N'
GROUP BY
form.RAG_status,
rx.bnf_name,
rx.bnf_code
ORDER BY
actual_cost DESC
""", projectid, dialect='standard')
# amend DF so that null values read "none"
form_df['RAG_status'] = form_df['RAG_status'].fillna('None')
# group data by RAG status
gp_form_df = form_df.groupby('RAG_status').sum()
gp_form_df['actual_cost'] = gp_form_df['actual_cost'].map('£{:,.0f}'.format)
gp_form_df.head(10)
items | actual_cost | |
---|---|---|
RAG_status | ||
Amber | 3769 | £35,627 |
Amber Star | 6522 | £27,047 |
Black | 1123 | £12,625 |
Blue | 899 | £14,560 |
Mixed | 41 | £11,039 |
None | 252395 | £2,319,411 |
Red | 4517 | £25,357 |
As can be seen, the vast majority of items (94%) are not listed in the extract from FDB. There are also no "preferred" or "green" options in the RAG status. We can confirm this by looking at two ACE inhibitors:
Ramipril is listed in the GW formulary as "Green". Fosinopril is listed in the GW formulary as "non-formulary"
#create df containing ramipril and fosinopril prescribing only
ace_df=form_df.loc[form_df["bnf_code"].str.contains('0205051R0|0205051J0')]
ace_df.head(20)
bnf_name | bnf_code | RAG_status | items | actual_cost | |
---|---|---|---|---|---|
116 | Ramipril_Tab 2.5mg | 0205051R0AAALAL | None | 550 | 3681.86443 |
152 | Ramipril_Tab 5mg | 0205051R0AAAMAM | None | 399 | 2818.67705 |
184 | Ramipril_Cap 10mg | 0205051R0AAADAD | None | 1739 | 2410.40684 |
304 | Ramipril_Cap 5mg | 0205051R0AAACAC | None | 1265 | 1631.85624 |
320 | Ramipril_Tab 10mg | 0205051R0AAANAN | None | 211 | 1564.71178 |
338 | Ramipril_Cap 2.5mg | 0205051R0AAABAB | None | 1021 | 1481.67478 |
563 | Ramipril_Cap 1.25mg | 0205051R0AAAAAA | None | 693 | 888.78039 |
1846 | Ramipril_Oral Soln 2.5mg/5ml S/F | 0205051R0AAATAT | None | 1 | 178.22321 |
2927 | Fosinopril Sod_Tab 20mg | 0205051J0AAABAB | None | 8 | 67.98327 |
3068 | Ramipril_Tab 1.25mg | 0205051R0AAAKAK | None | 38 | 60.37992 |
4711 | Fosinopril Sod_Tab 10mg | 0205051J0AAAAAA | None | 1 | 7.99476 |
Despite this, it appears that neither fosinopril or ramipril have an entry on the FDB extract. We ideally need to know whether this is a) an issue with the extract, or b) whether GWCCG have not included "preferred" or "green" items on the OptimiseRx profile.