annotate OrthancFramework/Sources/JobsEngine/SetOfInstancesJob.h @ 5657:dedbf019a707

Improved parsing of multiple numerical values in DICOM tags
author Alain Mazy <am@orthanc.team>
date Thu, 06 Jun 2024 17:55:13 +0200
parents f7adfb22e20e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2585
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
5640
f7adfb22e20e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5485
diff changeset
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
f7adfb22e20e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5485
diff changeset
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
5485
48b8dae6dc77 upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5185
diff changeset
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
2585
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 *
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * This program is free software: you can redistribute it and/or
4119
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
10 * modify it under the terms of the GNU Lesser General Public License
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
11 * as published by the Free Software Foundation, either version 3 of
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
12 * the License, or (at your option) any later version.
2585
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 *
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful, but
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4119
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
17 * Lesser General Public License for more details.
2585
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 *
4119
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
19 * You should have received a copy of the GNU Lesser General Public
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
20 * License along with this program. If not, see
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
21 * <http://www.gnu.org/licenses/>.
2585
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 **/
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #pragma once
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 #include "IJob.h"
2860
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
28 #include "SetOfCommandsJob.h"
2585
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 #include <set>
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 namespace Orthanc
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 {
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
34 class ORTHANC_PUBLIC SetOfInstancesJob : public SetOfCommandsJob
2585
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 {
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 private:
2860
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
37 class InstanceCommand;
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
38 class TrailingStepCommand;
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
39 class InstanceUnserializer;
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
40
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
41 bool hasTrailingStep_;
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
42 std::set<std::string> failedInstances_;
3374
d0d6bd633e4c Reporting of "ParentResources" in "DicomModalityStore" and "DicomModalityStore" jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
43 std::set<std::string> parentResources_;
2585
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 protected:
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 virtual bool HandleInstance(const std::string& instance) = 0;
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
2842
ff0ed5ea9e4e trailing step in SetOfInstancesJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2812
diff changeset
48 virtual bool HandleTrailingStep() = 0;
ff0ed5ea9e4e trailing step in SetOfInstancesJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2812
diff changeset
49
2860
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
50 // Hiding this method, use AddInstance() instead
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
51 using SetOfCommandsJob::AddCommand;
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
52
2585
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 public:
2860
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
54 SetOfInstancesJob();
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
55
4202
2007ab69ac16 moving ORTHANC_FORCE_INLINE and ORTHANC_OVERRIDE from Enumerations.h to Compatibility.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4119
diff changeset
56 explicit SetOfInstancesJob(const Json::Value& source); // Unserialization
2860
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
57
3374
d0d6bd633e4c Reporting of "ParentResources" in "DicomModalityStore" and "DicomModalityStore" jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
58 // Only used for reporting in the public content
d0d6bd633e4c Reporting of "ParentResources" in "DicomModalityStore" and "DicomModalityStore" jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
59 // https://groups.google.com/d/msg/orthanc-users/9GCV88GLEzw/6wAgP_PRAgAJ
4304
50b0c69b653a continued abi
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4202
diff changeset
60 void AddParentResource(const std::string& resource);
3374
d0d6bd633e4c Reporting of "ParentResources" in "DicomModalityStore" and "DicomModalityStore" jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
61
2860
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
62 void AddInstance(const std::string& instance);
2585
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63
2860
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
64 void AddTrailingStep();
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
65
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
66 size_t GetInstancesCount() const;
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
67
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
68 const std::string& GetInstance(size_t index) const;
2652
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2648
diff changeset
69
4304
50b0c69b653a continued abi
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4202
diff changeset
70 bool HasTrailingStep() const;
2657
5eea2f11e8df JobsSerialization.GenericJobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2652
diff changeset
71
4304
50b0c69b653a continued abi
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4202
diff changeset
72 const std::set<std::string>& GetFailedInstances() const;
2657
5eea2f11e8df JobsSerialization.GenericJobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2652
diff changeset
73
4304
50b0c69b653a continued abi
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4202
diff changeset
74 bool IsFailedInstance(const std::string& instance) const;
2860
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
75
4202
2007ab69ac16 moving ORTHANC_FORCE_INLINE and ORTHANC_OVERRIDE from Enumerations.h to Compatibility.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4119
diff changeset
76 virtual void Start() ORTHANC_OVERRIDE;
2860
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
77
4202
2007ab69ac16 moving ORTHANC_FORCE_INLINE and ORTHANC_OVERRIDE from Enumerations.h to Compatibility.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4119
diff changeset
78 virtual void Reset() ORTHANC_OVERRIDE;
2860
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
79
4202
2007ab69ac16 moving ORTHANC_FORCE_INLINE and ORTHANC_OVERRIDE from Enumerations.h to Compatibility.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4119
diff changeset
80 virtual void GetPublicContent(Json::Value& target) ORTHANC_OVERRIDE;
2860
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2842
diff changeset
81
4202
2007ab69ac16 moving ORTHANC_FORCE_INLINE and ORTHANC_OVERRIDE from Enumerations.h to Compatibility.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4119
diff changeset
82 virtual bool Serialize(Json::Value& target) ORTHANC_OVERRIDE;
2585
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 };
4c809711149e reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 }