Skip to content

Commit

Permalink
Release version 3.1.2 (#35)
Browse files Browse the repository at this point in the history
* Add function to get phenotype log
* Remove unneeded else logic in readFile to improve test coverage
* A new vignette that shows cohort definition log
* Spell mistakes and url fixes
  • Loading branch information
gowthamrao authored Jul 9, 2022
1 parent a366603 commit 2e144df
Show file tree
Hide file tree
Showing 29 changed files with 2,111 additions and 41 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: PhenotypeLibrary
Type: Package
Title: The OHDSI Phenotype library
Version: 3.1.1
Date: 2022-07-07
Version: 3.1.2
Date: 2022-07-09
Author: Gowtham Rao [aut, cre]
Maintainer: Gowtham Rao <[email protected]>
Description: A repository to store the content of the OHDSI Phenotype library.
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

export(getPhenotypeLog)
export(getPlCohortDefinitionSet)
export(listPhenotypes)
import(dplyr)
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
PhenotypeLibrary 3.1.2
======================

Added Vignette: Cohort Definitions in OHDSI Phenotype Library
Added new function: to get log of phenotype changes

PhenotypeLibrary 3.1.1
======================

Expand Down
41 changes: 39 additions & 2 deletions R/Phenotypes.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ getPlCohortDefinitionSet <- function(cohortIds) {
readFile <- function(fileName) {
if (file.exists(fileName)) {
return(paste(readr::read_lines(fileName), collapse = "\n"))
} else {
stop(paste0("File not found: ", fileName))
}
}

Expand All @@ -76,3 +74,42 @@ getPlCohortDefinitionSet <- function(cohortIds) {

return(result)
}


#' Get phenotype log
#'
#' @return
#' Returns a table with one row per cohort definitions with log information such as its release cycle.
#' Example, this function gives us insight on when a cohort definition was added/updated/deprecated
#' by the OHDSI PhenotypeLibrary.
#'
#' @param cohortIds IDs of cohorts to extraction from the library.
#'
#' @return
#' A tibble.
#'
#' @examples
#' getPhenotypeLog(cohortIds = c(1, 2))
#'
#' @export
getPhenotypeLog <- function(cohortIds = listPhenotypes()$cohortId) {
log <-
readr::read_csv(
system.file("PhenotypeLog.csv", package = "PhenotypeLibrary"),
col_types = readr::cols()
) %>%
dplyr::filter(.data$cohortId %in% c(cohortIds)) %>%
dplyr::mutate(
addedVersion = as.character(.data$addedVersion),
addedDate = as.Date(.data$addedDate),
addedNotes = as.character(.data$addedNotes),
deprecatedVersion = as.character(.data$deprecatedVersion),
deprecatedDate = as.Date(.data$deprecatedDate),
deprecatedNotes = as.character(.data$deprecatedNotes),
updatedVersion = as.character(.data$updatedVersion),
updatedDate = as.Date(.data$updatedDate),
updatedNotes = as.character(.data$updatedNotes)
) %>%
dplyr::arrange(.data$cohortId)
return(log)
}
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,33 @@ PhenotypeLibrary
[![Build Status](https://github.com/OHDSI/PhenotypeLibrary/workflows/R-CMD-check/badge.svg)](https://github.com/OHDSI/PhenotypeLibrary/actions?query=workflow%3AR-CMD-check)
[![codecov.io](https://codecov.io/github/OHDSI/PhenotypeLibrary/coverage.svg?branch=main)](https://codecov.io/github/OHDSI/PhenotypeLibrary?branch=main)

PhenotypeLibrary is part of [HADES](https://ohdsi.github.io/Hades).

Introduction
============
PhenotypeLibrary is a repository to store the content of the OHDSI Phenotype library. These phenotype/cohort definitions have under gone an OHDSI best practice Phenotype Development and Evaluation Process by the OHDSI Phenotype Development and Evaluation work group. This [workgroup](https://forums.ohdsi.org/t/ohdsi-phenotype-library-announcements/16910), through a OHDSI community wide collaboration effort, evaluates and maintains cohort definitions in an [Atlas instance](https://atlas-phenotype.ohdsi.org/#/home). Definitions that have graduated through this process are published in this repository, and are thus considered high quality cohort definitions.
[PhenotypeLibrary](https://github.com/OHDSI/PhenotypeLibrary) is a repository to store the content of the [OHDSI Phenotype Library](https://github.com/OHDSI/PhenotypeLibrary) (Library). These phenotype/cohort definitions have under gone an OHDSI best practice Phenotype Development and Evaluation Process by the [OHDSI Phenotype Development and Evaluation Work group](https://teams.microsoft.com/l/team/19%3a66a11855657c46918723073bff9e36f1%40thread.tacv2/conversations?groupId=b464dca0-06d1-477c-b66d-11827e4d0412&tenantId=a30f0094-9120-4aab-ba4c-e5509023b2d5) (work group). This [Work group](https://teams.microsoft.com/l/team/19%3a66a11855657c46918723073bff9e36f1%40thread.tacv2/conversations?groupId=b464dca0-06d1-477c-b66d-11827e4d0412&tenantId=a30f0094-9120-4aab-ba4c-e5509023b2d5), through a OHDSI community wide collaboration effort, evaluates and maintains cohort definitions in an [Atlas instance](https://atlas-phenotype.ohdsi.org/#/home). Definitions that have graduated through this process are published in this repository, and are thus considered high quality cohort definitions.

cohortId's in this repository are persistent (similar to OMOP Concept Id) i.e. once published it maybe expected to stay the same between releases of the Phenotype library (i.e. backward compatible). Version numbers in this repository follows [HADES](https://ohdsi.github.io/Hades/index.html) convention, and changes (addition or deletions) are reported as [News](https://ohdsi.github.io/PhenotypeLibrary/news/index.html). Phenotype Development and Evaluation Workgroup will be responsible to maintain a cadence for the cohort life cycle - including deprecation and additions.
cohortId's in this repository are persistent (similar to OMOP Concept Id) i.e. once published it maybe expected to stay the same between releases of the Phenotype library (i.e. backward compatible). Version numbers in this repository follows [HADES](https://ohdsi.github.io/Hades/index.html) convention, and changes (addition or deletions) are reported as [News](https://ohdsi.github.io/PhenotypeLibrary/news/index.html). [Work group](https://teams.microsoft.com/l/team/19%3a66a11855657c46918723073bff9e36f1%40thread.tacv2/conversations?groupId=b464dca0-06d1-477c-b66d-11827e4d0412&tenantId=a30f0094-9120-4aab-ba4c-e5509023b2d5) will be responsible to maintain a cadence for the cohort life cycle - including deprecation and additions.

Features
========
- Contains all phenotypes (ie. cohort definitions) that have been approved by the OHDSI Phenotype Development and Evaluation workgroup.
- Contains all phenotypes (i.e. cohort definitions) that have been approved by the OHDSI Phenotype Development and Evaluation workgroup.
- Phenotypes are available as SQL statements and JSON.
- Can provide cohortDefinitionSet object that maybe directly used as input by other OHDSI R packages like OHDSI [CohortGenerator](https://ohdsi.github.io/CohortGenerator/) and [CohortGenerator] (https://ohdsi.github.io/CohortDiagnostics/). See accompanying vignettes.
- Can provide cohortDefinitionSet object that maybe directly used as input by other OHDSI R packages like OHDSI [CohortGenerator](https://ohdsi.github.io/CohortGenerator/) and [CohortDiagnostics](https://ohdsi.github.io/CohortDiagnostics/). See accompanying vignettes.

Technology
============
PhenotypeLibrary is an R package.
[PhenotypeLibrary](https://github.com/OHDSI/PhenotypeLibrary) is an R package.

System Requirements
============
Requires R (version 3.6.0 or higher).

Installation
=============
1. See the instructions [here](https://ohdsi.github.io/Hades/rSetup.html) for configuring your R environment, including RTools and Java.
1. See [HADES instructions](https://ohdsi.github.io/Hades/rSetup.html) for configuring your R environment, including RTools and Java.

2. In R, use the following commands to download and install PhenotypeLibrary:
2. In R, use the following commands to download and install [PhenotypeLibrary](https://github.com/OHDSI/PhenotypeLibrary):

```r
install.packages("remotes")
Expand All @@ -49,16 +51,17 @@ Support

Contributing
============
Read [here](https://ohdsi.github.io/Hades/contribute.html) how you can contribute to this package.
Read [HADES contribution](https://ohdsi.github.io/Hades/contribute.html) how you can contribute to thee software in this package.
To contribute to the Cohort Definitions, Phenotype Development and Evaluation - please visit the Microsoft Teams website of the [OHDSI Phenotype Development and Evaluation Work group](https://teams.microsoft.com/l/team/19%3a66a11855657c46918723073bff9e36f1%40thread.tacv2/conversations?groupId=b464dca0-06d1-477c-b66d-11827e4d0412&tenantId=a30f0094-9120-4aab-ba4c-e5509023b2d5).

License
=======
PhenotypeLibrary is licensed under Apache License 2.0
[PhenotypeLibrary](https://github.com/OHDSI/PhenotypeLibrary) is licensed under Apache License 2.0

Development
===========
PhenotypeLibrary is being developed in R Studio.
[PhenotypeLibrary](https://github.com/OHDSI/PhenotypeLibrary) is being developed in R Studio.

### Development status

PhenotypeLibrary is under development.
[PhenotypeLibrary](https://github.com/OHDSI/PhenotypeLibrary) is under development.
5 changes: 4 additions & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2e144df

Please sign in to comment.