# HG changeset patch # User Sebastien Jodogne # Date 1406128208 -7200 # Node ID 1701dcb6f5545828f25b446ca90425efe8a1e45d # Parent ee5cbe6e48d327e262085166d584a8326e52594b Access patient module at the study level to cope with PatientID collisions diff -r ee5cbe6e48d3 -r 1701dcb6f554 NEWS --- a/NEWS Wed Jul 23 16:52:03 2014 +0200 +++ b/NEWS Wed Jul 23 17:10:08 2014 +0200 @@ -1,10 +1,19 @@ Pending changes in the mainline =============================== + +General +------- + +* Access patient module at the study level to cope with PatientID collisions +* On-the-fly conversion of JSON to XML according to the HTTP Accept header +* C-Echo SCU in the REST API + +Plugins +------- + * Lookup for DICOM UIDs in the plugin SDK * Plugins have access to the HTTP headers and can answer with HTTP status codes -* On-the-fly conversion of JSON to XML according to the HTTP Accept header -* C-Echo SCU in the REST API Version 0.8.0 (2014/07/10) @@ -43,7 +52,7 @@ * Creation of DICOM instances using the REST API * Embedding of images within DICOM instances * Adding/removal/modification of remote modalities/peers through REST -* Reuse of the previous SCU connection to avoid unecessary handshakes +* Reuse of the previous SCU connection to avoid unnecessary handshakes * Fix problems with anonymization and modification * Fix missing licensing terms about reuse of some code from DCMTK * Various code refactorings @@ -172,7 +181,7 @@ ========================== * "Bulk" Store-SCU (send several DICOM instances with the same - DICOM connexion) + DICOM connection) * Store-SCU for patients and studies in Orthanc Explorer * Filtering of incoming DICOM instances (through Lua scripting) * Filtering of incoming HTTP requests (through Lua scripting) @@ -197,7 +206,7 @@ ------------- * Download of modified or anonymized DICOM instances -* Inplace modification and anymization of DICOM series, studies and patients +* Inplace modification and anonymization of DICOM series, studies and patients Minor changes ------------- diff -r ee5cbe6e48d3 -r 1701dcb6f554 OrthancServer/OrthancRestApi/OrthancRestResources.cpp --- a/OrthancServer/OrthancRestApi/OrthancRestResources.cpp Wed Jul 23 16:52:03 2014 +0200 +++ b/OrthancServer/OrthancRestApi/OrthancRestResources.cpp Wed Jul 23 17:10:08 2014 +0200 @@ -705,16 +705,23 @@ } - template - static void GetModule(RestApiGetCall& call) + static void GetModuleInternal(RestApiGetCall& call, + ResourceType resourceType, + ResourceType queryLevel) { + if (resourceType != queryLevel && + !(resourceType == ResourceType_Study && queryLevel == ResourceType_Patient)) + { + throw OrthancException(ErrorCode_NotImplemented); + } + ServerContext& context = OrthancRestApi::GetContext(call); std::string publicId = call.GetUriComponent("id", ""); bool simplify = call.HasArgument("simplify"); typedef std::set Module; Module module; - DicomTag::GetTagsForModule(module, resourceType); + DicomTag::GetTagsForModule(module, queryLevel); Json::Value tags; @@ -756,7 +763,21 @@ else { call.GetOutput().AnswerJson(result); - } + } + } + + + + template + static void GetModule(RestApiGetCall& call) + { + GetModuleInternal(call, resourceType, resourceType); + } + + + static void GetPatientModuleForStudy(RestApiGetCall& call) + { + GetModuleInternal(call, ResourceType_Study, ResourceType_Patient); } @@ -789,6 +810,7 @@ Register("/patients/{id}/module", GetModule); Register("/series/{id}/module", GetModule); Register("/studies/{id}/module", GetModule); + Register("/studies/{id}/module-patient", GetPatientModuleForStudy); Register("/instances/{id}/file", GetInstanceFile); Register("/instances/{id}/export", ExportInstanceFile);