Dear OMOP community,
We have the problem that in one of our OMOP instances no statistics about visits are generated (in Atlas under “Data Sources”). Likewise, some other data categories are missing the record count (RC).
After a bit of research, we saw in the logs that an SQL was failing, which could be related to the error. The problem is that generated code is missing in a subquery:
FROM ( ) e. We tried to find the program code that generates this SQL (“Begin Primary Events”), but had no success.
-- Begin Primary Events SELECT p.ordinal AS event_id, p.person_id, p.start_date, p.end_date, op_start_date, op_end_date, cast(p.visit_occurrence_id AS bigint) AS visit_occurrence_id FROM ( SELECT e.person_id, e.start_date, e.end_date, row_number() OVER (partition BY e.person_id ORDER BY e.sort_date ASC) ordinal, op.observation_period_start_date AS op_start_date, op.observation_period_end_date AS op_end_date, cast(e.visit_occurrence_id AS bigint) AS visit_occurrence_id FROM ( ) e JOIN cds_cdm.observation_period op ON e.person_id = op.person_id AND e.start_date >= op.observation_period_start_date AND e.start_date <= op.observation_period_end_date
The CDM is in version 5.3.1.
Any tips on how we could address the problem would be greatly appreciated.
Kind regards from Erlangen, Germany,