Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature #2

Merged
merged 59 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
6b12243
update gitignore
guuswilmink Jul 10, 2024
32f9d96
rename R project
guuswilmink Jul 10, 2024
b686131
add config
guuswilmink Jul 10, 2024
b5c0945
update variable mapping tables and standard concept check result tables
guuswilmink Jul 12, 2024
1fa06c2
update .gitignore
guuswilmink Jul 12, 2024
b4af833
update renv
guuswilmink Jul 12, 2024
9269137
add config files
guuswilmink Jul 12, 2024
fcafc8d
update function to use SQL queries
guuswilmink Jul 12, 2024
e39ca44
update function to use SQL queries
guuswilmink Jul 12, 2024
a7c491a
update main code
guuswilmink Jul 12, 2024
73d5989
update mismatched concepts
guuswilmink Jul 12, 2024
d2dc72b
update gitignore
guuswilmink Jul 12, 2024
c1398bc
remove json files
guuswilmink Jul 12, 2024
0867c6f
sync R script
guuswilmink Jul 12, 2024
4847572
update standard_config-sample.yml
guuswilmink Jul 15, 2024
4fd9a44
remove unnecessary file
guuswilmink Jul 15, 2024
4946c35
update standard concept check
guuswilmink Jul 15, 2024
3c3ed54
Add standard concept checker for across concept setS
guuswilmink Jul 15, 2024
8466f8b
docstring for conceptSets.R
guuswilmink Jul 15, 2024
07a3794
update with docstring
guuswilmink Jul 15, 2024
00116e5
update main code
guuswilmink Jul 15, 2024
18a6637
restore
guuswilmink Jul 15, 2024
e2b1e89
update reduce no. SQL queries to 1 for efficiency
guuswilmink Jul 16, 2024
3ce3c8b
remove renv; only keep lockfile
guuswilmink Jul 16, 2024
b6f2c32
update lockfile
guuswilmink Jul 16, 2024
0d03b91
remove unnecessary file
guuswilmink Jul 16, 2024
8fcf546
migrate files
guuswilmink Jul 16, 2024
f05f39c
update .gitignore
guuswilmink Jul 16, 2024
1767466
use Capr.Rproj
guuswilmink Jul 16, 2024
b8ec494
update R profile
guuswilmink Jul 16, 2024
ccda61b
remove outdated html
guuswilmink Jul 16, 2024
071b6b4
.Renviron to configure rJava installation
guuswilmink Jul 17, 2024
239853e
update .Rproj
guuswilmink Jul 17, 2024
2b366a5
update renv lock
guuswilmink Jul 17, 2024
f056636
renamed .Rproj
guuswilmink Jul 17, 2024
5aafcc8
update DESCRIPTION
guuswilmink Jul 17, 2024
b0bdffb
update script
guuswilmink Jul 17, 2024
fbfa18f
renv library updates and install configurations
guuswilmink Jul 17, 2024
aeec12f
update readme
guuswilmink Jul 18, 2024
b544f50
update config
guuswilmink Jul 18, 2024
7ed8727
update config
guuswilmink Jul 18, 2024
5c092a1
move files
guuswilmink Jul 19, 2024
75c3dbe
small code updates
guuswilmink Jul 19, 2024
e22a7da
update config samples
guuswilmink Jul 19, 2024
c48e148
update docs
guuswilmink Jul 19, 2024
52028f3
update environment
guuswilmink Jul 19, 2024
ed6f01d
Update 5.22_vital_signs.csv
guuswilmink Jul 19, 2024
948050d
update README
guuswilmink Jul 19, 2024
6e1bd5b
update README
guuswilmink Jul 19, 2024
c854918
small fixes and additional documentation
guuswilmink Jul 19, 2024
495d8b8
update .gitignore
guuswilmink Jul 19, 2024
13e2334
remove json files
guuswilmink Jul 19, 2024
bdfb571
minor updates
guuswilmink Jul 19, 2024
726ecaa
update gitignore
guuswilmink Jul 19, 2024
09abdc0
update gitignore
guuswilmink Jul 19, 2024
3b9368d
update gitignore
guuswilmink Jul 19, 2024
d3e531b
Merge branch 'main' into feature
guuswilmink Jul 19, 2024
a55ab9f
update cohort definition
guuswilmink Jul 19, 2024
1e907d1
remove project folder
guuswilmink Jul 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
^Capr\.Rproj$
^\.Rproj\.user$
.github
deploy.sh
compare_versions
^doc$
^Meta$
^_pkgdown\.yml$
^docs$
^extras$
^man-roxygen$
^scratch$
^work$
^README\.Rmd$
^pkgdown$
^cran-comments\.md$
^CRAN-SUBMISSION$
^LICENSE\.md$
^renv$
^renv\.lock$
^Capr\.Rproj$
^\.Rproj\.user$
.github
deploy.sh
compare_versions
^doc$
^Meta$
^_pkgdown\.yml$
^docs$
^extras$
^man-roxygen$
^scratch$
^work$
^README\.Rmd$
^pkgdown$
^cran-comments\.md$
^CRAN-SUBMISSION$
^LICENSE\.md$
14 changes: 14 additions & 0 deletions .Rprofile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Force compile packages from source before installing
options(
repos = c(CRAN = "https://cran.rstudio.com"),
install.packages.compile.from.source = TRUE,
pkgType = "source"
)

