Trial concept calculated: phase of a clinical trial as per ICH E8(R1).
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 `.trialPhase`, which is an ordered factor with levels `phase 1`, `phase 1+2`, `phase 2`, `phase 2+3`, `phase 2+4`, `phase 3`, `phase 3+4`, `phase 1+2+3`, `phase 4`, `phase 1+2+3+4`.
Examples
# fields needed
f.trialPhase()
#> $euctr
#> [1] "e71_human_pharmacology_phase_i"
#> [2] "e72_therapeutic_exploratory_phase_ii"
#> [3] "e73_therapeutic_confirmatory_phase_iii"
#> [4] "e74_therapeutic_use_phase_iv"
#>
#> $ctgov
#> [1] "phase"
#>
#> $ctgov2
#> [1] "protocolSection.designModule.phases"
#>
#> $isrctn
#> [1] "interventions.intervention.phase"
#>
#> $ctis
#> [1] "authorizedPartI.trialDetails.trialInformation.trialCategory.trialPhase"
#> [2] "authorizedApplication.authorizedPartI.trialDetails.trialInformation.trialCategory.trialPhase"
#>
# 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.trialPhase",
con = dbc)
#> Querying database (9 fields)...
trialsDf
#> _id .trialPhase
#> 1 12949496 phase 3
#> 2 13281214 phase 3
#> 3 17473621 phase 3
#> 4 2012-003632-23-CZ phase 2
#> 5 2012-003632-23-SE phase 2+3
#> 6 2014-002606-20-PT phase 3
#> 7 2014-003556-31-GB phase 2
#> 8 2014-003556-31-SE phase 2
#> 9 2022-500244-37-00 phase 2
#> 10 2022-501142-30-00 phase 4
#> 11 2023-505613-24-00 phase 2
#> 12 2023-508143-51-01 phase 4
#> 13 2024-510663-34-00 phase 2
#> 14 20343063 phase 3
#> 15 61070850 phase 3
#> 16 76463425 phase 3
#> 17 80181452 phase 3
#> 18 88261002 phase 3
#> 19 NCT00617929 phase 2
#> 20 NCT01125800 phase 1+2
#> 21 NCT01483820 phase 1+2
#> 22 NCT01505608 phase 1+2
#> 23 NCT01592045 phase 1+2
#> 24 NCT02620761 phase 2+3
#> 25 NCT03280147 phase 3
#> 26 NCT03325439 phase 3
#> 27 NCT03431558 phase 3
#> 28 NCT03876704 phase 3
#> 29 NCT04001712 phase 3
#> 30 NCT04041765 phase 3
#> 31 NCT05969327 phase 3