예제 #1
0
        private void butRecall_Click(object sender, System.EventArgs e)
        {
            Procedure[] procList   = Procedures.Refresh(PatCur.PatNum);
            Recall[]    recallList = Recalls.GetList(new int[] { PatCur.PatNum });     //get the recall for this pt
            if (recallList.Length == 0)
            {
                MsgBox.Show(this, "This patient does not have any recall due.");
                return;
            }
            Recall recallCur = recallList[0];

            InsPlan[]   planList = InsPlans.Refresh(FamCur);
            Appointment apt      = Appointments.CreateRecallApt(PatCur, procList, recallCur, planList);

            AptSelected = apt.AptNum;
            oResult     = OtherResult.PinboardAndSearch;
            if (recallCur.DateDue < DateTime.Today)
            {
                DateJumpToString = DateTime.Today.ToShortDateString();              //they are overdue
            }
            else
            {
                DateJumpToString = recallCur.DateDue.ToShortDateString();
            }
            DialogResult = DialogResult.OK;
        }
예제 #2
0
        private void tbApts_CellDoubleClicked(object sender, CellEventArgs e)
        {
            int          currentSelection = tbApts.SelectedRow;
            int          currentScroll    = tbApts.ScrollValue;
            FormApptEdit FormAE           = new FormApptEdit(ListOth[e.Row].AptNum);

            FormAE.PinIsVisible = true;
            FormAE.ShowDialog();
            if (FormAE.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (FormAE.PinClicked)
            {
                if (!OKtoSendToPinboard(ListOth[e.Row]))
                {
                    return;
                }
                AptSelected  = ListOth[e.Row].AptNum;
                oResult      = OtherResult.CopyToPinBoard;
                DialogResult = DialogResult.OK;
            }
            else
            {
                Filltb();
                tbApts.SetSelected(currentSelection, true);
                tbApts.ScrollValue = currentScroll;
            }
        }
예제 #3
0
 private void FormApptsOther_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (DialogResult == DialogResult.OK)
     {
         return;
     }
     _otherResult = OtherResult.Cancel;
 }
예제 #4
0
 private void butPin_Click(object sender, System.EventArgs e)
 {
     if (tbApts.SelectedRow == -1)
     {
         MessageBox.Show(Lan.g(this, "Please select appointment first."));
         return;
     }
     if (!OKtoSendToPinboard(ListOth[tbApts.SelectedRow]))
     {
         return;
     }
     AptSelected  = ListOth[tbApts.SelectedRow].AptNum;
     oResult      = OtherResult.CopyToPinBoard;
     DialogResult = DialogResult.OK;
 }
예제 #5
0
 private void butGoTo_Click(object sender, System.EventArgs e)
 {
     if (tbApts.SelectedRow == -1)
     {
         MessageBox.Show(Lan.g(this, "Please select appointment first."));
         return;
     }
     if (ListOth[tbApts.SelectedRow].AptDateTime.Year < 1880)
     {
         MessageBox.Show(Lan.g(this, "Unable to go to unscheduled appointment."));
         return;
     }
     SelectedAppt = ListOth[tbApts.SelectedRow];
     oResult      = OtherResult.GoTo;
     DialogResult = DialogResult.OK;
 }
예제 #6
0
        private void listFamily_DoubleClick(object sender, System.EventArgs e)
        {
            if (listFamily.SelectedIndices.Count == 0)
            {
                return;
            }
            int    originalPatNum = PatCur.PatNum;
            Recall recallCur      = null;

            for (int i = 0; i < RecallList.Length; i++)
            {
                if (RecallList[i].PatNum == FamCur.List[listFamily.SelectedIndices[0]].PatNum)
                {
                    recallCur = RecallList[i];
                }
            }
            if (recallCur == null)
            {
                recallCur                = new Recall();
                recallCur.PatNum         = FamCur.List[listFamily.SelectedIndices[0]].PatNum;
                recallCur.RecallInterval = new Interval(0, 0, 6, 0);
            }
            FormRecallListEdit FormRLE = new FormRecallListEdit(recallCur);

            FormRLE.ShowDialog();
            if (FormRLE.PinClicked)
            {
                oResult      = OtherResult.CopyToPinBoard;
                AptSelected  = FormRLE.AptSelected;
                DialogResult = DialogResult.OK;
            }
            else
            {
                FamCur = Patients.GetFamily(originalPatNum);
                PatCur = FamCur.GetPatient(originalPatNum);
                Filltb();
            }
        }
예제 #7
0
 private void butPin_Click(object sender, System.EventArgs e)
 {
     if (odApptGrid.SelectedApptOther == null)
     {
         MsgBox.Show(this, "Please select appointment first.");
         return;
     }
     if (odApptGrid.IsSelectedApptOtherNull())
     {
         return;
     }
     if (PatRestrictionL.IsRestricted(_patCur.PatNum, PatRestrict.ApptSchedule))
     {
         return;
     }
     if (!AppointmentL.OKtoSendToPinboard(odApptGrid.SelectedApptOther, odApptGrid.ListApptOthers, this))           //Tag is AptNum
     {
         return;
     }
     ListAptNumsSelected.Add(odApptGrid.SelectedApptOther.AptNum);
     _otherResult = OtherResult.CopyToPinBoard;
     DialogResult = DialogResult.OK;
 }
예제 #8
0
        private void butGoTo_Click(object sender, System.EventArgs e)
        {
            if (odApptGrid.SelectedApptOther == null)
            {
                MsgBox.Show(this, "Please select appointment first.");
                return;
            }
            if (odApptGrid.IsSelectedApptOtherNull())
            {
                return;
            }
            ApptOther aptSelected = odApptGrid.SelectedApptOther;

            if (aptSelected.AptDateTime.Year < 1880)
            {
                MsgBox.Show(this, "Unable to go to unscheduled appointment.");
                return;
            }
            ListAptNumsSelected.Add(aptSelected.AptNum);
            StringDateJumpTo = aptSelected.AptDateTime.Date.ToShortDateString();
            _otherResult     = OtherResult.GoTo;
            DialogResult     = DialogResult.OK;
        }
예제 #9
0
 private void butPin_Click(object sender, System.EventArgs e)
 {
     if(tbApts.SelectedRow==-1){
         MessageBox.Show(Lan.g(this,"Please select appointment first."));
         return;
     }
     if(!OKtoSendToPinboard(ApptList[tbApts.SelectedRow])){
         return;
     }
     AptNumsSelected.Add(ApptList[tbApts.SelectedRow].AptNum);
     oResult=OtherResult.CopyToPinBoard;
     DialogResult=DialogResult.OK;
 }
