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

getCharacterizationResults - error when pulling back a run with a generation on a source that was deleted #268

Open
jhardin29 opened this issue Nov 20, 2023 · 3 comments

Comments

@jhardin29
Copy link

For characterization 240 - the request is finding all generations across all sources, and there is a record of a generation on a source that was deleted.

So when ROhdsiWebApi tries to look up the source for that generation, it doesn't find it, which results in an error

##Request:
Employ data cleanup such that a deleted run won't raise an error when attempting to pull back results.

Tagging @chrisknoll because we chatted about this issue.

@chrisknoll
Copy link
Collaborator

right. this is compounded by marking a source 'deleted' doesn't actually delete the record, so we can't depend on FK cascade deletes to clean up generations on sources that are deleted. But, there should probably be some cleanup that when a source gets deleted (or a check that only returns non-deleted sources in results).

Tagging @anthonysena : I think you thought about soft-deletes on sources, and wanted your thoughts on handling this.

@anthonysena
Copy link
Collaborator

I'm not sure of the query/endpoint in ROhdsiWebApi that is driving this behavior but it is most likely we need to add a check on the source table to exclude those generations where "deleted_date IS NOT NULL"

@chrisknoll
Copy link
Collaborator

The error on the call comes from the following steps:

  1. Get the list of generations for an entity (example: CohortCharacterizations). This will contain a set of generationIDs and what source_id they were on.
  2. Query the results by looking up the Source by source_id to get the connection details
  3. Error: source not found (Hibernate error).

Probably the logic should be: 1) get the list of available sources, 2) get the list of generations, 3) filter generations to where the source_id exists in the available sources, 4) return the generation_ids.

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

3 participants