% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fhir_interop.R
\name{omophub_fhir_url}
\alias{omophub_fhir_url}
\title{OMOPHub FHIR Terminology Service URL}
\usage{
omophub_fhir_url(version = c("r4", "r4b", "r5", "r6"))
}
\arguments{
\item{version}{FHIR version prefix. One of \code{"r4"} (default),
\code{"r4b"}, \code{"r5"}, or \code{"r6"}.}
}
\value{
A character scalar with the full FHIR base URL, e.g.
\code{"https://fhir.omophub.com/fhir/r4"}.
}
\description{
Convenience helper for constructing the OMOPHub FHIR Terminology
Service base URL for a given FHIR version. Use it when configuring
an external FHIR client library (\code{httr2}, \code{fhircrackr}, etc.) to
talk to OMOPHub's FHIR endpoint directly.
}
\examples{
omophub_fhir_url()
omophub_fhir_url("r5")

\dontrun{
# Use with httr2 to call the $lookup operation directly
library(httr2)
req <- request(omophub_fhir_url()) |>
  req_url_path_append("CodeSystem/$lookup") |>
  req_url_query(
    system = "http://snomed.info/sct",
    code = "44054006"
  ) |>
  req_headers(Authorization = paste("Bearer", Sys.getenv("OMOPHUB_API_KEY")))
resp <- req_perform(req)
}
}