예제 #10
0
        ///<summary>Offers to use unscheduled appt.  Shows ApptEdit window. Sets Prospective, if necessary.  Fires Automation triggers.  ListAptNumsSelected will contain the AptNum of the new appointment.</summary>
        public void MakeAppointment()
        {
            //Check to see if the patient has any unscheduled appointments and inform the user.
            List <Appointment> listUnschedAppts = Appointments.GetUnschedApptsForPat(_patCur.PatNum);

            //Per Nathan, pinboard appointments will not be considered unscheduled for this logic.
            listUnschedAppts.RemoveAll(x => x.AptNum.In(_listPinboardApptNums));
            FormApptEdit formApptEdit            = null;
            long         aptNum                  = 0;
            bool         isSchedulingUnscheduled = false;

            if (listUnschedAppts.Count > 0 &&
                MsgBox.Show(this, MsgBoxButtons.YesNo, "This patient has an unscheduled appointment, would you like to use an existing unscheduled appointment?"))
            {
                if (listUnschedAppts.Count == 1)
                {
                    aptNum = listUnschedAppts[0].AptNum;
                }
                else                  //Multiple unscheduled appointments, let the user pick which one to use.
                {
                    FormUnschedListPatient formUnschedListPatient = new FormUnschedListPatient(_patCur);
                    if (formUnschedListPatient.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }
                    //Use the appointment the user selected.
                    aptNum = formUnschedListPatient.SelectedAppt.AptNum;
                }
                isSchedulingUnscheduled = true;
            }
            formApptEdit       = new FormApptEdit(aptNum, patNum: _patCur.PatNum, useApptDrawingSettings: IsInitialDoubleClick, patient: _patCur, dateTNew: DateTNew, opNumNew: OpNumNew);
            formApptEdit.IsNew = (aptNum == 0);
            formApptEdit.IsSchedulingUnscheduledAppt = isSchedulingUnscheduled;
            formApptEdit.ShowDialog();
            if (formApptEdit.DialogResult != DialogResult.OK)
            {
                return;
            }
            Appointment aptCur = formApptEdit.GetAppointmentCur();

            if (IsInitialDoubleClick)
            {
                if (isSchedulingUnscheduled)                 //User double clicked in Appointment Module, intending to schedule appointment at a specific time/op/etc.
                {
                    Appointment aptOld = aptCur.Copy();
                    aptCur.AptDateTime = DateTimeClicked;
                    aptCur.Op          = OpNumClicked;
                    if (_patCur != null && _patCur.AskToArriveEarly > 0)
                    {
                        aptCur.DateTimeAskedToArrive = aptCur.AptDateTime.AddMinutes(-_patCur.AskToArriveEarly);
                    }
                    aptCur           = Appointments.AssignFieldsForOperatory(aptCur);
                    aptCur.AptStatus = ApptStatus.Scheduled;
                    Appointments.Update(aptCur, aptOld);
                }
                //Change PatStatus to Prospective or from Prospective.
                Operatory opCur = Operatories.GetOperatory(aptCur.Op);
                if (opCur != null)
                {
                    if (opCur.SetProspective && _patCur.PatStatus != PatientStatus.Prospective)                    //Don't need to prompt if patient is already prospective.
                    {
                        if (MsgBox.Show(this, MsgBoxButtons.OKCancel, "Patient's status will be set to Prospective."))
                        {
                            Patient patOld = _patCur.Copy();
                            _patCur.PatStatus = PatientStatus.Prospective;
                            Patients.Update(_patCur, patOld);
                        }
                    }
                    else if (!opCur.SetProspective && _patCur.PatStatus == PatientStatus.Prospective)
                    {
                        if (MsgBox.Show(this, MsgBoxButtons.OKCancel, "Patient's status will change from Prospective to Patient."))
                        {
                            Patient patOld = _patCur.Copy();
                            _patCur.PatStatus = PatientStatus.Patient;
                            Patients.Update(_patCur, patOld);
                        }
                    }
                }
            }
            ListAptNumsSelected.Add(aptCur.AptNum);
            if (IsInitialDoubleClick)
            {
                _otherResult = OtherResult.CreateNew;
            }
            else
            {
                _otherResult = OtherResult.NewToPinBoard;
            }
            if (aptCur.IsNewPatient)
            {
                AutomationL.Trigger(AutomationTrigger.CreateApptNewPat, null, aptCur.PatNum, aptCur.AptNum);
            }
            AutomationL.Trigger(AutomationTrigger.CreateAppt, null, aptCur.PatNum, aptCur.AptNum);
            DialogResult = DialogResult.OK;
        }
예제 #11
0
        private void butNote_Click(object sender, EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.AppointmentCreate))
            {
                return;
            }
            if (PatRestrictionL.IsRestricted(_patCur.PatNum, PatRestrict.ApptSchedule))
            {
                return;
            }
            Appointment aptCur = new Appointment();

            aptCur.PatNum = _patCur.PatNum;
            if (_patCur.DateFirstVisit.Year < 1880 &&
                !Procedures.AreAnyComplete(_patCur.PatNum))                   //this only runs if firstVisit blank
            {
                aptCur.IsNewPatient = true;
            }
            aptCur.Pattern = "/X/";
            if (_patCur.PriProv == 0)
            {
                aptCur.ProvNum = PrefC.GetLong(PrefName.PracticeDefaultProv);
            }
            else
            {
                aptCur.ProvNum = _patCur.PriProv;
            }
            aptCur.ProvHyg    = _patCur.SecProv;
            aptCur.AptStatus  = ApptStatus.PtNote;
            aptCur.ClinicNum  = _patCur.ClinicNum;
            aptCur.TimeLocked = PrefC.GetBool(PrefName.AppointmentTimeIsLocked);
            if (IsInitialDoubleClick)             //initially double clicked on appt module
            {
                aptCur.AptDateTime = DateTimeClicked;
                aptCur.Op          = OpNumClicked;
            }
            else
            {
                //new appt will be placed on pinboard instead of specific time
            }
            try {
                if (!AppointmentL.IsSpecialtyMismatchAllowed(_patCur.PatNum, aptCur.ClinicNum))
                {
                    return;
                }
                Appointments.Insert(aptCur);
            }
            catch (ApplicationException ex) {
                MessageBox.Show(ex.Message);
                return;
            }
            FormApptEdit formApptEdit = new FormApptEdit(aptCur.AptNum);

            formApptEdit.IsNew = true;
            formApptEdit.ShowDialog();
            if (formApptEdit.DialogResult != DialogResult.OK)
            {
                return;
            }
            ListAptNumsSelected.Add(aptCur.AptNum);
            if (IsInitialDoubleClick)
            {
                _otherResult = OtherResult.CreateNew;
            }
            else
            {
                _otherResult = OtherResult.NewToPinBoard;
            }
            DialogResult = DialogResult.OK;
        }
