comparison Framework/Plugins/IndexBackend.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 be7de633695c
children 9cde77ca9ad9
comparison
equal deleted inserted replaced
377:02fe4606f5e4 378:9db9e0275ec0
1008 statement.Execute(args); 1008 statement.Execute(args);
1009 } 1009 }
1010 1010
1011 1011
1012 void IndexBackend::LogExportedResource(DatabaseManager& manager, 1012 void IndexBackend::LogExportedResource(DatabaseManager& manager,
1013 const OrthancPluginExportedResource& resource) 1013 OrthancPluginResourceType resourceType,
1014 const char* publicId,
1015 const char* modality,
1016 const char* date,
1017 const char* patientId,
1018 const char* studyInstanceUid,
1019 const char* seriesInstanceUid,
1020 const char* sopInstanceUid)
1014 { 1021 {
1015 DatabaseManager::CachedStatement statement( 1022 DatabaseManager::CachedStatement statement(
1016 STATEMENT_FROM_HERE, manager, 1023 STATEMENT_FROM_HERE, manager,
1017 "INSERT INTO ExportedResources VALUES(${AUTOINCREMENT} ${type}, ${publicId}, " 1024 "INSERT INTO ExportedResources VALUES(${AUTOINCREMENT} ${type}, ${publicId}, "
1018 "${modality}, ${patient}, ${study}, ${series}, ${instance}, ${date})"); 1025 "${modality}, ${patient}, ${study}, ${series}, ${instance}, ${date})");
1025 statement.SetParameterType("series", ValueType_Utf8String); 1032 statement.SetParameterType("series", ValueType_Utf8String);
1026 statement.SetParameterType("instance", ValueType_Utf8String); 1033 statement.SetParameterType("instance", ValueType_Utf8String);
1027 statement.SetParameterType("date", ValueType_Utf8String); 1034 statement.SetParameterType("date", ValueType_Utf8String);
1028 1035
1029 Dictionary args; 1036 Dictionary args;
1030 args.SetIntegerValue("type", resource.resourceType); 1037 args.SetIntegerValue("type", resourceType);
1031 args.SetUtf8Value("publicId", resource.publicId); 1038 args.SetUtf8Value("publicId", publicId);
1032 args.SetUtf8Value("modality", resource.modality); 1039 args.SetUtf8Value("modality", modality);
1033 args.SetUtf8Value("patient", resource.patientId); 1040 args.SetUtf8Value("patient", patientId);
1034 args.SetUtf8Value("study", resource.studyInstanceUid); 1041 args.SetUtf8Value("study", studyInstanceUid);
1035 args.SetUtf8Value("series", resource.seriesInstanceUid); 1042 args.SetUtf8Value("series", seriesInstanceUid);
1036 args.SetUtf8Value("instance", resource.sopInstanceUid); 1043 args.SetUtf8Value("instance", sopInstanceUid);
1037 args.SetUtf8Value("date", resource.date); 1044 args.SetUtf8Value("date", date);
1038 1045
1039 statement.Execute(args); 1046 statement.Execute(args);
1040 } 1047 }
1041 1048
1042 1049