if (any(list.files() == "renv")) {
source("renv/activate.R")
} else {
message("No renv initialized, calling renv::init()")
message("Please select to use only the DESCRIPTION file for dependency discovery if prompted, and next select 'Restore the project from the lockfile'")
renv::init()
}
42 changes: 33 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
.Rhistory
.Rproj.user
.DS_Store
errorReportSql.txt
*.log
/Meta/
work/*
scratch/
inst/doc
!.gitignore

# Capr
.Rhistory
.Rproj.user
.DS_Store
errorReportSql.txt
*.log
/Meta/
work/*
scratch/
inst/doc

# project-specific
inst/config/*
!inst/config/*-sample.yml

inst/extdata/**/*

!inst/extdata/phems_variable_list

!inst/extdata/json
inst/extdata/json/*

!inst/extdata/standard_concepts
inst/extdata/standard_concepts/*

!inst/extdata/vocabularies
inst/extdata/vocabularies/*

!*.gitkeep

renv
38 changes: 17 additions & 21 deletions Capr.Rproj → Capr-PHEMS.Rproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
Version: 1.0

RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
23 changes: 17 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
Package: Capr
Title: Cohort Definition Application Programming
Package: Capr-PHEMS
Title: Cohort Definition Application Programming - project specific for PHEMS
Version: 2.0.8
Authors@R: c(
person("Martin", "Lavallee", , "martin.lavallee@boehringer-ingelheim.com", role = c("aut", "cre")),
person("Adam", "Black", , "black@ohdsi.org", role = c("aut"))
person("Adam", "Black", , "black@ohdsi.org", role = c("aut")),
person("Guus", "Wilmink", , "guus@thehyve.nl", role = c("aut"))
)
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 '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
while also helping bridge the gap between human readable descriptions of clinical phenotypes
and their computational implementation.
and their computational implementation.
For PHEMS this package has been extended with additional functions to support PHEMS cohort creation.
License: Apache License (>= 2)
URL: https://ohdsi.github.io/Capr/, https://github.com/OHDSI/Capr/
BugReports: https://github.com/OHDSI/Capr/issues/
Encoding: UTF-8
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Depends:
R (>= 3.5.0)
Imports:
Expand All @@ -40,7 +42,11 @@ Imports:
DatabaseConnector,
SqlRender,
generics,
CirceR
CirceR,
codetools,
readr,
dplyr,
DBI
Suggests:
testthat (>= 3.0.0),
knitr,
Expand All @@ -61,4 +67,9 @@ Collate:
'exit.R'
'cohort.R'
'collectCodesetId.R'
'conceptSets.R'
'countOccurrences.R'
'isStandard.R'
'isStandardCS.R'
'table_linked_to_concept_field.R'
'utils.R'
186 changes: 100 additions & 86 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,86 +1,100 @@
# Generated by roxygen2: do not edit by hand

S3method(compile,Cohort)
export("%>%")
export(age)
export(as.json)
export(atLeast)
export(atMost)
export(attrition)
export(bt)
export(censoringEvents)
export(cohort)
export(compile)
export(conditionEra)
export(conditionOccurrence)
export(conditionType)
export(continuousObservation)
export(cs)
export(dateAdjustment)
export(daysOfSupply)
export(death)
export(descendants)
export(deviceExposure)
export(drugEra)
export(drugExit)
export(drugExposure)
export(drugQuantity)
export(drugRefills)
export(drugType)
export(duringInterval)
export(endDate)
export(entry)
export(eq)
export(era)
export(eventEnds)
export(eventStarts)
export(exactly)
export(exclude)
export(exit)
export(female)
export(firstOccurrence)
export(fixedExit)
export(getConceptSetDetails)
export(gt)
export(gte)
export(lt)
export(lte)
export(makeCohortSet)
export(male)
export(mapped)
export(measurement)
export(measurementType)
export(nbt)
export(nestedWithAll)
export(nestedWithAny)
export(nestedWithAtLeast)
export(nestedWithAtMost)
export(observation)
export(observationExit)
export(observationType)
export(procedure)
export(procedureType)
export(rangeHigh)
export(rangeLow)
export(readConceptSet)
export(startDate)
export(toCirce)
export(unit)
export(valueAsNumber)
export(visit)
export(visitType)
export(withAll)
export(withAny)
export(withAtLeast)
export(withAtMost)
export(writeCohort)
export(writeConceptSet)
exportMethods("==")
exportMethods(compile)
import(dplyr)
importFrom(generics,compile)
importFrom(magrittr,"%>%")
importFrom(methods,"slot<-")
importFrom(rlang,"%||%")
importFrom(rlang,":=")
importFrom(rlang,.data)
# Generated by roxygen2: do not edit by hand

S3method(compile,Cohort)
export("%>%")
export(age)
export(as.json)
export(atLeast)
export(atMost)
export(attrition)
export(bt)
export(censoringEvents)
export(cohort)
export(compile)
export(conceptSets)
export(conditionEra)
export(conditionOccurrence)
export(conditionType)
export(continuousObservation)
export(countOccurrences)
export(cs)
export(dateAdjustment)
export(daysOfSupply)
export(death)
export(descendants)
export(deviceExposure)
export(drugEra)
export(drugExit)
export(drugExposure)
export(drugQuantity)
export(drugRefills)
export(drugType)
export(duringInterval)
export(endDate)
export(entry)
export(eq)
export(era)
export(eventEnds)
export(eventStarts)
export(exactly)
export(exclude)
export(exit)
export(female)
export(firstOccurrence)
export(fixedExit)
export(getConceptSetDetails)
export(gt)
export(gte)
export(isStandard)
export(isStandardCS)
export(links)
export(lt)
export(lte)
export(makeCohortSet)
export(male)
export(mapped)
export(measurement)
export(measurementType)
export(nbt)
export(nestedWithAll)
export(nestedWithAny)
export(nestedWithAtLeast)
export(nestedWithAtMost)
export(observation)
export(observationExit)
export(observationType)
export(procedure)
export(procedureType)
export(rangeHigh)
export(rangeLow)
export(readConceptSet)
export(startDate)
export(toCirce)
export(unit)
export(valueAsNumber)
export(visit)
export(visitType)
export(withAll)
export(withAny)
export(withAtLeast)
export(withAtMost)
export(writeCohort)
export(writeConceptSet)
exportMethods("==")
exportMethods(collectGuid)
exportMethods(compile)
import(dplyr)
importFrom(DBI,dbGetQuery)
importFrom(dplyr,across)
importFrom(dplyr,filter)
importFrom(dplyr,inner_join)
importFrom(dplyr,mutate)
importFrom(dplyr,select)
importFrom(generics,compile)
importFrom(magrittr,"%>%")
importFrom(methods,"slot<-")
importFrom(readr,read_csv)
importFrom(readr,write_csv)
importFrom(rlang,"%||%")
importFrom(rlang,":=")
importFrom(rlang,.data)
Loading