dicom

package
v0.85.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 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")
	ErrNotFound              = errors.New("not found")
)

Errors

Functions

This section is empty.

Types

type AdvancedSettings

type AdvancedSettings struct {
	PDULength              int `json:"pduLength,omitempty"`
	ArtimTimeout           int `json:"artimTimeOut,omitempty"`
	AssociationIdleTimeout int `json:"associationIdleTimeOut,omitempty"`
}

AdvancedSettings

type ApplicationEntity

type ApplicationEntity struct {
	AllowAny       bool   `json:"allowAny"`
	AeTitle        string `json:"aeTitle"`
	OrganizationID string `json:"organizationId"`
}

ApplicationEntity

type BrokenAdvancedSettings added in v0.46.0

type BrokenAdvancedSettings struct {
	PDULength              int `json:"pduLength,omitempty"`
	ArtimTimeout           int `json:"artimTimeout,omitempty"`
	AssociationIdleTimeout int `json:"associationIdleTimeout,omitempty"`
}

BrokenAdvancedSettings

type BrokenNetworkConnection added in v0.46.0

type BrokenNetworkConnection struct {
	Port             int                     `json:"port,omitempty"`
	HostName         string                  `json:"hostName,omitempty"`
	IPAddress        string                  `json:"ipAddress,omitempty"`
	AdvancedSettings *BrokenAdvancedSettings `json:"advancedSettings,omitempty"`
	CertificateInfo  *CertificateInfo        `json:"certificateInfo,omitempty"`
	NetworkTimeout   int                     `json:"networkTimeout,omitempty"`
}

BrokenNetworkConnection

type BrokenSCPConfig added in v0.46.0

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

BrokenSCPConfig

The backstory of the 'Broken' prefix is that at least one JSON field has a difference in casing usage e.g.: 'associationIdleTimeout' vs 'associationIdleTimeOut' This is a subtle but significant issue i.e. we can't use the regular SCPConfig struct in places where the different cased JSON fields are expected. Fixing the API would also mean bumping the version number. Until that time we will keep the BrokenSCPConfig definition here. We have prefixed it, so it stays on the radar.

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,omitempty"`
}

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 (c *Client) GetQIDOURL() string

func (*Client) GetSTOWURL

func (c *Client) GetSTOWURL() string

func (*Client) GetWADOURL

func (c *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       io.Writer
}

Config contains the configuration of a client

type ConfigService

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

ConfigService

func (*ConfigService) CreateNotification added in v0.52.0

func (c *ConfigService) CreateNotification(repo Notification, opt *QueryOptions, options ...OptionFunc) (*Notification, *Response, error)

CreateNotification creates a notification

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, opt *QueryOptions, 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, opt *QueryOptions, options ...OptionFunc) (bool, *Response, error)

DeleteRemoteNode

func (*ConfigService) DeleteRepository

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

DeleteRepository

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) GetNotification added in v0.52.0

func (c *ConfigService) GetNotification(opt *QueryOptions, options ...OptionFunc) (*Notification, *Response, error)

GetNotification gets the notification settings of a given organization

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) GetQueryRetrieveService added in v0.46.0

func (c *ConfigService) GetQueryRetrieveService(opt *QueryOptions, options ...OptionFunc) (*BrokenSCPConfig, *Response, error)

GetQueryRetrieveService

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)

GetRepository

func (*ConfigService) GetStoreService

func (c *ConfigService) GetStoreService(opt *QueryOptions, options ...OptionFunc) (*BrokenSCPConfig, *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) SetQueryRetrieveService added in v0.46.0

func (c *ConfigService) SetQueryRetrieveService(svc BrokenSCPConfig, opt *QueryOptions, options ...OptionFunc) (*BrokenSCPConfig, *Response, error)

SetQueryRetrieveService

func (*ConfigService) SetStoreService

func (c *ConfigService) SetStoreService(svc BrokenSCPConfig, opt *QueryOptions, options ...OptionFunc) (*BrokenSCPConfig, *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"`
	Description string `json:"description,omitempty"`
}

type NetworkConnection

type NetworkConnection struct {
	Port             int               `json:"port,omitempty"`
	HostName         string            `json:"hostName,omitempty"`
	IPAddress        string            `json:"ipAddress,omitempty"`
	DisableIPv6      bool              `json:"disableIpv6"`
	IsSecure         bool              `json:"isSecure"`
	AdvancedSettings *AdvancedSettings `json:"advancedSettings,omitempty"`
	CertificateInfo  *CertificateInfo  `json:"certificateInfo,omitempty"`
	NetworkTimeout   int               `json:"networkTimeout,omitempty"`
}

NetworkConnection

type Notification added in v0.52.0

type Notification struct {
	ID                    string `json:"id,omitempty"`
	Enabled               bool   `json:"enabled" validate:"required"`
	Endpoint              string `json:"endPoint" validate:"required"`
	DefaultOrganizationID string `json:"defaultOrganizationId,omitempty"`
}

type ObjectStore

type ObjectStore struct {
	ID                string              `json:"id,omitempty"`
	Description       string              `json:"description,omitempty"`
	AccessType        string              `json:"accessType" validate:"required,oneof=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"`
	StoreAsComposite    *bool                   `json:"storeAsComposite,omitempty"`
	Notification        *RepositoryNotification `json:"notification,omitempty"`
}

type RepositoryNotification added in v0.52.0

type RepositoryNotification struct {
	Enabled        bool   `json:"enabled"`
	OrganizationID string `json:"organizationId"`
}

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

func (*Response) StatusCode added in v0.73.0

func (r *Response) StatusCode() int

type SCPConfig

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

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