Пример #1
0
        private void ValidPhone_TextChanged(object sender, System.EventArgs e)
        {
            if (sender.GetType() != typeof(ValidPhone))
            {
                return;
            }
            if (!IsFormattingEnabled)
            {
                return;
            }
            ValidPhone textPhone     = (ValidPhone)sender;
            string     formattedText = TelephoneNumbers.AutoFormat(textPhone.Text);

            if (textPhone.Text == formattedText)
            {
                return;
            }
            //If there are characters that get removed from calling AutoFormat (i.e. spaces) and the cursor was at the start (which happens if/when the
            //ValidPhone control initially gets filled with a value) the calculated new selection start index would be an invalid value, so Max with 0.
            //Move cursor forward the difference in text length, i.e. if this adds a '(' character, move the cursor ahead one index.
            int newSelectionStartPosition = Math.Max(textPhone.SelectionStart + formattedText.Length - textPhone.Text.Length, 0);

            //remove this event handler from the TextChanged event so that setting the text here doesn't cause this to run again
            textPhone.TextChanged -= ValidPhone_TextChanged;
            textPhone.Text         = formattedText;
            //add this event handler back to the TextChanged event
            textPhone.TextChanged   += ValidPhone_TextChanged;
            textPhone.SelectionStart = newSelectionStartPosition;
        }
Пример #2
0
        private void textPhone_TextChanged(object sender, System.EventArgs e)
        {
            int cursor = textPhone.SelectionStart;
            int length = textPhone.Text.Length;

            textPhone.Text = TelephoneNumbers.AutoFormat(textPhone.Text);
            if (textPhone.Text.Length > length)
            {
                cursor++;
            }
            textPhone.SelectionStart = cursor;
        }
Пример #3
0
        private void textAnyPhone_TextChanged(object sender, System.EventArgs e)
        {
            if (sender.GetType() != typeof(TextBox))
            {
                return;
            }
            TextBox textPhone         = (TextBox)sender;
            int     phoneTextPosition = textPhone.SelectionStart;
            int     textLength        = textPhone.Text.Length;

            textPhone.Text = TelephoneNumbers.AutoFormat(textPhone.Text);
            int diff = textPhone.Text.Length - textLength;

            textPhone.SelectionStart = phoneTextPosition + diff;
        }
Пример #4
0
        private void CreateTask()
        {
            if (gridVoiceMails.SelectedCell.Y == -1 || gridVoiceMails.Rows.Count <= gridVoiceMails.SelectedCell.Y)
            {
                MsgBox.Show(this, "No voice mail selected");
                return;
            }
            VoiceMail voiceMailCur = (VoiceMail)gridVoiceMails.Rows[gridVoiceMails.SelectedCell.Y].Tag;
            VoiceMail voiceMailOld = voiceMailCur.Copy();

            if (voiceMailCur.PatNum == 0)           //Multiple patients had a match for the phone number
            {
                FormPatientSelect FormPS = new FormPatientSelect(new Patient {
                    HmPhone = voiceMailCur.PhoneNumber
                });
                if (FormPS.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                voiceMailCur.PatNum = FormPS.SelectedPatNum;
                VoiceMails.Update(voiceMailCur, voiceMailOld);
                FillGrid();
            }
            Task task = new Task()
            {
                TaskListNum = -1
            };                                                  //don't show it in any list yet.

            Tasks.Insert(task);
            Task taskOld = task.Copy();

            task.UserNum        = Security.CurUser.UserNum;
            task.TaskListNum    = Tasks.TriageTaskListNum;
            task.DateTimeEntry  = voiceMailCur.DateCreated;
            task.PriorityDefNum = Tasks.TriageBlueNum;
            task.ObjectType     = TaskObjectType.Patient;
            task.KeyNum         = voiceMailCur.PatNum;
            task.Descript       = "VM " + TelephoneNumbers.AutoFormat(voiceMailCur.PhoneNumber) + " ";
            FormTaskEdit FormTE = new FormTaskEdit(task, taskOld);

            FormTE.IsNew = true;
            FormTE.Show();            //non-modal
            FormTE.BringToFront();
            //The reason the below line didn't work is because popups would appear behind the task.
            //FormTE.TopMost=true;//For some techs, when they open a task from this window, it goes behind all the other windows. This is an attempted fix.
        }
Пример #5
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textStoreName.Text == "")
     {
         MessageBox.Show(Lan.g(this, "Store name cannot be blank."));
         return;
     }
     if (CultureInfo.CurrentCulture.Name == "en-US")
     {
         if (textPhone.Text != "" && TelephoneNumbers.FormatNumbersExactTen(textPhone.Text) == "")
         {
             MessageBox.Show(Lan.g(this, "Phone number must be in a 10-digit format."));
             return;
         }
         if (textFax.Text != "" && TelephoneNumbers.FormatNumbersExactTen(textFax.Text) == "")
         {
             MessageBox.Show(Lan.g(this, "Fax number must be in a 10-digit format."));
             return;
         }
     }
     PharmCur.StoreName = textStoreName.Text;
     PharmCur.PharmID   = "";
     PharmCur.Phone     = textPhone.Text;
     PharmCur.Fax       = textFax.Text;
     PharmCur.Address   = textAddress.Text;
     PharmCur.Address2  = textAddress2.Text;
     PharmCur.City      = textCity.Text;
     PharmCur.State     = textState.Text;
     PharmCur.Zip       = textZip.Text;
     PharmCur.Note      = textNote.Text;
     try{
         if (PharmCur.IsNew)
         {
             Pharmacies.Insert(PharmCur);
         }
         else
         {
             Pharmacies.Update(PharmCur);
         }
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message);
         return;
     }
     DialogResult = DialogResult.OK;
 }
