Пример #1
0
        public FixedDocumentSequence getReport()
        {
            if (!string.IsNullOrEmpty(this.CardID))
            {
                List <ListValue> list = new List <ListValue>();
                BaseModel = new RecordsBaseInfoBLL().GetModel(this.CardID);
                if (BaseModel != null)
                {
                    list.Add(new ListValue
                    {
                        strMark = "$name",
                        strVal  = BaseModel.CustomerName
                    });
                    list.Add(new ListValue
                    {
                        strMark = "$archiveid",
                        strVal  = BaseModel.RecordID
                    });
                }
                #region 健康问询
                HealthAssessExamModel model1 = new HealthAssessExamBLL().GetMaxModel(this.CardID);
                if (model1 != null)
                {
                    list.Add(new ListValue
                    {
                        strMark = "#jzjb",
                        strVal  = model1.FamilyHistory
                    });
                    list.Add(new ListValue
                    {
                        strMark = "#jb",
                        strVal  = model1.MedicalHistory
                    });
                    list.Add(new ListValue
                    {
                        strMark = "#yscs",
                        strVal  = model1.DietaryHabit
                    });
                    list.Add(new ListValue
                    {
                        strMark = "#ysglx",
                        strVal  = model1.DietaryLaw
                    });
                    list.Add(new ListValue
                    {
                        strMark = "$ysqt",
                        strVal  = model1.DietaryOther
                    });

                    list.Add(new ListValue
                    {
                        strMark = "#dlpl",
                        strVal  = model1.ExerciseRate
                    });
                    list.Add(new ListValue
                    {
                        strMark = "$dlsj",
                        strVal  = model1.ExerciseTimes.ToString()
                    });
                    list.Add(new ListValue
                    {
                        strMark = "#zys",
                        strVal  = model1.HospitalHistory
                    });
                    list.Add(new ListValue
                    {
                        strMark = "#fy",
                        strVal  = model1.TakingMedicine
                    });
                    list.Add(new ListValue
                    {
                        strMark = "#zlnl",
                        strVal  = model1.OldSelfCareability
                    });
                    list.Add(new ListValue
                    {
                        strMark = "$zldf",
                        strVal  = model1.GloomyScore.ToString()
                    });
                    string strtyfs = "";
                    if (!string.IsNullOrEmpty(model1.ExerciseExistense))
                    {
                        foreach (char c in model1.ExerciseExistense)
                        {
                            switch (c)
                            {
                            case '1': strtyfs = strtyfs + "散步;";
                                break;

                            case '2': strtyfs = strtyfs + "跑步;";
                                break;

                            case '3': strtyfs = strtyfs + "广场舞;";
                                break;

                            default: break;
                            }
                        }
                    }
                    if (!string.IsNullOrEmpty(model1.ExerciseExistenseOther))
                    {
                        strtyfs = strtyfs + model1.ExerciseExistenseOther + ";";
                    }
                    list.Add(new ListValue
                    {
                        strMark = "$dlfs",
                        strVal  = strtyfs
                    });
                    #region 体检评估
                    HealthHouseModel model2 = new HealthHouseBLL().GetDataByID(model1.PID);
                    if (model2 != null)
                    {
                        list.Add(new ListValue
                        {
                            strMark = "$tjsj",
                            strVal  = DrawItems.strToDate(model2.CheckDate)
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$bmi",
                            strVal  = model2.BMI.ToString()
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$gy",
                            strVal  = model2.LeftHeight.ToString()
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$dy",
                            strVal  = model2.LeftPre.ToString()
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$ml",
                            strVal  = model2.PulseRate.ToString()
                        });
                        list.Add(new ListValue
                        {
                            strMark = "$xy",
                            strVal  = model2.BloodOxygen
                        });

                        HealthHouseBCHAOModel BchaoModel = new HealthHouseBCHAOBLL().GetModel(model2.ID);//B超表
                        if (BchaoModel != null)
                        {
                            list.Add(new ListValue
                            {
                                strMark = "#bc",
                                strVal  = BchaoModel.BCHAO
                            });
                        }
                        HealthHouseEcgModel EcgModel = new HealthHouseEcgBLL().GetModel(model2.ID);//心电
                        if (EcgModel != null)
                        {
                            list.Add(new ListValue
                            {
                                strMark = "#xd",
                                strVal  = EcgModel.ECG
                            });
                        }
                        HHCardiovascularModel VascularModel = new HHCardiovascularBLL().GetData(this.CardID, model2.ID);//心血管
                        if (VascularModel != null)
                        {
                            list.Add(new ListValue
                            {
                                strMark = "#xx",
                                strVal  = VascularModel.Result
                            });
                        }
                        HHBoneModel BoneModel = new HHBoneBLL().GetData(this.CardID, model2.ID);//骨密度
                        if (BoneModel != null)
                        {
                            list.Add(new ListValue
                            {
                                strMark = "#gm",
                                strVal  = BoneModel.Result
                            });
                        }
                        HHLungModel LungModel = new HHLungBLL().GetData(this.CardID, model2.ID);//肺功能
                        if (LungModel != null)
                        {
                            list.Add(new ListValue
                            {
                                strMark = "#fg",
                                strVal  = LungModel.Result
                            });
                        }
                        HealthHousePhysicalAssistCheckModel HHAssistCheck = new HealthHousePhysicalAssistCheckBLL().GetModel(model2.ID);//辅助检查表
                        if (HHAssistCheck != null)
                        {
                            list.Add(new ListValue
                            {
                                strMark = "#xb",
                                strVal  = HHAssistCheck.CHESTX
                            });
                            if (!string.IsNullOrEmpty(HHAssistCheck.PRO) &&
                                !string.IsNullOrEmpty(HHAssistCheck.GLU) &&
                                !string.IsNullOrEmpty(HHAssistCheck.KET) &&
                                !string.IsNullOrEmpty(HHAssistCheck.BLD))
                            {
                                if (HHAssistCheck.PRO.Contains("+") ||
                                    HHAssistCheck.GLU.Contains("+") ||
                                    HHAssistCheck.KET.Contains("+") ||
                                    HHAssistCheck.BLD.Contains("+"))
                                {
                                    list.Add(new ListValue
                                    {
                                        strMark = "#nc",
                                        strVal  = "2"
                                    });
                                }
                                else
                                {
                                    list.Add(new ListValue
                                    {
                                        strMark = "#nc",
                                        strVal  = "1"
                                    });
                                }
                            }
                        }
                        HealthHouseMediPhyModel MedModel = new HealthHouseMediPhyBLL().GetModel(model2.ID);//中医体质类型
                        if (MedModel != null)
                        {
                            string strMed = "";
                            if (!string.IsNullOrEmpty(MedModel.Mild))
                            {
                                strMed += "平和质,";
                            }
                            if (!string.IsNullOrEmpty(MedModel.Faint))
                            {
                                strMed += "气虚质,";
                            }
                            if (!string.IsNullOrEmpty(MedModel.Yang))
                            {
                                strMed += "阳虚质,";
                            }
                            if (!string.IsNullOrEmpty(MedModel.Yin))
                            {
                                strMed += "阴虚质,";
                            }
                            if (!string.IsNullOrEmpty(MedModel.PhlegmDamp))
                            {
                                strMed += "痰湿质,";
                            }
                            if (!string.IsNullOrEmpty(MedModel.Muggy))
                            {
                                strMed += "湿热质,";
                            }
                            if (!string.IsNullOrEmpty(MedModel.BloodStasis))
                            {
                                strMed += "血瘀质,";
                            }
                            if (!string.IsNullOrEmpty(MedModel.QiConstraint))
                            {
                                strMed += "气郁质,";
                            }
                            if (!string.IsNullOrEmpty(MedModel.Characteristic))
                            {
                                strMed += "特兼质,";
                            }
                            if (strMed != "")
                            {
                                list.Add(new ListValue
                                {
                                    strMark = "$zytz",
                                    strVal  = strMed.Remove(strMed.Length - 1, 1)
                                });
                            }
                        }
                    }

                    #endregion
                    #region 范围值
                    List <HealthOverviewSetModel> SetList = new List <HealthOverviewSetModel>();
                    SetList = new HealthOverviewSetBLL().GetList(" and Type in (1,2,3,4) ");
                    string strBMI = "", strxueya = "", strxinlv = "", strxueyang = "";
                    if (SetList != null)
                    {
                        foreach (HealthOverviewSetModel setmodel in SetList)
                        {
                            if (setmodel.Type == "1")//体质指数
                            {
                                strBMI = setmodel.minValues + "~" + setmodel.maxValues;
                            }
                            else if (setmodel.Type == "2")//血压
                            {
                                strxueya = setmodel.minValues + "~" + setmodel.maxValues;
                            }
                            else if (setmodel.Type == "3")//心率
                            {
                                strxinlv = setmodel.minValues + "~" + setmodel.maxValues;
                            }
                            else if (setmodel.Type == "4")//血氧
                            {
                                strxueyang = setmodel.minValues + "~" + setmodel.maxValues;
                            }
                        }
                    }
                    list.Add(new ListValue
                    {
                        strMark = "$bmifw",
                        strVal  = strBMI
                    });
                    list.Add(new ListValue
                    {
                        strMark = "$xzfw",
                        strVal  = strxueya
                    });
                    list.Add(new ListValue
                    {
                        strMark = "$xlfw",
                        strVal  = strxinlv
                    });
                    list.Add(new ListValue
                    {
                        strMark = "$xyfw",
                        strVal  = strxueyang
                    });
                    #endregion
                }
                #endregion
                return(DrawItems.setPage("printXps\\" + PrintName, list));
            }
            return(null);
        }
