Documentation
¶
Overview ¶
Package fhirclient is a small read-only FHIR R4 HTTP client (Search and Read). It depends only on the stdlib and samply FHIR models — no substrate-internal imports.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client reads from a FHIR R4 server base URL (e.g. https://ehr.example/fhir). Unauthenticated by default; an injected token source supplies auth.
func New ¶
New returns a Client for baseURL. A nil hc uses http.DefaultClient. Trailing slashes on baseURL are trimmed so path joining is unambiguous.
func (*Client) Read ¶ added in v0.12.0
func (c *Client) Read(ctx context.Context, resourceType, id string) (body []byte, found bool, err error)
Read issues GET {base}/{resourceType}/{id} and returns the raw response bytes. Non-2xx or a read failure is an error; 404 returns an error (callers inspect the status via errors.Is or by treating the error as absence). found=false is returned for 404 specifically (resource absent); other errors are returned as (nil, false, err) — callers that want fail-safe semantics ignore err.