Skip to content

Commit

Permalink
When modifying studies, dates selected from the DatePicker were not a…
Browse files Browse the repository at this point in the history
…lways taken into account
  • Loading branch information
amazy committed Oct 16, 2024
1 parent 32025af commit 4141d0d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
20 changes: 14 additions & 6 deletions WebApplication/src/components/ModifyModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ export default {
}
const originalPatient = await api.findPatient(this.originalTags['PatientID']);
this.updateDateTags();
const jobId = await api.modifyResource({
resourceLevel: 'patient',
orthancId: originalPatient['ID'],
Expand All @@ -269,6 +270,7 @@ export default {
console.log("modify-patient-tags-in-all-studies: created job ", jobId);
this.startMonitoringJob(jobId);
} else if (this.action == 'anonymize-study') {
this.updateDateTags();
const jobId = await api.anonymizeResource({
resourceLevel: 'study',
orthancId: this.orthancId,
Expand Down Expand Up @@ -322,6 +324,7 @@ export default {
// generate a new StudyInstanceUID (since we perform modification at series level, orthanc would keep even if not listed in keepTags)
this.tags['StudyInstanceUID'] = await api.generateUid('study');
this.updateDateTags();
const jobId = await api.modifyResource({
resourceLevel: 'series',
orthancId: this.orthancId,
Expand All @@ -343,6 +346,7 @@ export default {
console.log("modify-series-tags: created job ", jobId);
this.startMonitoringJob(jobId);
} else if (this.action == 'anonymize-series') {
this.updateDateTags();
const jobId = await api.anonymizeResource({
resourceLevel: 'series',
orthancId: this.orthancId,
Expand Down Expand Up @@ -540,8 +544,14 @@ export default {
return true;
}
return false;
}
},
updateDateTags() {
for (const [k,] of Object.entries(this.tags)) {
if (dateHelpers.isDateTag(k)) {
this.tags[k] = dateHelpers.dicomDateFromDatePicker(this.dateTags[k]);
}
}
},
},
computed: {
...mapState({
Expand Down Expand Up @@ -588,12 +598,10 @@ export default {
return (Object.keys(this.modifiedTags).length > 0 || areTagsRemoved)
},
modifiedTags() {
this.updateDateTags();
let modifiedTags = {};
for (const [k,] of Object.entries(this.tags)) {
if (dateHelpers.isDateTag(k)) {
this.tags[k] = dateHelpers.dicomDateFromDatePicker(this.dateTags[k]);
}
if (this.tags[k] != this.originalTags[k] && !this.removedTags[k]) {
modifiedTags[k] = this.tags[k];
}
Expand Down
7 changes: 7 additions & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Pending changes
===============

Fixes:
- When modifying studies, dates selected from the DatePicker were not always taken into account.


1.6.4 (2024-10-10)
==================

Expand Down

0 comments on commit 4141d0d

Please sign in to comment.