//获取病历信息
        public void GetPatientRecordInfo(string TaskCode, string WorkID, out M_PatientRecord info, out M_PatientRecordAppend pra, out M_PatientRecordCPR prCPR)
        {
            M_PatientRecordBLL prBLL = new M_PatientRecordBLL();
            M_AttemperData result = prBLL.GetAttemperData(TaskCode,"");//根据任务编码获取调度信息

            info = new M_PatientRecord();//病历主表信息
            info.TaskCode = TaskCode;
            info.PatientOrder = 1;
            info.CallOrder = result.CallOrder;
            info.Name = result.Name;
            info.Sex = result.Sex;
            info.AgeType = "岁";
            info.ForHelpTelephone = result.ForHelpPhone;
            info.ContactTelephone = result.ContactTelephone;
            info.PatientVersion = result.AlarmType;
            info.OriginalTaskType = result.AlarmType;
            info.ForArea = result.Area;
            info.LocalAddress = result.LocalAddress;
            info.OutStationCode = result.StationCode;
            info.Station = result.Station;
            info.SendAddress = result.SendAddress;
            info.DrivingTime = result.DrivingTime;
            info.ArriveSceneTime = result.ArriveSceneTime;
            info.LeaveSceneTime = result.LeaveSceneTime;
            info.ArriveDestinationTime = result.ArriveDestinationTime;
            info.Driver = result.Driver;
            info.StretcherBearersI = result.StretcherBearers;
            info.DoctorAndNurse = result.Doctor + result.Nurse;
            P_UserBLL bll = new P_UserBLL();
            P_User user = bll.GetListBy(u => u.WorkCode == WorkID).Select(u => u.ToExtModle()).FirstOrDefault(); //查找用户名 密码
            info.AgentCode = user.ID.ToString();
            info.AgentWorkID = WorkID;
            info.AgentName = user.Name;
            info.BeginFillPatientTime = DateTime.Now;
            info.MedicalRecordGenerationTime = DateTime.Now;
            info.FormCompleteLogo = false;
            //obj.FormCompleteTime = null;
            info.ChargeOrder = 0;
            info.SubCenterIFSpotChecks = false;
            info.CenterIFSpotChecks = false;
            info.SubmitLogo = false;
            info.SubmitTime = null;
            info.MedicalStateCode = 0;
            info.LastUpdatePerson = user.Name;//填写病历的人员
            info.LastUpdateTime = DateTime.Now;
            info.CPRIFSuccess = "";//心肺复苏选择
            info.IFRefuseTreatment = "治疗记录";//是否拒绝治疗(救治记录)
            info.RescueType = "";//抢救类型(救治记录)
            info.IMEI = "PAD";//从PAD填写

            pra = new M_PatientRecordAppend();//
            pra.TaskCode = TaskCode;
            pra.PatientOrder = 1;

            prCPR = new M_PatientRecordCPR();//
            prCPR.TaskCode = TaskCode;
            prCPR.PatientOrder = 1;
            prCPR.CenterIFAuditForXFFS = false;
        }
 public void GetPatientInfo(string TaskCode, int PatientOrder, out M_PatientRecord info
     , out M_PatientRecordAppend pra)
 {
     info = null;
     object objpr = null;
     M_PatientRecordCPR mprCPR = null;
     m_DAL.GetPatientInfo(TaskCode, PatientOrder, out objpr, out pra, out mprCPR);
     if (objpr != null)
     {
         info = (M_PatientRecord)objpr;
     }
 }
        public bool PADAddPatientRecord(string TaskCode, int PatientOrder, string EvenType, string TaskOrder, M_PatientRecord pr, M_PatientRecordAppend pra, string WorkCode, string PersonName, ref string errorMsg)
        {
            try
            {
                if (pr == null)
                    pr = new M_PatientRecord();
                if (pra == null)
                    pra = new M_PatientRecordAppend();

                if (TaskCode == "")
                {
                    TaskCode = m_DAL.GetTaskCodeByTaskOrder(TaskOrder);
                }
                if (TaskCode=="")
                {
                    errorMsg = "任务流水号错误!未在任务中找到该流水号。";
                    return false;
                }
                pr.TaskCode = TaskCode;
                pr.PatientOrder = PatientOrder;
                pr.AgentWorkID = WorkCode;
                pr.AgentName = PersonName;
                pr.PatientVersion = EvenType;
                pra.TaskCode = TaskCode;
                pra.PatientOrder = PatientOrder;
                object objpr = null;
                M_PatientRecordAppend mpra = null;
                M_PatientRecordCPR mprCPR = new M_PatientRecordCPR();;
                M_PatientRecord mpr = null;
                mprCPR.TaskCode = TaskCode;
                mprCPR.PatientOrder = PatientOrder;
                mprCPR.CenterIFAuditForXFFS = false;
                pr.MedicalRecordGenerationTime = DateTime.Now;
                pr.IMEI = "PAD";
                m_DAL.GetPatientInfo(TaskCode, PatientOrder, out objpr, out mpra);
                if (objpr != null)
                {
                    mpr = (M_PatientRecord)objpr;
                    ReflectionUtility.UpdateObjectProperty(mpr, pr);
                    ReflectionUtility.UpdateObjectProperty(mpra, pra);
                    m_DAL.Update(pr, pra);
                }
                else
                {
                    string HJTel = "";
                    string Area = "";
                    string EventType = "";
                    new MobileTaskDAL().GetMobileTaskInfo(TaskCode, out HJTel, out Area, out EventType);
                    pr.ForHelpTelephone = HJTel;
                    pr.OriginalTaskType = EventType;
                    pr.ForArea = Area;
                    pr.MedicalStateCode = 0;
                    pr.FormCompleteLogo = false;
                    pr.SubmitLogo = false;
                    pr.SubCenterIFSpotChecks = false;
                    pr.CenterIFSpotChecks = false;
                    pr.LastUpdatePerson = PersonName;
                    pr.LastUpdateTime = DateTime.Now;
                    m_DAL.Insert(pr, pra, mprCPR, null, null);
                }
                return true;
            }
            catch (Exception ex)
            {
                errorMsg = ex.Message;
                return false;
            }
        }
