# Create data frame for WHO vs ICC diagnostic criteria
diagnosis_df <- data.frame(
Criteria = c(
"Diagnostic Requirements",
"Major Criterion",
"Minor Criteria - 1",
"Minor Criteria - 2",
"Minor Criteria - 3",
"Minor Criteria - 4",
"Minor Criteria - 5",
"Special Notes"
),
WHO = c(
"Requires the major and 1 minor criteria OR 3 minor criteria",
"Multifocal dense infiltrated of MCs (≥15 MCs in aggregates) in BM biopsies and/or in sections of other extracutaneous organ(s)",
">25% of all MCs are atypical cells (type I or type II) on BM smears or are spindle-shaped in MC infiltrates detected on sections of visceral organ",
"KIT point mutation at codon 816 in the BM or another extracutaneous organ",
"MCs in BM or blood or another extracutaneous organ exhibit CD2 and/or CD25",
"Baseline serum tryptase level >20 ng/ML*",
"In case of an unrelated myeloid neoplasm, serum tryptase is not valid as an SM criterion",
"*adjusted according to the presence or absence of hereditary alpha tryptasemia"
),
ICC = c(
"The major criterion alone is sufficient for diagnosis. In the absence of the major criterion, at least 3 of the minor criteria are required",
"Multifocal dense infiltrates of tryptase- and/or CD117-positive mast cells (≥15 mast cells in aggregates) detected in sections of bone marrow and/or other extracutaneous organ(s)",
"In BM biopsy or in section of other extracutaneous organs >25% of mast cells are spindle shaped or have an atypical immature morphology",
"MCs in BM, PB or other extracutaneous organs express CD25, CD2 and/or CD30, in addition to MC markers",
"KIT D816V mutation or other activating KIT mutation detected in BM, PB or other extracutaneous organs",
"Persistently elevated serum tryptase level >20 ng/mL",
"In cases of SM-AMN, an elevated tryptase does not count as a SM minor criterion",
""
)
)
# Create data frame for classification criteria
classification_df <- data.frame(
Type = c(
"ISM (Indolent systemic mastocytosis)",
"BBM (Bone marrow mastocytosis)",
"SSM (Smoldering systemic mastocytosis)",
"ASM (Aggressive mastocytosis)"
),
Criteria = c(
"0/1 B-finding and no C findings",
"no B or C findings",
"2 or more B findings and no C findings",
"1 or more C finding"
)
)
# Create data frame for B-findings
b_findings_df <- data.frame(
Finding = c(
"Bone marrow biopsy",
"Organomegaly",
"Signs of dysplasia",
"KIT mutation"
),
Description = c(
"≥30% mast cells and tryptase level ≥200mg/ml",
"Hepatomegaly or splenomegaly without liver dysfunction or hypersplenism; or lymphadenopathy (>2cm)",
"Signs of dysplasia or myeloproliferation, without a frank AHN; normal or mildly abnormal CBCs",
"KIT D816V mutation with VAF ≥10%"
)
)
# Create data frame for C-findings
c_findings_df <- data.frame(
Finding = c(
"Cytopenias",
"Liver dysfunction",
"Bone lesions",
"Splenomegaly",
"Malabsorption"
),
Description = c(
"Due to bone marrow infiltration",
"Liver dysfunction, ascites and/or portal hypertension",
"Large osteolytic bone lesions with or without pathological fracture",
"Palpable splenomegaly with hypersplenism",
"Malabsorption (hypoalbuminaemia) with weight loss due to gastrointestinal mast cell infiltrates"
)
)
# Function to create styled DT table
create_styled_dt <- function(df, caption = NULL) {
datatable(
df,
options = list(
pageLength = nrow(df),
dom = 'ft',
scrollX = TRUE,
columnDefs = list(list(className = 'dt-center', targets = "_all"))
),
rownames = FALSE,
caption = caption,
filter = 'top',
class = 'cell-border stripe'
) %>%
formatStyle(
columns = colnames(df),
backgroundColor = '#f8f9fa',
borderColor = '#dee2e6',
borderStyle = 'solid',
borderWidth = '1px'
)
}
# Quarto rendering function
render_mastocytosis_tables <- function() {
tags$div(
tags$h2("The World Health Organisation and International Consensus Criteria 2022 for Systemic Mastocytosis"),
tags$h3("Diagnosis Criteria Comparison"),
create_styled_dt(diagnosis_df, "Table 1: WHO vs ICC Diagnostic Criteria"),
tags$h3("WHO Classification Based on B and C Findings"),
create_styled_dt(classification_df, "Table 2: Classification of Systemic Mastocytosis"),
tags$h3("B-findings"),
create_styled_dt(b_findings_df, "Table 3: B-findings in Systemic Mastocytosis"),
tags$h3("C-findings"),
create_styled_dt(c_findings_df, "Table 4: C-findings in Systemic Mastocytosis")
)
}
# For use in Quarto document
render_mastocytosis_tables()