Esempio n. 1
0
        /// <summary>
        /// 获取数据的文本值
        /// </summary>
        /// <returns></returns>
        public virtual string GetDataText()
        {
            string strValue = string.Empty;

            if (this.InfoType == EnumPatientInfoType.年龄)
            {
                if (GlobalPatient.currPatient != null)
                {
                    if (CalcAgeType == 1)
                    {
                        strValue = CalcAge.GetAge(GlobalPatient.currPatient.Birthday, GlobalPatient.currPatient.RegisterDate);
                    }
                    else
                    {
                        int intAge = CalcAge.GetAgeInt(GlobalPatient.currPatient.Birthday);
                        if (intAge < 1)
                        {
                            strValue = CalcAge.GetAge(GlobalPatient.currPatient.Birthday, GlobalPatient.currPatient.RegisterDate);
                        }
                        else
                        {
                            strValue = CalcAge.GetAge(GlobalPatient.currPatient.Birthday);
                        }
                    }
                }
            }
            else
            {
                strValue = PatientInfoHelper.GetTypePatientInfo(this.InfoType);
            }

            return(strValue);
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="disClientRpt"></param>
        /// <returns></returns>
        internal List <EntityModelAccess> GetModelAccess(EntitymModelAccessRecord mdAccessRecord)
        {
            List <EntityModelAccess>    data    = new List <EntityModelAccess>();
            Dictionary <string, string> dicData = new Dictionary <string, string>();

            if (!string.IsNullOrEmpty(mdAccessRecord.qnData))
            {
                XmlDocument document = new XmlDocument();
                document.LoadXml(mdAccessRecord.qnData);
                XmlNodeList list = document["FormData"].ChildNodes;
                dicData = Function.ReadXML(mdAccessRecord.qnData);
            }
            int age = 0;

            if (dicData.ContainsKey("Birthday"))
            {
                age = CalcAge.GetAgeInt(Function.Datetime(dicData["Birthday"]));
            }
            string sexStr = dicData["Sex"];
            int    sex    = 0;

            if (sexStr == "男")
            {
                sex = 1;
            }
            if (sexStr == "女")
            {
                sex = 2;
            }

            if (lstModelAccess != null)
            {
                List <EntityModelAccess> tmpList = lstModelAccess.FindAll(r => (r.modelSex == sex || r.modelSex == 0));
                foreach (var maVo in tmpList)
                {
                    decimal minAge = maVo.minAge;
                    decimal maxAge = maVo.maxAge;

                    if (age >= minAge && age <= maxAge)
                    {
                        data.Add(maVo);
                    }
                }
            }

            return(data);
        }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="modelId"></param>
        /// <returns></returns>
        internal List <EntityModelParamCalc> CalcModelResult(decimal modelId, EntitymModelAccessRecord vo, out decimal result, out decimal bestDf)
        {
            result = 0;
            bestDf = 0;
            bool ageFlag = false;
            List <EntityModelParamCalc> data        = null;
            EntityModelParamCalc        paramCalcVo = null;
            Dictionary <string, string> dicData     = new Dictionary <string, string>();
            List <EntityModelGroupItem> lstGxyModel = lstModelGroupItem.FindAll(r => r.modelId == modelId && r.isMain == 1);

            //EntityDisplayClientRpt vo = GetRowObject();
            if (!string.IsNullOrEmpty(vo.qnData))
            {
                XmlDocument document = new XmlDocument();
                document.LoadXml(vo.qnData);
                XmlNodeList list = document["FormData"].ChildNodes;
                dicData = Function.ReadXML(vo.qnData);
            }

            if (lstGxyModel != null)
            {
                data = new List <EntityModelParamCalc>();
                foreach (var model in lstGxyModel)
                {
                    List <EntityModelParam> lstModelParamGxy = lstModelParam.FindAll(r => r.parentFieldId == model.paramNo && r.modelId == modelId);
                    if (lstModelParamGxy != null)
                    {
                        //问卷
                        if (model.paramType == 3 || model.paramType == 4)
                        {
                            foreach (var modelGxy in lstModelParamGxy)
                            {
                                if (!string.IsNullOrEmpty(vo.qnData))
                                {
                                    //评估得分
                                    if (dicData.ContainsKey(modelGxy.paramNo))
                                    {
                                        decimal score = 0;
                                        if (dicData[modelGxy.paramNo] == "1")
                                        {
                                            score += Function.Dec(modelGxy.score);

                                            paramCalcVo            = new EntityModelParamCalc();
                                            paramCalcVo.clientId   = vo.clientNo;
                                            paramCalcVo.qnRecId    = vo.qnRecId;
                                            paramCalcVo.regNo      = vo.regNo;
                                            paramCalcVo.modelId    = modelId;
                                            paramCalcVo.paramNo    = model.paramNo;
                                            paramCalcVo.paramName  = model.paramName;
                                            paramCalcVo.calcScore  = score;
                                            paramCalcVo.paramValue = dicData[modelGxy.paramNo];
                                            paramCalcVo.recordDate = DateTime.Now;

                                            if (data.Any(r => r.paramNo == paramCalcVo.paramNo && r.modelId == modelId && r.qnRecId == paramCalcVo.qnRecId && r.regNo == paramCalcVo.regNo))
                                            {
                                                EntityModelParamCalc cloneVo = data.Find(r => r.paramNo == paramCalcVo.paramNo && r.modelId == modelId && r.qnRecId == paramCalcVo.qnRecId && r.regNo == paramCalcVo.regNo);
                                                cloneVo.calcScore = score;
                                            }
                                            else
                                            {
                                                data.Add(paramCalcVo);
                                            }
                                        }

                                        result += score;
                                    }
                                    if (modelGxy.paramNo == "Age")
                                    {
                                        decimal df  = 0;
                                        decimal bDf = 0;
                                        decimal age = 0;
                                        if (dicData.ContainsKey("Birthday") && !ageFlag)
                                        {
                                            if (!string.IsNullOrEmpty(dicData["Birthday"]))
                                            {
                                                age                    = CalcAge.GetAgeInt(Function.Datetime(dicData["Birthday"]));
                                                df                     = CalcDf(age, modelId, modelGxy.paramNo, out bDf);
                                                result                += df;
                                                ageFlag                = true;
                                                paramCalcVo            = new EntityModelParamCalc();
                                                paramCalcVo.clientId   = vo.clientNo;
                                                paramCalcVo.regNo      = vo.regNo;
                                                paramCalcVo.qnRecId    = vo.qnRecId;
                                                paramCalcVo.modelId    = modelId;
                                                paramCalcVo.paramNo    = modelGxy.paramNo;
                                                paramCalcVo.paramName  = modelGxy.paramName;
                                                paramCalcVo.calcScore  = df;
                                                paramCalcVo.recordDate = DateTime.Now;
                                                paramCalcVo.paramValue = dicData["Birthday"];
                                                paramCalcVo.recordDate = DateTime.Now;
                                                data.Add(paramCalcVo);
                                            }
                                        }
                                    }
                                    //最佳状态 得分
                                    if (modelGxy.isBest == "1")
                                    {
                                        bestDf += Function.Dec(modelGxy.score);
                                    }
                                }
                            }
                        }
                        else if (model.paramType == 2)
                        {
                            if (lstTjResult == null)
                            {
                                continue;
                            }
                            EntityTjResult tjVo = lstTjResult.Find(r => r.itemCode == model.paramNo);
                            if (tjVo == null)
                            {
                                continue;
                            }
                            decimal tjValue = Function.Dec(tjVo.itemResult);
                            decimal df      = 0;
                            decimal bDf     = 0;
                            df                     = CalcDf(tjValue, modelId, model.paramNo, out bDf);
                            paramCalcVo            = new EntityModelParamCalc();
                            paramCalcVo.clientId   = vo.clientNo;
                            paramCalcVo.regNo      = vo.regNo;
                            paramCalcVo.qnRecId    = vo.qnRecId;
                            paramCalcVo.modelId    = modelId;
                            paramCalcVo.paramNo    = model.paramNo;
                            paramCalcVo.paramName  = model.paramName;
                            paramCalcVo.calcScore  = df;
                            paramCalcVo.recordDate = DateTime.Now;
                            paramCalcVo.paramValue = tjVo.itemResult.ToString();
                            result                += df;
                            bestDf                += bDf;
                            if (data.Any(r => r.modelId == modelId && r.paramNo == model.paramNo && paramCalcVo.qnRecId == vo.qnRecId))
                            {
                                continue;
                            }
                            else
                            {
                                data.Add(paramCalcVo);
                            }
                        }
                    }
                }
            }
            return(data);
        }