/// <summary> /// 手术取消 /// </summary> /// <param name="operationCanceled"></param> /// <returns></returns> public bool CancelOperationSchedule(OperCancelAndDetailEntity operationCanceled) { MED_OPERATION_SCHEDULE opsche = dapper.Set <MED_OPERATION_SCHEDULE>().Single(d => d.PATIENT_ID == operationCanceled.OperCanceled.PATIENT_ID && d.VISIT_ID == operationCanceled.OperCanceled.VISIT_ID && d.SCHEDULE_ID == operationCanceled.OperCanceled.SCHEDULE_ID); int CancelID = GetMaxOperCancelCancelID(operationCanceled.OperCanceled); operationCanceled.OperCanceled.OPER_ID = opsche.OPER_ID; operationCanceled.OperCanceled.CANCEL_ID = ++CancelID; bool flag = dapper.Set <MED_OPERATION_CANCELED>().Insert(operationCanceled.OperCanceled); if (operationCanceled.AnesInputDict != null && operationCanceled.AnesInputDict.Count > 0) { foreach (var item in operationCanceled.AnesInputDict) { dapper.Set <MED_OPERATION_CANCELED_DETAIL>().Insert(new MED_OPERATION_CANCELED_DETAIL { PATIENT_ID = operationCanceled.OperCanceled.PATIENT_ID, VISIT_ID = operationCanceled.OperCanceled.VISIT_ID, CANCEL_ID = operationCanceled.OperCanceled.CANCEL_ID, CANCEL_CLASS = item.ITEM_CLASS, CANCEL_TYPE = item.ITEM_NAME }); } } if (flag) { opsche.OPER_ROOM_NO = null; opsche.SEQUENCE = 0; opsche.OPERATING_TIME = 0; opsche.ANES_CONFIRM = 0; opsche.NURSE_CONFIRM = 0; opsche.FIRST_OPER_NURSE = null; opsche.FIRST_SUPPLY_NURSE = null; opsche.ANES_DOCTOR = null; opsche.FIRST_ANES_ASSISTANT = null; opsche.OPER_STATUS_CODE = -80; dapper.Set <MED_OPERATION_SCHEDULE>().Update(opsche, d => new { d.OPER_ROOM_NO, d.SEQUENCE, d.OPERATING_TIME, d.ANES_CONFIRM, d.NURSE_CONFIRM, d.FIRST_OPER_NURSE, d.FIRST_SUPPLY_NURSE, d.ANES_DOCTOR, d.FIRST_ANES_ASSISTANT, d.OPER_STATUS_CODE, }); if (AppSettings.OpenHIS212) { SyncInfoService.SyncWrite_OPER504W(opsche.PATIENT_ID, opsche.VISIT_ID, opsche.SCHEDULE_ID); } } dapper.SaveChanges(); return(flag); }
public RequestResult <int> CancelOperationSchedule(OperCancelAndDetailEntity operationCanceled) { return(Success(nurseManageService.CancelOperationSchedule(operationCanceled))); }
public RequestResult CancelOperationSchedule(OperCancelAndDetailEntity operationCanceled) { return(Success(OperSchedule.CancelOperationSchedule(operationCanceled))); }