//------------------------------------------------------------------------------
// <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>
//------------------------------------------------------------------------------

// 
// This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.17929.
// 
#pragma warning disable 1591

namespace ObservationResultsSampleCodeCS.ObservationResultsWebService {
    using System;
    using System.Web.Services;
    using System.Diagnostics;
    using System.Web.Services.Protocols;
    using System.Xml.Serialization;
    using System.ComponentModel;
    
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="ObservationResultServicePort", Namespace="http://medplus.com/observation")]
    [System.Xml.Serialization.SoapIncludeAttribute(typeof(AcknowledgedResult))]
    [System.Xml.Serialization.SoapIncludeAttribute(typeof(ObservationResultDocument))]
    [System.Xml.Serialization.SoapIncludeAttribute(typeof(ObservationResult))]
    [System.Xml.Serialization.SoapIncludeAttribute(typeof(ProviderAccount))]
    public partial class ObservationResultService : System.Web.Services.Protocols.SoapHttpClientProtocol {
        
        private System.Threading.SendOrPostCallback getResultsOperationCompleted;
        
        private System.Threading.SendOrPostCallback getMoreResultsOperationCompleted;
        
        private System.Threading.SendOrPostCallback acknowledgeResultsOperationCompleted;
        
        private System.Threading.SendOrPostCallback getProviderAccountsOperationCompleted;
        
        private bool useDefaultCredentialsSetExplicitly;
        
        /// <remarks/>
        public ObservationResultService() {
            this.Url = global::ObservationResultsSampleCodeCS.Properties.Settings.Default.ObservationResultsSampleCodeCS_localhost_ObservationResultService;
            if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
                this.UseDefaultCredentials = true;
                this.useDefaultCredentialsSetExplicitly = false;
            }
            else {
                this.useDefaultCredentialsSetExplicitly = true;
            }
        }
        
        public new string Url {
            get {
                return base.Url;
            }
            set {
                if ((((this.IsLocalFileSystemWebService(base.Url) == true) 
                            && (this.useDefaultCredentialsSetExplicitly == false)) 
                            && (this.IsLocalFileSystemWebService(value) == false))) {
                    base.UseDefaultCredentials = false;
                }
                base.Url = value;
            }
        }
        
        public new bool UseDefaultCredentials {
            get {
                return base.UseDefaultCredentials;
            }
            set {
                base.UseDefaultCredentials = value;
                this.useDefaultCredentialsSetExplicitly = true;
            }
        }
        
        /// <remarks/>
        public event getResultsCompletedEventHandler getResultsCompleted;
        
        /// <remarks/>
        public event getMoreResultsCompletedEventHandler getMoreResultsCompleted;
        
        /// <remarks/>
        public event acknowledgeResultsCompletedEventHandler acknowledgeResultsCompleted;
        
        /// <remarks/>
        public event getProviderAccountsCompletedEventHandler getProviderAccountsCompleted;
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://medplus.com/observation", ResponseNamespace="http://medplus.com/observation")]
        [return: System.Xml.Serialization.SoapElementAttribute("result")]
        public ObservationResultResponse getResults(ObservationResultRequest resultRequest) {
            object[] results = this.Invoke("getResults", new object[] {
                        resultRequest});
            return ((ObservationResultResponse)(results[0]));
        }
        
        /// <remarks/>
        public void getResultsAsync(ObservationResultRequest resultRequest) {
            this.getResultsAsync(resultRequest, null);
        }
        
        /// <remarks/>
        public void getResultsAsync(ObservationResultRequest resultRequest, object userState) {
            if ((this.getResultsOperationCompleted == null)) {
                this.getResultsOperationCompleted = new System.Threading.SendOrPostCallback(this.OngetResultsOperationCompleted);
            }
            this.InvokeAsync("getResults", new object[] {
                        resultRequest}, this.getResultsOperationCompleted, userState);
        }
        
        private void OngetResultsOperationCompleted(object arg) {
            if ((this.getResultsCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.getResultsCompleted(this, new getResultsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://medplus.com/observation", ResponseNamespace="http://medplus.com/observation")]
        [return: System.Xml.Serialization.SoapElementAttribute("result")]
        public ObservationResultResponse getMoreResults(string requestId) {
            object[] results = this.Invoke("getMoreResults", new object[] {
                        requestId});
            return ((ObservationResultResponse)(results[0]));
        }
        
        /// <remarks/>
        public void getMoreResultsAsync(string requestId) {
            this.getMoreResultsAsync(requestId, null);
        }
        
        /// <remarks/>
        public void getMoreResultsAsync(string requestId, object userState) {
            if ((this.getMoreResultsOperationCompleted == null)) {
                this.getMoreResultsOperationCompleted = new System.Threading.SendOrPostCallback(this.OngetMoreResultsOperationCompleted);
            }
            this.InvokeAsync("getMoreResults", new object[] {
                        requestId}, this.getMoreResultsOperationCompleted, userState);
        }
        
        private void OngetMoreResultsOperationCompleted(object arg) {
            if ((this.getMoreResultsCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.getMoreResultsCompleted(this, new getMoreResultsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://medplus.com/observation", ResponseNamespace="http://medplus.com/observation")]
        public void acknowledgeResults(Acknowledgment ack) {
            this.Invoke("acknowledgeResults", new object[] {
                        ack});
        }
        
        /// <remarks/>
        public void acknowledgeResultsAsync(Acknowledgment ack) {
            this.acknowledgeResultsAsync(ack, null);
        }
        
        /// <remarks/>
        public void acknowledgeResultsAsync(Acknowledgment ack, object userState) {
            if ((this.acknowledgeResultsOperationCompleted == null)) {
                this.acknowledgeResultsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnacknowledgeResultsOperationCompleted);
            }
            this.InvokeAsync("acknowledgeResults", new object[] {
                        ack}, this.acknowledgeResultsOperationCompleted, userState);
        }
        
        private void OnacknowledgeResultsOperationCompleted(object arg) {
            if ((this.acknowledgeResultsCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.acknowledgeResultsCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://medplus.com/observation", ResponseNamespace="http://medplus.com/observation")]
        [return: System.Xml.Serialization.SoapElementAttribute("result")]
        public ProviderAccount[] getProviderAccounts() {
            object[] results = this.Invoke("getProviderAccounts", new object[0]);
            return ((ProviderAccount[])(results[0]));
        }
        
        /// <remarks/>
        public void getProviderAccountsAsync() {
            this.getProviderAccountsAsync(null);
        }
        
        /// <remarks/>
        public void getProviderAccountsAsync(object userState) {
            if ((this.getProviderAccountsOperationCompleted == null)) {
                this.getProviderAccountsOperationCompleted = new System.Threading.SendOrPostCallback(this.OngetProviderAccountsOperationCompleted);
            }
            this.InvokeAsync("getProviderAccounts", new object[0], this.getProviderAccountsOperationCompleted, userState);
        }
        
        private void OngetProviderAccountsOperationCompleted(object arg) {
            if ((this.getProviderAccountsCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.getProviderAccountsCompleted(this, new getProviderAccountsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        public new void CancelAsync(object userState) {
            base.CancelAsync(userState);
        }
        
        private bool IsLocalFileSystemWebService(string url) {
            if (((url == null) 
                        || (url == string.Empty))) {
                return false;
            }
            System.Uri wsUri = new System.Uri(url);
            if (((wsUri.Port >= 1024) 
                        && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
                return true;
            }
            return false;
        }
    }
    
    /// <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.results.webservice.observation")]
    public partial class ObservationResultRequest {
        
        private string endDateField;
        
        private System.Nullable<int> maxMessagesField;
        
        private ProviderAccount[] providerAccountsField;
        
        private bool retrieveFinalsOnlyField;
        
        private string startDateField;
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string endDate {
            get {
                return this.endDateField;
            }
            set {
                this.endDateField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public System.Nullable<int> maxMessages {
            get {
                return this.maxMessagesField;
            }
            set {
                this.maxMessagesField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public ProviderAccount[] providerAccounts {
            get {
                return this.providerAccountsField;
            }
            set {
                this.providerAccountsField = value;
            }
        }
        
        /// <remarks/>
        public bool retrieveFinalsOnly {
            get {
                return this.retrieveFinalsOnlyField;
            }
            set {
                this.retrieveFinalsOnlyField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string startDate {
            get {
                return this.startDateField;
            }
            set {
                this.startDateField = value;
            }
        }
    }
    
    /// <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.results.webservice.observation")]
    public partial class ProviderAccount {
        
        private string providerAccountNameField;
        
        private string providerNameField;
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string providerAccountName {
            get {
                return this.providerAccountNameField;
            }
            set {
                this.providerAccountNameField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string providerName {
            get {
                return this.providerNameField;
            }
            set {
                this.providerNameField = value;
            }
        }
    }
    
    /// <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.results.webservice.observation")]
    public partial class AcknowledgedResult {
        
        private string ackCodeField;
        
        private string[] documentIdsField;
        
        private string rejectionReasonField;
        
        private string resultIdField;
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string ackCode {
            get {
                return this.ackCodeField;
            }
            set {
                this.ackCodeField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string[] documentIds {
            get {
                return this.documentIdsField;
            }
            set {
                this.documentIdsField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string rejectionReason {
            get {
                return this.rejectionReasonField;
            }
            set {
                this.rejectionReasonField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string resultId {
            get {
                return this.resultIdField;
            }
            set {
                this.resultIdField = value;
            }
        }
    }
    
    /// <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.results.webservice.observation")]
    public partial class Acknowledgment {
        
        private AcknowledgedResult[] acknowledgedResultsField;
        
        private string requestIdField;
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public AcknowledgedResult[] acknowledgedResults {
            get {
                return this.acknowledgedResultsField;
            }
            set {
                this.acknowledgedResultsField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string requestId {
            get {
                return this.requestIdField;
            }
            set {
                this.requestIdField = value;
            }
        }
    }
    
    /// <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.results.webservice.observation")]
    public partial class ObservationResultDocument {
        
        private byte[] documentDataField;
        
        private string documentIdField;
        
        private string fileMimeTypeField;
        
        private string fileNameField;
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(DataType="base64Binary", IsNullable=true)]
        public byte[] documentData {
            get {
                return this.documentDataField;
            }
            set {
                this.documentDataField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string documentId {
            get {
                return this.documentIdField;
            }
            set {
                this.documentIdField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string fileMimeType {
            get {
                return this.fileMimeTypeField;
            }
            set {
                this.fileMimeTypeField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string fileName {
            get {
                return this.fileNameField;
            }
            set {
                this.fileNameField = value;
            }
        }
    }
    
    /// <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.results.webservice.observation")]
    public partial class ObservationResult {
        
        private byte[] hL7MessageField;
        
        private ObservationResultDocument[] documentsField;
        
        private string observationResultTypeField;
        
        private string resultIdField;
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(DataType="base64Binary", IsNullable=true)]
        public byte[] HL7Message {
            get {
                return this.hL7MessageField;
            }
            set {
                this.hL7MessageField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public ObservationResultDocument[] documents {
            get {
                return this.documentsField;
            }
            set {
                this.documentsField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string observationResultType {
            get {
                return this.observationResultTypeField;
            }
            set {
                this.observationResultTypeField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string resultId {
            get {
                return this.resultIdField;
            }
            set {
                this.resultIdField = value;
            }
        }
    }
    
    /// <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.results.webservice.observation")]
    public partial class ObservationResultResponse {
        
        private System.Nullable<bool> isMoreField;
        
        private ObservationResult[] observationResultsField;
        
        private string requestIdField;
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public System.Nullable<bool> isMore {
            get {
                return this.isMoreField;
            }
            set {
                this.isMoreField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public ObservationResult[] observationResults {
            get {
                return this.observationResultsField;
            }
            set {
                this.observationResultsField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string requestId {
            get {
                return this.requestIdField;
            }
            set {
                this.requestIdField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
    public delegate void getResultsCompletedEventHandler(object sender, getResultsCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class getResultsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal getResultsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public ObservationResultResponse Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((ObservationResultResponse)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
    public delegate void getMoreResultsCompletedEventHandler(object sender, getMoreResultsCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class getMoreResultsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal getMoreResultsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public ObservationResultResponse Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((ObservationResultResponse)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
    public delegate void acknowledgeResultsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
    public delegate void getProviderAccountsCompletedEventHandler(object sender, getProviderAccountsCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class getProviderAccountsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal getProviderAccountsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public ProviderAccount[] Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((ProviderAccount[])(this.results[0]));
            }
        }
    }
}

#pragma warning restore 1591