comparison PalantirServer/PalantirRestApi.cpp @ 43:9be852ad33d2

rename for c
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 04 Sep 2012 09:59:34 +0200
parents ea48f38afe5f
children
comparison
equal deleted inserted replaced
42:ea48f38afe5f 43:9be852ad33d2
424 SendJson(output, result); 424 SendJson(output, result);
425 return; 425 return;
426 } 426 }
427 else 427 else
428 { 428 {
429 output.SendHeader(HttpStatus_415_UnsupportedMediaType); 429 output.SendHeader(Palantir_HttpStatus_415_UnsupportedMediaType);
430 return; 430 return;
431 } 431 }
432 } 432 }
433 else 433 else
434 { 434 {
627 since = boost::lexical_cast<int64_t>(GetArgument(arguments, "since", "0")); 627 since = boost::lexical_cast<int64_t>(GetArgument(arguments, "since", "0"));
628 limit = boost::lexical_cast<unsigned int>(GetArgument(arguments, "limit", "0")); 628 limit = boost::lexical_cast<unsigned int>(GetArgument(arguments, "limit", "0"));
629 } 629 }
630 catch (boost::bad_lexical_cast) 630 catch (boost::bad_lexical_cast)
631 { 631 {
632 output.SendHeader(HttpStatus_400_BadRequest); 632 output.SendHeader(Palantir_HttpStatus_400_BadRequest);
633 return; 633 return;
634 } 634 }
635 635
636 if (limit == 0 || limit > MAX_RESULTS) 636 if (limit == 0 || limit > MAX_RESULTS)
637 { 637 {
638 limit = MAX_RESULTS; 638 limit = MAX_RESULTS;
639 } 639 }
640 640
641 if (!index_.GetChanges(result, since, filter, limit)) 641 if (!index_.GetChanges(result, since, filter, limit))
642 { 642 {
643 output.SendHeader(HttpStatus_400_BadRequest); 643 output.SendHeader(Palantir_HttpStatus_400_BadRequest);
644 return; 644 return;
645 } 645 }
646 646
647 existingResource = true; 647 existingResource = true;
648 } 648 }
728 (uri[2] == "find-study" && !DicomFindStudy(result, connection, postData)) || 728 (uri[2] == "find-study" && !DicomFindStudy(result, connection, postData)) ||
729 (uri[2] == "find-series" && !DicomFindSeries(result, connection, postData)) || 729 (uri[2] == "find-series" && !DicomFindSeries(result, connection, postData)) ||
730 (uri[2] == "find" && !DicomFind(result, connection, postData)) || 730 (uri[2] == "find" && !DicomFind(result, connection, postData)) ||
731 (uri[2] == "store" && !DicomStore(result, connection, postData))) 731 (uri[2] == "store" && !DicomStore(result, connection, postData)))
732 { 732 {
733 output.SendHeader(HttpStatus_400_BadRequest); 733 output.SendHeader(Palantir_HttpStatus_400_BadRequest);
734 return; 734 return;
735 } 735 }
736 } 736 }
737 } 737 }
738 } 738 }
742 { 742 {
743 SendJson(output, result); 743 SendJson(output, result);
744 } 744 }
745 else 745 else
746 { 746 {
747 output.SendHeader(HttpStatus_404_NotFound); 747 output.SendHeader(Palantir_HttpStatus_404_NotFound);
748 } 748 }
749 } 749 }
750 } 750 }