annotate Sphinx/source/faq/orthanc-ids.rst @ 1113:a588960a72e5 default tip

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