1 /*
2  *
3  *  Copyright (C) 1993-2017, 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:  dcmqrdb
15  *
16  *  Author:  Andrew Hewett
17  *
18  *  Purpose: class DcmQueryRetrieveOptions
19  *
20  */
21 
22 #ifndef DCMQROPT_H
23 #define DCMQROPT_H
24 
25 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
26 
27 #include "dcmtk/dcmdata/dcxfer.h"
28 #include "dcmtk/dcmnet/dicom.h"
29 #include "dcmtk/dcmnet/cond.h"
30 #include "dcmtk/dcmnet/assoc.h"
31 #include "dcmtk/dcmqrdb/dcmqrcnf.h"
32 #include "dcmtk/ofstd/ofconapp.h"
33 #include "dcmtk/dcmnet/dimse.h"
34 
35 /// invalid peer for move operation
36 extern DCMTK_DCMQRDB_EXPORT const OFConditionConst QR_EC_InvalidPeer;
37 extern DCMTK_DCMQRDB_EXPORT const OFConditionConst QR_EC_IndexDatabaseError;
38 
39 /** this class encapsulates all the various options that affect the
40  *  operation of the SCP, in addition to those defined in the config file
41  */
42 class DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveOptions
43 {
44 private:
45   /// private undefined copy constructor
46   DcmQueryRetrieveOptions(const DcmQueryRetrieveOptions& other);
47 
48   /// private undefined assignment operator
49   DcmQueryRetrieveOptions& operator=(const DcmQueryRetrieveOptions& other);
50 
51 public:
52   /// default constructor
53   DcmQueryRetrieveOptions();
54 
55   /// destructor
56   ~DcmQueryRetrieveOptions();
57 
58   // these member variables should be private but are public for now
59 
60   /// enable negotiation of private shutdown SOP class
61   OFBool            allowShutdown_;
62 
63   /// bit preserving mode for incoming storage requests.
64   OFBool            bitPreserving_;
65 
66   /// silently correct space-padded UIDs
67   OFBool            correctUIDPadding_;
68 
69   /// enable/disable C-GET support
70   OFBool            disableGetSupport_;
71 
72   /// block size for file padding, pad DICOM files to multiple of this value
73   OFCmdUnsignedInt  filepad_;
74 
75   /// group length encoding when writing DICOM files
76   E_GrpLenEncoding  groupLength_;
77 
78   /// ignore incoming data, receive but do not store (for debugging)
79   OFBool            ignoreStoreData_;
80 
81   /// block size for item padding, pad DICOM files to multiple of this value
82   OFCmdUnsignedInt  itempad_;
83 
84   /// maximum number of parallel associations accepted
85   int               maxAssociations_;
86 
87   /// maximum PDU size
88   OFCmdUnsignedInt  maxPDU_;
89 
90   /// pointer to network structure used for requesting C-STORE sub-associations
91   T_ASC_Network *   net_;
92 
93   /// preferred transfer syntax for incoming associations
94   E_TransferSyntax  networkTransferSyntax_;
95 
96 #ifndef DISABLE_COMPRESSION_EXTENSION
97   /// preferred transfer syntax for outgoing associations
98   E_TransferSyntax  networkTransferSyntaxOut_;
99 #endif
100 
101   /// padding algorithm for writing DICOM files
102   E_PaddingEncoding paddingType_;
103 
104   /* refuse storage presentation contexts in incoming associations
105    * if a storage presentation context for the application entity already exists
106    */
107   OFBool            refuseMultipleStorageAssociations_;
108 
109   /// refuse all incoming associations
110   OFBool            refuse_;
111 
112   /// reject associations if implementatino class UID is missing
113   OFBool            rejectWhenNoImplementationClassUID_;
114 
115   /// refuse MOVE context if no corresponding FIND context is present
116   OFBool            requireFindForMove_;
117 
118   /// restrict MOVE operations to same Application Entity
119   OFBool            restrictMoveToSameAE_;
120 
121   /// restrict MOVE operations to same host
122   OFBool            restrictMoveToSameHost_;
123 
124   /// restrict MOVE operations to same vendor according to vendor table
125   OFBool            restrictMoveToSameVendor_;
126 
127   /// sequence encoding when writing DICOM files
128   E_EncodingType    sequenceType_;
129 
130   /// single process mode
131   OFBool            singleProcess_;
132 
133   /// support for patient root q/r model
134   OFBool            supportPatientRoot_;
135 
136   /// support for patient/study only q/r model
137   OFBool            supportPatientStudyOnly_;
138 
139   /// support for study root q/r model
140   OFBool            supportStudyRoot_;
141 
142   /// write DICOM files with DICOM metaheader
143   OFBool            useMetaheader_;
144 
145   /** keep DB handle open for the complete lifetime of an association.
146    *  If false, the DB handle is created and released for each incoming
147    *  DIMSE message that is processed.
148    */
149   OFBool            keepDBHandleDuringAssociation_;
150 
151   /// transfer syntax for writing
152   E_TransferSyntax  writeTransferSyntax_;
153 
154   /// blocking mode for DIMSE operations
155   T_DIMSE_BlockingMode blockMode_;
156 
157   /// timeout for DIMSE operations
158   int dimse_timeout_;
159 
160   /// timeout for ACSE operations
161   int acse_timeout_;
162 
163   // association configuration file name
164   OFString associationConfigFile;
165 
166   /// profile name for incoming association configuration
167   OFString incomingProfile;
168 
169   /// profile name for outgoing association configuration
170   OFString outgoingProfile;
171 };
172 
173 
174 #endif
175