static void echomwl(string title, IPAddress address, int port) { VerificationServiceSCU echo = new VerificationServiceSCU(); echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian); QueryRetrieveServiceSCU mwl = new QueryRetrieveServiceSCU(); mwl.Syntaxes.Add(Syntax.ImplicitVrLittleEndian); Association association = new Association(); association.AddService(mwl); association.AddService(echo); if (association.Open(title, address, port)) { bool result = echo.Echo(); System.Console.WriteLine("\necho {0}.", (result) ? "succeded" : "failed"); if (result) { DataSet query = GetQuery(null); RecordCollection records = mwl.CFind(query); WriteRecords(records); } } else { System.Console.WriteLine("\ncan't Open."); } association.Close(); }
static void mwl2(string[] args) { Dictionary <string, string> arguments = null; try { arguments = ParseCommandLine(args); ApplicationEntity scp = new ApplicationEntity(arguments["scp"], IPAddress.Parse(arguments["address"]), Int32.Parse(arguments["port"])); ApplicationEntity scu = new ApplicationEntity(arguments["scu"], IPAddress.Parse("127.0.0.1"), 0); QueryRetrieveServiceSCU mwl = new QueryRetrieveServiceSCU(); mwl.Syntaxes.Add(Syntax.ExplicitVrLittleEndian); mwl.Syntaxes.Add(Syntax.ExplicitVrBigEndian); mwl.Syntaxes.Add(Syntax.ImplicitVrLittleEndian); Association association = new Association(); association.AddService(mwl); if (association.Open(scp, scu)) { DataSet query = GetQuery(arguments); RecordCollection records = mwl.CFind(query); WriteRecords(records); } else { System.Console.WriteLine("\ncan't Open."); } association.Close(); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(""); Console.WriteLine("usage: Test scp= address= port= [scu=] [tagname=]*"); Console.WriteLine("e.g. : Test scp=Worklist_SCP address=127.0.0.1 port=6104"); Console.WriteLine(""); } }