Ejemplo n.º 1
0
        ///<summary>Called from claimsend window.</summary>
        public static ClaimSendQueueItem[] GetQueueList()
        {
            string command =
                "SELECT claim.ClaimNum,carrier.NoSendElect"
                + ",CONCAT(CONCAT(CONCAT(concat(patient.LName,', '),patient.FName),' '),patient.MiddleI)"
                + ",claim.ClaimStatus,carrier.CarrierName,patient.PatNum,carrier.ElectID,insplan.IsMedical "
                + "FROM claim "
                + "Left join insplan on claim.PlanNum = insplan.PlanNum "
                + "Left join carrier on insplan.CarrierNum = carrier.CarrierNum "
                + "Left join patient on patient.PatNum = claim.PatNum "
                + "WHERE claim.ClaimStatus = 'W' OR claim.ClaimStatus = 'P' "
                + "ORDER BY insplan.IsMedical";               //this puts the medical claims at the end, helping with the looping in X12.
            //MessageBox.Show(string command);
            DataTable table = General.GetTable(command);

            ClaimSendQueueItem[] listQueue = new ClaimSendQueueItem[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                listQueue[i]                  = new ClaimSendQueueItem();
                listQueue[i].ClaimNum         = PIn.PInt(table.Rows[i][0].ToString());
                listQueue[i].NoSendElect      = PIn.PBool(table.Rows[i][1].ToString());
                listQueue[i].PatName          = PIn.PString(table.Rows[i][2].ToString());
                listQueue[i].ClaimStatus      = PIn.PString(table.Rows[i][3].ToString());
                listQueue[i].Carrier          = PIn.PString(table.Rows[i][4].ToString());
                listQueue[i].PatNum           = PIn.PInt(table.Rows[i][5].ToString());
                listQueue[i].ClearinghouseNum = Clearinghouses.GetNumForPayor(PIn.PString(table.Rows[i][6].ToString()));
                listQueue[i].IsMedical        = PIn.PBool(table.Rows[i][7].ToString());
            }
            return(listQueue);
        }
Ejemplo n.º 2
0
 private void FillGrid()
 {
     Clearinghouses.RefreshCache();
     gridMain.ResetRows(Clearinghouses.Listt.Length);
     gridMain.SetGridColor(Color.Gray);
     gridMain.SetBackGColor(Color.White);
     for (int i = 0; i < Clearinghouses.Listt.Length; i++)
     {
         gridMain.Cell[0, i] = Clearinghouses.Listt[i].Description;
         gridMain.Cell[1, i] = Clearinghouses.Listt[i].ExportPath;
         gridMain.Cell[2, i] = Clearinghouses.Listt[i].Eformat.ToString();
         string s = "";
         if (PrefC.GetLong(PrefName.ClearinghouseDefaultDent) == Clearinghouses.Listt[i].ClearinghouseNum)
         {
             s += "Dent";
         }
         if (PrefC.GetLong(PrefName.ClearinghouseDefaultMed) == Clearinghouses.Listt[i].ClearinghouseNum)
         {
             if (s != "")
             {
                 s += ",";
             }
             s += "Med";
         }
         gridMain.Cell[3, i] = s;
         gridMain.Cell[4, i] = Clearinghouses.Listt[i].Payors;
     }
     gridMain.LayoutTables();
 }
Ejemplo n.º 3
0
        private void FormClearinghouses_Load(object sender, System.EventArgs e)
        {
            textReportComputerName.Text = PrefC.GetString(PrefName.ClaimReportComputerName);
            int claimReportReceiveInterval = PrefC.GetInt(PrefName.ClaimReportReceiveInterval);

            checkReceiveReportsService.Checked = PrefC.GetBool(PrefName.ClaimReportReceivedByService);
            _listClearinghousesHq        = Clearinghouses.GetDeepCopy(true);
            _listClearinghousesClinicAll = Clearinghouses.GetAllNonHq();
            _listClearinghousesClinicCur = new List <Clearinghouse>();
            _selectedClinicNum           = 0;
            if (PrefC.HasClinicsEnabled)
            {
                comboClinic.Visible = true;
                labelClinic.Visible = true;
                FillClinics();
            }
            if (CultureInfo.CurrentCulture.Name.EndsWith("CA"))
            {
                butEligibility.Visible = false;
            }
            FillGrid();
            if (claimReportReceiveInterval == 0)
            {
                radioTime.Checked = true;
                DateTime fullDateTime = PrefC.GetDateT(PrefName.ClaimReportReceiveTime);
                textReportCheckTime.Text = fullDateTime.ToShortTimeString();
            }
            else
            {
                textReportCheckInterval.Text = POut.Int(claimReportReceiveInterval);
                radioInterval.Checked        = true;
            }
        }
