Example #1
0
        /// <summary>
        /// 初始化病例
        /// </summary>
        private void InitReport()
        {
            bool isLocked = bool.Parse(Request.QueryString["IsLocked"]);
            int  reportID = int.Parse(Request.QueryString["ReportID"]);

            reportSummation = medicalReportBLO.GetReportSummationByReportID(reportID);

            if (reportSummation != null)
            {
                person = reportSummation.Person;
                reportZhuSuAndXianBingShi  = reportSummation.Report_ZhuSuAndXianBingShi;
                reportJiWangBingShi        = reportSummation.Report_JiWangBingShi;
                reportChuBuZhenDuan        = reportSummation.Report_ChuBuZhenDuan;
                reportBinLiBanSuiZhuangTai = reportSummation.Report_JiBingBanSuiZhuangTai;
                reportJinMaiRongShuan      = reportSummation.Report_JingMaiRongShuan;
                reportFuZhuYongYao         = reportSummation.Report_FuZhuYongYao;
                reportLinChuangZhuanGui    = reportSummation.Report_LinChuangZhuanGui;
                reportWeiJinXingJiZhenGuanMaiJieRuZhiLiao = reportSummation.Report_WeiJinXingJiZhenGuanMaiJieRuZhiLiao;
                reportWeiJinXingJingMaiRongSuanLiYou      = reportSummation.Report_WeiJinXingJingMaiRongSuanLiYou;
                reportJieRuZhiLiao = reportSummation.Report_JieRuZhiLiao;
                this.InitReportSummation();
            }
        }
