-
Notifications
You must be signed in to change notification settings - Fork 31
Update visit_source_value JOINs to only use hadm_id
#61
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
base: dev
Are you sure you want to change the base?
Conversation
etl/etl/cdm_drug_exposure.sql
Outdated
| src.source_concept_id AS drug_source_concept_id, | ||
| src.route_source_code AS route_source_value, | ||
| src.dose_unit_source_code AS dose_unit_source_value, | ||
| `@etl_project.@etl_dataset`.obf_id_str(src.trace_id, 32) AS drug_exposure_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little bit worried about uniqueness of drug_exposure_id when the generated value is based on src.trace_id only: drug_exposure source rows can be multiplied due to multiple mapping of drug_source_value (for example, when a drug mapped to ingredients concepts). Maybe src.trace_id + drug_concept_id would be a safer choice?
atsvetkova-ody
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked through the changes, and I have only two notes:
- about drug_exposure_id: I expect some risk of generating duplicated values when only src.trace_id is passed to the obfuscating function. May be src.trace_id + drug_concept_id could be a safer option.
- about visit_source_value, just an idea probably to think it over later: we used to populate visit_source_value with the source visit_id to track original visits. But having trace_id field or with adding another non-OMOP field dedicated to source visit_id, it can be safe to return initial role to visit_source_value, i. e. to populate it with the values used to find visit_concept_id.
|
Thanks for the feedback @atsvetkova-ody !
I've updated this to combine
I don't think I understand what you are suggesting here. Looking at the old code, on main, Can I ask if you've reviewed all of the open PR commits (most of which are in this PR since I've been building on top of PRs to avoid merge conflicts)? I ask so I can decide what to merge. |
This PR should be merged after the PRs ahead of it.
In #57 , we updated
visit_source_valueto simply behadm_idinstead of a concatenation ofhadm_idand other variables. This PR updates theJOINstatements which usevisit_source_valueto simplyJOINagainsthadm_id, see 225c79c.