public async Task OnNEventReportRequestAsync_ShouldRespond() { var port = Ports.GetNext(); using (DicomServer.Create <AsyncDicomNServiceProvider>(port, logger: _logger.IncludePrefix("DicomServer"))) { var client = new Network.Client.DicomClient("127.0.0.1", port, false, "SCU", "ANY-SCP") { 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); } }
public DicomNEventReportResponse OnNEventReportRequest(DicomNEventReportRequest request) { return(new DicomNEventReportResponse(request, DicomStatus.Success) { Dataset = request.Dataset }); }
/// <summary> /// Initializes a new instance of the <see cref="DicomNEventReportResponse"/> class. /// </summary> /// <param name="request"> /// The request associated with the N-EVENTREPORT response. /// </param> /// <param name="status"> /// The response status. /// </param> public DicomNEventReportResponse(DicomNEventReportRequest request, DicomStatus status) : base(request, status) { if (request.HasSOPInstanceUID) { this.SOPInstanceUID = request.SOPInstanceUID; } this.EventTypeID = request.EventTypeID; }
public void SOPInstanceUIDGetter_ResponseCreatedFromRequest_DoesNotThrow() { var request = new DicomNEventReportRequest( DicomUID.BasicFilmSessionSOPClass, 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); }
public DicomNEventReportResponse OnNEventReportRequest(DicomNEventReportRequest request) { throw new NotImplementedException(); }
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(DicomNEventReportRequest request, DicomStatus status) : base(request, status) { }
/// <summary> /// Initializes a new instance of the <see cref="DicomNEventReportResponse"/> class. /// </summary> /// <param name="request"> /// The request associated with the N-EVENTREPORT response. /// </param> /// <param name="status"> /// The response status. /// </param> public DicomNEventReportResponse(DicomNEventReportRequest request, DicomStatus status) : base(request, status) { SOPInstanceUID = request.SOPInstanceUID; EventTypeID = request.EventTypeID; }
public Task <DicomNEventReportResponse> OnNEventReportRequestAsync(DicomNEventReportRequest request) { return(Task.FromResult(new DicomNEventReportResponse(request, DicomStatus.Success))); }
public Task <DicomNEventReportResponse> OnNEventReportRequestAsync(DicomNEventReportRequest request) => throw new NotImplementedException();