Пример #6
0
        ///<summary>Returns true if a task was inserted into the DB, when true formTaskEdit is set. Otherwise null.</summary>
        private bool TryCreateTaskAndForm(out FormTaskEdit formTaskEdit)
        {
            formTaskEdit = null;
            if (gridVoiceMails.SelectedCell.Y == -1 || gridVoiceMails.ListGridRows.Count <= gridVoiceMails.SelectedCell.Y)
            {
                MsgBox.Show(this, "No voice mail selected");
                return(false);
            }
            VoiceMail voiceMailCur = (VoiceMail)gridVoiceMails.ListGridRows[gridVoiceMails.SelectedCell.Y].Tag;
            VoiceMail voiceMailOld = voiceMailCur.Copy();

            if (voiceMailCur.PatNum == 0)           //Multiple patients had a match for the phone number
            {
                FormPatientSelect FormPS = new FormPatientSelect(new Patient {
                    HmPhone = voiceMailCur.PhoneNumber
                });
                if (FormPS.ShowDialog() != DialogResult.OK)
                {
                    return(false);
                }
                voiceMailCur.PatNum = FormPS.SelectedPatNum;
                VoiceMails.Update(voiceMailCur, voiceMailOld);
                FillGrid();
            }
            Task task = new Task()
            {
                TaskListNum = -1
            };                                                  //don't show it in any list yet.

            Tasks.Insert(task);
            Task taskOld = task.Copy();

            task.UserNum        = Security.CurUser.UserNum;
            task.TaskListNum    = Tasks.TriageTaskListNum;
            task.DateTimeEntry  = voiceMailCur.DateCreated;
            task.PriorityDefNum = Tasks.TriageBlueNum;
            task.ObjectType     = TaskObjectType.Patient;
            task.KeyNum         = voiceMailCur.PatNum;
            task.Descript       = "VM " + TelephoneNumbers.AutoFormat(voiceMailCur.PhoneNumber) + " ";
            FormTaskEdit FormTE = new FormTaskEdit(task, taskOld);

            FormTE.IsNew = true;
            formTaskEdit = FormTE;
            return(true);
        }
Пример #7
0
        private void listOther_DoubleClick(object sender, EventArgs e)
        {
            int index = listOther.SelectedIndex;

            if (index == -1)
            {
                return;
            }
            InputBox input = new InputBox("Phone Number");

            input.textResult.Text = otherList[index].PhoneNumberVal;
            input.ShowDialog();
            if (input.DialogResult != DialogResult.OK)
            {
                return;
            }
            otherList[index].PhoneNumberVal = TelephoneNumbers.AutoFormat(input.textResult.Text);
            PhoneNumbers.Update(otherList[index]);
            FillList();
        }
Пример #8
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);
        }
