115
115
< button type ="button " class ="quarto-btn-toggle btn " data-bs-toggle ="collapse " role ="button " data-bs-target =".quarto-sidebar-collapse-item " aria-controls ="quarto-sidebar " aria-expanded ="false " aria-label ="Toggle sidebar navigation " onclick ="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); } ">
116
116
< i class ="bi bi-layout-text-sidebar-reverse "> </ i >
117
117
</ button >
118
- < nav class ="quarto-page-breadcrumbs " aria-label ="breadcrumb "> < ol class ="breadcrumb "> < li class ="breadcrumb-item "> < a href ="./explore .html "> Working with the OMOP CDM</ a > </ li > < li class ="breadcrumb-item "> < a href ="./adding_features.html "> < span class ="chapter-number "> 8</ span > < span class ="chapter-title "> Identifying patient characteristics</ span > </ a > </ li > </ ol > </ nav >
118
+ < nav class ="quarto-page-breadcrumbs " aria-label ="breadcrumb "> < ol class ="breadcrumb "> < li class ="breadcrumb-item "> < a href ="./omop .html "> Working with the OMOP CDM from R </ a > </ li > < li class ="breadcrumb-item "> < a href ="./adding_features.html "> < span class ="chapter-number "> 8</ span > < span class ="chapter-title "> Identifying patient characteristics</ span > </ a > </ li > </ ol > </ nav >
119
119
< a class ="flex-grow-1 " role ="navigation " data-bs-toggle ="collapse " data-bs-target =".quarto-sidebar-collapse-item " aria-controls ="quarto-sidebar " aria-expanded ="false " aria-label ="Toggle sidebar navigation " onclick ="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); } ">
120
120
</ a >
121
121
< button type ="button " class ="btn quarto-search-button " aria-label ="Search " onclick ="window.quartoOpenSearch(); ">
176
176
< li class ="sidebar-item ">
177
177
< div class ="sidebar-item-container ">
178
178
< a href ="./dbplyr_packages.html " class ="sidebar-item-text sidebar-link ">
179
- < span class ="menu-text "> < span class ="chapter-number "> 4</ span > < span class ="chapter-title "> Building data pipelines</ span > </ span > </ a >
179
+ < span class ="menu-text "> < span class ="chapter-number "> 4</ span > < span class ="chapter-title "> Building analytic pipelines for a data model </ span > </ span > </ a >
180
180
</ div >
181
181
</ li >
182
182
</ ul >
183
183
</ li >
184
184
< li class ="sidebar-item sidebar-item-section ">
185
185
< div class ="sidebar-item-container ">
186
- < a href ="./explore .html " class ="sidebar-item-text sidebar-link ">
187
- < span class ="menu-text "> Working with the OMOP CDM</ span > </ a >
186
+ < a href ="./omop .html " class ="sidebar-item-text sidebar-link ">
187
+ < span class ="menu-text "> Working with the OMOP CDM from R </ span > </ a >
188
188
< a class ="sidebar-item-toggle text-start " data-bs-toggle ="collapse " data-bs-target ="#quarto-sidebar-section-2 " role ="navigation " aria-expanded ="true " aria-label ="Toggle section ">
189
189
< i class ="bi bi-chevron-right ms-2 "> </ i >
190
190
</ a >
@@ -255,7 +255,7 @@ <h2 id="toc-title">Table of contents</h2>
255
255
<!-- main -->
256
256
< main class ="content " id ="quarto-document-content ">
257
257
258
- < header id ="title-block-header " class ="quarto-title-block default "> < nav class ="quarto-page-breadcrumbs quarto-title-breadcrumbs d-none d-lg-block " aria-label ="breadcrumb "> < ol class ="breadcrumb "> < li class ="breadcrumb-item "> < a href ="./explore .html "> Working with the OMOP CDM</ a > </ li > < li class ="breadcrumb-item "> < a href ="./adding_features.html "> < span class ="chapter-number "> 8</ span > < span class ="chapter-title "> Identifying patient characteristics</ span > </ a > </ li > </ ol > </ nav >
258
+ < header id ="title-block-header " class ="quarto-title-block default "> < nav class ="quarto-page-breadcrumbs quarto-title-breadcrumbs d-none d-lg-block " aria-label ="breadcrumb "> < ol class ="breadcrumb "> < li class ="breadcrumb-item "> < a href ="./omop .html "> Working with the OMOP CDM from R </ a > </ li > < li class ="breadcrumb-item "> < a href ="./adding_features.html "> < span class ="chapter-number "> 8</ span > < span class ="chapter-title "> Identifying patient characteristics</ span > </ a > </ li > </ ol > </ nav >
259
259
< div class ="quarto-title ">
260
260
< h1 class ="title "> < span class ="chapter-number "> 8</ span > < span class ="chapter-title "> Identifying patient characteristics</ span > </ h1 >
261
261
</ div >
@@ -309,7 +309,7 @@ <h2 data-number="8.1" class="anchored" data-anchor-id="adding-specific-demograph
309
309
< div class ="cell-output cell-output-stdout ">
310
310
< pre > < code > Rows: ??
311
311
Columns: 18
312
- Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpmeklJq\file668448b62f55 .duckdb]
312
+ Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpItzU3r\file5580112859cc .duckdb]
313
313
$ condition_occurrence_id <int> 1, 3, 8, 9, 12, 18, 19, 20, 21, 23, 24, …
314
314
$ person_id <int> 2, 7, 16, 16, 25, 42, 42, 42, 44, 47, 47…
315
315
$ condition_concept_id <int> 381316, 381316, 381316, 313217, 381316, …
@@ -341,7 +341,7 @@ <h2 data-number="8.1" class="anchored" data-anchor-id="adding-specific-demograph
341
341
< pre > < code > <SQL>
342
342
SELECT
343
343
condition_occurrence_id,
344
- og_002_1736509005 .person_id AS person_id,
344
+ og_002_1736606688 .person_id AS person_id,
345
345
condition_concept_id,
346
346
condition_start_date,
347
347
condition_start_datetime,
@@ -358,7 +358,7 @@ <h2 data-number="8.1" class="anchored" data-anchor-id="adding-specific-demograph
358
358
condition_status_source_value,
359
359
age,
360
360
RHS.sex AS sex
361
- FROM og_002_1736509005
361
+ FROM og_002_1736606688
362
362
LEFT JOIN (
363
363
SELECT
364
364
person_id,
@@ -376,13 +376,13 @@ <h2 data-number="8.1" class="anchored" data-anchor-id="adding-specific-demograph
376
376
day_of_birth
377
377
FROM (
378
378
SELECT DISTINCT person_id
379
- FROM og_002_1736509005
379
+ FROM og_002_1736606688
380
380
) LHS
381
381
INNER JOIN main.person
382
382
ON (LHS.person_id = person.person_id)
383
383
) q01
384
384
) RHS
385
- ON (og_002_1736509005 .person_id = RHS.person_id)</ code > </ pre >
385
+ ON (og_002_1736606688 .person_id = RHS.person_id)</ code > </ pre >
386
386
</ div >
387
387
</ div >
388
388
< p > We now have two variables added containing values for age and sex.</ p >
@@ -392,7 +392,7 @@ <h2 data-number="8.1" class="anchored" data-anchor-id="adding-specific-demograph
392
392
< div class ="cell-output cell-output-stdout ">
393
393
< pre > < code > Rows: ??
394
394
Columns: 18
395
- Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpmeklJq\file668448b62f55 .duckdb]
395
+ Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpItzU3r\file5580112859cc .duckdb]
396
396
$ condition_occurrence_id <int> 1, 3, 8, 9, 12, 18, 19, 20, 21, 23, 24, …
397
397
$ person_id <int> 2, 7, 16, 16, 25, 42, 42, 42, 44, 47, 47…
398
398
$ condition_concept_id <int> 381316, 381316, 381316, 313217, 381316, …
@@ -456,7 +456,7 @@ <h2 data-number="8.2" class="anchored" data-anchor-id="adding-multiple-demograph
456
456
< div class ="cell-output cell-output-stdout ">
457
457
< pre > < code > Rows: ??
458
458
Columns: 27
459
- Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpmeklJq\file668448b62f55 .duckdb]
459
+ Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpItzU3r\file5580112859cc .duckdb]
460
460
$ drug_exposure_id <int> 245761, 245762, 245763, 245765, 245766, 2…
461
461
$ person_id <int> 7764, 7764, 7764, 7764, 7764, 7764, 7764,…
462
462
$ drug_concept_id <int> 40213227, 40213201, 40213198, 40213154, 4…
@@ -498,8 +498,8 @@ <h2 data-number="8.2" class="anchored" data-anchor-id="adding-multiple-demograph
498
498
< pre > < code > # A tibble: 2 × 4
499
499
sex mean_age mean_prior_observation mean_future_observation
500
500
<chr> <dbl> <dbl> <dbl>
501
- 1 Female 39.4 2096 . 1661 .
502
- 2 Male 43.0 2455 . 1768 .</ code > </ pre >
501
+ 1 Male 43.0 2455 . 1768 .
502
+ 2 Female 39.4 2096 . 1661 .</ code > </ pre >
503
503
</ div >
504
504
</ div >
505
505
< div class ="callout callout-style-default callout-tip callout-titled ">
@@ -522,8 +522,8 @@ <h2 data-number="8.2" class="anchored" data-anchor-id="adding-multiple-demograph
522
522
< 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 >
523
523
< div class ="cell-output cell-output-stdout ">
524
524
< pre > < code > <SQL>
525
- SELECT og_004_1736509007 .*
526
- FROM og_004_1736509007
525
+ SELECT og_004_1736606693 .*
526
+ FROM og_004_1736606693
527
527
WHERE (sex = 'Male')</ code > </ pre >
528
528
</ div >
529
529
</ div >
@@ -623,7 +623,7 @@ <h2 data-number="8.3" class="anchored" data-anchor-id="creating-categories"><spa
623
623
< div class ="cell-output cell-output-stdout ">
624
624
< pre > < code > Rows: ??
625
625
Columns: 20
626
- Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpmeklJq\file668448b62f55 .duckdb]
626
+ Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpItzU3r\file5580112859cc .duckdb]
627
627
$ condition_occurrence_id <int> 1, 3, 8, 9, 12, 18, 19, 20, 21, 23, 24, …
628
628
$ person_id <int> 2, 7, 16, 16, 25, 42, 42, 42, 44, 47, 47…
629
629
$ condition_concept_id <int> 381316, 381316, 381316, 313217, 381316, …
@@ -660,7 +660,7 @@ <h2 data-number="8.4" class="anchored" data-anchor-id="adding-custom-variables">
660
660
< div class ="cell-output cell-output-stdout ">
661
661
< pre > < code > Rows: ??
662
662
Columns: 6
663
- Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpmeklJq\file668448b62f55 .duckdb]
663
+ Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpItzU3r\file5580112859cc .duckdb]
664
664
$ observation_period_id <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1…
665
665
$ person_id <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1…
666
666
$ observation_period_start_date <date> 2014-05-09, 1977-04-11, 2014-04-19, 201…
@@ -688,7 +688,7 @@ <h2 data-number="8.4" class="anchored" data-anchor-id="adding-custom-variables">
688
688
< div class ="cell-output cell-output-stdout ">
689
689
< pre > < code > Rows: ??
690
690
Columns: 2
691
- Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpmeklJq\file668448b62f55 .duckdb]
691
+ Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpItzU3r\file5580112859cc .duckdb]
692
692
$ person_id <int> 2, 7, 16, 18, 25, 36, 42, 44, 47, 51, 52,…
693
693
$ condition_occurrence_records <dbl> 1, 1, 2, 2, 1, 4, 3, 2, 5, 1, 3, 2, 1, 4,…</ code > </ pre >
694
694
</ div >
@@ -716,7 +716,7 @@ <h2 data-number="8.4" class="anchored" data-anchor-id="adding-custom-variables">
716
716
FROM main.person
717
717
LEFT JOIN (
718
718
SELECT person_id, COUNT(*) AS condition_occurrence_records
719
- FROM og_002_1736509005
719
+ FROM og_002_1736606688
720
720
GROUP BY person_id
721
721
) RHS
722
722
ON (person.person_id = RHS.person_id)
@@ -743,7 +743,7 @@ <h2 data-number="8.4" class="anchored" data-anchor-id="adding-custom-variables">
743
743
< 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 >
744
744
< div class ="cell-output cell-output-stdout ">
745
745
< pre > < code > # Source: SQL [?? x 1]
746
- # Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpmeklJq\file668448b62f55 .duckdb]
746
+ # Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpItzU3r\file5580112859cc .duckdb]
747
747
n
748
748
<dbl>
749
749
1 9967</ code > </ pre >
@@ -752,7 +752,7 @@ <h2 data-number="8.4" class="anchored" data-anchor-id="adding-custom-variables">
752
752
< 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 >
753
753
< div class ="cell-output cell-output-stdout ">
754
754
< pre > < code > # Source: SQL [?? x 1]
755
- # Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpmeklJq\file668448b62f55 .duckdb]
755
+ # Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpItzU3r\file5580112859cc .duckdb]
756
756
n
757
757
<dbl>
758
758
1 337509</ code > </ pre >
@@ -765,7 +765,7 @@ <h2 data-number="8.4" class="anchored" data-anchor-id="adding-custom-variables">
765
765
< 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 >
766
766
< div class ="cell-output cell-output-stdout ">
767
767
< pre > < code > # Source: SQL [?? x 1]
768
- # Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpmeklJq\file668448b62f55 .duckdb]
768
+ # Database: DuckDB v1.1.3 [eburn@Windows 10 x64:R 4.4.0/C:\Users\eburn\AppData\Local\Temp\RtmpItzU3r\file5580112859cc .duckdb]
769
769
n
770
770
<dbl>
771
771
1 410683</ code > </ pre >
0 commit comments