Esempio n. 1
0
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            FormCarrierEdit FormCE = new FormCarrierEdit();

            FormCE.IsNew = true;
            Carrier carrier = new Carrier();

            if (CultureInfo.CurrentCulture.Name.EndsWith("CA"))             //Canadian. en-CA or fr-CA
            {
                carrier.IsCDA = true;
            }
            carrier.CarrierName = textCarrier.Text;
            //The phone number will get formated while the user types inside the carrier edit window.
            //However, the user could have typed in a poorly formatted number so we will reformat the number once before load.
            string phoneFormatted = TelephoneNumbers.ReFormat(textPhone.Text);

            carrier.Phone     = phoneFormatted;
            FormCE.CarrierCur = carrier;
            FormCE.ShowDialog();
            if (FormCE.DialogResult != DialogResult.OK)
            {
                return;
            }
            //Load the name and phone number of the newly added carrier to the search fields so that the new carrier shows up in the grid.
            textCarrier.Text = FormCE.CarrierCur.CarrierName;
            textPhone.Text   = FormCE.CarrierCur.Phone;
            FillGrid();
            for (int i = 0; i < table.Rows.Count; i++)
            {
                if (FormCE.CarrierCur.CarrierNum.ToString() == table.Rows[i]["CarrierNum"].ToString())
                {
                    gridMain.SetSelected(i, true);
                }
            }
            DataValid.SetInvalid(InvalidType.Carriers);
        }
Esempio n. 2
0
 private void FormPractice_Load(object sender, System.EventArgs e)
 {
     checkIsMedicalOnly.Checked = PrefC.GetBool(PrefName.PracticeIsMedicalOnly);
     if (Programs.UsingEcwTightOrFullMode())
     {
         checkIsMedicalOnly.Visible = false;
     }
     textPracticeTitle.Text = PrefC.GetString(PrefName.PracticeTitle);
     textAddress.Text       = PrefC.GetString(PrefName.PracticeAddress);
     textAddress2.Text      = PrefC.GetString(PrefName.PracticeAddress2);
     textCity.Text          = PrefC.GetString(PrefName.PracticeCity);
     textST.Text            = PrefC.GetString(PrefName.PracticeST);
     textZip.Text           = PrefC.GetString(PrefName.PracticeZip);
     textPhone.Text         = TelephoneNumbers.ReFormat(PrefC.GetString(PrefName.PracticePhone));
     textFax.Text           = TelephoneNumbers.ReFormat(PrefC.GetString(PrefName.PracticeFax));
     checkUseBillingAddressOnClaims.Checked = PrefC.GetBool(PrefName.UseBillingAddressOnClaims);
     textBillingAddress.Text  = PrefC.GetString(PrefName.PracticeBillingAddress);
     textBillingAddress2.Text = PrefC.GetString(PrefName.PracticeBillingAddress2);
     textBillingCity.Text     = PrefC.GetString(PrefName.PracticeBillingCity);
     textBillingST.Text       = PrefC.GetString(PrefName.PracticeBillingST);
     textBillingZip.Text      = PrefC.GetString(PrefName.PracticeBillingZip);
     textPayToAddress.Text    = PrefC.GetString(PrefName.PracticePayToAddress);
     textPayToAddress2.Text   = PrefC.GetString(PrefName.PracticePayToAddress2);
     textPayToCity.Text       = PrefC.GetString(PrefName.PracticePayToCity);
     textPayToST.Text         = PrefC.GetString(PrefName.PracticePayToST);
     textPayToZip.Text        = PrefC.GetString(PrefName.PracticePayToZip);
     textBankNumber.Text      = PrefC.GetString(PrefName.PracticeBankNumber);
     if (CultureInfo.CurrentCulture.Name.EndsWith("CH"))             //CH is for switzerland. eg de-CH
     {
         textBankRouting.Text = PrefC.GetString(PrefName.BankRouting);
         textBankAddress.Text = PrefC.GetString(PrefName.BankAddress);
     }
     else
     {
         groupSwiss.Visible = false;
     }
     listProvider.Items.Clear();
     _listProviders = Providers.GetDeepCopy(true);
     for (int i = 0; i < _listProviders.Count; i++)
     {
         listProvider.Items.Add(_listProviders[i].GetLongDesc());
         if (_listProviders[i].ProvNum == PrefC.GetLong(PrefName.PracticeDefaultProv))
         {
             listProvider.SelectedIndex = i;
         }
     }
     listBillType.Items.Clear();
     _listBillingTypeDefs = Defs.GetDefsForCategory(DefCat.BillingTypes, true);
     for (int i = 0; i < _listBillingTypeDefs.Count; i++)
     {
         listBillType.Items.Add(_listBillingTypeDefs[i].ItemName);
         if (_listBillingTypeDefs[i].DefNum == PrefC.GetLong(PrefName.PracticeDefaultBillType))
         {
             listBillType.SelectedIndex = i;
         }
     }
     if (PrefC.GetBool(PrefName.EasyHidePublicHealth))
     {
         labelPlaceService.Visible = false;
         listPlaceService.Visible  = false;
     }
     listPlaceService.Items.Clear();
     for (int i = 0; i < Enum.GetNames(typeof(PlaceOfService)).Length; i++)
     {
         listPlaceService.Items.Add(Lan.g("enumPlaceOfService", Enum.GetNames(typeof(PlaceOfService))[i]));
     }
     listPlaceService.SelectedIndex = PrefC.GetInt(PrefName.DefaultProcedurePlaceService);
     _selectedBillingProvNum        = PrefC.GetLong(PrefName.InsBillingProv);
     _insBillingProvNum             = _selectedBillingProvNum;
     FillComboInsBillingProv();
 }
