Example #1
0
        public void InitEveryThing()
        {
            dsRequire                 = new RequireBLL().GetList("TabName = '健康体检' AND Comment = '治疗情况' ");
            this.HospitalHistory      = new RecordsHospitalHistoryBLL().GetModelList(string.Format("IDCardNo = '{0}' and OutKey={1}", this.Model.IDCardNo, PhysicalInfoFactory.ID));
            this.FamilyBedHistoryInfo = new RecordsFamilyBedHistoryBLL().GetModelList(string.Format("IDCardNo = '{0}' and OutKey={1}", this.Model.IDCardNo, PhysicalInfoFactory.ID));


            this.Medication  = new RecordsMedicationBLL().GetModelList(string.Format("IDCardNo = '{0}' and OutKey={1}", this.Model.IDCardNo, PhysicalInfoFactory.ID));
            this.Perzhuyuans = new List <ZhuYuanUserControl> {
                this.zhuYuan1, this.zhuYuan2
            };
            this.FamZhuyuans = new List <ZhuYuanUserControl> {
                this.homezhuYuan1, this.homezhuYuan2
            };
            //新增体检时,从设备中读取的栏位设置为空
            if (PhysicalInfoFactory.falgID == 0)
            {
                if (area.Equals("威海"))
                {
                    this.Medication = new List <RecordsMedicationModel>();
                }
                this.PresetValue();
                if (community.Equals("平度云山医院") || area.Equals("威海"))//平度云山医院、威海,从高血压,糖尿病随访中获取用药
                {
                    string strYear      = DateTime.Now.Year.ToString();
                    string strHypeWhere = string.Format("  Left(FollowUpDate,4)='{0}' and IDCardNo='{1}' order by FollowUpDate desc  ", strYear, this.Model.IDCardNo);
                    List <ChronicHypertensionVisitModel> HyperModellist = new ChronicHypertensionVisitBLL().GetModelList(strHypeWhere);
                    if (HyperModellist.Count > 0)
                    {
                        List <ChronicDrugConditionModel> DrugConditions = new ChronicDrugConditionBLL().GetModelList(string.Format(" IDCardNo = '{0}' and type = '{1}' and OUTKey = '{2}' ", HyperModellist[0].IDCardNo, "1", HyperModellist[0].ID));
                        foreach (ChronicDrugConditionModel drugmodel in DrugConditions)
                        {
                            RecordsMedicationModel newModel = new RecordsMedicationModel
                            {
                                MedicinalName = drugmodel.Name,
                                UseNum        = drugmodel.DosAge,
                                IDCardNo      = this.Model.IDCardNo
                            };
                            this.Medication.Add(newModel);
                        }
                    }
                    string strDiaWhere = string.Format(" Left(VisitDate,4)='{0}'and IDCardNo='{1}' order by VisitDate desc  ", strYear, this.Model.IDCardNo);
                    List <ChronicDiadetesVisitModel> DiamodelList = new ChronicDiadetesVisitBLL().GetModelList(strDiaWhere);
                    if (DiamodelList.Count > 0)
                    {
                        List <ChronicDrugConditionModel> DiaDrugConditions = new ChronicDrugConditionBLL().GetModelList(string.Format(" IDCardNo = '{0}' and type = '{1}' and OUTKey = '{2}' ", DiamodelList[0].IDCardNo, "2", DiamodelList[0].ID));
                        foreach (ChronicDrugConditionModel drugmodel in DiaDrugConditions)
                        {
                            RecordsMedicationModel newModel = new RecordsMedicationModel
                            {
                                MedicinalName = drugmodel.Name,
                                UseNum        = drugmodel.DosAge,
                                IDCardNo      = this.Model.IDCardNo
                            };
                            this.Medication.Add(newModel);
                        }
                    }
                }
            }
            for (int i = 0; i < this.HospitalHistory.Count; i++)
            {
                this.Perzhuyuans[i].PerSource = this.HospitalHistory[i];
            }
            for (int j = 0; j < this.FamilyBedHistoryInfo.Count; j++)
            {
                this.FamZhuyuans[j].FamSource = this.FamilyBedHistoryInfo[j];
            }
            if (this.FamilyBedHistoryInfo.Count > 0)
            {
                this.homezhuYuan1.FamSource = this.FamilyBedHistoryInfo[0];
                if (this.FamilyBedHistoryInfo.Count == 2)
                {
                    this.homezhuYuan2.FamSource = this.FamilyBedHistoryInfo[1];
                }
            }

            //读取用药情况
            if (File.Exists(Application.StartupPath + "\\dose.xml"))
            {
                DataSet ds = new DataSet();

                ds.ReadXml(Application.StartupPath + "\\dose.xml");
                DataTable dt_yw = ds.Tables[0];
                doseUC1.setSource(dt_yw);
                doseUC2.setSource(DeepCopy(dt_yw));
                doseUC3.setSource(DeepCopy(dt_yw));
                doseUC4.setSource(DeepCopy(dt_yw));
                doseUC5.setSource(DeepCopy(dt_yw));
                doseUC6.setSource(DeepCopy(dt_yw));
            }

            for (int k = 0; k < this.doses.Count; k++)
            {
                if (k < this.Medication.Count)
                {
                    this.doses[k].Source = this.Medication[k];
                }
                else
                {
                    RecordsMedicationModel recordsMedicationModel = new RecordsMedicationModel
                    {
                        IDCardNo   = this.Model.IDCardNo,
                        ModelState = RecordsStateModel.NoValue
                    };
                    this.doses[k].Source = recordsMedicationModel;
                }
            }
            this.EveryThingIsOk = true;
            MustChoose();
        }
