From b2af1cd36390ab1dbda7f8d09dfd526150c381f6 Mon Sep 17 00:00:00 2001 From: edward-burn <9583964+edward-burn@users.noreply.github.com> Date: Mon, 3 Feb 2025 16:05:33 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20OHDSI/Ph?= =?UTF-8?q?enotypeR@f45065818e86500be38502564f214f7c03871cb8=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- articles/a02_CodelistDiagnostics.html | 10 +++++----- pkgdown.yml | 2 +- reference/cohortDiagnostics.html | 4 ++-- reference/phenotypeDiagnostics.html | 8 ++++---- reference/populationDiagnostics.html | 2 +- reference/shinyDiagnostics.html | 6 +++--- search.json | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/articles/a02_CodelistDiagnostics.html b/articles/a02_CodelistDiagnostics.html index 99f53e8..3366a25 100644 --- a/articles/a02_CodelistDiagnostics.html +++ b/articles/a02_CodelistDiagnostics.html @@ -98,11 +98,11 @@

Introductionglimpse() #> Rows: ?? #> Columns: 4 -#> Database: DuckDB v1.1.3 [unknown@Linux 6.8.0-1020-azure:R 4.4.2//tmp/RtmpVD6DtE/file2aac16f8fc34.duckdb] -#> $ cohort_definition_id <int> 1, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2… -#> $ subject_id <int> 191, 321, 1025, 1779, 1791, 2980, 4279, 4274, 516… -#> $ cohort_start_date <date> 1994-05-07, 1996-06-30, 1941-04-18, 1955-03-23, … -#> $ cohort_end_date <date> 1994-08-05, 1996-07-21, 1941-05-16, 1955-04-06, … +#> Database: DuckDB v1.1.3 [unknown@Linux 6.8.0-1020-azure:R 4.4.2//tmp/RtmpmyQLfI/file2ab1bd75389.duckdb] +#> $ cohort_definition_id <int> 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 1, 2… +#> $ subject_id <int> 3694, 474, 1021, 1021, 1397, 1966, 2226, 3440, 35… +#> $ cohort_start_date <date> 1972-12-21, 1982-12-02, 1976-06-29, 1992-09-24, … +#> $ cohort_end_date <date> 1973-01-20, 1982-12-16, 1976-07-20, 1992-10-15, …

Summarising code use diff --git a/pkgdown.yml b/pkgdown.yml index dc41a9a..791cc25 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -7,7 +7,7 @@ articles: a03_CohortDiagnostics: a03_CohortDiagnostics.html a04_MatchedDiagnostics: a04_MatchedDiagnostics.html a05_PopulationDiagnostics: a05_PopulationDiagnostics.html -last_built: 2025-02-03T15:46Z +last_built: 2025-02-03T15:57Z urls: reference: https://ohdsi.github.io/PhenotypeR/reference article: https://ohdsi.github.io/PhenotypeR/articles diff --git a/reference/cohortDiagnostics.html b/reference/cohortDiagnostics.html index 312b331..2f3584b 100644 --- a/reference/cohortDiagnostics.html +++ b/reference/cohortDiagnostics.html @@ -98,8 +98,8 @@

Examples#> days_between_cohort_entries: median, q25, q75, min, max, density #> ! Table is collected to memory as not all requested estimates are supported on #> the database side -#> → Start summary of data, at 2025-02-03 15:47:11.002596 -#> Summary finished, at 2025-02-03 15:47:11.100706 +#> → Start summary of data, at 2025-02-03 15:58:21.932025 +#> Summary finished, at 2025-02-03 15:58:22.017751 CDMConnector::cdmDisconnect(cdm = cdm) # } diff --git a/reference/phenotypeDiagnostics.html b/reference/phenotypeDiagnostics.html index 4a83fba..2c4f312 100644 --- a/reference/phenotypeDiagnostics.html +++ b/reference/phenotypeDiagnostics.html @@ -156,15 +156,15 @@

Examples#> days_between_cohort_entries: median, q25, q75, min, max, density #> ! Table is collected to memory as not all requested estimates are supported on #> the database side -#> → Start summary of data, at 2025-02-03 15:49:08.333273 -#> Summary finished, at 2025-02-03 15:49:08.435682 +#> → Start summary of data, at 2025-02-03 16:00:17.52025 +#> Summary finished, at 2025-02-03 16:00:17.610323 #> #> Creating denominator for incidence and prevalence #> Sampling person table to 1e+06 #> Creating denominator cohorts #> ! cohort columns will be reordered to match the expected order: #> cohort_definition_id, subject_id, cohort_start_date, and cohort_end_date. -#> Cohorts created in 0 min and 6 sec +#> Cohorts created in 0 min and 5 sec #> Estimating incidence #> Getting incidence for analysis 1 of 12 #> Getting incidence for analysis 2 of 12 @@ -178,7 +178,7 @@

Examples#> Getting incidence for analysis 10 of 12 #> Getting incidence for analysis 11 of 12 #> Getting incidence for analysis 12 of 12 -#> Overall time taken: 0 mins and 14 secs +#> Overall time taken: 0 mins and 13 secs #> Estimating prevalence #> Getting prevalence for analysis 1 of 12 #> Getting prevalence for analysis 2 of 12 diff --git a/reference/populationDiagnostics.html b/reference/populationDiagnostics.html index c2b4827..2632a35 100644 --- a/reference/populationDiagnostics.html +++ b/reference/populationDiagnostics.html @@ -115,7 +115,7 @@

Examples#> Creating denominator cohorts #> ! cohort columns will be reordered to match the expected order: #> cohort_definition_id, subject_id, cohort_start_date, and cohort_end_date. -#> Cohorts created in 0 min and 6 sec +#> Cohorts created in 0 min and 5 sec #> Estimating incidence #> Getting incidence for analysis 1 of 12 #> Getting incidence for analysis 2 of 12 diff --git a/reference/shinyDiagnostics.html b/reference/shinyDiagnostics.html index 318d4cc..3273e5e 100644 --- a/reference/shinyDiagnostics.html +++ b/reference/shinyDiagnostics.html @@ -124,15 +124,15 @@

