matchedDiagnostics {PhenotypeR} | R Documentation |
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
matchedDiagnostics(cohort, matchedSample = 1000)
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. |
A summarised result
cdm_local <- omock::mockCdmReference() |>
omock::mockPerson(nPerson = 100) |>
omock::mockObservationPeriod() |>
omock::mockConditionOccurrence() |>
omock::mockDrugExposure() |>
omock::mockObservation() |>
omock::mockMeasurement() |>
omock::mockVisitOccurrence() |>
omock::mockProcedureOccurrence() |>
omock::mockCohort(name = "my_cohort")
db <- DBI::dbConnect(duckdb::duckdb())
cdm <- CDMConnector::copyCdmTo(con = db,
cdm = cdm_local,
schema ="main",
overwrite = TRUE)
result <- cdm$my_cohort |> matchedDiagnostics()
CDMConnector::cdm_disconnect(cdm)