protected override void OnReceiveCFindResponse(byte presentationID, int messageID, string affectedClass, DicomCommandStatusType status, DicomDataSet dataSet) { if ((_mainForm != null) && (_mainForm._mySettings.LogLowLevel)) { string sMsg = _sNewlineTab + "presentationID:\t" + presentationID.ToString() + _sNewlineTab + "messageID:\t" + messageID.ToString() + _sNewlineTab + "affectedClass:\t" + affectedClass + _sNewlineTab + "status:\t" + status.ToString(); _mainForm.LogText("OnReceiveCFindResponse", sMsg, System.Drawing.Color.Green); } base.OnReceiveCFindResponse(presentationID, messageID, affectedClass, status, dataSet); }
public void SendDownloadRequest(object param) { try { DicomDataSet ds = new DicomDataSet(); //you can set what ever elements you need, PatientID, StudyInstanceUID, SeriesInstnaceUID... //if you need to create private tags to set custom information we have to do it like this: // check this link for more information about creating custom tags: //https://www.leadtools.com/help/leadtools/v175/dh/di/leadtools.dicom~leadtools.dicom.dicomdataset~createprivatecreatordataelement.html { DicomElement privateCreatorElement = ds.CreatePrivateCreatorDataElement(null, 0x0017, 0x0012, "DownloadService"); DicomElement element = ds.InsertElement(null, false, CustomTags.JobID, DicomVRType.LT, false, 0); if (null != element) { ds.SetStringValue(element, param.ToString(), DicomCharacterSetType.Default); //(0x11,0x0010) } else { throw new Exception("Can't Insert Element"); } } byte presentation = GetPresentation(); SendNActionRequest(presentation, 1, CustomUID.DownloadImagesClass, CustomUID.DownloadImagesInstance, 1, ds); Wait(); //blocks until we receive the response from the server Release(); if (_status != DicomCommandStatusType.Success) { throw new ApplicationException("Error adding a c-move job: " + _status.ToString()); } else { //success, the server received the request and processing the message. } } catch (Exception e) { Logger.Global.Log(string.Empty, string.Empty, -1, string.Empty, string.Empty, -1, DicomCommandType.Undefined, DateTime.Now, LogType.Information, MessageDirection.None, e.Message, null, null); throw; } }