From 16fe9e8746e54b53557875b33d6e70358a5cc219 Mon Sep 17 00:00:00 2001 From: edward-burn <9583964+edward-burn@users.noreply.github.com> Date: Tue, 18 Jun 2024 17:32:21 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20OHDSI/Co?= =?UTF-8?q?hortConstructor@c65f347134134d0fa3d7841540670876e56a3b70=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 2 +- LICENSE.html | 2 +- apple-touch-icon-120x120.png | Bin 11933 -> 11933 bytes apple-touch-icon-152x152.png | Bin 16024 -> 16024 bytes apple-touch-icon-180x180.png | Bin 19230 -> 19230 bytes apple-touch-icon-60x60.png | Bin 5087 -> 5087 bytes apple-touch-icon-76x76.png | Bin 6873 -> 6873 bytes apple-touch-icon.png | Bin 19230 -> 19230 bytes articles/a00_introduction.html | 2 +- articles/a01_building_base_cohorts.html | 6 ++--- .../a02_applying_cohort_restrictions.html | 2 +- articles/a03_age_sex_matching.html | 2 +- articles/a04_cohort_manipulations.html | 2 +- articles/index.html | 2 +- authors.html | 6 ++--- favicon-16x16.png | Bin 1208 -> 1208 bytes favicon-32x32.png | Bin 2416 -> 2416 bytes index.html | 2 +- pkgdown.yml | 2 +- reference/CohortConstructor-package.html | 2 +- reference/collapseCohorts.html | 2 +- reference/conceptCohort.html | 2 +- reference/demographicsCohort.html | 2 +- reference/entryAtFirstDate.html | 10 ++++---- reference/entryAtLastDate.html | 10 ++++---- reference/exitAtDeath.html | 20 ++++++++-------- reference/exitAtFirstDate.html | 10 ++++---- reference/exitAtLastDate.html | 10 ++++---- reference/exitAtObservationEnd.html | 12 +++++----- reference/index.html | 2 +- reference/intersectCohorts.html | 2 +- reference/matchCohorts.html | 22 +++++++++--------- reference/measurementCohort.html | 6 ++--- reference/mockCohortConstructor.html | 2 +- reference/reexports.html | 2 +- reference/requireAge.html | 2 +- reference/requireCohortIntersect.html | 2 +- reference/requireConceptIntersect.html | 2 +- reference/requireDeathFlag.html | 2 +- reference/requireDemographics.html | 2 +- reference/requireFutureObservation.html | 2 +- reference/requireInDateRange.html | 2 +- reference/requireIsFirstEntry.html | 2 +- reference/requireIsLastEntry.html | 2 +- reference/requirePriorObservation.html | 2 +- reference/requireSex.html | 2 +- reference/requireTableIntersect.html | 2 +- reference/sampleCohorts.html | 22 +++++++++--------- reference/stratifyCohorts.html | 2 +- reference/subsetCohorts.html | 2 +- reference/trimDemographics.html | 2 +- reference/trimToDateRange.html | 2 +- reference/unionCohorts.html | 2 +- reference/yearCohorts.html | 2 +- search.json | 2 +- 55 files changed, 103 insertions(+), 103 deletions(-) diff --git a/404.html b/404.html index d65050b1..a547fefb 100644 --- a/404.html +++ b/404.html @@ -31,7 +31,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/LICENSE.html b/LICENSE.html index bd370ee0..14c90096 100644 --- a/LICENSE.html +++ b/LICENSE.html @@ -10,7 +10,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/apple-touch-icon-120x120.png b/apple-touch-icon-120x120.png index 40171cbd1d6e4cc8c53cda8efb8ea679e51e5a8d..2e0344119ab6dd8fcdb1206372dc5992b36d8ffb 100644 GIT binary patch delta 69 zcmbOmJ2!Sh6^D?Ztm50EH~%&^rR$1VgczDz8ChBx8*3XFSQ!``GCQAE83AqEy!2BucV2HFM&Rt5&G(wAf>|J9Ynkoe-3 KwQ#bYUOoWtTNMNV diff --git a/apple-touch-icon-152x152.png b/apple-touch-icon-152x152.png index c56f5be368e2dd4676d9b809b083436c76b3b9ed..c7f5e8e0a21bfcd4df7cae2089f3c0ec72b97ed6 100644 GIT binary patch delta 69 zcmbPHJEL|&6^D?ZtWrt!UYCtcNwy*uA%^BwMwV8_CfWuDRt5&_6aQFD{$VSNAyIb5 KrDd|FT|NK@4;5|FD(Ckoe-3 KwQ#bgT|NK+;}u%~ diff --git a/apple-touch-icon-180x180.png b/apple-touch-icon-180x180.png index ccf97c232c80cf1d67676dba08ac8a4a29dd4f54..40b22667a24cd67f5a9849fc216b5359346984fc 100644 GIT binary patch delta 71 zcmbO?jd9*I#tBs%LV~g?b0s7SH#WWS6tM^~G`BLcv@$l+HZZU!>%HP+H#WWS6fqAmu&^>PwK6u;HZZU delta 69 zcmca{^kXT!y K|7LQQR6YQ~Xl`X>X=QA#ZD3$!U|?4HZ0Y1WFIfx; Mca=EF$?LuH0X}LK*#H0l delta 71 zcmbO?jd9*I#tBs%f*h<0k~+l-8=GEuikOEOSXddDS{WN@8yHv_7zni-Hkn-KC5s`E Me6zY^@_Mg)0N;QW3IG5A diff --git a/articles/a00_introduction.html b/articles/a00_introduction.html index caddaeab..92e6dee5 100644 --- a/articles/a00_introduction.html +++ b/articles/a00_introduction.html @@ -33,7 +33,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/articles/a01_building_base_cohorts.html b/articles/a01_building_base_cohorts.html index 90c7caa7..58a41a44 100644 --- a/articles/a01_building_base_cohorts.html +++ b/articles/a01_building_base_cohorts.html @@ -33,7 +33,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 @@ -134,7 +134,7 @@ Demographic based cohort creation median_start_age = median(age), max_start_age = max(age)) #> # Source: SQL [1 x 3] -#> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1//tmp/RtmpJZsuDv/file1b034cba6033.duckdb] +#> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1//tmp/Rtmpj17orA/file1a566f76d0ad.duckdb] #> min_start_age median_start_age max_start_age #> <int> <dbl> <int> #> 1 17 18 18 @@ -146,7 +146,7 @@ Demographic based cohort creation median_start_age = median(age), max_start_age = max(age)) #> # Source: SQL [1 x 3] -#> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1//tmp/RtmpJZsuDv/file1b034cba6033.duckdb] +#> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1//tmp/Rtmpj17orA/file1a566f76d0ad.duckdb] #> min_start_age median_start_age max_start_age #> <int> <dbl> <int> #> 1 31 57 65 diff --git a/articles/a02_applying_cohort_restrictions.html b/articles/a02_applying_cohort_restrictions.html index 02bd3c4f..7ae85703 100644 --- a/articles/a02_applying_cohort_restrictions.html +++ b/articles/a02_applying_cohort_restrictions.html @@ -33,7 +33,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/articles/a03_age_sex_matching.html b/articles/a03_age_sex_matching.html index e74e127b..3fba9a06 100644 --- a/articles/a03_age_sex_matching.html +++ b/articles/a03_age_sex_matching.html @@ -33,7 +33,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/articles/a04_cohort_manipulations.html b/articles/a04_cohort_manipulations.html index 860d2c01..b5c841e5 100644 --- a/articles/a04_cohort_manipulations.html +++ b/articles/a04_cohort_manipulations.html @@ -33,7 +33,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/articles/index.html b/articles/index.html index 7577ecdf..9f39e9e3 100644 --- a/articles/index.html +++ b/articles/index.html @@ -10,7 +10,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/authors.html b/authors.html index b85d4327..2445e67d 100644 --- a/authors.html +++ b/authors.html @@ -10,7 +10,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 @@ -87,13 +87,13 @@ Citation Burn E, Catala M, Mercade-Besora N, Alcalde-Herraiz M, Du M, Guo Y, Chen X, Lopez K (2024). CohortConstructor: Build and Manipulate Study Cohorts Using a Common Data Model. -R package version 0.2.1, https://ohdsi.github.io/CohortConstructor/. +R package version 0.2.1.900, https://ohdsi.github.io/CohortConstructor/. @Manual{, title = {CohortConstructor: Build and Manipulate Study Cohorts Using a Common Data Model}, author = {Edward Burn and Marti Catala and Nuria Mercade-Besora and Marta Alcalde-Herraiz and Mike Du and Yuchen Guo and Xihang Chen and Kim Lopez}, year = {2024}, - note = {R package version 0.2.1}, + note = {R package version 0.2.1.900}, url = {https://ohdsi.github.io/CohortConstructor/}, } diff --git a/favicon-16x16.png b/favicon-16x16.png index 734854f42d18bc7832b5b23b222a65874a0068d0..e19d7384b7050f1694cb157bec4659d82585f79b 100644 GIT binary patch delta 71 zcmdnNxr1}V872-PL0PS;1*T=2uP_-fidcjgnp+uJTA3JW8yHv_8057ake)2TB8wp* Mf3srwWKWiS0N4Z*)c^nh delta 71 zcmdnNxr1}V872-v4p!v`Ri#;*uP_-fikOEOSXddDS{a*a8yHv_7+hEWyKAxpi!6r3 MvN~6`$(}6v0M6wTdH?_b diff --git a/favicon-32x32.png b/favicon-32x32.png index f8679f8b619195eaa27397c23d64a6fdd0a539f2..770ed814fcc310e5cf0f6199cae68a79fe33cc61 100644 GIT binary patch delta 69 zcmew$^g(Ds6^D?Ztj^@a6P!0TS#gM1gczDz8ChDHm}naqSQ!}bhJ00=e1St2L!yS$ KckX0H&U^siCohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/pkgdown.yml b/pkgdown.yml index 87f0f5a4..e9abe0d9 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -7,7 +7,7 @@ articles: a02_applying_cohort_restrictions: a02_applying_cohort_restrictions.html a03_age_sex_matching: a03_age_sex_matching.html a04_cohort_manipulations: a04_cohort_manipulations.html -last_built: 2024-06-17T08:05Z +last_built: 2024-06-18T17:29Z urls: reference: https://ohdsi.github.io/CohortConstructor/reference article: https://ohdsi.github.io/CohortConstructor/articles diff --git a/reference/CohortConstructor-package.html b/reference/CohortConstructor-package.html index 5e0d3c10..8e8267dd 100644 --- a/reference/CohortConstructor-package.html +++ b/reference/CohortConstructor-package.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/collapseCohorts.html b/reference/collapseCohorts.html index 4d24c611..770e7d5c 100644 --- a/reference/collapseCohorts.html +++ b/reference/collapseCohorts.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/conceptCohort.html b/reference/conceptCohort.html index cfe94a48..1c00c534 100644 --- a/reference/conceptCohort.html +++ b/reference/conceptCohort.html @@ -56,7 +56,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/demographicsCohort.html b/reference/demographicsCohort.html index d94d02f3..734cde37 100644 --- a/reference/demographicsCohort.html +++ b/reference/demographicsCohort.html @@ -16,7 +16,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/entryAtFirstDate.html b/reference/entryAtFirstDate.html index ac145a60..4e8687ce 100644 --- a/reference/entryAtFirstDate.html +++ b/reference/entryAtFirstDate.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 @@ -115,10 +115,10 @@ Examples#> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date entry_reason #> <dbl> <dbl> <date> <date> <chr> -#> 1 1 3 2015-02-14 2015-02-15 date_2 -#> 2 1 2 2001-01-01 2001-01-12 date_1 -#> 3 1 1 2001-08-01 2001-09-01 date_1; dat… -#> 4 1 4 2002-12-09 2002-12-09 date_1; dat… +#> 1 1 1 2001-08-01 2001-09-01 date_2; dat… +#> 2 1 3 2015-02-14 2015-02-15 date_2 +#> 3 1 2 2001-01-01 2001-01-12 date_1 +#> 4 1 4 2002-12-09 2002-12-09 date_2; dat… # } diff --git a/reference/entryAtLastDate.html b/reference/entryAtLastDate.html index 60b90686..120cda9d 100644 --- a/reference/entryAtLastDate.html +++ b/reference/entryAtLastDate.html @@ -10,7 +10,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 @@ -112,10 +112,10 @@ Examples#> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date entry_reason #> <dbl> <dbl> <date> <date> <chr> -#> 1 1 1 2001-08-01 2001-09-01 date_2; dat… -#> 2 1 2 2001-01-01 2001-01-12 date_1 -#> 3 1 3 2015-02-14 2015-02-15 date_2 -#> 4 1 4 2002-12-09 2002-12-09 date_2; dat… +#> 1 1 2 2001-01-01 2001-01-12 date_1 +#> 2 1 3 2015-02-14 2015-02-15 date_2 +#> 3 1 1 2001-08-01 2001-09-01 date_1; dat… +#> 4 1 4 2002-12-09 2002-12-09 date_1; dat… # } diff --git a/reference/exitAtDeath.html b/reference/exitAtDeath.html index f53aa7aa..ed321ef1 100644 --- a/reference/exitAtDeath.html +++ b/reference/exitAtDeath.html @@ -14,7 +14,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 @@ -105,16 +105,16 @@ Examples#> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date #> <int> <int> <date> <date> -#> 1 2 8 1954-07-05 1955-07-17 -#> 2 2 5 2113-08-18 2144-11-05 -#> 3 3 7 2029-01-30 2050-08-27 -#> 4 2 2 1998-11-05 2008-01-27 +#> 1 3 7 2029-01-30 2050-08-27 +#> 2 2 8 1954-07-05 1955-07-17 +#> 3 2 5 2113-08-18 2144-11-05 +#> 4 1 6 2006-12-25 2022-11-01 #> 5 2 1 1951-11-28 2019-01-16 -#> 6 1 6 2006-12-25 2022-11-01 -#> 7 3 10 2003-01-05 2060-02-27 -#> 8 2 3 1993-12-06 1997-05-26 -#> 9 1 4 2017-04-18 2077-11-07 -#> 10 2 9 2109-11-07 2115-08-03 +#> 6 2 2 1998-11-05 2008-01-27 +#> 7 1 4 2017-04-18 2077-11-07 +#> 8 2 9 2109-11-07 2115-08-03 +#> 9 2 3 1993-12-06 1997-05-26 +#> 10 3 10 2003-01-05 2060-02-27 # } diff --git a/reference/exitAtFirstDate.html b/reference/exitAtFirstDate.html index f37c4fd3..cab41598 100644 --- a/reference/exitAtFirstDate.html +++ b/reference/exitAtFirstDate.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 @@ -115,10 +115,10 @@ Examples#> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date exit_reason #> <dbl> <dbl> <date> <date> <chr> -#> 1 1 3 2015-01-15 2015-01-15 date_1 -#> 2 1 1 2000-06-03 2001-08-01 date_1; dat… -#> 3 1 2 2000-01-01 2001-01-01 date_1 -#> 4 1 4 2000-12-09 2002-12-09 date_1; dat… +#> 1 1 4 2000-12-09 2002-12-09 date_2; dat… +#> 2 1 2 2000-01-01 2001-01-01 date_1 +#> 3 1 1 2000-06-03 2001-08-01 date_2; dat… +#> 4 1 3 2015-01-15 2015-01-15 date_1 # } diff --git a/reference/exitAtLastDate.html b/reference/exitAtLastDate.html index 295af798..ce113425 100644 --- a/reference/exitAtLastDate.html +++ b/reference/exitAtLastDate.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 @@ -115,10 +115,10 @@ Examples#> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date exit_reason #> <dbl> <dbl> <date> <date> <chr> -#> 1 1 2 2000-01-01 2001-01-01 date_1 -#> 2 1 1 2000-06-03 2001-08-01 date_1; dat… -#> 3 1 3 2015-01-15 2015-04-15 date_2 -#> 4 1 4 2000-12-09 2002-12-09 date_1; dat… +#> 1 1 1 2000-06-03 2001-08-01 date_1; dat… +#> 2 1 2 2000-01-01 2001-01-01 date_1 +#> 3 1 4 2000-12-09 2002-12-09 date_1; dat… +#> 4 1 3 2015-01-15 2015-04-15 date_2 # } diff --git a/reference/exitAtObservationEnd.html b/reference/exitAtObservationEnd.html index b09269f6..b2a4f930 100644 --- a/reference/exitAtObservationEnd.html +++ b/reference/exitAtObservationEnd.html @@ -18,7 +18,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 @@ -102,11 +102,11 @@ Examples#> cohort_definition_id subject_id cohort_start_date cohort_end_date #> <int> <int> <date> <date> #> 1 1 7 2014-03-07 2014-04-09 -#> 2 1 2 2000-05-04 2003-06-15 -#> 3 1 4 1996-06-30 2013-12-31 -#> 4 1 5 2012-03-20 2013-02-10 -#> 5 1 3 2015-01-27 2015-10-11 -#> 6 1 1 2001-05-30 2013-06-29 +#> 2 1 4 1996-06-30 2013-12-31 +#> 3 1 2 2000-05-04 2003-06-15 +#> 4 1 3 2015-01-27 2015-10-11 +#> 5 1 1 2001-05-30 2013-06-29 +#> 6 1 5 2012-03-20 2013-02-10 # } diff --git a/reference/index.html b/reference/index.html index 297073d4..d69b92e1 100644 --- a/reference/index.html +++ b/reference/index.html @@ -10,7 +10,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/intersectCohorts.html b/reference/intersectCohorts.html index 32b6e392..cabe9b38 100644 --- a/reference/intersectCohorts.html +++ b/reference/intersectCohorts.html @@ -14,7 +14,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/matchCohorts.html b/reference/matchCohorts.html index d21c7076..2bf3a628 100644 --- a/reference/matchCohorts.html +++ b/reference/matchCohorts.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 @@ -141,16 +141,16 @@ Examples#> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date cluster_id #> <int> <int> <date> <date> <dbl> -#> 1 1 94 2017-11-01 2018-07-05 59 -#> 2 1 119 1982-09-08 1989-01-29 65 -#> 3 1 62 2017-04-27 2018-07-04 74 -#> 4 1 98 2010-02-24 2013-03-24 84 -#> 5 1 8 1990-10-16 1999-07-20 94 -#> 6 1 105 2002-04-21 2003-07-10 106 -#> 7 1 118 1975-11-28 1981-05-30 6 -#> 8 1 56 2007-09-28 2008-07-15 18 -#> 9 1 63 2008-08-23 2008-09-02 19 -#> 10 1 20 1985-08-15 1990-06-06 26 +#> 1 1 19 2003-06-22 2005-07-21 35 +#> 2 1 84 1995-08-28 1999-04-05 42 +#> 3 1 113 2015-09-05 2016-01-10 50 +#> 4 1 94 2017-11-01 2018-07-05 59 +#> 5 1 118 1975-11-28 1981-05-30 6 +#> 6 1 56 2007-09-28 2008-07-15 18 +#> 7 1 20 1990-06-07 1993-11-05 26 +#> 8 1 119 1982-09-08 1989-01-29 65 +#> 9 1 98 2010-02-24 2013-03-24 84 +#> 10 1 62 2017-04-27 2018-07-04 73 #> # ℹ more rows # } diff --git a/reference/measurementCohort.html b/reference/measurementCohort.html index dd44abf6..ee3cdfce 100644 --- a/reference/measurementCohort.html +++ b/reference/measurementCohort.html @@ -34,7 +34,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 @@ -185,8 +185,8 @@ Examples#> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date #> <int> <dbl> <date> <date> -#> 1 1 3 2015-02-19 2015-02-19 -#> 2 1 1 2000-07-01 2000-07-01 +#> 1 1 1 2000-07-01 2000-07-01 +#> 2 1 3 2015-02-19 2015-02-19 # } diff --git a/reference/mockCohortConstructor.html b/reference/mockCohortConstructor.html index a7087550..46bc3b9b 100644 --- a/reference/mockCohortConstructor.html +++ b/reference/mockCohortConstructor.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/reexports.html b/reference/reexports.html index 45891d2b..0d5ec743 100644 --- a/reference/reexports.html +++ b/reference/reexports.html @@ -32,7 +32,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/requireAge.html b/reference/requireAge.html index 0de57c0d..f71cbb73 100644 --- a/reference/requireAge.html +++ b/reference/requireAge.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/requireCohortIntersect.html b/reference/requireCohortIntersect.html index b2141533..b2b897b4 100644 --- a/reference/requireCohortIntersect.html +++ b/reference/requireCohortIntersect.html @@ -14,7 +14,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/requireConceptIntersect.html b/reference/requireConceptIntersect.html index d47cf0dc..1a926477 100644 --- a/reference/requireConceptIntersect.html +++ b/reference/requireConceptIntersect.html @@ -14,7 +14,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/requireDeathFlag.html b/reference/requireDeathFlag.html index 0e371a31..6074dc7a 100644 --- a/reference/requireDeathFlag.html +++ b/reference/requireDeathFlag.html @@ -14,7 +14,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/requireDemographics.html b/reference/requireDemographics.html index ee75cd96..2acf7705 100644 --- a/reference/requireDemographics.html +++ b/reference/requireDemographics.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/requireFutureObservation.html b/reference/requireFutureObservation.html index 26d95410..a0b24185 100644 --- a/reference/requireFutureObservation.html +++ b/reference/requireFutureObservation.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/requireInDateRange.html b/reference/requireInDateRange.html index bc1ce386..b5b2ac65 100644 --- a/reference/requireInDateRange.html +++ b/reference/requireInDateRange.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/requireIsFirstEntry.html b/reference/requireIsFirstEntry.html index e1c03ff9..bd763f5c 100644 --- a/reference/requireIsFirstEntry.html +++ b/reference/requireIsFirstEntry.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/requireIsLastEntry.html b/reference/requireIsLastEntry.html index d22116c7..977d6a66 100644 --- a/reference/requireIsLastEntry.html +++ b/reference/requireIsLastEntry.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/requirePriorObservation.html b/reference/requirePriorObservation.html index e43d0199..881b76b8 100644 --- a/reference/requirePriorObservation.html +++ b/reference/requirePriorObservation.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/requireSex.html b/reference/requireSex.html index 6c642e5a..c8202c33 100644 --- a/reference/requireSex.html +++ b/reference/requireSex.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/requireTableIntersect.html b/reference/requireTableIntersect.html index f2930fb1..e0c8c0ef 100644 --- a/reference/requireTableIntersect.html +++ b/reference/requireTableIntersect.html @@ -14,7 +14,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/sampleCohorts.html b/reference/sampleCohorts.html index 1f642fa6..d9c4ccef 100644 --- a/reference/sampleCohorts.html +++ b/reference/sampleCohorts.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 @@ -96,16 +96,16 @@ Examples#> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date #> <int> <int> <date> <date> -#> 1 1 1 2001-02-15 2001-10-28 -#> 2 1 1 2001-10-29 2003-03-15 -#> 3 1 1 2003-03-16 2005-02-08 -#> 4 1 21 1996-09-03 1996-11-02 -#> 5 1 21 1996-11-03 1997-03-12 -#> 6 1 22 1993-09-22 1994-04-10 -#> 7 1 22 1994-04-11 1996-04-26 -#> 8 1 22 1996-04-27 1999-08-31 -#> 9 1 28 2005-04-01 2005-04-03 -#> 10 1 28 2005-04-04 2005-08-23 +#> 1 1 13 2014-06-24 2014-06-29 +#> 2 1 13 2014-06-30 2014-08-07 +#> 3 1 25 2019-06-16 2019-07-07 +#> 4 1 34 2017-05-28 2017-07-27 +#> 5 1 34 2017-07-28 2017-08-05 +#> 6 1 34 2017-08-06 2017-10-02 +#> 7 1 38 1990-05-01 1994-07-14 +#> 8 1 39 2003-03-18 2003-04-11 +#> 9 1 39 2003-04-12 2003-05-10 +#> 10 1 39 2003-05-11 2007-11-15 #> # ℹ more rows # } diff --git a/reference/stratifyCohorts.html b/reference/stratifyCohorts.html index ce4fe0ad..203ec76d 100644 --- a/reference/stratifyCohorts.html +++ b/reference/stratifyCohorts.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/subsetCohorts.html b/reference/subsetCohorts.html index 58345bd3..c230fb92 100644 --- a/reference/subsetCohorts.html +++ b/reference/subsetCohorts.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/trimDemographics.html b/reference/trimDemographics.html index fe10a247..6509969f 100644 --- a/reference/trimDemographics.html +++ b/reference/trimDemographics.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/trimToDateRange.html b/reference/trimToDateRange.html index 65cffc8c..adec0410 100644 --- a/reference/trimToDateRange.html +++ b/reference/trimToDateRange.html @@ -12,7 +12,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/unionCohorts.html b/reference/unionCohorts.html index 91b6ced3..075ecf93 100644 --- a/reference/unionCohorts.html +++ b/reference/unionCohorts.html @@ -14,7 +14,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/reference/yearCohorts.html b/reference/yearCohorts.html index 71f6f1fb..bab3212c 100644 --- a/reference/yearCohorts.html +++ b/reference/yearCohorts.html @@ -10,7 +10,7 @@ CohortConstructor - 0.2.1 + 0.2.1.900 diff --git a/search.json b/search.json index 444789b3..baea7909 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://ohdsi.github.io/CohortConstructor/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"Apache License","title":"Apache License","text":"Version 2.0, January 2004 ","code":""},{"path":[]},{"path":"https://ohdsi.github.io/CohortConstructor/LICENSE.html","id":"id_1-definitions","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"1. Definitions","title":"Apache License","text":"“License” shall mean terms conditions use, reproduction, distribution defined Sections 1 9 document. “Licensor” shall mean copyright owner entity authorized copyright owner granting License. “Legal Entity” shall mean union acting entity entities control, controlled , common control entity. purposes definition, “control” means () power, direct indirect, cause direction management entity, whether contract otherwise, (ii) ownership fifty percent (50%) outstanding shares, (iii) beneficial ownership entity. “” (“”) shall mean individual Legal Entity exercising permissions granted License. “Source” form shall mean preferred form making modifications, including limited software source code, documentation source, configuration files. “Object” form shall mean form resulting mechanical transformation translation Source form, including limited compiled object code, generated documentation, conversions media types. “Work” shall mean work authorship, whether Source Object form, made available License, indicated copyright notice included attached work (example provided Appendix ). “Derivative Works” shall mean work, whether Source Object form, based (derived ) Work editorial revisions, annotations, elaborations, modifications represent, whole, original work authorship. purposes License, Derivative Works shall include works remain separable , merely link (bind name) interfaces , Work Derivative Works thereof. “Contribution” shall mean work authorship, including original version Work modifications additions Work Derivative Works thereof, intentionally submitted Licensor inclusion Work copyright owner individual Legal Entity authorized submit behalf copyright owner. purposes definition, “submitted” means form electronic, verbal, written communication sent Licensor representatives, including limited communication electronic mailing lists, source code control systems, issue tracking systems managed , behalf , Licensor purpose discussing improving Work, excluding communication conspicuously marked otherwise designated writing copyright owner “Contribution.” “Contributor” shall mean Licensor individual Legal Entity behalf Contribution received Licensor subsequently incorporated within Work.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/LICENSE.html","id":"id_2-grant-of-copyright-license","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"2. Grant of Copyright License","title":"Apache License","text":"Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable copyright license reproduce, prepare Derivative Works , publicly display, publicly perform, sublicense, distribute Work Derivative Works Source Object form.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/LICENSE.html","id":"id_3-grant-of-patent-license","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"3. Grant of Patent License","title":"Apache License","text":"Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable (except stated section) patent license make, made, use, offer sell, sell, import, otherwise transfer Work, license applies patent claims licensable Contributor necessarily infringed Contribution(s) alone combination Contribution(s) Work Contribution(s) submitted. institute patent litigation entity (including cross-claim counterclaim lawsuit) alleging Work Contribution incorporated within Work constitutes direct contributory patent infringement, patent licenses granted License Work shall terminate date litigation filed.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/LICENSE.html","id":"id_4-redistribution","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"4. Redistribution","title":"Apache License","text":"may reproduce distribute copies Work Derivative Works thereof medium, without modifications, Source Object form, provided meet following conditions: () must give recipients Work Derivative Works copy License; (b) must cause modified files carry prominent notices stating changed files; (c) must retain, Source form Derivative Works distribute, copyright, patent, trademark, attribution notices Source form Work, excluding notices pertain part Derivative Works; (d) Work includes “NOTICE” text file part distribution, Derivative Works distribute must include readable copy attribution notices contained within NOTICE file, excluding notices pertain part Derivative Works, least one following places: within NOTICE text file distributed part Derivative Works; within Source form documentation, provided along Derivative Works; , within display generated Derivative Works, wherever third-party notices normally appear. contents NOTICE file informational purposes modify License. may add attribution notices within Derivative Works distribute, alongside addendum NOTICE text Work, provided additional attribution notices construed modifying License. may add copyright statement modifications may provide additional different license terms conditions use, reproduction, distribution modifications, Derivative Works whole, provided use, reproduction, distribution Work otherwise complies conditions stated License.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/LICENSE.html","id":"id_5-submission-of-contributions","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"5. Submission of Contributions","title":"Apache License","text":"Unless explicitly state otherwise, Contribution intentionally submitted inclusion Work Licensor shall terms conditions License, without additional terms conditions. Notwithstanding , nothing herein shall supersede modify terms separate license agreement may executed Licensor regarding Contributions.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/LICENSE.html","id":"id_6-trademarks","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"6. Trademarks","title":"Apache License","text":"License grant permission use trade names, trademarks, service marks, product names Licensor, except required reasonable customary use describing origin Work reproducing content NOTICE file.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/LICENSE.html","id":"id_7-disclaimer-of-warranty","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"7. Disclaimer of Warranty","title":"Apache License","text":"Unless required applicable law agreed writing, Licensor provides Work (Contributor provides Contributions) “” BASIS, WITHOUT WARRANTIES CONDITIONS KIND, either express implied, including, without limitation, warranties conditions TITLE, NON-INFRINGEMENT, MERCHANTABILITY, FITNESS PARTICULAR PURPOSE. solely responsible determining appropriateness using redistributing Work assume risks associated exercise permissions License.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/LICENSE.html","id":"id_8-limitation-of-liability","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"8. Limitation of Liability","title":"Apache License","text":"event legal theory, whether tort (including negligence), contract, otherwise, unless required applicable law (deliberate grossly negligent acts) agreed writing, shall Contributor liable damages, including direct, indirect, special, incidental, consequential damages character arising result License use inability use Work (including limited damages loss goodwill, work stoppage, computer failure malfunction, commercial damages losses), even Contributor advised possibility damages.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/LICENSE.html","id":"id_9-accepting-warranty-or-additional-liability","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"9. Accepting Warranty or Additional Liability","title":"Apache License","text":"redistributing Work Derivative Works thereof, may choose offer, charge fee , acceptance support, warranty, indemnity, liability obligations /rights consistent License. However, accepting obligations, may act behalf sole responsibility, behalf Contributor, agree indemnify, defend, hold Contributor harmless liability incurred , claims asserted , Contributor reason accepting warranty additional liability. END TERMS CONDITIONS","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/LICENSE.html","id":"appendix-how-to-apply-the-apache-license-to-your-work","dir":"","previous_headings":"","what":"APPENDIX: How to apply the Apache License to your work","title":"Apache License","text":"apply Apache License work, attach following boilerplate notice, fields enclosed brackets [] replaced identifying information. (Don’t include brackets!) text enclosed appropriate comment syntax file format. also recommend file class name description purpose included “printed page” copyright notice easier identification within third-party archives.","code":"Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License."},{"path":"https://ohdsi.github.io/CohortConstructor/articles/a00_introduction.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Introduction","text":"CohortConstructor package designed support cohort building pipelines. using package general workflow first build set base cohorts subsequently apply inclusion criteria derive final study cohorts interest. Base cohorts built domain (rather cohort definition) one base cohort many study cohorts can derived.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/articles/a00_introduction.html","id":"building-a-cohort-set-by-domain","dir":"Articles","previous_headings":"","what":"Building a cohort set by domain","title":"Introduction","text":"Let´s say want build 5 cohorts 3 (asthma, copd, diabetes) defined based concepts seen condition occurrence table 2 (acetaminophen warfarin) based concepts recorded drug exposure table. can build cohorts independently, one . However, approach mean repeating 3 joins condition occurrence tables 2 joins drug exposure table (concepts concept sets). make less computationally expensive, instead create cohorts domain. case instead make one join condition occurrence table one drug exposure (using concept sets together).","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/articles/a00_introduction.html","id":"deriving-study-cohorts-from-base-cohorts","dir":"Articles","previous_headings":"","what":"Deriving study cohorts from base cohorts","title":"Introduction","text":"making study cohorts often concept sets define clinical event along various study-specific inclusion criteria, example criteria around amount prior observation age. Often may sensitivity analysis concept set remains inclusion criteria change. situations can make cohorts one--one. However, can lead duplication can see example identify asthma records multiple times. alternative approach build base cohort, case based asthma records, derive multiple cohorts different inclusion criteria applied.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/articles/a00_introduction.html","id":"considerations-when-building-cohorts","dir":"Articles","previous_headings":"","what":"Considerations when building cohorts","title":"Introduction","text":"CohortConstructor provides means building cohorts via pipeline, cohorts created application sequence functions. important note order sequence often important implications. example just one individual three recorded diagnoses asthma. One diagnosis 2008 two 2009, last coming individual´s 18th birthday. three cohort pipelines shown restrictions around calendar dates, age, record first. cohort pipeline , however, individual included final cohort, third diagnosis used cohort start. pipeline B C individual excluded.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/articles/a01_building_base_cohorts.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Building base cohorts","text":"Let’s first create cdm reference Eunomia synthetic data.","code":"library(CDMConnector) library(CodelistGenerator) library(PatientProfiles) library(CohortConstructor) library(dplyr) con <- DBI::dbConnect(duckdb::duckdb(), dbdir = eunomia_dir()) cdm <- cdm_from_con(con, cdm_schema = \"main\", write_schema = c(prefix = \"my_study_\", schema = \"main\"))"},{"path":"https://ohdsi.github.io/CohortConstructor/articles/a01_building_base_cohorts.html","id":"demographic-based-cohort-creation","dir":"Articles","previous_headings":"","what":"Demographic based cohort creation","title":"Building base cohorts","text":"One base cohort can create based around patient demographics. example create cohort people enter 18th birthday leave age 65 ","code":"cdm$working_age_cohort <- demographicsCohort(cdm = cdm, ageRange = c(18, 65), name = \"working_age_cohort\") settings(cdm$working_age_cohort) #> # A tibble: 1 × 3 #> cohort_definition_id cohort_name age_range #> #> 1 1 demographics 18_65 cohortCount(cdm$working_age_cohort) #> # A tibble: 1 × 3 #> cohort_definition_id number_records number_subjects #> #> 1 1 2694 2694 attrition(cdm$working_age_cohort) #> # A tibble: 2 × 7 #> cohort_definition_id number_records number_subjects reason_id reason #> #> 1 1 2694 2694 1 Initial qualify… #> 2 1 2694 2694 2 Age requirement… #> # ℹ 2 more variables: excluded_records , excluded_subjects cdm$working_age_cohort |> addAge(indexDate = \"cohort_start_date\") |> summarise(min_start_age = min(age), median_start_age = median(age), max_start_age = max(age)) #> # Source: SQL [1 x 3] #> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1//tmp/RtmpJZsuDv/file1b034cba6033.duckdb] #> min_start_age median_start_age max_start_age #> #> 1 17 18 18 cdm$working_age_cohort |> addAge(indexDate = \"cohort_end_date\") |> summarise(min_start_age = min(age), median_start_age = median(age), max_start_age = max(age)) #> # Source: SQL [1 x 3] #> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1//tmp/RtmpJZsuDv/file1b034cba6033.duckdb] #> min_start_age median_start_age max_start_age #> #> 1 31 57 65"},{"path":"https://ohdsi.github.io/CohortConstructor/articles/a01_building_base_cohorts.html","id":"concept-based-cohort-creation","dir":"Articles","previous_headings":"","what":"Concept based cohort creation","title":"Building base cohorts","text":"","code":"drug_codes <- getDrugIngredientCodes(cdm, name = c(\"diclofenac\", \"acetaminophen\")) drug_codes #> #> - diclofenac (1 codes) #> - acetaminophen (7 codes) cdm$medications <- conceptCohort(cdm = cdm, conceptSet = drug_codes, name = \"medications\") settings(cdm$medications) #> # A tibble: 2 × 2 #> cohort_definition_id cohort_name #> #> 1 1 diclofenac #> 2 2 acetaminophen cohortCount(cdm$medications) #> # A tibble: 2 × 3 #> cohort_definition_id number_records number_subjects #> #> 1 1 830 830 #> 2 2 13908 2679"},{"path":[]},{"path":"https://ohdsi.github.io/CohortConstructor/articles/a02_applying_cohort_restrictions.html","id":"keep-only-the-first-record-per-person","dir":"Articles","previous_headings":"","what":"Keep only the first record per person","title":"Applying cohort restrictions","text":"Individuals can contribute multiple records per cohort. However now ’ll keep earliest cohort entry remaining records using requireIsFirstEntry() CohortConstructor. can see one record per person cohort. Note, applying criteria later applying criteria result different result. ’re requiring individuals meet inclusion criteria time first use diclofenac acetaminophen.","code":"cdm$medications <- cdm$medications %>% requireIsFirstEntry(indexDate = \"cohort_start_date\") cohortCount(cdm$medications) #> # A tibble: 2 × 3 #> cohort_definition_id number_records number_subjects #> #> 1 1 830 830 #> 2 2 2580 2580"},{"path":"https://ohdsi.github.io/CohortConstructor/articles/a02_applying_cohort_restrictions.html","id":"applying-restrictions-on-patient-demographics","dir":"Articles","previous_headings":"","what":"Applying restrictions on patient demographics","title":"Applying cohort restrictions","text":"Using requireDemographics() ’ll require individuals medications cohort female , relative cohort start date, 18 85 least 30 days prior observation time database. can see many people people excluded based demographic requirements.","code":"cdm$medications <- cdm$medications %>% requireDemographics(indexDate = \"cohort_start_date\", ageRange = list(c(18, 85)), sex = \"Female\", minPriorObservation = 30) cohort_attrition(cdm$medications) %>% dplyr::filter(reason == \"Demographic requirements\") %>% dplyr::glimpse() #> Rows: 0 #> Columns: 7 #> $ cohort_definition_id #> $ number_records #> $ number_subjects #> $ reason_id #> $ reason #> $ excluded_records #> $ excluded_subjects "},{"path":"https://ohdsi.github.io/CohortConstructor/articles/a02_applying_cohort_restrictions.html","id":"restrictions-on-calendar-dates","dir":"Articles","previous_headings":"","what":"Restrictions on calendar dates","title":"Applying cohort restrictions","text":"Next can use requireInDateRange() keep records cohort entry particular date range. , can track cohort attrition","code":"cdm$medications <- cdm$medications %>% requireInDateRange(indexDate = \"cohort_start_date\", dateRange = as.Date(c(\"2000-01-01\", \"2015-01-01\"))) cohort_attrition(cdm$medications) %>% dplyr::filter(reason == \"cohort_start_date between 2000-01-01 and 2015-01-01\") %>% dplyr::glimpse() #> Rows: 0 #> Columns: 7 #> $ cohort_definition_id #> $ number_records #> $ number_subjects #> $ reason_id #> $ reason #> $ excluded_records #> $ excluded_subjects "},{"path":"https://ohdsi.github.io/CohortConstructor/articles/a02_applying_cohort_restrictions.html","id":"restrictions-on-cohort-presence","dir":"Articles","previous_headings":"","what":"Restrictions on cohort presence","title":"Applying cohort restrictions","text":"require individuals medication cohorts history GI bleed. can use requireCohortIntersect() function, requiring individuals one intersections GI bleed cohort. Instead requiring individuals history GI bleed, instead require don’t history . case can use requireCohortIntersect() function, time set intersections argument 0 require individuals’ absence cohort rather presence .","code":"cdm$medications_gi_bleed <- cdm$medications %>% requireCohortIntersect(intersections = c(1,Inf), targetCohortTable = \"gi_bleed\", targetCohortId = 1, indexDate = \"cohort_start_date\", window = c(-Inf, 0), name = \"medications_gi_bleed\") cohort_count(cdm$medications_gi_bleed) #> # A tibble: 2 × 3 #> cohort_definition_id number_records number_subjects #> #> 1 1 0 0 #> 2 2 7 7 cdm$medications_no_gi_bleed <- cdm$medications %>% requireCohortIntersect(intersections = 0, targetCohortTable = \"gi_bleed\", targetCohortId = 1, indexDate = \"cohort_start_date\", window = c(-Inf, 0), name = \"medications_no_gi_bleed\") cohort_count(cdm$medications_no_gi_bleed) #> # A tibble: 2 × 3 #> cohort_definition_id number_records number_subjects #> #> 1 1 179 179 #> 2 2 94 94"},{"path":"https://ohdsi.github.io/CohortConstructor/articles/a03_age_sex_matching.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Generate a matched age and sex cohort","text":"CohortConstructor packages includes function obtain age sex matched cohort, generateMatchedCohortSet() function. vignette, explore usage function.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/articles/a03_age_sex_matching.html","id":"create-mock-data","dir":"Articles","previous_headings":"Introduction","what":"Create mock data","title":"Generate a matched age and sex cohort","text":"first use mockDrugUtilisation() function DrugUtilisation package create mock data. use cohort1 explore generateMatchedCohortSet(), let us first use cohort_attrition() CDMConnector package explore cohort:","code":"library(CohortConstructor) library(dplyr) cdm <- mockCohortConstructor(nPerson = 1000) CDMConnector::cohort_set(cdm$cohort1)"},{"path":"https://ohdsi.github.io/CohortConstructor/articles/a03_age_sex_matching.html","id":"use-generatematchedcohortset-to-create-an-age-sex-matched-cohort","dir":"Articles","previous_headings":"","what":"Use generateMatchedCohortSet() to create an age-sex matched cohort","title":"Generate a matched age and sex cohort","text":"Let us first see example function works. usage, need provide cdm object, targetCohortName, name table containing cohort interest, name new generated tibble containing cohort matched cohort. also use argument targetCohortId specify want matched cohort cohort_definition_id = 1. Notice generated tibble, two cohorts: cohort_definition_id = 1 (original cohort), cohort_definition_id = 4 (matched cohort). target_cohort_name column indicates original cohort. match_sex match_year_of_birth adopt boolean values (TRUE/FALSE) indicating matched sex age, . match_status indicate original cohort (target) matched cohort (matched). target_cohort_id indicates cohort_id original cohort. Check exclusion criteria applied generate new cohorts using cohort_attrition() CDMConnector package: Briefly, original cohort, exclude first individuals match, individuals matching pair observation assigned cohort_start_date. matched cohort, start whole database first exclude individuals original cohort. Afterwards, exclude individuals match, individuals observation assigned cohort_start_date, finally remove many individuals required fulfill ratio. Notice matching pairs randomly assigned, probable every time execute function, generated cohorts change. Use set.seed() avoid .","code":"cdm$matched_cohort1 <- matchCohorts( cohort = cdm$cohort1, cohortId = 1, name = \"matched_cohort1\") CDMConnector::cohort_set(cdm$matched_cohort1) # Original cohort CDMConnector::cohort_attrition(cdm$matched_cohort1) %>% filter(cohort_definition_id == 1) # Matched cohort CDMConnector::cohort_attrition(cdm$matched_cohort1) %>% filter(cohort_definition_id == 4)"},{"path":"https://ohdsi.github.io/CohortConstructor/articles/a03_age_sex_matching.html","id":"matchsex-parameter","dir":"Articles","previous_headings":"Use generateMatchedCohortSet() to create an age-sex matched cohort","what":"matchSex parameter","title":"Generate a matched age and sex cohort","text":"matchSex boolean parameter (TRUE/FALSE) indicating want match sex (TRUE) want (FALSE).","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/articles/a03_age_sex_matching.html","id":"matchyear-parameter","dir":"Articles","previous_headings":"Use generateMatchedCohortSet() to create an age-sex matched cohort","what":"matchYear parameter","title":"Generate a matched age and sex cohort","text":"matchYear another boolean parameter (TRUE/FALSE) indicating want match age (TRUE) want (FALSE). Notice matchSex = FALSE matchYear = FALSE, obtain unmatched comparator cohort.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/articles/a03_age_sex_matching.html","id":"ratio-parameter","dir":"Articles","previous_headings":"Use generateMatchedCohortSet() to create an age-sex matched cohort","what":"ratio parameter","title":"Generate a matched age and sex cohort","text":"default matching ratio 1:1 (ratio = 1). Use cohort_counts() CDMConnector check matching done desired. can modify ratio parameter tailor matched cohort. ratio can adopt values 1 Inf.","code":"CDMConnector::cohort_count(cdm$matched_cohort1) cdm$matched_cohort2 <- matchCohorts( cohort = cdm$cohort1, cohortId = 1, name = \"matched_cohort2\", ratio = Inf) CDMConnector::cohort_count(cdm$matched_cohort2)"},{"path":"https://ohdsi.github.io/CohortConstructor/articles/a03_age_sex_matching.html","id":"generate-matched-cohorts-simultaneously-across-multiple-cohorts","dir":"Articles","previous_headings":"Use generateMatchedCohortSet() to create an age-sex matched cohort","what":"Generate matched cohorts simultaneously across multiple cohorts","title":"Generate a matched age and sex cohort","text":"functionalities can implemented across multiple cohorts simultaneously. Specify targetCohortId parameter cohorts interest. set NULL, cohorts present targetCohortName matched. Notice cohort (independent cohorts) matched cohort.","code":"cdm$matched_cohort3 <- matchCohorts( cohort = cdm$cohort1, cohortId = c(1,3), name = \"matched_cohort3\", ratio = 2) CDMConnector::cohort_set(cdm$matched_cohort3) %>% arrange(cohort_definition_id) CDMConnector::cohort_count(cdm$matched_cohort3) %>% arrange(cohort_definition_id)"},{"path":"https://ohdsi.github.io/CohortConstructor/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Edward Burn. Author, maintainer. Marti Catala. Author. Nuria Mercade-Besora. Author. Marta Alcalde-Herraiz. Author. Mike Du. Author. Yuchen Guo. Author. Xihang Chen. Author. Kim Lopez. Author.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Burn E, Catala M, Mercade-Besora N, Alcalde-Herraiz M, Du M, Guo Y, Chen X, Lopez K (2024). CohortConstructor: Build Manipulate Study Cohorts Using Common Data Model. R package version 0.2.1, https://ohdsi.github.io/CohortConstructor/.","code":"@Manual{, title = {CohortConstructor: Build and Manipulate Study Cohorts Using a Common Data Model}, author = {Edward Burn and Marti Catala and Nuria Mercade-Besora and Marta Alcalde-Herraiz and Mike Du and Yuchen Guo and Xihang Chen and Kim Lopez}, year = {2024}, note = {R package version 0.2.1}, url = {https://ohdsi.github.io/CohortConstructor/}, }"},{"path":"https://ohdsi.github.io/CohortConstructor/index.html","id":"cohortconstructor-","dir":"","previous_headings":"","what":"Build and Manipulate Study Cohorts Using a Common Data Model","title":"Build and Manipulate Study Cohorts Using a Common Data Model","text":"package currently experimental. Please use care report issues might come across. goal CohortConstructor support creation manipulation cohorts OMOP Common Data Model.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Build and Manipulate Study Cohorts Using a Common Data Model","text":"can install development version CohortConstructor GitHub :","code":"# install.packages(\"devtools\") devtools::install_github(\"ohdsi/CohortConstructor\")"},{"path":"https://ohdsi.github.io/CohortConstructor/index.html","id":"creating-and-manipulating-cohorts","dir":"","previous_headings":"","what":"Creating and manipulating cohorts","title":"Build and Manipulate Study Cohorts Using a Common Data Model","text":"illustrate functionality let’s create CDM reference Eunomia dataset Using CDMConnector package.","code":"library(CDMConnector) library(PatientProfiles) library(dplyr) library(CohortConstructor) con <- DBI::dbConnect(duckdb::duckdb(), dbdir = eunomia_dir()) cdm <- cdm_from_con(con, cdm_schema = \"main\", write_schema = c(prefix = \"my_study_\", schema = \"main\")) print(cdm)"},{"path":"https://ohdsi.github.io/CohortConstructor/index.html","id":"generating-concept-based-cohorts","dir":"","previous_headings":"Creating and manipulating cohorts","what":"Generating concept based cohorts","title":"Build and Manipulate Study Cohorts Using a Common Data Model","text":"start making concept based cohort. need provide concept sets get cohort back, cohort end date event date associated records, overlapping records collapsed, records observation kept. can see starting cohorts, add additional restrictions, following associated settings, counts, attrition.","code":"cdm$fractures <- cdm |> conceptCohort(conceptSet = list( \"ankle_fracture\" = 4059173, \"forearm_fracture\" = 4278672, \"hip_fracture\" = 4230399), name = \"fractures\") settings(cdm$fractures) %>% glimpse() #> Rows: 3 #> Columns: 2 #> $ cohort_definition_id 1, 2, 3 #> $ cohort_name \"ankle_fracture\", \"forearm_fracture\", \"hip_fractu… cohort_count(cdm$fractures) %>% glimpse() #> Rows: 3 #> Columns: 3 #> $ cohort_definition_id 1, 2, 3 #> $ number_records 464, 569, 138 #> $ number_subjects 427, 510, 132 attrition(cdm$fractures) %>% glimpse() #> Rows: 3 #> Columns: 7 #> $ cohort_definition_id 1, 2, 3 #> $ number_records 464, 569, 138 #> $ number_subjects 427, 510, 132 #> $ reason_id 1, 1, 1 #> $ reason \"Initial qualifying events\", \"Initial qualifying … #> $ excluded_records 0, 0, 0 #> $ excluded_subjects 0, 0, 0"},{"path":"https://ohdsi.github.io/CohortConstructor/index.html","id":"require-in-date-range","dir":"","previous_headings":"Creating and manipulating cohorts","what":"Require in date range","title":"Build and Manipulate Study Cohorts Using a Common Data Model","text":"created base cohort, can start applying additional cohort requirements. example, first can require individuals’ cohort start date fall within certain date range. Now ’ve applied date restriction, can see cohort attributes updated","code":"cdm$fractures <- cdm$fractures %>% requireInDateRange(dateRange = as.Date(c(\"2000-01-01\", \"2020-01-01\"))) cohort_count(cdm$fractures) %>% glimpse() #> Rows: 3 #> Columns: 3 #> $ cohort_definition_id 1, 2, 3 #> $ number_records 108, 152, 62 #> $ number_subjects 104, 143, 60 attrition(cdm$fractures) %>% filter(reason == \"cohort_start_date between 2000-01-01 & 2020-01-01\") %>% glimpse() #> Rows: 0 #> Columns: 7 #> $ cohort_definition_id #> $ number_records #> $ number_subjects #> $ reason_id #> $ reason #> $ excluded_records #> $ excluded_subjects "},{"path":"https://ohdsi.github.io/CohortConstructor/index.html","id":"applying-demographic-requirements","dir":"","previous_headings":"Creating and manipulating cohorts","what":"Applying demographic requirements","title":"Build and Manipulate Study Cohorts Using a Common Data Model","text":"can also add restrictions patient characteristics age (cohort start date default) sex. can see many individuals ’ve lost applying criteria.","code":"cdm$fractures <- cdm$fractures %>% requireDemographics(ageRange = list(c(40, 65)), sex = \"Female\") attrition(cdm$fractures) %>% filter(reason == \"Age requirement: 40 to 65\") %>% glimpse() #> Rows: 3 #> Columns: 7 #> $ cohort_definition_id 1, 2, 3 #> $ number_records 43, 64, 22 #> $ number_subjects 43, 62, 22 #> $ reason_id 4, 4, 4 #> $ reason \"Age requirement: 40 to 65\", \"Age requirement: 40… #> $ excluded_records 65, 88, 40 #> $ excluded_subjects 61, 81, 38 attrition(cdm$fractures) %>% filter(reason == \"Sex requirement: Female\") %>% glimpse() #> Rows: 3 #> Columns: 7 #> $ cohort_definition_id 1, 2, 3 #> $ number_records 19, 37, 12 #> $ number_subjects 19, 36, 12 #> $ reason_id 5, 5, 5 #> $ reason \"Sex requirement: Female\", \"Sex requirement: Fema… #> $ excluded_records 24, 27, 10 #> $ excluded_subjects 24, 26, 10"},{"path":"https://ohdsi.github.io/CohortConstructor/index.html","id":"require-presence-in-another-cohort","dir":"","previous_headings":"Creating and manipulating cohorts","what":"Require presence in another cohort","title":"Build and Manipulate Study Cohorts Using a Common Data Model","text":"can also require individuals another cohort window. example require study participants GI bleed cohort time prior entry fractures cohort.","code":"cdm$gibleed <- cdm |> conceptCohort(conceptSet = list(\"gibleed\" = 192671), name = \"gibleed\") cdm$fractures <- cdm$fractures %>% requireCohortIntersect(targetCohortTable = \"gibleed\", window = c(-Inf, 0)) attrition(cdm$fractures) %>% filter(reason == \"In cohort gibleed between -Inf & 0 days relative to cohort_start_date\") %>% glimpse() #> Rows: 3 #> Columns: 7 #> $ cohort_definition_id 1, 2, 3 #> $ number_records 5, 7, 2 #> $ number_subjects 5, 6, 2 #> $ reason_id 8, 8, 8 #> $ reason \"In cohort gibleed between -Inf & 0 days relative… #> $ excluded_records 14, 30, 10 #> $ excluded_subjects 14, 30, 10"},{"path":"https://ohdsi.github.io/CohortConstructor/index.html","id":"combining-cohorts","dir":"","previous_headings":"Creating and manipulating cohorts","what":"Combining cohorts","title":"Build and Manipulate Study Cohorts Using a Common Data Model","text":"Currently separate fracture cohorts. Let’s say want create cohort people fractures. create cohort like :","code":"cdm$fractures <- cdm$fractures |> CohortConstructor::unionCohorts() settings(cdm$fractures) #> # A tibble: 1 × 3 #> cohort_definition_id cohort_name gap #> #> 1 1 ankle_fracture_forearm_fracture_hip_fracture 0 cohortCount(cdm$fractures) #> # A tibble: 1 × 3 #> cohort_definition_id number_records number_subjects #> #> 1 1 14 13 cdmDisconnect(cdm)"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/CohortConstructor-package.html","id":null,"dir":"Reference","previous_headings":"","what":"CohortConstructor: Build and Manipulate Study Cohorts Using a Common Data Model — CohortConstructor-package","title":"CohortConstructor: Build and Manipulate Study Cohorts Using a Common Data Model — CohortConstructor-package","text":"Create manipulate study cohorts data mapped Observational Medical Outcomes Partnership Common Data Model.","code":""},{"path":[]},{"path":"https://ohdsi.github.io/CohortConstructor/reference/CohortConstructor-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"CohortConstructor: Build and Manipulate Study Cohorts Using a Common Data Model — CohortConstructor-package","text":"Maintainer: Edward Burn edward.burn@ndorms.ox.ac.uk (ORCID) Authors: Marti Catala marti.catalasabate@ndorms.ox.ac.uk (ORCID) Nuria Mercade-Besora nuria.mercadebesora@ndorms.ox.ac.uk (ORCID) Marta Alcalde-Herraiz marta.alcaldeherraiz@ndorms.ox.ac.uk (ORCID) Mike Du mike.du@ndorms.ox.ac.uk (ORCID) Yuchen Guo yuchen.guo@ndorms.ox.ac.uk (ORCID) Xihang Chen xihang.chen@ndorms.ox.ac.uk (ORCID) Kim Lopez kim.lopez@spc.ox.ac.uk (ORCID)","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/collapseCohorts.html","id":null,"dir":"Reference","previous_headings":"","what":"Collapse cohort entries using a certain gap to concatenate records. — collapseCohorts","title":"Collapse cohort entries using a certain gap to concatenate records. — collapseCohorts","text":"collapseCohorts() concatenates cohort records, allowing number days one finishing next starting.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/collapseCohorts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Collapse cohort entries using a certain gap to concatenate records. — collapseCohorts","text":"","code":"collapseCohorts(cohort, cohortId = NULL, gap = 0, name = tableName(cohort))"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/collapseCohorts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collapse cohort entries using a certain gap to concatenate records. — collapseCohorts","text":"cohort cohort table cohortId IDs cohorts modify. NULL, cohorts used; otherwise, specified cohorts modified, rest remain unchanged. gap Number days use merging cohort entries. name Name cohort table.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/collapseCohorts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Collapse cohort entries using a certain gap to concatenate records. — collapseCohorts","text":"cohort table","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/conceptCohort.html","id":null,"dir":"Reference","previous_headings":"","what":"Create cohorts based on a concept set — conceptCohort","title":"Create cohorts based on a concept set — conceptCohort","text":"conceptCohort() creates cohort table patient records clinical tables OMOP CDM. following tables currently supported creating concept cohorts: condition_occurrence device_exposure drug_exposure measurement observation procedure_occurrence visit_occurrence Cohort duration based record start end (e.g. condition_start_date condition_end_date records coming condition_occurrence tables). resulting table satisfies requirements OMOP CDM cohort table: Overlapping records collapsed single cohort entry. record starts outside observation period silently ignored. record ends outside observation period trimmed end preceding observation period end date.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/conceptCohort.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create cohorts based on a concept set — conceptCohort","text":"","code":"conceptCohort(cdm, conceptSet, name)"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/conceptCohort.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create cohorts based on a concept set — conceptCohort","text":"cdm cdm reference. conceptSet conceptSet, can either codelist conceptSetExpression. name Name cohort cdm object.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/conceptCohort.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create cohorts based on a concept set — conceptCohort","text":"cohort table","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/conceptCohort.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create cohorts based on a concept set — conceptCohort","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor(conditionOccurrence = TRUE) cohort <- conceptCohort(cdm = cdm, conceptSet = list(a = 1), name = \"cohort\") #> ℹ Subsetting table condition_occurrence using 1 concept with domain: condition. #> ℹ Combining tables. #> ℹ Collapsing records. #> ℹ Creating cohort attributes. #> ✔ Cohort cohort created. cohort |> attrition() #> # A tibble: 1 × 7 #> cohort_definition_id number_records number_subjects reason_id reason #> #> 1 1 7 7 1 Initial qualify… #> # ℹ 2 more variables: excluded_records , excluded_subjects # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/demographicsCohort.html","id":null,"dir":"Reference","previous_headings":"","what":"Create cohorts based on patient demographics — demographicsCohort","title":"Create cohorts based on patient demographics — demographicsCohort","text":"demographicsCohort() creates cohort table based patient characteristics. individual satisfies criteria enter cohort. stop satisfying criteria cohort entry ends.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/demographicsCohort.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create cohorts based on patient demographics — demographicsCohort","text":"","code":"demographicsCohort( cdm, name, ageRange = NULL, sex = NULL, minPriorObservation = NULL, minFutureObservation = NULL )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/demographicsCohort.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create cohorts based on patient demographics — demographicsCohort","text":"cdm cdm reference. name Name new cohort table ageRange list vectors specifying minimum maximum age. sex Can \"\", \"Male\" \"Female\". minPriorObservation minimum number prior observation days database. minFutureObservation minimum number future observation days database.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/demographicsCohort.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create cohorts based on patient demographics — demographicsCohort","text":"cohort table","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/demographicsCohort.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create cohorts based on patient demographics — demographicsCohort","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor() cohort <- cdm |> demographicsCohort(name = \"cohort3\", ageRange = c(18,40), sex = \"Male\") #> ℹ Building new trimmed cohort #> Adding demographics information #> Creating initial cohort #> Trim sex #> Trim age #> ✔ Cohort trimmed attrition(cohort) #> # A tibble: 3 × 7 #> cohort_definition_id number_records number_subjects reason_id reason #> #> 1 1 10 10 1 Initial qualify… #> 2 1 5 5 2 Sex requirement… #> 3 1 4 4 3 Age requirement… #> # ℹ 2 more variables: excluded_records , excluded_subjects # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/entryAtFirstDate.html","id":null,"dir":"Reference","previous_headings":"","what":"Update cohort start date to be the first date from of a set of column dates — entryAtFirstDate","title":"Update cohort start date to be the first date from of a set of column dates — entryAtFirstDate","text":"entryAtFirstDate() resets cohort start date based set specified column dates. first date occurs chosen.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/entryAtFirstDate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update cohort start date to be the first date from of a set of column dates — entryAtFirstDate","text":"","code":"entryAtFirstDate( cohort, dateColumns, cohortId = NULL, returnReason = TRUE, name = tableName(cohort) )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/entryAtFirstDate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update cohort start date to be the first date from of a set of column dates — entryAtFirstDate","text":"cohort cohort table cdm reference. dateColumns Date columns cohort table consider. cohortId IDs cohorts modify. NULL, cohorts used; otherwise, specified cohorts modified, rest remain unchanged. returnReason TRUE return column stating column dateColumns used new cohort end date. name Name new cohort restriction.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/entryAtFirstDate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Update cohort start date to be the first date from of a set of column dates — entryAtFirstDate","text":"cohort table.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/entryAtFirstDate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Update cohort start date to be the first date from of a set of column dates — entryAtFirstDate","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor(tables = list( \"cohort\" = dplyr::tibble( cohort_definition_id = 1, subject_id = c(1, 2, 3, 4), cohort_start_date = as.Date(c(\"2000-06-03\", \"2000-01-01\", \"2015-01-15\", \"2000-12-09\")), cohort_end_date = as.Date(c(\"2001-09-01\", \"2001-01-12\", \"2015-02-15\", \"2002-12-09\")), date_1 = as.Date(c(\"2001-08-01\", \"2001-01-01\", \"2015-01-15\", \"2002-12-09\")), date_2 = as.Date(c(\"2001-08-01\", NA, \"2015-02-14\", \"2002-12-09\")) ) )) cdm$cohort |> entryAtLastDate(dateColumns = c(\"date_1\", \"date_2\")) #> # Source: table [4 x 5] #> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date entry_reason #> #> 1 1 3 2015-02-14 2015-02-15 date_2 #> 2 1 2 2001-01-01 2001-01-12 date_1 #> 3 1 1 2001-08-01 2001-09-01 date_1; dat… #> 4 1 4 2002-12-09 2002-12-09 date_1; dat… # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/entryAtLastDate.html","id":null,"dir":"Reference","previous_headings":"","what":"Set cohort start date to the last of a set of column dates — entryAtLastDate","title":"Set cohort start date to the last of a set of column dates — entryAtLastDate","text":"Set cohort start date last set column dates","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/entryAtLastDate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set cohort start date to the last of a set of column dates — entryAtLastDate","text":"","code":"entryAtLastDate( cohort, dateColumns, cohortId = NULL, returnReason = TRUE, name = tableName(cohort) )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/entryAtLastDate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set cohort start date to the last of a set of column dates — entryAtLastDate","text":"cohort cohort table cdm reference. dateColumns description cohortId IDs cohorts modify. NULL, cohorts used; otherwise, specified cohorts modified, rest remain unchanged. returnReason TRUE return column stating column dateColumns used new cohort end date. description name Name new cohort restriction.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/entryAtLastDate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set cohort start date to the last of a set of column dates — entryAtLastDate","text":"cohort table.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/entryAtLastDate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set cohort start date to the last of a set of column dates — entryAtLastDate","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor(tables = list( \"cohort\" = dplyr::tibble( cohort_definition_id = 1, subject_id = c(1, 2, 3, 4), cohort_start_date = as.Date(c(\"2000-06-03\", \"2000-01-01\", \"2015-01-15\", \"2000-12-09\")), cohort_end_date = as.Date(c(\"2001-09-01\", \"2001-01-12\", \"2015-02-15\", \"2002-12-09\")), date_1 = as.Date(c(\"2001-08-01\", \"2001-01-01\", \"2015-01-15\", \"2002-12-09\")), date_2 = as.Date(c(\"2001-08-01\", NA, \"2015-02-14\", \"2002-12-09\")) ) )) cdm$cohort |> entryAtLastDate(dateColumns = c(\"date_1\", \"date_2\")) #> # Source: table [4 x 5] #> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date entry_reason #> #> 1 1 1 2001-08-01 2001-09-01 date_2; dat… #> 2 1 2 2001-01-01 2001-01-12 date_1 #> 3 1 3 2015-02-14 2015-02-15 date_2 #> 4 1 4 2002-12-09 2002-12-09 date_2; dat… # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtDeath.html","id":null,"dir":"Reference","previous_headings":"","what":"Set cohort end date to death date — exitAtDeath","title":"Set cohort end date to death date — exitAtDeath","text":"functions changes cohort end date subject's death date. case generates overlapping records cohort, overlapping entries merged.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtDeath.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set cohort end date to death date — exitAtDeath","text":"","code":"exitAtDeath( cohort, cohortId = NULL, requireDeath = FALSE, name = tableName(cohort) )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtDeath.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set cohort end date to death date — exitAtDeath","text":"cohort cohort table cdm reference. cohortId IDs cohorts modify. NULL, cohorts used; otherwise, specified cohorts modified, rest remain unchanged. requireDeath TRUE, subjects without death record dropped, FALSE end date left . name Name new cohort restriction.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtDeath.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set cohort end date to death date — exitAtDeath","text":"cohort table.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtDeath.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set cohort end date to death date — exitAtDeath","text":"","code":"# \\donttest{ library(PatientProfiles) library(CohortConstructor) cdm <- mockPatientProfiles() cdm$cohort1 |> exitAtDeath() #> # Source: table [10 x 4] #> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date #> #> 1 2 8 1954-07-05 1955-07-17 #> 2 2 5 2113-08-18 2144-11-05 #> 3 3 7 2029-01-30 2050-08-27 #> 4 2 2 1998-11-05 2008-01-27 #> 5 2 1 1951-11-28 2019-01-16 #> 6 1 6 2006-12-25 2022-11-01 #> 7 3 10 2003-01-05 2060-02-27 #> 8 2 3 1993-12-06 1997-05-26 #> 9 1 4 2017-04-18 2077-11-07 #> 10 2 9 2109-11-07 2115-08-03 # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtFirstDate.html","id":null,"dir":"Reference","previous_headings":"","what":"Set cohort end date to the first of a set of column dates — exitAtFirstDate","title":"Set cohort end date to the first of a set of column dates — exitAtFirstDate","text":"exitAtFirstDate() resets cohort end date based set specified column dates. first date occurs chosen.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtFirstDate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set cohort end date to the first of a set of column dates — exitAtFirstDate","text":"","code":"exitAtFirstDate( cohort, dateColumns, cohortId = NULL, returnReason = TRUE, name = tableName(cohort) )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtFirstDate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set cohort end date to the first of a set of column dates — exitAtFirstDate","text":"cohort cohort table cdm reference. dateColumns Date columns cohort table consider. cohortId IDs cohorts modify. NULL, cohorts used; otherwise, specified cohorts modified, rest remain unchanged. returnReason TRUE return column stating column dateColumns used new cohort end date. name Name new cohort restriction.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtFirstDate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set cohort end date to the first of a set of column dates — exitAtFirstDate","text":"cohort table.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtFirstDate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set cohort end date to the first of a set of column dates — exitAtFirstDate","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor(tables = list( \"cohort\" = dplyr::tibble( cohort_definition_id = 1, subject_id = c(1, 2, 3, 4), cohort_start_date = as.Date(c(\"2000-06-03\", \"2000-01-01\", \"2015-01-15\", \"2000-12-09\")), cohort_end_date = as.Date(c(\"2001-09-01\", \"2001-01-12\", \"2015-02-15\", \"2002-12-09\")), date_1 = as.Date(c(\"2001-08-01\", \"2001-01-01\", \"2015-01-15\", \"2002-12-09\")), date_2 = as.Date(c(\"2001-08-01\", NA, \"2015-04-15\", \"2002-12-09\")) ) )) cdm$cohort |> exitAtFirstDate(dateColumns = c(\"date_1\", \"date_2\")) #> # Source: table [4 x 5] #> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date exit_reason #> #> 1 1 3 2015-01-15 2015-01-15 date_1 #> 2 1 1 2000-06-03 2001-08-01 date_1; dat… #> 3 1 2 2000-01-01 2001-01-01 date_1 #> 4 1 4 2000-12-09 2002-12-09 date_1; dat… # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtLastDate.html","id":null,"dir":"Reference","previous_headings":"","what":"Set cohort end date to the last of a set of column dates — exitAtLastDate","title":"Set cohort end date to the last of a set of column dates — exitAtLastDate","text":"exitAtLastDate() resets cohort end date based set specified column dates. last date occurs chosen.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtLastDate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set cohort end date to the last of a set of column dates — exitAtLastDate","text":"","code":"exitAtLastDate( cohort, dateColumns, cohortId = NULL, returnReason = TRUE, name = tableName(cohort) )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtLastDate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set cohort end date to the last of a set of column dates — exitAtLastDate","text":"cohort cohort table cdm reference. dateColumns description cohortId IDs cohorts modify. NULL, cohorts used; otherwise, specified cohorts modified, rest remain unchanged. returnReason TRUE return column stating column dateColumns used new cohort end date. description name Name new cohort restriction.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtLastDate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set cohort end date to the last of a set of column dates — exitAtLastDate","text":"cohort table.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtLastDate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set cohort end date to the last of a set of column dates — exitAtLastDate","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor(tables = list( \"cohort\" = dplyr::tibble( cohort_definition_id = 1, subject_id = c(1, 2, 3, 4), cohort_start_date = as.Date(c(\"2000-06-03\", \"2000-01-01\", \"2015-01-15\", \"2000-12-09\")), cohort_end_date = as.Date(c(\"2001-09-01\", \"2001-01-12\", \"2015-02-15\", \"2002-12-09\")), date_1 = as.Date(c(\"2001-08-01\", \"2001-01-01\", \"2015-01-15\", \"2002-12-09\")), date_2 = as.Date(c(\"2001-08-01\", NA, \"2015-04-15\", \"2002-12-09\")) ) )) cdm$cohort |> exitAtLastDate(dateColumns = c(\"date_1\", \"date_2\")) #> # Source: table [4 x 5] #> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date exit_reason #> #> 1 1 2 2000-01-01 2001-01-01 date_1 #> 2 1 1 2000-06-03 2001-08-01 date_1; dat… #> 3 1 3 2015-01-15 2015-04-15 date_2 #> 4 1 4 2000-12-09 2002-12-09 date_1; dat… # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtObservationEnd.html","id":null,"dir":"Reference","previous_headings":"","what":"Set cohort end date to end of observation — exitAtObservationEnd","title":"Set cohort end date to end of observation — exitAtObservationEnd","text":"exitAtObservationEnd() resets cohort end date based set specified column dates. last date occurs chosen. functions changes cohort end date end date observation period corresponding cohort entry. case generates overlapping records cohort, overlapping entries merged.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtObservationEnd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set cohort end date to end of observation — exitAtObservationEnd","text":"","code":"exitAtObservationEnd(cohort, cohortId = NULL, name = tableName(cohort))"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtObservationEnd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set cohort end date to end of observation — exitAtObservationEnd","text":"cohort cohort table cdm reference. cohortId IDs cohorts modify. NULL, cohorts used; otherwise, specified cohorts modified, rest remain unchanged. name Name new cohort restriction.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtObservationEnd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set cohort end date to end of observation — exitAtObservationEnd","text":"cohort table.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/exitAtObservationEnd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set cohort end date to end of observation — exitAtObservationEnd","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor() cdm$cohort1 |> exitAtObservationEnd() #> # Source: table [6 x 4] #> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date #> #> 1 1 7 2014-03-07 2014-04-09 #> 2 1 2 2000-05-04 2003-06-15 #> 3 1 4 1996-06-30 2013-12-31 #> 4 1 5 2012-03-20 2013-02-10 #> 5 1 3 2015-01-27 2015-10-11 #> 6 1 1 2001-05-30 2013-06-29 # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/intersectCohorts.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate a combination cohort set between the intersection of different cohorts. — intersectCohorts","title":"Generate a combination cohort set between the intersection of different cohorts. — intersectCohorts","text":"intersectCohorts() combines different cohort entries, records overlap combined kept. Cohort entries individual cohorts.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/intersectCohorts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate a combination cohort set between the intersection of different cohorts. — intersectCohorts","text":"","code":"intersectCohorts( cohort, cohortId = NULL, gap = 0, mutuallyExclusive = FALSE, returnOnlyComb = FALSE, name = tableName(cohort) )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/intersectCohorts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate a combination cohort set between the intersection of different cohorts. — intersectCohorts","text":"cohort cohort table cdm reference. cohortId IDs cohorts include. NULL cohorts considered. Cohorts included removed cohort set. gap Number days two subsequent cohort entries merged single cohort record. mutuallyExclusive Whether generated cohorts mutually exclusive . returnOnlyComb Whether get combination cohort back name Name new cohort demographic requirements.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/intersectCohorts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate a combination cohort set between the intersection of different cohorts. — intersectCohorts","text":"cohort table.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/intersectCohorts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate a combination cohort set between the intersection of different cohorts. — intersectCohorts","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor(nPerson = 100) cdm$cohort3 <- intersectCohorts( cohort = cdm$cohort2, name = \"cohort3\", ) settings(cdm$cohort3) #> # A tibble: 3 × 6 #> cohort_definition_id cohort_name cohort_1 cohort_2 mutually_exclusive gap #> #> 1 1 cohort_1 1 0 FALSE 0 #> 2 2 cohort_2 0 1 FALSE 0 #> 3 3 cohort_1_coho… 1 1 FALSE 0 # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/matchCohorts.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate a new cohort matched cohort — matchCohorts","title":"Generate a new cohort matched cohort — matchCohorts","text":"matchCohorts() generate new cohort matched individuals existing cohort. Individuals can matched based year birth sex.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/matchCohorts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate a new cohort matched cohort — matchCohorts","text":"","code":"matchCohorts( cohort, cohortId = NULL, matchSex = TRUE, matchYearOfBirth = TRUE, ratio = 1, name = tableName(cohort) )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/matchCohorts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate a new cohort matched cohort — matchCohorts","text":"cohort cohort table cdm reference. cohortId IDs cohorts include. NULL cohorts considered. Cohorts included removed cohort set. matchSex Whether match sex. matchYearOfBirth Whether match year birth. ratio Number allowed matches per individual target cohort. name Name new generated cohort set.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/matchCohorts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate a new cohort matched cohort — matchCohorts","text":"cohort table.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/matchCohorts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate a new cohort matched cohort — matchCohorts","text":"","code":"# \\donttest{ library(CohortConstructor) library(dplyr) #> #> Attaching package: ‘dplyr’ #> The following objects are masked from ‘package:stats’: #> #> filter, lag #> The following objects are masked from ‘package:base’: #> #> intersect, setdiff, setequal, union cdm <- mockCohortConstructor(nPerson = 200) cdm$new_matched_cohort <- cdm$cohort2 |> matchCohorts( name = \"new_matched_cohort\", cohortId = 2, matchSex = TRUE, matchYearOfBirth = TRUE, ratio = 1) #> Starting matching #> Warning: Multiple records per person detected. The matchCohorts() function is designed #> to operate under the assumption that there is only one record per person within #> each cohort. If this assumption is not met, each record will be treated #> independently. As a result, the same individual may be matched multiple times, #> leading to inconsistent and potentially misleading results. #> ℹ Creating copy of target cohort. #> • 1 cohort to be matched. #> ℹ Creating controls cohorts. #> ℹ Excluding cases from controls #> • Matching by gender_concept_id and year_of_birth #> • Removing controls that were not in observation at index date #> • Excluding target records whose pair is not in observation #> • Adjusting ratio #> Binding both cohorts #> ✔ Done cdm$new_matched_cohort #> # Source: table [?? x 5] #> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date cluster_id #> #> 1 1 94 2017-11-01 2018-07-05 59 #> 2 1 119 1982-09-08 1989-01-29 65 #> 3 1 62 2017-04-27 2018-07-04 74 #> 4 1 98 2010-02-24 2013-03-24 84 #> 5 1 8 1990-10-16 1999-07-20 94 #> 6 1 105 2002-04-21 2003-07-10 106 #> 7 1 118 1975-11-28 1981-05-30 6 #> 8 1 56 2007-09-28 2008-07-15 18 #> 9 1 63 2008-08-23 2008-09-02 19 #> 10 1 20 1985-08-15 1990-06-06 26 #> # ℹ more rows # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/measurementCohort.html","id":null,"dir":"Reference","previous_headings":"","what":"Create cohorts measurement based cohorts — measurementCohort","title":"Create cohorts measurement based cohorts — measurementCohort","text":"measurementCohort() creates cohorts based patient records contained measurement table. function extends conceptCohort() allows measurement values associated records specified. valueAsConcept valueAsNumber NULL requirements values associated measurement records using measurementCohort() lead result using conceptCohort() (long concepts measurement domain). one valueAsConcept valueAsNumber NULL records required values satisfy requirement specified. valueAsConcept valueAsNumber NULL, records required values fulfill either requirements","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/measurementCohort.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create cohorts measurement based cohorts — measurementCohort","text":"","code":"measurementCohort( cdm, conceptSet, name, valueAsConcept = NULL, valueAsNumber = NULL )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/measurementCohort.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create cohorts measurement based cohorts — measurementCohort","text":"cdm cdm reference. conceptSet conceptSet, can either codelist conceptSetExpression. name Name cohort cdm object. valueAsConcept vector cohort IDs used filter measurements. measurements values value_as_concept_id column measurement table included. NULL entries independently value concept considered. valueAsNumber named list indicating range values unit correspond , follows: list(\"unit_concept_id\" = c(rangeValue1, rangeValue2)). NULL, entries independently value number included.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/measurementCohort.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create cohorts measurement based cohorts — measurementCohort","text":"cohort table","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/measurementCohort.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create cohorts measurement based cohorts — measurementCohort","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor(con = NULL) cdm$concept <- cdm$concept |> dplyr::union_all( dplyr::tibble( concept_id = c(4326744, 4298393, 45770407, 8876, 4124457), concept_name = c(\"Blood pressure\", \"Systemic blood pressure\", \"Baseline blood pressure\", \"millimeter mercury column\", \"Normal range\"), domain_id = \"Measurement\", vocabulary_id = c(\"SNOMED\", \"SNOMED\", \"SNOMED\", \"UCUM\", \"SNOMED\"), standard_concept = \"S\", concept_class_id = c(\"Observable Entity\", \"Observable Entity\", \"Observable Entity\", \"Unit\", \"Qualifier Value\"), concept_code = NA, valid_start_date = NA, valid_end_date = NA, invalid_reason = NA ) ) cdm$measurement <- dplyr::tibble( measurement_id = 1:4, person_id = c(1, 1, 2, 3), measurement_concept_id = c(4326744, 4298393, 4298393, 45770407), measurement_date = as.Date(c(\"2000-07-01\", \"2000-12-11\", \"2002-09-08\", \"2015-02-19\")), measurement_type_concept_id = NA, value_as_number = c(100, 125, NA, NA), value_as_concept_id = c(0, 0, 0, 4124457), unit_concept_id = c(8876, 8876, 0, 0) ) cdm <- CDMConnector::copyCdmTo( con = DBI::dbConnect(duckdb::duckdb()), cdm = cdm, schema = \"main\") cdm$cohort <- measurementCohort( cdm = cdm, name = \"cohort\", conceptSet = list(\"normal_blood_pressure\" = c(4326744, 4298393, 45770407)), valueAsConcept = c(4124457), valueAsNumber = list(\"8876\" = c(70, 120)) ) #> ℹ Getting records in observation. #> ℹ Applying measurement requirements. #> ℹ Creating cohort attributes. #> ✔ Cohort cohort created. cdm$cohort #> # Source: table [2 x 4] #> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date #> #> 1 1 3 2015-02-19 2015-02-19 #> 2 1 1 2000-07-01 2000-07-01 # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/mockCohortConstructor.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to create a mock cdm reference for CohortConstructor — mockCohortConstructor","title":"Function to create a mock cdm reference for CohortConstructor — mockCohortConstructor","text":"mockCohortConstructor() creates example dataset can used demonstrating testing package","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/mockCohortConstructor.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to create a mock cdm reference for CohortConstructor — mockCohortConstructor","text":"","code":"mockCohortConstructor( nPerson = 10, conceptTable = NULL, tables = NULL, conceptId = NULL, conceptIdClass = NULL, drugExposure = FALSE, conditionOccurrence = FALSE, measurement = FALSE, death = FALSE, otherTables = NULL, con = DBI::dbConnect(duckdb::duckdb()), writeSchema = \"main\", seed = 123 )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/mockCohortConstructor.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to create a mock cdm reference for CohortConstructor — mockCohortConstructor","text":"nPerson number person cdm conceptTable user defined concept table tables list tables include cdm conceptId list concept id conceptIdClass domain class conceptId drugExposure T/F include drug exposure table cdm conditionOccurrence T/F include condition occurrence cdm measurement T/F include measurement cdm death T/F include death table cdm otherTables takes list single tibble names include tables cdm con DBI connection create cdm mock object. writeSchema Name schema connection writing permissions. seed Seed passed omock::mockCdmFromTable","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/mockCohortConstructor.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function to create a mock cdm reference for CohortConstructor — mockCohortConstructor","text":"cdm object","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/mockCohortConstructor.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Function to create a mock cdm reference for CohortConstructor — mockCohortConstructor","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor() cdm #> #> ── # OMOP CDM reference (duckdb) of mock database ────────────────────────────── #> • omop tables: person, observation_period, cdm_source, concept, vocabulary, #> concept_relationship, concept_synonym, concept_ancestor, drug_strength #> • cohort tables: cohort1, cohort2 #> • achilles tables: - #> • other tables: - # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. omopgenerics attrition, bind, cohortCodelist, cohortCount, settings, tableName PatientProfiles endDateColumn, startDateColumn","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireAge.html","id":null,"dir":"Reference","previous_headings":"","what":"Restrict cohort on age — requireAge","title":"Restrict cohort on age — requireAge","text":"requireAge() filters cohort records, keeping records individuals satisfy specified age criteria.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireAge.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Restrict cohort on age — requireAge","text":"","code":"requireAge( cohort, ageRange, cohortId = NULL, indexDate = \"cohort_start_date\", name = tableName(cohort) )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireAge.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Restrict cohort on age — requireAge","text":"cohort cohort table cdm reference. ageRange list minimum maximum age. cohortId IDs cohorts modify. NULL, cohorts used; otherwise, specified cohorts modified, rest remain unchanged. indexDate Variable cohort contains date compute demographics characteristics restrict . name Name new cohort age requirement.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireAge.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Restrict cohort on age — requireAge","text":"cohort table records individuals satisfying age requirement","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireAge.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Restrict cohort on age — requireAge","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor() cdm$cohort1 |> requireAge(indexDate = \"cohort_start_date\", ageRange = list(c(18, 65))) #> # Source: SQL [7 x 4] #> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date #> #> 1 1 2 2000-05-04 2000-05-17 #> 2 1 2 2000-05-18 2001-01-23 #> 3 1 3 2015-01-27 2015-06-28 #> 4 1 5 2012-03-20 2012-04-30 #> 5 1 5 2012-05-01 2012-07-24 #> 6 1 7 2014-03-07 2014-03-07 #> 7 1 7 2014-03-08 2014-03-20 # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireCohortIntersect.html","id":null,"dir":"Reference","previous_headings":"","what":"Require cohort subjects are present (or absence) in another cohort — requireCohortIntersect","title":"Require cohort subjects are present (or absence) in another cohort — requireCohortIntersect","text":"requireCohortIntersect() filters cohort table based requirement individual seen (seen) another cohort time window around index date.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireCohortIntersect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Require cohort subjects are present (or absence) in another cohort — requireCohortIntersect","text":"","code":"requireCohortIntersect( cohort, targetCohortTable, window, intersections = c(1, Inf), cohortId = NULL, targetCohortId = NULL, indexDate = \"cohort_start_date\", targetStartDate = \"cohort_start_date\", targetEndDate = \"cohort_end_date\", censorDate = NULL, name = tableName(cohort) )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireCohortIntersect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Require cohort subjects are present (or absence) in another cohort — requireCohortIntersect","text":"cohort cohort table cdm reference. targetCohortTable Name cohort want check intersect. window Window consider events . intersections range indicating number intersections criteria fulfilled. single number passed, number intersections must match . cohortId IDs cohorts modify. NULL, cohorts used; otherwise, specified cohorts modified, rest remain unchanged. targetCohortId Vector cohort definition ids include. indexDate Variable x contains date compute intersection. targetStartDate Date reference cohort table, either start (overlap) (incidence). targetEndDate Date reference cohort table, either end (overlap) NULL (incidence). censorDate Whether censor overlap events specific date column date x. name Name new cohort future observation restriction.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireCohortIntersect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Require cohort subjects are present (or absence) in another cohort — requireCohortIntersect","text":"Cohort table isatisfying criteria kept","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireCohortIntersect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Require cohort subjects are present (or absence) in another cohort — requireCohortIntersect","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor() cdm$cohort1 |> requireCohortIntersect(targetCohortTable = \"cohort2\", targetCohortId = 1, indexDate = \"cohort_start_date\", window = c(-Inf, 0)) #> # Source: table [10 x 4] #> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date #> #> 1 1 1 2001-05-30 2003-05-01 #> 2 1 1 2003-05-02 2006-06-10 #> 3 1 2 2000-05-04 2000-05-17 #> 4 1 2 2000-05-18 2001-01-23 #> 5 1 3 2015-01-27 2015-06-28 #> 6 1 4 1996-06-30 1998-11-20 #> 7 1 5 2012-03-20 2012-04-30 #> 8 1 5 2012-05-01 2012-07-24 #> 9 1 7 2014-03-07 2014-03-07 #> 10 1 7 2014-03-08 2014-03-20 # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireConceptIntersect.html","id":null,"dir":"Reference","previous_headings":"","what":"Require cohort subjects to have (or not have) events of a concept list — requireConceptIntersect","title":"Require cohort subjects to have (or not have) events of a concept list — requireConceptIntersect","text":"requireConceptIntersect() filters cohort table based requirement individual seen (seen) events related concept list time window around index date.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireConceptIntersect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Require cohort subjects to have (or not have) events of a concept list — requireConceptIntersect","text":"","code":"requireConceptIntersect( cohort, conceptSet, window, intersections = c(1, Inf), cohortId = NULL, indexDate = \"cohort_start_date\", targetStartDate = \"event_start_date\", targetEndDate = \"event_end_date\", censorDate = NULL, name = tableName(cohort) )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireConceptIntersect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Require cohort subjects to have (or not have) events of a concept list — requireConceptIntersect","text":"cohort cohort table cdm reference. conceptSet Concept set list. window Window consider events . intersections range indicating number intersections criteria fulfilled. single number passed, number intersections must match . cohortId IDs cohorts modify. NULL, cohorts used; otherwise, specified cohorts modified, rest remain unchanged.. indexDate Variable x contains date compute intersection. targetStartDate Date reference cohort table, either start (overlap) (incidence). targetEndDate Date reference cohort table, either end (overlap) NULL (incidence). censorDate Whether censor overlap events specific date column date x. name Name new cohort future observation restriction.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireConceptIntersect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Require cohort subjects to have (or not have) events of a concept list — requireConceptIntersect","text":"Cohort table events concept list kept (without event negate = TRUE)","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireConceptIntersect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Require cohort subjects to have (or not have) events of a concept list — requireConceptIntersect","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor(conditionOccurrence = TRUE) cdm$cohort2 <- requireConceptIntersect( cohort = cdm$cohort1, conceptSet = list(a = 1), window = c(-Inf, 0), name = \"cohort2\") # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireDeathFlag.html","id":null,"dir":"Reference","previous_headings":"","what":"Require cohort subjects have (or do not have) a death record — requireDeathFlag","title":"Require cohort subjects have (or do not have) a death record — requireDeathFlag","text":"requireDeathFlag() filters cohort table based requirement individual seen (seen) death time window around index date.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireDeathFlag.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Require cohort subjects have (or do not have) a death record — requireDeathFlag","text":"","code":"requireDeathFlag( cohort, window, cohortId = NULL, indexDate = \"cohort_start_date\", censorDate = NULL, negate = FALSE, name = tableName(cohort) )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireDeathFlag.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Require cohort subjects have (or do not have) a death record — requireDeathFlag","text":"cohort cohort table cdm reference. window Window consider events . cohortId IDs cohorts modify. NULL, cohorts used; otherwise, specified cohorts modified, rest remain unchanged. indexDate Variable x contains date compute intersection. censorDate Whether censor overlap events specific date column date x. negate set TRUE, criteria applied exclusion rather inclusion (.e. require absence another cohort). name Name new cohort future observation restriction.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireDeathFlag.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Require cohort subjects have (or do not have) a death record — requireDeathFlag","text":"Cohort table death event kept (without negate = TRUE)","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireDeathFlag.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Require cohort subjects have (or do not have) a death record — requireDeathFlag","text":"","code":"# \\donttest{ library(CDMConnector) #> #> Attaching package: ‘CDMConnector’ #> The following objects are masked from ‘package:CohortConstructor’: #> #> intersectCohorts, unionCohorts library(CohortConstructor) cdm <- mockCohortConstructor(death = TRUE) cdm$cohort1 <- cdm$cohort1 |> requireDeathFlag(window = list(c(0, Inf))) attrition(cdm$cohort1) #> # A tibble: 2 × 7 #> cohort_definition_id number_records number_subjects reason_id reason #> #> 1 1 10 6 1 Initial qualify… #> 2 1 10 6 2 Death between 0… #> # ℹ 2 more variables: excluded_records , excluded_subjects # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireDemographics.html","id":null,"dir":"Reference","previous_headings":"","what":"Restrict cohort on patient demographics — requireDemographics","title":"Restrict cohort on patient demographics — requireDemographics","text":"requireDemographics() filters cohort records, keeping records individuals satisfy specified demographic criteria.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireDemographics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Restrict cohort on patient demographics — requireDemographics","text":"","code":"requireDemographics( cohort, cohortId = NULL, indexDate = \"cohort_start_date\", ageRange = list(c(0, 150)), sex = c(\"Both\"), minPriorObservation = 0, minFutureObservation = 0, requirementInteractions = TRUE, name = tableName(cohort) )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireDemographics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Restrict cohort on patient demographics — requireDemographics","text":"cohort cohort table cdm reference. cohortId IDs cohorts modify. NULL, cohorts used; otherwise, specified cohorts modified, rest remain unchanged. indexDate Variable cohort contains date compute demographics characteristics restrict . ageRange list minimum maximum age. sex Can \"\", \"Male\" \"Female\". one latter, sex included. minPriorObservation minimum number prior observation days database. minFutureObservation minimum number future observation days database. requirementInteractions TRUE, cohorts created combinations ageGroup, sex, daysPriorObservation. FALSE, first value specified factors used. Consequently, order values matters requirementInteractions FALSE. name Name new cohort demographic requirements.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireDemographics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Restrict cohort on patient demographics — requireDemographics","text":"cohort table records individuals satisfying demographic requirements","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireDemographics.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Restrict cohort on patient demographics — requireDemographics","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor(nPerson = 100) cdm$cohort1 |> requireDemographics(indexDate = \"cohort_start_date\", ageRange = list(c(18, 65)), sex = \"Female\", minPriorObservation = 365) #> # Source: SQL [3 x 4] #> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date #> #> 1 1 32 1991-09-11 2002-11-15 #> 2 1 38 1990-05-01 1994-07-14 #> 3 1 85 2000-05-09 2001-11-16 # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireFutureObservation.html","id":null,"dir":"Reference","previous_headings":"","what":"Restrict cohort on future observation — requireFutureObservation","title":"Restrict cohort on future observation — requireFutureObservation","text":"requireFutureObservation() filters cohort records, keeping records individuals satisfy specified future observation criteria.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireFutureObservation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Restrict cohort on future observation — requireFutureObservation","text":"","code":"requireFutureObservation( cohort, minFutureObservation, cohortId = NULL, indexDate = \"cohort_start_date\", name = tableName(cohort) )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireFutureObservation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Restrict cohort on future observation — requireFutureObservation","text":"cohort cohort table cdm reference. minFutureObservation minimum number future observation days database. cohortId IDs cohorts modify. NULL, cohorts used; otherwise, specified cohorts modified, rest remain unchanged. indexDate Variable cohort contains date compute demographics characteristics restrict . name Name new cohort future observation restriction.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireFutureObservation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Restrict cohort on future observation — requireFutureObservation","text":"cohort table records individuals satisfying future observation requirement","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireFutureObservation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Restrict cohort on future observation — requireFutureObservation","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor() cdm$cohort1 |> requireFutureObservation(indexDate = \"cohort_start_date\", minFutureObservation = 30) #> # Source: SQL [10 x 4] #> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date #> #> 1 1 1 2001-05-30 2003-05-01 #> 2 1 1 2003-05-02 2006-06-10 #> 3 1 2 2000-05-04 2000-05-17 #> 4 1 2 2000-05-18 2001-01-23 #> 5 1 3 2015-01-27 2015-06-28 #> 6 1 4 1996-06-30 1998-11-20 #> 7 1 5 2012-03-20 2012-04-30 #> 8 1 5 2012-05-01 2012-07-24 #> 9 1 7 2014-03-07 2014-03-07 #> 10 1 7 2014-03-08 2014-03-20 # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireInDateRange.html","id":null,"dir":"Reference","previous_headings":"","what":"Require that an index date is within a date range — requireInDateRange","title":"Require that an index date is within a date range — requireInDateRange","text":"requireInDateRange() filters cohort records, keeping index date within specified date range.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireInDateRange.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Require that an index date is within a date range — requireInDateRange","text":"","code":"requireInDateRange( cohort, dateRange, cohortId = NULL, indexDate = \"cohort_start_date\", name = tableName(cohort) )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireInDateRange.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Require that an index date is within a date range — requireInDateRange","text":"cohort cohort table cdm reference. dateRange window time index date must observed. cohortId IDs cohorts modify. NULL, cohorts used; otherwise, specified cohorts modified, rest remain unchanged. indexDate Variable cohort contains index date interest name Name new cohort restriction.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireInDateRange.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Require that an index date is within a date range — requireInDateRange","text":"cohort table cohort entries outside date range dropped","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireInDateRange.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Require that an index date is within a date range — requireInDateRange","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor(nPerson = 100) cdm$cohort1 |> requireInDateRange(indexDate = \"cohort_start_date\", dateRange = as.Date(c(\"2010-01-01\", \"2019-01-01\"))) #> # Source: table [?? x 4] #> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date #> #> 1 1 6 2011-03-07 2014-01-24 #> 2 1 7 2014-03-08 2014-03-19 #> 3 1 13 2014-06-24 2014-06-29 #> 4 1 13 2014-06-30 2014-08-07 #> 5 1 17 2017-03-28 2017-04-05 #> 6 1 18 2012-01-30 2012-05-21 #> 7 1 24 2016-11-15 2016-11-22 #> 8 1 24 2016-11-23 2016-11-29 #> 9 1 24 2016-11-30 2017-01-25 #> 10 1 31 2013-03-29 2014-02-09 #> # ℹ more rows # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireIsFirstEntry.html","id":null,"dir":"Reference","previous_headings":"","what":"Restrict cohort to first entry — requireIsFirstEntry","title":"Restrict cohort to first entry — requireIsFirstEntry","text":"requireIsFirstEntry() filters cohort records, keeping first cohort entry per person.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireIsFirstEntry.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Restrict cohort to first entry — requireIsFirstEntry","text":"","code":"requireIsFirstEntry( cohort, cohortId = NULL, indexDate = \"cohort_start_date\", name = tableName(cohort) )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireIsFirstEntry.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Restrict cohort to first entry — requireIsFirstEntry","text":"cohort cohort table cdm reference. cohortId IDs cohorts modify. NULL, cohorts used; otherwise, specified cohorts modified, rest remain unchanged. indexDate Column name cohort contains date restrict . name Name new cohort restriction.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireIsFirstEntry.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Restrict cohort to first entry — requireIsFirstEntry","text":"cohort table cdm reference.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireIsFirstEntry.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Restrict cohort to first entry — requireIsFirstEntry","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor() cdm$cohort1 <- requireIsFirstEntry(cdm$cohort1) # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireIsLastEntry.html","id":null,"dir":"Reference","previous_headings":"","what":"Restrict cohort to last entry per person — requireIsLastEntry","title":"Restrict cohort to last entry per person — requireIsLastEntry","text":"requireIsLastEntry() filters cohort records, keeping last cohort entry per person.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireIsLastEntry.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Restrict cohort to last entry per person — requireIsLastEntry","text":"","code":"requireIsLastEntry( cohort, cohortId = NULL, indexDate = \"cohort_start_date\", name = tableName(cohort) )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireIsLastEntry.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Restrict cohort to last entry per person — requireIsLastEntry","text":"cohort cohort table cdm reference. cohortId IDs cohorts modify. NULL, cohorts used; otherwise, specified cohorts modified, rest remain unchanged. indexDate Column name cohort contains date restrict . name Name new cohort restriction.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireIsLastEntry.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Restrict cohort to last entry per person — requireIsLastEntry","text":"cohort table cdm reference.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireIsLastEntry.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Restrict cohort to last entry per person — requireIsLastEntry","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor() cdm$cohort1 <- requireIsLastEntry(cdm$cohort1) # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requirePriorObservation.html","id":null,"dir":"Reference","previous_headings":"","what":"Restrict cohort on prior observation — requirePriorObservation","title":"Restrict cohort on prior observation — requirePriorObservation","text":"requirePriorObservation() filters cohort records, keeping records individuals satisfy specified prior observation criteria.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requirePriorObservation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Restrict cohort on prior observation — requirePriorObservation","text":"","code":"requirePriorObservation( cohort, minPriorObservation, cohortId = NULL, indexDate = \"cohort_start_date\", name = tableName(cohort) )"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requirePriorObservation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Restrict cohort on prior observation — requirePriorObservation","text":"cohort cohort table cdm reference. minPriorObservation minimum number prior observation days database. cohortId IDs cohorts modify. NULL, cohorts used; otherwise, specified cohorts modified, rest remain unchanged. indexDate Variable cohort contains date compute demographics characteristics restrict . name Name new cohort prior observation restriction.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requirePriorObservation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Restrict cohort on prior observation — requirePriorObservation","text":"cohort table records individuals satisfying prior observation requirement","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requirePriorObservation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Restrict cohort on prior observation — requirePriorObservation","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor() cdm$cohort1 |> requirePriorObservation(indexDate = \"cohort_start_date\", minPriorObservation = 365) #> # Source: SQL [4 x 4] #> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date #> #> 1 1 1 2003-05-02 2006-06-10 #> 2 1 2 2000-05-04 2000-05-17 #> 3 1 2 2000-05-18 2001-01-23 #> 4 1 4 1996-06-30 1998-11-20 # }"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireSex.html","id":null,"dir":"Reference","previous_headings":"","what":"Restrict cohort on sex — requireSex","title":"Restrict cohort on sex — requireSex","text":"requireSex() filters cohort records, keeping records individuals satisfy specified sex criteria.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireSex.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Restrict cohort on sex — requireSex","text":"","code":"requireSex(cohort, sex, cohortId = NULL, name = tableName(cohort))"},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireSex.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Restrict cohort on sex — requireSex","text":"cohort cohort table cdm reference. sex Can \"\", \"Male\" \"Female\". one latter, sex included. cohortId IDs cohorts modify. NULL, cohorts used; otherwise, specified cohorts modified, rest remain unchanged. name Name new cohort sex requirements.","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireSex.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Restrict cohort on sex — requireSex","text":"cohort table records individuals satisfying sex requirement","code":""},{"path":"https://ohdsi.github.io/CohortConstructor/reference/requireSex.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Restrict cohort on sex — requireSex","text":"","code":"# \\donttest{ library(CohortConstructor) cdm <- mockCohortConstructor() cdm$cohort1 |> requireSex(sex = \"Female\") #> # Source: SQL [5 x 4] #> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1021-azure:R 4.4.1/:memory:] #> cohort_definition_id subject_id cohort_start_date cohort_end_date #>
Burn E, Catala M, Mercade-Besora N, Alcalde-Herraiz M, Du M, Guo Y, Chen X, Lopez K (2024). CohortConstructor: Build and Manipulate Study Cohorts Using a Common Data Model. -R package version 0.2.1, https://ohdsi.github.io/CohortConstructor/. +R package version 0.2.1.900, https://ohdsi.github.io/CohortConstructor/.
@Manual{, title = {CohortConstructor: Build and Manipulate Study Cohorts Using a Common Data Model}, author = {Edward Burn and Marti Catala and Nuria Mercade-Besora and Marta Alcalde-Herraiz and Mike Du and Yuchen Guo and Xihang Chen and Kim Lopez}, year = {2024}, - note = {R package version 0.2.1}, + note = {R package version 0.2.1.900}, url = {https://ohdsi.github.io/CohortConstructor/}, }