The ciecl package is
designed to work with ICD-10 and ICD-11 classifications in the Chilean
clinical context. This guide covers the recommended installation, system
requirements, and the configuration of external credentials.
The easiest way to install ciecl is using the
pak package, which automatically manages system
dependencies and R package requirements.
The package has minimal dependencies for core functionality. To enable all features, including comorbidity indices and interactive tables:
# Full installation with all optional packages
pak::pkg_install("RodoTasso/ciecl", dependencies = TRUE)| Feature | Required Package | Installation |
|---|---|---|
| Charlson/Elixhauser Comorbidities | comorbidity |
install.packages("comorbidity") |
| Interactive GT Tables | gt |
install.packages("gt") |
| WHO ICD-11 API | httr2 |
install.packages("httr2") |
| Read MINSAL Excel Files | readxl |
install.packages("readxl") |
The package uses a local SQLite database to ensure high performance in vectorized searches.
No additional configuration needed. The installation works out of the box.
Install the Xcode Command Line Tools if you plan to compile from source:
Execute the following to install system requirements:
To use cie11_search() and access the WHO ICD-11
international classification, you need free credentials.
Option A: Using keyring
(Recommended)
The keyring package stores secrets in the OS native
keychain (macOS Keychain, Windows Credential Store, Linux Secret
Service), avoiding plain text secrets in your environment files.
# Store credentials once (it will prompt for them)
# Format: "client_id:client_secret"
keyring::key_set("ciecl_icd11")
# Use them in your session
Sys.setenv(ICD_API_KEY = keyring::key_get("ciecl_icd11"))Option B: Using .Renviron File
Add the following line to your ~/.Renviron file (you can
use usethis::edit_r_environ()):
ICD_API_KEY=your_client_id:your_client_secret
Restart R for the changes to take effect. Ensure
.Renviron is not tracked by Git.
If you encounter errors related to the database connection or corrupt data, force a rebuild of the local cache: