Skip to content

Commit

Permalink
Merge pull request #2 from thehyve/feature
Browse files Browse the repository at this point in the history
Feature
  • Loading branch information
guuswilmink committed Jul 19, 2024
2 parents 87eafac + 1e907d1 commit b5c1e37
Show file tree
Hide file tree
Showing 123 changed files with 3,940 additions and 8,460 deletions.
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

0 comments on commit b5c1e37

Please sign in to comment.