Thanks to visit codestin.com
Credit goes to github.com

Skip to content

load_dictionary not working on json from documentation #72

@Addison-Weatherhead

Description

@Addison-Weatherhead

Calling load_dictionary on the json file provided in the documentation (https://cran.r-project.org/web/packages/ricu/ricu.pdf) (page 34/35), yields this error:

! Cannot merge concept 'glu' due to malformed 'sources' entry
Backtrace:
ricu::load_dictionary(cfg_dirs = "../ricu-extensions/configs/chemistry/")
ricu:::parse_dictionary(...)
ricu:::read_dictionary(name, cfg_dirs)
ricu::get_config(...)
base::Reduce(combine_fun, res, NULL)
ricu (local) f(init, x[[i]])
ricu:::map(combine_sources, x[dups], y[dups], dups)
base::Map(f, ..., USE.NAMES = FALSE)
base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
ricu (local) ''(dots[[1L]][[1L]], dots[[2L]][[1L]], dots[[3L]][[1L]])
ricu:::stop_ricu(...)
rlang::abort(...)
Execution halted

What exactly is wrong with the concept-dict.json:

{
"glu": {
"unit": "mg/dL",
"min": 0,
"max": 1000,
"description": "glucose",
"category": "chemistry",
"sources": {
"mimic_demo": [
{
"ids": [50809, 50931],
"table": "labevents",
"sub_var": "itemid"
}
]
}
}
}

I'm using R 4.2.2, and ricu 0.6.0 (below is the entry for ricu from my renv.lock):

"ricu": { "Package": "ricu", "Version": "0.6.0", "Source": "GitHub", "RemoteType": "github", "RemoteHost": "api.github.com", "RemoteRepo": "ricu-package", "RemoteUsername": "prockenschaub", "RemoteRef": "monkeypatch0.6.0", "RemoteSha": "0969a52747c71ae9f47051d640caa5df2d5169a0", "Requirements": [ "R", "assertthat", "backports", "cli", "curl", "data.table", "fansi", "fst", "jsonlite", "methods", "openssl", "prt", "readr", "rlang", "stats", "tibble", "utils", "vctrs" ], "Hash": "2681cdea2f2f3446691071ea30f745b5" },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions