Thursday, February 09, 2012
Google Custom Search

ClearCanvas Highlights

Download our Open Source software
Watch some Videos
Get the Source
Check out our Licensing
Join our  Forums
Some Research: OICR IPP-Trials

Our Community

Membership Membership:
Latest New User Latest: she
New Today New Today: 15
New Yesterday New Yesterday: 26
User Count Overall: 20578

People Online People Online:
Visitors Visitors: 12
Members Members: 1
Total Total: 13

Online Now Online Now:
01: rlake

ClearCanvas Community Forums

How can i get data from remote file via port?
Last Post 2010-05-10 12:53 PM by stewart. 1 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Phsika
New Member
New Member
Posts:9

--
2010-04-30 11:04 AM  

 can i access remote database via this code or can i get data from remote file via port?

 

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Diagnostics;

using System.Linq;

using System.ServiceProcess;

using System.Text;

using System.ServiceModel;

using ClearCanvas.Dicom.ServiceModel.Query;

using ClearCanvas.ImageViewer.Services.Automation;

using ClearCanvas.Desktop.View.WinForms;

namespace WindowsService1

{

    public partial class Service1 : ServiceBase

    {

        public Service1()

        {

            InitializeComponent();

        }

 

        protected override void OnStart(string[] args)

        {

        }

 

        protected override void OnStop()

        {

        }

 

        public static IList FindStudyByPatientId(string patientId)

        {

 

            BasicHttpBinding binding = new BasicHttpBinding();

            EndpointAddress endpoint = new EndpointAddress("http://127.0.0.1:51124/ClearCanvas/ImageViewer/StudyLocator?wsdl");

            StudyRootQueryServiceClient client = new StudyRootQueryServiceClient(binding, endpoint);

 

            try

            {

 

                client.Open();

                StudyRootStudyIdentifier identifier = new StudyRootStudyIdentifier();

                identifier.PatientId = patientId;

                IList results = client.StudyQuery(identifier);

                client.Close();

                return results;

 

            }

 

            catch (Exception)

            {

 

                client.Abort();

                throw;

 

            }

 

        }

 

        public static void OpenStudy(string studyInstanceUid)

        {

 

            BasicHttpBinding binding = new BasicHttpBinding();

 

            EndpointAddress endpoint = new EndpointAddress("http://127.0.0.1:51124/ClearCanvas/ImageViewer/Automation?wsdl");

 

           ViewerAutomationServiceClient client = new ViewerAutomationServiceClient(binding, endpoint);

 

 

 

            try

            {

 

                client.Open();

 

                OpenStudiesRequest request = new OpenStudiesRequest();

 

                request.ActivateIfAlreadyOpen = true;

 

                List studiesToOpen = new List();

 

 

 

                OpenStudyInfo info = new OpenStudyInfo(studyInstanceUid);

 

                studiesToOpen.Add(info);

 

                request.StudiesToOpen = studiesToOpen;

 

                client.OpenStudies(request);

 

 

 

                client.Close();

 

            }

 

            catch (Exception e)

            {

 

                client.Abort();

 

             // MessageBox.Show(e.Message);

 

            }

 

        }

 

 

    }

}

 

stewart
Senior Member
Senior Member
Posts:2032

--
2010-05-10 12:53 PM  
This code would be used by an external application to tell a running instance of the CC viewer to *open* a study. The automation feature does not automatically retrieve studies for viewing.

If you want to retrieve a file via DICOM, you would use the Dicom.Network.StudyRootMoveScu where you are currently using an automation service proxy.

Hope this helps,
Stewart
Real-time support available to Clinical Edition and Team Edition customers
You are not authorized to post a reply.

Active Forums 4.1
Copyright 2011 ClearCanvas Inc.