Exemple #1
0
        /**
         * \brief <b>Brief Description</b> - Program <b><i>class method</i></b> - Convert a string array into the Week information
         * \details <b>Details</b>
         *
         * This method will take a string array containing the information for the week and converts it into a Week object
         *
         * \param weekData - <b>string[]</b> - The object to log the actions to the log file
         *
         * \return none - <b>void</b> - this method returns nothing
         */
        public Week(string[] weekData)
        {
            if (weekData != null)
            {
                WeekID = (Int32.Parse(weekData[0]));
                DateTime.TryParse(weekData[1].ToString(), out StartDate);
                //StartDate = DateTime.ParseExact(weekData[1].ToString(), Scheduling.DATE_FORMAT, CultureInfo.InvariantCulture);
                AppointmentList = weekData[2].Split(DEFAULT_DELIMETER);
            }
            else
            {
                WeekID          = -1;
                StartDate       = new DateTime(0);
                AppointmentList = GetDefaultAppointmentListString().Split(DEFAULT_DELIMETER);
            }
            foreach (string appointmentID in AppointmentList)
            {
                if (appointmentID != END_CHECK)
                {
                    if (Int32.Parse(appointmentID) == -1)
                    {
                        lAppointments.Add(new Appointment());
                    }
                    else
                    {
                        Dictionary <int, Appointment> dapp = Scheduling.GetAppointmentsFromDatabase();
                        int apptID = Int32.Parse(appointmentID);
                        if (dapp.ContainsKey(apptID))
                        {
                            lAppointments.Add(dapp[apptID]);
                        }
                        else
                        {
                            lAppointments.Add(new Appointment());
                            Logging.Log("Week", "Constructor", string.Format("Schedule contains appointment with ID {0}. No associated appointment.", apptID));
                        }
                    }
                }
            }

            if (AppointmentList[TOTAL_TIME_SLOTS] == END_CHECK)
            {
                int currentIndex = 0;
                foreach (DayOfWeek dayOfWeek in Enum.GetValues(typeof(DayOfWeek)))
                {
                    int numTimeSlots = WEEKDAY_TIME_SLOTS;
                    if (dayOfWeek == DayOfWeek.Sunday || dayOfWeek == DayOfWeek.Saturday)
                    {
                        numTimeSlots = WEEKEND_TIME_SLOTS;
                    }
                    dDays.Add(dayOfWeek, new Day(dayOfWeek, lAppointments.GetRange(currentIndex, numTimeSlots), WeekID));
                    currentIndex += numTimeSlots;
                }
            }
            else
            {
                Logging.Log("Week", "Constructor", AppointmentList);
            }
        }
Exemple #2
0
 /**
  * \brief <b>Brief Description</b> - Billing<b> <i>class method</i></b> - This adds a recall flag to an appointment
  * \details <b>Details</b>
  *
  * This will allow the user to add a recall flag to an appointment that will show in the appointment requiring the patient
  * to return for another for another appointment. This will generally be used by the physician directly following an appointment
  * to ensure the patient will be seen again. This method will set the RecallFlag field from the Appointment.cs
  *
  * \param obj - <b>Scheduling</b> - The obj passed in to use for the UpdateAppointmentInfo method.
  * \param appointmentID - <b>int</b> - This is the appointment ID.
  * \param recallFlag - <b>int</b> - This is the Recall Flag
  *
  *
  * \return none - <b>void</b> - this method returns nothing
  *
  * <exception cref="ArgumentException">Thrown trying to update the flag of a billing code / appointmentBillingRecord with an ID not in the dictionary. Try/Catch block, make no change on error.</exception>
  * * <exception cref="Exception">Thrown trying to use Scheduling class method to update the flag of a billing code. Try/Catch block, make no change on error.</exception>
  */
 public bool FlagAppointment(Scheduling obj, int appointmentID, int recallFlag)
 {
     try
     {
         Logging.Log("Billing", "AddNewRecord", ("Flagged appointment for reccall Appointment ID: " + appointmentID + " Recall Flag: " + recallFlag));
         return(obj.UpdateAppointmentInfo(appointmentID, recallFlag));
     }
     catch (Exception e)
     {
         Logging.Log(e, "Billing", "FlagAppointment", "FAILED FLAGGING APPOINTMENT-EXCEPTION HIT");
         return(false);
     }
 }
Exemple #3
0
        /**
         * \brief <b>Brief Description</b> - Billing<b> <i>class method</i></b> - This will generate a monthly billing file
         * \details <b>Details</b>
         *
         * This will generate a monthly billing by searching throuhg the applications data file. The file will be used by the
         * Ministry of Health to provide payment to the clinic. The method will read all appointments and patient information gathering
         * the appropriate billing code from the data file. The process will  be able to look up and apply a fee from the fee schedule file
         *  provided by the Ministry of Health against all billable encounters. The output file will be in CSV format.
         *
         * \return none - <b>void</b> - this method returns nothing
         *
         */
        public bool GenerateMonthlyBillingFile(Scheduling schedule, Demographics demo, int year, int month)
        {
            List <string> billingFileInfo = new List <string>();
            string        tmp;
            Patient       patient;

            try
            {
                foreach (Appointment a in schedule.GetAppointmentsByMonth(new DateTime(year, month, 1)))
                {
                    foreach (ApptBillRecord abr in appointmentBillingRecords)
                    {
                        if (a.AppointmentID.ToString() == abr.AppointmentID)
                        {
                            patient = demo.GetPatientByID(Int32.Parse(abr.PatientID));
                            if (patient.ResponseCode != "PUNKO")
                            {
                                tmp  = schedule.GetDateByAppointmentID(a.AppointmentID).ToString("yyyyMMdd");
                                tmp += patient.HCN;
                                tmp += patient.Sex;
                                tmp += abr.BillingCode;
                                tmp += (allBillingCodes[abr.BillingCode].Cost * 10000).ToString("00000000000");

                                billingFileInfo.Add(tmp);
                            }
                        }
                    }
                }

                if (FileIO.SaveToFile(string.Format(@"Reports/{0}{1}MonthlyBillingFile", year, month), billingFileInfo))
                {
                    Logging.Log("Billing", "GenerateMonthlyBillingFile", ("Generated Monthly Billing File for YEAR: " + year + " and Month: " + month));
                    return(true);
                }
                else
                {
                    Logging.Log("Billing", "GenerateMonthlyBillingFile", "FAILED GENERATING MONTHLY BILLING FILE");
                    return(false);
                }
            }
            catch (Exception e)
            {
                Logging.Log(e, "Billing", "GenerateMonthlyBillingFile", "FAILED GENERATING MONTHLY BILLING FILE-EXCEPTION HIT");
                return(false);
            }
        }