예제 #1
0
        private void butGenerate_Click(object sender, EventArgs e)
        {
            if (textOnlinePassword.ReadOnly)
            {
                MessageBox.Show("Please use the Provide Online Access button first.");
                return;
            }
            Cursor = Cursors.WaitCursor;
            textOnlinePassword.Text = GenerateRandomPassword(8, 10);
            PatCur.OnlinePassword   = textOnlinePassword.Text;
            Patients.Update(PatCur, PatOld);
            PatOld.OnlinePassword = textOnlinePassword.Text;          //so that subsequent Updates will work.
            string interval = PrefC.GetStringSilent(PrefName.MobileSyncIntervalMinutes);

            if (interval == "" || interval == "0")         //not a paid customer or chooses not to synch
            {
                Cursor = Cursors.Default;
                MessageBox.Show("Synch must be setup first from the Tools menu, Mobile and Patient Portal Synch.");
                return;
            }
            //we won't check PrefName.MobileSyncWorkstationName because we are forcing the synch
            if (System.Environment.MachineName.ToUpper() != PrefC.GetStringSilent(PrefName.MobileSyncWorkstationName).ToUpper())
            {
                Cursor = Cursors.Default;
                //Since GetStringSilent returns "" before OD is connected to db, this gracefully loops out
                if (!MsgBox.Show(this, MsgBoxButtons.OKCancel,
                                 "Warning.  Workstation is not entered in the Tools menu, Mobile and Patient Portal Synch.  No automatic synch is taking place.  Continue anyway?"))
                {
                    return;
                }
            }
            if (PrefC.GetDate(PrefName.MobileExcludeApptsBeforeDate).Year < 1880)
            {
                Cursor = Cursors.Default;
                MessageBox.Show("Full Synch must be run first first from the Tools menu, Mobile and Patient Portal Synch.");
                return;
            }
            FormMobile.SynchFromMain(true);
            Cursor = Cursors.Default;
        }
예제 #2
0
 private void menuItemMobileSetup_Click(object sender,EventArgs e)
 {
     if(!Security.IsAuthorized(Permissions.Setup)){
         return;
     }
     //MessageBox.Show("Not yet functional.");
     FormMobile FormM=new FormMobile();
     FormM.ShowDialog();
     //SecurityLogs.MakeLogEntry(Permissions.Setup,0,"Mobile Sync");
 }