Esempio n. 3
0
        private void ProcessINS(string field, string textValue)
        {
            //MessageBox.Show("INS, "+field+", "+textValue);
            switch (field)
            {
            case "CompanyName":
                carrier.CarrierName = textValue;
                break;

            case "AddressStreet":
                carrier.Address = textValue;
                break;

            case "AddressOtherDesignation":
                carrier.Address2 = textValue;
                break;

            case "AddressCity":
                carrier.City = textValue;
                break;

            case "AddressStateOrProvince":
                carrier.State = textValue;                      //we won't enforce two letters
                break;

            case "AddressZipOrPostalCode":
                carrier.Zip = textValue;
                break;

            case "PhoneNumber":
                carrier.Phone = TelephoneNumbers.ReFormat(textValue);
                break;

            case "GroupNumber":
                plan.GroupNum = textValue;
                break;

            case "GroupName":
                plan.GroupName = textValue;
                break;

            case "InsuredGroupEmpName":
                InsEmp = textValue;
                break;

            case "PlanEffectiveDate":
                sub.DateEffective = DateTime.MinValue;
                if (textValue.Length > 0)
                {
                    try{
                        sub.DateEffective = DateTime.Parse(textValue);
                    }
                    catch {
                        warnings += "Invalid PlanEffectiveDate\r\n";
                    }
                }
                break;

            case "PlanExpirationDate":
                sub.DateTerm = DateTime.MinValue;
                if (textValue.Length > 0)
                {
                    try{
                        sub.DateTerm = DateTime.Parse(textValue);
                    }
                    catch {
                        warnings += "Invalid PlanExpirationDate\r\n";
                    }
                }
                break;

            case "InsuredsNameLast":
                subsc.LName = textValue;
                break;

            case "InsuredsNameFirst":
                subsc.FName = textValue;
                break;

            case "InsuredsNameMiddle":
                subsc.MiddleI = textValue;
                break;

            case "InsuredsRelationToPat":                    //Self, Parent, Spouse, or Guardian
                switch (textValue.ToLower())
                {
                case "self":
                    insRelat = "self";
                    break;

                case "parent":
                    insRelat = "parent";
                    break;

                case "spouse":
                    insRelat = "spouse";
                    break;

                case "guardian":
                    insRelat = "guardian";
                    break;

                case "":
                    insRelat = "self";
                    break;

                default:
                    insRelat  = "self";
                    warnings += "Invalid InsuredsRelationToPat\r\n";
                    break;
                }
                break;

            case "InsuredsDateOfBirth":
                subsc.Birthdate = DateTime.MinValue;
                if (textValue.Length > 0)
                {
                    try{
                        subsc.Birthdate = DateTime.Parse(textValue);
                    }
                    catch {
                        warnings += "Invalid InsuredsDateOfBirth\r\n";
                    }
                }
                break;

            case "InsuredsAddressStreet":
                subsc.Address = textValue;
                break;

            case "InsuredsAddressOtherDesignation":
                subsc.Address2 = textValue;
                break;

            case "InsuredsAddressCity":
                subsc.City = textValue;
                break;

            case "InsuredsAddressStateOrProvince":
                subsc.State = textValue;                      //we won't enforce two letters
                break;

            case "InsuredsAddressZipOrPostalCode":
                subsc.Zip = textValue;
                break;

            case "AssignmentOfBenefits":
                switch (textValue.ToUpper())
                {
                case "Y":
                    sub.AssignBen = true;
                    break;

                case "N":
                    sub.AssignBen = false;
                    break;

                case "":
                    sub.AssignBen = true;
                    break;

                default:
                    sub.AssignBen = true;
                    warnings     += "Invalid AssignmentOfBenefits\r\n";
                    break;
                }
                break;

            case "ReleaseInformationCode":
                switch (textValue.ToUpper())
                {
                case "Y":
                    sub.ReleaseInfo = true;
                    break;

                case "N":
                    sub.ReleaseInfo = false;
                    break;

                case "":
                    sub.ReleaseInfo = true;
                    break;

                default:
                    sub.ReleaseInfo = true;
                    warnings       += "Invalid ReleaseInformationCode\r\n";
                    break;
                }
                break;

            case "PolicyNumber":
                sub.SubscriberID = textValue;
                break;

            case "PolicyDeductible":
                deductible = -1;                      //unknown
                if (textValue.Length > 0)
                {
                    try{
                        deductible = System.Convert.ToInt32(textValue);
                    }
                    catch {
                        warnings += "Invalid PolicyDeductible\r\n";
                    }
                }
                break;

            case "PolicyLimitAmount":
                annualMax = -1;                      //unknown
                if (textValue.Length > 0)
                {
                    try{
                        annualMax = System.Convert.ToInt32(textValue);
                    }
                    catch {
                        warnings += "Invalid PolicyLimitAmount\r\n";
                    }
                }
                break;

            case "InsuredsSex":
                subsc.Gender = PatientGender.Unknown;
                if (textValue.Length > 0)
                {
                    switch (textValue.Substring(0, 1).ToUpper())
                    {
                    case "M":
                        subsc.Gender = PatientGender.Male;
                        break;

                    case "F":
                        subsc.Gender = PatientGender.Female;
                        break;

                    case "U":
                        subsc.Gender = PatientGender.Unknown;
                        break;

                    default:
                        warnings += "Invalid InsuredsSex\r\n";
                        break;
                    }
                }
                break;

            case "InsuredsSSN":
                subsc.SSN = textValue;
                if (CultureInfo.CurrentCulture.Name == "en-US")
                {
                    if (Regex.IsMatch(subsc.SSN, @"^\d\d\d-\d\d-\d\d\d\d$"))
                    {
                        subsc.SSN = subsc.SSN.Replace("-", "");
                    }
                    if (!Regex.IsMatch(subsc.SSN, @"^\d{9}$"))                           //if not exactly 9 digits
                    {
                        warnings += "Invalid InsuredsSSN\r\n";
                    }
                }
                break;

            case "InsuredsPhoneHome":
                subsc.HmPhone = TelephoneNumbers.ReFormat(textValue);
                break;

            case "NotePlan":
                sub.BenefitNotes = textValue;
                break;

            default:
                warnings += "Unrecognized field: " + field + "\r\n";
                break;
            }
        }
