コード例 #1
0
ファイル: Services.asmx.cs プロジェクト: SimonTDY/WebService
        public ChartData GetSignInfoByCodeWeb(string PatientId, string PlanNo, string ItemCode, int StartDate, int EndDate)
        {
            ChartData ChartData = new ChartData();
            List<Graph> GraphList = new List<Graph>();
            GraphGuide GraphGuide = new GraphGuide();
            List<MstBloodPressure> reference = new List<MstBloodPressure>();

            try
            {
                string Module = "";
                InterSystems.Data.CacheTypes.CacheSysList planInfo = null;
                planInfo = PsPlan.GetPlanInfo(_cnCache, PlanNo);
                if (planInfo != null)
                {
                    Module = planInfo[4].ToString();

                }

                if (Module == "M1")
                {
                    if ((ItemCode == "Bloodpressure|Bloodpressure_1") || (ItemCode == "Bloodpressure|Bloodpressure_2"))
                    {
                        reference = CmMstBloodPressure.GetBPGrades(_cnCache);
                    }

                    GraphList = CmMstBloodPressure.GetSignInfoByM1(_cnCache, PatientId, PlanNo, ItemCode, StartDate, EndDate, reference);

                    //初始值、目标值、分级规则加工
                    if (GraphList.Count > 0)
                    {
                        GraphGuide = CmMstBloodPressure.GetGuidesByCode(_cnCache, PlanNo, ItemCode, reference);
                        ChartData.GraphGuide = GraphGuide;
                    }
                }

                //读取任务列表  必有测量任务,其他任务(例如吃药)可能没有
                DataTable TaskList = new DataTable();
                TaskList = PsTask.GetTaskList(_cnCache, PlanNo);
                string condition = " Type = 'VitalSign'";
                DataRow[] VitalSignRows = TaskList.Select(condition);

                //其他任务依从情况
                List<CompliacneDetailByD> TasksComByPeriod = new List<CompliacneDetailByD>();
                //是否有其他任务
                if (TaskList.Rows.Count == VitalSignRows.Length)
                {
                    ChartData.OtherTasks = "0";
                }
                else
                {
                    ChartData.OtherTasks = "1";
                    TasksComByPeriod = PsCompliance.GetTasksComByPeriodWeb(_cnCache, PatientId, PlanNo, StartDate, EndDate);
                    if ((TasksComByPeriod != null) && (TasksComByPeriod.Count == GraphList.Count))
                    {
                        for (int rowsCount = 0; rowsCount < TasksComByPeriod.Count; rowsCount++)
                        {
                            GraphList[rowsCount].DrugValue = "1";   //已经初始化过
                            GraphList[rowsCount].DrugBullet = TasksComByPeriod[rowsCount].drugBullet;
                            GraphList[rowsCount].DrugColor = TasksComByPeriod[rowsCount].drugColor;
                            GraphList[rowsCount].DrugDescription = TasksComByPeriod[rowsCount].Events;
                        }
                    }
                }
                ChartData.GraphList = GraphList;

                return ChartData;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "GetSignInfoByCode", "WebService调用异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                //return null;
                throw (ex);
            }
        }
