/// <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); } } }