Mercurial > hg > orthanc-book
annotate Sphinx/source/faq/orthanc-ids.rst @ 660:a6e371768a70
dicom-as-json
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 29 Apr 2021 12:41:31 +0200 |
parents | 2922fb1bd65e |
children | 1316bc62b5d5 |
rev | line source |
---|---|
0 | 1 .. _orthanc-ids: |
2 | |
3 Orthanc identifiers | |
4 =================== | |
5 | |
6 In Orthanc, each patient, study, series and instance is assigned with | |
7 an unique identifier that is derived from the DICOM identifiers. | |
8 Contrarily to the :ref:`identifiers of the DICOM standard | |
9 <dicom-identifiers>`, the Orthanc identifiers are formatted as a | |
25 | 10 `SHA-1 hash <https://en.wikipedia.org/wiki/Sha-1>`__ with a fixed |
0 | 11 length, so as to be more Web-friendly. More specifically: |
12 | |
13 * Patients are identified as the SHA-1 hash of their PatientID tag | |
14 (0010,0020). | |
15 * Studies are identified as the SHA-1 hash of the concatenation of | |
16 their PatientID tag (0010,0020) and their StudyInstanceUID tag | |
17 (0020,000d). | |
18 * Series are identified as the SHA-1 hash of the concatenation of | |
19 their PatientID tag (0010,0020), their StudyInstanceUID tag | |
20 (0020,000d) and their SeriesInstanceUID tag (0020,000e). | |
21 * Instances are identified as the SHA-1 hash of the concatenation of | |
22 their PatientID tag (0010,0020), their StudyInstanceUID tag | |
23 (0020,000d), their SeriesInstanceUID tag (0020,000e), and their | |
24 SOPInstanceUID tag (0008,0018). | |
25 | |
125
9b4e810f4ecf
note about concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
25
diff
changeset
|
26 NB: The concatenation adds a `pipe |
9b4e810f4ecf
note about concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
25
diff
changeset
|
27 <https://en.wikipedia.org/wiki/Vertical_bar>`__ separator "``|``" |
9b4e810f4ecf
note about concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
25
diff
changeset
|
28 between the concatenated DICOM tags. |
9b4e810f4ecf
note about concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
25
diff
changeset
|
29 |
0 | 30 Because the DICOM standard guarantees the StudyInstanceUID, |
31 SeriesInstanceUID and SOPInstanceUID tags to be globally unique, the | |
32 Orthanc identifiers for studies, series and instances are also | |
33 globally unique (provided no hash collision occurs, which is highly | |
34 improbable). | |
35 | |
36 The patient-level identifiers are *not* guaranteed to be globally | |
37 unique, and might collide between different hospitals. For this | |
38 reason, you should **always do queries at the study level** as soon as | |
39 you deal with an application that handles patients from different | |
40 hospitals. | |
41 | |
42 The actual implementation of the hashing is carried on by the | |
43 `DicomInstanceHasher class | |
449 | 44 <https://hg.orthanc-server.com/orthanc/file/default/OrthancFramework/Sources/DicomFormat/DicomInstanceHasher.cpp>`_. |
0 | 45 |
410 | 46 If two different instances have the same Orthanc identifier, only one |
47 of them is kept. By default, the first instance that was received by | |
48 Orthanc is kept. You can choose to replace the first instance by the | |
49 second instance by setting :ref:`configuration option <configuration>` | |
50 ``OverwriteInstances`` to ``true``. | |
51 | |
0 | 52 |
53 The "Inexistent Tag" error | |
54 -------------------------- | |
55 | |
56 If you use an old version of Orthanc (< 0.7.4) and you receive the | |
57 "*Exception while storing DICOM: Inexistent tag*" error while storing | |
58 a DICOM instance into Orthanc, please make sure that all the 4 | |
59 following tags do exist in the DICOM file: | |
60 | |
61 * PatientID (0010,0020), | |
62 * StudyInstanceUID (0020,000d), | |
63 * SeriesInstanceUID (0020,000e), | |
64 * SOPInstanceUID (0008,0018). | |
65 | |
66 These tags are all used to index the incoming DICOM instances. The | |
67 error message is more explicit starting with Orthanc 0.7.4. |