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 DcmQueryRetrieveSCP 00019 * 00020 * Last Update: $Author: joergr $ 00021 * Update Date: $Date: 2010-10-14 13:16:41 $ 00022 * CVS/RCS Revision: $Revision: 1.4 $ 00023 * Status: $State: Exp $ 00024 * 00025 * CVS/RCS Log at end of file 00026 * 00027 */ 00028 00029 #ifndef DCMQRSRV_H 00030 #define DCMQRSRV_H 00031 00032 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00033 #include "dcmtk/ofstd/oftypes.h" 00034 #include "dcmtk/dcmnet/assoc.h" 00035 #include "dcmtk/dcmnet/dimse.h" 00036 #include "dcmtk/dcmqrdb/dcmqrptb.h" 00037 00038 class DcmQueryRetrieveConfig; 00039 class DcmQueryRetrieveOptions; 00040 class DcmQueryRetrieveDatabaseHandle; 00041 class DcmQueryRetrieveDatabaseHandleFactory; 00042 00044 enum CTN_RefuseReason 00045 { 00047 CTN_TooManyAssociations, 00049 CTN_CannotFork, 00051 CTN_BadAppContext, 00053 CTN_BadAEPeer, 00055 CTN_BadAEService, 00057 CTN_NoReason 00058 }; 00059 00062 class DcmQueryRetrieveSCP 00063 { 00064 public: 00065 00071 DcmQueryRetrieveSCP( 00072 const DcmQueryRetrieveConfig& config, 00073 const DcmQueryRetrieveOptions& options, 00074 const DcmQueryRetrieveDatabaseHandleFactory& factory); 00075 00077 virtual ~DcmQueryRetrieveSCP() { } 00078 00085 OFCondition waitForAssociation(T_ASC_Network *theNet); 00086 00091 void setDatabaseFlags( 00092 OFBool dbCheckFindIdentifier, 00093 OFBool dbCheckMoveIdentifier); 00094 00097 void cleanChildren(); 00098 00099 private: 00100 00107 OFCondition negotiateAssociation(T_ASC_Association * assoc); 00108 00109 OFCondition refuseAssociation(T_ASC_Association ** assoc, CTN_RefuseReason reason); 00110 00111 OFCondition handleAssociation( 00112 T_ASC_Association * assoc, 00113 OFBool correctUIDPadding); 00114 00115 OFCondition echoSCP( 00116 T_ASC_Association * assoc, 00117 T_DIMSE_C_EchoRQ * req, 00118 T_ASC_PresentationContextID presId); 00119 00120 OFCondition findSCP( 00121 T_ASC_Association * assoc, 00122 T_DIMSE_C_FindRQ * request, 00123 T_ASC_PresentationContextID presID, 00124 DcmQueryRetrieveDatabaseHandle& dbHandle); 00125 00126 OFCondition getSCP( 00127 T_ASC_Association * assoc, 00128 T_DIMSE_C_GetRQ * request, 00129 T_ASC_PresentationContextID presID, 00130 DcmQueryRetrieveDatabaseHandle& dbHandle); 00131 00132 OFCondition moveSCP( 00133 T_ASC_Association * assoc, 00134 T_DIMSE_C_MoveRQ * request, 00135 T_ASC_PresentationContextID presID, 00136 DcmQueryRetrieveDatabaseHandle& dbHandle); 00137 00138 OFCondition storeSCP( 00139 T_ASC_Association * assoc, 00140 T_DIMSE_C_StoreRQ * req, 00141 T_ASC_PresentationContextID presId, 00142 DcmQueryRetrieveDatabaseHandle& dbHandle, 00143 OFBool correctUIDPadding); 00144 00145 OFCondition dispatch( 00146 T_ASC_Association *assoc, 00147 OFBool correctUIDPadding); 00148 00149 static void refuseAnyStorageContexts(T_ASC_Association *assoc); 00150 00152 const DcmQueryRetrieveConfig *config_; 00153 00155 DcmQueryRetrieveProcessTable processtable_; 00156 00158 OFBool dbCheckFindIdentifier_; 00159 00161 OFBool dbCheckMoveIdentifier_; 00162 00164 const DcmQueryRetrieveDatabaseHandleFactory& factory_; 00165 00167 const DcmQueryRetrieveOptions& options_; 00168 }; 00169 00170 #endif 00171 00172 /* 00173 * CVS Log 00174 * $Log: dcmqrsrv.h,v $ 00175 * Revision 1.4 2010-10-14 13:16:41 joergr 00176 * Updated copyright header. Added reference to COPYRIGHT file. 00177 * 00178 * Revision 1.3 2009-11-24 10:10:42 uli 00179 * Switched to logging mechanism provided by the "new" oflog module. 00180 * 00181 * Revision 1.2 2009-08-21 09:50:07 joergr 00182 * Replaced tabs by spaces and updated copyright date. 00183 * 00184 * Revision 1.1 2005/12/16 12:42:50 joergr 00185 * Renamed file to avoid naming conflicts when linking on SunOS 5.5.1 with 00186 * Sun CC 2.0.1. 00187 * 00188 * Revision 1.2 2005/12/08 16:04:27 meichel 00189 * Changed include path schema for all DCMTK header files 00190 * 00191 * Revision 1.1 2005/03/30 13:34:50 meichel 00192 * Initial release of module dcmqrdb that will replace module imagectn. 00193 * It provides a clear interface between the Q/R DICOM front-end and the 00194 * database back-end. The imagectn code has been re-factored into a minimal 00195 * class structure. 00196 * 00197 * 00198 */