예제 #1
0
        private string m_mthStringOperator(clsOutpatientPrintRecipeDetail_VO objtemp)
        {
            string ret = "";

            if (objtemp.m_strUsage != "")
            {
                ret += objtemp.m_strUsage + "/次";
            }
            if (objtemp.m_strFrequency != "")
            {
                if (ret.Trim() != "")
                {
                    ret += ",";
                }
                ret += objtemp.m_strFrequency;
            }
            if (objtemp.m_strDays != "")
            {
                if (ret.Trim() != "")
                {
                    ret += ",";
                }
                ret += objtemp.m_strDays;
            }
            return(ret);
        }
예제 #2
0
        public static void m_mthGetRecipeInfoByCaseHistoryID(string strID, out ArrayList a1, out ArrayList a2)
        {
            DataTable          dt;
            clsDcl_ShowReports objSvc = new clsDcl_ShowReports();
            long ret = objSvc.m_mthGetRecipeInfoByCaseHistoryID(strID, out dt);

            a1 = new ArrayList();
            a2 = new ArrayList();
            if (ret > 0 && dt.Rows.Count > 0)
            {
                string strTempID = dt.Rows[0]["OUTPATRECIPEID_CHR"].ToString().Trim();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (dt.Rows[i]["SEQID_CHR"].ToString().Trim() == "1")
                    {
                        continue;
                    }
                    if (strTempID != dt.Rows[i]["OUTPATRECIPEID_CHR"].ToString().Trim())
                    {
                        clsOutpatientPrintRecipeDetail_VO objSpilt = null;

                        if (a1.Count > 0)
                        {
                            a1.Add(objSpilt);
                        }
                        if (a2.Count > 0)
                        {
                            a2.Add(objSpilt);
                        }
                        strTempID = dt.Rows[i]["OUTPATRECIPEID_CHR"].ToString().Trim();
                    }

                    clsOutpatientPrintRecipeDetail_VO objtemp = new clsOutpatientPrintRecipeDetail_VO();
                    objtemp.m_strChargeName = dt.Rows[i]["ITEMNAME"].ToString().Trim();
                    objtemp.m_strCount      = dt.Rows[i]["QUANTITY"].ToString().Trim() + dt.Rows[i]["UNIT"].ToString().Trim();
                    objtemp.m_strPrice      = "";
                    objtemp.m_strSumPrice   = "";
                    objtemp.m_strUnit       = dt.Rows[i]["UNIT"].ToString().Trim();
                    objtemp.m_strFrequency  = dt.Rows[i]["FREQNAME_CHR"].ToString().Trim();
                    objtemp.m_strDosage     = dt.Rows[i]["QTY_DEC"].ToString().Trim() + dt.Rows[i]["DOSAGEUNIT_CHR"].ToString().Trim();
                    objtemp.m_strDays       = dt.Rows[i]["DAYS_INT"].ToString().Trim() + "天";
                    objtemp.m_strSpec       = dt.Rows[i]["DEC"].ToString().Trim();
                    objtemp.m_strUsage      = dt.Rows[i]["USAGENAME_VCHR"].ToString().Trim();
                    objtemp.m_strRowNo      = dt.Rows[i]["ROWNO_CHR"].ToString().Trim();
                    objtemp.m_strInvoiceCat = dt.Rows[i]["invtype"].ToString().Trim();
                    if (dt.Rows[i]["SEQID_CHR"].ToString().Trim() == "2")
                    {
                        a2.Add(objtemp);
                    }
                    else
                    {
                        a1.Add(objtemp);
                    }
                }
            }
        }
예제 #3
0
        /// <summary>
        /// 打印内容
        /// </summary>
        /// <param name="currRows">行数</param>
        /// <param name="p_blnDiffOn">是否打印让利列</param>
        private void m_mthPrintText(ref int currRows, bool p_blnDiffOn)
        {
            Y += 5;
            float X = this.objDraw.PageBounds.Width * fltLeftIndentProp;
            //项目最大长度
            SizeF size = objDraw.Graphics.MeasureString("样", objFontNormal);
            float ItemNameMaxLength = this.objDraw.PageBounds.Width * 0.30f;

            intMaxLength = (int)Math.Floor(ItemNameMaxLength / size.Width);
            StringFormat objSF = new StringFormat();

            objSF.Alignment = StringAlignment.Far;
            float[] widthflaArr = { 0.34f, 0.45f, 0.655f, 0.78f, 0.84f, 0.94f };
            if (p_blnDiffOn)
            {
                widthflaArr = new float[] { 0.30f, 0.43f, 0.56f, 0.65f, 0.7f, 0.94f, 0.77f, 0.88f }
            }
            ;                                                                                       //倒数第三个为最后一项宽
            decimal decTotalDiffCost = 0;

            for (int i = currRows; i < this.obj_VO.objPRDArr.Count; i++)
            {
                clsOutpatientPrintRecipeDetail_VO objtemp = obj_VO.objPRDArr[i] as clsOutpatientPrintRecipeDetail_VO;
                X = this.objDraw.PageBounds.Width * fltLeftIndentProp;
                int temp = 1;
                if (objtemp.m_strChargeName.Length <= intMaxLength)
                {
                    objDraw.Graphics.DrawString(objtemp.m_strChargeName, objFontNormal, Brushes.Black, X, Y);
                }
                else
                {
                    objDraw.Graphics.DrawString(objtemp.m_strChargeName.Substring(0, intMaxLength), objFontNormal, Brushes.Black, X, Y);
                    objDraw.Graphics.DrawString(objtemp.m_strChargeName.Substring(intMaxLength, objtemp.m_strChargeName.Length - intMaxLength), objFontNormal, Brushes.Black, X, Y + fltRowHeight);
                    temp = 2;
                }
                //规格
                X = this.objDraw.PageBounds.Width * widthflaArr[0];
                objDraw.Graphics.DrawString(objtemp.m_strSpec, objFontNormal, Brushes.Black, X, Y);
                //产地
                X = this.objDraw.PageBounds.Width * widthflaArr[1];
                objDraw.Graphics.DrawString(objtemp.m_strFrequency, objFontNormal, Brushes.Black, X, Y);
                //单位
                X = this.objDraw.PageBounds.Width * widthflaArr[2];
                objDraw.Graphics.DrawString(objtemp.m_strUnit, objFontNormal, Brushes.Black, X, Y);

                //单价
                X = this.objDraw.PageBounds.Width * widthflaArr[3];
                objDraw.Graphics.DrawString(objtemp.m_strPrice, objFontNormal, Brushes.Black, X, Y, objSF);
                //数量
                X = this.objDraw.PageBounds.Width * widthflaArr[4];
                objDraw.Graphics.DrawString(objtemp.m_strCount, objFontNormal, Brushes.Black, X, Y, objSF);
                if (p_blnDiffOn)
                {
                    //让利金额
                    X = this.objDraw.PageBounds.Width * widthflaArr[6];
                    objDraw.Graphics.DrawString(objtemp.m_decTolDiffPrice.ToString(), objFontNormal, Brushes.Black, X, Y, objSF);
                    //实付金额
                    X = this.objDraw.PageBounds.Width * widthflaArr[7];
                    objDraw.Graphics.DrawString((clsPublic.ConvertObjToDecimal(objtemp.m_strSumPrice) - Math.Abs(objtemp.m_decTolDiffPrice)).ToString(), objFontNormal, Brushes.Black, X, Y, objSF);
                    decTotalDiffCost += objtemp.m_decTolDiffPrice;
                }
                //总金额
                X = this.objDraw.PageBounds.Width * widthflaArr[5];
                objDraw.Graphics.DrawString(objtemp.m_strSumPrice, objFontNormal, Brushes.Black, X, Y, objSF);

                Y += this.fltRowHeight * temp + 3;
                if (Y + 2 * fltRowHeight > this.objDraw.PageBounds.Height)
                {
                    currRows = i + 1;
                    this.objDraw.HasMorePages = true;
                    return;
                }
            }
            decTotalDiffCost = Math.Abs(decTotalDiffCost) * -1;
            //处方总金额
            X  = this.objDraw.PageBounds.Width * 0.94f;
            Y += 30;
            if (p_blnDiffOn)
            {
                obj_VO.m_strSelfPay     = (decimal.Parse(obj_VO.m_strSelfPay)).ToString();
                obj_VO.m_strRecipePrice = (decimal.Parse(obj_VO.m_strRecipePrice) + decTotalDiffCost).ToString();
            }
            string strPrint = "记帐金额:" + obj_VO.m_strChargeUp + "   " + "自付金额:" + obj_VO.m_strSelfPay + "   " + "合计:   " + obj_VO.m_strRecipePrice;

            objDraw.Graphics.DrawString(strPrint, objFontNormal, Brushes.Black, X, Y, objSF);
            if (obj_VO.m_strChargeUp != null && obj_VO.m_strChargeUp.Trim() != "0.00" && obj_VO.m_strChargeUp != null && obj_VO.m_strChargeUp.Trim() != string.Empty && obj_VO.m_strChargeUp != null && obj_VO.m_strChargeUp.Trim() != string.Empty && obj_VO.m_strRegisterFee != null && obj_VO.m_strRegisterFee.Trim() != string.Empty && obj_VO.m_strTreatFee != null && obj_VO.m_strTreatFee.Trim() != string.Empty)
            {
                string m_strTemp = "(其中记账挂号费:" + obj_VO.m_strRegisterFee + " 记账诊金:" + obj_VO.m_strTreatFee + " 其他记账:" + ((decimal)(decimal.Parse(obj_VO.m_strChargeUp) - decimal.Parse(obj_VO.m_strRegisterFee) - decimal.Parse(obj_VO.m_strTreatFee))).ToString("0.00") + ")";
                Y += 25;
                objDraw.Graphics.DrawString(m_strTemp, objFontNormal, Brushes.Black, X, Y, objSF);
            }
        }
예제 #4
0
        public void m_mthBegionPrint(System.Drawing.Printing.PrintEventArgs e)
        {
            if (dtChargeCheck.Rows.Count == 0 && this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber < 0)
            {
                e.Cancel = true;
                return;
            }
            string    strSEQID   = this.m_objViewer.DgChargeCheck[this.m_objViewer.DgChargeCheck.CurrentRowIndex, 3].ToString();
            DataTable dtChargeDe = new DataTable();
            DataView  dv;

            if ((string)this.m_objViewer.DgChargeCheck.Tag == "dtChargeCheck")
            {
                dv = m_dvRegister;
                //strSEQID=m_dvRegister[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["流水号"].ToString();
            }
            else
            {
                dv = m_dvRegisterfind;
                //strSEQID=m_dvRegisterfind[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["流水号"].ToString();
            }
            if (strSEQID == "")
            {
                e.Cancel = true;
                return;
            }
            Domain.m_lngGetRecipeDate(strSEQID, out dtChargeDe); //获取明细数据

            obj_VO.m_strHospitalName = this.m_objComInfo.m_strGetHospitalTitle();
            obj_VO.m_strPrintDate    = this.m_objViewer.DgChargeCheck[this.m_objViewer.DgChargeCheck.CurrentRowIndex, 13].ToString(); //dv[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["记录时间"].ToString();//打印时间
            obj_VO.m_strCardID       = this.m_objViewer.DgChargeCheck[this.m_objViewer.DgChargeCheck.CurrentRowIndex, 0].ToString();  //dv[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["诊疗卡号"].ToString();//打印时间
            obj_VO.strInvoiceNO      = this.m_objViewer.DgChargeCheck[this.m_objViewer.DgChargeCheck.CurrentRowIndex, 1].ToString();  //dv[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["发票编号"].ToString();//打印时间
            obj_VO.m_strPatientName  = this.m_objViewer.DgChargeCheck[this.m_objViewer.DgChargeCheck.CurrentRowIndex, 5].ToString();  //dv[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["病人名称"].ToString();//打印时间
            obj_VO.m_strPatientType  = this.m_objViewer.DgChargeCheck[this.m_objViewer.DgChargeCheck.CurrentRowIndex, 4].ToString();  //dv[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["病人身份"].ToString();//打印时间
            //			obj_VO.m_strPrintDate =dv[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["记录时间"].ToString();//打印时间
            //			obj_VO.m_strPrintDate =dv[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["记录时间"].ToString();//打印时间
            obj_VO.m_strChargeUp   = "";
            obj_VO.m_strSelfPay    = "";
            obj_VO.m_strEmployer   = this.m_objViewer.DgChargeCheck[this.m_objViewer.DgChargeCheck.CurrentRowIndex, 20].ToString(); // dv[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["工作单位"].ToString();
            obj_VO.m_strDiagDrName = this.m_objViewer.DgChargeCheck[this.m_objViewer.DgChargeCheck.CurrentRowIndex, 11].ToString(); //dv[this.m_objViewer.DgChargeCheck.CurrentCell.RowNumber]["医生名称"].ToString();
            ArrayList objItemArr = new ArrayList();
            decimal   MoneyAll   = 0;

            if (dtChargeDe.Rows.Count > 0)
            {
                for (int i1 = 0; i1 < dtChargeDe.Rows.Count; i1++)
                {
                    clsOutpatientPrintRecipeDetail_VO objDetail = new clsOutpatientPrintRecipeDetail_VO();
                    decimal totalMoney = 0;
                    objDetail.m_strChargeName = dtChargeDe.Rows[i1]["NAME"].ToString().Trim();
                    objDetail.m_strSpec       = dtChargeDe.Rows[i1]["DEC"].ToString().Trim();
                    objDetail.m_strFrequency  = dtChargeDe.Rows[i1]["PDCAREA_VCHR"].ToString().Trim();//这里用了频率存放了生产地
                    objDetail.m_strUnit       = dtChargeDe.Rows[i1]["UINT"].ToString().Trim();
                    objDetail.m_strPrice      = dtChargeDe.Rows[i1]["PRICE"].ToString().Trim();
                    objDetail.m_strCount      = dtChargeDe.Rows[i1]["COUNT"].ToString().Trim();
                    if (dtChargeDe.Rows[i1]["NAME"].ToString().IndexOf("挂号费") != -1)
                    {
                        obj_VO.m_strRegisterFee = ((decimal)(clsConvertToDecimal.m_mthConvertObjToDecimal(dtChargeDe.Rows[i1]["COUNT"]) * clsConvertToDecimal.m_mthConvertObjToDecimal(dtChargeDe.Rows[i1]["PRICE"]))).ToString("0.00");
                    }
                    if (dtChargeDe.Rows[i1]["NAME"].ToString().IndexOf("诊金") != -1)
                    {
                        obj_VO.m_strTreatFee = ((decimal)(clsConvertToDecimal.m_mthConvertObjToDecimal(dtChargeDe.Rows[i1]["COUNT"]) * clsConvertToDecimal.m_mthConvertObjToDecimal(dtChargeDe.Rows[i1]["PRICE"]))).ToString("0.00");
                    }
                    totalMoney = clsConvertToDecimal.m_mthConvertObjToDecimal(dtChargeDe.Rows[i1]["COUNT"]) * clsConvertToDecimal.m_mthConvertObjToDecimal(dtChargeDe.Rows[i1]["PRICE"]);
                    totalMoney = Convert.ToDecimal(totalMoney.ToString("0.00"));
                    objDetail.m_strSumPrice = totalMoney.ToString("0.00");
                    MoneyAll += totalMoney;
                    objDetail.m_decTolDiffPrice = clsConvertToDecimal.m_mthConvertObjToDecimal(dtChargeDe.Rows[i1]["toldiffprice_mny"]);// 总让利金额
                    objItemArr.Add(objDetail);
                }
                if (dtChargeDe.Rows[0]["ACCTSUM_MNY"] != null && dtChargeDe.Rows[0]["ACCTSUM_MNY"].ToString().Trim() != string.Empty)
                {
                    obj_VO.m_strChargeUp = double.Parse(dtChargeDe.Rows[0]["ACCTSUM_MNY"].ToString()).ToString("0.00");
                }
                if (dtChargeDe.Rows[0]["sbsum_mny"] != null && dtChargeDe.Rows[0]["sbsum_mny"].ToString().Trim() != string.Empty)
                {
                    obj_VO.m_strSelfPay = double.Parse(dtChargeDe.Rows[0]["sbsum_mny"].ToString()).ToString("0.00");
                }
                obj_VO.strCheckOutName = dtChargeDe.Rows[0]["LASTNAME_VCHR"].ToString();
            }
            obj_VO.objPRDArr        = objItemArr;
            obj_VO.m_strRecipePrice = MoneyAll.ToString("0.00");
            obj_VO.m_strINSURANCEID = Domain.m_strGetpatientidentityno(obj_VO.strInvoiceNO);
            isOtherPage             = false;
            currRows = 0;
        }
