Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BuildRxE.sql bug introduced by @Fix AVOC-3852 #1039

Open
lore-edencehealth opened this issue Aug 8, 2024 · 2 comments
Open

BuildRxE.sql bug introduced by @Fix AVOC-3852 #1039

lore-edencehealth opened this issue Aug 8, 2024 · 2 comments
Labels

Comments

@lore-edencehealth
Copy link

lore-edencehealth commented Aug 8, 2024

Describe the problem in content or desired feature
When the input for BuildRxE has multiple source data that represents the same ingredient + dose then the sum(prec)::INT4 AS new_prec in ri_combo_prex_fix and rd_combo_prex_fix increases the prec which sometimes makes it no longer find a mapping for ingredient + dose even though it does exist.

How to find it
input to reproduce the problem:
drug_concept_stage:
concept_name,domain_id,vocabulary_id,concept_class_id,concept_code
B01AE03_IV_1000.0_ug,Drug,2000000001,Drug Product,B01AE03_IV_1000.0_ug
B01AE03_IV_1.0_mg,Drug,2000000001,Drug Product,B01AE03_IV_1.0_mg
intravenous,Drug,2000000001,Dose Form,IV
argatroban; parenteral,Drug,2000000001,Ingredient,B01AE03

relationship_to_concept:
concept_code_1,vocabulary_id,concept_id_2,precedence,conversion_factor
IV,2000000001,19082106,1,
IV,2000000001,19095915,2,
mg,2000000001,8576,,
ml,2000000001,8587,,
ug,2000000001,8576,,0.001
B01AE03,2000000001,1322207,,

internal_relationship_stage:
concept_code_1,concept_code_2
B01AE03_IV_1000.0_ug,B01AE03
B01AE03_IV_1000.0_ug,ug
B01AE03_IV_1000.0_ug,ml
B01AE03_IV_1000.0_ug,IV
B01AE03_IV_1.0_mg,B01AE03
B01AE03_IV_1.0_mg,mg
B01AE03_IV_1.0_mg,ml
B01AE03_IV_1.0_mg,IV

ds_stage:
drug_concept_code,ingredient_concept_code,amount_value,amount_unit,numerator_value,numerator_unit,denominator_value,denominator_unit
B01AE03_IV_1000.0_ug,B01AE03,,,1000,ug,1,ml
B01AE03_IV_1.0_mg,B01AE03,,,1,mg,1,ml

Expected adjustments
adjusting
SUM(prec)::INT4 AS new_prec
to
MIN(prec)::INT4 AS new_prec
in rd_combo_prex_fix (and ri_combo_prex_fix) fixes this.
Not sure if this might reintroduces the undeterminate query problem from #892 .

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
running BuildRxE.sql with sum(prec) gives no existing Clinical Drug Comp, running with min(prec) does give an existing Clinical Drug Comp mapping.

@lore-edencehealth
Copy link
Author

@maleman this issue is related to #892 opened by you.

@TinyRickC137
Copy link
Contributor

Thank you for the input, @lore-edencehealth
It is impressive! We will get back to this issue after the release (we have not been running BuildRxE in this release)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants