OFFIS DCMTK  Version 3.6.0
dcmqrcbm.h
1 /*
2  *
3  * Copyright (C) 1993-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: dcmqrdb
15  *
16  * Author: Marco Eichelberg
17  *
18  * Purpose: class DcmQueryRetrieveMoveContext
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-14 13:16:41 $
22  * CVS/RCS Revision: $Revision: 1.8 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 #ifndef DCMQRCBM_H
30 #define DCMQRCBM_H
31 
32 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
33 #include "dcmtk/dcmnet/dimse.h"
34 
39 
44 {
45 public:
57  const DcmQueryRetrieveOptions& options,
58  const DcmQueryRetrieveConfig *cfg,
59  DIC_US priorstatus,
60  T_ASC_Association *assoc,
61  DIC_US msgid,
62  T_DIMSE_Priority pr)
63  : dbHandle(handle)
64  , options_(options)
65  , priorStatus(priorstatus)
66  , origAssoc(assoc)
67  , subAssoc(NULL)
68  , config(cfg)
69  , assocStarted(OFFalse)
70  , origMsgId(msgid)
71 // , origAETitle()
72 // , origHostName()
73  , priority(pr)
74  , ourAETitle()
75 // , dstAETitle()
76  , failedUIDs(NULL)
77  , nRemaining(0)
78  , nCompleted(0)
79  , nFailed(0)
80  , nWarning(0)
81  {
82  origAETitle[0] = '\0';
83  origHostName[0] = '\0';
84  dstAETitle[0] = '\0';
85  }
86 
96  void callbackHandler(
97  /* in */
98  OFBool cancelled, T_DIMSE_C_MoveRQ *request,
99  DcmDataset *requestIdentifiers, int responseCount,
100  /* out */
101  T_DIMSE_C_MoveRSP *response, DcmDataset **stDetail,
102  DcmDataset **responseIdentifiers);
103 
107  void setOurAETitle(const char *ae)
108  {
109  if (ae) ourAETitle = ae; else ourAETitle.clear();
110  }
111 
112 private:
113 
114  void addFailedUIDInstance(const char *sopInstance);
115  OFCondition performMoveSubOp(DIC_UI sopClass, DIC_UI sopInstance, char *fname);
116  OFCondition buildSubAssociation(T_DIMSE_C_MoveRQ *request);
117  OFCondition closeSubAssociation();
118  void moveNextImage(DcmQueryRetrieveDatabaseStatus * dbStatus);
119  void failAllSubOperations(DcmQueryRetrieveDatabaseStatus * dbStatus);
120  void buildFailedInstanceList(DcmDataset ** rspIds);
121  OFBool mapMoveDestination(
122  const char *origPeer, const char *origAE,
123  const char *dstAE, char *dstPeer, int *dstPort);
124  OFCondition addAllStoragePresentationContexts(T_ASC_Parameters *params);
125 
128 
131 
133  DIC_US priorStatus;
134 
136  T_ASC_Association *origAssoc; /* association of requestor */
137 
139  T_ASC_Association *subAssoc; /* sub-association */
140 
143 
145  OFBool assocStarted;
146 
148  DIC_US origMsgId;
149 
151  DIC_AE origAETitle;
152 
154  DIC_NODENAME origHostName;
155 
157  T_DIMSE_Priority priority;
158 
161 
163  DIC_AE dstAETitle;
164 
166  char *failedUIDs;
167 
169  DIC_US nRemaining;
170 
172  DIC_US nCompleted;
173 
175  DIC_US nFailed;
176 
178  DIC_US nWarning;
179 
180 };
181 
182 #endif
183 
184 /*
185  * CVS Log
186  * $Log: dcmqrcbm.h,v $
187  * Revision 1.8 2010-10-14 13:16:41 joergr
188  * Updated copyright header. Added reference to COPYRIGHT file.
189  *
190  * Revision 1.7 2009-11-24 10:10:42 uli
191  * Switched to logging mechanism provided by the "new" oflog module.
192  *
193  * Revision 1.6 2009-08-21 09:50:07 joergr
194  * Replaced tabs by spaces and updated copyright date.
195  *
196  * Revision 1.5 2006/04/05 08:22:24 joergr
197  * Fixed issue with initialization of OFString member variables.
198  *
199  * Revision 1.4 2005/12/20 11:21:30 meichel
200  * Removed duplicate parameter
201  *
202  * Revision 1.3 2005/12/15 08:32:49 joergr
203  * Fixed issue with initialization of array member variables, reported by egcs
204  * on Solaris. Fixed missing/wrong initialization of member variables.
205  *
206  * Revision 1.2 2005/12/08 16:04:18 meichel
207  * Changed include path schema for all DCMTK header files
208  *
209  * Revision 1.1 2005/03/30 13:34:50 meichel
210  * Initial release of module dcmqrdb that will replace module imagectn.
211  * It provides a clear interface between the Q/R DICOM front-end and the
212  * database back-end. The imagectn code has been re-factored into a minimal
213  * class structure.
214  *
215  *
216  */
DIC_US nCompleted
number of completed sub-operations
Definition: dcmqrcbm.h:172
DcmQueryRetrieveDatabaseHandle & dbHandle
reference to database handle
Definition: dcmqrcbm.h:127
void clear()
empty the string of all contents
Definition: ofstring.h:457
void callbackHandler(OFBool cancelled, T_DIMSE_C_MoveRQ *request, DcmDataset *requestIdentifiers, int responseCount, T_DIMSE_C_MoveRSP *response, DcmDataset **stDetail, DcmDataset **responseIdentifiers)
callback handler called by the DIMSE_storeProvider callback function.
OFBool assocStarted
true if the association was started
Definition: dcmqrcbm.h:145
DIC_AE dstAETitle
destination title for move
Definition: dcmqrcbm.h:163
DIC_US nWarning
number of completed sub-operations that causes warnings
Definition: dcmqrcbm.h:178
this class encapsulates all the various options that affect the operation of the SCP, in addition to those defined in the config file
Definition: dcmqropt.h:48
DIC_US origMsgId
message id of request
Definition: dcmqrcbm.h:148
abstract base class for database handles.
Definition: dcmqrdba.h:51
DcmQueryRetrieveMoveContext(DcmQueryRetrieveDatabaseHandle &handle, const DcmQueryRetrieveOptions &options, const DcmQueryRetrieveConfig *cfg, DIC_US priorstatus, T_ASC_Association *assoc, DIC_US msgid, T_DIMSE_Priority pr)
constructor
Definition: dcmqrcbm.h:55
T_ASC_Association * subAssoc
pointer to sub-association for outgoing C-STORE-RQ
Definition: dcmqrcbm.h:139
DIC_NODENAME origHostName
hostname of move requestor
Definition: dcmqrcbm.h:154
const DcmQueryRetrieveConfig * config
pointer to Q/R configuration
Definition: dcmqrcbm.h:142
T_ASC_Association * origAssoc
pointer to original association on which the C-MOVE-RQ was received
Definition: dcmqrcbm.h:136
a class handling the DICOM dataset format (files without meta header)
Definition: dcdatset.h:46
DIC_US priorStatus
prior DIMSE status
Definition: dcmqrcbm.h:133
char * failedUIDs
instance UIDs of failed store sub-ops
Definition: dcmqrcbm.h:166
void setOurAETitle(const char *ae)
set the AEtitle under which this application operates
Definition: dcmqrcbm.h:107
DIC_AE origAETitle
title of requestor
Definition: dcmqrcbm.h:151
a simple string class that implements a subset of std::string.
Definition: ofstring.h:86
this class describes configuration settings for a Query/Retrieve SCP Service
Definition: dcmqrcnf.h:133
const DcmQueryRetrieveOptions & options_
reference to Q/R service options
Definition: dcmqrcbm.h:130
this class describes the result of a database operation (for an incoming C-FIND, C-MOVE, C-GET or C-STORE request) in a format that can directly be communicated to the remote SCU in a DIMSE RSP message.
Definition: dcmqrdbs.h:43
DIC_US nFailed
number of failed sub-operations
Definition: dcmqrcbm.h:175
OFString ourAETitle
our current title
Definition: dcmqrcbm.h:160
DIC_US nRemaining
number of remaining sub-operations
Definition: dcmqrcbm.h:169
General purpose class for condition codes.
Definition: ofcond.h:305
T_DIMSE_Priority priority
priority of move request
Definition: dcmqrcbm.h:157
this class maintains the context information that is passed to the callback function called by DIMSE_...
Definition: dcmqrcbm.h:43


Generated on Wed Dec 14 2016 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.11