Mercurial > hg > orthanc
comparison OrthancServer/ServerIndex.cpp @ 1236:21d84e3acc0d
clean
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 05 Dec 2014 14:53:30 +0100 |
parents | 9b4977e3c19d |
children | 0f3716b88af7 |
comparison
equal
deleted
inserted
replaced
1235:9b4977e3c19d | 1236:21d84e3acc0d |
---|---|
716 | 716 |
717 | 717 |
718 SeriesStatus ServerIndex::GetSeriesStatus(int64_t id) | 718 SeriesStatus ServerIndex::GetSeriesStatus(int64_t id) |
719 { | 719 { |
720 // Get the expected number of instances in this series (from the metadata) | 720 // Get the expected number of instances in this series (from the metadata) |
721 std::string s = db_->GetMetadata(id, MetadataType_Series_ExpectedNumberOfInstances); | 721 std::string s = db_->GetMetadata(id, MetadataType_Series_ExpectedNumberOfInstances, ""); |
722 | 722 |
723 size_t expected; | 723 size_t expected; |
724 try | 724 try |
725 { | 725 { |
726 expected = boost::lexical_cast<size_t>(s); | 726 expected = boost::lexical_cast<size_t>(s); |
737 std::set<size_t> instances; | 737 std::set<size_t> instances; |
738 for (std::list<int64_t>::const_iterator | 738 for (std::list<int64_t>::const_iterator |
739 it = children.begin(); it != children.end(); ++it) | 739 it = children.begin(); it != children.end(); ++it) |
740 { | 740 { |
741 // Get the index of this instance in the series | 741 // Get the index of this instance in the series |
742 s = db_->GetMetadata(*it, MetadataType_Instance_IndexInSeries); | 742 s = db_->GetMetadata(*it, MetadataType_Instance_IndexInSeries, ""); |
743 size_t index; | 743 size_t index; |
744 try | 744 try |
745 { | 745 { |
746 index = boost::lexical_cast<size_t>(s); | 746 index = boost::lexical_cast<size_t>(s); |
747 } | 747 } |
921 result["ID"] = publicId; | 921 result["ID"] = publicId; |
922 MainDicomTagsToJson(result, id); | 922 MainDicomTagsToJson(result, id); |
923 | 923 |
924 std::string tmp; | 924 std::string tmp; |
925 | 925 |
926 tmp = db_->GetMetadata(id, MetadataType_AnonymizedFrom); | 926 tmp = db_->GetMetadata(id, MetadataType_AnonymizedFrom, ""); |
927 if (tmp.size() != 0) | 927 if (tmp.size() != 0) |
928 { | |
928 result["AnonymizedFrom"] = tmp; | 929 result["AnonymizedFrom"] = tmp; |
929 | 930 } |
930 tmp = db_->GetMetadata(id, MetadataType_ModifiedFrom); | 931 |
932 tmp = db_->GetMetadata(id, MetadataType_ModifiedFrom, ""); | |
931 if (tmp.size() != 0) | 933 if (tmp.size() != 0) |
934 { | |
932 result["ModifiedFrom"] = tmp; | 935 result["ModifiedFrom"] = tmp; |
936 } | |
933 | 937 |
934 if (type == ResourceType_Patient || | 938 if (type == ResourceType_Patient || |
935 type == ResourceType_Study || | 939 type == ResourceType_Study || |
936 type == ResourceType_Series) | 940 type == ResourceType_Series) |
937 { | 941 { |
938 result["IsStable"] = !unstableResources_.Contains(id); | 942 result["IsStable"] = !unstableResources_.Contains(id); |
939 | 943 |
940 tmp = db_->GetMetadata(id, MetadataType_LastUpdate); | 944 tmp = db_->GetMetadata(id, MetadataType_LastUpdate, ""); |
941 if (tmp.size() != 0) | 945 if (tmp.size() != 0) |
946 { | |
942 result["LastUpdate"] = tmp; | 947 result["LastUpdate"] = tmp; |
948 } | |
943 } | 949 } |
944 | 950 |
945 return true; | 951 return true; |
946 } | 952 } |
947 | 953 |
1063 publicId, | 1069 publicId, |
1064 remoteModality, | 1070 remoteModality, |
1065 patientId, | 1071 patientId, |
1066 studyInstanceUid, | 1072 studyInstanceUid, |
1067 seriesInstanceUid, | 1073 seriesInstanceUid, |
1068 sopInstanceUid); | 1074 sopInstanceUid, |
1075 boost::posix_time::second_clock::local_time()); | |
1069 } | 1076 } |
1070 | 1077 |
1071 | 1078 |
1072 bool ServerIndex::GetExportedResources(Json::Value& target, | 1079 bool ServerIndex::GetExportedResources(Json::Value& target, |
1073 int64_t since, | 1080 int64_t since, |
1850 | 1857 |
1851 for (std::list<MetadataType>::const_iterator | 1858 for (std::list<MetadataType>::const_iterator |
1852 it = metadata.begin(); it != metadata.end(); it++) | 1859 it = metadata.begin(); it != metadata.end(); it++) |
1853 { | 1860 { |
1854 std::string key = EnumerationToString(*it); | 1861 std::string key = EnumerationToString(*it); |
1855 std::string value = db_->GetMetadata(id, *it); | 1862 std::string value = db_->GetMetadata(id, *it, ""); |
1856 target[key] = value; | 1863 target[key] = value; |
1857 } | 1864 } |
1858 | 1865 |
1859 return true; | 1866 return true; |
1860 } | 1867 } |