예제 #12
0
        ///<summary>Creates appointments for each patient in _famCur.  MsgBox informs user of anyone skipped.  StringDateJumpTo will contain the due date (of the last family member) to jump to.  ListAptNumsSelected will contain the AptNums of the new appointments on the pinboard.</summary>
        public void MakeRecallFamily()
        {
            List <Recall>  listPatRecalls;
            List <InsPlan> listInsPlans;
            List <InsSub>  listInsSubs;
            Appointment    apt = null;
            Recall         recall;
            int            countAlreadySched           = 0;
            int            countNoRecalls              = 0;
            int            countPatsRestricted         = 0;
            int            countPatsArchivedOrDeceased = 0;

            for (int i = 0; i < _famCur.ListPats.Length; i++)
            {
                Patient patCur = _famCur.ListPats[i];
                if (PatRestrictionL.IsRestricted(patCur.PatNum, PatRestrict.ApptSchedule, true))
                {
                    countPatsRestricted++;
                    continue;
                }
                if (patCur.PatStatus.In(PatientStatus.Archived, PatientStatus.Deceased))
                {
                    countPatsArchivedOrDeceased++;
                    continue;
                }
                listPatRecalls = Recalls.GetList(patCur.PatNum);              //get the recall for this pt
                //Check to see if the special type recall is disabled or already scheduled.  This is also done in AppointmentL.CreateRecallApt() below so I'm
                //	not sure why we do it here.
                List <Recall> listRecalls = listPatRecalls.FindAll(x => x.RecallTypeNum == RecallTypes.PerioType || x.RecallTypeNum == RecallTypes.ProphyType);
                if (listRecalls.Count == 0 || listRecalls.Exists(x => x.IsDisabled))
                {
                    countNoRecalls++;
                    continue;
                }
                if (listRecalls.Exists(x => x.DateScheduled.Year > 1880))
                {
                    countAlreadySched++;
                    continue;
                }
                listInsSubs  = InsSubs.RefreshForFam(_famCur);
                listInsPlans = InsPlans.RefreshForSubList(listInsSubs);
                try {
                    apt = AppointmentL.CreateRecallApt(patCur, listInsPlans, -1, listInsSubs);
                }
                catch (Exception ex) {
                    ex.DoNothing();
                    continue;
                }
                ListAptNumsSelected.Add(apt.AptNum);
                _otherResult = OtherResult.PinboardAndSearch;
                recall       = Recalls.GetRecallProphyOrPerio(patCur.PatNum);        //should not return null
                if (recall.DateDue < DateTime.Today)
                {
                    StringDateJumpTo = DateTime.Today.ToShortDateString();                  //they are overdue
                }
                else
                {
                    StringDateJumpTo = recall.DateDue.ToShortDateString();
                }
                //Log will be made when appointment dragged off of the pinboard.
                //SecurityLogs.MakeLogEntry(Permissions.AppointmentCreate,apt.PatNum,apt.AptDateTime.ToString(),apt.AptNum);
            }
            List <string> listUserMsgs = new List <string>();

            if (countPatsRestricted > 0)
            {
                listUserMsgs.Add(Lan.g(this, "Family members skipped due to patient restriction") + " "
                                 + PatRestrictions.GetPatRestrictDesc(PatRestrict.ApptSchedule) + ": " + countPatsRestricted + ".");
            }
            if (countNoRecalls > 0)
            {
                listUserMsgs.Add(Lan.g(this, "Family members skipped because recall disabled") + ": " + countNoRecalls + ".");
            }
            if (countAlreadySched > 0)
            {
                listUserMsgs.Add(Lan.g(this, "Family members skipped because already scheduled") + ": " + countAlreadySched + ".");
            }
            if (countPatsArchivedOrDeceased > 0)
            {
                listUserMsgs.Add(Lan.g(this, "Family members skipped because status is archived or deceased") + ": " + countPatsArchivedOrDeceased + ".");
            }
            if (ListAptNumsSelected.Count == 0)
            {
                listUserMsgs.Add(Lan.g(this, "There are no recall appointments to schedule."));
            }
            if (listUserMsgs.Count > 0)
            {
                MessageBox.Show(string.Join("\r\n", listUserMsgs));
                if (ListAptNumsSelected.Count == 0)
                {
                    return;
                }
            }
            DialogResult = DialogResult.OK;
        }
