Esempio n. 1
0
 /// <summary>
 /// 获取一体机配置项
 /// </summary>
 /// <returns></returns>
 public RequestResult <dynamic> ModifyMedConfigSet(MED_CONFIGSET medconfig)
 {
     return(Success <dynamic>(sysConfig.ModifyMedConfigSet(medconfig)));
 }
Esempio n. 2
0
        /// <summary>
        /// 麻醉交班急救插管患者信息查询
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public List <MED_ANES_SHIFT_PATIENTINFO> GetAnesShiftPatientInfoList(OperQueryParaModel model)
        {
            string sql = sqlDict.GetSQLByKey("GetAnesShiftPatientInfoList");

            DateTime?startTime = null;

            int?shift_Type = 0;

            if (!string.IsNullOrWhiteSpace(model.SHIFT_DATE))
            {
                startTime = Convert.ToDateTime(model.SHIFT_DATE).Date;
            }

            if (!string.IsNullOrWhiteSpace(model.SHIFT_TYUPE))
            {
                shift_Type = Convert.ToInt32(model.SHIFT_TYUPE);
            }

            List <MED_ANES_SHIFT_PATIENTINFO> list = dapper.Set <MED_ANES_SHIFT_PATIENTINFO>().Query(sql, new
            {
                SHIFT_DATE  = startTime,
                SHIFT_TYUPE = shift_Type
            });

            //int? emergencyPatCount = model.AnesShiftEmergencyPatCount;//毒麻药列表

            decimal?emergencyPatCount = 0;

            MED_CONFIGSET config = sysConfigService.GetMedConfigSet();

            if (!string.IsNullOrEmpty(config.AnesShiftEmergencyPatCount.ToString()))
            {
                emergencyPatCount = config.AnesShiftEmergencyPatCount;
            }

            if (emergencyPatCount != 0)
            {
                for (int i = 0; i < emergencyPatCount; i++)
                {
                    var item = i;

                    MED_ANES_SHIFT_PATIENTINFO listFind = list.Find(d => d.PATIENT_NO == item);

                    if (listFind == null)
                    {
                        listFind = new MED_ANES_SHIFT_PATIENTINFO()
                        {
                            SHIFT_DATE  = startTime,
                            SHIFT_TYUPE = shift_Type,
                            PATIENT_NO  = i
                        };
                        list.Add(listFind);

                        dapper.Set <MED_ANES_SHIFT_PATIENTINFO>().Insert(listFind);
                    }
                }
                dapper.SaveChanges();
            }

            list = dapper.Set <MED_ANES_SHIFT_PATIENTINFO>().Query(sql, new
            {
                SHIFT_DATE  = startTime,
                SHIFT_TYUPE = shift_Type
            });

            return(list);
        }
Esempio n. 3
0
        /// <summary>
        /// 获取一体机配置项
        /// </summary>
        /// <returns></returns>
        public RequestResult <dynamic> GetMedConfigSet()
        {
            MED_CONFIGSET medconfig = sysConfig.GetMedConfigSet();

            return(Success <dynamic>(medconfig));
        }
Esempio n. 4
0
        /// <summary>
        /// 麻醉交班毒麻药查询
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public List <MED_ANES_SHIFT_DRUGS> GetAnesShiftDrugInfoList(OperQueryParaModel model)
        {
            string sql = sqlDict.GetSQLByKey("GetAnesShiftDrugInfoList");

            DateTime?startTime = null;

            int?shift_Type = 0;

            if (!string.IsNullOrWhiteSpace(model.SHIFT_DATE))
            {
                startTime = Convert.ToDateTime(model.SHIFT_DATE).Date;
            }

            if (!string.IsNullOrWhiteSpace(model.SHIFT_TYUPE))
            {
                shift_Type = Convert.ToInt32(model.SHIFT_TYUPE);
            }

            List <MED_ANES_SHIFT_DRUGS> list = dapper.Set <MED_ANES_SHIFT_DRUGS>().Query(sql, new
            {
                SHIFT_DATE  = startTime,
                SHIFT_TYUPE = shift_Type
            });

            //List<string> drugList = model.DRUG_LIST;//毒麻药列表

            List <string> drugList = new List <string>();

            MED_CONFIGSET config = sysConfigService.GetMedConfigSet();

            if (!string.IsNullOrEmpty(config.AnesShiftDrugList))
            {
                drugList = config.AnesShiftDrugList.Split(',').ToList();
            }

            if (drugList != null)
            {
                for (int i = 0; i < drugList.Count; i++)
                {
                    var item = drugList[i];

                    MED_ANES_SHIFT_DRUGS listFind = list.Find(d => d.DRUGS_NAME == item);

                    if (listFind == null)
                    {
                        listFind = new MED_ANES_SHIFT_DRUGS()
                        {
                            SHIFT_DATE  = startTime,
                            SHIFT_TYUPE = shift_Type,
                            DRUGS_NO    = i,
                            DRUGS_NAME  = item
                        };
                        list.Add(listFind);

                        dapper.Set <MED_ANES_SHIFT_DRUGS>().Insert(listFind);
                    }
                }
                dapper.SaveChanges();
            }

            list = dapper.Set <MED_ANES_SHIFT_DRUGS>().Query(sql, new
            {
                SHIFT_DATE  = startTime,
                SHIFT_TYUPE = shift_Type
            });

            return(list);
        }