% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/databaseDiagnostics.R
\name{databaseDiagnostics}
\alias{databaseDiagnostics}
\title{Database diagnostics}
\usage{
databaseDiagnostics(
  cohort,
  cohortId = NULL,
  snapshot = TRUE,
  personTableSummary = TRUE,
  observationPeriodsSummary = TRUE,
  clinicalRecordsSummary = TRUE
)
}
\arguments{
\item{cohort}{Cohort table in a cdm reference}

\item{cohortId}{Specific cohort definition ID for which to run database
diagnostics. This will only affect the clinical tables summary results.}

\item{snapshot}{Whether to run `OmopSketch::summariseOmopSnapshot()` (TRUE) or not (FALSE).}

\item{personTableSummary}{Whether to run `OmopSketch::summarisePerson()` (TRUE) or not (FALSE).}

\item{observationPeriodsSummary}{Whether to run `OmopSketch::summariseObservationPeriod()` (TRUE) or not (FALSE).}

\item{clinicalRecordsSummary}{Whether to run `OmopSketch::summariseClinicalRecords()` on those clinical
tables where the codes associated with your cohort are found (TRUE) or not (FALSE).}
}
\value{
A summarised result
}
\description{
PhenotypeR diagnostics on the cdm object.

Diagnostics include:
\itemize{
  \item Summarise a cdm_reference object, creating a snapshot with the metadata of the cdm_reference object
  \item Summarise the observation period table getting some overall statistics in a summarised_result object.
  \item Summarise the person table including demographics (sex, race, ethnicity, year of birth) and related statistics.
  \item Summarise the OMOP clinical tables where the codes associated with your cohort are found.
}
}
\examples{
\donttest{
library(omock)
library(PhenotypeR)
library(CohortConstructor)
library(CDMConnector)

cdm <- mockCdmFromDataset(source = "duckdb")

cdm$new_cohort <- conceptCohort(cdm,
                                conceptSet = list("codes" = c(40213201L, 4336464L)),
                                name = "new_cohort")

 result <- databaseDiagnostics(cohort = cdm$new_cohort)

 cdmDisconnect(cdm = cdm)
}
}
