dicom

package
v0.40.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: MIT Imports: 14 Imported by: 1

Documentation

Overview

Package dicom provides support for HSDP DICOM services

Index

Constants

View Source
const (
	APIVersion = "1"
)

Variables

View Source
var (
	ErrDICOMURLCannotBeEmpty = errors.New("base DICOM URL cannot be empty")
	ErrEmptyResult           = errors.New("empty result")
	ErrNonHttp20xResponse    = errors.New("non HTTP 20x DICOM response")
	ErrDICOMForbidden        = errors.New("HTTP 403 DICOM response")
)

Errors

Functions

This section is empty.

Types

type AdvancedSettings

type AdvancedSettings struct {
	PDULength              int `json:"pduLength"`
	ArtimTimeout           int `json:"artimTimeout"`
	AssociationIdleTimeout int `json:"associationIdleTimeout"`
}

AdvancedSettings

type ApplicationEntity

type ApplicationEntity struct {
	AllowAny           bool   `json:"allowAny"`
	AeTitle            string `json:"aeTitle"`
	OrganizationID     string `json:"organizationId"`
	AdditionalSettings struct {
		ServiceTimeout int `json:"serviceTimeout"`
	} `json:"additionalSettings"`
}

ApplicationEntity

type CDRServiceAccount

type CDRServiceAccount struct {
	ID         string `json:"id,omitempty"`
	ServiceID  string `json:"serviceId"`
	PrivateKey string `json:"privateKey"`
}

CDRServiceAccount

func (CDRServiceAccount) Valid

func (c CDRServiceAccount) Valid() bool

Valid

type CertificateInfo added in v0.40.1

type CertificateInfo struct {
	ID string `json:"id"`
}

type Client

type Client struct {

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

	Config *ConfigService
	// contains filtered or unexported fields
}

A Client manages communication with HSDP DICOM API

func NewClient

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

NewClient returns a new HSDP DICOM 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) GetDICOMStoreURL

func (c *Client) GetDICOMStoreURL() string

GetDICOMStoreURL returns the base FHIR Store base URL as configured

func (*Client) GetEndpointURL

func (c *Client) GetEndpointURL() string

GetEndpointURL returns the FHIR Store Endpoint URL as configured

func (*Client) GetQIDOURL

func (o *Client) GetQIDOURL() string

func (*Client) GetSTOWURL

func (o *Client) GetSTOWURL() string

func (*Client) GetWADOURL

func (o *Client) GetWADOURL() string

func (*Client) SetDICOMStoreURL

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

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

func (*Client) SetEndpointURL

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) TokenRefresh added in v0.35.3

func (c *Client) TokenRefresh() error

TokenRefresh forces a refresh of the IAM access token

type Config

type Config struct {
	Region         string
	Environment    string
	OrganizationID string
	DICOMConfigURL string
	Type           string
	TimeZone       string
	DebugLog       string
}

Config contains the configuration of a client

type ConfigService

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

ConfigService

func (*ConfigService) CreateObjectStore

func (c *ConfigService) CreateObjectStore(store ObjectStore, opt *QueryOptions, options ...OptionFunc) (*ObjectStore, *Response, error)

CreateObjectStore

func (*ConfigService) CreateRemoteNode

func (c *ConfigService) CreateRemoteNode(node RemoteNode, options ...OptionFunc) (*RemoteNode, *Response, error)

CreateRemoteNode

func (*ConfigService) CreateRepository

func (c *ConfigService) CreateRepository(repo Repository, opt *QueryOptions, options ...OptionFunc) (*Repository, *Response, error)

CreateRepository

func (*ConfigService) DeleteObjectStore

func (c *ConfigService) DeleteObjectStore(store ObjectStore, opt *QueryOptions, options ...OptionFunc) (bool, *Response, error)

DeleteObjectStore

func (*ConfigService) DeleteRemoteNode

func (c *ConfigService) DeleteRemoteNode(node RemoteNode, options ...OptionFunc) (bool, *Response, error)

