OFFIS DCMTK  Version 3.6.0
scu.h
1 /*
2  *
3  * Copyright (C) 2008-2010, OFFIS e.V.
4  * All rights reserved. See COPYRIGHT file for details.
5  *
6  * This software and supporting documentation were developed by
7  *
8  * OFFIS e.V.
9  * R&D Division Health
10  * Escherweg 2
11  * D-26121 Oldenburg, Germany
12  *
13  *
14  * Module: dcmnet
15  *
16  * Author: Michael Onken
17  *
18  * Purpose: Base class for Service Class Users (SCUs)
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-14 13:17:22 $
22  * CVS/RCS Revision: $Revision: 1.13 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 #ifndef SCU_H
30 #define SCU_H
31 
32 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
33 
34 #include "dcmtk/dcmdata/dctk.h" /* Covers most common dcmdata classes */
35 #include "dcmtk/dcmnet/dcompat.h"
36 #include "dcmtk/dcmnet/dimse.h" /* DIMSE network layer */
37 #include "dcmtk/dcmnet/dcasccff.h" /* For reading a association config file */
38 #include "dcmtk/dcmnet/dcasccfg.h" /* For holding association cfg file infos */
39 
40 #ifdef WITH_ZLIB
41 #include <zlib.h> /* for zlibVersion() */
42 #endif
43 
44 
47 enum DcmCloseAssociationType
48 {
50  DCMSCU_RELEASE_ASSOCIATION,
52  DCMSCU_ABORT_ASSOCIATION,
54  DCMSCU_PEER_REQUESTED_RELEASE,
56  DCMSCU_PEER_ABORTED_ASSOCIATION
57 };
58 
59 
63 {
64 
65 public:
66 
68  FINDResponse();
69 
71  virtual ~FINDResponse();
72 
75 
76  // Mandatory response field
77  OFString m_affectedSOPClassUID;
78 
81 
83  Uint16 m_status;
84 };
85 
86 
90 {
91 
92 public:
93  FINDResponses();
94  virtual ~FINDResponses();
95  Uint32 numResults() const;
96  void add(FINDResponse *rsp);
97  OFListIterator(FINDResponse *) begin();
98  OFListIterator(FINDResponse *) end();
99 
100 private:
101  OFList<FINDResponse *> m_responses;
102 };
103 
110 class DcmSCU
111 {
112 
113 public:
114 
117  DcmSCU();
118 
121  virtual ~DcmSCU();
122 
129  OFCondition addPresentationContext(const OFString &abstractSyntax,
130  const OFList<OFString> &xferSyntaxes);
131 
135  virtual OFCondition initNetwork();
136 
143 
151  T_ASC_PresentationContextID findPresentationContextID(const OFString &abstractSyntax,
152  const OFString &transferSyntax);
153 
160  virtual OFCondition sendECHORequest(const T_ASC_PresentationContextID presID);
161 
190  virtual OFCondition sendSTORERequest(const T_ASC_PresentationContextID presID,
191  const OFString &dicomFile,
192  DcmDataset *dset,
193  DcmDataset *&rspCommandSet,
194  DcmDataset *&rspStatusDetail,
195  Uint16 &rspStatusCode);
196 
209  virtual OFCondition sendFINDRequest(T_ASC_PresentationContextID presID,
210  DcmDataset *queryKeys,
211  FINDResponses *responses);
212 
223  virtual OFCondition handleFINDResponse(Uint16 presContextID,
224  FINDResponse *response,
225  OFBool &waitForNextResponse);
226 
234  virtual OFCondition sendCANCELRequest(Uint16 presContextID);
235 
249  virtual OFCondition sendACTIONRequest(const T_ASC_PresentationContextID presID,
250  const OFString &sopInstanceUID,
251  const Uint16 actionTypeID,
252  DcmDataset *reqDataset,
253  Uint16 &rspStatusCode);
254 
265  virtual OFCondition handleEVENTREPORTRequest(DcmDataset *&reqDataset,
266  Uint16 &eventTypeID,
267  const int timeout = 0);
268 
272  virtual void closeAssociation(const DcmCloseAssociationType closeType);
273 
274  /* Set methods */
275 
279  void setMaxReceivePDULength(const unsigned long maxRecPDU);
280 
284  void setDIMSEBlockingMode(const T_DIMSE_BlockingMode blockingMode);
285 
289  void setAETitle(const OFString &myAETtitle);
290 
294  void setPeerHostName(const OFString &peerHostName);
295 
299  void setPeerAETitle(const OFString &peerAETitle);
300 
304  void setPeerPort(const Uint16 peerPort);
305 
311  void setDIMSETimeout(const Uint32 dimseTimeout);
312 
317  void setACSETimeout(const Uint32 acseTimeout);
318 
323  void setAssocConfigFileAndProfile(const OFString &filename,
324  const OFString &profile);
325 
330  void setVerbosePCMode(const OFBool mode);
331 
332  /* Get methods */
333 
337  OFBool isConnected() const;
338 
342  Uint32 getMaxReceivePDULength() const;
343 
347  T_DIMSE_BlockingMode getDIMSEBlockingMode() const;
348 
352  const OFString &getAETitle() const;
353 
357  const OFString &getPeerHostName() const;
358 
362  const OFString &getPeerAETitle() const;
363 
367  Uint16 getPeerPort() const;
368 
373  Uint32 getDIMSETimeout() const;
374 
379  Uint32 getACSETimeout() const;
380 
386  OFBool getVerbosePCMode() const;
387 
391  OFBool getTLSEnabled() const;
392 
393 protected:
394 
410  OFCondition sendDIMSEMessage(const T_ASC_PresentationContextID presID,
411  T_DIMSE_Message *msg,
412  DcmDataset *dataObject,
413  DIMSE_ProgressCallback callback,
414  void *callbackContext,
415  DcmDataset **commandSet = NULL);
416 
427  OFString &sopClassUID,
428  OFString &sopInstanceUID,
429  E_TransferSyntax &transferSyntax);
430 
431 
437 
459  OFCondition receiveDIMSECommand(T_ASC_PresentationContextID *presID,
460  T_DIMSE_Message *msg,
461  DcmDataset **statusDetail,
462  DcmDataset **commandSet = NULL,
463  const Uint32 timeout = 0);
464 
478  OFCondition receiveDIMSEDataset(T_ASC_PresentationContextID *presID,
479  DcmDataset **dataObject,
480  DIMSE_ProgressCallback callback,
481  void *callbackContext);
482 
491  void findPresentationContext(const T_ASC_PresentationContextID presID,
492  OFString &abstractSyntax,
493  OFString &transferSyntax);
494 
505  virtual Uint16 checkEVENTREPORTRequest(T_DIMSE_N_EventReportRQ &request,
506  DcmDataset *reqDataset);
507 
508 private:
509 
513  DcmSCU(const DcmSCU &src);
514 
519  DcmSCU &operator=(const DcmSCU &src);
520 
523 
526 
529 
532 
535 
543  };
544 
547 
550 
553 
556 
558  T_DIMSE_BlockingMode m_blockMode;
559 
562 
565 
568 
570  Uint16 m_peerPort;
571 
574 
577 
580 
584  Uint16 nextMessageID();
585 
586 };
587 
588 #endif // SCU_H
589 
590 
591 /*
592 ** CVS Log
593 ** $Log: scu.h,v $
594 ** Revision 1.13 2010-10-14 13:17:22 joergr
595 ** Updated copyright header. Added reference to COPYRIGHT file.
596 **
597 ** Revision 1.12 2010-10-07 12:54:07 joergr
598 ** Fixed minor Doxygen API documentation issues (added backslash in order to
599 ** avoid that the short description ends at the first period).
600 **
601 ** Revision 1.11 2010-06-24 09:21:54 joergr
602 ** Revised comment to make clear that the parameter "presID" shall never be 0
603 ** for the sendACTIONRequest() method.
604 **
605 ** Revision 1.10 2010-06-22 15:45:27 joergr
606 ** Introduced new enumeration type to be used for closeAssociation().
607 ** Further code cleanup. Renamed some methods, variables, types and so on.
608 **
609 ** Revision 1.9 2010-06-17 17:11:27 joergr
610 ** Added preliminary support for N-EVENT-REPORT to DcmSCU. Some further code
611 ** cleanups and enhancements. Renamed some methods. Revised documentation.
612 **
613 ** Revision 1.8 2010-06-09 16:09:01 joergr
614 ** Added preliminary support for N-ACTION to DcmSCU. Some further code cleanups
615 ** and enhancements.
616 **
617 ** Revision 1.7 2010-06-08 17:54:12 onken
618 ** Added C-FIND functionality to DcmSCU. Some code cleanups. Fixed
619 ** memory leak sometimes occuring during association configuration.
620 **
621 ** Revision 1.6 2010-04-29 16:13:28 onken
622 ** Made SCU class independent from dcmtls, i.e. outsourced TLS API. Added
623 ** direct API support for sending C-STORE requests. Further API changes and
624 ** some bugs fixed.
625 **
626 ** Revision 1.5 2009-12-21 17:00:32 onken
627 ** Fixed API documentation to keep doxygen quiet.
628 **
629 ** Revision 1.4 2009-12-21 15:33:55 onken
630 ** Added documentation and refactored / enhanced some code.
631 **
632 ** Revision 1.3 2009-12-17 09:12:10 onken
633 ** Fixed other scu and scp base class compile issues.
634 **
635 ** Revision 1.2 2009-12-17 09:05:15 onken
636 ** Fixed typo resulting in build failure.
637 **
638 ** Revision 1.1 2009-12-17 09:02:44 onken
639 ** Added base classes for SCU and SCP implementations.
640 **
641 ** Revision 1.2 2009-12-02 14:26:05 uli
642 ** Stop including dcdebug.h which was removed.
643 **
644 ** Revision 1.1 2008-09-29 13:51:52 onken
645 ** Initial checkin of module dcmppscu implementing an MPPS commandline client.
646 **
647 */


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2