00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086 #ifndef DIMSE_H
00087 #define DIMSE_H
00088
00089
00090
00091
00092
00093 #include "dcmtk/config/osconfig.h"
00094
00095 #include "dcmtk/dcmnet/dicom.h"
00096 #include "dcmtk/dcmnet/lst.h"
00097 #include "dcmtk/dcmnet/cond.h"
00098 #include "dcmtk/dcmnet/dul.h"
00099 #include "dcmtk/dcmnet/assoc.h"
00100 #include "dcmtk/dcmdata/dcdatset.h"
00101 #include "dcmtk/ofstd/ofglobal.h"
00102
00103 class DcmOutputFileStream;
00104
00113 extern OFGlobal<OFBool> dcmPeerRequiresExactUIDCopy;
00114
00121 extern OFGlobal<Uint32> dcmMaxOutgoingPDUSize;
00122
00123
00124
00125
00126
00127 #define STATUS_Success 0x0000
00128 #define STATUS_Pending 0xff00
00129
00130 #define DICOM_PENDING_STATUS(status) (((status)&0xff00) == 0xff00)
00131 #define DICOM_WARNING_STATUS(status) (((status)&0xf000) == 0xb000)
00132
00133
00134
00135
00136
00137
00138
00139 #define STATUS_STORE_Refused_OutOfResources 0xa700
00140 #define STATUS_STORE_Refused_SOPClassNotSupported 0xa800
00141 #define STATUS_STORE_Error_DataSetDoesNotMatchSOPClass 0xa900
00142 #define STATUS_STORE_Error_CannotUnderstand 0xc000
00143 #define STATUS_STORE_Warning_CoersionOfDataElements 0xb000
00144 #define STATUS_STORE_Warning_DataSetDoesNotMatchSOPClass 0xb007
00145 #define STATUS_STORE_Warning_ElementsDiscarded 0xb006
00146
00147
00148 #define STATUS_FIND_Refused_OutOfResources 0xa700
00149 #define STATUS_FIND_Refused_SOPClassNotSupported 0xa800
00150 #define STATUS_FIND_Failed_IdentifierDoesNotMatchSOPClass 0xa900
00151 #define STATUS_FIND_Failed_UnableToProcess 0xc000
00152 #define STATUS_FIND_Cancel_MatchingTerminatedDueToCancelRequest 0xfe00
00153 #define STATUS_FIND_Pending_WarningUnsupportedOptionalKeys 0xff01
00154
00155
00156 #define STATUS_MOVE_Refused_OutOfResourcesNumberOfMatches 0xa701
00157 #define STATUS_MOVE_Refused_OutOfResourcesSubOperations 0xa702
00158 #define STATUS_MOVE_Failed_SOPClassNotSupported 0xa800
00159 #define STATUS_MOVE_Failed_MoveDestinationUnknown 0xa801
00160 #define STATUS_MOVE_Failed_IdentifierDoesNotMatchSOPClass 0xa900
00161 #define STATUS_MOVE_Failed_UnableToProcess 0xc000
00162 #define STATUS_MOVE_Cancel_SubOperationsTerminatedDueToCancelIndication 0xfe00
00163 #define STATUS_MOVE_Warning_SubOperationsCompleteOneOrMoreFailures 0xb000
00164
00165
00166 #define STATUS_GET_Refused_OutOfResourcesNumberOfMatches 0xa701
00167 #define STATUS_GET_Refused_OutOfResourcesSubOperations 0xa702
00168 #define STATUS_GET_Failed_SOPClassNotSupported 0xa800
00169 #define STATUS_GET_Failed_IdentifierDoesNotMatchSOPClass 0xa900
00170 #define STATUS_GET_Failed_UnableToProcess 0xc000
00171 #define STATUS_GET_Cancel_SubOperationsTerminatedDueToCancelIndication 0xfe00
00172 #define STATUS_GET_Warning_SubOperationsCompleteOneOrMoreFailures 0xb000
00173
00174
00175 #define STATUS_N_Cancel 0xFE00
00176 #define STATUS_N_AttributeListError 0x0107
00177 #define STATUS_N_SOPClassNotSupported 0x0122
00178 #define STATUS_N_ClassInstanceConflict 0x0119
00179 #define STATUS_N_DuplicateSOPInstance 0x0111
00180 #define STATUS_N_DuplicateInvocation 0x0210
00181 #define STATUS_N_InvalidArgumentValue 0x0115
00182 #define STATUS_N_InvalidAttributeValue 0x0106
00183 #define STATUS_N_InvalidObjectInstance 0x0117
00184 #define STATUS_N_MissingAttribute 0x0120
00185 #define STATUS_N_MissingAttributeValue 0x0121
00186 #define STATUS_N_MistypedArgument 0x0212
00187 #define STATUS_N_NoSuchArgument 0x0114
00188 #define STATUS_N_NoSuchAttribute 0x0105
00189 #define STATUS_N_NoSuchEventType 0x0113
00190 #define STATUS_N_NoSuchObjectInstance 0x0112
00191 #define STATUS_N_NoSuchSOPClass 0x0118
00192 #define STATUS_N_ProcessingFailure 0x0110
00193 #define STATUS_N_ResourceLimitation 0x0213
00194 #define STATUS_N_UnrecognizedOperation 0x0211
00195 #define STATUS_N_NoSuchAction 0x0123
00196
00197
00198 #define STATUS_N_PRINT_BFS_Warn_MemoryAllocation 0xB600
00199 #define STATUS_N_PRINT_BFS_Warn_NoSessionPrinting 0xB601
00200 #define STATUS_N_PRINT_BFS_Warn_EmptyPage 0xB602
00201 #define STATUS_N_PRINT_BFB_Warn_EmptyPage 0xB603
00202 #define STATUS_N_PRINT_BFS_Fail_NoFilmBox 0xC600
00203 #define STATUS_N_PRINT_BFS_Fail_PrintQueueFull 0xC601
00204 #define STATUS_N_PRINT_BSB_Fail_PrintQueueFull 0xC602
00205 #define STATUS_N_PRINT_BFS_BFB_Fail_ImageSize 0xC603
00206 #define STATUS_N_PRINT_BFS_BFB_Fail_PositionCollision 0xC604
00207 #define STATUS_N_PRINT_IB_Fail_InsufficientMemory 0xC605
00208 #define STATUS_N_PRINT_IB_Fail_MoreThanOneVOILUT 0xC606
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219 typedef enum {
00220 DIMSE_NOTHING = 0x0000,
00221 DIMSE_C_STORE_RQ = 0x0001,
00222 DIMSE_C_STORE_RSP = 0x8001,
00223 DIMSE_C_GET_RQ = 0x0010,
00224 DIMSE_C_GET_RSP = 0x8010,
00225 DIMSE_C_FIND_RQ = 0x0020,
00226 DIMSE_C_FIND_RSP = 0x8020,
00227 DIMSE_C_MOVE_RQ = 0x0021,
00228 DIMSE_C_MOVE_RSP = 0x8021,
00229 DIMSE_C_ECHO_RQ = 0x0030,
00230 DIMSE_C_ECHO_RSP = 0x8030,
00231 DIMSE_C_CANCEL_RQ = 0x0fff,
00232
00233
00234 DIMSE_N_EVENT_REPORT_RQ = 0x0100,
00235 DIMSE_N_EVENT_REPORT_RSP = 0x8100,
00236 DIMSE_N_GET_RQ = 0x0110,
00237 DIMSE_N_GET_RSP = 0x8110,
00238 DIMSE_N_SET_RQ = 0x0120,
00239 DIMSE_N_SET_RSP = 0x8120,
00240 DIMSE_N_ACTION_RQ = 0x0130,
00241 DIMSE_N_ACTION_RSP = 0x8130,
00242 DIMSE_N_CREATE_RQ = 0x0140,
00243 DIMSE_N_CREATE_RSP = 0x8140,
00244 DIMSE_N_DELETE_RQ = 0x0150,
00245 DIMSE_N_DELETE_RSP = 0x8150
00246 } T_DIMSE_Command;
00247
00248
00249
00250
00251
00252 typedef enum {
00253 DIMSE_DATASET_PRESENT = 0x0001,
00254 DIMSE_DATASET_NULL = 0x0101
00255 } T_DIMSE_DataSetType;
00256
00257
00258
00259
00260
00261 typedef enum {
00262 DIMSE_PRIORITY_LOW = 0x0002,
00263 DIMSE_PRIORITY_MEDIUM = 0x0000,
00264 DIMSE_PRIORITY_HIGH = 0x0001
00265 } T_DIMSE_Priority;
00266
00267
00268
00269
00270
00271 typedef enum {
00272 DIMSE_BLOCKING,
00273 DIMSE_NONBLOCKING
00274 } T_DIMSE_BlockingMode;
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284 struct T_DIMSE_C_StoreRQ {
00285 DIC_US MessageID;
00286 DIC_UI AffectedSOPClassUID;
00287 T_DIMSE_Priority Priority;
00288 T_DIMSE_DataSetType DataSetType;
00289 DIC_UI AffectedSOPInstanceUID;
00290 DIC_AE MoveOriginatorApplicationEntityTitle;
00291 DIC_US MoveOriginatorID;
00292
00293 unsigned int opts;
00294 #define O_STORE_MOVEORIGINATORAETITLE 0x0001
00295 #define O_STORE_MOVEORIGINATORID 0x0002
00296
00297
00298
00299
00300
00301 #define O_STORE_RQ_BLANK_PADDING 0x0008
00302 };
00303
00304 struct T_DIMSE_C_StoreRSP {
00305 DIC_US MessageIDBeingRespondedTo;
00306 DIC_UI AffectedSOPClassUID;
00307 T_DIMSE_DataSetType DataSetType;
00308 DIC_US DimseStatus;
00309 DIC_UI AffectedSOPInstanceUID;
00310 unsigned int opts;
00311 #define O_STORE_AFFECTEDSOPCLASSUID 0x0001
00312 #define O_STORE_AFFECTEDSOPINSTANCEUID 0x0002
00313
00314
00315
00316
00317 #define O_STORE_PEER_REQUIRES_EXACT_UID_COPY 0x0004
00318
00319 #define O_STORE_RSP_BLANK_PADDING 0x0008
00320 } ;
00321
00322
00323
00324 struct T_DIMSE_C_EchoRQ {
00325 DIC_US MessageID;
00326 DIC_UI AffectedSOPClassUID;
00327 T_DIMSE_DataSetType DataSetType;
00328 } ;
00329
00330 struct T_DIMSE_C_EchoRSP {
00331 DIC_US MessageIDBeingRespondedTo;
00332 DIC_UI AffectedSOPClassUID;
00333 T_DIMSE_DataSetType DataSetType;
00334 DIC_US DimseStatus;
00335 unsigned int opts;
00336 #define O_ECHO_AFFECTEDSOPCLASSUID 0x0001
00337 } ;
00338
00339
00340
00341 struct T_DIMSE_C_FindRQ {
00342 DIC_US MessageID;
00343 DIC_UI AffectedSOPClassUID;
00344 T_DIMSE_Priority Priority;
00345 T_DIMSE_DataSetType DataSetType;
00346
00347 } ;
00348
00349 struct T_DIMSE_C_FindRSP {
00350 DIC_US MessageIDBeingRespondedTo;
00351 DIC_UI AffectedSOPClassUID;
00352 T_DIMSE_DataSetType DataSetType;
00353 DIC_US DimseStatus;
00354
00355 unsigned int opts;
00356 #define O_FIND_AFFECTEDSOPCLASSUID 0x0001
00357 } ;
00358
00359
00360
00361 struct T_DIMSE_C_GetRQ {
00362 DIC_US MessageID;
00363 DIC_UI AffectedSOPClassUID;
00364 T_DIMSE_Priority Priority;
00365 T_DIMSE_DataSetType DataSetType;
00366
00367 } ;
00368
00369 struct T_DIMSE_C_GetRSP {
00370 DIC_US MessageIDBeingRespondedTo;
00371 DIC_UI AffectedSOPClassUID;
00372 T_DIMSE_DataSetType DataSetType;
00373 DIC_US DimseStatus;
00374 DIC_US NumberOfRemainingSubOperations;
00375 DIC_US NumberOfCompletedSubOperations;
00376 DIC_US NumberOfFailedSubOperations;
00377 DIC_US NumberOfWarningSubOperations;
00378 unsigned int opts;
00379 #define O_GET_AFFECTEDSOPCLASSUID 0x0001
00380 #define O_GET_NUMBEROFREMAININGSUBOPERATIONS 0x0002
00381 #define O_GET_NUMBEROFCOMPLETEDSUBOPERATIONS 0x0004
00382 #define O_GET_NUMBEROFFAILEDSUBOPERATIONS 0x0008
00383 #define O_GET_NUMBEROFWARNINGSUBOPERATIONS 0x0010
00384 } ;
00385
00386
00387
00388 struct T_DIMSE_C_MoveRQ {
00389 DIC_US MessageID;
00390 DIC_UI AffectedSOPClassUID;
00391 T_DIMSE_Priority Priority;
00392 T_DIMSE_DataSetType DataSetType;
00393 DIC_AE MoveDestination;
00394
00395 } ;
00396
00397 struct T_DIMSE_C_MoveRSP {
00398 DIC_US MessageIDBeingRespondedTo;
00399 DIC_UI AffectedSOPClassUID;
00400 T_DIMSE_DataSetType DataSetType;
00401 DIC_US DimseStatus;
00402 DIC_US NumberOfRemainingSubOperations;
00403 DIC_US NumberOfCompletedSubOperations;
00404 DIC_US NumberOfFailedSubOperations;
00405 DIC_US NumberOfWarningSubOperations;
00406 unsigned int opts;
00407 #define O_MOVE_AFFECTEDSOPCLASSUID 0x0001
00408 #define O_MOVE_NUMBEROFREMAININGSUBOPERATIONS 0x0002
00409 #define O_MOVE_NUMBEROFCOMPLETEDSUBOPERATIONS 0x0004
00410 #define O_MOVE_NUMBEROFFAILEDSUBOPERATIONS 0x0008
00411 #define O_MOVE_NUMBEROFWARNINGSUBOPERATIONS 0x0010
00412 } ;
00413
00414
00415
00416
00417 struct T_DIMSE_C_CancelRQ {
00418 DIC_US MessageIDBeingRespondedTo;
00419 T_DIMSE_DataSetType DataSetType;
00420 } ;
00421
00422
00423
00424
00425 struct T_DIMSE_N_EventReportRQ {
00426 DIC_US MessageID;
00427 DIC_UI AffectedSOPClassUID;
00428 DIC_UI AffectedSOPInstanceUID;
00429 T_DIMSE_DataSetType DataSetType;
00430 DIC_US EventTypeID;
00431
00432 } ;
00433
00434 struct T_DIMSE_N_EventReportRSP {
00435 DIC_US MessageIDBeingRespondedTo;
00436 DIC_UI AffectedSOPClassUID;
00437 DIC_US DimseStatus;
00438 DIC_UI AffectedSOPInstanceUID;
00439 T_DIMSE_DataSetType DataSetType;
00440 DIC_US EventTypeID;
00441
00442 unsigned int opts;
00443 #define O_NEVENTREPORT_AFFECTEDSOPCLASSUID 0x0001
00444 #define O_NEVENTREPORT_AFFECTEDSOPINSTANCEUID 0x0002
00445 #define O_NEVENTREPORT_EVENTTYPEID 0x0004
00446 } ;
00447
00448
00449
00450 struct T_DIMSE_N_GetRQ {
00451 DIC_US MessageID;
00452 DIC_UI RequestedSOPClassUID;
00453 DIC_UI RequestedSOPInstanceUID;
00454 T_DIMSE_DataSetType DataSetType;
00455
00456
00457
00458
00459
00460
00461 int ListCount;
00462 DIC_US *AttributeIdentifierList;
00463 } ;
00464
00465 struct T_DIMSE_N_GetRSP {
00466 DIC_US MessageIDBeingRespondedTo;
00467 DIC_UI AffectedSOPClassUID;
00468 DIC_US DimseStatus;
00469 DIC_UI AffectedSOPInstanceUID;
00470 T_DIMSE_DataSetType DataSetType;
00471
00472 unsigned int opts;
00473 #define O_NGET_AFFECTEDSOPCLASSUID 0x0001
00474 #define O_NGET_AFFECTEDSOPINSTANCEUID 0x0002
00475 } ;
00476
00477
00478
00479 struct T_DIMSE_N_SetRQ {
00480 DIC_US MessageID;
00481 DIC_UI RequestedSOPClassUID;
00482 DIC_UI RequestedSOPInstanceUID;
00483 T_DIMSE_DataSetType DataSetType;
00484
00485 } ;
00486
00487 struct T_DIMSE_N_SetRSP {
00488 DIC_US MessageIDBeingRespondedTo;
00489 DIC_UI AffectedSOPClassUID;
00490 DIC_US DimseStatus;
00491 DIC_UI AffectedSOPInstanceUID;
00492 T_DIMSE_DataSetType DataSetType;
00493
00494 unsigned int opts;
00495 #define O_NSET_AFFECTEDSOPCLASSUID 0x0001
00496 #define O_NSET_AFFECTEDSOPINSTANCEUID 0x0002
00497 } ;
00498
00499
00500
00501 struct T_DIMSE_N_ActionRQ {
00502 DIC_US MessageID;
00503 DIC_UI RequestedSOPClassUID;
00504 DIC_UI RequestedSOPInstanceUID;
00505 DIC_US ActionTypeID;
00506 T_DIMSE_DataSetType DataSetType;
00507
00508 } ;
00509
00510 struct T_DIMSE_N_ActionRSP {
00511 DIC_US MessageIDBeingRespondedTo;
00512 DIC_UI AffectedSOPClassUID;
00513 DIC_US DimseStatus;
00514 DIC_UI AffectedSOPInstanceUID;
00515 DIC_US ActionTypeID;
00516 T_DIMSE_DataSetType DataSetType;
00517
00518 unsigned int opts;
00519 #define O_NACTION_AFFECTEDSOPCLASSUID 0x0001
00520 #define O_NACTION_AFFECTEDSOPINSTANCEUID 0x0002
00521 #define O_NACTION_ACTIONTYPEID 0x0004
00522 } ;
00523
00524
00525
00526 struct T_DIMSE_N_CreateRQ {
00527 DIC_US MessageID;
00528 DIC_UI AffectedSOPClassUID;
00529 DIC_UI AffectedSOPInstanceUID;
00530 T_DIMSE_DataSetType DataSetType;
00531
00532 unsigned int opts;
00533 #define O_NCREATE_AFFECTEDSOPINSTANCEUID 0x0002
00534 } ;
00535
00536 struct T_DIMSE_N_CreateRSP {
00537 DIC_US MessageIDBeingRespondedTo;
00538 DIC_UI AffectedSOPClassUID;
00539 DIC_US DimseStatus;
00540 DIC_UI AffectedSOPInstanceUID;
00541 T_DIMSE_DataSetType DataSetType;
00542
00543 unsigned int opts;
00544 #define O_NCREATE_AFFECTEDSOPCLASSUID 0x0001
00545 #define O_NCREATE_AFFECTEDSOPINSTANCEUID 0x0002
00546 } ;
00547
00548
00549
00550 struct T_DIMSE_N_DeleteRQ {
00551 DIC_US MessageID;
00552 DIC_UI RequestedSOPClassUID;
00553 DIC_UI RequestedSOPInstanceUID;
00554 T_DIMSE_DataSetType DataSetType;
00555 } ;
00556
00557 struct T_DIMSE_N_DeleteRSP {
00558 DIC_US MessageIDBeingRespondedTo;
00559 DIC_UI AffectedSOPClassUID;
00560 DIC_US DimseStatus;
00561 DIC_UI AffectedSOPInstanceUID;
00562 T_DIMSE_DataSetType DataSetType;
00563 unsigned int opts;
00564 #define O_NDELETE_AFFECTEDSOPCLASSUID 0x0001
00565 #define O_NDELETE_AFFECTEDSOPINSTANCEUID 0x0002
00566 } ;
00567
00568
00569
00570
00571
00572
00573
00574 struct T_DIMSE_Message {
00575 T_DIMSE_Command CommandField;
00576
00577 union {
00578
00579 T_DIMSE_C_StoreRQ CStoreRQ;
00580 T_DIMSE_C_EchoRQ CEchoRQ;
00581 T_DIMSE_C_FindRQ CFindRQ;
00582 T_DIMSE_C_GetRQ CGetRQ;
00583 T_DIMSE_C_MoveRQ CMoveRQ;
00584 T_DIMSE_C_CancelRQ CCancelRQ;
00585 T_DIMSE_N_EventReportRQ NEventReportRQ;
00586 T_DIMSE_N_GetRQ NGetRQ;
00587 T_DIMSE_N_SetRQ NSetRQ;
00588 T_DIMSE_N_ActionRQ NActionRQ;
00589 T_DIMSE_N_CreateRQ NCreateRQ;
00590 T_DIMSE_N_DeleteRQ NDeleteRQ;
00591
00592
00593 T_DIMSE_C_StoreRSP CStoreRSP;
00594 T_DIMSE_C_EchoRSP CEchoRSP;
00595 T_DIMSE_C_FindRSP CFindRSP;
00596 T_DIMSE_C_GetRSP CGetRSP;
00597 T_DIMSE_C_MoveRSP CMoveRSP;
00598 T_DIMSE_N_EventReportRSP NEventReportRSP;
00599 T_DIMSE_N_GetRSP NGetRSP;
00600 T_DIMSE_N_SetRSP NSetRSP;
00601 T_DIMSE_N_ActionRSP NActionRSP;
00602 T_DIMSE_N_CreateRSP NCreateRSP;
00603 T_DIMSE_N_DeleteRSP NDeleteRSP;
00604 } msg;
00605
00606 };
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618 extern E_GrpLenEncoding g_dimse_send_groupLength_encoding;
00619 extern E_EncodingType g_dimse_send_sequenceType_encoding;
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632 extern OFBool g_dimse_save_dimse_data;
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665 OFCondition
00666 DIMSE_echoUser(
00667
00668 T_ASC_Association *assoc, DIC_US msgId,
00669
00670 T_DIMSE_BlockingMode blockMode, int timeout,
00671
00672 DIC_US *status, DcmDataset **statusDetail);
00673
00674 OFCondition
00675 DIMSE_sendEchoResponse(T_ASC_Association * assoc,
00676 T_ASC_PresentationContextID presID,
00677 T_DIMSE_C_EchoRQ *request, DIC_US status, DcmDataset *statusDetail);
00678
00679
00680
00681
00682
00683
00684 typedef enum {
00685 DIMSE_StoreBegin,
00686 DIMSE_StoreProgressing,
00687 DIMSE_StoreEnd
00688 } T_DIMSE_StoreProgressState;
00689
00690 struct T_DIMSE_StoreProgress {
00691 T_DIMSE_StoreProgressState state;
00692 long callbackCount;
00693 long progressBytes;
00694 long totalBytes;
00695 } ;
00696
00697
00698 typedef void (*DIMSE_StoreUserCallback)(
00699 void *callbackData,
00700 T_DIMSE_StoreProgress *progress,
00701 T_DIMSE_C_StoreRQ *request
00702 );
00703
00704 struct T_DIMSE_DetectedCancelParameters {
00705 OFBool cancelEncountered;
00706 T_ASC_PresentationContextID presId;
00707 T_DIMSE_C_CancelRQ req;
00708 } ;
00709
00710 OFCondition
00711 DIMSE_storeUser(
00712
00713 T_ASC_Association *assoc, T_ASC_PresentationContextID presId,
00714 T_DIMSE_C_StoreRQ *request,
00715 const char *imageFileName, DcmDataset *imageDataSet,
00716 DIMSE_StoreUserCallback callback, void *callbackData,
00717
00718 T_DIMSE_BlockingMode blockMode, int timeout,
00719
00720 T_DIMSE_C_StoreRSP *response,
00721 DcmDataset **statusDetail,
00722 T_DIMSE_DetectedCancelParameters *checkForCancelParams = NULL,
00723
00724 long imageFileTotalBytes=0);
00725
00726 typedef void (*DIMSE_StoreProviderCallback)(
00727
00728 void *callbackData,
00729 T_DIMSE_StoreProgress *progress,
00730 T_DIMSE_C_StoreRQ *request,
00731 char *imageFileName, DcmDataset **imageDataSet,
00732
00733 T_DIMSE_C_StoreRSP *response,
00734
00735 DcmDataset **statusDetail);
00736
00737 OFCondition
00738 DIMSE_storeProvider(
00739 T_ASC_Association *assoc,
00740 T_ASC_PresentationContextID presIdCmd,
00741 T_DIMSE_C_StoreRQ *request,
00742 const char* imageFileName, int writeMetaheader,
00743 DcmDataset **imageDataSet,
00744 DIMSE_StoreProviderCallback callback, void *callbackData,
00745
00746 T_DIMSE_BlockingMode blockMode, int timeout);
00747
00748 OFCondition
00749 DIMSE_sendStoreResponse(T_ASC_Association * assoc,
00750 T_ASC_PresentationContextID presID,
00751 T_DIMSE_C_StoreRQ *request,
00752 T_DIMSE_C_StoreRSP *response,
00753 DcmDataset *statusDetail);
00754
00755
00756
00757
00758
00759
00760 typedef void (*DIMSE_FindUserCallback)(
00761
00762 void *callbackData,
00763 T_DIMSE_C_FindRQ *request,
00764 int responseCount,
00765 T_DIMSE_C_FindRSP *response,
00766 DcmDataset *responseIdentifiers
00767 );
00768
00769 OFCondition
00770 DIMSE_findUser(
00771
00772 T_ASC_Association *assoc,
00773 T_ASC_PresentationContextID presID,
00774 T_DIMSE_C_FindRQ *request, DcmDataset *requestIdentifiers,
00775 DIMSE_FindUserCallback callback, void *callbackData,
00776
00777 T_DIMSE_BlockingMode blockMode, int timeout,
00778
00779 T_DIMSE_C_FindRSP *response, DcmDataset **statusDetail);
00780
00781 typedef void (*DIMSE_FindProviderCallback)(
00782
00783 void *callbackData,
00784 OFBool cancelled, T_DIMSE_C_FindRQ *request,
00785 DcmDataset *requestIdentifiers, int responseCount,
00786
00787 T_DIMSE_C_FindRSP *response,
00788 DcmDataset **responseIdentifiers,
00789 DcmDataset **statusDetail);
00790
00791 OFCondition
00792 DIMSE_findProvider(
00793
00794 T_ASC_Association *assoc,
00795 T_ASC_PresentationContextID presIdCmd,
00796 T_DIMSE_C_FindRQ *request,
00797 DIMSE_FindProviderCallback callback, void *callbackData,
00798
00799 T_DIMSE_BlockingMode blockMode, int timeout);
00800
00801 OFCondition
00802 DIMSE_sendFindResponse(T_ASC_Association * assoc,
00803 T_ASC_PresentationContextID presID,
00804 T_DIMSE_C_FindRQ *request,
00805 T_DIMSE_C_FindRSP *response, DcmDataset *responseIdentifiers,
00806 DcmDataset *statusDetail);
00807
00808
00809
00810
00811
00812 typedef void (*DIMSE_MoveUserCallback)(
00813
00814 void *callbackData,
00815 T_DIMSE_C_MoveRQ *request,
00816 int responseCount, T_DIMSE_C_MoveRSP *response);
00817
00818 typedef void (*DIMSE_SubOpProviderCallback)(void *subOpCallbackData,
00819 T_ASC_Network *net, T_ASC_Association **subOpAssoc);
00820
00821 OFCondition
00822 DIMSE_moveUser(
00823
00824 T_ASC_Association *assoc,
00825 T_ASC_PresentationContextID presID,
00826 T_DIMSE_C_MoveRQ *request,
00827 DcmDataset *requestIdentifiers,
00828 DIMSE_MoveUserCallback callback, void *callbackData,
00829
00830 T_DIMSE_BlockingMode blockMode, int timeout,
00831
00832 T_ASC_Network *net,
00833 DIMSE_SubOpProviderCallback subOpCallback, void *subOpCallbackData,
00834
00835 T_DIMSE_C_MoveRSP *response, DcmDataset **statusDetail,
00836 DcmDataset **responseIdentifers,
00837 OFBool ignorePendingDatasets = OFFalse);
00838
00839 typedef void (*DIMSE_MoveProviderCallback)(
00840
00841 void *callbackData,
00842 OFBool cancelled, T_DIMSE_C_MoveRQ *request,
00843 DcmDataset *requestIdentifiers, int responseCount,
00844
00845 T_DIMSE_C_MoveRSP *response, DcmDataset **statusDetail,
00846 DcmDataset **responseIdentifiers);
00847
00848 OFCondition
00849 DIMSE_moveProvider(
00850
00851 T_ASC_Association *assoc,
00852 T_ASC_PresentationContextID presIdCmd,
00853 T_DIMSE_C_MoveRQ *request,
00854 DIMSE_MoveProviderCallback callback, void *callbackData,
00855
00856 T_DIMSE_BlockingMode blockMode, int timeout);
00857
00858 OFCondition
00859 DIMSE_sendMoveResponse(T_ASC_Association * assoc,
00860 T_ASC_PresentationContextID presID, T_DIMSE_C_MoveRQ *request,
00861 T_DIMSE_C_MoveRSP *response, DcmDataset *rspIds,
00862 DcmDataset *statusDetail);
00863
00864
00865
00866
00867
00868 typedef void (*DIMSE_GetUserCallback)(
00869
00870 void *callbackData,
00871 T_DIMSE_C_GetRQ *request,
00872 int responseCount, T_DIMSE_C_GetRSP *response);
00873
00874 typedef void (*DIMSE_SubOpProviderCallback)(void *subOpCallbackData,
00875 T_ASC_Network *net, T_ASC_Association **subOpAssoc);
00876
00877 OFCondition
00878 DIMSE_getUser(
00879
00880 T_ASC_Association *assoc,
00881 T_ASC_PresentationContextID presID,
00882 T_DIMSE_C_GetRQ *request,
00883 DcmDataset *requestIdentifiers,
00884 DIMSE_GetUserCallback callback, void *callbackData,
00885
00886 T_DIMSE_BlockingMode blockMode, int timeout,
00887
00888 T_ASC_Network *net,
00889 DIMSE_SubOpProviderCallback subOpCallback, void *subOpCallbackData,
00890
00891 T_DIMSE_C_GetRSP *response, DcmDataset **statusDetail,
00892 DcmDataset **responseIdentifers);
00893
00894 typedef void (*DIMSE_GetProviderCallback)(
00895
00896 void *callbackData,
00897 OFBool cancelled, T_DIMSE_C_GetRQ *request,
00898 DcmDataset *requestIdentifiers, int responseCount,
00899
00900 T_DIMSE_C_GetRSP *response, DcmDataset **statusDetail,
00901 DcmDataset **responseIdentifiers);
00902
00903 OFCondition
00904 DIMSE_getProvider(
00905
00906 T_ASC_Association *assoc,
00907 T_ASC_PresentationContextID presIdCmd,
00908 T_DIMSE_C_GetRQ *request,
00909 DIMSE_GetProviderCallback callback, void *callbackData,
00910
00911 T_DIMSE_BlockingMode blockMode, int timeout);
00912
00913 OFCondition
00914 DIMSE_sendGetResponse(T_ASC_Association * assoc,
00915 T_ASC_PresentationContextID presID, T_DIMSE_C_GetRQ *request,
00916 T_DIMSE_C_GetRSP *response, DcmDataset *rspIds,
00917 DcmDataset *statusDetail);
00918
00919
00920
00921
00922
00923 OFCondition
00924 DIMSE_sendCancelRequest(T_ASC_Association * assoc,
00925 T_ASC_PresentationContextID presId, DIC_US msgId);
00926
00927 OFCondition
00928 DIMSE_checkForCancelRQ(T_ASC_Association * assoc,
00929 T_ASC_PresentationContextID presId, DIC_US msgId);
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943
00944
00945 typedef void (*DIMSE_ProgressCallback)(void *callbackContext,
00946 unsigned long byteCount);
00947
00948
00949 OFCondition
00950 DIMSE_sendMessageUsingFileData(T_ASC_Association *association,
00951 T_ASC_PresentationContextID presID,
00952 T_DIMSE_Message *msg, DcmDataset *statusDetail,
00953 const char* dataFileName,
00954 DIMSE_ProgressCallback callback,
00955 void *callbackContext,
00956 DcmDataset **commandSet=NULL);
00957
00958 OFCondition
00959 DIMSE_sendMessageUsingMemoryData(T_ASC_Association *association,
00960 T_ASC_PresentationContextID presID,
00961 T_DIMSE_Message *msg, DcmDataset *statusDetail,
00962 DcmDataset *dataObject,
00963 DIMSE_ProgressCallback callback,
00964 void *callbackContext,
00965 DcmDataset **commandSet=NULL);
00966
00967 OFCondition
00968 DIMSE_receiveCommand(T_ASC_Association *association,
00969 T_DIMSE_BlockingMode blocking,
00970 int timeout,
00971 T_ASC_PresentationContextID *presID,
00972 T_DIMSE_Message *msg,
00973 DcmDataset **statusDetail,
00974 DcmDataset **commandSet=NULL);
00975
00976 OFCondition
00977 DIMSE_receiveDataSetInMemory(T_ASC_Association *association,
00978 T_DIMSE_BlockingMode blocking,
00979 int timeout,
00980 T_ASC_PresentationContextID *presID,
00981 DcmDataset **dataObject,
00982 DIMSE_ProgressCallback callback,
00983 void *callbackContext);
00984
00985 OFCondition
00986 DIMSE_createFilestream(
00987
00988 const char *filename,
00989 const T_DIMSE_C_StoreRQ *request,
00990 const T_ASC_Association *assoc,
00991 T_ASC_PresentationContextID presIdCmd,
00992 int writeMetaheader,
00993
00994 DcmOutputFileStream **filestream);
00995
00996 OFCondition
00997 DIMSE_receiveDataSetInFile(T_ASC_Association *assoc,
00998 T_DIMSE_BlockingMode blocking, int timeout,
00999 T_ASC_PresentationContextID *presID,
01000 DcmOutputStream *filestream,
01001 DIMSE_ProgressCallback callback, void *callbackData);
01002
01003 OFCondition
01004 DIMSE_ignoreDataSet( T_ASC_Association * assoc,
01005 T_DIMSE_BlockingMode blocking,
01006 int timeout,
01007 DIC_UL * bytesRead,
01008 DIC_UL * pdvCount);
01009
01010
01011
01012
01013
01014 OFString DIMSE_warn_str(T_ASC_Association *assoc);
01015
01016 enum DIMSE_direction {
01017 DIMSE_INCOMING,
01018 DIMSE_OUTGOING
01019 };
01020
01021
01022 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_Message &msg,
01023 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01024 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_C_EchoRQ &msg,
01025 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01026 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_C_EchoRSP &msg,
01027 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01028 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_C_GetRQ &msg,
01029 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01030 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_C_GetRSP &msg,
01031 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01032 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_C_MoveRQ &msg,
01033 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01034 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_C_MoveRSP &msg,
01035 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01036 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_C_FindRQ &msg,
01037 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01038 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_C_FindRSP &msg,
01039 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01040 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_C_StoreRQ &msg,
01041 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01042 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_C_StoreRSP &msg,
01043 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01044 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_C_CancelRQ &msg,
01045 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01046 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_N_EventReportRQ &msg,
01047 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01048 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_N_EventReportRSP &msg,
01049 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01050 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_N_GetRQ &msg,
01051 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01052 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_N_GetRSP &msg,
01053 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01054 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_N_SetRQ &msg,
01055 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01056 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_N_SetRSP &msg,
01057 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01058 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_N_ActionRQ &msg,
01059 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01060 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_N_ActionRSP &msg,
01061 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01062 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_N_CreateRQ &msg,
01063 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01064 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_N_CreateRSP &msg,
01065 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01066 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_N_DeleteRQ &msg,
01067 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01068 OFString& DIMSE_dumpMessage(OFString &str, T_DIMSE_N_DeleteRSP &msg,
01069 enum DIMSE_direction dir, DcmItem *dataset = NULL, T_ASC_PresentationContextID presID = 0);
01070
01071
01072
01073 #define DIMSE_COMPAT_WRAP(func, type) \
01074 static inline void func (FILE * f, type * msg) \
01075 { \
01076 OFString str; \
01077 DIMSE_dumpMessage(str, *msg, DIMSE_INCOMING); \
01078 fprintf(f, "%s\n", str.c_str()); \
01079 }
01080 #define DIMSE_COMPAT_WRAP_R(func, type) \
01081 DIMSE_COMPAT_WRAP(func ## RQ, type ## RQ) \
01082 DIMSE_COMPAT_WRAP(func ## RSP, type ## RSP)
01083
01084 static inline void DIMSE_printMessage(STD_NAMESPACE ostream& ostream, T_DIMSE_Message &msg, DcmItem *dataset = NULL)
01085 {
01086 OFString str;
01087 ostream << DIMSE_dumpMessage(str, msg, DIMSE_INCOMING, dataset) << OFendl;
01088 }
01089
01090 DIMSE_COMPAT_WRAP(DIMSE_printCommand, T_DIMSE_Message)
01091 DIMSE_COMPAT_WRAP_R(DIMSE_printCEcho, T_DIMSE_C_Echo)
01092 DIMSE_COMPAT_WRAP_R(DIMSE_printCStore, T_DIMSE_C_Store)
01093 DIMSE_COMPAT_WRAP_R(DIMSE_printCGet, T_DIMSE_C_Get)
01094 DIMSE_COMPAT_WRAP_R(DIMSE_printCMove, T_DIMSE_C_Move)
01095 DIMSE_COMPAT_WRAP_R(DIMSE_printCFind, T_DIMSE_C_Find)
01096 DIMSE_COMPAT_WRAP(DIMSE_printCCancelRQ, T_DIMSE_C_EchoRQ)
01097 DIMSE_COMPAT_WRAP_R(DIMSE_printNEventReport, T_DIMSE_N_EventReport)
01098 DIMSE_COMPAT_WRAP_R(DIMSE_printNGet, T_DIMSE_N_Get)
01099 DIMSE_COMPAT_WRAP_R(DIMSE_printNSet, T_DIMSE_N_Set)
01100 DIMSE_COMPAT_WRAP_R(DIMSE_printNAction, T_DIMSE_N_Action)
01101 DIMSE_COMPAT_WRAP_R(DIMSE_printNCreate, T_DIMSE_N_Create)
01102 DIMSE_COMPAT_WRAP_R(DIMSE_printNDelete, T_DIMSE_N_Delete)
01103
01104 #undef DIMSE_COMPAT_WRAP
01105 #undef DIMSE_COMPAT_WRAP_R
01106
01107 #endif
01108
01109
01110
01111
01112
01113
01114
01115
01116
01117
01118
01119
01120
01121
01122
01123
01124
01125
01126
01127
01128
01129
01130
01131
01132
01133
01134
01135
01136
01137
01138
01139
01140
01141
01142
01143
01144
01145
01146
01147
01148
01149
01150
01151
01152
01153
01154
01155
01156
01157
01158
01159
01160
01161
01162
01163
01164
01165
01166
01167
01168
01169
01170
01171
01172
01173
01174
01175
01176
01177
01178
01179
01180
01181
01182
01183
01184
01185
01186
01187
01188
01189
01190
01191
01192
01193
01194
01195
01196
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206