Esempio n. 4
0
        private void ProcessGT(string field, string textValue)
        {
            //MessageBox.Show("GT, "+field+", "+textValue);
            switch (field)
            {
            case "NameLast":
                guar.LName = textValue;
                break;

            case "NameFirst":
                guar.FName = textValue;
                break;

            case "NameMiddle":
                guar.MiddleI = textValue;
                break;

            case "AddressStreet":
                guar.Address = textValue;
                break;

            case "AddressOtherDesignation":
                guar.Address2 = textValue;
                break;

            case "AddressCity":
                guar.City = textValue;
                break;

            case "AddressStateOrProvince":
                guar.State = textValue;                      //we won't enforce two letters
                break;

            case "AddressZipOrPostalCode":
                guar.Zip = textValue;
                break;

            case "PhoneHome":
                guar.HmPhone = TelephoneNumbers.ReFormat(textValue);
                break;

            case "EmailAddressHome":
                guar.Email = textValue;
                break;

            case "PhoneBusiness":
                guar.WkPhone = TelephoneNumbers.ReFormat(textValue);
                break;

            case "DateOfBirth":
                guar.Birthdate = DateTime.MinValue;
                if (textValue.Length > 0)
                {
                    try{
                        guar.Birthdate = DateTime.Parse(textValue);
                    }
                    catch {
                        warnings += "Invalid DateOfBirth\r\n";
                    }
                }
                break;

            case "Sex":
                guar.Gender = PatientGender.Unknown;
                if (textValue.Length > 0)
                {
                    switch (textValue.Substring(0, 1).ToUpper())
                    {
                    case "M":
                        guar.Gender = PatientGender.Male;
                        break;

                    case "F":
                        guar.Gender = PatientGender.Female;
                        break;

                    case "U":
                        guar.Gender = PatientGender.Unknown;
                        break;

                    default:
                        warnings += "Invalid Sex\r\n";
                        break;
                    }
                }
                break;

            case "GuarantorRelationship":
                switch (textValue.ToLower())
                {
                case "self":
                    guarRelat = "self";
                    break;

                case "parent":
                    guarRelat = "parent";
                    break;

                case "other":
                    guarRelat = "other";
                    break;

                case "":
                    guarRelat = "self";
                    break;

                default:
                    guarRelat = "self";
                    warnings += "Invalid GuarantorRelationship\r\n";
                    break;
                }
                break;

            case "SSN":
                guar.SSN = textValue;
                if (CultureInfo.CurrentCulture.Name == "en-US")
                {
                    if (Regex.IsMatch(guar.SSN, @"^\d\d\d-\d\d-\d\d\d\d$"))
                    {
                        guar.SSN = guar.SSN.Replace("-", "");
                    }
                    if (!Regex.IsMatch(guar.SSN, @"^\d{9}$"))                           //if not exactly 9 digits
                    {
                        warnings += "Invalid SSN\r\n";
                    }
                }
                break;

            case "EmployerName":
                GuarEmp = textValue;
                break;

            case "MaritalStatus":
                guar.Position = PatientPosition.Single;
                if (textValue.Length > 0)
                {
                    switch (textValue.Substring(0, 1).ToUpper())
                    {
                    case "M":
                        guar.Position = PatientPosition.Married;
                        break;

                    case "S":
                        guar.Position = PatientPosition.Single;
                        break;

                    case "W":
                        guar.Position = PatientPosition.Widowed;
                        break;

                    default:
                        warnings += "Invalid MaritalStatus\r\n";
                        break;
                    }
                }
                break;

            default:
                warnings += "Unrecognized field: " + field + "\r\n";
                break;
            }
        }
