dimse

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: Apache-2.0 Imports: 8 Imported by: 6

Documentation

Index

Constants

View Source
const CommandDataSetTypeNonNull uint16 = 1

CommandDataSetTypeNonNull indicates that the DIMSE message has a data payload, when set in dicom.TagCommandDataSetType.

View Source
const CommandDataSetTypeNull uint16 = 0x101

CommandDataSetTypeNull indicates that the DIMSE message has no data payload, when set in dicom.TagCommandDataSetType. Any other value indicates the existence of a payload.

View Source
const CommandFieldCEchoRq = 48
View Source
const CommandFieldCEchoRsp = 32816
View Source
const CommandFieldCFindRq = 32
View Source
const CommandFieldCFindRsp = 32800
View Source
const CommandFieldCGetRq = 16
View Source
const CommandFieldCGetRsp = 32784
View Source
const CommandFieldCMoveRq = 33
View Source
const CommandFieldCMoveRsp = 32801
View Source
const CommandFieldCStoreRq = 1
View Source
const CommandFieldCStoreRsp = 32769

Variables

Success is an OK status for a call.

Functions

func EncodeMessage

func EncodeMessage(e *dicomio.Encoder, v Message)

EncodeMessage serializes the given message. Errors are reported through e.Error()

Types

type CEchoRq

type CEchoRq struct {
	MessageID          MessageID
	CommandDataSetType uint16
	Extra              []*dicom.Element // Unparsed elements
}

func (*CEchoRq) CommandField

func (v *CEchoRq) CommandField() int

func (*CEchoRq) Encode

func (v *CEchoRq) Encode(e *dicomio.Encoder)

func (*CEchoRq) GetMessageID

func (v *CEchoRq) GetMessageID() MessageID

func (*CEchoRq) GetStatus

func (v *CEchoRq) GetStatus() *Status

func (*CEchoRq) HasData

func (v *CEchoRq) HasData() bool

func (*CEchoRq) String

func (v *CEchoRq) String() string

type CEchoRsp

type CEchoRsp struct {
	MessageIDBeingRespondedTo MessageID
	CommandDataSetType        uint16
	Status                    Status
	Extra                     []*dicom.Element // Unparsed elements
}

func (*CEchoRsp) CommandField

func (v *CEchoRsp) CommandField() int

func (*CEchoRsp) Encode

func (v *CEchoRsp) Encode(e *dicomio.Encoder)

func (*CEchoRsp) GetMessageID

func (v *CEchoRsp) GetMessageID() MessageID

func (*CEchoRsp) GetStatus

func (v *CEchoRsp) GetStatus() *Status

func (*CEchoRsp) HasData

func (v *CEchoRsp) HasData() bool

func (*CEchoRsp) String

func (v *CEchoRsp) String() string

type CFindRq

type CFindRq struct {
	AffectedSOPClassUID string
	MessageID           MessageID
	Priority            uint16
	CommandDataSetType  uint16
	Extra               []*dicom.Element // Unparsed elements
}

func (*CFindRq) CommandField

func (v *CFindRq) CommandField() int

func (*CFindRq) Encode

func (v *CFindRq) Encode(e *dicomio.Encoder)

func (*CFindRq) GetMessageID

func (v *CFindRq) GetMessageID() MessageID

func (*CFindRq) GetStatus

func (v *CFindRq) GetStatus() *Status

func (*CFindRq) HasData

func (v *CFindRq) HasData() bool

func (*CFindRq) String

func (v *CFindRq) String() string

type CFindRsp

type CFindRsp struct {
	AffectedSOPClassUID       string
	MessageIDBeingRespondedTo MessageID
	CommandDataSetType        uint16
	Status                    Status
	Extra                     []*dicom.Element // Unparsed elements
}

func (*CFindRsp) CommandField

func (v *CFindRsp) CommandField() int

func (*CFindRsp) Encode

func (v *CFindRsp) Encode(e *dicomio.Encoder)

func (*CFindRsp) GetMessageID

func (v *CFindRsp) GetMessageID() MessageID

func (*CFindRsp) GetStatus

func (v *CFindRsp) GetStatus() *Status

func (*CFindRsp) HasData

func (v *CFindRsp) HasData() bool

func (*CFindRsp) String

func (v *CFindRsp) String() string

type CGetRq

