coderxio / sagerx

Open drug data pipelines curated by pharmacists.
https://coderx.io/sagerx
Other
45 stars 12 forks source link

Fix to new RXCUI product mart #290

Closed jrlegrand closed 4 months ago

jrlegrand commented 4 months ago

Explanation

It was identified that there were duplicate rows and not great cross-match between ndc mart and RXCUI product mart.

I found an oversight where I was only including a subset of all product RXCUIs and fixed.

I pipe-delimited " | " product info - mostly (entirely?) GPCK/BPCK products that had multiple products and ingredients within them and sometimes different dose forms, etc. Need to come up with a better solution to this to maintain granularity, but this will do for now.

Also added a dbt test to ensure product RXCUIs are unique in the products mart.

Rationale

Customer request - need to maintain granularity of product RXCUI.

Tests

Ran dbt build for mart and dependencies. No duplicate product RXCUIs in products mart. Joined to ndc table and got 100% match.