Ejemplo n.º 4
0
        ///<summary>Returns the clearinghouse specified by the given num.  Will only return an HQ-level clearinghouse.
        ///Do not attempt to pass in a clinic-level clearinghouseNum.  Can return null if no match found.</summary>
        public static Clearinghouse GetClearinghouseHq(long hqClearinghouseNum, bool suppressError)
        {
            Clearinghouse clearinghouse = Clearinghouses.GetClearinghouse(hqClearinghouseNum);

            if (clearinghouse == null && !suppressError)
            {
                MsgBox.Show("Clearinghouses", "Error. Could not locate Clearinghouse.");
            }
            return(clearinghouse);
        }
Ejemplo n.º 5
0
 private void butDelete_Click(object sender, System.EventArgs e)
 {
     if (MessageBox.Show(Lan.g(this, "Delete this Clearinghouse?"), "", MessageBoxButtons.OKCancel)
         != DialogResult.OK)
     {
         return;
     }
     Clearinghouses.Delete(ClearinghouseCur);
     DialogResult = DialogResult.OK;
 }
Ejemplo n.º 6
0
 private void FormClaimReports_Load(object sender, System.EventArgs e)
 {
     _listHqClearinghouses = Clearinghouses.GetDeepCopy();
     for (int i = 0; i < _listHqClearinghouses.Count; i++)
     {
         comboClearhouse.Items.Add(_listHqClearinghouses[i].Description);
         if (PrefC.GetLong(PrefName.ClearinghouseDefaultDent) == _listHqClearinghouses[i].ClearinghouseNum)
         {
             comboClearhouse.SelectedIndex = i;
         }
     }
     if (comboClearhouse.Items.Count > 0 && comboClearhouse.SelectedIndex == -1)
     {
         comboClearhouse.SelectedIndex = 0;
     }
 }
Ejemplo n.º 7
0
        private void FormEtrans270Edit_Load(object sender, EventArgs e)
        {
            MessageText    = EtransMessageTexts.GetMessageText(EtransCur.EtransMessageTextNum);
            MessageTextAck = "";
            //textMessageText.Text=MessageText;
            textNote.Text = EtransCur.Note;
            EtransAck271  = Etranss.GetEtrans(EtransCur.AckEtransNum);
            x271          = null;
            if (EtransAck271 != null)
            {
                MessageTextAck = EtransMessageTexts.GetMessageText(EtransAck271.EtransMessageTextNum);              //.Replace("~","~\r\n");
                if (EtransAck271.Etype == EtransType.BenefitResponse271)
                {
                    x271 = new X271(MessageTextAck);
                }
            }
            listDTP = new List <DTP271>();
            if (x271 != null)
            {
                listDTP = x271.GetListDtpSubscriber();
                textResponseGroupNum.Text = x271.GetGroupNum();
            }
            if (textCurrentGroupNum.Text != textResponseGroupNum.Text)
            {
                errorProviderGroupNum.SetError(textCurrentGroupNum, Lan.g(this, "Mismatched group number."));
            }
            radioBenefitSendsPat.Checked = (!_isConinsuranceInverted);
            radioBenefitSendsIns.Checked = (_isConinsuranceInverted);
            FillGridDates();
            CreateListOfBenefits();
            FillGrid();
            FillGridBen();
            if (IsInitialResponse)
            {
                SelectForImport();
            }
            long patNum = (EtransCur.PatNum == 0?_subPatNum:EtransCur.PatNum);        //Older 270/217s were always for the subscriber and have etrans.PatNum of 0.

            this.Text += ": " + Patients.GetNameLF(patNum);
            if (Clearinghouses.GetFirstOrDefault(x => x.ClearinghouseNum == EtransCur.ClearingHouseNum)?.CommBridge == EclaimsCommBridge.EDS &&
                EtransAck271 != null && EtransAck271.AckEtransNum != 0)
            {
                _htmlResponse    = EtransMessageTexts.GetMessageText(Etranss.GetEtrans(EtransAck271.AckEtransNum).EtransMessageTextNum);
                butPrint.Visible = true;
            }
        }
