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.
- Medical 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, LOINC and ICD-10-CM 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 (401), KindForbidden (403), KindRefused, KindNoAnswer, or KindNotSent for a request it refused to send or an answer a reader cannot read as one. A 403's Code says why when the API names it, such as "phi-agreement-required". 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 ¶
- Constants
- Variables
- func MarkAsTestData[T fhir.Resource](body T) (T, error)
- func Parameter(answer *fhir.Parameters, name string) (*fhir.ParametersParameter, error)
- func Parameters(answer *fhir.Parameters, name string) []fhir.ParametersParameter
- func StructureDosageRequest(input StructureDosageInput) *fhir.Parameters
- type BatchCalls
- func (BatchCalls) CheckInsurancePlanNetwork(id string, params CheckInsurancePlanNetworkParams) *Call[*fhir.Parameters]
- func (BatchCalls) CodeSystemLookup(params CodeSystemLookupParams) *Call[*fhir.Parameters]
- func (BatchCalls) CodeSystemLookupPost(body *fhir.Parameters) *Call[*fhir.Parameters]
- func (BatchCalls) CodeSystemValidateCode(params CodeSystemValidateCodeParams) *Call[*fhir.Parameters]
- func (BatchCalls) CodeSystemValidateCodePost(body *fhir.Parameters) *Call[*fhir.Parameters]
- func (BatchCalls) FHIRMetadata(params FHIRMetadataParams) *Call[fhir.Resource]
- func (BatchCalls) ListInsurancePlanCounties(params ListInsurancePlanCountiesParams) *Call[*fhir.Parameters]
- func (BatchCalls) ReadEndpoint(id string) *Call[*fhir.Endpoint]
- func (BatchCalls) ReadHealthcareService(id string) *Call[*fhir.HealthcareService]
- func (BatchCalls) ReadInsurancePlan(id string) *Call[*fhir.InsurancePlan]
- func (BatchCalls) ReadLocation(id string) *Call[*fhir.Location]
- func (BatchCalls) ReadOrganization(id string) *Call[*fhir.Organization]
- func (BatchCalls) ReadOrganizationAffiliation(id string) *Call[*fhir.OrganizationAffiliation]
- func (BatchCalls) ReadPractitioner(id string) *Call[*fhir.Practitioner]
- func (BatchCalls) ReadPractitionerRole(id string) *Call[*fhir.PractitionerRole]
- func (BatchCalls) ReadQuestionnaire(id string) *Call[*fhir.Questionnaire]
- func (BatchCalls) SearchEndpoint(params SearchEndpointParams) *Call[*fhir.Bundle]
- func (BatchCalls) SearchHealthcareService(params SearchHealthcareServiceParams) *Call[*fhir.Bundle]
- func (BatchCalls) SearchInsurancePlan(params SearchInsurancePlanParams) *Call[*fhir.Bundle]
- func (BatchCalls) SearchLocation(params SearchLocationParams) *Call[*fhir.Bundle]
- func (BatchCalls) SearchOrganization(params SearchOrganizationParams) *Call[*fhir.Bundle]
- func (BatchCalls) SearchOrganizationAffiliation(params SearchOrganizationAffiliationParams) *Call[*fhir.Bundle]
- func (BatchCalls) SearchPractitioner(params SearchPractitionerParams) *Call[*fhir.Bundle]
- func (BatchCalls) SearchPractitionerRole(params SearchPractitionerRoleParams) *Call[*fhir.Bundle]
- func (BatchCalls) SearchQuestionnaire(params SearchQuestionnaireParams) *Call[*fhir.Bundle]
- func (BatchCalls) StructureDosage(body *fhir.Parameters) *Call[*fhir.Parameters]
- func (BatchCalls) ValueSetExpand(params ValueSetExpandParams) *Call[*fhir.ValueSet]
- func (BatchCalls) ValueSetExpandPost(body *fhir.Parameters) *Call[*fhir.ValueSet]
- func (BatchCalls) ValueSetValidateCode(params ValueSetValidateCodeParams) *Call[*fhir.Parameters]
- func (BatchCalls) ValueSetValidateCodePost(body *fhir.Parameters) *Call[*fhir.Parameters]
- type Call
- type CheckInsurancePlanNetworkParams
- type Client
- func (c *Client) BaseURL() string
- func (c *Client) Batch(ctx context.Context, entries []Entry, opts ...Option) error
- func (c *Client) CheckInsurancePlanNetwork(ctx context.Context, id string, params CheckInsurancePlanNetworkParams, ...) (*fhir.Parameters, error)
- func (c *Client) CodeSystemLookup(ctx context.Context, params CodeSystemLookupParams, opts ...Option) (*fhir.Parameters, error)
- func (c *Client) CodeSystemLookupPost(ctx context.Context, body *fhir.Parameters, opts ...Option) (*fhir.Parameters, error)
- func (c *Client) CodeSystemValidateCode(ctx context.Context, params CodeSystemValidateCodeParams, opts ...Option) (*fhir.Parameters, error)
- func (c *Client) CodeSystemValidateCodePost(ctx context.Context, body *fhir.Parameters, opts ...Option) (*fhir.Parameters, error)
- func (c *Client) FHIRBatch(ctx context.Context, body *fhir.Bundle, opts ...Option) (*fhir.Bundle, error)
- func (c *Client) FHIRMetadata(ctx context.Context, params FHIRMetadataParams, opts ...Option) (fhir.Resource, error)
- func (c *Client) Format(f fmt.State, _ rune)
- func (c *Client) GoString() string
- func (c *Client) ListInsurancePlanCounties(ctx context.Context, params ListInsurancePlanCountiesParams, opts ...Option) (*fhir.Parameters, error)
- func (c *Client) ListPublishers(ctx context.Context, opts ...Option) (*ListPublishersResponse, error)
- func (c *Client) ListServiceTypes(ctx context.Context, params ListServiceTypesParams, opts ...Option) (*ListServiceTypesResponse, error)
- func (c *Client) ListSpecialties(ctx context.Context, params ListSpecialtiesParams, opts ...Option) (*ListSpecialtiesResponse, error)
- func (c *Client) Pages(ctx context.Context, first *fhir.Bundle, opts ...Option) iter.Seq2[*fhir.Bundle, error]
- func (c *Client) ProcessMessage(ctx context.Context, body *fhir.Bundle, opts ...Option) (*fhir.Bundle, error)
- func (c *Client) ReadEndpoint(ctx context.Context, id string, opts ...Option) (*fhir.Endpoint, error)
- func (c *Client) ReadHealthcareService(ctx context.Context, id string, opts ...Option) (*fhir.HealthcareService, error)
- func (c *Client) ReadInsurancePlan(ctx context.Context, id string, opts ...Option) (*fhir.InsurancePlan, error)
- func (c *Client) ReadLocation(ctx context.Context, id string, opts ...Option) (*fhir.Location, error)
- func (c *Client) ReadOrganization(ctx context.Context, id string, opts ...Option) (*fhir.Organization, error)
- func (c *Client) ReadOrganizationAffiliation(ctx context.Context, id string, opts ...Option) (*fhir.OrganizationAffiliation, error)
- func (c *Client) ReadPractitioner(ctx context.Context, id string, opts ...Option) (*fhir.Practitioner, error)
- func (c *Client) ReadPractitionerRole(ctx context.Context, id string, opts ...Option) (*fhir.PractitionerRole, error)
- func (c *Client) ReadQuestionnaire(ctx context.Context, id string, opts ...Option) (*fhir.Questionnaire, error)
- func (c *Client) ReconcileMedications(ctx context.Context, body fhir.Resource, opts ...Option) (*fhir.Bundle, error)
- func (c *Client) Request(ctx context.Context, req RawRequest, opts ...Option) (*RawResponse, error)
- func (c *Client) Resources(ctx context.Context, first *fhir.Bundle, opts ...Option) iter.Seq2[fhir.Resource, error]
- func (c *Client) SandboxMetadata(ctx context.Context, opts ...Option) (*fhir.CapabilityStatement, error)
- func (c *Client) SandboxProcessMessage(ctx context.Context, body *fhir.Bundle, opts ...Option) (*fhir.Bundle, error)
- func (c *Client) SearchEndpoint(ctx context.Context, params SearchEndpointParams, opts ...Option) (*fhir.Bundle, error)
- func (c *Client) SearchHealthcareService(ctx context.Context, params SearchHealthcareServiceParams, opts ...Option) (*fhir.Bundle, error)
- func (c *Client) SearchInsurancePlan(ctx context.Context, params SearchInsurancePlanParams, opts ...Option) (*fhir.Bundle, error)
- func (c *Client) SearchLocation(ctx context.Context, params SearchLocationParams, opts ...Option) (*fhir.Bundle, error)
- func (c *Client) SearchOrganization(ctx context.Context, params SearchOrganizationParams, opts ...Option) (*fhir.Bundle, error)
- func (c *Client) SearchOrganizationAffiliation(ctx context.Context, params SearchOrganizationAffiliationParams, ...) (*fhir.Bundle, error)
- func (c *Client) SearchPractitioner(ctx context.Context, params SearchPractitionerParams, opts ...Option) (*fhir.Bundle, error)
- func (c *Client) SearchPractitionerRole(ctx context.Context, params SearchPractitionerRoleParams, opts ...Option) (*fhir.Bundle, error)
- func (c *Client) SearchProviderLocations(ctx context.Context, params SearchProviderLocationsParams, opts ...Option) (*SearchProviderLocationsResponse, error)
- func (c *Client) SearchQuestionnaire(ctx context.Context, params SearchQuestionnaireParams, opts ...Option) (*fhir.Bundle, error)
- func (c *Client) SearchSlots(ctx context.Context, params SearchSlotsParams, opts ...Option) (*SearchSlotsResponse, error)
- func (c *Client) String() string
- func (c *Client) StructureDosage(ctx context.Context, body *fhir.Parameters, opts ...Option) (*fhir.Parameters, error)
- func (c *Client) ValueSetExpand(ctx context.Context, params ValueSetExpandParams, opts ...Option) (*fhir.ValueSet, error)
- func (c *Client) ValueSetExpandPost(ctx context.Context, body *fhir.Parameters, opts ...Option) (*fhir.ValueSet, error)
- func (c *Client) ValueSetValidateCode(ctx context.Context, params ValueSetValidateCodeParams, opts ...Option) (*fhir.Parameters, error)
- func (c *Client) ValueSetValidateCodePost(ctx context.Context, body *fhir.Parameters, opts ...Option) (*fhir.Parameters, error)
- type CodeSystemLookupParams
- type CodeSystemValidateCodeParams
- type Designation
- type DesignationFilter
- type DesignationUse
- type DosageReview
- type Entry
- type Error
- func (e *Error) Error() string
- func (e *Error) Format(f fmt.State, verb rune)
- func (e *Error) GoString() string
- func (e *Error) Is(target error) bool
- func (e *Error) LogValue() slog.Value
- func (e *Error) MarshalJSON() ([]byte, error)
- func (e *Error) Outcome() *fhir.OperationOutcome
- func (e *Error) Problem() *Problem
- func (e *Error) Unwrap() error
- type FHIRMetadataParams
- type Kind
- type ListInsurancePlanCountiesParams
- type ListPublishersResponse
- type ListServiceTypesParams
- type ListServiceTypesResponse
- type ListSpecialtiesParams
- type ListSpecialtiesResponse
- type Lookup
- type Option
- func WithAPIKey(key string) Option
- func WithBaseURL(url string) Option
- func WithCorrelationID(id string) Option
- func WithHTTPClient(client *http.Client) Option
- func WithHeader(name, value string) Option
- func WithMaxRetries(n int) Option
- func WithPayerAuthorization(value string) Option
- func WithResponseInfo(info *ResponseInfo) Option
- func WithTimeout(d time.Duration) Option
- type Problem
- type ProblemIssue
- type Property
- type RawRequest
- type RawResponse
- type Reason
- type ResponseInfo
- type ReviewFlag
- type SchedulingProviderLocation
- type SchedulingProviderLocationLocation
- type SchedulingProviderLocationLocationIdentifier
- type SchedulingProviderLocationLocationPhysicalType
- type SchedulingProviderLocationLocationPosition
- type SchedulingProviderLocationProvider
- type SchedulingProviderLocationProviderIdentifier
- type SchedulingProviderLocationProviderSpecialty
- type SchedulingProviderLocationServiceType
- type SchedulingProviderLocationSpecialty
- type SchedulingPublisher
- type SchedulingServiceType
- type SchedulingSlot
- type SchedulingSlotLocation
- type SchedulingSlotLocationIdentifier
- type SchedulingSlotLocationPhysicalType
- type SchedulingSlotLocationPosition
- type SchedulingSlotProvider
- type SchedulingSlotProviderIdentifier
- type SchedulingSlotProviderSpecialty
- type SchedulingSlotServiceType
- type SchedulingSlotSource
- type SchedulingSlotSpecialty
- type SchedulingSpecialty
- type SearchEndpointParams
- type SearchHealthcareServiceParams
- type SearchInsurancePlanParams
- type SearchLocationParams
- type SearchOrganizationAffiliationParams
- type SearchOrganizationParams
- type SearchPractitionerParams
- type SearchPractitionerRoleParams
- type SearchProviderLocationsParams
- type SearchProviderLocationsResponse
- type SearchQuestionnaireParams
- type SearchSlotsParams
- type SearchSlotsResponse
- type StructureDosageInput
- type Validation
- type ValueSetExpandParams
- type ValueSetValidateCodeParams
Examples ¶
Constants ¶
const ( // RxNormSystem is RxNorm's code system. RxNormSystem = "http://www.nlm.nih.gov/research/umls/rxnorm" // NDCSystem is the NDC's code system. NDCSystem = "http://hl7.org/fhir/sid/ndc" )
The code systems of a medication's codings, for StructureDosageInput's Medication.
const SpecVersion = "1.0.0-preview.29"
SpecVersion is the version of the API's spec this release was generated from.
const Version = "0.2.8" // x-release-please-version
Version is this SDK's version.
Variables ¶
var ( ErrNotSent error = &kindError{KindNotSent} ErrAuth error = &kindError{KindAuth} ErrRefused error = &kindError{KindRefused} ErrNoAnswer error = &kindError{KindNoAnswer} ErrForbidden error = &kindError{KindForbidden} )
Sentinels for errors.Is, one per Kind: errors.Is(err, haau3.ErrNoAnswer) is true for an *Error whose Kind is KindNoAnswer.
var ( // PreferredForLanguageUse is the use of a name preferred for its language among several, HL7 // Terminology's preferredForLanguage. Every answer from a code system haau3 holds names the // display again with this use. PreferredForLanguageUse = DesignationUse{ System: "http://terminology.hl7.org/CodeSystem/hl7TermMaintInfra", Code: "preferredForLanguage", Display: "Preferred For Language", } // SynonymUse is the use of a variant name that is also fit for display, the FHIR terminology // ecosystem's synonym. ICD-10-CM's short title has this use, where it differs from the display. SynonymUse = DesignationUse{ System: "http://fhir.org/packages/fhir.tx.support/CodeSystem/designation-usage", Code: "synonym", Display: "Synonym", } )
The uses of a designation the API sends.
Functions ¶
func MarkAsTestData ¶ added in v0.2.0
MarkAsTestData returns a copy of a request with HL7's test data label (HTEST, from v3-ActReason) in meta.security on the request and on every resource the API reads in it: each Bundle entry, each Parameters resource part at any depth, and the same again inside a Bundle or Parameters found there. A resource contained in another goes with the one that contains it, so it is left as it is. Labels already there are kept, and a resource that already carries the label gets no second one. The request you pass is never changed, and what comes back is of its type.
Without an agreement for patient data, the operations that receive it accept only test data labelled as such, and refuse anything else with a KindForbidden error whose Code is "phi-agreement-required".
Label only made-up data. The label says a record is not about a real person, and it is never a way to send patient data without an agreement.
marked, err := haau3.MarkAsTestData(records)
if err != nil {
return err
}
list, err := client.ReconcileMedications(ctx, marked)
The copy is made through JSON, so the error is a KindNotSent *Error only for a body that cannot be written as JSON, which the call itself could not send either.
func Parameter ¶ added in v0.2.3
func Parameter(answer *fhir.Parameters, name string) (*fhir.ParametersParameter, error)
Parameter is the one part of a Parameters answer with that name, with no request, or nil when there is none. It returns an *Error of KindNotSent when there are two, since which one is meant is then ambiguous; Parameters reads a name that repeats. It reads an answer as FHIR's own SDKs do (Firely's GetSingleValue, HAPI's ParametersUtil).
answer, err := client.CodeSystemLookup(ctx, haau3.CodeSystemLookupParams{System: new("http://loinc.org"), Code: "2345-7"})
if err != nil {
return err
}
display, err := haau3.Parameter(answer, "display")
if err == nil && display != nil && display.ValueString != nil {
fmt.Println(*display.ValueString)
}
func Parameters ¶ added in v0.2.3
func Parameters(answer *fhir.Parameters, name string) []fhir.ParametersParameter
Parameters is every part of a Parameters answer with that name, in order, with no request: the way FHIR operations answer, CodeSystemLookup's "property" parts or StructureDosage's "dosage" part. Each part holds its value in the value[x] its operation names, so read ValueDosage, ValueString and so on from it. It is empty when there is none. It reads an answer as FHIR's own SDKs do (Firely's Get, HAPI's ParametersUtil).
answer, err := client.CodeSystemLookup(ctx, haau3.CodeSystemLookupParams{System: new("http://loinc.org"), Code: "2345-7", Property: []string{"COMPONENT"}})
if err != nil {
return err
}
for _, property := range haau3.Parameters(answer, "property") {
fmt.Println(property.Part)
}
func StructureDosageRequest ¶ added in v0.2.4
func StructureDosageRequest(input StructureDosageInput) *fhir.Parameters
StructureDosageRequest is the Parameters StructureDosage takes, from the directions and, optionally, the medication: a "text" part, and a "medication" part when there is one. It checks nothing; the API refuses what it does not accept, with its reason. It builds a batch entry too: Calls.StructureDosage(haau3.StructureDosageRequest(input)).
answer, err := client.StructureDosage(ctx, haau3.StructureDosageRequest(haau3.StructureDosageInput{
Text: "Take 1 tablet by mouth daily",
Medication: &fhir.CodeableConcept{Coding: []fhir.Coding{
{System: new(haau3.RxNormSystem), Code: new("311354")},
}},
}))
Example ¶
package main
import (
"fmt"
"github.com/haau3/haau3-go"
"github.com/haau3/haau3-go/fhir"
)
func main() {
request := haau3.StructureDosageRequest(haau3.StructureDosageInput{
Text: "Take 1 tablet by mouth daily",
Medication: &fhir.CodeableConcept{Coding: []fhir.Coding{
{System: new(haau3.RxNormSystem), Code: new("311354")},
}},
})
for _, part := range request.Parameter {
fmt.Println(*part.Name)
}
}
Output: text medication
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) StructureDosage ¶ added in v0.2.3
func (BatchCalls) StructureDosage(body *fhir.Parameters) *Call[*fhir.Parameters]
StructureDosage is Client.StructureDosage 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.
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 ¶
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)
}
Output:
func (*Client) Batch ¶
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)
}
}
Output:
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/medical-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`. For the code systems this service holds (RxNorm and ICD-10-CM), the answer also names the `code` and the `system`, says whether the code is `abstract` (not for use), and carries the display again as a `designation` used `preferredForLanguage`. ICD-10-CM codes are written dotted (`E11.9`); a lookup answers `notSelectable`, true for a header, gives the code's short title as a `designation` used `synonym` (`http://fhir.org/packages/fhir.tx.support/CodeSystem/designation-usage`, as tx.fhir.org gives it) where it differs from the display, and a code not in the version served is a `404` naming that version.
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`. For the code systems this service holds (RxNorm and ICD-10-CM), the answer also names the `code` and the `system`, says whether the code is `abstract` (not for use), and carries the display again as a `designation` used `preferredForLanguage`. ICD-10-CM codes are written dotted (`E11.9`); a lookup answers `notSelectable`, true for a header, gives the code's short title as a `designation` used `synonym` (`http://fhir.org/packages/fhir.tx.support/CodeSystem/designation-usage`, as tx.fhir.org gives it) where it differs from the display, and a code not in the version served is a `404` naming that version.
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. An ICD-10-CM header is a code, so it answers `true`, with a message saying it is not valid for submission; to check a code for a claim, ask `ValueSet/$validate-code` with `https://haau3.com/fhir/ValueSet/icd-10-cm-valid-for-submission`.
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. An ICD-10-CM header is a code, so it answers `true`, with a message saying it is not valid for submission; to check a code for a claim, ask `ValueSet/$validate-code` with `https://haau3.com/fhir/ValueSet/icd-10-cm-valid-for-submission`.
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) 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/medical-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. Not yet open to customers: while its price sources are being licensed, every request from a customer's organization, with or without patient details, is refused with `403` `forbidden`. 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, up to three ZIP codes, or both. It is answered by the cash-price sources haau3 connects to, each named in the notes on its prices. `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. It is answered by the member's insurer, found by the payer's Payer ID: a `payor.identifier` whose `type` is `payerid` from `http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType`. An insurer that answers only with the member's own authorization is sent the access token from the member's login with that insurer, in the `Payer-Authorization` header, for that one request; it is never stored, logged or sent anywhere else. No insurer is connected yet. 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. With prices, `item` is the lowest price at a pharmacy near the ZIP codes or at the pharmacy named, every price is also an `addItem` alternative naming its pharmacy by an Organization in the Bundle and its price source in `programCode`, from `https://haau3.com/fhir/CodeSystem/pharmacy-benefits-price-source`, and `processNote` says where each price came from, when, and which free discount card pays it. Each price repeats the request's product coding, which CARIN requires to carry a display: an RxNorm code sent without one is answered with the display haau3's RxNorm release gives it, and an NDC needs its display sent with it. A check no connected source can answer carries `no-responder-for-coverage`, `no-price-source` or `source-not-available-to-caller` from `https://haau3.com/fhir/CodeSystem/pharmacy-benefits-processing-code`, and a member's request to an insurer that needs the member's authorization carries `payer-authorization-required` when none was sent and `payer-authorization-rejected` when the insurer refused it. A member's request the insurer declines under its own rules carries `insurer-declined-request`, and sending it again gives the same answer. An insurer that prices by NDC is asked about the request's NDC, or, for an RxNorm code, an NDC haau3's RxNorm release holds for the code or one of its branded forms, named in the answer's note; with none held it is not asked and the answer carries `ndc-required`, so send the NDC. Send the prescription's days supply in `MedicationRequest.dispenseRequest.expectedSupplyDuration`, as a whole number of days with the UCUM code `d`; any other days supply is refused with `400`, and an insurer that requires one is not asked about a request without one: the answer carries `days-supply-required`, beside `ndc-required` when the NDC is missing too. A price is an estimate; the pharmacy confirms the price. A member's request receives patient data, so send real patient data only under an executed business associate agreement (BAA) on the Team or Scale plan. Without both, send a member's request only as test data marked as such, the request and every resource in it labelled with the `meta.security` coding `HTEST` from `http://terminology.hl7.org/CodeSystem/v3-ActReason`; anything else is refused with `403` `phi-agreement-required`. A request without patient details needs neither. 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 query 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
WithPayerAuthorization sends Payer-Authorization, checked before sending.
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. A pharmacy service's id (`HealthcareService-pharmacy-{NPI}`) is read back from NPPES.
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 Medical 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/medical-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)
}
}
Output:
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. A pharmacy's store (`Location-pharmacy-{NPI}`, from a pharmacy search on `HealthcareService`) is read back from NPPES.
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 real patient data only under an executed business associate agreement (BAA) on the Team or Scale plan. Without both, send only test data marked as such, the request and every resource in it labelled with the `meta.security` coding `HTEST` from `http://terminology.hl7.org/CodeSystem/v3-ActReason`; anything else is refused with `403` `phi-agreement-required`. 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)
}
}
}
Output:
func (*Client) SandboxMetadata ¶ added in v0.2.1
func (c *Client) SandboxMetadata(ctx context.Context, opts ...Option) (*fhir.CapabilityStatement, error)
SandboxMetadata: The Sandbox's capability statement.
FHIR `[base]/metadata` at the Sandbox's FHIR base, `/v1/sandbox/fhir/r4`. Returns the Sandbox's own `CapabilityStatement`, which says what the Sandbox serves: today the pharmacy benefit check, `$process-message`, as CARIN's responder (STU2 ballot, `2.0.0-ballot`), receiving a member's request. It takes no parameters. Send a test key (`haau3_sk_test_…`): a live key is refused with `live-key-in-sandbox`.
GET /v1/sandbox/fhir/r4/metadata (sandboxMetadata): https://docs.haau3.com/api-reference/sandbox/the-sandboxs-capability-statement
func (*Client) SandboxProcessMessage ¶ added in v0.1.6
func (c *Client) SandboxProcessMessage(ctx context.Context, body *fhir.Bundle, opts ...Option) (*fhir.Bundle, error)
SandboxProcessMessage: Check a test member's medication cost with a test insurer.
The Sandbox's pharmacy benefit check: the same operation as `/v1/fhir/r4/$process-message`, at the Sandbox's FHIR base, `/v1/sandbox/fhir/r4`, where Example Health Plan, a test insurer, answers the CARIN Consumer Real-Time Pharmacy Benefit Check (STU2 ballot, `2.0.0-ballot`) as a payer would, with synthetic data. Every organization may call it on every plan, and each request counts like any other. Send a test key (`haau3_sk_test_…`): a live key is refused with `live-key-in-sandbox`. POST a FHIR `Bundle` of type `message` whose first entry is a MessageHeader with the event `rtpbc-request`: a member's request, with the member's Patient and Coverage, the prescription and its prescriber, and a pharmacy. A request is read by the same rules as Pharmacy Benefits' member's request. The member must be one of the test insurer's test members, named by member ID in `Coverage.subscriberId`, the Coverage's `rxid` class, or a Patient identifier whose system is `https://example-health-plan.test/member-id`; a request for anyone else is answered the error `no-test-member` and nothing else. Send test members only, never a real person. Each medication in the test insurer's formulary table always gets the same answer, by its RxNorm code or NDC: priced with a copay, covered at $0 with an alternative, not covered with an alternative, prior authorization required, or a quantity limit. Any other medication gets a default priced answer, and one test member's requests are always declined, `insurer-declined`. Both errors are coded from `https://haau3.com/fhir/CodeSystem/sandbox-error` in `ClaimResponse.error`. The answer is a `message` Bundle whose MessageHeader answers the request's, with one ClaimResponse naming the insurer by its Payer ID, `SANDBOX-EHP`, and the request's Patient as it was sent, a test member's labelled `HTEST`; a process note says which test member and formulary row answered. Amounts are fixed, whatever the quantity. Nothing a request carries is stored or logged, and every answer is sent with `Cache-Control: no-store`. The operation takes no query parameters. The test members and the formulary table are at https://docs.haau3.com/sandbox/example-health-plan.
POST /v1/sandbox/fhir/r4/$process-message (sandboxProcessMessage): https://docs.haau3.com/api-reference/sandbox/check-a-test-members-medication-cost-with-a-test-insurer
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 and pharmacies.
Search `HealthcareService` two ways.
**The directory's services**, 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 on this search rather than answered with nothing.
**Pharmacies**, modelled as NDH 2.0.0 models them: each match is a pharmacy service, with category `pharm` and its NUCC pharmacy codes as `specialty`, provided by an organization at a store. Start the search with `service-category=pharm` (every kind) or `specialty` (one kind or several, separated by commas). A pharmacy search needs `location.address-state` with `location.address-postalcode` or `location.address-city`, or one pharmacy's `organization` or `organization.identifier`; `name` narrows it. Add `_include=HealthcareService:organization` and `_include=HealthcareService:location` to get each pharmacy's organization (its NPI) and store (its address) in the same bundle.
Pharmacies are found in NPPES, CMS's NPI Registry, until CMS's National Provider Directory serves them. Each is found and served at its primary practice address. The organization keeps the directory's own id (`Organization-{NPI}`) and reads back from the directory, where a pharmacy registered in the last few weeks can answer 404 until the directory's next load. A pharmacy service's and store's ids are read back from NPPES, and change when the search moves to the directory. NPPES returns at most 1,200 records for one search, so a continuation past them is refused with a 422 that asks for a narrower search, rather than repeating a page or ending early. One store can bill under more than one NPI, and each is served as its own pharmacy.
GET /v1/fhir/r4/HealthcareService (searchHealthcareService): https://docs.haau3.com/api-reference/provider-directory/find-healthcare-services-and-pharmacies
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/medical-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))
}
Output:
func (*Client) StructureDosage ¶ added in v0.2.3
func (c *Client) StructureDosage(ctx context.Context, body *fhir.Parameters, opts ...Option) (*fhir.Parameters, error)
StructureDosage: Structure a prescription's directions as a FHIR Dosage.
FHIR system-level operation `$structure-dosage`. POST a Parameters resource with one `text` part, a prescription's directions as written, at most 1,000 characters, and optionally one `medication` part, the medication's codings as a CodeableConcept (RxNorm or NDC). The answer is a Parameters resource with one `dosage` part: a FHIR Dosage conforming to haau3 Structured Dosage, whose `text` is the directions exactly as sent and whose dose and unit, route, method, timing and as-needed elements are coded where the words support them, in SNOMED CT (Global Patient Set concepts only), NCIt and UCUM. Nothing is invented: an element the directions do not support is absent. Anything a person should check is a review flag on the Dosage, an extension with a code from `https://haau3.com/fhir/CodeSystem/structured-sig-review-flag` and, when the flag is about words, those words. Every Dosage names the engine and vocabulary versions it was written under, and the RxNorm release when the medication's code was looked up. With an RxNorm code, the product's dose form checks the dose's unit and the route, and supplies either when the directions name none, each flagged. Send the directions and the medication's codings only, never a patient's name or identifiers. 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 query parameters, and may be sent inside a batch, one request per entry. The contract is published at https://fhir.haau3.com/OperationDefinition-structure-dosage.html.
POST /v1/fhir/r4/$structure-dosage (structureDosage): https://docs.haau3.com/api-reference/structured-sig/structure-a-prescriptions-directions-as-a-fhir-dosage
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 a text filter and paging (`count=0` returns the total only). On the value sets of the code systems this service holds (RxNorm and ICD-10-CM), the filter searches by name, and on ICD-10-CM by code too, and is required, and the matches come ranked, best first, with `expansion.total` the number of matches.
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 a text filter and paging (`count=0` returns the total only). On the value sets of the code systems this service holds (RxNorm and ICD-10-CM), the filter searches by name, and on ICD-10-CM by code too, and is required, and the matches come ranked, best first, with `expansion.total` the number of matches.
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. RxNorm and ICD-10-CM are held in English only: another language is answered in
// English, with a `warning` parameter saying so.
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. On RxNorm and ICD-10-CM any name
// the code has matches: RxNorm's other names, and an ICD-10-CM code's short title.
Display *string
// DisplayLanguage is `displayLanguage`. Language to use when checking the display. RxNorm and
// ICD-10-CM are held in English only: another language is checked against the English names, and
// the `message` says so.
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 Designation ¶ added in v0.2.8
type Designation struct {
// Language is the name's language, such as "en", or "" when the answer does not say.
Language string
// Use is what the name is for, or nil when the answer does not say. A name with no use is fit for
// display.
Use *DesignationUse
// Value is the name.
Value string
// Other is the designation's parts this reader does not read, such as R5's additionalUse, verbatim.
Other []fhir.ParametersParameter
}
Designation is one name for a code, as LookupResult reads it.
func Designations ¶ added in v0.2.8
func Designations(lookup Lookup, filter DesignationFilter) []Designation
Designations is a lookup's designations with a use and in a language, in answer order, with no request. A use matches by its System and Code together. A language matches as RFC 4647's basic filtering says, so "en" finds "en" and "en-US". A field left as its zero value matches every designation; a designation that names no use, or no language, is found only when that field is left out.
type DesignationFilter ¶ added in v0.2.8
type DesignationFilter struct {
// Use is a use, matched by its System and Code together.
Use DesignationUse
// Language is a language range, matched as RFC 4647's basic filtering does: "en" matches "en"
// and "en-US".
Language string
}
DesignationFilter is which designations Designations finds. A field left as its zero value matches every designation.
type DesignationUse ¶ added in v0.2.8
type DesignationUse struct {
// System is the code system the use's code is from.
System string
// Code is the use's code.
Code string
// Display is the code's display, or "" when the answer gives none.
Display string
}
DesignationUse is how a designation is used: a code from a code system, saying what the name is for.
type DosageReview ¶ added in v0.2.3
type DosageReview struct {
// Flags is every flag on the Dosage, in the order the answer gives them. It is empty when nothing
// needs checking.
Flags []ReviewFlag
// EngineVersion is how the directions were read, in the form YYYY-MM-DD.vN.
EngineVersion string
// VocabularyVersion is the codes the directions were coded with, in the form YYYY-MM-DD.vN.
VocabularyVersion string
// RxnormRelease is the RxNorm release the medication's code was looked up in, when it carried one.
RxnormRelease string
}
DosageReview is what ReviewFlags reads from a Dosage. A version it does not name is "".
func ReviewFlags ¶ added in v0.2.3
func ReviewFlags(dosage *fhir.Dosage) DosageReview
ReviewFlags reads the review flags on a Dosage StructureDosage answered with, and the versions it names, with no request. Each flag is something a person should check: its code, its display, and the words of the directions it is about, when it is about words.
answer, err := client.StructureDosage(ctx, haau3.StructureDosageRequest(haau3.StructureDosageInput{Text: "Take 1 tablet by mouth twice daily"}))
if err != nil {
return err
}
part, err := haau3.Parameter(answer, "dosage")
if err == nil && part != nil && part.ValueDosage != nil {
for _, flag := range haau3.ReviewFlags(part.ValueDosage).Flags {
fmt.Println(flag.Code, flag.Words)
}
}
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
// StatusText is that status's text: the answer's own, or the standard one when it came with
// none, as HTTP/2 answers do. Empty when the API did not answer.
StatusText string
// Code is the API's own code for why it refused a request with a 403 (KindForbidden), from its
// api-error code system, when it names one: "test-key-outside-sandbox" (a test key works only
// in the Sandbox), "live-key-in-sandbox" (a live key does not work there),
// "phi-agreement-required" (patient data not all labelled as test data).
Code string
// 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.KindForbidden: // e.Code
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 ¶
Error is what happened, naming the request but never a value you sent or the body.
func (*Error) Format ¶
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) Is ¶
Is reports whether e is of the kind a sentinel names: errors.Is(err, haau3.ErrNoAnswer).
func (*Error) LogValue ¶
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 ¶
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.
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 the SDK refusing before anything is sent: a request it will not 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), or an answer a reader cannot read as one (two parts with a name // FHIR allows once). KindNotSent Kind = iota + 1 // KindAuth is the API not accepting the key (401): none was sent, it is not one the API knows, // or it was revoked. A 403 is never KindAuth: the key was accepted, and the error is // KindForbidden. 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 // KindForbidden is the API accepting the key and refusing the request (403). The key itself is // real, so there is nothing to rotate. Code says why when the API names it, and the message // says it in words: // // - "test-key-outside-sandbox": a test key works only in the Sandbox. Send a live key. // - "live-key-in-sandbox": a live key does not work in the Sandbox. Send a test key. // - "phi-agreement-required": the organization may not send patient data, and not every // resource in the request is labelled as test data. MarkAsTestData labels made-up data. // // Without a code, the key's organization may not make the request, or the operation is not yet // open to it; the body says why, in the API's words. KindForbidden )
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 Lookup ¶ added in v0.2.8
type Lookup struct {
// Name is the code system's name, such as "ICD-10-CM".
Name string
// Code is the code.
Code string
// System is the code system.
System string
// Version is the code system's version the answer is from.
Version string
// Display is the code's display.
Display string
// Abstract says whether the code is abstract, not for use, such as an ICD-10-CM header.
Abstract *bool
// Warning is what the answer warns of: for a code system haau3 holds, that another language was
// asked for and the answer is in English.
Warning string
// Designations is every designation, in answer order. The package function Designations finds one
// by use and language.
Designations []Designation
// Properties is every property, in answer order.
Properties []Property
// Other is the answer's parts this reader does not read, verbatim.
Other []fhir.ParametersParameter
}
Lookup is what LookupResult reads from a CodeSystemLookup answer. A part the answer does not carry is "", or nil for Abstract.
func LookupResult ¶ added in v0.2.8
func LookupResult(answer *fhir.Parameters) (Lookup, error)
LookupResult reads a CodeSystemLookup answer, typed, with no request: the code, its system and version, its display, whether it is abstract, every designation and every property. A part this reader does not know stays in Other. It returns an *Error of KindNotSent when a part FHIR allows once comes twice, since which one is meant is then ambiguous.
answer, err := client.CodeSystemLookup(ctx, haau3.CodeSystemLookupParams{System: new("http://hl7.org/fhir/sid/icd-10-cm"), Code: "E08.37X1"})
if err != nil {
return err
}
lookup, err := haau3.LookupResult(answer)
if err != nil {
return err
}
for _, title := range haau3.Designations(lookup, haau3.DesignationFilter{Use: haau3.SynonymUse}) {
fmt.Println(title.Value)
}
Example ¶
package main
import (
"fmt"
"github.com/haau3/haau3-go"
"github.com/haau3/haau3-go/fhir"
)
func main() {
// An ICD-10-CM lookup's display and short title, as the API answers them.
answer := &fhir.Parameters{Parameter: []fhir.ParametersParameter{
{Name: new("display"), ValueString: new("Diabetes mellitus due to underlying condition with diabetic macular edema, resolved following treatment, right eye")},
{Name: new("designation"), Part: []fhir.ParametersParameter{
{Name: new("language"), ValueCode: new("en")},
{Name: new("use"), ValueCoding: &fhir.Coding{System: new(haau3.SynonymUse.System), Code: new(haau3.SynonymUse.Code)}},
{Name: new("value"), ValueString: new("Diab with diabetic macular edema, resolved fol trtmt, r eye")},
}},
}}
lookup, err := haau3.LookupResult(answer)
if err != nil {
fmt.Println(err)
return
}
for _, title := range haau3.Designations(lookup, haau3.DesignationFilter{Use: haau3.SynonymUse, Language: "en"}) {
fmt.Println(title.Value)
}
}
Output: Diab with diabetic macular edema, resolved fol trtmt, r eye
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. An option for a header an operation declares, such as WithPayerAuthorization (options_gen.go), is for a call to that operation only.
func WithAPIKey ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 WithPayerAuthorization ¶ added in v0.1.4
WithPayerAuthorization sends Payer-Authorization with a call to ProcessMessage. A member's own authorization at their insurer, for a member's request (event `rtpbc-request`) to an insurer that answers only with it: `Bearer` and the access token your app obtained from the member's login with that insurer, as an `Authorization` header carries one. It is forwarded once, to that insurer, for this request, and is never stored, logged or sent anywhere else. Without it, such a request is answered `payer-authorization-required`; a token the insurer refuses is answered `payer-authorization-rejected`. A request without patient details that carries it is refused.
It is checked against the form the API takes for it, at most 4096 characters, before sending: a value it does not take is refused with an error of KindNotSent that never repeats it. It wins over the same header given with WithHeader. For a call to ProcessMessage only: NewClient and any other call refuse it.
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)
}
Output:
func WithTimeout ¶
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 403: why, as a code from `https://haau3.com/fhir/CodeSystem/api-error`, the same one an
// OperationOutcome carries in `issue.details.coding`.
Code *string `json:"code,omitempty"`
// On a 400: one entry per parameter that is not valid.
Issues []ProblemIssue `json:"issues,omitempty"`
}
type ProblemIssue ¶
type Property ¶ added in v0.2.8
type Property struct {
// Code is the property's code, in the code system's own words, such as "notSelectable" or "TTY".
Code string
// Type is the FHIR data type of Value.
Type string
// Value is the property's value, of the Go type Type names.
Value any
// Description is the property's description, or "" when the answer gives none.
Description string
// Subproperties is the property's subproperties, in answer order, or empty when there are none.
Subproperties []Property
// Other is the property's parts this reader does not read, verbatim.
Other []fhir.ParametersParameter
}
Property is one property of a code. Type names the FHIR data type of its value, as $lookup allows them, and Value holds it:
- "code", "string" and "dateTime": a string;
- "integer": an int;
- "decimal": a json.Number, as the FHIR types hold one;
- "boolean": a bool;
- "Coding": a fhir.Coding.
A type switch on Value reads it:
switch value := property.Value.(type) {
case fhir.Coding:
fmt.Println(property.Code, *value.Code)
case bool:
fmt.Println(property.Code, value)
}
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 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 ReviewFlag ¶ added in v0.2.3
type ReviewFlag struct {
// Code is the flag's code, from https://haau3.com/fhir/CodeSystem/structured-sig-review-flag.
Code string
// Display is the flag's display, such as "Route and dose form differ".
Display string
// Words are the words of the directions the flag is about, exactly as written, or "" when the
// flag is not about words.
Words string
}
ReviewFlag is one thing a person should check about a Dosage.
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 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 SchedulingPublisher ¶
type SchedulingServiceType ¶
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 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 SchedulingSlotSource ¶
type SchedulingSlotSpecialty ¶
type SchedulingSpecialty ¶
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
// ServiceCategory is `service-category`. `pharm`, bare or as
// `http://terminology.hl7.org/CodeSystem/ndh-healthcare-service-category|pharm`: every pharmacy,
// of any kind. Starts a pharmacy search, as `specialty` does. A pharmacy search needs
// `location.address-state` with `location.address-postalcode` or `location.address-city`, or one
// pharmacy's `organization` or `organization.identifier`; `name` narrows it.
ServiceCategory *string
// Specialty is `specialty`. A NUCC pharmacy code, bare or as
// `http://nucc.org/provider-taxonomy|{code}`, or several separated by commas to find pharmacies of
// any of those kinds: for example `3336C0003X` (community or retail) or `3336M0002X` (mail order).
// Starts a pharmacy search. A pharmacy may carry only the general code 333600000X or only a
// specific one, so send `333600000X,3336C0003X` to find either, or `service-category=pharm` for
// every kind. Only pharmacy codes (333600000X, 3336C0002X, 3336C0003X, 3336C0004X, 3336H0001X,
// 3336I0012X, 3336L0003X, 3336M0002X, 3336M0003X, 3336N0007X, 3336S0011X) are served. A pharmacy
// search needs `location.address-state` with `location.address-postalcode` or
// `location.address-city`, or one pharmacy's `organization` or `organization.identifier`; `name`
// narrows it.
Specialty *string
// LocationAddressState is `location.address-state`. A pharmacy search's state: the two-letter code
// of the state the pharmacy's store is in. Required, with a ZIP code or a city, unless the search
// names one pharmacy.
LocationAddressState *string
// LocationAddressPostalcode is `location.address-postalcode`. Narrows a pharmacy search to stores
// whose ZIP code starts with this: a ZIP code, or its first two or more digits. Send it with
// `location.address-state`.
LocationAddressPostalcode *string
// LocationAddressCity is `location.address-city`. Narrows a pharmacy search to stores in a city
// whose name starts with this, so `Miami` also finds Miami Beach. Two or more letters. Send it
// with `location.address-state`.
LocationAddressCity *string
// Name is `name`. Narrows a pharmacy search to pharmacies whose name, or a name they do business
// as, starts with this. Two or more letters. Cannot be used on its own, or with a state alone.
Name *string
// Organization is `organization`. One pharmacy: the organization that provides it, as a pharmacy
// search returned it (`Organization-{NPI}`). Stands alone on a pharmacy search. Give a
// Organization id, `Organization/{id}`, or the `fullUrl` this service returned. An address on
// another server is refused.
Organization *string
// OrganizationIdentifier is `organization.identifier`. One pharmacy by its NPI, as
// `{system}|{npi}` or a bare 10-digit value, under the same systems `Organization` accepts. Stands
// alone on a pharmacy search.
OrganizationIdentifier *string
// Active is `active`. `true` or `false`. Narrows a search; cannot be used on its own.
Active *bool
// Include is `_include`. On a pharmacy search, `HealthcareService:organization` brings the
// organization that provides each pharmacy (its NPI, names and phone), and
// `HealthcareService:location` its store (address and phone). Repeat the parameter to include
// several. Included entries do not count toward `_count`. One of: HealthcareService:organization,
// HealthcareService:location.
Include []string
// 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. A NUCC provider taxonomy code is refused: the directory's
// organizations carry none, and pharmacies are searched as `HealthcareService`
// (`service-category=pharm`).
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 StructureDosageInput ¶ added in v0.2.4
type StructureDosageInput struct {
// Text is a prescription's directions, exactly as written. At most 1,000 characters.
Text string
// Medication is the medication's codings, RxNorm or NDC, when known, or nil. With an RxNorm code,
// the product's dose form checks the dose's unit and the route, and supplies either when the
// directions name none.
Medication *fhir.CodeableConcept
}
StructureDosageInput is what StructureDosageRequest builds a StructureDosage request from.
type Validation ¶ added in v0.2.8
type Validation struct {
// Result says whether the code is valid, with the display when one was sent.
Result *bool
// Display is the code's display, given even when a display sent did not match it.
Display string
// Message is what the server says about the answer, in its words.
Message string
// Other is the answer's parts this reader does not read, verbatim.
Other []fhir.ParametersParameter
}
Validation is what ValidationResult reads from a validate-code answer. A part the answer does not carry is "", or nil for Result.
func ValidationResult ¶ added in v0.2.8
func ValidationResult(answer *fhir.Parameters) (Validation, error)
ValidationResult reads a validate-code answer, from a code system or a value set, typed, with no request: whether the code is valid, its display, and the server's message. A display that did not match answers Result false with the code's display beside it. It returns an *Error of KindNotSent when a part FHIR allows once comes twice.
answer, err := client.CodeSystemValidateCode(ctx, haau3.CodeSystemValidateCodeParams{URL: new("http://loinc.org"), Code: "8867-4", Display: new("Pulse")})
if err != nil {
return err
}
check, err := haau3.ValidationResult(answer)
if err == nil && check.Result != nil && !*check.Result {
fmt.Println(check.Message, check.Display)
}
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. The RxNorm value sets this service holds are
// `https://haau3.com/fhir/ValueSet/rxnorm-current-prescribable-content` (every concept of the
// release it serves) and `https://haau3.com/fhir/ValueSet/rxnorm-current-prescribable-products`
// (its drug products: clinical and branded drugs and packs). The ICD-10-CM value sets are
// `https://haau3.com/fhir/ValueSet/icd-10-cm` (every code of the release it serves, headers
// included) and `https://haau3.com/fhir/ValueSet/icd-10-cm-valid-for-submission` (the codes valid
// for submission for HIPAA-covered transactions, so no header).
URL *string
// Filter is `filter`. Text to narrow the expansion: each word must be the start of a word in a
// concept's name, and every word must match, with case and accents ignored. On the RxNorm and
// ICD-10-CM value sets it is required, with at least 3 letters or digits, and the matches come
// ranked, best first; on ICD-10-CM a code is a name too, so `E11` finds `E11` and the codes below
// it. Without it, or with fewer, the answer is `422` coded `too-costly`. At most 500 characters.
// 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). On the
// RxNorm and ICD-10-CM value sets the first 20 come back when it is not sent. 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 paging; `expansion.total` is the number of
// matching concepts. 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. This service does not narrow an expansion by language, designation or status.
DisplayLanguage *string
// IncludeDesignations is `includeDesignations`. Not supported on this operation, and refused with
// a `400` naming it. This service does not narrow an expansion by language, designation or status.
IncludeDesignations *bool
// ActiveOnly is `activeOnly`. Not supported on this operation, and refused with a `400` naming it.
// This service does not narrow an expansion by language, designation or status.
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. On RxNorm and ICD-10-CM any name
// the code has matches: RxNorm's other names, and an ICD-10-CM code's short title.
Display *string
// DisplayLanguage is `displayLanguage`. Language to use when checking the display. RxNorm and
// ICD-10-CM are held in English only: another language is checked against the English names, and
// the `message` says so.
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.
Source Files
¶
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: |