Documentation
¶
Index ¶
- Constants
- Variables
- type Boolean
- type Carrier
- type Cent
- type Client
- func (c *Client) GetCarrier(ctx context.Context, id int32) (*Carrier, error)
- func (c *Client) GetDrugNames(ctx context.Context, searchTerm string) ([]*GetDrugNamesResponse, error)
- func (c *Client) ListCountiesByZipCode(ctx context.Context, zipCode string) ([]*ListCountiesByZipCodeResponse, error)
- func (c *Client) ListDrugDosagesByDrugName(ctx context.Context, drugName string) ([]*Drug, error)
- func (c *Client) ListPharmaciesByZipCode(ctx context.Context, zipCode, radius string) ([]*Pharmacy, error)
- func (c *Client) Ping(ctx context.Context) error
- func (c *Client) RequestQuote(ctx context.Context, params RequestQuoteParams) (*RequestQuoteResponse, error)
- type County
- type Drug
- type Error
- type ExternalProvider
- type GetDrugNamesResponse
- type ListCountiesByZipCodeResponse
- type Pharmacy
- type Quote
- type QuoteDrug
- type QuoteProducts
- type RequestQuoteParams
- type RequestQuoteResponse
Constants ¶
const ( GenderMale = "M" GenderFemale = "F" )
Variables ¶
var (
ErrNoResults = errors.New("no results")
)
Functions ¶
This section is empty.
Types ¶
type Boolean ¶
type Boolean bool
Boolean is a custom type assisting in the proper unmarshaling of non-standard boolean types sent over json.
func (*Boolean) UnmarshalJSON ¶
type Cent ¶
type Cent int32
Cent is a custom type for unmarshaling currency strings into int32 cents.
func (*Cent) UnmarshalJSON ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetCarrier ¶
func (*Client) GetDrugNames ¶
func (c *Client) GetDrugNames(ctx context.Context, searchTerm string) ([]*GetDrugNamesResponse, error)
GetDrugNames returns a list of drug names that match the provided partial drug name. A partial drug name typically consist of the first 3 letters of the drug name.
func (*Client) ListCountiesByZipCode ¶
func (c *Client) ListCountiesByZipCode(ctx context.Context, zipCode string) ([]*ListCountiesByZipCodeResponse, error)
ListCountiesByZipCode retrieves all counties within a given zip code, organized by state. The response includes one entry per state that intersects with the zip code, with each state entry containing its respective counties that fall within the zip code boundaries.
func (*Client) ListDrugDosagesByDrugName ¶
ListDrugDosagesByDrugName returns a list of Drugs & dosages for a given drug name.
func (*Client) ListPharmaciesByZipCode ¶
func (c *Client) ListPharmaciesByZipCode(ctx context.Context, zipCode, radius string) ([]*Pharmacy, error)
ListPharmaciesByZipCode returns a list of pharmacies for a given zipcode, within a given radius from the geographical center of the zipcode.
func (*Client) Ping ¶
Ping checks the current health status of the client. A client with an active access token is in a healthy state.
func (*Client) RequestQuote ¶
func (c *Client) RequestQuote(ctx context.Context, params RequestQuoteParams) (*RequestQuoteResponse, error)
type Drug ¶
type Drug struct {
DosageID string `json:"dosageid"`
PackType string `json:"packtype"`
Unit string `json:"unit"`
NDCCode string `json:"ndccode"`
CommonMetricQuantity string `json:"commonmetricquantity"`
Strength string `json:"strength"`
TradeName string `json:"tradename"`
DrugName string `json:"drugname"`
DrugID string `json:"drugid"`
IsCommonDosage Boolean `json:"iscommondosage"`
DrugType string `json:"drugtype"`
GenericDrugName string `json:"genericdrugname"`
PackSize string `json:"packsize"`
GenericDosageID string `json:"genericdosageid"`
GenericDrugID string `json:"genericdrugid"`
CommonDaysOfSupply string `json:"commondaysofsupply"`
CommonUserQuantity string `json:"commonuserquantity"`
}
type Error ¶
type Error struct {
Message string `json:"message"`
Success string `json:"success"`
StatusCode string `json:"statuscode"`
HTTPMethod string `json:"httpmethod"`
HTTPContent json.RawMessage `json:"httpcontent"`
CurrentEvent string `json:"currentevent"`
}
Error represents an error response from the LAPro API. The structure varies based on the type of error: For successful API calls that return no results (e.g., valid searches with zero records), only the Result, Message, and Success fields are populated. For actual API errors, all fields are populated with the status code indicating the issue type and the complete error response details.
type ExternalProvider ¶
type GetDrugNamesResponse ¶
type Quote ¶
type Quote struct {
PlanID string `json:"plan_id"`
PlanName string `json:"plan_name"`
CarrierName string `json:"carrier_name"`
CarrierID string `json:"carrier_id"`
DrugPremiumCents Cent `json:"drug_premium"`
EstimatedAnnualDrugCostCents Cent `json:"estimated_annual_drug_cost"`
MAPDProductType string `json:"mapd_product_type"`
AnnualTotalCombinedCents Cent `json:"annual_total_combined"`
}
func (*Quote) EstimatedMonthlyDrugCostCents ¶
type QuoteDrug ¶
type QuoteDrug struct {
Name string `json:"drug_name"`
Type string `json:"drug_type"`
MetricQty string `json:"drug_metric_qty"`
Freq string `json:"drug_freq"`
NDCCode string `json:"drug_ndc_code"`
Strength string `json:"drug_strength"`
PackSize string `json:"drug_pack_size"`
PackType string `json:"drug_pack_type"`
PackUnit string `json:"drug_pack_unit"`
DosageExternalID string `json:"drug_dosage_external_id"`
}
type QuoteProducts ¶
type RequestQuoteParams ¶
type RequestQuoteParams struct {
Zip string `json:"zip"`
County string `json:"county"`
DOB string `json:"dob"`
EffectiveDate string `json:"eff_date"`
HealthStatus string `json:"health_status"`
QuoteProducts QuoteProducts `json:"quote_products"`
ExternalProviders []ExternalProvider `json:"external_providers"`
Drugs []QuoteDrug `json:"drugs"`
Gender string `json:"gender"`
PharmacyID string `json:"pharmacy_id"`
}
type RequestQuoteResponse ¶
type RequestQuoteResponse struct {
MapDResults []*Quote `json:"mapdresult"`
}