Mercurial > hg > orthanc
comparison OrthancServer/OrthancRestApi.cpp @ 192:c56dc32266e0
refactoring getfile
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 13 Nov 2012 11:29:43 +0100 |
parents | b6cef9d45cc3 |
children | a1b9d1e1497b |
comparison
equal
deleted
inserted
replaced
191:bff0b77b02fa | 192:c56dc32266e0 |
---|---|
569 uri[2] == "simplified-tags")) | 569 uri[2] == "simplified-tags")) |
570 { | 570 { |
571 std::string fileUuid, contentType, filename; | 571 std::string fileUuid, contentType, filename; |
572 if (uri[2] == "file") | 572 if (uri[2] == "file") |
573 { | 573 { |
574 existingResource = index_.GetDicomFile(fileUuid, uri[1]); | 574 existingResource = index_.GetFile(fileUuid, uri[1], "dicom"); |
575 contentType = "application/dicom"; | 575 contentType = "application/dicom"; |
576 filename = fileUuid + ".dcm"; | 576 filename = fileUuid + ".dcm"; |
577 } | 577 } |
578 else if (uri[2] == "tags" || | 578 else if (uri[2] == "tags" || |
579 uri[2] == "simplified-tags") | 579 uri[2] == "simplified-tags") |
580 { | 580 { |
581 existingResource = index_.GetJsonFile(fileUuid, uri[1]); | 581 existingResource = index_.GetFile(fileUuid, uri[1], "json"); |
582 contentType = "application/json"; | 582 contentType = "application/json"; |
583 filename = fileUuid + ".json"; | 583 filename = fileUuid + ".json"; |
584 } | 584 } |
585 | 585 |
586 if (existingResource) | 586 if (existingResource) |
640 (uri[4] == "preview" || | 640 (uri[4] == "preview" || |
641 uri[4] == "image-uint8" || | 641 uri[4] == "image-uint8" || |
642 uri[4] == "image-uint16")))) | 642 uri[4] == "image-uint16")))) |
643 { | 643 { |
644 std::string uuid; | 644 std::string uuid; |
645 existingResource = index_.GetDicomFile(uuid, uri[1]); | 645 existingResource = index_.GetFile(uuid, uri[1], "dicom"); |
646 | 646 |
647 std::string action = uri[2]; | 647 std::string action = uri[2]; |
648 | 648 |
649 unsigned int frame = 0; | 649 unsigned int frame = 0; |
650 if (existingResource && | 650 if (existingResource && |