Mercurial > hg > orthanc
comparison OrthancServer/OrthancRestApi/OrthancRestModalities.cpp @ 807:566a2fb3c1fb
update/delete modalities
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 07 May 2014 15:54:23 +0200 |
parents | 557575fd93e9 |
children | 2d9a000aa3a6 |
comparison
equal
deleted
inserted
replaced
806:557575fd93e9 | 807:566a2fb3c1fb |
---|---|
462 call.GetOutput().AnswerJson(result); | 462 call.GetOutput().AnswerJson(result); |
463 } | 463 } |
464 } | 464 } |
465 | 465 |
466 | 466 |
467 static void UpdateModality(RestApi::PutCall& call) | |
468 { | |
469 Json::Value json; | |
470 Json::Reader reader; | |
471 if (reader.parse(call.GetPutBody(), json)) | |
472 { | |
473 RemoteModalityParameters modality; | |
474 modality.FromJson(json); | |
475 modality.SetName(call.GetUriComponent("id", "")); | |
476 UpdateModality(modality); | |
477 } | |
478 } | |
479 | |
480 | |
481 static void DeleteModality(RestApi::DeleteCall& call) | |
482 { | |
483 RemoveModality(call.GetUriComponent("id", "")); | |
484 } | |
485 | |
486 | |
467 void OrthancRestApi::RegisterModalities() | 487 void OrthancRestApi::RegisterModalities() |
468 { | 488 { |
469 Register("/modalities", ListModalities); | 489 Register("/modalities", ListModalities); |
470 Register("/modalities/{id}", ListModalityOperations); | 490 Register("/modalities/{id}", ListModalityOperations); |
491 Register("/modalities/{id}", UpdateModality); | |
492 Register("/modalities/{id}", DeleteModality); | |
471 Register("/modalities/{id}/find-patient", DicomFindPatient); | 493 Register("/modalities/{id}/find-patient", DicomFindPatient); |
472 Register("/modalities/{id}/find-study", DicomFindStudy); | 494 Register("/modalities/{id}/find-study", DicomFindStudy); |
473 Register("/modalities/{id}/find-series", DicomFindSeries); | 495 Register("/modalities/{id}/find-series", DicomFindSeries); |
474 Register("/modalities/{id}/find-instance", DicomFindInstance); | 496 Register("/modalities/{id}/find-instance", DicomFindInstance); |
475 Register("/modalities/{id}/find", DicomFind); | 497 Register("/modalities/{id}/find", DicomFind); |
476 Register("/modalities/{id}/store", DicomStore); | 498 Register("/modalities/{id}/store", DicomStore); |
477 | 499 |
478 Register("/peers", ListPeers); | 500 Register("/peers", ListPeers); |
479 Register("/peers/{id}", ListPeerOperations); | 501 Register("/peers/{id}", ListPeerOperations); |
480 Register("/peers/{id}/store", PeerStore); | 502 Register("/peers/{id}/store", PeerStore); |
503 | |
481 } | 504 } |
482 } | 505 } |