Beispiel #1
0
        private bool SelectItem(string OfficeIDitem)
        {
            ClinicPhysicianRecipeFacade clinicPhysicianRecipeFacade = new ClinicPhysicianRecipeFacade();
            string  diagnoseid = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["DIAGNOSEID"].ToString().Trim(); //诊疗号
            DataSet ds         = clinicPhysicianRecipeFacade.FindAllRecipeMedordInfoByExeofficeID(diagnoseid, OfficeIDitem);

            if (!dtRev.Columns.Contains("处方号"))
            {
                #region MyRegion
                dtRev.Columns.Add("处方号");
                dtRev.Columns.Add("处方内容");
                dtRev.Columns.Add("注意事项");
                dtRev.Columns.Add("预约号");
                dtRev.Columns.Add("诊疗号");
                dtRev.Columns.Add("挂号号");
                dtRev.Columns.Add("科室ID");
                dtRev.Columns.Add("诊室名称");
                dtRev.Columns.Add("执行科室地址");
                dtRev.Columns.Add("医嘱用语备注");
                dtRev.Columns.Add("开单科室");
                dtRev.Columns.Add("检查医师");
                dtRev.Columns.Add("检查医师ID");
                dtRev.Columns.Add("预约日期");
                dtRev.Columns.Add("预约结束日期");
                dtRev.Columns.Add("报到时间");
                dtRev.Columns.Add("完成时间");
                dtRev.Columns.Add("挂起时间");
                dtRev.Columns.Add("操作员ID");
                dtRev.Columns.Add("预约状态");
                dtRev.Columns.Add("检查状态");
                dtRev.Columns.Add("检查目的");  //douyaming 2014-8-4
                dtRev.Columns.Add("收费状态");  //douyaming 2016-05-14
                //isBindRev = true;
                #endregion
            }
            dtRev.Clear();

            for (int i = 0; i < this.gdvMain.RowCount; i++)
            {
                if ((Boolean)gdvMain.GetDataRow(i)["PITCHON1"]) //添加用户选择数据
                {
                    #region 增加医技预约次数限制 wangchao 2017.03.23 case:27593
                    //try
                    //{
                    //    if (SystemInfo.SystemConfigs["医技预约限制次数"].DefaultValue == "1")
                    //    {
                    //        string _execOffice = ds.Tables[0].Rows[i]["EXECOFFICEID"].ToString();
                    //        string _diagnoseID = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["DIAGNOSEID"].ToString();
                    //        string _content = ds.Tables[0].Rows[i]["RECIPECONTENT"].ToString();
                    //        CLINICMtReserveFacade _reserveFacade = new CLINICMtReserveFacade();
                    //        DataSet dsCheck = _reserveFacade.checkRecipeHasReserveRecord(_diagnoseID, _execOffice, _content);
                    //        if (dsCheck != null && dsCheck.Tables.Count > 0 && dsCheck.Tables[0].Rows.Count > 0)
                    //        {
                    //            SkyComm.ShowMessageInfo("检查项目【" + ds.Tables[0].Rows[i]["CHARGEITEM"].ToString() + "】在日期【" + Convert.ToDateTime(dsCheck.Tables[0].Rows[0]["RESERVESTARTTIME"].ToString()).ToString("yyyy年MM月dd日") + "】已存在预约信息,不能重复预约!");
                    //            return false;
                    //        }
                    //    }
                    //}
                    //catch (Exception ex)
                    //{
                    //    Skynet.LoggingService.LogService.GlobalInfoMessage("医技预约次数限制模块发生异常,原因:" + ex.Message);
                    //}
                    #endregion

                    DataSet dsClinic = reserveFacade.ReserveRecipeInfo(gdvMain.GetDataRow(i)["RESERVEID"].ToString());
                    //dsClinic.Tables[0].TableName = "data1";
                    //ds.Tables[0].TableName = "data2";
                    //dsClinic.WriteXml(Application.StartupPath + "\\数据集1.xml");
                    //ds.WriteXml(Application.StartupPath + "\\数据集2.xml");
                    foreach (DataRow drClinic in dsClinic.Tables[0].Rows)
                    {
                        foreach (DataRow drTemp in ds.Tables[0].Rows)
                        {
                            if (drClinic["CLINICRECIPEID"].ToString() == drTemp["CLINICRECIPEID"].ToString() && drClinic["APPLYDOCNO"].ToString() == drTemp["APPLYDOCNO"].ToString())
                            {
                                DataRow newRow = dtRev.NewRow();
                                newRow["处方号"]    = drTemp["CLINICRECIPEID"].ToString();
                                newRow["处方内容"]   = drTemp["CHARGEITEM"].ToString();
                                newRow["注意事项"]   = "";
                                newRow["预约号"]    = "1";
                                newRow["诊疗号"]    = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["DIAGNOSEID"].ToString();
                                newRow["挂号号"]    = drTemp["REGISTERID"].ToString();
                                newRow["科室ID"]   = drTemp["EXECOFFICEID"].ToString();; // this.cmbExamineName.SelectedValue.ToString();
                                newRow["诊室名称"]   = drTemp["EXECOFFICE"].ToString();    //new
                                newRow["开单科室"]   = drTemp["OPERATOROFFICE"].ToString();
                                newRow["执行科室地址"] = drTemp["OFFICEADDRESS"].ToString();
                                newRow["医嘱用语备注"] = drTemp["REMARK"].ToString();
                                newRow["检查医师ID"] = ""; // this.cmbUserName.SelectedValue;
                                newRow["检查医师"]   = ""; // this.cmbUserName.Text;
                                newRow["预约日期"]   = "";
                                newRow["预约结束日期"] = null;
                                newRow["报到时间"]   = null;
                                newRow["完成时间"]   = null;
                                newRow["挂起时间"]   = null;
                                newRow["操作员ID"]  = SysOperatorInfo.OperatorID;
                                newRow["预约状态"]   = 1;  //预约
                                newRow["检查状态"]   = 1;  //未检查
                                newRow["检查目的"]   = ""; // this.gridView1.GetDataRow(i)["APPLYREMARK"].ToString();
                                try
                                {
                                    var revState = drTemp["RECIPESTATE"];
                                    newRow["收费状态"] = drTemp["RECIPESTATE"] == null ? "" : drTemp["RECIPESTATE"].ToString() == "0" ? "未收费" : "已收费";
                                }
                                catch (Exception)
                                {
                                    newRow["收费状态"] = "";
                                }
                                dtRev.Rows.Add(newRow);
                            }
                        }
                    }
                    //DataTable dtTemp = dtRev.Copy();
                    //DataSet dsTemp = new DataSet();
                    //dsTemp.Tables.Add(dtTemp);
                    //dsTemp.Tables[0].TableName = "data3";
                    //dsTemp.WriteXml(Application.StartupPath + "\\数据集3.xml");
                }
            }
            return(true);
        }