Esempio n. 5
0
        private void ProcessPID(string field, string textValue)
        {
            //MessageBox.Show("PID, "+field+", "+textValue);
            switch (field)
            {
            case "NameLast":
                pat.LName = textValue;
                break;

            case "NameFirst":
                pat.FName = textValue;
                break;

            case "NameMiddle":
                pat.MiddleI = textValue;
                break;

            case "DateOfBirth":
                pat.Birthdate = DateTime.MinValue;
                if (textValue.Length > 0)
                {
                    try{
                        pat.Birthdate = DateTime.Parse(textValue);
                    }
                    catch {
                        warnings += "Invalid DateOfBirth\r\n";
                    }
                }
                break;

            case "Sex":
                pat.Gender = PatientGender.Unknown;
                if (textValue.Length > 0)
                {
                    switch (textValue.Substring(0, 1).ToUpper())
                    {
                    case "M":
                        pat.Gender = PatientGender.Male;
                        break;

                    case "F":
                        pat.Gender = PatientGender.Female;
                        break;

                    case "U":
                        pat.Gender = PatientGender.Unknown;
                        break;

                    default:
                        warnings += "Invalid Sex\r\n";
                        break;
                    }
                }
                break;

            case "AliasFirst":
                pat.Preferred = textValue;
                break;

            case "AddressStreet":
                pat.Address = textValue;
                break;

            case "AddressOtherDesignation":
                pat.Address2 = textValue;
                break;

            case "AddressCity":
                pat.City = textValue;
                break;

            case "AddressStateOrProvince":
                pat.State = textValue;                      //we won't enforce two letters
                break;

            case "AddressZipOrPostalCode":
                pat.Zip = textValue;
                break;

            case "PhoneHome":
                pat.HmPhone = TelephoneNumbers.ReFormat(textValue);
                break;

            case "EmailAddressHome":
                pat.Email = textValue;
                break;

            case "PhoneBusiness":
                pat.WkPhone = TelephoneNumbers.ReFormat(textValue);
                break;

            case "MaritalStatus":
                pat.Position = PatientPosition.Single;
                if (textValue.Length > 0)
                {
                    switch (textValue.Substring(0, 1).ToUpper())
                    {
                    case "M":
                        pat.Position = PatientPosition.Married;
                        break;

                    case "S":
                        pat.Position = PatientPosition.Single;
                        break;

                    case "W":
                        pat.Position = PatientPosition.Widowed;
                        break;

                    default:
                        warnings += "Invalid MaritalStatus\r\n";
                        break;
                    }
                }
                break;

            case "SSN":
                pat.SSN = textValue;
                if (CultureInfo.CurrentCulture.Name == "en-US")
                {
                    if (Regex.IsMatch(pat.SSN, @"^\d\d\d-\d\d-\d\d\d\d$"))
                    {
                        pat.SSN = pat.SSN.Replace("-", "");
                    }
                    if (!Regex.IsMatch(pat.SSN, @"^\d{9}$"))                           //if not exactly 9 digits
                    {
                        warnings += "Invalid SSN\r\n";
                    }
                }
                break;

            case "NotePhoneAddress":
                pat.AddrNote = textValue;
                break;

            case "NoteMedicalComplete":
                NoteMedicalComp = textValue;
                break;

            default:
                warnings += "Unrecognized field: " + field + "\r\n";
                break;
            }
        }
