Mercurial > hg > orthanc-java
comparison JavaSDK/be/uclouvain/orthanc/StorageCommitmentFailureReason.java @ 0:3ecef5782f2c
initial commit
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 18 Oct 2023 17:59:44 +0200 |
parents | |
children | 26c08ff926a3 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3ecef5782f2c |
---|---|
1 package be.uclouvain.orthanc; | |
2 | |
3 /** | |
4 * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium | |
5 * SPDX-License-Identifier: GPL-3.0-or-later | |
6 */ | |
7 | |
8 /** | |
9 * Java plugin for Orthanc | |
10 * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium | |
11 * | |
12 * This program is free software: you can redistribute it and/or | |
13 * modify it under the terms of the GNU General Public License as | |
14 * published by the Free Software Foundation, either version 3 of the | |
15 * License, or (at your option) any later version. | |
16 * | |
17 * This program is distributed in the hope that it will be useful, but | |
18 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
20 * General Public License for more details. | |
21 * | |
22 * You should have received a copy of the GNU General Public License | |
23 * along with this program. If not, see http://www.gnu.org/licenses/. | |
24 **/ | |
25 | |
26 | |
27 /** | |
28 * The available values for the Failure Reason (0008,1197) during storage | |
29 * commitment. | |
30 * http://dicom.nema.org/medical/dicom/2019e/output/chtml/part03/sect_C.14.html#sect_C.14.1.1 | |
31 **/ | |
32 public enum StorageCommitmentFailureReason { | |
33 /** | |
34 * Success: The DICOM instance is properly stored in the SCP | |
35 **/ | |
36 SUCCESS(0), | |
37 /** | |
38 * 0110H: A general failure in processing the operation was encountered | |
39 **/ | |
40 PROCESSING_FAILURE(1), | |
41 /** | |
42 * 0112H: One or more of the elements in the Referenced SOP Instance Sequence was | |
43 * not available | |
44 **/ | |
45 NO_SUCH_OBJECT_INSTANCE(2), | |
46 /** | |
47 * 0213H: The SCP does not currently have enough resources to store the requested | |
48 * SOP Instance(s) | |
49 **/ | |
50 RESOURCE_LIMITATION(3), | |
51 /** | |
52 * 0122H: Storage Commitment has been requested for a SOP Instance with a SOP Class | |
53 * that is not supported by the SCP | |
54 **/ | |
55 REFERENCED_SOPCLASS_NOT_SUPPORTED(4), | |
56 /** | |
57 * 0119H: The SOP Class of an element in the Referenced SOP Instance Sequence did | |
58 * not correspond to the SOP class registered for this SOP Instance at the SCP | |
59 **/ | |
60 CLASS_INSTANCE_CONFLICT(5), | |
61 /** | |
62 * 0131H: The Transaction UID of the Storage Commitment Request is already in use | |
63 **/ | |
64 DUPLICATE_TRANSACTION_UID(6); | |
65 | |
66 private int value; | |
67 | |
68 private StorageCommitmentFailureReason(int value) { | |
69 this.value = value; | |
70 } | |
71 | |
72 /** | |
73 * Return the enumeration value that corresponds to an integer value of interest. | |
74 * @param value The integer value. | |
75 * @return The enumeration value. | |
76 **/ | |
77 protected static StorageCommitmentFailureReason getInstance(int value) { | |
78 if (value == 0) { | |
79 return SUCCESS; | |
80 } | |
81 if (value == 1) { | |
82 return PROCESSING_FAILURE; | |
83 } | |
84 if (value == 2) { | |
85 return NO_SUCH_OBJECT_INSTANCE; | |
86 } | |
87 if (value == 3) { | |
88 return RESOURCE_LIMITATION; | |
89 } | |
90 if (value == 4) { | |
91 return REFERENCED_SOPCLASS_NOT_SUPPORTED; | |
92 } | |
93 if (value == 5) { | |
94 return CLASS_INSTANCE_CONFLICT; | |
95 } | |
96 if (value == 6) { | |
97 return DUPLICATE_TRANSACTION_UID; | |
98 } | |
99 | |
100 throw new IllegalArgumentException("Value out of range for enumeration StorageCommitmentFailureReason: " + value); | |
101 } | |
102 | |
103 /** | |
104 * Get the integer value corresponding to this enumeration value. | |
105 * @return The integer value. | |
106 **/ | |
107 public int getValue() { | |
108 return value; | |
109 } | |
110 } |