client

package
v0.0.0-...-41bf266 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: CC0-1.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultParams

func GetDefaultParams() (params url.Values)

func HashIdentifier

func HashIdentifier(toHash string) (hashedValue string, err error)

func SetLogger

func SetLogger(log logrus.FieldLogger)

SetLogger sets the logger to be used in the client. Since both the API and worker use the bluebutton client, we need to be able to set the appropriate logger based on who is using the client.

Types

type APIClient

type APIClient interface {
	GetExplanationOfBenefit(jobData models.JobEnqueueArgs, patientID string, claimsWindow ClaimsWindow) (*fhirModels.Bundle, error)
	GetPatient(jobData models.JobEnqueueArgs, patientID string) (*fhirModels.Bundle, error)
	GetCoverage(jobData models.JobEnqueueArgs, beneficiaryID string) (*fhirModels.Bundle, error)
	GetPatientByIdentifierHash(jobData models.JobEnqueueArgs, hashedIdentifier string) (string, error)
	GetClaim(jobData models.JobEnqueueArgs, mbi string, claimsWindow ClaimsWindow) (*fhirModels.Bundle, error)
	GetClaimResponse(jobData models.JobEnqueueArgs, mbi string, claimsWindow ClaimsWindow) (*fhirModels.Bundle, error)
}

type BlueButtonClient

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

func NewBlueButtonClient

func NewBlueButtonClient(config BlueButtonConfig) (*BlueButtonClient, error)

func (*BlueButtonClient) GetClaim

func (bbc *BlueButtonClient) GetClaim(jobData models.JobEnqueueArgs, mbi string, claimsWindow ClaimsWindow) (*fhirModels.Bundle, error)

func (*BlueButtonClient) GetClaimResponse

func (bbc *BlueButtonClient) GetClaimResponse(jobData models.JobEnqueueArgs, mbi string, claimsWindow ClaimsWindow) (*fhirModels.Bundle, error)

func (*BlueButtonClient) GetCoverage

func (bbc *BlueButtonClient) GetCoverage(jobData models.JobEnqueueArgs, beneficiaryID string) (*fhirModels.Bundle, error)

func (*BlueButtonClient) GetExplanationOfBenefit

func (bbc *BlueButtonClient) GetExplanationOfBenefit(jobData models.JobEnqueueArgs, patientID string, claimsWindow ClaimsWindow) (*fhirModels.Bundle, error)

func (*BlueButtonClient) GetMetadata

func (bbc *BlueButtonClient) GetMetadata() (string, error)

func (*BlueButtonClient) GetPatient

func (bbc *BlueButtonClient) GetPatient(jobData models.JobEnqueueArgs, patientID string) (*fhirModels.Bundle, error)

func (*BlueButtonClient) GetPatientByIdentifierHash

func (bbc *BlueButtonClient) GetPatientByIdentifierHash(jobData models.JobEnqueueArgs, hashedIdentifier string) (string, error)

type BlueButtonConfig

type BlueButtonConfig struct {
	BBServer   string
	BBBasePath string
}

BlueButtonConfig holds the configuration settings needed to create a BlueButtonClient TODO (BCDA-3755): Move the other env vars used in NewBlueButtonClient to this struct

func NewConfig

func NewConfig(basePath string) BlueButtonConfig

NewConfig generates a new BlueButtonConfig using various environment variables.

type ClaimsWindow

type ClaimsWindow struct {
	LowerBound time.Time
	UpperBound time.Time
}

type MockBlueButtonClient

type MockBlueButtonClient struct {
	mock.Mock
	HICN *string
	MBI  *string
}

func (*MockBlueButtonClient) GetBundleData

func (bbc *MockBlueButtonClient) GetBundleData(endpoint, patientID string) (*fhirModels.Bundle, error)

func (*MockBlueButtonClient) GetClaim

func (bbc *MockBlueButtonClient) GetClaim(jobData models.JobEnqueueArgs, mbi string, claimsWindow ClaimsWindow) (*fhirModels.Bundle, error)

func (*MockBlueButtonClient) GetClaimResponse

func (bbc *MockBlueButtonClient) GetClaimResponse(jobData models.JobEnqueueArgs, mbi string, claimsWindow ClaimsWindow) (*fhirModels.Bundle, error)

func (*MockBlueButtonClient) GetCoverage

func (bbc *MockBlueButtonClient) GetCoverage(jobData models.JobEnqueueArgs, beneficiaryID string) (*fhirModels.Bundle, error)

func (*MockBlueButtonClient) GetData

func (bbc *MockBlueButtonClient) GetData(endpoint, patientID string) (string, error)

Returns copy of a static json file (From Blue Button Sandbox originally) after replacing the patient ID of 20000000000001 with the requested identifier This is private in the real function and should remain so, but in the test client it makes maintenance easier to expose it.

func (*MockBlueButtonClient) GetExplanationOfBenefit

func (bbc *MockBlueButtonClient) GetExplanationOfBenefit(jobData models.JobEnqueueArgs, patientID string, serviceDate ClaimsWindow) (*fhirModels.Bundle, error)

func (*MockBlueButtonClient) GetPatient

func (bbc *MockBlueButtonClient) GetPatient(jobData models.JobEnqueueArgs, patientID string) (*fhirModels.Bundle, error)

func (*MockBlueButtonClient) GetPatientByIdentifierHash

func (bbc *MockBlueButtonClient) GetPatientByIdentifierHash(jobData models.JobEnqueueArgs, hashedIdentifier string) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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