# HG changeset patch # User Sebastien Jodogne # Date 1368802530 -7200 # Node ID be93b666ed79e991cbf357fb81d24bef547b2ec7 # Parent 40deb65253375ca83bea46037ecd0a0717157945 link anonymized to original resource in OrthancExplorer diff -r 40deb6525337 -r be93b666ed79 OrthancExplorer/explorer.html --- a/OrthancExplorer/explorer.html Fri May 17 16:06:38 2013 +0200 +++ b/OrthancExplorer/explorer.html Fri May 17 16:55:30 2013 +0200 @@ -98,6 +98,9 @@ @@ -138,6 +141,9 @@ @@ -180,6 +186,9 @@ diff -r 40deb6525337 -r be93b666ed79 OrthancExplorer/explorer.js --- a/OrthancExplorer/explorer.js Fri May 17 16:06:38 2013 +0200 +++ b/OrthancExplorer/explorer.js Fri May 17 16:55:30 2013 +0200 @@ -356,6 +356,23 @@ +function SetupAnonymizedFrom(buttonSelector, resource, resourceType) +{ + if ('AnonymizedFrom' in resource) + { + $(buttonSelector).closest('li').show(); + $(buttonSelector).click(function(e) { + window.location.assign('explorer.html#' + resourceType + '?uuid=' + resource.AnonymizedFrom); + window.location.reload(); + }); + } + else + { + $(buttonSelector).closest('li').hide(); + } +} + + $('#patient').live('pagebeforeshow', function() { if ($.mobile.pageData) { GetSingleResource('patients', $.mobile.pageData.uuid, function(patient) { @@ -381,6 +398,8 @@ target.append(FormatStudy(studies[i], '#study?uuid=' + studies[i].ID)); } + SetupAnonymizedFrom('#patient-anonymized-from', patient, 'patient'); + target.listview('refresh'); // Check whether this patient is protected @@ -417,6 +436,8 @@ .append(FormatStudy(study)) .listview('refresh'); + SetupAnonymizedFrom('#study-anonymized-from', study, 'study'); + var target = $('#list-series'); $('li', target).remove(); for (var i = 0; i < series.length; i++) { @@ -456,6 +477,8 @@ .append(FormatSeries(series)) .listview('refresh'); + SetupAnonymizedFrom('#series-anonymized-from', series, 'series'); + var target = $('#list-instances'); $('li', target).remove(); for (var i = 0; i < instances.length; i++) { diff -r 40deb6525337 -r be93b666ed79 OrthancServer/OrthancRestApi.cpp --- a/OrthancServer/OrthancRestApi.cpp Fri May 17 16:06:38 2013 +0200 +++ b/OrthancServer/OrthancRestApi.cpp Fri May 17 16:55:30 2013 +0200 @@ -1319,7 +1319,7 @@ /** - * Record metadata information (AnonimizedFrom/ModifiedFrom). + * Record metadata information (AnonymizedFrom/ModifiedFrom). **/ DicomInstanceHasher modifiedHasher = modified->GetHasher(); @@ -1348,6 +1348,9 @@ if (isFirst) { + context.GetIndex().SetMetadata(modifiedHasher.HashPatient(), + metadataType, originalHasher.HashPatient()); + std::string newId; switch (resourceType)