'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated by a tool.
'     Runtime Version:4.0.30319.17929
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict Off
Option Explicit On

Imports System
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Xml.Serialization

'
'This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.17929.
'
Namespace PatientDemographicsWebService
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929"),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code"),  _
     System.Web.Services.WebServiceBindingAttribute(Name:="DemographicServicePort", [Namespace]:="http://medplus.com/demographic")>  _
    Partial Public Class DemographicService
        Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
        
        Private submitRealTimeADTMessageOperationCompleted As System.Threading.SendOrPostCallback
        
        Private submitBatchADTMessageOperationCompleted As System.Threading.SendOrPostCallback
        
        Private useDefaultCredentialsSetExplicitly As Boolean
        
        '''<remarks/>
        Public Sub New()
            MyBase.New
            Me.Url = "http://mustang.dev.medplus.com:7023/demographic/service"
            If (Me.IsLocalFileSystemWebService(Me.Url) = true) Then
                Me.UseDefaultCredentials = true
                Me.useDefaultCredentialsSetExplicitly = false
            Else
                Me.useDefaultCredentialsSetExplicitly = true
            End If
        End Sub
        
        Public Shadows Property Url() As String
            Get
                Return MyBase.Url
            End Get
            Set
                If (((Me.IsLocalFileSystemWebService(MyBase.Url) = true)  _
                            AndAlso (Me.useDefaultCredentialsSetExplicitly = false))  _
                            AndAlso (Me.IsLocalFileSystemWebService(value) = false)) Then
                    MyBase.UseDefaultCredentials = false
                End If
                MyBase.Url = value
            End Set
        End Property
        
        Public Shadows Property UseDefaultCredentials() As Boolean
            Get
                Return MyBase.UseDefaultCredentials
            End Get
            Set
                MyBase.UseDefaultCredentials = value
                Me.useDefaultCredentialsSetExplicitly = true
            End Set
        End Property
        
        '''<remarks/>
        Public Event submitRealTimeADTMessageCompleted As submitRealTimeADTMessageCompletedEventHandler
        
        '''<remarks/>
        Public Event submitBatchADTMessageCompleted As submitBatchADTMessageCompletedEventHandler
        
        '''<remarks/>
        <System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace:="http://medplus.com/demographic", ResponseNamespace:="http://medplus.com/demographic")>  _
        Public Function submitRealTimeADTMessage(ByVal request As DemographicRequest) As <System.Xml.Serialization.SoapElementAttribute("result")> DemographicResponse
            Dim results() As Object = Me.Invoke("submitRealTimeADTMessage", New Object() {request})
            Return CType(results(0),DemographicResponse)
        End Function
        
        '''<remarks/>
        Public Function BeginsubmitRealTimeADTMessage(ByVal request As DemographicRequest, ByVal callback As System.AsyncCallback, ByVal asyncState As Object) As System.IAsyncResult
            Return Me.BeginInvoke("submitRealTimeADTMessage", New Object() {request}, callback, asyncState)
        End Function
        
        '''<remarks/>
        Public Function EndsubmitRealTimeADTMessage(ByVal asyncResult As System.IAsyncResult) As DemographicResponse
            Dim results() As Object = Me.EndInvoke(asyncResult)
            Return CType(results(0),DemographicResponse)
        End Function
        
        '''<remarks/>
        Public Overloads Sub submitRealTimeADTMessageAsync(ByVal request As DemographicRequest)
            Me.submitRealTimeADTMessageAsync(request, Nothing)
        End Sub
        
        '''<remarks/>
        Public Overloads Sub submitRealTimeADTMessageAsync(ByVal request As DemographicRequest, ByVal userState As Object)
            If (Me.submitRealTimeADTMessageOperationCompleted Is Nothing) Then
                Me.submitRealTimeADTMessageOperationCompleted = AddressOf Me.OnsubmitRealTimeADTMessageOperationCompleted
            End If
            Me.InvokeAsync("submitRealTimeADTMessage", New Object() {request}, Me.submitRealTimeADTMessageOperationCompleted, userState)
        End Sub
        
        Private Sub OnsubmitRealTimeADTMessageOperationCompleted(ByVal arg As Object)
            If (Not (Me.submitRealTimeADTMessageCompletedEvent) Is Nothing) Then
                Dim invokeArgs As System.Web.Services.Protocols.InvokeCompletedEventArgs = CType(arg,System.Web.Services.Protocols.InvokeCompletedEventArgs)
                RaiseEvent submitRealTimeADTMessageCompleted(Me, New submitRealTimeADTMessageCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState))
            End If
        End Sub
        
        '''<remarks/>
        <System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace:="http://medplus.com/demographic", ResponseNamespace:="http://medplus.com/demographic")>  _
        Public Function submitBatchADTMessage(ByVal request As DemographicRequest) As <System.Xml.Serialization.SoapElementAttribute("result")> DemographicResponse
            Dim results() As Object = Me.Invoke("submitBatchADTMessage", New Object() {request})
            Return CType(results(0),DemographicResponse)
        End Function
        
        '''<remarks/>
        Public Function BeginsubmitBatchADTMessage(ByVal request As DemographicRequest, ByVal callback As System.AsyncCallback, ByVal asyncState As Object) As System.IAsyncResult
            Return Me.BeginInvoke("submitBatchADTMessage", New Object() {request}, callback, asyncState)
        End Function
        
        '''<remarks/>
        Public Function EndsubmitBatchADTMessage(ByVal asyncResult As System.IAsyncResult) As DemographicResponse
            Dim results() As Object = Me.EndInvoke(asyncResult)
            Return CType(results(0),DemographicResponse)
        End Function
        
        '''<remarks/>
        Public Overloads Sub submitBatchADTMessageAsync(ByVal request As DemographicRequest)
            Me.submitBatchADTMessageAsync(request, Nothing)
        End Sub
        
        '''<remarks/>
        Public Overloads Sub submitBatchADTMessageAsync(ByVal request As DemographicRequest, ByVal userState As Object)
            If (Me.submitBatchADTMessageOperationCompleted Is Nothing) Then
                Me.submitBatchADTMessageOperationCompleted = AddressOf Me.OnsubmitBatchADTMessageOperationCompleted
            End If
            Me.InvokeAsync("submitBatchADTMessage", New Object() {request}, Me.submitBatchADTMessageOperationCompleted, userState)
        End Sub
        
        Private Sub OnsubmitBatchADTMessageOperationCompleted(ByVal arg As Object)
            If (Not (Me.submitBatchADTMessageCompletedEvent) Is Nothing) Then
                Dim invokeArgs As System.Web.Services.Protocols.InvokeCompletedEventArgs = CType(arg,System.Web.Services.Protocols.InvokeCompletedEventArgs)
                RaiseEvent submitBatchADTMessageCompleted(Me, New submitBatchADTMessageCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState))
            End If
        End Sub
        
        '''<remarks/>
        Public Shadows Sub CancelAsync(ByVal userState As Object)
            MyBase.CancelAsync(userState)
        End Sub
        
        Private Function IsLocalFileSystemWebService(ByVal url As String) As Boolean
            If ((url Is Nothing)  _
                        OrElse (url Is String.Empty)) Then
                Return false
            End If
            Dim wsUri As System.Uri = New System.Uri(url)
            If ((wsUri.Port >= 1024)  _
                        AndAlso (String.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) = 0)) Then
                Return true
            End If
            Return false
        End Function
    End Class
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.17929"),  _
     System.SerializableAttribute(),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code"),  _
     System.Xml.Serialization.SoapTypeAttribute([Namespace]:="java:com.medplus.serviceHub.mpi.webservice")>  _
    Partial Public Class DemographicRequest
        
        Private aDTMessageField() As Byte
        
        '''<remarks/>
        <System.Xml.Serialization.SoapElementAttribute(DataType:="base64Binary", IsNullable:=true)>  _
        Public Property ADTMessage() As Byte()
            Get
                Return Me.aDTMessageField
            End Get
            Set
                Me.aDTMessageField = value
            End Set
        End Property
    End Class
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.17929"),  _
     System.SerializableAttribute(),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code"),  _
     System.Xml.Serialization.SoapTypeAttribute([Namespace]:="java:com.medplus.serviceHub.mpi.webservice")>  _
    Partial Public Class DemographicResponse
        
        Private errorsField() As String
        
        Private hubTransactionUidField As String
        
        Private messageControlUidField As String
        
        Private statusField As String
        
        '''<remarks/>
        <System.Xml.Serialization.SoapElementAttribute(IsNullable:=true)>  _
        Public Property errors() As String()
            Get
                Return Me.errorsField
            End Get
            Set
                Me.errorsField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.SoapElementAttribute(IsNullable:=true)>  _
        Public Property hubTransactionUid() As String
            Get
                Return Me.hubTransactionUidField
            End Get
            Set
                Me.hubTransactionUidField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.SoapElementAttribute(IsNullable:=true)>  _
        Public Property messageControlUid() As String
            Get
                Return Me.messageControlUidField
            End Get
            Set
                Me.messageControlUidField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.SoapElementAttribute(IsNullable:=true)>  _
        Public Property status() As String
            Get
                Return Me.statusField
            End Get
            Set
                Me.statusField = value
            End Set
        End Property
    End Class
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")>  _
    Public Delegate Sub submitRealTimeADTMessageCompletedEventHandler(ByVal sender As Object, ByVal e As submitRealTimeADTMessageCompletedEventArgs)
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929"),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code")>  _
    Partial Public Class submitRealTimeADTMessageCompletedEventArgs
        Inherits System.ComponentModel.AsyncCompletedEventArgs
        
        Private results() As Object
        
        Friend Sub New(ByVal results() As Object, ByVal exception As System.Exception, ByVal cancelled As Boolean, ByVal userState As Object)
            MyBase.New(exception, cancelled, userState)
            Me.results = results
        End Sub
        
        '''<remarks/>
        Public ReadOnly Property Result() As DemographicResponse
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(0),DemographicResponse)
            End Get
        End Property
    End Class
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")>  _
    Public Delegate Sub submitBatchADTMessageCompletedEventHandler(ByVal sender As Object, ByVal e As submitBatchADTMessageCompletedEventArgs)
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929"),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code")>  _
    Partial Public Class submitBatchADTMessageCompletedEventArgs
        Inherits System.ComponentModel.AsyncCompletedEventArgs
        
        Private results() As Object
        
        Friend Sub New(ByVal results() As Object, ByVal exception As System.Exception, ByVal cancelled As Boolean, ByVal userState As Object)
            MyBase.New(exception, cancelled, userState)
            Me.results = results
        End Sub
        
        '''<remarks/>
        Public ReadOnly Property Result() As DemographicResponse
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(0),DemographicResponse)
            End Get
        End Property
    End Class
End Namespace