Пример #9
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
Пример #10
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            string phone = textPhone.Text;

            if (!TelephoneNumbers.IsNumberValid(ref phone))
            {
                MessageBox.Show(Lan.g(this, "Invalid phone"));
                return;
            }
            string fax = textFax.Text;

            if (!TelephoneNumbers.IsNumberValid(ref fax))
            {
                MessageBox.Show(Lan.g(this, "Invalid fax"));
                return;
            }
            if (radioInsBillingProvSpecific.Checked && _selectedBillingProvNum < 1)
            {
                MsgBox.Show(this, "You must select a provider.");
                return;
            }
            if (listProvider.SelectedIndex == -1 &&      //practice really needs a default prov
                _listProviders.Count > 0)
            {
                listProvider.SelectedIndex = 0;
            }
            if (_listProviders.Count > 0 &&
                _listProviders[listProvider.SelectedIndex].FeeSched == 0)           //Default provider must have a fee schedule set.
            {
                MsgBox.Show(this, "The selected provider must have a fee schedule set before they can be the default provider.");
                return;
            }
            bool changed = false;

            if (Prefs.UpdateBool(PrefName.PracticeIsMedicalOnly, checkIsMedicalOnly.Checked)
                | Prefs.UpdateString(PrefName.PracticeTitle, textPracticeTitle.Text)
                | Prefs.UpdateString(PrefName.PracticeAddress, textAddress.Text)
                | Prefs.UpdateString(PrefName.PracticeAddress2, textAddress2.Text)
                | Prefs.UpdateString(PrefName.PracticeCity, textCity.Text)
                | Prefs.UpdateString(PrefName.PracticeST, textST.Text)
                | Prefs.UpdateString(PrefName.PracticeZip, textZip.Text)
                | Prefs.UpdateString(PrefName.PracticePhone, phone)
                | Prefs.UpdateString(PrefName.PracticeFax, fax)
                | Prefs.UpdateBool(PrefName.UseBillingAddressOnClaims, checkUseBillingAddressOnClaims.Checked)
                | Prefs.UpdateString(PrefName.PracticeBillingAddress, textBillingAddress.Text)
                | Prefs.UpdateString(PrefName.PracticeBillingAddress2, textBillingAddress2.Text)
                | Prefs.UpdateString(PrefName.PracticeBillingCity, textBillingCity.Text)
                | Prefs.UpdateString(PrefName.PracticeBillingST, textBillingST.Text)
                | Prefs.UpdateString(PrefName.PracticeBillingZip, textBillingZip.Text)
                | Prefs.UpdateString(PrefName.PracticePayToAddress, textPayToAddress.Text)
                | Prefs.UpdateString(PrefName.PracticePayToAddress2, textPayToAddress2.Text)
                | Prefs.UpdateString(PrefName.PracticePayToCity, textPayToCity.Text)
                | Prefs.UpdateString(PrefName.PracticePayToST, textPayToST.Text)
                | Prefs.UpdateString(PrefName.PracticePayToZip, textPayToZip.Text)
                | Prefs.UpdateString(PrefName.PracticeBankNumber, textBankNumber.Text))
            {
                changed = true;
            }
            if (CultureInfo.CurrentCulture.Name.EndsWith("CH"))             //CH is for switzerland. eg de-CH
            {
                if (Prefs.UpdateString(PrefName.BankRouting, textBankRouting.Text)
                    | Prefs.UpdateString(PrefName.BankAddress, textBankAddress.Text))
                {
                    changed = true;
                }
            }
            if (listProvider.SelectedIndex != -1)
            {
                if (Prefs.UpdateLong(PrefName.PracticeDefaultProv, _listProviders[listProvider.SelectedIndex].ProvNum))
                {
                    changed = true;
                }
            }
            if (listBillType.SelectedIndex != -1)
            {
                if (Prefs.UpdateLong(PrefName.PracticeDefaultBillType
                                     , _listBillingTypeDefs[listBillType.SelectedIndex].DefNum))
                {
                    changed = true;
                }
            }
            if (Prefs.UpdateLong(PrefName.DefaultProcedurePlaceService, listPlaceService.SelectedIndex))
            {
                changed = true;
            }
            if (radioInsBillingProvDefault.Checked)            //default=0
            {
                if (Prefs.UpdateLong(PrefName.InsBillingProv, 0))
                {
                    changed = true;
                }
            }
            else if (radioInsBillingProvTreat.Checked)            //treat=-1
            {
                if (Prefs.UpdateLong(PrefName.InsBillingProv, -1))
                {
                    changed = true;
                }
            }
            else
            {
                if (Prefs.UpdateLong(PrefName.InsBillingProv, _selectedBillingProvNum))
                {
                    changed = true;
                }
            }
            if (changed)
            {
                DataValid.SetInvalid(InvalidType.Prefs);
            }
            FormEServicesSetup.UploadPreference(PrefName.PracticeTitle);
            DialogResult = DialogResult.OK;
        }
