R/pedis-pedis-score.R

#' Print PEDIS System
#'
#' Description of the PEDIS Classification Score
#'
#' @return A tibble with the PEDIS System
#' @export
#'
#' @import tibble
#' @import tidyr
#'
#' @examples
#' print_pedis_classification()
#'
print_pedis_classification <- function() {

  categories <- c(
    c("1: Keine nachweisbare pAVK",
      "2: aVK, aber keine Extremitäten Ischämie",
      "3: Kritische Extremitätenischämie",
      "4: "
    ),
    c("1: <1cm²",
      "2: 1cm²-5cm²",
      "3: >5cm²",
      "4: "
    ),
    c(
      "1: Komplettes Ulcus bis zur Dermis",
      "2: Infiltration bis Subcutis, Faszie, Muskulatur, Sehnen",
      "3: Infiltration bis in Knochen und Gelenke",
      "4: "
    ),
    c(
      "1: Keine Entzündungszeichen",
      "2: Infektion von Haut oder subcutanem Gewebe. Mindestens zwei der folgenden Symptome",
      "3: Erythem > 2cm und eines der folgenden Symptome oder Infektion über die Subcutis",
      "4: Zwei oder mehr der folgenden Zeichen einer systematischen Inflammation"
    ),
    c(
      "1: Keine nachweisbare Neuropathie",
      "2: Monofilament an 2 von 3 Auflagepunkten nicht spürbar oder fehlendes Vibrationsempfinden an der Großzehe oder Biothesiometerschwelle über 25V",
      "3: ",
      "4: "
    )
  )

  index <- factor(
    c(
      rep("Perfusion", 4),
      rep("Extend", 4),
      rep("Depth", 4),
      rep("Infection", 4),
      rep("Sensation", 4)
    ),
    levels =  c("Perfusion",
                "Extend",
                "Depth",
                "Infection",
                "Sensation"
    ),
    ordered = T
  )

  pedis_classification <- tibble::tibble(categories, index) %>%
    tidyr::separate(col = categories, into = c("Stufe", "Kategorie"), sep = ":") %>%
    dplyr::mutate_if(is.character, stringr::str_trim) %>%
    tidyr::spread(key = index, value = Kategorie) %>%
    tibble::add_column(Punkte = c("0 Punkte", "1 Punkt", "2 Punkte", "3 Punkte")) %>%
    dplyr::select(Stufe:Sensation)

  return(pedis_classification)
}
jnshsrs/PEDISdata documentation built on June 24, 2019, 12:07 p.m.