tuva-health / tuva

Main repo including core data model, data marts, reference data, terminology, and the clinical concept library
https://thetuvaproject.com/
178 stars 42 forks source link

Duplicate code G0503 in `terminology__hcpcs_level_2` #484

Closed donaldrauscher closed 3 months ago

donaldrauscher commented 3 months ago

Describe the bug - Required I'm getting some duplicates in core__procedure table which are coming from a merge in core__stg_claims_procedure. Specifically, on line 535, there is a join against terminology__hcpcs_level_2. there is exactly once HCPCS code which has multiple rows in the table: G0503. this merge is creating multiple rows for those claim lines, one with a populated normalized_description field, one which is NULL.

Environment - Required

Expected behavior Either terminology__hcpcs_level_2 should be unique at the HCPCS code level. Or, in core__stg_claims_procedure, the join logic should be amended to prevent duplicates. I wasn't sure if Tuva team had preferred approach. Let me know and I can implement and submit a PR. Thanks!

Screenshots image image

sarah-tuva commented 3 months ago

Hi @donaldrauscher, thank you so much for bringing this to our attention. We're looking into it now.

sarah-tuva commented 3 months ago

Hi @donaldrauscher, I was able to track down the issue. There was a line-breaking character in the original source for this seed file. You were lucky to find the only code affected by this. 😉

It will be corrected in the next release, 0.8.5 which will be coming out tomorrow.

sarah-tuva commented 3 months ago

Version 0.8.5 was released today and included a fix for this bug.