View Source Kindling.Client (kindling v1.0.2)
FHIR API client.
Summary
Types
The FHIR access token. Used when :auth_mode is :bearer or :basic. Ignored when :auth_mode is :open.
The base URL of the FHIR server. Often (but not always), includes the FHIR version in the URL path.
A string that is the ID of a FHIR resource.
Configuration of a FHIR client.
Functions
Make a read REST request against a FHIR API server, for a resource of type resource_module
and the id id
. Returns a schema struct of the results, or an error.
Make a search REST request against a FHIR API server, for a resource of type resource_module
using the search params params
.
Types
@type access_token() :: String.t()
The FHIR access token. Used when :auth_mode is :bearer or :basic. Ignored when :auth_mode is :open.
@type fhir_server_base_url() :: String.t()
The base URL of the FHIR server. Often (but not always), includes the FHIR version in the URL path.
@type resource_id() :: String.t()
A string that is the ID of a FHIR resource.
@type t() :: %{ base_url: fhir_server_base_url(), access_token: access_token(), auth_mode: :bearer | :basic | :open }
Configuration of a FHIR client.
Functions
create(client, resource_module, attrs, opts \\ [], req_fn \\ &Kindling.Client.Req.post/2)
View Sourcedelete(client, resource_module, id, opts \\ [], req_fn \\ &Kindling.Client.Req.delete/2)
View Sourceread(client, resource_module, id, opts \\ [], req_fn \\ &Kindling.Client.Req.get/2)
View SourceMake a read REST request against a FHIR API server, for a resource of type resource_module
and the id id
. Returns a schema struct of the results, or an error.
opts
:
headers
: additional HTTP request headers to send with the request, as a list of {key, value} pairs.
search(client, resource_module, params \\ [], opts \\ [], req_fn \\ &Kindling.Client.Req.get/2)
View SourceMake a search REST request against a FHIR API server, for a resource of type resource_module
using the search params params
.
Returns a schema struct of the results (usually a FHIR bundle), or an error.
opts
:
headers
: additional HTTP request headers to send with the request, as a list of {key, value} pairs.