123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565 |
- using Newtonsoft.Json.Linq;
- using PTMedicalInsurance.Common;
- using PTMedicalInsurance.Helper;
- using PTMedicalInsurance.Variables;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace PTMedicalInsurance.Business
- {
- class LocalMobilePayProcess : AbstractProcess
- {
- private Patients MPat;
- public Settlements MSettl;
- private JObject joParam;
- private JObject joInsuAdmObj;
- private JObject joResponse;
- /// <summary>
- /// 支付请求
- /// </summary>
- /// <param name="input"></param>
- /// <returns></returns>
- public override CallResult Process(JObject input)
- {
- //调用HIS费用查询信息
- if (hIS.getHisFee(Global.pat, out outParam) != 0)
- {
- return Exception("获取HIS费用", outParam);
- }
- //调用医保平台转换
- JObject joHisFee = JObject.Parse(outParam);
- if (mIS.convertHisFeeWithInsuCode(joHisFee, out outParam) != 0)
- {
- return Exception("转换HIS费用", outParam);
- }
- Decimal total = 0;
- JArray jaFeeDetail = JArray.Parse(JsonHelper.getDestValue(JObject.Parse(outParam), "data"));
- jaFeeDetail.ToList().ForEach((fee) =>
- {
- fee["chrg_bchno"] = Global.pat.adm_Dr.ToString();
- fee["med_type"] = Global.pat.medType;
- fee["med_list_spc"] = fee["spec"];
- dynamic expContent = new JObject();
- JProperty exp = fee.Children<JProperty>().FirstOrDefault(p => p.Name == "expContent");
- if (exp != null)
- {
- exp.Remove();
- }
- string item_sum = JsonHelper.getDestValue((JObject)fee, "det_item_fee_sumamt");
- if (!string.IsNullOrEmpty(item_sum)) {
- total += Decimal.Parse(item_sum);
- }
- expContent.selfpay_prop = fee["SelfPayPercent"];
- expContent.drord_no = fee["drord_no"];
- fee["exp_content"] = expContent;
- });
- JObject joSettlement = (JObject)input["settlement"];
- joSettlement["medfee_sumamt"] = total;
- //合并参数
- dynamic joInput = new JObject();
- joInput.Add("feedetail", jaFeeDetail);
- joInput = mergeJson(joInput, (JObject)input["patInfo"]);
- joInput = mergeJson(joInput, (JObject)input["data"]);
- joInput = mergeJson(joInput, (JObject)input["mdtrtinfo"]);
- joInput = mergeJson(joInput, joSettlement);
- joInput.Add("diseinfo_list",input["diseinfo"]);
- joInput.Add("feedetail_list", jaFeeDetail);
- dynamic joExpContent = new JObject();
- joExpContent.op_swssc_flag = "0";
- joExpContent.itnt_hosp_flag = "0";
- joExpContent.mulaid_flag = "0";
- joInput.exp_content = joExpContent;
- outParam = JsonHelper.toJsonString(joInput);
- return Success();
- }
- private JObject mergeJson(JObject source,JObject target)
- {
- source.Merge(target, new JsonMergeSettings
- {
- MergeArrayHandling = MergeArrayHandling.Union
- });
- return source;
- }
-
- private void init(JObject joInpar)
- {
- joParam = JObject.Parse(JsonHelper.getDestValue(joInpar, "params[0]"));
- joInsuAdmObj = JObject.Parse(JsonHelper.getDestValue(joInpar, "insuAdmObj"));
- string response = JsonHelper.getDestValue(joInpar, "responsecontent");
- if(!string.IsNullOrEmpty(response))
- {
- joResponse = JObject.Parse(response);
- }
- setPatientByInPar();
- setSettlementsByInPar();
- }
- public void setSettlementsByInPar()
- {
- MSettl.clearingWay = JsonHelper.getDestValue(joInsuAdmObj, "psnSetlway");
- MSettl.settlID = JsonHelper.getDestValue(joInsuAdmObj, "payOrdId");
- MSettl.payOrdId = JsonHelper.getDestValue(joInsuAdmObj, "payOrdId");
- }
- public void setPatientByInPar()
- {
- MPat.adm_Dr = int.Parse(JsonHelper.getDestValue(joParam, "admID"));
- Global.pat.adm_Dr = MPat.adm_Dr;
- MPat.name = JsonHelper.getDestValue(joInsuAdmObj, "patName");
- MPat.recordID = JsonHelper.getDestValue(joParam, "recordID");
- MPat.billID = JsonHelper.getDestValue(joParam, "billID");
- MPat.medType = JsonHelper.getDestValue(joInsuAdmObj, "medType");
- MPat.certType = JsonHelper.getDestValue(joInsuAdmObj, "mdtrtCertType");
- MPat.token = JsonHelper.getDestValue(joInsuAdmObj, "ecToken");
- MPat.payAuthNo = JsonHelper.getDestValue(joInsuAdmObj, "payAuthNo");
- MPat.uldLatlnt = JsonHelper.getDestValue(joInsuAdmObj, "uldLatlnt");
- MPat.payOrdId = JsonHelper.getDestValue(joInsuAdmObj, "payOrdId");
- MPat.mdtrtID = JsonHelper.getDestValue(joInsuAdmObj, "mdtrt_id");
- if (string.IsNullOrEmpty(MPat.mdtrtID) && joResponse != null)
- {
- MPat.mdtrtID = JsonHelper.getDestValue(joResponse, "SETLINFO.mdtrt_id");
- }
- MPat.settlID = JsonHelper.getDestValue(joInsuAdmObj, "setl_id");
- if (string.IsNullOrEmpty(MPat.settlID) && joResponse != null)
- {
- MPat.settlID = JsonHelper.getDestValue(joResponse, "SETLINFO.setl_id");
- MPat.psn_no = JsonHelper.getDestValue(joResponse, "SETLINFO.psn_no");
- MPat.payOrdId = MPat.settlID;
- MPat.insuplc_admdvs = JsonHelper.getDestValue(joResponse, "insuplcAdmdvs");
- }
- Global.pat.mdtrtID = MPat.mdtrtID;
- }
- /// <summary>
- /// 交易确认
- /// </summary>
- /// <param name="input"></param>
- public CallResult Confirm(JObject input)
- {
- outParam = "";
- string errMsg = "";
- init(input);
- // save
- //设置
- JObject joSettle = joResponse["SETLINFO"].ToObject<JObject>();
- setSettlementsBy6202Rtn(joSettle);
- MSettl.confirmFlag = 0;
- //存入MI 结算表
- if (saveSettlement(out errMsg) != 0)
- {
- outParam = errMsg;
- return Exception(-1, "保存结算信息失败",errMsg);
- }
- MobilePayConfirmSettlement(joSettle,out outParam);
- return IrisReturn("结算成功",null);
- }
- private int MobilePayConfirmSettlement(JObject joSettlInfo,out string outPar)
- {
- string errMsg;
- outPar = "";
- try
- {
- //设置
- setSettlementsBy6301Rtn(joSettlInfo);
- MSettl.confirmFlag = 1;
- //存入MI 结算表
- if (updateSettlement(out errMsg) != 0)
- {
- outPar = errMsg;
- return -1;
- }
- else
- {
- //返回给HIS前端
- outPar = JsonHelper.setExceptionJson(0, "云医保平台", "确认成功!").ToString();
- return 0;
- }
- }
- catch (Exception ex)
- {
- outPar = ex.Message;
- return -1;
- }
- }
- public void setSettlementsBy6202Rtn(JObject jo)
- {
- MSettl.settlID = JsonHelper.getDestValue(jo, "setl_id");
- MPat.payOrdId = MSettl.settlID;
- MSettl.payOrdId = MSettl.settlID;
- MSettl.ordStas = JsonHelper.getDestValue(jo, "ordStas");
- MSettl.sumamt = getDecimalFee(jo, "medfee_sumamt");
- MSettl.personCashPay = getDecimalFee(jo, "ownPayAmt");
- MSettl.accountPaySumamt = getDecimalFee(jo, "acct_pay");
- MSettl.fundPaySumamt = getDecimalFee(jo, "fund_pay_sumamt");
- MSettl.deposit = getDecimalFee(jo, "deposit");
- MSettl.clearingOrgan = JsonHelper.getDestValue(jo, "clr_optins");
- MSettl.clearingType = JsonHelper.getDestValue(jo, "clr_type");
- MSettl.clearingWay = JsonHelper.getDestValue(jo, "clr_way");
- MSettl.civilserviceAllowancePay = getDecimalFee(jo, "cvlserv_pay");
- MSettl.ownPayAmount = getDecimalFee(jo, "fulamt_ownpay_amt");
- MSettl.overLimitAmountmt = getDecimalFee(jo, "overlmt_selfpay");
- MSettl.preSelfPayAmount = getDecimalFee(jo, "preselfpay_amt");
- MSettl.inPolicyRangeAmount = getDecimalFee(jo, "inscp_scp_amt");
- MSettl.actualPayDeductible = getDecimalFee(jo, "act_pay_dedc");
- MSettl.healthInsurancePay = getDecimalFee(jo, "hifp_pay");
- MSettl.healthInsuranceRatio = getDecimalFee(jo, "pool_prop_selfpay");
- MSettl.enterpriseSupplementPay = getDecimalFee(jo, "hifes_pay");
- MSettl.seriousIllnessPay = getDecimalFee(jo, "hifmi_pay");
- MSettl.largeExpensesSupplementPay = getDecimalFee(jo, "hifob_pay");
- MSettl.medicalAssistPay = getDecimalFee(jo, "maf_pay");
- MSettl.hospitalPartAmount = getDecimalFee(jo, "hosp_part_amt");
- MSettl.otherPay = getDecimalFee(jo, "oth_pay");
- MSettl.personPaySumamt = getDecimalFee(jo, "psn_part_amt");
- MSettl.balance = getDecimalFee(jo, "balc");
- MSettl.accountMutualAidAmount = getDecimalFee(jo, "acct_mulaid_pay");
- }
- /// <summary>
- /// 插入结算信息
- /// </summary>
- /// <param name="joSettlement"></param>
- /// <param name="outParam"></param>
- /// <returns></returns>
- public int saveSettlement(out string outParam)
- {
- JObject joTmp = new JObject();
- string errMsg = "";
- try
- {
- JObject joSetlinfo = new JObject();
- joSetlinfo.Add("HospitalDr", Global.inf.hospitalDr);
- joSetlinfo.Add("admID", MPat.adm_Dr);
- joSetlinfo.Add("mdtrt_id", MPat.mdtrtID);
- joSetlinfo.Add("setl_id", MSettl.settlID);//
- joSetlinfo.Add("pay_ord_id", MSettl.payOrdId);
- joSetlinfo.Add("psn_no", MPat.psn_no);
- joSetlinfo.Add("psn_name", MPat.name);
- //joSetlinfo.Add("mdtrt_cert_type", JsonHelper.getDestValue(joRtnSetlinfo, "mdtrt_cert_type"));
- joSetlinfo.Add("certno", MPat.certNO);
- joSetlinfo.Add("gend", MPat.gend);
- joSetlinfo.Add("naty", MPat.naty);
- joSetlinfo.Add("brdy", MPat.brdy);
- joSetlinfo.Add("age", MPat.age);
- joSetlinfo.Add("insutype", MPat.insuType);
- joSetlinfo.Add("psn_type", MPat.psn_type);
- joSetlinfo.Add("cvlserv_flag", "");
- joSetlinfo.Add("setl_time", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
- joSetlinfo.Add("mdtrt_cert_type", MPat.mdtrtcertType);
- joSetlinfo.Add("med_type", MPat.medType);
- joSetlinfo.Add("medfee_sumamt", MSettl.sumamt);//总费用
- joSetlinfo.Add("fulamt_ownpay_amt", MSettl.ownPayAmount);//全自费金额
- joSetlinfo.Add("overlmt_selfpay", MSettl.overLimitAmountmt);//超限价自费费用
- joSetlinfo.Add("preselfpay_amt", MSettl.preSelfPayAmount);//先行自付金额
- joSetlinfo.Add("inscp_scp_amt", MSettl.inPolicyRangeAmount);//符合政策范围金额
- joSetlinfo.Add("act_pay_dedc", MSettl.actualPayDeductible);//实际支付起付线
- joSetlinfo.Add("hifp_pay", MSettl.healthInsurancePay);//基本医疗保险统筹基金支出
- joSetlinfo.Add("pool_prop_selfpay", MSettl.healthInsuranceRatio);//基本医疗保险统筹基金支付比例
- joSetlinfo.Add("cvlserv_pay", MSettl.civilserviceAllowancePay);//公务员医疗补助资金支出
- joSetlinfo.Add("hifes_pay", MSettl.enterpriseSupplementPay);//企业支付 占用 大病报销金额
- joSetlinfo.Add("hifmi_pay", MSettl.seriousIllnessPay);// 居民大病保险资金支出
- joSetlinfo.Add("hifob_pay", MSettl.largeExpensesSupplementPay);//职工大额医疗费用补助基金支出
- joSetlinfo.Add("maf_pay", MSettl.medicalAssistPay);//医疗救助基金支出
- joSetlinfo.Add("hosp_part_amt", MSettl.hospitalPartAmount);//医院负担金额
- joSetlinfo.Add("oth_pay", MSettl.otherPay);//其他支出
- joSetlinfo.Add("fund_pay_sumamt", MSettl.fundPaySumamt);//基金支付总额
- joSetlinfo.Add("psn_part_amt", MSettl.personPaySumamt);//个人负担总金额
- joSetlinfo.Add("acct_pay", MSettl.accountPaySumamt);//个人账户支出
- joSetlinfo.Add("psn_cash_pay", MSettl.personCashPay);//个人现金支出
- joSetlinfo.Add("balc", MSettl.balance);// 余额
- joSetlinfo.Add("acct_mulaid_pay", "");//个人账户共济支付金额
- joSetlinfo.Add("medins_setl_id", "");//医药机构结算ID
- joSetlinfo.Add("clr_optins", MSettl.clearingOrgan);//清算经办机构
- joSetlinfo.Add("clr_way", MSettl.clearingWay);//清算方式
- joSetlinfo.Add("clr_type", MSettl.clearingType);//清算类别
- joSetlinfo.Add("ValidFlag", 1);
- joSetlinfo.Add("BillType", 1);
- joSetlinfo.Add("msgid", Global.curEvt.msgid);
- joSetlinfo.Add("admType", "3");
- joSetlinfo.Add("billID", MPat.billID);
- joSetlinfo.Add("recordID", MPat.recordID);
- joSetlinfo.Add("interfaceDr", Global.inf.interfaceDr);
- joSetlinfo.Add("insuplc_admdvs", MPat.insuplc_admdvs);
- joSetlinfo.Add("OccurTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
- joSetlinfo.Add("HospitalizationsDays", MSettl.hospitalizationsDays);
- joSetlinfo.Add("HospitalizationsTimes", MSettl.hospitalizationsTimes);
- joSetlinfo.Add("HISAdmTime", MSettl.hisAdmTime);
- joSetlinfo.Add("HISDischargeTime", MSettl.hisDischargeTime);
- joSetlinfo.Add("updateUserID", Global.user.ID);
- joSetlinfo.Add("ConfirmFlag", MSettl.confirmFlag);
- JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010051", joSetlinfo).ToString(), "插入结算信息");
- if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
- {
- outParam = errMsg;
- return -1;
- }
- else
- {
- outParam = joSetlinfo.ToString();
- return 0;
- }
- }
- catch (Exception ex)
- {
- outParam = "插入结算信息:" + ex.Message;
- return -1;
- }
- }
- public void setSettlementsBy6301Rtn(JObject jo)
- {
- MSettl.settlID = MPat.payOrdId;
- MPat.psn_no = JsonHelper.getDestValue(jo, "psn_no");
- MPat.naty = JsonHelper.getDestValue(jo, "naty");
- //MPat.name = JsonHelper.getDestValue(jo, "name");
- MPat.age = JsonHelper.getDestValue(jo, "age");
- MPat.gend = JsonHelper.getDestValue(jo, "gend");
- MPat.certNO = JsonHelper.getDestValue(jo, "certno");
- MPat.brdy = JsonHelper.getDestValue(jo, "brdy");
- MPat.insuType = JsonHelper.getDestValue(jo, "insutype");
- MPat.psn_type = JsonHelper.getDestValue(jo, "psn_type");
- MPat.mdtrtcertType = JsonHelper.getDestValue(jo, "mdtrt_cert_type");
- MPat.medType = JsonHelper.getDestValue(jo, "med_type");
- //MPat.insuplc_admdvs = JsonHelper.getDestValue(jo, "insuplc_admdvs");
- //MPat.payOrdId = JsonHelper.getDestValue(jo, "payOrdId");
- MSettl.ordStas = JsonHelper.getDestValue(jo, "ordStas");
- MSettl.sumamt = getDecimalFee(jo, "medfee_sumamt");
- MSettl.personCashPay = getDecimalFee(jo, "psn_cash_pay");
- MSettl.accountPaySumamt = getDecimalFee(jo, "acct_pay");
- MSettl.fundPaySumamt = getDecimalFee(jo, "fund_pay_sumamt");
- //MSettl.deposit = getDecimalFee(jo, "deposit");
- MSettl.clearingOrgan = JsonHelper.getDestValue(jo, "clr_optins");
- MSettl.clearingType = JsonHelper.getDestValue(jo, "clr_type");
- MSettl.clearingWay = JsonHelper.getDestValue(jo, "clr_way");
- MSettl.civilserviceAllowancePay = getDecimalFee(jo, "cvlserv_pay");
- MSettl.ownPayAmount = getDecimalFee(jo, "fulamt_ownpay_amt");
- MSettl.overLimitAmountmt = getDecimalFee(jo, "overlmt_selfpay");
- MSettl.preSelfPayAmount = getDecimalFee(jo, "preselfpay_amt");
- MSettl.inPolicyRangeAmount = getDecimalFee(jo, "inscp_scp_amt");
- MSettl.actualPayDeductible = getDecimalFee(jo, "act_pay_dedc");
- MSettl.healthInsurancePay = getDecimalFee(jo, "hifp_pay");
- MSettl.healthInsuranceRatio = getDecimalFee(jo, "pool_prop_selfpay");
- MSettl.enterpriseSupplementPay = getDecimalFee(jo, "hifes_pay");
- MSettl.seriousIllnessPay = getDecimalFee(jo, "hifmi_pay");
- MSettl.largeExpensesSupplementPay = getDecimalFee(jo, "hifob_pay");
- MSettl.medicalAssistPay = getDecimalFee(jo, "maf_pay");
- MSettl.hospitalPartAmount = getDecimalFee(jo, "hosp_part_amt");
- MSettl.otherPay = getDecimalFee(jo, "oth_pay");
- MSettl.personPaySumamt = getDecimalFee(jo, "psn_part_amt");
- MSettl.balance = getDecimalFee(jo, "balc");
- MSettl.accountMutualAidAmount = getDecimalFee(jo, "acct_mulaid_pay");
- }
- /// <summary>
- /// 获取结算费用的封装
- /// </summary>
- /// <param name="jo"></param>
- /// <param name="path"></param>
- /// <returns></returns>
- private decimal getDecimalFee(JObject jo, string path)
- {
- try
- {
- string temp = JsonHelper.getDestValue(jo, path);
- if (temp == "")
- {
- return 0;
- }
- else
- {
- return decimal.Parse(temp);
- }
- }
- catch (Exception ex)
- {
- Global.writeLog("getFee异常:" + ex.Message);
- return 0;
- }
- }
- public int updateSettlement(out string outParam)
- {
- JObject joTmp = new JObject();
- string errMsg = "";
- try
- {
- JObject joSetlinfo = new JObject();
- joSetlinfo.Add("HospitalDr", Global.inf.hospitalDr);
- joSetlinfo.Add("AdmDr", MPat.adm_Dr);
- joSetlinfo.Add("MdtrtID", MPat.mdtrtID);
- joSetlinfo.Add("SettlementID", MSettl.settlID);//
- joSetlinfo.Add("PayOrdID", MSettl.payOrdId);
- joSetlinfo.Add("PersonnelNO", MPat.psn_no);
- joSetlinfo.Add("PatientName", MPat.name);
- //joSetlinfo.Add("CertificateType", JsonHelper.getDestValue(joRtnSetlinfo, "mdtrt_cert_type"));
- joSetlinfo.Add("CertificateNO", MPat.certNO);
- joSetlinfo.Add("Gender", MPat.gend);
- joSetlinfo.Add("Nation", MPat.naty);
- joSetlinfo.Add("BirthDay", MPat.brdy);
- joSetlinfo.Add("Age", MPat.age);
- joSetlinfo.Add("InsuranceType", MPat.insuType);
- joSetlinfo.Add("PersonType", MPat.psn_type);
- joSetlinfo.Add("CivilserviceFlag", "");
- joSetlinfo.Add("SettlementDateTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
- joSetlinfo.Add("MdtrtCertType", MPat.mdtrtcertType);
- joSetlinfo.Add("MedicalType", MPat.medType);
- joSetlinfo.Add("Sumamt", MSettl.sumamt);//总费用
- joSetlinfo.Add("OwnPayAmount", MSettl.ownPayAmount);//全自费金额
- joSetlinfo.Add("OverLimitAmount", MSettl.overLimitAmountmt);//超限价自费费用
- joSetlinfo.Add("PreSelfPayAmount", MSettl.preSelfPayAmount);//先行自付金额
- joSetlinfo.Add("InPolicyRangeAmount", MSettl.inPolicyRangeAmount);//符合政策范围金额
- joSetlinfo.Add("ActualPayDeductible", MSettl.actualPayDeductible);//实际支付起付线
- joSetlinfo.Add("HealthInsurancePay", MSettl.healthInsurancePay);//基本医疗保险统筹基金支出
- joSetlinfo.Add("HealthInsuranceRatio", MSettl.healthInsuranceRatio);//基本医疗保险统筹基金支付比例
- joSetlinfo.Add("CivilserviceAllowancePay", MSettl.civilserviceAllowancePay);//公务员医疗补助资金支出
- joSetlinfo.Add("EnterpriseSupplementPay", MSettl.enterpriseSupplementPay);//企业支付
- joSetlinfo.Add("SeriousIllnessPay", MSettl.seriousIllnessPay);// 居民大病保险资金支出
- joSetlinfo.Add("LargeExpensesSupplementPay", MSettl.largeExpensesSupplementPay);//职工大额医疗费用补助基金支出
- joSetlinfo.Add("MedicalAssistPay", MSettl.medicalAssistPay);//医疗救助基金支出
- joSetlinfo.Add("HospitalPartAmount", MSettl.hospitalPartAmount);//医院负担金额
- joSetlinfo.Add("OtherPay", MSettl.otherPay);//其他支出
- joSetlinfo.Add("FundPaySumamt", MSettl.fundPaySumamt);//基金支付总额
- joSetlinfo.Add("PersonPaySumamt", MSettl.personPaySumamt);//个人负担总金额
- joSetlinfo.Add("AccountPaySumamt", MSettl.accountPaySumamt);//个人账户支出
- joSetlinfo.Add("PersonCashPay", MSettl.personCashPay);//个人现金支出
- joSetlinfo.Add("Balance", MSettl.balance);// 余额
- joSetlinfo.Add("AccountMutualAidAmount", "");//个人账户共济支付金额
- joSetlinfo.Add("OrganSettlementID", "");//医药机构结算ID
- joSetlinfo.Add("ClearingOrgan", MSettl.clearingOrgan);//清算经办机构
- joSetlinfo.Add("ClearingWay", MSettl.clearingWay);//清算方式
- joSetlinfo.Add("ClearingType", MSettl.clearingType);//清算类别
- joSetlinfo.Add("ValidFlag", 1);
- joSetlinfo.Add("BillType", 1);
- joSetlinfo.Add("ConfirmFlag", MSettl.confirmFlag);
- joSetlinfo.Add("MSGID", Global.curEvt.msgid);
- joSetlinfo.Add("AdmType", "3");
- joSetlinfo.Add("BillID", MPat.billID);
- joSetlinfo.Add("RecordID", MPat.recordID);
- joSetlinfo.Add("InterfaceDr", Global.inf.interfaceDr);
- joSetlinfo.Add("InsuranceAreaCode", MPat.insuplc_admdvs);
- joSetlinfo.Add("OccurTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
- joSetlinfo.Add("HospitalizationsDays", MSettl.hospitalizationsDays);
- joSetlinfo.Add("HospitalizationsTimes", MSettl.hospitalizationsTimes);
- joSetlinfo.Add("HISAdmTime", MSettl.hisAdmTime);
- joSetlinfo.Add("HISDischargeTime", MSettl.hisDischargeTime);
- joSetlinfo.Add("updateUserID", Global.user.ID);
- JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010089", joSetlinfo).ToString(), "通过订单号更新结算信息");
- if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
- {
- outParam = errMsg;
- return -1;
- }
- else
- {
- outParam = joSetlinfo.ToString();
- return 0;
- }
- }
- catch (Exception ex)
- {
- outParam = "插入结算信息:" + ex.Message;
- return -1;
- }
- }
- public void setPatientByMiRegInfo(JObject jo)
- {
- MPat.name = JsonHelper.getDestValue(jo, "data.PatientName");
- MPat.psn_no = JsonHelper.getDestValue(jo, "data.PersonalNO");
- MPat.certNO = JsonHelper.getDestValue(jo, "data.CertificateNO");
- MPat.IDNO = MPat.certNO;
- MPat.certType = JsonHelper.getDestValue(jo, "data.CertificateType");
- MPat.payToken = JsonHelper.getDestValue(jo, "data.payToken");
- MPat.insuplc_admdvs = JsonHelper.getDestValue(jo, "data.InsuranceAreaCode");
- }
- //获取入参,入参基本为类局部变量
- public int Get6301Inpar(out string outparam)
- {
- outparam = "";
- try
- {
- string errMsg;
- //查询登记信息
- if (mIS.queryRegisterInfo(4, out errMsg) != 0)
- {
- outparam = errMsg;
- return -1;
- }
- setPatientByMiRegInfo(JObject.Parse(errMsg));
- //获取其他入参
- JObject joInpar = new JObject();
- joInpar.Add("payOrdId", MPat.payOrdId);//待支付订单号
- joInpar.Add("payToken", MPat.payToken);//支付订单对应的token
- joInpar.Add("orgCodg", Global.inf.hospitalNO);//定点机构编码
- joInpar.Add("idNo", MPat.IDNO);//业务流水号 前端传入
- joInpar.Add("userName", MPat.name);
- joInpar.Add("idType", "01");
- joInpar.Add("expData", "");
- //JObject joData = new JObject();
- //joData.Add("data", joInpar);
- outparam = joInpar.ToString();
- return 0;
- }
- catch (Exception ex)
- {
- outparam = "Get6301Inpar:" + ex.Message;
- return -1;
- }
- finally
- {
- Global.writeLog("Get6301Inpar", "", outparam);
- }
- }
- private int MobilePayQuery(out string outPar)
- {
- string errMsg, M6301Inpar;
- outPar = "";
- //6301查询具体明细信息
- if (Get6301Inpar(out errMsg) != 0)
- {
- outPar = errMsg;
- return -1;
- }
- M6301Inpar = errMsg;
- JObject joM6301Rtn = invoker.invokeMPService("6301", M6301Inpar);
- if (JsonHelper.parseMPRtnValue(joM6301Rtn, out errMsg) != 0)
- {
- outPar = errMsg;
- return -1;
- }
- outPar = joM6301Rtn.ToString();
- return 0;
- }
- }
- }
|