~ubuntu-branches/ubuntu/raring/ginkgocadx/raring-proposed

« back to all changes in this revision

Viewing changes to src/cadxcore/main/controllers/dcmtk/dicomcustomassociation.h

  • Committer: Package Import Robot
  • Author(s): Andreas Tille
  • Date: 2012-05-19 11:37:14 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20120519113714-13jwx5svm7d4fnsq
Tags: 2.12.0.4889-1
* New upstream version
* debian/control: Standards-Version: 3.9.3 (no changes needed)
* debhelper 9 (control+compat)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  
 
3
 *  $Id: dicomcustomassociation.h 4848 2012-04-18 09:43:41Z carlos $
 
4
 *  Ginkgo CADx Project
 
5
 *
 
6
 *  Copyright 2008-10 MetaEmotion S.L. All rights reserved.
 
7
 *  http://ginkgo-cadx.com
 
8
 *
 
9
 *  This file is licensed under LGPL v3 license.
 
10
 *  See License.txt for details
 
11
 *
 
12
 */
 
13
#pragma once
 
14
#include <string>
 
15
#include <vector>
 
16
#include <list>
 
17
#include "dicomassociation.h"
 
18
 
 
19
#include <api/dicom/imodelodicom.h>
 
20
#include <main/controllers/dcmtk/dicomservers.h>
 
21
#include <main/controllers/dcmtk/dicomnetwork.h>
 
22
#include <api/controllers/ipacscontroller.h>
 
23
 
 
24
#include <dcmtk/ofstd/ofstream.h>
 
25
#include <dcmtk/ofstd/ofstring.h>      /* for class OFString */
 
26
 
 
27
class DicomImage;
 
28
 
 
29
 
 
30
class CustomEventHandler
 
31
{
 
32
public:
 
33
 
 
34
  /// destructor
 
35
  virtual ~CustomEventHandler() {}
 
36
 
 
37
  /** handles an N-EVENT-REPORT-RQ message. This method is called
 
38
   *  from CustomAssociation whenever an event report is received.
 
39
   *  The event message, information and status detail elements must be copied
 
40
   *  if they should remain valid after the end of this method call.
 
41
   *  The event handler can react on the event message in any implementation
 
42
   *  dependent way, e.g. display the event on-screen.
 
43
   *  @param eventMessage the N-EVENT-REPORT-RQ message
 
44
   *  @param eventInformation event information dataset. May be NULL if no event information available.
 
45
   *  @param statusDetail status detail dataset. ay be NULL if no status detail available.
 
46
   *  @return the status code to be sent back as part of the N-EVENT-REPORT-RSP message, usually STATUS_Success.
 
47
   */
 
48
  virtual DIC_US handleEvent(
 
49
    T_DIMSE_N_EventReportRQ& eventMessage,
 
50
    DcmDataset *eventInformation,
 
51
    DcmDataset *statusDetail)=0;
 
52
};
 
53
 
 
54
class CustomAssociation : public Association, public GIL::DICOM::ICustomAssociation {
 
55
public:
 
56
        
 
57
        /**
 
58
         Constructors
 
59
         */
 
60
        CustomAssociation(void* connectionKey, const std::string& ambitolog, GNC::IProxyNotificadorProgreso* pNotificadorProgreso = NULL);
 
61
        
 
62
        virtual ~CustomAssociation();
 
63
 
 
64
        virtual bool Connect(const std::string& serverId, const std::string& local_aet);
 
65
        
 
66
        virtual bool createRQ( const std::string& sopclassUID, const std::string& sopinstanceUID, const GIL::DICOM::TipoJerarquia& attributeListIn,  int& status, GnkPtr<GIL::DICOM::TipoJerarquia>& attributeListOut);
 
67
        virtual bool setRQ(    const std::string& sopclassUID, const std::string& sopinstanceUID, const GIL::DICOM::TipoJerarquia& modificationList, int& status, GnkPtr<GIL::DICOM::TipoJerarquia>& attributeListOut);
 
68
        virtual bool getRQ(    const std::string& sopclassUID, const std::string& sopinstanceUID, const int *attributeIdentifierList, unsigned long numShorts, int& status,  GnkPtr<GIL::DICOM::TipoJerarquia>& attributeListOut);
 
69
        virtual bool actionRQ( const std::string& sopclassUID, const std::string& sopinstanceUID, int actionTypeID, const GIL::DICOM::TipoJerarquia& actionInformation, int& status,  GnkPtr<GIL::DICOM::TipoJerarquia>& attributeListOut);
 
70
        virtual bool deleteRQ( const std::string& sopclassUID, const std::string& sopinstanceUID, int& status);
 
71
 
 
72
        virtual bool releaseAssociation();
 
73
        virtual bool abortAssociation();
 
74
 
 
75
 
 
76
        void dumpNMessage(T_DIMSE_Message &msg, DcmItem *dataset, OFBool outgoing);
 
77
        OFCondition sendNRequest( T_ASC_PresentationContextID presId, T_DIMSE_Message &request, DcmDataset *rqDataSet, T_DIMSE_Message &response, DcmDataset* &statusDetail, DcmDataset* &rspDataset);
 
78
        T_ASC_PresentationContextID findAcceptedPC(const char *sopclassuid);
 
79
 
 
80
 
 
81
        /*
 
82
 
 
83
        CONDITION Connect(DicomServer* server, const std::string& local_aet);
 
84
        OFCondition createRQ(const char *sopclassUID, OFString& sopinstanceUID, DcmDataset *attributeListIn, Uint16& status, DcmDataset* &attributeListOut);
 
85
        OFCondition setRQ( const char *sopclassUID, const char *sopinstanceUID, DcmDataset *modificationList, Uint16& status, DcmDataset* &attributeListOut);
 
86
        OFCondition getRQ( const char *sopclassUID,  const char *sopinstanceUID,  const Uint16 *attributeIdentifierList, ssize_t numShorts, Uint16& status,  DcmDataset* &attributeListOut);
 
87
        OFCondition actionRQ( const char *sopclassUID,  const char *sopinstanceUID,  Uint16 actionTypeID,  DcmDataset *actionInformation, Uint16& status,  DcmDataset* &actionReply);
 
88
        OFCondition deleteRQ( const char *sopclassUID,  const char *sopinstanceUID,  Uint16& status);
 
89
        OFCondition releaseAssociation();
 
90
        OFCondition abortAssociation();
 
91
        
 
92
 
 
93
        void addPresentationContext(const std::string& sopClass, const std::list<std::string>& transferSyntaxes);
 
94
        */
 
95
 
 
96
private:
 
97
 
 
98
        void Gnk2Dcmtk(const GIL::DICOM::TipoJerarquia& base, DcmDataset* query);
 
99
        
 
100
private:
 
101
        GIL::DICOM::DCMTK::Network* Net;
 
102
        std::string                 ambitolog;
 
103
 
 
104
protected:
 
105
        GNC::IProxyNotificadorProgreso* m_pNotificadorProgreso;
 
106
        
 
107
        virtual void OnAddPresentationContext(T_ASC_Parameters* params);
 
108
        
 
109
        T_ASC_PresentationContextID presId;
 
110
 
 
111
private:
 
112
        
 
113
        T_DIMSE_BlockingMode blockMode;
 
114
        
 
115
        /// the current event handler. Can be NULL.
 
116
        CustomEventHandler *eventHandler;
 
117
};