/// <summary> /// Save patient details /// </summary> private void SavePatient() { int patientId = 0; patientDetails = new clsPatientDetails(); patientId = patientDetails.Save(patient.PatientDetails); if (patientId == 0) { throw new Exception("Cannot save patient"); } dateEntry = new clsDateEntry(); dateEntry.Save(patientId, patient.DateEntry); if (patient.Appointments.Count > 0) { var selectedAppointment = patient.Appointments.First(); if (selectedAppointment.Appointment.Date != DateTime.Today.Date) { appointment = new clsAppointment(); appointment.Save(patientId, selectedAppointment.Appointment); } } medicalRecord = new clsMedicalRecord(); medicalRecord.Save(patientId, patient.MedicalRecords); assessment = new clsAssessment(); assessment.Save(patientId, patient.Assessment); prescription = new clsPrescription(); prescription.Save(patientId, patient.Prescription); }
/// <summary> /// Update event method /// </summary> private void UpdatePrescription() { patient.Prescription.Advise = txtAdvise.Text; patient.Prescription.Prescription = txtPrescription.Text; prescription = new clsPrescription(); prescription.Update(patient.PatientId, patient.Prescription); }
/// <summary> /// Navigation /// </summary> private void Navigation() { if (selectedPatient == 0) { this.Close(); } patientDetail = new clsPatientDetails(); dateEntry = new clsDateEntry(); medicalRecord = new clsMedicalRecord(); assessment = new clsAssessment(); appointment = new clsAppointment(); prescription = new clsPrescription(); patient = new clsPatientModel() { Appointments = new List <clsAppointmentModel>(), Assessment = new List <clsAssessmentModel>(), DateEntry = new clsDateEntryModel(), MedicalRecords = new clsPatientMedicalRecordModel(), PatientDetails = new clsPatientDetailsModel(), PatientId = selectedPatient, Prescription = new clsPrescriptionModel() }; switch (navigateFrom) { case NavigationType.Appointments: case NavigationType.Patients: case NavigationType.Search: patient.PatientDetails = patientDetail.GetByPatientId(selectedPatient); patient.DateEntry = dateEntry.GetbyPatientId(selectedPatient); patient.MedicalRecords = medicalRecord.GetByPatientId(selectedPatient); patient.Prescription = prescription.GetByPatientId(selectedPatient); patient.Assessment = assessment.GetByPatientId(selectedPatient); patient.Appointments = appointment.GetByPatientId(selectedPatient); break; case NavigationType.NewPatient: break; case NavigationType.RnageOfMotion: break; case NavigationType.ViewPatient: break; default: break; } }