Skip to content

Commit

Permalink
Merge pull request #93 from OHDSI/adding_descriptions
Browse files Browse the repository at this point in the history
adding descriptions
  • Loading branch information
edward-burn authored Oct 28, 2024
2 parents a52a6ed + a4ce0cf commit a5ffb92
Show file tree
Hide file tree
Showing 17 changed files with 131 additions and 11 deletions.
8 changes: 8 additions & 0 deletions R/addCodelistAttribute.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#' Adds the cohort_codelist attribute to a cohort
#'
#' @description
#' `addCodelistAttribute()` allows the users to add a codelist to a cohort in
#' OMOP CDM.
#'
#' This is particularly important for the use of `codelistDiagnostics()`, as the
#' underlying assumption is that the cohort that is fed into
#' `codelistDiagnostics()` has a cohort_codelist attribute attached to it.
#'
#' @inheritParams cohortDoc
#' @param codelist Named list of concepts
#' @param cohortName For each element of the codelist, the name of the cohort in
Expand Down
9 changes: 9 additions & 0 deletions R/codelistDiagnostics.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#' Run codelist-level diagnostics
#'
#' @description
#' `codelistDiagnostics()` runs phenotypeR diagnostics on the cohort_codelist
#' attribute on the cohort. Thus codelist attribute of the cohort must be
#' populated. If it is missing then it could be populated using
#' `addCodelistAttribute()` function.
#'
#' Furthermore `codelistDiagnostics()` requires achilles tables to be present in
#' the cdm so that concept counts could be derived.
#'
#' @param cohort A cohort table in a cdm reference. The cohort_codelist
#' attribute must be populated. The cdm reference must contain achilles
#' tables as these will be used for deriving concept counts.
Expand Down
9 changes: 9 additions & 0 deletions R/cohortDiagnostics.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#' Run cohort-level diagnostics
#'
#' @description
#' Runs phenotypeR diagnostics on the cohort.
#' The diganotics include:
#' * Age groups and sex summarised.
#' * A summary of visits of everyone in the cohort using visit_occurrence table.
#' * A summary of age and sex density of the cohort.
#' * Attritions of the cohorts.
#' * Overlap between cohorts (if more than one cohort is being used).
#'
#' @inheritParams cohortDoc
#'
#' @return A summarised result
Expand Down
7 changes: 7 additions & 0 deletions R/databaseDiagnostics.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#' Database diagnostics
#'
#' @description
#' phenotypeR diagnostics on the cdm object.
#'
#' Diagnostics include:
#' * Summarise a cdm_reference object, creating a snapshot with the metadata of the cdm_reference object.
#' * Summarise the observation period table getting some overall statistics in a summarised_result object.
#'
#' @param cdm CDM reference
#'
#' @return A summarised result
Expand Down
13 changes: 13 additions & 0 deletions R/matchedDiagnostics.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
#' Compare characteristics of cohort matched to database population
#'
#' @description
#' A summary of the cohort that is matched to the original cohort that has been
#' given by the user. Such summary contains basic cohort summary including
#' number of visits within one year prior of the cohort_start_date, as well as
#' a large scale charactersitics using the following domians of OMOP CDM:
#'
#' * condition_occurrence
#' * visit_occurrence
#' * measurement
#' * procedure_occurrence
#' * observation
#' * drug_exposure
#'
#' @inheritParams cohortDoc
#' @inheritParams matchedSampleDoc
#'
Expand Down
10 changes: 10 additions & 0 deletions R/phenotypeDiagnostics.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#' Phenotype a cohort
#'
#' @description
#' This comprises all the diagnostics that are being offered in this package,
#' this includes:
#'
#' * A diagnostics on the database via `databaseDiagnostics`.
#' * A diagnostics on the cohort_codelist attribute of the cohort via `codelistDiagnostics`.
#' * A diagnostics on the cohort via `cohortDiagnostics`.
#' * A diagnostics on the population via `populationDiagnostics`.
#' * A diagnostics on the matched cohort via `matchedDiagnostics`.
#'
#' @inheritParams cohortDoc
#' @param databaseDiagnostics If TRUE, database diagnostics will be run.
#' @param codelistDiagnostics If TRUE, codelist diagnostics will be run.
Expand Down
8 changes: 7 additions & 1 deletion R/populationDiagnostics.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#' Population-level diagnostics
#'
#' @description
#' phenotypeR diagnostics on the cohort of input with relation to a denomination
#' population. Diagnostics include:
#'
#' * Incidence
#' * Prevalence
#'
#' @inheritParams cohortDoc
#' @inheritParams populationSampleDoc
#'
Expand All @@ -10,7 +17,6 @@
#' \donttest{
#' library(IncidencePrevalence)
#' cdm <- mockIncidencePrevalenceRef(sampleSize = 1000)
#' cdm <- generateDenominatorCohortSet(cdm, name = "denom")
#' pop_diag <- populationDiagnostics(cohort = cdm$outcome,
#' populationSample = 250)
#' CDMConnector::cdm_disconnect(cdm)
Expand Down
1 change: 0 additions & 1 deletion R/reportDiagnostics.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#' Create a report summarising your phenotyping results
#'
#' @inheritParams resultDoc
Expand Down
11 changes: 11 additions & 0 deletions R/shinyDiagnostics.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#' Create a shiny app summarising your phenotyping results
#'
#' @description
#' A shiny app that is designed for any diagnostics results from phenotypeR, this
#' includes:
#'
#' * A diagnostics on the database via `databaseDiagnostics`.
#' * A diagnostics on the cohort_codelist attribute of the cohort via `codelistDiagnostics`.
#' * A diagnostics on the cohort via `cohortDiagnostics`.
#' * A diagnostics on the population via `populationDiagnostics`.
#' * A diagnostics on the matched cohort via `matchedDiagnostics`.
#'
#'
#' @inheritParams resultDoc
#' @inheritParams directoryDoc
#'
Expand Down
7 changes: 6 additions & 1 deletion man/addCodelistAttribute.Rd

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

8 changes: 7 additions & 1 deletion man/codelistDiagnostics.Rd

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

8 changes: 7 additions & 1 deletion man/cohortDiagnostics.Rd

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

6 changes: 5 additions & 1 deletion man/databaseDiagnostics.Rd

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

12 changes: 11 additions & 1 deletion man/matchedDiagnostics.Rd

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

9 changes: 8 additions & 1 deletion man/phenotypeDiagnostics.Rd

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

7 changes: 5 additions & 2 deletions man/populationDiagnostics.Rd

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

9 changes: 8 additions & 1 deletion man/shinyDiagnostics.Rd

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

0 comments on commit a5ffb92

Please sign in to comment.