예제 #5
0
        public long m_lngGetPrintData(string m_strSid_int, out ArrayList m_objList1, out ArrayList m_objList2, out ArrayList m_objListGroupName, out clsOutpatientPrintRecipe_VO obj_VO)
        {
            long lngRes = 0;

            m_objList1         = new ArrayList();
            m_objList2         = new ArrayList();
            m_objListGroupName = new ArrayList();
            obj_VO             = new clsOutpatientPrintRecipe_VO();
            string    strSQL    = @" select   c.homephone_vchr, a.pstauts_int, b.outpatrecipedeid_chr,
         b.itemid_chr, b.unitid_chr, b.usageid_chr, b.tolqty_dec,
         b.unitprice_mny, b.tolprice_mny,
         case b.rowno_chr
            when '0'
               then ''
            else b.rowno_chr
         end as rowno_chr, b.days_int, b.qty_dec, b.discount_dec,
         b.freqid_chr, b.itemname_vchr, b.dosageunit_chr, b.itemspec_vchr,
         h.usagename_vchr, k.freqname_chr, b.dosage_dec, c.birth_dat,
         a.recorddate_dat, g.lastname_vchr as doctorname_chr, c.lastname_vchr,
         c.sex_chr, j.patientcardid_chr, b.desc_vchr, m1.serno_chr,
         e.diag_vchr
    from t_opr_recipesend m1,
         t_opr_recipesendentry n1,
         t_opr_outpatientrecipe a,
         t_opr_outpatientpwmrecipede b,
         t_bse_chargeitem d,
         t_opr_outpatientcasehis e,
         (select distinct (usageid_chr)
                     from t_opr_setusage
                    where orderid_vchr = 1 or orderid_vchr = 0) f,
         t_bse_usagetype h,
         t_aid_recipefreq k,
         t_bse_patient c,
         t_bse_employee g,
         t_bse_medicine m,
         t_bse_patientcard j
   where m1.sid_int = n1.sid_int
     and m1.sid_int = ?
     and a.outpatrecipeid_chr = n1.outpatrecipeid_chr
     and a.outpatrecipeid_chr = b.outpatrecipeid_chr(+)
     and b.itemid_chr = d.itemid_chr(+)
     and b.freqid_chr = k.freqid_chr
     and b.usageid_chr = f.usageid_chr
     and b.usageid_chr = h.usageid_chr
     and a.patientid_chr = c.patientid_chr
     and a.diagdr_chr = g.empid_chr(+)
     and d.itemsrcid_vchr = m.medicineid_chr
     and a.patientid_chr = j.patientid_chr
     and a.casehisid_chr = e.casehisid_chr
union all
select   c.homephone_vchr, a.pstauts_int, b.outpatrecipedeid_chr,
         b.itemid_chr, b.unitid_chr, b.usageid_chr, 0 as tolqty_dec,
         b.unitprice_mny, b.tolprice_mny,
         case b.rowno_chr
            when '0'
               then ''
            else b.rowno_chr
         end as rowno_chr, 0 as days_int, b.qty_dec, b.discount_dec,
         '' as freqid_chr, b.itemname_vchr, d.dosageunit_chr, b.itemspec_vchr,
         h.usagename_vchr, '' as freqname_chr, d.dosage_dec, c.birth_dat,
         a.recorddate_dat, g.lastname_vchr as doctorname_chr, c.lastname_vchr,
         c.sex_chr, j.patientcardid_chr, n.desc_vchr, m1.serno_chr,
         e.diag_vchr
    from t_opr_recipesend m1,
         t_opr_recipesendentry n1,
         t_opr_outpatientrecipe a,
         t_opr_outpatientcmrecipede b,
         t_bse_chargeitem d,
         t_opr_outpatientpwmrecipede n,
         t_opr_outpatientcasehis e,
         (select distinct (usageid_chr)
                     from t_opr_setusage
                    where orderid_vchr = 1 or orderid_vchr = 0) f,
         t_bse_usagetype h,
         t_bse_patient c,
         t_bse_employee g,
         t_bse_medicine m,
         t_bse_patientcard j
   where m1.sid_int = n1.sid_int
     and m1.sid_int = ?
     and a.outpatrecipeid_chr = n1.outpatrecipeid_chr
     and a.outpatrecipeid_chr = b.outpatrecipeid_chr(+)
     and b.itemid_chr = d.itemid_chr(+)
     and b.usageid_chr = f.usageid_chr
     and b.usageid_chr = h.usageid_chr
     and a.patientid_chr = c.patientid_chr
     and a.diagdr_chr = g.empid_chr(+)
     and d.itemsrcid_vchr = m.medicineid_chr
     and a.patientid_chr = j.patientid_chr
     and a.outpatrecipeid_chr = n.outpatrecipeid_chr(+)
     and a.casehisid_chr = e.casehisid_chr
union all
select   c.homephone_vchr, a.pstauts_int, b.outpatrecipedeid_chr,
         b.itemid_chr, b.itemunit_vchr as unitid_chr, '' as usageid_chr,
         0 as tolqty_dec, 0 as unitprice_mny, b.tolprice_mny,
         case b.rowno_chr
            when '0'
               then ''
            else b.rowno_chr
         end as rowno_chr, 0 as days_int, b.qty_dec, b.discount_dec,
         '' as freqid_chr, b.itemname_vchr, d.dosageunit_chr, b.itemspec_vchr,
         '' as usagename_vchr, '' as freqname_chr, d.dosage_dec, c.birth_dat,
         a.recorddate_dat, g.lastname_vchr as doctorname_chr, c.lastname_vchr,
         c.sex_chr, j.patientcardid_chr, n.desc_vchr, m1.serno_chr,
         e.diag_vchr
    from t_opr_recipesend m1,
         t_opr_recipesendentry n1,
         t_opr_outpatientrecipe a,
         t_opr_outpatientchkrecipede b,
         t_opr_outpatientpwmrecipede n,
         t_bse_chargeitem d,
         t_opr_outpatientcasehis e,
         (select distinct (usageid_chr)
                     from t_opr_setusage
                    where orderid_vchr = 1 or orderid_vchr = 0) f,
         t_bse_patient c,
         t_bse_employee g,
         t_bse_medicine m,
         t_bse_patientcard j
   where m1.sid_int = n1.sid_int
     and m1.sid_int = ?
     and a.outpatrecipeid_chr = n1.outpatrecipeid_chr
     and a.outpatrecipeid_chr = b.outpatrecipeid_chr(+)
     and b.itemid_chr = d.itemid_chr(+)
     and d.usageid_chr = f.usageid_chr
     and a.patientid_chr = c.patientid_chr
     and a.diagdr_chr = g.empid_chr(+)
     and d.itemsrcid_vchr = m.medicineid_chr
     and a.patientid_chr = j.patientid_chr
     and a.outpatrecipeid_chr = n.outpatrecipeid_chr(+)
     and a.casehisid_chr = e.casehisid_chr
union all
select   c.homephone_vchr, a.pstauts_int, b.outpatrecipedeid_chr,
         b.itemid_chr, b.itemunit_vchr as unitid_chr, '' as usageid_chr,
         0 as tolqty_dec, 0 as unitprice_mny, b.tolprice_mny,
         case b.rowno_chr
            when '0'
               then ''
            else b.rowno_chr
         end as rowno_chr, 0 as days_int, b.qty_dec, b.discount_dec,
         '' as freqid_chr, b.itemname_vchr, d.dosageunit_chr, b.itemspec_vchr,
         '' as usagename_vchr, '' as freqname_chr, d.dosage_dec, c.birth_dat,
         a.recorddate_dat, g.lastname_vchr as doctorname_chr, c.lastname_vchr,
         c.sex_chr, j.patientcardid_chr, n.desc_vchr, m1.serno_chr,
         e.diag_vchr
    from t_opr_recipesend m1,
         t_opr_recipesendentry n1,
         t_opr_outpatientrecipe a,
         t_opr_outpatienttestrecipede b,
         t_opr_outpatientpwmrecipede n,
         t_bse_chargeitem d,
         t_opr_outpatientcasehis e,
         (select distinct (usageid_chr)
                     from t_opr_setusage
                    where orderid_vchr = 1 or orderid_vchr = 0) f,
         t_bse_patient c,
         t_bse_employee g,
         t_bse_medicine m,
         t_bse_patientcard j
   where m1.sid_int = n1.sid_int
     and m1.sid_int = ?
     and a.outpatrecipeid_chr = n1.outpatrecipeid_chr
     and a.outpatrecipeid_chr = b.outpatrecipeid_chr(+)
     and b.itemid_chr = d.itemid_chr(+)
     and d.usageid_chr = f.usageid_chr
     and a.patientid_chr = c.patientid_chr
     and a.diagdr_chr = g.empid_chr(+)
     and d.itemsrcid_vchr = m.medicineid_chr
     and a.patientid_chr = j.patientid_chr
     and a.outpatrecipeid_chr = n.outpatrecipeid_chr(+)
     and a.casehisid_chr = e.casehisid_chr
union all
select   c.homephone_vchr, a.pstauts_int, b.outpatrecipedeid_chr,
         b.itemid_chr, b.itemunit_vchr as unitid_chr, '' as usageid_chr,
         0 as tolqty_dec, 0 as unitprice_mny, b.tolprice_mny,
         case b.rowno_chr
            when '0'
               then ''
            else b.rowno_chr
         end as rowno_chr, 0 as days_int, b.qty_dec, b.discount_dec,
         '' as freqid_chr, b.itemname_vchr, d.dosageunit_chr, b.itemspec_vchr,
         '' as usagename_vchr, '' as freqname_chr, d.dosage_dec, c.birth_dat,
         a.recorddate_dat, g.lastname_vchr as doctorname_chr, c.lastname_vchr,
         c.sex_chr, j.patientcardid_chr, n.desc_vchr, m1.serno_chr,
         e.diag_vchr
    from t_opr_recipesend m1,
         t_opr_recipesendentry n1,
         t_opr_outpatientrecipe a,
         t_opr_outpatientopsrecipede b,
         t_opr_outpatientpwmrecipede n,
         t_bse_chargeitem d,
         t_opr_outpatientcasehis e,
         (select distinct (usageid_chr)
                     from t_opr_setusage
                    where orderid_vchr = 1 or orderid_vchr = 0) f,
         t_bse_patient c,
         t_bse_employee g,
         t_bse_medicine m,
         t_bse_patientcard j
   where m1.sid_int = n1.sid_int
     and m1.sid_int = ?
     and a.outpatrecipeid_chr = n1.outpatrecipeid_chr
     and a.outpatrecipeid_chr = b.outpatrecipeid_chr(+)
     and b.itemid_chr = d.itemid_chr(+)
     and d.usageid_chr = f.usageid_chr
     and a.patientid_chr = c.patientid_chr
     and a.diagdr_chr = g.empid_chr(+)
     and d.itemsrcid_vchr = m.medicineid_chr
     and a.patientid_chr = j.patientid_chr
     and a.outpatrecipeid_chr = n.outpatrecipeid_chr(+)
     and a.casehisid_chr = e.casehisid_chr
union all
select   c.homephone_vchr, a.pstauts_int, b.outpatrecipedeid_chr,
         b.itemid_chr, b.itemunit_vchr as unitid_chr, '' as usageid_chr,
         0 as tolqty_dec, 0 as unitprice_mny, b.tolprice_mny,
         case b.rowno_chr
            when '0'
               then ''
            else b.rowno_chr
         end as rowno_chr, 0 as days_int, b.qty_dec, b.discount_dec,
         '' as freqid_chr, b.itemname_vchr, d.dosageunit_chr, b.itemspec_vchr,
         '' as usagename_vchr, '' as freqname_chr, d.dosage_dec, c.birth_dat,
         a.recorddate_dat, g.lastname_vchr as doctorname_chr, c.lastname_vchr,
         c.sex_chr, j.patientcardid_chr, n.desc_vchr, m1.serno_chr,
         e.diag_vchr
    from t_opr_recipesend m1,
         t_opr_recipesendentry n1,
         t_opr_outpatientrecipe a,
         t_opr_outpatientothrecipede b,
         t_opr_outpatientpwmrecipede n,
         t_bse_chargeitem d,
         t_opr_outpatientcasehis e,
         (select distinct (usageid_chr)
                     from t_opr_setusage
                    where orderid_vchr = 1 or orderid_vchr = 0) f,
         t_bse_patient c,
         t_bse_employee g,
         t_bse_medicine m,
         t_bse_patientcard j
   where m1.sid_int = n1.sid_int
     and m1.sid_int = ?
     and a.outpatrecipeid_chr = n1.outpatrecipeid_chr
     and a.outpatrecipeid_chr = b.outpatrecipeid_chr(+)
     and b.itemid_chr = d.itemid_chr(+)
     and d.usageid_chr = f.usageid_chr
     and a.patientid_chr = c.patientid_chr
     and a.outpatrecipeid_chr = n.outpatrecipeid_chr(+)
     and a.diagdr_chr = g.empid_chr(+)
     and d.itemsrcid_vchr = m.medicineid_chr
     and a.patientid_chr = j.patientid_chr
     and a.casehisid_chr = e.casehisid_chr
order by rowno_chr";
            DataTable dtbResult = new DataTable();

            com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new com.digitalwave.iCare.middletier.HRPService.clsHRPTableService();
            try
            {
                System.Data.IDataParameter[] objLisAddItemRefArr = null;
                objHRPSvc.CreateDatabaseParameter(6, out objLisAddItemRefArr);
                objLisAddItemRefArr[0].Value = m_strSid_int;
                objLisAddItemRefArr[1].Value = m_strSid_int;
                objLisAddItemRefArr[2].Value = m_strSid_int;
                objLisAddItemRefArr[3].Value = m_strSid_int;
                objLisAddItemRefArr[4].Value = m_strSid_int;
                objLisAddItemRefArr[5].Value = m_strSid_int;
                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtbResult, objLisAddItemRefArr);
                if (lngRes > 0 && dtbResult.Rows.Count > 0)
                {
                    DateTime dteBirth = Convert.ToDateTime("1900-1-1");
                    if (dtbResult.Rows[0]["BIRTH_DAT"] != System.DBNull.Value)
                    {
                        dteBirth = Convert.ToDateTime(dtbResult.Rows[0]["BIRTH_DAT"].ToString());
                    }

                    if (obj_VO == null)
                    {
                        obj_VO = new clsOutpatientPrintRecipe_VO();
                        obj_VO.objinjectArr = new ArrayList();
                        obj_VO.objPRDArr    = new ArrayList();
                        obj_VO.objPRDArr2   = new ArrayList();
                    }
                    //obj_VO.m_strAge = clsConvertDateTime.CalcAge(dteBirth);
                    obj_VO.m_strAge          = new clsBrithdayToAge().m_strGetAge(dteBirth);
                    obj_VO.m_strDiagDrName   = dtbResult.Rows[0]["DOCTORNAME_CHR"].ToString().Trim();
                    obj_VO.m_strHospitalName = "";
                    obj_VO.m_strPatientName  = dtbResult.Rows[0]["LASTNAME_VCHR"].ToString().Trim();
                    obj_VO.m_strPhotoNo      = dtbResult.Rows[0]["HOMEPHONE_VCHR"].ToString().Trim();
                    obj_VO.m_strCardID       = dtbResult.Rows[0]["PATIENTCARDID_CHR"].ToString().Trim();
                    obj_VO.m_strAddress      = "";
                    obj_VO.m_strRecipeType   = "";
                    obj_VO.m_strdiagnose     = dtbResult.Rows[0]["diag_vchr"].ToString().Trim();
                    obj_VO.m_strGOVCARD      = "";
                    obj_VO.m_strINSURANCEID  = "";
                    obj_VO.m_strRecordEmpID  = "";//员工ID
                    obj_VO.m_strRegisterID   = "";
                    if (dtbResult.Rows[0]["RECORDDATE_DAT"] != System.DBNull.Value)
                    {
                        obj_VO.m_strPrintDate = DateTime.Parse(dtbResult.Rows[0]["RECORDDATE_DAT"].ToString()).ToString("yyyy-MM-dd");
                    }
                    else
                    {
                        obj_VO.m_strPrintDate = DateTime.Now.ToString("yyyy-MM-dd");
                    }
                    obj_VO.m_strSex                 = dtbResult.Rows[0]["SEX_CHR"].ToString().Trim();
                    obj_VO.m_strSelfPay             = "";
                    obj_VO.m_strChargeUp            = "";
                    obj_VO.m_strRecipePrice         = "";
                    obj_VO.m_strSelfPay             = "";
                    obj_VO.m_strHerbalmedicineUsage = "";
                    obj_VO.m_strTimes               = "";
                    obj_VO.m_strSerNO               = dtbResult.Rows[0]["SERNO_CHR"].ToString().Trim();
                    obj_VO.objinjectArr2            = new ArrayList();
                    int temRow = 0;
                    for (int i = 0; i < dtbResult.Rows.Count; i++)
                    {
                        clsOutpatientPrintRecipeDetail_VO objtemp = new clsOutpatientPrintRecipeDetail_VO();
                        objtemp.m_strChargeName  = dtbResult.Rows[i]["ITEMNAME_VCHR"].ToString().Trim();
                        objtemp.m_strCount       = dtbResult.Rows[i]["TOLQTY_DEC"].ToString().Trim() + dtbResult.Rows[i]["UNITID_CHR"].ToString().Trim();
                        objtemp.m_strPrice       = dtbResult.Rows[i]["UNITPRICE_MNY"].ToString().Trim();
                        objtemp.m_strSumPrice    = dtbResult.Rows[i]["TOLPRICE_MNY"].ToString().Trim();
                        objtemp.m_strUnit        = dtbResult.Rows[i]["UNITID_CHR"].ToString().Trim();
                        objtemp.m_strFrequency   = dtbResult.Rows[i]["FREQNAME_CHR"].ToString().Trim();
                        objtemp.m_strDosage      = dtbResult.Rows[i]["QTY_DEC"].ToString().Trim() + dtbResult.Rows[i]["dosageunit_chr"].ToString().Trim();
                        objtemp.m_strDays        = dtbResult.Rows[i]["DAYS_INT"].ToString().Trim();
                        objtemp.m_strSpec        = dtbResult.Rows[i]["ITEMSPEC_VCHR"].ToString().Trim();
                        objtemp.m_strUsage       = dtbResult.Rows[i]["USAGENAME_VCHR"].ToString().Trim();
                        objtemp.m_strRowNo       = dtbResult.Rows[i]["ROWNO_CHR"].ToString().Trim();
                        objtemp.m_strUsageDetail = dtbResult.Rows[i]["DESC_VCHR"].ToString().Trim();
                        if (objtemp.m_strRowNo == "" || objtemp.m_strRowNo == "0")
                        {
                            objtemp.m_strRowNo = "0" + temRow.ToString();
                            temRow++;
                        }
                        obj_VO.objinjectArr2.Add(objtemp);
                    }
                }
                else
                {
                    obj_VO.m_strAge          = "";
                    obj_VO.m_strDiagDrName   = "";
                    obj_VO.m_strHospitalName = "";
                    obj_VO.m_strPatientName  = "";
                    // obj_VO.m_strRecipeID = strRecipedeID;
                    obj_VO.m_strAddress             = "";
                    obj_VO.m_strRecipeType          = "";
                    obj_VO.m_strdiagnose            = "";
                    obj_VO.m_strGOVCARD             = "";
                    obj_VO.m_strINSURANCEID         = "";
                    obj_VO.m_strRecordEmpID         = "";//员工ID
                    obj_VO.m_strRegisterID          = "";
                    obj_VO.m_strPrintDate           = "";
                    obj_VO.m_strSex                 = "";
                    obj_VO.m_strSelfPay             = "";
                    obj_VO.m_strChargeUp            = "";
                    obj_VO.m_strRecipePrice         = "";
                    obj_VO.m_strSelfPay             = "";
                    obj_VO.m_strHerbalmedicineUsage = "";
                    obj_VO.m_strTimes               = "";
                    obj_VO.objinjectArr2            = new ArrayList();
                }
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            DataTable ArrdtRow = new DataTable();

            ArrdtRow.Columns.Add("rowno_chr");
            ArrdtRow.Columns.Add("USAGEID_CHR");
            DataRow[] objRowsList = dtbResult.Select("rowno_chr>0 and USAGEID_CHR is not null", "rowno_chr");
            if (objRowsList.Length > 0)
            {
                for (int j = 0; j < objRowsList.Length; j++)
                {
                    if (j == 0)
                    {
                        DataRow newRow = ArrdtRow.NewRow();
                        newRow["rowno_chr"]   = objRowsList[j]["rowno_chr"].ToString();
                        newRow["USAGEID_CHR"] = objRowsList[j]["USAGEID_CHR"].ToString();
                        ArrdtRow.Rows.Add(newRow);
                    }
                    else
                    {
                        for (int r = 0; r < ArrdtRow.Rows.Count; r++)
                        {
                            if (objRowsList[j]["rowno_chr"].ToString() == ArrdtRow.Rows[r]["rowno_chr"].ToString())
                            {
                                break;
                            }
                            if (r == ArrdtRow.Rows.Count - 1)
                            {
                                DataRow newRow = ArrdtRow.NewRow();
                                newRow["rowno_chr"]   = objRowsList[j]["rowno_chr"].ToString();
                                newRow["USAGEID_CHR"] = objRowsList[j]["USAGEID_CHR"].ToString();
                                ArrdtRow.Rows.Add(newRow);
                            }
                        }
                    }
                }
            }
            DataTable dtItemArr = new DataTable();

            dtItemArr.Columns.Add("itemname_vchr");
            dtItemArr.Columns.Add("rowno_chr");
            dtItemArr.Columns.Add("itemid_chr");
            dtItemArr.Columns.Add("USAGEID_CHR");
            if (dtbResult.Rows.Count > 0)
            {
                for (int m = 0; m < dtbResult.Rows.Count; m++)
                {
                    if (m == 0)
                    {
                        DataRow newRow = dtItemArr.NewRow();
                        newRow["itemname_vchr"] = dtbResult.Rows[m]["itemname_vchr"].ToString();
                        newRow["rowno_chr"]     = dtbResult.Rows[m]["rowno_chr"];
                        newRow["itemid_chr"]    = dtbResult.Rows[m]["itemid_chr"].ToString();
                        newRow["USAGEID_CHR"]   = dtbResult.Rows[m]["USAGEID_CHR"].ToString();
                        dtItemArr.Rows.Add(newRow);
                    }
                    else
                    {
                        for (int n = 0; n < dtItemArr.Rows.Count; n++)
                        {
                            if (dtItemArr.Rows[n]["itemid_chr"].ToString().Trim() == dtbResult.Rows[m]["itemid_chr"].ToString().Trim() && dtItemArr.Rows[n]["rowno_chr"].ToString().Trim() == dtbResult.Rows[m]["rowno_chr"].ToString().Trim())
                            {
                                break;
                            }
                            if (n == dtItemArr.Rows.Count - 1)
                            {
                                DataRow newRow = dtItemArr.NewRow();
                                newRow["itemname_vchr"] = dtbResult.Rows[m]["itemname_vchr"].ToString();
                                newRow["rowno_chr"]     = dtbResult.Rows[m]["rowno_chr"];
                                newRow["itemid_chr"]    = dtbResult.Rows[m]["itemid_chr"].ToString();
                                newRow["USAGEID_CHR"]   = dtbResult.Rows[m]["USAGEID_CHR"].ToString();
                                dtItemArr.Rows.Add(newRow);
                            }
                        }
                    }
                }
            }
            strSQL = @"SELECT   a.itemid_chr, a.operatorid_chr, a.exectime_dat, a.operatortype_int,
         b.lastname_vchr
    FROM t_opr_recipesend m1,
         t_opr_recipesendentry n1,
         t_opr_nurseexecute a,
         t_bse_employee b,
         (SELECT MAX (itemid_chr) itemid_chr
            FROM t_opr_nurseexecute p,t_opr_recipesend m,t_opr_recipesendentry n 
           WHERE m.sid_int=n.sid_int and p.outpatrecipeid_chr=n.outpatrecipeid_chr and m.sid_int=?
             AND (operatortype_int = 1 OR operatortype_int = 2)
             AND status_int = 1) c
   WHERE m1.sid_int=n1.sid_int
     and n1.outpatrecipeid_chr=a.outpatrecipeid_chr
     and m1.sid_int=?
     AND (a.operatortype_int = 1 OR a.operatortype_int = 2)
     AND a.status_int = 1
     AND a.operatorid_chr = b.empid_chr
     AND a.itemid_chr = c.itemid_chr
ORDER BY a.seq_int DESC";
            try
            {
                System.Data.IDataParameter[] objLisAddItemRefArr = null;
                objHRPSvc.CreateDatabaseParameter(2, out objLisAddItemRefArr);
                objLisAddItemRefArr[0].Value = m_strSid_int;
                objLisAddItemRefArr[1].Value = m_strSid_int;
                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtbResult, objLisAddItemRefArr);
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            ArrayList list1  = new ArrayList();
            ArrayList objArr = new ArrayList();

            if (lngRes == 1)
            {
                ArrayList arr1 = new ArrayList();
                arr1.Add("配药人");
                ArrayList arr2 = new ArrayList();
                arr2.Add("时间");
                ArrayList arr3 = new ArrayList();
                arr3.Add("复核人");
                ArrayList arr4 = new ArrayList();
                arr4.Add("时间");
                if (dtbResult.Rows.Count > 0)
                {
                    int tolMunber1 = 0;
                    int tolMunber2 = 0;
                    for (int i1 = 0; i1 < dtbResult.Rows.Count; i1++)
                    {
                        if (dtbResult.Rows[i1]["OPERATORTYPE_INT"].ToString() == "1" && tolMunber1 < 7)
                        {
                            arr1.Add(dtbResult.Rows[i1]["LASTNAME_VCHR"].ToString());
                            arr2.Add(DateTime.Parse(dtbResult.Rows[i1]["EXECTIME_DAT"].ToString()).ToString("MM-dd HH:mm"));
                            tolMunber1++;
                        }
                        else if (tolMunber2 < 7)
                        {
                            arr3.Add(dtbResult.Rows[i1]["LASTNAME_VCHR"].ToString());
                            arr4.Add(DateTime.Parse(dtbResult.Rows[i1]["EXECTIME_DAT"].ToString()).ToString("MM-dd HH:mm"));
                            tolMunber2++;
                        }
                    }
                }
                list1.Add(arr1);
                list1.Add(arr2);
                list1.Add(arr3);
                list1.Add(arr4);
            }
            strSQL = @"SELECT   a.itemid_chr, d.itemname_vchr, a.rowno_chr, a.operatorid_chr,
         a.exectime_dat, a.operatortype_int, b.lastname_vchr, a.remark1_vchr
    FROM t_opr_recipesend m1,
         t_opr_recipesendentry n1,
         t_opr_nurseexecute a,
         t_bse_employee b,
         t_bse_chargeitem d,
         (SELECT   MAX (a.itemid_chr) itemid_chr
              FROM t_opr_nurseexecute a,
                   t_opr_recipesend m,
                   t_opr_recipesendentry n
             WHERE m.sid_int = n.sid_int
               AND a.outpatrecipeid_chr = n.outpatrecipeid_chr
               AND m.sid_int = ?
               AND (   a.operatortype_int = 10
                    OR a.operatortype_int = 3
                    OR a.operatortype_int = 4
                   )
               AND a.status_int = 1
          GROUP BY rowno_chr) c
   WHERE m1.sid_int = n1.sid_int
     AND n1.outpatrecipeid_chr = a.outpatrecipeid_chr
     AND m1.sid_int = ?
     AND (   a.operatortype_int = 10
          OR a.operatortype_int = 3
          OR a.operatortype_int = 4
         )
     AND a.status_int = 1
     AND a.rowno_chr > 0
     AND a.operatorid_chr = b.empid_chr
     AND a.itemid_chr = c.itemid_chr
     AND a.itemid_chr = d.itemid_chr(+)
ORDER BY a.seq_int DESC ";
            try
            {
                System.Data.IDataParameter[] objLisAddItemRefArr = null;
                objHRPSvc.CreateDatabaseParameter(2, out objLisAddItemRefArr);
                objLisAddItemRefArr[0].Value = m_strSid_int;
                objLisAddItemRefArr[1].Value = m_strSid_int;
                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtbResult, objLisAddItemRefArr);
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            strSQL = @"SELECT   a.itemid_chr, d.itemname_vchr, a.rowno_chr, a.operatorid_chr,
         a.exectime_dat, a.operatortype_int, b.lastname_vchr, a.remark1_vchr
    FROM t_opr_recipesend m1,
         t_opr_recipesendentry n1,
         t_opr_nurseexecute a,
         t_bse_employee b,
         t_bse_chargeitem d
   WHERE m1.sid_int = n1.sid_int
     AND n1.outpatrecipeid_chr = a.outpatrecipeid_chr
     AND m1.sid_int = ?
     AND (   a.operatortype_int = 10
          OR a.operatortype_int = 3
          OR a.operatortype_int = 4
         )
     AND a.status_int = 1
     AND a.rowno_chr <= 0
     AND a.operatorid_chr = b.empid_chr
     AND a.itemid_chr = d.itemid_chr(+)
ORDER BY a.seq_int DESC ";
            DataTable dtbResult2 = new DataTable();

            try
            {
                System.Data.IDataParameter[] objLisAddItemRefArr = null;
                objHRPSvc.CreateDatabaseParameter(1, out objLisAddItemRefArr);
                objLisAddItemRefArr[0].Value = m_strSid_int;
                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtbResult2, objLisAddItemRefArr);
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            DataTable dtUsage = new DataTable();//保存需要打印输液巡视单的用法数据

            strSQL = @"select USAGEID_CHR from t_opr_setusage where ORDERID_VCHR='1'";
            try
            {
                lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL, ref dtUsage);
            }
            catch (Exception objEx)
            {
                string strTmp = objEx.Message;
                com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText();
                bool blnRes = objLogger.LogError(objEx);
            }
            ArrayList arrGroud = new ArrayList();

            if (ArrdtRow.Rows.Count > 0)
            {
                for (int f2 = 0; f2 < ArrdtRow.Rows.Count; f2++)
                {
                    DataRow[] objRows  = dtItemArr.Select("ROWNO_CHR =" + ArrdtRow.Rows[f2]["ROWNO_CHR"].ToString().Trim());
                    int       kk       = f2 + 1;
                    string    strGroud = "第" + kk.ToString() + "组:";
                    int       currInt  = 0;//标志当前组中是否存在需要打印的明细-1.有

                    int currint1 = 0;
                    for (int k1 = 0; k1 < objRows.Length; k1++)
                    {
                        DataRow[] tempArr = dtUsage.Select("USAGEID_CHR=" + objRows[k1]["usageid_chr"].ToString());
                        if (tempArr.Length == 0)
                        {
                            continue;
                        }
                        if (currint1 == 0)
                        {
                            currInt   = -1;
                            strGroud += objRows[k1]["ITEMNAME_VCHR"].ToString();
                            currint1++;
                        }
                        else
                        {
                            strGroud = strGroud + "、" + objRows[k1]["ITEMNAME_VCHR"].ToString();
                        }
                    }
                    if (currInt == -1)
                    {
                        ArrayList arr1 = new ArrayList();
                        arr1.Add("配药护士");
                        ArrayList arr2 = new ArrayList();
                        arr2.Add("时间");
                        ArrayList arr3 = new ArrayList();
                        arr3.Add("执行人");
                        ArrayList arr4 = new ArrayList();
                        arr4.Add("输液时间");
                        ArrayList arr5 = new ArrayList();
                        arr5.Add("滴速(分)");
                        ArrayList arr6 = new ArrayList();
                        arr6.Add("巡视时间");
                        ArrayList arr7 = new ArrayList();
                        arr7.Add("滴速(分)");
                        ArrayList arr8 = new ArrayList();
                        arr8.Add("签名");
                        int       tolMunber1 = 0;
                        int       tolMunber2 = 0;
                        int       tolMunber3 = 0;
                        ArrayList objList    = new ArrayList();
                        if (dtbResult.Rows.Count > 0)
                        {
                            for (int i1 = 0; i1 < dtbResult.Rows.Count; i1++)
                            {
                                if (ArrdtRow.Rows[f2]["ROWNO_CHR"].ToString() == dtbResult.Rows[i1]["ROWNO_CHR"].ToString())
                                {
                                    if (dtbResult.Rows[i1]["OPERATORTYPE_INT"].ToString() == "3" && tolMunber1 < 7)
                                    {
                                        arr3.Add(dtbResult.Rows[i1]["LASTNAME_VCHR"].ToString());
                                        arr4.Add(DateTime.Parse(dtbResult.Rows[i1]["EXECTIME_DAT"].ToString()).ToString("MM-dd HH:mm"));
                                        arr5.Add(dtbResult.Rows[i1]["REMARK1_VCHR"].ToString());
                                        tolMunber1++;
                                    }
                                    if (dtbResult.Rows[i1]["OPERATORTYPE_INT"].ToString() == "10" && tolMunber2 < 7)
                                    {
                                        arr1.Add(dtbResult.Rows[i1]["LASTNAME_VCHR"].ToString());
                                        arr2.Add(DateTime.Parse(dtbResult.Rows[i1]["EXECTIME_DAT"].ToString()).ToString("MM-dd HH:mm"));
                                        tolMunber2++;
                                    }
                                    if (dtbResult.Rows[i1]["OPERATORTYPE_INT"].ToString() == "4" && tolMunber3 < 7)
                                    {
                                        arr8.Add(dtbResult.Rows[i1]["LASTNAME_VCHR"].ToString());
                                        arr6.Add(DateTime.Parse(dtbResult.Rows[i1]["EXECTIME_DAT"].ToString()).ToString("MM-dd HH:mm"));
                                        arr7.Add(dtbResult.Rows[i1]["REMARK1_VCHR"].ToString());
                                        tolMunber3++;
                                    }
                                }
                            }
                        }
                        objList.Add(arr1);
                        objList.Add(arr2);
                        objList.Add(arr3);
                        objList.Add(arr4);
                        objList.Add(arr5);
                        objList.Add(arr6);
                        objList.Add(arr7);
                        objList.Add(arr8);
                        objArr.Add(objList);
                        arrGroud.Add(strGroud);
                    }
                }
            }

            if (dtItemArr.Rows.Count > 0)
            {
                for (int h = 0; h < dtItemArr.Rows.Count; h++)
                {
                    try
                    {
                        if (int.Parse(dtItemArr.Rows[h]["ROWNO_CHR"].ToString()) > 0)
                        {
                            dtItemArr.Rows[h].Delete();
                            h--;
                        }
                    }
                    catch
                    {
                    }
                }
                dtItemArr.AcceptChanges();
            }
            if (dtItemArr.Rows.Count > 0)
            {
                for (int f2 = 0; f2 < dtItemArr.Rows.Count; f2++)
                {
                    DataRow[] tempArr = dtUsage.Select("USAGEID_CHR=" + dtItemArr.Rows[f2]["usageid_chr"].ToString());
                    if (tempArr.Length == 0)
                    {
                        continue;
                    }
                    arrGroud.Add(dtItemArr.Rows[f2]["ITEMNAME_VCHR"].ToString());
                    ArrayList tempList = new ArrayList();
                    ArrayList arr1     = new ArrayList();
                    arr1.Add("配药护士");
                    ArrayList arr2 = new ArrayList();
                    arr2.Add("时间");
                    ArrayList arr3 = new ArrayList();
                    arr3.Add("执行人");
                    ArrayList arr4 = new ArrayList();
                    arr4.Add("输液时间");
                    ArrayList arr5 = new ArrayList();
                    arr5.Add("滴速(分)");
                    ArrayList arr6 = new ArrayList();
                    arr6.Add("巡视时间");
                    ArrayList arr7 = new ArrayList();
                    arr7.Add("滴速(分)");
                    ArrayList arr8 = new ArrayList();
                    arr8.Add("签名");
                    int       tolMunber1 = 0;
                    int       tolMunber2 = 0;
                    int       tolMunber3 = 0;
                    ArrayList objList    = new ArrayList();
                    for (int i1 = 0; i1 < dtbResult2.Rows.Count; i1++)
                    {
                        if (dtItemArr.Rows[f2]["ITEMNAME_VCHR"].ToString().Trim() == dtbResult2.Rows[i1]["ITEMNAME_VCHR"].ToString().Trim())
                        {
                            if (dtbResult2.Rows[i1]["OPERATORTYPE_INT"].ToString() == "3" && tolMunber1 < 7)
                            {
                                arr3.Add(dtbResult2.Rows[i1]["LASTNAME_VCHR"].ToString());
                                arr4.Add(DateTime.Parse(dtbResult2.Rows[i1]["EXECTIME_DAT"].ToString()).ToString("MM-dd HH:mm"));
                                arr5.Add(dtbResult.Rows[i1]["REMARK1_VCHR"].ToString());
                                tolMunber1++;
                            }
                            if (dtbResult2.Rows[i1]["OPERATORTYPE_INT"].ToString() == "10" && tolMunber2 < 7)
                            {
                                arr1.Add(dtbResult2.Rows[i1]["LASTNAME_VCHR"].ToString());
                                arr2.Add(DateTime.Parse(dtbResult2.Rows[i1]["EXECTIME_DAT"].ToString()).ToString("MM-dd HH:mm"));
                                tolMunber2++;
                            }
                            if (dtbResult2.Rows[i1]["OPERATORTYPE_INT"].ToString() == "4" && tolMunber3 < 7)
                            {
                                arr8.Add(dtbResult2.Rows[i1]["LASTNAME_VCHR"].ToString());
                                arr6.Add(DateTime.Parse(dtbResult2.Rows[i1]["EXECTIME_DAT"].ToString()).ToString("MM-dd HH:mm"));
                                arr7.Add(dtbResult2.Rows[i1]["REMARK1_VCHR"].ToString());
                                tolMunber3++;
                            }
                        }
                    }
                    objList.Add(arr1);
                    objList.Add(arr2);
                    objList.Add(arr3);
                    objList.Add(arr4);

                    objList.Add(arr5);
                    objList.Add(arr6);
                    objList.Add(arr7);
                    objList.Add(arr8);
                    objArr.Add(objList);
                }
            }
            m_objList1         = list1;
            m_objList2         = objArr;
            m_objListGroupName = arrGroud;
            return(lngRes);
        }
