The R package MainzellisteConnectoR
provides utility functions used to access a running Mainzelliste-Instance.
The development version can be installed using
install.packages("devtools")
devtools::install_github("joundso/mainzelliste-connector", ref = "development")
res <- MainzellisteConnectoR::pseudonymize(
MAINZELLISTE_BASE_URL = "https://your-organization.org",
MAINZELLISTE_API_KEY = "123456789abcdef",
MAINZELLISTE_FIELDNAME = "ishid",
mainzelliste_fieldvalue = c(123, 456, "abc")
)
## Result (e.g.):
res
# 123 456 abc
# "000C30WP" "T4ECWT4Q" "Y2FAYH5D"
Simply fill a .env
file:
## Save this e.g. as '.env'
MAINZELLISTE_BASE_URL=https://your-organization.org
MAINZELLISTE_API_KEY=123456789abcdef
MAINZELLISTE_FIELDNAME=ishid
then read in the file and assign all variables to the environment:
## Read in the '.env' file:
DIZutils::set_env_vars(env_file = "./.env")
## And use the smaller function call:
res <- MainzellisteConnectoR::pseudonymize(
mainzelliste_fieldvalue = c(123, 456, "abc"),
from_env = TRUE
)
## Result (e.g.):
res
# 123 456 abc
# "000C30WP" "T4ECWT4Q" "Y2FAYH5D"
## Result (e.g.):
res
# 123 456 abc
# "000C30WP" "T4ECWT4Q" "Y2FAYH5D"
## The result is a named list and can be accessed like this:
## Access the element with the name "123" (and receive a single-item-list):
res["123"]
# Result:
# 123
# "000C30WP"
## Access the element with the name "123" (and receive a string):
res[["123"]]
# Result:
# "000C30WP"
## Access the first element (and receive a string):
res[[1]]
# Result:
# "000C30WP"
This is exactly the same like pseudonymizing, but use MainzellisteConnectoR::depseudonymize
instead of MainzellisteConnectoR::pseudonymize
.
- About the Mainzelliste in its Repo or its Wiki
- About MIRACUM: https://www.miracum.org/
- About the Medical Informatics Initiative: https://www.medizininformatik-initiative.de/index.php/de