comparison PalanthirServer/PalanthirRestApi.h @ 47:491a97842e31

rename
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 05 Sep 2012 13:26:06 +0200
parents PalanthirServer/PalantirRestApi.h@33d67e1ab173
children a15e90e5d6fc
comparison
equal deleted inserted replaced
45:33d67e1ab173 47:491a97842e31
1 /**
2 * Palantir - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012 Medical Physics Department, CHU of Liege,
4 * Belgium
5 *
6 * This program is free software: you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 **/
19
20
21 #pragma once
22
23 #include "../Core/HttpServer/HttpHandler.h"
24 #include "ServerIndex.h"
25 #include "DicomProtocol/DicomUserConnection.h"
26
27 #include <set>
28
29
30 namespace Palantir
31 {
32 class PalantirRestApi : public HttpHandler
33 {
34 private:
35 typedef std::set<std::string> Modalities;
36
37 ServerIndex& index_;
38 FileStorage storage_;
39 Modalities modalities_;
40
41 bool Store(Json::Value& result,
42 const std::string& postData);
43
44 void ConnectToModality(DicomUserConnection& c,
45 const std::string& name);
46
47 bool MergeQueryAndTemplate(DicomMap& result,
48 const std::string& postData);
49
50 bool DicomFindPatient(Json::Value& result,
51 DicomUserConnection& c,
52 const std::string& postData);
53
54 bool DicomFindStudy(Json::Value& result,
55 DicomUserConnection& c,
56 const std::string& postData);
57
58 bool DicomFindSeries(Json::Value& result,
59 DicomUserConnection& c,
60 const std::string& postData);
61
62 bool DicomFind(Json::Value& result,
63 DicomUserConnection& c,
64 const std::string& postData);
65
66 bool DicomStore(Json::Value& result,
67 DicomUserConnection& c,
68 const std::string& postData);
69
70 public:
71 PalantirRestApi(ServerIndex& index,
72 const std::string& path);
73
74 virtual bool IsServedUri(const UriComponents& uri)
75 {
76 return true;
77 }
78
79 virtual void Handle(
80 HttpOutput& output,
81 const std::string& method,
82 const UriComponents& uri,
83 const Arguments& headers,
84 const Arguments& arguments,
85 const std::string& postData);
86 };
87 }