Examples#> days_between_cohort_entries: median, q25, q75, min, max, density #> ! Table is collected to memory as not all requested estimates are supported on #> the database side -#> → Start summary of data, at 2025-02-03 15:51:56.986898 -#> Summary finished, at 2025-02-03 15:51:57.075346 +#> → Start summary of data, at 2025-02-03 16:02:56.043102 +#> Summary finished, at 2025-02-03 16:02:56.131523 #> #> Creating denominator for incidence and prevalence #> Sampling person table to 1e+06 #> Creating denominator cohorts #> ! cohort columns will be reordered to match the expected order: #> cohort_definition_id, subject_id, cohort_start_date, and cohort_end_date. -#> Cohorts created in 0 min and 6 sec +#> Cohorts created in 0 min and 5 sec #> Estimating incidence #> Getting incidence for analysis 1 of 12 #> Getting incidence for analysis 2 of 12 diff --git a/search.json b/search.json index f4200c0..9e1e5e7 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"Apache License","title":"Apache License","text":"Version 2.0, January 2004 ","code":""},{"path":[]},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"id_1-definitions","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"1. Definitions","title":"Apache License","text":"“License” shall mean terms conditions use, reproduction, distribution defined Sections 1 9 document. “Licensor” shall mean copyright owner entity authorized copyright owner granting License. “Legal Entity” shall mean union acting entity entities control, controlled , common control entity. purposes definition, “control” means () power, direct indirect, cause direction management entity, whether contract otherwise, (ii) ownership fifty percent (50%) outstanding shares, (iii) beneficial ownership entity. “” (“”) shall mean individual Legal Entity exercising permissions granted License. “Source” form shall mean preferred form making modifications, including limited software source code, documentation source, configuration files. “Object” form shall mean form resulting mechanical transformation translation Source form, including limited compiled object code, generated documentation, conversions media types. “Work” shall mean work authorship, whether Source Object form, made available License, indicated copyright notice included attached work (example provided Appendix ). “Derivative Works” shall mean work, whether Source Object form, based (derived ) Work editorial revisions, annotations, elaborations, modifications represent, whole, original work authorship. purposes License, Derivative Works shall include works remain separable , merely link (bind name) interfaces , Work Derivative Works thereof. “Contribution” shall mean work authorship, including original version Work modifications additions Work Derivative Works thereof, intentionally submitted Licensor inclusion Work copyright owner individual Legal Entity authorized submit behalf copyright owner. purposes definition, “submitted” means form electronic, verbal, written communication sent Licensor representatives, including limited communication electronic mailing lists, source code control systems, issue tracking systems managed , behalf , Licensor purpose discussing improving Work, excluding communication conspicuously marked otherwise designated writing copyright owner “Contribution.” “Contributor” shall mean Licensor individual Legal Entity behalf Contribution received Licensor subsequently incorporated within Work.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"id_2-grant-of-copyright-license","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"2. Grant of Copyright License","title":"Apache License","text":"Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable copyright license reproduce, prepare Derivative Works , publicly display, publicly perform, sublicense, distribute Work Derivative Works Source Object form.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"id_3-grant-of-patent-license","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"3. Grant of Patent License","title":"Apache License","text":"Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable (except stated section) patent license make, made, use, offer sell, sell, import, otherwise transfer Work, license applies patent claims licensable Contributor necessarily infringed Contribution(s) alone combination Contribution(s) Work Contribution(s) submitted. institute patent litigation entity (including cross-claim counterclaim lawsuit) alleging Work Contribution incorporated within Work constitutes direct contributory patent infringement, patent licenses granted License Work shall terminate date litigation filed.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"id_4-redistribution","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"4. Redistribution","title":"Apache License","text":"may reproduce distribute copies Work Derivative Works thereof medium, without modifications, Source Object form, provided meet following conditions: () must give recipients Work Derivative Works copy License; (b) must cause modified files carry prominent notices stating changed files; (c) must retain, Source form Derivative Works distribute, copyright, patent, trademark, attribution notices Source form Work, excluding notices pertain part Derivative Works; (d) Work includes “NOTICE” text file part distribution, Derivative Works distribute must include readable copy attribution notices contained within NOTICE file, excluding notices pertain part Derivative Works, least one following places: within NOTICE text file distributed part Derivative Works; within Source form documentation, provided along Derivative Works; , within display generated Derivative Works, wherever third-party notices normally appear. contents NOTICE file informational purposes modify License. may add attribution notices within Derivative Works distribute, alongside addendum NOTICE text Work, provided additional attribution notices construed modifying License. may add copyright statement modifications may provide additional different license terms conditions use, reproduction, distribution modifications, Derivative Works whole, provided use, reproduction, distribution Work otherwise complies conditions stated License.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"id_5-submission-of-contributions","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"5. Submission of Contributions","title":"Apache License","text":"Unless explicitly state otherwise, Contribution intentionally submitted inclusion Work Licensor shall terms conditions License, without additional terms conditions. Notwithstanding , nothing herein shall supersede modify terms separate license agreement may executed Licensor regarding Contributions.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"id_6-trademarks","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"6. Trademarks","title":"Apache License","text":"License grant permission use trade names, trademarks, service marks, product names Licensor, except required reasonable customary use describing origin Work reproducing content NOTICE file.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"id_7-disclaimer-of-warranty","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"7. Disclaimer of Warranty","title":"Apache License","text":"Unless required applicable law agreed writing, Licensor provides Work (Contributor provides Contributions) “” BASIS, WITHOUT WARRANTIES CONDITIONS KIND, either express implied, including, without limitation, warranties conditions TITLE, NON-INFRINGEMENT, MERCHANTABILITY, FITNESS PARTICULAR PURPOSE. solely responsible determining appropriateness using redistributing Work assume risks associated exercise permissions License.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"id_8-limitation-of-liability","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"8. Limitation of Liability","title":"Apache License","text":"event legal theory, whether tort (including negligence), contract, otherwise, unless required applicable law (deliberate grossly negligent acts) agreed writing, shall Contributor liable damages, including direct, indirect, special, incidental, consequential damages character arising result License use inability use Work (including limited damages loss goodwill, work stoppage, computer failure malfunction, commercial damages losses), even Contributor advised possibility damages.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"id_9-accepting-warranty-or-additional-liability","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"9. Accepting Warranty or Additional Liability","title":"Apache License","text":"redistributing Work Derivative Works thereof, may choose offer, charge fee , acceptance support, warranty, indemnity, liability obligations /rights consistent License. However, accepting obligations, may act behalf sole responsibility, behalf Contributor, agree indemnify, defend, hold Contributor harmless liability incurred , claims asserted , Contributor reason accepting warranty additional liability. END TERMS CONDITIONS","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"appendix-how-to-apply-the-apache-license-to-your-work","dir":"","previous_headings":"","what":"APPENDIX: How to apply the Apache License to your work","title":"Apache License","text":"apply Apache License work, attach following boilerplate notice, fields enclosed brackets [] replaced identifying information. (Don’t include brackets!) text enclosed appropriate comment syntax file format. also recommend file class name description purpose included “printed page” copyright notice easier identification within third-party archives.","code":"Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License."},{"path":"https://ohdsi.github.io/PhenotypeR/articles/a02_CodelistDiagnostics.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Codelist diagnostics","text":"example ’re going summarise characteristics individuals ankle sprain, ankle fracture, forearm fracture, hip fracture using Eunomia synthetic data. ’ll begin creating study cohorts.","code":"library(CDMConnector) library(CohortConstructor) library(CodelistGenerator) library(PhenotypeR) library(dplyr) library(ggplot2) con <- DBI::dbConnect(duckdb::duckdb(), dbdir = CDMConnector::eunomiaDir() ) cdm <- CDMConnector::cdmFromCon(con, cdmSchema = \"main\", writeSchema = \"main\", cdmName = \"Eunomia\" ) cdm$injuries <- conceptCohort(cdm = cdm, conceptSet = list( \"ankle_sprain\" = 81151, \"ankle_fracture\" = 4059173, \"forearm_fracture\" = 4278672, \"hip_fracture\" = 4230399 ), name = \"injuries\") cdm$injuries |> glimpse() #> Rows: ?? #> Columns: 4 #> Database: DuckDB v1.1.3 [unknown@Linux 6.8.0-1020-azure:R 4.4.2//tmp/RtmpVD6DtE/file2aac16f8fc34.duckdb] #> $ cohort_definition_id 1, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2… #> $ subject_id 191, 321, 1025, 1779, 1791, 2980, 4279, 4274, 516… #> $ cohort_start_date 1994-05-07, 1996-06-30, 1941-04-18, 1955-03-23, … #> $ cohort_end_date 1994-08-05, 1996-07-21, 1941-05-16, 1955-04-06, …"},{"path":"https://ohdsi.github.io/PhenotypeR/articles/a02_CodelistDiagnostics.html","id":"summarising-code-use","dir":"Articles","previous_headings":"","what":"Summarising code use","title":"Codelist diagnostics","text":"","code":"code_diag <- codelistDiagnostics(cdm$injuries) #tableCohortCodeUse(code_diag)"},{"path":"https://ohdsi.github.io/PhenotypeR/articles/a03_CohortDiagnostics.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Cohort diagnostics","text":"example ’re going summarise cohort diagnostics results cohorts individuals ankle sprain, ankle fracture, forearm fracture, hip fracture using Eunomia synthetic data. , ’ll begin creating study cohorts.","code":"library(CDMConnector) library(CohortConstructor) library(CodelistGenerator) library(PatientProfiles) library(CohortCharacteristics) library(PhenotypeR) library(dplyr) library(ggplot2) con <- DBI::dbConnect(duckdb::duckdb(), dbdir = CDMConnector::eunomiaDir() ) cdm <- CDMConnector::cdmFromCon(con, cdmSchema = \"main\", writeSchema = \"main\", cdmName = \"Eunomia\" ) cdm$injuries <- conceptCohort(cdm = cdm, conceptSet = list( \"ankle_sprain\" = 81151, \"ankle_fracture\" = 4059173, \"forearm_fracture\" = 4278672, \"hip_fracture\" = 4230399 ), name = \"injuries\")"},{"path":"https://ohdsi.github.io/PhenotypeR/articles/a03_CohortDiagnostics.html","id":"cohort-diagnostics","dir":"Articles","previous_headings":"","what":"Cohort diagnostics","title":"Cohort diagnostics","text":"can run cohort diagnostics analyses overall cohorts like : results include summary overlap cohorts. visualise Moreover, results also include summary characteristics cohort, stratified age group sex. can also visualise age distribution:","code":"cohort_diag <- cohortDiagnostics(cdm$injuries) plotCohortOverlap(cohort_diag, uniqueCombinations = TRUE) tableCharacteristics(cohort_diag, groupColumn = c(\"age_group\", \"sex\")) tableCharacteristics(cohort_diag, groupColumn = c(\"age_group\", \"sex\"))"},{"path":"https://ohdsi.github.io/PhenotypeR/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Edward Burn. Author, maintainer. Marti Catala. Author. Xihang Chen. Author. Marta Alcalde-Herraiz. Author. Albert Prats-Uribe. Author.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Burn E, Catala M, Chen X, Alcalde-Herraiz M, Prats-Uribe (2025). PhenotypeR: Assess Study Cohorts Using Common Data Model. R package version 0.1.1.900, https://ohdsi.github.io/PhenotypeR/.","code":"@Manual{, title = {PhenotypeR: Assess Study Cohorts Using a Common Data Model}, author = {Edward Burn and Marti Catala and Xihang Chen and Marta Alcalde-Herraiz and Albert Prats-Uribe}, year = {2025}, note = {R package version 0.1.1.900}, url = {https://ohdsi.github.io/PhenotypeR/}, }"},{"path":"https://ohdsi.github.io/PhenotypeR/index.html","id":"phenotyper-","dir":"","previous_headings":"","what":"Assess Study Cohorts Using a Common Data Model","title":"Assess Study Cohorts Using a Common Data Model","text":"PhenotypeR package helps us assess research-readiness set cohorts defined. assessment includes: Database diagnostics help us better understand database created. includes information size data, time period covered, number people data whole. granular information may influence analytic decisions, number observation periods per person, also described. Codelist diagnostics help answer questions like concepts codelist used database? concepts present led individuals’ entry cohort? concepts used database didn’t include codelist maybe ? Cohort diagnostics help answer questions like many individuals include cohort many excluded inclusion criteria? multiple cohorts, overlap people enter one cohort relative another? incidence cohort entry prevalence cohort database? Matched diagnostics compares study cohorts overall population database. matching people cohorts people similar age sex database can see cohorts differ general database population. Population diagnostics estimates frequency study cohorts database terms incidence rates prevalence.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Assess Study Cohorts Using a Common Data Model","text":"can install PhenotypeR CRAN: can install development version GitHub:","code":"install.packages(\"PhenotypeR\") # install.packages(\"remotes\") remotes::install_github(\"OHDSI/PhenotypeR\")"},{"path":"https://ohdsi.github.io/PhenotypeR/index.html","id":"example-usage","dir":"","previous_headings":"","what":"Example usage","title":"Assess Study Cohorts Using a Common Data Model","text":"illustrate functionality PhenotypeR, let’s create cohort using Eunomia Synpuf dataset. ’ll first load required packages create cdm reference data. Note ’ve included achilles results cdm reference. can ’ll use precomputed counts speed analysis. can easily run analyses explained (database diagnostics, codelist diagnostics, cohort diagnostics, matched diagnostics, population diagnostics) using phenotypeDiagnostics(): can see results generated like : results can quickly view interactive application. shiny app saved new directory can customised using directory input. See shiny app generated example cohort .","code":"library(dplyr) library(CohortConstructor) library(PhenotypeR) # Connect to the database and create the cdm object con <- DBI::dbConnect(duckdb::duckdb(), CDMConnector::eunomiaDir(\"synpuf-1k\", \"5.3\")) cdm <- CDMConnector::cdmFromCon(con = con, cdmName = \"Eunomia Synpuf\", cdmSchema = \"main\", writeSchema = \"main\", achillesSchema = \"main\") cdm #> #> ── # OMOP CDM reference (duckdb) of Eunomia Synpuf ───────────────────────────── #> • omop tables: person, observation_period, visit_occurrence, visit_detail, #> condition_occurrence, drug_exposure, procedure_occurrence, device_exposure, #> measurement, observation, death, note, note_nlp, specimen, fact_relationship, #> location, care_site, provider, payer_plan_period, cost, drug_era, dose_era, #> condition_era, metadata, cdm_source, concept, vocabulary, domain, #> concept_class, concept_relationship, relationship, concept_synonym, #> concept_ancestor, source_to_concept_map, drug_strength, cohort_definition, #> attribute_definition #> • cohort tables: - #> • achilles tables: achilles_analysis, achilles_results, achilles_results_dist #> • other tables: - # Create a code lists codes <- list(\"warfarin\" = c(1310149, 40163554), \"acetaminophen\" = c(1125315, 1127078, 1127433, 40229134, 40231925, 40162522, 19133768), \"morphine\" = c(1110410, 35605858, 40169988)) # Instantiate cohorts with CohortConstructor cdm$my_cohort <- conceptCohort(cdm = cdm, conceptSet = codes, exit = \"event_end_date\", overlap = \"merge\", name = \"my_cohort\") result <- phenotypeDiagnostics(cdm$my_cohort) result |> settings() |> pull(\"result_type\") |> unique() #> [1] \"summarise_omop_snapshot\" #> [2] \"summarise_observation_period\" #> [3] \"cohort_code_use\" #> [4] \"achilles_code_use\" #> [5] \"orphan_code_use\" #> [6] \"summarise_characteristics\" #> [7] \"summarise_table\" #> [8] \"summarise_cohort_attrition\" #> [9] \"summarise_cohort_overlap\" #> [10] \"summarise_cohort_timing\" #> [11] \"incidence\" #> [12] \"incidence_attrition\" #> [13] \"prevalence\" #> [14] \"prevalence_attrition\" #> [15] \"summarise_large_scale_characteristics\" shinyDiagnostics(result = result, minCellCount = 10, directory = tempdir())"},{"path":"https://ohdsi.github.io/PhenotypeR/index.html","id":"more-information","dir":"","previous_headings":"Example usage","what":"More information","title":"Assess Study Cohorts Using a Common Data Model","text":"see details regarding one analyses, please refer package vignettes.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/PhenotypeR-package.html","id":null,"dir":"Reference","previous_headings":"","what":"PhenotypeR: Assess Study Cohorts Using a Common Data Model — PhenotypeR-package","title":"PhenotypeR: Assess Study Cohorts Using a Common Data Model — PhenotypeR-package","text":"Phenotype study cohorts data mapped Observational Medical Outcomes Partnership Common Data Model. Diagnostics run database, code list, cohort, population level assess whether study cohorts ready research.","code":""},{"path":[]},{"path":"https://ohdsi.github.io/PhenotypeR/reference/PhenotypeR-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"PhenotypeR: Assess Study Cohorts Using a Common Data Model — PhenotypeR-package","text":"Maintainer: Edward Burn edward.burn@ndorms.ox.ac.uk (ORCID) Authors: Marti Catala marti.catalasabate@ndorms.ox.ac.uk (ORCID) Xihang Chen xihang.chen@ndorms.ox.ac.uk (ORCID) Marta Alcalde-Herraiz marta.alcaldeherraiz@ndorms.ox.ac.uk (ORCID) Albert Prats-Uribe albert.prats-uribe@ndorms.ox.ac.uk (ORCID)","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/addCodelistAttribute.html","id":null,"dir":"Reference","previous_headings":"","what":"Adds the cohort_codelist attribute to a cohort — addCodelistAttribute","title":"Adds the cohort_codelist attribute to a cohort — addCodelistAttribute","text":"`addCodelistAttribute()` allows users add codelist cohort OMOP CDM. particularly important use `codelistDiagnostics()`, underlying assumption cohort fed `codelistDiagnostics()` cohort_codelist attribute attached .","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/addCodelistAttribute.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Adds the cohort_codelist attribute to a cohort — addCodelistAttribute","text":"","code":"addCodelistAttribute(cohort, codelist, cohortName = names(codelist))"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/addCodelistAttribute.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Adds the cohort_codelist attribute to a cohort — addCodelistAttribute","text":"cohort Cohort table cdm reference codelist Named list concepts cohortName element codelist, name cohort `cohort` codelist refers","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/addCodelistAttribute.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Adds the cohort_codelist attribute to a cohort — addCodelistAttribute","text":"cohort","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/addCodelistAttribute.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Adds the cohort_codelist attribute to a cohort — addCodelistAttribute","text":"","code":"# \\donttest{ library(PhenotypeR) cdm <- mockPhenotypeR() #> Note: method with signature ‘DBIConnection#Id’ chosen for function ‘dbExistsTable’, #> target signature ‘duckdb_connection#Id’. #> \"duckdb_connection#ANY\" would also be valid cohort <- addCodelistAttribute(cohort = cdm$my_cohort, codelist = list(\"cohort_1\" = 1L)) attr(cohort, \"cohort_codelist\") #> # Source: table [?? x 4] #> # Database: DuckDB v1.1.3 [unknown@Linux 6.8.0-1020-azure:R 4.4.2/:memory:] #> cohort_definition_id codelist_name concept_id type #> #> 1 1 cohort_1 1 index event CDMConnector::cdmDisconnect(cdm) # }"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/codelistDiagnostics.html","id":null,"dir":"Reference","previous_headings":"","what":"Run codelist-level diagnostics — codelistDiagnostics","title":"Run codelist-level diagnostics — codelistDiagnostics","text":"`codelistDiagnostics()` runs phenotypeR diagnostics cohort_codelist attribute cohort. Thus codelist attribute cohort must populated. missing populated using `addCodelistAttribute()` function. Furthermore `codelistDiagnostics()` requires achilles tables present cdm concept counts derived.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/codelistDiagnostics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run codelist-level diagnostics — codelistDiagnostics","text":"","code":"codelistDiagnostics(cohort)"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/codelistDiagnostics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run codelist-level diagnostics — codelistDiagnostics","text":"cohort cohort table cdm reference. cohort_codelist attribute must populated. cdm reference must contain achilles tables used deriving concept counts.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/codelistDiagnostics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Run codelist-level diagnostics — codelistDiagnostics","text":"summarised result","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/codelistDiagnostics.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Run codelist-level diagnostics — codelistDiagnostics","text":"","code":"# \\donttest{ library(CohortConstructor) library(PhenotypeR) cdm <- mockPhenotypeR() cdm$arthropathies <- conceptCohort(cdm, conceptSet = list(\"arthropathies\" = c(40475132)), name = \"arthropathies\") #> Warning: ! `codelist` contains numeric values, they are casted to integers. #> ℹ Subsetting table condition_occurrence using 1 concept with domain: condition. #> ℹ No cohort entries found, returning empty cohort table. result <- codelistDiagnostics(cdm$arthropathies) #> • Getting codelists from cohorts #> • Getting index event breakdown #> Getting counts of arthropathies codes for cohort arthropathies #> ℹ No records found in the cdm for the concepts provided. #> Warning: The CDM reference containing the cohort must also contain achilles tables. #> Returning only index event breakdown. CDMConnector::cdmDisconnect(cdm = cdm) # }"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/cohortDiagnostics.html","id":null,"dir":"Reference","previous_headings":"","what":"Run cohort-level diagnostics — cohortDiagnostics","title":"Run cohort-level diagnostics — cohortDiagnostics","text":"Runs phenotypeR diagnostics cohort. diganostics include: * Age groups sex summarised. * summary visits everyone cohort using visit_occurrence table. * summary age sex density cohort. * Attritions cohorts. * Overlap cohorts (one cohort used).","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/cohortDiagnostics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run cohort-level diagnostics — cohortDiagnostics","text":"","code":"cohortDiagnostics(cohort)"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/cohortDiagnostics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run cohort-level diagnostics — cohortDiagnostics","text":"cohort Cohort table cdm reference","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/cohortDiagnostics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Run cohort-level diagnostics — cohortDiagnostics","text":"summarised result","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/cohortDiagnostics.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Run cohort-level diagnostics — cohortDiagnostics","text":"","code":"# \\donttest{ library(PhenotypeR) cdm <- mockPhenotypeR() result <- cohortDiagnostics(cdm$my_cohort) #> • Index cohort table #> • Getting cohort summary #> ℹ adding demographics columns #> ℹ adding tableIntersectCount 1/1 #> ℹ summarising data #> ✔ summariseCharacteristics finished! #> • Getting age density #> • Getting cohort attrition #> • Getting cohort overlap #> • Getting cohort timing #> ℹ The following estimates will be computed: #> • days_between_cohort_entries: median, q25, q75, min, max, density #> ! Table is collected to memory as not all requested estimates are supported on #> the database side #> → Start summary of data, at 2025-02-03 15:47:11.002596 #> ✔ Summary finished, at 2025-02-03 15:47:11.100706 CDMConnector::cdmDisconnect(cdm = cdm) # }"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/cohortDoc.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper for consistent documentation of `cohort`. — cohortDoc","title":"Helper for consistent documentation of `cohort`. — cohortDoc","text":"Helper consistent documentation `cohort`.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/cohortDoc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper for consistent documentation of `cohort`. — cohortDoc","text":"cohort Cohort table cdm reference","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/databaseDiagnostics.html","id":null,"dir":"Reference","previous_headings":"","what":"Database diagnostics — databaseDiagnostics","title":"Database diagnostics — databaseDiagnostics","text":"phenotypeR diagnostics cdm object. Diagnostics include: * Summarise cdm_reference object, creating snapshot metadata cdm_reference object. * Summarise observation period table getting overall statistics summarised_result object.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/databaseDiagnostics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Database diagnostics — databaseDiagnostics","text":"","code":"databaseDiagnostics(cdm)"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/databaseDiagnostics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Database diagnostics — databaseDiagnostics","text":"cdm CDM reference","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/databaseDiagnostics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Database diagnostics — databaseDiagnostics","text":"summarised result","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/databaseDiagnostics.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Database diagnostics — databaseDiagnostics","text":"","code":"# \\donttest{ library(PhenotypeR) cdm <- mockPhenotypeR() result <- databaseDiagnostics(cdm) CDMConnector::cdmDisconnect(cdm = cdm) # }"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/directoryDoc.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper for consistent documentation of `directory`. — directoryDoc","title":"Helper for consistent documentation of `directory`. — directoryDoc","text":"Helper consistent documentation `directory`.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/directoryDoc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper for consistent documentation of `directory`. — directoryDoc","text":"directory Directory save report","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/matchedDiagnostics.html","id":null,"dir":"Reference","previous_headings":"","what":"Compare characteristics of cohort matched to database population — matchedDiagnostics","title":"Compare characteristics of cohort matched to database population — matchedDiagnostics","text":"summary cohort matched original cohort given user. summary contains basic cohort summary including number visits within one year prior cohort_start_date, well large scale charactersitics using following domians OMOP CDM: * condition_occurrence * visit_occurrence * measurement * procedure_occurrence * observation * drug_exposure","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/matchedDiagnostics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compare characteristics of cohort matched to database population — matchedDiagnostics","text":"","code":"matchedDiagnostics(cohort, matchedSample = 1000)"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/matchedDiagnostics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compare characteristics of cohort matched to database population — matchedDiagnostics","text":"cohort Cohort table cdm reference matchedSample number people take random sample matching. NULL, sampling performed.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/matchedDiagnostics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compare characteristics of cohort matched to database population — matchedDiagnostics","text":"summarised result","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/matchedDiagnostics.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compare characteristics of cohort matched to database population — matchedDiagnostics","text":"","code":"# \\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) # }"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/matchedSampleDoc.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper for consistent documentation of `matchedSample`. — matchedSampleDoc","title":"Helper for consistent documentation of `matchedSample`. — matchedSampleDoc","text":"Helper consistent documentation `matchedSample`.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/matchedSampleDoc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper for consistent documentation of `matchedSample`. — matchedSampleDoc","text":"matchedSample number people take random sample matching. NULL, sampling performed.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/mockPhenotypeR.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to create a mock cdm reference for mockPhenotypeR — mockPhenotypeR","title":"Function to create a mock cdm reference for mockPhenotypeR — mockPhenotypeR","text":"`mockPhenotypeR()` creates example dataset can used show package works","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/mockPhenotypeR.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to create a mock cdm reference for mockPhenotypeR — mockPhenotypeR","text":"","code":"mockPhenotypeR( nPerson = 100, con = DBI::dbConnect(duckdb::duckdb()), writeSchema = \"main\", seed = 111 )"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/mockPhenotypeR.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to create a mock cdm reference for mockPhenotypeR — mockPhenotypeR","text":"nPerson number people cdm. con DBI connection create cdm mock object. writeSchema Name schema connection writing permissions. seed seed use creating mock data.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/mockPhenotypeR.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function to create a mock cdm reference for mockPhenotypeR — mockPhenotypeR","text":"cdm object","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/mockPhenotypeR.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Function to create a mock cdm reference for mockPhenotypeR — mockPhenotypeR","text":"","code":"# \\donttest{ library(PhenotypeR) cdm <- mockPhenotypeR() cdm #> #> ── # OMOP CDM reference (duckdb) of mock database ────────────────────────────── #> • omop tables: person, observation_period, cdm_source, concept, vocabulary, #> concept_relationship, concept_synonym, concept_ancestor, drug_strength, #> condition_occurrence, visit_occurrence, drug_exposure, observation, #> measurement, procedure_occurrence #> • cohort tables: my_cohort #> • achilles tables: - #> • other tables: - # }"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/phenotypeDiagnostics.html","id":null,"dir":"Reference","previous_headings":"","what":"Phenotype a cohort — phenotypeDiagnostics","title":"Phenotype a cohort — phenotypeDiagnostics","text":"comprises diagnostics offered package, includes: * diagnostics database via `databaseDiagnostics`. * diagnostics cohort_codelist attribute cohort via `codelistDiagnostics`. * diagnostics cohort via `cohortDiagnostics`. * diagnostics population via `populationDiagnostics`. * diagnostics matched cohort via `matchedDiagnostics`.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/phenotypeDiagnostics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Phenotype a cohort — phenotypeDiagnostics","text":"","code":"phenotypeDiagnostics( cohort, databaseDiagnostics = TRUE, codelistDiagnostics = TRUE, cohortDiagnostics = TRUE, populationDiagnostics = TRUE, populationSample = 1e+06, populationDateRange = as.Date(c(NA, NA)), matchedDiagnostics = TRUE, matchedSample = 1000 )"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/phenotypeDiagnostics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Phenotype a cohort — phenotypeDiagnostics","text":"cohort Cohort table cdm reference databaseDiagnostics TRUE, database diagnostics run. codelistDiagnostics TRUE, codelist diagnostics run. cohortDiagnostics TRUE, cohort diagnostics run. populationDiagnostics TRUE, population diagnostics run. populationSample Number people cdm sample. NULL sampling performed populationDateRange Two dates. first indicating earliest cohort start date second indicating latest possible cohort end date. NULL first date set missing, earliest observation_start_date observation_period table used former. NULL second date set missing, latest observation_end_date observation_period table used latter. matchedDiagnostics TRUE, cohort population diagnostics run. matchedSample number people take random sample matching. NULL, sampling performed.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/phenotypeDiagnostics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Phenotype a cohort — phenotypeDiagnostics","text":"summarised result","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/phenotypeDiagnostics.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Phenotype a cohort — phenotypeDiagnostics","text":"","code":"# \\donttest{ library(PhenotypeR) cdm <- mockPhenotypeR() result <- phenotypeDiagnostics(cdm$my_cohort) #> #> #> • Getting codelists from cohorts #> Warning: No codelists found for the specified cohorts #> Warning: No codelists found for the specified cohorts #> Warning: Empty cohort_codelist attribute for cohort #> ℹ Returning an empty summarised result #> #> • Index cohort table #> • Getting cohort summary #> ℹ adding demographics columns #> ℹ adding tableIntersectCount 1/1 #> ℹ summarising data #> ✔ summariseCharacteristics finished! #> • Getting age density #> • Getting cohort attrition #> • Getting cohort overlap #> • Getting cohort timing #> ℹ The following estimates will be computed: #> • days_between_cohort_entries: median, q25, q75, min, max, density #> ! Table is collected to memory as not all requested estimates are supported on #> the database side #> → Start summary of data, at 2025-02-03 15:49:08.333273 #> ✔ Summary finished, at 2025-02-03 15:49:08.435682 #> #> • Creating denominator for incidence and prevalence #> • Sampling person table to 1e+06 #> ℹ Creating denominator cohorts #> ! cohort columns will be reordered to match the expected order: #> cohort_definition_id, subject_id, cohort_start_date, and cohort_end_date. #> ✔ Cohorts created in 0 min and 6 sec #> • Estimating incidence #> ℹ Getting incidence for analysis 1 of 12 #> ℹ Getting incidence for analysis 2 of 12 #> ℹ Getting incidence for analysis 3 of 12 #> ℹ Getting incidence for analysis 4 of 12 #> ℹ Getting incidence for analysis 5 of 12 #> ℹ Getting incidence for analysis 6 of 12 #> ℹ Getting incidence for analysis 7 of 12 #> ℹ Getting incidence for analysis 8 of 12 #> ℹ Getting incidence for analysis 9 of 12 #> ℹ Getting incidence for analysis 10 of 12 #> ℹ Getting incidence for analysis 11 of 12 #> ℹ Getting incidence for analysis 12 of 12 #> ✔ Overall time taken: 0 mins and 14 secs #> • Estimating prevalence #> ℹ Getting prevalence for analysis 1 of 12 #> ℹ Getting prevalence for analysis 2 of 12 #> ℹ Getting prevalence for analysis 3 of 12 #> ℹ Getting prevalence for analysis 4 of 12 #> ℹ Getting prevalence for analysis 5 of 12 #> ℹ Getting prevalence for analysis 6 of 12 #> ℹ Getting prevalence for analysis 7 of 12 #> ℹ Getting prevalence for analysis 8 of 12 #> ℹ Getting prevalence for analysis 9 of 12 #> ℹ Getting prevalence for analysis 10 of 12 #> ℹ Getting prevalence for analysis 11 of 12 #> ℹ Getting prevalence for analysis 12 of 12 #> ✔ Time taken: 0 mins and 7 secs #> #> • 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) # }"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/pipe.html","id":null,"dir":"Reference","previous_headings":"","what":"Pipe operator — %>%","title":"Pipe operator — %>%","text":"See magrittr::%>% details.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/pipe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pipe operator — %>%","text":"","code":"lhs %>% rhs"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/pipe.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pipe operator — %>%","text":"lhs value magrittr placeholder. rhs function call using magrittr semantics.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/pipe.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pipe operator — %>%","text":"result calling `rhs(lhs)`.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/populationDiagnostics.html","id":null,"dir":"Reference","previous_headings":"","what":"Population-level diagnostics — populationDiagnostics","title":"Population-level diagnostics — populationDiagnostics","text":"phenotypeR diagnostics cohort input relation denomination population. Diagnostics include: * Incidence * Prevalence","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/populationDiagnostics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Population-level diagnostics — populationDiagnostics","text":"","code":"populationDiagnostics( cohort, populationSample = 1e+06, populationDateRange = as.Date(c(NA, NA)) )"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/populationDiagnostics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Population-level diagnostics — populationDiagnostics","text":"cohort Cohort table cdm reference populationSample Number people cdm sample. NULL sampling performed populationDateRange Two dates. first indicating earliest cohort start date second indicating latest possible cohort end date. NULL first date set missing, earliest observation_start_date observation_period table used former. NULL second date set missing, latest observation_end_date observation_period table used latter.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/populationDiagnostics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Population-level diagnostics — populationDiagnostics","text":"summarised result","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/populationDiagnostics.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Population-level diagnostics — populationDiagnostics","text":"","code":"# \\donttest{ library(PhenotypeR) library(dplyr) #> #> Attaching package: ‘dplyr’ #> The following objects are masked from ‘package:stats’: #> #> filter, lag #> The following objects are masked from ‘package:base’: #> #> intersect, setdiff, setequal, union cdm <- mockPhenotypeR() dateStart <- cdm$my_cohort |> summarise(start = min(cohort_start_date, na.rm = TRUE)) |> pull(\"start\") dateEnd <- cdm$my_cohort |> summarise(start = max(cohort_start_date, na.rm = TRUE)) |> pull(\"start\") result <- cdm$my_cohort |> populationDiagnostics(populationDateRange = c(dateStart, dateEnd)) #> • Creating denominator for incidence and prevalence #> • Sampling person table to 1e+06 #> ℹ Creating denominator cohorts #> ! cohort columns will be reordered to match the expected order: #> cohort_definition_id, subject_id, cohort_start_date, and cohort_end_date. #> ✔ Cohorts created in 0 min and 6 sec #> • Estimating incidence #> ℹ Getting incidence for analysis 1 of 12 #> ℹ Getting incidence for analysis 2 of 12 #> ℹ Getting incidence for analysis 3 of 12 #> ℹ Getting incidence for analysis 4 of 12 #> ℹ Getting incidence for analysis 5 of 12 #> ℹ Getting incidence for analysis 6 of 12 #> ℹ Getting incidence for analysis 7 of 12 #> ℹ Getting incidence for analysis 8 of 12 #> ℹ Getting incidence for analysis 9 of 12 #> ℹ Getting incidence for analysis 10 of 12 #> ℹ Getting incidence for analysis 11 of 12 #> ℹ Getting incidence for analysis 12 of 12 #> ✔ Overall time taken: 0 mins and 13 secs #> • Estimating prevalence #> ℹ Getting prevalence for analysis 1 of 12 #> ℹ Getting prevalence for analysis 2 of 12 #> ℹ Getting prevalence for analysis 3 of 12 #> ℹ Getting prevalence for analysis 4 of 12 #> ℹ Getting prevalence for analysis 5 of 12 #> ℹ Getting prevalence for analysis 6 of 12 #> ℹ Getting prevalence for analysis 7 of 12 #> ℹ Getting prevalence for analysis 8 of 12 #> ℹ Getting prevalence for analysis 9 of 12 #> ℹ Getting prevalence for analysis 10 of 12 #> ℹ Getting prevalence for analysis 11 of 12 #> ℹ Getting prevalence for analysis 12 of 12 #> ✔ Time taken: 0 mins and 7 secs CDMConnector::cdmDisconnect(cdm = cdm) # }"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/populationSampleDoc.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper for consistent documentation of `populationSample`. — populationSampleDoc","title":"Helper for consistent documentation of `populationSample`. — populationSampleDoc","text":"Helper consistent documentation `populationSample`.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/populationSampleDoc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper for consistent documentation of `populationSample`. — populationSampleDoc","text":"populationSample Number people cdm sample. NULL sampling performed populationDateRange Two dates. first indicating earliest cohort start date second indicating latest possible cohort end date. NULL first date set missing, earliest observation_start_date observation_period table used former. NULL second date set missing, latest observation_end_date observation_period table used latter.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. CodelistGenerator summariseAchillesCodeUse, summariseCodeUse, summariseCohortCodeUse, summariseOrphanCodes omopgenerics bind, exportSummarisedResult, importSummarisedResult, settings, suppress","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/resultDoc.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper for consistent documentation of `result`. — resultDoc","title":"Helper for consistent documentation of `result`. — resultDoc","text":"Helper consistent documentation `result`.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/resultDoc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper for consistent documentation of `result`. — resultDoc","text":"result summarised result","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/shinyDiagnostics.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a shiny app summarising your phenotyping results — shinyDiagnostics","title":"Create a shiny app summarising your phenotyping results — shinyDiagnostics","text":"shiny app designed diagnostics results phenotypeR, includes: * diagnostics database via `databaseDiagnostics`. * diagnostics cohort_codelist attribute cohort via `codelistDiagnostics`. * diagnostics cohort via `cohortDiagnostics`. * diagnostics population via `populationDiagnostics`. * diagnostics matched cohort via `matchedDiagnostics`.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/shinyDiagnostics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a shiny app summarising your phenotyping results — shinyDiagnostics","text":"","code":"shinyDiagnostics( result, directory, minCellCount = 5, open = rlang::is_interactive() )"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/shinyDiagnostics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a shiny app summarising your phenotyping results — shinyDiagnostics","text":"result summarised result directory Directory save report minCellCount Minimum cell count suppression exporting results. open TRUE, shiny app launched new session. FALSE, shiny app created launched.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/shinyDiagnostics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a shiny app summarising your phenotyping results — shinyDiagnostics","text":"shiny app","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/shinyDiagnostics.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a shiny app summarising your phenotyping results — shinyDiagnostics","text":"","code":"# \\donttest{ library(PhenotypeR) cdm <- mockPhenotypeR() result <- phenotypeDiagnostics(cdm$my_cohort) #> #> #> • Getting codelists from cohorts #> Warning: No codelists found for the specified cohorts #> Warning: No codelists found for the specified cohorts #> Warning: Empty cohort_codelist attribute for cohort #> ℹ Returning an empty summarised result #> #> • Index cohort table #> • Getting cohort summary #> ℹ adding demographics columns #> ℹ adding tableIntersectCount 1/1 #> ℹ summarising data #> ✔ summariseCharacteristics finished! #> • Getting age density #> • Getting cohort attrition #> • Getting cohort overlap #> • Getting cohort timing #> ℹ The following estimates will be computed: #> • days_between_cohort_entries: median, q25, q75, min, max, density #> ! Table is collected to memory as not all requested estimates are supported on #> the database side #> → Start summary of data, at 2025-02-03 15:51:56.986898 #> ✔ Summary finished, at 2025-02-03 15:51:57.075346 #> #> • Creating denominator for incidence and prevalence #> • Sampling person table to 1e+06 #> ℹ Creating denominator cohorts #> ! cohort columns will be reordered to match the expected order: #> cohort_definition_id, subject_id, cohort_start_date, and cohort_end_date. #> ✔ Cohorts created in 0 min and 6 sec #> • Estimating incidence #> ℹ Getting incidence for analysis 1 of 12 #> ℹ Getting incidence for analysis 2 of 12 #> ℹ Getting incidence for analysis 3 of 12 #> ℹ Getting incidence for analysis 4 of 12 #> ℹ Getting incidence for analysis 5 of 12 #> ℹ Getting incidence for analysis 6 of 12 #> ℹ Getting incidence for analysis 7 of 12 #> ℹ Getting incidence for analysis 8 of 12 #> ℹ Getting incidence for analysis 9 of 12 #> ℹ Getting incidence for analysis 10 of 12 #> ℹ Getting incidence for analysis 11 of 12 #> ℹ Getting incidence for analysis 12 of 12 #> ✔ Overall time taken: 0 mins and 13 secs #> • Estimating prevalence #> ℹ Getting prevalence for analysis 1 of 12 #> ℹ Getting prevalence for analysis 2 of 12 #> ℹ Getting prevalence for analysis 3 of 12 #> ℹ Getting prevalence for analysis 4 of 12 #> ℹ Getting prevalence for analysis 5 of 12 #> ℹ Getting prevalence for analysis 6 of 12 #> ℹ Getting prevalence for analysis 7 of 12 #> ℹ Getting prevalence for analysis 8 of 12 #> ℹ Getting prevalence for analysis 9 of 12 #> ℹ Getting prevalence for analysis 10 of 12 #> ℹ Getting prevalence for analysis 11 of 12 #> ℹ Getting prevalence for analysis 12 of 12 #> ✔ Time taken: 0 mins and 7 secs #> #> • 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) #> shinyDiagnostics(result, tempdir()) CDMConnector::cdmDisconnect(cdm = cdm) # }"}] +[{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"Apache License","title":"Apache License","text":"Version 2.0, January 2004 ","code":""},{"path":[]},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"id_1-definitions","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"1. Definitions","title":"Apache License","text":"“License” shall mean terms conditions use, reproduction, distribution defined Sections 1 9 document. “Licensor” shall mean copyright owner entity authorized copyright owner granting License. “Legal Entity” shall mean union acting entity entities control, controlled , common control entity. purposes definition, “control” means () power, direct indirect, cause direction management entity, whether contract otherwise, (ii) ownership fifty percent (50%) outstanding shares, (iii) beneficial ownership entity. “” (“”) shall mean individual Legal Entity exercising permissions granted License. “Source” form shall mean preferred form making modifications, including limited software source code, documentation source, configuration files. “Object” form shall mean form resulting mechanical transformation translation Source form, including limited compiled object code, generated documentation, conversions media types. “Work” shall mean work authorship, whether Source Object form, made available License, indicated copyright notice included attached work (example provided Appendix ). “Derivative Works” shall mean work, whether Source Object form, based (derived ) Work editorial revisions, annotations, elaborations, modifications represent, whole, original work authorship. purposes License, Derivative Works shall include works remain separable , merely link (bind name) interfaces , Work Derivative Works thereof. “Contribution” shall mean work authorship, including original version Work modifications additions Work Derivative Works thereof, intentionally submitted Licensor inclusion Work copyright owner individual Legal Entity authorized submit behalf copyright owner. purposes definition, “submitted” means form electronic, verbal, written communication sent Licensor representatives, including limited communication electronic mailing lists, source code control systems, issue tracking systems managed , behalf , Licensor purpose discussing improving Work, excluding communication conspicuously marked otherwise designated writing copyright owner “Contribution.” “Contributor” shall mean Licensor individual Legal Entity behalf Contribution received Licensor subsequently incorporated within Work.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"id_2-grant-of-copyright-license","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"2. Grant of Copyright License","title":"Apache License","text":"Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable copyright license reproduce, prepare Derivative Works , publicly display, publicly perform, sublicense, distribute Work Derivative Works Source Object form.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"id_3-grant-of-patent-license","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"3. Grant of Patent License","title":"Apache License","text":"Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable (except stated section) patent license make, made, use, offer sell, sell, import, otherwise transfer Work, license applies patent claims licensable Contributor necessarily infringed Contribution(s) alone combination Contribution(s) Work Contribution(s) submitted. institute patent litigation entity (including cross-claim counterclaim lawsuit) alleging Work Contribution incorporated within Work constitutes direct contributory patent infringement, patent licenses granted License Work shall terminate date litigation filed.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"id_4-redistribution","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"4. Redistribution","title":"Apache License","text":"may reproduce distribute copies Work Derivative Works thereof medium, without modifications, Source Object form, provided meet following conditions: () must give recipients Work Derivative Works copy License; (b) must cause modified files carry prominent notices stating changed files; (c) must retain, Source form Derivative Works distribute, copyright, patent, trademark, attribution notices Source form Work, excluding notices pertain part Derivative Works; (d) Work includes “NOTICE” text file part distribution, Derivative Works distribute must include readable copy attribution notices contained within NOTICE file, excluding notices pertain part Derivative Works, least one following places: within NOTICE text file distributed part Derivative Works; within Source form documentation, provided along Derivative Works; , within display generated Derivative Works, wherever third-party notices normally appear. contents NOTICE file informational purposes modify License. may add attribution notices within Derivative Works distribute, alongside addendum NOTICE text Work, provided additional attribution notices construed modifying License. may add copyright statement modifications may provide additional different license terms conditions use, reproduction, distribution modifications, Derivative Works whole, provided use, reproduction, distribution Work otherwise complies conditions stated License.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"id_5-submission-of-contributions","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"5. Submission of Contributions","title":"Apache License","text":"Unless explicitly state otherwise, Contribution intentionally submitted inclusion Work Licensor shall terms conditions License, without additional terms conditions. Notwithstanding , nothing herein shall supersede modify terms separate license agreement may executed Licensor regarding Contributions.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"id_6-trademarks","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"6. Trademarks","title":"Apache License","text":"License grant permission use trade names, trademarks, service marks, product names Licensor, except required reasonable customary use describing origin Work reproducing content NOTICE file.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"id_7-disclaimer-of-warranty","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"7. Disclaimer of Warranty","title":"Apache License","text":"Unless required applicable law agreed writing, Licensor provides Work (Contributor provides Contributions) “” BASIS, WITHOUT WARRANTIES CONDITIONS KIND, either express implied, including, without limitation, warranties conditions TITLE, NON-INFRINGEMENT, MERCHANTABILITY, FITNESS PARTICULAR PURPOSE. solely responsible determining appropriateness using redistributing Work assume risks associated exercise permissions License.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"id_8-limitation-of-liability","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"8. Limitation of Liability","title":"Apache License","text":"event legal theory, whether tort (including negligence), contract, otherwise, unless required applicable law (deliberate grossly negligent acts) agreed writing, shall Contributor liable damages, including direct, indirect, special, incidental, consequential damages character arising result License use inability use Work (including limited damages loss goodwill, work stoppage, computer failure malfunction, commercial damages losses), even Contributor advised possibility damages.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"id_9-accepting-warranty-or-additional-liability","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"9. Accepting Warranty or Additional Liability","title":"Apache License","text":"redistributing Work Derivative Works thereof, may choose offer, charge fee , acceptance support, warranty, indemnity, liability obligations /rights consistent License. However, accepting obligations, may act behalf sole responsibility, behalf Contributor, agree indemnify, defend, hold Contributor harmless liability incurred , claims asserted , Contributor reason accepting warranty additional liability. END TERMS CONDITIONS","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/LICENSE.html","id":"appendix-how-to-apply-the-apache-license-to-your-work","dir":"","previous_headings":"","what":"APPENDIX: How to apply the Apache License to your work","title":"Apache License","text":"apply Apache License work, attach following boilerplate notice, fields enclosed brackets [] replaced identifying information. (Don’t include brackets!) text enclosed appropriate comment syntax file format. also recommend file class name description purpose included “printed page” copyright notice easier identification within third-party archives.","code":"Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License."},{"path":"https://ohdsi.github.io/PhenotypeR/articles/a02_CodelistDiagnostics.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Codelist diagnostics","text":"example ’re going summarise characteristics individuals ankle sprain, ankle fracture, forearm fracture, hip fracture using Eunomia synthetic data. ’ll begin creating study cohorts.","code":"library(CDMConnector) library(CohortConstructor) library(CodelistGenerator) library(PhenotypeR) library(dplyr) library(ggplot2) con <- DBI::dbConnect(duckdb::duckdb(), dbdir = CDMConnector::eunomiaDir() ) cdm <- CDMConnector::cdmFromCon(con, cdmSchema = \"main\", writeSchema = \"main\", cdmName = \"Eunomia\" ) cdm$injuries <- conceptCohort(cdm = cdm, conceptSet = list( \"ankle_sprain\" = 81151, \"ankle_fracture\" = 4059173, \"forearm_fracture\" = 4278672, \"hip_fracture\" = 4230399 ), name = \"injuries\") cdm$injuries |> glimpse() #> Rows: ?? #> Columns: 4 #> Database: DuckDB v1.1.3 [unknown@Linux 6.8.0-1020-azure:R 4.4.2//tmp/RtmpmyQLfI/file2ab1bd75389.duckdb] #> $ cohort_definition_id 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 1, 2… #> $ subject_id 3694, 474, 1021, 1021, 1397, 1966, 2226, 3440, 35… #> $ cohort_start_date 1972-12-21, 1982-12-02, 1976-06-29, 1992-09-24, … #> $ cohort_end_date 1973-01-20, 1982-12-16, 1976-07-20, 1992-10-15, …"},{"path":"https://ohdsi.github.io/PhenotypeR/articles/a02_CodelistDiagnostics.html","id":"summarising-code-use","dir":"Articles","previous_headings":"","what":"Summarising code use","title":"Codelist diagnostics","text":"","code":"code_diag <- codelistDiagnostics(cdm$injuries) #tableCohortCodeUse(code_diag)"},{"path":"https://ohdsi.github.io/PhenotypeR/articles/a03_CohortDiagnostics.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Cohort diagnostics","text":"example ’re going summarise cohort diagnostics results cohorts individuals ankle sprain, ankle fracture, forearm fracture, hip fracture using Eunomia synthetic data. , ’ll begin creating study cohorts.","code":"library(CDMConnector) library(CohortConstructor) library(CodelistGenerator) library(PatientProfiles) library(CohortCharacteristics) library(PhenotypeR) library(dplyr) library(ggplot2) con <- DBI::dbConnect(duckdb::duckdb(), dbdir = CDMConnector::eunomiaDir() ) cdm <- CDMConnector::cdmFromCon(con, cdmSchema = \"main\", writeSchema = \"main\", cdmName = \"Eunomia\" ) cdm$injuries <- conceptCohort(cdm = cdm, conceptSet = list( \"ankle_sprain\" = 81151, \"ankle_fracture\" = 4059173, \"forearm_fracture\" = 4278672, \"hip_fracture\" = 4230399 ), name = \"injuries\")"},{"path":"https://ohdsi.github.io/PhenotypeR/articles/a03_CohortDiagnostics.html","id":"cohort-diagnostics","dir":"Articles","previous_headings":"","what":"Cohort diagnostics","title":"Cohort diagnostics","text":"can run cohort diagnostics analyses overall cohorts like : results include summary overlap cohorts. visualise Moreover, results also include summary characteristics cohort, stratified age group sex. can also visualise age distribution:","code":"cohort_diag <- cohortDiagnostics(cdm$injuries) plotCohortOverlap(cohort_diag, uniqueCombinations = TRUE) tableCharacteristics(cohort_diag, groupColumn = c(\"age_group\", \"sex\")) tableCharacteristics(cohort_diag, groupColumn = c(\"age_group\", \"sex\"))"},{"path":"https://ohdsi.github.io/PhenotypeR/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Edward Burn. Author, maintainer. Marti Catala. Author. Xihang Chen. Author. Marta Alcalde-Herraiz. Author. Albert Prats-Uribe. Author.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Burn E, Catala M, Chen X, Alcalde-Herraiz M, Prats-Uribe (2025). PhenotypeR: Assess Study Cohorts Using Common Data Model. R package version 0.1.1.900, https://ohdsi.github.io/PhenotypeR/.","code":"@Manual{, title = {PhenotypeR: Assess Study Cohorts Using a Common Data Model}, author = {Edward Burn and Marti Catala and Xihang Chen and Marta Alcalde-Herraiz and Albert Prats-Uribe}, year = {2025}, note = {R package version 0.1.1.900}, url = {https://ohdsi.github.io/PhenotypeR/}, }"},{"path":"https://ohdsi.github.io/PhenotypeR/index.html","id":"phenotyper-","dir":"","previous_headings":"","what":"Assess Study Cohorts Using a Common Data Model","title":"Assess Study Cohorts Using a Common Data Model","text":"PhenotypeR package helps us assess research-readiness set cohorts defined. assessment includes: Database diagnostics help us better understand database created. includes information size data, time period covered, number people data whole. granular information may influence analytic decisions, number observation periods per person, also described. Codelist diagnostics help answer questions like concepts codelist used database? concepts present led individuals’ entry cohort? concepts used database didn’t include codelist maybe ? Cohort diagnostics help answer questions like many individuals include cohort many excluded inclusion criteria? multiple cohorts, overlap people enter one cohort relative another? incidence cohort entry prevalence cohort database? Matched diagnostics compares study cohorts overall population database. matching people cohorts people similar age sex database can see cohorts differ general database population. Population diagnostics estimates frequency study cohorts database terms incidence rates prevalence.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Assess Study Cohorts Using a Common Data Model","text":"can install PhenotypeR CRAN: can install development version GitHub:","code":"install.packages(\"PhenotypeR\") # install.packages(\"remotes\") remotes::install_github(\"OHDSI/PhenotypeR\")"},{"path":"https://ohdsi.github.io/PhenotypeR/index.html","id":"example-usage","dir":"","previous_headings":"","what":"Example usage","title":"Assess Study Cohorts Using a Common Data Model","text":"illustrate functionality PhenotypeR, let’s create cohort using Eunomia Synpuf dataset. ’ll first load required packages create cdm reference data. Note ’ve included achilles results cdm reference. can ’ll use precomputed counts speed analysis. can easily run analyses explained (database diagnostics, codelist diagnostics, cohort diagnostics, matched diagnostics, population diagnostics) using phenotypeDiagnostics(): can see results generated like : results can quickly view interactive application. shiny app saved new directory can customised using directory input. See shiny app generated example cohort .","code":"library(dplyr) library(CohortConstructor) library(PhenotypeR) # Connect to the database and create the cdm object con <- DBI::dbConnect(duckdb::duckdb(), CDMConnector::eunomiaDir(\"synpuf-1k\", \"5.3\")) cdm <- CDMConnector::cdmFromCon(con = con, cdmName = \"Eunomia Synpuf\", cdmSchema = \"main\", writeSchema = \"main\", achillesSchema = \"main\") cdm #> #> ── # OMOP CDM reference (duckdb) of Eunomia Synpuf ───────────────────────────── #> • omop tables: person, observation_period, visit_occurrence, visit_detail, #> condition_occurrence, drug_exposure, procedure_occurrence, device_exposure, #> measurement, observation, death, note, note_nlp, specimen, fact_relationship, #> location, care_site, provider, payer_plan_period, cost, drug_era, dose_era, #> condition_era, metadata, cdm_source, concept, vocabulary, domain, #> concept_class, concept_relationship, relationship, concept_synonym, #> concept_ancestor, source_to_concept_map, drug_strength, cohort_definition, #> attribute_definition #> • cohort tables: - #> • achilles tables: achilles_analysis, achilles_results, achilles_results_dist #> • other tables: - # Create a code lists codes <- list(\"warfarin\" = c(1310149, 40163554), \"acetaminophen\" = c(1125315, 1127078, 1127433, 40229134, 40231925, 40162522, 19133768), \"morphine\" = c(1110410, 35605858, 40169988)) # Instantiate cohorts with CohortConstructor cdm$my_cohort <- conceptCohort(cdm = cdm, conceptSet = codes, exit = \"event_end_date\", overlap = \"merge\", name = \"my_cohort\") result <- phenotypeDiagnostics(cdm$my_cohort) result |> settings() |> pull(\"result_type\") |> unique() #> [1] \"summarise_omop_snapshot\" #> [2] \"summarise_observation_period\" #> [3] \"cohort_code_use\" #> [4] \"achilles_code_use\" #> [5] \"orphan_code_use\" #> [6] \"summarise_characteristics\" #> [7] \"summarise_table\" #> [8] \"summarise_cohort_attrition\" #> [9] \"summarise_cohort_overlap\" #> [10] \"summarise_cohort_timing\" #> [11] \"incidence\" #> [12] \"incidence_attrition\" #> [13] \"prevalence\" #> [14] \"prevalence_attrition\" #> [15] \"summarise_large_scale_characteristics\" shinyDiagnostics(result = result, minCellCount = 10, directory = tempdir())"},{"path":"https://ohdsi.github.io/PhenotypeR/index.html","id":"more-information","dir":"","previous_headings":"Example usage","what":"More information","title":"Assess Study Cohorts Using a Common Data Model","text":"see details regarding one analyses, please refer package vignettes.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/PhenotypeR-package.html","id":null,"dir":"Reference","previous_headings":"","what":"PhenotypeR: Assess Study Cohorts Using a Common Data Model — PhenotypeR-package","title":"PhenotypeR: Assess Study Cohorts Using a Common Data Model — PhenotypeR-package","text":"Phenotype study cohorts data mapped Observational Medical Outcomes Partnership Common Data Model. Diagnostics run database, code list, cohort, population level assess whether study cohorts ready research.","code":""},{"path":[]},{"path":"https://ohdsi.github.io/PhenotypeR/reference/PhenotypeR-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"PhenotypeR: Assess Study Cohorts Using a Common Data Model — PhenotypeR-package","text":"Maintainer: Edward Burn edward.burn@ndorms.ox.ac.uk (ORCID) Authors: Marti Catala marti.catalasabate@ndorms.ox.ac.uk (ORCID) Xihang Chen xihang.chen@ndorms.ox.ac.uk (ORCID) Marta Alcalde-Herraiz marta.alcaldeherraiz@ndorms.ox.ac.uk (ORCID) Albert Prats-Uribe albert.prats-uribe@ndorms.ox.ac.uk (ORCID)","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/addCodelistAttribute.html","id":null,"dir":"Reference","previous_headings":"","what":"Adds the cohort_codelist attribute to a cohort — addCodelistAttribute","title":"Adds the cohort_codelist attribute to a cohort — addCodelistAttribute","text":"`addCodelistAttribute()` allows users add codelist cohort OMOP CDM. particularly important use `codelistDiagnostics()`, underlying assumption cohort fed `codelistDiagnostics()` cohort_codelist attribute attached .","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/addCodelistAttribute.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Adds the cohort_codelist attribute to a cohort — addCodelistAttribute","text":"","code":"addCodelistAttribute(cohort, codelist, cohortName = names(codelist))"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/addCodelistAttribute.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Adds the cohort_codelist attribute to a cohort — addCodelistAttribute","text":"cohort Cohort table cdm reference codelist Named list concepts cohortName element codelist, name cohort `cohort` codelist refers","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/addCodelistAttribute.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Adds the cohort_codelist attribute to a cohort — addCodelistAttribute","text":"cohort","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/addCodelistAttribute.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Adds the cohort_codelist attribute to a cohort — addCodelistAttribute","text":"","code":"# \\donttest{ library(PhenotypeR) cdm <- mockPhenotypeR() #> Note: method with signature ‘DBIConnection#Id’ chosen for function ‘dbExistsTable’, #> target signature ‘duckdb_connection#Id’. #> \"duckdb_connection#ANY\" would also be valid cohort <- addCodelistAttribute(cohort = cdm$my_cohort, codelist = list(\"cohort_1\" = 1L)) attr(cohort, \"cohort_codelist\") #> # Source: table [?? x 4] #> # Database: DuckDB v1.1.3 [unknown@Linux 6.8.0-1020-azure:R 4.4.2/:memory:] #> cohort_definition_id codelist_name concept_id type #> #> 1 1 cohort_1 1 index event CDMConnector::cdmDisconnect(cdm) # }"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/codelistDiagnostics.html","id":null,"dir":"Reference","previous_headings":"","what":"Run codelist-level diagnostics — codelistDiagnostics","title":"Run codelist-level diagnostics — codelistDiagnostics","text":"`codelistDiagnostics()` runs phenotypeR diagnostics cohort_codelist attribute cohort. Thus codelist attribute cohort must populated. missing populated using `addCodelistAttribute()` function. Furthermore `codelistDiagnostics()` requires achilles tables present cdm concept counts derived.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/codelistDiagnostics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run codelist-level diagnostics — codelistDiagnostics","text":"","code":"codelistDiagnostics(cohort)"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/codelistDiagnostics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run codelist-level diagnostics — codelistDiagnostics","text":"cohort cohort table cdm reference. cohort_codelist attribute must populated. cdm reference must contain achilles tables used deriving concept counts.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/codelistDiagnostics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Run codelist-level diagnostics — codelistDiagnostics","text":"summarised result","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/codelistDiagnostics.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Run codelist-level diagnostics — codelistDiagnostics","text":"","code":"# \\donttest{ library(CohortConstructor) library(PhenotypeR) cdm <- mockPhenotypeR() cdm$arthropathies <- conceptCohort(cdm, conceptSet = list(\"arthropathies\" = c(40475132)), name = \"arthropathies\") #> Warning: ! `codelist` contains numeric values, they are casted to integers. #> ℹ Subsetting table condition_occurrence using 1 concept with domain: condition. #> ℹ No cohort entries found, returning empty cohort table. result <- codelistDiagnostics(cdm$arthropathies) #> • Getting codelists from cohorts #> • Getting index event breakdown #> Getting counts of arthropathies codes for cohort arthropathies #> ℹ No records found in the cdm for the concepts provided. #> Warning: The CDM reference containing the cohort must also contain achilles tables. #> Returning only index event breakdown. CDMConnector::cdmDisconnect(cdm = cdm) # }"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/cohortDiagnostics.html","id":null,"dir":"Reference","previous_headings":"","what":"Run cohort-level diagnostics — cohortDiagnostics","title":"Run cohort-level diagnostics — cohortDiagnostics","text":"Runs phenotypeR diagnostics cohort. diganostics include: * Age groups sex summarised. * summary visits everyone cohort using visit_occurrence table. * summary age sex density cohort. * Attritions cohorts. * Overlap cohorts (one cohort used).","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/cohortDiagnostics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run cohort-level diagnostics — cohortDiagnostics","text":"","code":"cohortDiagnostics(cohort)"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/cohortDiagnostics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run cohort-level diagnostics — cohortDiagnostics","text":"cohort Cohort table cdm reference","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/cohortDiagnostics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Run cohort-level diagnostics — cohortDiagnostics","text":"summarised result","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/cohortDiagnostics.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Run cohort-level diagnostics — cohortDiagnostics","text":"","code":"# \\donttest{ library(PhenotypeR) cdm <- mockPhenotypeR() result <- cohortDiagnostics(cdm$my_cohort) #> • Index cohort table #> • Getting cohort summary #> ℹ adding demographics columns #> ℹ adding tableIntersectCount 1/1 #> ℹ summarising data #> ✔ summariseCharacteristics finished! #> • Getting age density #> • Getting cohort attrition #> • Getting cohort overlap #> • Getting cohort timing #> ℹ The following estimates will be computed: #> • days_between_cohort_entries: median, q25, q75, min, max, density #> ! Table is collected to memory as not all requested estimates are supported on #> the database side #> → Start summary of data, at 2025-02-03 15:58:21.932025 #> ✔ Summary finished, at 2025-02-03 15:58:22.017751 CDMConnector::cdmDisconnect(cdm = cdm) # }"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/cohortDoc.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper for consistent documentation of `cohort`. — cohortDoc","title":"Helper for consistent documentation of `cohort`. — cohortDoc","text":"Helper consistent documentation `cohort`.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/cohortDoc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper for consistent documentation of `cohort`. — cohortDoc","text":"cohort Cohort table cdm reference","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/databaseDiagnostics.html","id":null,"dir":"Reference","previous_headings":"","what":"Database diagnostics — databaseDiagnostics","title":"Database diagnostics — databaseDiagnostics","text":"phenotypeR diagnostics cdm object. Diagnostics include: * Summarise cdm_reference object, creating snapshot metadata cdm_reference object. * Summarise observation period table getting overall statistics summarised_result object.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/databaseDiagnostics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Database diagnostics — databaseDiagnostics","text":"","code":"databaseDiagnostics(cdm)"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/databaseDiagnostics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Database diagnostics — databaseDiagnostics","text":"cdm CDM reference","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/databaseDiagnostics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Database diagnostics — databaseDiagnostics","text":"summarised result","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/databaseDiagnostics.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Database diagnostics — databaseDiagnostics","text":"","code":"# \\donttest{ library(PhenotypeR) cdm <- mockPhenotypeR() result <- databaseDiagnostics(cdm) CDMConnector::cdmDisconnect(cdm = cdm) # }"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/directoryDoc.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper for consistent documentation of `directory`. — directoryDoc","title":"Helper for consistent documentation of `directory`. — directoryDoc","text":"Helper consistent documentation `directory`.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/directoryDoc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper for consistent documentation of `directory`. — directoryDoc","text":"directory Directory save report","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/matchedDiagnostics.html","id":null,"dir":"Reference","previous_headings":"","what":"Compare characteristics of cohort matched to database population — matchedDiagnostics","title":"Compare characteristics of cohort matched to database population — matchedDiagnostics","text":"summary cohort matched original cohort given user. summary contains basic cohort summary including number visits within one year prior cohort_start_date, well large scale charactersitics using following domians OMOP CDM: * condition_occurrence * visit_occurrence * measurement * procedure_occurrence * observation * drug_exposure","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/matchedDiagnostics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compare characteristics of cohort matched to database population — matchedDiagnostics","text":"","code":"matchedDiagnostics(cohort, matchedSample = 1000)"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/matchedDiagnostics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compare characteristics of cohort matched to database population — matchedDiagnostics","text":"cohort Cohort table cdm reference matchedSample number people take random sample matching. NULL, sampling performed.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/matchedDiagnostics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compare characteristics of cohort matched to database population — matchedDiagnostics","text":"summarised result","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/matchedDiagnostics.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compare characteristics of cohort matched to database population — matchedDiagnostics","text":"","code":"# \\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) # }"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/matchedSampleDoc.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper for consistent documentation of `matchedSample`. — matchedSampleDoc","title":"Helper for consistent documentation of `matchedSample`. — matchedSampleDoc","text":"Helper consistent documentation `matchedSample`.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/matchedSampleDoc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper for consistent documentation of `matchedSample`. — matchedSampleDoc","text":"matchedSample number people take random sample matching. NULL, sampling performed.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/mockPhenotypeR.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to create a mock cdm reference for mockPhenotypeR — mockPhenotypeR","title":"Function to create a mock cdm reference for mockPhenotypeR — mockPhenotypeR","text":"`mockPhenotypeR()` creates example dataset can used show package works","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/mockPhenotypeR.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to create a mock cdm reference for mockPhenotypeR — mockPhenotypeR","text":"","code":"mockPhenotypeR( nPerson = 100, con = DBI::dbConnect(duckdb::duckdb()), writeSchema = \"main\", seed = 111 )"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/mockPhenotypeR.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to create a mock cdm reference for mockPhenotypeR — mockPhenotypeR","text":"nPerson number people cdm. con DBI connection create cdm mock object. writeSchema Name schema connection writing permissions. seed seed use creating mock data.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/mockPhenotypeR.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function to create a mock cdm reference for mockPhenotypeR — mockPhenotypeR","text":"cdm object","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/mockPhenotypeR.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Function to create a mock cdm reference for mockPhenotypeR — mockPhenotypeR","text":"","code":"# \\donttest{ library(PhenotypeR) cdm <- mockPhenotypeR() cdm #> #> ── # OMOP CDM reference (duckdb) of mock database ────────────────────────────── #> • omop tables: person, observation_period, cdm_source, concept, vocabulary, #> concept_relationship, concept_synonym, concept_ancestor, drug_strength, #> condition_occurrence, visit_occurrence, drug_exposure, observation, #> measurement, procedure_occurrence #> • cohort tables: my_cohort #> • achilles tables: - #> • other tables: - # }"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/phenotypeDiagnostics.html","id":null,"dir":"Reference","previous_headings":"","what":"Phenotype a cohort — phenotypeDiagnostics","title":"Phenotype a cohort — phenotypeDiagnostics","text":"comprises diagnostics offered package, includes: * diagnostics database via `databaseDiagnostics`. * diagnostics cohort_codelist attribute cohort via `codelistDiagnostics`. * diagnostics cohort via `cohortDiagnostics`. * diagnostics population via `populationDiagnostics`. * diagnostics matched cohort via `matchedDiagnostics`.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/phenotypeDiagnostics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Phenotype a cohort — phenotypeDiagnostics","text":"","code":"phenotypeDiagnostics( cohort, databaseDiagnostics = TRUE, codelistDiagnostics = TRUE, cohortDiagnostics = TRUE, populationDiagnostics = TRUE, populationSample = 1e+06, populationDateRange = as.Date(c(NA, NA)), matchedDiagnostics = TRUE, matchedSample = 1000 )"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/phenotypeDiagnostics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Phenotype a cohort — phenotypeDiagnostics","text":"cohort Cohort table cdm reference databaseDiagnostics TRUE, database diagnostics run. codelistDiagnostics TRUE, codelist diagnostics run. cohortDiagnostics TRUE, cohort diagnostics run. populationDiagnostics TRUE, population diagnostics run. populationSample Number people cdm sample. NULL sampling performed populationDateRange Two dates. first indicating earliest cohort start date second indicating latest possible cohort end date. NULL first date set missing, earliest observation_start_date observation_period table used former. NULL second date set missing, latest observation_end_date observation_period table used latter. matchedDiagnostics TRUE, cohort population diagnostics run. matchedSample number people take random sample matching. NULL, sampling performed.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/phenotypeDiagnostics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Phenotype a cohort — phenotypeDiagnostics","text":"summarised result","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/phenotypeDiagnostics.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Phenotype a cohort — phenotypeDiagnostics","text":"","code":"# \\donttest{ library(PhenotypeR) cdm <- mockPhenotypeR() result <- phenotypeDiagnostics(cdm$my_cohort) #> #> #> • Getting codelists from cohorts #> Warning: No codelists found for the specified cohorts #> Warning: No codelists found for the specified cohorts #> Warning: Empty cohort_codelist attribute for cohort #> ℹ Returning an empty summarised result #> #> • Index cohort table #> • Getting cohort summary #> ℹ adding demographics columns #> ℹ adding tableIntersectCount 1/1 #> ℹ summarising data #> ✔ summariseCharacteristics finished! #> • Getting age density #> • Getting cohort attrition #> • Getting cohort overlap #> • Getting cohort timing #> ℹ The following estimates will be computed: #> • days_between_cohort_entries: median, q25, q75, min, max, density #> ! Table is collected to memory as not all requested estimates are supported on #> the database side #> → Start summary of data, at 2025-02-03 16:00:17.52025 #> ✔ Summary finished, at 2025-02-03 16:00:17.610323 #> #> • Creating denominator for incidence and prevalence #> • Sampling person table to 1e+06 #> ℹ Creating denominator cohorts #> ! cohort columns will be reordered to match the expected order: #> cohort_definition_id, subject_id, cohort_start_date, and cohort_end_date. #> ✔ Cohorts created in 0 min and 5 sec #> • Estimating incidence #> ℹ Getting incidence for analysis 1 of 12 #> ℹ Getting incidence for analysis 2 of 12 #> ℹ Getting incidence for analysis 3 of 12 #> ℹ Getting incidence for analysis 4 of 12 #> ℹ Getting incidence for analysis 5 of 12 #> ℹ Getting incidence for analysis 6 of 12 #> ℹ Getting incidence for analysis 7 of 12 #> ℹ Getting incidence for analysis 8 of 12 #> ℹ Getting incidence for analysis 9 of 12 #> ℹ Getting incidence for analysis 10 of 12 #> ℹ Getting incidence for analysis 11 of 12 #> ℹ Getting incidence for analysis 12 of 12 #> ✔ Overall time taken: 0 mins and 13 secs #> • Estimating prevalence #> ℹ Getting prevalence for analysis 1 of 12 #> ℹ Getting prevalence for analysis 2 of 12 #> ℹ Getting prevalence for analysis 3 of 12 #> ℹ Getting prevalence for analysis 4 of 12 #> ℹ Getting prevalence for analysis 5 of 12 #> ℹ Getting prevalence for analysis 6 of 12 #> ℹ Getting prevalence for analysis 7 of 12 #> ℹ Getting prevalence for analysis 8 of 12 #> ℹ Getting prevalence for analysis 9 of 12 #> ℹ Getting prevalence for analysis 10 of 12 #> ℹ Getting prevalence for analysis 11 of 12 #> ℹ Getting prevalence for analysis 12 of 12 #> ✔ Time taken: 0 mins and 7 secs #> #> • 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) # }"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/pipe.html","id":null,"dir":"Reference","previous_headings":"","what":"Pipe operator — %>%","title":"Pipe operator — %>%","text":"See magrittr::%>% details.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/pipe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pipe operator — %>%","text":"","code":"lhs %>% rhs"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/pipe.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pipe operator — %>%","text":"lhs value magrittr placeholder. rhs function call using magrittr semantics.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/pipe.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pipe operator — %>%","text":"result calling `rhs(lhs)`.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/populationDiagnostics.html","id":null,"dir":"Reference","previous_headings":"","what":"Population-level diagnostics — populationDiagnostics","title":"Population-level diagnostics — populationDiagnostics","text":"phenotypeR diagnostics cohort input relation denomination population. Diagnostics include: * Incidence * Prevalence","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/populationDiagnostics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Population-level diagnostics — populationDiagnostics","text":"","code":"populationDiagnostics( cohort, populationSample = 1e+06, populationDateRange = as.Date(c(NA, NA)) )"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/populationDiagnostics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Population-level diagnostics — populationDiagnostics","text":"cohort Cohort table cdm reference populationSample Number people cdm sample. NULL sampling performed populationDateRange Two dates. first indicating earliest cohort start date second indicating latest possible cohort end date. NULL first date set missing, earliest observation_start_date observation_period table used former. NULL second date set missing, latest observation_end_date observation_period table used latter.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/populationDiagnostics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Population-level diagnostics — populationDiagnostics","text":"summarised result","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/populationDiagnostics.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Population-level diagnostics — populationDiagnostics","text":"","code":"# \\donttest{ library(PhenotypeR) library(dplyr) #> #> Attaching package: ‘dplyr’ #> The following objects are masked from ‘package:stats’: #> #> filter, lag #> The following objects are masked from ‘package:base’: #> #> intersect, setdiff, setequal, union cdm <- mockPhenotypeR() dateStart <- cdm$my_cohort |> summarise(start = min(cohort_start_date, na.rm = TRUE)) |> pull(\"start\") dateEnd <- cdm$my_cohort |> summarise(start = max(cohort_start_date, na.rm = TRUE)) |> pull(\"start\") result <- cdm$my_cohort |> populationDiagnostics(populationDateRange = c(dateStart, dateEnd)) #> • Creating denominator for incidence and prevalence #> • Sampling person table to 1e+06 #> ℹ Creating denominator cohorts #> ! cohort columns will be reordered to match the expected order: #> cohort_definition_id, subject_id, cohort_start_date, and cohort_end_date. #> ✔ Cohorts created in 0 min and 5 sec #> • Estimating incidence #> ℹ Getting incidence for analysis 1 of 12 #> ℹ Getting incidence for analysis 2 of 12 #> ℹ Getting incidence for analysis 3 of 12 #> ℹ Getting incidence for analysis 4 of 12 #> ℹ Getting incidence for analysis 5 of 12 #> ℹ Getting incidence for analysis 6 of 12 #> ℹ Getting incidence for analysis 7 of 12 #> ℹ Getting incidence for analysis 8 of 12 #> ℹ Getting incidence for analysis 9 of 12 #> ℹ Getting incidence for analysis 10 of 12 #> ℹ Getting incidence for analysis 11 of 12 #> ℹ Getting incidence for analysis 12 of 12 #> ✔ Overall time taken: 0 mins and 13 secs #> • Estimating prevalence #> ℹ Getting prevalence for analysis 1 of 12 #> ℹ Getting prevalence for analysis 2 of 12 #> ℹ Getting prevalence for analysis 3 of 12 #> ℹ Getting prevalence for analysis 4 of 12 #> ℹ Getting prevalence for analysis 5 of 12 #> ℹ Getting prevalence for analysis 6 of 12 #> ℹ Getting prevalence for analysis 7 of 12 #> ℹ Getting prevalence for analysis 8 of 12 #> ℹ Getting prevalence for analysis 9 of 12 #> ℹ Getting prevalence for analysis 10 of 12 #> ℹ Getting prevalence for analysis 11 of 12 #> ℹ Getting prevalence for analysis 12 of 12 #> ✔ Time taken: 0 mins and 7 secs CDMConnector::cdmDisconnect(cdm = cdm) # }"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/populationSampleDoc.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper for consistent documentation of `populationSample`. — populationSampleDoc","title":"Helper for consistent documentation of `populationSample`. — populationSampleDoc","text":"Helper consistent documentation `populationSample`.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/populationSampleDoc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper for consistent documentation of `populationSample`. — populationSampleDoc","text":"populationSample Number people cdm sample. NULL sampling performed populationDateRange Two dates. first indicating earliest cohort start date second indicating latest possible cohort end date. NULL first date set missing, earliest observation_start_date observation_period table used former. NULL second date set missing, latest observation_end_date observation_period table used latter.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. CodelistGenerator summariseAchillesCodeUse, summariseCodeUse, summariseCohortCodeUse, summariseOrphanCodes omopgenerics bind, exportSummarisedResult, importSummarisedResult, settings, suppress","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/resultDoc.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper for consistent documentation of `result`. — resultDoc","title":"Helper for consistent documentation of `result`. — resultDoc","text":"Helper consistent documentation `result`.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/resultDoc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper for consistent documentation of `result`. — resultDoc","text":"result summarised result","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/shinyDiagnostics.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a shiny app summarising your phenotyping results — shinyDiagnostics","title":"Create a shiny app summarising your phenotyping results — shinyDiagnostics","text":"shiny app designed diagnostics results phenotypeR, includes: * diagnostics database via `databaseDiagnostics`. * diagnostics cohort_codelist attribute cohort via `codelistDiagnostics`. * diagnostics cohort via `cohortDiagnostics`. * diagnostics population via `populationDiagnostics`. * diagnostics matched cohort via `matchedDiagnostics`.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/shinyDiagnostics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a shiny app summarising your phenotyping results — shinyDiagnostics","text":"","code":"shinyDiagnostics( result, directory, minCellCount = 5, open = rlang::is_interactive() )"},{"path":"https://ohdsi.github.io/PhenotypeR/reference/shinyDiagnostics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a shiny app summarising your phenotyping results — shinyDiagnostics","text":"result summarised result directory Directory save report minCellCount Minimum cell count suppression exporting results. open TRUE, shiny app launched new session. FALSE, shiny app created launched.","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/shinyDiagnostics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a shiny app summarising your phenotyping results — shinyDiagnostics","text":"shiny app","code":""},{"path":"https://ohdsi.github.io/PhenotypeR/reference/shinyDiagnostics.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a shiny app summarising your phenotyping results — shinyDiagnostics","text":"","code":"# \\donttest{ library(PhenotypeR) cdm <- mockPhenotypeR() result <- phenotypeDiagnostics(cdm$my_cohort) #> #> #> • Getting codelists from cohorts #> Warning: No codelists found for the specified cohorts #> Warning: No codelists found for the specified cohorts #> Warning: Empty cohort_codelist attribute for cohort #> ℹ Returning an empty summarised result #> #> • Index cohort table #> • Getting cohort summary #> ℹ adding demographics columns #> ℹ adding tableIntersectCount 1/1 #> ℹ summarising data #> ✔ summariseCharacteristics finished! #> • Getting age density #> • Getting cohort attrition #> • Getting cohort overlap #> • Getting cohort timing #> ℹ The following estimates will be computed: #> • days_between_cohort_entries: median, q25, q75, min, max, density #> ! Table is collected to memory as not all requested estimates are supported on #> the database side #> → Start summary of data, at 2025-02-03 16:02:56.043102 #> ✔ Summary finished, at 2025-02-03 16:02:56.131523 #> #> • Creating denominator for incidence and prevalence #> • Sampling person table to 1e+06 #> ℹ Creating denominator cohorts #> ! cohort columns will be reordered to match the expected order: #> cohort_definition_id, subject_id, cohort_start_date, and cohort_end_date. #> ✔ Cohorts created in 0 min and 5 sec #> • Estimating incidence #> ℹ Getting incidence for analysis 1 of 12 #> ℹ Getting incidence for analysis 2 of 12 #> ℹ Getting incidence for analysis 3 of 12 #> ℹ Getting incidence for analysis 4 of 12 #> ℹ Getting incidence for analysis 5 of 12 #> ℹ Getting incidence for analysis 6 of 12 #> ℹ Getting incidence for analysis 7 of 12 #> ℹ Getting incidence for analysis 8 of 12 #> ℹ Getting incidence for analysis 9 of 12 #> ℹ Getting incidence for analysis 10 of 12 #> ℹ Getting incidence for analysis 11 of 12 #> ℹ Getting incidence for analysis 12 of 12 #> ✔ Overall time taken: 0 mins and 13 secs #> • Estimating prevalence #> ℹ Getting prevalence for analysis 1 of 12 #> ℹ Getting prevalence for analysis 2 of 12 #> ℹ Getting prevalence for analysis 3 of 12 #> ℹ Getting prevalence for analysis 4 of 12 #> ℹ Getting prevalence for analysis 5 of 12 #> ℹ Getting prevalence for analysis 6 of 12 #> ℹ Getting prevalence for analysis 7 of 12 #> ℹ Getting prevalence for analysis 8 of 12 #> ℹ Getting prevalence for analysis 9 of 12 #> ℹ Getting prevalence for analysis 10 of 12 #> ℹ Getting prevalence for analysis 11 of 12 #> ℹ Getting prevalence for analysis 12 of 12 #> ✔ Time taken: 0 mins and 7 secs #> #> • 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) #> shinyDiagnostics(result, tempdir()) CDMConnector::cdmDisconnect(cdm = cdm) # }"}]