Mercurial > hg > orthanc
comparison OrthancServer/main.cpp @ 1796:5e08a5fe6b27 worklists
HierarchicalMatcher - extracting tags
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 19 Nov 2015 18:32:00 +0100 |
parents | af6840eb23ee |
children | 23722a191e4e |
comparison
equal
deleted
inserted
replaced
1795:af6840eb23ee | 1796:5e08a5fe6b27 |
---|---|
105 virtual bool Handle(DicomFindAnswers& answers, | 105 virtual bool Handle(DicomFindAnswers& answers, |
106 ParsedDicomFile& query, | 106 ParsedDicomFile& query, |
107 const std::string& remoteIp, | 107 const std::string& remoteIp, |
108 const std::string& remoteAet) | 108 const std::string& remoteAet) |
109 { | 109 { |
110 printf("=====================================================================\n"); | |
110 printf("Worklist\n"); | 111 printf("Worklist\n"); |
111 | 112 |
112 bool caseSensitivePN = Configuration::GetGlobalBoolParameter("CaseSensitivePN", false); | 113 bool caseSensitivePN = Configuration::GetGlobalBoolParameter("CaseSensitivePN", false); |
113 HierarchicalMatcher matcher(query, caseSensitivePN); | 114 HierarchicalMatcher matcher(query, caseSensitivePN); |
114 | 115 |
115 std::cout << matcher.Format(); | 116 std::cout << matcher.Format(); |
117 | |
118 for (unsigned int i = 1; i <= 10; i++) | |
119 { | |
120 std::string p = "/tmp/worklists/db/OFFIS/item" + boost::lexical_cast<std::string>(i) + ".wl"; | |
121 std::string s; | |
122 Toolbox::ReadFile(s, p); | |
123 ParsedDicomFile f(s); | |
124 std::cout << p << " => " << matcher.Match(f) << std::endl; | |
125 | |
126 if (matcher.Match(f)) | |
127 { | |
128 std::auto_ptr<ParsedDicomFile> e(matcher.Extract(f)); | |
129 | |
130 Json::Value v; | |
131 e->ToJson(v, DicomToJsonFormat_Short, DicomToJsonFlags_Default, 0); | |
132 std::cout << v; | |
133 } | |
134 } | |
116 | 135 |
117 return true; | 136 return true; |
118 } | 137 } |
119 }; | 138 }; |
120 | 139 |