Title: | A Certe R Package for Providing an Application Programming Interface |
---|---|
Description: | A Certe R Package for providing an application programming interface (API) using 'plumber'. This package is part of the 'certedata' universe. |
Authors: | Matthijs S. Berends [aut, cre], Erwin E. A. Hassing [aut], Certe Medical Diagnostics & Advice Foundation [cph, fnd] |
Maintainer: | Matthijs S. Berends <[email protected]> |
License: | GPL-2 |
Version: | 0.1.6 |
Built: | 2024-11-14 03:59:46 UTC |
Source: | https://github.com/certe-medical-epidemiology/certeapi |
This page provides an overview of all available API endpoints and their arguments. On the API server, this information is available at {host}/__docs__/
, where {host}
is the API location, such as "localhost"
, an IP address, or DNS name.
[GET] /esbl_prediction
:Description: Retrieve an ESBL ETEST prediction and reliability for a vector of MIC values.
Arguments:
AMC
Amoxicillin/clavulanic acid, can be left blank
AMP
Ampicillin, can be left blank
TZP
Piperacillin/tazobactam, can be left blank
CXM
Cefuroxime, can be left blank
FOX
Cefoxitin, can be left blank
CTX
Cefotaxime, can be left blank
CAZ
Ceftazidime, can be left blank
GEN
Gentamicin, can be left blank
TOB
Tobramycin, can be left blank
TMP
Trimethoprim, can be left blank
NIT
Nitrofurantoin, can be left blank
FOS
Fosfomycin, can be left blank
CIP
Ciprofloxacin, can be left blank
IPM
Imipenem, can be left blank
MEM
Meropenem, can be left blank
COL
Colistin, can be left blank
Use get_model_path()
to retrieve the prediction model path, which should be an RDS file.
get_api_file() get_model_path(name, path = read_secret("api.modelpath")) read_model(path)
get_api_file() get_model_path(name, path = read_secret("api.modelpath")) read_model(path)
name |
(file)name of the model |
path |
folder of where the models are stored |
This function starts the API server.
startup(port = read_secret("api.port"))
startup(port = read_secret("api.port"))
port |
port number |
For cron on UNIX (Linux/macOS), use the following command:
Rscript -e "certeapi::startup()" &>> /path/api.log &
Use Rscript --vanilla -e
to not load any user settings such as .Rprofile
. The trailing &
will make the script run in the background.