Ejemplo n.º 1
0
        ///<summary>Creats a new appointment for the given patient.  A valid patient must be passed in.
        ///Set useApptDrawingSettings to true if the user double clicked on the appointment schedule in order to make a new appointment.
        ///It will utilize the global static properties to help set required fields for "Scheduled" appointments.
        ///Otherwise, simply sets the corresponding PatNum and then the status to "Unscheduled".</summary>
        public static Appointment MakeNewAppointment(Patient PatCur, bool useApptDrawingSettings)
        {
            DateTime d;
            //Appointments.MakeNewAppointment may or may not use apptDateTime depending on useApptDrawingSettings,
            //however it's safer to just pass in the appropriate datetime verses DateTime.MinVal.
            DateTime apptDateTime;

            if (ApptDrawing.IsWeeklyView)
            {
                d = ContrAppt.WeekStartDate.AddDays(ContrAppt.SheetClickedonDay);
            }
            else
            {
                d = AppointmentL.DateSelected;
            }
            int minutes = (int)(ContrAppt.SheetClickedonMin / ApptDrawing.MinPerIncr) * ApptDrawing.MinPerIncr;

            apptDateTime = new DateTime(d.Year, d.Month, d.Day
                                        , ContrAppt.SheetClickedonHour, minutes, 0);
            //Make the appointment in memory
            Appointment apptCur = Appointments.MakeNewAppointment(PatCur, apptDateTime, ContrAppt.SheetClickedonOp, useApptDrawingSettings);

            if (PatCur.AskToArriveEarly > 0 && useApptDrawingSettings)
            {
                MessageBox.Show(Lan.g("FormApptsOther", "Ask patient to arrive") + " " + PatCur.AskToArriveEarly
                                + " " + Lan.g("FormApptsOther", "minutes early at") + " " + apptCur.DateTimeAskedToArrive.ToShortTimeString() + ".");
            }
            return(apptCur);
        }
Ejemplo n.º 2
0
        ///<summary>Creats a new appointment for the given patient.  A valid patient must be passed in.
        ///Set useApptDrawingSettings to true if the user double clicked on the appointment schedule in order to make a new appointment.
        ///It will utilize the global static properties to help set required fields for "Scheduled" appointments.
        ///Otherwise, simply sets the corresponding PatNum and then the status to "Unscheduled".</summary>
        public static Appointment MakeNewAppointment(Patient PatCur, bool useApptDrawingSettings, DateTime?dateTNew = null, long?opNumNew = null)
        {
            //Appointments.MakeNewAppointment may or may not use apptDateTime depending on useApptDrawingSettings,
            //however it's safer to just pass in the appropriate datetime verses DateTime.MinVal.
            DateTime apptDateTime = DateTime.MinValue;
            long     opNum        = 0;

            apptDateTime = dateTNew.Value;
            opNum        = opNumNew.Value;
            //Make the appointment in memory
            Appointment apptCur = Appointments.MakeNewAppointment(PatCur, apptDateTime, opNum, useApptDrawingSettings);

            if (PatCur.AskToArriveEarly > 0 && useApptDrawingSettings)
            {
                MessageBox.Show(Lan.g("FormApptsOther", "Ask patient to arrive") + " " + PatCur.AskToArriveEarly
                                + " " + Lan.g("FormApptsOther", "minutes early at") + " " + apptCur.DateTimeAskedToArrive.ToShortTimeString() + ".");
            }
            return(apptCur);
        }