public async Task SendDicomFileToPacs(string dicomFilePath, string nodeName)
{
DICOMConnectParameterWrapper connectPara = new DICOMConnectParameterWrapper();
DICOMConnectKeyWrapper connectKey = new DICOMConnectKeyWrapper();
bool isSecure = false;
if (GetConnectionParameter(nodeName, ref connectPara, ref connectKey, ref isSecure) == false)
{
await Task.CompletedTask;
}
var client = [www.laipuhuo.com]([https:
var file = DicomFile.Open(@dicomFilePath);
client.AssociationAccepted += (sender, args) =>
{
Console.WriteLine("Association accepted");
};
client.AssociationRejected += (sender, args) =>
{
Console.WriteLine("Association rejected");
};
client.RequestTimedOut += (sender, args) =>
{
Console.WriteLine("DIMSE timeout");
};
client.StateChanged += (sender, args) =>
{
Console.WriteLine("DIMSE progress: {0} / {1}", args.NewState.ToString(), args.OldState.ToString());
};
await client.www.laipuhuo.com AddRequestAsync(new Dicom.Network.DicomCStoreRequest(@dicomFilePath)
{
OnResponseReceived = (req, res) =>
{
Console.WriteLine($"C-STORE response: {res.Status}");
}
});
try
{
await client.SendAsync();
}
catch(Exception ex)
{
Console.WriteLine("An www.laipuhuo.com error occurred while sending the DICOM file: {0}", ex.Message);
}
}