Mercurial > hg > orthanc
comparison OrthancServer/Sources/ServerContext.cpp @ 4376:b002f9abe802 varian
review of changeset 4375:208029732d51
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 17 Dec 2020 11:27:37 +0100 |
parents | 208029732d51 |
children | 7e0d015ad109 |
comparison
equal
deleted
inserted
replaced
4375:208029732d51 | 4376:b002f9abe802 |
---|---|
268 isHttpServerSecure_(true), | 268 isHttpServerSecure_(true), |
269 isExecuteLuaEnabled_(false), | 269 isExecuteLuaEnabled_(false), |
270 overwriteInstances_(false), | 270 overwriteInstances_(false), |
271 dcmtkTranscoder_(new DcmtkTranscoder), | 271 dcmtkTranscoder_(new DcmtkTranscoder), |
272 isIngestTranscoding_(false), | 272 isIngestTranscoding_(false), |
273 deidentifyDimseQueryLogs_(false), | 273 deidentifyLogs_(false) |
274 deidentifyDimseQueryLogsDicomVersion_(DicomVersion_2017c) | |
275 { | 274 { |
276 try | 275 try |
277 { | 276 { |
278 unsigned int lossyQuality; | 277 unsigned int lossyQuality; |
279 | 278 |
321 { | 320 { |
322 isIngestTranscoding_ = false; | 321 isIngestTranscoding_ = false; |
323 LOG(INFO) << "Automated transcoding of incoming DICOM instances is disabled"; | 322 LOG(INFO) << "Automated transcoding of incoming DICOM instances is disabled"; |
324 } | 323 } |
325 | 324 |
326 if (lock.GetConfiguration().GetBooleanParameter("DeidentifyDimseQueryLogs", false)) | 325 if (lock.GetConfiguration().GetBooleanParameter("DeidentifyLogs", true)) |
327 { | 326 { |
328 deidentifyDimseQueryLogs_ = true; | 327 deidentifyLogs_ = true; |
329 CLOG(INFO, DICOM) << "Deidentification of DIMSE query log contents is enabled"; | 328 CLOG(INFO, DICOM) << "Deidentification of log contents (notably for DIMSE queries) is enabled"; |
330 | 329 |
331 deidentifyDimseQueryLogsDicomVersion_ = StringToDicomVersion( | 330 DicomVersion version = StringToDicomVersion( |
332 lock.GetConfiguration().GetStringParameter("DeidentifyDimseQueryLogsDicomVersion", "2017c")); | 331 lock.GetConfiguration().GetStringParameter("DeidentifyLogsDicomVersion", "2017c")); |
333 CLOG(INFO, DICOM) << "Version of DICOM standard used for deidentification is " | 332 CLOG(INFO, DICOM) << "Version of DICOM standard used for deidentification is " |
334 << EnumerationToString(deidentifyDimseQueryLogsDicomVersion_); | 333 << EnumerationToString(version); |
334 | |
335 logsDeidentifierRules_.SetupAnonymization(version); | |
335 } | 336 } |
336 else | 337 else |
337 { | 338 { |
338 deidentifyDimseQueryLogs_ = false; | 339 deidentifyLogs_ = false; |
339 CLOG(INFO, DICOM) << "Deidentification of DIMSE query log contents is disabled"; | 340 CLOG(INFO, DICOM) << "Deidentification of log contents (notably for DIMSE queries) is disabled"; |
340 } | 341 } |
341 } | 342 } |
342 | 343 |
343 jobsEngine_.SetThreadSleep(unitTesting ? 20 : 200); | 344 jobsEngine_.SetThreadSleep(unitTesting ? 20 : 200); |
344 | 345 |
345 listeners_.push_back(ServerListener(luaListener_, "Lua")); | 346 listeners_.push_back(ServerListener(luaListener_, "Lua")); |
346 changeThread_ = boost::thread(ChangeThread, this, (unitTesting ? 20 : 100)); | 347 changeThread_ = boost::thread(ChangeThread, this, (unitTesting ? 20 : 100)); |
347 | 348 |
348 dynamic_cast<DcmtkTranscoder&>(*dcmtkTranscoder_).SetLossyQuality(lossyQuality); | 349 dynamic_cast<DcmtkTranscoder&>(*dcmtkTranscoder_).SetLossyQuality(lossyQuality); |
349 | |
350 if (deidentifyDimseQueryLogs_) | |
351 { | |
352 logsDeidentifierRules_.SetupAnonymization(deidentifyDimseQueryLogsDicomVersion_); | |
353 } | |
354 } | 350 } |
355 catch (OrthancException&) | 351 catch (OrthancException&) |
356 { | 352 { |
357 Stop(); | 353 Stop(); |
358 throw; | 354 throw; |
1651 { | 1647 { |
1652 return false; | 1648 return false; |
1653 } | 1649 } |
1654 } | 1650 } |
1655 | 1651 |
1656 const std::string& ServerContext::GetDeidentifiedQueryContent(const DicomElement &element) const | 1652 const std::string& ServerContext::GetDeidentifiedContent(const DicomElement &element) const |
1657 { | 1653 { |
1658 static const std::string redactedContent = "*** POTENTIAL PHI ***"; | 1654 static const std::string redactedContent = "*** POTENTIAL PHI ***"; |
1659 | 1655 |
1660 const DicomTag& tag = element.GetTag(); | 1656 const DicomTag& tag = element.GetTag(); |
1661 if (deidentifyDimseQueryLogs_ && ( | 1657 if (deidentifyLogs_ && ( |
1662 logsDeidentifierRules_.IsCleared(tag) || | 1658 logsDeidentifierRules_.IsCleared(tag) || |
1663 logsDeidentifierRules_.IsRemoved(tag) || | 1659 logsDeidentifierRules_.IsRemoved(tag) || |
1664 logsDeidentifierRules_.IsReplaced(tag))) | 1660 logsDeidentifierRules_.IsReplaced(tag))) |
1665 { | 1661 { |
1666 return redactedContent; | 1662 return redactedContent; |
1667 } | 1663 } |
1668 else | 1664 else |
1669 { | 1665 { |