dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbg.h

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 DcmQueryRetrieveGetContext
00019  *
00020  *  Last Update:      $Author: joergr $
00021  *  Update Date:      $Date: 2010-10-14 13:16:41 $
00022  *  CVS/RCS Revision: $Revision: 1.7 $
00023  *  Status:           $State: Exp $
00024  *
00025  *  CVS/RCS Log at end of file
00026  *
00027  */
00028 
00029 #ifndef DCMQRCBG_H
00030 #define DCMQRCBG_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 DcmQueryRetrieveDatabaseStatus;
00038 
00042 class DcmQueryRetrieveGetContext
00043 {
00044 public:
00054     DcmQueryRetrieveGetContext(DcmQueryRetrieveDatabaseHandle& handle,
00055       const DcmQueryRetrieveOptions& options,
00056       DIC_US priorstatus,
00057       T_ASC_Association *origassoc,
00058       DIC_US origmsgid,
00059       T_DIMSE_Priority prior,
00060       T_ASC_PresentationContextID origpresid)
00061     : dbHandle(handle)
00062     , options_(options)
00063     , priorStatus(priorstatus)
00064     , origAssoc(origassoc)
00065     , assocStarted(OFFalse)
00066     , origPresId(origpresid)
00067     , origMsgId(origmsgid)
00068     , origAETitle()
00069 //    , origHostName()
00070     , priority(prior)
00071     , ourAETitle()
00072     , failedUIDs(NULL)
00073     , nRemaining(0)
00074     , nCompleted(0)
00075     , nFailed(0)
00076     , nWarning(0)
00077     , getCancelled(OFFalse)
00078     {
00079       origHostName[0] = '\0';
00080     }
00081 
00085     void setOurAETitle(const char *ae)
00086     {
00087       if (ae) ourAETitle = ae; else ourAETitle.clear();
00088     }
00089 
00099     void callbackHandler(
00100         /* in */
00101         OFBool cancelled, T_DIMSE_C_GetRQ *request,
00102         DcmDataset *requestIdentifiers, int responseCount,
00103         /* out */
00104         T_DIMSE_C_GetRSP *response, DcmDataset **stDetail,
00105         DcmDataset **responseIdentifiers);
00106 
00107 private:
00108 
00109     void addFailedUIDInstance(const char *sopInstance);
00110     OFCondition performGetSubOp(DIC_UI sopClass, DIC_UI sopInstance, char *fname);
00111     void getNextImage(DcmQueryRetrieveDatabaseStatus * dbStatus);
00112     void buildFailedInstanceList(DcmDataset ** rspIds);
00113 
00115     DcmQueryRetrieveDatabaseHandle& dbHandle;
00116 
00118     const DcmQueryRetrieveOptions& options_;
00119 
00121     DIC_US  priorStatus;
00122 
00124     T_ASC_Association   *origAssoc;
00125 
00127     OFBool assocStarted;
00128 
00130     T_ASC_PresentationContextID origPresId;
00131 
00133     DIC_US origMsgId;
00134 
00136     OFString origAETitle;
00137 
00139     DIC_NODENAME origHostName;
00140 
00141 
00143     T_DIMSE_Priority priority;
00144 
00146     OFString ourAETitle;
00147 
00149     char *failedUIDs;
00150 
00152     DIC_US nRemaining;
00153 
00155     DIC_US nCompleted;
00156 
00158     DIC_US nFailed;
00159 
00161     DIC_US nWarning;
00162 
00164     OFBool getCancelled;
00165 
00166 };
00167 
00168 #endif
00169 
00170 /*
00171  * CVS Log
00172  * $Log: dcmqrcbg.h,v $
00173  * Revision 1.7  2010-10-14 13:16:41  joergr
00174  * Updated copyright header. Added reference to COPYRIGHT file.
00175  *
00176  * Revision 1.6  2009-11-24 10:10:42  uli
00177  * Switched to logging mechanism provided by the "new" oflog module.
00178  *
00179  * Revision 1.5  2009-08-21 09:50:07  joergr
00180  * Replaced tabs by spaces and updated copyright date.
00181  *
00182  * Revision 1.4  2006/04/05 08:22:24  joergr
00183  * Fixed issue with initialization of OFString member variables.
00184  *
00185  * Revision 1.3  2005/12/15 08:32:49  joergr
00186  * Fixed issue with initialization of array member variables, reported by egcs
00187  * on Solaris. Fixed missing/wrong initialization of member variables.
00188  *
00189  * Revision 1.2  2005/12/08 16:04:17  meichel
00190  * Changed include path schema for all DCMTK header files
00191  *
00192  * Revision 1.1  2005/03/30 13:34:50  meichel
00193  * Initial release of module dcmqrdb that will replace module imagectn.
00194  *   It provides a clear interface between the Q/R DICOM front-end and the
00195  *   database back-end. The imagectn code has been re-factored into a minimal
00196  *   class structure.
00197  *
00198  *
00199  */


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1