Ejemplo n.º 8
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();
     }
 }
Ejemplo n.º 9
0
        private void FormClearinghouses_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (PrefC.GetLong(PrefName.ClearinghouseDefaultDent) == 0)
            {
                if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "A default clearinghouse should be set. Continue anyway?"))
                {
                    e.Cancel = true;
                    return;
                }
            }
            //validate that the default dental clearinghouse is not type mismatched.
            Clearinghouse chDent = Clearinghouses.GetClearinghouse(PrefC.GetLong(PrefName.ClearinghouseDefaultDent));

            if (chDent != null)
            {
                if (chDent.Eformat == ElectronicClaimFormat.x837_5010_med_inst)               //mismatch
                {
                    if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "The default dental clearinghouse should be set to a dental e-claim format.  Continue anyway?"))
                    {
                        e.Cancel = true;
                        return;
                    }
                }
            }
            //validate medical clearinghouse
            Clearinghouse chMed = Clearinghouses.GetClearinghouse(PrefC.GetLong(PrefName.ClearinghouseDefaultMed));

            if (chMed != null)
            {
                if (chMed.Eformat != ElectronicClaimFormat.x837_5010_med_inst)               //mismatch
                {
                    if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "The default medical clearinghouse should be set to a med/inst e-claim format.  Continue anyway?"))
                    {
                        e.Cancel = true;
                        return;
                    }
                }
            }
            if (listHasChanged)
            {
                //update all computers including this one:
                DataValid.SetInvalid(InvalidType.ClearHouses);
            }
        }
Ejemplo n.º 10
0
 private void FillGrid()
 {
     Clearinghouses.Refresh();
     gridMain.ResetRows(Clearinghouses.List.Length);
     gridMain.SetGridColor(Color.Gray);
     gridMain.SetBackGColor(Color.White);
     for (int i = 0; i < Clearinghouses.List.Length; i++)
     {
         gridMain.Cell[0, i] = Clearinghouses.List[i].Description;
         gridMain.Cell[1, i] = Clearinghouses.List[i].ExportPath;
         gridMain.Cell[2, i] = Clearinghouses.List[i].Eformat.ToString();
         if (Clearinghouses.List[i].IsDefault)
         {
             gridMain.Cell[3, i] = "X";
         }
         gridMain.Cell[4, i] = Clearinghouses.List[i].Payors;
     }
     gridMain.LayoutTables();
 }
        private void butOK_Click(object sender, EventArgs e)
        {
            if (listCarriers.SelectedIndex < 0)
            {
                MsgBox.Show(this, "You must first choose a carrier.");
                return;
            }
            if (listBillingProvider.SelectedIndex < 0)
            {
                MsgBox.Show(this, "You must first choose a billing provider.");
                return;
            }
            if (listTreatingProvider.SelectedIndex < 0)
            {
                MsgBox.Show(this, "You must first choose a treating provider.");
                return;
            }
            DateTime reconciliationDate;

            try {
                reconciliationDate = DateTime.Parse(textDateReconciliation.Text).Date;
            }
            catch {
                MsgBox.Show(this, "Reconciliation date invalid.");
                return;
            }
            Cursor = Cursors.WaitCursor;
            try {
                Carrier       carrier           = carriers[listCarriers.SelectedIndex];
                Clearinghouse clearinghouseHq   = Canadian.GetCanadianClearinghouseHq(carrier);
                Clearinghouse clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum);
                CanadianOutput.GetPaymentReconciliations(clearinghouseClin, carrier, _listProviders[listTreatingProvider.SelectedIndex],
                                                         _listProviders[listBillingProvider.SelectedIndex], reconciliationDate, Clinics.ClinicNum, false, FormCCDPrint.PrintCCD);
                Cursor = Cursors.Default;
                MsgBox.Show(this, "Done.");
            }
            catch (Exception ex) {
                Cursor = Cursors.Default;
                MessageBox.Show(Lan.g(this, "Request failed: ") + ex.Message);
            }
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 12
0
        ///<summary>Sends data for the DXC credit check program link.</summary>
        ///<param name="prog">The program calling this. Should be DXC.</param>
        ///<param name="pat">The current patient.</param>
        public static void SendData(Program prog, Patient pat)
        {
            string url = "https://";

                        #if DEBUG
            url += "prelive.dentalxchange.com";
                        #else
            url += "register.dentalxchange.com";
                        #endif
            url += "/reg/pmslogin";
            Clearinghouse claimConnectClearingHouse = Clearinghouses.GetFirstOrDefault(x => x.CommBridge == EclaimsCommBridge.ClaimConnect);
            if (claimConnectClearingHouse == null)
            {
                MsgBox.Show("ContrAccount", "ClaimConnect clearinghouse not found.");
                return;
            }
            //This is the postdata
            string         postData = $"username={ claimConnectClearingHouse.LoginID }&pwd={ claimConnectClearingHouse.Password }&app=pfs&pagename=creditcheck";
            FormWebBrowser browser  = new FormWebBrowser(url: url, postData: postData, additionalHeaders: "Content-Type: application/x-www-form-urlencoded\r\n");
            browser.Show();
        }