Пример #2
0
        public void InitEveryThing()
        {
            HealthHouseModel houseModel = new HealthHouseModel();

            if (HealthAssessFactory.ID == 0)//新增时
            {
                houseModel             = healthHouseBLL.GetMaxData(this.Model.IDCardNo);
                HealthAssessFactory.ID = houseModel.ID;
            }
            else //查询时
            {
                houseModel = healthHouseBLL.GetDataByID(HealthAssessFactory.ID);
            }

            this.AssessModel = new HealthAssessModel {
                IDCardNo = this.Model.IDCardNo
            };
            List <HealthOverviewSetModel> SetList = new List <HealthOverviewSetModel>();

            SetList = new HealthOverviewSetBLL().GetList(" and Type in (1,2,3,4) ");

            if (houseModel != null)
            {
                HealthAssessFactory.ID     = houseModel.ID;
                this.AssessModel.PID       = houseModel.ID;
                this.AssessModel.CheckDate = houseModel.CheckDate;

                this.lbBMI.Text     = houseModel.BMI.ToString();         //体质指数
                this.lbXueYa.Text   = "收缩压:" + houseModel.LeftHeight.ToString();
                this.lbxinlv.Text   = houseModel.PulseRate.ToString();   //心率
                this.lbxueyang.Text = houseModel.BloodOxygen.ToString(); //血氧

                if (SetList == null)
                {
                    this.AssessModel.BasicTest = "";
                    this.AssessModel.Blood     = "";
                    this.AssessModel.PulseRate = "";
                    this.AssessModel.Oxygen    = "";
                    this.AssessModel.Urine     = "";
                }
                else
                {
                    foreach (HealthOverviewSetModel hs in SetList)
                    {
                        if (hs.Type == "1")//体质指数
                        {
                            this.lbBMI.Text += "  参考范围:" + hs.minValues + " ~ " + hs.maxValues;
                            int res = Compare(houseModel.BMI.ToString(), hs.maxValues, hs.minValues);
                            if (res == 2 || res == 1)
                            {
                                this.lbBMI.ForeColor = Color.Red;
                            }
                        }
                        else if (hs.Type == "2")//血压
                        {
                            string[] Hmax = hs.maxValues.Split('/');
                            string[] Hmin = hs.minValues.Split('/');
                            bool     flag = false;

                            if (Hmax.Length == 2)
                            {
                                this.lbXueYa.Text += "  参考范围:" + Hmax[0] + " ~  " + Hmax[1];
                                if (Compare(houseModel.LeftHeight.ToString(), Hmax[0], Hmax[1]) == 1)
                                {
                                    this.lbXueYa.ForeColor = Color.Red;
                                }
                            }
                            this.lbXueYa.Text += "    舒张压:" + houseModel.LeftPre.ToString() + "   ";
                            if (Hmin.Length == 2)
                            {
                                this.lbXueYa.Text += "  参考范围:" + Hmin[0] + " ~  " + Hmin[1];
                                if (Compare(houseModel.LeftPre.ToString(), Hmin[0], Hmin[1]) == 2)
                                {
                                    this.lbXueYa.ForeColor = Color.Red;
                                }
                            }
                        }
                        else if (hs.Type == "3")//心率
                        {
                            this.lbxinlv.Text += "  参考范围:" + hs.maxValues + " ~  " + hs.minValues;
                            int res = Compare(houseModel.PulseRate.ToString(), hs.maxValues, hs.minValues);
                            if (res == 2 || res == 1)
                            {
                                this.lbxinlv.ForeColor = Color.Red;
                            }
                        }
                        else if (hs.Type == "4")//血氧
                        {
                            this.lbxueyang.Text += "  参考范围:" + hs.maxValues + " ~  " + hs.minValues;
                            int res = Compare(houseModel.BloodOxygen.ToString(), hs.maxValues, hs.minValues);

                            if (res == 2 || res == 1)
                            {
                                this.lbxueyang.ForeColor = Color.Red;
                                this.AssessModel.Oxygen  = "偏低";
                            }
                        }
                    }
                }
                HealthHousePhysicalAssistCheckModel HHAssistCheck = new HealthHousePhysicalAssistCheckBLL().GetModel(houseModel.ID);//辅助检查表
                if (HHAssistCheck != null)
                {
                    if (HHAssistCheck.CHESTX == "1")
                    {
                        this.lbXiongBu.Text = "正常";
                    }
                    else if (HHAssistCheck.CHESTX == "2")
                    {
                        this.lbXiongBu.ForeColor = Color.Red;
                        this.lbXiongBu.Text      = "异常";
                    }
                    if (!string.IsNullOrEmpty(HHAssistCheck.PRO) &&
                        !string.IsNullOrEmpty(HHAssistCheck.GLU) &&
                        !string.IsNullOrEmpty(HHAssistCheck.KET) &&
                        !string.IsNullOrEmpty(HHAssistCheck.BLD))
                    {
                        if (HHAssistCheck.PRO.Contains("+") ||
                            HHAssistCheck.GLU.Contains("+") ||
                            HHAssistCheck.KET.Contains("+") ||
                            HHAssistCheck.BLD.Contains("+"))
                        {
                            this.lbniao.ForeColor = Color.Red;
                            this.lbniao.Text      = "异常";
                        }
                        else
                        {
                            this.lbniao.Text = "正常";
                        }
                    }
                }
                HealthHouseBCHAOModel BchaoModel = new HealthHouseBCHAOBLL().GetModel(houseModel.ID);//B超表
                if (BchaoModel != null)
                {
                    if (BchaoModel.BCHAO == "1")
                    {
                        this.lbBchao.Text = "正常";
                    }
                    else if (BchaoModel.BCHAO == "2")
                    {
                        this.lbBchao.ForeColor = Color.Red;
                        this.lbBchao.Text      = "异常";
                    }
                }
                HealthHouseEcgModel EcgModel = new HealthHouseEcgBLL().GetModel(houseModel.ID);//心电
                if (EcgModel != null)
                {
                    if (EcgModel.ECG == "1")
                    {
                        this.lbEcg.Text = "正常";
                    }
                    else if (EcgModel.ECG == "2")
                    {
                        this.lbEcg.ForeColor = Color.Red;
                        this.lbEcg.Text      = "异常";
                    }
                }
                HHCardiovascularModel VascularModel = new HHCardiovascularBLL().GetData(this.Model.IDCardNo, houseModel.ID);//心血管
                if (VascularModel != null)
                {
                    if (VascularModel.Result == "1")
                    {
                        this.lbVascular.Text = "正常";
                    }
                    else if (VascularModel.Result == "2")
                    {
                        this.lbVascular.ForeColor = Color.Red;
                        this.lbVascular.Text      = "异常";
                    }
                }
                HHBoneModel BoneModel = new HHBoneBLL().GetData(this.Model.IDCardNo, houseModel.ID);//骨密度
                if (BoneModel != null)
                {
                    if (BoneModel.Result == "1")
                    {
                        this.lbBone.Text = "正常";
                    }
                    else if (BoneModel.Result == "2")
                    {
                        this.lbBone.ForeColor = Color.Red;
                        this.lbBone.Text      = "异常";
                    }
                }
                HHLungModel LungModel = new HHLungBLL().GetData(this.Model.IDCardNo, houseModel.ID);//肺功能
                if (LungModel != null)
                {
                    if (LungModel.Result == "1")
                    {
                        this.lbLung.Text = "正常";
                    }
                    else if (LungModel.Result == "2")
                    {
                        this.lbLung.ForeColor = Color.Red;
                        this.lbLung.Text      = "异常";
                    }
                }
                HealthHouseMediPhyModel MedModel = new HealthHouseMediPhyBLL().GetModel(houseModel.ID);//中医体质类型
                if (MedModel != null)
                {
                    string strMed = "";
                    if (!string.IsNullOrEmpty(MedModel.Mild))
                    {
                        strMed += "平和质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.Faint))
                    {
                        strMed += "气虚质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.Yang))
                    {
                        strMed += "阳虚质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.Yin))
                    {
                        strMed += "阴虚质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.PhlegmDamp))
                    {
                        strMed += "痰湿质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.Muggy))
                    {
                        strMed += "湿热质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.BloodStasis))
                    {
                        strMed += "血瘀质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.QiConstraint))
                    {
                        strMed += "气郁质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.Characteristic))
                    {
                        strMed += "特兼质,";
                    }
                    if (strMed != "")
                    {
                        this.lbMed.Text = strMed.Remove(strMed.Length - 1, 1);
                    }
                }
            }
            else
            {
                MessageBox.Show("无体检信息,请先做体检!");
                return;
            }
            //SimpleBinding(this.lbBMI, "BasicTest");
            //SimpleBinding(this.lbData, "CheckDate");
            //SimpleBinding(this.lbXueYa, "Blood");
            //SimpleBinding(this.lbBchao, "BSuper");
            //SimpleBinding(this.lbXiongBu, "ChestX");
            //SimpleBinding(this.lbEcg, "ECG");
            //SimpleBinding(this.lbVascular, "Cardiovascular");
            //SimpleBinding(this.lbBone, "Bone");
            //SimpleBinding(this.lbLung, "Lung");
            //SimpleBinding(this.lbMed, "TCMConstitution");
            //SimpleBinding(this.lbxinlv, "PulseRate");
            //SimpleBinding(this.lbxueyang, "Oxygen");
            //SimpleBinding(this.lbniao, "Urine");
            this.EveryThingIsOk = true;
        }