コード例 #2
0
ファイル: Services.asmx.cs プロジェクト: SimonTDY/WebService
        public ImplementationInfo GetImplementationForWebFirst(string PatientId, string Module)
        {
            ImplementationInfo ImplementationInfo = new ImplementationInfo();
            try
            {
                string PlanNo = "";

                //病人基本信息-姓名、头像..
                //CacheSysList patientList = PsBasicInfo.GetPatientBasicInfo(_cnCache, PatientId);
                //if (patientList != null)
                //{
                //    ImplementationInfo.PatientInfo.PatientName = patientList[0];

                //    CacheSysList BasicInfoDetail = PsBasicInfoDetail.GetDetailInfo(_cnCache, PatientId);
                //    if (BasicInfoDetail != null)
                //    {
                //        if (BasicInfoDetail[6] != null)
                //        {
                //            ImplementationInfo.PatientInfo.ImageUrl = BasicInfoDetail[6].ToString();
                //        }
                //        else
                //        {
                //            ImplementationInfo.PatientInfo.ImageUrl = "";  //js端意外不能识别null
                //        }

                //    }
                //}

                //刚进入页面加载计划列表 (始终存在第一条-当前计划)
                ImplementationInfo.PlanList = PsPlan.GetPlanList34ByM(_cnCache, PatientId, Module);

                PlanNo = ImplementationInfo.PlanList[0].PlanNo; //肯定会存在

                #region  存在正在执行的计划

                if ((PlanNo != "") && (PlanNo != null))  //存在正在执行的计划
                {
                    //剩余天数和进度
                    InterSystems.Data.CacheTypes.CacheSysList PRlist = null;
                    PRlist = PsPlan.GetProgressRate(_cnCache, PlanNo);
                    if (PRlist != null)
                    {
                        ImplementationInfo.RemainingDays = PRlist[0].ToString();
                        ImplementationInfo.ProgressRate = (Convert.ToDouble(PRlist[1]) * 100).ToString();

                        ImplementationInfo.StartDate = ImplementationInfo.PlanList[0].StartDate;
                        ImplementationInfo.EndDate = ImplementationInfo.PlanList[0].EndDate;
                    }

                    //正在执行计划的最近一周的依从率
                    InterSystems.Data.CacheTypes.CacheSysList weekPeriod = null;
                    weekPeriod = PsPlan.GetWeekPeriod(_cnCache, ImplementationInfo.PlanList[0].StartDate);
                    if (weekPeriod != null)
                    {

                        ImplementationInfo.CompliacneValue = "最近一周依从率为:" + PsCompliance.GetCompliacneRate(_cnCache, PatientId, PlanNo, Convert.ToInt32(weekPeriod[0]), Convert.ToInt32(weekPeriod[1])) + "%";
                    }

                    //读取任务列表
                    DataTable TaskList = new DataTable();
                    TaskList = PsTask.GetTaskList(_cnCache, PlanNo);
                    ImplementationInfo.TaskList = PsTask.GetSpTaskList(_cnCache, PlanNo);

                    //测量-体征切换下拉框
                    string condition = " Type = 'VitalSign'";
                    DataRow[] VitalSignRows = TaskList.Select(condition);
                    List<SignShow> SignList = new List<SignShow>();
                    for (int j = 0; j < VitalSignRows.Length; j++)
                    {
                        SignShow SignShow = new SignShow();
                        SignShow.SignName = VitalSignRows[j]["CodeName"].ToString();
                        SignShow.SignCode = VitalSignRows[j]["Code"].ToString();
                        SignList.Add(SignShow);
                    }
                    ImplementationInfo.SignList = SignList;

                    List<MstBloodPressure> reference = new List<MstBloodPressure>();
                    ChartData ChartData = new ChartData();
                    List<Graph> GraphList = new List<Graph>();
                    GraphGuide GraphGuide = new GraphGuide();

                    if (Module == "M1")  //后期维护的话,在这里添加不同的模块判断
                    {

                        //高血压模块  体征测量-血压(收缩压、舒张压)、脉率   【默认显示-收缩压,血压必有,脉率可能有】
                        condition = " Code = 'Bloodpressure|Bloodpressure_1' or  Code = 'Bloodpressure|Bloodpressure_2'or  Code = 'Pulserate|Pulserate_1'";
                        DataRow[] HyperTensionRows = TaskList.Select(condition);

                        //注意:需要兼容之前没有脉率的情况
                        if ((HyperTensionRows != null) && (HyperTensionRows.Length >= 2))  //M1 收缩压(默认显示)、舒张压、脉率  前两者肯定有,脉率不一定有
                        {
                            //获取血压的分级规则,脉率的分级原则写死在webservice
                            reference = CmMstBloodPressure.GetBPGrades(_cnCache);

                            //首次进入,默认加载收缩压
                            GraphList = CmMstBloodPressure.GetSignInfoByM1(_cnCache, PatientId, PlanNo, "Bloodpressure|Bloodpressure_1", ImplementationInfo.PlanList[0].StartDate, ImplementationInfo.PlanList[0].EndDate, reference);
                            //GraphList = CmMstBloodPressure.GetSignInfoByBP

                            //初始值、目标值、分级规则加工
                            if (GraphList.Count > 0)
                            {
                                GraphGuide = CmMstBloodPressure.GetGuidesByCode(_cnCache, PlanNo, "Bloodpressure|Bloodpressure_1", reference);
                                ChartData.GraphGuide = GraphGuide;
                            }
                        }
                    }

                    //必有测量任务,其他任务(例如吃药)可能没有

                    //其他任务依从情况
                    List<CompliacneDetailByD> TasksComByPeriod = new List<CompliacneDetailByD>();
                    if (TaskList.Rows.Count == VitalSignRows.Length)
                    {
                        ChartData.OtherTasks = "0";
                    }
                    else
                    {
                        ChartData.OtherTasks = "1";
                        TasksComByPeriod = PsCompliance.GetTasksComByPeriodWeb(_cnCache, PatientId, PlanNo, ImplementationInfo.PlanList[0].StartDate, ImplementationInfo.PlanList[0].EndDate);
                        if ((TasksComByPeriod != null) && (TasksComByPeriod.Count == GraphList.Count))
                        {
                            for (int rowsCount = 0; rowsCount < TasksComByPeriod.Count; rowsCount++)
                            {
                                GraphList[rowsCount].DrugValue = "1";   //已经初始化过
                                GraphList[rowsCount].DrugBullet = TasksComByPeriod[rowsCount].drugBullet;
                                GraphList[rowsCount].DrugColor = TasksComByPeriod[rowsCount].drugColor;
                                GraphList[rowsCount].DrugDescription = TasksComByPeriod[rowsCount].Events;
                            }
                        }
                    }
                    ChartData.GraphList = GraphList;
                    ImplementationInfo.ChartData = ChartData;
                }

                #endregion

                return ImplementationInfo;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "GetImplementationForWebFirst", "WebService调用异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                //return null;
                throw (ex);
            }
        }
