[英]Storage Commitment with fo-dicom
我正在嘗試使用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;
}
免責聲明:我從未使用過FO-DICOM。 下面的代碼只是一個偽代碼,不是FO-DICOM語法。 我希望查看偽代碼,您將能夠在工具包中找出確切的成員(屬性,方法和事件)。
在您的代碼中,您已經在構建請求數據集。 然后,您正在調用client.AddRequest(nAction);
然后client.Send(.......);
。 我假設這將在內部建立連接,關聯並將發送NAction請求。
然后你訂閱了private void NActionResponse(....)
事件。 我認為這個事件正在被解雇,你正在獲得NAction Response。
同樣,您應該訂閱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
}
正如我在其他答案中所說,你的SCU應該有能力處理NEventReport。 您已通過編寫行client.AddRequest(nAction);
將NAction添加到您的客戶端client.AddRequest(nAction);
。 檢查工具包文檔,看看是否還需要為NEventReport添加類似的東西。 我強烈認為不應該這樣做; 你只需要訂閱一個活動。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.