📄 dimse.h
字号:
/*** Copyright (C) 1993/1994, OFFIS, Oldenburg University and CERIUM** ** This software and supporting documentation were** developed by ** ** Institut OFFIS** Bereich Kommunikationssysteme** Westerstr. 10-12** 26121 Oldenburg, Germany** ** Fachbereich Informatik** Abteilung Prozessinformatik** Carl von Ossietzky Universitaet Oldenburg ** Ammerlaender Heerstr. 114-118** 26111 Oldenburg, Germany** ** CERIUM** Laboratoire SIM** Faculte de Medecine** 2 Avenue du Pr. Leon Bernard** 35043 Rennes Cedex, France** ** for CEN/TC251/WG4 as a contribution to the Radiological ** Society of North America (RSNA) 1993 Digital Imaging and ** Communications in Medicine (DICOM) Demonstration.** ** THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND NEITHER OFFIS,** OLDENBURG UNIVERSITY NOR CERIUM MAKE ANY WARRANTY REGARDING ** THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR ** FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER ** DISEASES OR ITS CONFORMITY TO ANY SPECIFICATION. THE ** ENTIRE RISK AS TO QUALITY AND PERFORMANCE OF THE SOFTWARE ** IS WITH THE USER. ** ** Copyright of the software and supporting documentation** is, unless otherwise stated, jointly owned by OFFIS,** Oldenburg University and CERIUM and free access is hereby** granted as a license to use this software, copy this** software and prepare derivative works based upon this** software. However, any distribution of this software** source code or supporting documentation or derivative** works (source code and supporting documentation) must** include the three paragraphs of this copyright notice. ** *//***** Author: Andrew Hewett Created: 03-06-93** ** Module: dimse**** Purpose: ** This file contains the routines which provide dimse layer services** for DICOM applications. **** Module Prefix: DIMSE_**** Last Update: $Author: meichel $** Update Date: $Date: 2005/12/08 16:02:21 $** Source File: $Source: /share/dicom/cvs-depot/dcmtk/dcmnet/include/dcmtk/dcmnet/dimse.h,v $** CVS/RCS Revision: $Revision: 1.17 $** Status: $State: Exp $**** CVS/RCS Log at end of file***/#ifndef DIMSE_H#define DIMSE_H/* * Required Include Files */ #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */#include "dcmtk/dcmnet/dicom.h"#include "dcmtk/dcmnet/lst.h"#include "dcmtk/dcmnet/cond.h"#include "dcmtk/dcmnet/dul.h"#include "dcmtk/dcmnet/assoc.h"#include "dcmtk/dcmdata/dcdatset.h"#include "dcmtk/ofstd/ofglobal.h"class DcmOutputFileStream;/** Global flag to enable/disable workaround code for some buggy Store SCUs * in DIMSE_storeProvider(). If enabled, an illegal space-padding in the * Affected SOP Instance UID field of the C-STORE-RQ message is retained * in the corresponding C-STORE-RSP message. * To enable the workaround, this flag must be set to OFTrue and * dcmEnableAutomaticInputDataCorrection must be set to OFFalse. * (see declaration in dcmdata/include/dcobject.h) */extern OFGlobal<OFBool> dcmPeerRequiresExactUIDCopy; /* default OFFalse *//** global flag allowing to restrict the maximum size of outgoing * P-DATA PDUs to a value less than the maximum supported by the * remote application entity or this library. May be useful * if there is an interaction between PDU size and other network * layers, e. g. TLS, IP or below. */extern OFGlobal<Uint32> dcmMaxOutgoingPDUSize; /* default 2^32-1 *//* * General Status Codes */#define STATUS_Success 0x0000#define STATUS_Pending 0xff00#define DICOM_PENDING_STATUS(status) (((status)&0xff00) == 0xff00)#define DICOM_WARNING_STATUS(status) (((status)&0xf000) == 0xb000)/* * Service Class Specific Status Codes * NOTE: some codes are only significant in the high byte * or high nibble (4 bits). *//* Storage Specific Codes*/#define STATUS_STORE_Refused_OutOfResources /* high byte */ 0xa700 #define STATUS_STORE_Refused_SOPClassNotSupported /* high byte */ 0xa800 #define STATUS_STORE_Error_DataSetDoesNotMatchSOPClass /* high byte */ 0xa900 #define STATUS_STORE_Error_CannotUnderstand /* high nibble */ 0xc000 #define STATUS_STORE_Warning_CoersionOfDataElements 0xb000#define STATUS_STORE_Warning_DataSetDoesNotMatchSOPClass 0xb007#define STATUS_STORE_Warning_ElementsDiscarded 0xb006/* Find Specific Codes */#define STATUS_FIND_Refused_OutOfResources 0xa700#define STATUS_FIND_Refused_SOPClassNotSupported 0xa800#define STATUS_FIND_Failed_IdentifierDoesNotMatchSOPClass 0xa900#define STATUS_FIND_Failed_UnableToProcess /* high nibble */ 0xc000 #define STATUS_FIND_Cancel_MatchingTerminatedDueToCancelRequest 0xfe00#define STATUS_FIND_Pending_WarningUnsupportedOptionalKeys 0xff01/* Move Specific Codes */#define STATUS_MOVE_Refused_OutOfResourcesNumberOfMatches 0xa701#define STATUS_MOVE_Refused_OutOfResourcesSubOperations 0xa702#define STATUS_MOVE_Failed_SOPClassNotSupported 0xa800#define STATUS_MOVE_Failed_MoveDestinationUnknown 0xa801#define STATUS_MOVE_Failed_IdentifierDoesNotMatchSOPClass 0xa900#define STATUS_MOVE_Failed_UnableToProcess /* high nibble */ 0xc000 #define STATUS_MOVE_Cancel_SubOperationsTerminatedDueToCancelIndication 0xfe00#define STATUS_MOVE_Warning_SubOperationsCompleteOneOrMoreFailures 0xb000/* Get Specific Codes */#define STATUS_GET_Refused_OutOfResourcesNumberOfMatches 0xa701#define STATUS_GET_Refused_OutOfResourcesSubOperations 0xa702#define STATUS_GET_Failed_SOPClassNotSupported 0xa800#define STATUS_GET_Failed_IdentifierDoesNotMatchSOPClass 0xa900#define STATUS_GET_Failed_UnableToProcess /* high nibble */ 0xc000 #define STATUS_GET_Cancel_SubOperationsTerminatedDueToCancelIndication 0xfe00#define STATUS_GET_Warning_SubOperationsCompleteOneOrMoreFailures 0xb000/* DIMSE-N Specific Codes */#define STATUS_N_Cancel 0xFE00#define STATUS_N_AttributeListError 0x0107#define STATUS_N_SOPClassNotSupported 0x0122#define STATUS_N_ClassInstanceConflict 0x0119#define STATUS_N_DuplicateSOPInstance 0x0111#define STATUS_N_DuplicateInvocation 0x0210#define STATUS_N_InvalidArgumentValue 0x0115#define STATUS_N_InvalidAttributeValue 0x0106#define STATUS_N_InvalidObjectInstance 0x0117#define STATUS_N_MissingAttribute 0x0120#define STATUS_N_MissingAttributeValue 0x0121#define STATUS_N_MistypedArgument 0x0212#define STATUS_N_NoSuchArgument 0x0114#define STATUS_N_NoSuchAttribute 0x0105#define STATUS_N_NoSuchEventType 0x0113#define STATUS_N_NoSuchObjectInstance 0x0112#define STATUS_N_NoSuchSOPClass 0x0118#define STATUS_N_ProcessingFailure 0x0110#define STATUS_N_ResourceLimitation 0x0213#define STATUS_N_UnrecognizedOperation 0x0211/* Print Management Service Class Specific Codes */#define STATUS_N_PRINT_BFS_Warn_MemoryAllocation 0xB600#define STATUS_N_PRINT_BFS_Warn_NoSessionPrinting 0xB601#define STATUS_N_PRINT_BFS_Warn_EmptyPage 0xB602#define STATUS_N_PRINT_BFB_Warn_EmptyPage 0xB603#define STATUS_N_PRINT_BFS_Fail_NoFilmBox 0xC600#define STATUS_N_PRINT_BFS_Fail_PrintQueueFull 0xC601#define STATUS_N_PRINT_BSB_Fail_PrintQueueFull 0xC602#define STATUS_N_PRINT_BFS_BFB_Fail_ImageSize 0xC603#define STATUS_N_PRINT_BFS_BFB_Fail_PositionCollision 0xC604#define STATUS_N_PRINT_IB_Fail_InsufficientMemory 0xC605#define STATUS_N_PRINT_IB_Fail_MoreThanOneVOILUT 0xC606/* * Type Definitions *//* * DIMSE Command Codes (Request and Response) */typedef enum { /* DIC_US */ DIMSE_NOTHING = 0x0000, /* none of the rest !! */ DIMSE_C_STORE_RQ = 0x0001, /* also known as C_SEND_RQ */ DIMSE_C_STORE_RSP = 0x8001, /* also known as C_SEND_RSP */ DIMSE_C_GET_RQ = 0x0010, DIMSE_C_GET_RSP = 0x8010, DIMSE_C_FIND_RQ = 0x0020, DIMSE_C_FIND_RSP = 0x8020, DIMSE_C_MOVE_RQ = 0x0021, DIMSE_C_MOVE_RSP = 0x8021, DIMSE_C_ECHO_RQ = 0x0030, DIMSE_C_ECHO_RSP = 0x8030, DIMSE_C_CANCEL_RQ = 0x0fff, /* there is no DIMSE_C_CANCEL_RSP */ DIMSE_N_EVENT_REPORT_RQ = 0x0100, DIMSE_N_EVENT_REPORT_RSP = 0x8100, DIMSE_N_GET_RQ = 0x0110, DIMSE_N_GET_RSP = 0x8110, DIMSE_N_SET_RQ = 0x0120, DIMSE_N_SET_RSP = 0x8120, DIMSE_N_ACTION_RQ = 0x0130, DIMSE_N_ACTION_RSP = 0x8130, DIMSE_N_CREATE_RQ = 0x0140, DIMSE_N_CREATE_RSP = 0x8140, DIMSE_N_DELETE_RQ = 0x0150, DIMSE_N_DELETE_RSP = 0x8150} T_DIMSE_Command;/* * DIMSE Data Set Type Codes */typedef enum { /* DIC_US */ DIMSE_DATASET_PRESENT = 0x0001, /* anything other than 0x0101) */ DIMSE_DATASET_NULL = 0x0101} T_DIMSE_DataSetType;/* * DIMSE Priority Codes */typedef enum { /* DIC_US */ DIMSE_PRIORITY_LOW = 0x0002, DIMSE_PRIORITY_MEDIUM = 0x0000, DIMSE_PRIORITY_HIGH = 0x0001} T_DIMSE_Priority;/* * DIMSE Blocking Modes (reading) */typedef enum { DIMSE_BLOCKING, DIMSE_NONBLOCKING} T_DIMSE_BlockingMode;/* * DIMSE Messages * *//* C-STORE */struct T_DIMSE_C_StoreRQ { DIC_US MessageID; /* M */ DIC_UI AffectedSOPClassUID; /* M */ T_DIMSE_Priority Priority; /* M */ T_DIMSE_DataSetType DataSetType; /* M */ DIC_UI AffectedSOPInstanceUID; /* M */ DIC_AE MoveOriginatorApplicationEntityTitle; /* U */ DIC_US MoveOriginatorID; /* U */ /* DataSet provided as argument to DIMSE functions */ /* M */ unsigned int opts; /* which optional items are set */#define O_STORE_MOVEORIGINATORAETITLE 0x0001#define O_STORE_MOVEORIGINATORID 0x0002 /* the following flag is set on incoming C-STORE requests if * the SOP instance UID is (incorrectly) padded with a space * character. Will only be detected if the dcmdata flag * dcmEnableAutomaticInputDataCorrection is false. */#define O_STORE_RQ_BLANK_PADDING 0x0008};struct T_DIMSE_C_StoreRSP { DIC_US MessageIDBeingRespondedTo; /* M */ DIC_UI AffectedSOPClassUID; /* U(=) */ T_DIMSE_DataSetType DataSetType; /* M */ DIC_US DimseStatus; /* M */ DIC_UI AffectedSOPInstanceUID; /* U(=) */ unsigned int opts; /* which optional items are set */#define O_STORE_AFFECTEDSOPCLASSUID 0x0001#define O_STORE_AFFECTEDSOPINSTANCEUID 0x0002 /* peer requires an exact copy of the SOP instance UID * as it was sent in the C-STORE-RQ, * including any illegal trailing space padding. */#define O_STORE_PEER_REQUIRES_EXACT_UID_COPY 0x0004 /* SOP instance UID in C-STORE-RQ was space padded. */#define O_STORE_RSP_BLANK_PADDING 0x0008} ;/* C-ECHO */struct T_DIMSE_C_EchoRQ { DIC_US MessageID; /* M */ DIC_UI AffectedSOPClassUID; /* M */ T_DIMSE_DataSetType DataSetType; /* M */} ;struct T_DIMSE_C_EchoRSP { DIC_US MessageIDBeingRespondedTo; /* M */ DIC_UI AffectedSOPClassUID; /* U(=) */ T_DIMSE_DataSetType DataSetType; /* M */ DIC_US DimseStatus; /* M */ unsigned int opts; /* which optional items are set */#define O_ECHO_AFFECTEDSOPCLASSUID 0x0001} ;/* C-FIND */struct T_DIMSE_C_FindRQ { DIC_US MessageID; /* M */ DIC_UI AffectedSOPClassUID; /* M */ T_DIMSE_Priority Priority; /* M */ T_DIMSE_DataSetType DataSetType; /* M */ /* Identifier provided as argument to DIMSE functions *//* M */} ;struct T_DIMSE_C_FindRSP { DIC_US MessageIDBeingRespondedTo; /* M */ DIC_UI AffectedSOPClassUID; /* U(=) */ T_DIMSE_DataSetType DataSetType; /* M */ DIC_US DimseStatus; /* M */ /* Identifier provided as argument to DIMSE functions *//* C */ unsigned int opts; /* which optional items are set */#define O_FIND_AFFECTEDSOPCLASSUID 0x0001} ;/* C-GET */struct T_DIMSE_C_GetRQ { DIC_US MessageID; /* M */ DIC_UI AffectedSOPClassUID; /* M */ T_DIMSE_Priority Priority; /* M */ T_DIMSE_DataSetType DataSetType; /* M */ /* Identifier provided as argument to DIMSE functions *//* M */} ;struct T_DIMSE_C_GetRSP { DIC_US MessageIDBeingRespondedTo; /* M */ DIC_UI AffectedSOPClassUID; /* U(=) */ T_DIMSE_DataSetType DataSetType; /* M */ DIC_US DimseStatus; /* M */ DIC_US NumberOfRemainingSubOperations; /* C */ DIC_US NumberOfCompletedSubOperations; /* C */ DIC_US NumberOfFailedSubOperations; /* C */ DIC_US NumberOfWarningSubOperations; /* C */ unsigned int opts; /* which optional items are set */#define O_GET_AFFECTEDSOPCLASSUID 0x0001#define O_GET_NUMBEROFREMAININGSUBOPERATIONS 0x0002#define O_GET_NUMBEROFCOMPLETEDSUBOPERATIONS 0x0004#define O_GET_NUMBEROFFAILEDSUBOPERATIONS 0x0008#define O_GET_NUMBEROFWARNINGSUBOPERATIONS 0x0010} ;/* C-MOVE */struct T_DIMSE_C_MoveRQ {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -