public async Task OnCEchoRequestAsync_ShouldRespond() { var port = Ports.GetNext(); using (DicomServerFactory.Create <AsyncDicomCEchoProvider>(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); DicomCEchoResponse response = null; DicomRequest.OnTimeoutEventArgs timeout = null; var request = new DicomCEchoRequest { 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 override Task <DicomCEchoResponse> OnCEchoRequestAsync(DicomCEchoRequest request) { var response = new DicomCEchoResponse(request, DicomStatus.Success) { Dataset = new DicomDataset { { DicomTag.PatientComments, _someInterface.GetValue() } } }; return(Task.FromResult(response)); }
private void CallBackEcho(DicomCEchoRequest creq, DicomCEchoResponse cres) { if (cres.Status == Dicom.Network.DicomStatus.Success) { MessageBox.Show("Pacs 在线"); } else { MessageBox.Show("Pacs 不在线"); } }
private static void OnEchoResponseReceivedFromRemoteHost(DicomCEchoRequest request, DicomCEchoResponse response) { LogToDebugConsole($"DICOM Echo Verification request was received by remote host"); LogToDebugConsole($"Response was received from remote host..."); LogToDebugConsole($"Verification response status returned was:{response.Status.ToString()}"); }