Ejemplo n.º 13
0
        private void FormCarriers_Load(object sender, System.EventArgs e)
        {
            //if(CultureInfo.CurrentCulture.Name.EndsWith("CA")) {//Canadian. en-CA or fr-CA
            //No.  Even Canadian users will want to see all their carriers and only use the checkbox for special situations.
            //	checkCDAnet.Checked=true;
            //}
            //else{
            //	checkCDAnet.Visible=false;
            //}
            if (IsSelectMode)
            {
                butCancel.Text = Lan.g(this, "Cancel");
            }
            else
            {
                butCancel.Text = Lan.g(this, "Close");
                butOK.Visible  = false;
            }
            if (!Security.IsAuthorized(Permissions.CarrierCreate, true))
            {
                butAdd.Enabled = false;
            }
            Clearinghouse ch = Clearinghouses.GetDefaultDental();

            if (CultureInfo.CurrentCulture.Name.EndsWith("CA") && ch.Eformat == ElectronicClaimFormat.Canadian)
            {
                groupItrans.Visible = true;
                ItransImportFields fieldsToImport = (ItransImportFields)PrefC.GetInt(PrefName.ItransImportFields);
                checkITransPhone.Checked   = (fieldsToImport.HasFlag(ItransImportFields.Phone));
                checkItransAddress.Checked = (fieldsToImport.HasFlag(ItransImportFields.Address));
                checkItransName.Checked    = (fieldsToImport.HasFlag(ItransImportFields.Name));
                checkItransMissing.Checked = (fieldsToImport.HasFlag(ItransImportFields.AddMissing));
            }
            Carriers.RefreshCache();
            FillGrid();
        }