Example #2
0
        public void InitEveryThing()
        {
            this.HospitalHistory      = new RecordsHospitalHistoryBLL().GetModelList(string.Format("IDCardNo = '{0}' and OutKey={1}", this.Model.IDCardNo, PhysicalInfoFactory.ID));
            this.FamilyBedHistoryInfo = new RecordsFamilyBedHistoryBLL().GetModelList(string.Format("IDCardNo = '{0}' and OutKey={1}", this.Model.IDCardNo, PhysicalInfoFactory.ID));
            this.Medication           = new RecordsMedicationBLL().GetModelList(string.Format("IDCardNo = '{0}' and OutKey={1}", this.Model.IDCardNo, PhysicalInfoFactory.ID));
            this.Perzhuyuans          = new List <ZhuYuanUserControl> {
                this.zhuYuan1, this.zhuYuan2
            };
            this.FamZhuyuans = new List <ZhuYuanUserControl> {
                this.homezhuYuan1, this.homezhuYuan2
            };
            for (int i = 0; i < this.HospitalHistory.Count; i++)
            {
                this.Perzhuyuans[i].PerSource = this.HospitalHistory[i];
            }
            for (int j = 0; j < this.FamilyBedHistoryInfo.Count; j++)
            {
                this.FamZhuyuans[j].FamSource = this.FamilyBedHistoryInfo[j];
            }
            if (this.FamilyBedHistoryInfo.Count > 0)
            {
                this.homezhuYuan1.FamSource = this.FamilyBedHistoryInfo[0];
                if (this.FamilyBedHistoryInfo.Count == 2)
                {
                    this.homezhuYuan2.FamSource = this.FamilyBedHistoryInfo[1];
                }
            }

            //读取用药情况
            if (File.Exists(Application.StartupPath + "\\dose.xml"))
            {
                DataSet ds = new DataSet();

                ds.ReadXml(Application.StartupPath + "\\dose.xml");
                DataTable dt_yw = ds.Tables[0];
                doseUC1.setSource(dt_yw);
                doseUC2.setSource(DeepCopy(dt_yw));
                doseUC3.setSource(DeepCopy(dt_yw));
                doseUC4.setSource(DeepCopy(dt_yw));
                doseUC5.setSource(DeepCopy(dt_yw));
                doseUC6.setSource(DeepCopy(dt_yw));
            }

            for (int k = 0; k < this.doses.Count; k++)
            {
                if (k < this.Medication.Count)
                {
                    this.doses[k].Source = this.Medication[k];
                }
                else
                {
                    RecordsMedicationModel recordsMedicationModel = new RecordsMedicationModel
                    {
                        IDCardNo   = this.Model.IDCardNo,
                        ModelState = RecordsStateModel.NoValue
                    };
                    this.doses[k].Source = recordsMedicationModel;
                }
            }
            this.EveryThingIsOk = true;
        }