public static string confirmDrug(int pid, string pspnum, string Hospitalid) { DrugModel dm = new DrugModel(); DataTable dt = dm.findDrugByPid(pid + ""); if (dt.Rows.Count > 0) { RecipeModel rm = new RecipeModel(); int count = rm.confirmDrug(pid); if (count > 0) { DrugMatchingModel dmm = new DrugMatchingModel(); dmm.findNotCheckAndMatchRecipeDrugInfoToMatch(); return("操作成功"); } else { return("操作失败"); } } else { return("操作失败:该处方还没有录入药品"); } }
public static int insertDrugMatching(int hospitalId, string hospitalName, string hdrugNum, string ypcdrugNum, string hdrugName , string ypcdrugName, string hdrugOriginAddress, string ypcdrugOriginAddress, string hdrugSpecs, string ypcdrugSpecs , string hdrugTotal, string ypcdrugTotal, string pspNum, string ypcdrugPositionNum, string pspId, string drugId) { DrugAdminModel wr = new DrugAdminModel(); int count = 0; DrugMatchingModel dmm = new DrugMatchingModel(); DataTable dt = dmm.findNotCheckAndMatchRecipeDrugInfo(hdrugNum); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { DrugMatchingInfo drugMatchingInfo = new DrugMatchingInfo(); drugMatchingInfo.hospitalId = Convert.ToInt32(dt.Rows[i]["hospitalId"].ToString()); drugMatchingInfo.hospitalName = dt.Rows[i]["hospitalName"].ToString(); drugMatchingInfo.hdrugNum = dt.Rows[i]["hdrugNum"].ToString(); drugMatchingInfo.ypcdrugNum = ypcdrugNum; drugMatchingInfo.hdrugName = dt.Rows[i]["hdrugName"].ToString(); drugMatchingInfo.ypcdrugName = ypcdrugName; drugMatchingInfo.hdrugOriginAddress = hdrugOriginAddress; drugMatchingInfo.ypcdrugOriginAddress = ypcdrugOriginAddress; drugMatchingInfo.hdrugSpecs = hdrugSpecs; drugMatchingInfo.ypcdrugSpecs = ypcdrugSpecs; drugMatchingInfo.hdrugTotal = dt.Rows[i]["hdrugTotal"].ToString(); drugMatchingInfo.ypcdrugTotal = ypcdrugTotal; drugMatchingInfo.pspNum = dt.Rows[i]["pspNum"].ToString(); drugMatchingInfo.ypcdrugPositionNum = ypcdrugPositionNum; drugMatchingInfo.pspId = dt.Rows[i]["pspId"].ToString(); drugMatchingInfo.drugId = dt.Rows[i]["drugId"].ToString(); count += dmm.insertDrugMatching(drugMatchingInfo); int sdr = wr.Adddrugmatchinginfo(dt.Rows[i]["hospitalId"].ToString(), dt.Rows[i]["hdrugName"].ToString(), dt.Rows[i]["hdrugNum"].ToString(), ypcdrugName, ypcdrugNum); RecipeModel rm = new RecipeModel(); bool boo = rm.checkPrescriptionIsMath(Convert.ToInt32(drugMatchingInfo.pspId)); if (boo) { SqlDataReader sdr2 = rm.findisneedcheckstatus(); string isneedcheck = ""; if (sdr2.Read()) { isneedcheck = sdr2["isneedcheck"].ToString(); } if (isneedcheck == "0") { rm.updatePrescriptionStatus(Convert.ToInt32(drugMatchingInfo.pspId), "未审核"); } if (isneedcheck == "1") { string reasonText = ""; string name = ""; string employeeid = ""; int num = rm.checkPrescription(Convert.ToInt32(drugMatchingInfo.pspId), 1, reasonText, name, employeeid); rm.updatePrescriptionStatus(Convert.ToInt32(drugMatchingInfo.pspId), "已审核"); } } } } return(count); }