Exemplo n.º 1
0
 private static void RetrieveReportsAutomaticHelper(Clearinghouse clearinghouseClin, Clearinghouse clearinghouseHq, long defaultClearingHouseNum
                                                    , bool isTimeToRetrieve)
 {
     if (!Directory.Exists(clearinghouseClin.ResponsePath))
     {
         return;
     }
     if (clearinghouseHq.ClearinghouseNum == defaultClearingHouseNum)           //If it's the default dental clearinghouse
     {
         RetrieveAndImport(clearinghouseClin, true, isTimeToRetrieve: isTimeToRetrieve);
     }
     else if (clearinghouseHq.Eformat == ElectronicClaimFormat.None)           //And the format is "None" (accessed from all regions)
     {
         RetrieveAndImport(clearinghouseClin, true, isTimeToRetrieve: isTimeToRetrieve);
     }
     else if (clearinghouseHq.CommBridge == EclaimsCommBridge.BCBSGA)
     {
         BCBSGA.Retrieve(clearinghouseClin, true, new TerminalConnector());
     }
     else if (clearinghouseHq.Eformat == ElectronicClaimFormat.Canadian && CultureInfo.CurrentCulture.Name.EndsWith("CA"))
     {
         //Or the Eformat is Canadian and the region is Canadian.  In Canada, the "Outstanding Reports" are received upon request.
         //Canadian reports must be retrieved using an office num and valid provider number for the office,
         //which will cause all reports for that office to be returned.
         //Here we loop through all providers and find CDAnet providers with a valid provider number and office number, and we only send
         //one report download request for one provider from each office.  For most offices, the loop will only send a single request.
         List <Provider> listProvs      = Providers.GetDeepCopy(true);
         List <string>   listOfficeNums = new List <string>();
         for (int j = 0; j < listProvs.Count; j++)           //Get all unique office numbers from the providers.
         {
             if (!listProvs[j].IsCDAnet || listProvs[j].NationalProvID == "" || listProvs[j].CanadianOfficeNum == "")
             {
                 continue;
             }
             if (!listOfficeNums.Contains(listProvs[j].CanadianOfficeNum))                     //Ignore duplicate office numbers.
             {
                 listOfficeNums.Add(listProvs[j].CanadianOfficeNum);
                 try {
                     clearinghouseHq   = Eclaims.Canadian.GetCanadianClearinghouseHq(null);
                     clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum);
                     Eclaims.CanadianOutput.GetOutstandingTransactions(clearinghouseClin, false, true, null, listProvs[j], true, null, null);
                 }
                 catch {
                     //Supress errors importing reports.
                 }
             }
         }
     }
     else if (clearinghouseHq.Eformat == ElectronicClaimFormat.Dutch && CultureInfo.CurrentCulture.Name.EndsWith("DE"))
     {
         //Or the Eformat is German and the region is German
         RetrieveAndImport(clearinghouseClin, true, isTimeToRetrieve: isTimeToRetrieve);
     }
     else if (clearinghouseHq.Eformat != ElectronicClaimFormat.Canadian &&
              clearinghouseHq.Eformat != ElectronicClaimFormat.Dutch &&
              CultureInfo.CurrentCulture.Name.EndsWith("US"))               //Or the Eformat is in any other format and the region is US
     {
         RetrieveAndImport(clearinghouseClin, true, isTimeToRetrieve: isTimeToRetrieve);
     }
 }
