00001 /* 00002 * 00003 * Copyright (C) 2000-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: dcmpstat 00015 * 00016 * Author: Marco Eichelberg 00017 * 00018 * Purpose: 00019 * classes: DVPSPrintSCP 00020 * 00021 * Last Update: $Author: joergr $ 00022 * Update Date: $Date: 2010-10-14 13:16:36 $ 00023 * CVS/RCS Revision: $Revision: 1.12 $ 00024 * Status: $State: Exp $ 00025 * 00026 * CVS/RCS Log at end of file 00027 * 00028 */ 00029 00030 00031 #ifndef DVPSPRT_H 00032 #define DVPSPRT_H 00033 00034 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00035 00036 #include "dcmtk/ofstd/ofstream.h" 00037 #include "dcmtk/ofstd/ofstring.h" 00038 #include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ 00039 #include "dcmtk/dcmpstat/dvpspll.h" /* for class DVPSPresentationLUT_PList */ 00040 #include "dcmtk/dcmpstat/dvpsspl.h" /* for class DVPSStoredPrint_PList */ 00041 #include "dcmtk/dcmnet/assoc.h" 00042 #include "dcmtk/dcmnet/dimse.h" 00043 00044 class DVInterface; 00045 class DVPSFilmSession; 00046 00051 class DVPSPrintSCP 00052 { 00053 public: 00054 00059 DVPSPrintSCP(DVInterface &iface, const char *cfname); 00060 00062 virtual ~DVPSPrintSCP(); 00063 00071 void setDimseLogPath(const char *fname); 00072 00083 DVPSAssociationNegotiationResult negotiateAssociation(T_ASC_Network &net); 00084 00089 void handleClient(); 00090 00091 private: 00092 00094 DVPSPrintSCP& operator=(const DVPSPrintSCP&); 00095 00097 DVPSPrintSCP(const DVPSPrintSCP& copy); 00098 00105 int errorCond(OFCondition cond, const char *message); 00106 00115 OFCondition refuseAssociation(OFBool isBadContext); 00116 00119 void dropAssociation(); 00120 00126 OFCondition handleNGet(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID); 00127 00133 OFCondition handleNSet(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID); 00134 00140 OFCondition handleNAction(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID); 00141 00147 OFCondition handleNCreate(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID); 00148 00154 OFCondition handleNDelete(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID); 00155 00161 OFCondition handleCEcho(T_DIMSE_Message& rq, T_ASC_PresentationContextID presID); 00162 00168 void printerNGet(T_DIMSE_Message& rq, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); 00169 00176 void filmSessionNSet(T_DIMSE_Message& rq, DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); 00177 00184 void filmBoxNSet(T_DIMSE_Message& rq, DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); 00185 00192 void imageBoxNSet(T_DIMSE_Message& rq, DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); 00193 00198 void filmSessionNAction(T_DIMSE_Message& rq, T_DIMSE_Message& rsp); 00199 00204 void filmBoxNAction(T_DIMSE_Message& rq, T_DIMSE_Message& rsp); 00205 00211 void filmSessionNCreate(DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); 00212 00218 void filmBoxNCreate(DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); 00219 00225 void presentationLUTNCreate(DcmDataset *rqDataset, T_DIMSE_Message& rsp, DcmDataset *& rspDataset); 00226 00231 void filmSessionNDelete(T_DIMSE_Message& rq, T_DIMSE_Message& rsp); 00232 00237 void filmBoxNDelete(T_DIMSE_Message& rq, T_DIMSE_Message& rsp); 00238 00243 void presentationLUTNDelete(T_DIMSE_Message& rq, T_DIMSE_Message& rsp); 00244 00248 void saveDimseLog(); 00249 00255 static void addLogEntry(DcmSequenceOfItems *seq, const char *text); 00256 00263 void dumpNMessage(T_DIMSE_Message &msg, DcmItem *dataset, OFBool outgoing); 00264 00265 00266 /* class data */ 00267 00268 /* Interface to database and config file 00269 */ 00270 DVInterface& dviface; 00271 00272 /* symbolic name of print SCP in config file, not NULL. 00273 */ 00274 const char *cfgname; 00275 00278 T_DIMSE_BlockingMode blockMode; 00279 00282 int timeout; 00283 00286 DVPSFilmSession *filmSession; 00287 00288 /* Presentation LUT List 00289 */ 00290 DVPSPresentationLUT_PList presentationLUTList; 00291 00292 /* Stored Print List (contains Basic Film Boxes plus hierarchy) 00293 */ 00294 DVPSStoredPrint_PList storedPrintList; 00295 00296 /* the network association over which the print SCP is operating 00297 */ 00298 T_ASC_Association *assoc; 00299 00301 DcmUniqueIdentifier studyInstanceUID; 00302 00304 DcmUniqueIdentifier psSeriesInstanceUID; 00305 00307 DcmUniqueIdentifier imageSeriesInstanceUID; 00308 00310 DcmSequenceOfItems *logSequence; 00311 00313 DcmSequenceOfItems *acseSequence; 00314 00316 OFString logPath; 00317 00318 }; 00319 00320 #endif 00321 00322 /* 00323 * $Log: dvpsprt.h,v $ 00324 * Revision 1.12 2010-10-14 13:16:36 joergr 00325 * Updated copyright header. Added reference to COPYRIGHT file. 00326 * 00327 * Revision 1.11 2009-11-24 14:12:57 uli 00328 * Switched to logging mechanism provided by the "new" oflog module. 00329 * 00330 * Revision 1.10 2009-09-30 10:42:38 uli 00331 * Make dcmpstat's include headers self-sufficient by including all 00332 * needed headers directly and stop using dctk.h 00333 * 00334 * Revision 1.9 2005-12-08 16:03:58 meichel 00335 * Changed include path schema for all DCMTK header files 00336 * 00337 * Revision 1.8 2004/02/04 15:49:09 joergr 00338 * Removed acknowledgements with e-mail addresses from CVS log. Removed leading 00339 * underscore characters from preprocessor symbols (reserved symbols). 00340 * 00341 * Revision 1.7 2003/09/05 10:38:32 meichel 00342 * Print SCP now supports TLS connections and the Verification Service Class. 00343 * 00344 * Revision 1.6 2002/04/16 14:02:03 joergr 00345 * Added configurable support for C++ ANSI standard includes (e.g. streams). 00346 * 00347 * Revision 1.5 2001/10/12 13:46:52 meichel 00348 * Adapted dcmpstat to OFCondition based dcmnet module (supports strict mode). 00349 * 00350 * Revision 1.4 2001/06/01 15:50:20 meichel 00351 * Updated copyright header 00352 * 00353 * Revision 1.3 2000/06/07 13:17:45 meichel 00354 * added binary and textual log facilities to Print SCP. 00355 * 00356 * Revision 1.2 2000/06/02 16:00:50 meichel 00357 * Adapted all dcmpstat classes to use OFConsole for log and error output 00358 * 00359 * Revision 1.1 2000/05/31 12:56:36 meichel 00360 * Added initial Print SCP support 00361 * 00362 */