Пример #11
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();
 }
Пример #12
0
        private void FormReferralEdit_Load(object sender, System.EventArgs e)
        {
            listSpecialty.Items.Clear();
            for (int i = 0; i < Enum.GetNames(typeof(DentalSpecialty)).Length; i++)
            {
                listSpecialty.Items.Add(Lan.g("enumDentalSpecialty", Enum.GetNames(typeof(DentalSpecialty))[i]));
            }
            if (IsPatient)
            {
                if (IsNew)
                {
                    Text = Lan.g(this, "Add Referral");
                    Family  FamCur = Patients.GetFamily(RefCur.PatNum);
                    Patient PatCur = FamCur.GetPatient(RefCur.PatNum);
                    RefCur.Address  = PatCur.Address;
                    RefCur.Address2 = PatCur.Address2;
                    RefCur.City     = PatCur.City;
                    RefCur.EMail    = PatCur.Email;
                    RefCur.FName    = PatCur.FName;
                    RefCur.LName    = PatCur.LName;
                    RefCur.MName    = PatCur.MiddleI;
                    //RefCur.PatNum=Patients.Cur.PatNum;//already handled
                    RefCur.SSN       = PatCur.SSN;
                    RefCur.Telephone = TelephoneNumbers.FormatNumbersExactTen(PatCur.HmPhone);
                    if (PatCur.WkPhone == "")
                    {
                        RefCur.Phone2 = PatCur.WirelessPhone;
                    }
                    else
                    {
                        RefCur.Phone2 = PatCur.WkPhone;
                    }
                    RefCur.ST  = PatCur.State;
                    RefCur.Zip = PatCur.Zip;
                }
                labelPatient.Visible        = true;
                textLName.ReadOnly          = true;
                textFName.ReadOnly          = true;
                textMName.ReadOnly          = true;
                textTitle.ReadOnly          = true;
                textAddress.ReadOnly        = true;
                textAddress2.ReadOnly       = true;
                textCity.ReadOnly           = true;
                textST.ReadOnly             = true;
                textZip.ReadOnly            = true;
                checkNotPerson.Enabled      = false;
                textPhone1.ReadOnly         = true;
                textPhone2.ReadOnly         = true;
                textPhone3.ReadOnly         = true;
                textSSN.ReadOnly            = true;
                radioTIN.Enabled            = false;
                textEmail.ReadOnly          = true;
                listSpecialty.Enabled       = false;
                listSpecialty.SelectedIndex = -1;
                checkIsDoctor.Enabled       = false;
                textNotes.Select();
            }
            else             //non patient
            {
                if (IsNew)
                {
                    this.Text        = Lan.g(this, "Add Referral");
                    RefCur           = new Referral();
                    RefCur.Specialty = DentalSpecialty.General;
                }
                listSpecialty.SelectedIndex = (int)RefCur.Specialty;
                textLName.Select();
            }
            checkIsDoctor.Checked  = RefCur.IsDoctor;
            checkNotPerson.Checked = RefCur.NotPerson;
            checkHidden.Checked    = RefCur.IsHidden;
            textLName.Text         = RefCur.LName;
            textFName.Text         = RefCur.FName;
            textMName.Text         = RefCur.MName;
            textTitle.Text         = RefCur.Title;
            textAddress.Text       = RefCur.Address;
            textAddress2.Text      = RefCur.Address2;
            textCity.Text          = RefCur.City;
            textST.Text            = RefCur.ST;
            textZip.Text           = RefCur.Zip;
            string phone = RefCur.Telephone;

            if (phone != null && phone.Length == 10)
            {
                textPhone1.Text = phone.Substring(0, 3);
                textPhone2.Text = phone.Substring(3, 3);
                textPhone3.Text = phone.Substring(6);
            }
            textSSN.Text = RefCur.SSN;
            if (RefCur.UsingTIN)
            {
                radioTIN.Checked = true;
            }
            else
            {
                radioSSN.Checked = true;
            }
            textNationalProvID.Text = RefCur.NationalProvID;
            textOtherPhone.Text     = RefCur.Phone2;
            textEmail.Text          = RefCur.EMail;
            textNotes.Text          = RefCur.Note;
            //Patients using:
            string[] patsTo   = RefAttaches.GetPats(RefCur.ReferralNum, false);
            string[] patsFrom = RefAttaches.GetPats(RefCur.ReferralNum, true);
            textPatientsNumTo.Text   = patsTo.Length.ToString();
            textPatientsNumFrom.Text = patsFrom.Length.ToString();
            comboPatientsTo.Items.Clear();
            comboPatientsFrom.Items.Clear();
            for (int i = 0; i < patsTo.Length; i++)
            {
                comboPatientsTo.Items.Add(patsTo[i]);
            }
            for (int i = 0; i < patsFrom.Length; i++)
            {
                comboPatientsFrom.Items.Add(patsFrom[i]);
            }
            if (patsTo.Length > 0)
            {
                comboPatientsTo.SelectedIndex = 0;
            }
            if (patsFrom.Length > 0)
            {
                comboPatientsFrom.SelectedIndex = 0;
            }
            comboSlip.Items.Add(Lan.g(this, "Default"));
            comboSlip.SelectedIndex = 0;
            SlipList = SheetDefs.GetCustomForType(SheetTypeEnum.ReferralSlip);
            for (int i = 0; i < SlipList.Count; i++)
            {
                comboSlip.Items.Add(SlipList[i].Description);
                if (RefCur.Slip == SlipList[i].SheetDefNum)
                {
                    comboSlip.SelectedIndex = i + 1;
                }
            }
        }