예제 #13
0
        ///<summary>Creates a single recall appointment. If it's from a double click, then it will end up on that spot in the Appts module.  If not, it will end up on the pinboard with StringDateJumpTo as due date to jump to.  ListAptNumsSelected will contain the AptNum of the new appointment.</summary>
        public void MakeRecallAppointment()
        {
            List <InsSub>  listInsSubs  = InsSubs.RefreshForFam(_famCur);
            List <InsPlan> listInsPlans = InsPlans.RefreshForSubList(listInsSubs);
            Appointment    apt          = null;
            DateTime       dateTimeApt  = DateTime.MinValue;

            if (this.IsInitialDoubleClick)
            {
                dateTimeApt = DateTimeClicked;
            }
            try{
                apt = AppointmentL.CreateRecallApt(_patCur, listInsPlans, -1, listInsSubs, dateTimeApt);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
                return;
            }
            DateTime datePrevious = apt.DateTStamp;

            ListAptNumsSelected.Add(apt.AptNum);
            if (IsInitialDoubleClick)
            {
                Appointment oldApt = apt.Copy();
                if (_patCur.AskToArriveEarly > 0)
                {
                    apt.DateTimeAskedToArrive = apt.AptDateTime.AddMinutes(-_patCur.AskToArriveEarly);
                    MessageBox.Show(Lan.g(this, "Ask patient to arrive") + " " + _patCur.AskToArriveEarly
                                    + " " + Lan.g(this, "minutes early at") + " " + apt.DateTimeAskedToArrive.ToShortTimeString() + ".");
                }
                apt.AptStatus = ApptStatus.Scheduled;
                apt.ClinicNum = _patCur.ClinicNum;
                apt.Op        = OpNumClicked;
                apt           = Appointments.AssignFieldsForOperatory(apt);
                //Use apt.ClinicNum because it was just set based on Op.ClinicNum in AssignFieldsForOperatory().
                if (!AppointmentL.IsSpecialtyMismatchAllowed(_patCur.PatNum, apt.ClinicNum))
                {
                    return;
                }
                Appointments.Update(apt, oldApt);
                _otherResult = OtherResult.CreateNew;
                SecurityLogs.MakeLogEntry(Permissions.AppointmentCreate, apt.PatNum, apt.AptDateTime.ToString(), apt.AptNum, datePrevious);
                //If there is an existing HL7 def enabled, send a SIU message if there is an outbound SIU message defined
                if (HL7Defs.IsExistingHL7Enabled())
                {
                    //S12 - New Appt Booking event
                    MessageHL7 messageHL7 = MessageConstructor.GenerateSIU(_patCur, _famCur.GetPatient(_patCur.Guarantor), EventTypeHL7.S12, apt);
                    //Will be null if there is no outbound SIU message defined, so do nothing
                    if (messageHL7 != null)
                    {
                        HL7Msg hl7Msg = new HL7Msg();
                        hl7Msg.AptNum    = apt.AptNum;
                        hl7Msg.HL7Status = HL7MessageStatus.OutPending;                      //it will be marked outSent by the HL7 service.
                        hl7Msg.MsgText   = messageHL7.ToString();
                        hl7Msg.PatNum    = _patCur.PatNum;
                        HL7Msgs.Insert(hl7Msg);
#if DEBUG
                        MessageBox.Show(this, messageHL7.ToString());
#endif
                    }
                }
                DialogResult = DialogResult.OK;
                return;
            }
            //not initialClick
            _otherResult = OtherResult.PinboardAndSearch;
            Recall recall = Recalls.GetRecallProphyOrPerio(_patCur.PatNum);          //shouldn't return null.
            if (recall.DateDue < DateTime.Today)
            {
                StringDateJumpTo = DateTime.Today.ToShortDateString();              //they are overdue
            }
            else
            {
                StringDateJumpTo = recall.DateDue.ToShortDateString();
            }
            //no securitylog entry needed here.  That will happen when it's dragged off pinboard.
            DialogResult = DialogResult.OK;
        }
예제 #14
0
 private void FormApptsOther_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if(DialogResult==DialogResult.OK){
         return;
     }
     oResult=OtherResult.Cancel;
 }
예제 #15
0
 private void butRecall_Click(object sender, System.EventArgs e)
 {
     List<Procedure> procList=Procedures.Refresh(PatCur.PatNum);
     //List<Recall> recallList=Recalls.GetList(PatCur.PatNum);//get the recall for this pt
     //if(recallList.Count==0){
     //	MsgBox.Show(this,"This patient does not have any recall due.");
     //	return;
     //}
     //Recall recallCur=recallList[0];
     List<InsSub> subList=InsSubs.RefreshForFam(FamCur);
     List<InsPlan> planList=InsPlans.RefreshForSubList(subList);
     Appointment apt=null;
     try{
         apt=AppointmentL.CreateRecallApt(PatCur,procList,planList,-1,subList);
     }
     catch(Exception ex){
         MessageBox.Show(ex.Message);
         return;
     }
     AptNumsSelected.Add(apt.AptNum);
     if(this.InitialClick) {
         Appointment oldApt=apt.Clone();
         DateTime d;
         if(ApptDrawing.IsWeeklyView) {
             d=ContrAppt.WeekStartDate.AddDays(ContrAppt.SheetClickedonDay);
         }
         else {
             d=AppointmentL.DateSelected;
         }
         int minutes=(int)(ContrAppt.SheetClickedonMin/ApptDrawing.MinPerIncr)*ApptDrawing.MinPerIncr;
         apt.AptDateTime=new DateTime(d.Year,d.Month,d.Day,ContrAppt.SheetClickedonHour,minutes,0);
         if(PatCur.AskToArriveEarly>0){
             apt.DateTimeAskedToArrive=apt.AptDateTime.AddMinutes(-PatCur.AskToArriveEarly);
             MessageBox.Show(Lan.g(this,"Ask patient to arrive")+" "+PatCur.AskToArriveEarly
                 +" "+Lan.g(this,"minutes early at")+" "+apt.DateTimeAskedToArrive.ToShortTimeString()+".");
         }
         apt.AptStatus=ApptStatus.Scheduled;
         apt.Op=ContrAppt.SheetClickedonOp;
         Operatory curOp=Operatories.GetOperatory(apt.Op);
         if(curOp.ProvDentist!=0) {
             apt.ProvNum=curOp.ProvDentist;
         }
         apt.ProvHyg=curOp.ProvHygienist;
         apt.IsHygiene=curOp.IsHygiene;
         if(curOp.ClinicNum==0){
             apt.ClinicNum=PatCur.ClinicNum;
         }
         else{
             apt.ClinicNum=curOp.ClinicNum;
         }
         Appointments.Update(apt,oldApt);
         oResult=OtherResult.CreateNew;
         SecurityLogs.MakeLogEntry(Permissions.AppointmentCreate,apt.PatNum,apt.AptDateTime.ToString());
         DialogResult=DialogResult.OK;
         return;
     }
     //not initialClick
     oResult=OtherResult.PinboardAndSearch;
     Recall recall=Recalls.GetRecallProphyOrPerio(PatCur.PatNum);//shouldn't return null.
     if(recall.DateDue<DateTime.Today){
         DateJumpToString=DateTime.Today.ToShortDateString();//they are overdue
     }
     else{
         DateJumpToString=recall.DateDue.ToShortDateString();
     }
     //no securitylog entry needed here.  That will happen when it's dragged off pinboard.
     DialogResult=DialogResult.OK;
 }
