public SelectionWorker(Route route) { var db3 = new Domains3.Entities.EiSDbContext(); this.GreenPathCategories = new System.Web.Mvc.SelectList(db3.GreenPathCategories.OrderBy(c => c.Priority), "GreenPathCategoryId", "GreenPathCategoryName", route.GreenPathCategoryId); this.InRoomWays = new System.Web.Mvc.SelectList(db3.InRoomWays.Where(c => c.IsUseForResuscitateRoom).OrderBy(c => c.Priority), "InRoomWayId", "InRoomWayName", route.InRoomWayId); this.Destinations = new System.Web.Mvc.SelectList(db3.Destinations.Where(c => c.IsUseForResuscitateRoom).OrderBy(c => c.Priority2), "DestinationId", "DestinationName", route.DestinationId); this.IsRescues = new System.Web.Mvc.SelectList( new List <System.Web.Mvc.SelectListItem> { new System.Web.Mvc.SelectListItem { Text = "是", Value = "True" }, new System.Web.Mvc.SelectListItem { Text = "否", Value = "False" } }, "Value", "Text"); this.IsLeaves = new System.Web.Mvc.SelectList( new List <System.Web.Mvc.SelectListItem> { new System.Web.Mvc.SelectListItem { Text = "是", Value = "true" }, new System.Web.Mvc.SelectListItem { Text = "否", Value = "false" } }, "Value", "Text"); }
public Details(Guid id) { var db3 = new Domains3.Entities.EiSDbContext(); var target = db3.GeneralRoomInfos.Find(id); this.Initial(target); }
private void GetData() { var db3 = new Domains3.Entities.EiSDbContext(); var room = db3.Rooms.Find(this.RoomId); this.RoomName = room.RoomName; }
public Create2(string outPatientNumber, Guid roomId, Guid?preGeneralRoomInfoId) { this.RoomId = roomId; this.PreGeneralRoomInfoId = preGeneralRoomInfoId; var db3 = new Domains3.Entities.EiSDbContext(); var room = db3.Rooms.Find(this.RoomId); this.RoomName = room.RoomName; Domains3.Entities.GeneralRoomInfo target = null; if (this.PreGeneralRoomInfoId != null) { target = db3.GeneralRoomInfos.Find(this.PreGeneralRoomInfoId); } var dbTrasen = new TrasenDbContext("TrasenConnection"); var itemKDJB = dbTrasen.YY_KDJB.Where(c => c.KH == outPatientNumber).First(); List <VI_MZ_GHXX> listGHXX; if (target == null) { listGHXX = dbTrasen.VI_MZ_GHXX.Where(c => c.BRXXID == itemKDJB.BRXXID).OrderByDescending(c => c.GHSJ).ThenBy(c => c.GHXXID).ToList(); } else { listGHXX = dbTrasen.VI_MZ_GHXX.Where(c => c.BRXXID == itemKDJB.BRXXID && c.GHSJ >= target.ReceiveTime.Value).OrderByDescending(c => c.GHSJ).ThenBy(c => c.GHXXID).ToList(); } this.ListGhxx = listGHXX.Select(c => new ItemGhxx(c, this.RoomId, this.PreGeneralRoomInfoId)).ToList(); }
public SelectionWorker(TransferRoom targetV) { var db3 = new Domains3.Entities.EiSDbContext(); var targetOld = db3.GeneralRoomInfos.Find(targetV.GeneralRoomInfoId); this.Rooms = new System.Web.Mvc.SelectList(db3.Rooms.Where(c => c.RoomId != targetOld.RoomId), "RoomId", "RoomName", targetV.RoomId); }
public Index(Route route) { var db3 = new Domains3.Entities.EiSDbContext(); var query = db3.GeneralRoomInfos.Where(c => c.Room.IsObserveRoom); if (route.InDepartmentTimeStart != null) { query = query.Where(c => route.InDepartmentTimeStart.Value <= c.InDepartmentTime); } if (route.InDepartmentTimeEnd != null) { query = query.Where(c => c.InDepartmentTime < route.InDepartmentTimeEnd); } if (route.OutDepartmentTimeStart != null) { query = query.Where(c => route.OutDepartmentTimeStart.Value <= c.OutDepartmentTime); } if (route.OutDepartmentTimeEnd != null) { query = query.Where(c => c.OutDepartmentTime < route.OutDepartmentTimeEnd); } if (route.IsLeave != null) { query = query.Where(c => c.OutDepartmentTime.HasValue == route.IsLeave); } if (!string.IsNullOrWhiteSpace(route.PatientName)) { route.PatientName = route.PatientName.Trim(); query = query.Where(c => c.PatientName == route.PatientName); } if (!string.IsNullOrWhiteSpace(route.OutPatientNumber)) { route.OutPatientNumber = route.OutPatientNumber.Trim(); query = query.Where(c => c.OutPatientNumber == route.OutPatientNumber); } if (route.InRoomWayId != null) { query = query.Where(c => c.InRoomWayId == route.InRoomWayId); } if (route.DestinationId != null) { query = query.Where(c => c.DestinationId == route.DestinationId); } route.Count = query.Count(); var queryOrdered = query.OrderByDescending(c => c.InDepartmentTime).ThenBy(c => c.GeneralRoomInfoId); var queryCurrentPage = queryOrdered.Skip((route.Page - 1) * route.PerPage).Take(route.PerPage); this.Route = route; this.List = queryCurrentPage.ToList().Select(c => new Item(c)).ToList(); }
public SelectionWorker(Edit targetV) { var db3 = new Domains3.Entities.EiSDbContext(); this.Beds = new System.Web.Mvc.SelectList(db3.Beds.Where(c => c.IsUseForObserveRoom).OrderBy(c => c.Priority), "BedId", "BedName", targetV.BedId); this.InRoomWays = new System.Web.Mvc.SelectList(db3.InRoomWays.Where(c => c.IsUseForObserveRoom).OrderBy(c => c.Priority), "InRoomWayId", "InRoomWayName", targetV.InRoomWayId); this.Destinations = new System.Web.Mvc.SelectList(db3.Destinations.Where(c => c.IsUseForObserveRoom).OrderBy(c => c.Priority2), "DestinationId", "DestinationName", targetV.DestinationId); this.DestinationFirsts = new System.Web.Mvc.SelectList(db3.Destinations.Where(c => c.IsUseForSubscription).OrderBy(c => c.Priority2), "DestinationId", "DestinationName", targetV.DestinationFirstId); this.DestinationSeconds = new System.Web.Mvc.SelectList(db3.Destinations.Where(c => c.IsUseForSubscription).OrderBy(c => c.Priority2), "DestinationId", "DestinationName", targetV.DestinationSecondId); this.TransferReasons = new System.Web.Mvc.SelectList(db3.TransferReasons, "TransferReasonId", "TransferReasonName", targetV.TransferReasonId); }
public SelectionWorker(Edit targetV) { var db3 = new Domains3.Entities.EiSDbContext(); this.Beds = new System.Web.Mvc.SelectList(db3.Beds.Where(c => c.IsUseForResuscitateRoom).OrderBy(c => c.Priority), "BedId", "BedName", targetV.BedId); this.InRoomWays = new System.Web.Mvc.SelectList(db3.InRoomWays.Where(c => c.IsUseForResuscitateRoom).OrderBy(c => c.Priority), "InRoomWayId", "InRoomWayName", targetV.InRoomWayId); this.GreenPathCategories = new System.Web.Mvc.SelectList(db3.GreenPathCategories.OrderBy(c => c.Priority), "GreenPathCategoryId", "GreenPathCategoryName", targetV.GreenPathCategoryId); this.RescueResults = new System.Web.Mvc.SelectList(db3.RescueResults.OrderBy(c => c.Priority), "RescueResultId", "RescueResultName", targetV.RescueResultId); this.Destinations = new System.Web.Mvc.SelectList(db3.Destinations.Where(c => c.IsUseForResuscitateRoom).OrderBy(c => c.Priority2), "DestinationId", "DestinationName", targetV.DestinationId); this.CriticalLevels = new System.Web.Mvc.SelectList(db3.CriticalLevels, "CriticalLevelId", "CriticalLevelName", targetV.CriticalLevelId); this.DestinationFirsts = new System.Web.Mvc.SelectList(db3.Destinations.Where(c => c.IsUseForSubscription).OrderBy(c => c.Priority2), "DestinationId", "DestinationName", targetV.DestinationFirstId); this.DestinationSeconds = new System.Web.Mvc.SelectList(db3.Destinations.Where(c => c.IsUseForSubscription).OrderBy(c => c.Priority2), "DestinationId", "DestinationName", targetV.DestinationSecondId); this.TransferReasons = new System.Web.Mvc.SelectList(db3.TransferReasons, "TransferReasonId", "TransferReasonName", targetV.TransferReasonId); }
public Domains3.Entities.GeneralRoomInfo GetReturn() { var db3 = new Domains3.Entities.EiSDbContext(); var targetOld = db3.GeneralRoomInfos.Find(this.PreGeneralRoomInfoId); var roomOld = targetOld?.Room; var target = new Domains3.Entities.GeneralRoomInfo(); target.GeneralRoomInfoId = Guid.NewGuid(); target.RoomId = this.RoomId; target.PreGeneralRoomInfoId = this.PreGeneralRoomInfoId; if (roomOld != null) { if (roomOld.IsRescueRoom) { target.InRoomWayId = new Guid("793396FB-5298-4C33-9782-0C3F39439709"); } else if (roomOld.IsObserveRoom) { target.InRoomWayId = new Guid("C41FA74D-6BF8-4A51-8FF8-3579A052C527"); } else if (roomOld.IsResuscitateRoom) { target.InRoomWayId = new Guid("F1784E85-71A0-4BBD-939D-E540F47315CE"); } } target.PatientName = this.PatientName; target.OutPatientNumber = this.OutPatientNumber; target.Sex = this.Sex; target.BirthDate = this.BirthDate; target.DiagnosisNameOrigin = this.DiagnosisNameOrigin; target.ReceiveTime = this.ReceiveTime; target.FirstDoctorName = this.FirstDoctorName; target.InDepartmentTime = this.ReceiveTime.Value.Date; target.KDJID = this.KDJID; target.BRXXID = this.BRXXID; target.GHXXID = this.GHXXID; target.JZID = this.JZID; target.UpdateTime = DateTime.Now; return(target); }
public ItemJzjl(MZYS_JZJL JZJL, Guid roomId, Guid?preGeneralRoomInfoId) { this.RoomId = roomId; this.PreGeneralRoomInfoId = preGeneralRoomInfoId; var dbTrasen = new TrasenDbContext("TrasenConnection"); this.ORIGIN_JZID = JZJL.JZID; this.FirstDoctorName = dbTrasen.JC_EMPLOYEE_PROPERTY.Where(c => c.EMPLOYEE_ID == JZJL.JSYSDM).FirstOrDefault()?.NAME; this.DiagnosisNameOrigin = JZJL.ZDMC; this.ReceiveTime = JZJL.JSSJ; var db3 = new Domains3.Entities.EiSDbContext(); this.ExistRoomName = db3.GeneralRoomInfos.FirstOrDefault(c => c.JZID == JZJL.JZID)?.Room.RoomName; }
public Header(Guid id) { var db3 = new Domains3.Entities.EiSDbContext(); var target = db3.GeneralRoomInfos.Find(id); if (target == null) { throw new ArgumentException("id Not Exist.", "id"); } this.PatientName = target.PatientName; this.OutPatientNumber = target.OutPatientNumber; this.Sex = target.Sex; this.ReceiveAgeName = target.ReceiveAgeName; this.DiagnosisNameOrigin = target.DiagnosisNameOrigin; this.ReceiveTime = target.ReceiveTime; this.FirstDoctorName = target.FirstDoctorName; }
public RelatedIndex(Guid id) { var db3 = new Domains3.Entities.EiSDbContext(); var target = db3.GeneralRoomInfos.Find(id); if (target == null) { throw new ArgumentException("ID不存在", "id", null); } this.List = new List <Item>(); Domains3.Entities.GeneralRoomInfo targetTemp; //前 targetTemp = target.PreGeneralRoomInfo; while (targetTemp != null) { this.List.Add(new Item(targetTemp, false)); targetTemp = targetTemp.PreGeneralRoomInfo; } //当 this.List.Add(new Item(target, true)); //后 targetTemp = target; do { targetTemp = db3.GeneralRoomInfos.FirstOrDefault(c => c.PreGeneralRoomInfoId == targetTemp.GeneralRoomInfoId); if (targetTemp != null) { this.List.Add(new Item(targetTemp, false)); } else { break; } } while (true); this.List = this.List.OrderBy(c => c.InDepartmentTime).ToList(); }
public IEnumerable <ValidationResult> Validate(ValidationContext validationContext) { var result = new List <ValidationResult>(); var db3 = new Domains3.Entities.EiSDbContext(); var targetOld = db3.GeneralRoomInfos.Find(this.GeneralRoomInfoId); //1.入室时间不能晚于当前时间。 if (this.InDepartmentTime > DateTime.Now) { result.Add(new ValidationResult("“入室时间”不能晚于当前时间", new string[] { "InDepartmentTime" })); } //2.入室方式必填。 if (!this.InRoomWayId.HasValue && !targetOld.InRoomWayId.HasValue) { result.Add(new ValidationResult("“入室方式”不可为空", new string[] { "InRoomWayId" })); } //3.首诊护士必填。 if (string.IsNullOrWhiteSpace(this.FirstNurseName)) { result.Add(new ValidationResult("“首诊护士”不可为空", new string[] { "FirstNurseName" })); } //4.入室方式为允许附加数据才可以有附加数据。 //if (!db.InRescueRoomWays.Find(rescueRoomInfo.InRescueRoomWayId).IsHasAdditionalInfo && !string.IsNullOrEmpty(rescueRoomInfo.InRescueRoomWayRemarks)) // ModelState.AddModelError("InRescueRoomWayRemarks", "与入院方式不匹配。"); //5.入室方式为允许附加数据,必须有具体名称。 if (this.InRoomWayId.HasValue && db3.InRoomWays.Find(this.InRoomWayId).IsHasAdditionalInfo && string.IsNullOrWhiteSpace(this.InRoomWayRemarks)) { result.Add(new ValidationResult("“入室方式明细”不可为空", new string[] { "InRoomWayRemarks" })); } //6.有抢救才能有抢救结果。 if (!this.IsRescue && this.RescueResultId.HasValue) { result.Add(new ValidationResult("与“抢救”不匹配", new string[] { "RescueResultId" })); } //7.离室时,有抢救则必须有抢救结果。 if (this.OutDepartmentTime.HasValue && this.IsRescue && !this.RescueResultId.HasValue) { result.Add(new ValidationResult("离室时,有“抢救”必须有“抢救结果”", new string[] { "RescueResultId" })); } //8.绿色通道为允许附加数据才可以有附加数据。 //if (!db.GreenPathCategories.Find(rescueRoomInfo.GreenPathCategoryId).IsHasAdditionalInfo && !string.IsNullOrEmpty(rescueRoomInfo.GreenPathCategoryRemarks)) // ModelState.AddModelError("GreenPathCategoryRemarks", "与绿色通道病种不匹配。"); //9.绿色通道为允许附加数据,必须有具体名称。 if (this.GreenPathCategoryId.HasValue && db3.GreenPathCategories.Find(this.GreenPathCategoryId).IsHasAdditionalInfo && string.IsNullOrWhiteSpace(this.GreenPathCategoryRemarks)) { result.Add(new ValidationResult("“绿色通道明细”不可为空", new string[] { "GreenPathCategoryRemarks" })); } //10.有预约首选科室,必须有预约首选时间。 if (this.DestinationFirstId.HasValue && !this.DestinationFirstTime.HasValue) { result.Add(new ValidationResult("“预约时间”不可为空", new string[] { "DestinationFirstTime" })); } //11.预约首选时间不能早于入室时间。 if (this.DestinationFirstTime.HasValue && this.DestinationFirstTime.Value < this.InDepartmentTime) { result.Add(new ValidationResult("“预约时间”不能早于“入室时间”", new string[] { "DestinationFirstTime" })); } //12.有预约首选科室,必须有预约首选医师。 if (this.DestinationFirstId.HasValue && string.IsNullOrWhiteSpace(this.DestinationFirstContact)) { result.Add(new ValidationResult("“预约医师”不可为空", new string[] { "DestinationFirstContact" })); } //13.有预约次选科室,必须有预约首选科室。 if (this.DestinationSecondId.HasValue && !this.DestinationFirstId.HasValue) { result.Add(new ValidationResult("必须先填写“预约首选科室”", new string[] { "DestinationSecondId" })); } //14.有离室时间,必须有去向。 if (this.OutDepartmentTime.HasValue && this.DestinationId == null) { result.Add(new ValidationResult("离室时必填", new string[] { "DestinationId" })); } //15.有离室时间,必须有经手护士。 if (this.OutDepartmentTime.HasValue && string.IsNullOrWhiteSpace(this.HandleNurse)) { result.Add(new ValidationResult("离室时必填", new string[] { "HandleNurse" })); } //16.离室时间必须不早于入室时间。 if (this.OutDepartmentTime.HasValue && this.InDepartmentTime > this.OutDepartmentTime) { result.Add(new ValidationResult("不能早于“入室时间”", new string[] { "OutDepartmentTime" })); } //17.去向为允许附加数据才可以填写去向详细。 //if (!db.Destinations.Find(rescueRoomInfo.DestinationId).IsHasAdditionalInfo && !string.IsNullOrEmpty(rescueRoomInfo.DestinationRemarks)) // ModelState.AddModelError("DestinationRemarks", "与去向不匹配。"); //18.去向为允许附加数据,必须填写去向详细。 if (this.DestinationId.HasValue && db3.Destinations.Find(this.DestinationId).IsHasAdditionalInfo && string.IsNullOrWhiteSpace(this.DestinationRemarks)) { result.Add(new ValidationResult("“去向明细”不可为空", new string[] { "DestinationRemarks" })); } //19.有去向,必须有离室时间。 if (this.DestinationId.HasValue && !this.OutDepartmentTime.HasValue) { result.Add(new ValidationResult("“离室时间”不可为空", new string[] { "OutDepartmentTime" })); } //20.有去向,必须有经手护士。 if (this.DestinationId.HasValue && string.IsNullOrWhiteSpace(this.HandleNurse)) { result.Add(new ValidationResult("“经手护士”不可为空", new string[] { "HandleNurse" })); } //21.去向为转院时,必须有转院原因。 if (this.DestinationId.HasValue && db3.Destinations.Find(this.DestinationId).IsTransferHospital && !this.TransferReasonId.HasValue) { result.Add(new ValidationResult("“转院原因”不可为空", new string[] { "TransferReasonId" })); } //22.去向为转院时,必须有转往医院。 if (this.DestinationId.HasValue && db3.Destinations.Find(this.DestinationId).IsTransferHospital && string.IsNullOrWhiteSpace(this.TransferTarget)) { result.Add(new ValidationResult("“转往医院”不可为空", new string[] { "TransferTarget" })); } //23.去向为专科时,必须有专科名称。 if (this.DestinationId.HasValue && db3.Destinations.Find(this.DestinationId).IsNeedProfessional && string.IsNullOrWhiteSpace(this.ProfessionalTarget)) { result.Add(new ValidationResult("“专科名称”不可为空", new string[] { "ProfessionalTarget" })); } return(result); }
public IEnumerable <ValidationResult> Validate(ValidationContext validationContext) { var result = new List <ValidationResult>(); var db3 = new Domains3.Entities.EiSDbContext(); var targetOld = db3.GeneralRoomInfos.Find(this.GeneralRoomInfoId); //1.入室时间不能晚于当前时间。 if (this.InDepartmentTime > DateTime.Now) { result.Add(new ValidationResult("“入室时间”不能晚于当前时间", new string[] { "InDepartmentTime" })); } //2.入室方式必填。 if (!this.InRoomWayId.HasValue && !targetOld.InRoomWayId.HasValue) { result.Add(new ValidationResult("“入室方式”不可为空", new string[] { "InRoomWayId" })); } //3.首诊护士必填。 if (string.IsNullOrWhiteSpace(this.FirstNurseName)) { result.Add(new ValidationResult("“首诊护士”不可为空", new string[] { "FirstNurseName" })); } //5.入室方式为允许附加数据,必须有具体名称。 if (this.InRoomWayId.HasValue && db3.InRoomWays.Find(this.InRoomWayId).IsHasAdditionalInfo && string.IsNullOrWhiteSpace(this.InRoomWayRemarks)) { result.Add(new ValidationResult("“入室方式明细”不可为空", new string[] { "InRoomWayRemarks" })); } //10.有预约首选科室,必须有预约首选时间。 if (this.DestinationFirstId.HasValue && !this.DestinationFirstTime.HasValue) { result.Add(new ValidationResult("“预约时间”不可为空", new string[] { "DestinationFirstTime" })); } //11.预约首选时间不能早于入室时间。 if (this.DestinationFirstTime.HasValue && this.DestinationFirstTime.Value < this.InDepartmentTime) { result.Add(new ValidationResult("“预约时间”不能早于“入室时间”", new string[] { "DestinationFirstTime" })); } //12.有预约首选科室,必须有预约首选医师。 if (this.DestinationFirstId.HasValue && string.IsNullOrWhiteSpace(this.DestinationFirstContact)) { result.Add(new ValidationResult("“预约医师”不可为空", new string[] { "DestinationFirstContact" })); } //13.有预约次选科室,必须有预约首选科室。 if (this.DestinationSecondId.HasValue && !this.DestinationFirstId.HasValue) { result.Add(new ValidationResult("必须先填写“预约首选科室”", new string[] { "DestinationSecondId" })); } //14.有离室时间,必须有去向。 if (this.OutDepartmentTime.HasValue && this.DestinationId == null) { result.Add(new ValidationResult("离室时必填", new string[] { "DestinationId" })); } //15.有离室时间,必须有经手护士。 if (this.OutDepartmentTime.HasValue && string.IsNullOrWhiteSpace(this.HandleNurse)) { result.Add(new ValidationResult("离室时必填", new string[] { "HandleNurse" })); } //16.离室时间必须不早于入室时间。 if (this.OutDepartmentTime.HasValue && this.InDepartmentTime > this.OutDepartmentTime) { result.Add(new ValidationResult("不能早于“入室时间”", new string[] { "OutDepartmentTime" })); } //18.去向为允许附加数据,必须填写去向详细。 if (this.DestinationId.HasValue && db3.Destinations.Find(this.DestinationId).IsHasAdditionalInfo && string.IsNullOrWhiteSpace(this.DestinationRemarks)) { result.Add(new ValidationResult("“去向明细”不可为空", new string[] { "DestinationRemarks" })); } //19.有去向,必须有离室时间。 if (this.DestinationId.HasValue && !this.OutDepartmentTime.HasValue) { result.Add(new ValidationResult("“离室时间”不可为空", new string[] { "OutDepartmentTime" })); } //20.有去向,必须有经手护士。 if (this.DestinationId.HasValue && string.IsNullOrWhiteSpace(this.HandleNurse)) { result.Add(new ValidationResult("“经手护士”不可为空", new string[] { "HandleNurse" })); } //21.去向为转院时,必须有转院原因。 if (this.DestinationId.HasValue && db3.Destinations.Find(this.DestinationId).IsTransferHospital && !this.TransferReasonId.HasValue) { result.Add(new ValidationResult("“转院原因”不可为空", new string[] { "TransferReasonId" })); } //22.去向为转院时,必须有转往医院。 if (this.DestinationId.HasValue && db3.Destinations.Find(this.DestinationId).IsTransferHospital && string.IsNullOrWhiteSpace(this.TransferTarget)) { result.Add(new ValidationResult("“转往医院”不可为空", new string[] { "TransferTarget" })); } //23.去向为专科时,必须有专科名称。 if (this.DestinationId.HasValue && db3.Destinations.Find(this.DestinationId).IsNeedProfessional && string.IsNullOrWhiteSpace(this.ProfessionalTarget)) { result.Add(new ValidationResult("“专科名称”不可为空", new string[] { "ProfessionalTarget" })); } return(result); }