Mercurial > hg > orthanc
comparison OrthancServer/ServerToolbox.cpp @ 730:309e686b41e7
better logging about nonexistent tags
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 25 Feb 2014 14:51:19 +0100 |
parents | 2d0a347e8cfc |
children | a811bdf8b8eb |
comparison
equal
deleted
inserted
replaced
729:948720c72586 | 730:309e686b41e7 |
---|---|
33 #include "ServerToolbox.h" | 33 #include "ServerToolbox.h" |
34 | 34 |
35 #include "../Core/OrthancException.h" | 35 #include "../Core/OrthancException.h" |
36 | 36 |
37 #include <cassert> | 37 #include <cassert> |
38 #include <glog/logging.h> | |
38 | 39 |
39 namespace Orthanc | 40 namespace Orthanc |
40 { | 41 { |
41 void SimplifyTags(Json::Value& target, | 42 void SimplifyTags(Json::Value& target, |
42 const Json::Value& source) | 43 const Json::Value& source) |
80 { | 81 { |
81 assert(0); | 82 assert(0); |
82 } | 83 } |
83 } | 84 } |
84 } | 85 } |
86 | |
87 | |
88 void LogMissingRequiredTag(const DicomMap& summary) | |
89 { | |
90 std::string s, t; | |
91 | |
92 if (summary.HasTag(DICOM_TAG_PATIENT_ID)) | |
93 { | |
94 if (t.size() > 0) | |
95 t += ", "; | |
96 t += "PatientID=" + summary.GetValue(DICOM_TAG_PATIENT_ID).AsString(); | |
97 } | |
98 else | |
99 { | |
100 if (s.size() > 0) | |
101 s += ", "; | |
102 s += "PatientID"; | |
103 } | |
104 | |
105 if (summary.HasTag(DICOM_TAG_STUDY_INSTANCE_UID)) | |
106 { | |
107 if (t.size() > 0) | |
108 t += ", "; | |
109 t += "StudyInstanceUID=" + summary.GetValue(DICOM_TAG_STUDY_INSTANCE_UID).AsString(); | |
110 } | |
111 else | |
112 { | |
113 if (s.size() > 0) | |
114 s += ", "; | |
115 s += "StudyInstanceUID"; | |
116 } | |
117 | |
118 if (summary.HasTag(DICOM_TAG_SERIES_INSTANCE_UID)) | |
119 { | |
120 if (t.size() > 0) | |
121 t += ", "; | |
122 t += "SeriesInstanceUID=" + summary.GetValue(DICOM_TAG_SERIES_INSTANCE_UID).AsString(); | |
123 } | |
124 else | |
125 { | |
126 if (s.size() > 0) | |
127 s += ", "; | |
128 s += "SeriesInstanceUID"; | |
129 } | |
130 | |
131 if (summary.HasTag(DICOM_TAG_SOP_INSTANCE_UID)) | |
132 { | |
133 if (t.size() > 0) | |
134 t += ", "; | |
135 t += "SOPInstanceUID=" + summary.GetValue(DICOM_TAG_SOP_INSTANCE_UID).AsString(); | |
136 } | |
137 else | |
138 { | |
139 if (s.size() > 0) | |
140 s += ", "; | |
141 s += "SOPInstanceUID"; | |
142 } | |
143 | |
144 if (t.size() == 0) | |
145 { | |
146 LOG(ERROR) << "Store has failed because all the required tags (" << s << ") are missing (is it a DICOMDIR file?)"; | |
147 } | |
148 else | |
149 { | |
150 LOG(ERROR) << "Store has failed because required tags (" << s << ") are missing for the following instance: " << t; | |
151 } | |
152 } | |
85 } | 153 } |