コード例 #3
0
ファイル: Services.asmx.cs プロジェクト: SimonTDY/WebService
        public ImplementationInfo GetImplementationForWebSecond(string PatientId, string PlanNo)
        {
            ImplementationInfo ImplementationInfo = new ImplementationInfo();
            //string str_result = "";
            string Module = "";
            try
            {
                //Pad保证PlanNo输入不为空  为空的表示无当前计划,则显示无执行即可,无需连接网络服务

                if ((PlanNo != "") && (PlanNo != null)) //存在正在执行的计划
                {
                    //获取计划的相关信息
                    int planStatus = 0;

                    InterSystems.Data.CacheTypes.CacheSysList planInfo = null;
                    planInfo = PsPlan.GetPlanInfo(_cnCache, PlanNo);
                    if (planInfo != null)
                    {
                        planStatus = Convert.ToInt32(planInfo[5]);
                        Module = planInfo[4].ToString();

                        ImplementationInfo.StartDate = Convert.ToInt32(planInfo[2]);
                        ImplementationInfo.EndDate = Convert.ToInt32(planInfo[3]);

                    }

                    if (planStatus == 3) //是正在执行的当前计划
                    {
                        //剩余天数和进度
                        InterSystems.Data.CacheTypes.CacheSysList PRlist = null;
                        PRlist = PsPlan.GetProgressRate(_cnCache, PlanNo);
                        if (PRlist != null)
                        {
                            ImplementationInfo.RemainingDays = PRlist[0].ToString();
                            ImplementationInfo.ProgressRate = (Convert.ToDouble(PRlist[1]) * 100).ToString();

                        }

                        //最近一周的依从率
                        InterSystems.Data.CacheTypes.CacheSysList weekPeriod = null;
                        weekPeriod = PsPlan.GetWeekPeriod(_cnCache, ImplementationInfo.StartDate);
                        if (weekPeriod != null)
                        {
                            ImplementationInfo.CompliacneValue = "最近一周依从率为:" + PsCompliance.GetCompliacneRate(_cnCache, PatientId, PlanNo, Convert.ToInt32(weekPeriod[0]), Convert.ToInt32(weekPeriod[1])) + "%";
                        }
                    }
                    else  //已经结束计划
                    {
                        ImplementationInfo.RemainingDays = "0";
                        ImplementationInfo.ProgressRate = "100";
                        ImplementationInfo.CompliacneValue = "整个计划依从率为:" + PsCompliance.GetCompliacneRate(_cnCache, PatientId, PlanNo, ImplementationInfo.StartDate, ImplementationInfo.EndDate) + "%";
                    }

                    #region  读取任务执行情况,体征、用药等

                    //读取任务列表
                    DataTable TaskList = new DataTable();
                    TaskList = PsTask.GetTaskList(_cnCache, PlanNo);
                    ImplementationInfo.TaskList = PsTask.GetSpTaskList(_cnCache, PlanNo);

                    //测量-体征切换下拉框
                    string condition = " Type = 'VitalSign'";
                    DataRow[] VitalSignRows = TaskList.Select(condition);
                    List<SignShow> SignList = new List<SignShow>();
                    for (int j = 0; j < VitalSignRows.Length; j++)
                    {
                        SignShow SignShow = new SignShow();
                        SignShow.SignName = VitalSignRows[j]["CodeName"].ToString();
                        SignShow.SignCode = VitalSignRows[j]["Code"].ToString();
                        SignList.Add(SignShow);
                    }
                    ImplementationInfo.SignList = SignList;

                    List<MstBloodPressure> reference = new List<MstBloodPressure>();
                    ChartData ChartData = new ChartData();
                    List<Graph> GraphList = new List<Graph>();
                    GraphGuide GraphGuide = new GraphGuide();

                    if (Module == "M1")  //后期维护的话,在这里添加不同的模块判断
                    {

                        //高血压模块  体征测量-血压(收缩压、舒张压)、脉率   【默认显示-收缩压,血压必有,脉率可能有】
                        condition = " Code = 'Bloodpressure|Bloodpressure_1' or  Code = 'Bloodpressure|Bloodpressure_2'or  Code = 'Pulserate|Pulserate_1'";
                        DataRow[] HyperTensionRows = TaskList.Select(condition);

                        //注意:需要兼容之前没有脉率的情况
                        if ((HyperTensionRows != null) && (HyperTensionRows.Length >= 2))  //M1 收缩压(默认显示)、舒张压、脉率  前两者肯定有,脉率不一定有
                        {
                            //获取血压的分级规则,脉率的分级原则写死在webservice
                            reference = CmMstBloodPressure.GetBPGrades(_cnCache);

                            //首次进入,默认加载收缩压
                            GraphList = CmMstBloodPressure.GetSignInfoByM1(_cnCache, PatientId, PlanNo, "Bloodpressure|Bloodpressure_1", ImplementationInfo.StartDate, ImplementationInfo.EndDate, reference);

                            //初始值、目标值、分级规则加工
                            if (GraphList.Count > 0)
                            {
                                GraphGuide = CmMstBloodPressure.GetGuidesByCode(_cnCache, PlanNo, "Bloodpressure|Bloodpressure_1", reference);
                                ChartData.GraphGuide = GraphGuide;
                            }
                        }
                    }

                    //必有测量任务,其他任务(例如吃药)可能没有

                    //其他任务依从情况
                    List<CompliacneDetailByD> TasksComByPeriod = new List<CompliacneDetailByD>();
                    if (TaskList.Rows.Count == VitalSignRows.Length)
                    {
                        ChartData.OtherTasks = "0";
                    }
                    else
                    {
                        ChartData.OtherTasks = "1";
                        TasksComByPeriod = PsCompliance.GetTasksComByPeriodWeb(_cnCache, PatientId, PlanNo, ImplementationInfo.StartDate, ImplementationInfo.EndDate);
                        if ((TasksComByPeriod != null) && (TasksComByPeriod.Count == GraphList.Count))
                        {
                            for (int rowsCount = 0; rowsCount < TasksComByPeriod.Count; rowsCount++)
                            {
                                GraphList[rowsCount].DrugValue = "1";
                                GraphList[rowsCount].DrugBullet = TasksComByPeriod[rowsCount].drugBullet;
                                GraphList[rowsCount].DrugColor = TasksComByPeriod[rowsCount].drugColor;
                                GraphList[rowsCount].DrugDescription = TasksComByPeriod[rowsCount].Events;
                            }
                        }
                    }
                    ChartData.GraphList = GraphList;
                    ImplementationInfo.ChartData = ChartData;

                    #endregion
                }

                return ImplementationInfo;
                //str_result = JSONHelper.ObjectToJson(ImplementationInfo);
                //Context.Response.BinaryWrite(new byte[] { 0xEF, 0xBB, 0xBF });
                //Context.Response.Write(str_result);
                //HttpContext.Current.ApplicationInstance.CompleteRequest();
                //Context.Response.End();

            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "GetImplementationForPadSecond", "WebService调用异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                //return null;
                throw (ex);
            }
        }