Esempio n. 6
0
        ///<summary></summary>
        public static void Reformat()
        {
            string oldTel;
            string newTel;
            string idNum;

            Queries.CurReport.Query = "select * from patient";
            Queries.SubmitCur();
            for (int i = 0; i < Queries.TableQ.Rows.Count; i++)
            {
                idNum = PIn.PString(Queries.TableQ.Rows[i][0].ToString());
                //home
                oldTel = PIn.PString(Queries.TableQ.Rows[i][15].ToString());
                newTel = TelephoneNumbers.ReFormat(oldTel);
                if (oldTel != newTel)
                {
                    Queries.CurReport.Query = "UPDATE patient SET hmphone = '"
                                              + POut.PString(newTel) + "' WHERE patNum = '" + idNum + "'";

                    Queries.SubmitNonQ();
                }
                //wk:
                oldTel = PIn.PString(Queries.TableQ.Rows[i][16].ToString());
                newTel = TelephoneNumbers.ReFormat(oldTel);
                if (oldTel != newTel)
                {
                    Queries.CurReport.Query = "UPDATE patient SET wkphone = '"
                                              + POut.PString(newTel) + "' WHERE patNum = '" + idNum + "'";
                    Queries.SubmitNonQ();
                }
                //wireless
                oldTel = PIn.PString(Queries.TableQ.Rows[i][17].ToString());
                newTel = TelephoneNumbers.ReFormat(oldTel);
                if (oldTel != newTel)              // Keyush Shah 04/21/04 Bug, was overwriting wireless with work phone here
                {
                    Queries.CurReport.Query = "UPDATE patient SET wirelessphone = '"
                                              + POut.PString(newTel) + "' WHERE patNum = '" + idNum + "'";
                    Queries.SubmitNonQ();
                }
            }
            Queries.CurReport.Query = "select * from carrier";
            Queries.SubmitCur();
            for (int i = 0; i < Queries.TableQ.Rows.Count; i++)
            {
                idNum = PIn.PString(Queries.TableQ.Rows[i][0].ToString());
                //ph
                oldTel = PIn.PString(Queries.TableQ.Rows[i][7].ToString());
                newTel = TelephoneNumbers.ReFormat(oldTel);
                if (oldTel != newTel)
                {
                    Queries.CurReport.Query = "UPDATE carrier SET Phone = '"
                                              + POut.PString(newTel) + "' WHERE CarrierNum = '" + idNum + "'";
                    Queries.SubmitNonQ();
                }
            }
            //this last part will only be run once during conversion to 2.8. It can be dropped from a future version.

            /*Queries.CurReport.Query="select * from insplan";
             * Queries.SubmitCur();
             * for(int i=0;i<Queries.TableQ.Rows.Count;i++){
             *      idNum=PIn.PString(Queries.TableQ.Rows[i][0].ToString());
             *      //ph
             *      oldTel=PIn.PString(Queries.TableQ.Rows[i][5].ToString());
             *      newTel=TelephoneNumbers.ReFormat(oldTel);
             *      if(oldTel!=newTel){
             *              Queries.CurReport.Query="UPDATE insplan SET Phone = '"
             +newTel+"' WHERE PlanNum = '"+idNum+"'";
             *              Queries.SubmitNonQ();
             *      }
             * }*/
        }        //reformat