Beispiel #1
0
        private void m_mthAddNewNode(clsRecipeInfo_VO objRI_VO)
        {
            string   strdate = DateTime.Parse(objRI_VO.m_strCreatTime).ToString("yyyy年MM月dd日");
            TreeNode tn      = new TreeNode(strdate);
            TreeNode subtn   = new TreeNode(objRI_VO.m_strOUTPATRECIPEID_CHR);

//			switch(objRI_VO.m_intPSTATUS_INT)
//			{
//				case 1:
//					subtn.ForeColor=Color.Brown;
//					break;
//				case 2:
//					subtn.ForeColor=Color.Red;
//					break;
//			}
            subtn.ForeColor = this.m_mthCreatColor(objRI_VO.m_intPSTATUS_INT);
            subtn.Tag       = objRI_VO;
            tn.Nodes.Add(subtn);
            this.tv.Nodes.Add(tn);
        }
Beispiel #2
0
 private void m_mthSelectRecipe()
 {
     try
     {
         if (this.tv.SelectedNode.Tag != null)
         {
             this.objRecipeInfo_VO = (clsRecipeInfo_VO)this.tv.SelectedNode.Tag;
             this.tv.Hide();
             this.txtRecipeNo.Text      = objRecipeInfo_VO.m_strOUTPATRECIPEID_CHR;
             this.txtRecipeNo.ForeColor = this.m_mthCreatColor(this.objRecipeInfo_VO.m_intPSTATUS_INT);
             if (RecipeSelected != null)
             {
                 RecipeSelected(this, null);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #3
0
        /// <summary>
        /// 加载处方号
        /// </summary>
        /// <param name="strID"></param>
        public void m_mthLoadRecipeNo(string strID)
        {
            clsRecipeInfo_VO[] objRI_VO = null;
            com.digitalwave.iCare.middletier.HIS.clsOPChargeQuerySvc objSvc =
                (com.digitalwave.iCare.middletier.HIS.clsOPChargeQuerySvc)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(com.digitalwave.iCare.middletier.HIS.clsOPChargeQuerySvc));
            long l = objSvc.m_mthFindRecipeNoByPatientID(null, strPatientID, out objRI_VO, strID, intFalg);

//			ArrayList  objArr;
//			if(l>0&&objRI_VO!=null)
//			{
//				this.m_mthFilter(objRI_VO,out objArr);
//			}
//			else
//			{
//				return;
//			}
            if (l > 0 && objRI_VO != null)
            {
                if (objRI_VO.Length == 1)
                {
                    this.objRecipeInfo_VO = objRI_VO[0];

                    this.txtRecipeNo.Text = objRecipeInfo_VO.m_strOUTPATRECIPEID_CHR;
                    if (RecipeSelected != null)
                    {
                        RecipeSelected(this, null);
                        if (this.objRecipeInfo_VO != null)
                        {
                            this.txtRecipeNo.ForeColor = this.m_mthCreatColor(this.objRecipeInfo_VO.m_intPSTATUS_INT);
                        }
                    }
                }
                else
                {
                    this.m_mthFillTreeView(objRI_VO);
                }
            }
        }
Beispiel #4
0
 /// <summary>
 /// 清空数据
 /// </summary>
 public void m_mthClearText()
 {
     this.txtRecipeNo.Clear();
     this.objRecipeInfo_VO = null;
 }
Beispiel #5
0
        /// <summary>
        /// 选中某条后,查询处方
        /// </summary>
        public void m_mthGetRecipeInfo()
        {
            this.m_objViewer.objListApp.Clear();
            if (this.m_objViewer.trvRecipe.SelectedNode != null && this.m_objViewer.trvRecipe.SelectedNode.Tag != null)
            {
                try
                {
                    clsRecipeInfo_VO objRI_VO = (clsRecipeInfo_VO)this.m_objViewer.trvRecipe.SelectedNode.Tag;
                    DataTable        dt       = new DataTable();
                    this.m_objViewer.dgvRecipe.Rows.Clear();
                    this.m_objViewer.dgvDetails.Rows.Clear();
                    if (true)
                    {
                        DataTable dtbDiagnosisItemStatus = null;
                        long      ret = 0;
                        //诊疗项目
                        //检验
                        int intCheck = 1;
                        //检查
                        int intTest = 2;
                        //手术
                        int     intOps       = 3;
                        int     intIsSendOth = 0;
                        int     intRowIndex  = 0;
                        decimal Totalmny     = 0;
                        objSvc.m_mthRecipeDetail(objRI_VO.m_strOUTPATRECIPEID_CHR, out dt);
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            intRowIndex = this.m_objViewer.dgvRecipe.Rows.Add();

                            DataGridViewRow dgvrTemp = this.m_objViewer.dgvRecipe.Rows[intRowIndex];
                            DataRow         dr       = dt.Rows[i];

                            //方号
                            dgvrTemp.Cells["colRepNo"].Value = dr["id"].ToString();
                            //项目名称
                            dgvrTemp.Cells["colItemName"].Value = dr["name"].ToString();
                            //诊疗项目id
                            dgvrTemp.Cells["colItemID"].Value    = dr["itemid_chr"].ToString();
                            dgvrTemp.Cells["colPatientID"].Value = dr["usageparentid_vchr"].ToString();
                            dgvrTemp.Cells["coldeid"].Value      = dr["outpatrecipedeid_chr"].ToString();
                            dgvrTemp.Cells["colChecked"].Value   = "F";
                            dgvrTemp.Cells["colstatus"].Value    = "";
                            dgvrTemp.Cells["colType"].Value      = dr["tableindex_int"].ToString();
                            if (dr["status"].ToString() == "1")
                            {
                                dgvrTemp.Cells["colstatus"].Value     = "已确认";
                                dgvrTemp.Cells["colChecked"].Value    = "T";
                                dgvrTemp.Cells["colChecked"].ReadOnly = true;
                                dgvrTemp.ReadOnly = true;
                                dgvrTemp.DefaultCellStyle.BackColor = Color.Orange;
                            }
                            //添加目标申请单id
                            //dgvrTemp.Cells["colAttachid"].Value = dr["attachid_vchr"].ToString();

                            //string ordertype = dr["tableindex_int"].ToString();
                            //string strItemid = dr["itemid_chr"].ToString().Trim();
                            //if (dtbDiagnosisItemStatus != null)
                            //{
                            //    dtbDiagnosisItemStatus.Dispose();
                            //    dtbDiagnosisItemStatus = null;
                            //}
                            //if (ordertype == "3")
                            //{
                            //    dgvrTemp.Cells["colItemAttribute"].Value = "lis";
                            //    ret = objSvc.m_lngQueryDiagnosisItemStatus(p_strRecipeNo, dr["orderdicid_chr"].ToString().Trim(), intCheck, out dtbDiagnosisItemStatus);
                            //}
                            //else if (ordertype == "4")
                            //{
                            //    dgvrTemp.Cells["colItemAttribute"].Value = "test";
                            //    ret = objSvc.m_lngQueryDiagnosisItemStatus(p_strRecipeNo, dr["orderdicid_chr"].ToString().Trim(), intTest, out dtbDiagnosisItemStatus);
                            //}
                            //else if (ordertype == "5")
                            //{
                            //    dgvrTemp.Cells["colItemAttribute"].Value = "ops";
                            //    if (objSvc.m_blnChkopsitem(strItemid))
                            //    {
                            //        ret = objSvc.m_lngQueryDiagnosisItemStatus(p_strRecipeNo, dr["orderdicid_chr"].ToString().Trim(), intOps, out dtbDiagnosisItemStatus);
                            //    }
                            //    else
                            //    {
                            //        this.m_objViewer.dgvRecipe.Rows.RemoveAt(intRowIndex);
                            //        continue;
                            //    }
                            //}
                            //else
                            //{
                            //    continue;
                            //}

                            //if (ret > 0)
                            //{
                            //    Totalmny += ConvertObjToDecimal(dr["totalmny_dec"]);

                            //    if (dtbDiagnosisItemStatus != null && dtbDiagnosisItemStatus.Rows.Count > 0)
                            //    {
                            //        DataRow dtrTemp = dtbDiagnosisItemStatus.Rows[0];
                            //        int intStatus = 0;
                            //        int.TryParse(dtrTemp["isfinish"].ToString(), out intStatus);

                            //        if (intStatus == 1)
                            //        {
                            //            dgvrTemp.Cells["colChecked"].Value = "T";
                            //            dgvrTemp.Cells["colChecked"].ReadOnly = true;
                            //            dgvrTemp.Cells["colState"].Value = "已做";
                            //            dgvrTemp.DefaultCellStyle.BackColor = Color.Red;
                            //        }
                            //        else
                            //        {
                            //            dgvrTemp.Cells["colChecked"].Value = "F";
                            //            dgvrTemp.Cells["colState"].Value = "未做";
                            //        }
                            //    }

                            //    dgvrTemp.Tag = dr;
                            //}
                        }
                    }
                    else
                    {
                        this.m_objViewer.dgvRecipe.Columns["colchecked"].Visible = true;
                        string p_strRecipeNo = objRI_VO.m_strOUTPATRECIPEID_CHR;
                        //诊疗项目的状态,是否完成该诊疗
                        DataTable dtbDiagnosisItemStatus = null;
                        long      ret = 0;
                        #region 3、诊疗项目
                        //诊疗项目
                        //检验
                        int intCheck = 1;
                        //检查
                        int intTest = 2;
                        //手术
                        int     intOps       = 3;
                        int     intIsSendOth = 0;
                        int     intRowIndex  = 0;
                        decimal Totalmny     = 0;
                        ret = objSvc.m_mthFindRecipeDetailOrder(objRI_VO.m_strOUTPATRECIPEID_CHR, out dt);

                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            intRowIndex = this.m_objViewer.dgvRecipe.Rows.Add();

                            DataGridViewRow dgvrTemp = this.m_objViewer.dgvRecipe.Rows[intRowIndex];
                            DataRow         dr       = dt.Rows[i];

                            //方号
                            dgvrTemp.Cells["colRepNo"].Value = "";
                            //项目名称
                            dgvrTemp.Cells["colItemName"].Value = dr["orderdicname_vchr"].ToString();
                            //原规格
                            dgvrTemp.Cells["colOriSpecification"].Value = dr["spec_vchr"].ToString();
                            //新规格
                            dgvrTemp.Cells["colNewSpecification"].Value = "";
                            //频率
                            dgvrTemp.Cells["colFrequency"].Value = "";
                            //用法
                            dgvrTemp.Cells["colUsage"].Value = "";
                            //数量
                            dgvrTemp.Cells["colQuantity"].Value = dr["qty_dec"].ToString();
                            //原单价
                            dgvrTemp.Cells["colOriPrice"].Value = dr["pricemny_dec"].ToString();
                            //新单价
                            dgvrTemp.Cells["colNewPrice"].Value = "";
                            // 原合计金额
                            dgvrTemp.Cells["colSum"].Value = dr["totalmny_dec"].ToString();
                            //诊疗项目id
                            dgvrTemp.Cells["colItemID"].Value = dr["orderdicid_chr"].ToString();

                            //添加目标申请单id
                            dgvrTemp.Cells["colAttachid"].Value = dr["attachid_vchr"].ToString();

                            string ordertype = dr["tableindex_int"].ToString();
                            string strItemid = dr["itemid_chr"].ToString().Trim();
                            if (dtbDiagnosisItemStatus != null)
                            {
                                dtbDiagnosisItemStatus.Dispose();
                                dtbDiagnosisItemStatus = null;
                            }
                            if (ordertype == "3")
                            {
                                dgvrTemp.Cells["colItemAttribute"].Value = "lis";
                                ret = objSvc.m_lngQueryDiagnosisItemStatus(p_strRecipeNo, dr["orderdicid_chr"].ToString().Trim(), intCheck, out dtbDiagnosisItemStatus);
                            }
                            else if (ordertype == "4")
                            {
                                dgvrTemp.Cells["colItemAttribute"].Value = "test";
                                ret = objSvc.m_lngQueryDiagnosisItemStatus(p_strRecipeNo, dr["orderdicid_chr"].ToString().Trim(), intTest, out dtbDiagnosisItemStatus);
                            }
                            else if (ordertype == "5")
                            {
                                dgvrTemp.Cells["colItemAttribute"].Value = "ops";
                                if (objSvc.m_blnChkopsitem(strItemid))
                                {
                                    ret = objSvc.m_lngQueryDiagnosisItemStatus(p_strRecipeNo, dr["orderdicid_chr"].ToString().Trim(), intOps, out dtbDiagnosisItemStatus);
                                }
                                else
                                {
                                    this.m_objViewer.dgvRecipe.Rows.RemoveAt(intRowIndex);
                                    continue;
                                }
                            }
                            else
                            {
                                continue;
                            }

                            if (ret > 0)
                            {
                                Totalmny += ConvertObjToDecimal(dr["totalmny_dec"]);

                                if (dtbDiagnosisItemStatus != null && dtbDiagnosisItemStatus.Rows.Count > 0)
                                {
                                    DataRow dtrTemp   = dtbDiagnosisItemStatus.Rows[0];
                                    int     intStatus = 0;
                                    int.TryParse(dtrTemp["isfinish"].ToString(), out intStatus);

                                    if (intStatus == 1)
                                    {
                                        dgvrTemp.Cells["colChecked"].Value    = "T";
                                        dgvrTemp.Cells["colChecked"].ReadOnly = true;
                                        dgvrTemp.Cells["colState"].Value      = "已做";
                                        dgvrTemp.DefaultCellStyle.BackColor   = Color.Red;
                                    }
                                    else
                                    {
                                        dgvrTemp.Cells["colChecked"].Value = "F";
                                        dgvrTemp.Cells["colState"].Value   = "未做";
                                    }
                                }

                                dgvrTemp.Tag = dr;
                            }
                        }
                        #endregion

                        #region 4、其他项目,只是显示手动添加的,不显示项目带出的

                        /*
                         * 可以通过查看是不是带出的项目来决定是否显示,如,它的用法带出父项目id为空
                         * **/
                        //6、其他
                        ret = objSvc.m_mthFindRecipeDetail6(p_strRecipeNo, out dt, false);

                        if (ret > 0)
                        {
                            int intRwoCount = dt.Rows.Count;
                            for (int i1 = 0; i1 < intRwoCount; i1++)
                            {
                                DataRow dtrTemp = dt.Rows[i1];

                                if (string.IsNullOrEmpty(dtrTemp["usageparentid_vchr"].ToString().Trim()))
                                {
                                    intRowIndex = this.m_objViewer.dgvRecipe.Rows.Add();
                                    DataGridViewRow dgvrTemp = this.m_objViewer.dgvRecipe.Rows[intRowIndex];


                                    if (intIsSendOth == 1)
                                    {
                                        dgvrTemp.Cells["colChecked"].Value    = "T";
                                        dgvrTemp.Cells["colChecked"].ReadOnly = true;
                                        dgvrTemp.Cells["colState"].Value      = "已领材料";
                                        dgvrTemp.DefaultCellStyle.BackColor   = Color.Red;
                                    }
                                    else
                                    {
                                        dgvrTemp.Cells["colChecked"].Value = "F";
                                        dgvrTemp.Cells["colState"].Value   = "未领材料";
                                    }

                                    //方号
                                    dgvrTemp.Cells["colRepNo"].Value = "";
                                    //项目名称
                                    dgvrTemp.Cells["colItemName"].Value = dtrTemp["itemname"].ToString();
                                    //原规格
                                    dgvrTemp.Cells["colOriSpecification"].Value = dtrTemp["dec"].ToString();
                                    //新规格
                                    dgvrTemp.Cells["colNewSpecification"].Value = "";
                                    //频率
                                    dgvrTemp.Cells["colFrequency"].Value = "";
                                    //用法
                                    dgvrTemp.Cells["colUsage"].Value = "";
                                    //数量
                                    dgvrTemp.Cells["colQuantity"].Value = dtrTemp["quantity"].ToString();
                                    //原单价
                                    dgvrTemp.Cells["colOriPrice"].Value = dtrTemp["price"].ToString();
                                    //新单价
                                    dgvrTemp.Cells["colNewPrice"].Value = "";
                                    // 原合计金额
                                    dgvrTemp.Cells["colSum"].Value = dtrTemp["summoney"].ToString();
                                    //项目属性
                                    dgvrTemp.Cells["colItemAttribute"].Value = "oth";
                                    //项目Id
                                    dgvrTemp.Cells["colItemID"].Value = dtrTemp["itemid"].ToString();
                                    //添加目标申请单id
                                    dgvrTemp.Cells["colAttachid"].Value = "";

                                    if (dtrTemp["dec"].ToString().Trim() != dtrTemp["spec"].ToString().Trim())
                                    {
                                        dgvrTemp.Cells["colNewSpecification"].Value = dtrTemp["spec"].ToString();
                                    }

                                    if (this.ConvertObjToDecimal(dtrTemp["price"]) != this.ConvertObjToDecimal(dtrTemp["itemprice_mny"]))
                                    {
                                        dgvrTemp.Cells["colNewPrice"].Value = dtrTemp["itemprice_mny"].ToString();
                                    }

                                    Totalmny += ConvertObjToDecimal(dtrTemp["summoney"]);

                                    dgvrTemp.Tag = dtrTemp;
                                }
                            }
                        }
                        #endregion

                        if (this.m_objViewer.dgvRecipe.Rows.Count == 0)
                        {
                            intRowIndex = this.m_objViewer.dgvRecipe.Rows.Add();
                            DataGridViewRow dgvrTemp = this.m_objViewer.dgvRecipe.Rows[intRowIndex];
                            this.m_objViewer.dgvRecipe.Columns["colchecked"].Visible = false;
                            this.m_objViewer.dgvRecipe.Columns["colItemName"].Width  = 300;
                            dgvrTemp.Cells["colItemName"].Value    = "没有需要确认的检验、检查、手术等项目";
                            dgvrTemp.Cells["colItemName"].ReadOnly = true;
                        }
                    }
                }
                catch (Exception objEX)
                {
                    com.digitalwave.Utility.clsLogText objLog = new com.digitalwave.Utility.clsLogText();
                    objLog.LogError(objEX);
                }
            }
        }
Beispiel #6
0
        /// <summary>
        /// 构造
        /// </summary>
        public frmDoctReUseInfo(clsRecipeInfo_VO objRecinfo)
        {
            InitializeComponent();

            RecipeInfo_VO = objRecinfo;
        }
Beispiel #7
0
        public long m_lngGetPatientInfoByCardID(string p_strCardno, out clsRecipeInfo_VO[] objRI_VO)
        {
            long lngRes = -1;

            objRI_VO = null;
            DataTable          dtResult  = new DataTable();
            string             strSql    = @"select a.patientname_chr,a.recorddate_dat,
                                   a.invoiceno_vchr,
                                   d.patientcardid_chr,
                                   b.sex_chr,
                                   a.outpatrecipeid_chr,
                                   b.idcard_chr,
                                   a.deptname_chr,
                                   b.mobile_chr,
                                   a.totalsum_mny
                              from t_opr_outpatientrecipeinv a, t_bse_patient b, t_bse_patientcard d
                             where a.patientid_chr = b.patientid_chr
                               and a.patientid_chr = d.patientid_chr
                               and a.isvouchers_int = 2
                               and d.patientcardid_chr = ?
                               and not exists (select t.invoiceno_vchr
                                      from t_opr_outpatientrecipeinv t
                                     where t.isvouchers_int = 2
                                       and t.status_int = 2
                                       and a.invoiceno_vchr = t.invoiceno_vchr)
                             and exists
                             (select t.outpatrecipeid_chr
                                      from t_opr_outpatientrecipe t
                                     where t.pstauts_int <> -1
                                       and a.outpatrecipeid_chr = t.outpatrecipeid_chr)  order by recorddate_dat desc";
            clsHRPTableService objHRPSvc = null;

            dtResult = new DataTable();
            IDataParameter[] ParamArr = null;
            try
            {
                objHRPSvc = new clsHRPTableService();
                objHRPSvc.CreateDatabaseParameter(1, out ParamArr);
                ParamArr[0].Value = p_strCardno;
                lngRes            = objHRPSvc.lngGetDataTableWithParameters(strSql, ref dtResult, ParamArr);
                if (lngRes > 0 && dtResult.Rows.Count > 0)
                {
                    objRI_VO = new clsRecipeInfo_VO[dtResult.Rows.Count];
                    for (int i = 0; i < dtResult.Rows.Count; i++)
                    {
                        objRI_VO[i] = new clsRecipeInfo_VO();
                        objRI_VO[i].m_intPSTATUS_INT        = 5;
                        objRI_VO[i].m_strOUTPATRECIPEID_CHR = dtResult.Rows[i]["OUTPATRECIPEID_CHR"].ToString();
                        objRI_VO[i].m_strCreatTime          = dtResult.Rows[i]["recorddate_dat"].ToString();
                    }
                }
            }
            catch (Exception objEx)
            {
                com.digitalwave.Utility.clsLogText objLogger = new clsLogText();
                objLogger.LogError(objEx);
                objLogger = null;
            }
            finally
            {
                objHRPSvc.Dispose();
                objHRPSvc = null;
            }
            return(lngRes);
        }