comparison OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp @ 2521:6db878376018

support anonymization of CurrentRequestedProcedureEvidenceSequence
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 09 Apr 2018 17:59:16 +0200
parents 2e6b7862ccf2
children 75a404e40323
comparison
equal deleted inserted replaced
2520:b94ed97508e6 2521:6db878376018
102 { 102 {
103 std::string id = call.GetUriComponent("id", ""); 103 std::string id = call.GetUriComponent("id", "");
104 104
105 ServerContext::DicomCacheLocker locker(OrthancRestApi::GetContext(call), id); 105 ServerContext::DicomCacheLocker locker(OrthancRestApi::GetContext(call), id);
106 106
107 std::auto_ptr<ParsedDicomFile> modified(locker.GetDicom().Clone()); 107 std::auto_ptr<ParsedDicomFile> modified(locker.GetDicom().Clone(true));
108 modification.Apply(*modified); 108 modification.Apply(*modified);
109 modified->Answer(call.GetOutput()); 109 modified->Answer(call.GetOutput());
110 } 110 }
111 111
112 112
160 160
161 /** 161 /**
162 * Compute the resulting DICOM instance. 162 * Compute the resulting DICOM instance.
163 **/ 163 **/
164 164
165 std::auto_ptr<ParsedDicomFile> modified(original.Clone()); 165 std::auto_ptr<ParsedDicomFile> modified(original.Clone(true));
166 modification.Apply(*modified); 166 modification.Apply(*modified);
167 167
168 DicomInstanceToStore toStore; 168 DicomInstanceToStore toStore;
169 toStore.SetRestOrigin(call); 169 toStore.SetRestOrigin(call);
170 toStore.SetParsedDicomFile(*modified); 170 toStore.SetParsedDicomFile(*modified);
432 432
433 try 433 try
434 { 434 {
435 for (Json::ArrayIndex i = 0; i < content.size(); i++) 435 for (Json::ArrayIndex i = 0; i < content.size(); i++)
436 { 436 {
437 std::auto_ptr<ParsedDicomFile> dicom(base.Clone()); 437 std::auto_ptr<ParsedDicomFile> dicom(base.Clone(false));
438 const Json::Value* payload = NULL; 438 const Json::Value* payload = NULL;
439 439
440 if (content[i].type() == Json::stringValue) 440 if (content[i].type() == Json::stringValue)
441 { 441 {
442 payload = &content[i]; 442 payload = &content[i];