public void SendCStoreResponse(byte presentationID, ushort messageID, string affectedInstance, DicomStatus status, string errorComment)
{
var msg = new DicomMessage
{
MessageIdBeingRespondedTo = messageID,
CommandField = DicomCommandField.CStoreResponse,
AffectedSopClassUid = _assoc.GetAbstractSyntax(presentationID).UID,
AffectedSopInstanceUid = affectedInstance,
DataSetType = 0x0101,
Status = status,
};
if (!string.IsNullOrEmpty(errorComment))
{
msg.ErrorComment = errorComment.Substring(0, (int)Math.Min(DicomVr.LOvr.MaximumLength, errorComment.Length));
}
SendDimse(presentationID, msg.CommandSet, null);
}