public IActionResult PostRegistration(RegistrationNewViewModel model) { Input.Patient.Person.DoB = DateTime.ParseExact(Input.DoB, "dd/MM/yyyy", CultureInfo.InvariantCulture); Input.Patient.Save(); Input.NextOfKin.Person = Input.Patient.Person; Input.NextOfKin.Save(); Bills bill = new Bills { Amount = Input.Billables.Amount, Patient = Input.Patient, Notes = "New Patient Visit" }; if (bill.Amount.Equals(0)) { bill.Flag = 1; } bill.Save(); BillsItems items = new BillsItems { Bill = bill, Item = Input.Billables, Amount = Input.Billables.Amount, Description = Input.Billables.Description }; items.Save(); PatientQueue queue = new PatientQueue { Patient = Input.Patient, Queue = new Queue(Input.Room), Bill = bill }; queue.Save(); return(LocalRedirect("/patient-registration/new-patient")); }
public IActionResult NewPatient(RegistrationNewViewModel model, BillingService billing) { model.Billables = billing.GetBillableServices(_Constants.INITIAL_REG_FEE); return(View(model)); }