// GET: HealthRecord/Create public IActionResult Create(int Id) { PatientHealthRecord phr = new PatientHealthRecord(); phr.DoctorEmployeeId = int.Parse(User.Identity.Name); phr.HospitalId = 1; phr.PatientId = Id; _context.PatientHealthRecord.Add(phr); _context.SaveChanges(); ViewBag.PatientId = Id; ViewBag.HealthRecordId = phr.HealthRecordId; //ViewData["DoctorEmployeeId"] = new SelectList(_context.Employee, "EmployeeId", "JoinDate"); //ViewData["HospitalId"] = new SelectList(_context.Hospital, "HospitalId", "Address"); //ViewData["PatientId"] = new SelectList(_context.Patient, "PatientId", "RegDate"); return(View("Details", phr)); }
public String test() { PatientHealthRecord phr = context.PatientHealthRecord.FirstOrDefault(); //PatientPrescription p = new PatientPrescription(); //p.MedicineName = "MedicineName1"; //p.Quantity = "Quantity1"; //p.UsageDirections = "UsageDirections1"; //phr.PatientPrescription.Add(p); //PatientPrescription p2 = new PatientPrescription(); //p2.MedicineName = "MedicineName2"; //p2.Quantity = "Quantity2"; //p2.UsageDirections = "UsageDirections2"; //phr.PatientPrescription.Add(p); //phr.PatientPrescription.Add(p2); String phrJson = JsonConvert.SerializeObject(phr); return(phrJson); }