annotate OrthancStone/Sources/Oracle/ParseDicomSuccessMessage.h @ 1960:40f8009ceb4e

added compatibility against release 1.10.1 of the DICOMweb plugin
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 27 Oct 2022 17:17:14 +0200
parents 7053b8a0aaec
children 07964689cb0b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
1871
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * This program is free software: you can redistribute it and/or
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
9 * modify it under the terms of the GNU Lesser General Public License
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * as published by the Free Software Foundation, either version 3 of
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * the License, or (at your option) any later version.
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
16 * Lesser General Public License for more details.
1596
4fb8fdf03314 removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
17 *
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
19 * License along with this program. If not, see
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
20 * <http://www.gnu.org/licenses/>.
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #pragma once
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
1471
28c64c246312 working on a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1271
diff changeset
26 #include "../OrthancStone.h"
28c64c246312 working on a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1271
diff changeset
27
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 #if !defined(ORTHANC_ENABLE_DCMTK)
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 # error The macro ORTHANC_ENABLE_DCMTK must be defined
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 #endif
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 #if ORTHANC_ENABLE_DCMTK != 1
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 # error Support for DCMTK must be enabled to use ParseDicomFromFileCommand
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 #endif
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 #include "OracleCommandBase.h"
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 #include "../Messages/IMessageEmitter.h"
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 #include "../Messages/IObserver.h"
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 #include <map>
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 namespace Orthanc
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 {
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 class ParsedDicomFile;
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 }
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 namespace OrthancStone
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 {
1484
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1471
diff changeset
49 class DicomSource;
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1471
diff changeset
50
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 class ParseDicomSuccessMessage : public OriginMessage<OracleCommandBase>
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 {
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 private:
1484
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1471
diff changeset
56 const DicomSource& source_;
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 Orthanc::ParsedDicomFile& dicom_;
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 size_t fileSize_;
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 bool hasPixelData_;
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 public:
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 ParseDicomSuccessMessage(const OracleCommandBase& command,
1484
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1471
diff changeset
63 const DicomSource& source,
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 Orthanc::ParsedDicomFile& dicom,
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 size_t fileSize,
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 bool hasPixelData) :
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 OriginMessage(command),
1484
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1471
diff changeset
68 source_(source),
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 dicom_(dicom),
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 fileSize_(fileSize),
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 hasPixelData_(hasPixelData)
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 {
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 }
1484
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1471
diff changeset
74
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1471
diff changeset
75 const DicomSource& GetSource() const
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1471
diff changeset
76 {
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1471
diff changeset
77 return source_;
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1471
diff changeset
78 }
121d01aa328e SeriesThumbnailsLoader working on raw dicom files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1471
diff changeset
79
1151
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 Orthanc::ParsedDicomFile& GetDicom() const
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 {
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 return dicom_;
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 }
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 size_t GetFileSize() const
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 {
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 return fileSize_;
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 }
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 bool HasPixelData() const
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 {
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 return hasPixelData_;
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 }
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 static Orthanc::ParsedDicomFile* ParseWadoAnswer(size_t& fileSize /* OUT */,
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 const std::string& answer,
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 const std::map<std::string, std::string>& headers);
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 };
48befc2bf66d ParseDicomFromWadoCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 }