Mercurial > hg > orthanc-databases
annotate Framework/Plugins/MessagesToolbox.cpp @ 550:9ed9a91bde33 find-refactoring
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 09 Sep 2024 15:04:48 +0200 |
parents | |
children | 1a74fc1bea2d |
rev | line source |
---|---|
550
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * This program is free software: you can redistribute it and/or |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * modify it under the terms of the GNU Affero General Public License |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * as published by the Free Software Foundation, either version 3 of |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * the License, or (at your option) any later version. |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * This program is distributed in the hope that it will be useful, but |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * WITHOUT ANY WARRANTY; without even the implied warranty of |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * Affero General Public License for more details. |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 * You should have received a copy of the GNU Affero General Public License |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 **/ |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 #include "MessagesToolbox.h" |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 namespace OrthancDatabases |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 { |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 namespace MessagesToolbox |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 { |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 Orthanc::ResourceType Convert(Orthanc::DatabasePluginMessages::ResourceType resourceType) |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 { |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 switch (resourceType) |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 { |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 case Orthanc::DatabasePluginMessages::RESOURCE_PATIENT: |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 return Orthanc::ResourceType_Patient; |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 case Orthanc::DatabasePluginMessages::RESOURCE_STUDY: |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 return Orthanc::ResourceType_Study; |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 case Orthanc::DatabasePluginMessages::RESOURCE_SERIES: |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 return Orthanc::ResourceType_Series; |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 case Orthanc::DatabasePluginMessages::RESOURCE_INSTANCE: |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 return Orthanc::ResourceType_Instance; |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 default: |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 } |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 } |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 } |
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 } |