Using standard and non-standard concepts in criteria leads to bad query · Issue #160 · OHDSI/circe-be · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a criteria expression that uses standard and non-standard attributes, the following query is generated:
SELECT co.*
FROM @cdm_database_schema.CONDITION_OCCURRENCE co
JOIN Codesets codesets on ((co.condition_concept_id = codesets.concept_id and codesets.codeset_id = 0)
AND (co.condition_source_concept_id = codesets.concept_id and codesets.codeset_id = 1))
The issue is that you will never have a single join record on Codesets where the condeset_id can be both 0 and 1 in the same row, and therefore this join always fails.
The proper form of this should be:
SELECT co.*
FROM @cdm_database_schema.CONDITION_OCCURRENCE co
JOIN #codesets cs on co.condition_concept_id = cs.concept_id and cs.codeset_id = 0
JOIN #codesets cns on co.condition_source_concept_id = cns.concept_id and cns.codeset_id = 1
The text was updated successfully, but these errors were encountered:
When creating a criteria expression that uses standard and non-standard attributes, the following query is generated:
The issue is that you will never have a single join record on Codesets where the condeset_id can be both 0 and 1 in the same row, and therefore this join always fails.
The proper form of this should be:
The text was updated successfully, but these errors were encountered: