LEADTOOLS WebForms and AJAX (Leadtools.Medical.WebViewer.ExternalControl assembly)

InitApplication Method

Show in webframe
Example 



An out parameter to be filled with the current application name
An out parameter to be filled with the current version
An integer specifying which port to use for communicating between the controller and the MedicalWebViewer
Starts the CommandQueue web service which the MedicalWebViewer will poll for commands once launched.
Syntax
'Declaration
 
Public Function InitApplication( _
   ByRef applicationName As String, _
   ByRef version As String, _
   ByVal externalControlPort As Integer _
) As ControllerReturnCode
'Usage
 
Dim instance As MedicalWebViewerExternalController
Dim applicationName As String
Dim version As String
Dim externalControlPort As Integer
Dim value As ControllerReturnCode
 
value = instance.InitApplication(applicationName, version, externalControlPort)
public ControllerReturnCode InitApplication( 
   out string applicationName,
   out string version,
   int externalControlPort
)
public:
ControllerReturnCode InitApplication( 
   [Out] String^ applicationName,
   [Out] String^ version,
   int externalControlPort
) 

Parameters

applicationName
An out parameter to be filled with the current application name
version
An out parameter to be filled with the current version
externalControlPort
An integer specifying which port to use for communicating between the controller and the MedicalWebViewer
Example
Copy Code  
Imports Leadtools
Imports Leadtools.Examples
Imports Leadtools.Medical.WebViewer.ExternalControl

Private Sub MedicalWebViewerExternalController_InitApplication()
    Dim applicationName As String
    Dim version As String
    Dim externalControlPort As Integer = 500
    ' Username a password to log in
    ' This will be the username and password that you created when running the CSPacsDatabaseConfig.exe demo
    Dim username As String = "bob"
    Dim password As String = "bob"

    ' These are the UIDs of datasets that are preinstalled in the CSStorageServerMananger.exe demo database
    Const jonesPatientId As String = "12341234"
    Const jonesStudyInstanceUid As String = "2.16.840.1.114151.4.862.39853.4041.912374"
    Const jonesSeriesInstanceUid As String = "1.2.392.200036.9107.500.305.5577.557709021107405.121"

    Dim controller As New MedicalWebViewerExternalController("http://localhost/MedicalViewer/")

    controller.Timeout = 30
    applicationName = String.Empty
    version = String.Empty
    controller.InitApplication(applicationName, version, externalControlPort)
    controller.SelectedBrowser = MedicalWebViewerBrowser.GoogleChrome
    Dim ret As ControllerReturnCode = controller.UserLogin(username, password)

    DisplayResult(ret)
    controller.ShowSeries(jonesStudyInstanceUid, jonesSeriesInstanceUid)

    Dim sMsg As String = String.Format("Displaying SeriesInstanceUID '{0}' in a {1} browser", jonesSeriesInstanceUid, controller.SelectedBrowser.ToString())
    MessageBox.Show(sMsg)
    controller.CloseApplication()


    controller.SelectedBrowser = MedicalWebViewerBrowser.InternetExplorer
    ret = controller.UserLogin(username, password)
    controller.ShowPatient(jonesPatientId)
    sMsg = String.Format("Displaying PatientID '{0}' in a {1} browser", jonesPatientId, controller.SelectedBrowser.ToString())
    MessageBox.Show(sMsg)

    controller.CloseApplication()

    ' Shutdown the command queue
    controller.Shutdown()
End Sub

Private Sub DisplayResult(ByVal ret As ControllerReturnCode)
    If ret <> ControllerReturnCode.Success Then
        Console.WriteLine(ret.ToString())
    End If
End Sub
using Leadtools;
using Leadtools.Examples;
using Leadtools.Medical.WebViewer.ExternalControl;

private void MedicalWebViewerExternalController_InitApplication()
{
   string applicationName;
   string version;
   int externalControlPort = 500;
   // Username a password to log in
   // This will be the username and password that you created when running the CSPacsDatabaseConfig.exe demo
   string username = "bob";
   string password = "bob";

   // These are the UIDs of datasets that are preinstalled in the CSStorageServerMananger.exe demo database
   const string jonesPatientId = "12341234";
   const string jonesStudyInstanceUid = "2.16.840.1.114151.4.862.39853.4041.912374";
   const string jonesSeriesInstanceUid = "1.2.392.200036.9107.500.305.5577.557709021107405.121";

   MedicalWebViewerExternalController controller = new MedicalWebViewerExternalController("http://localhost/MedicalViewer/");

   controller.Timeout = 30;
   controller.InitApplication(out applicationName, out version, externalControlPort);
   controller.SelectedBrowser = MedicalWebViewerBrowser.GoogleChrome;
   ControllerReturnCode ret = controller.UserLogin(username, password);

   DisplayResult(ret);
   controller.ShowSeries(jonesStudyInstanceUid, jonesSeriesInstanceUid);

   string sMsg = string.Format("Displaying SeriesInstanceUID '{0}' in a {1} browser", jonesSeriesInstanceUid, controller.SelectedBrowser.ToString());
   MessageBox.Show(sMsg);
   controller.CloseApplication();


   controller.SelectedBrowser = MedicalWebViewerBrowser.InternetExplorer;
   ret = controller.UserLogin(username, password);
   controller.ShowPatient(jonesPatientId);
   sMsg = string.Format("Displaying PatientID '{0}' in a {1} browser", jonesPatientId, controller.SelectedBrowser.ToString());
   MessageBox.Show(sMsg);

   controller.CloseApplication();

   // Shutdown the command queue
   controller.Shutdown();
}

private void DisplayResult(ControllerReturnCode ret)
{
   if (ret != ControllerReturnCode.Success)
   {
      Console.WriteLine(ret.ToString());
   }
}
Requirements

Target Platforms

See Also

Reference

MedicalWebViewerExternalController Class
MedicalWebViewerExternalController Members

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.