Imports Leadtools
Imports Leadtools.Dicom.Scu
Imports Leadtools.Dicom.Scu.Common
Imports Leadtools.Dicom
Imports Leadtools.Dicom.Common.DataTypes
Public Sub MoveSeries()
DicomEngine.Startup()
DicomNet.Startup()
Dim retrieveSeries As QueryRetrieveScu = New QueryRetrieveScu()
Dim query As FindQuery = New FindQuery()
Dim scp As DicomScp = New DicomScp()
'
' Change these parameters to reflect the calling AETitle.
'
retrieveSeries.AETitle = "LEAD_CLIENT"
retrieveSeries.HostPort = 1000
retrieveSeries.HostAddress = Dns.GetHostEntry(Dns.GetHostName()).AddressList.FirstOrDefault(Function(ip) ip.AddressFamily = AddressFamily.InterNetwork)
'
' Change these parameters to reflect the called AETitle (server).
'
scp.AETitle = "MI_SERVER"
scp.Port = 104
scp.Timeout = 60
scp.PeerAddress = IPAddress.Parse("10.1.1.96")
AddHandler retrieveSeries.BeforeCMove, AddressOf retrieveSeries_BeforeCMove
AddHandler retrieveSeries.Moved, AddressOf retrieveSeries_Moved
AddHandler retrieveSeries.AfterCMove, AddressOf retrieveSeries_AfterCMove
retrieveSeries.Move(scp, String.Empty, "1.2.840.114257.3.6.5.41964868", "1.2.840.114257.3.6.5.5.4214471")
DicomNet.Shutdown()
DicomEngine.Shutdown()
End Sub
Private Sub retrieveSeries_BeforeCMove(ByVal sender As Object, ByVal e As BeforeCMoveEventArgs)
Console.WriteLine("Before CMove")
End Sub
Private Sub retrieveSeries_Moved(ByVal sender As Object, ByVal e As MovedEventArgs)
Console.WriteLine(e.Patient.Name.Full)
Console.WriteLine(e.Study.AccessionNumber)
Console.WriteLine(e.Series.Number)
Console.WriteLine(e.Instance.SOPInstanceUID)
Console.WriteLine("==========================================")
End Sub
Private Sub retrieveSeries_AfterCMove(ByVal sender As Object, ByVal e As AfterCMoveEventArgs)
Console.WriteLine("{0} Completed", e.Completed)
Console.WriteLine("{0} Failed", e.Failed)
Console.WriteLine("{0} Warning", e.Warning)
Console.WriteLine("Status: {0}", e.Status)
End Sub
using Leadtools;
using Leadtools.Dicom.Scu;
using Leadtools.Dicom.Scu.Common;
using Leadtools.Dicom;
using Leadtools.Dicom.Common.DataTypes;
public void MoveSeries()
{
DicomEngine.Startup();
DicomNet.Startup();
QueryRetrieveScu retrieveSeries = new QueryRetrieveScu();
FindQuery query = new FindQuery();
DicomScp scp = new DicomScp();
//
// Change these parameters to reflect the calling AETitle.
//
retrieveSeries.AETitle = "LEAD_CLIENT";
retrieveSeries.HostPort = 1000;
retrieveSeries.HostAddress = Dns.GetHostEntry(Dns.GetHostName()).AddressList.FirstOrDefault(ip => ip.AddressFamily == AddressFamily.InterNetwork);
//
// Change these parameters to reflect the called AETitle (server).
//
scp.AETitle = "MI_SERVER";
scp.Port = 104;
scp.Timeout = 60;
scp.PeerAddress = IPAddress.Parse("10.1.1.96");
retrieveSeries.BeforeCMove += new BeforeCMoveDelegate(retrieveSeries_BeforeCMove);
retrieveSeries.Moved += new MovedDelegate(retrieveSeries_Moved);
retrieveSeries.AfterCMove += new AfterCMoveDelegate(retrieveSeries_AfterCMove);
retrieveSeries.Move(scp, string.Empty, "1.2.840.114257.3.6.5.41964868", "1.2.840.114257.3.6.5.5.4214471");
DicomNet.Shutdown();
DicomEngine.Shutdown();
}
void retrieveSeries_BeforeCMove(object sender, BeforeCMoveEventArgs e)
{
Console.WriteLine("Before CMove");
}
void retrieveSeries_Moved(object sender, MovedEventArgs e)
{
Console.WriteLine(e.Patient.Name.Full);
Console.WriteLine(e.Study.AccessionNumber);
Console.WriteLine(e.Series.Number);
Console.WriteLine(e.Instance.SOPInstanceUID);
Console.WriteLine("==========================================");
}
void retrieveSeries_AfterCMove(object sender, AfterCMoveEventArgs e)
{
Console.WriteLine("After CMove");
Console.WriteLine("\t{0} Completed", e.Completed);
Console.WriteLine("\t{0} Failed", e.Failed);
Console.WriteLine("\t{0} Warning", e.Warning);
Console.WriteLine("\tStatus: {0}", e.Status);
}