示例#1
0
        /// <summary>
        /// 修改门诊病人信息
        /// </summary>
        /// <param name="memberEntity">会员信息</param>
        public void UpdateOPPatientInfo(ME_MemberInfo memberEntity)
        {
            string sql = @" UPDATE OP_CostHead SET PatName='{0}',PatTypeID={1} WHERE MemberID={2}";

            sql = string.Format(sql, memberEntity.Name, memberEntity.PatType, memberEntity.MemberID);
            oleDb.DoCommand(sql);
            sql = @" UPDATE OP_FeeItemHead SET PatName='{0}' WHERE MemberID={1}";
            sql = string.Format(sql, memberEntity.Name, memberEntity.MemberID);
            oleDb.DoCommand(sql);

            sql = @" UPDATE OP_FeeRefundHead SET PatName='{0}' WHERE PatListID IN (SELECT PatListID FROM OP_PatList WHERE MemberID={1})";
            sql = string.Format(sql, memberEntity.Name, memberEntity.MemberID);
            oleDb.DoCommand(sql);
            string sex = string.Empty;

            if (memberEntity.Sex == "1")
            {
                sex = "男";
            }
            else if (memberEntity.Sex == "2")
            {
                sex = "女";
            }

            AgeValue      ag          = AgeExtend.GetAgeValue(memberEntity.Birthday);
            string        age         = ag.ReturnAgeStr_EN();
            string        patTypeName = string.Empty;
            Basic_PatType model       = (Basic_PatType)NewObject <Basic_PatType>().getmodel(memberEntity.PatType);

            patTypeName = model.PatTypeName;
            sql         = @" UPDATE OP_PatList SET PatTypeID={0},PatName='{1}',PatSex='{2}',Birthday='{3}',Age='{4}',Allergies='{5}',WorkUnit='{6}',PatTypeName='{7}' WHERE MemberID={8}";
            sql         = string.Format(sql, memberEntity.PatType, memberEntity.Name, sex, memberEntity.Birthday.ToString("yyyy-MM-dd HH:mm:ss"), age, memberEntity.Allergies, memberEntity.WorkUnit, patTypeName, memberEntity.MemberID);
            oleDb.DoCommand(sql);
        }
示例#2
0
        public static AgeValue Perturb(AgeValue value, PerturbSetting perturbSetting)
        {
            EnsureArg.IsNotNull(perturbSetting, nameof(perturbSetting));

            var result = Perturb(value.Age, perturbSetting);

            return(new AgeValue(result, value.AgeType));
        }
        public AgeValue RedactAge(AgeValue age)
        {
            if (Settings.EnablePartialAgeForRedact)
            {
                if (age.AgeToYearsOld() > s_ageThreshold)
                {
                    return(null);
                }

                return(age);
            }
            else
            {
                return(null);
            }
        }
示例#4
0
        /// <summary>
        /// 获取绑定数据源信息
        /// </summary>
        /// <param name="patlistid">病人ID</param>
        /// <returns>病人信息数据</returns>
        public MedicalCasePatient GetCasePatInfoDataSource(int patlistid)
        {
            MedicalCaseDbHelper helper      = new MedicalCaseDbHelper();
            MedicalCasePatient  casePatInfo = helper.GetCasePatient(patlistid);
            AgeValue            ageValue    = AgeExtend.GetAgeValue(casePatInfo.Birthday, casePatInfo.EnterHDate);

            casePatInfo.Age = "0";
            if (ageValue.Y_num > 0)
            {
                casePatInfo.Age = ageValue.Y_num.ToString();
            }
            else
            {
                casePatInfo.BirthDays = (ageValue.M_num * 30 + ageValue.D_num) / 30;
            }
            return(casePatInfo);
        }
示例#5
0
        private bool CheckPiecewise()
        {
            textBoxCompile.Text = "";
            //Check that complete pairs.
            //Check that at least one value available.
            //Check that no [Age] value is less than 0
            //Make sure two identical age values not entered.
            Dictionary <int, double> ageValues = new Dictionary <int, double>();

            foreach (DataGridViewRow row in dgvPerformance.Rows)
            {
                if (row.IsNewRow)
                {
                    continue;
                }
                int age = -1;
                try
                {
                    age = Convert.ToInt32(row.Cells[0].Value);
                }
                catch
                {
                    textBoxCompile.Text += "Failure to convert [AGE]=" + row.Cells[0].Value.ToString() + " Row=" + row.Index.ToString() + "\n";
                    return(false);
                }

                if (age < 0)
                {
                    textBoxCompile.Text = "Values for [AGE] must be 0 or greater.  Negative values for age not allowed.";
                    return(false);
                }

                double value = double.NaN;
                try
                {
                    value = Convert.ToDouble(row.Cells[1].Value);
                }
                catch
                {
                    textBoxCompile.Text += "Failure to convert [VALUE]=" + row.Cells[1].Value.ToString() + " Row=" + row.Index.ToString() + "\n";
                    return(false);
                }

                if (!ageValues.ContainsKey(age))
                {
                    ageValues.Add(age, value);
                }
                else
                {
                    textBoxCompile.Text = "Only unique integer values for [AGE] (first column) are allowed.";
                    return(false);
                }
            }

            if (ageValues.Count < 1)
            {
                textBoxCompile.Text = "At least one age/value pair must be entered to use a piecewise analysis.";
                return(false);
            }

            string piecewise = "";

            foreach (int key in ageValues.Keys)
            {
                piecewise += "(" + key.ToString() + "," + ageValues[key].ToString() + ")";
            }

            SimulationDataAccess.DTO.Piecewise temp = new SimulationDataAccess.DTO.Piecewise(piecewise);
            richTextBoxEquation.Text = temp.ToString();

            if (!string.IsNullOrWhiteSpace(temp.Errors))
            {
                textBoxCompile.Text = "PIECEWISE ERRORS:" + temp.Errors;
            }
            else
            {
                textBoxCompile.Text = "Piecewise equation input compile properly.";
            }

            double   apparentAge = temp.GetApparentAge(89);
            AgeValue nextValue   = temp.GetNextValue(89, 1);

            AgeValue nextValueShift   = temp.GetNextValue(89, 10, 1);
            double   benefit          = temp.GetBenefit(100, 50);
            double   benefitWithShift = temp.GetBenefit(85, 50, 15);

            double remainLife      = temp.GetRemainingLife(59, 50);
            double remainLifeShift = temp.GetRemainingLife(91, 50, 10);

            return(true);
        }