Exemple #1
0
        private void BookAppointment()
        {
            if (RequiredNotComplete())
            {
                return;
            }

            PatientUser patient = new PatientUser(Firstname, Middlename, Lastname, (DateTime)DOB, int.Parse(DoorNumber), Postcode);
            int         patientID;

            // Verifies if patient records existing in patient DB, if multiple records are found, below situation is handelled using
            // appropirate dialog boxes.
            string verifiedExistance = VerifyPatientDetails(patient);

            if (verifiedExistance.Equals("NoRecord"))
            {
                return;
            }
            // If multiple records are found, user is asked to input their patient ID to uniquely identify them.
            // If incorrect input format is detected i.e. non-numerical, or a patient ID not corrosponding to inputted details is entered,
            // the user is shown an alert message and redirected to partner with a receptionist for assistance.
            else if (verifiedExistance.Equals("MultipleRecords"))
            {
                Alert("Multiple Records Found.",
                      "Multple Records were found with your details. Please type in your Patient ID or speak to the receptionist for assistance with booking an appointment.");
                string inputtedID = PatientIDBox();
                if (string.IsNullOrWhiteSpace(inputtedID) || !inputtedID.All(char.IsDigit))
                {
                    Alert("Incorrect ID.", "Patient ID must be numerical. Please speak to a receptionist.");
                    return;
                }
                verifiedExistance = VerifyPatientDetails(patient, int.Parse(inputtedID));
                if (verifiedExistance.Equals("FoundRecord"))
                {
                    patientID = int.Parse(inputtedID);
                }
                else
                {
                    Alert("Could Not Find record.", "Could not find record matching details under inputted ID, please speak to a receptionist for assistance.");
                    return;
                }
            }
            else
            {
                patientID = PatientDBConverter.GetPatientID(patient);
            }

            if (PatientDBConverter.PatientHasAppointment(patientID))
            {
                Alert("Appointment Found!", "An existing appointment was found. Please cancel or check-in for your existing appointment to proceed.");
                return;
            }

            PatientDBConverter.BookEmergencyAppointment(patientID);
            Success("Appointment Booked.", "Emergency appointment has been booked. Please ask patient to be seated, the next avaliable doctor will take the session.");
            MessengerInstance.Send <string>("ReceptionistHomeView");
        }
Exemple #2
0
        public void ShowReservationView()
        {
            if (RequiredNotComplete())
            {
                return;
            }

            PatientUser patient = new PatientUser(Firstname, Middlename, Lastname, (DateTime)DOB, int.Parse(StreetNo), Postcode);
            int         patientID;

            // Verifies if patient records existing in patient DB, if multiple records are found, below situation is handelled using
            // appropirate dialog boxes.
            string verifiedExistance = VerifyPatientDetails(patient);

            if (verifiedExistance.Equals("NoRecord"))
            {
                return;
            }
            // If multiple records are found, user is asked to input their patient ID to uniquely identify them.
            // If incorrect input format is detected i.e. non-numerical, or a patient ID not corrosponding to inputted details is entered,
            // the user is shown an alert message and redirected to partner with a receptionist for assistance.
            else if (verifiedExistance.Equals("MultipleRecords"))
            {
                Alert("Multiple Records Found.",
                      "Multple Records were found with your details. Please type in your Patient ID or speak to the receptionist for assistance with booking an appointment.");
                string inputtedID = PatientIDBox();
                if (string.IsNullOrWhiteSpace(inputtedID) || !inputtedID.All(char.IsDigit))
                {
                    Alert("Incorrect ID.", "Patient ID must be numerical. Please speak to a receptionist.");
                    return;
                }
                verifiedExistance = VerifyPatientDetails(patient, int.Parse(inputtedID));
                if (verifiedExistance.Equals("FoundRecord"))
                {
                    patientID = int.Parse(inputtedID);
                }
                else
                {
                    Alert("Could Not Find record.", "Could not find record matching details under inputted ID, please speak to a receptionist for assistance.");
                    return;
                }
            }
            else
            {
                patientID = PatientDBConverter.GetPatientID(patient);
            }

            PatientDBConverter.UpdateEmail(patientID, Email);
            // Shows the booking view after patient details & desired reservation type verified
            // sends patient user details as message to view
            AppointmentTypeView   = ReservationView;
            IsBookingVisible      = true;
            BookingSubviewVisible = "Visible";
            PatientCaptureWidth   = "0";
            MessengerInstance.Send <double>(patientID);
        }