Trial concept calculated: status of recruitment at the time of loading the trial records. Maps the categories that are in fields which specify the state of recruitment. Simplifies the status into three categories.
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 `.statusRecruitment`, which is a factor with levels `ongoing` (includes active, not yet recruiting; temporarily halted; suspended; authorised, not started and similar), `completed` (includes ended; ongoing, recruitment ended), `ended early` (includes prematurely ended, terminated early) and `other` (includes revoked, withdrawn, planned, stopped).
Examples
# fields needed
f.statusRecruitment()
#> $euctr
#> [1] "trialInformation.globalEndOfTrialPremature"
#> [2] "trialInformation.isGlobalEndOfTrialReached"
#> [3] "p_end_of_trial_status"
#>
#> $ctgov
#> [1] "last_known_status" "overall_status"
#>
#> $ctgov2
#> [1] "protocolSection.statusModule.overallStatus"
#>
#> $isrctn
#> [1] "participants.recruitmentEnd"
#> [2] "participants.recruitmentStart"
#> [3] "participants.recruitmentStatusOverride"
#>
#> $ctis
#> [1] "authorizedApplication.memberStatesConcerned.mscName"
#> [2] "mscTrialNotificationsInfoList.mscNotificationsListInfo.notificationType"
#> [3] "events.trialEvents.events.notificationType"
#> [4] "ctPublicStatusCode"
#> [5] "ctStatus"
#>
# 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.statusRecruitment",
con = dbc)
#> Querying database (14 fields)...
trialsDf
#> _id .statusRecruitment
#> 1 12949496 other
#> 2 13281214 completed
#> 3 17473621 completed
#> 4 2012-003632-23-CZ completed
#> 5 2012-003632-23-SE completed
#> 6 2014-002606-20-PT ongoing
#> 7 2014-003556-31-GB completed
#> 8 2014-003556-31-SE completed
#> 9 2022-500244-37-00 ongoing
#> 10 2022-501142-30-00 ongoing
#> 11 2023-505613-24-00 ongoing
#> 12 2023-508143-51-01 ongoing
#> 13 2024-510663-34-00 ongoing
#> 14 20343063 completed
#> 15 61070850 completed
#> 16 76463425 completed
#> 17 80181452 completed
#> 18 88261002 completed
#> 19 NCT00617929 ended early
#> 20 NCT01125800 completed
#> 21 NCT01483820 ended early
#> 22 NCT01505608 ended early
#> 23 NCT01592045 completed
#> 24 NCT02620761 ended early
#> 25 NCT03280147 completed
#> 26 NCT03325439 ended early
#> 27 NCT03431558 ongoing
#> 28 NCT03876704 ongoing
#> 29 NCT04001712 completed
#> 30 NCT04041765 ongoing
#> 31 NCT05969327 completed