DeleteRemoteNode

func (*ConfigService) DeleteRepository

func (c *ConfigService) DeleteRepository(repo Repository, opt *QueryOptions, options ...OptionFunc) (bool, *Response, error)

DeleteObjectStore

func (*ConfigService) GetCDRServiceAccount

func (c *ConfigService) GetCDRServiceAccount(opt *QueryOptions, options ...OptionFunc) (*CDRServiceAccount, *Response, error)

GetCDRServiceAccount

func (*ConfigService) GetFHIRStore

func (c *ConfigService) GetFHIRStore(opt *QueryOptions, options ...OptionFunc) (*FHIRStore, *Response, error)

GetFHIRStore

func (*ConfigService) GetImportService

func (c *ConfigService) GetImportService(opt *QueryOptions, options ...OptionFunc) (*ImportService, *Response, error)

GetImportService

func (*ConfigService) GetMoveService

func (c *ConfigService) GetMoveService(opt *QueryOptions, options ...OptionFunc) (*SCPConfig, *Response, error)

GetMoveService

func (*ConfigService) GetObjectStore

func (c *ConfigService) GetObjectStore(id string, opt *QueryOptions, options ...OptionFunc) (*ObjectStore, *Response, error)

GetObjectStore

func (*ConfigService) GetObjectStores

func (c *ConfigService) GetObjectStores(opt *QueryOptions, options ...OptionFunc) (*[]ObjectStore, *Response, error)

GetObjectStores

func (*ConfigService) GetQueryService

func (c *ConfigService) GetQueryService(opt *QueryOptions, options ...OptionFunc) (*SCPConfig, *Response, error)

GetQueryService

func (*ConfigService) GetRemoteNode

func (c *ConfigService) GetRemoteNode(id string, opt *QueryOptions, options ...OptionFunc) (*RemoteNode, *Response, error)

GetRemoteNode

func (*ConfigService) GetRemoteNodes

func (c *ConfigService) GetRemoteNodes(opt *QueryOptions, options ...OptionFunc) (*[]RemoteNode, *Response, error)

GetRemoteNodes

func (*ConfigService) GetRepositories

func (c *ConfigService) GetRepositories(opt *QueryOptions, options ...OptionFunc) (*[]Repository, *Response, error)

GetRepositories

func (*ConfigService) GetRepository

func (c *ConfigService) GetRepository(id string, opt *QueryOptions, options ...OptionFunc) (*Repository, *Response, error)

GetObjectStore

func (*ConfigService) GetStoreService

func (c *ConfigService) GetStoreService(options ...OptionFunc) (*SCPConfig, *Response, error)

GetStoreService

func (*ConfigService) SetCDRServiceAccount

func (c *ConfigService) SetCDRServiceAccount(svc CDRServiceAccount, opt *QueryOptions, options ...OptionFunc) (*CDRServiceAccount, *Response, error)

SetCDRServiceAccount

func (*ConfigService) SetFHIRStore

func (c *ConfigService) SetFHIRStore(svc FHIRStore, opt *QueryOptions, options ...OptionFunc) (*FHIRStore, *Response, error)

SetFHIRStore

func (*ConfigService) SetImportService

func (c *ConfigService) SetImportService(svc ImportService, opt *QueryOptions, options ...OptionFunc) (*ImportService, *Response, error)

SetImportService

func (*ConfigService) SetMoveService

func (c *ConfigService) SetMoveService(svc SCPConfig, opt *QueryOptions, options ...OptionFunc) (*SCPConfig, *Response, error)

SetMoveService

func (*ConfigService) SetQueryService

func (c *ConfigService) SetQueryService(svc SCPConfig, opt *QueryOptions, options ...OptionFunc) (*SCPConfig, *Response, error)

SetQueryService

func (*ConfigService) SetStoreService

func (c *ConfigService) SetStoreService(svc SCPConfig, options ...OptionFunc) (*SCPConfig, *Response, error)

SetStoreService

type CredsServiceAccess

