OFFIS DCMTK  Version 3.6.0
dcmqrtis.h
1 /*
2  *
3  * Copyright (C) 1993-2010, 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: Andrew Hewett
17  *
18  * Purpose: TI Common Constants, Types, Globals and Functions
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-14 13:16:41 $
22  * CVS/RCS Revision: $Revision: 1.8 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 #ifndef DCMQRTIS_H
30 #define DCMQRTIS_H
31 
32 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
33 
34 #include "dcmtk/dcmnet/dicom.h"
35 #include "dcmtk/dcmnet/cond.h"
36 #include "dcmtk/dcmnet/assoc.h"
37 #include "dcmtk/dcmnet/dimse.h"
38 #include "dcmtk/ofstd/ofcmdln.h"
39 #include "dcmtk/dcmqrdb/dcmqrcnf.h"
40 
42 
43 /*
44  * Constants
45  */
46 
47 #define TI_MAXPEERS 100
48 #define TI_MAXDATABASES 100
49 #define TI_MAXSTUDIES 1000
50 #define TI_MAXSERIES 500
51 #define TI_MAXIMAGES 1000
52 
53 /*
54  * Type definitions
55  */
56 
58 {
59  DIC_UI sopInstanceUID;
60  DIC_IS imageNumber;
61  int intImageNumber;
62 } ;
63 
65 {
66  DIC_UI seriesInstanceUID;
67  DIC_IS seriesNumber;
68  int intSeriesNumber;
69  DIC_CS modality;
70  TI_ImageEntry *images[TI_MAXIMAGES]; /* array of image pointers */
71  int imageCount;
72 
73  time_t lastQueryTime; /* time we last queried db */
74 };
75 
77 {
78  DIC_UI studyInstanceUID;
79  DIC_CS studyID;
80  DIC_PN patientName;
81  DIC_LO patientID;
82  TI_SeriesEntry *series[TI_MAXSERIES]; /* array of series pointers */
83  int seriesCount;
84  time_t lastQueryTime; /* time we last queried db */
85 };
86 
87 
88 struct TI_DBEntry
89 {
90  const char *title; /* the CTN AE Title associated with this DB */
91 
92  const char **peerTitles; /* peer titles which can read this database
93  * and thus we can comminicate with */
94  int peerTitleCount; /* number of peer titles */
95 
96  DcmQueryRetrieveDatabaseHandle *dbHandle; /* handle to current db */
97 
98  TI_StudyEntry *studies[TI_MAXSTUDIES]; /* array of study pointers */
99  int studyCount;
100 
101  int currentStudy; /* index of current study */
102  int currentSeries; /* index of current series in current study */
103  int currentImage; /* index of current image in current study */
104 
105  time_t lastQueryTime; /* time we last queried db */
106 
107  OFBool isRemoteDB; /* true if DB is remote */
108 };
109 
111 {
112  TI_DBEntry *db;
113  TI_StudyEntry *study;
114  TI_SeriesEntry *series;
115 };
116 
117 typedef OFBool (*TI_GenericEntryCallbackFunction)(TI_GenericCallbackStruct *cbstruct, DcmDataset *reply);
118 
122 {
123 public:
124 
129 
132  void TI_userInput();
133 
138  OFBool addPeerName(const char *peerName, const char *configFileName);
139 
142  void printConfig();
143 
147  OFBool TI_detachAssociation(OFBool abortFlag);
148 
152  void setAETitle(const char *ae)
153  {
154  myAETitle = ae;
155  }
156 
160  void setMaxPDU(OFCmdUnsignedInt pdu)
161  {
162  maxReceivePDULength = pdu;
163  }
164 
168  {
169  peerHostName = peerNames[0];
170  }
171 
177  {
178  return &net;
179  }
180 
182  int getdbCount() const
183  {
184  return dbCount;
185  }
186 
192  void createConfigEntries(
193  const char *configFileName,
194  int remoteDBTitlesCount,
195  const char **remoteDBTitles);
196 
200  void setXferSyntax(E_TransferSyntax xfer) { networkTransferSyntax = xfer; }
201 
206  void setBlockMode(T_DIMSE_BlockingMode blockMode, int timeout)
207  {
208  blockMode_ = blockMode;
209  dimse_timeout_ = timeout;
210  }
211 
212 private:
213 
214  OFBool TI_attachAssociation();
215  OFBool TI_changeAssociation();
216  OFBool TI_sendEcho();
217  OFBool TI_storeImage(char *sopClass, char *sopInstance, char * imgFile);
218  OFBool TI_remoteFindQuery(
219  TI_DBEntry *db, DcmDataset *query,
220  TI_GenericEntryCallbackFunction callbackFunction,
221  TI_GenericCallbackStruct *callbackData);
222  OFBool TI_title(int arg, const char * /*cmdbuf*/ );
223  OFBool TI_attachDB(TI_DBEntry *db);
224  OFBool TI_database(int arg, const char * /*cmdbuf*/ );
225  OFBool TI_echo(int arg, const char * /*cmdbuf*/ );
226  OFBool TI_quit(int arg, const char * /*cmdbuf*/ );
227  OFBool TI_actualizeStudies();
228  OFBool TI_study(int arg, const char * /*cmdbuf*/ );
229  OFBool TI_actualizeSeries();
230  OFBool TI_series(int arg, const char * /*cmdbuf*/ );
231  OFBool TI_actualizeImages();
232  OFBool TI_image(int arg, const char * /*cmdbuf*/ );
233  OFBool TI_buildStudies(TI_DBEntry *db);
234  OFBool TI_buildSeries(TI_DBEntry *db, TI_StudyEntry *study);
235  OFBool TI_buildRemoteImages(TI_DBEntry *db, TI_StudyEntry *study, TI_SeriesEntry *series);
236  OFBool TI_buildImages(TI_DBEntry *db, TI_StudyEntry *study, TI_SeriesEntry *series);
237  OFBool TI_sendStudy(int arg, const char * /*cmdbuf*/ );
238  OFBool TI_sendSeries(int arg, const char * /*cmdbuf*/ );
239  OFBool TI_sendImage(int arg, const char * /*cmdbuf*/ );
240  OFBool TI_send(int /*arg*/, const char *cmdbuf);
241  OFBool TI_shortHelp(int /*arg*/ , const char * /*cmdbuf*/ );
242  OFBool TI_help(int arg, const char * /*cmdbuf*/ );
243  OFBool TI_buildRemoteStudies(TI_DBEntry *db);
244  OFBool TI_buildRemoteSeries(TI_DBEntry *db, TI_StudyEntry *study);
245  OFBool TI_dbReadable(const char *dbTitle);
246  time_t TI_dbModifyTime(const char *dbTitle);
247  OFCondition addPresentationContexts(T_ASC_Parameters *params);
248 
249  OFBool findDBPeerTitles(
250  const char *configFileName,
251  TI_DBEntry *dbEntry,
252  const char *peer);
253 
256 
258  int dbCount;
259 
261  const char *peerHostName;
262 
264  const char *peerNames[TI_MAXPEERS];
265 
268 
270  const char *myAETitle;
271 
274 
277 
279  OFCmdUnsignedInt maxReceivePDULength;
280 
283 
285  const char *currentPeerTitle;
286 
289 
291  E_TransferSyntax networkTransferSyntax;
292 
294  T_DIMSE_BlockingMode blockMode_;
295 
298 
299 };
300 
301 
302 #endif
303 
304 /*
305  * CVS Log
306  * $Log: dcmqrtis.h,v $
307  * Revision 1.8 2010-10-14 13:16:41 joergr
308  * Updated copyright header. Added reference to COPYRIGHT file.
309  *
310  * Revision 1.7 2010-08-09 13:23:00 joergr
311  * Updated data dictionary to 2009 edition of the DICOM standard. From now on,
312  * the official "keyword" is used for the attribute name which results in a
313  * number of minor changes (e.g. "PatientsName" is now called "PatientName").
314  *
315  * Revision 1.6 2009-11-24 10:10:42 uli
316  * Switched to logging mechanism provided by the "new" oflog module.
317  *
318  * Revision 1.5 2009-08-21 09:50:07 joergr
319  * Replaced tabs by spaces and updated copyright date.
320  *
321  * Revision 1.4 2005/12/08 16:04:28 meichel
322  * Changed include path schema for all DCMTK header files
323  *
324  * Revision 1.3 2005/11/17 13:44:37 meichel
325  * Added command line options for DIMSE and ACSE timeouts
326  *
327  * Revision 1.2 2005/06/16 08:03:51 meichel
328  * Fixed typo in method name
329  *
330  * Revision 1.1 2005/03/30 13:34:50 meichel
331  * Initial release of module dcmqrdb that will replace module imagectn.
332  * It provides a clear interface between the Q/R DICOM front-end and the
333  * database back-end. The imagectn code has been re-factored into a minimal
334  * class structure.
335  *
336  *
337  */


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2