Mercurial > hg > orthanc
annotate OrthancServer/Sources/ExportedResource.cpp @ 4963:7ae27bc1f4bb Orthanc-1.10.1
Orthanc-1.10.1
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 23 Mar 2022 16:37:45 +0100 |
parents | 6eff25f70121 |
children | 0ea402b4d901 |
rev | line source |
---|---|
1247 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
1900 | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1247
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
4870
43e613a7756b
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4831
diff
changeset
|
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium |
43e613a7756b
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4831
diff
changeset
|
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
1247 | 7 * |
8 * This program is free software: you can redistribute it and/or | |
9 * modify it under the terms of the GNU General Public License as | |
10 * published by the Free Software Foundation, either version 3 of the | |
11 * License, or (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, but | |
14 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 * General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 **/ | |
21 | |
22 | |
1624
0a2ad4a6858f
fix missing precompiled headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
23 #include "PrecompiledHeadersServer.h" |
1247 | 24 #include "ExportedResource.h" |
25 | |
4045 | 26 #include "../../OrthancFramework/Sources/OrthancException.h" |
1247 | 27 |
28 namespace Orthanc | |
29 { | |
30 void ExportedResource::Format(Json::Value& item) const | |
31 { | |
32 item = Json::objectValue; | |
33 item["Seq"] = static_cast<int>(seq_); | |
34 item["ResourceType"] = EnumerationToString(resourceType_); | |
35 item["ID"] = publicId_; | |
36 item["Path"] = GetBasePath(resourceType_, publicId_); | |
37 item["RemoteModality"] = modality_; | |
38 item["Date"] = date_; | |
39 | |
40 // WARNING: Do not add "break" below and do not reorder the case items! | |
41 switch (resourceType_) | |
42 { | |
43 case ResourceType_Instance: | |
44 item["SOPInstanceUID"] = sopInstanceUid_; | |
45 | |
46 case ResourceType_Series: | |
47 item["SeriesInstanceUID"] = seriesInstanceUid_; | |
48 | |
49 case ResourceType_Study: | |
50 item["StudyInstanceUID"] = studyInstanceUid_; | |
51 | |
52 case ResourceType_Patient: | |
53 item["PatientID"] = patientId_; | |
54 break; | |
55 | |
56 default: | |
57 throw OrthancException(ErrorCode_InternalError); | |
58 } | |
59 } | |
60 } |