Exemplo n.º 2
0
        private void RetrieveReports()
        {
            if (Clearinghouses.Listt[comboClearhouse.SelectedIndex].ISA08 == "113504607")           //TesiaLink
            //But the import will still happen
            {
                return;
            }
            if (Clearinghouses.Listt[comboClearhouse.SelectedIndex].CommBridge == EclaimsCommBridge.None ||
                Clearinghouses.Listt[comboClearhouse.SelectedIndex].CommBridge == EclaimsCommBridge.Renaissance ||
                Clearinghouses.Listt[comboClearhouse.SelectedIndex].CommBridge == EclaimsCommBridge.RECS)
            {
                return;
            }
            Cursor = Cursors.WaitCursor;

            /*if(Clearinghouses.List[comboClearhouse.SelectedIndex].CommBridge==EclaimsCommBridge.Tesia) {
             *      try{
             *              DateTime curtime=DateTime.Now;
             *              while (DateTime.Now<curtime.AddSeconds(2)){
             *                      Application.DoEvents();
             *              }
             *              MessageBox.Show("Incomplete");
             *              Tesia.GetReports();
             *      }
             *      catch(Exception ex){
             *              Cursor=Cursors.Default;
             *              MessageBox.Show(ex.Message);
             *              return;
             *      }
             * }*/
            if (Clearinghouses.Listt[comboClearhouse.SelectedIndex].CommBridge == EclaimsCommBridge.WebMD)
            {
                if (!WebMD.Launch(Clearinghouses.Listt[comboClearhouse.SelectedIndex], 0))
                {
                    Cursor = Cursors.Default;
                    MessageBox.Show(Lan.g(this, "Error retrieving."));
                    return;
                }
            }
            else if (Clearinghouses.Listt[comboClearhouse.SelectedIndex].CommBridge == EclaimsCommBridge.BCBSGA)
            {
                if (!BCBSGA.Retrieve(Clearinghouses.Listt[comboClearhouse.SelectedIndex]))
                {
                    Cursor = Cursors.Default;
                    MessageBox.Show(Lan.g(this, "Error retrieving."));
                    return;
                }
            }
            else if (Clearinghouses.Listt[comboClearhouse.SelectedIndex].CommBridge == EclaimsCommBridge.ClaimConnect)
            {
                if (AutomaticMode)
                {
                    Cursor = Cursors.Default;
                    return;
                }
                try{
                    Process.Start(@"http://www.dentalxchange.com/newdxc");
                }
                catch {
                    MessageBox.Show("Could not locate the site.");
                }
                Cursor = Cursors.Default;
                return;
            }
            else if (Clearinghouses.Listt[comboClearhouse.SelectedIndex].CommBridge == EclaimsCommBridge.AOS)
            {
                try{
                    //his path would never exist on Unix, so no need to handle back slashes.
                    Process.Start(@"C:\Program files\AOS\AOSCommunicator\AOSCommunicator.exe");
                }
                catch {
                    Cursor = Cursors.Default;
                    MessageBox.Show("Could not locate the file.");
                    return;
                }
            }
            else if (Clearinghouses.Listt[comboClearhouse.SelectedIndex].CommBridge == EclaimsCommBridge.MercuryDE)
            {
                if (!MercuryDE.Launch(Clearinghouses.Listt[comboClearhouse.SelectedIndex], 0))
                {
                    Cursor = Cursors.Default;
                    MessageBox.Show(Lan.g(this, "Error retrieving."));
                    return;
                }
            }
            else if (Clearinghouses.Listt[comboClearhouse.SelectedIndex].CommBridge == EclaimsCommBridge.EmdeonMedical)
            {
                if (!EmdeonMedical.Retrieve(Clearinghouses.Listt[comboClearhouse.SelectedIndex]))
                {
                    Cursor = Cursors.Default;
                    MessageBox.Show(Lan.g(this, "Error retrieving."));
                    return;
                }
            }
            Cursor = Cursors.Default;
            if (!AutomaticMode)
            {
                MsgBox.Show(this, "Retrieval successful");
            }
        }
Exemplo n.º 3
0
 private static string RetrieveReports(Clearinghouse clearinghouseClin, bool isAutomaticMode, IODProgressExtended progress = null)
 {
     progress = progress ?? new ODProgressExtendedNull();
     progress.UpdateProgress(Lans.g(progress.LanThis, "Beginning report retrieval..."), "reports", "0%");
     if (progress.IsPauseOrCancel())
     {
         return(Lans.g(progress.LanThis, "Process canceled by user."));
     }
     if (clearinghouseClin.ISA08 == "113504607")           //TesiaLink
     //But the import will still happen
     {
         return("");
     }
     if (clearinghouseClin.CommBridge == EclaimsCommBridge.None ||
         clearinghouseClin.CommBridge == EclaimsCommBridge.Renaissance ||
         clearinghouseClin.CommBridge == EclaimsCommBridge.RECS)
     {
         return("");
     }
     if (clearinghouseClin.CommBridge == EclaimsCommBridge.WebMD)
     {
         if (!WebMD.Launch(clearinghouseClin, 0, isAutomaticMode, progress))
         {
             return(Lans.g("FormClaimReports", "Error retrieving.") + "\r\n" + WebMD.ErrorMessage);
         }
     }
     else if (clearinghouseClin.CommBridge == EclaimsCommBridge.BCBSGA)
     {
         if (!BCBSGA.Retrieve(clearinghouseClin, true, new TerminalConnector(), progress))
         {
             return(Lans.g("FormClaimReports", "Error retrieving.") + "\r\n" + BCBSGA.ErrorMessage);
         }
     }
     else if (clearinghouseClin.CommBridge == EclaimsCommBridge.ClaimConnect)
     {
         if (!Directory.Exists(clearinghouseClin.ResponsePath))
         {
             //The clearinghouse report path is not setup.  Therefore, the customer does not use ClaimConnect reports via web services.
             if (isAutomaticMode)      //The user opened FormClaimsSend, or FormOpenDental called this function automatically.
             {
                 return("");           //Suppress error message.
             }
             else                      //The user pressed the Get Reports button manually.
             //This cannot happen, because the user is blocked by the UI before they get to this point.
             {
             }
         }
         else if (!ClaimConnect.Retrieve(clearinghouseClin, progress))
         {
             if (ClaimConnect.ErrorMessage.Contains(": 150\r\n")) //Error message 150 "Service Not Contracted"
             {
                 if (isAutomaticMode)                             //The user opened FormClaimsSend, or FormOpenDental called this function automatically.
                 {
                     return("");                                  //Pretend that there is no error when loading FormClaimsSend for those customers who do not pay for ERA service.
                 }
                 else                                             //The user pressed the Get Reports button manually.
                 //The old way.  Some customers still prefer to go to the dentalxchange web portal to view reports because the ERA service costs money.
                 {
                     try {
                         Process.Start(@"http://www.dentalxchange.com");
                     }
                     catch (Exception ex) {
                         ex.DoNothing();
                         return(Lans.g("FormClaimReports", "Could not locate the site."));
                     }
                     return("");
                 }
             }
             return(Lans.g("FormClaimReports", "Error retrieving.") + "\r\n" + ClaimConnect.ErrorMessage);
         }
     }
     else if (clearinghouseClin.CommBridge == EclaimsCommBridge.AOS)
     {
         try {
             //This path would never exist on Unix, so no need to handle back slashes.
             Process.Start(@"C:\Program files\AOS\AOSCommunicator\AOSCommunicator.exe");
         }
         catch {
             return(Lans.g("FormClaimReports", "Could not locate the file."));
         }
     }
     else if (clearinghouseClin.CommBridge == EclaimsCommBridge.MercuryDE)
     {
         if (!MercuryDE.Launch(clearinghouseClin, 0, progress))
         {
             return(Lans.g("FormClaimReports", "Error retrieving.") + "\r\n" + MercuryDE.ErrorMessage);
         }
     }
     else if (clearinghouseClin.CommBridge == EclaimsCommBridge.EmdeonMedical)
     {
         if (!EmdeonMedical.Retrieve(clearinghouseClin, progress))
         {
             return(Lans.g("FormClaimReports", "Error retrieving.") + "\r\n" + EmdeonMedical.ErrorMessage);
         }
     }
     else if (clearinghouseClin.CommBridge == EclaimsCommBridge.DentiCal)
     {
         if (!DentiCal.Launch(clearinghouseClin, 0, progress))
         {
             return(Lans.g("FormClaimReports", "Error retrieving.") + "\r\n" + DentiCal.ErrorMessage);
         }
     }
     else if (clearinghouseClin.CommBridge == EclaimsCommBridge.EDS)
     {
         List <string> listEdsErrors = new List <string>();
         if (!EDS.Retrieve277s(clearinghouseClin, progress))
         {
             listEdsErrors.Add(Lans.g("FormClaimReports", "Error retrieving.") + "\r\n" + EDS.ErrorMessage);
         }
         if (!EDS.Retrieve835s(clearinghouseClin, progress))
         {
             listEdsErrors.Add(Lans.g("FormClaimReports", "Error retrieving.") + "\r\n" + EDS.ErrorMessage);
         }
         if (listEdsErrors.Count > 0)
         {
             return(string.Join("\r\n", listEdsErrors));
         }
     }
     return("");
 }
