OHDSI / CohortDiagnostics

An R package for performing various cohort diagnostics.
https://ohdsi.github.io/CohortDiagnostics
41 stars 48 forks source link

getCdmDataSourceInformation() does not work when CDM_source table is a synonym (in SQL Server) #1053

Closed kzollove closed 1 year ago

kzollove commented 1 year ago

Probably an edge case. Many tables in our main SQL Server CDM database are actually synonyms referencing tables in other databases. This generally isn't an issue, but it is in this case where existsTable() is checking if a table CDM_source exists, and aborting if it doesn't.

Warning message:
In getCdmDataSourceInformation(connection = connection, cdmDatabaseSchema = cdmDatabaseSchema) :
  CDM Source table not found in CDM. Metadata on CDM source will be limited.

https://github.com/OHDSI/CohortDiagnostics/blob/311e7c6944d82b9ab9da0bd7d856a975fa5a55b9/R/DataSourceInformation.R#L52

azimov commented 1 year ago

@kzollove For non standard cdm info table a workaround for this setup is simply to set the parameters for your cdm manually with the optional parameters, e.g:

executeDiagnostics(
         ...
        databaseName = "my database long name field",
        databaseDescription = "my description field"
)      

Alternatively these values will be set as the databaseId (required parameter). The only other information used from cdm_source is the vocabulary version, which will be captured from the vocabulary table.

kzollove commented 1 year ago

Thanks for the tip @azimov