Пример #13
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;
            }
        }
Пример #14
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;
            }
        }
Пример #15
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;
            }
        }
Пример #16
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textStoreName.Text == "")
            {
                MessageBox.Show(Lan.g(this, "Store name cannot be blank."));
                return;
            }
            if (CultureInfo.CurrentCulture.Name == "en-US")
            {
                if (textPhone.Text != "" && TelephoneNumbers.FormatNumbersExactTen(textPhone.Text) == "")
                {
                    MessageBox.Show(Lan.g(this, "Phone number must be in a 10-digit format."));
                    return;
                }
                if (textFax.Text != "" && TelephoneNumbers.FormatNumbersExactTen(textFax.Text) == "")
                {
                    MessageBox.Show(Lan.g(this, "Fax number must be in a 10-digit format."));
                    return;
                }
            }
            PharmCur.StoreName = textStoreName.Text;
            PharmCur.PharmID   = "";
            PharmCur.Phone     = textPhone.Text;
            PharmCur.Fax       = textFax.Text;
            PharmCur.Address   = textAddress.Text;
            PharmCur.Address2  = textAddress2.Text;
            PharmCur.City      = textCity.Text;
            PharmCur.State     = textState.Text;
            PharmCur.Zip       = textZip.Text;
            PharmCur.Note      = textNote.Text;
            try{
                if (PharmCur.IsNew)
                {
                    Pharmacies.Insert(PharmCur);
                }
                else
                {
                    Pharmacies.Update(PharmCur);
                }
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
                return;
            }
            //Update PharmClinic links
            List <PharmClinic> listPharmClinicOld = (List <PharmClinic>)comboClinic.Tag;
            List <PharmClinic> listPharmClinicNew = new List <PharmClinic>();

            //comboClinic.All might be selected, and would result in ListSelectedClinicNums containing only the clinics showing in the combobox, which very will not include clinics that user does not have permissions for.  "All" is not separately tested for.  Because the new list is synched against the old list, clinics that aren't showing are not affected one way or the other.
            foreach (long clinicNumNew in comboClinic.ListSelectedClinicNums)
            {
                if (listPharmClinicOld.Any(x => x.ClinicNum == clinicNumNew))               //if it existed before, add it to the list
                {
                    listPharmClinicNew.Add(listPharmClinicOld.First(x => x.ClinicNum == clinicNumNew));
                }
                else                  //otherwise, create a new link.
                {
                    listPharmClinicNew.Add(new PharmClinic(PharmCur.PharmacyNum, clinicNumNew));
                }
            }
            PharmClinics.Sync(listPharmClinicNew, listPharmClinicOld);
            DialogResult = DialogResult.OK;
        }
