public async Task <IActionResult> GetPatientAppointments([FromBody] PatientAppointments patientAppointments) { var appointments = await _context.Appointments .Include(a => a.Patient) .Include(a => a.Doctor) .Where(ap => ap.AppointedAt >= patientAppointments.From && ap.AppointedAt <= patientAppointments.To) .Where(app => app.ClinicId == patientAppointments.ClinicId && app.PatientId == patientAppointments.PatientId) .ToListAsync(); return(Ok(appointments)); }
/// <summary> /// Handles the Click event of the AddCondition_Button control. Adds a new condition to the patient record using the <see cref = "OpticianDB.Forms.Dialogs.AddConditionOnPatient" /> form and if the condition is added then the record is reloaded to add the new condition. /// </summary> /// <param name = "sender">The source of the event.</param> /// <param name = "e">The <see cref = "System.EventArgs" /> instance containing the event data.</param> private void AddCondition_Button_Click(object sender, EventArgs e) { using (AddConditionOnPatient ac1 = new AddConditionOnPatient(patientId)) { ac1.ShowDialog(); if (ac1.DialogResult == DialogResult.OK) { dbb.RefreshAdaptor(); PatientAppointments pa1 = dbb.GetAppointmentById(appointmentId); conditions_List.Items.Clear(); foreach (PatientConditions patientCondition in pa1.Patients.PatientConditions) { conditions_List.Items.Add(patientCondition.Conditions.Condition); } } } }
/// <summary> /// Initializes a new instance of the <see cref = "EditAppointment" /> class. Adds a list of usernames to the opticians screen and fills out the information boxes with fields from the patients record. /// </summary> /// <param name = "appointmentId">The appointment id.</param> public EditAppointment(int appointmentId) { InitializeComponent(); Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); dbb = new DBBackEnd(); foreach (string user in dbb.UserNameList) { optician_ComboBox.Items.Add(user); } this.appointmentId = appointmentId; PatientAppointments ap1 = dbb.GetAppointmentById(appointmentId); start_DateTime.Value = ap1.StartDateTime; end_DateTime.Value = ap1.EndDateTime; remarks_Text.Text = ap1.Remarks; optician_ComboBox.SelectedItem = ap1.Users.Username; }
/// <summary> /// Handles the SelectedIndexChanged event of the Appointments_List control. Parses the selected item to get the record ID, Loads the information into the side table and enables the buttons. /// </summary> /// <param name = "sender">The source of the event.</param> /// <param name = "e">The <see cref = "System.EventArgs" /> instance containing the event data.</param> private void Appointments_ListSelectedIndexChanged(object sender, EventArgs e) { if (appointments_List.SelectedIndex == -1) { return; } string itemStr = appointments_List.SelectedItem.ToString(); string numStr = itemStr.Remove(0, 1).Split(new string[] { ":" }, StringSplitOptions.None)[0]; recId = int.Parse(numStr); PatientAppointments pa1 = dbb.GetAppointmentById(recId); startDate_Text.Text = pa1.StartDateTime.ToString(); endDate_Text.Text = pa1.EndDateTime.ToString(); remarks_Text.Text = pa1.Remarks; optician_Text.Text = pa1.Users.Username; load_Button.Enabled = true; edit_Button.Enabled = true; }
/// <summary> /// Initializes a new instance of the <see cref = "AppointmentInProgress" /> class. Sets the appointment ID globally, sets the patient information to the values from the record and adds the conditions to the list. /// </summary> /// <param name = "appointmentId">The appointment id.</param> public AppointmentInProgress(int appointmentId) { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); dbb = new DBBackEnd(); this.appointmentId = appointmentId; PatientAppointments pa1 = dbb.GetAppointmentById(appointmentId); name_Text.Text = pa1.Patients.Name; dateOfBirth_Text.Text = pa1.Patients.DateOfBirth.ToLongDateString(); nhsNumber_Text.Text = pa1.Patients.NhsnUmber; patientId = pa1.PatientID; apmtRemarks_Text.Text = pa1.Remarks; foreach (PatientConditions patientCondition in pa1.Patients.PatientConditions) { conditions_List.Items.Add(patientCondition.Conditions.Condition); } }