00001 /* 00002 * 00003 * Copyright (C) 1993-2005, OFFIS 00004 * 00005 * This software and supporting documentation were developed by 00006 * 00007 * Kuratorium OFFIS e.V. 00008 * Healthcare Information and Communication Systems 00009 * Escherweg 2 00010 * D-26121 Oldenburg, Germany 00011 * 00012 * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY 00013 * REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR 00014 * FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR 00015 * ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND 00016 * PERFORMANCE OF THE SOFTWARE IS WITH THE USER. 00017 * 00018 * Module: dcmqrdb 00019 * 00020 * Author: Marco Eichelberg 00021 * 00022 * Purpose: class DcmQueryRetrieveMoveContext 00023 * 00024 * Last Update: $Author: meichel $ 00025 * Update Date: $Date: 2005/12/20 11:21:30 $ 00026 * Source File: $Source: /share/dicom/cvs-depot/dcmtk/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbm.h,v $ 00027 * CVS/RCS Revision: $Revision: 1.4 $ 00028 * Status: $State: Exp $ 00029 * 00030 * CVS/RCS Log at end of file 00031 * 00032 */ 00033 00034 #ifndef DCMQRCBM_H 00035 #define DCMQRCBM_H 00036 00037 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00038 #include "dcmtk/dcmnet/dimse.h" 00039 00040 class DcmQueryRetrieveDatabaseHandle; 00041 class DcmQueryRetrieveOptions; 00042 class DcmQueryRetrieveConfig; 00043 class DcmQueryRetrieveDatabaseStatus; 00044 00048 class DcmQueryRetrieveMoveContext 00049 { 00050 public: 00060 DcmQueryRetrieveMoveContext( 00061 DcmQueryRetrieveDatabaseHandle& handle, 00062 const DcmQueryRetrieveOptions& options, 00063 const DcmQueryRetrieveConfig *cfg, 00064 DIC_US priorstatus, 00065 T_ASC_Association *assoc, 00066 DIC_US msgid, 00067 T_DIMSE_Priority pr) 00068 : dbHandle(handle) 00069 , options_(options) 00070 , priorStatus(priorstatus) 00071 , origAssoc(assoc) 00072 , subAssoc(NULL) 00073 , config(cfg) 00074 , assocStarted(OFFalse) 00075 , origMsgId(msgid) 00076 // , origAETitle() 00077 // , origHostName() 00078 , priority(pr) 00079 // , ourAETitle() 00080 // , dstAETitle() 00081 , failedUIDs(NULL) 00082 , nRemaining(0) 00083 , nCompleted(0) 00084 , nFailed(0) 00085 , nWarning(0) 00086 { 00087 origAETitle[0] = '\0'; 00088 origHostName[0] = '\0'; 00089 dstAETitle[0] = '\0'; 00090 ourAETitle[0] = '\0'; 00091 } 00092 00102 void callbackHandler( 00103 /* in */ 00104 OFBool cancelled, T_DIMSE_C_MoveRQ *request, 00105 DcmDataset *requestIdentifiers, int responseCount, 00106 /* out */ 00107 T_DIMSE_C_MoveRSP *response, DcmDataset **stDetail, 00108 DcmDataset **responseIdentifiers); 00109 00111 OFBool isVerbose() const; 00112 00116 void setOurAETitle(const char *ae) 00117 { 00118 if (ae) ourAETitle = ae; else ourAETitle.clear(); 00119 } 00120 00121 private: 00122 00123 void addFailedUIDInstance(const char *sopInstance); 00124 OFCondition performMoveSubOp(DIC_UI sopClass, DIC_UI sopInstance, char *fname); 00125 OFCondition buildSubAssociation(T_DIMSE_C_MoveRQ *request); 00126 OFCondition closeSubAssociation(); 00127 void moveNextImage(DcmQueryRetrieveDatabaseStatus * dbStatus); 00128 void failAllSubOperations(DcmQueryRetrieveDatabaseStatus * dbStatus); 00129 void buildFailedInstanceList(DcmDataset ** rspIds); 00130 OFBool mapMoveDestination( 00131 const char *origPeer, const char *origAE, 00132 const char *dstAE, char *dstPeer, int *dstPort); 00133 OFCondition addAllStoragePresentationContexts(T_ASC_Parameters *params); 00134 00136 DcmQueryRetrieveDatabaseHandle& dbHandle; 00137 00139 const DcmQueryRetrieveOptions& options_; 00140 00142 DIC_US priorStatus; 00143 00145 T_ASC_Association *origAssoc; /* association of requestor */ 00146 00148 T_ASC_Association *subAssoc; /* sub-association */ 00149 00151 const DcmQueryRetrieveConfig *config; 00152 00154 OFBool assocStarted; 00155 00157 DIC_US origMsgId; 00158 00160 DIC_AE origAETitle; 00161 00163 DIC_NODENAME origHostName; 00164 00166 T_DIMSE_Priority priority; 00167 00169 OFString ourAETitle; 00170 00172 DIC_AE dstAETitle; 00173 00175 char *failedUIDs; 00176 00178 DIC_US nRemaining; 00179 00181 DIC_US nCompleted; 00182 00184 DIC_US nFailed; 00185 00187 DIC_US nWarning; 00188 00189 }; 00190 00191 #endif 00192 00193 /* 00194 * CVS Log 00195 * $Log: dcmqrcbm.h,v $ 00196 * Revision 1.4 2005/12/20 11:21:30 meichel 00197 * Removed duplicate parameter 00198 * 00199 * Revision 1.3 2005/12/15 08:32:49 joergr 00200 * Fixed issue with initialization of array member variables, reported by egcs 00201 * on Solaris. Fixed missing/wrong initialization of member variables. 00202 * 00203 * Revision 1.2 2005/12/08 16:04:18 meichel 00204 * Changed include path schema for all DCMTK header files 00205 * 00206 * Revision 1.1 2005/03/30 13:34:50 meichel 00207 * Initial release of module dcmqrdb that will replace module imagectn. 00208 * It provides a clear interface between the Q/R DICOM front-end and the 00209 * database back-end. The imagectn code has been re-factored into a minimal 00210 * class structure. 00211 * 00212 * 00213 */