The CDM is version 5.2 The SQL code is MSSQL. These parameters need to point to the appropriate local databases: @vocabulary_database_schema @cdm_database_schema @target_database_schema Implementation steps: 1. run the algorithm code in the files with the web site labels "Cases (.sql saved as .txt)" and "Controls (.sql saved as .txt)". One creates a case cohort and one creates a control cohort. This is the complete algorithm. They can be run in any order. If one fails for some reason, it does not affect the other. These code scripts create two persistent tables at the top of the script @target_database_schema.t1d_cases @target_database_schema.t1d_controls 2. When step 1 is completed, the two select statements in the file with the website label "Report (.sql saved as .txt)" pulls the data for the two data dictionaries on PheKB. The first select statement for table @target_database_schema.t1d_cases pulls data formatted for the data dictionary T1D_cases_dd.csv. The second select statement for table @target_database_schema.t1d_controls pulls data for the data dictionary T1D_controls_dd.csv. If person_id is not the eMERGE subjid, then this needs to be changed by the sites.