/// <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); }
private void UpdateMedicalRecord() { patient.MedicalRecords.Diagnosis = txtDiagnosis.Text; patient.MedicalRecords.BriefHistory = txtBriefHistory.Text; patient.MedicalRecords.PastMedicalHistory = txtPastMedicalHistory.Text; patient.MedicalRecords.Swelling = cbxSwelling.Checked; patient.MedicalRecords.Tenderness = cbxTenderness.Checked; patient.MedicalRecords.Sensation = cbxSensation.Checked; patient.MedicalRecords.SensationDetails = txtSensation.Text; medicalRecord = new clsMedicalRecord(); medicalRecord.Update(patient.PatientId, patient.MedicalRecords); }
/// <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; } }
/// <summary> /// Retrieve patients data /// </summary> private void RetrievePatient() { patients = new List <clsPatientModel>(); patientDetails = new clsPatientDetails(); dateEntry = new clsDateEntry(); medicalRecord = new clsMedicalRecord(); patients = patientDetails.Retrieve(); if (patients.Count > 0) { foreach (var item in patients) { item.DateEntry = new clsDateEntryModel(); item.MedicalRecords = new clsPatientMedicalRecordModel(); item.DateEntry = dateEntry.GetbyPatientId(item.PatientId); item.MedicalRecords = medicalRecord.GetByPatientId(item.PatientId); } } }