【问题标题】:Storage Commitment with fo-dicomfo-dicom 的存储承诺
【发布时间】:2017-02-16 22:31:33
【问题描述】:

我正在尝试使用 FO-DICOM 框架实施存储承诺,但没有结果。我能够创建 N-ACTION 请求。我能够收到 N-ACTION 响应。但我不知道如何接收 EVENTREPORT。任何人都可以帮助我并以正确的方式称呼我吗?

private DicomStatus _responseStatus;

public void SendRequestForCommitment(string scImageUid)
{
    var client = new DicomClient();

    var nAction = new DicomNActionRequest(DicomUID.StorageCommitmentPushModelSOPClass,
        new UIDGenerator().PrivatelyDefinedSoapInstanceUid(), 1);

    var ds = new DicomDataset();
    nAction.Dataset = ds;
    nAction.Dataset.Add(DicomTag.TransactionUID, new UIDGenerator().uid);

    var sps = new DicomDataset();
    nAction.Dataset.Add(new DicomSequence(DicomTag.ReferencedSOPSequence, sps));

    sps.Add(DicomTag.ReferencedSOPClassUID, DicomUID.SecondaryCaptureImageStorage);
    sps.Add(DicomTag.ReferencedSOPInstanceUID, scImageUid);

    DicomNActionRequest.ResponseDelegate nActionResponseDelegate = NActionResponse;
    nAction.OnResponseReceived = nActionResponseDelegate;

    client.AddRequest(nAction);
    client.Send("127.0.0.1", 105, false, "myAE", "DVTK_STRC_SCP");


}

private void NActionResponse(DicomNActionRequest request, DicomNActionResponse response)
{
    _responseStatus = response.Status;
}

【问题讨论】:

  • 好的,只包含我的代码:方法SendRequestForCommitment将NACTION请求发送到存储,scImageUid参数是我想要在安全存储时通知的辅助捕获图像的标识符,NActionResponse接收NACTION的响应调用....但是如何连接存储中的 EVENTREPORT 消息?
  • Fo-Dicom 是一个很好的 c# 框架,但用于客户端目的...缺少许多服务器功能...。很抱歉,我不得不面对同样的问题,最后我必须自己开发此功能
  • 通用建议:查看客户端的dicom库是否有网络通信的日志,还要查看服务器端的dicom库是否也有网络日志。如果这些都没有提供任何帮助,那么您可能想知道 Wireshark 有一个用于网络捕获的 dicom 过滤器,非常有用。

标签: c# dicom medical fo-dicom


【解决方案1】:

免责声明:我从未使用过 FO-DICOM。下面的代码只是一个伪代码,不是 FO-DICOM 语法。我希望通过查看伪代码,您将能够找出工具包中的确切成员(属性、方法和事件)。

在您的代码中,您已经在构建请求数据集。然后,您拨打client.AddRequest(nAction);,然后拨打client.Send(.......);。我假设这将在内部建立连接、关联并发送 NAction 请求。

那么您已经订阅了private void NActionResponse(....) 事件。我假设这个事件被触发并且你得到了 NAction 响应。

同样,您应该订阅 NEventReport 事件(在工具包中查找确切的语法),如下所示:

private void NEventReportReceived(DicomNEventReport request, ......)
{
    //Parse the request here.
    //Check what files were archived and what were failed.
    //Do your stuff accordingly.
    //Send NEventReport response conveying the status.

    client.SendReleaseRequest();
}

订阅另一个事件来处理发布响应。

private void ReleaseResponseReceived(......)
{
    //Close connection
}

正如我在other 回答中所说,您的 SCU 应该有能力处理 NEventReport。您已经通过写client.AddRequest(nAction); 将NAction 添加到您的客户。检查工具包文档以查看是否还需要为 NEventReport 添加类似内容。我强烈认为这不应该是必要的;你只需要订阅一个事件。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-02-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-05
    • 1970-01-01
    相关资源
    最近更新 更多