Ejemplo n.º 1
0
 private void FormCommItem_Load(object sender, System.EventArgs e)
 {
     textPatientName.Text = Patients.GetLim(CommlogCur.PatNum).GetNameFL();
     textDateTime.Text    = CommlogCur.CommDateTime.ToString();
     //there will usually be a commtype set before this dialog is opened
     for (int i = 0; i < DefB.Short[(int)DefCat.CommLogTypes].Length; i++)
     {
         listType.Items.Add(DefB.Short[(int)DefCat.CommLogTypes][i].ItemName);
         if (DefB.Short[(int)DefCat.CommLogTypes][i].DefNum == CommlogCur.CommType)
         {
             listType.SelectedIndex = i;
         }
     }
     for (int i = 0; i < Enum.GetNames(typeof(CommItemMode)).Length; i++)
     {
         listMode.Items.Add(Lan.g("enumCommItemMode", Enum.GetNames(typeof(CommItemMode))[i]));
     }
     listMode.SelectedIndex = (int)CommlogCur.Mode_;
     for (int i = 0; i < Enum.GetNames(typeof(CommSentOrReceived)).Length; i++)
     {
         listSentOrReceived.Items.Add
             (Lan.g("enumCommSentOrReceived", Enum.GetNames(typeof(CommSentOrReceived))[i]));
     }
     try{
         listSentOrReceived.SelectedIndex = (int)CommlogCur.SentOrReceived;
     }
     catch {
         MessageBox.Show(((int)CommlogCur.SentOrReceived).ToString());
     }
     checkIsStatementSent.Checked = CommlogCur.IsStatementSent;
     textNote.Text           = CommlogCur.Note;
     textNote.SelectionStart = textNote.Text.Length;
     textNote.Select();
 }
Ejemplo n.º 2
0
 private void FormCommItem_Load(object sender, System.EventArgs e)
 {
     /*if(CommlogCur.EmailMessageNum!=0){
      *      EmailMessage message=EmailMessages.Refresh(CommlogCur.EmailMessageNum);
      *      //If a date is entered, user will not be able to click Send
      *      FormEmailMessageEdit FormE=new FormEmailMessageEdit(message);
      *      FormE.ShowDialog();
      *      DialogResult=DialogResult.OK;
      *      return;
      * }*/
     /*{
      *      if(!UserPermissions.CheckUserPassword("Adjustment Edit",Adjustments.Cur.AdjDate)){
      *              //MessageBox.Show(Lan.g(this,"You only have permission to view the Adjustment. No changes will be saved."));
      *              butOK.Enabled=false;
      *              butDelete.Enabled=false;
      *      }
      * }*/
     textDateTime.Text = CommlogCur.CommDateTime.ToString();
     //remember, this list is 1-based
     //there will ALWAYS be a commtype set before this dialog is opened
     for (int i = 0; i < Enum.GetNames(typeof(CommItemType)).Length; i++)
     {
         listType.Items.Add(Lan.g("enumCommItemType", Enum.GetNames(typeof(CommItemType))[i]));
     }
     listType.SelectedIndex = (int)CommlogCur.CommType - 1;
     for (int i = 0; i < Enum.GetNames(typeof(CommItemMode)).Length; i++)
     {
         listMode.Items.Add(Lan.g("enumCommItemMode", Enum.GetNames(typeof(CommItemMode))[i]));
     }
     listMode.SelectedIndex = (int)CommlogCur.Mode_;
     for (int i = 0; i < Enum.GetNames(typeof(CommSentOrReceived)).Length; i++)
     {
         listSentOrReceived.Items.Add
             (Lan.g("enumCommSentOrReceived", Enum.GetNames(typeof(CommSentOrReceived))[i]));
     }
     try{
         listSentOrReceived.SelectedIndex = (int)CommlogCur.SentOrReceived;
     }
     catch {
         MessageBox.Show(((int)CommlogCur.SentOrReceived).ToString());
     }
     //if(CommlogCur.EmailMessageNum==0)
     //	butEmail.Visible=false;
     textNote.Text           = CommlogCur.Note;
     textNote.SelectionStart = textNote.Text.Length;
     textNote.Select();
 }
