comparison OrthancServer/ServerEnumerations.cpp @ 204:7f4acf490179

changes api
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 28 Nov 2012 11:27:57 +0100
parents bee20e978835
children e5d5d4a9a326
comparison
equal deleted inserted replaced
203:9283552c25df 204:7f4acf490179
54 default: 54 default:
55 throw OrthancException(ErrorCode_ParameterOutOfRange); 55 throw OrthancException(ErrorCode_ParameterOutOfRange);
56 } 56 }
57 } 57 }
58 58
59 const char* GetBasePath(ResourceType type) 59 std::string GetBasePath(ResourceType type,
60 const std::string& publicId)
60 { 61 {
61 switch (type) 62 switch (type)
62 { 63 {
63 case ResourceType_Patient: 64 case ResourceType_Patient:
64 return "patients"; 65 return "/patients/" + publicId;
65 66
66 case ResourceType_Study: 67 case ResourceType_Study:
67 return "studies"; 68 return "/studies/" + publicId;
68 69
69 case ResourceType_Series: 70 case ResourceType_Series:
70 return "series"; 71 return "/series/" + publicId;
71 72
72 case ResourceType_Instance: 73 case ResourceType_Instance:
73 return "instances"; 74 return "/instances/" + publicId;
74 75
75 default: 76 default:
76 throw OrthancException(ErrorCode_ParameterOutOfRange); 77 throw OrthancException(ErrorCode_ParameterOutOfRange);
77 } 78 }
78 } 79 }
95 96
96 default: 97 default:
97 throw OrthancException(ErrorCode_ParameterOutOfRange); 98 throw OrthancException(ErrorCode_ParameterOutOfRange);
98 } 99 }
99 } 100 }
101
102 const char* ToString(ChangeType type)
103 {
104 switch (type)
105 {
106 case ChangeType_CompletedSeries:
107 return "CompletedSeries";
108
109 case ChangeType_NewInstance:
110 return "NewInstance";
111
112 case ChangeType_NewPatient:
113 return "NewPatient";
114
115 case ChangeType_NewSeries:
116 return "NewSeries";
117
118 case ChangeType_NewStudy:
119 return "NewStudy";
120
121 default:
122 throw OrthancException(ErrorCode_ParameterOutOfRange);
123 }
124 }
100 } 125 }