Ejemplo n.º 14
0
        private void FillGrid()
        {
            listQueue = Claims.GetQueueList();
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableQueue", "Patient Name"), 130);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableQueue", "Carrier Name"), 170);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableQueue", "Clearinghouse"), 120);
            gridMain.Columns.Add(col);
            //col=new ODGridColumn("",120);//Lan.g("TableQueue","Status"),120);
            //gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableQueue", "Missing Info"), 400);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < listQueue.Length; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(listQueue[i].PatName);
                row.Cells.Add(listQueue[i].Carrier);
                if (listQueue[i].NoSendElect)
                {
                    row.Cells.Add("Paper");
                }
                else
                {
                    row.Cells.Add(Clearinghouses.GetDescript(listQueue[i].ClearinghouseNum));
                }

                /*string status="";
                 * switch(listQueue[i].ClaimStatus){
                 *      case "U"://unsent
                 *              status="Unsent";
                 *              break;
                 *      case "H"://hold until pri received
                 *              status="Hold";
                 *              break;
                 *      case "W"://waiting to be sent
                 *              status="Waiting to Send";
                 *              break;
                 *      case "P"://probably sent
                 *              status="Probably Sent";
                 *              break;
                 *      case "S"://sent-verified
                 *              status="Sent-Verified";
                 *              break;
                 *      case "R"://received
                 *              status="Received";
                 *              break;
                 * }
                 * row.Cells.Add(Lan.g(this,status));
                 * row.Cells.Add("");*/
                if (listQueue[i].NoSendElect)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(Eclaims.Eclaims.GetMissingData(listQueue[i]));
                }
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Ejemplo n.º 15
0
        private void FillGrid()
        {
            _listClearinghousesClinicCur.Clear();
            for (int i = 0; i < _listClearinghousesClinicAll.Count; i++)
            {
                if (_listClearinghousesClinicAll[i].ClinicNum == _selectedClinicNum)
                {
                    _listClearinghousesClinicCur.Add(_listClearinghousesClinicAll[i]);
                }
            }
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g(this, "Description"), 150);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Export Path"), 230);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Format"), 110);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Is Default"), 60);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Payors"), 0);        //310
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < _listClearinghousesHq.Count; i++)
            {
                Clearinghouse[] listClearinghouseTag = new Clearinghouse[3];            //[0]=clearinghouseHq, [1]=clearinghouseClinic, [2]=clearinghouseCur per ODGridRow
                listClearinghouseTag[0] = _listClearinghousesHq[i].Copy();              //clearinghousehq.
                listClearinghouseTag[2] = _listClearinghousesHq[i].Copy();              //clearinghouseCur. will be clearinghouseHq if clearinghouseClinic doesn't exist.
                for (int j = 0; j < _listClearinghousesClinicCur.Count; j++)
                {
                    if (_listClearinghousesClinicCur[j].HqClearinghouseNum == _listClearinghousesHq[i].ClearinghouseNum)
                    {
                        listClearinghouseTag[1] = _listClearinghousesClinicCur[j];                      //clearinghouseClin
                        listClearinghouseTag[2] = Clearinghouses.OverrideFields(_listClearinghousesHq[i], _listClearinghousesClinicCur[j]);
                        break;
                    }
                }
                Clearinghouse clearinghouseCur = listClearinghouseTag[2];
                row     = new ODGridRow();
                row.Tag = listClearinghouseTag;
                row.Cells.Add(clearinghouseCur.Description);
                row.Cells.Add(clearinghouseCur.ExportPath);
                row.Cells.Add(clearinghouseCur.Eformat.ToString());
                string s = "";
                if (PrefC.GetLong(PrefName.ClearinghouseDefaultDent) == _listClearinghousesHq[i].ClearinghouseNum)
                {
                    s += "Dent";
                }
                if (PrefC.GetLong(PrefName.ClearinghouseDefaultMed) == _listClearinghousesHq[i].ClearinghouseNum)
                {
                    if (s != "")
                    {
                        s += ",";
                    }
                    s += "Med";
                }
                if (PrefC.GetLong(PrefName.ClearinghouseDefaultEligibility) == _listClearinghousesHq[i].ClearinghouseNum &&
                    !CultureInfo.CurrentCulture.Name.EndsWith("CA"))                        //Canadian. en-CA or fr-CA
                {
                    if (s != "")
                    {
                        s += ",";
                    }
                    s += "Elig";
                }
                row.Cells.Add(s);
                row.Cells.Add(clearinghouseCur.Payors);
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
        private void butOK_Click(object sender, EventArgs e)
        {
            if (radioVersion4ToCarrier.Checked)
            {
                if (listCarriers.SelectedIndex < 0)
                {
                    MsgBox.Show(this, "You must first select a carrier to use.");
                    return;
                }
            }
            if (listOfficeNumbers.SelectedIndex < 0)
            {
                MsgBox.Show(this, "You must first select an Office Number to use.");
                return;
            }
            Cursor = Cursors.WaitCursor;
            Provider prov = null;

            for (int i = 0; i < _listProviders.Count; i++)
            {
                if (_listProviders[i].CanadianOfficeNum == listOfficeNumbers.Items[listOfficeNumbers.SelectedIndex].ToString() &&
                    _listProviders[i].NationalProvID != "" && _listProviders[i].IsCDAnet)
                {
                    prov = _listProviders[i];
                    break;
                }
            }
            try {
                if (radioVersion2.Checked)
                {
                    Clearinghouse clearinghouseHq   = Canadian.GetCanadianClearinghouseHq(null);
                    Clearinghouse clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum);
                    CanadianOutput.GetOutstandingTransactions(clearinghouseClin, true, false, null, prov, false, FormClaimPrint.PrintCdaClaimForm,
                                                              FormCCDPrint.PrintCCD);
                }
                else if (radioVersion4Itrans.Checked)
                {
                    Clearinghouse clearinghouseHq   = Canadian.GetCanadianClearinghouseHq(null);
                    Clearinghouse clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum);
                    CanadianOutput.GetOutstandingTransactions(clearinghouseClin, false, true, null, prov, false, FormClaimPrint.PrintCdaClaimForm,
                                                              FormCCDPrint.PrintCCD);
                }
                else if (radioVersion4ToCarrier.Checked)
                {
                    Carrier       carrier           = carriers[listCarriers.SelectedIndex];
                    Clearinghouse clearinghouseHq   = Canadian.GetCanadianClearinghouseHq(carrier);
                    Clearinghouse clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum);
                    CanadianOutput.GetOutstandingTransactions(clearinghouseClin, false, false, carrier, prov, false, FormClaimPrint.PrintCdaClaimForm,
                                                              FormCCDPrint.PrintCCD);
                }
                Cursor = Cursors.Default;
                MsgBox.Show(this, "Done.");
            }
            catch (ApplicationException aex) {
                Cursor = Cursors.Default;
                MessageBox.Show(Lan.g(this, "Request failed: ") + aex.Message);
            }
            catch (Exception ex) {
                Cursor = Cursors.Default;
                MessageBox.Show(Lan.g(this, "Request failed: ") + ex.ToString());
            }
            DialogResult = DialogResult.OK;
        }
        private void butOK_Click(object sender, EventArgs e)
        {
            if (!checkGetForAllCarriers.Checked)
            {
                if (listCarriers.SelectedIndex < 0 && listNetworks.SelectedIndex < 0)
                {
                    MsgBox.Show(this, "You must first choose one carrier or one network.");
                    return;
                }
            }
            if (listTreatingProvider.SelectedIndex < 0)
            {
                MsgBox.Show(this, "You must first choose a treating provider.");
                return;
            }
            DateTime reconciliationDate;

            try {
                reconciliationDate = DateTime.Parse(textDateReconciliation.Text).Date;
            }
            catch {
                MsgBox.Show(this, "Reconciliation date invalid.");
                return;
            }
            Cursor = Cursors.WaitCursor;
            try {
                if (checkGetForAllCarriers.Checked)
                {
                    Carrier carrier = new Carrier();
                    carrier.CDAnetVersion            = "04";
                    carrier.ElectID                  = "999999"; //The whole ITRANS network.
                    carrier.CanadianEncryptionMethod = 1;        //No encryption.
                    Clearinghouse clearinghouseHq   = Canadian.GetCanadianClearinghouseHq(carrier);
                    Clearinghouse clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum);
                    CanadianOutput.GetSummaryReconciliation(clearinghouseClin, carrier, null,
                                                            _listProviders[listTreatingProvider.SelectedIndex], reconciliationDate, false, FormCCDPrint.PrintCCD);
                }
                else
                {
                    if (listCarriers.SelectedIndex >= 0)
                    {
                        Carrier       carrier           = carriers[listCarriers.SelectedIndex];
                        Clearinghouse clearinghouseHq   = Canadian.GetCanadianClearinghouseHq(carrier);
                        Clearinghouse clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum);
                        CanadianOutput.GetSummaryReconciliation(clearinghouseClin, carrier, null,
                                                                _listProviders[listTreatingProvider.SelectedIndex], reconciliationDate, false, FormCCDPrint.PrintCCD);
                    }
                    else
                    {
                        Clearinghouse clearinghouseHq   = Canadian.GetCanadianClearinghouseHq(null);
                        Clearinghouse clearinghouseClin = Clearinghouses.OverrideFields(clearinghouseHq, Clinics.ClinicNum);
                        CanadianOutput.GetSummaryReconciliation(clearinghouseClin, null, _listCanadianNetworks[listNetworks.SelectedIndex],
                                                                _listProviders[listTreatingProvider.SelectedIndex], reconciliationDate, false, FormCCDPrint.PrintCCD);
                    }
                }
                Cursor = Cursors.Default;
                MsgBox.Show(this, "Done.");
            }
            catch (Exception ex) {
                Cursor = Cursors.Default;
                MessageBox.Show(Lan.g(this, "Request failed: ") + ex.Message);
            }
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 18
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();
            }
        }
