comparison Framework/Plugins/DatabaseBackendAdapterV4.cpp @ 378:9db9e0275ec0 db-protobuf

refactoring IndexBackend::LogExportedResource()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 29 Mar 2023 08:19:40 +0200
parents 02fe4606f5e4
children 33b2aaffdd6c
comparison
equal deleted inserted replaced
377:02fe4606f5e4 378:9db9e0275ec0
634 { 634 {
635 response.mutable_get_total_uncompressed_size()->set_size(backend.GetTotalUncompressedSize(manager)); 635 response.mutable_get_total_uncompressed_size()->set_size(backend.GetTotalUncompressedSize(manager));
636 break; 636 break;
637 } 637 }
638 638
639 case Orthanc::DatabasePluginMessages::OPERATION_IS_PROTECTED_PATIENT:
640 {
641 bool isProtected = backend.IsProtectedPatient(manager, request.is_protected_patient().patient_id());
642 response.mutable_is_protected_patient()->set_protected_patient(isProtected);
643 break;
644 }
645
646 case Orthanc::DatabasePluginMessages::OPERATION_LIST_AVAILABLE_ATTACHMENTS:
647 {
648 std::list<int32_t> values;
649 backend.ListAvailableAttachments(values, manager, request.list_available_attachments().id());
650
651 for (std::list<int32_t>::const_iterator it = values.begin(); it != values.end(); ++it)
652 {
653 response.mutable_list_available_attachments()->add_attachments(*it);
654 }
655
656 break;
657 }
658
659 case Orthanc::DatabasePluginMessages::OPERATION_LOG_CHANGE:
660 {
661 backend.LogChange(manager, request.log_change().change_type(),
662 request.log_change().resource_id(),
663 Convert(request.log_change().resource_type()),
664 request.log_change().date().c_str());
665 break;
666 }
667
668 case Orthanc::DatabasePluginMessages::OPERATION_LOG_EXPORTED_RESOURCE:
669 {
670 backend.LogExportedResource(manager,
671 Convert(request.log_exported_resource().resource_type()),
672 request.log_exported_resource().public_id().c_str(),
673 request.log_exported_resource().modality().c_str(),
674 request.log_exported_resource().date().c_str(),
675 request.log_exported_resource().patient_id().c_str(),
676 request.log_exported_resource().study_instance_uid().c_str(),
677 request.log_exported_resource().series_instance_uid().c_str(),
678 request.log_exported_resource().sop_instance_uid().c_str());
679 break;
680 }
681
639 default: 682 default:
640 LOG(ERROR) << "Not implemented transaction operation from protobuf: " << request.operation(); 683 LOG(ERROR) << "Not implemented transaction operation from protobuf: " << request.operation();
641 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); 684 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
642 } 685 }
643 } 686 }