View source: R/download_resources.R
fhir_capability_statement | R Documentation |
Get the capability statement of a FHIR server.
This function downloads a capability statement and creates three data.frames from it:
Meta
contains general information on the server
Rest
contains information on the Rest operations the server supports
Resources
contains information on the supported resource types
When there is more than one piece of information regarding a variable in these data.frames,
they are divided by the string specified in sep
. If brackets
is not NULL, those entries
will also be assigned indices so you can melt them using fhir_melt()
.
fhir_capability_statement(
url = "https://hapi.fhir.org/baseR4",
username = NULL,
password = NULL,
token = NULL,
add_headers = NULL,
brackets = NULL,
sep = " ::: ",
log_errors = NULL,
verbose = deprecated()
)
url |
The base URL of the FHIR server. |
username |
A character vector of length one containing the username for basic authentication. Defaults to NULL, meaning no authentication. |
password |
A character vector of length one containing the password for basic authentication. Defaults to NULL, meaning no authentication. |
token |
A character vector of length one or object of class httr::Token, for bearer token authentication (e.g. OAuth2). See |
add_headers |
A named character vector of custom headers to add to the HTTP request, e.g. |
brackets |
A character vector of length two defining the brackets surrounding indices for multiple entries, e.g. |
sep |
A character vector of length one to separate pasted multiple entries |
log_errors |
Either |
verbose |
A list of data frames containing the information from the statement
## Not run:
#without indices
cap <- fhir_capability_statement(url = "https://server.fire.ly")
#with indices
cap <- fhir_capability_statement(url = "https://server.fire.ly",
brackets = c("[","]"),
sep = " || ")
#melt searchInclude variable
resources <- fhir_melt(cap$Resources,
columns = "searchInclude",
brackets = c("[", "]"),
sep = " || ",
all_columns = FALSE)
#remove indices
resources <- fhir_rm_indices(resources, brackets = c("[", "]"))
head(resources)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.