type CredsServiceAccess struct {
	Endpoint       string `json:"endPoint"`
	ProductKey     string `json:"productKey"`
	BucketName     string `json:"bucketName"`
	FolderPath     string `json:"folderPath"`
	ServiceAccount struct {
		Name                string `json:"name,omitempty"`
		ServiceID           string `json:"serviceId"`
		PrivateKey          string `json:"privateKey"`
		AccessTokenEndPoint string `json:"accessTokenEndPoint"`
		TokenEndPoint       string `json:"tokenEndPoint"`
	} `json:"serviceAccount"`
}

CredsServiceAccess

type ErrorResponse added in v0.40.0

type ErrorResponse struct {
	Error string `json:"error,omitempty"`
}

ErrorResponse contains fields of an error response

type FHIRStore

type FHIRStore struct {
	ID          string `json:"id,omitempty"`
	MPIEndpoint string `json:"mpiEndPoint"`
}

FHIRStore

func (FHIRStore) Valid

func (f FHIRStore) Valid() bool

Valid

type ImportService

type ImportService struct {
	ID      string `json:"id,omitempty"`
	AETitle string `json:"aeTitle"`
}

type NetworkConnection

type NetworkConnection struct {
	Port             int    `json:"port"`
	HostName         string `json:"hostName"`
	IPAddress        string `json:"ipAddress"`
	DisableIPv6      bool   `json:"disableIpv6"`
	AdvancedSettings struct {
		PDULength                     int             `json:"pduLength"`
		ArtimTimeOut                  int             `json:"artimTimeOut"`
		AssociationIdleTimeOut        int             `json:"associationIdleTimeOut"`
		CertificateInfo               CertificateInfo `json:"certificateInfo"`
		AuthenticateClientCertificate bool            `json:"authenticateClientCertificate"`
	} `json:"advancedSettings"`
	NetworkTimeout int  `json:"networkTimeout"`
	IsSecure       bool `json:"isSecure"`
}

NetworkConnection

type ObjectStore

type ObjectStore struct {
	ID                string              `json:"id,omitempty"`
	Description       string              `json:"description,omitempty"`
	AccessType        string              `json:"accessType" validate:"required,enum" enum:"direct,s3Creds"`
	CredServiceAccess *CredsServiceAccess `json:"credServiceAccess,omitempty"`
	StaticAccess      *StaticAccess       `json:"staticAccess,omitempty"`
	ErrorResponse
}

ObjectStore describes a DICOM object store

type OptionFunc

type OptionFunc func(*http.Request) error

OptionFunc is the function signature function for options

type QueryOptions

type QueryOptions struct {
	OrganizationID *string `url:"organizationId,omitempty"`
}

QueryOptions holds optional query options for requests

type RemoteNode

type RemoteNode struct {
	ID                string            `json:"id,omitempty"`
	Title             string            `json:"title"`
	NetworkConnection NetworkConnection `json:"networkConnection"`
	AETitle           string            `json:"aeTitle"`
}

RemoteNode

type Repository

type Repository struct {
	ID                  string `json:"id,omitempty"`
	OrganizationID      string `json:"organizationId"`
	ActiveObjectStoreID string `json:"activeObjectStoreId"`
}

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 SCPConfig

type SCPConfig struct {
	ID                        string              `json:"id,omitempty"`
	Title                     string              `json:"title"`
	Description               string              `json:"description,omitempty"`
	UnSecureNetworkConnection NetworkConnection   `json:"unSecureNetworkConnection"`
	SecureNetworkConnection   NetworkConnection   `json:"secureNetworkConnection"`
	ApplicationEntities       []ApplicationEntity `json:"applicationEntities"`
}

SCPConfig

type StaticAccess

type StaticAccess struct {
	Endpoint   string `json:"endPoint"`
	BucketName string `json:"bucketName"`
	AccessKey  string `json:"accessKey"`
	SecretKey  string `json:"secretKey"`
}

StaticAccess

Jump to

Keyboard shortcuts

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