Hi
What you are attempting should certainly be possible. Any column of the EPD can be used for an API call in either R or Python. So therefore, replacing PCO_Code with ICB_CODE should allow for a whole ICB areas data to be requested and likewise for BNF_CHEMICAL_SUBSTANCE to be replaced with BNF_CHAPTER_PLUS_CODE etc.
It has been reported to us that sometimes the size of the EPD data means that sometimes systems and queries can struggle to hold/pull all the data requested.
@allotherusers can anyone help dape with this query in terms example code?
This discussion has now been closed
I’m trying to use EPD data through the API using R. I’ve been to github and followed the code there (https://github.com/nhsbsa-data-analytics/open-data-portal-api/find/master) which was helpful but I am struggling to modify my query. It appears that as a minimum I have to specify the CCG/SICBL (pco_code) and the chemical (bnf_chemical_substance). However, I’d hoped for greater flexibility for example, getting prescriptions for an entire ICB or a BNF chapter. I have tried changing the SQL query to remove these terms thus making it more general and using wildcards for example, to include more CCGs but had no luck. I have included extra terms though this only limits my search rather than expands it. A potential workaround is to loop through all of the CCGs/chemicals I am interested in however I can figure out how to first get a list to then loop through.