dscsa / client

Browser single page application for logging written with Aurelia
3 stars 1 forks source link

Update nadac price for non capsules and tablets to be by unit, not milliliters or other #134

Closed akircher closed 8 years ago

akircher commented 8 years ago

More generally, if someone manually updates an incorrect price, do we override it with a new update or keep it forever? Can we programmatically fix incorrect prices?

akircher commented 8 years ago

Related to #34

akircher commented 8 years ago

Related to #164

minasow commented 8 years ago

What if we modified the update method, more generally, to consider the change it's about to make and see if it's reasonable, within some measure? Could it look at the old price (which may or may not have been manually edited) and the new price it found (which may be totally wrong) and if there's some crazy ratio or difference between the two, that's probably because this was manually updated from an incorrect value, so it leaves it alone. Based off the assumption that the prices aren't regularly going to actually change that much? Also, if the pricing data eventually improves, then it'll correct itself here.

minasow commented 8 years ago

I see. I checked the response from NADAC and GoodRx. NADAC gives a field called "pricing_unit" which I've so far seen as either "EA" or "ML". I'm assuming "EA" means each, so it would be per unit as opposed to milliliters, and we can check for that. GoodRx doesn't seem to have a similar field, but it does have a "quantity" field and for injections it seems to usually be one, so they're giving us data in unit-of-use by default?

akircher commented 8 years ago

In the NADAC response could we do a REGEX like /\/\d*ml/ to search for the # of milliliters in the denominator and if the units is expressed in ML then we multiply the price by what the regex finds. Maybe that will give us all prices in units?

If that does not work or is error prone, maybe we talk about keeping everything in milliliters. However then we have to convert goodrx to milliliters which will likely be even harder.

Adam

On Sep 1, 2016, at 11:27 AM, owsow notifications@github.com wrote:

I see. I checked the response from NADAC and GoodRx. NADAC gives a field called "pricing_unit" which I've so far seen as either "EA" or "ML". I'm assuming "EA" means each, so it would be per unit as opposed to milliliters, and we can check for that. GoodRx doesn't seem to have a similar field, but it does have a "quantity" field and for injections it seems to usually be one, so they're giving us data in unit-of-use and we'd need to manipulate the price knowing the strength.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dscsa/client/issues/134#issuecomment-244168455, or mute the thread https://github.com/notifications/unsubscribe-auth/AFeBeSVtzGk9d3EOR_M3h6ETK3JQdVsyks5qlxkFgaJpZM4JeJcv.

minasow commented 8 years ago

Submitted pull request with functionality that does that. Can continue to evaluate whether that totally solves the more general issue.