# HG changeset patch # User Sebastien Jodogne # Date 1359385089 -3600 # Node ID 64625960af22c6d5f0b164e96cf0bdef5e6bc054 # Parent 8031f9cfe7fe702e92b364da3eeaf7ea3a571f97 fix diff -r 8031f9cfe7fe -r 64625960af22 OrthancExplorer/explorer.html --- a/OrthancExplorer/explorer.html Mon Jan 28 15:36:44 2013 +0100 +++ b/OrthancExplorer/explorer.html Mon Jan 28 15:58:09 2013 +0100 @@ -91,6 +91,7 @@ Delete this patient Download ZIP + Anonymize

diff -r 8031f9cfe7fe -r 64625960af22 OrthancExplorer/explorer.js --- a/OrthancExplorer/explorer.js Mon Jan 28 15:36:44 2013 +0100 +++ b/OrthancExplorer/explorer.js Mon Jan 28 15:58:09 2013 +0100 @@ -837,7 +837,11 @@ async: false, cache: false, success: function(s) { - $.mobile.changePage('#patient?uuid=' + s.PatientID); + // The following line does not work... + //$.mobile.changePage('explorer.html#patient?uuid=' + s.PatientID); + + window.location.assign('explorer.html#patient?uuid=' + s.PatientID); + window.location.reload(); } }); }, @@ -866,3 +870,8 @@ OpenAnonymizeResourceDialog('../series/' + $.mobile.pageData.uuid, 'Anonymize this series?'); }); + +$('#patient-anonymize').live('click', function() { + OpenAnonymizeResourceDialog('../patients/' + $.mobile.pageData.uuid, + 'Anonymize this patient?'); +}); diff -r 8031f9cfe7fe -r 64625960af22 OrthancServer/OrthancRestApi.cpp --- a/OrthancServer/OrthancRestApi.cpp Mon Jan 28 15:36:44 2013 +0100 +++ b/OrthancServer/OrthancRestApi.cpp Mon Jan 28 15:58:09 2013 +0100 @@ -1413,6 +1413,36 @@ } + static void ModifyPatientInplace(RestApi::PostCall& call) + { + Removals removals; + Replacements replacements; + bool removePrivateTags; + + if (ParseModifyRequest(removals, replacements, removePrivateTags, call)) + { + AnonymizeOrModifyResource(removals, replacements, removePrivateTags, + MetadataType_ModifiedFrom, ChangeType_ModifiedPatient, + ResourceType_Patient, call); + } + } + + + static void AnonymizePatientInplace(RestApi::PostCall& call) + { + Removals removals; + Replacements replacements; + bool removePrivateTags; + + if (ParseAnonymizationRequest(removals, replacements, removePrivateTags, call)) + { + AnonymizeOrModifyResource(removals, replacements, removePrivateTags, + MetadataType_AnonymizedFrom, ChangeType_AnonymizedPatient, + ResourceType_Patient, call); + } + } + + // Registration of the various REST handlers -------------------------------- @@ -1472,10 +1502,12 @@ Register("/instances/{id}/modify", ModifyInstance); Register("/series/{id}/modify", ModifySeriesInplace); Register("/studies/{id}/modify", ModifyStudyInplace); + Register("/patients/{id}/modify", ModifyPatientInplace); Register("/instances/{id}/anonymize", AnonymizeInstance); Register("/series/{id}/anonymize", AnonymizeSeriesInplace); Register("/studies/{id}/anonymize", AnonymizeStudyInplace); + Register("/patients/{id}/anonymize", AnonymizePatientInplace); Register("/tools/generate-uid", GenerateUid); }