Esempio n. 4
0
        public bool SaveSpotChecks()
        {
            M_PatientRecordBLL bll = new M_PatientRecordBLL();

            string SpotChecks = Request.Form["SpotChecks"].ToString();
            int orderNumber = int.Parse(Request.Form["orderNumber"]);
            M_PatientRecord info = new M_PatientRecord();
            info = JsonHelper.GetJsonInfoBy<M_PatientRecord>(SpotChecks);

            bool save = false;
            if (info != null)
            {
                try
                {
                    save = bll.UpdateSpotChecks(info, orderNumber);//修改病历抽查
                }
                catch
                {
                    save = false;
                }
            }
            return save;
        }
Esempio n. 5
0
        private static object m_SyncRoot = new Object(); //互斥对象

        #endregion Fields

        #region Methods

        /// <summary>
        /// 病历页面初始化
        /// </summary>
        /// <param name="TaskCode">任务编码</param>
        /// <param name="PatientOrder">序号</param>
        /// <param name="state">填写状态</param>
        /// <returns></returns>
        public ActionResult AddPatientRecord(string TaskCode, int PatientOrder, string state)
        {
            //, int PatientOrder//测试
            M_PatientRecordBLL prBLL = new M_PatientRecordBLL();
            M_DictionaryBLL dBLL = new M_DictionaryBLL();
            //int PatientOrder = 1;//测试

            M_AttemperData result = prBLL.GetAttemperData(TaskCode, state);//根据任务编码获取调度信息
            ViewBag.Attemper = result;

            ViewData["TaskCode"] = TaskCode == null ? "2012102023555200020101" : TaskCode;
            M_PatientRecord prInfo;//病历主表信息
            M_PatientRecordAppend pra;//病历附表--体检等信息
            M_PatientRecordCPR prCPR;//病历附表--心肺复苏
            if (state == "new")
            {
                int AddPatientOrder = prBLL.GetPatientMaxOrder(TaskCode);
                ViewData["PatientOrder"] = AddPatientOrder;
                prInfo = new M_PatientRecord();
                pra = new M_PatientRecordAppend();
                prCPR = new M_PatientRecordCPR();
                ViewBag.PRInfo = prInfo;//病历主表信息--传到页面
                ViewBag.PRAppendInfo = pra;//病历附表--体检等信息--传到页面
                ViewBag.PRCPRInfo = prCPR;//病历附表--心肺复苏--传到页面

            }
            else
            {
                object oPatientInfo;//病历主表
                prBLL.GetPatientInfo(TaskCode, PatientOrder, out oPatientInfo, out pra, out prCPR);
                if (PatientOrder > 0)
                {
                    prInfo = (M_PatientRecord)oPatientInfo;
                    ViewBag.PRInfo = prInfo;//病历主表信息--传到页面
                    ViewBag.PRAppendInfo = pra;//病历附表--体检等信息--传到页面
                    ViewBag.PRCPRInfo = prCPR;//病历附表--心肺复苏--传到页面
                    ViewData["PatientOrder"] = PatientOrder;
                    if (SuperRole("SuperRole"))
                    {
                        this.ViewData["SuperRole"] = "SuperRole";//登录人有超级权限
                    }
                    else
                        this.ViewData["SuperRole"] = "";

                    string role = UserOperateContext.Current.getMaxPerForRole();//获取登录人角色(医生、护士、司机)
                    this.ViewData["PatientRole"] = role;//
                }
            }
            ViewData["state"] = state == null ? "new" : state;

            if (SuperRole("PRAuditCPR"))
            {
                this.ViewData["PRAuditCPR"] = "PRAuditCPR";//登录人有“心肺复苏审核”权限
            }
            else
                this.ViewData["PRAuditCPR"] = "";

            if (SuperRole("SubCenterSpotChecks"))
            {
                this.ViewData["SubCenterSpotChecks"] = "SubCenterSpotChecks";//登录人有"分中心抽查"权限
            }
            else
                this.ViewData["SubCenterSpotChecks"] = "";

            if (SuperRole("CenterSpotChecks"))
            {
                this.ViewData["CenterSpotChecks"] = "CenterSpotChecks";//登录人有"中心抽查"权限
            }
            else
                this.ViewData["CenterSpotChecks"] = "";

            P_User pUser = new P_User();
            pUser = UserOperateContext.Current.Session_UsrInfo;//获取登录人信息
            ViewData["AgentCode"] = pUser.ID;
            ViewData["AgentWorkID"] = pUser.WorkCode;
            ViewData["AgentName"] = pUser.Name;
            ViewData["BeginFillPatientTime"] = DateTime.Now.ToString();//开始填写病历时间

            #region 为病历页面的CheckBoxList项目赋值
            CheckViewModel model = new CheckViewModel();
            //model.DiseasesClassification = dBLL.GetCheckBoxModelByTableName("M_ZCaseTemplate");//病种分类
            //model.GongShiRen = dBLL.GetCheckBoxModel("GongShiRen");//供史人
            //model.AnamnesisllnessHistory = dBLL.GetCheckBoxModel("PastMedicalHistory");//既往病史
            model.BodyFigure = dBLL.GetCheckBoxModel("PiFu");//皮肤
            model.Head = dBLL.GetCheckBoxModel("Head");//头部
            model.Neck = dBLL.GetCheckBoxModel("Neck");//颈部
            model.Chest = dBLL.GetCheckBoxModel("Chest");//胸部
            model.Lung = dBLL.GetCheckBoxModel("Lung");//肺脏
            model.LungLeft = dBLL.GetCheckBoxModel("LungLeft");//左肺
            model.LungRight = dBLL.GetCheckBoxModel("LungLeft");//右肺
            model.FuBu = dBLL.GetCheckBoxModel("FuBu");//腹部
            model.JiZhu = dBLL.GetCheckBoxModel("JiZhu");//脊柱
            model.Limb = dBLL.GetCheckBoxModel("Limb");//四肢
            #endregion

            #region 为病历页面的RadioButtonList从数据库传值

            var ProvideMedicalHistoryPeople = new object();//供史人
            var DiseasesClassification = new object();//病种分类
            var PastMedicalHistory = new object();//既往病史
            var BabinskiSign = new object();//神经系统--巴氏征
            var ChestExtrusionTest = new object();//胸廓挤压试验
            var PelvicExtrusionTest = new object();//骨盆挤压试验

            lock (m_SyncRoot)
            {
                ProvideMedicalHistoryPeople = CacheHelper.GetCache("ProvideMedicalHistoryPeople");
                DiseasesClassification = CacheHelper.GetCache("DiseasesClassification");
                PastMedicalHistory = CacheHelper.GetCache("PastMedicalHistory");
                BabinskiSign = CacheHelper.GetCache("BabinskiSign");
                ChestExtrusionTest = CacheHelper.GetCache("ChestExtrusionTest");
                PelvicExtrusionTest = CacheHelper.GetCache("PelvicExtrusionTest");
                if (ProvideMedicalHistoryPeople == null)
                {
                    ProvideMedicalHistoryPeople = dBLL.GetCheckBoxOrRadioButtonList("Checkbox", "ProvideMedicalHistoryPeople", "checkbox");
                    CacheHelper.SetCache("ProvideMedicalHistoryPeople", ProvideMedicalHistoryPeople);
                }
                if (DiseasesClassification == null)
                {
                    DiseasesClassification = dBLL.GetCheckBoxListByTableName("M_ZCaseTemplate", "DiseasesClassification", "checkbox");
                    CacheHelper.SetCache("DiseasesClassification", DiseasesClassification);
                }
                if (PastMedicalHistory == null)
                {
                    PastMedicalHistory = dBLL.GetCheckBoxOrRadioButtonList("Checkbox", "PastMedicalHistory", "checkbox");
                    CacheHelper.SetCache("PastMedicalHistory", PastMedicalHistory);
                }
                if (BabinskiSign == null)
                {
                    BabinskiSign = dBLL.GetCheckBoxOrRadioButtonList("Checkbox", "BabinskiSign", "checkbox");
                    CacheHelper.SetCache("BabinskiSign", BabinskiSign);
                }
                if (ChestExtrusionTest == null)
                {
                    ChestExtrusionTest = dBLL.GetCheckBoxOrRadioButtonList("Radio", "ChestExtrusionTest", "radio");
                    CacheHelper.SetCache("ChestExtrusionTest", ChestExtrusionTest);
                }
                if (PelvicExtrusionTest == null)
                {
                    PelvicExtrusionTest = dBLL.GetCheckBoxOrRadioButtonList("Radio", "PelvicExtrusionTest", "radio");
                    CacheHelper.SetCache("PelvicExtrusionTest", PelvicExtrusionTest);
                }
            }
            this.ViewData["ProvideMedicalHistoryPeople"] = ProvideMedicalHistoryPeople;
            this.ViewData["DiseasesClassification"] = DiseasesClassification;
            this.ViewData["PastMedicalHistory"] = PastMedicalHistory;
            this.ViewData["BabinskiSign"] = BabinskiSign;
            this.ViewData["ChestExtrusionTest"] = ChestExtrusionTest;
            this.ViewData["PelvicExtrusionTest"] = PelvicExtrusionTest;

            #endregion

            return View(model);
        }