예제 #16
0
        private void butNew_Click(object sender, System.EventArgs e)
        {
            Appointment AptCur = new Appointment();

            AptCur.PatNum = PatCur.PatNum;
            if (PatCur.DateFirstVisit.Year < 1880 &&
                !Procedures.AreAnyComplete(PatCur.PatNum))                   //this only runs if firstVisit blank
            {
                AptCur.IsNewPatient = true;
            }
            AptCur.Pattern = "/X/";
            if (PatCur.PriProv == 0)
            {
                AptCur.ProvNum = PIn.PInt(((Pref)PrefB.HList["PracticeDefaultProv"]).ValueString);
            }
            else
            {
                AptCur.ProvNum = PatCur.PriProv;
            }
            AptCur.ProvHyg   = PatCur.SecProv;
            AptCur.AptStatus = ApptStatus.Scheduled;
            AptCur.ClinicNum = PatCur.ClinicNum;
            if (InitialClick)            //initially double clicked on appt module
            {
                DateTime d;
                if (ContrApptSheet.IsWeeklyView)
                {
                    d = ContrAppt.WeekStartDate.AddDays(ContrAppt.SheetClickedonDay);
                }
                else
                {
                    d = Appointments.DateSelected;
                }
                int minutes = (int)(ContrAppt.SheetClickedonMin / ContrApptSheet.MinPerIncr) * ContrApptSheet.MinPerIncr;
                AptCur.AptDateTime = new DateTime(d.Year, d.Month, d.Day
                                                  , ContrAppt.SheetClickedonHour, minutes, 0);
                AptCur.Op = ContrAppt.SheetClickedonOp;
                Operatory curOp = Operatories.GetOperatory(AptCur.Op);
                if (curOp.ProvDentist != 0)
                {
                    AptCur.ProvNum = curOp.ProvDentist;
                }
                AptCur.ProvHyg   = curOp.ProvHygienist;
                AptCur.IsHygiene = curOp.IsHygiene;
                AptCur.ClinicNum = curOp.ClinicNum;
                try {
                    Appointments.InsertOrUpdate(AptCur, null, true);
                }
                catch (ApplicationException ex) {
                    MessageBox.Show(ex.Message);
                }
            }
            else
            {
                //new appt will be placed on pinboard instead of specific time
            }
            try{
                Appointments.InsertOrUpdate(AptCur, null, true);
            }
            catch (ApplicationException ex) {
                MessageBox.Show(ex.Message);
                return;
            }
            FormApptEdit FormApptEdit2 = new FormApptEdit(AptCur.AptNum);

            FormApptEdit2.IsNew = true;
            FormApptEdit2.ShowDialog();
            if (FormApptEdit2.DialogResult != DialogResult.OK)
            {
                return;
            }
            AptSelected = AptCur.AptNum;
            if (InitialClick)
            {
                oResult = OtherResult.CreateNew;
            }
            else
            {
                oResult = OtherResult.NewToPinBoard;
            }
            DialogResult = DialogResult.OK;
        }
예제 #17
0
파일: FormApptsOther.cs 프로젝트: mnisl/OD
		private void gridMain_CellDoubleClick(object sender,ODGridClickEventArgs e) {
			int currentSelection=e.Row;
			int currentScroll=gridMain.ScrollValue;
			FormApptEdit FormAE=new FormApptEdit(ApptList[e.Row].AptNum);
			FormAE.IsInViewPatAppts=true;
			FormAE.PinIsVisible=true;
			FormAE.ShowDialog();
			if(FormAE.DialogResult!=DialogResult.OK)
				return;
			if(FormAE.PinClicked){
				if(!OKtoSendToPinboard(ApptList[e.Row])){
					return;
				}
				AptNumsSelected.Add(ApptList[e.Row].AptNum);
				oResult=OtherResult.CopyToPinBoard;
				DialogResult=DialogResult.OK;
			}
			else{
				FillFamily();
				FillGrid();
				gridMain.SetSelected(currentSelection,true);
				gridMain.ScrollValue=currentScroll;
			}
		}
예제 #18
0
 private void butNew_Click(object sender, System.EventArgs e)
 {
     Appointment AptCur=new Appointment();
     AptCur.PatNum=PatCur.PatNum;
     if(PatCur.DateFirstVisit.Year<1880
         && !Procedures.AreAnyComplete(PatCur.PatNum))//this only runs if firstVisit blank
     {
         AptCur.IsNewPatient=true;
     }
     AptCur.Pattern="/X/";
     if(PatCur.PriProv==0){
         AptCur.ProvNum=PrefC.GetLong(PrefName.PracticeDefaultProv);
     }
     else{
         AptCur.ProvNum=PatCur.PriProv;
     }
     AptCur.ProvHyg=PatCur.SecProv;
     AptCur.AptDateTime=DateTime.MinValue;//(was .Now) This is what triggers automatic deletion from db when clear pinboard is clicked.
     AptCur.ClinicNum=PatCur.ClinicNum;
     if(InitialClick){//initially double clicked on appt module
         DateTime d;
         if(ApptDrawing.IsWeeklyView){
             d=ContrAppt.WeekStartDate.AddDays(ContrAppt.SheetClickedonDay);
         }
         else{
             d=AppointmentL.DateSelected;
         }
         int minutes=(int)(ContrAppt.SheetClickedonMin/ApptDrawing.MinPerIncr)*ApptDrawing.MinPerIncr;
         AptCur.AptDateTime=new DateTime(d.Year,d.Month,d.Day
             ,ContrAppt.SheetClickedonHour,minutes,0);
         if(PatCur.AskToArriveEarly>0){
             AptCur.DateTimeAskedToArrive=AptCur.AptDateTime.AddMinutes(-PatCur.AskToArriveEarly);
             MessageBox.Show(Lan.g(this,"Ask patient to arrive")+" "+PatCur.AskToArriveEarly
                 +" "+Lan.g(this,"minutes early at")+" "+AptCur.DateTimeAskedToArrive.ToShortTimeString()+".");
         }
         AptCur.Op=ContrAppt.SheetClickedonOp;
         Operatory curOp=Operatories.GetOperatory(AptCur.Op);
         //if(curOp.ProvDentist!=0) {
         //  AptCur.ProvNum=curOp.ProvDentist;
         //}
         //AptCur.ProvHyg=curOp.ProvHygienist;
         List<Schedule> schedListPeriod=Schedules.RefreshDayEdit(AptCur.AptDateTime);
         long assignedDent=Schedules.GetAssignedProvNumForSpot(schedListPeriod,curOp,false,AptCur.AptDateTime);
         long assignedHyg=Schedules.GetAssignedProvNumForSpot(schedListPeriod,curOp,true,AptCur.AptDateTime);
         if(assignedDent!=0) {//if no dentist is assigned to op, then keep the original dentist.  All appts must have prov.
             AptCur.ProvNum=assignedDent;
         }
         AptCur.ProvHyg=assignedHyg;
         AptCur.IsHygiene=curOp.IsHygiene;
         if(curOp.ClinicNum!=0){
             AptCur.ClinicNum=curOp.ClinicNum;
         }
         AptCur.AptStatus=ApptStatus.Scheduled;
     }
     else{
         //new appt will be placed on pinboard instead of specific time
         AptCur.AptStatus=ApptStatus.UnschedList;//This is so that if it's on the pinboard when use shuts down OD, no db inconsistency.
     }
     try{
         Appointments.Insert(AptCur);
     }
     catch(ApplicationException ex){
         MessageBox.Show(ex.Message);
         return;
     }
     FormApptEdit FormApptEdit2=new FormApptEdit(AptCur.AptNum);
     FormApptEdit2.IsNew=true;
     FormApptEdit2.ShowDialog();
     if(FormApptEdit2.DialogResult!=DialogResult.OK){
         return;
     }
     if(InitialClick) {
         //Change PatStatus to Prospective or from Prospective.
         Operatory opCur=Operatories.GetOperatory(AptCur.Op);
         if(opCur.SetProspective && PatCur.PatStatus!=PatientStatus.Prospective) { //Don't need to prompt if patient is already prospective.
             if(MsgBox.Show(this,MsgBoxButtons.OKCancel,"Patient's status will be set to Prospective.")) {
                 Patient patOld=PatCur.Copy();
                 PatCur.PatStatus=PatientStatus.Prospective;
                 Patients.Update(PatCur,patOld);
             }
         }
         else if(!opCur.SetProspective && PatCur.PatStatus==PatientStatus.Prospective) {
             if(MsgBox.Show(this,MsgBoxButtons.OKCancel,"Patient's status will change from Prospective to Patient.")) {
                 Patient patOld=PatCur.Copy();
                 PatCur.PatStatus=PatientStatus.Patient;
                 Patients.Update(PatCur,patOld);
             }
         }
     }
     AptNumsSelected.Add(AptCur.AptNum);
     if(InitialClick){
         oResult=OtherResult.CreateNew;
     }
     else{
         oResult=OtherResult.NewToPinBoard;
     }
     if(AptCur.IsNewPatient) {
         AutomationL.Trigger(AutomationTrigger.CreateApptNewPat,null,AptCur.PatNum);
     }
     DialogResult=DialogResult.OK;
 }
