comparison OrthancServer/Sources/OrthancRestApi/OrthancRestAnonymizeModify.cpp @ 4796:94616af363ec filter-store-instance

added ReceivedCStoreInstanceFilter lua callback + OrthancPluginRegisterIncomingCStoreInstanceFilter in sdk
author Alain Mazy <am@osimis.io>
date Fri, 01 Oct 2021 18:36:45 +0200
parents 388d108f6e4b
children 70d2a97ca8cb 7053502fbf97
comparison
equal deleted inserted replaced
4795:22d5b611dea7 4796:94616af363ec
552 { 552 {
553 std::unique_ptr<DicomInstanceToStore> toStore(DicomInstanceToStore::CreateFromParsedDicomFile(dicom)); 553 std::unique_ptr<DicomInstanceToStore> toStore(DicomInstanceToStore::CreateFromParsedDicomFile(dicom));
554 toStore->SetOrigin(DicomInstanceOrigin::FromRest(call)); 554 toStore->SetOrigin(DicomInstanceOrigin::FromRest(call));
555 555
556 ServerContext& context = OrthancRestApi::GetContext(call); 556 ServerContext& context = OrthancRestApi::GetContext(call);
557 StoreStatus status = context.Store(id, *toStore, StoreInstanceMode_Default); 557 ServerContext::StoreResult result = context.Store(id, *toStore, StoreInstanceMode_Default);
558 558
559 if (status == StoreStatus_Failure) 559 if (result.GetStatus() == StoreStatus_Failure)
560 { 560 {
561 throw OrthancException(ErrorCode_CannotStoreInstance); 561 throw OrthancException(ErrorCode_CannotStoreInstance);
562 } 562 }
563 563
564 if (sendAnswer) 564 if (sendAnswer)
565 { 565 {
566 OrthancRestApi::GetApi(call).AnswerStoredInstance(call, *toStore, status, id); 566 OrthancRestApi::GetApi(call).AnswerStoredInstance(call, *toStore, result.GetStatus(), id);
567 } 567 }
568 } 568 }
569 569
570 570
571 static void CreateDicomV1(ParsedDicomFile& dicom, 571 static void CreateDicomV1(ParsedDicomFile& dicom,