예제 #6
0
        private void m_mthPrintText()
        {
            SizeF objFontSize = objDraw.Graphics.MeasureString(this.strDiagMain, this.objFontNormal);
//			float fltRFTemp =this.objDraw.PageBounds.Width*(1-fltLeftIndentProp)-objFontSize.Width-2;

            float X    = this.objDraw.PageBounds.Width * fltLeftIndentProp;
            float RX   = this.objDraw.PageBounds.Width * (1 - fltRightIndentProp);
            int   ipos = 0;

            while (location < 14)
            {
                switch (location)
                {
                case 0:
                    if (subRow == 0)
                    {
                        objDraw.Graphics.DrawString(this.strDiagMain, objFontNormal, Brushes.Black, X, Y);
                    }
                    X += objFontSize.Width + 2;
                    if (m_mthDrawString(obj_VO.strDiagMain, X))
                    {
                        return;
                    }
//						RectangleF RF=new RectangleF(X,Y,fltRFTemp,this.fltRowHeight);
//						objDraw.Graphics.DrawString(obj_VO.strDiagMain,objFontNormal,Brushes.Black,RF);
//						Y+=this.fltRowHeight;
//						location++;
                    break;

                case 1:                        //现 病 史
                    X           = this.objDraw.PageBounds.Width * fltLeftIndentProp;
                    objFontSize = objDraw.Graphics.MeasureString(this.strDiagCurr, this.objFontNormal);
                    if (subRow == 0)
                    {
                        objDraw.Graphics.DrawString(this.strDiagCurr, objFontNormal, Brushes.Black, X, Y);
                    }
                    X += objFontSize.Width + 2;
//						RF=new RectangleF(X,Y,fltRFTemp,this.fltRowHeight*2);
//						objDraw.Graphics.DrawString(obj_VO.strDiagCurr,objFontNormal,Brushes.Black,RF);
//						Y+=this.fltRowHeight*2;
                    if (m_mthDrawString(obj_VO.strDiagCurr, X))
                    {
                        return;
                    }
                    if (this.obj_VO.strParentID.Trim() != "")
                    {
                        location = 5;
                    }

                    break;

                case 2:
                    //既 病 史
                    objFontSize = objDraw.Graphics.MeasureString("既 病 史:", this.objFontNormal);
                    X           = this.objDraw.PageBounds.Width * fltLeftIndentProp;
                    if (subRow == 0)
                    {
                        objDraw.Graphics.DrawString("既 病 史:", objFontNormal, Brushes.Black, X, Y);
                    }
                    X += objFontSize.Width + 2;
//						RF=new RectangleF(X,Y,fltRFTemp,this.fltRowHeight);
//						objDraw.Graphics.DrawString(obj_VO.strDiagHis,objFontNormal,Brushes.Black,RF);
//						Y+=this.fltRowHeight;
//						location++;
                    if (m_mthDrawString(obj_VO.strDiagHis, X))
                    {
                        return;
                    }
                    break;

                case 3:
                    //过敏史
                    objFontSize = objDraw.Graphics.MeasureString("过 敏 史:", this.objFontNormal);
                    X           = this.objDraw.PageBounds.Width * fltLeftIndentProp;
                    if (subRow == 0)
                    {
                        objDraw.Graphics.DrawString("过 敏 史:", objFontNormal, Brushes.Black, X, Y);
                    }
                    X += objFontSize.Width + 2;
//						RF=new RectangleF(X,Y,fltRFTemp,this.fltRowHeight);
//						objDraw.Graphics.DrawString(obj_VO.strAnaPhyLaXis,objFontNormal,Brushes.Black,RF);
//						Y+=this.fltRowHeight;
//						location++;
                    if (m_mthDrawString(obj_VO.strAnaPhyLaXis, X))
                    {
                        return;
                    }
                    break;

                case 4:
                    //个人史
                    objFontSize = objDraw.Graphics.MeasureString("个 人 史:", this.objFontNormal);
                    X           = this.objDraw.PageBounds.Width * fltLeftIndentProp;
                    if (subRow == 0)
                    {
                        objDraw.Graphics.DrawString("个 人 史:", objFontNormal, Brushes.Black, X, Y);
                    }
                    X += objFontSize.Width + 2;
//						objDraw.Graphics.DrawString(obj_VO.m_strPRIHIS_VCHR,objFontNormal,Brushes.Black,X,Y);
//						Y+=this.fltRowHeight;
//						location++;
                    if (m_mthDrawString(obj_VO.m_strPRIHIS_VCHR, X))
                    {
                        return;
                    }
                    break;

                case 5:
                    //体格检查
                    X = this.objDraw.PageBounds.Width * fltLeftIndentProp;
                    //			RX=this.objDraw.PageBounds.Width*(1-fltRightIndentProp)-X;
                    objFontSize = objDraw.Graphics.MeasureString("体格检查:", this.objFontNormal);
                    if (subRow == 0)
                    {
                        objDraw.Graphics.DrawString("体格检查:", objFontNormal, Brushes.Black, X, Y);
                    }
                    X += objFontSize.Width + 2;
//						RF=new RectangleF(X,Y,fltRFTemp,this.fltRowHeight*2);
//						objDraw.Graphics.DrawString(obj_VO.strExamineResult,objFontNormal,Brushes.Black,RF);
//						Y+=this.fltRowHeight*2;
//						location++;
                    if (m_mthDrawString(obj_VO.strExamineResult, X))
                    {
                        return;
                    }
                    break;

                case 6:
                    //转科情况
                    objFontSize = objDraw.Graphics.MeasureString("转科情况:", this.objFontNormal);
                    X           = this.objDraw.PageBounds.Width * fltLeftIndentProp;
                    if (subRow == 0)
                    {
                        objDraw.Graphics.DrawString("专科情况:", objFontNormal, Brushes.Black, X, Y);
                    }
                    X += objFontSize.Width + 2;
//						RF=new RectangleF(X,Y,fltRFTemp,this.fltRowHeight);
//						objDraw.Graphics.DrawString(obj_VO.strChangeDeparement,objFontNormal,Brushes.Black,RF);
//						Y+=this.fltRowHeight;
//						location++;
                    if (m_mthDrawString(obj_VO.strChangeDeparement, X))
                    {
                        return;
                    }
                    break;

                case 7:
                    //辅助检查
                    objFontSize = objDraw.Graphics.MeasureString("辅助检查:", this.objFontNormal);
                    X           = this.objDraw.PageBounds.Width * fltLeftIndentProp;
                    if (subRow == 0)
                    {
                        objDraw.Graphics.DrawString("辅助检查:", objFontNormal, Brushes.Black, X, Y);
                    }
                    X += objFontSize.Width + 2;
//						RF=new RectangleF(X,Y,fltRFTemp,this.fltRowHeight);
//						objDraw.Graphics.DrawString(obj_VO.strAidCheck,objFontNormal,Brushes.Black,RF);
//						Y+=this.fltRowHeight;
//						location++;
                    if (m_mthDrawString(obj_VO.strAidCheck, X))
                    {
                        return;
                    }
                    break;

                case 8:
                    //处方2
                    #region 排序
                    ipos = subRow;
                    for (int i = subRow; i < obj_VO.objItemArr2.Count; i++)
                    {
                        clsOutpatientPrintRecipeDetail_VO objTemp = obj_VO.objItemArr2[i] as clsOutpatientPrintRecipeDetail_VO;
                        if (objTemp == null)
                        {
                            if (i > ipos)
                            {
                                if (i - ipos <= obj_VO.objItemArr.Count)
                                {
                                    obj_VO.objItemArr.Sort(ipos, i - ipos, null);
                                }

                                ipos = i + 1;
                            }
                            continue;
                        }
                        switch (this.m_mthRelationInfo(objTemp.m_strInvoiceCat))
                        {
                        case "0001":
                            objTemp.m_strRowNo = "1" + objTemp.m_strRowNo;
                            break;

                        case "0002":
                            objTemp.m_strRowNo = "2" + objTemp.m_strRowNo;
                            break;

                        case "0003":
                            objTemp.m_strRowNo = "3" + objTemp.m_strRowNo;
                            break;

                        case "0004":
                            objTemp.m_strRowNo = "4" + objTemp.m_strRowNo;
                            break;

                        case "0005":
                            objTemp.m_strRowNo = "6" + objTemp.m_strRowNo;
                            break;

                        case "0006":
                            objTemp.m_strRowNo = "5" + objTemp.m_strRowNo;
                            break;

                        default:
                            objTemp.m_strRowNo = "6" + objTemp.m_strRowNo;
                            break;
                        }
                    }
                    obj_VO.objItemArr2.Sort(ipos, obj_VO.objItemArr2.Count - ipos, null);

                    #endregion

                    for (int i = subRow; i < obj_VO.objItemArr2.Count; i++)
                    {
                        clsOutpatientPrintRecipeDetail_VO objtemp = obj_VO.objItemArr2[i] as clsOutpatientPrintRecipeDetail_VO;

                        X = this.objDraw.PageBounds.Width * fltLeftIndentProp + objFontSize.Width + 2;
                        if (objtemp == null)
                        {
                            using (Pen pen = new Pen(Color.Black, 1))
                            {
                                pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
                                objDraw.Graphics.DrawLine(pen, X, Y, RX, Y);
                            }
                        }
                        else
                        {
                            //名称
                            objDraw.Graphics.DrawString(objtemp.m_strChargeName, objFontNormal, Brushes.Black, X, Y);
                            //规格
                            X = this.objDraw.PageBounds.Width * 0.33f + objFontSize.Width + 2;
                            objDraw.Graphics.DrawString(objtemp.m_strSpec, objFontNormal, Brushes.Black, X, Y);
                            //总量
                            X = this.objDraw.PageBounds.Width * 0.52f + objFontSize.Width + 2;
                            objDraw.Graphics.DrawString(objtemp.m_strCount, objFontNormal, Brushes.Black, X, Y);
                            //频率
                            X = this.objDraw.PageBounds.Width * 0.58f + objFontSize.Width + 2;
                            objDraw.Graphics.DrawString(m_mthStringOperator(objtemp), objFontNormal, Brushes.Black, X, Y);
                            //								//频率
//								X=this.objDraw.PageBounds.Width*0.7f+objFontSize.Width+2;
//								objDraw.Graphics.DrawString(objtemp.m_strUsage,objFontNormal,Brushes.Black,X,Y);
//								//天数
//								X=this.objDraw.PageBounds.Width*0.65f+objFontSize.Width+2;
//								objDraw.Graphics.DrawString(objtemp.m_strDays,objFontNormal,Brushes.Black,X,Y);
//								//频率
//								X=this.objDraw.PageBounds.Width*0.75f+objFontSize.Width+2;
//								objDraw.Graphics.DrawString(objtemp.m_strFrequency,objFontNormal,Brushes.Black,X,Y);
                        }
                        Y += this.fltRowHeight + 3;
                        if (this.Y + this.fltRowHeight + 20 > this.objDraw.PageBounds.Height)
                        {
                            objDraw.HasMorePages = true;
                            return;
                        }
                        subRow++;
                    }
                    subRow = 0;
                    location++;
                    break;

                case 9:
                    //诊    断
                    X = this.objDraw.PageBounds.Width * fltLeftIndentProp;
                    //			RX=this.objDraw.PageBounds.Width*(1-fltRightIndentProp)-X;
                    objFontSize = objDraw.Graphics.MeasureString("诊    断:", this.objFontNormal);
                    if (subRow == 0)
                    {
                        objDraw.Graphics.DrawString("诊    断:", objFontNormal, Brushes.Black, X, Y);
                    }
                    X += objFontSize.Width + 2;
//						RF=new RectangleF(X,Y,fltRFTemp,this.fltRowHeight*2);
//						objDraw.Graphics.DrawString(obj_VO.strDiag,objFontNormal,Brushes.Black,RF);
//						Y+=this.fltRowHeight*2;
//						location++;
                    if (m_mthDrawString(obj_VO.strDiag, X))
                    {
                        return;
                    }
                    break;

                case 10:
                    //处    置
                    objFontSize = objDraw.Graphics.MeasureString("处    置:", this.objFontNormal);
                    X           = this.objDraw.PageBounds.Width * fltLeftIndentProp;
                    if (subRow == 0)
                    {
                        objDraw.Graphics.DrawString("处    置:", objFontNormal, Brushes.Black, X, Y);
                    }
                    X += objFontSize.Width + 2;
//						RF=new RectangleF(X,Y,fltRFTemp,this.fltRowHeight);
//						objDraw.Graphics.DrawString(obj_VO.strTreatMent,objFontNormal,Brushes.Black,RF);
//						Y+=this.fltRowHeight;
//						location++;
                    if (m_mthDrawString(obj_VO.strTreatMent, X))
                    {
                        return;
                    }
                    break;

                case 11:
                    #region 排序
                    ipos = subRow;
                    for (int i = subRow; i < obj_VO.objItemArr.Count; i++)
                    {
                        clsOutpatientPrintRecipeDetail_VO objTemp = obj_VO.objItemArr[i] as clsOutpatientPrintRecipeDetail_VO;
                        if (objTemp == null)
                        {
                            if (i > ipos)
                            {
                                obj_VO.objItemArr.Sort(ipos, i - ipos, null);
                                ipos = i + 1;
                            }
                            continue;
                        }
                        switch (this.m_mthRelationInfo(objTemp.m_strInvoiceCat))
                        {
                        case "0001":
                            objTemp.m_strRowNo = "1" + objTemp.m_strRowNo;
                            break;

                        case "0002":
                            objTemp.m_strRowNo = "2" + objTemp.m_strRowNo;
                            break;

                        case "0003":
                            objTemp.m_strRowNo = "3" + objTemp.m_strRowNo;
                            break;

                        case "0004":
                            objTemp.m_strRowNo = "4" + objTemp.m_strRowNo;
                            break;

                        case "0005":
                            objTemp.m_strRowNo = "6" + objTemp.m_strRowNo;
                            break;

                        case "0006":
                            objTemp.m_strRowNo = "5" + objTemp.m_strRowNo;
                            break;

                        default:
                            objTemp.m_strRowNo = "6" + objTemp.m_strRowNo;
                            break;
                        }
                    }
                    obj_VO.objItemArr.Sort(ipos, obj_VO.objItemArr.Count - ipos, null);

                    #endregion

                    for (int i = subRow; i < obj_VO.objItemArr.Count; i++)
                    {
                        clsOutpatientPrintRecipeDetail_VO objtemp = obj_VO.objItemArr[i] as clsOutpatientPrintRecipeDetail_VO;
                        X = this.objDraw.PageBounds.Width * fltLeftIndentProp + objFontSize.Width + 2;
                        if (objtemp == null)
                        {
                            using (Pen pen = new Pen(Color.Black, 1))
                            {
                                pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
                                objDraw.Graphics.DrawLine(pen, X, Y, RX, Y);
                            }
                        }
                        else
                        {
                            if (objtemp.m_strInvoiceCat.IndexOf("材料") >= 0)
                            {
                                continue;
                            }

                            //方号
                            if (objtemp.m_strRowNo.StartsWith("1") && int.Parse(objtemp.m_strRowNo.Substring(1, objtemp.m_strRowNo.Length - 1)) > 0)
                            {
                                objDraw.Graphics.DrawString(objtemp.m_strRowNo.Substring(1, objtemp.m_strRowNo.Length - 1), objFontNormal, Brushes.Black, X, Y);
                            }
                            //名称
                            X = this.objDraw.PageBounds.Width * 0.1f + objFontSize.Width + 2;
                            objDraw.Graphics.DrawString(objtemp.m_strChargeName, objFontNormal, Brushes.Black, X, Y);
                            //规格
                            X = this.objDraw.PageBounds.Width * 0.33f + objFontSize.Width + 2;
                            objDraw.Graphics.DrawString(objtemp.m_strSpec, objFontNormal, Brushes.Black, X, Y);
                            //总量
                            X = this.objDraw.PageBounds.Width * 0.52f + objFontSize.Width + 2;
                            objDraw.Graphics.DrawString(objtemp.m_strCount, objFontNormal, Brushes.Black, X, Y);
                            //频率
                            X = this.objDraw.PageBounds.Width * 0.58f + objFontSize.Width + 2;
//								objDraw.Graphics.DrawString(m_mthStringOperator(objtemp),objFontNormal,Brushes.Black,X,Y);
                            objDraw.Graphics.DrawString(objtemp.m_strDosage + "/次," + objtemp.m_strUsage + "," + objtemp.m_strFrequency + "*" + objtemp.m_strDays, objFontNormal, Brushes.Black, X, Y);

//								//天数
//								X=this.objDraw.PageBounds.Width*0.65f+objFontSize.Width+2;
//								objDraw.Graphics.DrawString(objtemp.m_strDays,objFontNormal,Brushes.Black,X,Y);
//								//频率
//								X=this.objDraw.PageBounds.Width*0.75f+objFontSize.Width+2;
//								objDraw.Graphics.DrawString(objtemp.m_strFrequency,objFontNormal,Brushes.Black,X,Y);
                        }
                        Y += this.fltRowHeight + 3;
                        subRow++;
                        if (this.Y + this.fltRowHeight + 20 > this.objDraw.PageBounds.Height)
                        {
                            objDraw.HasMorePages = true;
                            return;
                        }
                    }
                    subRow = 0;
                    location++;
                    break;

                case 12:
                    //备注
                    objFontSize = objDraw.Graphics.MeasureString("备    注:", this.objFontNormal);
                    X           = this.objDraw.PageBounds.Width * fltLeftIndentProp;
                    if (subRow == 0)
                    {
                        objDraw.Graphics.DrawString("备    注:", objFontNormal, Brushes.Black, X, Y);
                    }
                    X += objFontSize.Width + 2;
//						RF=new RectangleF(X,Y,fltRFTemp,this.fltRowHeight);
//						objDraw.Graphics.DrawString(obj_VO.strReMark,objFontNormal,Brushes.Black,RF);
//						Y+=this.fltRowHeight+10;
//						location++;
                    if (m_mthDrawString(obj_VO.strReMark, X))
                    {
                        return;
                    }
                    break;

                case 13:
                    //画线
                    X = this.objDraw.PageBounds.Width * fltLeftIndentProp;
                    Pen objPen = new Pen(Color.Black, 1);
                    //			objPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
                    objDraw.Graphics.DrawLine(objPen, X, Y, RX, Y);
                    Y += this.fltRowHeight / 2;
                    //打印时间
                    objDraw.Graphics.DrawString("打印时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm"), objFontNormal, Brushes.Black, X, Y);
                    //医生签名
                    X           = this.objDraw.PageBounds.Width * 0.65f;
                    objFontSize = objDraw.Graphics.MeasureString("医生签名:", objFontNormal);
                    objDraw.Graphics.DrawString("医生签名:", objFontNormal, Brushes.Black, X, Y);
                    X += objFontSize.Width + 5;
                    if (this.obj_VO.objDocImage != null)
                    {
                        RectangleF RF = new RectangleF(X, Y - 5, 100, 60);
                        objDraw.Graphics.DrawImage(this.obj_VO.objDocImage, RF);
                    }
                    else
                    {
                        objDraw.Graphics.DrawString(obj_VO.m_strDiagDrName, objFontNormal, Brushes.Black, X, Y);
                    }
                    Y += this.fltRowHeight * 1.5f;
                    X  = this.objDraw.PageBounds.Width * fltLeftIndentProp;
//						objDraw.Graphics.DrawLine(objPen,X,Y,RX,Y);
                    location++;
                    break;
                }
            }



//			//现 病 史
//			X=this.objDraw.PageBounds.Width*fltLeftIndentProp;
//			float RX=this.objDraw.PageBounds.Width*(1-fltRightIndentProp);
//			objFontSize =objDraw.Graphics.MeasureString(this.strDiagCurr,this.objFontNormal);
//
//			objDraw.Graphics.DrawString(this.strDiagCurr,objFontNormal,Brushes.Black,X,Y);
//			X+=objFontSize.Width+2;
//			RF=new RectangleF(X,Y,fltRFTemp,this.fltRowHeight*2);
//			objDraw.Graphics.DrawString(obj_VO.strDiagCurr,objFontNormal,Brushes.Black,RF);
//			Y+=this.fltRowHeight*2;
//			if(this.obj_VO.strParentID.Trim()=="")
//			{
//
//				//既 病 史
//				objFontSize =objDraw.Graphics.MeasureString("既 病 史:",this.objFontNormal);
//				X=this.objDraw.PageBounds.Width*fltLeftIndentProp;
//				objDraw.Graphics.DrawString("既 病 史:",objFontNormal,Brushes.Black,X,Y);
//				X+=objFontSize.Width+2;
//				RF=new RectangleF(X,Y,fltRFTemp,this.fltRowHeight);
//				objDraw.Graphics.DrawString(obj_VO.strDiagHis,objFontNormal,Brushes.Black,RF);
//				Y+=this.fltRowHeight;
//				//过敏史
//				objFontSize =objDraw.Graphics.MeasureString("过 敏 史:",this.objFontNormal);
//				X=this.objDraw.PageBounds.Width*fltLeftIndentProp;
//				objDraw.Graphics.DrawString("过 敏 史:",objFontNormal,Brushes.Black,X,Y);
//				X+=objFontSize.Width+2;
//				RF=new RectangleF(X,Y,fltRFTemp,this.fltRowHeight);
//				objDraw.Graphics.DrawString(obj_VO.strAnaPhyLaXis,objFontNormal,Brushes.Black,RF);
//				Y+=this.fltRowHeight;
//				//个人史
//				objFontSize =objDraw.Graphics.MeasureString("个 人 史:",this.objFontNormal);
//				X=this.objDraw.PageBounds.Width*fltLeftIndentProp;
//				objDraw.Graphics.DrawString("个 人 史:",objFontNormal,Brushes.Black,X,Y);
//				X+=objFontSize.Width+2;
//				objDraw.Graphics.DrawString(obj_VO.m_strPRIHIS_VCHR,objFontNormal,Brushes.Black,X,Y);
//				Y+=this.fltRowHeight;
//			}
//			//体格检查
//			X=this.objDraw.PageBounds.Width*fltLeftIndentProp;
////			RX=this.objDraw.PageBounds.Width*(1-fltRightIndentProp)-X;
//			objFontSize =objDraw.Graphics.MeasureString("体格检查:",this.objFontNormal);
//			objDraw.Graphics.DrawString("体格检查:",objFontNormal,Brushes.Black,X,Y);
//			X+=objFontSize.Width+2;
//			RF=new RectangleF(X,Y,fltRFTemp,this.fltRowHeight*2);
//			objDraw.Graphics.DrawString(obj_VO.strExamineResult,objFontNormal,Brushes.Black,RF);
//			Y+=this.fltRowHeight*2;
//			//辅助检查
//			objFontSize =objDraw.Graphics.MeasureString("辅助检查:",this.objFontNormal);
//			X=this.objDraw.PageBounds.Width*fltLeftIndentProp;
//			objDraw.Graphics.DrawString("辅助检查:",objFontNormal,Brushes.Black,X,Y);
//			X+=objFontSize.Width+2;
//			RF=new RectangleF(X,Y,fltRFTemp,this.fltRowHeight);
//			objDraw.Graphics.DrawString(obj_VO.strAidCheck,objFontNormal,Brushes.Black,RF);
//			Y+=this.fltRowHeight;
//			//诊    断
//			X=this.objDraw.PageBounds.Width*fltLeftIndentProp;
////			RX=this.objDraw.PageBounds.Width*(1-fltRightIndentProp)-X;
//			objFontSize =objDraw.Graphics.MeasureString("诊    断:",this.objFontNormal);
//			objDraw.Graphics.DrawString("诊    断:",objFontNormal,Brushes.Black,X,Y);
//			X+=objFontSize.Width+2;
//			RF=new RectangleF(X,Y,fltRFTemp,this.fltRowHeight*2);
//			objDraw.Graphics.DrawString(obj_VO.strDiag,objFontNormal,Brushes.Black,RF);
//			Y+=this.fltRowHeight*2;
//			//处    置
//			objFontSize =objDraw.Graphics.MeasureString("处    理:",this.objFontNormal);
//			X=this.objDraw.PageBounds.Width*fltLeftIndentProp;
//			objDraw.Graphics.DrawString("处    理:",objFontNormal,Brushes.Black,X,Y);
//			X+=objFontSize.Width+2;
//			RF=new RectangleF(X,Y,fltRFTemp,this.fltRowHeight);
//			objDraw.Graphics.DrawString(obj_VO.strTreatMent,objFontNormal,Brushes.Black,RF);
//			Y+=this.fltRowHeight;
//
//			for(int i=0;i<obj_VO.objItemArr.Count;i++)
//			{
//				clsOutpatientPrintRecipeDetail_VO objtemp =obj_VO.objItemArr[i] as clsOutpatientPrintRecipeDetail_VO;
//				X=this.objDraw.PageBounds.Width*fltLeftIndentProp;
//
//				//名称
//				objDraw.Graphics.DrawString(objtemp.m_strChargeName,objFontNormal,Brushes.Black,X,Y);
//				//总量
//				X=this.objDraw.PageBounds.Width*0.4f;
//				objDraw.Graphics.DrawString(objtemp.m_strCount,objFontNormal,Brushes.Black,X,Y);
//				//频率
//				X=this.objDraw.PageBounds.Width*0.5f;
//				objDraw.Graphics.DrawString(objtemp.m_strUsage,objFontNormal,Brushes.Black,X,Y);
//				//天数
//				X=this.objDraw.PageBounds.Width*0.65f;
//				objDraw.Graphics.DrawString(objtemp.m_strDays,objFontNormal,Brushes.Black,X,Y);
//				//频率
//				X=this.objDraw.PageBounds.Width*0.75f;
//				objDraw.Graphics.DrawString(objtemp.m_strFrequency,objFontNormal,Brushes.Black,X,Y);
//				Y+=this.fltRowHeight+3;
//
//			}
//
//			//备注
//			objFontSize =objDraw.Graphics.MeasureString("备    注:",this.objFontNormal);
//			X=this.objDraw.PageBounds.Width*fltLeftIndentProp;
//			objDraw.Graphics.DrawString("备    注:",objFontNormal,Brushes.Black,X,Y);
//			X+=objFontSize.Width+2;
//			RF=new RectangleF(X,Y,fltRFTemp,this.fltRowHeight);
//			objDraw.Graphics.DrawString(obj_VO.strReMark,objFontNormal,Brushes.Black,RF);
//			Y+=this.fltRowHeight+10;
//			//画线
//			X=this.objDraw.PageBounds.Width*fltLeftIndentProp;
//			Pen objPen=new Pen(Color.Black,2);
////			objPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
//			objDraw.Graphics.DrawLine(objPen,X,Y,RX,Y);
//			Y+=this.fltRowHeight/2;
//			//打印时间
//			objDraw.Graphics.DrawString("打印时间:"+DateTime.Now.ToString("yyyy-MM-dd HH:mm"),objFontNormal,Brushes.Black,X,Y);
//			//医生签名
//			X=this.objDraw.PageBounds.Width*0.65f;
//			objFontSize =objDraw.Graphics.MeasureString("医生签名:",objFontNormal);
//			objDraw.Graphics.DrawString("医生签名:",objFontNormal,Brushes.Black,X,Y);
//			X+=objFontSize.Width+5;
//			if(this.obj_VO.objDocImage!=null)
//			{
//				RF=new RectangleF(X,Y-5,100,60);
//				objDraw.Graphics.DrawImage(this.obj_VO.objDocImage,RF);
//			}
//			else
//			{
//				objDraw.Graphics.DrawString(obj_VO.m_strDiagDrName,objFontNormal,Brushes.Black,X,Y);
//			}
//			Y+=this.fltRowHeight*1.5f;
//			X=this.objDraw.PageBounds.Width*fltLeftIndentProp;
//			objDraw.Graphics.DrawLine(objPen,X,Y,RX,Y);
        }
예제 #7
0
        /// <summary>
        /// 打印带药处方
        /// </summary>
        /// <returns></returns>
        public clsOutpatientPrintRecipe_VO PrintRecipeData()
        {
            string             registerId = patVo.m_strRegisterID;
            clsBIHOrderService svc        = new clsDcl_GetSvcObject().m_GetOrderSvcObject();
            DataTable          dtPat      = svc.GetOutPatient(patVo.m_strPatientID);
            int      rowNo    = 0;
            decimal  totalMny = 0;
            DataView dvMed    = new DataView(dtMed);
            clsOutpatientPrintRecipe_VO       vo      = null;
            clsOutpatientPrintRecipeDetail_VO subItem = null;

            #region 主信息

            DataRow drPat = dtPat.Rows[0];
            vo = new clsOutpatientPrintRecipe_VO();
            vo.stroutpatrecipeMoney     = "";
            vo.m_strMatCost             = "";
            vo.m_strTimes               = "";
            vo.m_strHerbalmedicineUsage = "";
            vo.strCheckName             = "";
            vo.strDosageName            = "";
            vo.strMedMoney              = "";
            vo.strInvoiceNO             = "/";
            vo.m_strPhotoNo             = patVo.m_strHOMEPHONE_VCHR;
            vo.m_strAge         = patVo.m_strAge;
            vo.m_strIDcardno    = drPat["idcard_chr"].ToString();
            vo.strCheckOutName  = "";
            vo.m_strCardID      = patVo.m_strInHospitalNo; // 住院号
            vo.m_strRecipePrice = "";
            vo.m_strPatientType = patVo.m_strPayTypeName;
            vo.m_strPrintDate   = DateTime.Now.ToShortDateString();
            vo.m_strRecipeID    = "00000000" + DateTime.Now.ToString("yyMMddHHmm");
            vo.m_strSerNO       = "";
            vo.m_intRecipeCount = 1;

            vo.m_strRecipeDate    = "";
            vo.m_strSex           = patVo.m_strSex;
            vo.m_strPatientName   = patVo.m_strPatientName;
            vo.m_strdiagnose      = patVo.m_strDiagnose;
            vo.m_strAddress       = drPat["homeaddress_vchr"].ToString();
            vo.m_strHospitalName  = "";
            vo.m_strGOVCARD       = drPat["govcard_chr"].ToString();
            vo.m_strDiagDrName    = patVo.m_strDOCTOR_VCHR;
            vo.m_strDiagDeptID    = patVo.m_strDeptName + "(" + patVo.m_strBedName + "床)";
            vo.m_strINSURANCEID   = drPat["insuranceid_vchr"].ToString();
            vo.objPRDArr          = new System.Collections.ArrayList();
            vo.strSendMedStorage  = "";
            vo.m_strSendMedWindow = "";
            vo.strOutpatrecipeNO  = registerId;
            vo.objPRDArr2         = new System.Collections.ArrayList();
            vo.objPRDArr3         = new System.Collections.ArrayList();
            vo.objTreatArr        = new ArrayList();

            #endregion

            bool isCM = false;
            if (this.chk1.Checked)
            {
                vo.m_strRectype = "普通";
                dvMed.RowFilter = "medicinetypeid_chr = '2'";
            }
            else if (this.chk2.Checked)
            {
                isCM            = true;
                vo.m_strRectype = "中药";
                dvMed.RowFilter = "medicinetypeid_chr = '1' and recipeno_int = " + this.cboZyRecipeNo.Text;
            }
            else if (this.chk3.Checked)
            {
                vo.m_strRectype = "易制毒";
                dvMed.RowFilter = "ispoison_chr = '1'";
            }
            else if (this.chk4.Checked)
            {
                vo.m_strRectype = "麻醉";
                dvMed.RowFilter = "isanaesthesia_chr = '1'";
            }
            else if (this.chk5.Checked)
            {
                vo.m_strRectype = "精神一类";
                dvMed.RowFilter = "ischlorpromazine_chr = '1'";
            }
            else if (this.chk6.Checked)
            {
                vo.m_strRectype = "精神二类";
                dvMed.RowFilter = "ischlorpromazine2_chr = '1'";
            }
            else if (this.chk7.Checked)
            {
                vo.m_strRectype = "儿科";
                dvMed.RowFilter = "medicinetypeid_chr = '2'";
            }

            if (dvMed.Count > 0)
            {
                // 出院带药: 存在别医师代替管床医师开药情况,处方上医师需改用"开单医师(提交人)" 。
                if (dvMed[0]["poster_chr"] != DBNull.Value && dvMed[0]["poster_chr"].ToString().Trim() != string.Empty)
                {
                    patVo.m_strDOCTOR_VCHR = dvMed[0]["poster_chr"].ToString().Trim();
                }
            }

            #region 西药

            if (isCM == false)
            {
                vo.m_strRecipeDate   = Convert.ToDateTime(dvMed[0]["postdate_dat"].ToString()).ToString("yyyy-MM-dd");
                vo.strSendMedStorage = "中心药房";
                rowNo    = 0;
                totalMny = 0;
                for (int i = 0; i < dvMed.Count; i++)
                {
                    DataRowView drv = dvMed[i];
                    subItem = new clsOutpatientPrintRecipeDetail_VO();
                    // 西药
                    subItem.m_strDosageUnit    = drv["dosageunit_chr"].ToString();
                    subItem.m_strChargeName    = drv["medicinename_vchr"].ToString();
                    subItem.m_strMEDNORMALNAME = drv["mednormalname_vchr"].ToString();
                    subItem.m_strCount         = drv["get_dec"].ToString();
                    subItem.m_strDays          = drv["outgetmeddays_int"].ToString();
                    subItem.m_strDosage        = drv["dosage_dec"].ToString();
                    subItem.m_strFrequency     = drv["execfreqname_chr"].ToString().Trim();
                    subItem.m_strSpec          = drv["spec_vchr"].ToString();
                    subItem.m_strSumPrice      = drv["totalmny"].ToString();
                    subItem.m_strUnit          = drv["getunit_chr"].ToString().Trim();
                    subItem.m_strUsage         = drv["dosetypename_chr"].ToString().Trim();//drv["opusagedesc"].ToString() + " " + drv["opfredesc_vchr"].ToString();
                    if (i == 0)
                    {
                        subItem.m_strRowNo = Convert.ToString(++rowNo);
                    }
                    else
                    {
                        if (drv["parentid_chr"] != DBNull.Value && drv["parentid_chr"].ToString() == dvMed[i - 1]["orderid_chr"].ToString())
                        {
                            subItem.m_strRowNo = rowNo.ToString();
                        }
                        else
                        {
                            subItem.m_strRowNo = Convert.ToString(++rowNo);
                        }
                    }
                    subItem.m_strFreqDays       = drv["days_int"].ToString();
                    subItem.m_strFreqTimes      = drv["times_int"].ToString();
                    subItem.m_strBasicDosage    = subItem.m_strDosage;
                    subItem.m_strOPFreqDesc     = drv["opfredesc_vchr"].ToString();
                    subItem.m_strOPUsageDesc    = drv["opusagedesc"].ToString();
                    subItem.m_strItemIPUnit_chr = drv["dosageunit_chr"].ToString();
                    subItem.m_intPuted          = 1;
                    vo.objPRDArr.Add(subItem);
                    totalMny += clsPublic.ConvertObjToDecimal(subItem.m_strSumPrice);
                }
                vo.stroutpatrecipeMoney = totalMny.ToString();
                vo.strMedMoney          = totalMny.ToString();
                vo.m_strRecipePrice     = totalMny.ToString();
            }
            #endregion

            #region 中药
            vo.objPRDArr2  = new System.Collections.ArrayList();
            vo.objPRDArr3  = new System.Collections.ArrayList();
            vo.objTreatArr = new ArrayList();

            if (isCM)
            {
                vo.m_strRecipeDate   = Convert.ToDateTime(dvMed[0]["postdate_dat"].ToString()).ToString("yyyy-MM-dd");
                vo.strSendMedStorage = "门诊药房";
                rowNo    = 0;
                totalMny = 0;
                int fs = 0;
                foreach (DataRowView drv in dvMed)
                {
                    subItem = new clsOutpatientPrintRecipeDetail_VO();
                    // 中药
                    subItem.m_strChargeName    = drv["medicinename_vchr"].ToString();
                    subItem.m_strMEDNORMALNAME = drv["mednormalname_vchr"].ToString();
                    subItem.m_strCount         = drv["get_dec"].ToString();
                    subItem.m_strDays          = drv["outgetmeddays_int"].ToString();
                    subItem.m_strDosage        = drv["dosage_dec"].ToString();
                    subItem.m_strFrequency     = drv["execfreqname_chr"].ToString();
                    subItem.m_strSpec          = drv["spec_vchr"].ToString();
                    subItem.m_strSumPrice      = drv["totalmny"].ToString();
                    subItem.m_strUnit          = drv["getunit_chr"].ToString();
                    subItem.m_strUsage         = drv["dosetypename_chr"].ToString().Trim(); //drv["opusagedesc"].ToString() + " " + drv["opfredesc_vchr"].ToString();
                    //subItem.m_strUsageDetail = drv["dosetypename_chr"].ToString();
                    subItem.m_strBasicDosage    = subItem.m_strDosage;
                    subItem.m_strOPFreqDesc     = drv["opfredesc_vchr"].ToString();
                    subItem.m_strOPUsageDesc    = drv["opusagedesc"].ToString();
                    subItem.m_strItemIPUnit_chr = drv["dosageunit_chr"].ToString();
                    if (drv["remark_vchr"] != DBNull.Value && !string.IsNullOrEmpty(drv["remark_vchr"].ToString()))
                    {
                        subItem.m_strUsage = drv["remark_vchr"].ToString().Trim();
                    }
                    subItem.m_intPuted = 1;
                    vo.objPRDArr2.Add(subItem);
                    totalMny += clsPublic.ConvertObjToDecimal(subItem.m_strSumPrice);
                    if (fs == 0 && Convert.ToDecimal(drv["dosage_dec"].ToString()) > 0)
                    {
                        fs = Convert.ToInt32(Convert.ToDecimal(drv["get_dec"].ToString()) / Convert.ToDecimal(drv["dosage_dec"].ToString()));
                    }
                }
                vo.stroutpatrecipeMoney = totalMny.ToString();
                vo.strMedMoney          = totalMny.ToString();
                vo.m_strRecipePrice     = totalMny.ToString();
                vo.m_strTimes           = (fs > 0 ? fs.ToString() : "");
            }
            #endregion

            return(vo);
        }
