Mercurial > hg > orthanc
comparison OrthancServer/ServerJobs/SplitStudyJob.h @ 2845:218e2c864d1d
serialization of SplitStudyJob
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 28 Sep 2018 17:59:44 +0200 |
parents | 99863d6245b2 |
children | d386abc18133 |
comparison
equal
deleted
inserted
replaced
2844:99863d6245b2 | 2845:218e2c864d1d |
---|---|
42 class SplitStudyJob : public SetOfInstancesJob | 42 class SplitStudyJob : public SetOfInstancesJob |
43 { | 43 { |
44 private: | 44 private: |
45 typedef std::map<std::string, std::string> SeriesUidMap; | 45 typedef std::map<std::string, std::string> SeriesUidMap; |
46 typedef std::map<DicomTag, std::string> Replacements; | 46 typedef std::map<DicomTag, std::string> Replacements; |
47 typedef std::set<DicomTag> Removals; | |
48 | 47 |
49 | 48 |
50 ServerContext& context_; | 49 ServerContext& context_; |
50 bool keepSource_; | |
51 std::string sourceStudy_; | 51 std::string sourceStudy_; |
52 std::set<std::string> sourceSeries_; | 52 std::set<std::string> sourceSeries_; |
53 bool keepSource_; | |
54 std::string targetStudy_; | 53 std::string targetStudy_; |
55 std::string targetStudyUid_; | 54 std::string targetStudyUid_; |
56 SeriesUidMap targetSeries_; | 55 SeriesUidMap targetSeries_; |
57 std::set<DicomTag> allowedTags_; | 56 std::set<DicomTag> allowedTags_; |
58 DicomInstanceOrigin origin_; | 57 DicomInstanceOrigin origin_; |
59 Replacements replacements_; | 58 Replacements replacements_; |
60 Removals removals_; | 59 std::set<DicomTag> removals_; |
61 | 60 |
62 void CheckAllowedTag(const DicomTag& tag) const; | 61 void CheckAllowedTag(const DicomTag& tag) const; |
63 | 62 |
64 void Setup(const std::string& sourceStudy); | 63 void Setup(); |
65 | 64 |
66 protected: | 65 protected: |
67 virtual bool HandleInstance(const std::string& instance); | 66 virtual bool HandleInstance(const std::string& instance); |
68 | 67 |
69 virtual bool HandleTrailingStep(); | 68 virtual bool HandleTrailingStep(); |
73 const std::string& sourceStudy); | 72 const std::string& sourceStudy); |
74 | 73 |
75 SplitStudyJob(ServerContext& context, | 74 SplitStudyJob(ServerContext& context, |
76 const Json::Value& serialized); | 75 const Json::Value& serialized); |
77 | 76 |
78 void SetOrigin(const DicomInstanceOrigin& origin); | 77 const std::string& GetSourceStudy() const |
79 | 78 { |
80 void SetOrigin(const RestApiCall& call); | 79 return sourceStudy_; |
80 } | |
81 | 81 |
82 void AddSourceSeries(const std::string& series); | 82 void AddSourceSeries(const std::string& series); |
83 | 83 |
84 bool IsKeepSource() const | 84 bool IsKeepSource() const |
85 { | 85 { |
86 return keepSource_; | 86 return keepSource_; |
87 } | 87 } |
88 | 88 |
89 void SetKeepSource(bool keep); | 89 void SetKeepSource(bool keep); |
90 | 90 |
91 void Remove(const DicomTag& tag); | |
92 | |
93 void Replace(const DicomTag& tag, | 91 void Replace(const DicomTag& tag, |
94 const std::string& value); | 92 const std::string& value); |
95 | 93 |
94 void Remove(const DicomTag& tag); | |
95 | |
96 void SetOrigin(const DicomInstanceOrigin& origin); | |
97 | |
98 void SetOrigin(const RestApiCall& call); | |
99 | |
100 const DicomInstanceOrigin& GetOrigin() const | |
101 { | |
102 return origin_; | |
103 } | |
104 | |
96 virtual void Stop(JobStopReason reason) | 105 virtual void Stop(JobStopReason reason) |
97 { | 106 { |
98 } | 107 } |
99 | 108 |
100 virtual void GetJobType(std::string& target) | 109 virtual void GetJobType(std::string& target) |
101 { | 110 { |
102 target = "SplitStudyJob"; | 111 target = "SplitStudy"; |
103 } | 112 } |
104 | 113 |
105 virtual void GetPublicContent(Json::Value& value); | 114 virtual void GetPublicContent(Json::Value& value); |
106 | 115 |
107 virtual bool Serialize(Json::Value& target); | 116 virtual bool Serialize(Json::Value& target); |