Esempio n. 1
0
 private void FormClaimReports_Shown(object sender, EventArgs e)
 {
     if (AutomaticMode)
     {
         labelRetrieving.Visible = true;
         Cursor = Cursors.WaitCursor;
         Clearinghouse clearinghouseHq   = _listHqClearinghouses[comboClearhouse.SelectedIndex];
         Clearinghouse clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum);
         string        errorMessage      = Clearinghouses.RetrieveAndImport(clearinghouseClin, AutomaticMode);
         if (errorMessage != "")
         {
             MessageBox.Show(errorMessage);
         }
         Cursor = Cursors.Default;
         Close();
     }
 }
Esempio n. 2
0
        private void butRetrieve_Click(object sender, EventArgs e)
        {
            if (comboClearhouse.SelectedIndex == -1)
            {
                MsgBox.Show(this, "Please select a clearinghouse first.");
                return;
            }
            if (!MsgBox.Show(this, true, "Connect to clearinghouse to retrieve reports?"))
            {
                return;
            }
            Clearinghouse clearhouseHq      = _listHqClearinghouses[comboClearhouse.SelectedIndex];
            Clearinghouse clearinghouseClin = Clearinghouses.OverrideFields(clearhouseHq, Clinics.ClinicNum);

            if (!Directory.Exists(clearinghouseClin.ResponsePath))
            {
                MsgBox.Show(this, "Clearinghouse does not have a valid Report Path set.");
                return;
            }
            ODProgressExtended progressbar = new ODProgressExtended(ODEventType.Clearinghouse, new ClearinghouseEvent(), this
                                                                    , new ProgressBarHelper((Lans.g(this, "Clearinghouse Progress")), progressBarEventType: ProgBarEventType.Header), lanThis: this.Name);

            //For Tesia, user wouldn't normally manually retrieve.
            if (clearhouseHq.ISA08 == "113504607")
            {
                if ((PrefC.RandomKeys && PrefC.HasClinicsEnabled) ||            //See FormClaimsSend_Load
                    PrefC.GetLong(PrefName.ClearinghouseDefaultDent) != clearhouseHq.ClearinghouseNum)                      //default
                {
                    //But they might need to in these situations.
                    string errorMessage = Clearinghouses.RetrieveAndImport(clearinghouseClin, false, progressbar);
                    progressbar.UpdateProgressDetailed("", tagString: "reports", percentVal: "100%", barVal: 100);
                    if (errorMessage == "")
                    {
                        progressbar.UpdateProgress(Lan.g(this, "Retrieval and import successful"));
                    }
                    else
                    {
                        progressbar.UpdateProgress(errorMessage);
                    }
                    progressbar.UpdateProgress(Lan.g(this, "Done"));
                }
                else
                {
                    progressbar.UpdateProgress(Lan.g(this, "No need to retrieve. Available reports are automatically downloaded every three minutes."));
                }
                progressbar.OnProgressDone();
                return;
            }
            if (clearhouseHq.CommBridge == EclaimsCommBridge.None || clearhouseHq.CommBridge == EclaimsCommBridge.Renaissance ||
                clearhouseHq.CommBridge == EclaimsCommBridge.RECS)
            {
                progressbar.UpdateProgress(Lan.g(this, "No built-in functionality for retrieving reports from this clearinghouse."));
                progressbar.OnProgressDone();
                return;
            }
            labelRetrieving.Visible = true;
            string errorMesssage = Clearinghouses.RetrieveAndImport(clearinghouseClin, false, progressbar);

            progressbar.UpdateProgressDetailed("", tagString: "reports", percentVal: "100%", barVal: 100);
            if (clearhouseHq.CommBridge == EclaimsCommBridge.ClaimConnect && errorMesssage == "" && Directory.Exists(clearinghouseClin.ResponsePath))
            {
                //Since the dentalxchange website was successfully launched in this scenario, the user does not need any further notification.
            }
            else if (errorMesssage == "")
            {
                progressbar.UpdateProgress(Lan.g(this, "Retrieve and import successful."));
            }
            else
            {
                progressbar.UpdateProgress(Lans.g(progressbar.LanThis, "Error Log:") + "\r\n" + errorMesssage);
            }
            labelRetrieving.Visible = false;
            progressbar.OnProgressDone();
            if (progressbar.IsCanceled)             //close
            {
                progressbar.Close();
            }
        }