Help us shape the future of Go! Take the 2026 Go Developer Survey

haau3

package module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 24 Imported by: 0

README

haau3-go

The Go SDK for the haau3 platform API, as typed calls:

  • Scheduling: open appointment slots from many SMART Scheduling Links publishers, in one search.
  • Plan Benefits: Medicare Advantage and ACA Marketplace plans as FHIR InsurancePlan, searchable by state or county, and which providers are in a plan's network.
  • MedList: one reconciled medication list from one patient's FHIR medication records.

On the same key and FHIR base: RxNorm and LOINC lookups, value sets and code validation (Terminology), practitioners and organizations from CMS's National Provider Directory (Provider directory), and standard FHIR Questionnaires such as the PHQ-9.

The haau3 platform API is in preview: it may change as we build, usually to add features or improve performance.

Also for TypeScript: @haau3/sdk, and for Python: haau3 on PyPI.

Install

go get github.com/haau3/haau3-go

Go 1.26 or newer. The SDK has no dependencies outside Go's standard library. It runs on a server only: NewClient refuses to start in a browser (GOOS=js), where your API key would be public.

Authenticate

Create an API key on platform.haau3.com, then set it as HAAU3_API_KEY or pass it with haau3.WithAPIKey.

client, err := haau3.NewClient() // reads HAAU3_API_KEY
if err != nil {
	return err
}

Make one client and reuse it: it holds a pool of connections, and is safe to use from many goroutines at once.

A first call

plan, err := client.ReadInsurancePlan(ctx, "H2406-013-000")
if err != nil {
	return err
}
if plan.Name != nil {
	fmt.Println(*plan.Name) // "AARP Medicare Advantage from UHC FL-0021 (PPO)"
}

Every method takes a context.Context first, and its deadline or cancellation bounds the whole call, retries included. FHIR answers are typed with FHIR R4 from HL7's own schema, in the fhir package; the other services' answers with the API's own types, in this package. FHIR elements are optional, so each is a pointer, nil when absent, or a slice. A decimal keeps the digits it was written with, as a json.Number. Scheduling's times are time.Time, and a time you send goes out with seconds and its own offset, as the API requires. FHIR's own dates stay strings, since FHIR allows a partial date such as 2024.

One call per service

// Scheduling: open appointment slots, here in Boston.
found, err := client.SearchSlots(ctx, haau3.SearchSlotsParams{City: new("Boston"), State: new("MA"), Limit: new(10)})

// Provider directory: a practitioner by NPI, from CMS's National Provider Directory.
practitioners, err := client.SearchPractitioner(ctx, haau3.SearchPractitionerParams{Identifier: new("1093209884")})

// Terminology: a LOINC code's display and properties.
glucose, err := client.CodeSystemLookup(ctx, haau3.CodeSystemLookupParams{System: new("http://loinc.org"), Code: "2345-7"})

// Questionnaires: a form by its id, such as the PHQ-9.
phq9, err := client.ReadQuestionnaire(ctx, "44249-1")

// Plan Benefits: a Medicare Advantage or ACA Marketplace plan, and which providers are in its network.
plan, err := client.ReadInsurancePlan(ctx, "H2406-013-000")
network, err := client.CheckInsurancePlanNetwork(ctx, "H3359-038-000", haau3.CheckInsurancePlanNetworkParams{NPI: []string{"1518929058"}})

// Pharmacy Benefits: what a medication would cost, as the CARIN pharmacy benefit check, from a FHIR
// message Bundle. A member's check carries patient data, so send it only under an executed agreement.
checked, err := client.ProcessMessage(ctx, message)

// MedList: one reconciled medication list from one patient's FHIR medication records. It receives
// patient data, so send it only under an executed agreement.
reconciled, err := client.ReconcileMedications(ctx, records)

Every method, grouped by service, with its request and a link to its page on docs.haau3.com, is in api.md. Each is named by its operationId in Go's style: fhirMetadata is FHIRMetadata. Query parameters are fields of the method's <Method>Params, named the same way: name:contains is NameContains, _count is Count, serviceTypeCode is ServiceTypeCode. A required one is a plain field; an optional one is a pointer or a slice, and nil is not sent. From Go 1.26, new("NC") gives a pointer to a value. Each field's doc comment gives the API's own name.

With an AI coding agent

An agent can read the docs directly:

  • docs.haau3.com/llms.txt lists every docs page as Markdown.
  • docs.haau3.com/skill.md is an Agent Skill that says what the platform does and how to call it. npx skills add https://docs.haau3.com adds it to your project's coding agents.
  • https://docs.haau3.com/mcp is an MCP server that searches the docs. To add it:
    • Claude Code: claude mcp add --transport http haau3 https://docs.haau3.com/mcp
    • Codex: codex mcp add haau3 --url https://docs.haau3.com/mcp
    • Cursor, in .cursor/mcp.json: { "mcpServers": { "haau3": { "url": "https://docs.haau3.com/mcp" } } }
    • VS Code: code --add-mcp '{"name":"haau3","type":"http","url":"https://docs.haau3.com/mcp"}'

go doc github.com/haau3/haau3-go gives the package's own documentation.

Options

Option Default
WithAPIKey(key) HAAU3_API_KEY Your platform API key.
WithBaseURL(url) HAAU3_BASE_URL, then https://api.haau3.com Where the API is. The API key is sent there only. For NewClient only.
WithTimeout(d) 65 * time.Second How long one attempt may take, sending and reading its answer.
WithMaxRetries(n) 1 Retries after a timeout, a network failure, a 429 or a 5xx.
WithHTTPClient(c) a new *http.Client Your own, for a proxy, certificates, connection limits or tracing. For NewClient only.
WithHeader(name, value) A header sent with each request.

Each method takes options too, for that call only, as do Batch, Pages, Resources and Request. Two are for a call only: WithCorrelationID and WithResponseInfo.

slots, err := client.SearchSlots(ctx, haau3.SearchSlotsParams{State: new("MA")},
	haau3.WithTimeout(10*time.Second), haau3.WithMaxRetries(0))

WithHTTPClient takes any *http.Client: its Transport carries a proxy, certificates, connection limits, or tracing such as OpenTelemetry's otelhttp.NewTransport. The SDK sends with a copy that never follows a redirect, so the key goes only where it was sent, and it never changes or closes yours.

A retry waits a short, growing interval, or what the API's Retry-After header says when that is 60 seconds or less. A longer Retry-After fails at once, carrying it. Nothing is cached: every call asks the API.

Errors

Every error the SDK returns is an *haau3.Error, but for your own context's. Its Kind says which of four it is:

plan, err := client.ReadInsurancePlan(ctx, planID)
var e *haau3.Error
if errors.As(err, &e) {
	switch e.Kind {
	case haau3.KindRefused:
		fmt.Println(e.Status)    // 400, 404, 410 and so on
		fmt.Println(e.Outcome()) // the OperationOutcome; Scheduling's errors carry e.Problem()
	case haau3.KindNoAnswer:
		fmt.Println(e.Reason)     // timeout, network, rate-limited, unavailable, server-error or unreadable
		fmt.Println(e.RetryAfter) // when the API said
		fmt.Println(e.Detail)     // for a timeout or a network failure: what failed, such as "dial: connection refused"
	case haau3.KindAuth:
		// the key was missing, unknown or revoked
	case haau3.KindNotSent:
		// the SDK refused to send it: a required parameter left empty, a URL on another host
	}
}

errors.Is(err, haau3.ErrNoAnswer) checks the kind alone, and the same for ErrAuth, ErrRefused and ErrNotSent. A no-answer error unwraps to the network error behind it, so errors.Is(err, context.DeadlineExceeded) works. When your own context is cancelled or runs out, the error is the context's: errors.Is(err, context.Canceled).

No answer is never reported as an empty result, and an empty result is never an error. Every error the API answered carries Attempts, Duration and the RequestID it answered with.

An error's message never includes the body the API answered with, and the body is never printed when the error is: not by any of fmt's verbs, not when it is wrapped or joined, not by slog, json.Marshal or a recovered panic. Outcome() and Problem() are the only ways to read it. A request body you sent is held the same way.

A FHIR answer is checked against the resource types its operation answers with. Anything else, a Bundle where an InsurancePlan was asked for, say, is a no-answer with reason unreadable. The check is of the resource type, and of each element's JSON type as it is read into its Go type: a list where FHIR R4 has an object is unreadable too, its message naming the element and never its value. The SDK does not validate each element against FHIR R4, and an element FHIR R4 does not define is not kept.

An error logs safely as it is: slog gives its fields that are set (its name, message, kind, status, reason, retry-after, attempts, duration, request id, correlation id and detail), and so does json.Marshal, never the body or the cause.

if _, err := client.ReadInsurancePlan(ctx, planID); err != nil {
	slog.Warn("the plan read failed", "error", err)
}

Request ids and timing

haau3.WithResponseInfo fills in what came with an answer: the request id and timing, in the same names Request uses.

var info haau3.ResponseInfo
plan, err := client.ReadInsurancePlan(ctx, planID, haau3.WithResponseInfo(&info))
fmt.Println(info.RequestID, info.Duration, info.Attempts)

Quote the RequestID when you ask for help: it finds the request in the API's own logs.

To find a request by an id of your own, such as your job's or your trace's, pass it with haau3.WithCorrelationID. It must be a UUID, which is all the API keeps; anything else is refused before it is sent. The API keeps it with its record of the request, and it comes back on the answer and on every error the API answered:

var info haau3.ResponseInfo
plan, err := client.ReadInsurancePlan(ctx, planID, haau3.WithCorrelationID(jobID), haau3.WithResponseInfo(&info))
fmt.Println(info.CorrelationID)

Paging

Pages gives a FHIR search's first page and every page after it, following each next link on the client's own host:

first, err := client.SearchInsurancePlan(ctx, haau3.SearchInsurancePlanParams{CoverageAreaState: new("NC")})
if err != nil {
	return err
}
for page, err := range client.Pages(ctx, first) {
	if err != nil {
		return err
	}
	for _, entry := range page.Entry {
		if plan, ok := entry.Resource.(*fhir.InsurancePlan); ok {
			fmt.Println(*plan.ID)
		}
	}
}

Resources gives every resource the search found, across every page:

for resource, err := range client.Resources(ctx, first) {
	if err != nil {
		return err
	}
	fmt.Println(resource.ResourceType())
}

It gives each entry whose search mode is match, or says none. A resource an _include or _revinclude brought, and a search's own OperationOutcome, are not among them; Pages gives every entry. Scheduling's searches page with Limit and Offset, and answer with a Total.

Several requests in one

Batch sends several operations of the FHIR base as one request. Each entry comes from haau3.Calls, whose methods are called as the client's methods of the same name are, without ctx, and gets its own result:

planCall := haau3.Calls.ReadInsurancePlan("H2406-013-000")
counties := haau3.Calls.ListInsurancePlanCounties(haau3.ListInsurancePlanCountiesParams{State: "NC"})

if err := client.Batch(ctx, []haau3.Entry{planCall, counties}); err != nil {
	return err // the batch as a whole failed
}
p, err := planCall.Result() // an *fhir.InsurancePlan, or the error ReadInsurancePlan alone would have returned

Each entry is checked as the call alone is, and fails alone while the others answer. An entry that fails is not retried. The batch itself is retried, and fails, as any call does: then Batch returns its error, and so does each entry's Result. WithResponseInfo gives the batch's own request id. The API takes up to 100 entries in up to 1 MiB and gives a batch 60 seconds, so send a longer list as several batches. Every operation on the FHIR base can go in a batch except FHIRBatch, ProcessMessage and ReconcileMedications, which the spec marks x-haau3-batchable: false.

To send a batch Bundle you built yourself, FHIRBatch takes it and returns the batch-response as it is.

Any request

Request sends a request as you give it and returns what the API answered, whatever the status, with its headers, request id, attempts and duration:

raw, err := client.Request(ctx, haau3.RawRequest{Method: "GET", Path: "/v1/scheduling/publishers"})
if err != nil {
	return err
}
fmt.Println(raw.Status, raw.StatusText, raw.RequestID, len(raw.Body()))

Using it with net/http and Gin

Each of these is a complete, tested example in examples/:

  • net/http (nethttp): one client for the whole server, shared by every request, each call given the request's own r.Context(), so a client that goes away stops the call. Routers built on net/http, such as chi, work the same way.
  • Gin (gin): the same, with c.Request.Context(). Gin's own *gin.Context is a context.Context too, but it is not cancelled when the request ends unless the engine sets ContextWithFallback, so pass the request's.
  • A script (plancsv): every plan a search finds, across every page, written to CSV.

Testing your code

Give the client an *http.Client whose Transport answers as you need, and your code calls the SDK as it always does:

type answer func(*http.Request) (*http.Response, error)

func (a answer) RoundTrip(r *http.Request) (*http.Response, error) { return a(r) }

func TestMyCode(t *testing.T) {
	plan := answer(func(r *http.Request) (*http.Response, error) {
		return &http.Response{
			StatusCode: 200,
			Header:     http.Header{"Content-Type": {"application/fhir+json"}},
			Body:       io.NopCloser(strings.NewReader(`{"resourceType":"InsurancePlan","id":"H2406-013-000"}`)),
		}, nil
	})
	client, err := haau3.NewClient(haau3.WithAPIKey("test"), haau3.WithHTTPClient(&http.Client{Transport: plan}))
	if err != nil {
		t.Fatal(err)
	}
	got, err := client.ReadInsurancePlan(t.Context(), "H2406-013-000")
	if err != nil || *got.ID != "H2406-013-000" {
		t.Fatal(got, err)
	}
}

httptest.NewServer with haau3.WithBaseURL(server.URL) works too. To run code you have not changed against a stand-in API of your own, set HAAU3_BASE_URL to its address: a client made without WithBaseURL sends there, and nowhere else.

Versions

The SDK is 0.y.z while the API is in preview: a minor release may change what a method takes or answers, and a patch release never does. CHANGELOG.md lists every release, and a release that takes a new version of the API's spec names that version; haau3.SpecVersion is the one a release was generated from.

It supports the two Go releases the Go project supports, today 1.26 and 1.27. When a new Go release leaves one of them unsupported, the SDK's lowest Go rises with a minor release.

License

MIT

Documentation

Overview

