dcmqrdb/include/dcmtk/dcmqrdb/dcmqrcbs.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 DcmQueryRetrieveStoreContext
00019  *
00020  *  Last Update:      $Author: joergr $
00021  *  Update Date:      $Date: 2010-10-14 13:16:41 $
00022  *  CVS/RCS Revision: $Revision: 1.5 $
00023  *  Status:           $State: Exp $
00024  *
00025  *  CVS/RCS Log at end of file
00026  *
00027  */
00028 
00029 #ifndef DCMQRCBS_H
00030 #define DCMQRCBS_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 DcmFileFormat;
00038 
00042 class DcmQueryRetrieveStoreContext
00043 {
00044 public:
00052     DcmQueryRetrieveStoreContext(
00053       DcmQueryRetrieveDatabaseHandle& handle,
00054       const DcmQueryRetrieveOptions& options,
00055       DIC_US s,
00056       DcmFileFormat *ff,
00057       OFBool correctuidpadding)
00058     : dbHandle(handle)
00059     , options_(options)
00060     , status(s)
00061     , fileName(NULL)
00062     , dcmff(ff)
00063     , correctUIDPadding(correctuidpadding)
00064     {
00065     }
00066 
00070     void setStatus(DIC_US s) { status = s; }
00071 
00073     DIC_US getStatus() const { return status; }
00074 
00078     void setFileName(const char *fn) { fileName = fn; }
00079 
00088     void callbackHandler(
00089         T_DIMSE_StoreProgress *progress,
00090         T_DIMSE_C_StoreRQ *req,
00091         char *imageFileName,
00092         DcmDataset **imageDataSet,
00093         T_DIMSE_C_StoreRSP *rsp,
00094         DcmDataset **stDetail);
00095 
00096 private:
00097 
00098     void updateDisplay(T_DIMSE_StoreProgress * progress);
00099 
00100     void saveImageToDB(
00101         T_DIMSE_C_StoreRQ *req,             /* original store request */
00102         const char *imageFileName,
00103         /* out */
00104         T_DIMSE_C_StoreRSP *rsp,            /* final store response */
00105         DcmDataset **stDetail);
00106 
00107     void writeToFile(
00108         DcmFileFormat *ff,
00109         const char* fname,
00110         T_DIMSE_C_StoreRSP *rsp);
00111 
00112     void checkRequestAgainstDataset(
00113         T_DIMSE_C_StoreRQ *req,     /* original store request */
00114         const char* fname,          /* filename of dataset */
00115         DcmDataset *dataSet,        /* dataset to check */
00116         T_DIMSE_C_StoreRSP *rsp,    /* final store response */
00117         OFBool uidPadding);         /* correct UID padding */
00118 
00120     DcmQueryRetrieveDatabaseHandle& dbHandle;
00121 
00123     const DcmQueryRetrieveOptions& options_;
00124 
00126     DIC_US status;
00127 
00129     const char *fileName;
00130 
00132     DcmFileFormat *dcmff;
00133 
00135     OFBool correctUIDPadding;
00136 
00137 };
00138 
00139 #endif
00140 
00141 /*
00142  * CVS Log
00143  * $Log: dcmqrcbs.h,v $
00144  * Revision 1.5  2010-10-14 13:16:41  joergr
00145  * Updated copyright header. Added reference to COPYRIGHT file.
00146  *
00147  * Revision 1.4  2009-08-21 09:50:07  joergr
00148  * Replaced tabs by spaces and updated copyright date.
00149  *
00150  * Revision 1.3  2005/12/15 12:38:00  joergr
00151  * Removed naming conflicts.
00152  *
00153  * Revision 1.2  2005/12/08 16:04:19  meichel
00154  * Changed include path schema for all DCMTK header files
00155  *
00156  * Revision 1.1  2005/03/30 13:34:50  meichel
00157  * Initial release of module dcmqrdb that will replace module imagectn.
00158  *   It provides a clear interface between the Q/R DICOM front-end and the
00159  *   database back-end. The imagectn code has been re-factored into a minimal
00160  *   class structure.
00161  *
00162  *
00163  */


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