예제 #8
0
        private clsOutpatientPrintRecipe_VO m_mthGetPrintVo(string strID)
        {
            clsOutpatientPrintRecipe_VO obj_VO = new clsOutpatientPrintRecipe_VO();

            objSvc = new clsDcl_ShowReports();
            DataTable dt;
            long      ret = objSvc.m_mthGetRecipeInfo(strID, out dt);

            if (ret > 0 && dt.Rows.Count > 0)
            {
                obj_VO.m_strDiagDeptID  = dt.Rows[0]["DEPTNAME_CHR"].ToString().Trim();
                obj_VO.m_strDiagDrName  = dt.Rows[0]["DOCTORNAME_CHR"].ToString().Trim();
                obj_VO.m_strRegisterID  = "";
                obj_VO.m_strSelfPay     = dt.Rows[0]["SBSUM_MNY"].ToString().Trim();
                obj_VO.m_strChargeUp    = dt.Rows[0]["ACCTSUM_MNY"].ToString().Trim();
                obj_VO.m_strRecipePrice = dt.Rows[0]["TOTALSUM_MNY"].ToString().Trim();
                obj_VO.m_strPrintDate   = dt.Rows[0]["INVDATE_DAT"].ToString().Trim().Substring(0, 10);
                obj_VO.m_strAddress     = dt.Rows[0]["HOMEADDRESS_VCHR"].ToString().Trim();
                obj_VO.m_strGOVCARD     = dt.Rows[0]["GOVCARD_CHR"].ToString().Trim();
                obj_VO.m_strINSURANCEID = dt.Rows[0]["INSURANCEID_VCHR"].ToString().Trim();
                DateTime dteBirth = Convert.ToDateTime(dt.Rows[0]["BIRTH_DAT"].ToString());
                obj_VO.m_strAge                 = clsCreatFile.s_strCalAge(dteBirth);
                obj_VO.m_strCardID              = dt.Rows[0]["PATIENTCARDID_CHR"].ToString().Trim();
                obj_VO.m_strHospitalName        = strHospitalName;
                obj_VO.m_strPatientName         = dt.Rows[0]["LASTNAME_VCHR"].ToString().Trim();
                obj_VO.m_strSex                 = dt.Rows[0]["SEX_CHR"].ToString().Trim();
                obj_VO.m_strRecipeType          = dt.Rows[0]["RECIPEFLAG_INT"].ToString().Trim();
                obj_VO.m_strHerbalmedicineUsage = "";
                obj_VO.strInvoiceNO             = dt.Rows[0]["INVOICENO_VCHR"].ToString().Trim();
                obj_VO.m_strRecordEmpID         = dt.Rows[0]["TYPENAME_VCHR"].ToString().Trim();
                obj_VO.m_strPatientType         = dt.Rows[0]["PAYTYPENAME_VCHR"].ToString().Trim();
                obj_VO.m_strdiagnose            = dt.Rows[0]["DIAG_VCHR"].ToString().Trim();
            }



            obj_VO.m_strTimes = "1";

            obj_VO.m_strRecipeID = strID;

            clsDcl_DoctorWorkstation objDKSvc = new clsDcl_DoctorWorkstation();

            dt = null;
            decimal decWMedicineCost  = 0;
            decimal decZCMedicineCost = 0;
            decimal decCureCost       = 0;

            System.Collections.ArrayList objPRDArr = new System.Collections.ArrayList();
            string[] IDarr = null;
            objSvc.m_mthGetRecipeGroup(strID, out IDarr);
            foreach (string TempID in IDarr)
            {
                ret = objDKSvc.m_mthFindRecipeDetail1(TempID, out dt, true);             //西药
                if (ret > 0 && dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        clsOutpatientPrintRecipeDetail_VO objtemp = new clsOutpatientPrintRecipeDetail_VO();
                        objtemp.m_strChargeName = dt.Rows[i]["ITEMNAME_VCHR"].ToString().Trim();
                        objtemp.m_strCount      = dt.Rows[i]["TOLQTY_DEC"].ToString().Trim() + dt.Rows[i]["UNITID_CHR"].ToString();
                        objtemp.m_strPrice      = clsConvertToDecimal.m_mthConvertObjToDecimal(dt.Rows[i]["UNITPRICE_MNY"]).ToString("0.00");
                        objtemp.m_strSumPrice   = dt.Rows[i]["TOLPRICE_MNY"].ToString().Trim();
                        objtemp.m_strUnit       = dt.Rows[i]["DOSAGEUNIT_CHR"].ToString().Trim();
                        objtemp.m_strFrequency  = dt.Rows[i]["FREQNAME_CHR"].ToString().Trim();
                        objtemp.m_strDosage     = dt.Rows[i]["QTY_DEC"].ToString().Trim() + dt.Rows[i]["DOSAGEUNIT_CHR"].ToString().Trim();
                        objtemp.m_strDays       = dt.Rows[i]["DAYS_INT"].ToString().Trim();
                        objtemp.m_strSpec       = dt.Rows[i]["ITEMSPEC_VCHR"].ToString().Trim();
                        objtemp.m_strUsage      = dt.Rows[i]["USAGENAME_VCHR"].ToString().Trim();
                        objtemp.m_strRowNo      = dt.Rows[i]["ROWNO_CHR"].ToString().Trim();
                        objtemp.m_strInvoiceCat = dt.Rows[i]["ITEMOPINVTYPE_CHR"].ToString().Trim();
                        decWMedicineCost       += clsConvertToDecimal.m_mthConvertObjToDecimal(dt.Rows[i]["TOLPRICE_MNY"]);
                        objPRDArr.Add(objtemp);
                    }
                }
            }

            System.Collections.ArrayList objPRDArr2 = new   System.Collections.ArrayList();
            foreach (string TempID in IDarr)
            {
                ret = objDKSvc.m_mthFindRecipeDetail2(TempID, out dt, true);             //中药
                if (ret > 0 && dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        clsOutpatientPrintRecipeDetail_VO objtemp = new clsOutpatientPrintRecipeDetail_VO();
                        objtemp.m_strChargeName = dt.Rows[i]["ITEMNAME"].ToString().Trim();
                        objtemp.m_strDosage     = dt.Rows[i]["MIN_QTY_DEC"].ToString().Trim() + dt.Rows[i]["UNIT"].ToString();
                        objtemp.m_strPrice      = dt.Rows[i]["price"].ToString().Trim();
                        objtemp.m_strSumPrice   = dt.Rows[i]["SUMMONEY"].ToString().Trim();
                        objtemp.m_strUsage      = dt.Rows[i]["USAGENAME_VCHR"].ToString();
                        objtemp.m_strRowNo      = dt.Rows[i]["ROWNO_CHR"].ToString();
                        objtemp.m_strInvoiceCat = dt.Rows[i]["ITEMOPINVTYPE_CHR"].ToString().Trim();
                        decZCMedicineCost      += clsConvertToDecimal.m_mthConvertObjToDecimal(dt.Rows[i]["SUMMONEY"]);
                        objPRDArr2.Add(objtemp);
                    }
                }
            }


            obj_VO.objinjectArr = new System.Collections.ArrayList();
            foreach (string TempID in IDarr)
            {
                ret = objDKSvc.m_mthFindRecipeDetail3(TempID, out dt, true);
                if (ret > 0 && dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        clsOutpatientPrintRecipeDetail_VO objtemp = new clsOutpatientPrintRecipeDetail_VO();
                        objtemp.m_strChargeName = dt.Rows[i]["ITEMNAME"].ToString();;
                        objtemp.m_strCount      = dt.Rows[i]["quantity"].ToString().Trim();
                        objtemp.m_strPrice      = dt.Rows[i]["PRICE"].ToString();
                        objtemp.m_strSumPrice   = dt.Rows[i]["SUMMONEY"].ToString().Trim();
                        objtemp.m_strUnit       = dt.Rows[i]["UNIT"].ToString().Trim();
                        objtemp.m_strInvoiceCat = dt.Rows[i]["ITEMOPINVTYPE_CHR"].ToString().Trim();
                        objtemp.m_strFrequency  = "";
                        objtemp.m_strDosage     = "";
                        objtemp.m_strDays       = "";
                        objtemp.m_strUsage      = "";
                        objtemp.m_strRowNo      = "";
                        decCureCost            += clsConvertToDecimal.m_mthConvertObjToDecimal(dt.Rows[i]["SUMMONEY"]);
                        obj_VO.objinjectArr.Add(objtemp);
                    }
                }
                ret = objDKSvc.m_mthFindRecipeDetail4(TempID, out dt, true);
                if (ret > 0 && dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        clsOutpatientPrintRecipeDetail_VO objtemp = new clsOutpatientPrintRecipeDetail_VO();
                        objtemp.m_strChargeName = dt.Rows[i]["ITEMNAME"].ToString();;
                        objtemp.m_strCount      = dt.Rows[i]["quantity"].ToString().Trim();
                        objtemp.m_strPrice      = dt.Rows[i]["PRICE"].ToString();
                        objtemp.m_strSumPrice   = dt.Rows[i]["SUMMONEY"].ToString().Trim();
                        objtemp.m_strUnit       = dt.Rows[i]["UNIT"].ToString().Trim();
                        objtemp.m_strInvoiceCat = dt.Rows[i]["ITEMOPINVTYPE_CHR"].ToString().Trim();
                        objtemp.m_strFrequency  = "";
                        objtemp.m_strDosage     = "";
                        objtemp.m_strDays       = "";
                        objtemp.m_strUsage      = "";
                        objtemp.m_strRowNo      = "";
                        decCureCost            += clsConvertToDecimal.m_mthConvertObjToDecimal(dt.Rows[i]["SUMMONEY"]);
                        obj_VO.objinjectArr.Add(objtemp);
                    }
                }
                ret = objDKSvc.m_mthFindRecipeDetail5(TempID, out dt, true);
                if (ret > 0 && dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        clsOutpatientPrintRecipeDetail_VO objtemp = new clsOutpatientPrintRecipeDetail_VO();
                        objtemp.m_strChargeName = dt.Rows[i]["ITEMNAME"].ToString();;
                        objtemp.m_strCount      = dt.Rows[i]["quantity"].ToString().Trim();
                        objtemp.m_strPrice      = dt.Rows[i]["PRICE"].ToString();
                        objtemp.m_strSumPrice   = dt.Rows[i]["SUMMONEY"].ToString().Trim();
                        objtemp.m_strUnit       = dt.Rows[i]["UNIT"].ToString().Trim();
                        objtemp.m_strInvoiceCat = dt.Rows[i]["ITEMOPINVTYPE_CHR"].ToString().Trim();
                        objtemp.m_strFrequency  = "";
                        objtemp.m_strDosage     = "";
                        objtemp.m_strDays       = "";
                        objtemp.m_strUsage      = "";
                        objtemp.m_strRowNo      = "";
                        decCureCost            += clsConvertToDecimal.m_mthConvertObjToDecimal(dt.Rows[i]["SUMMONEY"]);
                        obj_VO.objinjectArr.Add(objtemp);
                    }
                }
                ret = objDKSvc.m_mthFindRecipeDetail6(TempID, out dt, true);
                if (ret > 0 && dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        clsOutpatientPrintRecipeDetail_VO objtemp = new clsOutpatientPrintRecipeDetail_VO();
                        objtemp.m_strChargeName = dt.Rows[i]["ITEMNAME"].ToString();;
                        objtemp.m_strCount      = dt.Rows[i]["quantity"].ToString().Trim();
                        objtemp.m_strPrice      = dt.Rows[i]["PRICE"].ToString();
                        objtemp.m_strSumPrice   = dt.Rows[i]["SUMMONEY"].ToString().Trim();
                        objtemp.m_strUnit       = dt.Rows[i]["UNIT"].ToString().Trim();
                        objtemp.m_strInvoiceCat = dt.Rows[i]["ITEMOPINVTYPE_CHR"].ToString().Trim();
                        objtemp.m_strFrequency  = "";
                        objtemp.m_strDosage     = "";
                        objtemp.m_strDays       = "";
                        objtemp.m_strUsage      = "";
                        objtemp.m_strRowNo      = "";
                        decCureCost            += clsConvertToDecimal.m_mthConvertObjToDecimal(dt.Rows[i]["SUMMONEY"]);
                        obj_VO.objinjectArr.Add(objtemp);
                    }
                }
            }
            obj_VO.m_strWMedicineCost  = decWMedicineCost.ToString("0.00");         //最后在这里添加数据
            obj_VO.m_strZCMedicineCost = decZCMedicineCost.ToString("0.00");
            obj_VO.m_strCureCost       = decCureCost.ToString("0.00");
            objPRDArr.Sort(0, objPRDArr.Count, null);
            objPRDArr2.Sort(0, objPRDArr2.Count, null);
            obj_VO.objPRDArr  = objPRDArr;
            obj_VO.objPRDArr2 = objPRDArr2;
            return(obj_VO);
        }