コード例 #4
0
ファイル: Services.asmx.cs プロジェクト: SimonTDY/WebService
        public void GetImplementationForPhone(string PatientId, string Module)
        {
            ImplementationPhone ImplementationPhone = new ImplementationPhone();
            string str_result = "";
            try
            {
                //病人基本信息-头像、姓名.. (由于手机版只针对换换咋用户,基本信息可不用获取
                // CacheSysList patientList = PsBasicInfo.GetPatientBasicInfo(_cnCache, PatientId);
                //if (patientList != null)
                //{
                //ImplementationPhone.PatientInfo.PatientName = patientList[0];
                //}

                int planStartDate = 0;
                int planEndDate = 0;
                string PlanNo = "";

                InterSystems.Data.CacheTypes.CacheSysList planInfo = null;
                planInfo = PsPlan.GetExecutingPlanByM(_cnCache, PatientId, Module);
                if (planInfo != null)
                {
                    PlanNo = planInfo[0].ToString();
                    planStartDate = Convert.ToInt32(planInfo[2]);
                    planEndDate = Convert.ToInt32(planInfo[3]);  //未用到
                }

                if ((PlanNo != "") && (PlanNo != null)) //存在正在执行的计划
                {
                    ImplementationPhone.NowPlanNo = PlanNo;

                    //剩余天数和进度
                    InterSystems.Data.CacheTypes.CacheSysList PRlist = null;
                    PRlist = PsPlan.GetProgressRate(_cnCache, PlanNo);
                    if (PRlist != null)
                    {
                        ImplementationPhone.RemainingDays = PRlist[0].ToString();  //"距离本次计划结束还剩"+PRlist[0]+"天";
                        ImplementationPhone.ProgressRate = (Convert.ToDouble(PRlist[1]) * 100).ToString();  //"进度:"++"%";
                    }

                    //最近一周的依从率
                    InterSystems.Data.CacheTypes.CacheSysList weekPeriod = null;
                    weekPeriod = PsPlan.GetWeekPeriod(_cnCache, planStartDate);
                    if (weekPeriod != null)
                    {
                        ImplementationPhone.CompliacneValue = PsCompliance.GetCompliacneRate(_cnCache, PatientId, PlanNo, Convert.ToInt32(weekPeriod[0]), Convert.ToInt32(weekPeriod[1]));
                        ImplementationPhone.StartDate = Convert.ToInt32(weekPeriod[0]);  //用于获取血压的详细数据
                        ImplementationPhone.EndDate = Convert.ToInt32(weekPeriod[1]);
                    }

                    #region  读取任务执行情况,血压、用药-最近一周的数据

                    //读取任务  phone版 此函数其他任务也显示
                    DataTable TaskList = new DataTable();
                    TaskList = PsTask.GetTaskList(_cnCache, PlanNo);

                    //测量-体征切换下拉框
                    string condition = " Type = 'VitalSign'";
                    DataRow[] VitalSignRows = TaskList.Select(condition);
                    List<SignShow> SignList = new List<SignShow>();
                    for (int j = 0; j < VitalSignRows.Length; j++)
                    {
                        SignShow SignShow = new SignShow();
                        SignShow.SignName = VitalSignRows[j]["CodeName"].ToString();
                        SignShow.SignCode = VitalSignRows[j]["Code"].ToString();
                        SignList.Add(SignShow);
                    }
                    ImplementationPhone.SignList = SignList;

                    List<MstBloodPressure> reference = new List<MstBloodPressure>();
                    ChartData ChartData = new ChartData();
                    List<Graph> GraphList = new List<Graph>();
                    GraphGuide GraphGuide = new GraphGuide();

                    if (Module == "M1")  //后期维护的话,在这里添加不同的模块判断
                    {
                        condition = " Code = 'Bloodpressure|Bloodpressure_1' or  Code = 'Bloodpressure|Bloodpressure_2'or  Code = 'Pulserate|Pulserate_1'";
                        DataRow[] HyperTensionRows = TaskList.Select(condition);

                        //注意:需要兼容之前没有脉率的情况
                        if ((HyperTensionRows != null) && (HyperTensionRows.Length >= 2))  //M1 收缩压(默认显示)、舒张压、脉率  前两者肯定有,脉率不一定有
                        {
                            //获取血压的分级规则,脉率的分级原则写死在webservice
                            reference = CmMstBloodPressure.GetBPGrades(_cnCache);

                            //首次进入,默认加载收缩压
                            GraphList = CmMstBloodPressure.GetSignInfoByM1(_cnCache, PatientId, PlanNo, "Bloodpressure|Bloodpressure_1", Convert.ToInt32(weekPeriod[0]), Convert.ToInt32(weekPeriod[1]), reference);

                            //初始值、目标值、分级规则加工
                            if (GraphList.Count > 0)
                            {
                                GraphGuide = CmMstBloodPressure.GetGuidesByCode(_cnCache, PlanNo, "Bloodpressure|Bloodpressure_1", reference);
                                ChartData.GraphGuide = GraphGuide;
                            }
                        }

                    }
                    else
                    {

                    }

                    //必有测量任务,其他任务(例如吃药)可能没有
                    //其他任务依从情况 //是否有其他任务
                    List<CompliacneDetailByD> TasksComByPeriod = new List<CompliacneDetailByD>();
                    //string condition1 = " Type not in ('VitalSign,')";
                    if (TaskList.Rows.Count == VitalSignRows.Length)
                    {
                        ChartData.OtherTasks = "0";
                    }
                    else
                    {
                        ChartData.OtherTasks = "1";
                        TasksComByPeriod = PsCompliance.GetTasksComCountByPeriod(_cnCache, PatientId, PlanNo, Convert.ToInt32(weekPeriod[0]), Convert.ToInt32(weekPeriod[1]));
                        if ((TasksComByPeriod != null) && (TasksComByPeriod.Count == GraphList.Count))
                        {
                            for (int rowsCount = 0; rowsCount < TasksComByPeriod.Count; rowsCount++)
                            {
                                GraphList[rowsCount].DrugValue = "1";   //已经初始化过
                                GraphList[rowsCount].DrugBullet = TasksComByPeriod[rowsCount].drugBullet;
                                GraphList[rowsCount].DrugColor = TasksComByPeriod[rowsCount].drugColor;
                                GraphList[rowsCount].DrugDescription = TasksComByPeriod[rowsCount].Events;//+ "<br><a onclick= shuang shuang zz(); shuang shuang;>详细</a>"
                            }
                        }
                    }

                    #endregion

                    ChartData.GraphList = GraphList;
                    ImplementationPhone.ChartData = ChartData;
                }

                str_result = JSONHelper.ObjectToJson(ImplementationPhone);
                Context.Response.BinaryWrite(new byte[] { 0xEF, 0xBB, 0xBF });
                Context.Response.Write(str_result);
                HttpContext.Current.ApplicationInstance.CompleteRequest();
                //Context.Response.End();
                //return ImplementationInfo;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "GetImplementationForPhone", "WebService调用异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                //return null;
                throw (ex);
            }
        }
