public IActionResult Create(Medication medication) { if (ModelState.IsValid) { Medication medicationAdded = _handlerMedicationRepository.AddMedication(medication); return(RedirectToAction("details", new { id = medicationAdded.Id })); } return(View()); }
public Visitation AddVisitation(int doctorId, int patientId, string reason, string notes, string medicationName, string medicationQuantity, string medicationInstructions, string treatmentPrescribed, string testPrescribed) { Visitation visitation = _visitationRepository.CreateVisitation(doctorId, patientId, DateTime.Now, reason, notes); if (medicationName != null) { Medication medication = _medicationRepository.AddMedication(visitation.VisitationId, medicationName, medicationQuantity, medicationInstructions); } if (testPrescribed != null) { Test test = _testRepository.AddTest(visitation.VisitationId, testPrescribed); } if (treatmentPrescribed != null) { Treatment treatment = _treatmentRepository.AddTreatment(visitation.VisitationId, treatmentPrescribed); } return(visitation); }