comparison OrthancServer/OrthancRestApi.cpp @ 313:60429bb2551e

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 21 Dec 2012 13:44:38 +0100
parents 1642a354fec8
children 4f17834a50b6
comparison
equal deleted inserted replaced
312:1642a354fec8 313:60429bb2551e
1106 1106
1107 if (ParseModifyRequest(removals, replacements, removePrivateTags, call)) 1107 if (ParseModifyRequest(removals, replacements, removePrivateTags, call))
1108 { 1108 {
1109 std::auto_ptr<ParsedDicomFile> modified(dicom.Clone()); 1109 std::auto_ptr<ParsedDicomFile> modified(dicom.Clone());
1110 ReplaceInstanceInternal(*modified, removals, replacements, DicomReplaceMode_InsertIfAbsent, removePrivateTags); 1110 ReplaceInstanceInternal(*modified, removals, replacements, DicomReplaceMode_InsertIfAbsent, removePrivateTags);
1111 context.GetIndex().SetMetadata(id, MetadataType_ModifiedFrom, id);
1112 modified->Answer(call.GetOutput()); 1111 modified->Answer(call.GetOutput());
1113 } 1112 }
1114 } 1113 }
1115 1114
1116 1115
1140 FromDcmtkBridge::GenerateUniqueIdentifier(DicomRootLevel_Patient))); 1139 FromDcmtkBridge::GenerateUniqueIdentifier(DicomRootLevel_Patient)));
1141 } 1140 }
1142 1141
1143 std::auto_ptr<ParsedDicomFile> anonymized(dicom.Clone()); 1142 std::auto_ptr<ParsedDicomFile> anonymized(dicom.Clone());
1144 ReplaceInstanceInternal(*anonymized, removals, replacements, DicomReplaceMode_InsertIfAbsent, removePrivateTags); 1143 ReplaceInstanceInternal(*anonymized, removals, replacements, DicomReplaceMode_InsertIfAbsent, removePrivateTags);
1145 context.GetIndex().SetMetadata(id, MetadataType_AnonymizedFrom, id);
1146
1147 anonymized->Answer(call.GetOutput()); 1144 anonymized->Answer(call.GetOutput());
1148 } 1145 }
1149 } 1146 }
1150 1147
1151 1148
1190 if (newSeriesId.size() == 0 && 1187 if (newSeriesId.size() == 0 &&
1191 !context.GetIndex().LookupParent(newSeriesId, modifiedInstance)) 1188 !context.GetIndex().LookupParent(newSeriesId, modifiedInstance))
1192 { 1189 {
1193 throw OrthancException(ErrorCode_InternalError); 1190 throw OrthancException(ErrorCode_InternalError);
1194 } 1191 }
1192
1193 // TODO for the instances and the series:
1194 // context.GetIndex().SetMetadata(id, MetadataType_ModifiedFrom, id);
1195 } 1195 }
1196 1196
1197 assert(newSeriesId.size() != 0); 1197 assert(newSeriesId.size() != 0);
1198 Json::Value result = Json::objectValue; 1198 Json::Value result = Json::objectValue;
1199 result["ID"] = newSeriesId; 1199 result["ID"] = newSeriesId;
1263 return; 1263 return;
1264 } 1264 }
1265 1265
1266 if (newStudyId.size() == 0) 1266 if (newStudyId.size() == 0)
1267 { 1267 {
1268 // TODO FOR instances, studies and series:
1269 // context.GetIndex().SetMetadata(id, MetadataType_ModifiedFrom, id);
1270
1268 std::string newSeriesId; 1271 std::string newSeriesId;
1269 if (!context.GetIndex().LookupParent(newSeriesId, modifiedInstance) || 1272 if (!context.GetIndex().LookupParent(newSeriesId, modifiedInstance) ||
1270 !context.GetIndex().LookupParent(newStudyId, newSeriesId)) 1273 !context.GetIndex().LookupParent(newStudyId, newSeriesId))
1271 { 1274 {
1272 throw OrthancException(ErrorCode_InternalError); 1275 throw OrthancException(ErrorCode_InternalError);