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 DcmQueryRetrieveSCP 00023 * 00024 * Last Update: $Author: joergr $ 00025 * Update Date: $Date: 2005/12/16 12:42:50 $ 00026 * Source File: $Source: /share/dicom/cvs-depot/dcmtk/dcmqrdb/include/dcmtk/dcmqrdb/dcmqrsrv.h,v $ 00027 * CVS/RCS Revision: $Revision: 1.1 $ 00028 * Status: $State: Exp $ 00029 * 00030 * CVS/RCS Log at end of file 00031 * 00032 */ 00033 00034 #ifndef DCMQRSRV_H 00035 #define DCMQRSRV_H 00036 00037 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00038 #include "dcmtk/ofstd/oftypes.h" 00039 #include "dcmtk/dcmnet/assoc.h" 00040 #include "dcmtk/dcmnet/dimse.h" 00041 #include "dcmtk/dcmqrdb/dcmqrptb.h" 00042 00043 class DcmQueryRetrieveConfig; 00044 class DcmQueryRetrieveOptions; 00045 class DcmQueryRetrieveDatabaseHandle; 00046 class DcmQueryRetrieveDatabaseHandleFactory; 00047 00049 enum CTN_RefuseReason 00050 { 00052 CTN_TooManyAssociations, 00054 CTN_CannotFork, 00056 CTN_BadAppContext, 00058 CTN_BadAEPeer, 00060 CTN_BadAEService, 00062 CTN_NoReason 00063 }; 00064 00067 class DcmQueryRetrieveSCP 00068 { 00069 public: 00070 00076 DcmQueryRetrieveSCP( 00077 const DcmQueryRetrieveConfig& config, 00078 const DcmQueryRetrieveOptions& options, 00079 const DcmQueryRetrieveDatabaseHandleFactory& factory); 00080 00082 virtual ~DcmQueryRetrieveSCP() { } 00083 00090 OFCondition waitForAssociation(T_ASC_Network *theNet); 00091 00097 void setDatabaseFlags( 00098 OFBool dbCheckFindIdentifier, 00099 OFBool dbCheckMoveIdentifier, 00100 OFBool dbDebug); 00101 00105 void cleanChildren(OFBool verbose = OFFalse); 00106 00107 private: 00108 00115 OFCondition negotiateAssociation(T_ASC_Association * assoc); 00116 00117 OFCondition refuseAssociation(T_ASC_Association ** assoc, CTN_RefuseReason reason); 00118 00119 OFCondition handleAssociation( 00120 T_ASC_Association * assoc, 00121 OFBool correctUIDPadding); 00122 00123 OFCondition echoSCP( 00124 T_ASC_Association * assoc, 00125 T_DIMSE_C_EchoRQ * req, 00126 T_ASC_PresentationContextID presId); 00127 00128 OFCondition findSCP( 00129 T_ASC_Association * assoc, 00130 T_DIMSE_C_FindRQ * request, 00131 T_ASC_PresentationContextID presID, 00132 DcmQueryRetrieveDatabaseHandle& dbHandle); 00133 00134 OFCondition getSCP( 00135 T_ASC_Association * assoc, 00136 T_DIMSE_C_GetRQ * request, 00137 T_ASC_PresentationContextID presID, 00138 DcmQueryRetrieveDatabaseHandle& dbHandle); 00139 00140 OFCondition moveSCP( 00141 T_ASC_Association * assoc, 00142 T_DIMSE_C_MoveRQ * request, 00143 T_ASC_PresentationContextID presID, 00144 DcmQueryRetrieveDatabaseHandle& dbHandle); 00145 00146 OFCondition storeSCP( 00147 T_ASC_Association * assoc, 00148 T_DIMSE_C_StoreRQ * req, 00149 T_ASC_PresentationContextID presId, 00150 DcmQueryRetrieveDatabaseHandle& dbHandle, 00151 OFBool correctUIDPadding); 00152 00153 OFCondition dispatch( 00154 T_ASC_Association *assoc, 00155 OFBool correctUIDPadding); 00156 00157 static void refuseAnyStorageContexts(T_ASC_Association *assoc); 00158 00160 const DcmQueryRetrieveConfig *config_; 00161 00163 DcmQueryRetrieveProcessTable processtable_; 00164 00166 OFBool dbCheckFindIdentifier_; 00167 00169 OFBool dbCheckMoveIdentifier_; 00170 00172 OFBool dbDebug_; 00173 00175 const DcmQueryRetrieveDatabaseHandleFactory& factory_; 00176 00178 const DcmQueryRetrieveOptions& options_; 00179 }; 00180 00181 #endif 00182 00183 /* 00184 * CVS Log 00185 * $Log: dcmqrsrv.h,v $ 00186 * Revision 1.1 2005/12/16 12:42:50 joergr 00187 * Renamed file to avoid naming conflicts when linking on SunOS 5.5.1 with 00188 * Sun CC 2.0.1. 00189 * 00190 * Revision 1.2 2005/12/08 16:04:27 meichel 00191 * Changed include path schema for all DCMTK header files 00192 * 00193 * Revision 1.1 2005/03/30 13:34:50 meichel 00194 * Initial release of module dcmqrdb that will replace module imagectn. 00195 * It provides a clear interface between the Q/R DICOM front-end and the 00196 * database back-end. The imagectn code has been re-factored into a minimal 00197 * class structure. 00198 * 00199 * 00200 */