Skip to content

Commit

Permalink
Fix status codes of C-Move SCP response
Browse files Browse the repository at this point in the history
- Status.ProcessingFailure and other constants in this class
  need to be complemented with the base error code
  • Loading branch information
Enet4 committed Jan 3, 2025
1 parent cc35869 commit 39b2553
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ protected DimseRSP doCMove(Association as, int pcid, DicomObject cmd, DicomObjec

/** Verify if it have the field destination */
if (destination == null) {
throw new DicomServiceException(cmd, Status.UnrecognizedOperation, "Missing Move Destination");
throw new DicomServiceException(cmd, 0xC000 | Status.UnrecognizedOperation, "Missing Move Destination");
}

String SOPUID = new String(data.get(Integer.parseInt("0020000D", 16)).getBytes());
Expand Down Expand Up @@ -233,13 +233,13 @@ protected DimseRSP doCMove(Association as, int pcid, DicomObject cmd, DicomObjec
int code = totalErrors > 0 ? 0xB000 : Status.Success;
rsp.putInt(Tag.Status, VR.US, code);
} else {
rsp.putInt(Tag.Status, VR.US, Status.ProcessingFailure);
rsp.putInt(Tag.Status, VR.US, 0xC000 | Status.ProcessingFailure);
rsp.putInt(Tag.ErrorID, VR.US, ERROR_ID_FILE_TRANSMISSION);
}

} catch (Exception ex) {
logger.error("Failed to send files to DICOM node {}", destination, ex);
rsp.putInt(Tag.Status, VR.US, Status.ProcessingFailure);
rsp.putInt(Tag.Status, VR.US, 0xC000 | Status.ProcessingFailure);
rsp.putInt(Tag.ErrorID, VR.US, ERROR_ID_GENERAL_FAILURE);
}
}
Expand Down

0 comments on commit 39b2553

Please sign in to comment.