00001 /* 00002 * 00003 * Copyright (C) 1993-2010, OFFIS e.V. 00004 * All rights reserved. See COPYRIGHT file for details. 00005 * 00006 * This software and supporting documentation were developed by 00007 * 00008 * OFFIS e.V. 00009 * R&D Division Health 00010 * Escherweg 2 00011 * D-26121 Oldenburg, Germany 00012 * 00013 * 00014 * Module: dcmqrdb 00015 * 00016 * Author: Marco Eichelberg 00017 * 00018 * Purpose: class DcmQueryRetrieveMoveContext 00019 * 00020 * Last Update: $Author: joergr $ 00021 * Update Date: $Date: 2010-10-14 13:16:41 $ 00022 * CVS/RCS Revision: $Revision: 1.8 $ 00023 * Status: $State: Exp $ 00024 * 00025 * CVS/RCS Log at end of file 00026 * 00027 */ 00028 00029 #ifndef DCMQRCBM_H 00030 #define DCMQRCBM_H 00031 00032 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00033 #include "dcmtk/dcmnet/dimse.h" 00034 00035 class DcmQueryRetrieveDatabaseHandle; 00036 class DcmQueryRetrieveOptions; 00037 class DcmQueryRetrieveConfig; 00038 class DcmQueryRetrieveDatabaseStatus; 00039 00043 class DcmQueryRetrieveMoveContext 00044 { 00045 public: 00055 DcmQueryRetrieveMoveContext( 00056 DcmQueryRetrieveDatabaseHandle& handle, 00057 const DcmQueryRetrieveOptions& options, 00058 const DcmQueryRetrieveConfig *cfg, 00059 DIC_US priorstatus, 00060 T_ASC_Association *assoc, 00061 DIC_US msgid, 00062 T_DIMSE_Priority pr) 00063 : dbHandle(handle) 00064 , options_(options) 00065 , priorStatus(priorstatus) 00066 , origAssoc(assoc) 00067 , subAssoc(NULL) 00068 , config(cfg) 00069 , assocStarted(OFFalse) 00070 , origMsgId(msgid) 00071 // , origAETitle() 00072 // , origHostName() 00073 , priority(pr) 00074 , ourAETitle() 00075 // , dstAETitle() 00076 , failedUIDs(NULL) 00077 , nRemaining(0) 00078 , nCompleted(0) 00079 , nFailed(0) 00080 , nWarning(0) 00081 { 00082 origAETitle[0] = '\0'; 00083 origHostName[0] = '\0'; 00084 dstAETitle[0] = '\0'; 00085 } 00086 00096 void callbackHandler( 00097 /* in */ 00098 OFBool cancelled, T_DIMSE_C_MoveRQ *request, 00099 DcmDataset *requestIdentifiers, int responseCount, 00100 /* out */ 00101 T_DIMSE_C_MoveRSP *response, DcmDataset **stDetail, 00102 DcmDataset **responseIdentifiers); 00103 00107 void setOurAETitle(const char *ae) 00108 { 00109 if (ae) ourAETitle = ae; else ourAETitle.clear(); 00110 } 00111 00112 private: 00113 00114 void addFailedUIDInstance(const char *sopInstance); 00115 OFCondition performMoveSubOp(DIC_UI sopClass, DIC_UI sopInstance, char *fname); 00116 OFCondition buildSubAssociation(T_DIMSE_C_MoveRQ *request); 00117 OFCondition closeSubAssociation(); 00118 void moveNextImage(DcmQueryRetrieveDatabaseStatus * dbStatus); 00119 void failAllSubOperations(DcmQueryRetrieveDatabaseStatus * dbStatus); 00120 void buildFailedInstanceList(DcmDataset ** rspIds); 00121 OFBool mapMoveDestination( 00122 const char *origPeer, const char *origAE, 00123 const char *dstAE, char *dstPeer, int *dstPort); 00124 OFCondition addAllStoragePresentationContexts(T_ASC_Parameters *params); 00125 00127 DcmQueryRetrieveDatabaseHandle& dbHandle; 00128 00130 const DcmQueryRetrieveOptions& options_; 00131 00133 DIC_US priorStatus; 00134 00136 T_ASC_Association *origAssoc; /* association of requestor */ 00137 00139 T_ASC_Association *subAssoc; /* sub-association */ 00140 00142 const DcmQueryRetrieveConfig *config; 00143 00145 OFBool assocStarted; 00146 00148 DIC_US origMsgId; 00149 00151 DIC_AE origAETitle; 00152 00154 DIC_NODENAME origHostName; 00155 00157 T_DIMSE_Priority priority; 00158 00160 OFString ourAETitle; 00161 00163 DIC_AE dstAETitle; 00164 00166 char *failedUIDs; 00167 00169 DIC_US nRemaining; 00170 00172 DIC_US nCompleted; 00173 00175 DIC_US nFailed; 00176 00178 DIC_US nWarning; 00179 00180 }; 00181 00182 #endif 00183 00184 /* 00185 * CVS Log 00186 * $Log: dcmqrcbm.h,v $ 00187 * Revision 1.8 2010-10-14 13:16:41 joergr 00188 * Updated copyright header. Added reference to COPYRIGHT file. 00189 * 00190 * Revision 1.7 2009-11-24 10:10:42 uli 00191 * Switched to logging mechanism provided by the "new" oflog module. 00192 * 00193 * Revision 1.6 2009-08-21 09:50:07 joergr 00194 * Replaced tabs by spaces and updated copyright date. 00195 * 00196 * Revision 1.5 2006/04/05 08:22:24 joergr 00197 * Fixed issue with initialization of OFString member variables. 00198 * 00199 * Revision 1.4 2005/12/20 11:21:30 meichel 00200 * Removed duplicate parameter 00201 * 00202 * Revision 1.3 2005/12/15 08:32:49 joergr 00203 * Fixed issue with initialization of array member variables, reported by egcs 00204 * on Solaris. Fixed missing/wrong initialization of member variables. 00205 * 00206 * Revision 1.2 2005/12/08 16:04:18 meichel 00207 * Changed include path schema for all DCMTK header files 00208 * 00209 * Revision 1.1 2005/03/30 13:34:50 meichel 00210 * Initial release of module dcmqrdb that will replace module imagectn. 00211 * It provides a clear interface between the Q/R DICOM front-end and the 00212 * database back-end. The imagectn code has been re-factored into a minimal 00213 * class structure. 00214 * 00215 * 00216 */