Exemplo n.º 4
0
 private void butRetrieve_Click(object sender, System.EventArgs e)
 {
     if (comboClearhouse.SelectedIndex == -1)
     {
         MsgBox.Show(this, "Please select a clearinghouse first.");
         return;
     }
     if (Clearinghouses.List[comboClearhouse.SelectedIndex].CommBridge
         == EclaimsCommBridge.None ||
         Clearinghouses.List[comboClearhouse.SelectedIndex].CommBridge
         == EclaimsCommBridge.Renaissance ||
         Clearinghouses.List[comboClearhouse.SelectedIndex].CommBridge
         == EclaimsCommBridge.RECS)
     {
         MsgBox.Show
             (this, "No built-in functionality for retrieving reports from this clearinghouse.");
         return;
     }
     if (!MsgBox.Show(this, true, "Connect to clearinghouse to retrieve reports?"))
     {
         return;
     }
     else if (Clearinghouses.List[comboClearhouse.SelectedIndex].CommBridge
              == EclaimsCommBridge.WebMD)
     {
         if (!WebMD.Launch(Clearinghouses.List[comboClearhouse.SelectedIndex], 0))
         {
             MessageBox.Show(Lan.g(this, "Error retrieving."));
             return;
         }
         //MsgBox.Show
         //	(this,"Reports from WebMD are retrieved every time you send the next batch of claims.");
         //return;
     }
     else if (Clearinghouses.List[comboClearhouse.SelectedIndex].CommBridge
              == EclaimsCommBridge.BCBSGA)
     {
         if (!BCBSGA.Retrieve(Clearinghouses.List[comboClearhouse.SelectedIndex]))
         {
             MessageBox.Show(Lan.g(this, "Error retrieving."));
             return;
         }
     }
     else if (Clearinghouses.List[comboClearhouse.SelectedIndex].CommBridge
              == EclaimsCommBridge.ClaimConnect)
     {             //Added SPK 5/05
         try
         {
             Process.Start(@"http://www.dentalxchange.com/newdxc");
         }
         catch
         {
             MessageBox.Show("Could not locate the site.");
         }
         return;
     }
     else if (Clearinghouses.List[comboClearhouse.SelectedIndex].CommBridge
              == EclaimsCommBridge.AOS)
     {             //Added SPK 7/05
         try
         {
             Process.Start(@"C:\Program files\AOS\AOSCommunicator\AOSCommunicator.exe");
         }
         catch
         {
             MessageBox.Show("Could not locate the file.");
         }
         return;
     }
     MsgBox.Show(this, "Retrieval successful");
     FillGrid();
 }