-
Notifications
You must be signed in to change notification settings - Fork 0
/
AssociationRejection.cpp
82 lines (74 loc) · 1.45 KB
/
AssociationRejection.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#include "AssociationRejection.hpp"
namespace dicom
{
/*
exception class.
*/
AssociationRejection::AssociationRejection(BYTE Result, BYTE Source, BYTE Reason)
:
dicom::exception("Association Rejection"),
Result_(Result),
Source_(Source),
Reason_(Reason)
{
}
std::string AssociationRejection::GetResult() const
{
switch (Result_)
{
case 0x01:
return "Rejected Permanent";
case 0x02:
return "Rejected Transient";
default:
return "Undefined";
}
}
std::string AssociationRejection::GetSource() const
{
switch(Source_)
{
case 0x01:
return "DICOM UL service-user";
case 0x02:
return "DICOM UL service-provider (ACSE related function)";
case 0x03:
return "DICOM UL service-provider (Presentation related function)";
default:
return "Undefined";
}
}
std::string AssociationRejection::GetReason() const
{
switch(Source_)
{
case 0x01:
switch(Reason_)
{
case 0x01:
return "No reason given.";
case 0x02:
return "Application Context not supported.";
case 0x03:
return "Calling AE not recognized";
case 0x07:
return "Protocol version not supported";
}
case 0x02:
switch(Reason_)
{
case 0x02:
return "Protocol Version Not Supported.";
}
case 0x03:
switch(Reason_)
{
case 0x01:
return ("Temporary Congestion");
case 0x02:
return ("Local Limit Exceeded.");
}
}
return "Unknown reason";
}
}//namespace dicom