public async Task OnNEventReportRequestAsync_ShouldRespond() { var port = Ports.GetNext(); using (DicomServerFactory.Create <AsyncDicomNServiceProvider>(port, logger: _logger.IncludePrefix("DicomServer"))) { var client = DicomClientFactory.Create("127.0.0.1", port, false, "SCU", "ANY-SCP"); client.Logger = _logger.IncludePrefix(typeof(DicomClient).Name); DicomNEventReportResponse response = null; DicomRequest.OnTimeoutEventArgs timeout = null; var request = new DicomNEventReportRequest( DicomUID.BasicFilmSession, new DicomUID("1.2.3", null, DicomUidType.SOPInstance), 1) { OnResponseReceived = (req, res) => response = res, OnTimeout = (sender, args) => timeout = args }; await client.AddRequestAsync(request).ConfigureAwait(false); await client.SendAsync().ConfigureAwait(false); Assert.NotNull(response); Assert.Equal(DicomStatus.Success, response.Status); Assert.Null(timeout); } }
internal async Task <DicomResponse> OnNEventReportRequestAsync(DicomNEventReportRequest request) { if (OnNEventReportRequest == null) { return(new DicomNEventReportResponse(request, DicomStatus.AttributeListError)); } return(await OnNEventReportRequest(request).ConfigureAwait(false)); }
public void SOPInstanceUIDGetter_ResponseCreatedFromRequest_DoesNotThrow() { var request = new DicomNEventReportRequest( DicomUID.BasicFilmSession, new DicomUID("1.2.3", null, DicomUidType.SOPInstance), 1); var response = new DicomNEventReportResponse(request, DicomStatus.Success); var exception = Record.Exception(() => response.SOPInstanceUID); Assert.Null(exception); }
void OnPrintJobStatusUpdate(object sender, StatusUpdateEventArgs e) { var printJob = sender as PrintJob; if (printJob.SendNEventReport) { var reportRequest = new DicomNEventReportRequest(printJob.SOPClassUID, printJob.SOPInstanceUID, e.EventTypeId); var ds = new DicomDataset(); ds.Add(DicomTag.ExecutionStatusInfo, e.ExecutionStatusInfo); ds.Add(DicomTag.FilmSessionLabel, e.FilmSessionLabel); ds.Add(DicomTag.PrinterName, e.PrinterName); reportRequest.Dataset = ds; this.SendRequest(reportRequest); } }
public DicomNEventReportResponse OnNEventReportRequest(DicomNEventReportRequest request) { //Console.WriteLine("OnNEventReportRequest:{0}", request.EventTypeID); // string OnNEventReportRequest = request.EventTypeID.ToString(); // string studyInstanceUId = request.Dataset.Get<string>(DicomTag.StudyInstanceUID); DicomSequence seq = null; seq = request.Dataset.Get <DicomSequence>(DicomTag.ReferencedSOPSequence); DicomDataset d = seq.Items.First(); string studyInstanceUId = d.Get <string>(DicomTag.StudyInstanceUID); string sendState = "success"; OnDicomNEevent.BeginInvoke(new StudySendArgs() { StudyInstanceUID = studyInstanceUId, SendState = sendState }, null, null); return(new DicomNEventReportResponse(request, DicomStatus.Success)); }
private void OnPrintJobStatusUpdate(object sender, StatusUpdateEventArgs e) { var printJob = sender as PrintJob; if (printJob.SendNEventReport) { var reportRequest = new DicomNEventReportRequest( printJob.SOPClassUID, printJob.SOPInstanceUID, e.EventTypeId); var ds = new DicomDataset { { DicomTag.ExecutionStatusInfo, e.ExecutionStatusInfo }, { DicomTag.FilmSessionLabel, e.FilmSessionLabel }, { DicomTag.PrinterName, e.PrinterName } }; reportRequest.Dataset = ds; SendRequestAsync(reportRequest).Wait(); } }
public async Task <DicomNEventReportResponse> OnNEventReportRequestAsync(DicomNEventReportRequest request) { Logger.Log(LogLevel.Info, "receiving N-Event, not supported"); return(new DicomNEventReportResponse(request, DicomStatus.UnrecognizedOperation)); }
public DicomNEventReportResponse OnNEventReportRequest(DicomNEventReportRequest request) { throw new NotImplementedException(); }
public Task <DicomNEventReportResponse> OnNEventReportRequestAsync(DicomNEventReportRequest request) { throw new NotImplementedException(); }
public DicomNEventReportResponse OnNEventReportRequest(DicomNEventReportRequest request) { return(new DicomNEventReportResponse(request, DicomStatus.Success)); }
public Task <DicomNEventReportResponse> OnNEventReportRequestAsync(DicomNEventReportRequest request) => Task.FromResult(new DicomNEventReportResponse(request, DicomStatus.Success) { Dataset = request.Dataset });
public Task <DicomResponse> OnNEventReportRequestAsync(DicomNEventReportRequest request) { return(DicomClient.OnNEventReportRequestAsync(request)); }
public DicomNEventReportResponse OnNEventReportRequest(DicomNEventReportRequest request) { return(null); }
public Task <DicomResponse> OnNEventReportRequestAsync(DicomNEventReportRequest request) => DicomClient.OnNEventReportRequestAsync(request);