Skip to content

Commit

Permalink
render
Browse files Browse the repository at this point in the history
  • Loading branch information
edward-burn committed Jan 13, 2025
1 parent d0b4c81 commit 2bbf5b4
Show file tree
Hide file tree
Showing 31 changed files with 163 additions and 1,883 deletions.
36 changes: 18 additions & 18 deletions _book/adding_features.html
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ <h2 data-number="8.1" class="anchored" data-anchor-id="adding-specific-demograph
<div class="cell-output cell-output-stdout">
<pre><code>Rows: ??
Columns: 18
Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpItzU3r\file5580112859cc.duckdb]
Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpsBHwQQ\file6cd029b27267.duckdb]
$ condition_occurrence_id &lt;int&gt; 1, 3, 8, 9, 12, 18, 19, 20, 21, 23, 24, …
$ person_id &lt;int&gt; 2, 7, 16, 16, 25, 42, 42, 42, 44, 47, 47…
$ condition_concept_id &lt;int&gt; 381316, 381316, 381316, 313217, 381316, …
Expand Down Expand Up @@ -341,7 +341,7 @@ <h2 data-number="8.1" class="anchored" data-anchor-id="adding-specific-demograph
<pre><code>&lt;SQL&gt;
SELECT
condition_occurrence_id,
og_002_1736606688.person_id AS person_id,
og_002_1736768583.person_id AS person_id,
condition_concept_id,
condition_start_date,
condition_start_datetime,
Expand All @@ -358,7 +358,7 @@ <h2 data-number="8.1" class="anchored" data-anchor-id="adding-specific-demograph
condition_status_source_value,
age,
RHS.sex AS sex
FROM og_002_1736606688
FROM og_002_1736768583
LEFT JOIN (
SELECT
person_id,
Expand All @@ -376,13 +376,13 @@ <h2 data-number="8.1" class="anchored" data-anchor-id="adding-specific-demograph
day_of_birth
FROM (
SELECT DISTINCT person_id
FROM og_002_1736606688
FROM og_002_1736768583
) LHS
INNER JOIN main.person
ON (LHS.person_id = person.person_id)
) q01
) RHS
ON (og_002_1736606688.person_id = RHS.person_id)</code></pre>
ON (og_002_1736768583.person_id = RHS.person_id)</code></pre>
</div>
</div>
<p>We now have two variables added containing values for age and sex.</p>
Expand All @@ -392,7 +392,7 @@ <h2 data-number="8.1" class="anchored" data-anchor-id="adding-specific-demograph
<div class="cell-output cell-output-stdout">
<pre><code>Rows: ??
Columns: 18
Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpItzU3r\file5580112859cc.duckdb]
Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpsBHwQQ\file6cd029b27267.duckdb]
$ condition_occurrence_id &lt;int&gt; 1, 3, 8, 9, 12, 18, 19, 20, 21, 23, 24, …
$ person_id &lt;int&gt; 2, 7, 16, 16, 25, 42, 42, 42, 44, 47, 47…
$ condition_concept_id &lt;int&gt; 381316, 381316, 381316, 313217, 381316, …
Expand Down Expand Up @@ -422,8 +422,8 @@ <h2 data-number="8.1" class="anchored" data-anchor-id="adding-specific-demograph
<pre><code># A tibble: 2 × 2
sex mean_age
&lt;chr&gt; &lt;dbl&gt;
1 Female 50.8
2 Male 56.5</code></pre>
1 Male 56.5
2 Female 50.8</code></pre>
</div>
</div>
<div class="cell">
Expand Down Expand Up @@ -456,7 +456,7 @@ <h2 data-number="8.2" class="anchored" data-anchor-id="adding-multiple-demograph
<div class="cell-output cell-output-stdout">
<pre><code>Rows: ??
Columns: 27
Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpItzU3r\file5580112859cc.duckdb]
Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpsBHwQQ\file6cd029b27267.duckdb]
$ drug_exposure_id &lt;int&gt; 245761, 245762, 245763, 245765, 245766, 2…
$ person_id &lt;int&gt; 7764, 7764, 7764, 7764, 7764, 7764, 7764,…
$ drug_concept_id &lt;int&gt; 40213227, 40213201, 40213198, 40213154, 4…
Expand Down Expand Up @@ -522,8 +522,8 @@ <h2 data-number="8.2" class="anchored" data-anchor-id="adding-multiple-demograph
<span id="cb18-4"><a href="#cb18-4" aria-hidden="true" tabindex="-1"></a> dplyr<span class="sc">::</span><span class="fu">show_query</span>()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>&lt;SQL&gt;
SELECT og_004_1736606693.*
FROM og_004_1736606693
SELECT og_004_1736768586.*
FROM og_004_1736768586
WHERE (sex = 'Male')</code></pre>
</div>
</div>
Expand Down Expand Up @@ -623,7 +623,7 @@ <h2 data-number="8.3" class="anchored" data-anchor-id="creating-categories"><spa
<div class="cell-output cell-output-stdout">
<pre><code>Rows: ??
Columns: 20
Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpItzU3r\file5580112859cc.duckdb]
Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpsBHwQQ\file6cd029b27267.duckdb]
$ condition_occurrence_id &lt;int&gt; 1, 3, 8, 9, 12, 18, 19, 20, 21, 23, 24, …
$ person_id &lt;int&gt; 2, 7, 16, 16, 25, 42, 42, 42, 44, 47, 47…
$ condition_concept_id &lt;int&gt; 381316, 381316, 381316, 313217, 381316, …
Expand Down Expand Up @@ -660,7 +660,7 @@ <h2 data-number="8.4" class="anchored" data-anchor-id="adding-custom-variables">
<div class="cell-output cell-output-stdout">
<pre><code>Rows: ??
Columns: 6
Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpItzU3r\file5580112859cc.duckdb]
Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpsBHwQQ\file6cd029b27267.duckdb]
$ observation_period_id &lt;int&gt; 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1…
$ person_id &lt;int&gt; 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1…
$ observation_period_start_date &lt;date&gt; 2014-05-09, 1977-04-11, 2014-04-19, 201…
Expand Down Expand Up @@ -688,7 +688,7 @@ <h2 data-number="8.4" class="anchored" data-anchor-id="adding-custom-variables">
<div class="cell-output cell-output-stdout">
<pre><code>Rows: ??
Columns: 2
Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpItzU3r\file5580112859cc.duckdb]
Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpsBHwQQ\file6cd029b27267.duckdb]
$ person_id &lt;int&gt; 2, 7, 16, 18, 25, 36, 42, 44, 47, 51, 52,…
$ condition_occurrence_records &lt;dbl&gt; 1, 1, 2, 2, 1, 4, 3, 2, 5, 1, 3, 2, 1, 4,…</code></pre>
</div>
Expand Down Expand Up @@ -716,7 +716,7 @@ <h2 data-number="8.4" class="anchored" data-anchor-id="adding-custom-variables">
FROM main.person
LEFT JOIN (
SELECT person_id, COUNT(*) AS condition_occurrence_records
FROM og_002_1736606688
FROM og_002_1736768583
GROUP BY person_id
) RHS
ON (person.person_id = RHS.person_id)
Expand All @@ -743,7 +743,7 @@ <h2 data-number="8.4" class="anchored" data-anchor-id="adding-custom-variables">
<span id="cb33-2"><a href="#cb33-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">tally</span>()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code># Source: SQL [?? x 1]
# Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpItzU3r\file5580112859cc.duckdb]
# Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpsBHwQQ\file6cd029b27267.duckdb]
n
&lt;dbl&gt;
1 9967</code></pre>
Expand All @@ -752,7 +752,7 @@ <h2 data-number="8.4" class="anchored" data-anchor-id="adding-custom-variables">
<span id="cb35-2"><a href="#cb35-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">tally</span>()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code># Source: SQL [?? x 1]
# Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpItzU3r\file5580112859cc.duckdb]
# Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpsBHwQQ\file6cd029b27267.duckdb]
n
&lt;dbl&gt;
1 337509</code></pre>
Expand All @@ -765,7 +765,7 @@ <h2 data-number="8.4" class="anchored" data-anchor-id="adding-custom-variables">
<span id="cb37-6"><a href="#cb37-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">tally</span>()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code># Source: SQL [?? x 1]
# Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpItzU3r\file5580112859cc.duckdb]
# Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpsBHwQQ\file6cd029b27267.duckdb]
n
&lt;dbl&gt;
1 410683</code></pre>
Expand Down
48 changes: 25 additions & 23 deletions _book/cdm_reference.html
Original file line number Diff line number Diff line change
Expand Up @@ -377,16 +377,16 @@ <h2 data-number="5.2" class="anchored" data-anchor-id="creating-a-reference-to-t
# Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/:memory:]
person_id gender_concept_id year_of_birth month_of_birth day_of_birth
&lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt;
1 1 8532 1994 10 2
2 2 8532 1964 1 10
3 3 8507 1983 6 18
4 4 8532 1962 6 14
5 5 8507 1969 4 2
6 6 8507 2000 3 29
7 7 8532 1987 10 26
8 8 8507 1990 9 7
9 9 8532 1996 3 16
10 10 8507 1958 10 6
1 1 8507 1996 5 27
2 2 8532 1990 11 22
3 3 8532 1978 6 13
4 4 8532 1961 9 27
5 5 8532 1966 2 23
6 6 8532 1968 6 11
7 7 8532 1959 2 15
8 8 8507 1981 12 8
9 9 8532 1998 8 17
10 10 8507 1975 5 2
# ℹ more rows
# ℹ 13 more variables: race_concept_id &lt;int&gt;, ethnicity_concept_id &lt;int&gt;,
# birth_datetime &lt;dttm&gt;, location_id &lt;int&gt;, provider_id &lt;int&gt;,
Expand All @@ -401,16 +401,16 @@ <h2 data-number="5.2" class="anchored" data-anchor-id="creating-a-reference-to-t
# Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/:memory:]
observation_period_id person_id observation_period_s…¹ observation_period_e…²
&lt;int&gt; &lt;int&gt; &lt;date&gt; &lt;date&gt;
1 1 1 2016-01-28 2019-03-21
2 2 2 1978-04-02 2002-05-08
3 3 3 2014-04-21 2018-03-25
4 4 4 1982-11-23 1985-08-01
5 5 5 1978-05-01 2013-05-03
6 6 6 2015-07-24 2018-11-23
7 7 7 2014-12-22 2019-11-17
8 8 8 1996-01-10 2019-06-01
9 9 9 2003-12-03 2012-06-09
10 10 10 2018-12-11 2019-03-25
1 1 1 2004-07-12 2008-05-29
2 2 2 2011-06-08 2016-06-12
3 3 3 1995-05-10 2007-09-22
4 4 4 2011-03-25 2015-02-27
5 5 5 1993-03-08 1996-02-26
6 6 6 2002-05-15 2017-07-19
7 7 7 1984-06-12 1997-08-05
8 8 8 1988-08-31 1998-11-18
9 9 9 2018-05-31 2018-07-10
10 10 10 1976-12-05 2001-04-07
# ℹ more rows
# ℹ abbreviated names: ¹​observation_period_start_date,
# ²​observation_period_end_date
Expand Down Expand Up @@ -527,7 +527,7 @@ <h3 data-number="5.3.3" class="anchored" data-anchor-id="cdm-source"><span class
<div class="cell">
<div class="sourceCode cell-code" id="cb35"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb35-1"><a href="#cb35-1" aria-hidden="true" tabindex="-1"></a><span class="fu">attr</span>(<span class="fu">cdmSource</span>(cdm), <span class="st">"dbcon"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stderr">
<pre><code>&lt;duckdb_connection fdbe0 driver=&lt;duckdb_driver dbdir=':memory:' read_only=FALSE bigint=numeric&gt;&gt;</code></pre>
<pre><code>&lt;duckdb_connection f8700 driver=&lt;duckdb_driver dbdir=':memory:' read_only=FALSE bigint=numeric&gt;&gt;</code></pre>
</div>
</div>
</section>
Expand All @@ -546,7 +546,9 @@ <h2 data-number="5.4" class="anchored" data-anchor-id="mutability-of-the-cdm-ref
# Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/:memory:]
person_id gender_concept_id year_of_birth month_of_birth day_of_birth
&lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt;
1 87 8507 1970 3 5
1 55 8532 1970 7 14
2 61 8507 1970 4 24
3 74 8532 1970 1 6
# ℹ 13 more variables: race_concept_id &lt;int&gt;, ethnicity_concept_id &lt;int&gt;,
# birth_datetime &lt;dttm&gt;, location_id &lt;int&gt;, provider_id &lt;int&gt;,
# care_site_id &lt;int&gt;, person_source_value &lt;chr&gt;, gender_source_value &lt;chr&gt;,
Expand All @@ -564,7 +566,7 @@ <h2 data-number="5.4" class="anchored" data-anchor-id="mutability-of-the-cdm-ref
# Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/:memory:]
n
&lt;dbl&gt;
1 1</code></pre>
1 3</code></pre>
</div>
</div>
<p>The original OMOP CDM data itself however will remain unaffected. And we can see if we create our reference again that the underlying data is unchanged.</p>
Expand Down
Loading

0 comments on commit 2bbf5b4

Please sign in to comment.