Esempio n. 1
0
 public clsPrintRecipeDetail(System.Drawing.Printing.PrintPageEventArgs p_obj, clsOutpatientPrintRecipe_VO VO)
 {
     objDraw       = p_obj;
     objFontTitle  = new Font("SimSun", 16, FontStyle.Bold);
     objFontNormal = new Font("SimSun", 10);
     obj_VO        = VO;
 }
Esempio n. 2
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);
        }
Esempio n. 3
0
        public void m_mthCreatFile()
        {
            if (objArr == null || objArr.Length == 0)
            {
                return;
            }
            SaveFileDialog objDlg = new SaveFileDialog();

            objDlg.Title           = "请选择保存路径";
            objDlg.OverwritePrompt = true;
            objDlg.CheckPathExists = true;
            objDlg.AddExtension    = true;
            objDlg.FileName        = "文件名";
            objDlg.DefaultExt      = "emr";
            objDlg.Filter          = "灏瀚处方文件 (*.emr)|*.emr|所有文件 (*.*)|*.*";
            if (objDlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            string[] strPath = objDlg.FileName.Split('\\');
            string   strpath = "";

            for (int p = 0; p < strPath.Length - 1; p++)
            {
                strpath += strPath[p] + "\\";
            }
            dwtProcessBar objProcessBar = new dwtProcessBar("正在生成文件,请稍候...");

            objProcessBar.IsCanCancel = true;
            objProcessBar.m_mthSetMaxValue(objArr.Length);
            try
            {
                objProcessBar.Show();
                for (int i = 0; i < objArr.Length; i++)
                {
                    if (objProcessBar.IsCancel)
                    {
                        break;
                    }
                    clsOutpatientPrintRecipe_VO m_objSetValue = m_mthGetPrintVo(objArr[i].Trim());
                    string path = strpath;
                    path += m_objSetValue.m_strDiagDrName + m_objSetValue.m_strPatientType.Replace("/", "") + m_objSetValue.strInvoiceNO + ".emr";
                    IFormatter objForm   = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
                    Stream     objStream = new System.IO.FileStream(path, FileMode.Create);
                    objForm.Serialize(objStream, m_objSetValue);
                    objStream.Flush();
                    objStream.Close();
                    objProcessBar.m_mthAdd();
                    Application.DoEvents();
                }
                objProcessBar.Hide();
                MessageBox.Show("文件生成成功\n共生成了" + objProcessBar.GetValue.ToString() + "个文件");
                objProcessBar.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
//				MessageBox.Show("无法保存文件,请检查文件名是否与只读文件重名或磁盘空间不足。");
                objProcessBar.Close();
            }
        }
Esempio n. 4
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);
        }
Esempio n. 5
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);
        }