Skip to content

Commit

Permalink
#4545 : RESTful service to update Instance Attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
vrindanayak committed Sep 16, 2024
1 parent 62ff665 commit 79dded8
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,25 @@ public void updateInstance(StudyMgtContext ctx) throws StudyMissingException, Pa
if (attrs.diff(newAttrs, filter.getSelection(false), modified, true) == 0)
return;

ctx.setEventActionCode(AuditMessages.EventActionCode.Update);
ctx.setStudy(instance.getSeries().getStudy());
if (ctx.getPatient() == null)
ctx.setPatient(instance.getSeries().getStudy().getPatient());
else if (instance.getSeries().getStudy().getPatient().getPk() != ctx.getPatient().getPk())
throw new PatientMismatchException(ctx.getPatient()
+ " found using patient identifiers sent in request payload does not match with "
+ instance.getSeries().getStudy().getPatient() + " of " + instance);

Attributes.unifyCharacterSets(newAttrs, attrs);
newAttrs.addSelected(attrs, null, Tag.OriginalAttributesSequence);
attrs = newAttrs;
instance.setAttributes(ctx.getReasonForModification() != null
? attrs.addOriginalAttributes(
ctx.getSourceOfPreviousValues(),
new Date(),
ctx.getReasonForModification(),
device.getDeviceName(),
modified)
ctx.getSourceOfPreviousValues(),
new Date(),
ctx.getReasonForModification(),
device.getDeviceName(),
modified)
: attrs,
filter, true, ctx.getFuzzyStr());
em.createNamedQuery(Series.SCHEDULE_METADATA_UPDATE_FOR_SERIES)
Expand Down

0 comments on commit 79dded8

Please sign in to comment.