public PatientMV openPatientCreate(int id = 0, PatientMV model = null) { LookupBussiness look = new LookupBussiness(); if (model == null) { model = new PatientMV(); } if (id != 0 && model != null) { var _class = clinic.PatientTBLs.Find(id); model.areaname = _class.AreaTBL.AreaName; model.Areaid = _class.Areaid; model.cityname = _class.CityTBL.CityName; model.cityid = _class.cityid; model.Arealist = look.fillarea(model.cityid); } model.citylist = look.fillcity(); return(model); }
// GET: Patient/Edit/5 public ActionResult Edit(int id) { PatientMV resulltpatient = patient.Selectpatient(id); resulltpatient = patient.openPatientCreate(id, resulltpatient); return(View(resulltpatient)); }
public void InsertData(DBConn conn, PatientMV p) { if (conn == null || p == null) { return; } repository = new PatientRepository(conn); repository.Initialize(p); }
public ResponseMV Validatepatient(PatientMV viewmodel) { ResponseMV result = new ResponseMV(); if (string.IsNullOrEmpty(viewmodel.PatientName)) { result.ErrorMessages.Add("PatientName", "not found name"); } if (string.IsNullOrEmpty(viewmodel.SerialPatient)) { result.ErrorMessages.Add("SerialPatient", "not found name"); } result.IsValid = result.ErrorMessages.Count == 0 ? true : false; return(result); }
public ActionResult Editpatient(PatientMV newpatient) { ResponseMV result = patient.editepatient(newpatient); if (result.IsValid == true) { TempData["ModelName"] = "sucess edite " + newpatient.PatientName; return(RedirectToAction("Index")); } else { foreach (var item in result.ErrorMessages) { ModelState.AddModelError(item.Key, item.Value); } newpatient = patient.openPatientCreate(newpatient.PatientId, newpatient); return(View("Edit", newpatient)); } }
public ResponseMV createnewpatient(PatientMV patient) { ResponseMV result = Validatepatient(patient); if (result.IsValid == true) { PatientTBL patienttemp = new PatientTBL(); patienttemp.PatientId = patient.PatientId; patienttemp.SerialPatient = patient.SerialPatient; patienttemp.PatientName = patient.PatientName; patienttemp.Phone = patient.Phone; patienttemp.cityid = patient.cityid; patienttemp.Areaid = patient.Areaid; patienttemp.Age = patient.Age; clinic.PatientTBLs.Add(patienttemp); clinic.SaveChanges(); } return(result); }
public ResponseMV editepatient(PatientMV patient) { ResponseMV result = Validatepatient(patient); if (result.IsValid == true) { var patienttemp = clinic.PatientTBLs.Where(c => c.PatientId == patient.PatientId).FirstOrDefault(); patienttemp.PatientId = patient.PatientId; patienttemp.SerialPatient = patient.SerialPatient; patienttemp.PatientName = patient.PatientName; patienttemp.Phone = patient.Phone; patienttemp.cityid = patient.cityid; patienttemp.Areaid = patient.Areaid; patienttemp.Age = patient.Age; clinic.SaveChanges(); } return(result); }
//private readonly string _pathToFont = Path.Combine( AppDomain.CurrentDomain.BaseDirectory , "ARIALUNI.TTF"); public PdfCreator(PatientMV patient, DBConn conn) { if (conn == null) { return; } dB = conn; _patient = patient; //repository = new PatientRepository(dB); //Task task = new Task(()=> //{ // repository.Initialize(patient); //}); //task.Start(); string date = _patient.Patient.ResearchDateTime.ToString().Replace(" ", "_").Replace(":", "_"); _patientName = string.IsNullOrWhiteSpace(_patient.Patient.FIO) ? date : $"{_patient.Patient.FIO}_{date}"; CreateFolder(); }
public ActionResult Createnewpatient(PatientMV newpatient) { int f = (int)newpatient.ActionsList; newpatient.SerialPatient = newpatient.PatientName.Substring(0, 3) + newpatient.Phone.ToString(); ResponseMV result = patient.createnewpatient(newpatient); if (result.IsValid == true) { TempData["ModelName"] = "sucess save " + newpatient.PatientName; return(RedirectToAction("Index")); } else { foreach (var item in result.ErrorMessages) { ModelState.AddModelError(item.Key, item.Value); } newpatient = patient.openPatientCreate(model: newpatient); return(View("Create", newpatient)); } }
public WordCreator(PatientMV pp, DBConn conn) { if (pp == null || conn == null) { return; } dB = conn; _patient = pp; _defaultIndex = new DefaultIndex { Height = _patient.Patient.Height, Weight = _patient.Patient.Weigth, LastDiastolSizeLeftStomach = _patient.PatienValue?.LastDiastolSizeLeftStomach, ThicknessLowerWallLeftStomach = _patient.PatienValue?.ThicknessLowerWallLeftStomach, Arise = _patient.Aorta?.Arise, //LastVolumeLJRSF = _patient.RightStomachFunction?.LastVolumeLJ, ThicknessMejPereMJP = _patient.PatienValue?.ThicknessMejPereMJP, KDO = _patient.RightStomachFunction?.LastVolumeLJ, LP = _patient.PatienValue?.LeftAtrium, Volume = _patient.RightStomachFunctionAddition?.MaxValomeLeftAtrium, AverageGradientAortValue = _patient.RightStomachFunction?.AverageGradientAortValue, AverageGradientPressureTrucuspidil = _patient.RightStomachFunction?.AverageGradientPressureTrucuspidil, AverageGradientMitralValve = _patient.LeftStomachFunction?.AverageGradientMitralValve, MaxGradientAortValue = _patient.RightStomachFunction?.MaxGradientAortValue, MaxGradientTricuspidil = _patient.RightStomachFunction?.MaxGradientTricuspidil, MaxGradientLeftStomach = _patient.RightStomachFunction?.MaxGradientLeftStomach, MaxGradientMitralValve = _patient.LeftStomachFunction?.MaxGradientMitralValve, MaxGradientPressurePulmonaryArtery = _patient.PatienValue?.MaxGradientPressurePulmonaryArtery, RightAtriumVolume = _patient.RightStomachFunctionAddition?.MaxValomeRightAtrium }; _patient.LeftStomachMV = new LeftStomachMV { LastDiastolSizeLeftStomach = _patient.PatienValue?.LastDiastolSizeLeftStomach, LastSislotSizeLeftStomach = _patient.PatienValue?.LastSislotSizeLeftStomach, RelativeThicknessLeftStomach = _patient.PatienValue?.RelativeThicknessLeftStomach, ThicknessLowerWallLeftStomach = _patient.PatienValue?.ThicknessLowerWallLeftStomach, ThicknessMejPereMJP = _patient.PatienValue?.ThicknessMejPereMJP, ThicknessSegment = _patient.PatienValue?.ThicknessSegment, MovementMJP = _patient.PatienValue?.MovementMJP, FractionAcceleration = _patient.PatienValue?.FractionAcceleration, FVRSF = _patient.RightStomachFunction?.FV, LastVolumeLJ = _patient.RightStomachFunction?.LastVolumeLJ, INS = _patient.PatienValue?.INS, UOK = _patient.RightStomachFunction?.UOK }; _patient.Dopper = new Dopper { Aortha = _patient.RightStomachFunction?.VelocityAortValve, LeaveTract = _patient.RightStomachFunction?.VelocityLeftStomach, MitralValve = _patient.LeftStomachFunction?.PickE, TricValve = _patient.RightStomachFunction?.PickE, ValveLight = _patient.PatienValue?.VelocityVavlvePulmonaryArtery }; _patient.LightValve = new LightValve { MaxGradientTricuspidil = _patient.RightStomach?.MaxGradientTricuspidil, PressurePP = _patient.RightStomach?.PressurePP, SistolPressureLA = _patient.RightStomach?.SistolPressureLA }; _patient.DiametrNpv = new DiametrNpv { CollNPV = _patient.RightStomach?.SelectedColl, WidthNPV = _patient.RightStomach?.Width }; _patient.LeftAtrium = new LeftAtrium { LP = _patient.PatienValue?.LeftAtrium, Volume = _patient.RightStomachFunctionAddition?.MaxValomeLeftAtrium }; _patient.RightAtrium = new RightAtrium { RightAtriumVolume = _patient.RightStomachFunctionAddition?.MaxValomeRightAtrium }; _patient.CommentaryMV = new CommentaryMV { Commentary = _patient.Patient?.Commentary }; _defaultIndex.Initialize(); _patient.LeftStomachMV.WeightMokardLj = _defaultIndex.indexes["Mass"]; date = _patient.Patient.ResearchDateTime.ToString().Replace(" ", "_").Replace(":", "_"); _patientName = string.IsNullOrWhiteSpace(_patient.Patient.FIO) ? date : $"{_patient.Patient.FIO}_{date}"; var gender = _patient.Patient.Jender == "Ж" ? Gender.Female : Gender.Male; normaStorage = new NormaStorage(gender, pp.Patient.ChildAgeCode); CreateFolder(); }
// GET: Patient/Create public ActionResult Create() { PatientMV patientopen = patient.openPatientCreate(); return(View(patientopen)); }