Mercurial > hg > orthanc
annotate OrthancFramework/Sources/DicomFormat/DicomInstanceHasher.h @ 4733:1db3b79d97bd
Error code and description of jobs are now saved into the Orthanc database
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 28 Jun 2021 14:25:37 +0200 |
parents | d9473bd5ed43 |
children | 7053502fbf97 |
rev | line source |
---|---|
178 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
1900 | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
4437
d9473bd5ed43
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4296
diff
changeset
|
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium |
178 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4110
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public License |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4110
diff
changeset
|
9 * as published by the Free Software Foundation, either version 3 of |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4110
diff
changeset
|
10 * the License, or (at your option) any later version. |
178 | 11 * |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4110
diff
changeset
|
15 * Lesser General Public License for more details. |
178 | 16 * |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4110
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4110
diff
changeset
|
18 * License along with this program. If not, see |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4110
diff
changeset
|
19 * <http://www.gnu.org/licenses/>. |
178 | 20 **/ |
21 | |
22 | |
23 #pragma once | |
24 | |
25 #include "DicomMap.h" | |
26 | |
27 namespace Orthanc | |
28 { | |
29 /** | |
30 * This class implements the hashing mechanism that is used to | |
31 * convert DICOM unique identifiers to Orthanc identifiers. Any | |
32 * Orthanc identifier for a DICOM resource corresponds to the SHA-1 | |
33 * hash of the DICOM identifiers. | |
34 | |
35 * \note SHA-1 hash is used because it is less sensitive to | |
36 * collision attacks than MD5. <a | |
37 * href="http://en.wikipedia.org/wiki/SHA-256#Comparison_of_SHA_functions">[Reference]</a> | |
38 **/ | |
4110
d99739cbe94c
make DicomInstanceHasher and ParsedDicomDir public classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
39 class ORTHANC_PUBLIC DicomInstanceHasher |
178 | 40 { |
41 private: | |
42 std::string patientId_; | |
179 | 43 std::string studyUid_; |
178 | 44 std::string seriesUid_; |
179 | 45 std::string instanceUid_; |
46 | |
47 std::string patientHash_; | |
48 std::string studyHash_; | |
49 std::string seriesHash_; | |
50 std::string instanceHash_; | |
178 | 51 |
315 | 52 void Setup(const std::string& patientId, |
53 const std::string& studyUid, | |
54 const std::string& seriesUid, | |
55 const std::string& instanceUid); | |
56 | |
178 | 57 public: |
4199 | 58 explicit DicomInstanceHasher(const DicomMap& instance); |
178 | 59 |
315 | 60 DicomInstanceHasher(const std::string& patientId, |
61 const std::string& studyUid, | |
62 const std::string& seriesUid, | |
4296
3b70a2e6a06c
moving inline methods to source files for ABI compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4199
diff
changeset
|
63 const std::string& instanceUid); |
315 | 64 |
4296
3b70a2e6a06c
moving inline methods to source files for ABI compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4199
diff
changeset
|
65 const std::string& GetPatientId() const; |
178 | 66 |
4296
3b70a2e6a06c
moving inline methods to source files for ABI compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4199
diff
changeset
|
67 const std::string& GetStudyUid() const; |
178 | 68 |
4296
3b70a2e6a06c
moving inline methods to source files for ABI compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4199
diff
changeset
|
69 const std::string& GetSeriesUid() const; |
178 | 70 |
4296
3b70a2e6a06c
moving inline methods to source files for ABI compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4199
diff
changeset
|
71 const std::string& GetInstanceUid() const; |
178 | 72 |
179 | 73 const std::string& HashPatient(); |
178 | 74 |
179 | 75 const std::string& HashStudy(); |
178 | 76 |
179 | 77 const std::string& HashSeries(); |
178 | 78 |
179 | 79 const std::string& HashInstance(); |
178 | 80 }; |
81 } |