Exemple #1
0
        /// <summary>
        /// 是否对此条记录枷锁
        /// </summary>
        /// <param name="report">病例信息</param>
        /// <returns>是否枷锁成功</returns>
        public static bool IsLocked(Report_Summation report)
        {
            bool isLocked = false;

            if (report == null)
            {
                isLocked = true;
            }
            if (report.CreateDate.AddDays(10) < DateTime.Now)
            {
                isLocked = true;
            }
            return(isLocked);
        }
Exemple #2
0
 /// <summary>
 /// 页面加载
 /// </summary>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (Request.QueryString.Count != 0)
         {
             InitReport();
         }
         else
         {
             reportSummation = new Report_Summation();
             this.EnableExpendContent(false);
         }
     }
 }
Exemple #3
0
        /// <summary>
        /// 删除患者病例信息
        /// </summary>
        /// <param name="reportIDList">病例列表</param>
        /// <returns>返回是否删除成功</returns>
        public bool RemoveReportSummationByReportID(string[] reportIDList)
        {
            bool isSucceed = false;

            try
            {
                using (System.Transactions.TransactionScope transactionScope = new System.Transactions.TransactionScope())
                {
                    using (MedicalBaseEntities context = new MedicalBaseEntities())
                    {
                        foreach (var item in reportIDList)
                        {
                            int reportID = 0;
                            try
                            {
                                reportID = Int32.Parse(item);
                            }
                            catch
                            {
                                return(false);
                            }
                            // 获得待删除的信息
                            Report_Summation reportToDelete = (from p in context.Report_Summation
                                                               where p.ID == reportID
                                                               select p).FirstOrDefault();
                            if (reportToDelete != null)
                            {
                                context.Report_Summation.DeleteObject(reportToDelete);
                                context.SaveChanges();
                            }
                        }
                    }
                    isSucceed = true;
                    transactionScope.Complete();
                }
            }
            catch (Exception)
            {
                isSucceed = false;
            }
            return(isSucceed);
        }
Exemple #4
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();
            }
        }
Exemple #5
0
        /// <summary>
        /// 是否对此条记录枷锁
        /// </summary>
        /// <param name="reportID">病例信息ID</param>
        /// <returns>是否枷锁成功</returns>
        public static bool IsLocked(string reportID)
        {
            bool isLocked = true;

            int nReportID = 0;

            if (!Int32.TryParse(reportID, out nReportID))
            {
                return(false);
            }
            MedicalReportBLO medicalReportBLO = new MedicalReportBLO();
            Report_Summation report           = medicalReportBLO.GetReportSummationByReportID(nReportID);

            if (report == null)
            {
                return(false);
            }
            if (report.LastUpdateDate.AddDays(10) < DateTime.Now)
            {
                return(false);
            }
            return(isLocked);
        }
Exemple #6
0
        /// <summary>
        /// 获得患者基本信息
        /// </summary>
        /// <param name="personName">患者的病例ID</param>
        /// <returns>返回患者基本信息</returns>
        public Report_Summation GetReportSummationByReportID(int reportID)
        {
            Report_Summation reportSummation = null;

            try
            {
                using (MedicalBaseEntities context = new MedicalBaseEntities())
                {
                    context.ContextOptions.LazyLoadingEnabled = true;
                    Report_Summation temp = (from p in context.Report_Summation
                                             where p.ID == reportID
                                             orderby p.LastUpdateDate descending
                                             select p).FirstOrDefault();
                    if (temp != null)
                    {
                        reportSummation        = temp;
                        reportSummation.Person = temp.Person;
                        reportSummation.Report_ChuBuZhenDuan                       = temp.Report_ChuBuZhenDuan;
                        reportSummation.Report_FuZhuYongYao                        = temp.Report_FuZhuYongYao;
                        reportSummation.Report_JiBingBanSuiZhuangTai               = temp.Report_JiBingBanSuiZhuangTai;
                        reportSummation.Report_JieRuZhiLiao                        = temp.Report_JieRuZhiLiao;
                        reportSummation.Report_JingMaiRongShuan                    = temp.Report_JingMaiRongShuan;
                        reportSummation.Report_JiWangBingShi                       = temp.Report_JiWangBingShi;
                        reportSummation.Report_LinChuangZhuanGui                   = temp.Report_LinChuangZhuanGui;
                        reportSummation.Report_WeiJinXingJingMaiRongSuanLiYou      = temp.Report_WeiJinXingJingMaiRongSuanLiYou;
                        reportSummation.Report_WeiJinXingJiZhenGuanMaiJieRuZhiLiao = temp.Report_WeiJinXingJiZhenGuanMaiJieRuZhiLiao;
                        reportSummation.Report_ZhuSuAndXianBingShi                 = temp.Report_ZhuSuAndXianBingShi;
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(reportSummation);
        }
Exemple #7
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;
            }
        }