comparison OrthancServer/OrthancRestApi/OrthancRestResources.cpp @ 2120:4b02ec79728a

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 07 Nov 2016 11:19:19 +0100
parents 50b9bc19dc62
children 2ecc95a239f7
comparison
equal deleted inserted replaced
2119:e0517f25919e 2120:4b02ec79728a
207 { 207 {
208 Json::Value full; 208 Json::Value full;
209 context.ReadJson(full, publicId); 209 context.ReadJson(full, publicId);
210 210
211 Json::Value simplified; 211 Json::Value simplified;
212 Toolbox::SimplifyTags(simplified, full, DicomToJsonFormat_Human); 212 ServerToolbox::SimplifyTags(simplified, full, DicomToJsonFormat_Human);
213 call.GetOutput().AnswerJson(simplified); 213 call.GetOutput().AnswerJson(simplified);
214 } 214 }
215 else 215 else
216 { 216 {
217 context.AnswerAttachment(call.GetOutput(), publicId, FileContentType_DicomAsJson); 217 context.AnswerAttachment(call.GetOutput(), publicId, FileContentType_DicomAsJson);
935 { 935 {
936 // Success: Send the value of the shared tags 936 // Success: Send the value of the shared tags
937 if (simplify) 937 if (simplify)
938 { 938 {
939 Json::Value simplified; 939 Json::Value simplified;
940 Toolbox::SimplifyTags(simplified, sharedTags, DicomToJsonFormat_Human); 940 ServerToolbox::SimplifyTags(simplified, sharedTags, DicomToJsonFormat_Human);
941 call.GetOutput().AnswerJson(simplified); 941 call.GetOutput().AnswerJson(simplified);
942 } 942 }
943 else 943 else
944 { 944 {
945 call.GetOutput().AnswerJson(sharedTags); 945 call.GetOutput().AnswerJson(sharedTags);
1002 } 1002 }
1003 1003
1004 if (simplify) 1004 if (simplify)
1005 { 1005 {
1006 Json::Value simplified; 1006 Json::Value simplified;
1007 Toolbox::SimplifyTags(simplified, result, DicomToJsonFormat_Human); 1007 ServerToolbox::SimplifyTags(simplified, result, DicomToJsonFormat_Human);
1008 call.GetOutput().AnswerJson(simplified); 1008 call.GetOutput().AnswerJson(simplified);
1009 } 1009 }
1010 else 1010 else
1011 { 1011 {
1012 call.GetOutput().AnswerJson(result); 1012 call.GetOutput().AnswerJson(result);
1208 context.ReadJson(full, *it); 1208 context.ReadJson(full, *it);
1209 1209
1210 if (simplify) 1210 if (simplify)
1211 { 1211 {
1212 Json::Value simplified; 1212 Json::Value simplified;
1213 Toolbox::SimplifyTags(simplified, full, DicomToJsonFormat_Human); 1213 ServerToolbox::SimplifyTags(simplified, full, DicomToJsonFormat_Human);
1214 result[*it] = simplified; 1214 result[*it] = simplified;
1215 } 1215 }
1216 else 1216 else
1217 { 1217 {
1218 result[*it] = full; 1218 result[*it] = full;
1305 dicom.HeaderToJson(header, DicomToJsonFormat_Full); 1305 dicom.HeaderToJson(header, DicomToJsonFormat_Full);
1306 1306
1307 if (simplify) 1307 if (simplify)
1308 { 1308 {
1309 Json::Value simplified; 1309 Json::Value simplified;
1310 Toolbox::SimplifyTags(simplified, header, DicomToJsonFormat_Human); 1310 ServerToolbox::SimplifyTags(simplified, header, DicomToJsonFormat_Human);
1311 call.GetOutput().AnswerJson(simplified); 1311 call.GetOutput().AnswerJson(simplified);
1312 } 1312 }
1313 else 1313 else
1314 { 1314 {
1315 call.GetOutput().AnswerJson(header); 1315 call.GetOutput().AnswerJson(header);