예제 #3
0
        //private void butTreatProv_Click(object sender, System.EventArgs e) {
        //	listBillProv.SelectedIndex=-1;
        //}

        private void butOK_Click(object sender, System.EventArgs e)
        {
            string phone = textPhone.Text;

            if (Application.CurrentCulture.Name == "en-US" ||
                CultureInfo.CurrentCulture.Name.EndsWith("CA"))                    //Canadian. en-CA or fr-CA)
            {
                phone = phone.Replace("(", "");
                phone = phone.Replace(")", "");
                phone = phone.Replace(" ", "");
                phone = phone.Replace("-", "");
                if (phone.Length != 0 && phone.Length != 10)
                {
                    MessageBox.Show(Lan.g(this, "Invalid phone"));
                    return;
                }
            }
            if (radioInsBillingProvSpecific.Checked && comboInsBillingProv.SelectedIndex == -1)
            {
                MsgBox.Show(this, "You must select a provider.");
                return;
            }
            bool changed = false;

            if (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.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 &&      //practice really needs a default prov
                ProviderC.ListShort.Count > 0)
            {
                listProvider.SelectedIndex = 0;
            }
            if (listProvider.SelectedIndex != -1)
            {
                if (Prefs.UpdateLong(PrefName.PracticeDefaultProv, ProviderC.ListShort[listProvider.SelectedIndex].ProvNum))
                {
                    changed = true;
                }
            }
            if (listBillType.SelectedIndex != -1)
            {
                if (Prefs.UpdateLong(PrefName.PracticeDefaultBillType
                                     , DefC.Short[(int)DefCat.BillingTypes][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, ProviderC.ListShort[comboInsBillingProv.SelectedIndex].ProvNum))
                {
                    changed = true;
                }
            }
            if (changed)
            {
                DataValid.SetInvalid(InvalidType.Prefs);
            }
            FormMobile.UploadPreference(PrefName.PracticeTitle);
            DialogResult = DialogResult.OK;
        }
예제 #4
0
        private void butGiveAccess_Click(object sender, EventArgs e)
        {
            string interval = PrefC.GetStringSilent(PrefName.MobileSyncIntervalMinutes);

            if (interval == "" || interval == "0")         //not a paid customer or chooses not to synch
            {
                MessageBox.Show("Synch must be setup first from the Tools menu, Mobile and Patient Portal Synch.  Interval must not be blank or zero.");
                return;
            }
            //we won't check PrefName.MobileSyncWorkstationName because we are forcing the synch
            if (System.Environment.MachineName.ToUpper() != PrefC.GetStringSilent(PrefName.MobileSyncWorkstationName).ToUpper())
            {
                //Since GetStringSilent returns "" before OD is connected to db, this gracefully loops out
                if (!MsgBox.Show(this, MsgBoxButtons.OKCancel,
                                 "Warning.  Workstation is not entered in the Tools menu, Mobile and Patient Portal Synch.  No automatic synch is taking place.  Continue anyway?"))
                {
                    return;
                }
            }
            if (PrefC.GetDate(PrefName.MobileExcludeApptsBeforeDate).Year < 1880)
            {
                MessageBox.Show("Full Synch must be run first first from the Tools menu, Mobile and Patient Portal Synch.");
                return;
            }
            if (butGiveAccess.Text == "Provide Online Access")           //When form open opens with a blank password
            {
                Cursor = Cursors.WaitCursor;
                //1. Fill password.
                textOnlinePassword.Text = GenerateRandomPassword(8, 10);             //won't save until OK or Print
                //2. Fill link.
                textOnlineLink.Text = GetPatientPortalLink();
                //3. Reset timestamps for this patient to trigger all their objects to upload with the next synch
                LabPanels.ResetTimeStamps(PatCur.PatNum);
                Diseases.ResetTimeStamps(PatCur.PatNum);
                Allergies.ResetTimeStamps(PatCur.PatNum);
                MedicationPats.ResetTimeStamps(PatCur.PatNum);
                Statements.ResetTimeStamps(PatCur.PatNum);
                Documents.ResetTimeStamps(PatCur.PatNum);
                //4. Make the password editable in case they want to change it.
                textOnlinePassword.ReadOnly = false;
                //5. Save password to db
                PatCur.OnlinePassword = textOnlinePassword.Text;
                Patients.Update(PatCur, PatOld);
                PatOld.OnlinePassword = textOnlinePassword.Text;              //so that subsequent Updates will work.
                //6. Force a synch
                FormMobile.SynchFromMain(true);
                //7. Insert EhrMeasureEvent
                EhrMeasureEvent newMeasureEvent = new EhrMeasureEvent();
                newMeasureEvent.DateTEvent = DateTime.Now;
                newMeasureEvent.EventType  = EhrMeasureEventType.OnlineAccessProvided;
                newMeasureEvent.PatNum     = PatCur.PatNum;
                newMeasureEvent.MoreInfo   = "";
                EhrMeasureEvents.Insert(newMeasureEvent);
                //8. Rename button
                butGiveAccess.Text = "Remove Online Access";
                Cursor             = Cursors.Default;
            }
            else              //remove access
            {
                Cursor = Cursors.WaitCursor;
                //1. Clear password
                textOnlinePassword.Text = "";
                //2. Make in uneditable
                textOnlinePassword.ReadOnly = true;
                //3. Save password to db
                PatCur.OnlinePassword = textOnlinePassword.Text;
                Patients.Update(PatCur, PatOld);
                PatOld.OnlinePassword = textOnlinePassword.Text;
                //5. Force a synch
                FormMobile.SynchFromMain(true);
                //no event to insert
                //6. Rename button
                butGiveAccess.Text = "Provide Online Access";
                Cursor             = Cursors.Default;
            }
        }