comparison OrthancCppClient/Study.cpp @ 496:7f7a2d174acb laaw

preparing Laaw packaging
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 17 Jul 2013 17:07:12 +0200
parents f3d4193c571a
children ec19da4a1fe7
comparison
equal deleted inserted replaced
494:012b63028085 496:7f7a2d174acb
38 namespace OrthancClient 38 namespace OrthancClient
39 { 39 {
40 void Study::ReadStudy() 40 void Study::ReadStudy()
41 { 41 {
42 Orthanc::HttpClient client(connection_.GetHttpClient()); 42 Orthanc::HttpClient client(connection_.GetHttpClient());
43 client.SetUrl(connection_.GetOrthancUrl() + "/studies/" + id_); 43 client.SetUrl(std::string(connection_.GetOrthancUrl()) + "/studies/" + id_);
44
44 Json::Value v; 45 Json::Value v;
45 if (!client.Apply(study_)) 46 if (!client.Apply(study_))
46 { 47 {
47 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); 48 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol);
48 } 49 }
49 } 50 }
50 51
51 Orthanc::IDynamicObject* Study::GetFillerItem(size_t index) 52 Orthanc::IDynamicObject* Study::GetFillerItem(size_t index)
52 { 53 {
53 Json::Value::ArrayIndex tmp = static_cast<Json::Value::ArrayIndex>(index); 54 Json::Value::ArrayIndex tmp = static_cast<Json::Value::ArrayIndex>(index);
54 return new Series(connection_, study_["Series"][tmp].asString()); 55 std::string id = study_["Series"][tmp].asString();
56 return new Series(connection_, id.c_str());
55 } 57 }
56 58
57 Study::Study(const OrthancConnection& connection, 59 Study::Study(const OrthancConnection& connection,
58 const std::string& id) : 60 const std::string& id) :
59 connection_(connection), 61 connection_(connection),