Mercurial > hg > orthanc
comparison OrthancCppClient/Patient.cpp @ 500:ec19da4a1fe7 laaw
fix api
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 17 Jul 2013 22:31:22 +0200 |
parents | 7f7a2d174acb |
children | 50d9660f960c |
comparison
equal
deleted
inserted
replaced
498:ddeae3c3a8c2 | 500:ec19da4a1fe7 |
---|---|
50 } | 50 } |
51 | 51 |
52 Orthanc::IDynamicObject* Patient::GetFillerItem(size_t index) | 52 Orthanc::IDynamicObject* Patient::GetFillerItem(size_t index) |
53 { | 53 { |
54 Json::Value::ArrayIndex tmp = static_cast<Json::Value::ArrayIndex>(index); | 54 Json::Value::ArrayIndex tmp = static_cast<Json::Value::ArrayIndex>(index); |
55 return new Study(connection_, patient_["Studies"][tmp].asString()); | 55 std::string id = patient_["Studies"][tmp].asString(); |
56 return new Study(connection_, id.c_str()); | |
56 } | 57 } |
57 | 58 |
58 Patient::Patient(const OrthancConnection& connection, | 59 Patient::Patient(const OrthancConnection& connection, |
59 const char* id) : | 60 const char* id) : |
60 connection_(connection), | 61 connection_(connection), |
63 { | 64 { |
64 studies_.SetThreadCount(connection.GetThreadCount()); | 65 studies_.SetThreadCount(connection.GetThreadCount()); |
65 ReadPatient(); | 66 ReadPatient(); |
66 } | 67 } |
67 | 68 |
68 std::string Patient::GetMainDicomTag(const char* tag, const char* defaultValue) const | 69 const char* Patient::GetMainDicomTag(const char* tag, const char* defaultValue) const |
69 { | 70 { |
70 if (patient_["MainDicomTags"].isMember(tag)) | 71 if (patient_["MainDicomTags"].isMember(tag)) |
71 { | 72 { |
72 return patient_["MainDicomTags"][tag].asString(); | 73 return patient_["MainDicomTags"][tag].asCString(); |
73 } | 74 } |
74 else | 75 else |
75 { | 76 { |
76 return defaultValue; | 77 return defaultValue; |
77 } | 78 } |