Пример #17
0
        private void FillGrid()
        {
            labelError.Visible = false;
            List <VoiceMail> listVoiceMails = VoiceMails.GetAll(includeDeleted: checkShowDeleted.Checked).OrderBy(x => x.UserNum > 0) //Show unclaimed VMs first
                                              .ThenBy(x => x.DateCreated).ToList();                                                   //Show oldest VMs on top
            VoiceMail voiceMailSelected = null;
            int       selectedCellX     = gridVoiceMails.SelectedCell.X;
            string    changedNoteText   = null;     //If this value is null, then the note has not been changed by the user.

            if (gridVoiceMails.SelectedCell.Y > -1)
            {
                voiceMailSelected = (VoiceMail)gridVoiceMails.ListGridRows[gridVoiceMails.SelectedCell.Y].Tag;
                changedNoteText   = gridVoiceMails.GetText(gridVoiceMails.SelectedCell.Y, gridVoiceMails.ListGridColumns.GetIndex(Lan.g(this, "Note")));
                if (changedNoteText == voiceMailSelected.Note)
                {
                    changedNoteText = null;                  //To indicate that it has not been changed.
                }
            }
            gridVoiceMails.BeginUpdate();
            gridVoiceMails.ListGridColumns.Clear();
            GridColumn col;

            col = new GridColumn(Lan.g(this, "Date Time"), 120);
            gridVoiceMails.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Phone #"), 105);
            gridVoiceMails.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Patient"), 200);
            gridVoiceMails.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "User"), 90);
            gridVoiceMails.ListGridColumns.Add(col);
            if (checkShowDeleted.Checked)
            {
                col = new GridColumn(Lan.g(this, "Deleted"), 60, HorizontalAlignment.Center);
                gridVoiceMails.ListGridColumns.Add(col);
            }
            col     = new GridColumn(Lan.g(this, "Note"), 200, true);
            col.Tag = nameof(VoiceMail.Note);
            gridVoiceMails.ListGridColumns.Add(col);
            gridVoiceMails.ListGridRows.Clear();
            GridRow row;

            foreach (VoiceMail voiceMail in listVoiceMails)
            {
                row = new GridRow();
                row.Cells.Add(voiceMail.DateCreated.ToShortDateString() + " " + voiceMail.DateCreated.ToShortTimeString());
                string phoneField = TelephoneNumbers.AutoFormat(voiceMail.PhoneNumber);
                if (string.IsNullOrEmpty(phoneField))
                {
                    phoneField = Lan.g(this, "Unknown");
                }
                row.Cells.Add(phoneField);
                row.Cells.Add(voiceMail.PatientName);
                row.Cells.Add(voiceMail.UserName);
                if (checkShowDeleted.Checked)
                {
                    row.Cells.Add(voiceMail.StatusVM == VoiceMailStatus.Deleted ? "X" : "");
                }
                row.Cells.Add(voiceMail.Note);
                row.Tag = voiceMail;
                gridVoiceMails.ListGridRows.Add(row);
            }
            gridVoiceMails.EndUpdate();
            //Reselect the selected row if necessary
            if (voiceMailSelected != null)
            {
                for (int i = 0; i < gridVoiceMails.ListGridRows.Count; i++)
                {
                    if (((VoiceMail)gridVoiceMails.ListGridRows[i].Tag).VoiceMailNum == voiceMailSelected.VoiceMailNum)
                    {
                        gridVoiceMails.SetSelected(new Point(selectedCellX, i));
                        if (changedNoteText != null)                         //The user has changed the note.
                        {
                            gridVoiceMails.ListGridRows[i].Cells[gridVoiceMails.ListGridColumns.GetIndex(Lan.g(this, "Note"))].Text = changedNoteText;
                        }
                    }
                }
            }
        }