type CGetRq struct {
	AffectedSOPClassUID string
	MessageID           MessageID
	Priority            uint16
	CommandDataSetType  uint16
	Extra               []*dicom.Element // Unparsed elements
}

func (*CGetRq) CommandField

func (v *CGetRq) CommandField() int

func (*CGetRq) Encode

func (v *CGetRq) Encode(e *dicomio.Encoder)

func (*CGetRq) GetMessageID

func (v *CGetRq) GetMessageID() MessageID

func (*CGetRq) GetStatus

func (v *CGetRq) GetStatus() *Status

func (*CGetRq) HasData

func (v *CGetRq) HasData() bool

func (*CGetRq) String

func (v *CGetRq) String() string

type CGetRsp

type CGetRsp struct {
	AffectedSOPClassUID            string
	MessageIDBeingRespondedTo      MessageID
	CommandDataSetType             uint16
	NumberOfRemainingSuboperations uint16
	NumberOfCompletedSuboperations uint16
	NumberOfFailedSuboperations    uint16
	NumberOfWarningSuboperations   uint16
	Status                         Status
	Extra                          []*dicom.Element // Unparsed elements
}

func (*CGetRsp) CommandField

func (v *CGetRsp) CommandField() int

func (*CGetRsp) Encode

func (v *CGetRsp) Encode(e *dicomio.Encoder)

func (*CGetRsp) GetMessageID

func (v *CGetRsp) GetMessageID() MessageID

func (*CGetRsp) GetStatus

func (v *CGetRsp) GetStatus() *Status

func (*CGetRsp) HasData

func (v *CGetRsp) HasData() bool

func (*CGetRsp) String

func (v *CGetRsp) String() string

type CMoveRq

type CMoveRq struct {
	AffectedSOPClassUID string
	MessageID           MessageID
	Priority            uint16
	MoveDestination     string
	CommandDataSetType  uint16
	Extra               []*dicom.Element // Unparsed elements
}

func (*CMoveRq) CommandField

func (v *CMoveRq) CommandField() int

func (*CMoveRq) Encode

func (v *CMoveRq) Encode(e *dicomio.Encoder)

func (*CMoveRq) GetMessageID

func (v *CMoveRq) GetMessageID() MessageID

func (*CMoveRq) GetStatus

func (v *CMoveRq) GetStatus() *Status

func (*CMoveRq) HasData

func (v *CMoveRq) HasData() bool

func (*CMoveRq) String

func (v *CMoveRq) String() string

type CMoveRsp

type CMoveRsp struct {
	AffectedSOPClassUID            string
	MessageIDBeingRespondedTo      MessageID
	CommandDataSetType             uint16
	NumberOfRemainingSuboperations uint16
	NumberOfCompletedSuboperations uint16
	NumberOfFailedSuboperations    uint16
	NumberOfWarningSuboperations   uint16
	Status                         Status
	Extra                          []*dicom.Element // Unparsed elements
}

func (*CMoveRsp) CommandField

func (v *CMoveRsp) CommandField() int

func (*CMoveRsp) Encode

func (v *CMoveRsp) Encode(e *dicomio.Encoder)

func (*CMoveRsp) GetMessageID

func (v *CMoveRsp) GetMessageID() MessageID

func (*CMoveRsp) GetStatus

func (v *CMoveRsp) GetStatus() *Status

func (*CMoveRsp) HasData

func (v *CMoveRsp) HasData() bool

func (*CMoveRsp) String

func (v *CMoveRsp) String() string

type CStoreRq

type CStoreRq struct {
	AffectedSOPClassUID                  string
	MessageID                            MessageID
	Priority                             uint16
	CommandDataSetType                   uint16
	AffectedSOPInstanceUID               string
	MoveOriginatorApplicationEntityTitle string
	MoveOriginatorMessageID              MessageID
	Extra                                []*dicom.Element // Unparsed elements
}

func (*CStoreRq) CommandField

func (v *CStoreRq) CommandField() int

func (*CStoreRq) Encode

func (v *CStoreRq) Encode(e *dicomio.Encoder)

func (*CStoreRq) GetMessageID

func (v *CStoreRq) GetMessageID() MessageID

func (*CStoreRq) GetStatus

func (v *CStoreRq) GetStatus() *Status

func (*CStoreRq) HasData

