comparison OrthancCppClient/Patient.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 Patient::ReadPatient() 40 void Patient::ReadPatient()
41 { 41 {
42 Orthanc::HttpClient client(connection_.GetHttpClient()); 42 Orthanc::HttpClient client(connection_.GetHttpClient());
43 client.SetUrl(connection_.GetOrthancUrl() + "/patients/" + id_); 43 client.SetUrl(std::string(connection_.GetOrthancUrl()) + "/patients/" + id_);
44
44 Json::Value v; 45 Json::Value v;
45 if (!client.Apply(patient_)) 46 if (!client.Apply(patient_))
46 { 47 {
47 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); 48 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol);
48 } 49 }
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 Study(connection_, patient_["Studies"][tmp].asString()); 55 return new Study(connection_, patient_["Studies"][tmp].asString());
55 } 56 }
56 57
57 Patient::Patient(const OrthancConnection& connection, 58 Patient::Patient(const OrthancConnection& connection,
58 const std::string& id) : 59 const char* id) :
59 connection_(connection), 60 connection_(connection),
60 id_(id), 61 id_(id),
61 studies_(*this) 62 studies_(*this)
62 { 63 {
63 studies_.SetThreadCount(connection.GetThreadCount()); 64 studies_.SetThreadCount(connection.GetThreadCount());