cdr

package
v0.61.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 15 Imported by: 1

Documentation

Overview

Package cdr provides support for HSDP CDR services

Index

Constants

View Source
const (
	APIVersion = "1"
)

Variables

View Source
var (
	ErrCDRURLCannotBeEmpty = errors.New("base CDR URL cannot be empty")
	ErrEmptyResult         = errors.New("empty result")
	ErrMissingAcceptHeader = errors.New("missing accept header")
)

Errors

Functions

This section is empty.

Types

type Client

type Client struct {

	// User agent used when communicating with the HSDP CDR API
	UserAgent string

	TenantSTU3     *TenantSTU3Service
	OperationsSTU3 *OperationsSTU3Service

	TenantR4     *TenantR4Service
	OperationsR4 *OperationsR4Service
	// contains filtered or unexported fields
}

A Client manages communication with HSDP CDR API

func NewClient

func NewClient(iamClient *iam.Client, config *Config) (*Client, error)

NewClient returns a new HSDP CDR API client. Configured console and IAM clients must be provided as the underlying API requires tokens from respective services

func (*Client) Close

func (c *Client) Close()

Close releases allocated resources of clients

func (*Client) GetEndpointURL added in v0.28.0

func (c *Client) GetEndpointURL() string

GetEndpointURL returns the FHIR Store Endpoint URL as configured

func (*Client) GetFHIRStoreURL added in v0.27.1

func (c *Client) GetFHIRStoreURL() string

GetFHIRStoreURL returns the base FHIR Store base URL as configured

func (*Client) SetEndpointURL added in v0.28.0

func (c *Client) SetEndpointURL(urlStr string) error

SetEndpointURL sets the FHIR endpoint URL for API requests to a custom endpoint. urlStr should always be specified with a trailing slash.

func (*Client) SetFHIRStoreURL

func (c *Client) SetFHIRStoreURL(urlStr string) error

SetFHIRStoreURL sets the FHIR store URL for API requests to a custom endpoint. urlStr should always be specified with a trailing slash.

func (*Client) TokenRefresh added in v0.41.1

func (c *Client) TokenRefresh() error

TokenRefresh forces a refresh of the IAM access token

type Config

type Config struct {
	Region      string
	Environment string
	RootOrgID   string
	CDRURL      string
	FHIRStore   string
	Type        string
	TimeZone    string
	DebugLog    string
}

Config contains the configuration of a client

type OperationsR4Service added in v0.45.0

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

func (*OperationsR4Service) Delete added in v0.45.0

func (o *OperationsR4Service) Delete(resourceID string, options ...OptionFunc) (bool, *Response, error)

Delete removes a FHIR resource

func (*OperationsR4Service) Get added in v0.45.0

func (o *OperationsR4Service) Get(resourceID string, options ...OptionFunc) (*r4pb.ContainedResource, *Response, error)

Get returns a FHIR resource

func (*OperationsR4Service) Patch added in v0.45.0

func (o *OperationsR4Service) Patch(resourceID string, jsonPatch []byte, options ...OptionFunc) (*r4pb.ContainedResource, *Response, error)

Patch makes changes to a FHIR resources accepting the JSONPatch format set

func (*OperationsR4Service) Post added in v0.45.0

func (o *OperationsR4Service) Post(resourceID string, jsonBody []byte, options ...OptionFunc) (*r4pb.ContainedResource, *Response, error)

Post creates new FHIR resources

func (*OperationsR4Service) Put added in v0.45.0

func (o *OperationsR4Service) Put(resourceID string, jsonBody []byte, options ...OptionFunc) (*r4pb.ContainedResource, *Response, error)

Put creates or updates new FHIR resources

type OperationsSTU3Service

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

func (*OperationsSTU3Service) Delete added in v0.27.1

func (o *OperationsSTU3Service) Delete(resourceID string, options ...OptionFunc) (bool, *Response, error)

Delete removes a FHIR resource

func (*OperationsSTU3Service) Get added in v0.27.1

func (o *OperationsSTU3Service) Get(resourceID string, options ...OptionFunc) (*stu3pb.ContainedResource, *Response, error)

Get returns a FHIR resource

func (*OperationsSTU3Service) Patch

func (o *OperationsSTU3Service) Patch(resourceID string, jsonPatch []byte, options ...OptionFunc) (*stu3pb.ContainedResource, *Response, error)

Patch makes changes to a FHIR resources accepting the JSONPatch format set

func (*OperationsSTU3Service) Post

func (o *OperationsSTU3Service) Post(resourceID string, jsonBody []byte, options ...OptionFunc) (*stu3pb.ContainedResource, *Response, error)

Post creates new FHIR resources

func (*OperationsSTU3Service) Put added in v0.27.1

func (o *OperationsSTU3Service) Put(resourceID string, jsonBody []byte, options ...OptionFunc) (*stu3pb.ContainedResource, *Response, error)

Put creates or updates new FHIR resources

type OptionFunc

type OptionFunc func(*http.Request) error

OptionFunc is the function signature function for options

type Response

type Response struct {
	*http.Response
}

Response is a HSDP IAM API response. This wraps the standard http.Response returned from HSDP IAM and provides convenient access to things like errors

type TenantR4Service added in v0.45.0

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

func (*TenantR4Service) GetOrganizationByID added in v0.45.0

func (t *TenantR4Service) GetOrganizationByID(orgID string) (*r4pb.Organization, *Response, error)

func (*TenantR4Service) Onboard added in v0.45.0

func (t *TenantR4Service) Onboard(organization *r4pb.Organization, options ...OptionFunc) (*r4pb.Organization, *Response, error)

Onboard onboards the organization on the CDR under the rootOrgID

type TenantSTU3Service

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

func (*TenantSTU3Service) GetOrganizationByID

func (t *TenantSTU3Service) GetOrganizationByID(orgID string) (*stu3pb.Organization, *Response, error)

func (*TenantSTU3Service) Onboard

func (t *TenantSTU3Service) Onboard(organization *stu3pb.Organization, options ...OptionFunc) (*stu3pb.Organization, *Response, error)

Onboard onboards the organization on the CDR under the rootOrgID

Directories

Path Synopsis
helper
fhir/r4
Package r4 contains helper methods for use with CDR
Package r4 contains helper methods for use with CDR
fhir/stu3
Package dstu3 contains helper methods for use with CDR
Package dstu3 contains helper methods for use with CDR

Jump to

Keyboard shortcuts

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