Example #1
0
 private void UseCheck_Load(object sender, EventArgs e)
 {
     label1.Text = DB.GetPivasAllSetValue2("打印-打印确认-打印完成后调用画面");
     label2.Text = CheckPro();
 }
Example #2
0
        private void frmScanPre_Load(object sender, EventArgs e)
        {
            if (GetPivasLimit.Instance.Limit(EmployeeID, "ScanPre"))
            {
                cbbStatus.SelectedIndex = 1;
                comboBox2.SelectedIndex = 0;
                cb1.Checked             = true;
                cb2.Checked             = true;
                cb3.Checked             = true;

                cbP.Checked = true;
                cbK.Checked = true;
                cbH.Checked = true;
                cbY.Checked = true;
                cbZ.Checked = true;
                newdgvWard(P);
                TraversalDgvWard();
                newdgvPre();



                try
                {
                    dtp1.Text = DateTime.Now.AddDays(int.Parse(DB.GetPivasAllSet("医嘱查询-默认开始时间/结束时间-画面显示"))).ToString();
                    dtp2.Text = DateTime.Now.AddDays(int.Parse(DB.GetPivasAllSetValue2("医嘱查询-默认开始时间/结束时间-画面显示"))).ToString();
                }
                catch
                {
                    MessageBox.Show("  综合设置中:<医嘱查询-默认开始时间/结束时间-画面显示> 设置项请设置数字。  ");
                }

                //画面初始大小设置
                if (DB.GetPivasAllSet("医嘱查询-画面初始最大化") == "1")
                {
                    MaximizedBounds                = Screen.PrimaryScreen.WorkingArea;
                    this.FormBorderStyle           = FormBorderStyle.None;
                    this.WindowState               = FormWindowState.Maximized;
                    this.MaximumSize               = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
                    Panel_Max_None.BackgroundImage = global::ScanPre.Properties.Resources.还原;
                }

                //普抗化营筛选显示设置
                if (DB.GetPivasAllSet("医嘱查询-普抗化营筛选-画面显示") == "0")
                {
                    cbP.Visible = false;
                    cbK.Visible = false;
                    cbH.Visible = false;
                    cbY.Visible = false;
                    cbZ.Visible = false;
                }


                //长期临时筛选显示设置
                if (DB.GetPivasAllSet("医嘱查询-长期临时筛选-画面显示") == "0")
                {
                    cb1.Visible = false;
                    cb2.Visible = false;
                }

                //今日生有生成瓶签 筛选显示设置
                string Xianshi = DB.GetPivasAllSet("医嘱查询-今日有瓶签勾选-画面显示");
                string GouXuan = DB.GetPivasAllSetValue2("医嘱查询-今日有瓶签勾选-画面显示");
                if (Xianshi == "0")
                {
                    checkBox1.Visible = false;
                    checkBox1.Checked = false;
                }
                else if (Xianshi == "1" && GouXuan == "1")
                {
                    checkBox1.Visible = true;
                    checkBox1.Checked = true;
                }
                else if (Xianshi == "1" && GouXuan == "0")
                {
                    checkBox1.Visible = true;
                    checkBox1.Checked = false;
                }
                else
                {
                    checkBox1.Visible = false;
                    checkBox1.Checked = false;
                    MessageBox.Show("  综合设置中:<医嘱查询-今日有瓶签勾选-画面显示> 设置项 设置不正确。 ");
                }


                //模糊查询框 显示设置
                if (DB.GetPivasAllSet("医嘱查询-模糊查询框-画面显示") == "0")
                {
                    txtName.Visible = false;
                }

                //病区默认勾选
                if (DB.GetPivasAllSet("医嘱查询-画面初始病区勾选") == "0")
                {
                    P = 0;
                    newdgvWard(P);
                    TraversalDgvWard();
                    newdgvPre();
                }
                else if (DB.GetPivasAllSet("医嘱查询-画面初始病区勾选") == "2")
                {
                    P = 2;
                    newdgvWard(P);
                    TraversalDgvWard();
                    newdgvPre();
                }
                else if (DB.GetPivasAllSet("医嘱查询-画面初始病区勾选") == "1")
                {
                    P = 1;
                    newdgvWard(P);
                    TraversalDgvWard();
                    newdgvPre();
                }
                else
                {
                    newdgvWard(P);
                    TraversalDgvWard();
                    newdgvPre();
                    MessageBox.Show("  综合设置中:<医嘱查询-画面初始病区勾选> 设置项 设置不正确。 ");
                }
            }

            else
            {
                this.Dispose();
            }
        }