Esempio n. 6
0
 public int GetPatientMaxOrder(string taskCode)
 {
     M_PatientRecord pInfo = new M_PatientRecord();
     int PatientOrder = 0;
     var query = from pr in db.M_PatientRecord
                 where pr.TaskCode == taskCode
                 select pr.PatientOrder;
     if (query.Count() > 0)
         PatientOrder = query.Max() + 1;
     else
         PatientOrder = 1;
     return PatientOrder;
 }
Esempio n. 7
0
 /// <summary>
 /// 根据任务编码查询病历列表
 /// </summary>
 /// <param name="taskCode"></param>
 /// <returns></returns>
 public List<M_PatientRecord> GetPatientCommonByTask(string taskCode)
 {
     try
     {
         StringBuilder sbSQL = new StringBuilder();
         sbSQL.Append(" select TaskCode,PatientOrder,Name,Sex,Age=case when AgeType='不详' then Age else Age+AgeType end ");
         sbSQL.Append(" ,AgeType,LocalAddress,SendAddress,FirstAidEffect,DiseaseCooperation ");
         sbSQL.Append(" ,SubmitLogo,SubmitTime,PatientVersion,MedicalState=case when MedicalStateCode=0 then '暂存' when MedicalStateCode=1 then '已提交' else '' end ");
         sbSQL.Append(",IsCharge=isnull((SELECT IsCharge=case when cr.PatientOrder>0 then '已收' end FROM M_PatientCharge cr Where cr.TaskCode=pr.TaskCode and cr.PatientOrder=pr.PatientOrder),'未收')  ");
         sbSQL.Append(" from M_PatientRecord pr");
         //sbSQL.Append(" left join  ").Append(builder.InitialCatalog).Append(".dbo.TPerson tp on tp.编码=tpr.经办人编码 ");
         sbSQL.Append(" where pr.TaskCode='").Append(taskCode).Append("' ");
         DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.MainConnectionString, CommandType.Text, sbSQL.ToString(), null);
         List<M_PatientRecord> list = new List<M_PatientRecord>();
         if (ds.Tables[0].Rows.Count > 0)
         {
             M_PatientRecord info = new M_PatientRecord();
             foreach (DataRow dr in ds.Tables[0].Rows)
             {
                 info = new M_PatientRecord();
                 info.TaskCode = dr["TaskCode"].ToString();
                 info.PatientOrder = Convert.ToInt32(dr["PatientOrder"]);
                 info.Name = dr["Name"].ToString();
                 info.Sex = dr["Sex"].ToString();
                 info.Age = dr["Age"].ToString();
                 info.LocalAddress = dr["LocalAddress"].ToString();
                 info.SendAddress = dr["SendAddress"].ToString();
                 info.FirstAidEffect = dr["FirstAidEffect"].ToString();
                 info.DiseaseCooperation = dr["DiseaseCooperation"].ToString();
                 info.SubmitLogo = DBConvert.ConvertDBTypeToNullableBool(dr["SubmitLogo"]);
                 info.SubmitTime = DBConvert.ConvertDBTypeToNullable(dr["SubmitTime"]);
                 info.PatientVersion = dr["PatientVersion"].ToString();//事件类型
                 info.ForArea = dr["MedicalState"].ToString();//病历状态--借助区域字段
                 info.ForHelpTelephone = dr["IsCharge"].ToString();//是否收费--借助区域字段
                 list.Add(info);
             }
         }
         else
         {
             list = null;
         }
         return list;
     }
     catch (Exception ex)
     {
         LogUtility.Error("M_PatientRecordDAL/GetPatientCommonByTask()", ex.ToString());
         return null;
     }
 }
Esempio n. 8
0
        public bool UpdateSpotChecks(M_PatientRecord info, int orderNumber)
        {
            try
            {
                StringBuilder strSQL = new StringBuilder();
                switch (orderNumber)
                {
                    case -1://分中心抽查
                        strSQL.Append(@"update M_PatientRecord set SubCenterIFSpotChecks=1,SubCenterPerson='" + info.SubCenterPerson + "',SubCenterSpotChecksTime='" + DateTime.Now + "',SubCenterSpotChecksResult='" + info.SubCenterSpotChecksResult + "' ");
                        strSQL.Append(@"
                                    ,SubCenterSpotChecksRmark='" + info.SubCenterSpotChecksRmark + "' ");
                        strSQL.Append(@"
                                    where TaskCode='" + info.TaskCode + "' and PatientOrder=" + info.PatientOrder + "  ");
                        break;
                    case -2://中心抽查
                        strSQL.Append(@"update M_PatientRecord set CenterIFSpotChecks=1,CenterSpotChecksPerson='" + info.CenterSpotChecksPerson + "',CenterSpotChecksTime='" + DateTime.Now + "',CenterSpotChecksResult='" + info.CenterSpotChecksResult + "' ");
                        strSQL.Append(@"
                                    ,CenterSpotChecksRmark='" + info.CenterSpotChecksRmark + "' ");
                        strSQL.Append(@"
                                    where TaskCode='" + info.TaskCode + "' and PatientOrder=" + info.PatientOrder + "  ");
                        break;
                    default:
                        break;
                }

                int ds = SqlHelper.ExecuteNonQuery(SqlHelper.MainConnectionString, CommandType.Text, strSQL.ToString(), null);
                return ds > 0 ? true : false;
            }
            catch (Exception ex)
            {
                LogUtility.Error("M_PatientRecordDAL/UpdateSpotChecks()", ex.ToString());
                return false;
            }
        }