Ejemplo n.º 19
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDescription.Text == "")
     {
         MessageBox.Show(Lan.g(this, "Clearinghouse name cannot be blank."));
         return;
     }
     if (textExportPath.Text != "" && !textExportPath.Text.EndsWith("\\"))
     {
         MsgBox.Show(this, "Paths must end in \\");
         return;
     }
     if (textResponsePath.Text != "" && !textResponsePath.Text.EndsWith("\\"))
     {
         MsgBox.Show(this, "Paths must end in \\");
         return;
     }
     if (!Directory.Exists(textExportPath.Text))
     {
         if (MessageBox.Show("Export path does not exist. Continue anyway?", ""
                             , MessageBoxButtons.OKCancel) != DialogResult.OK)
         {
             return;
         }
     }
     if (comboFormat.SelectedIndex == 0)
     {
         if (MessageBox.Show("Format not selected. Claims will not send. Continue anyway?", ""
                             , MessageBoxButtons.OKCancel) != DialogResult.OK)
         {
             return;
         }
     }
     if (comboFormat.SelectedIndex == (int)ElectronicClaimFormat.X12)
     {
         if (textReceiverID.Text != "BCBSGA" &&
             textReceiverID.Text != "100000" &&                  //Medicaid of GA
             textReceiverID.Text != "0135WCH00" &&                  //WebMD
             textReceiverID.Text != "330989922" &&                  //WebClaim
             textReceiverID.Text != "RECS" &&
             textReceiverID.Text != "AOS" &&
             textReceiverID.Text != "PostnTrack"
             )
         {
             if (!MsgBox.Show(this, true, "Clearinghouse ID not recognized. Continue anyway?"))
             {
                 return;
             }
         }
     }
     ClearinghouseCur.Description = textDescription.Text;
     ClearinghouseCur.ReceiverID  = textReceiverID.Text;
     //ClearinghouseCur.SenderID=textSenderID.Text;
     ClearinghouseCur.LoginID       = textLoginID.Text;
     ClearinghouseCur.Password      = textPassword.Text;
     ClearinghouseCur.ExportPath    = textExportPath.Text;
     ClearinghouseCur.ResponsePath  = textResponsePath.Text;
     ClearinghouseCur.Eformat       = (ElectronicClaimFormat)(comboFormat.SelectedIndex);
     ClearinghouseCur.CommBridge    = (EclaimsCommBridge)(comboCommBridge.SelectedIndex);
     ClearinghouseCur.ModemPort     = PIn.PInt(textModemPort.Text);
     ClearinghouseCur.ClientProgram = textClientProgram.Text;
     ClearinghouseCur.IsDefault     = checkIsDefault.Checked;
     ClearinghouseCur.Payors        = textPayors.Text;
     if (IsNew)
     {
         Clearinghouses.Insert(ClearinghouseCur);
     }
     else
     {
         Clearinghouses.Update(ClearinghouseCur);
     }
     DialogResult = DialogResult.OK;
 }