Beispiel #2
0
        private bool BindRecipe()
        {
            string  diagnoseidC    = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["DIAGNOSEID"].ToString().Trim(); //诊疗号
            string  strjfType      = SystemInfo.SystemConfigs["健康卡操作员扣费条件"].DefaultValue.Trim();
            DataSet dsRecipeDetail = new DataSet();
            ClinicPhysicianRecipeFacade clinicPhysicianRecipeFacade = new ClinicPhysicianRecipeFacade();

            #region MyRegion
            Dictionary <string, int> recipeList = new Dictionary <string, int>();//预约列表<处方ID,预约状态>
            Dictionary <string, int> dic        = GetRecipeState();


            if (true)
            {
                #region 构建dtRecipe
                dtRecipe.Columns.Add("PITCHON1", typeof(System.Boolean)).DefaultValue = false;
                dtRecipe.Columns.Add("CLINICRECIPEID");
                dtRecipe.Columns.Add("MEDORDNAME");
                dtRecipe.Columns.Add("UNITPRICE");
                dtRecipe.Columns.Add("AMOUNT");
                dtRecipe.Columns.Add("DOSEUNIT");
                dtRecipe.Columns.Add("TOTALMONEY");
                dtRecipe.Columns.Add("OFFICE");
                dtRecipe.Columns.Add("APPLYREMARK");
                dtRecipe.Columns.Add("APPLYDOCNO");
                dtRecipe.Columns.Add("INHOSID");
                //douyaming 2016-05-14 增加是否收费字段
                dtRecipe.Columns.Add("RECIPESTATE");
                //zpq 2016年7月1日  开单医生,开单时间 ,挂号号 ,开单科室
                dtRecipe.Columns.Add("DOCTOR");
                dtRecipe.Columns.Add("OPERATETIME");
                dtRecipe.Columns.Add("REGISTERID");
                dtRecipe.Columns.Add("OPERATOROFFICE");
                dtRecipe.Columns.Add("OFFICEADDRESS");
                dtRecipe.Columns.Add("REMARK");
                dtRecipe.Columns.Add("STATE");
                dtRecipe.Columns.Add("RECIPECONTENT");
                #endregion

                //if (strjfType == "1")
                //{
                //dsRecipeDetail = clinicPhysicianRecipeFacade.FindAllRecipeMedordInfoByOperatorID(diagnoseidC, SysOperatorInfo.OperatorID);
                //}
                //else
                //{
                dsRecipeDetail = clinicPhysicianRecipeFacade.FindAllRecipeMedordInfoByExeofficeID(diagnoseidC, OfficeID);
                //}

                #region 添加过滤附加费功能 zpq 2016年6月6日---2016年6月20日
                DataTable dtFJF = dsRecipeDetail.Tables[0].Copy();
                if (dtFJF == null || dtFJF.Rows.Count < 1)
                {
                    SkyComm.ShowMessageInfo("未查询到对应处方信息或该处方数据已经过期!");
                    return(false);
                }
                String    filterStr = " RECIPETYPE <>'医材' and RECIPETYPE <> '附加' and VALID <>'0' ";
                DataRow[] drs       = dtFJF.Select(filterStr);
                if (drs.Length < 1)
                {
                    SkyComm.ShowMessageInfo("未查询到对应处方信息或该处方数据已经过期!");
                    return(false);
                }

                dsRecipeDetail = new DataSet();//重新赋值
                dsRecipeDetail.Tables.Add(drs.CopyToDataTable());

                #endregion

                #region 赋值dtRecipe
                for (int i = 0; i < dsRecipeDetail.Tables[0].Rows.Count; i++)
                {
                    #region 判断是否已经预约过了(一个处方可能有多条明细) zpq 2016年5月24日
                    string repID = dsRecipeDetail.Tables[0].Rows[i]["CLINICRECIPEID"].ToString();
                    if (recipeList.ContainsKey(repID) && recipeList[repID] > 0)
                    {
                        continue;
                    }
                    else
                    {
                        if (!recipeList.ContainsKey(repID))
                        {
                            DataSet dsRes = clinicPhysicianRecipeFacade.GetReserveInfoByClinicrecipeID(repID);
                            if (dsRes.Tables[0].Rows.Count > 0)
                            {
                                recipeList.Add(repID, (int)dsRes.Tables[0].Rows[0]["RESSTATUS"]);
                                continue;
                            }
                            else
                            {
                                recipeList.Add(repID, -1);//无预约信息
                            }
                        }
                    }
                    #endregion

                    DataRow dr = dtRecipe.NewRow();

                    dr["CLINICRECIPEID"] = dsRecipeDetail.Tables[0].Rows[i]["CLINICRECIPEID"].ToString();
                    dr["MEDORDNAME"]     = dsRecipeDetail.Tables[0].Rows[i]["CHARGEITEM"].ToString();
                    dr["UNITPRICE"]      = Math.Round(Convert.ToDouble(dsRecipeDetail.Tables[0].Rows[i]["UNITPRICE"]), 2).ToString() + "元";
                    dr["AMOUNT"]         = dsRecipeDetail.Tables[0].Rows[i]["AMOUNT"].ToString();
                    dr["DOSEUNIT"]       = dsRecipeDetail.Tables[0].Rows[i]["UNIT"].ToString();
                    dr["TOTALMONEY"]     = Math.Round(Convert.ToDouble(dsRecipeDetail.Tables[0].Rows[i]["TOTALMONEY"]), 2).ToString() + "元";
                    dr["OFFICE"]         = dsRecipeDetail.Tables[0].Rows[i]["EXECOFFICE"].ToString();
                    dr["APPLYREMARK"]    = "";
                    dr["APPLYDOCNO"]     = dsRecipeDetail.Tables[0].Rows[i]["APPLYDOCNO"].ToString();
                    dr["INHOSID"]        = "";
                    dr["RECIPESTATE"]    = dsRecipeDetail.Tables[0].Rows[i]["RECIPESTATE"].ToString();
                    //2016年7月1日
                    dr["DOCTOR"]         = dsRecipeDetail.Tables[0].Rows[i]["DOCTOR"].ToString();
                    dr["OPERATETIME"]    = dsRecipeDetail.Tables[0].Rows[i]["OPERATETIME"].ToString();
                    dr["REGISTERID"]     = dsRecipeDetail.Tables[0].Rows[i]["REGISTERID"].ToString();
                    dr["OPERATOROFFICE"] = dsRecipeDetail.Tables[0].Rows[i]["OPERATOROFFICE"].ToString();
                    dr["STATE"]          = dsRecipeDetail.Tables[0].Rows[i]["RECIPESTATE"].ToString() == "1" ? "已收费" : "未收费";
                    dr["REMARK"]         = dsRecipeDetail.Tables[0].Rows[i]["REMARK"].ToString();
                    dr["OFFICEADDRESS"]  = dsRecipeDetail.Tables[0].Rows[i]["OFFICEADDRESS"].ToString();
                    dr["RECIPECONTENT"]  = dsRecipeDetail.Tables[0].Rows[i]["RECIPECONTENT"].ToString();

                    dtRecipe.Rows.Add(dr);
                }
                #endregion
            }
            if (dtRecipe.Rows.Count > 0)
            {
                ClinicPhysicianRecipeFacade facade = new ClinicPhysicianRecipeFacade();
                DataTable dtableTemp = facade.GetGroupByRecipeDetail("门诊", dtRecipe);

                if (dtableTemp == null)
                {
                    SkyComm.ShowMessageInfo("执行获取组信息失败");
                    this.gdcMain.DataSource = null;
                    return(false);
                }
                //wangchao modify 2016-08-15 根据开单时间和申请单号排序
                DataTable dtSort = dtableTemp.Copy();
                DataView  dvSort = dtSort.DefaultView;
                dvSort.Sort = "OPERATETIME DESC,APPLYDOCNO DESC";
                dtRecipe    = dvSort.ToTable();


                this.gdcMain.DataSource = getTrueOfficeDataTable(diagnoseidC, dtRecipe, clinicPhysicianRecipeFacade);
                //                this.gdcMain.DataSource = dtRecipe;
            }
            else
            {
                SkyComm.ShowMessageInfo("未查询到对应处方信息或该处方数据已经过期!");
                return(false);
            }
            return(true);

            #endregion
        }