Example #3
0
        /// <summary>
        /// 病人列表模式下。查询病人瓶签详细信息
        /// </summary>
        /// <param name="WardCode"></param>
        /// <param name="dt"></param>
        /// <param name="s">BatchSaved</param>
        /// <param name="tags"></param>
        /// <param name="SelectText"></param>
        /// <param name="LabelOrderBy"></param>
        /// <returns></returns>
        public string IVRecordPatient(string WardCode, string dt, int s, bool tags, string SelectText, int LabelOrderBy)
        {
            string send  = db.GetPivasAllSet("批次-病人明细模式-未发送-已发送已打印瓶签");
            string print = db.GetPivasAllSetValue2("批次-病人明细模式-未发送-已发送已打印瓶签");

            StringBuilder str = new StringBuilder();

            str.Length = 0;
            str.Append(" select Count(LabelNo),patcode,patname from IVRecord i ");
            //str.Append(" where WardCode in (" + WardCode + ") ");
            //str.Append(" and LabelNo like '" + dt + "%'");
            str.Append(" where  LabelNo like '" + dt + "%'");
            str.Append("  and patcode='" + SelectText + "'");
            str.Append(" and IsBatch=1");
            if (WardCode != "")
            {
                str.Append(" and WardCode in (" + WardCode + ") ");
            }
            if (s == 2)
            {
                str.Append(" and ivstatus >=3 ");
            }
            else
            {
                if (tags)
                {
                    str.Append(" and ivstatus=1");
                }
                else
                {
                    str.Append(" and ivstatus=0");
                    //if (s != 2)
                    //{
                    str.Append(" and BatchSaved=" + s);
                    //}
                }
            }
            if (SelectText != "")
            {
                str.Append("and patcode='" + SelectText + "'");
            }
            str.Append("  and LabelOver>=0 ");
            str.Append(" and (i.Remark2 <> '-1' or i.Remark2 is null or i.Remark2 <> '-2') ");
            str.Append(" group by patcode,PatName");


            str.Append(" select distinct i.PatCode,Batch,BatchRule,OC.OrderColor,OC.OrderTColor as TColor,P.UsageName, TeamNumber,i.WardCode,i.WardName,i.GroupNo,LabelNo,i.IsSame,");
            str.Append(" FreqName,id.Spec,id.DrugName,pa.PatName,pa.BedNo,CASE WHEN pa.sex= '1' THEN '男' WHEN pa.sex= '2' THEN '女' ELSE '其他' END sex,");
            str.Append("  pa.age,pa.AgeSTR, i.InsertDT,case BatchSaved when 0 then '未发送' else '已发送' end BatchSaved,DgNo,");
            str.Append(" case IVStatus when 0 then '未打印' else '已打印' end IVStatus,");
            str.Append(" case BatchSaved when 0 then '未发送' else '已发送' end IsCommand,");
            str.Append(" case when cast(id.Dosage as float) > cast(cast(id.Dosage as float) as INT) then cast(id.Dosage as float)");
            str.Append(" else cast(cast(id.Dosage as float) as int) end as Dosage,");
            str.Append(" case when  id.DosageUnit is null then '' else  id.DosageUnit end AS DosageUnit ");
            str.Append(" , CASE id.DosageUnit WHEN 'ml' THEN id.Dosage WHEN 'l' THEN (1000 * id.Dosage)  ");
            str.Append("  ELSE isnull(dd.Capacity, 0) * id.DgNo END AS Remark9,dd.CapacityUnit  ");
            str.Append(" from dbo.IVRecord i");
            str.Append("  left join Patient pa on pa.PatCode=i.PatCode ");
            str.Append(" left join IVRecordDetail id on i.IVRecordID=id.IVRecordID ");
            str.Append(" left join DDrug dd on dd.DrugCode=id.DrugCode ");
            str.Append(" left join OrderColor OC on OC.OrderID=i.TeamNumber");
            str.Append(" inner join Prescription P on i.GroupNo=P.GroupNo ");
            str.Append(" where LabelNo like '" + dt + "%'");
            str.Append(" and IsBatch=1 ");



            if (WardCode != "")
            {
                str.Append(" and  i.WardCode in (" + WardCode + ") ");
            }
            if (s == 2)
            {
                str.Append(" and ivstatus >=3 ");
            }
            else
            {
                if (tags)
                {
                    str.Append(" and ivstatus=1");
                }
                else
                {
                    if (print == "0")
                    {
                        str.Append(" and ivstatus=0");
                    }
                    if (send == "0")
                    {
                        str.Append(" and BatchSaved=" + s);
                    }
                }
            }
            if (SelectText != "")
            {
                str.Append("  and i.patcode='" + SelectText + "'");
            }
            str.Append("  and LabelOver>=0 ");
            str.Append(" and ((i.Remark2 <> '-1' and i.Remark2 <> '-2') or i.Remark2 is null ) ");
            str.Append(" order by TeamNumber,");
            if (LabelOrderBy == 0)
            {
                str.Append("i.LabelNo,");
            }
            else if (LabelOrderBy == 1)
            {
                str.Append("i.FreqCode,");
            }
            else
            {
                str.Append("i.GroupNo,");
            }
            str.Append("i.PatCode,DgNo");
            return(str.ToString());
        }