Helper for consistent documentation of collapse
.
+ Source: R/documentationHelper.R
+ collapseDoc.Rd
Helper for consistent documentation of collapse
.
From 84b6138002c460039d6d847a424bedc84a98e80b Mon Sep 17 00:00:00 2001
From: edward-burn <9583964+edward-burn@users.noreply.github.com>
Date: Fri, 1 Nov 2024 22:13:05 +0000
Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20OHDSI/Co?=
=?UTF-8?q?hortConstructor@26484ba5410181ce3ce8618e8f820eee3f6330e9=20?=
=?UTF-8?q?=F0=9F=9A=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
articles/a06_concatanate_cohorts.html | 10 +-
articles/a07_filter_cohorts.html | 24 ++--
pkgdown.yml | 2 +-
reference/collapseDoc.html | 88 +++++++++++++
reference/daysDoc.html | 88 +++++++++++++
reference/entryAtFirstDate.html | 8 +-
reference/entryAtLastDate.html | 4 +-
reference/exitAtDeath.html | 16 +--
reference/exitAtFirstDate.html | 4 +-
reference/exitAtLastDate.html | 6 +-
reference/exitAtObservationEnd.html | 8 +-
reference/index.html | 6 +
reference/matchCohorts.html | 20 +--
reference/padCohortDate.html | 167 ++++++++++++++++++++++++
reference/padCohortEnd.html | 33 ++++-
reference/padCohortStart.html | 41 ++++--
reference/padObservationDoc.html | 89 +++++++++++++
reference/requireCohortIntersect.html | 18 +--
reference/requireFutureObservation.html | 10 +-
reference/sampleCohorts.html | 20 +--
reference/trimDemographics.html | 20 +--
search.json | 2 +-
sitemap.xml | 4 +
23 files changed, 584 insertions(+), 104 deletions(-)
create mode 100644 reference/collapseDoc.html
create mode 100644 reference/daysDoc.html
create mode 100644 reference/padCohortDate.html
create mode 100644 reference/padObservationDoc.html
diff --git a/articles/a06_concatanate_cohorts.html b/articles/a06_concatanate_cohorts.html
index a564567..a3d6373 100644
--- a/articles/a06_concatanate_cohorts.html
+++ b/articles/a06_concatanate_cohorts.html
@@ -130,7 +130,7 @@
cdm$medications |>
filter(subject_id == 1)
#> # Source: SQL [4 x 4]
-#> # Database: DuckDB v1.1.2 [unknown@Linux 6.5.0-1025-azure:R 4.4.2//tmp/RtmpTFmCk3/file294b67620621.duckdb]
+#> # Database: DuckDB v1.1.2 [unknown@Linux 6.5.0-1025-azure:R 4.4.2//tmp/Rtmp5JCQJe/file1df825926314.duckdb]
#> cohort_definition_id subject_id cohort_start_date cohort_end_date
#> <int> <int> <date> <date>
#> 1 1 1 1980-03-15 1980-03-29
@@ -140,12 +140,12 @@
cdm$medications_collapsed |>
filter(subject_id == 1)
#> # Source: SQL [3 x 4]
-#> # Database: DuckDB v1.1.2 [unknown@Linux 6.5.0-1025-azure:R 4.4.2//tmp/RtmpTFmCk3/file294b67620621.duckdb]
+#> # Database: DuckDB v1.1.2 [unknown@Linux 6.5.0-1025-azure:R 4.4.2//tmp/Rtmp5JCQJe/file1df825926314.duckdb]
#> cohort_definition_id subject_id cohort_start_date cohort_end_date
#> <int> <int> <date> <date>
-#> 1 1 1 1971-01-04 1971-01-18
-#> 2 1 1 1976-10-20 1976-11-03
-#> 3 1 1 1980-03-15 1982-10-02
+#> 1 1 1 1976-10-20 1976-11-03
+#> 2 1 1 1980-03-15 1982-10-02
+#> 3 1 1 1971-01-04 1971-01-18
Subject 1 initially had 4 records between 1971 and 1982. After specifying that records within three years of each other are to be merged, the number of records decreases to three. The record from diff --git a/articles/a07_filter_cohorts.html b/articles/a07_filter_cohorts.html index 04a18d2..d05a648 100644 --- a/articles/a07_filter_cohorts.html +++ b/articles/a07_filter_cohorts.html @@ -117,26 +117,26 @@
cdm$medications |> sampleCohorts(cohortId = NULL, n = 100)
#> # Source: table<main.my_study_medications> [?? x 4]
-#> # Database: DuckDB v1.1.2 [unknown@Linux 6.5.0-1025-azure:R 4.4.2//tmp/RtmpJmrUxd/file298d1509de16.duckdb]
+#> # Database: DuckDB v1.1.2 [unknown@Linux 6.5.0-1025-azure:R 4.4.2//tmp/Rtmps9k6ne/file1e3b7d33eae6.duckdb]
#> cohort_definition_id subject_id cohort_start_date cohort_end_date
#> <int> <int> <date> <date>
-#> 1 1 1024 1971-03-15 1971-03-29
-#> 2 1 1024 1995-02-21 1995-03-07
-#> 3 1 3761 1958-10-10 1958-10-24
-#> 4 1 951 1967-12-30 1968-01-20
-#> 5 1 951 1990-12-09 1990-12-23
-#> 6 1 675 1950-08-06 1950-08-20
-#> 7 1 1128 1975-02-21 1975-02-28
-#> 8 1 1558 2006-04-06 2006-04-13
-#> 9 1 3010 2000-01-07 2000-01-14
-#> 10 2 390 2016-05-15 2016-05-15
+#> 1 1 1246 1955-01-22 1955-03-23
+#> 2 1 3672 1979-06-23 1979-07-07
+#> 3 1 1468 1964-11-07 1964-11-28
+#> 4 1 1844 1977-07-15 1977-09-13
+#> 5 1 1905 2000-10-31 2000-11-21
+#> 6 1 2554 1979-08-09 1979-08-23
+#> 7 1 2616 2018-12-10 2018-12-24
+#> 8 1 2927 1958-05-21 1958-06-04
+#> 9 2 70 1983-06-27 1983-06-27
+#> 10 1 2646 1980-02-13 1980-02-20
#> # ℹ more rows
cohortCount(cdm$medications)
#> # A tibble: 2 × 3
#> cohort_definition_id number_records number_subjects
#> <int> <int> <int>
-#> 1 1 374 100
+#> 1 1 370 100
#> 2 2 100 100
When cohortId = NULL all cohorts in the table are used. Note that this function does not reduced the number of records in each cohort, diff --git a/pkgdown.yml b/pkgdown.yml index b533e49..51c3c3f 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -14,7 +14,7 @@ articles: a09_combine_cohorts: a09_combine_cohorts.html a10_match_cohorts: a10_match_cohorts.html a11_benchmark: a11_benchmark.html -last_built: 2024-11-01T21:58Z +last_built: 2024-11-01T22:06Z urls: reference: https://ohdsi.github.io/CohortConstructor/reference article: https://ohdsi.github.io/CohortConstructor/articles diff --git a/reference/collapseDoc.html b/reference/collapseDoc.html new file mode 100644 index 0000000..4ff22da --- /dev/null +++ b/reference/collapseDoc.html @@ -0,0 +1,88 @@ + +
collapse
.R/documentationHelper.R
+ collapseDoc.Rd
Helper for consistent documentation of collapse
.
Helper for consistent documentation of days
.
padCohortDate()
+
+ padCohortEnd()
Set cohort start or cohort end
+padCohortDate(
+ cohort,
+ days,
+ cohortDate = "cohort_start_date",
+ indexDate = "cohort_start_date",
+ collapse = TRUE,
+ padObservation = TRUE,
+ cohortId = NULL,
+ name = tableName(cohort)
+)
A cohort table in a cdm reference.
Integer with the number of days to add or name of a column (that +must be numeric) to add.
'cohort_start_date' or 'cohort_end_date'.
Variable in cohort that contains the index date to add.
Whether to collapse the overlapping records (TRUE) or drop +the records that have an ongoing prior record.
Whether to pad observations if they are outside +observation_period (TRUE) or drop the records if they are outside +observation_period (FALSE)
Vector identifying which cohorts to modify +(cohort_definition_id or cohort_name). If NULL, all cohorts will be +used; otherwise, only the specified cohorts will be modified, and the +rest will remain unchanged.
Name of the new cohort table created in the cdm object.
# \donttest{
+library(CohortConstructor)
+cdm <- mockCohortConstructor()
+cdm$cohort1 |>
+ padCohortDate(
+ cohortDate = "cohort_end_date",
+ indexDate = "cohort_start_date",
+ days = 10)
+#> # Source: table<main.cohort1> [10 x 4]
+#> # Database: DuckDB v1.1.2 [unknown@Linux 6.5.0-1025-azure:R 4.4.2/:memory:]
+#> cohort_definition_id subject_id cohort_start_date cohort_end_date
+#> <int> <int> <date> <date>
+#> 1 1 3 1976-11-28 1976-12-08
+#> 2 1 2 1964-09-18 1964-09-28
+#> 3 1 3 1977-03-12 1977-03-22
+#> 4 1 3 1978-04-04 1978-04-14
+#> 5 1 6 2003-10-31 2003-11-10
+#> 6 1 5 2007-10-19 2007-10-29
+#> 7 1 4 1998-06-22 1998-07-02
+#> 8 1 9 2012-01-18 2012-01-28
+#> 9 1 6 2003-11-15 2003-11-25
+#> 10 1 5 2008-11-11 2008-11-21
+# }
+
padCohortEnd(cohort, days, cohortId = NULL, name = tableName(cohort))
padCohortEnd(
+ cohort,
+ days,
+ collapse = TRUE,
+ padObservation = TRUE,
+ cohortId = NULL,
+ name = tableName(cohort)
+)
Number of day to add to the cohort end date.
Integer with the number of days to add or name of a column (that +must be numeric) to add.
Whether to collapse the overlapping records (TRUE) or drop +the records that have an ongoing prior record.
Whether to pad observations if they are outside +observation_period (TRUE) or drop the records if they are outside +observation_period (FALSE)
padCohortStart(cohort, days, cohortId = NULL, name = tableName(cohort))
padCohortStart(
+ cohort,
+ days,
+ collapse = TRUE,
+ padObservation = TRUE,
+ cohortId = NULL,
+ name = tableName(cohort)
+)
Number of day to add to the cohort start date.
Integer with the number of days to add or name of a column (that +must be numeric) to add.
Whether to collapse the overlapping records (TRUE) or drop +the records that have an ongoing prior record.
Whether to pad observations if they are outside +observation_period (TRUE) or drop the records if they are outside +observation_period (FALSE)
padObservation
.R/documentationHelper.R
+ padObservationDoc.Rd
Helper for consistent documentation of padObservation
.