ebmdatalab / openprescribing

A Django app providing a REST API and dashboards for the HSCIC's GP prescribing data
https://openprescribing.net
MIT License
96 stars 26 forks source link

`quantity_means_pack` field had been nulled #4827

Closed inglesp closed 1 week ago

inglesp commented 1 month ago

In investigating #4826, we discovered that Presentation.quantity_means_pack had been set to None for all presentations.

evansd commented 1 month ago

I suspect that this happened as part of the general shenanigans involved in importing new BNF mappings a couple of months ago: https://bennettoxford.slack.com/archives/C051A4P27GE/p1711358086447539

I note from previous times I've done this that sometimes this required manually deleting presentations in order to get the replacements import to work: https://github.com/ebmdatalab/openprescribing/issues/3713#issuecomment-1298438056

I can well imagine that I deleted more than I needed to and then didn't realise I needed to run a separate command to reset the quantity_means_pack field.

Interestingly 1202010U0AAAAAA is the only presentation in the database with that flag set (the other one referenced below doesn't seem to exist any more): https://github.com/ebmdatalab/openprescribing/blob/edc38ccf2e522e45d437d3a93fe41206e5a6549e/openprescribing/frontend/management/commands/set_quantity_means_pack_flag.py#L7-L10

evansd commented 1 week ago

The need to manually delete presentations has been removed in #4879 so hopefully this won't be an issue in future.