예제 #19
0
 private void butGoTo_Click(object sender, System.EventArgs e)
 {
     if(tbApts.SelectedRow==-1){
         MessageBox.Show(Lan.g(this,"Please select appointment first."));
         return;
     }
     if(ApptList[tbApts.SelectedRow].AptDateTime.Year<1880){
         MessageBox.Show(Lan.g(this,"Unable to go to unscheduled appointment."));
         return;
     }
     AptNumsSelected.Add(ApptList[tbApts.SelectedRow].AptNum);
     DateJumpToString=ApptList[tbApts.SelectedRow].AptDateTime.Date.ToShortDateString();
     oResult=OtherResult.GoTo;
     DialogResult=DialogResult.OK;
 }
예제 #20
0
 private void tbApts_CellDoubleClicked(object sender, CellEventArgs e)
 {
     int currentSelection=tbApts.SelectedRow;
     int currentScroll=tbApts.ScrollValue;
     FormApptEdit FormAE=new FormApptEdit(ApptList[e.Row].AptNum);
     FormAE.PinIsVisible=true;
     FormAE.ShowDialog();
     if(FormAE.DialogResult!=DialogResult.OK)
         return;
     if(FormAE.PinClicked){
         if(!OKtoSendToPinboard(ApptList[e.Row])){
             return;
         }
         AptNumsSelected.Add(ApptList[e.Row].AptNum);
         oResult=OtherResult.CopyToPinBoard;
         DialogResult=DialogResult.OK;
     }
     else{
         Filltb();
         tbApts.SetSelected(currentSelection,true);
         tbApts.ScrollValue=currentScroll;
     }
 }
예제 #21
0
파일: FormApptsOther.cs 프로젝트: mnisl/OD
		public void MakeRecallAppointment(){
			List<Procedure> procList=Procedures.Refresh(PatCur.PatNum);
			//List<Recall> recallList=Recalls.GetList(PatCur.PatNum);//get the recall for this pt
			//if(recallList.Count==0){
			//	MsgBox.Show(this,"This patient does not have any recall due.");
			//	return;
			//}
			//Recall recallCur=recallList[0];
			List<InsSub> subList=InsSubs.RefreshForFam(FamCur);
			List<InsPlan> planList=InsPlans.RefreshForSubList(subList);
			Appointment apt=null;
			try{
				apt=AppointmentL.CreateRecallApt(PatCur,procList,planList,-1,subList);
			}
			catch(Exception ex){
				MessageBox.Show(ex.Message);
				return;
			}
			AptNumsSelected.Add(apt.AptNum);
			if(this.InitialClick) {
				Appointment oldApt=apt.Clone();
				DateTime d;
				if(ApptDrawing.IsWeeklyView) {
					d=ContrAppt.WeekStartDate.AddDays(ContrAppt.SheetClickedonDay);
				}
				else {
					d=AppointmentL.DateSelected;
				}
				int minutes=(int)(ContrAppt.SheetClickedonMin/ApptDrawing.MinPerIncr)*ApptDrawing.MinPerIncr;
				apt.AptDateTime=new DateTime(d.Year,d.Month,d.Day,ContrAppt.SheetClickedonHour,minutes,0);
				if(PatCur.AskToArriveEarly>0){
					apt.DateTimeAskedToArrive=apt.AptDateTime.AddMinutes(-PatCur.AskToArriveEarly);
					MessageBox.Show(Lan.g(this,"Ask patient to arrive")+" "+PatCur.AskToArriveEarly
						+" "+Lan.g(this,"minutes early at")+" "+apt.DateTimeAskedToArrive.ToShortTimeString()+".");
				}
				apt.AptStatus=ApptStatus.Scheduled;
				apt.Op=ContrAppt.SheetClickedonOp;
				Operatory curOp=Operatories.GetOperatory(apt.Op);
				if(curOp.ProvDentist!=0) {
					apt.ProvNum=curOp.ProvDentist;
				}
				apt.ProvHyg=curOp.ProvHygienist;
				apt.IsHygiene=curOp.IsHygiene;
				if(curOp.ClinicNum==0){
					apt.ClinicNum=PatCur.ClinicNum;
				}
				else{
					apt.ClinicNum=curOp.ClinicNum;
				}
				Appointments.Update(apt,oldApt);
				oResult=OtherResult.CreateNew;
				SecurityLogs.MakeLogEntry(Permissions.AppointmentCreate,apt.PatNum,apt.AptDateTime.ToString(),apt.AptNum);
				//If there is an existing HL7 def enabled, send a SIU message if there is an outbound SIU message defined
				if(HL7Defs.IsExistingHL7Enabled()) {
					//S12 - New Appt Booking event
					MessageHL7 messageHL7=MessageConstructor.GenerateSIU(PatCur,FamCur.GetPatient(PatCur.Guarantor),EventTypeHL7.S12,apt);
					//Will be null if there is no outbound SIU message defined, so do nothing
					if(messageHL7!=null) {
						HL7Msg hl7Msg=new HL7Msg();
						hl7Msg.AptNum=apt.AptNum;
						hl7Msg.HL7Status=HL7MessageStatus.OutPending;//it will be marked outSent by the HL7 service.
						hl7Msg.MsgText=messageHL7.ToString();
						hl7Msg.PatNum=PatCur.PatNum;
						HL7Msgs.Insert(hl7Msg);
#if DEBUG
						MessageBox.Show(this,messageHL7.ToString());
#endif
					}
				}
				DialogResult=DialogResult.OK;
				return;
			}
			//not initialClick
			oResult=OtherResult.PinboardAndSearch;
			Recall recall=Recalls.GetRecallProphyOrPerio(PatCur.PatNum);//shouldn't return null.
			if(recall.DateDue<DateTime.Today){
				DateJumpToString=DateTime.Today.ToShortDateString();//they are overdue
			}
			else{
				DateJumpToString=recall.DateDue.ToShortDateString();
			}
			//no securitylog entry needed here.  That will happen when it's dragged off pinboard.
			DialogResult=DialogResult.OK;
		}
