我试图用FO框架实现存储承诺,但没有结果。我能够创建N动作请求。我能收到N-行动的反应。但我不知道如何接收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;
}发布于 2017-02-19 08:02:08
免责声明:我从未使用过FO.下面的代码只是一个伪代码,不是语法.我希望看到伪代码,您将能够在工具箱中找到确切的成员(属性、方法和事件)。
在您的代码中,您已经在构建请求数据集。然后,您将调用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的能力。您已经通过编写行NAction向客户端添加了client.AddRequest(nAction);。查看工具包文档,看看是否还需要为NEventReport添加类似的内容。我强烈认为这不应该是必要的,你只需要订阅一个事件。
https://stackoverflow.com/questions/42285941
复制相似问题