Title: | Clinical Scores Calculator for Healthcare |
Version: | 0.1.0 |
Description: | Provides functions to compute various clinical scores used in healthcare. These include the Charlson Comorbidity Index (CCI), predicting 10-year survival in patients with multiple comorbidities; the EPICES score, an individual indicator of precariousness considering its multidimensional nature; the MELD score for chronic liver disease severity; the Alternative Fistula Risk Score (a-FRS) for postoperative pancreatic fistula risk; and the Distal Pancreatectomy Fistula Risk Score (D-FRS) for risk following distal pancreatectomy. For detailed methodology, refer to Charlson et al. (1987) <doi:10.1016/0021-9681(87)90171-8> , Sass et al. (2006) <doi:10.1007/s10332-006-0131-5>, Kamath et al. (2001) <doi:10.1053/jhep.2001.22172>, Kim et al. (2008) <doi:10.1056/NEJMoa0801209> Kim et al. (2021) <doi:10.1053/j.gastro.2021.08.050>, Mungroop et al. (2019) <doi:10.1097/SLA.0000000000002620>, and de Pastena et al. (2023) <doi:10.1097/SLA.0000000000005497>.. |
Imports: | stats |
License: | GPL-3 |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.1 |
Suggests: | knitr, rmarkdown |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2024-07-09 15:54:24 UTC; amadousow |
Author: | Amadou Khalilou Sow
|
Maintainer: | Amadou Khalilou Sow <kkhalilou.sow@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2024-07-10 16:50:02 UTC |
Alternative Fistula Risk Score (a-FRS)
Description
Calculates the alternative Fistula Risk Score (FRS) based on gland Texture, pancreatic duct diameter, and BMI. Postoperative pancreatic fistula (POPF) is a significant complication following pancreatoduodenectomy (PD). The Fistula Risk Score (FRS), initially proposed by Callery et al. in 2013, includes parameters such as gland texture, pancreatic duct diameter, and pathology. Recent validations suggest reconsidering the inclusion of intraoperative blood loss in the FRS due to its minimal impact on POPF outcomes, exclusion from national audits like US-NSQIP and DPCA, and its dependence on surgical technique rather than patient factors. Therefore, a blood loss-independent fistula risk score is essential for accurate risk assessment in future studies. Visit https://www.evidencio.com/models/show/621 for more information.
Usage
a_FRS(my_data)
Arguments
my_data |
A data frame containing the columns Texture ("soft = 1" or "hard = 0"), PD_size Numeric (Pancreatic duct diameter in millimeters), and BMI Numeric (Body mass index in kg/m²). |
Details
This function calculates the risk of Postoperative Pancreatic Fistula (POPF) following pancreatoduodenectomy using the specified parameters:
-
Texture :
Nature of pancreatic texture (Firm or Hard = 0 or Soft = 1) -
BMI :
Body mass index in Kg/m² -
PD_size :
Size of the pancreatic duct in mm
Value
A data frame with the calculated alternative Fistula Risk Score (FRS) and risk classification of CR-POPF following pancreatoduodenectomy. Returns NA for cases with missing values.
References
Mungroop et al. (2019) doi:10.1097/SLA.0000000000002620
Examples
my_data <- data.frame(
ID = 1:4,
Texture = c(0, 1, 0, 0),
BMI = c(22, 25, 30, 20),
PD_size = c(5, 10, 1, 2)
)
a_FRS(my_data)
Calculate Charlson Comorbidity Index
Description
The Charlson Comorbidity Index is a tool used to assess the risk of mortality in patients with multiple comorbidities. This function calculates the Charlson Comorbidity Index (CCI) using various binary or ternary columns in a data frame.
Usage
cci(my_data, replace_na_with_zero = FALSE)
Arguments
my_data |
A data frame containing the necessary columns for score calculation (17 columns). The columns should have values 0, 1, 2, or NA. Yes/no responses should be coded as yes-1, no-0. For the column "liver_disease (None/Mild/Moderate to severe)", encode as None-0, Mild-1, Moderate to severe-2. For the column "diabetes_mellitus (None or diet-controlled/uncomplicated/End-organ)", encode as None or diet-controlled-0, uncomplicated-1, End-organ-2. For the column "solid_tumor (None/Localized/Metastatic)", encode as None-0, Localized-1, Metastatic-2. |
replace_na_with_zero |
A boolean indicating whether to replace NA values with zero (no-0), except for age (default is FALSE). |
Details
The data frame should contain the following CCI items:
-
age
: Age -
mi
: Myocardial infarction -
chf
: Congestive heart failure -
pvd
: Peripheral vascular disease -
cevd
: Cerebrovascular accident with minor or no residua and transient ischemic attacks -
dementia
: Dementia -
cpd
: Chronic obstructive pulmonary disease -
ctd
: Connective tissue disease -
pud
: Peptic ulcer disease -
liver_disease
: Liver disease -
diabetes_mellitus
: Diabetes mellitus -
hp
: Hemiplegia -
ckd
: Moderate to severe Chronic kidney disease -
solid_tumor
: Solid tumor -
leuk
: Leukemia -
lym
: Lymphoma -
aids
: AIDS
Value
A data frame (my_data) with an additional column 'cci_score' containing the calculated scores and an additional column 'estimated_10_year_survival'. Returns NA for cases with missing values.
References
Charlson et al. (1987) doi:10.1016/0021-9681(87)90171-8
Examples
set.seed(123)
n <- 10
my_data <- data.frame(
age = sample(30:90, n, replace = TRUE), # age
mi = sample(0:1, n, replace = TRUE), # Myocardial infraction
chf = sample(0:1, n, replace = TRUE), # Congestive heart failure
pvd = sample(0:1, n, replace = TRUE), # preripheral vascular disease
cevd = sample(0:1, n, replace = TRUE), # Cerebrovascular accident or Transient ischemic attack
dementia = sample(0:1, n, replace = TRUE), # Dematia
cpd = sample(0:1, n, replace = TRUE),# Chronic obstructive pulmonary disease
ctd = sample(0:1, n, replace = TRUE),# Connective tissue disease
pud = c(sample(0:1, (n-1), replace = TRUE) , NA), # peptide ulcer disease
liver_disease = sample(0:2, n, replace = TRUE), #Liver disease(None,Mild,Moderate to severe)
diabetes_mellitus = sample(0:2, n, replace = TRUE),#Diabetes(None,uncomplicated,End-organ)
hp = sample(0:1, n, replace = TRUE), # Hemipledia
ckd = sample(0:1, n, replace = TRUE), #Moderate to severe Chronic kidney disease
solid_tumor = sample(0:2, n, replace = TRUE), #Solid tumor(None,Localized,Metastatic)
leuk = sample(0:1, n, replace = TRUE), # Leukemia
lym = c(sample(0:1, (n-2), replace = TRUE) , c(NA , NA)), # Lymphoma
aids = sample(0:1, n, replace = TRUE) ) # AIDS
cci(my_data, replace_na_with_zero = FALSE)
Calculate EPICES Score
Description
This function calculates the EPICES score, which is used to investigate the relationship between social precariousness and risk factors. The EPICES score is an individual and quantitative scale based on 11 questions regarding material and social problems. Visit https://www.santepubliquefrance.fr/docs/le-score-epices-un-score-individuel-de-precarite.-construction-du-score-et-mesure-des-relations-avec-des-donnees-de-sante-dans-une-population-de for more information.
Usage
epices_score(my_data, prefix = "epices", replace_na_with_zero = FALSE)
Arguments
my_data |
A data frame containing the necessary columns for the EPICES score calculation (11 columns). Yes/no responses should be coded as yes-1, no-0. |
prefix |
A string prefix for the column names (default is "epices"). |
replace_na_with_zero |
A boolean indicating whether to replace NA values with zero (default is TRUE). |
Details
The data frame should contain the EPICES items ordered from 1 to 11::
-
epices_1 :
Do you sometimes meet with a social worker? -
epices_2 :
Do you have supplementary health insurance? -
epices_3 :
Do you live with a partner? -
epices_4 :
Do you own your home? -
epices_5 :
Are there times during the month when you experience real financial difficulties in meeting your needs (food, rent, electricity, etc.)? -
epices_6 :
Have you done any sports in the past 12 months? -
epices_7 :
Have you been to a show in the past 12 months? -
epices_8 :
Have you gone on vacation in the past 12 months? -
epices_9 :
In the past 6 months, have you had contact with family members other than your parents or children? -
epices_10 :
In case of difficulties, are there people in your surroundings whom you can rely on to accommodate you for a few days if needed? -
epices_11 :
In case of difficulties, are there people in your surroundings whom you can rely on to provide you with material assistance?
Value
A data frame with an additional column "epices_score" containing the calculated EPICES scores. Returns NA for cases with missing values.
References
Sass et al. (2006) doi:10.1007/s10332-006-0131-5,
Examples
my_data <- data.frame(
epices_1 = c(1, 0, 1),
epices_2 = c(0, 1, 1),
epices_3 = c(0, 0, 0),
epices_4 = c(1, 0, 0),
epices_5 = c(0, 1, 0),
epices_6 = c(1, 0, 1),
epices_7 = c(0, 1, 0),
epices_8 = c(0, 0, 1),
epices_9 = c(1, 1, 0),
epices_10 = c(0, 0, 1),
epices_11 = c(1, 0, NA)
)
epices_score(my_data, prefix = "epices", replace_na_with_zero = FALSE)
Calculate Intra-operative Distal Fistula Risk Score (D-FRS)
Description
Calculates the intra-operative Distal Fistula Risk Score (D-FRS) to estimate the probability of clinically relevant (grade B/C) postoperative pancreatic fistula (POPF) according to the 2016 ISGPS definition. Visit https://www.evidencio.com/models/show/2587# for more information.
Usage
io_DFRS(my_data)
Arguments
my_data |
A data frame containing the following columns:
|
Details
The intra-operative Distal Fistula Risk Score (D-FRS) estimates the probability of clinically relevant (grade B/C) postoperative pancreatic fistula (POPF) as per the 2016 ISGPS definition. It is the initial risk assessment tool specific to POPF following distal pancreatectomy, enabling tailored treatment and performance comparison across three risk categories.
Value
A data frame with the Intra-operative (D-FRS) score and risk classification of POPF. Returns NA for cases with missing values.
References
Pastena et al. (2023) doi:10.1097/SLA.0000000000005497
Examples
my_data <- data.frame(
ID = 1:4,
BMI = c(NA, 25, 30, 10),
PT = c(5, 43, 1, 20),
PD_size = c(100, 0, 1, 19),
OP_time = c(NA, 20, 605, NA),
Texture = c(0, 1, 0, 1)
)
io_DFRS(my_data)
MELD 3.0 Score Calculator
Description
The Model for End-Stage Liver Disease (MELD) is a prognostic score measuring liver failure severity and estimating short-term survival in chronic liver disease patients. Since 2002, it has prioritized organ allocation for liver transplants. MELDNa, the second version, is used by the Organ Procurement and Transplant Network today. Recently, MELD 3.0 was introduced to include additional variables, enhancing prediction accuracy and addressing gender disparity. For more information, visit https://www.mdcalc.com/calc/10437/model-end-stage-liver-disease-meld.
Usage
meld_3(my_data)
Arguments
my_data |
A data frame containing the following columns: A data frame containing the columns 'Sex', 'Creatinine', 'Bilirubin', 'INR', 'Sodium', and 'Albumin |
Details
The function calculates the MELD 3.0 score based on the following parameters:
-
Sex:
Sex (Male = 1 / Female = 0). -
Bilirubin:
Numeric value representing the bilirubin level (mg/dL). -
INR:
Numeric value representing the International Normalized Ratio (INR). -
Creatinine:
Numeric value representing the creatinine level (mg/dL). -
Albumin :
Numeric value representing the Albumin level (g/dL). -
Sodium:
Numeric value representing the serum sodium level (mEq/L).
Value
A data frame with the calculated MELD 3.0 score and risk classification of 90 day survival. Returns NA for cases with missing values.
References
Kamath et al. (2001) doi:10.1053/jhep.2001.22172
Examples
my_data <- data.frame(
Sex = c(1, 0, 1),
Creatinine = c(1.5, 2.0, 3.1),
Bilirubin = c(1.2, 2.5, 1.8),
INR = c(1.1, 1.4, 2.0),
Sodium = c(135, 130, 140),
Albumin = c(3.0, 2.5, 3.5))
meld_3(my_data)
MELD-Na (UNOS/OPTN) Score Calculator
Description
Calculates the MELD-Na score for patients greater than or equal to 12 years, incorporating serum sodium levels. This score is used for assessing the severity of end-stage liver disease for transplant planning. Note that since January 2016, the MELD score calculation includes the serum sodium level. For more information, visit https://www.mdcalc.com/calc/78/meld-score-model-end-stage-liver-disease-12-older#evidence.
Usage
meld_NA(my_data)
Arguments
my_data |
A data frame containing columns 'Creatinine', 'Bilirubin', 'INR', 'Hemodialysis', and 'Sodium'. |
Details
The function calculates the MELD-Na score based on the following parameters:
-
Bilirubin:
Numeric value representing the bilirubin level (mg/dL). -
INR:
Numeric value representing the International Normalized Ratio (INR). -
Creatinine:
Numeric value representing the creatinine level (mg/dL). -
Hemodialysis:
Logical value indicating if the patient is on hemodialysis (0 = No, 1 = Yes). -
Sodium:
Numeric value representing the serum sodium level (mEq/L).
Value
A modified data frame (my_data) with the calculated MELD-Na score and risk classification of three-month mortality. Returns NA for cases with missing values.
References
Kamath et al. (2001) doi:10.1053/jhep.2001.22172
Examples
my_data <- data.frame(
Creatinine = c(1.2, 2.5, 3),
Bilirubin = c(0.5, 1.0, 2.1),
INR = c(1.1, 1.5, 1.8),
Sodium = c(130, 140, 125),
Hemodialysis = c(0, 1, 0)
)
meld_NA(my_data)
MELD Score (Original, Pre-2016, Model for End-Stage Liver Disease)
Description
Calculates the MELD score based on the original pre-2016 formula, which does not include serum sodium levels, as used by non-US transplant societies. Visit https://www.mdcalc.com/calc/2693/meld-score-original-pre-2016-model-end-stage-liver-disease for more information.
Usage
meld_pre_2016(my_data)
Arguments
my_data |
A data frame containing columns 'Creatinine', 'Bilirubin', 'INR', and 'Hemodialysis'. |
Details
This function calculates the MELD score using the following parameters:
-
Bilirubin :
Numeric value representing the bilirubin level (mg/dL). -
INR :
Numeric value representing the International Normalized Ratio (INR). -
Creatinine :
Numeric value representing the creatinine level (mg/dL). -
Hemodialysis :
Logical value indicating if the patient is on hemodialysis (0 = No, 1 = Yes).
Value
A modified data frame with the calculated MELD score and risk classification of three-month mortality. Returns NA for cases with missing values.
References
Kamath et al. (2001) doi:10.1053/jhep.2001.22172
Examples
my_data <- data.frame(
Hemodialysis = c(0, 0, 1),
Creatinine = c(1.2, 0.9, 1.5),
Bilirubin = c(0.7, 1.1, 0.9),
INR = c(1.0, 1.2, 1)
)
meld_pre_2016(my_data)
Preoperative Distal Fistula Risk Score (D-FRS)
Description
The preoperative fistula risk score estimates the probability of clinically relevant (grade B/C) postoperative pancreatic fistula (POPF) based on the 2016 ISGPS definition. It is the first validated risk score for POPF after distal pancreatectomy, categorizing patients into three risk groups for personalized treatment and benchmarking. For more information, visit https://www.evidencio.com/models/show/2573.
Usage
preop_DFRS(my_data)
Arguments
my_data |
A data frame containing the columns PD_size Numeric (Pancreatic duct diameter in millimeters) and PT (Pancreatic thickness (in mm)) |
Details
The function calculates the (D-FRS)score based on the following parameters:
-
PT:
Size of the pancreatic thickness in mm -
PD_size:
Size of the pancreatic duct in mm
Value
A data frame with the (D-FRS) score and risk classification of POPF. Returns NA for cases with missing values.
References
Pastena et al. (2023) doi:10.1097/SLA.0000000000005497
Examples
my_data <- data.frame(ID = 1:4,
PT = c(5, 43, 1, 4),
PD_size = c(25, 5, 1, 19) )
preop_DFRS(my_data)
Updated Alternative Fistula Risk Score (ua-FRS)
Description
Calculates the alternative Fistula Risk Score (FRS) based on gland Texture, pancreatic duct diameter, BMI, and Sex. Objective is to validate and optimize the alternative Fistula Risk Score (ua-FRS) specifically for patients undergoing minimally invasive pancreatoduodenectomy (MIPD) using data from a comprehensive pan-European cohort. Visit https://www.evidencio.com/models/show/1408 for more information.
Usage
ua_FRS(my_data)
Arguments
my_data |
A data frame containing the columns Sex (Female = 0, Male = 1), Texture ("soft = 1" or "hard = 0"), PD_size Numeric (Pancreatic duct diameter in millimeters), and BMI Numeric (Body mass index in kg/m²). |
Details
This function calculates the risk of Postoperative Pancreatic Fistula (POPF) following pancreatoduodenectomy using the specified parameters:
-
Texture :
Nature of pancreatic texture (Not soft = 0 or Soft = 1) -
BMI :
Body mass index in Kg/m² -
PD_size :
Size of the pancreatic duct in mm (truncated to 5) -
Sex :
Sex (Female = 0, Male = 1)
Value
A modified data frame with the calculated alternative Fistula Risk Score (FRS) and risk classification of CR-POPF following pancreatoduodenectomy. Returns NA for cases with missing values.
References
Mungroop et al. (2019) doi:10.1097/SLA.0000000000003234.
Examples
my_data <- data.frame(
ID = 1:4,
Sex = c(0, 0, 1, 1),
Texture = c(0, 1, 0, 0),
BMI = c(22, 25, 30, 20),
PD_size = c(5, 10, 1, 2)
)
ua_FRS(my_data)