예제 #22
0
파일: FormApptsOther.cs 프로젝트: mnisl/OD
		public void MakeAppointment(){
			Appointment AptCur=new Appointment();
			AptCur.PatNum=PatCur.PatNum;
			if(PatCur.DateFirstVisit.Year<1880
				&& !Procedures.AreAnyComplete(PatCur.PatNum))//this only runs if firstVisit blank
			{
				AptCur.IsNewPatient=true;
			}
			AptCur.Pattern="/X/";
			if(PatCur.PriProv==0){
				AptCur.ProvNum=PrefC.GetLong(PrefName.PracticeDefaultProv);
			}
			else{			
				AptCur.ProvNum=PatCur.PriProv;
			}
			AptCur.ProvHyg=PatCur.SecProv;
			AptCur.AptDateTime=DateTime.MinValue;//(was .Now) This is what triggers automatic deletion from db when clear pinboard is clicked.
			AptCur.ClinicNum=PatCur.ClinicNum;
			AptCur.TimeLocked=PrefC.GetBool(PrefName.AppointmentTimeIsLocked);
			if(InitialClick){//initially double clicked on appt module
				DateTime d;
				if(ApptDrawing.IsWeeklyView){
					d=ContrAppt.WeekStartDate.AddDays(ContrAppt.SheetClickedonDay);
				}
				else{
					d=AppointmentL.DateSelected;
				}
				int minutes=(int)(ContrAppt.SheetClickedonMin/ApptDrawing.MinPerIncr)*ApptDrawing.MinPerIncr;
				AptCur.AptDateTime=new DateTime(d.Year,d.Month,d.Day
					,ContrAppt.SheetClickedonHour,minutes,0);
				if(PatCur.AskToArriveEarly>0){
					AptCur.DateTimeAskedToArrive=AptCur.AptDateTime.AddMinutes(-PatCur.AskToArriveEarly);
					MessageBox.Show(Lan.g(this,"Ask patient to arrive")+" "+PatCur.AskToArriveEarly
						+" "+Lan.g(this,"minutes early at")+" "+AptCur.DateTimeAskedToArrive.ToShortTimeString()+".");
				}
				AptCur.Op=ContrAppt.SheetClickedonOp;
				Operatory curOp=Operatories.GetOperatory(AptCur.Op);
				//if(curOp.ProvDentist!=0) {
				//  AptCur.ProvNum=curOp.ProvDentist;
				//}
				//AptCur.ProvHyg=curOp.ProvHygienist;
				List<Schedule> schedListPeriod=Schedules.RefreshDayEdit(AptCur.AptDateTime);
				long assignedDent=Schedules.GetAssignedProvNumForSpot(schedListPeriod,curOp,false,AptCur.AptDateTime);
				long assignedHyg=Schedules.GetAssignedProvNumForSpot(schedListPeriod,curOp,true,AptCur.AptDateTime);
				//the section below regarding providers is overly wordy because it's copied from ContrAppt.pinBoard_MouseUp to make maint easier.
				if(assignedDent!=0) {
					AptCur.ProvNum=assignedDent;
				}
				if(assignedHyg!=0) {//the hygienist will only be changed if the spot has a hygienist.
					AptCur.ProvHyg=assignedHyg;
				}
				if(curOp.IsHygiene) {
					AptCur.IsHygiene=true;
				}
				else {//op not marked as hygiene op
					if(assignedDent==0) {//no dentist assigned
						if(assignedHyg!=0) {//hyg is assigned (we don't really have to test for this)
							AptCur.IsHygiene=true;
						}
					}
					else {//dentist is assigned
						if(assignedHyg==0) {//hyg is not assigned
							AptCur.IsHygiene=false;
						}
						//if both dentist and hyg are assigned, it's tricky
						//only explicitly set it if user has a dentist assigned to the op
						if(curOp.ProvDentist!=0) {
							AptCur.IsHygiene=false;
						}
					}
				}
				if(curOp.ClinicNum!=0){
					AptCur.ClinicNum=curOp.ClinicNum;
				}
				AptCur.AptStatus=ApptStatus.Scheduled;
			}
			else{
				//new appt will be placed on pinboard instead of specific time
				AptCur.AptStatus=ApptStatus.UnschedList;//This is so that if it's on the pinboard when use shuts down OD, no db inconsistency.
			}
			try{
				Appointments.Insert(AptCur);
			}
			catch(ApplicationException ex){
				MessageBox.Show(ex.Message);
				return;
			}
			//This is done inside FormApptEdit.butOK_Click().  Don't want to make two create entries.
			//SecurityLogs.MakeLogEntry(Permissions.AppointmentCreate,AptCur.PatNum,
			//	AptCur.AptDateTime.ToString()+", "+AptCur.ProcDescript,
			//	AptCur.AptNum);
			FormApptEdit FormApptEdit2=new FormApptEdit(AptCur.AptNum);
			FormApptEdit2.IsNew=true;
			FormApptEdit2.ShowDialog();
			if(FormApptEdit2.DialogResult!=DialogResult.OK){
				return;
			}
			if(InitialClick) {
				//Change PatStatus to Prospective or from Prospective.
				Operatory opCur=Operatories.GetOperatory(AptCur.Op);
				if(opCur.SetProspective && PatCur.PatStatus!=PatientStatus.Prospective) { //Don't need to prompt if patient is already prospective.
					if(MsgBox.Show(this,MsgBoxButtons.OKCancel,"Patient's status will be set to Prospective.")) {
						Patient patOld=PatCur.Copy();
						PatCur.PatStatus=PatientStatus.Prospective;
						Patients.Update(PatCur,patOld);
					}
				}
				else if(!opCur.SetProspective && PatCur.PatStatus==PatientStatus.Prospective) {
					if(MsgBox.Show(this,MsgBoxButtons.OKCancel,"Patient's status will change from Prospective to Patient.")) {
						Patient patOld=PatCur.Copy();
						PatCur.PatStatus=PatientStatus.Patient;
						Patients.Update(PatCur,patOld);
					}
				}
			}
			AptNumsSelected.Add(AptCur.AptNum);
			if(InitialClick){
				oResult=OtherResult.CreateNew;
			}
			else{
				oResult=OtherResult.NewToPinBoard;
			}
			if(AptCur.IsNewPatient) {
				AutomationL.Trigger(AutomationTrigger.CreateApptNewPat,null,AptCur.PatNum);
			}
			DialogResult=DialogResult.OK;
		}
