00001 /* 00002 * 00003 * Copyright (C) 2000-2005, OFFIS 00004 * 00005 * This software and supporting documentation were developed by 00006 * 00007 * Kuratorium OFFIS e.V. 00008 * Healthcare Information and Communication Systems 00009 * Escherweg 2 00010 * D-26121 Oldenburg, Germany 00011 * 00012 * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY 00013 * REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR 00014 * FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR 00015 * ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND 00016 * PERFORMANCE OF THE SOFTWARE IS WITH THE USER. 00017 * 00018 * Module: dcmpstat 00019 * 00020 * Author: Marco Eichelberg 00021 * 00022 * Purpose: 00023 * classes: DVPSPrintSCP 00024 * 00025 * Last Update: $Author: meichel $ 00026 * Update Date: $Date: 2005/12/08 16:03:58 $ 00027 * CVS/RCS Revision: $Revision: 1.9 $ 00028 * Status: $State: Exp $ 00029 * 00030 * CVS/RCS Log at end of file 00031 * 00032 */ 00033 00034 00035 #ifndef DVPSPRT_H 00036 #define DVPSPRT_H 00037 00038 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00039 00040 #include "dcmtk/ofstd/ofstream.h" 00041 #include "dcmtk/ofstd/ofstring.h" 00042 #include "dcmtk/dcmdata/dctk.h" 00043 #include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ 00044 #include "dcmtk/dcmpstat/dvpspll.h" /* for class DVPSPresentationLUT_PList */ 00045 #include "dcmtk/dcmpstat/dvpsspl.h" /* for class DVPSStoredPrint_PList */ 00046 #include "dcmtk/dcmnet/assoc.h" 00047 #include "dcmtk/dcmnet/dimse.h" 00048 00049 class DVInterface; 00050 class DVPSFilmSession; 00051 00056 class DVPSPrintSCP 00057 { 00058 public: 00059 00064 DVPSPrintSCP(DVInterface &iface, const char *cfname); 00065 00067 virtual ~DVPSPrintSCP(); 00068 00076 void setLog(OFConsole *stream, OFBool verbMode, OFBool dbgMode, OFBool dmpMode); 00077 00085 void setDimseLogPath(const char *fname); 00086 00097 DVPSAssociationNegotiationResult negotiateAssociation(T_ASC_Network &net); 00098 00103 void handleClient(); 00104 00105 private: 00106 00108 DVPSPrintSCP& operator=(const DVPSPrintSCP&); 00109 00111 DVPSPrintSCP(const DVPSPrintSCP& copy); 00112 00119 int errorCond(OFCondition cond, const char *message); 00120 00129 OFCondition refuseAssociation(OFBool isBadContext); 00130 00133 void dropAssociation(); 00134 00140 OFCondition handleNGet(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID); 00141 00147 OFCondition handleNSet(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID); 00148 00154 OFCondition handleNAction(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID); 00155 00161 OFCondition handleNCreate(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID); 00162 00168 OFCondition handleNDelete(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID); 00169 00175 OFCondition handleCEcho(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID); 00176 00182 void printerNGet(T_DIMSE_Message& rq, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); 00183 00190 void filmSessionNSet(T_DIMSE_Message& rq, DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); 00191 00198 void filmBoxNSet(T_DIMSE_Message& rq, DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); 00199 00206 void imageBoxNSet(T_DIMSE_Message& rq, DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); 00207 00212 void filmSessionNAction(T_DIMSE_Message& rq, T_DIMSE_Message& rsp); 00213 00218 void filmBoxNAction(T_DIMSE_Message& rq, T_DIMSE_Message& rsp); 00219 00225 void filmSessionNCreate(DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); 00226 00232 void filmBoxNCreate(DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); 00233 00239 void presentationLUTNCreate(DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); 00240 00245 void filmSessionNDelete(T_DIMSE_Message& rq, T_DIMSE_Message& rsp); 00246 00251 void filmBoxNDelete(T_DIMSE_Message& rq, T_DIMSE_Message& rsp); 00252 00257 void presentationLUTNDelete(T_DIMSE_Message& rq, T_DIMSE_Message& rsp); 00258 00262 void saveDimseLog(); 00263 00269 static void addLogEntry(DcmSequenceOfItems *seq, const char *text); 00270 00277 void dumpNMessage(T_DIMSE_Message &msg, DcmItem *dataset, OFBool outgoing); 00278 00279 00280 /* class data */ 00281 00282 /* Interface to database and config file 00283 */ 00284 DVInterface& dviface; 00285 00286 /* symbolic name of print SCP in config file, not NULL. 00287 */ 00288 const char *cfgname; 00289 00292 T_DIMSE_BlockingMode blockMode; 00293 00296 int timeout; 00297 00300 DVPSFilmSession *filmSession; 00301 00302 /* Presentation LUT List 00303 */ 00304 DVPSPresentationLUT_PList presentationLUTList; 00305 00306 /* Stored Print List (contains Basic Film Boxes plus hierarchy) 00307 */ 00308 DVPSStoredPrint_PList storedPrintList; 00309 00310 /* the network association over which the print SCP is operating 00311 */ 00312 T_ASC_Association *assoc; 00313 00315 DcmUniqueIdentifier studyInstanceUID; 00316 00318 DcmUniqueIdentifier psSeriesInstanceUID; 00319 00321 DcmUniqueIdentifier imageSeriesInstanceUID; 00322 00324 DcmSequenceOfItems *logSequence; 00325 00327 DcmSequenceOfItems *acseSequence; 00328 00330 OFString logPath; 00331 00334 OFConsole *logstream; 00335 00338 OFBool verboseMode; 00339 00342 OFBool debugMode; 00343 00346 OFBool dumpMode; 00347 00348 }; 00349 00350 #endif 00351 00352 /* 00353 * $Log: dvpsprt.h,v $ 00354 * Revision 1.9 2005/12/08 16:03:58 meichel 00355 * Changed include path schema for all DCMTK header files 00356 * 00357 * Revision 1.8 2004/02/04 15:49:09 joergr 00358 * Removed acknowledgements with e-mail addresses from CVS log. Removed leading 00359 * underscore characters from preprocessor symbols (reserved symbols). 00360 * 00361 * Revision 1.7 2003/09/05 10:38:32 meichel 00362 * Print SCP now supports TLS connections and the Verification Service Class. 00363 * 00364 * Revision 1.6 2002/04/16 14:02:03 joergr 00365 * Added configurable support for C++ ANSI standard includes (e.g. streams). 00366 * 00367 * Revision 1.5 2001/10/12 13:46:52 meichel 00368 * Adapted dcmpstat to OFCondition based dcmnet module (supports strict mode). 00369 * 00370 * Revision 1.4 2001/06/01 15:50:20 meichel 00371 * Updated copyright header 00372 * 00373 * Revision 1.3 2000/06/07 13:17:45 meichel 00374 * added binary and textual log facilities to Print SCP. 00375 * 00376 * Revision 1.2 2000/06/02 16:00:50 meichel 00377 * Adapted all dcmpstat classes to use OFConsole for log and error output 00378 * 00379 * Revision 1.1 2000/05/31 12:56:36 meichel 00380 * Added initial Print SCP support 00381 * 00382 */