1 /*
2  *
3  *  Copyright (C) 1993-2011, OFFIS e.V.
4  *  All rights reserved.  See COPYRIGHT file for details.
5  *
6  *  This software and supporting documentation were developed by
7  *
8  *    OFFIS e.V.
9  *    R&D Division Health
10  *    Escherweg 2
11  *    D-26121 Oldenburg, Germany
12  *
13  *
14  *  Module:  dcmqrdb
15  *
16  *  Author:  Marco Eichelberg
17  *
18  *  Purpose: class DcmQueryRetrieveDatabaseStatus
19  *
20  */
21 
22 #ifndef DCMQRDBS_H
23 #define DCMQRDBS_H
24 
25 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
26 #include "dcmtk/ofstd/oftypes.h"
27 #include "dcmtk/dcmqrdb/qrdefine.h"
28 
29 class DcmDataset;
30 
31 /** this class describes the result of a database operation (for an
32  *  incoming C-FIND, C-MOVE, C-GET or C-STORE request) in a format
33  *  that can directly be communicated to the remote SCU in a DIMSE RSP message.
34  *  An object of this class comprises a status field along with an
35  *  optional dataset containing status detail information.
36  */
37 class DCMTK_DCMQRDB_EXPORT DcmQueryRetrieveDatabaseStatus
38 {
39 public:
40   /** default constructor
41    *  @param s initial DIMSE status, default is 0 (success).
42    */
43   DcmQueryRetrieveDatabaseStatus(Uint16 s = 0);
44 
45   /// copy constructor
46   DcmQueryRetrieveDatabaseStatus(const DcmQueryRetrieveDatabaseStatus& org);
47 
48   /// destructor
49   ~DcmQueryRetrieveDatabaseStatus();
50 
51   /// copy assignment operator
52   DcmQueryRetrieveDatabaseStatus& operator=(const DcmQueryRetrieveDatabaseStatus& org);
53 
54   /// delete status detail, if any
55   void deleteStatusDetail();
56 
57   /** return pointer to status detail object, then set status detail to NULL
58    *  @return status detail, may be NULL
59    */
60   DcmDataset *extractStatusDetail();
61 
62   /// return status value
status()63   Uint16 status() const { return status_; }
64 
65   /** set new status value
66    *  @param s new status
67    */
setStatus(Uint16 s)68   void setStatus(Uint16 s) { status_ = s; }
69 
70 private:
71   /// the status flag as defined for the various DIMSE services
72   Uint16 status_;
73 
74   /// an optional DICOM dataset with status detail, may be NULL.
75   DcmDataset *statusDetail_;
76 };
77 
78 #endif
79