diff --git a/docs/404.html b/docs/404.html index 30b7b897..ac794904 100644 --- a/docs/404.html +++ b/docs/404.html @@ -39,7 +39,7 @@ Capr - 2.1.0 + 2.0.6 @@ -59,19 +59,19 @@ Working with Concept Sets in Capr
NEWS.md
-
-
makeCohortSet()
function to pipe into CohortGenerator
(from Issue #79)dateAdjustment()
function to deploy new circe attribute to a query (from Issue #77)The aperture class provides context to when the criteria must be observed in a person timeline to pretain to the expression
+The aperture class provides context to when the criteria must be +observed in a person timeline to pretain to the expression
A criteria that can be used in a cohort definition
+A criteria that can be used in a cohort definition specifying satisfaction of at least x instances of a query
diff --git a/docs/reference/atMost.html b/docs/reference/atMost.html index d9ae4075..05750342 100644 --- a/docs/reference/atMost.html +++ b/docs/reference/atMost.html @@ -17,7 +17,7 @@ Capr - 2.1.0 + 2.0.6 @@ -35,26 +35,26 @@ Working with Concept Sets in CaprA criteria that can be used in a cohort definition
+A criteria that can be used in a cohort definition specifying satisfaction of at most x instances of a query
diff --git a/docs/reference/attributes.html b/docs/reference/attributes.html index 4ddac620..c25b325c 100644 --- a/docs/reference/attributes.html +++ b/docs/reference/attributes.html @@ -18,7 +18,7 @@ Capr - 2.1.0 + 2.0.6 @@ -36,26 +36,26 @@ Working with Concept Sets in Caprif (FALSE) {
-# Create a cohort of males with Type 1 diabetes
-t1dm <- cs(descendants(201254, 435216, 40484648))
-t1dm_males <- cohort(condition(t1dm, male()))
-}
-if (FALSE) {
+ # Create a cohort of males with Type 1 diabetes
+t1dm <- cs(descendants(201254, 435216, 40484648), name = "type 1 diabetes")
+t1dm_males <- cohort(conditionOccurrence(t1dm, male()))
# Create a cohort of males with Type 1 diabetes
-t1dm <- cs(descendants(201254, 435216, 40484648))
-t1dm_females <- cohort(condition(t1dm, female()))
-}
+t1dm <- cs(descendants(201254, 435216, 40484648), name = "type 1 diabetes")
+t1dm_females <- cohort(conditionOccurrence(t1dm, female()))
a list of Capr query objects that are used as censoring events
a censoring criteria S4 object used to define the censoring events of the cohort definition
+Cohort era (collapse) logic created with the `cohortEra` function
an S4 Cohort class object describing the cohort definiton
+if (FALSE) {
-ch <- cohort(condition(cs(1,2)))
+ ch <- cohort(conditionOccurrence(cs(1,2, name = "concepts")))
compile(ch)
-}
+#> [1] "{\"ConceptSets\":[{\"id\":0,\"name\":\"concepts\",\"expression\":{\"items\":[{\"concept\":{\"CONCEPT_ID\":1,\"CONCEPT_NAME\":\"\",\"STANDARD_CONCEPT\":\"\",\"STANDARD_CONCEPT_CAPTION\":\"\",\"INVALID_REASON\":\"\",\"INVALID_REASON_CAPTION\":\"\",\"CONCEPT_CODE\":\"\",\"DOMAIN_ID\":\"\",\"VOCABULARY_ID\":\"\",\"CONCEPT_CLASS_ID\":\"\"},\"isExcluded\":false,\"includeDescendants\":false,\"includeMapped\":false},{\"concept\":{\"CONCEPT_ID\":2,\"CONCEPT_NAME\":\"\",\"STANDARD_CONCEPT\":\"\",\"STANDARD_CONCEPT_CAPTION\":\"\",\"INVALID_REASON\":\"\",\"INVALID_REASON_CAPTION\":\"\",\"CONCEPT_CODE\":\"\",\"DOMAIN_ID\":\"\",\"VOCABULARY_ID\":\"\",\"CONCEPT_CLASS_ID\":\"\"},\"isExcluded\":false,\"includeDescendants\":false,\"includeMapped\":false}]}}],\"PrimaryCriteria\":{\"CriteriaList\":[{\"ConditionOccurrence\":{\"CodesetId\":0}}],\"ObservationWindow\":{\"PriorDays\":0,\"PostDays\":0},\"PrimaryCriteriaLimit\":{\"Type\":\"First\"}},\"QualifiedLimit\":{\"Type\":\"First\"},\"ExpressionLimit\":{\"Type\":\"First\"},\"InclusionRules\":[],\"CensoringCriteria\":[],\"CollapseSettings\":{\"CollapseType\":\"ERA\",\"EraPad\":0},\"CensorWindow\":{},\"cdmVersionRange\":\">=5.0.0\"}"
minimum number of observation days post cohort index. Default 0 days
An observation window that can be used in a Capr cohort definition
+if (FALSE) {
-cs(1, 2)
-cs(1, c(1, 10, 2))
-cs(1, seq(2, 10, 2))
-cs(1, 2, 3, exclude(4, 5))
-cs(1, 2, 3, exclude(4, 5), mapped(6, 7))
-cs(1, 2, 3, exclude(4, 5), mapped(6, 7), descendants(8, 9))
-cs(descendants(1, 2, 3), exclude(descendants(8, 9)))
-}
+ cs(1, 2, name = "concepts")
+#> -- <Capr Concept Set> concepts -------------------------------------------------
+#> # A tibble: 2 x 9
+#> conceptId conceptCode conceptName domainId vocabularyId standardConcept
+#> <int> <chr> <chr> <chr> <chr> <chr>
+#> 1 1 "" "" "" "" ""
+#> 2 2 "" "" "" "" ""
+#> # i 3 more variables: includeDescendants <lgl>, isExcluded <lgl>,
+#> # includeMapped <lgl>
+cs(1, c(10, 11, 2), name = "concepts")
+#> -- <Capr Concept Set> concepts -------------------------------------------------
+#> # A tibble: 4 x 9
+#> conceptId conceptCode conceptName domainId vocabularyId standardConcept
+#> <int> <chr> <chr> <chr> <chr> <chr>
+#> 1 1 "" "" "" "" ""
+#> 2 10 "" "" "" "" ""
+#> 3 11 "" "" "" "" ""
+#> 4 2 "" "" "" "" ""
+#> # i 3 more variables: includeDescendants <lgl>, isExcluded <lgl>,
+#> # includeMapped <lgl>
+cs(1, seq(2, 10, 2), name = "concepts")
+#> -- <Capr Concept Set> concepts -------------------------------------------------
+#> # A tibble: 6 x 9
+#> conceptId conceptCode conceptName domainId vocabularyId standardConcept
+#> <int> <chr> <chr> <chr> <chr> <chr>
+#> 1 1 "" "" "" "" ""
+#> 2 2 "" "" "" "" ""
+#> 3 4 "" "" "" "" ""
+#> 4 6 "" "" "" "" ""
+#> 5 8 "" "" "" "" ""
+#> 6 10 "" "" "" "" ""
+#> # i 3 more variables: includeDescendants <lgl>, isExcluded <lgl>,
+#> # includeMapped <lgl>
+cs(1, 2, 3, exclude(4, 5), name = "concepts")
+#> -- <Capr Concept Set> concepts -------------------------------------------------
+#> # A tibble: 5 x 9
+#> conceptId conceptCode conceptName domainId vocabularyId standardConcept
+#> <int> <chr> <chr> <chr> <chr> <chr>
+#> 1 1 "" "" "" "" ""
+#> 2 2 "" "" "" "" ""
+#> 3 3 "" "" "" "" ""
+#> 4 4 "" "" "" "" ""
+#> 5 5 "" "" "" "" ""
+#> # i 3 more variables: includeDescendants <lgl>, isExcluded <lgl>,
+#> # includeMapped <lgl>
+cs(1, 2, 3, exclude(4, 5), mapped(6, 7), name = "concepts")
+#> -- <Capr Concept Set> concepts -------------------------------------------------
+#> # A tibble: 7 x 9
+#> conceptId conceptCode conceptName domainId vocabularyId standardConcept
+#> <int> <chr> <chr> <chr> <chr> <chr>
+#> 1 1 "" "" "" "" ""
+#> 2 2 "" "" "" "" ""
+#> 3 3 "" "" "" "" ""
+#> 4 4 "" "" "" "" ""
+#> 5 5 "" "" "" "" ""
+#> 6 6 "" "" "" "" ""
+#> 7 7 "" "" "" "" ""
+#> # i 3 more variables: includeDescendants <lgl>, isExcluded <lgl>,
+#> # includeMapped <lgl>
+cs(1, 2, 3, exclude(4, 5), mapped(6, 7), descendants(8, 9), name = "concepts")
+#> -- <Capr Concept Set> concepts -------------------------------------------------
+#> # A tibble: 9 x 9
+#> conceptId conceptCode conceptName domainId vocabularyId standardConcept
+#> <int> <chr> <chr> <chr> <chr> <chr>
+#> 1 1 "" "" "" "" ""
+#> 2 2 "" "" "" "" ""
+#> 3 3 "" "" "" "" ""
+#> 4 4 "" "" "" "" ""
+#> 5 5 "" "" "" "" ""
+#> 6 6 "" "" "" "" ""
+#> 7 7 "" "" "" "" ""
+#> 8 8 "" "" "" "" ""
+#> 9 9 "" "" "" "" ""
+#> # i 3 more variables: includeDescendants <lgl>, isExcluded <lgl>,
+#> # includeMapped <lgl>
+cs(descendants(1, 2, 3), exclude(descendants(8, 9)), name = "concepts")
+#> -- <Capr Concept Set> concepts -------------------------------------------------
+#> # A tibble: 5 x 9
+#> conceptId conceptCode conceptName domainId vocabularyId standardConcept
+#> <int> <chr> <chr> <chr> <chr> <chr>
+#> 1 1 "" "" "" "" ""
+#> 2 2 "" "" "" "" ""
+#> 3 3 "" "" "" "" ""
+#> 4 8 "" "" "" "" ""
+#> 5 9 "" "" "" "" ""
+#> # i 3 more variables: includeDescendants <lgl>, isExcluded <lgl>,
+#> # includeMapped <lgl>
Function to create age attribute
+dateAdjustment(
+ startWith = "START_DATE",
+ startOffset = 0L,
+ endWith = "END_DATE",
+ endOffset = 0L
+)
character string either START_DATE or END_DATE
an integer value, default 0
character string either START_DATE or END_DATE
an integer value, default 0
A dateAdjustment attribute class that can be used with a query
+R/attributes-dateAdjustment.R
+ dateAdjustmentAttribute-class.Rd
An S4 class for a date adjustment attribute
+name
the name of the attribute
startWith
character string either START_DATE or END_DATE
startOffset
an integer value, default 0
endWith
character string either START_DATE or END_DATE
endOffset
an integer value, default 0
An attribute that can be used in a cohort definition
+force drug exposure days supply to a set number of days
an S4 DrugExposueExit class which defines the cohort exit by end of drug exposure
+An attribute that can be used in a cohort definition
+An attribute that can be used in a cohort definition
+An event aperature that can be used in a Capr cohort definition
+An attribute that can be used in a cohort definition
+a date string that specifies the end date of registration
a S4 CohortEra class object defining the eras of the cohort definition
+An event window that can be used in a Capr cohort definition
+R/window.R
eventStarts.Rd
#' Function looking at all time before an event -#' @export -allDaysBefore <- function() - new("Endpoint", - days = "all", - coeff = "before")
+Function creates an event window where the event starts
#' Function looking at all time after an event -#' @export -allDaysAfter <- function() - new("Endpoint", - days = "all", - coeff = "after") - -Function creates an event window where the event starts
+An event window that can be used in a Capr cohort definition
A criteria that can be used in a cohort definition specifying satisfaction of exactly x instances of a query
+an integer specifying the number of days to offset from the event date
a fixed Duration exit S4 object used to define the cohort exit as the end of a specified time
+if (FALSE) {
# create a concept set
vocabularyDatabaseSchema = "cdm5"
-anemia <- cs(descendants(439777,4013073,4013074))
+anemia <- cs(descendants(439777,4013073,4013074), name = "anemia")
# fill in the details from an OMOP CDM
library(DatabaseConnector)
-con <- connect(dbms = "postgresql", user = "postgres", password = "", server = "localhost/covid")
+con <- connect(dbms = "postgresql", user = "postgres", password = "", server = "localhost/cdm")
anemia <- getConceptSetDetails(condition_anemia, con, vocabularyDatabaseSchema = "cdm5")
}
An S4 class identifying a censoring criteria for the cohort
An S4 class for a single OMOP Concept
An S4 class for ConceptSetExpresion
An S4 class for ConceptSetItem
An S4 for a criteria
An S4 class for a cohort exit based on continuous exposure persistence.
An S4 class for an Endpoint
An S4 class for Aperture
An S4 class for a Window
An S4 class for a cohort exit based on fixed duration persistence.
An S4 class for a group
An S4 class for a cohort exit based on end of continuous observation.
An S4 class for an ObservationWindow
An S4 class for an occurrence.
An S4 class for a Circe Query
Function to create age attribute
bt()
Between operator
An S4 class identifying a censoring criteria for the cohort
compile()
Compile a Capr object to json
An S4 class for a single OMOP Concept
An S4 class for a concept attribute
An S4 class for ConceptSetExpresion
An S4 class for ConceptSetItem
continuousObservation()
A function to construct the observationWindow
An S4 for a criteria
Create a concept set
Function to create age attribute
An S4 class for a date adjustment attribute
drugExposure()
Query the drug domain
An S4 class for a cohort exit based on continuous exposure persistence.
endDate()
Function that creates a end date attribute
An S4 class for an Endpoint
era()
Create a Cohort Era class object
An S4 class for Aperture
#' A function to offset the number of days relative to index -#' @param days a number specifying the number of days to offset from index where -#' an event may be observed. In this function a negative number means days before index -#' and a postive number means days after index. -#' @export -offset <- function(days) - coeff <- dplyr::if_else(sign(days) == 1, "after", "before", "before") - new("Endpoint", - days = as.integer(abs(days)), - coeff = coeff)
Function creates an event window where the event starts
An S4 class for a Window
Add first occurrence attribute
Function to create an exit based on exit based on the end of a continuous drug exposure
An S4 class for a cohort exit based on fixed duration persistence.
Generate a Capr cohort using a template
Function to create an exit based on exit based on the end of a continuous drug exposure
getConceptSetDetails()
Fill in Concept Set details using a vocab
An S4 class for a group
lte()
Less than or equal to operator
Make a cohort dataframe for cohort generator
Function to construct a nested group where all criteria and groups must be satisfied
Construct a nested group where all criteria and groups must be satisfied
observation()
Query the observation domain
An S4 class for a cohort exit based on end of continuous observation.
Function to create an exit based on continuous observation
An S4 class for an ObservationWindow
An S4 class for an occurrence.
procedure()
Query the procedure domain
An S4 class for a Circe Query
Make a cohort dataframe for cohort generator
+makeCohortSet(...)
multiple capr cohorts to bind into a dataframe
a tibble containing cohortId, name, sql and json to pipe into CohortGenerator.
+R/attributes-nested.R
nestedWithAll.Rd
Function to construct a nested group where all criteria and groups must be satisfied
+Construct a nested group where all criteria and groups must be satisfied
observationExit()
an S4 ObservationExit class which defines the cohort exit as the end of continuous observation
+An attribute that can be used in a cohort definition
+An attribute that can be used in a cohort definition
+if (FALSE) {
-anemia <- readConceptSet('anemia.json')
-anemia <- readConceptSet('anemia.csv')
-}
+ library(Capr)
+path <- tempfile("concepts", fileext = ".json")
+concepts <- cs(1, 2, descendants(4, 5), exclude(descendants(6, 7)), name = "test")
+writeConceptSet(concepts, path = path)
+
+concepts <- readConceptSet(path)
+
An attribute that can be used in a cohort definition
+the Capr cohort class
an s3 list representing the circe object to coerce to json
+if (FALSE) {
-# create a unit attribute
+ # create a unit attribute
unit(8713L)
+#> + Capr Concept Attribute: unit
+#> # A tibble: 1 x 6
+#> concept_id concept_name concept_code domain_id vocabulary_id concept_class_id
+#> <int> <chr> <chr> <chr> <chr> <chr>
+#> 1 8713 NA NA NA NA NA
unit("%")
-}
+#> + Capr Concept Attribute: unit
+#> # A tibble: 1 x 6
+#> concept_id concept_name concept_code domain_id vocabulary_id concept_class_id
+#> <int> <chr> <chr> <chr> <chr> <chr>
+#> 1 8554 % NA NA NA NA
An attribute that can be used in a cohort definition
+a set of criteria or groups
an S4 group class specifying a bundle of criteria that all must be satisfied in context of the cohort definition
+a set of criteria or groups
an S4 group class specifying a bundle of criteria that any may be satisfied in context of the cohort definition
+a set of criteria or groups
an S4 group class specifying a bundle of criteria that at least x be satisfied in context of the cohort definition
+a set of criteria or groups
an S4 group class specifying a bundle of criteria that at most x be satisfied in context of the cohort definition
+The name of the file to create
Invisibly returns the path to the json file that was written
+if (FALSE) {
-cs1 <- cs(descendants(exclude(436665),440383,442306,4175329))
-cs1 <- getConceptSetDetails(cs1)
-x <- cohort(condition(cs1))
-writeCohort(x, "cohortDefinition.json")
-}
-
if (FALSE) {
-anemia <- cs(descendants(439777,4013073,4013074))
-writeConceptSet(anemia, 'anemia.json')
-writeConceptSet(anemia, 'anemia.csv')
-}
+