Merge pull request #558 from OHDSI/fix-557
Documentation fix for cdm_source example sql
This commit is contained in:
commit
77831c5326
|
@ -11,9 +11,9 @@
|
|||
|
||||
|
||||
|
||||
<title>sqlScripts.knit</title>
|
||||
<title>SQL Scripts</title>
|
||||
|
||||
<script src="site_libs/header-attrs-2.16/header-attrs.js"></script>
|
||||
<script src="site_libs/header-attrs-2.21/header-attrs.js"></script>
|
||||
<script src="site_libs/jquery-3.6.0/jquery-3.6.0.min.js"></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link href="site_libs/bootstrap-3.3.5/css/cosmo.min.css" rel="stylesheet" />
|
||||
|
@ -35,8 +35,8 @@
|
|||
<script src="site_libs/navigation-1.1/tabsets.js"></script>
|
||||
<link href="site_libs/highlightjs-9.12.0/default.css" rel="stylesheet" />
|
||||
<script src="site_libs/highlightjs-9.12.0/highlight.js"></script>
|
||||
<link href="site_libs/font-awesome-5.1.0/css/all.css" rel="stylesheet" />
|
||||
<link href="site_libs/font-awesome-5.1.0/css/v4-shims.css" rel="stylesheet" />
|
||||
<link href="site_libs/font-awesome-6.2.1/css/all.min.css" rel="stylesheet" />
|
||||
<link href="site_libs/font-awesome-6.2.1/css/v4-shims.min.css" rel="stylesheet" />
|
||||
<link rel='shortcut icon' type='image/x-icon' href='favicon.ico' />
|
||||
|
||||
<style type="text/css">
|
||||
|
@ -185,8 +185,8 @@ $(document).ready(function () {
|
|||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.tabset-dropdown > .nav-tabs > li.active:before {
|
||||
content: "";
|
||||
.tabset-dropdown > .nav-tabs > li.active:before, .tabset-dropdown > .nav-tabs.nav-tabs-open:before {
|
||||
content: "\e259";
|
||||
font-family: 'Glyphicons Halflings';
|
||||
display: inline-block;
|
||||
padding: 10px;
|
||||
|
@ -194,16 +194,9 @@ $(document).ready(function () {
|
|||
}
|
||||
|
||||
.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
|
||||
content: "";
|
||||
border: none;
|
||||
}
|
||||
|
||||
.tabset-dropdown > .nav-tabs.nav-tabs-open:before {
|
||||
content: "";
|
||||
content: "\e258";
|
||||
font-family: 'Glyphicons Halflings';
|
||||
display: inline-block;
|
||||
padding: 10px;
|
||||
border-right: 1px solid #ddd;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.tabset-dropdown > .nav-tabs > li.active {
|
||||
|
@ -402,6 +395,9 @@ div.tocify {
|
|||
<li>
|
||||
<a href="cdm54Changes.html">Changes from CDM v5.3</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="cdm54erd.html">Entity Relationships</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -908,11 +904,14 @@ SELECT * FROM #tmp_de;</code></pre>
|
|||
<p>The script below is an example for how to fill in the CDM_SOURCE
|
||||
table. This table is required for the <a
|
||||
href="https://github.com/OHDSI/DataQualityDashboard">Data Quality
|
||||
Dashboard</a> package to run. This was taken from the <a
|
||||
Dashboard</a> package to run.</p>
|
||||
<div id="v5.3" class="section level4">
|
||||
<h4>v5.3</h4>
|
||||
<p>This example was taken from the <a
|
||||
href="https://github.com/OHDSI/ETL-Synthea">ETL-Synthea</a> package, a
|
||||
good example on how to write a complete extract-transform-load script
|
||||
from start to finish, including vocabulary import.</p>
|
||||
<pre class="sql"><code>insert into @cdm_schema.cdm_source (
|
||||
<pre class="sql"><code>INSERT INTO @cdm_schema.cdm_source (
|
||||
cdm_source_name,
|
||||
cdm_source_abbreviation,
|
||||
cdm_holder,
|
||||
|
@ -924,7 +923,7 @@ cdm_release_date,
|
|||
cdm_version,
|
||||
vocabulary_version
|
||||
)
|
||||
select
|
||||
SELECT
|
||||
'Synthea synthetic health database',
|
||||
'Synthea',
|
||||
'OHDSI Community',
|
||||
|
@ -935,8 +934,39 @@ getdate(), -- NB: Set this value to the day the source data was pulled
|
|||
getdate(),
|
||||
'v5.3',
|
||||
vocabulary_version
|
||||
from @cdm_schema.vocabulary
|
||||
where vocabulary_id = 'None';</code></pre>
|
||||
FROM @cdm_schema.vocabulary
|
||||
WHERE vocabulary_id = 'None';</code></pre>
|
||||
</div>
|
||||
<div id="v5.4" class="section level4">
|
||||
<h4>v5.4</h4>
|
||||
<pre class="sql"><code>INSERT INTO @cdm_schema.cdm_source (
|
||||
cdm_source_name,
|
||||
cdm_source_abbreviation,
|
||||
cdm_holder,
|
||||
source_description,
|
||||
source_documentation_reference,
|
||||
cdm_etl_reference,
|
||||
source_release_date,
|
||||
cdm_release_date,
|
||||
cdm_version,
|
||||
vocabulary_version,
|
||||
vocabulary_version_concept_id
|
||||
)
|
||||
SELECT
|
||||
'<your_cdm_source_name>',
|
||||
'<your_cdm_source_abbreviation>',
|
||||
'<your_cdm_holder>',
|
||||
'<your_source_description>',
|
||||
'<your_source_documentation_reference>', -- e.g. link to source data dictionary
|
||||
'<your_etl_reference>', -- e.g. link to ETL documentation
|
||||
'<your_source_release_date>', -- when the source data was pulled
|
||||
getdate(), -- or the date of ETL run
|
||||
'v5.4',
|
||||
vocabulary_version,
|
||||
756265 -- 'OMOP CDM Version 5.4.0'
|
||||
FROM @cdm_schema.vocabulary
|
||||
WHERE vocabulary_id = 'None';</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bonus-queries" class="section level2">
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
title: 'SQL Scripts'
|
||||
output:
|
||||
html_document:
|
||||
toc: TRUE
|
||||
|
@ -404,10 +405,15 @@ SELECT * FROM #tmp_de;
|
|||
|
||||
### CDM_SOURCE Table
|
||||
|
||||
The script below is an example for how to fill in the CDM_SOURCE table. This table is required for the [Data Quality Dashboard](https://github.com/OHDSI/DataQualityDashboard) package to run. This was taken from the [ETL-Synthea](https://github.com/OHDSI/ETL-Synthea) package, a good example on how to write a complete extract-transform-load script from start to finish, including vocabulary import.
|
||||
The script below is an example for how to fill in the CDM_SOURCE table.
|
||||
This table is required for the [Data Quality Dashboard](https://github.com/OHDSI/DataQualityDashboard) package to run.
|
||||
|
||||
#### v5.3
|
||||
This example was taken from the [ETL-Synthea](https://github.com/OHDSI/ETL-Synthea) package,
|
||||
a good example on how to write a complete extract-transform-load script from start to finish, including vocabulary import.
|
||||
|
||||
```{sql eval = FALSE, echo = TRUE}
|
||||
insert into @cdm_schema.cdm_source (
|
||||
INSERT INTO @cdm_schema.cdm_source (
|
||||
cdm_source_name,
|
||||
cdm_source_abbreviation,
|
||||
cdm_holder,
|
||||
|
@ -419,7 +425,7 @@ cdm_release_date,
|
|||
cdm_version,
|
||||
vocabulary_version
|
||||
)
|
||||
select
|
||||
SELECT
|
||||
'Synthea synthetic health database',
|
||||
'Synthea',
|
||||
'OHDSI Community',
|
||||
|
@ -430,8 +436,39 @@ getdate(), -- NB: Set this value to the day the source data was pulled
|
|||
getdate(),
|
||||
'v5.3',
|
||||
vocabulary_version
|
||||
from @cdm_schema.vocabulary
|
||||
where vocabulary_id = 'None';
|
||||
FROM @cdm_schema.vocabulary
|
||||
WHERE vocabulary_id = 'None';
|
||||
```
|
||||
|
||||
#### v5.4
|
||||
```{sql eval = FALSE, echo = TRUE}
|
||||
INSERT INTO @cdm_schema.cdm_source (
|
||||
cdm_source_name,
|
||||
cdm_source_abbreviation,
|
||||
cdm_holder,
|
||||
source_description,
|
||||
source_documentation_reference,
|
||||
cdm_etl_reference,
|
||||
source_release_date,
|
||||
cdm_release_date,
|
||||
cdm_version,
|
||||
vocabulary_version,
|
||||
vocabulary_version_concept_id
|
||||
)
|
||||
SELECT
|
||||
'<your_cdm_source_name>',
|
||||
'<your_cdm_source_abbreviation>',
|
||||
'<your_cdm_holder>',
|
||||
'<your_source_description>',
|
||||
'<your_source_documentation_reference>', -- e.g. link to source data dictionary
|
||||
'<your_etl_reference>', -- e.g. link to ETL documentation
|
||||
'<your_source_release_date>', -- when the source data was pulled
|
||||
getdate(), -- or the date of ETL run
|
||||
'v5.4',
|
||||
vocabulary_version,
|
||||
756265 -- 'OMOP CDM Version 5.4.0'
|
||||
FROM @cdm_schema.vocabulary
|
||||
WHERE vocabulary_id = 'None';
|
||||
```
|
||||
|
||||
## **Bonus Queries**
|
||||
|
|
Loading…
Reference in New Issue