Skip to contents

Trial concept calculated: inclusion and exclusion criteria as well as age groups that can participate in a trial, based on protocol-related information. Since CTGOV uses single text field for eligibility criteria, text extraction is used to separate in- and exclusion criteria. (See dfMergeVariablesRelevel with an example for healthy volunteers.)

Usage

f.trialPopulation(df = NULL)

Arguments

df

data frame such as from dbGetFieldsIntoDf. If NULL, prints fields needed in df for calculating this trial concept, which can be used with dbGetFieldsIntoDf.

Value

data frame with columns _id and new columns: .trialPopulationAgeGroup (factor, "P", "A", "P+A", "E", "A+E", "P+A+E"), .trialPopulationInclusion (string), .trialPopulationExclusion (string).

Examples

# fields needed
f.trialPopulation()
#> $euctr
#>  [1] "e3_principal_inclusion_criteria"                             
#>  [2] "e4_principal_exclusion_criteria"                             
#>  [3] "f111_in_utero"                                               
#>  [4] "f112_preterm_newborn_infants_up_to_gestational_age__37_weeks"
#>  [5] "f113_newborns_027_days"                                      
#>  [6] "f114_infants_and_toddlers_28_days23_months"                  
#>  [7] "f115_children_211years"                                      
#>  [8] "f116_adolescents_1217_years"                                 
#>  [9] "f11_trial_has_subjects_under_18"                             
#> [10] "f12_adults_1864_years"                                       
#> [11] "f13_elderly_65_years"                                        
#> 
#> $ctgov
#> [1] "eligibility.criteria.textblock" "eligibility.maximum_age"       
#> [3] "eligibility.minimum_age"       
#> 
#> $ctgov2
#> [1] "protocolSection.eligibilityModule.maximumAge"         
#> [2] "protocolSection.eligibilityModule.minimumAge"         
#> [3] "protocolSection.eligibilityModule.eligibilityCriteria"
#> [4] "protocolSection.eligibilityModule.stdAges"            
#> 
#> $isrctn
#> [1] "participants.ageRange"  "participants.inclusion" "participants.exclusion"
#> 
#> $ctis
#> [1] "ageGroup"                                                                                                                                     
#> [2] "authorizedPartI.trialDetails.trialInformation.eligibilityCriteria.principalInclusionCriteria.principalInclusionCriteria"                      
#> [3] "authorizedPartI.trialDetails.trialInformation.eligibilityCriteria.principalExclusionCriteria.principalExclusionCriteria"                      
#> [4] "authorizedApplication.authorizedPartI.trialDetails.trialInformation.eligibilityCriteria.principalInclusionCriteria.principalInclusionCriteria"
#> [5] "authorizedApplication.authorizedPartI.trialDetails.trialInformation.eligibilityCriteria.principalExclusionCriteria.principalExclusionCriteria"
#> 

# apply trial concept when creating data frame
dbc <- nodbi::src_sqlite(
  dbname = system.file("extdata", "demo.sqlite", package = "ctrdata"),
  collection = "my_trials", flags = RSQLite::SQLITE_RO)
trialsDf <- dbGetFieldsIntoDf(
  calculate = "f.trialPopulation",
  con = dbc)
#> To review trial concepts details, call 'help("ctrdata-trial-concepts")'
#> Querying database (26 fields)...
#> Typing fields...
#> Calculating f.trialPopulation...                            

trialsDf
#> # A tibble: 25 × 4
#>    `_id`    .trialPopulationAgeG…¹ .trialPopulationIncl…² .trialPopulationExcl…³
#>    <chr>    <fct>                  <chr>                  <chr>                 
#>  1 12949496 P                      "All infants with a g… "1. Lethal congenital…
#>  2 13281214 P                      "All infants aged les… "1. Lack of consent o…
#>  3 17473621 P                      "1. Infants with gest… "1. Genetic, metaboli…
#>  4 2013-00… P                      "Children aged 0 to 1… "Multiorgan transplan…
#>  5 2016-00… P                      "Inclusion Criteria: … "A subject meeting an…
#>  6 2019-00… P+A                    "Part A, B and C: - G… "Part A, B and C:  - …
#>  7 2022-00… P                      "- Born at  29 weeks … "Participants are not…
#>  8 2022-50… A+E                    "Diagnosis of symptom… "Patients with an ind…
#>  9 2023-50… P                      "Panel A: Is undergoi… "Has received POS wit…
#> 10 2023-50… A+E                    "In order to be eligi… "A potential subject …
#> # ℹ 15 more rows
#> # ℹ abbreviated names: ¹​.trialPopulationAgeGroup, ²​.trialPopulationInclusion,
#> #   ³​.trialPopulationExclusion