Example #2
0
        /// <summary>
        /// 插入病例信息到数据库中
        /// </summary>
        /// <param name="person">患者的个人基本信息</param>
        /// <param name="reportBinLiBanSuiZhuangTai">患者的疾病伴随状态信息</param>
        /// <param name="reportChuBuZhengDuan">患者的初步诊断信息</param>
        /// <param name="reportFuZhuYongYao">患者的辅助用药信息</param>
        /// <param name="reportJinMaiRongShuan">患者的静脉溶栓信息</param>
        /// <param name="reportJiWangBingShi">患者的既往病史信息</param>
        /// <param name="reportJieRuZhiLiao">患者的介入治疗信息</param>
        /// <param name="reportWeiJinXingJingMaiRongSuanLiYou">患者的未进行静脉溶栓的原因</param>
        /// <param name="reportWeiJinXingJiZhenGuanMaiJieRuZhiLiao">患者未进行急诊冠脉介入治疗的原因</param>
        /// <param name="reportZhuSuAndXianBingShi">患者的主诉和现病史信息</param>
        /// <param name="reportLinChuangZhuangGui">患者的临床转归信息</param>
        /// <param name="reportLinChuangZhengZhuang">患者的主诉和现病史信息</param>
        /// <param name="reportSummation">患者的基本信息</param>
        /// <param name="reportID">患者的病例ID</param>
        public void InsertReportSummation(
            Person person,
            Report_JiBingBanSuiZhuangTai reportBinLiBanSuiZhuangTai,
            Report_ChuBuZhenDuan reportChuBuZhengDuan,
            Report_FuZhuYongYao reportFuZhuYongYao,
            Report_JingMaiRongShuan reportJinMaiRongShuan,
            Report_JiWangBingShi reportJiWangBingShi,
            Report_JieRuZhiLiao reportJieRuZhiLiao,
            Report_WeiJinXingJingMaiRongSuanLiYou reportWeiJinXingJingMaiRongSuanLiYou,
            Report_WeiJinXingJiZhenGuanMaiJieRuZhiLiao reportWeiJinXingJiZhenGuanMaiJieRuZhiLiao,
            Report_ZhuSuAndXianBingShi reportZhuSuAndXianBingShi,
            Report_LinChuangZhuanGui reportLinChuangZhuangGui,
            Report_ZhuSuAndXianBingShi reportLinChuangZhengZhuang,
            Report_Summation reportSummation, out int reportID)
        {
            try
            {
                using (System.Transactions.TransactionScope transactionScope = new System.Transactions.TransactionScope())
                {
                    using (MedicalBaseEntities context = new MedicalBaseEntities())
                    {
                        #region 患者的个人基本信息处理

                        Person personInDB = (from p in context.People
                                             where p.ID == person.ID
                                             select p).FirstOrDefault();
                        if (personInDB == null)
                        {
                            context.People.AddObject(person);
                        }
                        else
                        {
                            context.People.ApplyCurrentValues(person);
                        }
                        context.SaveChanges();

                        #endregion 患者的个人基本信息处理

                        #region 患者的疾病伴随状态信息处理

                        Report_JiBingBanSuiZhuangTai reportBinLiBanSuiZhuangTaiInDB = (from p in context.Report_JiBingBanSuiZhuangTai
                                                                                       where p.ID == reportBinLiBanSuiZhuangTai.ID
                                                                                       select p).FirstOrDefault();
                        if (reportBinLiBanSuiZhuangTaiInDB == null)
                        {
                            context.Report_JiBingBanSuiZhuangTai.AddObject(reportBinLiBanSuiZhuangTai);
                        }
                        else
                        {
                            context.Report_JiBingBanSuiZhuangTai.ApplyCurrentValues(reportBinLiBanSuiZhuangTai);
                        }
                        context.SaveChanges();

                        #endregion 患者的疾病伴随状态信息处理

                        #region 患者的初步诊断信息处理

                        Report_ChuBuZhenDuan reportChuBuZhengDuanInDB = (from p in context.Report_ChuBuZhenDuan
                                                                         where p.ID == reportChuBuZhengDuan.ID
                                                                         select p).FirstOrDefault();
                        if (reportChuBuZhengDuanInDB == null)
                        {
                            context.Report_ChuBuZhenDuan.AddObject(reportChuBuZhengDuan);
                        }
                        else
                        {
                            context.Report_ChuBuZhenDuan.ApplyCurrentValues(reportChuBuZhengDuan);
                        }
                        context.SaveChanges();

                        #endregion 患者的初步诊断信息处理

                        #region 患者的辅助用药信息处理

                        Report_FuZhuYongYao reportFuZhuYongYaoInDB = (from p in context.Report_FuZhuYongYao
                                                                      where p.ID == reportFuZhuYongYao.ID
                                                                      select p).FirstOrDefault();
                        if (reportFuZhuYongYaoInDB == null)
                        {
                            context.Report_FuZhuYongYao.AddObject(reportFuZhuYongYao);
                        }
                        else
                        {
                            context.Report_FuZhuYongYao.ApplyCurrentValues(reportFuZhuYongYao);
                        }
                        context.SaveChanges();

                        #endregion 患者的辅助用药信息处理

                        #region 患者的静脉溶栓信息处理

                        Report_JingMaiRongShuan reportJinMaiRongShuanInDB = (from p in context.Report_JingMaiRongShuan
                                                                             where p.ID == reportJinMaiRongShuan.ID
                                                                             select p).FirstOrDefault();
                        if (reportJinMaiRongShuanInDB == null)
                        {
                            context.Report_JingMaiRongShuan.AddObject(reportJinMaiRongShuan);
                        }
                        else
                        {
                            context.Report_JingMaiRongShuan.ApplyCurrentValues(reportJinMaiRongShuan);
                        }
                        context.SaveChanges();

                        #endregion 患者的静脉溶栓信息处理

                        #region 患者的既往病史信息处理

                        Report_JiWangBingShi reportJiWangBingShiInDB = (from p in context.Report_JiWangBingShi
                                                                        where p.ID == reportJiWangBingShi.ID
                                                                        select p).FirstOrDefault();
                        if (reportJiWangBingShiInDB == null)
                        {
                            context.Report_JiWangBingShi.AddObject(reportJiWangBingShi);
                        }
                        else
                        {
                            context.Report_JiWangBingShi.ApplyCurrentValues(reportJiWangBingShi);
                        }
                        context.SaveChanges();

                        #endregion 患者的既往病史信息处理

                        #region 患者的主诉和现病史信息处理

                        Report_ZhuSuAndXianBingShi reportLinChuangZhengZhuangInDB = (from p in context.Report_ZhuSuAndXianBingShi
                                                                                     where p.ID == reportLinChuangZhengZhuang.ID
                                                                                     select p).FirstOrDefault();
                        if (reportLinChuangZhengZhuangInDB == null)
                        {
                            context.Report_ZhuSuAndXianBingShi.AddObject(reportLinChuangZhengZhuang);
                        }
                        else
                        {
                            context.Report_ZhuSuAndXianBingShi.ApplyCurrentValues(reportLinChuangZhengZhuang);
                        }
                        context.SaveChanges();

                        #endregion 患者的主诉和现病史信息处理

                        #region 患者的介入治疗信息处理

                        Report_JieRuZhiLiao reportJieRuZhiLiaoInDB = (from p in context.Report_JieRuZhiLiao
                                                                      where p.ID == reportJieRuZhiLiao.ID
                                                                      select p).FirstOrDefault();
                        if (reportJieRuZhiLiaoInDB == null)
                        {
                            context.Report_JieRuZhiLiao.AddObject(reportJieRuZhiLiao);
                        }
                        else
                        {
                            context.Report_JieRuZhiLiao.ApplyCurrentValues(reportJieRuZhiLiao);
                        }
                        context.SaveChanges();

                        #endregion 患者的介入治疗信息处理

                        #region 患者的未进行静脉溶栓的原因处理

                        Report_WeiJinXingJingMaiRongSuanLiYou reportWeiJinXingJingMaiRongSuanLiYouInDB = (from p in context.Report_WeiJinXingJingMaiRongSuanLiYou
                                                                                                          where p.ID == reportWeiJinXingJingMaiRongSuanLiYou.ID
                                                                                                          select p).FirstOrDefault();
                        if (reportWeiJinXingJingMaiRongSuanLiYouInDB == null)
                        {
                            context.Report_WeiJinXingJingMaiRongSuanLiYou.AddObject(reportWeiJinXingJingMaiRongSuanLiYou);
                        }
                        else
                        {
                            context.Report_WeiJinXingJingMaiRongSuanLiYou.ApplyCurrentValues(reportWeiJinXingJingMaiRongSuanLiYou);
                        }
                        context.SaveChanges();

                        #endregion 患者的未进行静脉溶栓的原因处理

                        #region 患者未进行急诊冠脉介入治疗的原因处理

                        Report_WeiJinXingJiZhenGuanMaiJieRuZhiLiao reportWeiJinXingJiZhenGuanMaiJieRuZhiLia = (from p in context.Report_WeiJinXingJiZhenGuanMaiJieRuZhiLiao
                                                                                                               where p.ID == reportWeiJinXingJiZhenGuanMaiJieRuZhiLiao.ID
                                                                                                               select p).FirstOrDefault();
                        if (reportWeiJinXingJiZhenGuanMaiJieRuZhiLia == null)
                        {
                            context.Report_WeiJinXingJiZhenGuanMaiJieRuZhiLiao.AddObject(reportWeiJinXingJiZhenGuanMaiJieRuZhiLiao);
                        }
                        else
                        {
                            context.Report_WeiJinXingJiZhenGuanMaiJieRuZhiLiao.ApplyCurrentValues(reportWeiJinXingJiZhenGuanMaiJieRuZhiLiao);
                        }
                        context.SaveChanges();

                        #endregion 患者未进行急诊冠脉介入治疗的原因处理

                        #region 患者的主诉和现病史信息处理

                        Report_ZhuSuAndXianBingShi rreportZhuSuAndXianBingShiInDB = (from p in context.Report_ZhuSuAndXianBingShi
                                                                                     where p.ID == reportZhuSuAndXianBingShi.ID
                                                                                     select p).FirstOrDefault();
                        if (rreportZhuSuAndXianBingShiInDB == null)
                        {
                            context.Report_ZhuSuAndXianBingShi.AddObject(reportZhuSuAndXianBingShi);
                        }
                        else
                        {
                            context.Report_ZhuSuAndXianBingShi.ApplyCurrentValues(reportZhuSuAndXianBingShi);
                        }
                        context.SaveChanges();

                        #endregion 患者的主诉和现病史信息处理

                        #region 患者的临床转归信息处理

                        Report_LinChuangZhuanGui reportTreatResultInDB = (from p in context.Report_LinChuangZhuanGui
                                                                          where p.ID == reportLinChuangZhuangGui.ID
                                                                          select p).FirstOrDefault();
                        if (reportTreatResultInDB == null)
                        {
                            context.Report_LinChuangZhuanGui.AddObject(reportLinChuangZhuangGui);
                        }
                        else
                        {
                            context.Report_LinChuangZhuanGui.ApplyCurrentValues(reportLinChuangZhuangGui);
                        }
                        context.SaveChanges();

                        #endregion 患者的临床转归信息处理

                        #region 患者的基本信息处理

                        Report_Summation reportSummationInDB = (from p in context.Report_Summation
                                                                where p.ID == reportSummation.ID
                                                                select p).FirstOrDefault();
                        if (reportSummationInDB == null)
                        {
                            context.Report_Summation.AddObject(reportSummation);
                        }
                        else
                        {
                            context.Report_Summation.ApplyCurrentValues(reportSummation);
                        }
                        context.SaveChanges();

                        reportID = reportSummation.ID;

                        #endregion 患者的基本信息处理
                    }
                    transactionScope.Complete();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }