OMOP Common Data Model by OHDSI
Go to file
Adam Black d84141b5d8
add changes to v5.4 (#433)
* Add github actions workflow to build package and run tests.

* update Description file

* rename .Rproj file.

* Consolidate 'create' functions into one file.

* Add tests for create functions.

* update description

* removed spaces in file and folder names. Regenerated ddl output. Tried to fix Field_Level.csv file.

* consolidate write functions into one file. Add execute function.

* update docs

* add tests for write and execute functions

* update documentation

* Add windows and linux runners in github actions.

* update github actions

* download drivers before running tests

* fix small error in setup test file.

* debug github actions

* debug github actions

* debug github actions

* debug github actions

* fix tiny bug

* comment out execute ddl test

* fix bug in test

* Add execute test back in

* revert accidental change in description

* add print statement for debugging schema error on github actions.

* Fix schema environment variable name

* Add comment to github actions workflow file.

* remove placeholder text in function documentation.

* Rename createdDdl.R to createDdl.R

* Hack-a-thon updates

Closes #81, #387, #239, #412, #391, #330, #408, #365, #306, #264

* Changed bigint to integer for consistency

* Updated DDLs

* Add tests for redshift. Clean up test setup file.

* Foreign key fixes

* Add imports and update docs.

* Fix bug in setup test script.

* update setup file

* Add tests for oracle and sql server. Move setup.R file.

* fix bug in setup

* debug tests on github

* debug github actions

* debug actions.

* debug actions

* debug actions.

* Add missing secrets to yaml!!

* debug actions

* test connection on all platforms

* add ddl execution

* add windows and linux runners

* Resolving conflicts

* Removing unnecessary file

* Trying again to remove .DS_Store, adding to gitignore

* Allow user to specify output location in buildRelease

* replace outputpath with outputfolder for consitent argument names in the package.

* Add test for buildRelease.

* replace outputpath with outputfolder for consistency. update documentation.

* move ddl folder to inst so it is accessible from tests

* update documentation

* Add OMOP header genearator function

Co-authored-by: Adam Black <adam.black@odysseusinc.com>
Co-authored-by: Clair Blacketer <mblacke@its.jnj.com>
Co-authored-by: clairblacketer <clairblacketer@users.noreply.github.com>
2021-08-20 13:00:03 -04:00
.github/workflows Add unit tests for all databases and DDLs (#431) 2021-08-20 07:59:29 -04:00
R add changes to v5.4 (#433) 2021-08-20 13:00:03 -04:00
docs resolving merge issue on field level csv 2021-08-19 13:14:23 -04:00
extras Function to Build Release Zips (#429) 2021-08-19 15:43:34 -04:00
inst Add test for buildRelease (#432) 2021-08-20 12:32:46 -04:00
man Add test for buildRelease (#432) 2021-08-20 12:32:46 -04:00
rmd resolving merge issue on field level csv 2021-08-19 13:14:23 -04:00
tests Add test for buildRelease (#432) 2021-08-20 12:32:46 -04:00
.DS_Store Add unit tests for all databases and DDLs (#431) 2021-08-20 07:59:29 -04:00
.Rbuildignore Add unit tests for all databases and DDLs (#431) 2021-08-20 07:59:29 -04:00
.gitignore add changes to v5.4 (#433) 2021-08-20 13:00:03 -04:00
CommonDataModel.Rproj Function to Build Release Zips (#429) 2021-08-19 15:43:34 -04:00
DESCRIPTION Add tests, github actions, and executeDdl function (#425) 2021-08-19 11:49:36 -04:00
LICENSE Moved R project from CdmDdlBase 2021-06-08 20:19:01 -04:00
NAMESPACE Add test for buildRelease (#432) 2021-08-20 12:32:46 -04:00
README.md Moved R project from CdmDdlBase 2021-06-08 20:19:01 -04:00

README.md

title output
Readme
html_document
toc toc_float
TRUE TRUE

How to Update the CDM

NOTE This information is for the maintainers of the CDM as it is best for all information to be in one place. If you want to suggest an update or addition to the OMOP CDM please visit the CommonDataModel repo. The instructions contained herein are meant to describe the process by which new versions of the CDM are produced, should it need to be replicated in the future. These steps are also enumerated in extras/codeToRun.R.

Typically, new CDM versions and updates are decided by the CDM working group (details to join meetings on homepage). These changes are tracked as issues in the github repo. Once the working group decides which changes make up a version, all the corresponding issues should be tagged with a version number e.g. v6.1.

Step 0

All the issues and additions that are incorporated into the new CDM version will be handled in the CommonDataModel repository. Changes should be made in the representative csv files and it is the job of the CdmDdlBase repo to take those files and convert them to DDLs and documentation. This README will walk through how to update and create all the relevant DDLs, constraints, indices, and documentation for the CDM utilizing both the CommonDataModel repo and the CdmDdlBase repo.

Step 1

Create a branch in the CommonDataModel repository for the new version of the CDM you are creating.

Step 1.1

Rename the csv files from the current released version to the new version. For example, if the new version you are creating is v6.0 and the most recent released version is v5.3.1, rename the csv files named "OMOP_CDMv5.3.1_Field_Level.csv" and "OMOP_CDMv5.3.1_Table_Level.csv" to "OMOP_CDMv6.0_Field_Level.csv" and "OMOP_CDMv6.0_Table_Level.csv". These files serve multiple functions; they serve as the basis for the CDM DDL, CDM documentation, and Data Quality Dashboard (DQD). You can read more about the DQD here.

Step 1.2

The csv files can now be updated with the changes and additions for the new CDM version. If a new table should be added, add a line to the Table_Level.csv with the table name and description and list it as part of the CDM schema. The remaining columns are quality checks that can be run. Details here on what those are. After adding any tables, make any changes or additions to CDM fields in the Field_Level.csv. The columns are meant to mimic how a DDL is structured, which is how it will eventually be generated. A yes in the field isRequired indicates a NOT NULL constraint and the datatype field should be filled in exactly how it would look in the DDL. Any additions or changes should also be reflected in the userGuidance and etlConventions fields, which are the basis for the documentation. DO NOT MAKE ANY CHANGES IN THE DDL ITSELF. The structure is set up in such a way that the csv files are the ground truth. If changes are made in the DDL instead of the csv files then the DDL will be out of sync with the documentation and the DQD.

Step 2

Push the csv files up to the branch for the new CDM version and then switch to the CdmDdlBase repository. Get the zip url for the CDM branch (on the github page for the branch, click on the green download button and then right click on download zip to get the url) in progress and use the file packageMaintenance.R and the instructions therein to copy the csv files over to the inst/csv folder of the CdmDdlBase package. For each CDM version represented in CdmDdlBase there should be two csv files. For example, CDM v5.3.1 has csv files "OMOP_CDMv5.3.1_Field_Level" and "OMOP_CDMv5.3.1_Table_Level" in the inst/csv folder.

Step 3

Once all changes are made the csvs, open extras/codeToRun.R and run the createDdlFromFile function, setting the parameters cdmTableCsvLoc and cdmFieldCsvLoc to the locations of the csv files created in step 3. For example, the cdmTableCsvLoc for cdm v5.3.1 is "inst/csv/OMOP_CDMv5.3.1_Table_Level.csv". This will create a sql file in inst/sql/sql_server with the ddl for the current cdm version. Once the DDL is created, run the createPkFromFile and createFkFromFile functions to create the primary key and foreign key scripts.

Step 4

Use thewriteDDL function to tranlate the sql script created in the step above into oracle, postgres, and sql server dialects.

NOTE This documentation is a work in progress and will continue to be updated.