fw4spl
ioDicomWeb/include/ioDicomWeb/SSeriesPuller.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2018.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #pragma once
8 
9 #include "ioDicomWeb/config.hpp"
10 
11 #include <fwIO/IReader.hpp>
12 
13 #include <fwMedData/SeriesDB.hpp>
14 
15 #include <fwNetworkIO/http/ClientQt.hpp>
16 
17 #include <fwServices/IController.hpp>
18 
19 #include <boost/filesystem/path.hpp>
20 
21 namespace fwMedData
22 {
23 class DicomSeries;
24 }
25 
26 namespace ioDicomWeb
27 {
28 
56 class IODICOMWEB_CLASS_API SSeriesPuller : public ::fwServices::IController
57 {
58 public:
59 
61 
62  typedef ::fwMedData::SeriesDB::ContainerType DicomSeriesContainerType;
63  typedef std::vector< std::string > InstanceUIDContainerType;
64  typedef std::map < std::string, unsigned int > InstanceCountMapType;
65  typedef std::map < std::string, WPTR(::fwMedData::DicomSeries) > DicomSeriesMapType;
66 
70  IODICOMWEB_API SSeriesPuller() noexcept;
71 
75  IODICOMWEB_API virtual ~SSeriesPuller() noexcept;
76 
77 protected:
78 
80  IODICOMWEB_API virtual void configuring() override;
81 
83  IODICOMWEB_API virtual void starting() override;
84 
86  IODICOMWEB_API virtual void stopping() override;
87 
89  IODICOMWEB_API void updating() override;
90 
91 private:
92 
94  void pullSeries();
95 
100  void readLocalSeries(DicomSeriesContainerType selectedSeries);
101 
106  void displayErrorMessage(const std::string& message) const;
107 
109  ::fwNetworkIO::http::ClientQt m_clientQt;
110 
112  ::fwIO::IReader::sptr m_dicomReader;
113 
115  std::string m_dicomReaderSrvConfig;
116 
118  std::string m_dicomReaderType;
119 
121  ::fwMedData::SeriesDB::sptr m_tempSeriesDB;
122 
124  ::fwMedData::SeriesDB::sptr m_destinationSeriesDB;
125 
127  InstanceUIDContainerType m_localSeries;
128 
130  bool m_isPulling;
131 
133  unsigned int m_seriesIndex;
134 
136  size_t m_instanceCount;
137 
139  DicomSeriesMapType m_pullingDicomSeriesMap;
140 
142  std::string getPreferenceKey(const std::string& key) const;
143 
145  std::string m_serverHostnameKey;
146 
148  std::string m_serverPortKey;
149 
151  std::string m_serverHostname;
152 
154  int m_serverPort;
155 
157  ::boost::filesystem::path m_path;
158 
159 };
160 
161 } // namespace ioDicomWeb
Namespace containing medical data.
This service is used to pull series from a PACS (Orthanc).
STL namespace.
The namespace fwNetworkIO contains the primary methods to access network.
This interface defines control service API. Does nothing particularly, can be considered as a default...
Definition: IController.hpp:23
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
ioDicomWeb contains services use to deal with PACS through HTTP.
The namespace fwIO contains the base interface for reader and writer services.
Definition: ioTypes.hpp:16