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

Preceding Visit Occurrence ID Assignment in De-Identification Script #21

Open
wtroddy opened this issue Feb 2, 2024 · 0 comments
Open

Comments

@wtroddy
Copy link

wtroddy commented Feb 2, 2024

When ingesting data from some sites we're getting errors when creating the preceding_visit_occurrence_id foreign key constraint.

For example, this postgres error is raised:

insert or update on table "visit_occurrence" violates foreign key constraint "fpk_visit_occurrence_preceding_visit_occurrence_id"
DETAIL:  Key (preceding_visit_occurrence_id)=([REDACTED]) is not present in table "visit_occurrence".

In this example, the [REDACTED] key value was greater than 10 million, but the MAX(visit_occurrence_id) was fewer than 5000.

After looking through the code base I believe that the issue is related to the re-assignment of visit_occurrence_id but not the preceding_visit_occurrence_id in this script: https://github.com/OHDSI/CureIdRegistry/blob/main/Cohort%20curation%20scripts/05_DE_ID_script.sql#L90

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

No branches or pull requests

1 participant