Skip to contents

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

Usage

matchedDiagnostics(cohort, matchedSample = 1000)

Arguments

cohort

Cohort table in a cdm reference

matchedSample

The number of people to take a random sample for matching. If NULL, no sampling will be performed.

Value

A summarised result

Examples

# \donttest{
library(PhenotypeR)

cdm <- mockPhenotypeR()

result <- matchedDiagnostics(cdm$my_cohort)
#>  Sampling cohorts
#>  Generating a age and sex matched cohorts
#> Starting matching
#>  Creating copy of target cohort.
#>  2 cohorts to be matched.
#>  Creating controls cohorts.
#>  Excluding cases from controls
#>  Matching by gender_concept_id and year_of_birth
#>  Removing controls that were not in observation at index date
#>  Excluding target records whose pair is not in observation
#>  Adjusting ratio
#> Binding cohorts
#>  Done
#>  Index matched cohort table
#>  adding demographics columns
#>  adding tableIntersectCount 1/1
#>  summarising data
#>  summariseCharacteristics finished!
#>  Getting age density
#>  Running large scale characterisation
#>  Summarising large scale characteristics 
#> 
#>  - getting characteristics from table condition_occurrence (1 of 6)
#>  - getting characteristics from table visit_occurrence (2 of 6)
#>  - getting characteristics from table measurement (3 of 6)
#>  - getting characteristics from table procedure_occurrence (4 of 6)
#>  - getting characteristics from table observation (5 of 6)
#>  - getting characteristics from table drug_exposure (6 of 6)

CDMConnector::cdmDisconnect(cdm = cdm)
# }