コード例 #5
0
ファイル: Services.asmx.cs プロジェクト: SimonTDY/WebService
        public void GetImplementationForPadFirst(string PatientId, string Module)
        {
            ImplementationInfo ImplementationInfo = new ImplementationInfo();
            string str_result = "";  //最终的输出-ImplementationInfo转化成json格式
            try
            {

                //与模块特性无关的公共项 ——病人基本信息、计划列表、计划进度、体征切换  不同模块可共用

                string PlanNo = "";

                //病人基本信息-姓名、头像..
                CacheSysList patientList = PsBasicInfo.GetPatientBasicInfo(_cnCache, PatientId);
                if (patientList != null)
                {
                    ImplementationInfo.PatientInfo.PatientName = patientList[0];

                    CacheSysList BasicInfoDetail = PsBasicInfoDetail.GetDetailInfo(_cnCache, PatientId);
                    if (BasicInfoDetail != null)
                    {
                        if (BasicInfoDetail[6] != null)
                        {
                            ImplementationInfo.PatientInfo.ImageUrl = BasicInfoDetail[6].ToString();
                        }
                        else
                        {
                            ImplementationInfo.PatientInfo.ImageUrl = "";  //js端意外不能识别null
                        }

                    }
                }

                //刚进入页面加载计划列表 (始终存在第一条-当前计划)
                ImplementationInfo.PlanList = PsPlan.GetPlanList34ByM(_cnCache, PatientId, Module);

                PlanNo = ImplementationInfo.PlanList[0].PlanNo; //肯定会存在

                #region  存在正在执行的计划

                if ((PlanNo != "") && (PlanNo != null))  //存在正在执行的计划
                {
                    //剩余天数和进度
                    InterSystems.Data.CacheTypes.CacheSysList PRlist = null;
                    PRlist = PsPlan.GetProgressRate(_cnCache, PlanNo);
                    if (PRlist != null)
                    {
                        ImplementationInfo.RemainingDays = PRlist[0].ToString();
                        ImplementationInfo.ProgressRate = (Convert.ToDouble(PRlist[1]) * 100).ToString();

                        ImplementationInfo.StartDate = ImplementationInfo.PlanList[0].StartDate;
                        ImplementationInfo.EndDate = ImplementationInfo.PlanList[0].EndDate;
                    }

                    //正在执行计划的最近一周的依从率
                    InterSystems.Data.CacheTypes.CacheSysList weekPeriod = null;
                    weekPeriod = PsPlan.GetWeekPeriod(_cnCache, ImplementationInfo.PlanList[0].StartDate);
                    if (weekPeriod != null)
                    {

                        ImplementationInfo.CompliacneValue = "最近一周依从率为:" + PsCompliance.GetCompliacneRate(_cnCache, PatientId, PlanNo, Convert.ToInt32(weekPeriod[0]), Convert.ToInt32(weekPeriod[1])) + "%";
                    }

                    //读取任务列表
                    DataTable TaskList = new DataTable();
                    TaskList = PsTask.GetTaskList(_cnCache, PlanNo);
                    //ImplementationInfo.TaskList = PsTask.GetSpTaskList(_cnCache, PlanNo);

                    //测量-体征切换下拉框
                    string condition = " Type = 'VitalSign'";
                    DataRow[] VitalSignRows = TaskList.Select(condition);
                    List<SignShow> SignList = new List<SignShow>();
                    for (int j = 0; j < VitalSignRows.Length; j++)
                    {
                        SignShow SignShow = new SignShow();
                        SignShow.SignName = VitalSignRows[j]["CodeName"].ToString();
                        SignShow.SignCode = VitalSignRows[j]["Code"].ToString();
                        SignList.Add(SignShow);
                    }
                    ImplementationInfo.SignList = SignList;

                    List<MstBloodPressure> reference = new List<MstBloodPressure>();
                    ChartData ChartData = new ChartData();
                    List<Graph> GraphList = new List<Graph>();
                    GraphGuide GraphGuide = new GraphGuide();

                    if (Module == "M1")  //后期维护的话,在这里添加不同的模块判断
                    {

                        //高血压模块  体征测量-血压(收缩压、舒张压)、脉率   【默认显示-收缩压,血压必有,脉率可能有】
                        condition = " Code = 'Bloodpressure|Bloodpressure_1' or  Code = 'Bloodpressure|Bloodpressure_2'or  Code = 'Pulserate|Pulserate_1'";
                        DataRow[] HyperTensionRows = TaskList.Select(condition);

                        //注意:需要兼容之前没有脉率的情况
                        if ((HyperTensionRows != null) && (HyperTensionRows.Length >= 2))  //M1 收缩压(默认显示)、舒张压、脉率  前两者肯定有,脉率不一定有
                        {
                            //从数据库获取血压的分级规则,脉率的分级原则写死在webservice
                            reference = CmMstBloodPressure.GetBPGrades(_cnCache);

                            //首次进入,默认加载收缩压
                            GraphList = CmMstBloodPressure.GetSignInfoByM1(_cnCache, PatientId, PlanNo, "Bloodpressure|Bloodpressure_1", ImplementationInfo.PlanList[0].StartDate, ImplementationInfo.PlanList[0].EndDate, reference);

                            //初始值、目标值、分级规则加工
                            if (GraphList.Count > 0)
                            {
                                GraphGuide = CmMstBloodPressure.GetGuidesByCode(_cnCache, PlanNo, "Bloodpressure|Bloodpressure_1", reference);
                                ChartData.GraphGuide = GraphGuide;
                            }
                        }

                    }
                    else
                    {

                    }

                    //必有测量任务,其他任务(例如吃药)可能没有

                    //其他任务依从情况  所有模块共有的
                    List<CompliacneDetailByD> TasksComByPeriod = new List<CompliacneDetailByD>();
                    //是否有其他任务
                    //string condition1 = " Type not in ('VitalSign,')";
                    if (TaskList.Rows.Count == VitalSignRows.Length)
                    {
                        ChartData.OtherTasks = "0";
                    }
                    else
                    {
                        ChartData.OtherTasks = "1";
                        TasksComByPeriod = PsCompliance.GetTasksComCountByPeriod(_cnCache, PatientId, PlanNo, ImplementationInfo.PlanList[0].StartDate, ImplementationInfo.PlanList[0].EndDate);
                        if ((TasksComByPeriod != null) && (TasksComByPeriod.Count == GraphList.Count)) //体征的数据条数一定等于其他任务的条数(天数) ,都是按照compliance的date统计的
                        {
                            for (int rowsCount = 0; rowsCount < TasksComByPeriod.Count; rowsCount++)
                            {
                                GraphList[rowsCount].DrugValue = "1";   //已经初始化过
                                GraphList[rowsCount].DrugBullet = TasksComByPeriod[rowsCount].drugBullet;
                                GraphList[rowsCount].DrugColor = TasksComByPeriod[rowsCount].drugColor;
                                GraphList[rowsCount].DrugDescription = TasksComByPeriod[rowsCount].Events;//+ "<br><a onclick= shuang shuang zz(); shuang shuang;>详细</a>"
                            }
                        }
                    }

                    ChartData.GraphList = GraphList;
                    ImplementationInfo.ChartData = ChartData;
                }

                #endregion

                str_result = JSONHelper.ObjectToJson(ImplementationInfo);
                Context.Response.BinaryWrite(new byte[] { 0xEF, 0xBB, 0xBF });
                Context.Response.Write(str_result);
                HttpContext.Current.ApplicationInstance.CompleteRequest();
                //Context.Response.End();
                //return ImplementationInfo;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "GetImplementationForPadFirst", "WebService调用异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                //return null;
                throw (ex);
            }
        }
