From dc2d97975fe72f54e124e645131e4be2459e102a Mon Sep 17 00:00:00 2001 From: vrinda Date: Thu, 11 Apr 2019 13:07:16 +0200 Subject: [PATCH] Fix #1921 : IOCM-RS Update Patient Service : Incorrect RSOperation being sent to RSForward Service --- .../src/main/java/org/dcm4chee/arc/iocm/rs/IocmRS.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dcm4chee-arc-iocm-rs/src/main/java/org/dcm4chee/arc/iocm/rs/IocmRS.java b/dcm4chee-arc-iocm-rs/src/main/java/org/dcm4chee/arc/iocm/rs/IocmRS.java index 6c26c83d85..c1743111c5 100644 --- a/dcm4chee-arc-iocm-rs/src/main/java/org/dcm4chee/arc/iocm/rs/IocmRS.java +++ b/dcm4chee-arc-iocm-rs/src/main/java/org/dcm4chee/arc/iocm/rs/IocmRS.java @@ -300,13 +300,19 @@ public void updatePatient(@PathParam("PatientID") IDWithIssuer patientID, InputS errResponse("missing Patient ID in message body", Response.Status.BAD_REQUEST)); try { boolean newPatient = patientID.equals(bodyPatientID); - if (newPatient) + RSOperation rsOp; + if (newPatient) { patientService.updatePatient(ctx); + rsOp = ctx.getEventActionCode().equals(AuditMessages.EventActionCode.Create) + ? RSOperation.CreatePatient + : RSOperation.UpdatePatient; + } else { + rsOp = RSOperation.ChangePatientID; ctx.setPreviousAttributes(patientID.exportPatientIDWithIssuer(null)); patientService.changePatientID(ctx); } - rsForward.forward(RSOperation.UpdatePatient, arcAE, attrs, request); + rsForward.forward(rsOp, arcAE, attrs, request); String msgType = ctx.getEventActionCode().equals(AuditMessages.EventActionCode.Create) ? newPatient ? "ADT^A28^ADT_A05" : "ADT^A47^ADT_A30"