Package haau3 is the Go SDK for the haau3 platform API (https://docs.haau3.com), as typed calls:

  • Scheduling: open appointment slots from many SMART Scheduling Links publishers, in one search.
  • Plan Benefits: Medicare Advantage and ACA Marketplace plans as FHIR InsurancePlan, searchable by state or county, and which providers are in a plan's network.
  • MedList: one reconciled medication list from one patient's FHIR medication records (medication reconciliation).

On the same key and FHIR base: RxNorm and LOINC lookups, value sets and code validation (Terminology), practitioners and organizations from CMS's National Provider Directory (Provider directory), and standard FHIR Questionnaires such as the PHQ-9.

The haau3 platform API is in preview: it may change as we build, usually to add features or improve performance.

A first call

client, err := haau3.NewClient() // reads HAAU3_API_KEY
if err != nil {
	return err
}
plan, err := client.ReadInsurancePlan(ctx, "H2406-013-000")
if err != nil {
	return err
}
fmt.Println(*plan.Name)

Every operation of the API is a method on Client, named by its operationId: api.md in the repository lists them by service. FHIR answers are package fhir's types, FHIR R4 from HL7's own schema; the other services' answers are this package's.

Errors

Every error the SDK returns is an *Error, but for your own context's, with a Kind: KindAuth, KindRefused, KindNoAnswer, or KindNotSent for a request it refused to send. No answer is never reported as an empty result, and an empty result is never an error. An error never prints the body the API answered with.

With an AI coding agent

https://docs.haau3.com/llms.txt lists every docs page as Markdown, and https://docs.haau3.com/mcp is an MCP server that searches the docs.

Index

Examples

Constants

View Source
const SpecVersion = "1.0.0-preview.6"

SpecVersion is the version of the API's spec this release was generated from.

View Source
const Version = "0.1.3" // x-release-please-version

Version is this SDK's version.

Variables

View Source
var (
	ErrNotSent  error = &kindError{KindNotSent}
	ErrAuth     error = &kindError{KindAuth}
	ErrRefused  error = &kindError{KindRefused}
	ErrNoAnswer error = &kindError{KindNoAnswer}
)

Sentinels for errors.Is, one per Kind: errors.Is(err, haau3.ErrNoAnswer) is true for an *Error whose Kind is KindNoAnswer.

Functions

This section is empty.

Types

type BatchCalls

type BatchCalls struct{}

BatchCalls makes the entries of a batch: one method per operation a batch can carry, called as the client's method of the same name is, without ctx or options. Use it as Calls.

var Calls BatchCalls

Calls makes the entries of a batch:

plan := haau3.Calls.ReadInsurancePlan("H2406-013-000")
counties := haau3.Calls.ListInsurancePlanCounties(haau3.ListInsurancePlanCountiesParams{State: "NC"})
if err := client.Batch(ctx, []haau3.Entry{plan, counties}); err != nil {
	return err // the batch as a whole failed
}
p, err := plan.Result() // an *fhir.InsurancePlan, or the error ReadInsurancePlan alone would have returned

func (BatchCalls) CheckInsurancePlanNetwork

func (BatchCalls) CheckInsurancePlanNetwork(id string, params CheckInsurancePlanNetworkParams) *Call[*fhir.Parameters]

CheckInsurancePlanNetwork is Client.CheckInsurancePlanNetwork as an entry of a batch, sent by Client.Batch.

func (BatchCalls) CodeSystemLookup

func (BatchCalls) CodeSystemLookup(params CodeSystemLookupParams) *Call[*fhir.Parameters]

CodeSystemLookup is Client.CodeSystemLookup as an entry of a batch, sent by Client.Batch.

func (BatchCalls) CodeSystemLookupPost

func (BatchCalls) CodeSystemLookupPost(body *fhir.Parameters) *Call[*fhir.Parameters]

CodeSystemLookupPost is Client.CodeSystemLookupPost as an entry of a batch, sent by Client.Batch.

func (BatchCalls) CodeSystemValidateCode

func (BatchCalls) CodeSystemValidateCode(params CodeSystemValidateCodeParams) *Call[*fhir.Parameters]

CodeSystemValidateCode is Client.CodeSystemValidateCode as an entry of a batch, sent by Client.Batch.

func (BatchCalls) CodeSystemValidateCodePost

func (BatchCalls) CodeSystemValidateCodePost(body *fhir.Parameters) *Call[*fhir.Parameters]

CodeSystemValidateCodePost is Client.CodeSystemValidateCodePost as an entry of a batch, sent by Client.Batch.

func (BatchCalls) FHIRMetadata

func (BatchCalls) FHIRMetadata(params FHIRMetadataParams) *Call[fhir.Resource]

FHIRMetadata is Client.FHIRMetadata as an entry of a batch, sent by Client.Batch.

func (BatchCalls) ListInsurancePlanCounties

func (BatchCalls) ListInsurancePlanCounties(params ListInsurancePlanCountiesParams) *Call[*fhir.Parameters]

ListInsurancePlanCounties is Client.ListInsurancePlanCounties as an entry of a batch, sent by Client.Batch.

func (BatchCalls) ReadEndpoint

func (BatchCalls) ReadEndpoint(id string) *Call[*fhir.Endpoint]

ReadEndpoint is Client.ReadEndpoint as an entry of a batch, sent by Client.Batch.

func (BatchCalls) ReadHealthcareService

func (BatchCalls) ReadHealthcareService(id string) *Call[*fhir.HealthcareService]

ReadHealthcareService is Client.ReadHealthcareService as an entry of a batch, sent by Client.Batch.

func (BatchCalls) ReadInsurancePlan

func (BatchCalls) ReadInsurancePlan(id string) *Call[*fhir.InsurancePlan]

ReadInsurancePlan is Client.ReadInsurancePlan as an entry of a batch, sent by Client.Batch.

func (BatchCalls) ReadLocation

func (BatchCalls) ReadLocation(id string) *Call[*fhir.Location]

ReadLocation is Client.ReadLocation as an entry of a batch, sent by Client.Batch.

func (BatchCalls) ReadOrganization

func (BatchCalls) ReadOrganization(id string) *Call[*fhir.Organization]

ReadOrganization is Client.ReadOrganization as an entry of a batch, sent by Client.Batch.

func (BatchCalls) ReadOrganizationAffiliation

func (BatchCalls) ReadOrganizationAffiliation(id string) *Call[*fhir.OrganizationAffiliation]

ReadOrganizationAffiliation is Client.ReadOrganizationAffiliation as an entry of a batch, sent by Client.Batch.

func (BatchCalls) ReadPractitioner

func (BatchCalls) ReadPractitioner(id string) *Call[*fhir.Practitioner]

ReadPractitioner is Client.ReadPractitioner as an entry of a batch, sent by Client.Batch.

func (BatchCalls) ReadPractitionerRole

func (BatchCalls) ReadPractitionerRole(id string) *Call[*fhir.PractitionerRole]

ReadPractitionerRole is Client.ReadPractitionerRole as an entry of a batch, sent by Client.Batch.

func (BatchCalls) ReadQuestionnaire

func (BatchCalls) ReadQuestionnaire(id string) *Call[*fhir.Questionnaire]

ReadQuestionnaire is Client.ReadQuestionnaire as an entry of a batch, sent by Client.Batch.

func (BatchCalls) SearchEndpoint

func (BatchCalls) SearchEndpoint(params SearchEndpointParams) *Call[*fhir.Bundle]

SearchEndpoint is Client.SearchEndpoint as an entry of a batch, sent by Client.Batch.

func (BatchCalls) SearchHealthcareService

func (BatchCalls) SearchHealthcareService(params SearchHealthcareServiceParams) *Call[*fhir.Bundle]

SearchHealthcareService is Client.SearchHealthcareService as an entry of a batch, sent by Client.Batch.

func (BatchCalls) SearchInsurancePlan

func (BatchCalls) SearchInsurancePlan(params SearchInsurancePlanParams) *Call[*fhir.Bundle]

SearchInsurancePlan is Client.SearchInsurancePlan as an entry of a batch, sent by Client.Batch.

func (BatchCalls) SearchLocation

func (BatchCalls) SearchLocation(params SearchLocationParams) *Call[*fhir.Bundle]

SearchLocation is Client.SearchLocation as an entry of a batch, sent by Client.Batch.

func (BatchCalls) SearchOrganization

func (BatchCalls) SearchOrganization(params SearchOrganizationParams) *Call[*fhir.Bundle]

SearchOrganization is Client.SearchOrganization as an entry of a batch, sent by Client.Batch.

func (BatchCalls) SearchOrganizationAffiliation

func (BatchCalls) SearchOrganizationAffiliation(params SearchOrganizationAffiliationParams) *Call[*fhir.Bundle]

SearchOrganizationAffiliation is Client.SearchOrganizationAffiliation as an entry of a batch, sent by Client.Batch.

func (BatchCalls) SearchPractitioner

func (BatchCalls) SearchPractitioner(params SearchPractitionerParams) *Call[*fhir.Bundle]

SearchPractitioner is Client.SearchPractitioner as an entry of a batch, sent by Client.Batch.

func (BatchCalls) SearchPractitionerRole

func (BatchCalls) SearchPractitionerRole(params SearchPractitionerRoleParams) *Call[*fhir.Bundle]

SearchPractitionerRole is Client.SearchPractitionerRole as an entry of a batch, sent by Client.Batch.

func (BatchCalls) SearchQuestionnaire

func (BatchCalls) SearchQuestionnaire(params SearchQuestionnaireParams) *Call[*fhir.Bundle]

SearchQuestionnaire is Client.SearchQuestionnaire as an entry of a batch, sent by Client.Batch.

func (BatchCalls) ValueSetExpand

func (BatchCalls) ValueSetExpand(params ValueSetExpandParams) *Call[*fhir.ValueSet]

ValueSetExpand is Client.ValueSetExpand as an entry of a batch, sent by Client.Batch.

func (BatchCalls) ValueSetExpandPost

func (BatchCalls) ValueSetExpandPost(body *fhir.Parameters) *Call[*fhir.ValueSet]

ValueSetExpandPost is Client.ValueSetExpandPost as an entry of a batch, sent by Client.Batch.

func (BatchCalls) ValueSetValidateCode

func (BatchCalls) ValueSetValidateCode(params ValueSetValidateCodeParams) *Call[*fhir.Parameters]

ValueSetValidateCode is Client.ValueSetValidateCode as an entry of a batch, sent by Client.Batch.

func (BatchCalls) ValueSetValidateCodePost

func (BatchCalls) ValueSetValidateCodePost(body *fhir.Parameters) *Call[*fhir.Parameters]

ValueSetValidateCodePost is Client.ValueSetValidateCodePost as an entry of a batch, sent by Client.Batch.

type Call

type Call[T any] struct {
	// contains filtered or unexported fields
}

Call is one operation made into an entry of a batch, by Calls. After Client.Batch, Result gives its own answer, or the error the call alone would have returned. A Call is used by one Batch at a time; sent again, it holds its newest result.

func (*Call[T]) Format

func (c *Call[T]) Format(f fmt.State, _ rune)

Format prints String for every verb.

func (*Call[T]) GoString

func (c *Call[T]) GoString() string

GoString is String, so %#v shows no body either.

func (*Call[T]) Result

func (c *Call[T]) Result() (T, error)

Result is the entry's answer, or its error: a refusal or a no-answer as the call alone would have returned, or the batch's own error when the batch as a whole failed.

func (*Call[T]) String

func (c *Call[T]) String() string

String names the entry by its operation, never a value it was given.

type CheckInsurancePlanNetworkParams

type CheckInsurancePlanNetworkParams struct {
	// NPI is `npi`, required. Up to 20 NPIs, ten digits each, as repeated `npi` parameters or
	// separated by commas: `npi=1992700001&npi=1992700002` or `npi=1992700001,1992700002`. Duplicates
	// count once.
	NPI []string
}

CheckInsurancePlanNetworkParams holds CheckInsurancePlanNetwork's query parameters. A nil field is not sent.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client calls the haau3 platform API. Make one and reuse it: it holds a pool of connections, and is safe to use from many goroutines at once.

client, err := haau3.NewClient() // reads HAAU3_API_KEY
plan, err := client.ReadInsurancePlan(ctx, "H2406-013-000")

Printing a client shows its base URL, never its key.

func NewClient

func NewClient(opts ...Option) (*Client, error)

NewClient makes a client. With no options it reads the key from HAAU3_API_KEY, and calls HAAU3_BASE_URL when it is set, or else https://api.haau3.com, with a 65-second timeout per attempt and one retry. It returns an error of KindNotSent when there is no key, or an option is not one a client takes.

Example
package main

import (
	"fmt"
	"log/slog"
	"time"

	"github.com/haau3/haau3-go"
)

func main() {
	client, err := haau3.NewClient(haau3.WithTimeout(20 * time.Second)) // reads HAAU3_API_KEY
	if err != nil {
		slog.Error("no client", "error", err)
		return
	}
	fmt.Println(client)
}

func (*Client) BaseURL

func (c *Client) BaseURL() string

BaseURL is where the client sends requests.

func (*Client) Batch

func (c *Client) Batch(ctx context.Context, entries []Entry, opts ...Option) error

Batch sends several operations of the FHIR base as one request, each entry with its own answer or error, in the order given. Each entry is checked as the call alone is, and fails alone while the others answer; an entry that fails is not retried. The batch itself is retried as any call is, and Batch returns an error only when the batch as a whole failed: then every entry's Result gives that error too.

The API takes up to 100 entries in up to 1 MiB and gives a batch 60 seconds, so send a longer list as several batches. Every operation on the FHIR base can go in a batch except FHIRBatch and the ones the spec marks x-haau3-batchable: false, which api.md names. WithResponseInfo gives the batch's own request id.

Example
package main

import (
	"context"
	"fmt"

	"github.com/haau3/haau3-go"
)

func main() {
	client, err := haau3.NewClient()
	if err != nil {
		return
	}
	plan := haau3.Calls.ReadInsurancePlan("H2406-013-000")
	counties := haau3.Calls.ListInsurancePlanCounties(haau3.ListInsurancePlanCountiesParams{State: "NC"})
	if err := client.Batch(context.Background(), []haau3.Entry{plan, counties}); err != nil {
		return // the batch as a whole failed
	}
	if p, err := plan.Result(); err == nil {
		fmt.Println(*p.ID)
	}
}

func (*Client) CheckInsurancePlanNetwork

func (c *Client) CheckInsurancePlanNetwork(ctx context.Context, id string, params CheckInsurancePlanNetworkParams, opts ...Option) (*fhir.Parameters, error)

CheckInsurancePlanNetwork: Check providers against a plan's network.

FHIR instance-level operation `$in-network` on InsurancePlan: for each NPI, whether the CMS National Provider Directory lists the provider in a network this plan names, for the plan's year. The answer is a `Parameters` resource: the `plan`; the directory's `data-date`; one `network` per network checked, with the number of organizations it lists; a `reason` when there is no network data; a Marketplace plan's own `directory`; one `provider` per NPI, in the order sent, with its `status` (`in-network`, `not-found`, `not-in-directory` or `no-network-data`) and, when listed, `evidence` references to the directory's records on this base; then a `source` when the directory was asked. `not-found` never means out of network: the directory's network data is incomplete, and a listing is not a statement of a contract. All or nothing: a lookup that fails fails the whole answer. GET only. Defined by the haau3 implementation guide (`https://haau3.com/fhir/OperationDefinition/InsurancePlan-in-network`).

GET /v1/fhir/r4/InsurancePlan/{id}/$in-network (checkInsurancePlanNetwork): https://docs.haau3.com/api-reference/plan-benefits/check-providers-against-a-plans-network

func (*Client) CodeSystemLookup

func (c *Client) CodeSystemLookup(ctx context.Context, params CodeSystemLookupParams, opts ...Option) (*fhir.Parameters, error)

CodeSystemLookup: Look up a code.

FHIR `CodeSystem/$lookup`. Returns a code's display and requested properties. On POST, a `coding` parameter may stand in for `system` + `code`.

GET /v1/fhir/r4/CodeSystem/$lookup (codeSystemLookup): https://docs.haau3.com/api-reference/terminology/look-up-a-code

func (*Client) CodeSystemLookupPost

func (c *Client) CodeSystemLookupPost(ctx context.Context, body *fhir.Parameters, opts ...Option) (*fhir.Parameters, error)

CodeSystemLookupPost: Look up a code.

FHIR `CodeSystem/$lookup`. Returns a code's display and requested properties. On POST, a `coding` parameter may stand in for `system` + `code`.

POST /v1/fhir/r4/CodeSystem/$lookup (codeSystemLookupPost): https://docs.haau3.com/api-reference/terminology/look-up-a-code-1

func (*Client) CodeSystemValidateCode

func (c *Client) CodeSystemValidateCode(ctx context.Context, params CodeSystemValidateCodeParams, opts ...Option) (*fhir.Parameters, error)

CodeSystemValidateCode: Validate a code in a code system.

FHIR `CodeSystem/$validate-code`. Asks whether a code exists in a code system. The ValueSet operation of the same name asks about membership of a particular set instead. On POST, a `coding` or `codeableConcept` parameter may stand in for `url` + `code`; a codeableConcept validates if any of its codings does.

GET /v1/fhir/r4/CodeSystem/$validate-code (codeSystemValidateCode): https://docs.haau3.com/api-reference/terminology/validate-a-code-in-a-code-system

func (*Client) CodeSystemValidateCodePost

func (c *Client) CodeSystemValidateCodePost(ctx context.Context, body *fhir.Parameters, opts ...Option) (*fhir.Parameters, error)

CodeSystemValidateCodePost: Validate a code in a code system.

FHIR `CodeSystem/$validate-code`. Asks whether a code exists in a code system. The ValueSet operation of the same name asks about membership of a particular set instead. On POST, a `coding` or `codeableConcept` parameter may stand in for `url` + `code`; a codeableConcept validates if any of its codings does.

POST /v1/fhir/r4/CodeSystem/$validate-code (codeSystemValidateCodePost): https://docs.haau3.com/api-reference/terminology/validate-a-code-in-a-code-system-1

func (*Client) FHIRBatch

func (c *Client) FHIRBatch(ctx context.Context, body *fhir.Bundle, opts ...Option) (*fhir.Bundle, error)

FHIRBatch: Run several operations in one request (batch).

POST a FHIR `Bundle` with `type: batch` to send several requests in one round trip. Each entry's `request.url` is relative to this base and may be any read, search or operation of any service on it, except `$reconcile-medications` and `$process-message`, which a batch refuses by name: each is marked `x-haau3-batchable: false`, the one place this document says an operation cannot go in a batch. Entries are independent: one that fails, such as a lookup of an unknown code, does not fail the others, and each carries its own status in the `batch-response`. For example, a batch of 50 terminology lookups measured about 4.8 ms per code, against 181 ms each when sent one at a time. Transaction bundles are not accepted: nothing on this base writes, so all or nothing would only turn one bad entry into a wholly failed request. A batch carries at most 100 entries in at most 1 MiB, and has 60 seconds: an entry still running then answers `504` inside the `200`. See https://docs.haau3.com/errors#limits.

POST /v1/fhir/r4 (fhirBatch): https://docs.haau3.com/api-reference/fhir-base/run-several-operations-in-one-request-batch

func (*Client) FHIRMetadata

func (c *Client) FHIRMetadata(ctx context.Context, params FHIRMetadataParams, opts ...Option) (fhir.Resource, error)

FHIRMetadata: Capability statement.

FHIR `[base]/metadata`. Returns the `CapabilityStatement` for this service, or a `TerminologyCapabilities` when called with `?mode=terminology`, which lists the code systems served and names those that are recognised but not served. `mode` is the only parameter it takes.

GET /v1/fhir/r4/metadata (fhirMetadata): https://docs.haau3.com/api-reference/fhir-base/capability-statement

func (*Client) Format

func (c *Client) Format(f fmt.State, _ rune)

Format prints String for every verb.

func (*Client) GoString

func (c *Client) GoString() string

GoString is String, so %#v shows no key either.

func (*Client) ListInsurancePlanCounties

func (c *Client) ListInsurancePlanCounties(ctx context.Context, params ListInsurancePlanCountiesParams, opts ...Option) (*fhir.Parameters, error)

ListInsurancePlanCounties: List a state's counties.

FHIR type-level operation `$counties` on InsurancePlan: the counties and county equivalents of a state, the District of Columbia or a territory, sorted by name, each with the five-digit FIPS code `coverage-area-county` takes. The answer is a `Parameters` resource: one `county` parameter per county, whose `code` part is a Coding in `http://terminology.hl7.org/CodeSystem/FIPS64` with the county's name as its display and whose `state` part is the state's code, then a `source` parameter naming the list: the U.S. Census Bureau's 2020 county codes. It answers whether or not a plan is sold in a county. GET only. Defined by the haau3 implementation guide (`https://haau3.com/fhir/OperationDefinition/InsurancePlan-counties`).

GET /v1/fhir/r4/InsurancePlan/$counties (listInsurancePlanCounties): https://docs.haau3.com/api-reference/plan-benefits/list-a-states-counties

func (*Client) ListPublishers

func (c *Client) ListPublishers(ctx context.Context, opts ...Option) (*ListPublishersResponse, error)

ListPublishers: List scheduling publishers.

Returns the SMART Scheduling Links publishers (sources) the platform ingests. Requires a valid API key.

GET /v1/scheduling/publishers (listPublishers): https://docs.haau3.com/api-reference/scheduling/list-scheduling-publishers

func (*Client) ListServiceTypes

func (c *Client) ListServiceTypes(ctx context.Context, params ListServiceTypesParams, opts ...Option) (*ListServiceTypesResponse, error)

ListServiceTypes: List service types.

Returns the distinct service types observed across served slots, each with its `system` and a `count` of the slots carrying it. It is a discovery aid for the `serviceTypeCode` filter on `GET /v1/scheduling/slots`. Requires a valid API key.

GET /v1/scheduling/service-types (listServiceTypes): https://docs.haau3.com/api-reference/scheduling/list-service-types

func (*Client) ListSpecialties

func (c *Client) ListSpecialties(ctx context.Context, params ListSpecialtiesParams, opts ...Option) (*ListSpecialtiesResponse, error)

ListSpecialties: List specialties.

Returns the distinct specialties observed across served slots, from the provider's `specialties` and the schedule's, each with its `system` and a `count` of the slots carrying it. It is a discovery aid for the `specialty` filter on `GET /v1/scheduling/slots`. Codes are each publisher's own. Requires a valid API key.

GET /v1/scheduling/specialties (listSpecialties): https://docs.haau3.com/api-reference/scheduling/list-specialties

func (*Client) Pages

func (c *Client) Pages(ctx context.Context, first *fhir.Bundle, opts ...Option) iter.Seq2[*fhir.Bundle, error]

Pages is every page of a FHIR search: the one you have, then each page its `next` link leads to, on the client's own host. A link to any other host is refused, so the key is never sent elsewhere, and so is a link to a page already read. An error ends the pages, as the last item.

first, err := client.SearchInsurancePlan(ctx, haau3.SearchInsurancePlanParams{CoverageAreaState: new("NC")})
for page, err := range client.Pages(ctx, first) {
	if err != nil {
		return err
	}
	for _, entry := range page.Entry { ... }
}

Scheduling's searches page with Limit and Offset instead, and answer with a Total.

func (*Client) ProcessMessage added in v0.1.3

func (c *Client) ProcessMessage(ctx context.Context, body *fhir.Bundle, opts ...Option) (*fhir.Bundle, error)

ProcessMessage: Check what a medication costs (pharmacy benefit check).

FHIR system-level operation `$process-message`, as the CARIN Consumer Real-Time Pharmacy Benefit Check (STU2 ballot, `2.0.0-ballot`) specifies. POST a FHIR `Bundle` of type `message` whose first entry is a MessageHeader with one of two events. `rtpbc-request-non-phi` asks for a medication's price without patient details: a Claim naming the product (an NDC of 11 digits with no dashes, or an RxNorm code) and the quantity, with the patient and the coverage masked, and a pharmacy or one or more ZIP codes. `rtpbc-request` asks what a medication would cost a member under their coverage: the member's Patient and Coverage, with the payer's identifier in `payor.identifier`, the prescription and its prescriber, and a pharmacy. The answer is a `message` Bundle whose MessageHeader answers the request's, with one ClaimResponse that carries either prices and coverage in `item` or the reason there are none in `error`, and for a member's request the request's Patient as it was sent. A check no connected source can answer carries `no-responder-for-coverage` or `no-price-source` from `https://haau3.com/fhir/CodeSystem/pharmacy-benefits-processing-code`. A price is an estimate; the pharmacy confirms the price. A member's request receives patient data, so send it only under an executed agreement. Nothing a request carries is stored or logged, apart from the request's ids, and every answer is sent with `Cache-Control: no-store`. The operation takes no parameters and is not offered inside a batch. The contract is published at https://fhir.haau3.com/pharmacy-benefits.html.

POST /v1/fhir/r4/$process-message (processMessage): https://docs.haau3.com/api-reference/pharmacy-benefits/check-what-a-medication-costs-pharmacy-benefit-check

func (*Client) ReadEndpoint

func (c *Client) ReadEndpoint(ctx context.Context, id string, opts ...Option) (*fhir.Endpoint, error)

ReadEndpoint: Read an Endpoint.

Read one endpoint by id, as returned by a search on this service.

GET /v1/fhir/r4/Endpoint/{id} (readEndpoint): https://docs.haau3.com/api-reference/provider-directory/read-an-endpoint

func (*Client) ReadHealthcareService

func (c *Client) ReadHealthcareService(ctx context.Context, id string, opts ...Option) (*fhir.HealthcareService, error)

ReadHealthcareService: Read a HealthcareService.

Read one healthcare service by id, as returned by a search on this service.

GET /v1/fhir/r4/HealthcareService/{id} (readHealthcareService): https://docs.haau3.com/api-reference/provider-directory/read-a-healthcareservice

func (*Client) ReadInsurancePlan

func (c *Client) ReadInsurancePlan(ctx context.Context, id string, opts ...Option) (*fhir.InsurancePlan, error)

ReadInsurancePlan: Read a plan.

Read one plan by its id. A Medicare Advantage plan's id is CMS's plan id with the segment in three digits (`H2406-013-000`); a Marketplace plan's is its HIOS plan id with the variant (`19898FL0340001-01`). The plan conforms to the haau3 Plan Benefits profile and to the SBC InsurancePlan profile of the CARIN Digital Insurance Card guide, 2.0.0-ballot, and names the CMS release it was read from.

GET /v1/fhir/r4/InsurancePlan/{id} (readInsurancePlan): https://docs.haau3.com/api-reference/plan-benefits/read-a-plan

Example
package main

import (
	"context"
	"errors"
	"fmt"
	"log/slog"

	"github.com/haau3/haau3-go"
)

func main() {
	client, err := haau3.NewClient()
	if err != nil {
		return
	}
	plan, err := client.ReadInsurancePlan(context.Background(), "H2406-013-000")
	var e *haau3.Error
	switch {
	case errors.As(err, &e) && e.Kind == haau3.KindRefused:
		fmt.Println("refused:", e.Status, e.RequestID)
	case err != nil:
		slog.Warn("the plan read failed", "error", err)
	case plan.Name != nil:
		fmt.Println(*plan.Name)
	}
}

func (*Client) ReadLocation

func (c *Client) ReadLocation(ctx context.Context, id string, opts ...Option) (*fhir.Location, error)

ReadLocation: Read a Location.

Read one location by id, as returned by a search on this service.

GET /v1/fhir/r4/Location/{id} (readLocation): https://docs.haau3.com/api-reference/provider-directory/read-a-location

func (*Client) ReadOrganization

func (c *Client) ReadOrganization(ctx context.Context, id string, opts ...Option) (*fhir.Organization, error)

ReadOrganization: Read an Organization.

Read one organization, payer or network by id, as returned by a search on this service.

GET /v1/fhir/r4/Organization/{id} (readOrganization): https://docs.haau3.com/api-reference/provider-directory/read-an-organization

func (*Client) ReadOrganizationAffiliation

func (c *Client) ReadOrganizationAffiliation(ctx context.Context, id string, opts ...Option) (*fhir.OrganizationAffiliation, error)

ReadOrganizationAffiliation: Read an OrganizationAffiliation.

Read one organization affiliation by id, as returned by a search on this service.

GET /v1/fhir/r4/OrganizationAffiliation/{id} (readOrganizationAffiliation): https://docs.haau3.com/api-reference/provider-directory/read-an-organizationaffiliation

func (*Client) ReadPractitioner

func (c *Client) ReadPractitioner(ctx context.Context, id string, opts ...Option) (*fhir.Practitioner, error)

ReadPractitioner: Read a Practitioner.

Read one practitioner by id, as returned by a search on this service.

GET /v1/fhir/r4/Practitioner/{id} (readPractitioner): https://docs.haau3.com/api-reference/provider-directory/read-a-practitioner

func (*Client) ReadPractitionerRole

func (c *Client) ReadPractitionerRole(ctx context.Context, id string, opts ...Option) (*fhir.PractitionerRole, error)

ReadPractitionerRole: Read a PractitionerRole.

Read one practitioner role by id, as returned by a search on this service.

GET /v1/fhir/r4/PractitionerRole/{id} (readPractitionerRole): https://docs.haau3.com/api-reference/provider-directory/read-a-practitionerrole

func (*Client) ReadQuestionnaire

func (c *Client) ReadQuestionnaire(ctx context.Context, id string, opts ...Option) (*fhir.Questionnaire, error)

ReadQuestionnaire: Read a questionnaire.

Read one questionnaire by id. Ids are the identifier its source gives the instrument, for example `44249-1`. A search with no parameters lists the ids this service holds copies of; any other id its source publishes is fetched live.

The resource is returned exactly as its source publishes it, including its `copyright` and the order of every answer option.

GET /v1/fhir/r4/Questionnaire/{id} (readQuestionnaire): https://docs.haau3.com/api-reference/questionnaires/read-a-questionnaire

func (*Client) ReconcileMedications

func (c *Client) ReconcileMedications(ctx context.Context, body fhir.Resource, opts ...Option) (*fhir.Bundle, error)

ReconcileMedications: Reconcile one patient's medication records.

FHIR system-level operation `$reconcile-medications`. POST one patient's MedicationRequest, MedicationStatement, MedicationDispense and MedicationAdministration records, with the Medications they reference, as a `collection` or `searchset` Bundle; every entry needs a `fullUrl`. The response is one reconciled medication list: a `collection` Bundle holding one reconciled MedicationRequest per clinical drug, a Provenance for each naming the records behind it, and an OperationOutcome when a record was skipped. To evaluate the list as of another date, POST a Parameters resource with `resource` parts, or one `bundle` part, and an `asOf` part. This operation receives patient data, so send it only under an executed agreement. Nothing a request carries is stored or logged, apart from the request's ids, and the operation is not offered inside a batch. The contract is published at https://fhir.haau3.com/OperationDefinition-reconcile-medications.html.

POST /v1/fhir/r4/$reconcile-medications (reconcileMedications): https://docs.haau3.com/api-reference/medlist/reconcile-one-patients-medication-records

func (*Client) Request

func (c *Client) Request(ctx context.Context, req RawRequest, opts ...Option) (*RawResponse, error)

Request sends any request and returns what the API answered, whatever its status, with its headers, request id, attempts and duration. A 429 or a 5xx is still tried again. It returns an error only when no answer arrived, or the request was not sent (a URL on another host, say).

raw, err := client.Request(ctx, haau3.RawRequest{Method: "GET", Path: "/v1/scheduling/publishers"})
fmt.Println(raw.Status, raw.StatusText, raw.RequestID)

func (*Client) Resources

func (c *Client) Resources(ctx context.Context, first *fhir.Bundle, opts ...Option) iter.Seq2[fhir.Resource, error]

Resources is every resource a FHIR search found, across every page, in order: each entry whose search mode is "match", or says none. A resource an `_include` or `_revinclude` brought, and a search's own OperationOutcome, are not among them; Pages gives every entry.

for resource, err := range client.Resources(ctx, first) {
	if err != nil {
		return err
	}
	plan := resource.(*fhir.InsurancePlan)
}
Example
package main

import (
	"context"
	"fmt"

	"github.com/haau3/haau3-go"
	"github.com/haau3/haau3-go/fhir"
)

func main() {
	client, err := haau3.NewClient()
	if err != nil {
		return
	}
	ctx := context.Background()
	first, err := client.SearchInsurancePlan(ctx, haau3.SearchInsurancePlanParams{CoverageAreaState: new("VT")})
	if err != nil {
		return
	}
	for resource, err := range client.Resources(ctx, first) {
		if err != nil {
			return
		}
		if plan, ok := resource.(*fhir.InsurancePlan); ok {
			fmt.Println(*plan.ID)
		}
	}
}

func (*Client) SearchEndpoint

func (c *Client) SearchEndpoint(ctx context.Context, params SearchEndpointParams, opts ...Option) (*fhir.Bundle, error)

SearchEndpoint: Find endpoints.

Search `Endpoint` by managing organization; `connection-type`, `status` and `name` narrow a search but cannot stand alone.

GET /v1/fhir/r4/Endpoint (searchEndpoint): https://docs.haau3.com/api-reference/provider-directory/find-endpoints

func (*Client) SearchHealthcareService

func (c *Client) SearchHealthcareService(ctx context.Context, params SearchHealthcareServiceParams, opts ...Option) (*fhir.Bundle, error)

SearchHealthcareService: Find healthcare services.

Search `HealthcareService` by location, or by network beside a location. The directory's service records name a network and, for a few, a location; none names an organization, so `organization` is refused rather than answered with nothing.

GET /v1/fhir/r4/HealthcareService (searchHealthcareService): https://docs.haau3.com/api-reference/provider-directory/find-healthcare-services

func (*Client) SearchInsurancePlan

func (c *Client) SearchInsurancePlan(ctx context.Context, params SearchInsurancePlanParams, opts ...Option) (*fhir.Bundle, error)

SearchInsurancePlan: Find a plan.

Search the Medicare Advantage and ACA Marketplace plans being served, by identifier, name, or the state or county a plan is sold in. A search needs at least one of `identifier`, a form of `name`, `coverage-area-state` or `coverage-area-county`; `type` and `sold-to` narrow a search but are not one. Every result is the whole plan, sorted by name and then id, and every page states the total. Follow the `next` link to continue.

A plan sold in only part of a county matches the whole county. `GET /v1/fhir/r4/InsurancePlan/$counties?state=FL` lists a state's counties and their codes.

Every other parameter is refused by name rather than ignored, so a search never quietly answers a different question than the one asked. `address-state` and `address-postalcode` are refused with a pointer to the coverage-area parameters, because in FHIR R4 they search a plan's contact address.

Drug-only and dental-only plans are not served. An identifier search that finds one answers no plan and an `OperationOutcome` entry saying why.

GET /v1/fhir/r4/InsurancePlan (searchInsurancePlan): https://docs.haau3.com/api-reference/plan-benefits/find-a-plan

func (*Client) SearchLocation

func (c *Client) SearchLocation(ctx context.Context, params SearchLocationParams, opts ...Option) (*fhir.Bundle, error)

SearchLocation: Find practice locations.

Search `Location` by managing organization or name; the address parameters and `status` narrow a search but cannot stand alone. A distance search (`near`) is refused because the directory does not apply it.

GET /v1/fhir/r4/Location (searchLocation): https://docs.haau3.com/api-reference/provider-directory/find-practice-locations

func (*Client) SearchOrganization

func (c *Client) SearchOrganization(ctx context.Context, params SearchOrganizationParams, opts ...Option) (*fhir.Bundle, error)

SearchOrganization: Find organizations, payers and networks.

Search `Organization` by name, NPI, parent (`partof`) or type. `type=ntwk` lists the insurance networks the directory holds and `type=pay` its payers; any other type, `active` and the address parameters narrow a search but cannot stand alone.

The directory records networks by the text of their type rather than a code. This service searches that text for `type=ntwk` and confirms every answer is a network; if the directory changes how it records them, the search answers 502 rather than serve something else.

An NPI search can return a parent organization beside the practice, when the parent lists the NPI among several. `_revinclude` brings the roles, affiliations, locations and endpoints that point at each match, up to 100 per page.

GET /v1/fhir/r4/Organization (searchOrganization): https://docs.haau3.com/api-reference/provider-directory/find-organizations-payers-and-networks

func (*Client) SearchOrganizationAffiliation

func (c *Client) SearchOrganizationAffiliation(ctx context.Context, params SearchOrganizationAffiliationParams, opts ...Option) (*fhir.Bundle, error)

SearchOrganizationAffiliation: Find the organizations in a network.

Search `OrganizationAffiliation`: which organizations take part in which networks. `network` lists a network's members; with `participating-organization` beside it, it asks whether the directory lists that organization in that network. The directory's network data is sparse, so an organization a network's records do not list is not shown to be out of network. For a network, the primary organization is the network itself.

GET /v1/fhir/r4/OrganizationAffiliation (searchOrganizationAffiliation): https://docs.haau3.com/api-reference/provider-directory/find-the-organizations-in-a-network

func (*Client) SearchPractitioner

func (c *Client) SearchPractitioner(ctx context.Context, params SearchPractitionerParams, opts ...Option) (*fhir.Bundle, error)

SearchPractitioner: Find a practitioner by NPI or name.

Search `Practitioner` by `identifier` to resolve an NPI you already hold, or by name to find someone. A search needs one or the other (or an `_id`): `address-city`, `address-state` and `active` narrow a search but cannot stand alone. Specialties are searched on `PractitionerRole`.

Three identifier systems are accepted, `http://terminology.hl7.org/NamingSystem/npi`, `http://hl7.org/fhir/sid/us-npi` and `urn:oid:2.16.840.1.113883.4.6`, as well as a bare 10-digit value. All of them resolve the same provider. **Responses carry the directory's own system, `http://hl7.org/fhir/sid/us-npi`**, which may differ from the one you sent. Any other identifier system is refused by name: a system the directory does not index would answer with an empty result, which reads as 'no such provider'.

One NPI per search. To resolve several, POST a batch `Bundle` with one entry each.

GET /v1/fhir/r4/Practitioner (searchPractitioner): https://docs.haau3.com/api-reference/provider-directory/find-a-practitioner-by-npi-or-name

func (*Client) SearchPractitionerRole

func (c *Client) SearchPractitionerRole(ctx context.Context, params SearchPractitionerRoleParams, opts ...Option) (*fhir.Bundle, error)

SearchPractitionerRole: Find practitioner roles.

Search `PractitionerRole`: the organizations, specialties, locations and networks practitioners are associated with. A search names a practitioner, an organization, a location or an endpoint; `specialty` (NUCC), `new-patient` and `active` narrow it.

`network` and `new-patient-from-network` follow the directory's own rule: each needs a practitioner, organization, location or specialty beside it, and a search without one is refused before the directory is asked. A network search beside a practitioner or an organization answers in under a second; beside a specialty or a busy location the directory can take 10 to 15 seconds. The directory's network data is sparse, so a role a network's records do not list is not shown to be out of network.

`identifier` is not offered because the directory does not carry identifiers on these resources.

GET /v1/fhir/r4/PractitionerRole (searchPractitionerRole): https://docs.haau3.com/api-reference/provider-directory/find-practitioner-roles

func (*Client) SearchProviderLocations

func (c *Client) SearchProviderLocations(ctx context.Context, params SearchProviderLocationsParams, opts ...Option) (*SearchProviderLocationsResponse, error)

SearchProviderLocations: Search provider locations.

Returns the matching slots grouped by provider location: each item in `providerLocations` is one provider at one location, or a location with no provider, with its total slot count and soonest availability, paginated by provider location. Its opaque `key` drills down to its individual slots via `GET /v1/scheduling/slots?providerLocationKey=<key>`. Same filters as `/slots`. Requires a valid API key.

GET /v1/scheduling/provider-locations (searchProviderLocations): https://docs.haau3.com/api-reference/scheduling/search-provider-locations

func (*Client) SearchQuestionnaire

func (c *Client) SearchQuestionnaire(ctx context.Context, params SearchQuestionnaireParams, opts ...Option) (*fhir.Bundle, error)

SearchQuestionnaire: List or find a questionnaire.

With no parameters, this lists the questionnaires this service holds copies of. Those render the same way on every request, and that list is what you can rely on.

Naming a canonical `url` reaches any questionnaire the source publishes, including ones this service holds no copy of. Those depend on the source being reachable, and when it cannot answer you get a `502`, `503` or `504` carrying an `OperationOutcome`, so a failure never arrives looking like an empty result.

A canonical that is the address of a form published at its own address, under `https://smart-health-checkin.org/connectathon/Questionnaire/` or another place this service is set up to reach, is fetched from that address and served exactly as published, its entry's `fullUrl` the address it was fetched from. Any other canonical matches nothing.

Two parameters are offered: `url` (the canonical, optionally as `{url}|{version}`) and `version`. Every other parameter, `status` included, is refused by name rather than ignored, so a search never quietly answers a different question than the one asked. Results are never paged: one page, with `total` set.

Questionnaires are served exactly as their source publishes them. Each carries its own `copyright`, which must be kept with the form wherever it goes.

GET /v1/fhir/r4/Questionnaire (searchQuestionnaire): https://docs.haau3.com/api-reference/questionnaires/list-or-find-a-questionnaire

func (*Client) SearchSlots

func (c *Client) SearchSlots(ctx context.Context, params SearchSlotsParams, opts ...Option) (*SearchSlotsResponse, error)

SearchSlots: Search appointment slots.

Returns provider availability slots matching the filters, with pagination. Requires a valid API key.

GET /v1/scheduling/slots (searchSlots): https://docs.haau3.com/api-reference/scheduling/search-appointment-slots

Example
package main

import (
	"context"
	"fmt"

	"github.com/haau3/haau3-go"
)

func main() {
	client, err := haau3.NewClient()
	if err != nil {
		return
	}
	found, err := client.SearchSlots(context.Background(), haau3.SearchSlotsParams{City: new("Boston"), State: new("MA"), Limit: new(10)})
	if err != nil {
		return
	}
	fmt.Println(found.Total, len(found.Slots))
}

func (*Client) String

func (c *Client) String() string

String names the client by its base URL; never its key.

func (*Client) ValueSetExpand

func (c *Client) ValueSetExpand(ctx context.Context, params ValueSetExpandParams, opts ...Option) (*fhir.ValueSet, error)

ValueSetExpand: Expand a value set.

FHIR `ValueSet/$expand`. Expands a value set canonical to its member codes, with an optional text filter and paging (`count=0` returns the total only).

GET /v1/fhir/r4/ValueSet/$expand (valueSetExpand): https://docs.haau3.com/api-reference/terminology/expand-a-value-set

func (*Client) ValueSetExpandPost

func (c *Client) ValueSetExpandPost(ctx context.Context, body *fhir.Parameters, opts ...Option) (*fhir.ValueSet, error)

ValueSetExpandPost: Expand a value set.

FHIR `ValueSet/$expand`. Expands a value set canonical to its member codes, with an optional text filter and paging (`count=0` returns the total only).

POST /v1/fhir/r4/ValueSet/$expand (valueSetExpandPost): https://docs.haau3.com/api-reference/terminology/expand-a-value-set-1

func (*Client) ValueSetValidateCode

func (c *Client) ValueSetValidateCode(ctx context.Context, params ValueSetValidateCodeParams, opts ...Option) (*fhir.Parameters, error)

ValueSetValidateCode: Validate a code against a value set.

FHIR `ValueSet/$validate-code`. A code that is not in the set is a successful `200` with `result: false`, not an error. On POST, a `coding` or `codeableConcept` parameter may stand in for `system` + `code`; a codeableConcept validates if any of its codings is in the set, which helps when an element carries a vendor-local coding alongside a standard one.

GET /v1/fhir/r4/ValueSet/$validate-code (valueSetValidateCode): https://docs.haau3.com/api-reference/terminology/validate-a-code-against-a-value-set

func (*Client) ValueSetValidateCodePost

func (c *Client) ValueSetValidateCodePost(ctx context.Context, body *fhir.Parameters, opts ...Option) (*fhir.Parameters, error)

ValueSetValidateCodePost: Validate a code against a value set.

FHIR `ValueSet/$validate-code`. A code that is not in the set is a successful `200` with `result: false`, not an error. On POST, a `coding` or `codeableConcept` parameter may stand in for `system` + `code`; a codeableConcept validates if any of its codings is in the set, which helps when an element carries a vendor-local coding alongside a standard one.

POST /v1/fhir/r4/ValueSet/$validate-code (valueSetValidateCodePost): https://docs.haau3.com/api-reference/terminology/validate-a-code-against-a-value-set-1

type CodeSystemLookupParams

type CodeSystemLookupParams struct {
	// Code is `code`, required. The code to look up in the code system.
	Code string

	// System is `system`. Code system URI to look up against. Defaults to LOINC (`http://loinc.org`).
	System *string

	// Version is `version`. Optional code system version. Defaults to the server's current version.
	Version *string

	// Property is `property`. Property to return, repeatable up to 100 times. Narrows the response to
	// the named properties of the code system; omit it to receive all of them. An unrecognised
	// property name is silently omitted from the response, so treat an absent property as 'no answer',
	// never as a negative. More than 100 is refused with a `400` coded `too-long`.
	Property []string

	// DisplayLanguage is `displayLanguage`. Language for the returned display and designations.
	// Defaults to `en-US`, which also keeps answers small, since a code can have about 30
	// translations.
	DisplayLanguage *string

	// Date is `date`. The date for which the lookup should be valid.
	Date *string
}

CodeSystemLookupParams holds CodeSystemLookup's query parameters. A nil field is not sent.

type CodeSystemValidateCodeParams

type CodeSystemValidateCodeParams struct {
	// URL is `url`. Canonical URL of the **code system**. Defaults to LOINC (`http://loinc.org`).
	URL *string

	// Code is `code`, required. The code to validate.
	Code string

	// Version is `version`. Optional code system version.
	Version *string

	// Display is `display`. Optional display to check against the code's own display. A mismatch
	// returns `result: false` with the expected display alongside, which means the code is valid and
	// only the label differs. Do not read that as an invalid code.
	Display *string

	// DisplayLanguage is `displayLanguage`. Language to use when checking the display.
	DisplayLanguage *string

	// Date is `date`. The date for which the validation should be valid.
	Date *string
}

CodeSystemValidateCodeParams holds CodeSystemValidateCode's query parameters. A nil field is not sent.

type Entry

type Entry interface {
	// contains filtered or unexported methods
}

Entry is one entry of a batch: a *Call that Calls made.

type Error

type Error struct {
	// Kind says which error this is.
	Kind Kind
	// Status is the HTTP status the API answered with, or 0 when it did not answer.
	Status int
	// Reason says why there was no answer, for KindNoAnswer.
	Reason Reason
	// RetryAfter is how long to wait before trying again, when the API said (its Retry-After header).
	RetryAfter time.Duration
	// Attempts is how many attempts were made: 0 for a request that was not sent.
	Attempts int
	// Duration is from the first attempt to the last answer, waits between attempts included.
	Duration time.Duration
	// RequestID is the X-Request-Id the API answered with. Quote it when you ask for help.
	RequestID string
	// CorrelationID is the id you sent with WithCorrelationID, as the API returned it in
	// X-Correlation-Id.
	CorrelationID string
	// Detail is, for a timeout or a network failure, what failed, safe to log: "dial: connection
	// refused". It never holds an address.
	Detail string
	// contains filtered or unexported fields
}

Error is every error the SDK returns, but for your own context's: a cancelled or expired ctx returns an error that errors.Is reports as the context's own.

plan, err := client.ReadInsurancePlan(ctx, id)
var e *haau3.Error
if errors.As(err, &e) {
	switch e.Kind {
	case haau3.KindRefused: // e.Status, e.Outcome()
	case haau3.KindNoAnswer: // e.Reason, e.RetryAfter, e.Detail
	}
}

An Error never prints the body the API answered with, by any of fmt's verbs, by slog, or by json.Marshal: Outcome and Problem are the only ways to read it. Its message names the request by its method and the operation's path, never by a value you sent.

func (*Error) Error

func (e *Error) Error() string

Error is what happened, naming the request but never a value you sent or the body.

func (*Error) Format

func (e *Error) Format(f fmt.State, verb rune)

Format prints the error's message for every verb, and %#v as GoString does, so no verb reaches a field that holds a body.

func (*Error) GoString

func (e *Error) GoString() string

GoString is the error's log-safe fields as Go syntax.

func (*Error) Is

func (e *Error) Is(target error) bool

Is reports whether e is of the kind a sentinel names: errors.Is(err, haau3.ErrNoAnswer).

func (*Error) LogValue

func (e *Error) LogValue() slog.Value

LogValue is the error as slog logs it: the fields that are set and safe to log, never the body or the cause.

slog.Warn("the plan read failed", "error", err)

func (*Error) MarshalJSON

func (e *Error) MarshalJSON() ([]byte, error)

MarshalJSON is the error as a JSON object of the fields that are set and safe to log, the same keys LogValue gives and the TypeScript SDK's toJSON() gives.

func (*Error) Outcome

func (e *Error) Outcome() *fhir.OperationOutcome

Outcome is the OperationOutcome the FHIR base answered an error with, or nil. It is never printed when the error is.

func (*Error) Problem

func (e *Error) Problem() *Problem

Problem is the problem (RFC 9457) the other services answered an error with, or nil. It is never printed when the error is.

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap is the transport error behind a no-answer, so errors.Is(err, context.DeadlineExceeded) and errors.As(err, &netErr) work. Its own message names the request's URL, never a body or the key; the SDK never prints it.

type FHIRMetadataParams

type FHIRMetadataParams struct {
	// Mode is `mode`. Pass `terminology` for a `TerminologyCapabilities` resource instead of the
	// `CapabilityStatement`. `full`, the default, returns the `CapabilityStatement`. No other mode is
	// served. One of: full, terminology.
	Mode *string
}

FHIRMetadataParams holds FHIRMetadata's query parameters. A nil field is not sent.

type Kind

type Kind int

Kind is which of the SDK's errors an Error is.

const (
	// KindNotSent is a request the SDK refused to send: no API key, a URL on another host than the
	// client's base URL, a correlation id that is not a UUID, a required parameter left empty.
	KindNotSent Kind = iota + 1
	// KindAuth is the API refusing the key: none was sent, it is not one the API knows, or it was
	// revoked (401, 403).
	KindAuth
	// KindRefused is the API answering and refusing the request: a parameter it does not take, a
	// record that does not exist (404), a page that no longer exists (410), a body that is too
	// large (413). Status says which, and the body says why.
	KindRefused
	// KindNoAnswer is a request that got no answer, after every attempt the client was allowed.
	// Reason says why. It never means "no results": an empty search answers with an empty Bundle
	// or list, not with this error.
	KindNoAnswer
)

func (Kind) String

func (k Kind) String() string

type ListInsurancePlanCountiesParams

type ListInsurancePlanCountiesParams struct {
	// State is `state`, required. The two-letter USPS code of a state, the District of Columbia or a
	// territory: `FL`.
	State string
}

ListInsurancePlanCountiesParams holds ListInsurancePlanCounties's query parameters. A nil field is not sent.

type ListPublishersResponse

type ListPublishersResponse struct {
	Publishers []SchedulingPublisher `json:"publishers"`
}

type ListServiceTypesParams

type ListServiceTypesParams struct {
	// IncludePast is `includePast`. Also count slots that started before now. Defaults to `false`, so
	// the counts cover the slots a search with no `startAfter` returns.
	IncludePast *bool
}

ListServiceTypesParams holds ListServiceTypes's query parameters. A nil field is not sent.

type ListServiceTypesResponse

type ListServiceTypesResponse struct {
	ServiceTypes []SchedulingServiceType `json:"serviceTypes"`
}

type ListSpecialtiesParams

type ListSpecialtiesParams struct {
	// IncludePast is `includePast`. Also count slots that started before now. Defaults to `false`, so
	// the counts cover the slots a search with no `startAfter` returns.
	IncludePast *bool
}

ListSpecialtiesParams holds ListSpecialties's query parameters. A nil field is not sent.

type ListSpecialtiesResponse

type ListSpecialtiesResponse struct {
	Specialties []SchedulingSpecialty `json:"specialties"`
}

type Option

type Option func(*settings)

Option sets how a client, or one call, sends its requests. The same options are given to NewClient and to each method; one given to a call applies to that call only.

client, err := haau3.NewClient(haau3.WithTimeout(20 * time.Second))
slots, err := client.SearchSlots(ctx, params, haau3.WithMaxRetries(0))

WithBaseURL and WithHTTPClient are for NewClient only, and WithCorrelationID and WithResponseInfo for a call only; either given in the other place is refused with an error of KindNotSent.

func WithAPIKey

func WithAPIKey(key string) Option

WithAPIKey sets the platform API key. Without it, NewClient reads HAAU3_API_KEY from the environment. Create a key on platform.haau3.com.

func WithBaseURL

func WithBaseURL(url string) Option

WithBaseURL sets where the API is: an http or https URL with a host. It defaults to HAAU3_BASE_URL when that is set, and to https://api.haau3.com otherwise. The API key is sent there only. For NewClient only.

func WithCorrelationID

func WithCorrelationID(id string) Option

WithCorrelationID sends an id of your own, such as your job's or your trace's, with the request. It must be a UUID, which is all the API keeps; anything else is refused before it is sent. The API keeps it with its record of the request, and returns it on the answer (ResponseInfo) and on every error it answered. For a call only.

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient sets the *http.Client the SDK sends with: your own, for a proxy, certificates, connection limits or tracing, set on its Transport. The SDK uses a copy that never follows a redirect, and never changes or closes yours. For NewClient only.

func WithHeader

func WithHeader(name, value string) Option

WithHeader sends a header with each request. The SDK's own headers can be replaced this way, the key's included, so use it for what no other option does.

func WithMaxRetries

func WithMaxRetries(n int) Option

WithMaxRetries sets how many times a request is tried again after a timeout, a network failure, a 429 or a 5xx: 1 by default, 0 for none.

func WithResponseInfo

func WithResponseInfo(info *ResponseInfo) Option

WithResponseInfo fills in info when the call succeeds: the request id and timing that came with the answer. For a call only.

var info haau3.ResponseInfo
plan, err := client.ReadInsurancePlan(ctx, id, haau3.WithResponseInfo(&info))
slog.Info("plan read", "requestId", info.RequestID, "duration", info.Duration)
Example
package main

import (
	"context"
	"fmt"

	"github.com/haau3/haau3-go"
)

func main() {
	client, err := haau3.NewClient()
	if err != nil {
		return
	}
	var info haau3.ResponseInfo
	if _, err := client.ReadInsurancePlan(context.Background(), "H2406-013-000", haau3.WithResponseInfo(&info)); err != nil {
		return
	}
	fmt.Println(info.RequestID, info.Duration, info.Attempts)
}

func WithTimeout

func WithTimeout(d time.Duration) Option

WithTimeout sets how long one attempt may take, sending and reading its answer: 65 seconds by default, a little longer than the 60 seconds the API gives a batch. A context's deadline bounds the whole call, retries included.

type Problem

type Problem struct {
	// What kind of problem this is: an anchor on https://docs.haau3.com/errors.
	Type string `json:"type"`
	// A short summary, the same for every occurrence of the type.
	Title string `json:"title"`
	// The HTTP status code of this response.
	Status int `json:"status"`
	// What went wrong this time, and how to correct it.
	Detail string `json:"detail"`
	// This request's id as `urn:uuid:<id>`, the same id as the `X-Request-Id` header.
	Instance string `json:"instance"`
	// On a 400: one entry per parameter that is not valid.
	Issues []ProblemIssue `json:"issues,omitempty"`
}

type ProblemIssue

type ProblemIssue struct {
	// The parameter, or the field within it, that is not valid.
	Path []any `json:"path"`
	// Why it is not valid.
	Message string `json:"message"`
}

type RawRequest

type RawRequest struct {
	// Method is GET or POST.
	Method string
	// Path is a path such as /v1/scheduling/publishers, or a whole URL on the client's base URL.
	Path string
	// Query is sent with the API's own parameter names, in name order.
	Query url.Values
	// Body is sent as it is when it is a string or a []byte, and as JSON otherwise. Nil sends none.
	Body any
}

RawRequest is a request as you write it, for Client.Request.

type RawResponse

type RawResponse struct {
	// Status is the HTTP status.
	Status int
	// StatusText is its reason phrase, such as "Not Found".
	StatusText string
	// Header is the answer's headers.
	Header http.Header
	// RequestID is the X-Request-Id the API answered with.
	RequestID string
	// CorrelationID is the id you sent with WithCorrelationID, as the API returned it.
	CorrelationID string
	// Attempts is how many attempts were made.
	Attempts int
	// Duration is from the first attempt to the answer, waits between attempts included.
	Duration time.Duration
	// contains filtered or unexported fields
}

RawResponse is what the API answered, whatever its status. Printing it shows its status, never its body.

func (*RawResponse) Body

func (r *RawResponse) Body() []byte

Body is the answer's body as it arrived.

func (*RawResponse) Format

func (r *RawResponse) Format(f fmt.State, _ rune)

Format prints String for every verb.

func (*RawResponse) GoString

func (r *RawResponse) GoString() string

GoString is String, so %#v shows no body either.

func (*RawResponse) String

func (r *RawResponse) String() string

String names the response by its status, never its body.

type Reason

type Reason string

Reason is why a request got no answer.

const (
	// ReasonTimeout is an attempt that ran past its timeout, or the API answering 504.
	ReasonTimeout Reason = "timeout"
	// ReasonNetwork is a request that never reached the API, or a connection that failed.
	ReasonNetwork Reason = "network"
	// ReasonRateLimited is the API answering 429. RetryAfter says when to try again.
	ReasonRateLimited Reason = "rate-limited"
	// ReasonUnavailable is the API, or a source it reads, that could not answer (502, 503).
	ReasonUnavailable Reason = "unavailable"
	// ReasonServerError is the API failing (500).
	ReasonServerError Reason = "server-error"
	// ReasonUnreadable is an answer that is not one: a body that is not JSON, a FHIR resource of
	// another type than the operation answers with, or one that does not read as its type.
	ReasonUnreadable Reason = "unreadable"
)

type ResponseInfo

type ResponseInfo struct {
	// Status is the HTTP status of the answer.
	Status int
	// StatusText is its reason phrase, such as "OK".
	StatusText string
	// Header is the answer's headers.
	Header http.Header
	// RequestID is the X-Request-Id the API answered with. Quote it when you ask for help: it
	// finds the request in the API's own logs.
	RequestID string
	// CorrelationID is the id you sent with WithCorrelationID, as the API returned it.
	CorrelationID string
	// Attempts is how many attempts were made.
	Attempts int
	// Duration is from the first attempt to the answer, waits between attempts included.
	Duration time.Duration
}

ResponseInfo is what came with an answer, as WithResponseInfo gives it.

type SchedulingProviderLocation

type SchedulingProviderLocation struct {
	Key          string                                  `json:"key"`
	Publisher    string                                  `json:"publisher"`
	Provider     *SchedulingProviderLocationProvider     `json:"provider,omitempty"`
	Location     *SchedulingProviderLocationLocation     `json:"location,omitempty"`
	ServiceTypes []SchedulingProviderLocationServiceType `json:"serviceTypes"`
	Specialties  []SchedulingProviderLocationSpecialty   `json:"specialties"`
	// One of: online, phone, contact.
	BookingMethod string `json:"bookingMethod"`
	IsVirtual     *bool  `json:"isVirtual,omitempty"`
	// One of: nopt, newpt, existptonly, existptfam.
	AcceptingPatients  *string    `json:"acceptingPatients,omitempty"`
	NextAvailableStart *time.Time `json:"nextAvailableStart,omitempty"`
	TotalSlots         int        `json:"totalSlots"`
}

type SchedulingProviderLocationLocation

type SchedulingProviderLocationLocation struct {
	ID           *string                                         `json:"id,omitempty"`
	Identifier   []SchedulingProviderLocationLocationIdentifier  `json:"identifier,omitempty"`
	Name         *string                                         `json:"name,omitempty"`
	Phone        []string                                        `json:"phone,omitempty"`
	Website      []string                                        `json:"website,omitempty"`
	AddressLine  []string                                        `json:"addressLine,omitempty"`
	City         *string                                         `json:"city,omitempty"`
	State        *string                                         `json:"state,omitempty"`
	PostalCode   *string                                         `json:"postalCode,omitempty"`
	PhysicalType *SchedulingProviderLocationLocationPhysicalType `json:"physicalType,omitempty"`
	Description  *string                                         `json:"description,omitempty"`
	Position     *SchedulingProviderLocationLocationPosition     `json:"position,omitempty"`
}

type SchedulingProviderLocationLocationIdentifier

type SchedulingProviderLocationLocationIdentifier struct {
	System *string `json:"system,omitempty"`
	Value  string  `json:"value"`
}

type SchedulingProviderLocationLocationPhysicalType

type SchedulingProviderLocationLocationPhysicalType struct {
	System *string `json:"system,omitempty"`
	Code   string  `json:"code"`
}

type SchedulingProviderLocationLocationPosition

type SchedulingProviderLocationLocationPosition struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

type SchedulingProviderLocationProvider

type SchedulingProviderLocationProvider struct {
	ID         *string                                        `json:"id,omitempty"`
	Identifier []SchedulingProviderLocationProviderIdentifier `json:"identifier,omitempty"`
	// One of: practitioner, practitioner-role, healthcare-service.
	Type        *string                                       `json:"type,omitempty"`
	Name        *string                                       `json:"name,omitempty"`
	Specialty   *string                                       `json:"specialty,omitempty"`
	Specialties []SchedulingProviderLocationProviderSpecialty `json:"specialties,omitempty"`
	NPI         *string                                       `json:"npi,omitempty"`
}

type SchedulingProviderLocationProviderIdentifier

type SchedulingProviderLocationProviderIdentifier struct {
	System *string `json:"system,omitempty"`
	Value  string  `json:"value"`
}

type SchedulingProviderLocationProviderSpecialty

type SchedulingProviderLocationProviderSpecialty struct {
	System  *string `json:"system,omitempty"`
	Code    *string `json:"code,omitempty"`
	Display *string `json:"display,omitempty"`
}

type SchedulingProviderLocationServiceType

type SchedulingProviderLocationServiceType struct {
	System  *string `json:"system,omitempty"`
	Code    *string `json:"code,omitempty"`
	Display *string `json:"display,omitempty"`
}

type SchedulingProviderLocationSpecialty

type SchedulingProviderLocationSpecialty struct {
	System  *string `json:"system,omitempty"`
	Code    *string `json:"code,omitempty"`
	Display *string `json:"display,omitempty"`
}

type SchedulingPublisher

type SchedulingPublisher struct {
	Slug        string `json:"slug"`
	DisplayName string `json:"displayName"`
	ManifestURL string `json:"manifestUrl"`
	Enabled     bool   `json:"enabled"`
}

type SchedulingServiceType

type SchedulingServiceType struct {
	System  *string `json:"system,omitempty"`
	Code    *string `json:"code,omitempty"`
	Display *string `json:"display,omitempty"`
	Count   int     `json:"count"`
}

type SchedulingSlot

type SchedulingSlot struct {
	ID         string `json:"id"`
	Publisher  string `json:"publisher"`
	ScheduleID string `json:"scheduleId"`
	// One of: free, busy, busy-unavailable, busy-tentative.
	Status          string                      `json:"status"`
	Start           time.Time                   `json:"start"`
	End             time.Time                   `json:"end"`
	ServiceTypeCode *string                     `json:"serviceTypeCode,omitempty"`
	ServiceTypeText *string                     `json:"serviceTypeText,omitempty"`
	ServiceTypes    []SchedulingSlotServiceType `json:"serviceTypes,omitempty"`
	Specialties     []SchedulingSlotSpecialty   `json:"specialties,omitempty"`
	AppointmentType *string                     `json:"appointmentType,omitempty"`
	// One of: nopt, newpt, existptonly, existptfam.
	AcceptingPatients *string                 `json:"acceptingPatients,omitempty"`
	IsVirtual         *bool                   `json:"isVirtual,omitempty"`
	BookingDeepLink   *string                 `json:"bookingDeepLink,omitempty"`
	BookingPhone      *string                 `json:"bookingPhone,omitempty"`
	Location          *SchedulingSlotLocation `json:"location,omitempty"`
	Provider          *SchedulingSlotProvider `json:"provider,omitempty"`
	Source            *SchedulingSlotSource   `json:"source,omitempty"`
}

type SchedulingSlotLocation

type SchedulingSlotLocation struct {
	ID           *string                             `json:"id,omitempty"`
	Identifier   []SchedulingSlotLocationIdentifier  `json:"identifier,omitempty"`
	Name         *string                             `json:"name,omitempty"`
	Phone        []string                            `json:"phone,omitempty"`
	Website      []string                            `json:"website,omitempty"`
	AddressLine  []string                            `json:"addressLine,omitempty"`
	City         *string                             `json:"city,omitempty"`
	State        *string                             `json:"state,omitempty"`
	PostalCode   *string                             `json:"postalCode,omitempty"`
	PhysicalType *SchedulingSlotLocationPhysicalType `json:"physicalType,omitempty"`
	Description  *string                             `json:"description,omitempty"`
	Position     *SchedulingSlotLocationPosition     `json:"position,omitempty"`
}

type SchedulingSlotLocationIdentifier

type SchedulingSlotLocationIdentifier struct {
	System *string `json:"system,omitempty"`
	Value  string  `json:"value"`
}

type SchedulingSlotLocationPhysicalType

type SchedulingSlotLocationPhysicalType struct {
	System *string `json:"system,omitempty"`
	Code   string  `json:"code"`
}

type SchedulingSlotLocationPosition

type SchedulingSlotLocationPosition struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

type SchedulingSlotProvider

type SchedulingSlotProvider struct {
	ID         *string                            `json:"id,omitempty"`
	Identifier []SchedulingSlotProviderIdentifier `json:"identifier,omitempty"`
	// One of: practitioner, practitioner-role, healthcare-service.
	Type        *string                           `json:"type,omitempty"`
	Name        *string                           `json:"name,omitempty"`
	Specialty   *string                           `json:"specialty,omitempty"`
	Specialties []SchedulingSlotProviderSpecialty `json:"specialties,omitempty"`
}

type SchedulingSlotProviderIdentifier

type SchedulingSlotProviderIdentifier struct {
	System *string `json:"system,omitempty"`
	Value  string  `json:"value"`
}

type SchedulingSlotProviderSpecialty

type SchedulingSlotProviderSpecialty struct {
	System  *string `json:"system,omitempty"`
	Code    *string `json:"code,omitempty"`
	Display *string `json:"display,omitempty"`
}

type SchedulingSlotServiceType

type SchedulingSlotServiceType struct {
	System  *string `json:"system,omitempty"`
	Code    *string `json:"code,omitempty"`
	Display *string `json:"display,omitempty"`
}

type SchedulingSlotSource

type SchedulingSlotSource struct {
	Publisher       string    `json:"publisher"`
	ResourceID      string    `json:"resourceId"`
	TransactionTime time.Time `json:"transactionTime"`
	SyncedAt        time.Time `json:"syncedAt"`
}

type SchedulingSlotSpecialty

type SchedulingSlotSpecialty struct {
	System  *string `json:"system,omitempty"`
	Code    *string `json:"code,omitempty"`
	Display *string `json:"display,omitempty"`
}

type SchedulingSpecialty

type SchedulingSpecialty struct {
	System  *string `json:"system,omitempty"`
	Code    *string `json:"code,omitempty"`
	Display *string `json:"display,omitempty"`
	Count   int     `json:"count"`
}

type SearchEndpointParams

type SearchEndpointParams struct {
	// Organization is `organization`. The endpoints one organization manages. Give a Organization id,
	// `Organization/{id}`, or the `fullUrl` this service returned. An address on another server is
	// refused.
	Organization *string

	// ConnectionType is `connection-type`. A connection type from
	// `http://terminology.hl7.org/CodeSystem/endpoint-connection-type`, bare or with that system: for
	// example `hl7-fhir-rest` or `direct-project`. Narrows a search; cannot be used on its own.
	ConnectionType *string

	// Status is `status`. `active`, `suspended`, `error`, `off`, `entered-in-error` or `test`. Narrows
	// a search; cannot be used on its own.
	Status *string

	// Name is `name`. Matches the endpoint's name. Narrows a search; cannot be used on its own,
	// because most of the directory's endpoints share one name.
	Name *string

	// Include is `_include`. `Endpoint:organization` brings the organization that manages each
	// endpoint. Repeat the parameter to include several. Included entries do not count toward
	// `_count`. One of: Endpoint:organization.
	Include []string

	// ID is `_id`. A Endpoint id. Searching by id rather than reading it lets one request also bring
	// the records an `_include` or `_revinclude` names.
	ID *string

	// Summary is `_summary`. `count` only: answers how many records match, as `total`, with no
	// entries. Cannot be combined with `_include`, `_revinclude`, `_count` or `page`. One of: count.
	Summary *string

	// Count is `_count`. Results are paged. `_count` sets the page size (1 to 100); a larger value is
	// refused rather than quietly reduced. Follow `link` with relation `next` to continue. The cursor
	// it carries is opaque and must not be constructed or modified.
	Count *int

	// Page is `page`. Continuation cursor. Opaque: follow the `next` link from a previous response,
	// and never construct or modify it. Cursors expire.
	Page *string
}

SearchEndpointParams holds SearchEndpoint's query parameters. A nil field is not sent.

type SearchHealthcareServiceParams

type SearchHealthcareServiceParams struct {
	// Location is `location`. The services offered at one location. Give a Location id,
	// `Location/{id}`, or the `fullUrl` this service returned. An address on another server is
	// refused.
	Location *string

	// Network is `network`. The services the directory lists in one insurance network. Cannot be used
	// on its own: send it beside `location`. A search that breaks this rule is refused before the
	// directory is asked. Give a Organization id, `Organization/{id}`, or the `fullUrl` this service
	// returned. An address on another server is refused.
	Network *string

	// Active is `active`. `true` or `false`. Narrows a search; cannot be used on its own.
	Active *bool

	// ID is `_id`. A HealthcareService id. Searching by id rather than reading it lets one request
	// also bring the records an `_include` or `_revinclude` names.
	ID *string

	// Summary is `_summary`. `count` only: answers how many records match, as `total`, with no
	// entries. Cannot be combined with `_include`, `_revinclude`, `_count` or `page`. One of: count.
	Summary *string

	// Count is `_count`. Results are paged. `_count` sets the page size (1 to 100); a larger value is
	// refused rather than quietly reduced. Follow `link` with relation `next` to continue. The cursor
	// it carries is opaque and must not be constructed or modified.
	Count *int

	// Page is `page`. Continuation cursor. Opaque: follow the `next` link from a previous response,
	// and never construct or modify it. Cursors expire.
	Page *string
}

SearchHealthcareServiceParams holds SearchHealthcareService's query parameters. A nil field is not sent.

type SearchInsurancePlanParams

type SearchInsurancePlanParams struct {
	// Identifier is `identifier`. A plan id, as `value` or `system|value`. A Medicare Advantage plan
	// by CMS's plan id (`http://cms.gov/medicare/ma-plan-id`, the segment in three digits:
	// `H2406-013-000`) or its bid_id (`https://haau3.com/fhir/NamingSystem/cms-ma-bid-id`:
	// `H2406_013_0`). A Marketplace plan by its HIOS plan id
	// (`https://haau3.com/fhir/NamingSystem/hios-plan-id`: `19898FL0340001-01`) or its standard
	// component (`https://haau3.com/fhir/NamingSystem/hios-standard-component-id`: `19898FL0340001`),
	// which finds every variant.
	Identifier *string

	// Name is `name`. The start of the plan's name, ignoring case and accents. `name:contains` matches
	// anywhere in the name and `name:exact` the whole name exactly; give one form.
	Name *string

	// NameContains is `name:contains`. Part of the plan's name, anywhere in it, ignoring case and
	// accents.
	NameContains *string

	// NameExact is `name:exact`. The plan's whole name, exactly.
	NameExact *string

	// CoverageAreaState is `coverage-area-state`. A two-letter state code: the plans sold in that
	// state. Defined by the haau3 implementation guide
	// (`https://haau3.com/fhir/SearchParameter/InsurancePlan-coverage-area-state`).
	CoverageAreaState *string

	// CoverageAreaCounty is `coverage-area-county`. A five-digit FIPS state and county code (`12086`,
	// Miami-Dade County, Florida), bare or as `http://terminology.hl7.org/CodeSystem/FIPS64|12086`:
	// the plans sold in that county, in whole or in part. A code that names no county is refused.
	// Defined by the haau3 implementation guide
	// (`https://haau3.com/fhir/SearchParameter/InsurancePlan-coverage-area-county`).
	CoverageAreaCounty *string

	// Type is `type`. `mediadv` for Medicare Advantage or `qhp` for the Marketplace, from
	// `http://terminology.hl7.org/CodeSystem/insurance-product-type`.
	Type *string

	// SoldTo is `sold-to`. `individuals` for the plans a person can buy on their own, or
	// `employer-groups` for the plans sold only to employer and union groups (Medicare Advantage) or
	// to small employers (Marketplace SHOP plans). Narrows a search; it is not one by itself. Defined
	// by the haau3 implementation guide
	// (`https://haau3.com/fhir/SearchParameter/InsurancePlan-sold-to`). One of: individuals,
	// employer-groups.
	SoldTo *string

	// Count is `_count`. Page size. A larger value is refused rather than quietly reduced.
	Count *int

	// Page is `page`. The cursor a `next` link carries. It is opaque and belongs to one search; once
	// the plans are updated a later page answers `410`, so start the search again.
	Page *string
}

SearchInsurancePlanParams holds SearchInsurancePlan's query parameters. A nil field is not sent.

type SearchLocationParams

type SearchLocationParams struct {
	// Organization is `organization`. The locations one organization manages. Give a Organization id,
	// `Organization/{id}`, or the `fullUrl` this service returned. An address on another server is
	// refused.
	Organization *string

	// Name is `name`. Matches the location's name.
	Name *string

	// AddressCity is `address-city`. Narrows a search by city; cannot be used on its own.
	AddressCity *string

	// AddressState is `address-state`. Narrows a search by state; cannot be used on its own.
	AddressState *string

	// AddressPostalcode is `address-postalcode`. Narrows a search by postal code; cannot be used on
	// its own.
	AddressPostalcode *string

	// Status is `status`. `active`, `suspended` or `inactive`. Narrows a search; cannot be used on its
	// own.
	Status *string

	// Include is `_include`. `Location:organization` brings the organization that manages each
	// location. Repeat the parameter to include several. Included entries do not count toward
	// `_count`. One of: Location:organization.
	Include []string

	// Revinclude is `_revinclude`. `PractitionerRole:location` brings the roles held at each location.
	// Repeat the parameter to include several. Included entries do not count toward `_count`. The
	// directory returns at most 100 included records per page; a page with more is refused with a 502
	// rather than served short. One of: PractitionerRole:location.
	Revinclude []string

	// ID is `_id`. A Location id. Searching by id rather than reading it lets one request also bring
	// the records an `_include` or `_revinclude` names.
	ID *string

	// Summary is `_summary`. `count` only: answers how many records match, as `total`, with no
	// entries. Cannot be combined with `_include`, `_revinclude`, `_count` or `page`. One of: count.
	Summary *string

	// Count is `_count`. Results are paged. `_count` sets the page size (1 to 100); a larger value is
	// refused rather than quietly reduced. Follow `link` with relation `next` to continue. The cursor
	// it carries is opaque and must not be constructed or modified.
	Count *int

	// Page is `page`. Continuation cursor. Opaque: follow the `next` link from a previous response,
	// and never construct or modify it. Cursors expire.
	Page *string
}

SearchLocationParams holds SearchLocation's query parameters. A nil field is not sent.

type SearchOrganizationAffiliationParams

type SearchOrganizationAffiliationParams struct {
	// Network is `network`. The affiliations the directory lists in one insurance network. An
	// organization the network's records do not list is not shown to be out of network: the
	// directory's network data is sparse. Give a Organization id, `Organization/{id}`, or the
	// `fullUrl` this service returned. An address on another server is refused.
	Network *string

	// PrimaryOrganization is `primary-organization`. The affiliations whose primary organization is
	// this one. Give a Organization id, `Organization/{id}`, or the `fullUrl` this service returned.
	// An address on another server is refused.
	PrimaryOrganization *string

	// ParticipatingOrganization is `participating-organization`. The affiliations one organization
	// participates in. Give a Organization id, `Organization/{id}`, or the `fullUrl` this service
	// returned. An address on another server is refused.
	ParticipatingOrganization *string

	// Active is `active`. `true` or `false`. Narrows a search; cannot be used on its own.
	Active *bool

	// Include is `_include`. Bring the organizations an affiliation names:
	// `OrganizationAffiliation:participating-organization`,
	// `OrganizationAffiliation:primary-organization` or `OrganizationAffiliation:network`. Repeat the
	// parameter to include several. Included entries do not count toward `_count`. One of:
	// OrganizationAffiliation:participating-organization,
	// OrganizationAffiliation:primary-organization, OrganizationAffiliation:network.
	Include []string

	// ID is `_id`. A OrganizationAffiliation id. Searching by id rather than reading it lets one
	// request also bring the records an `_include` or `_revinclude` names.
	ID *string

	// Summary is `_summary`. `count` only: answers how many records match, as `total`, with no
	// entries. Cannot be combined with `_include`, `_revinclude`, `_count` or `page`. One of: count.
	Summary *string

	// Count is `_count`. Results are paged. `_count` sets the page size (1 to 100); a larger value is
	// refused rather than quietly reduced. Follow `link` with relation `next` to continue. The cursor
	// it carries is opaque and must not be constructed or modified.
	Count *int

	// Page is `page`. Continuation cursor. Opaque: follow the `next` link from a previous response,
	// and never construct or modify it. Cursors expire.
	Page *string
}

SearchOrganizationAffiliationParams holds SearchOrganizationAffiliation's query parameters. A nil field is not sent.

type SearchOrganizationParams

type SearchOrganizationParams struct {
	// Name is `name`. Matches the organization's name.
	Name *string

	// Identifier is `identifier`. An organization's NPI, as `{system}|{npi}` or a bare 10-digit value,
	// under the same systems `Practitioner` accepts. An NPI search can return more than the practice
	// that holds the NPI: a parent organization that lists it among several NPIs is a match too,
	// because it carries the NPI as an NPI.
	Identifier *string

	// Partof is `partof`. The organizations that are part of one organization. Give a Organization id,
	// `Organization/{id}`, or the `fullUrl` this service returned. An address on another server is
	// refused.
	Partof *string

	// Type is `type`. An organization type from
	// `http://terminology.hl7.org/CodeSystem/organization-type`, bare or with that system: `prov` for
	// healthcare providers, `pay` for payers, `ntwk` for insurance networks. `ntwk` is also accepted
	// under Plan-Net's `http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/OrgTypeCS`.
	// `type=ntwk` and `type=pay` may stand alone, to list every network or every payer; any other type
	// narrows a search. The directory records networks by the text of their type rather than a code;
	// this service searches that text and confirms each answer is a network, and answers 502 rather
	// than serve one that is not.
	Type *string

	// Active is `active`. `true` or `false`. Narrows a search; cannot be used on its own.
	Active *bool

	// AddressCity is `address-city`. Narrows a search by city; cannot be used on its own. Matches any
	// of the organization's addresses, so a result can still list addresses in another city.
	AddressCity *string

	// AddressState is `address-state`. Narrows a search by state; cannot be used on its own. Matches
	// any of the organization's addresses, so a result can still list addresses in another state.
	AddressState *string

	// AddressPostalcode is `address-postalcode`. Narrows a search by postal code; cannot be used on
	// its own. Matches any of the organization's addresses, so a result can still list addresses in
	// another postal code.
	AddressPostalcode *string

	// Include is `_include`. `Organization:partof` brings the organization each match is part of.
	// Repeat the parameter to include several. Included entries do not count toward `_count`. One of:
	// Organization:partof.
	Include []string

	// Revinclude is `_revinclude`. Bring the records that point at each match:
	// `PractitionerRole:organization`, `OrganizationAffiliation:primary-organization`,
	// `OrganizationAffiliation:participating-organization`, `Location:organization`,
	// `Endpoint:organization` or `Organization:partof`. Repeat the parameter to include several.
	// Included entries do not count toward `_count`. The directory returns at most 100 included
	// records per page; a page with more is refused with a 502 rather than served short. One of:
	// PractitionerRole:organization, OrganizationAffiliation:primary-organization,
	// OrganizationAffiliation:participating-organization, Location:organization,
	// Endpoint:organization, Organization:partof.
	Revinclude []string

	// ID is `_id`. A Organization id. Searching by id rather than reading it lets one request also
	// bring the records an `_include` or `_revinclude` names.
	ID *string

	// Summary is `_summary`. `count` only: answers how many records match, as `total`, with no
	// entries. Cannot be combined with `_include`, `_revinclude`, `_count` or `page`. One of: count.
	Summary *string

	// Count is `_count`. Results are paged. `_count` sets the page size (1 to 100); a larger value is
	// refused rather than quietly reduced. Follow `link` with relation `next` to continue. The cursor
	// it carries is opaque and must not be constructed or modified.
	Count *int

	// Page is `page`. Continuation cursor. Opaque: follow the `next` link from a previous response,
	// and never construct or modify it. Cursors expire.
	Page *string
}

SearchOrganizationParams holds SearchOrganization's query parameters. A nil field is not sent.

type SearchPractitionerParams

type SearchPractitionerParams struct {
	// Identifier is `identifier`. An NPI, as `{system}|{npi}` or a bare 10-digit value. Accepted
	// systems: http://terminology.hl7.org/NamingSystem/npi, http://hl7.org/fhir/sid/us-npi,
	// urn:oid:2.16.840.1.113883.4.6. All of them resolve the same provider. Responses carry the
	// directory's own system, `http://hl7.org/fhir/sid/us-npi`, which may differ from the one you
	// sent. One NPI per search; use a batch Bundle to resolve several. Any other identifier system is
	// refused by name rather than searched, because a system the source does not index would answer
	// with an empty result that reads as 'no such provider'.
	Identifier *string

	// Name is `name`. Matches across the whole name.
	Name *string

	// Family is `family`. The family name.
	Family *string

	// Given is `given`. A given name.
	Given *string

	// AddressCity is `address-city`. Narrows a search by city; cannot be used on its own. Matches any
	// of the practitioner's addresses, so a result can still list addresses in another city.
	AddressCity *string

	// AddressState is `address-state`. Narrows a search by state; cannot be used on its own. Matches
	// any of the practitioner's addresses, so a result can still list addresses in another state.
	AddressState *string

	// Active is `active`. `true` or `false`. Narrows a search; cannot be used on its own.
	Active *bool

	// Revinclude is `_revinclude`. `PractitionerRole:practitioner` brings the practitioner's roles
	// into the same bundle. Repeat the parameter to include several. Included entries do not count
	// toward `_count`. The directory returns at most 100 included records per page; a page with more
	// is refused with a 502 rather than served short. One of: PractitionerRole:practitioner.
	Revinclude []string

	// ID is `_id`. A Practitioner id. Searching by id rather than reading it lets one request also
	// bring the records an `_include` or `_revinclude` names.
	ID *string

	// Summary is `_summary`. `count` only: answers how many records match, as `total`, with no
	// entries. Cannot be combined with `_include`, `_revinclude`, `_count` or `page`. One of: count.
	Summary *string

	// Count is `_count`. Results are paged. `_count` sets the page size (1 to 100); a larger value is
	// refused rather than quietly reduced. Follow `link` with relation `next` to continue. The cursor
	// it carries is opaque and must not be constructed or modified.
	Count *int

	// Page is `page`. Continuation cursor. Opaque: follow the `next` link from a previous response,
	// and never construct or modify it. Cursors expire.
	Page *string
}

SearchPractitionerParams holds SearchPractitioner's query parameters. A nil field is not sent.

type SearchPractitionerRoleParams

type SearchPractitionerRoleParams struct {
	// Practitioner is `practitioner`. The roles one practitioner holds. Give a Practitioner id,
	// `Practitioner/{id}`, or the `fullUrl` this service returned. An address on another server is
	// refused.
	Practitioner *string

	// Organization is `organization`. The roles held at one organization. Give a Organization id,
	// `Organization/{id}`, or the `fullUrl` this service returned. An address on another server is
	// refused.
	Organization *string

	// Location is `location`. The roles held at one location. Give a Location id, `Location/{id}`, or
	// the `fullUrl` this service returned. An address on another server is refused.
	Location *string

	// Endpoint is `endpoint`. The roles reached through one endpoint. Give a Endpoint id,
	// `Endpoint/{id}`, or the `fullUrl` this service returned. An address on another server is
	// refused.
	Endpoint *string

	// Specialty is `specialty`. A NUCC Health Care Provider Taxonomy code, bare or as
	// `http://nucc.org/provider-taxonomy|{code}` (for example `207RC0000X`, cardiovascular disease).
	// Any other system is refused, because the directory codes specialties in NUCC alone and would
	// answer another system with nothing. Narrows a search; cannot be used on its own.
	Specialty *string

	// Network is `network`. The roles the directory lists in one insurance network (an Organization of
	// type `ntwk`). Cannot be used on its own: send it beside `practitioner`, `organization`,
	// `location` or `specialty`. A search that breaks this rule is refused before the directory is
	// asked. Beside a specialty or a busy location the directory can take 10 to 15 seconds. A role the
	// network's records do not list is not shown to be out of network: the directory's network data is
	// sparse. Give a Organization id, `Organization/{id}`, or the `fullUrl` this service returned. An
	// address on another server is refused.
	Network *string

	// NewPatientFromNetwork is `new-patient-from-network`. The roles accepting new patients from one
	// insurance network. Cannot be used on its own: send it beside `practitioner`, `organization`,
	// `location` or `specialty`. A search that breaks this rule is refused before the directory is
	// asked. Give a Organization id, `Organization/{id}`, or the `fullUrl` this service returned. An
	// address on another server is refused.
	NewPatientFromNetwork *string

	// NewPatient is `new-patient`. Whether the role accepts new patients: `newpt`, `nopt`,
	// `existptonly` or `existptfam`, bare or under
	// `http://terminology.hl7.org/CodeSystem/accepting-patients`. Narrows a search; cannot be used on
	// its own.
	NewPatient *string

	// Active is `active`. `true` or `false`. Narrows a search; cannot be used on its own.
	Active *bool

	// Include is `_include`. Bring the records a role points to into the same bundle:
	// `PractitionerRole:practitioner`, `PractitionerRole:organization`, `PractitionerRole:location`,
	// `PractitionerRole:network` or `PractitionerRole:endpoint`. Repeat the parameter to include
	// several. Included entries do not count toward `_count`. One of: PractitionerRole:practitioner,
	// PractitionerRole:organization, PractitionerRole:location, PractitionerRole:network,
	// PractitionerRole:endpoint.
	Include []string

	// ID is `_id`. A PractitionerRole id. Searching by id rather than reading it lets one request also
	// bring the records an `_include` or `_revinclude` names.
	ID *string

	// Summary is `_summary`. `count` only: answers how many records match, as `total`, with no
	// entries. Cannot be combined with `_include`, `_revinclude`, `_count` or `page`. One of: count.
	Summary *string

	// Count is `_count`. Results are paged. `_count` sets the page size (1 to 100); a larger value is
	// refused rather than quietly reduced. Follow `link` with relation `next` to continue. The cursor
	// it carries is opaque and must not be constructed or modified.
	Count *int

	// Page is `page`. Continuation cursor. Opaque: follow the `next` link from a previous response,
	// and never construct or modify it. Cursors expire.
	Page *string
}

SearchPractitionerRoleParams holds SearchPractitionerRole's query parameters. A nil field is not sent.

type SearchProviderLocationsParams

type SearchProviderLocationsParams struct {
	// Status is `status`. Slot availability state to return. Defaults to `free`. One of: free, busy,
	// busy-unavailable, busy-tentative.
	Status *string

	// Publisher is `publisher`. Filter to a single publisher (source) by slug, such as `zocdoc` or
	// `defacto`. See `GET /v1/scheduling/publishers` for the available slugs.
	Publisher *string

	// ServiceTypeCode is `serviceTypeCode`. Filter by service type code (as published by the source).
	// A slot matches when any of its `serviceTypes` carries the code. A comma-separated list (up to
	// 100) matches a slot carrying any of them.
	ServiceTypeCode *string

	// NPI is `npi`. Filter by the provider's National Provider Identifier: a clinician's, or an
	// organization's when a healthcare service is the provider. Ten digits; a comma-separated list (up
	// to 100) matches a slot whose provider carries any of them. Matched as the publisher sent it, in
	// either NPI identifier system, across every publisher.
	NPI *string

	// Specialty is `specialty`. Filter by specialty: a slot matches when its provider's `specialties`
	// or its schedule's `specialties` carry the code. Send `code` to match it in any code system, or
	// `system|code` to match it in that system only. Codes are each publisher's own and are not
	// translated between code systems, so one code finds the publishers that use it; `GET
	// /v1/scheduling/specialties` lists them. A specialty sent as text only cannot be matched. A
	// comma-separated list (up to 100) matches any of them.
	Specialty *string

	// AppointmentType is `appointmentType`. Filter by appointment type.
	AppointmentType *string

	// AcceptingPatients is `acceptingPatients`. Filter to slots accepting patients of this kind (HL7
	// `accepting-patients` CodeSystem: `newpt` | `existptonly` | `existptfam`). Slots marked `nopt`
	// (not accepting patients) are never served, so `nopt` is not a valid filter value. Lenient: a
	// slot that does not declare an accepting-patients code matches any value (absence never hides a
	// slot); a slot that declares one must equal the requested value. One of: newpt, existptonly,
	// existptfam.
	AcceptingPatients *string

	// IsVirtual is `isVirtual`. Filter to virtual (`true`) or in-person (`false`) slots.
	IsVirtual *bool

	// City is `city`. Filter by the location's city.
	City *string

	// State is `state`. Filter by the location's state.
	State *string

	// StartAfter is `startAfter`. Only slots starting at or after this instant: ISO 8601 with seconds
	// and an offset, such as `2026-07-06T13:00:00-04:00` or `2026-07-06T17:00:00Z`. A value without
	// seconds is refused. When absent, slots start from now unless `includePast=true`.
	StartAfter *time.Time

	// StartBefore is `startBefore`. Only slots starting at or before this instant: ISO 8601 with
	// seconds and an offset, such as `2026-07-06T13:00:00-04:00` or `2026-07-06T17:00:00Z`. A value
	// without seconds is refused.
	StartBefore *time.Time

	// IncludePast is `includePast`. Include slots that started before now. Defaults to `false`: with
	// no `startAfter`, results start from now. An explicit `startAfter` applies as given either way.
	IncludePast *bool

	// Limit is `limit`. Page size: the number of provider locations, from 1 to 100. Defaults to 25.
	Limit *int

	// Offset is `offset`. Number of provider locations to skip for pagination. Defaults to 0.
	Offset *int
}

SearchProviderLocationsParams holds SearchProviderLocations's query parameters. A nil field is not sent.

type SearchProviderLocationsResponse

type SearchProviderLocationsResponse struct {
	ProviderLocations []SchedulingProviderLocation `json:"providerLocations"`
	Total             int                          `json:"total"`
}

type SearchQuestionnaireParams

type SearchQuestionnaireParams struct {
	// URL is `url`. Exact match on the canonical URL, for example `http://loinc.org/q/44249-1`. The
	// `{url}|{version}` form is accepted and matches that version only, and never answers a different
	// version than the one asked for. A canonical this service holds a copy of is answered from that
	// copy at every version; any other LOINC canonical is fetched from LOINC, where a version names a
	// release of its catalogue. A canonical that is the address of a form under a place this service
	// is set up to reach is fetched from that address; any other canonical matches nothing.
	URL *string

	// Version is `version`. Exact match on the business version. On its own it filters the copies this
	// service holds; with `url` it names the release to fetch.
	Version *string
}

SearchQuestionnaireParams holds SearchQuestionnaire's query parameters. A nil field is not sent.

type SearchSlotsParams

type SearchSlotsParams struct {
	// Status is `status`. Slot availability state to return. Defaults to `free`. One of: free, busy,
	// busy-unavailable, busy-tentative.
	Status *string

	// Publisher is `publisher`. Filter to a single publisher (source) by slug, such as `zocdoc` or
	// `defacto`. See `GET /v1/scheduling/publishers` for the available slugs.
	Publisher *string

	// ServiceTypeCode is `serviceTypeCode`. Filter by service type code (as published by the source).
	// A slot matches when any of its `serviceTypes` carries the code. A comma-separated list (up to
	// 100) matches a slot carrying any of them.
	ServiceTypeCode *string

	// NPI is `npi`. Filter by the provider's National Provider Identifier: a clinician's, or an
	// organization's when a healthcare service is the provider. Ten digits; a comma-separated list (up
	// to 100) matches a slot whose provider carries any of them. Matched as the publisher sent it, in
	// either NPI identifier system, across every publisher.
	NPI *string

	// Specialty is `specialty`. Filter by specialty: a slot matches when its provider's `specialties`
	// or its schedule's `specialties` carry the code. Send `code` to match it in any code system, or
	// `system|code` to match it in that system only. Codes are each publisher's own and are not
	// translated between code systems, so one code finds the publishers that use it; `GET
	// /v1/scheduling/specialties` lists them. A specialty sent as text only cannot be matched. A
	// comma-separated list (up to 100) matches any of them.
	Specialty *string

	// AppointmentType is `appointmentType`. Filter by appointment type.
	AppointmentType *string

	// AcceptingPatients is `acceptingPatients`. Filter to slots accepting patients of this kind (HL7
	// `accepting-patients` CodeSystem: `newpt` | `existptonly` | `existptfam`). Slots marked `nopt`
	// (not accepting patients) are never served, so `nopt` is not a valid filter value. Lenient: a
	// slot that does not declare an accepting-patients code matches any value (absence never hides a
	// slot); a slot that declares one must equal the requested value. One of: newpt, existptonly,
	// existptfam.
	AcceptingPatients *string

	// IsVirtual is `isVirtual`. Filter to virtual (`true`) or in-person (`false`) slots.
	IsVirtual *bool

	// City is `city`. Filter by the location's city.
	City *string

	// State is `state`. Filter by the location's state.
	State *string

	// StartAfter is `startAfter`. Only slots starting at or after this instant: ISO 8601 with seconds
	// and an offset, such as `2026-07-06T13:00:00-04:00` or `2026-07-06T17:00:00Z`. A value without
	// seconds is refused. When absent, slots start from now unless `includePast=true`.
	StartAfter *time.Time

	// StartBefore is `startBefore`. Only slots starting at or before this instant: ISO 8601 with
	// seconds and an offset, such as `2026-07-06T13:00:00-04:00` or `2026-07-06T17:00:00Z`. A value
	// without seconds is refused.
	StartBefore *time.Time

	// IncludePast is `includePast`. Include slots that started before now. Defaults to `false`: with
	// no `startAfter`, results start from now. An explicit `startAfter` applies as given either way.
	IncludePast *bool

	// ProviderLocationKey is `providerLocationKey`. Opaque key of one provider location from `GET
	// /v1/scheduling/provider-locations`. When set, returns exactly that provider location's slots.
	// Treat the value as opaque; do not parse it.
	ProviderLocationKey *string

	// Limit is `limit`. Page size, from 1 to 100. Defaults to 25.
	Limit *int

	// Offset is `offset`. Number of slots to skip for pagination. Defaults to 0.
	Offset *int
}

SearchSlotsParams holds SearchSlots's query parameters. A nil field is not sent.

type SearchSlotsResponse

type SearchSlotsResponse struct {
	Slots []SchedulingSlot `json:"slots"`
	Total int              `json:"total"`
}

type ValueSetExpandParams

type ValueSetExpandParams struct {
	// URL is `url`. Canonical URL of the value set to expand. Defaults to the implicit all-LOINC value
	// set (`http://loinc.org?fhir_vs`), which is every LOINC code. That expansion is not served and
	// answers `422`: expand a LOINC group or answer list instead, or ask `$validate-code` whether a
	// code is in LOINC.
	URL *string

	// Filter is `filter`. Text filter to narrow the expansion to matching concepts. Applies to value
	// sets this service hosts. For a value set resolved from its own source, narrowing is refused with
	// a `400` naming this parameter, because that source answers a whole expansion or nothing: expand
	// it whole and filter the result.
	Filter *string

	// Count is `count`. Maximum number of concepts to return (`0` returns the total only). Applies to
	// value sets this service hosts. For a value set resolved from its own source, narrowing is
	// refused with a `400` naming this parameter, because that source answers a whole expansion or
	// nothing: expand it whole and filter the result.
	Count *int

	// Offset is `offset`. Number of concepts to skip for pagination. Applies to value sets this
	// service hosts. For a value set resolved from its own source, narrowing is refused with a `400`
	// naming this parameter, because that source answers a whole expansion or nothing: expand it whole
	// and filter the result.
	Offset *int

	// DisplayLanguage is `displayLanguage`. Not supported on this operation, and refused with a `400`
	// naming it. Expansions are returned whole, in their source's own language and order.
	DisplayLanguage *string

	// IncludeDesignations is `includeDesignations`. Not supported on this operation, and refused with
	// a `400` naming it. Expansions are returned whole.
	IncludeDesignations *bool

	// ActiveOnly is `activeOnly`. Not supported on this operation, and refused with a `400` naming it.
	// Expansions are returned whole.
	ActiveOnly *bool
}

ValueSetExpandParams holds ValueSetExpand's query parameters. A nil field is not sent.

type ValueSetValidateCodeParams

type ValueSetValidateCodeParams struct {
	// URL is `url`. Canonical URL of the value set to validate against. Defaults to the implicit
	// all-LOINC value set (`http://loinc.org?fhir_vs`), which is every LOINC code.
	URL *string

	// Code is `code`, required. The code to validate.
	Code string

	// System is `system`. Code system URI of the code. Defaults to LOINC (`http://loinc.org`).
	System *string

	// Display is `display`. Optional display to check against the code's own display. A mismatch
	// returns `result: false` with the expected display alongside, which means the code is valid and
	// only the label differs. Do not read that as an invalid code.
	Display *string

	// DisplayLanguage is `displayLanguage`. Language to use when checking the display.
	DisplayLanguage *string

	// Date is `date`. The date for which the validation should be valid.
	Date *string
}

ValueSetValidateCodeParams holds ValueSetValidateCode's query parameters. A nil field is not sent.

Directories

Path Synopsis
Package fhir holds FHIR R4 (4.0.1) as Go types: every resource and datatype, generated from HL7's own fhir.schema.json.
Package fhir holds FHIR R4 (4.0.1) as Go types: every resource and datatype, generated from HL7's own fhir.schema.json.
internal
cmd/fetchspec command
Command fetchspec pins the published spec: it fetches https://api.haau3.com/openapi.json and writes it to openapi/openapi.json, indented so a change reads as a diff, with the ETag it was served with in openapi/etag.
Command fetchspec pins the published spec: it fetches https://api.haau3.com/openapi.json and writes it to openapi/openapi.json, indented so a change reads as a diff, with the ETag it was served with in openapi/etag.
cmd/generate command
Command generate writes the SDK's typed surface from the pinned spec, openapi/openapi.json, and HL7's FHIR R4 schema, hl7/fhir.schema.json.zip:
Command generate writes the SDK's typed surface from the pinned spec, openapi/openapi.json, and HL7's FHIR R4 schema, hl7/fhir.schema.json.zip:
cmd/regeneration command
Command regeneration describes a regeneration pull request for .github/workflows/regenerate.yml, from what oasdiff found between the pinned spec and the live one, and whether the generated code changed:
Command regeneration describes a regeneration pull request for .github/workflows/regenerate.yml, from what oasdiff found between the pinned spec and the live one, and whether the generated code changed:

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL