Search Bundes-Klinik-Atlas hospitals
Usage
klinikatlas_search(
params = list(),
safe = TRUE,
refresh = FALSE,
flatten = FALSE,
flatten_mode = "json"
)Arguments
- params
Named list of upstream query parameters. Parameter names are forwarded unchanged and should match the OpenAPI spec, for example
tx_solr[searchlabel],tx_solr[rows], ortx_solr[icd].- safe
Logical; if
TRUE(default), apply rate-limiting and cache GET responses totools::R_user_dir("bunddev", "cache").- refresh
Logical; if
TRUE, ignore cached responses and re-fetch from the API (defaultFALSE).- flatten
Logical; if
TRUE, simplify nested list columns according toflatten_mode. DefaultFALSEkeeps list columns as-is.- flatten_mode
How to handle list columns when
flatten = TRUE:"drop"Remove list columns entirely. Use when nested data is not needed.
"json"Convert each list element to a JSON string. Preserves all data in a text-queryable format. This is the default.
"unnest"Expand list columns into multiple rows via
tidyr::unnest_longer(). Warning: this can significantly increase the number of rows.
Value
A tibble with one row per search result and the nested API payload retained in list-columns.
Details
Searches hospitals using the documented Bundes-Klinik-Atlas search endpoint. Parameter names are intentionally left in the upstream bracketed form so they can be passed through unchanged. API documentation: https://github.com/bundesAPI/klinikatlas-api.
Examples
if (FALSE) { # \dontrun{
klinikatlas_search(params = list(
"tx_solr[rows]" = 5,
"tx_solr[start]" = 0,
"tx_solr[searchlabel]" = "Berlin"
))
} # }