func (v *CStoreRq) HasData() bool

func (*CStoreRq) String

func (v *CStoreRq) String() string

type CStoreRsp

type CStoreRsp struct {
	AffectedSOPClassUID       string
	MessageIDBeingRespondedTo MessageID
	CommandDataSetType        uint16
	AffectedSOPInstanceUID    string
	Status                    Status
	Extra                     []*dicom.Element // Unparsed elements
}

func (*CStoreRsp) CommandField

func (v *CStoreRsp) CommandField() int

func (*CStoreRsp) Encode

func (v *CStoreRsp) Encode(e *dicomio.Encoder)

func (*CStoreRsp) GetMessageID

func (v *CStoreRsp) GetMessageID() MessageID

func (*CStoreRsp) GetStatus

func (v *CStoreRsp) GetStatus() *Status

func (*CStoreRsp) HasData

func (v *CStoreRsp) HasData() bool

func (*CStoreRsp) String

func (v *CStoreRsp) String() string

type CommandAssembler

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

CommandAssembler is a helper that assembles a DIMSE command message and data payload from a sequence of P_DATA_TF PDUs.

func (*CommandAssembler) AddDataPDU

func (a *CommandAssembler) AddDataPDU(pdu *pdu.PDataTf) (byte, Message, []byte, error)

AddDataPDU is to be called for each P_DATA_TF PDU received from the network. If the fragment is marked as the last one, AddDataPDU returns <SOPUID, TransferSyntaxUID, payload, nil>. If it needs more fragments, it returns <"", "", nil, nil>. On error, it returns a non-nil error.

type Message

type Message interface {
	fmt.Stringer // Print human-readable description for debugging.
	Encode(*dicomio.Encoder)
	// GetMessageID extracts the message ID field.
	GetMessageID() MessageID
	// CommandField returns the command field value of this message.
	CommandField() int
	// GetStatus returns the the response status value. It is nil for request message
	// types, and non-nil for response message types.
	GetStatus() *Status
	// HasData is true if we expect P_DATA_TF packets after the command packets.
	HasData() bool
}

Message defines the common interface for all DIMSE message types.

func ReadMessage

func ReadMessage(d *dicomio.Decoder) Message

ReadMessage constructs a typed dimse.Message object, given a set of dicom.Elements,

type MessageID

type MessageID = uint16

type Status

type Status struct {
	// Status==StatusSuccess on success. A non-zero value on error.
	Status StatusCode

	// Optional error payloads.
	ErrorComment string // Encoded as (0000,0902)
}

Status represents a result of a DIMSE call. P3.7 C defines list of status codes and error payloads.

type StatusCode

type StatusCode uint16

StatusCode represents a DIMSE service response code, as defined in P3.7

const (
	StatusSuccess               StatusCode = 0
	StatusCancel                StatusCode = 0xFE00
	StatusSOPClassNotSupported  StatusCode = 0x0112
	StatusInvalidArgumentValue  StatusCode = 0x0115
	StatusInvalidAttributeValue StatusCode = 0x0106
	StatusInvalidObjectInstance StatusCode = 0x0117
	StatusUnrecognizedOperation StatusCode = 0x0211
	StatusNotAuthorized         StatusCode = 0x0124
	StatusPending               StatusCode = 0xff00

	// C-STORE-specific status codes. P3.4 GG4-1
	CStoreOutOfResources              StatusCode = 0xa700
	CStoreCannotUnderstand            StatusCode = 0xc000
	CStoreDataSetDoesNotMatchSOPClass StatusCode = 0xa900

	// C-FIND-specific status codes.
	CFindUnableToProcess StatusCode = 0xc000

	// C-MOVE/C-GET-specific status codes.
	CMoveOutOfResourcesUnableToCalculateNumberOfMatches StatusCode = 0xa701
	CMoveOutOfResourcesUnableToPerformSubOperations     StatusCode = 0xa702
	CMoveMoveDestinationUnknown                         StatusCode = 0xa801
	CMoveDataSetDoesNotMatchSOPClass                    StatusCode = 0xa900

	// Warning codes.
	StatusAttributeValueOutOfRange StatusCode = 0x0116
	StatusAttributeListError       StatusCode = 0x0107
)

func (StatusCode) String

func (i StatusCode) String() string

Jump to

Keyboard shortcuts

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