コード例 #6
0
        public string OtherTasks { get; set; }    // 1有 0没有

        public ChartData()
        {
            GraphList = new List<Graph>();
            GraphGuide = new GraphGuide();
            OtherTasks = "0";
        }
コード例 #7
0
        }                                         // 1有 0没有

        public ChartData()
        {
            GraphList  = new List <Graph>();
            GraphGuide = new GraphGuide();
            OtherTasks = "0";
        }
コード例 #8
0
        //GetGuidesByCode LS 2015-06-28 输出用于图形的分级区域
        public static GraphGuide GetGuidesByCode(DataConnection pclsCache, string PlanNo, string Code, List<MstBloodPressure> Reference)
        {

            GraphGuide GraphGuide = new GraphGuide();   //输出

            List<Guide> GuideList = new List<Guide>();


            try
            {


                if ((Code == "Bloodpressure|Bloodpressure_1") && (Reference != null))
                {
                    #region 收缩压

                    GraphGuide.minimum = Convert.ToDouble(Reference[0].SBP);
                    GraphGuide.maximum = Convert.ToDouble(Reference[Reference.Count - 1].SBP);

                    InterSystems.Data.CacheTypes.CacheSysList SysTarget = null;
                    SysTarget = PsTarget.GetTargetByCode(pclsCache, PlanNo, "Bloodpressure", "Bloodpressure_1");
                    if (SysTarget != null)
                    {
                        //初始值
                        Guide originalGuide = new Guide();
                        originalGuide.value = SysTarget[4].ToString(); //值或起始值
                        originalGuide.toValue = "#CC0000";           //终值或""
                        originalGuide.label = "";      //中文定义 目标线、偏低、偏高等
                        //originalGuide.label = "起始" + ":" + originalGuide.value;
                        originalGuide.lineColor = "#FF5151";          //直线颜色  目标线  初始线
                        originalGuide.lineAlpha = "1";//直线透明度 0全透~1
                        originalGuide.dashLength = "8"; //虚线密度  4  8
                        originalGuide.color = "#CC0000";    //字体颜色
                        originalGuide.fontSize = "8"; //字体大小  默认14
                        originalGuide.position = "right"; //字体位置 right left
                        originalGuide.inside = "";//坐标系的内或外  false
                        originalGuide.fillAlpha = "";
                        originalGuide.fillColor = "";

                        GuideList.Add(originalGuide);
                        GraphGuide.original = originalGuide.value + "mmHg";


                        //目标值
                        Guide tagetGuide = new Guide();
                        tagetGuide.value = SysTarget[3].ToString();
                        tagetGuide.toValue = "#CC0000";
                        tagetGuide.label = "";
                        //tagetGuide.label = "目标" + ":" + tagetGuide.value;
                        tagetGuide.lineColor = "#CC0000";
                        tagetGuide.lineAlpha = "1";
                        tagetGuide.dashLength = "4";
                        tagetGuide.color = "#CC0000";
                        tagetGuide.fontSize = "14";
                        tagetGuide.position = "right";
                        tagetGuide.inside = "";
                        tagetGuide.fillAlpha = "";
                        tagetGuide.fillColor = "";

                        GuideList.Add(tagetGuide);
                        GraphGuide.target = tagetGuide.value + "mmHg";
                    }

                    //风险范围
                    for (int i = 0; i <= Reference.Count - 2; i++)
                    {
                        //收缩压
                        Guide SysGuide = new Guide();
                        SysGuide.value = Reference[i].SBP.ToString(); //起始值
                        SysGuide.toValue = Reference[i + 1].SBP.ToString();                //终值
                        SysGuide.label = Reference[i].Name;          //偏低、偏高等
                        SysGuide.lineColor = "";     //直线颜色  目标线  初始线
                        SysGuide.lineAlpha = "";   //直线透明度 0全透~1
                        SysGuide.dashLength = "";  //虚线密度  4  8
                        SysGuide.color = "#CC0000";     //字体颜色
                        SysGuide.fontSize = "14";   //字体大小  默认14
                        SysGuide.position = "right";    //字体位置 right left
                        SysGuide.inside = "true";      //坐标系的内或外  false
                        SysGuide.fillAlpha = "0.1";
                        SysGuide.fillColor = CmMstBloodPressure.GetBPColor(SysGuide.label, "fill");   //GetFillColor
                        GuideList.Add(SysGuide);

                    }

                    //一般线
                    for (int i = 0; i <= Reference.Count - 1; i++)
                    {
                        //收缩压
                        Guide SysGuide = new Guide();
                        SysGuide.value = Reference[i].SBP.ToString();
                        SysGuide.toValue = "#CC0000";
                        SysGuide.label = Reference[i].SBP.ToString();
                        SysGuide.lineColor = "#CC0000";
                        SysGuide.lineAlpha = "0.15";
                        SysGuide.dashLength = "";
                        SysGuide.color = "#CC0000";
                        SysGuide.fontSize = "8";
                        SysGuide.position = "left";
                        SysGuide.inside = "";
                        SysGuide.fillAlpha = "";
                        SysGuide.fillColor = "";
                        GuideList.Add(SysGuide);

                    }

                    #endregion
                }
                else if ((Code == "Bloodpressure|Bloodpressure_2") && (Reference != null))
                {
                    #region 舒张压
                    GraphGuide.minimum = Convert.ToDouble(Reference[0].DBP);
                    GraphGuide.maximum = Convert.ToDouble(Reference[Reference.Count - 1].DBP);

                    InterSystems.Data.CacheTypes.CacheSysList DiaTarget = null;
                    DiaTarget = PsTarget.GetTargetByCode(pclsCache, PlanNo, "Bloodpressure", "Bloodpressure_2");

                    if (DiaTarget != null)
                    {
                        //初始值
                        Guide originalGuide = new Guide();
                        originalGuide.value = DiaTarget[4].ToString(); //值或起始值
                        originalGuide.toValue = "#CC0000";           //终值或""
                        originalGuide.label = "";      //中文定义 目标线、偏低、偏高等
                        //originalGuide.label = "起始" + ":" + originalGuide.value;
                        originalGuide.lineColor = "#FF5151";          //直线颜色  目标线  初始线
                        originalGuide.lineAlpha = "1";//直线透明度 0全透~1
                        originalGuide.dashLength = "8"; //虚线密度  4  8
                        originalGuide.color = "#CC0000";    //字体颜色
                        originalGuide.fontSize = "8"; //字体大小  默认14
                        originalGuide.position = "right"; //字体位置 right left
                        originalGuide.inside = "";//坐标系的内或外  false
                        originalGuide.fillAlpha = "";
                        originalGuide.fillColor = "";

                        GuideList.Add(originalGuide);
                        GraphGuide.original = originalGuide.value + "mmHg";

                        //目标值
                        Guide tagetGuide = new Guide();
                        tagetGuide.value = DiaTarget[3].ToString();
                        tagetGuide.toValue = "#CC0000";
                        tagetGuide.label = "";
                        //tagetGuide.label = "目标" + ":" + tagetGuide.value;
                        tagetGuide.lineColor = "#CC0000";
                        tagetGuide.lineAlpha = "1";
                        tagetGuide.dashLength = "4";
                        tagetGuide.color = "#CC0000";
                        tagetGuide.fontSize = "14";
                        tagetGuide.position = "right";
                        tagetGuide.inside = "";
                        tagetGuide.fillColor = "";
                        tagetGuide.fillAlpha = "";

                        GuideList.Add(tagetGuide);
                        GraphGuide.target = tagetGuide.value + "mmHg";
                    }

                    //风险范围
                    for (int i = 0; i <= Reference.Count - 2; i++)
                    {
                        //舒张压
                        Guide DiaGuide = new Guide();
                        DiaGuide.value = Reference[i].DBP.ToString();
                        DiaGuide.toValue = Reference[i + 1].DBP.ToString();
                        DiaGuide.label = Reference[i].Name;
                        DiaGuide.lineColor = "";
                        DiaGuide.lineAlpha = "";
                        DiaGuide.dashLength = "";
                        DiaGuide.color = "#CC0000";
                        DiaGuide.fontSize = "14";
                        DiaGuide.position = "right";
                        DiaGuide.inside = "true";
                        DiaGuide.fillAlpha = "0.1";
                        DiaGuide.fillColor = CmMstBloodPressure.GetBPColor(DiaGuide.label, "fill");

                        GuideList.Add(DiaGuide);

                    }

                    //一般线
                    for (int i = 0; i <= Reference.Count - 1; i++)
                    {
                        //舒张压
                        Guide DiaGuide = new Guide();
                        DiaGuide.value = Reference[i].DBP.ToString();
                        DiaGuide.toValue = "#CC0000";
                        DiaGuide.label = Reference[i].DBP.ToString();
                        DiaGuide.lineColor = "#CC0000";
                        DiaGuide.lineAlpha = "0.15";
                        DiaGuide.dashLength = "";
                        DiaGuide.color = "#CC0000";
                        DiaGuide.fontSize = "8";
                        DiaGuide.position = "left";
                        DiaGuide.inside = "";
                        DiaGuide.fillAlpha = "";
                        DiaGuide.fillColor = "";

                        GuideList.Add(DiaGuide);

                    }

                    #endregion
                }
                else if (Code == "Pulserate|Pulserate_1") //脉率没有 初始值和目标值
                {
                    #region 脉率
                    GraphGuide.minimum = 30;
                    GraphGuide.maximum = 150;

                    ////初始值
                    //Guide originalGuide = new Guide();
                    //originalGuide.value =""; //值或起始值
                    //originalGuide.toValue = "#CC0000";           //终值或""
                    //originalGuide.label = "";      //中文定义 目标线、偏低、偏高等
                    ////originalGuide.label = "起始" + ":" + originalGuide.value;
                    //originalGuide.lineColor = "#FF5151";          //直线颜色  目标线  初始线
                    //originalGuide.lineAlpha = "1";//直线透明度 0全透~1
                    //originalGuide.dashLength = "8"; //虚线密度  4  8
                    //originalGuide.color = "#CC0000";    //字体颜色
                    //originalGuide.fontSize = "8"; //字体大小  默认14
                    //originalGuide.position = "right"; //字体位置 right left
                    //originalGuide.inside = "";//坐标系的内或外  false
                    //originalGuide.fillAlpha = "";
                    //originalGuide.fillColor = "";

                    //GuideList.Add(originalGuide);
                    //GraphGuide.original = originalGuide.value;

                    ////目标值
                    //Guide tagetGuide = new Guide();
                    //tagetGuide.value = "";
                    //tagetGuide.toValue = "#CC0000";
                    //tagetGuide.label = "";
                    ////tagetGuide.label = "目标" + ":" + tagetGuide.value;
                    //tagetGuide.lineColor = "#CC0000";
                    //tagetGuide.lineAlpha = "1";
                    //tagetGuide.dashLength = "4";
                    //tagetGuide.color = "#CC0000";
                    //tagetGuide.fontSize = "14";
                    //tagetGuide.position = "right";
                    //tagetGuide.inside = "";
                    //tagetGuide.fillColor = "";
                    //tagetGuide.fillAlpha = "";


                    //风险范围
                    //正常
                    Guide PulseGuide = new Guide();
                    PulseGuide.value = "60";
                    PulseGuide.toValue = "100";
                    PulseGuide.label = "正常";
                    PulseGuide.lineColor = "";
                    PulseGuide.lineAlpha = "";
                    PulseGuide.dashLength = "";
                    PulseGuide.color = "#00DB00";  //字的颜色
                    PulseGuide.fontSize = "14";
                    PulseGuide.position = "right";
                    PulseGuide.inside = "true";
                    PulseGuide.fillAlpha = "0.1";
                    PulseGuide.fillColor = "#2894FF";  //区域颜色
                    GuideList.Add(PulseGuide);

                    //偏高 #CC0000
                    PulseGuide = new Guide();
                    PulseGuide.value = "100";
                    PulseGuide.toValue = "150";
                    PulseGuide.label = "偏高";
                    PulseGuide.lineColor = "";
                    PulseGuide.lineAlpha = "";
                    PulseGuide.dashLength = "";
                    PulseGuide.color = "#FF60AF";
                    PulseGuide.fontSize = "14";
                    PulseGuide.position = "right";
                    PulseGuide.inside = "true";
                    PulseGuide.fillAlpha = "0.1";
                    PulseGuide.fillColor = "#CC0000";
                    GuideList.Add(PulseGuide);

                    //偏低
                    PulseGuide = new Guide();
                    PulseGuide.value = "30";
                    PulseGuide.toValue = "60";
                    PulseGuide.label = "偏低";
                    PulseGuide.lineColor = "";
                    PulseGuide.lineAlpha = "";
                    PulseGuide.dashLength = "";
                    PulseGuide.color = "#8080C0";
                    PulseGuide.fontSize = "14";
                    PulseGuide.position = "right";
                    PulseGuide.inside = "true";
                    PulseGuide.fillAlpha = "0.1";
                    PulseGuide.fillColor = "#FFC78E";
                    GuideList.Add(PulseGuide);


                    //一般线

                    //30
                    PulseGuide = new Guide();
                    PulseGuide.value = "30";
                    PulseGuide.toValue = "#CC0000";
                    PulseGuide.label = "30";
                    PulseGuide.lineColor = "#CC0000";
                    PulseGuide.lineAlpha = "0.15";
                    PulseGuide.dashLength = "";
                    PulseGuide.color = "#CC0000";
                    PulseGuide.fontSize = "8";
                    PulseGuide.position = "left";
                    PulseGuide.inside = "";
                    PulseGuide.fillAlpha = "";
                    PulseGuide.fillColor = "";
                    GuideList.Add(PulseGuide);


                    //60
                    PulseGuide = new Guide();
                    PulseGuide.value = "60";
                    PulseGuide.toValue = "#CC0000";
                    PulseGuide.label = "60";
                    PulseGuide.lineColor = "#CC0000";
                    PulseGuide.lineAlpha = "0.15";
                    PulseGuide.dashLength = "";
                    PulseGuide.color = "#CC0000";
                    PulseGuide.fontSize = "8";
                    PulseGuide.position = "left";
                    PulseGuide.inside = "";
                    PulseGuide.fillAlpha = "";
                    PulseGuide.fillColor = "";
                    GuideList.Add(PulseGuide);

                    //100
                    PulseGuide = new Guide();
                    PulseGuide.value = "100";
                    PulseGuide.toValue = "#CC0000";
                    PulseGuide.label = "100";
                    PulseGuide.lineColor = "#CC0000";
                    PulseGuide.lineAlpha = "0.15";
                    PulseGuide.dashLength = "";
                    PulseGuide.color = "#CC0000";
                    PulseGuide.fontSize = "8";
                    PulseGuide.position = "left";
                    PulseGuide.inside = "";
                    PulseGuide.fillAlpha = "";
                    PulseGuide.fillColor = "";
                    GuideList.Add(PulseGuide);

                    #endregion
                }

                GraphGuide.GuideList = GuideList;
                return GraphGuide;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "CmMstBloodPressure.GetGuidesByCode", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return null;
            }
            finally
            {
            }
        }