R Under development (unstable) (2025-10-08 r88906 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(medicalcoder) > ################################################################################ > # assert scaler logical > > # verify the function is defined and not exported > stopifnot( + "assert_scalar_logical" %in% ls(getNamespace("medicalcoder"), all.names = TRUE), + !("assert_scalar_logical" %in% getNamespaceExports("medicalcoder")) + ) > > # the method should only be used within methods and the error messages are > # controlled: > > x <- + tryCatch( + comorbidities(data = mdcr, method = "pccc_v3.1", icd.codes = "code", full.codes = "yes"), + error = function(e) e + ) > > stopifnot( + inherits(x, "error"), + x$message == "The value passed to 'full.codes' is expected to be a length-1 non-missing logical." + ) > > x <- + tryCatch( + comorbidities(data = mdcr, method = "pccc_v3.1", icd.codes = "code", compact.codes = "yes"), + error = function(e) e + ) > stopifnot( + inherits(x, "error"), + x$message == "The value passed to 'compact.codes' is expected to be a length-1 non-missing logical." + ) > > x <- + tryCatch( + comorbidities(data = mdcr, method = "pccc_v3.1", icd.codes = "code", subconditions = c(TRUE, TRUE)), + error = function(e) e + ) > stopifnot( + inherits(x, "error"), + x$message == "The value passed to 'subconditions' is expected to be a length-1 non-missing logical." + ) > > x <- + tryCatch( + get_icd_codes(with.descriptions = "Yes"), + error = function(e) e + ) > stopifnot( + inherits(x, "error"), + x$message == "The value passed to 'with.descriptions' is expected to be a length-1 non-missing logical." + ) > > x <- + tryCatch( + get_icd_codes(with.hierarchy = "Yes"), + error = function(e) e + ) > stopifnot( + inherits(x, "error"), + x$message == "The value passed to 'with.hierarchy' is expected to be a length-1 non-missing logical." + ) > > ################################################################################ > # End of File # > ################################################################################ > > proc.time() user system elapsed 3.45 0.23 3.64