Mercurial > hg > orthanc
comparison OrthancServer/OrthancRestApi/OrthancRestResources.cpp @ 2129:0c09d1af22f3
"/tools/invalidate-tags" to invalidate the JSON summary of all the DICOM files
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 07 Nov 2016 17:44:10 +0100 |
parents | 9329ba17a069 |
children | bb199bccdc45 |
comparison
equal
deleted
inserted
replaced
2128:9329ba17a069 | 2129:0c09d1af22f3 |
---|---|
1352 call.GetOutput().AnswerJson(header); | 1352 call.GetOutput().AnswerJson(header); |
1353 } | 1353 } |
1354 } | 1354 } |
1355 | 1355 |
1356 | 1356 |
1357 static void InvalidateTags(RestApiPostCall& call) | |
1358 { | |
1359 ServerIndex& index = OrthancRestApi::GetIndex(call); | |
1360 | |
1361 // Loop over the instances, grouping them by parent studies so as | |
1362 // to avoid large memory consumption | |
1363 std::list<std::string> studies; | |
1364 index.GetAllUuids(studies, ResourceType_Study); | |
1365 | |
1366 for (std::list<std::string>::const_iterator | |
1367 study = studies.begin(); study != studies.end(); ++study) | |
1368 { | |
1369 std::list<std::string> instances; | |
1370 index.GetChildInstances(instances, *study); | |
1371 | |
1372 for (std::list<std::string>::const_iterator | |
1373 instance = instances.begin(); instance != instances.end(); ++instance) | |
1374 { | |
1375 index.DeleteAttachment(*instance, FileContentType_DicomAsJson); | |
1376 } | |
1377 } | |
1378 | |
1379 call.GetOutput().AnswerBuffer("", "text/plain"); | |
1380 } | |
1381 | |
1382 | |
1357 void OrthancRestApi::RegisterResources() | 1383 void OrthancRestApi::RegisterResources() |
1358 { | 1384 { |
1359 Register("/instances", ListResources<ResourceType_Instance>); | 1385 Register("/instances", ListResources<ResourceType_Instance>); |
1360 Register("/patients", ListResources<ResourceType_Patient>); | 1386 Register("/patients", ListResources<ResourceType_Patient>); |
1361 Register("/series", ListResources<ResourceType_Series>); | 1387 Register("/series", ListResources<ResourceType_Series>); |
1426 Register("/{resourceType}/{id}/attachments/{name}/md5", GetAttachmentMD5); | 1452 Register("/{resourceType}/{id}/attachments/{name}/md5", GetAttachmentMD5); |
1427 Register("/{resourceType}/{id}/attachments/{name}/size", GetAttachmentSize); | 1453 Register("/{resourceType}/{id}/attachments/{name}/size", GetAttachmentSize); |
1428 Register("/{resourceType}/{id}/attachments/{name}/uncompress", ChangeAttachmentCompression<CompressionType_None>); | 1454 Register("/{resourceType}/{id}/attachments/{name}/uncompress", ChangeAttachmentCompression<CompressionType_None>); |
1429 Register("/{resourceType}/{id}/attachments/{name}/verify-md5", VerifyAttachment); | 1455 Register("/{resourceType}/{id}/attachments/{name}/verify-md5", VerifyAttachment); |
1430 | 1456 |
1457 Register("/tools/invalidate-tags", InvalidateTags); | |
1431 Register("/tools/lookup", Lookup); | 1458 Register("/tools/lookup", Lookup); |
1432 Register("/tools/find", Find); | 1459 Register("/tools/find", Find); |
1433 | 1460 |
1434 Register("/patients/{id}/studies", GetChildResources<ResourceType_Patient, ResourceType_Study>); | 1461 Register("/patients/{id}/studies", GetChildResources<ResourceType_Patient, ResourceType_Study>); |
1435 Register("/patients/{id}/series", GetChildResources<ResourceType_Patient, ResourceType_Series>); | 1462 Register("/patients/{id}/series", GetChildResources<ResourceType_Patient, ResourceType_Series>); |