OHDSI Home | Forums | Wiki | Github

Getting started with the DDL (total newbie)

Hello community - first post, total newbie.

I’ve dropped straight to the DDL, as I build a tool which enables the generation of complex data graphs for test and demonstration purposes.

I see (expected) statements such as:
CREATE TABLE @cdmDatabaseSchema.PERSON

But am puzzled as to the meaning of “@cdmDatabaseSchema” because without quoting, we can’t have a postgres schema of this name. So was wondering is this somekind of variable notation, or something we are supposed to search and replace?

Finally, is there a demonstration dataset available that we can upload into our empty database?

Many thanks for reading and for you time.

Hello Chris, welcome to the forum.

What you are seeing is parameterized SQL. It is translated into regular SQL by R package SqlRender. The @'s you are seeing are aliases for the CDM schemas.

Depending on what is your SQL dialect (or how close it is to MS SQL Server), you may be able to get the queries to work by simply find-replacing the @'s with the respective schema names as per your local CDM database. Otherwise, you can use R package CommonDataModel to translate and execute the DDL for you, which is the recommended way.

About test databases, we have Eunomia. If you want more, you can use Synthea to produce datasets, then ETL it into OMOP CDM using ETL-Synthea.

Good luck :+1:

2 Likes

Thank you so much Fabricio.

Once I searched and replaced the @schema reference I had the entire OMOP model established in Postgres and HasuraGraphQL, thanks to the invaluable asset of having the DDL for Postgres in the repo.

I hope to look at the demo data over the coming weekend. Thank you for the pointers there :slight_smile:

1 Like
t