Class Name: |
HL7PlusController |
HL7+ Category: |
|
Description: |
The parent object for all of the HL7+ restricted object classes. |
HL7PlusController.IsRunnable Property
Property Name |
Data Type |
Description |
---|---|---|
IsRunnable |
Boolean |
This property is the beating heart of the HL7+ Components. This property MUST be True or you cannot use any of the Restricted HL7+ Component object classes, or any of the Restricted Methods in the Partially Restricted object classes. When this property is referenced the HL7PlusController object will query the HL7+ Client Windows Service which will reply (if it's running) with the current status of your HL7+ Installation. See Troubleshooting Problems for more information about why IsRunnable may be returning False and how to fix. |
|
|
This object class uses our standard HL7PlusException Class interface for error handling wherever possible.
See the HL7PlusException Implementation Reference
|
*All example code is in Visual Basic.Net
'---Declare at the Class or Global level Private MyController As New HL7PlusController
Friend Function MyClassCode() As Boolean Try With MyController If Not .IsRunnable Then '--Everyone out of the pool until this is fixed MessageBox.Show(.RegistrationErrorMessage, "Error") Return False End If End With '.....Code.... '.....Code.... '.....Code.... '.....Code.... Return True Catch ex As Exception MessageBox.Show(ex.Message, "Error") Return False End Try End Function |
A simple test. Can you use the HL7+ Components? *All example code is in Visual Basic.Net While the test code below is fine, it's not really ideal. See Example Code 2 for a better way.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Try Dim o As New HL7PlusController Dim sMsg As String = "" With o If Not .IsRunnable Then sMsg = "Not runnable." & Environment.NewLine & Environment.NewLine & "Error Message=" & o.RegistrationErrorMessage MessageBox.Show(sMsg) Return End If sMsg = "Yes the components are runnable. Now we can move forward to test some other objects." sMsg &= Environment.NewLine & Environment.NewLine & "Installation Name = " & o.InstallationName & Environment.NewLine & "Expires: " & o.ExpiresOn.ToShortDateString MessageBox.Show(sMsg, "Success") End With Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub
|
A simple test (improved). Can you use the HL7+ Components? *All example code is in Visual Basic.Net A better way is to create your HL7PlusController object once at the class level and then use it throughout your class methods, etc as needed
Imports HL7PlusMC451 Public Class Form1 Private MyController As New HL7PlusController
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Try Dim sMsg As String = "" With MyController If Not .IsRunnable Then sMsg = "Not runnable." & Environment.NewLine & Environment.NewLine & "Error Message=" & .RegistrationErrorMessage MessageBox.Show(sMsg) Return End If sMsg = "Yes the components are runnable. Now we can move forward to test some other objects." sMsg &= Environment.NewLine & Environment.NewLine & "Installation Name = " & .InstallationName & Environment.NewLine & "Expires: " & .ExpiresOn.ToShortDateString MessageBox.Show(sMsg, "Success") End With Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub End Class
|