public ActionResult SearchPatient() { OpdMedicalRecordModel model = new OpdMedicalRecordModel(); model.OpdMedicalRecordListViewModelList = mrpro.GetInsertedMedicalRecordList(); return(View(model)); }
public int AddmoreCommonTest(OpdMedicalRecordModel model) { int i = 0; EHMSEntities ent = new EHMSEntities(); OpdMedicalRecordModel obj = new OpdMedicalRecordModel(); obj.CommonTestModel = new OpdMedicalRecordCommonTestModel(); var objToCommonCase = AutoMapper.Mapper.Map <OpdMedicalRecordCommonTestModel, OpdMedicalRecordCommonTest>(obj.CommonTestModel); foreach (var item in model.PatientCommonTestList) { objToCommonCase.OpdMedicalRecordMastetId = model.OpdMedicalRecordMastetId; objToCommonCase.PatientID = model.PatientId; objToCommonCase.ShortDesc = item.ShortDesc; objToCommonCase.Details = item.Details; objToCommonCase.CreatedBy = Utility.GetCurrentLoginUserId(); objToCommonCase.CreatedDate = DateTime.Now; objToCommonCase.InsertedDate = DateTime.Now; objToCommonCase.Status = true; ent.OpdMedicalRecordCommonTests.Add(objToCommonCase); i = ent.SaveChanges(); } return(i); }
public int AddMoreMedicicalDoes(OpdMedicalRecordModel model) { int i = 0; EHMSEntities ent = new EHMSEntities(); model.MedicineReferModel = new OpdMedicalRecordMedicineReferModel(); var objToMedicineDoses = AutoMapper.Mapper.Map <OpdMedicalRecordMedicineReferModel, OpdMedicalRecordMedicineRefer>(model.MedicineReferModel); foreach (var item in model.PatientMedicineDosesList) { objToMedicineDoses.OpdMedicalRecordMastetId = model.OpdMedicalRecordMastetId; objToMedicineDoses.PatientId = model.PatientId; objToMedicineDoses.MedicineName = item.MedicineName; objToMedicineDoses.Doses = item.Doses; objToMedicineDoses.DosesDay = item.DosesDay; objToMedicineDoses.DosesTime = item.DosesTime; objToMedicineDoses.CreatedDate = DateTime.Now; objToMedicineDoses.CreatedBy = Utility.GetCurrentLoginUserId(); objToMedicineDoses.Status = true; ent.OpdMedicalRecordMedicineRefers.Add(objToMedicineDoses); i = ent.SaveChanges(); } return(i); }
public ActionResult WriteRecord(int id, DateTime date) { OpdMedicalRecordModel model = new OpdMedicalRecordModel(); model.refOfVitalForOthersModel = new VitalForOthersModel(); model.refOfVitalForOthersModel.OpdId = id; using (EHMSEntities ent = new EHMSEntities()) { int patientlogid = Utility.GetoldPatientLogid(id); var VitalData = ent.VitalForOthers.Where(x => x.OpdId == id && x.PatinetLogId == patientlogid).FirstOrDefault(); var datainmodel = AutoMapper.Mapper.Map <VitalForOther, VitalForOthersModel>(VitalData); model.refOfVitalForOthersModel = datainmodel; } model.todayList = mrpro.GetlistByPatientId(id, date); model.TodayListViewModel = mrpro.GetlistByPatientId(id, date).FirstOrDefault(); model.PatientDoctorDetailID = (int)model.TodayListViewModel.PatientDoctorId; int?DepatId = model.TodayListViewModel.DepartmentId; return(View(model)); }
public ActionResult OpdMedicalReportPrint(int id, int docid, int deptid, int patientlogid, int opdMedMasid) { OpdMedicalRecordModel obj = new OpdMedicalRecordModel(); using (EHMSEntities ent = new EHMSEntities()) { // int patientlogid = Utility.GetoldPatientLogid(id); var VitalData = ent.VitalForOthers.Where(x => x.OpdId == id && x.PatinetLogId == patientlogid).FirstOrDefault(); var datainmodel = AutoMapper.Mapper.Map <VitalForOther, VitalForOthersModel>(VitalData); obj.refOfVitalForOthersModel = datainmodel; // int MedicalReportMasterId = Utility.GetOpdMedicalReportMasterId(id, docid, deptid); obj.PatientLogId = patientlogid; obj.PatientId = id; obj.DoctorId = docid; obj.DepartmentId = deptid; obj.OpdMedicalRecordMastetId = opdMedMasid; obj.CurrentCase = ent.OpdMedicalRecordMasters.Where(x => x.OpdMedicalRecordMastetId == opdMedMasid).Select(x => x.CurrentCase).FirstOrDefault(); obj.PreviousCase = ent.OpdMedicalRecordMasters.Where(x => x.OpdMedicalRecordMastetId == opdMedMasid).Select(x => x.PreviousCase).FirstOrDefault(); obj.ProvisionalDiagnosis = ent.OpdMedicalRecordMasters.Where(x => x.OpdMedicalRecordMastetId == opdMedMasid).Select(x => x.ProvisionalDiagnosis).FirstOrDefault(); // var obj =ent.OpdMedicalRecordFurtherTest.Where(x => x.OpdMedicalRecordMastetId == MedicalReportMasterId && x.PatientId == id).ToList(); obj.PatientFurtherTestList = new List <OpdMedicalRecordFurtherTestModel>(AutoMapper.Mapper.Map <IEnumerable <OpdMedicalRecordFurtherTest>, IEnumerable <OpdMedicalRecordFurtherTestModel> >(ent.OpdMedicalRecordFurtherTests.Where(x => x.OpdMedicalRecordMastetId == opdMedMasid && x.PatientId == id).ToList())); obj.PatientCommonTestList = new List <OpdMedicalRecordCommonTestModel>(AutoMapper.Mapper.Map <IEnumerable <OpdMedicalRecordCommonTest>, IEnumerable <OpdMedicalRecordCommonTestModel> >(ent.OpdMedicalRecordCommonTests.Where(x => x.OpdMedicalRecordMastetId == opdMedMasid && x.PatientID == id).ToList())); obj.PatientMedicineDosesList = new List <OpdMedicalRecordMedicineReferModel>(AutoMapper.Mapper.Map <IEnumerable <OpdMedicalRecordMedicineRefer>, IEnumerable <OpdMedicalRecordMedicineReferModel> >(ent.OpdMedicalRecordMedicineRefers.Where(x => x.OpdMedicalRecordMastetId == opdMedMasid && x.PatientId == id).ToList())); } return(View(obj)); }
public ActionResult ViewDetails(int id) { OpdMedicalRecordModel model = new OpdMedicalRecordModel(); model = mrpro.GetPatientMedicalRecordList().Where(x => x.OpdMedicalRecordMastetId == id).FirstOrDefault(); model.PatientCommonTestList = mrpro.GetPatientCommonTestById(id); model.PatientFurtherTestList = mrpro.GetPatientFurtherTestById(id); model.PatientMedicineDosesList = mrpro.GetPatientMedicineReferById(id); return(View(model)); }
public ActionResult GetDataFormForCommonTest(OpdMedicalRecordModel model) { OpdMedicalRecordsProviders pro = new OpdMedicalRecordsProviders(); int i = pro.AddmoreCommonTest(model); if (i != 0) { return(RedirectToAction("ViewOpdMedicalRecord", new { id = model.PatientId, docid = model.DoctorId, deptid = model.DepartmentId, patientLogId = model.PatientLogId, OpdmedRecmasid = model.OpdMedicalRecordMastetId })); } return(View()); }
public ActionResult WriteRecord(OpdMedicalRecordModel model) { //foreach (var item in ModelState) //{ //} // if (ModelState.IsValid) // { mrpro.Insert(model); // } return(RedirectToAction("Index")); }
public ActionResult FormForMedicineRecords(int Deptid, int patientid, int docid, int masterid) { var omrm = new OpdMedicalRecordModel(); omrm.PatientId = patientid; omrm.DepartmentId = Deptid; omrm.DoctorId = docid; omrm.OpdMedicalRecordMastetId = masterid; using (EHMSEntities ent = new EHMSEntities()) { var data = ent.OpdMedicalRecordMasters.Where(x => x.OpdMedicalRecordMastetId == masterid).FirstOrDefault(); omrm.PatientLogId = Convert.ToInt32(data.PatientLogId); } omrm.PatientMedicineDosesList.Insert(0, new OpdMedicalRecordMedicineReferModel()); return(PartialView(omrm)); }
public int AddmoreFurtherTestFormView(OpdMedicalRecordModel model) { int i = 0; EHMSEntities ent = new EHMSEntities(); model.FurtherTestModel = new OpdMedicalRecordFurtherTestModel(); var objToFurtherTest = AutoMapper.Mapper.Map <OpdMedicalRecordFurtherTestModel, OpdMedicalRecordFurtherTest>(model.FurtherTestModel); foreach (var item in model.PatientFurtherTestList) { objToFurtherTest.OpdMedicalRecordMastetId = model.OpdMedicalRecordMastetId; objToFurtherTest.PatientId = model.PatientId; objToFurtherTest.TestName = item.TestName; objToFurtherTest.CreatedDate = DateTime.Now; objToFurtherTest.CreatedBy = Utility.GetCurrentLoginUserId(); objToFurtherTest.Status = true; ent.OpdMedicalRecordFurtherTests.Add(objToFurtherTest); i = ent.SaveChanges(); } return(i); }
public int Insert(OpdMedicalRecordModel model) { int i = 0; //for furthertestName, get the name furthetest from FurtherTestModel string furtherTestNameFromModel = model.FurtherTestModel.TestName; //for medicineName,get the name of medicine name from MedicineReferModel string medicineName = model.MedicineReferModel.MedicineName; string does = model.MedicineReferModel.Doses; string doestimes = model.MedicineReferModel.DosesTime; string doesday = model.MedicineReferModel.DosesDay; using (EHMSEntities ent = new EHMSEntities()) { var objTosaveMR = AutoMapper.Mapper.Map <OpdMedicalRecordModel, OpdMedicalRecordMaster>(model); objTosaveMR.CreatedBy = Utility.GetCurrentLoginUserId(); objTosaveMR.CreatedDate = DateTime.Now; objTosaveMR.Status = true; objTosaveMR.DepartmentId = (int)model.TodayListViewModel.DepartmentId; objTosaveMR.DoctorId = (int)model.TodayListViewModel.DoctorId; objTosaveMR.PatientId = (int)model.TodayListViewModel.PatinetId; objTosaveMR.VisitedDate = DateTime.Today; objTosaveMR.Status = true; objTosaveMR.PatientLogId = Utility.patientlogid(model.refOfVitalForOthersModel.OpdId); ent.OpdMedicalRecordMasters.Add(objTosaveMR); //common test from CommonTestModel(this is a reference of OpdMedicalRecordCommonTestModel) var objtoCommonTest = AutoMapper.Mapper.Map <OpdMedicalRecordCommonTestModel, OpdMedicalRecordCommonTest>(model.CommonTestModel); objtoCommonTest.OpdMedicalRecordMastetId = objTosaveMR.OpdMedicalRecordMastetId; //objToCommonCase.PatientID = model.PatientId; objtoCommonTest.PatientID = model.TodayListViewModel.PatinetId; objtoCommonTest.CreatedBy = Utility.GetCurrentLoginUserId(); objtoCommonTest.CreatedDate = DateTime.Now; objtoCommonTest.InsertedDate = DateTime.Now; objtoCommonTest.ShortDesc = model.CommonTestModel.ShortDesc; objtoCommonTest.Details = model.CommonTestModel.Details; objtoCommonTest.Status = true; ent.OpdMedicalRecordCommonTests.Add(objtoCommonTest); //common test from PatientCommontestList foreach (var item in model.PatientCommonTestList) { model.CommonTestModel = new OpdMedicalRecordCommonTestModel(); var objToCommonCase = AutoMapper.Mapper.Map <OpdMedicalRecordCommonTestModel, OpdMedicalRecordCommonTest>(model.CommonTestModel); objToCommonCase.OpdMedicalRecordMastetId = objTosaveMR.OpdMedicalRecordMastetId; //objToCommonCase.PatientID = model.PatientId; objToCommonCase.PatientID = model.TodayListViewModel.PatinetId; objToCommonCase.CreatedBy = Utility.GetCurrentLoginUserId(); objToCommonCase.CreatedDate = DateTime.Now; objToCommonCase.InsertedDate = DateTime.Now; objToCommonCase.ShortDesc = item.ShortDesc; objToCommonCase.Details = item.Details; objToCommonCase.Status = true; ent.OpdMedicalRecordCommonTests.Add(objToCommonCase); } //further test from FurtherTestModel model.FurtherTestModel = new OpdMedicalRecordFurtherTestModel(); var objToFurtherTestForFurtherTestModel = AutoMapper.Mapper.Map <OpdMedicalRecordFurtherTestModel, OpdMedicalRecordFurtherTest>(model.FurtherTestModel); objToFurtherTestForFurtherTestModel.OpdMedicalRecordMastetId = objTosaveMR.OpdMedicalRecordMastetId; objToFurtherTestForFurtherTestModel.PatientId = (int)model.TodayListViewModel.PatinetId; objToFurtherTestForFurtherTestModel.TestName = furtherTestNameFromModel; objToFurtherTestForFurtherTestModel.CreatedBy = Utility.GetCurrentLoginUserId(); objToFurtherTestForFurtherTestModel.CreatedDate = DateTime.Now; objToFurtherTestForFurtherTestModel.Status = true; ent.OpdMedicalRecordFurtherTests.Add(objToFurtherTestForFurtherTestModel); //further test from Further test list foreach (var item in model.PatientFurtherTestList) { model.FurtherTestModel = new OpdMedicalRecordFurtherTestModel(); var objToFurtherTest = AutoMapper.Mapper.Map <OpdMedicalRecordFurtherTestModel, OpdMedicalRecordFurtherTest>(model.FurtherTestModel); objToFurtherTest.OpdMedicalRecordMastetId = objTosaveMR.OpdMedicalRecordMastetId; objToFurtherTest.PatientId = (int)model.TodayListViewModel.PatinetId; objToFurtherTest.TestName = item.TestName; objToFurtherTest.CreatedBy = Utility.GetCurrentLoginUserId(); objToFurtherTest.CreatedDate = DateTime.Now; objToFurtherTest.Status = true; ent.OpdMedicalRecordFurtherTests.Add(objToFurtherTest); } //medicine doses from MedicineReferenceModel model.MedicineReferModel = new OpdMedicalRecordMedicineReferModel(); var objToMDForMedicineReferenceModel = AutoMapper.Mapper.Map <OpdMedicalRecordMedicineReferModel, OpdMedicalRecordMedicineRefer>(model.MedicineReferModel); objToMDForMedicineReferenceModel.OpdMedicalRecordMastetId = objTosaveMR.OpdMedicalRecordMastetId; objToMDForMedicineReferenceModel.PatientId = (int)model.TodayListViewModel.PatinetId; objToMDForMedicineReferenceModel.MedicineName = medicineName; objToMDForMedicineReferenceModel.Doses = does; objToMDForMedicineReferenceModel.DosesDay = doesday; objToMDForMedicineReferenceModel.DosesTime = doestimes; objToMDForMedicineReferenceModel.CreatedBy = Utility.GetCurrentLoginUserId(); objToMDForMedicineReferenceModel.CreatedDate = DateTime.Now; objToMDForMedicineReferenceModel.Status = true; ent.OpdMedicalRecordMedicineRefers.Add(objToMDForMedicineReferenceModel); //medicine doses from model.PatientMedicieDoessList foreach (var item in model.PatientMedicineDosesList) { model.MedicineReferModel = new OpdMedicalRecordMedicineReferModel(); var objToMedicineDoses = AutoMapper.Mapper.Map <OpdMedicalRecordMedicineReferModel, OpdMedicalRecordMedicineRefer>(model.MedicineReferModel); objToMedicineDoses.OpdMedicalRecordMastetId = objTosaveMR.OpdMedicalRecordMastetId; objToMedicineDoses.PatientId = (int)model.TodayListViewModel.PatinetId; objToMedicineDoses.MedicineName = item.MedicineName; objToMedicineDoses.Doses = item.Doses; objToMedicineDoses.DosesDay = item.DosesDay; objToMedicineDoses.DosesTime = item.DosesTime; objToMedicineDoses.CreatedBy = Utility.GetCurrentLoginUserId(); objToMedicineDoses.CreatedDate = DateTime.Now; objToMedicineDoses.Status = true; ent.OpdMedicalRecordMedicineRefers.Add(objToMedicineDoses); } i = ent.SaveChanges(); } return(i); }