diff -r 9d876ea52df4 -r 7816aaa5db17 OrthancExplorer/explorer.js
--- a/OrthancExplorer/explorer.js Thu May 16 15:45:38 2013 +0200
+++ b/OrthancExplorer/explorer.js Fri May 17 17:32:16 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 9d876ea52df4 -r 7816aaa5db17 OrthancServer/OrthancRestApi.cpp
--- a/OrthancServer/OrthancRestApi.cpp Thu May 16 15:45:38 2013 +0200
+++ b/OrthancServer/OrthancRestApi.cpp Fri May 17 17:32:16 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)