Ejemplo n.º 3
0
 private void FormCommItem_Load(object sender, System.EventArgs e)
 {
     IsStartingUp         = true;
     textPatientName.Text = Patients.GetLim(CommlogCur.PatNum).GetNameFL();
     textUser.Text        = Userods.GetName(CommlogCur.UserNum);   //might be blank.
     textDateTime.Text    = CommlogCur.CommDateTime.ToShortDateString() + "  " + CommlogCur.CommDateTime.ToShortTimeString();
     if (CommlogCur.DateTimeEnd.Year > 1880)
     {
         textDateTimeEnd.Text = CommlogCur.DateTimeEnd.ToShortDateString() + "  " + CommlogCur.DateTimeEnd.ToShortTimeString();
     }
     //there will usually be a commtype set before this dialog is opened
     for (int i = 0; i < DefC.Short[(int)DefCat.CommLogTypes].Length; i++)
     {
         listType.Items.Add(DefC.Short[(int)DefCat.CommLogTypes][i].ItemName);
         if (DefC.Short[(int)DefCat.CommLogTypes][i].DefNum == CommlogCur.CommType)
         {
             listType.SelectedIndex = i;
         }
     }
     for (int i = 0; i < Enum.GetNames(typeof(CommItemMode)).Length; i++)
     {
         listMode.Items.Add(Lan.g("enumCommItemMode", Enum.GetNames(typeof(CommItemMode))[i]));
     }
     listMode.SelectedIndex = (int)CommlogCur.Mode_;
     for (int i = 0; i < Enum.GetNames(typeof(CommSentOrReceived)).Length; i++)
     {
         listSentOrReceived.Items.Add
             (Lan.g("enumCommSentOrReceived", Enum.GetNames(typeof(CommSentOrReceived))[i]));
     }
     try{
         listSentOrReceived.SelectedIndex = (int)CommlogCur.SentOrReceived;
     }
     catch {
         MessageBox.Show(((int)CommlogCur.SentOrReceived).ToString());
     }
     //checkIsStatementSent.Checked=CommlogCur.IsStatementSent;
     textNote.Text           = CommlogCur.Note;
     textNote.SelectionStart = textNote.Text.Length;
                 #if !DEBUG
     labelCommlogNum.Visible = false;
     textCommlogNum.Visible  = false;
                 #endif
     textCommlogNum.Text = CommlogCur.CommlogNum.ToString();
     if (!PrefC.GetBool(PrefName.DistributorKey))
     {
         labelDateTimeEnd.Visible = false;
         textDateTimeEnd.Visible  = false;
         butNow.Visible           = false;
         butNowEnd.Visible        = false;
     }
     textNote.Select();
     string keyData = GetSignatureKey();
     signatureBoxWrapper.FillSignature(CommlogCur.SigIsTopaz, keyData, CommlogCur.Signature);
     signatureBoxWrapper.BringToFront();
     IsStartingUp = false;
     if (!Security.IsAuthorized(Permissions.CommlogEdit, CommlogCur.CommDateTime))
     {
         if (IsNew)
         {
             DialogResult = DialogResult.Cancel;
             return;
         }
         butDelete.Enabled = false;
         butOK.Enabled     = false;
     }
 }
Ejemplo n.º 4
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;
                }
            }
        }
Ejemplo n.º 5
0
        private void FormScheduleEdit_Load(object sender, System.EventArgs e)
        {
            _isHolidayOrNote = (SchedCur.StartTime == TimeSpan.Zero && SchedCur.StopTime == TimeSpan.Zero);
            if (PrefC.HasClinicsEnabled)
            {
                if (ClinicNum == 0)
                {
                    Text += " - " + Lan.g(this, "Headquarters");
                }
                else
                {
                    string abbr = Clinics.GetAbbr(ClinicNum);
                    if (!string.IsNullOrWhiteSpace(abbr))
                    {
                        Text += " - " + abbr;
                    }
                }
                //if clinics are enabled and this is a holiday or practice note, set visible and fill the clinic combobox and private list of clinics
                if (_isHolidayOrNote && SchedCur.SchedType == ScheduleType.Practice)
                {
                    comboClinic.Visible = true;                  //only visible for holidays and practice notes and only if clinics are enabled
                    labelClinic.Visible = true;
                    _listClinics        = Clinics.GetForUserod(Security.CurUser);
                    if (!Security.CurUser.ClinicIsRestricted)
                    {
                        comboClinic.Items.Add(Lan.g(this, "Headquarters"));
                        if (SchedCur.ClinicNum == 0)                       //new sched and HQ selected or opened one from db for HQ
                        {
                            comboClinic.SelectedIndex = 0;
                        }
                    }
                    foreach (Clinic clinicCur in _listClinics)
                    {
                        comboClinic.Items.Add(clinicCur.Abbr);
                        if (clinicCur.ClinicNum == SchedCur.ClinicNum)
                        {
                            comboClinic.SelectedIndex = comboClinic.Items.Count - 1;
                        }
                    }
                    if (comboClinic.SelectedIndex < 0)                                                                                                 //current sched's clinic not found or set to 0 and user is restricted, default to clinic sent in
                    {
                        comboClinic.SelectedIndex = _listClinics.FindIndex(x => x.ClinicNum == ClinicNum) + (Security.CurUser.ClinicIsRestricted?0:1); //add one for HQ if not restricted
                    }
                }
            }
            textNote.Text = SchedCur.Note;
            if (_isHolidayOrNote)
            {
                comboStart.Visible = false;
                labelStart.Visible = false;
                comboStop.Visible  = false;
                labelStop.Visible  = false;
                listOps.Visible    = false;
                labelOps.Visible   = false;
                textNote.Select();
                return;
            }
            //from here on, NOT a practice note or holiday
            DateTime time;

            for (int i = 0; i < 24; i++)
            {
                time = DateTime.Today + TimeSpan.FromHours(7) + TimeSpan.FromMinutes(30 * i);
                comboStart.Items.Add(time.ToShortTimeString());
                comboStop.Items.Add(time.ToShortTimeString());
            }
            comboStart.Text = SchedCur.StartTime.ToShortTimeString();
            comboStop.Text  = SchedCur.StopTime.ToShortTimeString();
            listOps.Items.Add(Lan.g(this, "not specified"));
            //filter list if using clinics and if a clinic filter was passed in to only ops assigned to the specified clinic, otherwise all non-hidden ops
            _listOps = Operatories.GetDeepCopy(true);
            if (PrefC.HasClinicsEnabled && ClinicNum > 0)
            {
                _listOps.RemoveAll(x => x.ClinicNum != ClinicNum);
            }
            foreach (Operatory opCur in _listOps)
            {
                int curIndex = listOps.Items.Add(opCur.OpName);
                //Select the item that was just added if the schedule's Ops contains the current OpNum.
                listOps.SetSelected(curIndex, SchedCur.Ops.Contains(opCur.OperatoryNum));
            }
            listOps.SetSelected(0, listOps.SelectedIndices.Count == 0);         //select 'not specified' if no ops were selected in the loop
            comboStart.Select();
        }