-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from OHDSI/develop
Capr v2.0.6 release candidate.
- Loading branch information
Showing
389 changed files
with
1,671 additions
and
27,105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Version: 2.0.6 | ||
Date: 2023-09-06 18:37:34 UTC | ||
SHA: 71f1dd8bb419ec22cb023ee8502417a1bb82ccef |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
Package: Capr | ||
Title: Cohort Definition Application Programming | ||
Version: 2.0.5 | ||
Version: 2.0.6 | ||
Authors@R: c( | ||
person("Martin", "Lavallee", , "mdlavallee92@gmail.com", role = c("aut", "cre")), | ||
person("Adam", "Black", , "[email protected]", role = "aut") | ||
person("Martin", "Lavallee", , "martin.lavallee@odysseusinc.com", role = c("aut")), | ||
person("Adam", "Black", , "[email protected]", role = c("aut", "cre")) | ||
) | ||
Description: Provides a programming language for defining OHDSI cohort definitions in R to use in studies for Observational | ||
Description: Provides a programming language for defining cohort definitions in R to use in studies for Observational | ||
Health Data Sciences and Informatics (OHDSI). The functions in 'Capr' allow for the programmatic creation of | ||
OHDSI concept sets and cohorts that can be serialized to 'Atlas/CIRCE-BE' compatible 'json' files or to 'OHDSI-SQL'. | ||
OHDSI concept sets and cohorts that can be serialized to 'OHDSI' compatible 'json' files or to 'OHDSI-SQL'. | ||
'Capr' functions can be used to create, save, and load component parts to a cohort definition allowing | ||
R programmers to easily reuse cohort logic. 'Capr' provides tools to create a large number of OHDSI cohorts | ||
programmatically while also helping bridge the gap between human readable descriptions of clinical phenotypes | ||
and their computational implmentation. | ||
while also helping bridge the gap between human readable descriptions of clinical phenotypes | ||
and their computational implementation. | ||
License: Apache License (>= 2) | ||
URL: https://ohdsi.github.io/Capr, https://github.com/OHDSI/Capr | ||
BugReports: https://github.com/OHDSI/Capr/issues | ||
URL: https://ohdsi.github.io/Capr/, https://github.com/OHDSI/Capr/ | ||
BugReports: https://github.com/OHDSI/Capr/issues/ | ||
Encoding: UTF-8 | ||
RoxygenNote: 7.2.3 | ||
Depends: | ||
|
@@ -41,22 +41,26 @@ Imports: | |
SqlRender, | ||
generics | ||
Suggests: | ||
testthat (>= 3.0.0), | ||
knitr, | ||
rmarkdown | ||
testthat (>= 3.0.0), | ||
knitr, | ||
rmarkdown | ||
Enhances: | ||
CirceR | ||
VignetteBuilder: knitr | ||
Config/testthat/edition: 3 | ||
Additional_repositories: https://OHDSI.github.io/drat | ||
Collate: | ||
'Capr.R' | ||
'conceptSet.R' | ||
'attributes-concept.R' | ||
'attributes-dateAdjustment.R' | ||
'attributes-logic.R' | ||
'query.R' | ||
'window.R' | ||
'criteria.R' | ||
'exit.R' | ||
'cohort.R' | ||
'attributes-concept.R' | ||
'attributes-logic.R' | ||
'attributes-nested.R' | ||
'attributes-op.R' | ||
'exit.R' | ||
'cohort.R' | ||
'collectCodesetId.R' | ||
'utils.R' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# date Adjustment Attribute | ||
|
||
|
||
# Class ---------------------------- | ||
|
||
#' An S4 class for a date adjustment attribute | ||
#' @slot name the name of the attribute | ||
#' @slot startWith character string either START_DATE or END_DATE | ||
#' @slot startOffset an integer value, default 0 | ||
#' @slot endWith character string either START_DATE or END_DATE | ||
#' @slot endOffset an integer value, default 0 | ||
setClass("dateAdjustmentAttribute", | ||
slots = c(name = "character", | ||
startWith = "character", | ||
startOffset = "integer", | ||
endWith = "character", | ||
endOffset = "integer" | ||
), | ||
prototype = list( | ||
name = "DateAdjustment", | ||
startWith = "START_DATE", | ||
startOffset = 0L, | ||
endWith = "END_DATE", | ||
endOffset = 0L | ||
) | ||
) | ||
|
||
# Builder ----------------- | ||
|
||
#' Function to create age attribute | ||
#' @param startWith character string either START_DATE or END_DATE | ||
#' @param startOffset an integer value, default 0 | ||
#' @param endWith character string either START_DATE or END_DATE | ||
#' @param endOffset an integer value, default 0 | ||
#' @return A dateAdjustment attribute class that can be used with a query | ||
#' @export | ||
dateAdjustment <- function(startWith = "START_DATE", | ||
startOffset = 0L, | ||
endWith = "END_DATE", | ||
endOffset = 0L) { | ||
|
||
|
||
methods::new("dateAdjustmentAttribute", | ||
startWith = startWith, | ||
startOffset = startOffset, | ||
endWith = endWith, | ||
endOffset = endOffset) | ||
|
||
} | ||
|
||
# Coercion -------------- | ||
|
||
setMethod("as.list", "dateAdjustmentAttribute", function(x) { | ||
|
||
atr <- list( | ||
StartWith = x@startWith, | ||
StartOffset = x@startOffset, | ||
EndWith = x@endWith, | ||
EndOffset = x@endOffset) | ||
|
||
tibble::lst(`:=`(!!x@name, atr)) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.