Since when I worked in the hospital, I’ve been interested in the frailty. Recently, a Hospital Frailty Risk Score (HFRS) based on ICD-10 code system was published in Lancet (Gilbert et al., Development and Validation of a Hospital Frailty Risk Score Focusing on Older People in Acute Care Settings Using Electronic Hospital Records: An Observational Study.” The Lancet 391, no. 10132 (May 5, 2018)).
I implemented this score in FeatureExtraction package, and I encourage you to review, evaluate, and validate this score in various real-world database.
The code below describes how to extract this score for your own cohort
devtools::install_github('ABMI/FeatureExtraction', ref= 'hfrs') library(FeatureExtraction) connectionDetails <- DatabaseConnector::createConnectionDetails(dbms = dbms, server = server, user = user, password = pw, port = port) cdmDatabaseSchema <- "" cohortDatabaseSchema <- "" cohortTable <- "cohort" oracleTempSchema <- NULL cdmVersion <- "5" cohortId = cohort definition id of yours (INT) settings<-createCovariateSettings(useHfrs = TRUE) covs <- getDbCovariateData(connectionDetails = connectionDetails, oracleTempSchema = oracleTempSchema, cdmDatabaseSchema = cdmDatabaseSchema, cohortDatabaseSchema = cohortDatabaseSchema, cohortTable = cohortTable, cohortId = cohortId, rowIdField = "subject_id", covariateSettings = settings, aggregated = FALSE) cov.d<-as.data.frame(covs$covariates) hist(cov.d$covariateValue)