예제 #23
0
 private void butNote_Click(object sender,EventArgs e)
 {
     Appointment AptCur=new Appointment();
     AptCur.PatNum=PatCur.PatNum;
     if(PatCur.DateFirstVisit.Year<1880
         && !Procedures.AreAnyComplete(PatCur.PatNum))//this only runs if firstVisit blank
     {
         AptCur.IsNewPatient=true;
     }
     AptCur.Pattern="/X/";
     if(PatCur.PriProv==0) {
         AptCur.ProvNum=PrefC.GetLong(PrefName.PracticeDefaultProv);
     }
     else {
         AptCur.ProvNum=PatCur.PriProv;
     }
     AptCur.ProvHyg=PatCur.SecProv;
     AptCur.AptStatus=ApptStatus.PtNote;
     AptCur.ClinicNum=PatCur.ClinicNum;
     if(InitialClick) {//initially double clicked on appt module
         DateTime d;
         if(ApptDrawing.IsWeeklyView) {
             d=ContrAppt.WeekStartDate.AddDays(ContrAppt.SheetClickedonDay);
         }
         else {
             d=AppointmentL.DateSelected;
         }
         int minutes=(int)(ContrAppt.SheetClickedonMin/ApptDrawing.MinPerIncr)
             *ApptDrawing.MinPerIncr;
         AptCur.AptDateTime=new DateTime(d.Year,d.Month,d.Day
             ,ContrAppt.SheetClickedonHour,minutes,0);
         AptCur.Op=ContrAppt.SheetClickedonOp;
     }
     else {
         //new appt will be placed on pinboard instead of specific time
     }
     try {
         Appointments.Insert(AptCur);
     }
     catch(ApplicationException ex) {
         MessageBox.Show(ex.Message);
         return;
     }
     FormApptEdit FormApptEdit2=new FormApptEdit(AptCur.AptNum);
     FormApptEdit2.IsNew=true;
     FormApptEdit2.ShowDialog();
     if(FormApptEdit2.DialogResult!=DialogResult.OK) {
         return;
     }
     AptNumsSelected.Add(AptCur.AptNum);
     if(InitialClick) {
         oResult=OtherResult.CreateNew;
     }
     else {
         oResult=OtherResult.NewToPinBoard;
     }
     DialogResult=DialogResult.OK;
 }
예제 #24
0
 private void butRecallFamily_Click(object sender,EventArgs e)
 {
     List<Procedure> procList;
     List<Recall> recallList;//=Recalls.GetList(FamCur.ListPats
     List <InsPlan> planList;
     List<InsSub> subList;
     Appointment apt=null;
     Recall recall;
     int alreadySched=0;
     int noRecalls=0;
     for(int i=0;i<FamCur.ListPats.Length;i++){
         procList=Procedures.Refresh(FamCur.ListPats[i].PatNum);
         recallList=Recalls.GetList(FamCur.ListPats[i].PatNum);//get the recall for this pt
         if(recallList.Count==0) {
             noRecalls++;
             //MsgBox.Show(this,"This patient does not have any recall due.");
             continue;
         }
         if(recallList[0].IsDisabled){
             noRecalls++;
             continue;
         }
         if(recallList[0].DateScheduled.Year > 1880) {
             alreadySched++;
             continue;
         }
         subList=InsSubs.RefreshForFam(FamCur);
         planList=InsPlans.RefreshForSubList(subList);
         try{
             apt=AppointmentL.CreateRecallApt(FamCur.ListPats[i],procList,planList,-1,subList);
         }
         catch{
             //MessageBox.Show(ex.Message);
             continue;
         }
         AptNumsSelected.Add(apt.AptNum);
         oResult=OtherResult.PinboardAndSearch;
         recall=Recalls.GetRecallProphyOrPerio(FamCur.ListPats[i].PatNum);//should not return null
         if(recall.DateDue<DateTime.Today) {
             DateJumpToString=DateTime.Today.ToShortDateString();//they are overdue
         }
         else {
             DateJumpToString=recall.DateDue.ToShortDateString();
         }
         SecurityLogs.MakeLogEntry(Permissions.AppointmentCreate,apt.PatNum,apt.AptDateTime.ToString());
     }
     string userMsg="";
     if(noRecalls > 0){
         userMsg+=Lan.g(this,"Family members skipped because recall disabled: ")+noRecalls.ToString();
     }
     if(alreadySched > 0) {
         if(userMsg !="") {
             userMsg+="\r\n";
         }
         userMsg+=Lan.g(this,"Family members skipped because already scheduled: ")+alreadySched.ToString();
     }
     if(AptNumsSelected.Count==0) {
         if(userMsg !="") {
             userMsg+="\r\n";
         }
         userMsg+=Lan.g(this,"There are no recall appointments to schedule.");
         MessageBox.Show(userMsg);
         return;
     }
     if(userMsg !="") {
         MessageBox.Show(userMsg);
     }
     DialogResult=DialogResult.OK;
 }