|
@@ -0,0 +1,1588 @@
|
|
|
+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 MobilePay
|
|
|
+ {
|
|
|
+ private HisIrisServices hIS = new HisIrisServices();
|
|
|
+ private MIIrisServices mIS = new MIIrisServices();
|
|
|
+ private CenterBusiness cBus = new CenterBusiness();
|
|
|
+ private InvokeHelper invoker = new InvokeHelper();
|
|
|
+ private Patients MPat;
|
|
|
+ private Settlements MSettl;
|
|
|
+ private JArray jaFee;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ private JObject joParam;
|
|
|
+ private JObject joInsuAdmObj;
|
|
|
+
|
|
|
+ public MobilePay(string inpar, out string errMsg)
|
|
|
+ {
|
|
|
+ errMsg = "";
|
|
|
+ try
|
|
|
+ {
|
|
|
+ JObject joInpar = JObject.Parse(inpar);
|
|
|
+ joParam = JObject.Parse(JsonHelper.getDestValue(joInpar, "params[0]"));
|
|
|
+ joInsuAdmObj = JObject.Parse(JsonHelper.getDestValue(joInpar, "insuAdmObj"));
|
|
|
+ setPatientByInPar();
|
|
|
+ setSettlementsByInPar();
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ errMsg = "MobilePay异常:" + ex.Message;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private JObject OutpatientReg()
|
|
|
+ {
|
|
|
+ string diagnoses;
|
|
|
+ if (hIS.getPatDiagnoses(Global.pat, out diagnoses) != 0)
|
|
|
+ {
|
|
|
+ return JsonHelper.setExceptionJson(-1, "挂号", "获取诊断异常" + diagnoses);
|
|
|
+ }
|
|
|
+ JObject joHisRtnInfo = JObject.Parse(diagnoses);
|
|
|
+
|
|
|
+ JObject joRegInpar = new JObject();
|
|
|
+ string occurTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
+ joRegInpar.Add("psn_no", Global.pat.psn_no);
|
|
|
+ joRegInpar.Add("insutype", Global.pat.insuType);
|
|
|
+ joRegInpar.Add("begntime", JsonHelper.getDestValue(joHisRtnInfo, "mdtrtinfo.begntime"));
|
|
|
+ joRegInpar.Add("mdtrt_cert_type", "02");
|
|
|
+ joRegInpar.Add("mdtrt_cert_no", MPat.certNO);
|
|
|
+
|
|
|
+ joRegInpar.Add("ipt_otp_no", Global.pat.adm_Dr);
|
|
|
+ joRegInpar.Add("atddr_no", JsonHelper.getDestValue(joHisRtnInfo, "mdtrtinfo.atddr_no"));
|
|
|
+ joRegInpar.Add("dr_name", JsonHelper.getDestValue(joHisRtnInfo, "mdtrtinfo.chfpdr_name"));
|
|
|
+ joRegInpar.Add("dept_code", JsonHelper.getDestValue(joHisRtnInfo, "mdtrtinfo.adm_dept_codg"));
|
|
|
+ joRegInpar.Add("dept_name", JsonHelper.getDestValue(joHisRtnInfo, "mdtrtinfo.adm_dept_name"));
|
|
|
+ joRegInpar.Add("caty", "72");
|
|
|
+ JObject joReg = new JObject();
|
|
|
+ joReg.Add("data", joRegInpar);
|
|
|
+
|
|
|
+ JObject jo2201Rtn = invoker.invokeCenterService(TradeEnum.OutpatientRegistration, joReg);
|
|
|
+ string errMsg = "";
|
|
|
+ if (JsonHelper.parseCenterRtnValue(jo2201Rtn, out errMsg) != 0)
|
|
|
+ {
|
|
|
+ return JsonHelper.setExceptionJson(-1, "医保挂号", errMsg);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Global.pat.mdtrtID = JsonHelper.getDestValue(jo2201Rtn, "output.data.mdtrt_id");
|
|
|
+ }
|
|
|
+
|
|
|
+ return jo2201Rtn;
|
|
|
+ }
|
|
|
+ public int MobilePaySettlement(out string outPar)
|
|
|
+ {
|
|
|
+ string errMsg, patInfo, M6201Inpar, M6202Inpar;
|
|
|
+
|
|
|
+ outPar = "";
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ if (GetPatientInfo(out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outPar = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ patInfo = errMsg;
|
|
|
+ JObject jo1194Rtn = invoker.invokeCenterService(TradeEnum.PatientInfo, JObject.Parse(patInfo));
|
|
|
+ if (JsonHelper.parseCenterRtnValue(jo1194Rtn, out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outPar = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ setPatientInsuInfo(jo1194Rtn);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (Get6201Inpar(out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outPar = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ M6201Inpar = errMsg;
|
|
|
+ JObject joM6201Rtn = invoker.invokeMPService("6201", errMsg);
|
|
|
+ if (JsonHelper.parseMPRtnValue(joM6201Rtn, out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outPar = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ JObject joEncData = JObject.Parse(errMsg);
|
|
|
+
|
|
|
+ Global.writeLog("返回值:" + errMsg);
|
|
|
+
|
|
|
+ setPatientBy6201Rtn(joEncData);
|
|
|
+
|
|
|
+ if (saveToMi(out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outPar = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (Get6202Inpar(JObject.Parse(M6201Inpar), out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outPar = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ M6202Inpar = errMsg;
|
|
|
+ JObject joM6202Rtn = invoker.invokeMPService("6202", M6202Inpar);
|
|
|
+ if (JsonHelper.parseMPRtnValue(joM6202Rtn, out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outPar = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ joEncData = JObject.Parse(errMsg);
|
|
|
+ Global.writeLog(JsonHelper.Compress(joEncData));
|
|
|
+
|
|
|
+ setSettlementsBy6202Rtn(joEncData);
|
|
|
+ MSettl.confirmFlag = 0;
|
|
|
+
|
|
|
+ if (saveSettlement(out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outPar = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ JObject joPreSettl = JObject.Parse(JsonHelper.getDestValue(joEncData, "extData.preSetl"));
|
|
|
+
|
|
|
+ JObject joTmp = new JObject();
|
|
|
+ joTmp.Add("insutype", MPat.insuType);
|
|
|
+ joTmp.Add("psn_no", MPat.psn_no);
|
|
|
+ joTmp.Add("insuplc_admdvs", MPat.insuplc_admdvs);
|
|
|
+ joTmp.Add("mdtrtId", MPat.mdtrtID);
|
|
|
+ joTmp.Add("mdtrt_id", MPat.mdtrtID);
|
|
|
+ joPreSettl.Add("setl_id", MPat.payOrdId);
|
|
|
+ joTmp.Add("mdtrt_cert_type", JsonHelper.getDestValue(joPreSettl, "mdtrt_cert_type"));
|
|
|
+ joTmp.Add("mdtrt_cert_no", JsonHelper.getDestValue(joPreSettl, "certno"));
|
|
|
+ joTmp.Add("med_type", JsonHelper.getDestValue(joPreSettl, "med_type"));
|
|
|
+
|
|
|
+ if (returnMPSettlementInfo(joTmp, joPreSettl, out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outPar = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ outPar = errMsg;
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ outPar = ex.Message;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ public int MobilePayConfirmSettlement(out string outPar)
|
|
|
+ {
|
|
|
+ string errMsg, M6301Inpar;
|
|
|
+ outPar = "";
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ JObject joEncData = JObject.Parse((errMsg));
|
|
|
+ Global.writeLog(JsonHelper.Compress(joEncData));
|
|
|
+
|
|
|
+ setSettlementsBy6301Rtn(joEncData);
|
|
|
+ MSettl.confirmFlag = 1;
|
|
|
+
|
|
|
+ if (updateSettlement(out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outPar = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+
|
|
|
+ outPar = JsonHelper.setExceptionJson(0, "云医保平台", "确认成功!").ToString();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ outPar = ex.Message;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ public int MobilePayCancelSettlement(out string outPar)
|
|
|
+ {
|
|
|
+ string errMsg;
|
|
|
+ outPar = "";
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+
|
|
|
+ if (Get6203Inpar(out errMsg) != 0)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ YH6203Inpar = errMsg;
|
|
|
+ JObject jo6203Rtn = invoker.invokeMPService("6203", M6203Inpar);
|
|
|
+
|
|
|
+ if (ParseCenterRtnValue(jo6203Rtn, out errMsg) != 0)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ string newSettlID = JsonHelper.getDestValue(jo6203Rtn,"");
|
|
|
+
|
|
|
+ cancleSettlement(newSettlID,out errMsg);
|
|
|
+
|
|
|
+ }
|
|
|
+ **/
|
|
|
+
|
|
|
+
|
|
|
+ if (cancleSettlement(MPat.settlID, out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outPar = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ outPar = errMsg;
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #region 赋值MPat,Msettle结构体
|
|
|
+ public void setPatientByInPar()
|
|
|
+ {
|
|
|
+ MPat.adm_Dr = int.Parse(JsonHelper.getDestValue(joParam, "admID"));
|
|
|
+ Global.pat.adm_Dr = MPat.adm_Dr;
|
|
|
+ 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");
|
|
|
+ MPat.settlID = JsonHelper.getDestValue(joInsuAdmObj, "setl_id");
|
|
|
+ Global.pat.mdtrtID = MPat.mdtrtID;
|
|
|
+ }
|
|
|
+ public void setPatientBy6201Rtn(JObject jo)
|
|
|
+ {
|
|
|
+ MPat.payOrdId = JsonHelper.getDestValue(jo, "payOrdId");
|
|
|
+ MPat.payToken = JsonHelper.getDestValue(jo, "payToken");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ MPat.mdtrtID = JsonHelper.getDestValue(jo, "extData.mdtrtId");
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPatientByHisBaseInfo(JObject jo)
|
|
|
+ {
|
|
|
+ MPat.name = JsonHelper.getDestValue(jo, "result.patName");
|
|
|
+ MPat.brdy = JsonHelper.getDestValue(jo, "result.patBirthdate");
|
|
|
+ MPat.gend = JsonHelper.getDestValue(jo, "result.patSex");
|
|
|
+ MPat.age = JsonHelper.getDestValue(jo, "result.Age");
|
|
|
+ MPat.naty = JsonHelper.getDestValue(jo, "result.naty");
|
|
|
+ MPat.certNO = JsonHelper.getDestValue(jo, "result.credNo");
|
|
|
+ MPat.IDNO = MPat.certNO;
|
|
|
+ MPat.certType = JsonHelper.getDestValue(jo, "result.credCode");
|
|
|
+ }
|
|
|
+
|
|
|
+ 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 void setPatientInsuInfo(JObject jo)
|
|
|
+ {
|
|
|
+ MPat.insuplc_admdvs = JsonHelper.getDestValue(jo, "output.insuinfo[0].insuplc_admdvs");
|
|
|
+ MPat.psn_no = JsonHelper.getDestValue(jo, "output.baseinfo.psn_no");
|
|
|
+ MPat.insuType = JsonHelper.getDestValue(jo, "output.insuinfo[0].insutype");
|
|
|
+ Global.pat.insuplc_admdvs = MPat.insuplc_admdvs;
|
|
|
+ Global.pat.psn_no = MPat.psn_no;
|
|
|
+ Global.pat.insuType = MPat.insuType;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPatientByDiagnoseInfo(JObject jo)
|
|
|
+ {
|
|
|
+ MPat.admAttendDoctorNO = JsonHelper.getDestValue(jo, "atddr_no");
|
|
|
+ MPat.admDiagCode = JsonHelper.getDestValue(jo, "dscg_maindiag_code");
|
|
|
+ MPat.admDiagName = JsonHelper.getDestValue(jo, "dscg_maindiag_name");
|
|
|
+ MPat.AdmInDepCode = JsonHelper.getDestValue(jo, "adm_dept_codg");
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setSettlementsBy6202Rtn(JObject jo)
|
|
|
+ {
|
|
|
+ MSettl.settlID = JsonHelper.getDestValue(jo, "payOrdId");
|
|
|
+ MPat.payOrdId = MSettl.settlID;
|
|
|
+ MSettl.ordStas = JsonHelper.getDestValue(jo, "ordStas");
|
|
|
+ MSettl.sumamt = getDecimalFee(jo, "feeSumamt");
|
|
|
+ MSettl.personCashPay = getDecimalFee(jo, "ownPayAmt");
|
|
|
+ MSettl.accountPaySumamt = getDecimalFee(jo, "psnAcctPay");
|
|
|
+ MSettl.fundPaySumamt = getDecimalFee(jo, "fundPay");
|
|
|
+ MSettl.deposit = getDecimalFee(jo, "deposit");
|
|
|
+ MSettl.clearingOrgan = JsonHelper.getDestValue(jo, "extData.preSetl.clr_optins");
|
|
|
+ MSettl.clearingType = JsonHelper.getDestValue(jo, "extData.preSetl.clr_type");
|
|
|
+ MSettl.clearingWay = JsonHelper.getDestValue(jo, "extData.preSetl.clr_way");
|
|
|
+ MSettl.civilserviceAllowancePay = getDecimalFee(jo, "extData.preSetl.cvlserv_pay");
|
|
|
+ MSettl.ownPayAmount = getDecimalFee(jo, "extData.preSetl.fulamt_ownpay_amt");
|
|
|
+ MSettl.overLimitAmountmt = getDecimalFee(jo, "extData.preSetl.overlmt_selfpay");
|
|
|
+ MSettl.preSelfPayAmount = getDecimalFee(jo, "extData.preSetl.preselfpay_amt");
|
|
|
+ MSettl.inPolicyRangeAmount = getDecimalFee(jo, "extData.preSetl.inscp_scp_amt");
|
|
|
+ MSettl.actualPayDeductible = getDecimalFee(jo, "extData.preSetl.act_pay_dedc");
|
|
|
+ MSettl.healthInsurancePay = getDecimalFee(jo, "extData.preSetl.hifp_pay");
|
|
|
+ MSettl.healthInsuranceRatio = getDecimalFee(jo, "extData.preSetl.pool_prop_selfpay");
|
|
|
+ MSettl.enterpriseSupplementPay = getDecimalFee(jo, "extData.preSetl.hifes_pay");
|
|
|
+ MSettl.seriousIllnessPay = getDecimalFee(jo, "extData.preSetl.hifmi_pay");
|
|
|
+ MSettl.largeExpensesSupplementPay = getDecimalFee(jo, "extData.preSetl.hifob_pay");
|
|
|
+ MSettl.medicalAssistPay = getDecimalFee(jo, "extData.preSetl.maf_pay");
|
|
|
+ MSettl.hospitalPartAmount = getDecimalFee(jo, "extData.preSetl.hosp_part_amt");
|
|
|
+ MSettl.otherPay = getDecimalFee(jo, "extData.preSetl.oth_pay");
|
|
|
+ MSettl.personPaySumamt = getDecimalFee(jo, "extData.preSetl.psn_part_amt");
|
|
|
+ MSettl.balance = getDecimalFee(jo, "extData.preSetl.balc");
|
|
|
+ MSettl.accountMutualAidAmount = getDecimalFee(jo, "extData.preSetl.acct_mulaid_pay");
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setSettlementsBy6301Rtn(JObject joRtn)
|
|
|
+ {
|
|
|
+ JObject jo = JObject.Parse(JsonHelper.getDestValue(joRtn, "extData.setlinfo"));
|
|
|
+
|
|
|
+ MPat.settlID = JsonHelper.getDestValue(jo, "setlId");
|
|
|
+ MPat.psn_no = JsonHelper.getDestValue(jo, "psnNo");
|
|
|
+ MPat.naty = JsonHelper.getDestValue(jo, "naty");
|
|
|
+ MPat.name = JsonHelper.getDestValue(jo, "psnName");
|
|
|
+ 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, "psnType");
|
|
|
+ MPat.mdtrtcertType = JsonHelper.getDestValue(jo, "mdtrtCertType");
|
|
|
+ MPat.medType = JsonHelper.getDestValue(jo, "medType");
|
|
|
+ MPat.insuplc_admdvs = JsonHelper.getDestValue(joRtn, "extData.insuplcAdmdvs");
|
|
|
+
|
|
|
+ MPat.payOrdId = JsonHelper.getDestValue(joRtn, "payOrdId");
|
|
|
+ MSettl.ordStas = JsonHelper.getDestValue(joRtn, "ordStas");
|
|
|
+ MSettl.sumamt = getDecimalFee(joRtn, "feeSumamt");
|
|
|
+
|
|
|
+ MSettl.personCashPay = getDecimalFee(jo, "psnCashPay");
|
|
|
+ MSettl.accountPaySumamt = getDecimalFee(jo, "acctPay");
|
|
|
+ MSettl.fundPaySumamt = getDecimalFee(jo, "fundPaySumamt");
|
|
|
+
|
|
|
+
|
|
|
+ MSettl.clearingOrgan = JsonHelper.getDestValue(jo, "clrOptins");
|
|
|
+ MSettl.clearingType = JsonHelper.getDestValue(jo, "clrType");
|
|
|
+ MSettl.clearingWay = JsonHelper.getDestValue(jo, "clrWay");
|
|
|
+ MSettl.civilserviceAllowancePay = getDecimalFee(jo, "cvlservPay");
|
|
|
+ MSettl.ownPayAmount = getDecimalFee(jo, "fulamtOwnpayAmt");
|
|
|
+ MSettl.overLimitAmountmt = getDecimalFee(jo, "overlmtSelfpay");
|
|
|
+ MSettl.preSelfPayAmount = getDecimalFee(jo, "preselfpayAmt");
|
|
|
+ MSettl.inPolicyRangeAmount = getDecimalFee(jo, "inscpScpAmt");
|
|
|
+ MSettl.actualPayDeductible = getDecimalFee(jo, "actPayDedc");
|
|
|
+ MSettl.healthInsurancePay = getDecimalFee(jo, "hifpPay");
|
|
|
+ MSettl.healthInsuranceRatio = getDecimalFee(jo, "poolPropSelfpay");
|
|
|
+ MSettl.enterpriseSupplementPay = getDecimalFee(jo, "hifesPay");
|
|
|
+ MSettl.seriousIllnessPay = getDecimalFee(jo, "hifmiPay");
|
|
|
+ MSettl.largeExpensesSupplementPay = getDecimalFee(jo, "hifobPay");
|
|
|
+ MSettl.medicalAssistPay = getDecimalFee(jo, "mafPay");
|
|
|
+ MSettl.hospitalPartAmount = getDecimalFee(jo, "hospPartAmt");
|
|
|
+ MSettl.otherPay = getDecimalFee(jo, "othPay");
|
|
|
+ MSettl.personPaySumamt = getDecimalFee(jo, "psnPartAmt");
|
|
|
+ MSettl.balance = getDecimalFee(jo, "balc");
|
|
|
+ MSettl.accountMutualAidAmount = getDecimalFee(jo, "acctMulaidPay");
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setSettlementsByInPar()
|
|
|
+ {
|
|
|
+ MSettl.clearingWay = JsonHelper.getDestValue(joInsuAdmObj, "psnSetlway");
|
|
|
+ MSettl.settlID = JsonHelper.getDestValue(joInsuAdmObj, "payOrdId");
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 组织入参
|
|
|
+ public int GetPatientInfo(out string outparam)
|
|
|
+ {
|
|
|
+ string errMsg = "";
|
|
|
+ outparam = "";
|
|
|
+ try
|
|
|
+ {
|
|
|
+ JObject joInpar = new JObject();
|
|
|
+
|
|
|
+ if (hIS.GetHisPatBaseInfo(out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outparam = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ setPatientByHisBaseInfo(JObject.Parse(errMsg));
|
|
|
+
|
|
|
+ joInpar.Add("mdtrt_cert_type", "02");
|
|
|
+ joInpar.Add("mdtrt_cert_no", MPat.certNO);
|
|
|
+ joInpar.Add("card_sn", "");
|
|
|
+ joInpar.Add("begntime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
|
|
+ joInpar.Add("psn_cert_type", "01");
|
|
|
+ joInpar.Add("certno", MPat.certNO);
|
|
|
+ joInpar.Add("psn_name", MPat.name);
|
|
|
+ JObject joData = new JObject();
|
|
|
+ joData.Add("data", joInpar);
|
|
|
+ outparam = joData.ToString();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ outparam = "GetPatientInfo:" + ex.Message;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ finally
|
|
|
+ {
|
|
|
+ Global.writeLog("GetPatientInfo", "", outparam);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public int Get6201Inpar(out string outparam)
|
|
|
+ {
|
|
|
+ string errMsg = "";
|
|
|
+ outparam = "";
|
|
|
+ try
|
|
|
+ {
|
|
|
+ JObject joInpar = new JObject();
|
|
|
+
|
|
|
+ if (hIS.GetHisPatBaseInfo(out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outparam = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ setPatientByHisBaseInfo(JObject.Parse(errMsg));
|
|
|
+ JObject joPatBaseInfo = JObject.Parse(JsonHelper.getDestValue(JObject.Parse(errMsg), "result"));
|
|
|
+
|
|
|
+ if (getDiagnoses(out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outparam = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ JObject joDiagnoses = JObject.Parse(errMsg);
|
|
|
+ JArray jaDiseinfoList = JArray.Parse(JsonHelper.getDestValue(joDiagnoses, "diseinfoList"));
|
|
|
+ JObject joMdtrtinfo = JObject.Parse(JsonHelper.getDestValue(joDiagnoses, "mdtrtinfo"));
|
|
|
+ setPatientByDiagnoseInfo(joMdtrtinfo);
|
|
|
+
|
|
|
+ if (GetFee(out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outparam = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ JObject joFee = JObject.Parse(errMsg);
|
|
|
+ JArray jaFeedetailList = JArray.Parse(JsonHelper.getDestValue(joFee, "feedetailList"));
|
|
|
+ for (int i = 0; i < jaFeedetailList.Count; i++)
|
|
|
+ {
|
|
|
+ JObject joTmp = new JObject();
|
|
|
+ joTmp.Add("act_purc_pric", jaFeedetailList[i]["pric"]);
|
|
|
+ joTmp.Add("sin_dos", jaFeedetailList[i]["sinDosDscr"]);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ ((JObject)jaFeedetailList[i]).Property("rxno").Remove();
|
|
|
+
|
|
|
+ ((JObject)jaFeedetailList[i]).Property("sinDosDscr").Remove();
|
|
|
+ ((JObject)jaFeedetailList[i]).Property("usedFrquDscr").Remove();
|
|
|
+ ((JObject)jaFeedetailList[i]).Property("prdDays").Remove();
|
|
|
+ ((JObject)jaFeedetailList[i]).Property("medcWayDscr").Remove();
|
|
|
+
|
|
|
+ ((JObject)jaFeedetailList[i]).Property("acordDeptCodg").Remove();
|
|
|
+ ((JObject)jaFeedetailList[i]).Property("acordDeptName").Remove();
|
|
|
+ ((JObject)jaFeedetailList[i]).Property("ordersDrCode").Remove();
|
|
|
+ ((JObject)jaFeedetailList[i]).Property("ordersDrName").Remove();
|
|
|
+ ((JObject)jaFeedetailList[i]).Property("tcmdrugUsedWay").Remove();
|
|
|
+ ((JObject)jaFeedetailList[i]).Property("etipFlag").Remove();
|
|
|
+ ((JObject)jaFeedetailList[i]).Property("etipHospCode").Remove();
|
|
|
+ ((JObject)jaFeedetailList[i]).Property("dscgTkdrugFlag").Remove();
|
|
|
+ ((JObject)jaFeedetailList[i]).Property("matnFeeFlag").Remove();
|
|
|
+ ((JObject)jaFeedetailList[i]).Property("initFeedetlSn").Remove();
|
|
|
+ ((JObject)jaFeedetailList[i]).Property("medType").Remove();
|
|
|
+ ((JObject)jaFeedetailList[i]).Property("memo").Remove();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ ((JObject)jaFeedetailList[i]).Property("combNo").Remove();
|
|
|
+
|
|
|
+ jaFeedetailList[i]["expContent"] = joTmp.ToString();
|
|
|
+ jaFeedetailList[i]["medType"] = JsonHelper.getDestValue(joInsuAdmObj, "medType");
|
|
|
+ jaFeedetailList[i]["psnNo"] = MPat.psn_no;
|
|
|
+ }
|
|
|
+
|
|
|
+ joInpar.Add("orgCodg", Global.inf.hospitalNO);
|
|
|
+
|
|
|
+ joInpar.Add("psnNo", MPat.psn_no);
|
|
|
+ joInpar.Add("insutype", MPat.insuType);
|
|
|
+ joInpar.Add("medOrgOrd", MPat.recordID);
|
|
|
+ joInpar.Add("initRxOrd", JsonHelper.getDestValue(joInsuAdmObj, "initRxOrd"));
|
|
|
+ joInpar.Add("rxCircFlag", JsonHelper.getDestValue(joInsuAdmObj, "rxCircFlag"));
|
|
|
+ MSettl.settlTime = Convert.ToDateTime(JsonHelper.getDestValue(joMdtrtinfo, "begntime"));
|
|
|
+ joInpar.Add("begntime", JsonHelper.getDestValue(joMdtrtinfo, "begntime"));
|
|
|
+ joInpar.Add("idNo", JsonHelper.getDestValue(joPatBaseInfo, "credNo"));
|
|
|
+ joInpar.Add("userName", JsonHelper.getDestValue(joPatBaseInfo, "patName"));
|
|
|
+ joInpar.Add("idType", JsonHelper.getDestValue(joPatBaseInfo, "credCode"));
|
|
|
+ joInpar.Add("ecToken", JsonHelper.getDestValue(joInsuAdmObj, "ecToken"));
|
|
|
+ joInpar.Add("insuCode", Global.inf.areaCode);
|
|
|
+ joInpar.Add("iptOtpNo", JsonHelper.getDestValue(joMdtrtinfo, "ipt_no"));
|
|
|
+ joInpar.Add("atddrNo", JsonHelper.getDestValue(joMdtrtinfo, "atddr_no"));
|
|
|
+ joInpar.Add("drName", JsonHelper.getDestValue(joMdtrtinfo, "chfpdr_name"));
|
|
|
+ joInpar.Add("deptCode", JsonHelper.getDestValue(joMdtrtinfo, "adm_dept_codg"));
|
|
|
+ joInpar.Add("deptName", JsonHelper.getDestValue(joMdtrtinfo, "adm_dept_name"));
|
|
|
+ joInpar.Add("caty", "A10");
|
|
|
+
|
|
|
+ joInpar.Add("medType", MPat.medType);
|
|
|
+ joInpar.Add("feeType", JsonHelper.getDestValue(joInsuAdmObj, "feeType"));
|
|
|
+ joInpar.Add("medfeeSumamt", JsonHelper.getDestValue(joFee, "medfeeSumamt"));
|
|
|
+ joInpar.Add("acctUsedFlag", JsonHelper.getDestValue(joInsuAdmObj, "acctUsedFlag"));
|
|
|
+ joInpar.Add("mainCondDscr", JsonHelper.getDestValue(joMdtrtinfo, "mainCondDscr"));
|
|
|
+ joInpar.Add("diseCodg", JsonHelper.getDestValue(joMdtrtinfo, "diseCodg"));
|
|
|
+ joInpar.Add("diseName", JsonHelper.getDestValue(joMdtrtinfo, "diseName"));
|
|
|
+ joInpar.Add("psnSetlway", JsonHelper.getDestValue(joInsuAdmObj, "psnSetlway"));
|
|
|
+ joInpar.Add("chrgBchno", JsonHelper.getDestValue(joFee, "chrgBchno"));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ joInpar.Add("gesoVal", JsonHelper.getDestValue(joMdtrtinfo, "gesoVal"));
|
|
|
+ joInpar.Add("fetts", JsonHelper.getDestValue(joMdtrtinfo, "fetts"));
|
|
|
+ joInpar.Add("fetusCnt", JsonHelper.getDestValue(joMdtrtinfo, "fetusCnt"));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ joInpar.Add("matnType", JsonHelper.getDestValue(joMdtrtinfo, "matnType"));
|
|
|
+ joInpar.Add("expContent", JsonHelper.getDestValue(joInsuAdmObj, "expContent"));
|
|
|
+
|
|
|
+ joInpar.Add("diseinfoList", jaDiseinfoList);
|
|
|
+ joInpar.Add("feedetailList", jaFeedetailList);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ joInpar.Add("payAuthNo", JsonHelper.getDestValue(joInsuAdmObj, "payAuthNo"));
|
|
|
+ joInpar.Add("uldLatlnt", JsonHelper.getDestValue(joInsuAdmObj, "uldLatlnt"));
|
|
|
+ joInpar.Add("mdtrtCertType", JsonHelper.getDestValue(joInsuAdmObj, "mdtrtCertType"));
|
|
|
+ joInpar.Add("insuplcAdmdvs", MPat.insuplc_admdvs);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ outparam = joInpar.ToString();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+
|
|
|
+ outparam = "Get6201Inpar:" + ex.Message;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ finally
|
|
|
+ {
|
|
|
+ Global.writeLog("Get6201Inpar", "", outparam);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public int Get6202Inpar(JObject joM6201Inpar, out string outparam)
|
|
|
+ {
|
|
|
+ outparam = "";
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ JObject joInpar = new JObject();
|
|
|
+ joInpar.Add("payAuthNo", MPat.payAuthNo);
|
|
|
+ joInpar.Add("payOrdId", MPat.payOrdId);
|
|
|
+ joInpar.Add("payToken", MPat.payToken);
|
|
|
+ joInpar.Add("orgCodg", Global.inf.hospitalNO);
|
|
|
+ joInpar.Add("orgBizSer", DateTime.Now.ToString("yyyyMMddHHmmssffff"));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ joInpar.Add("chrgBchno", JsonHelper.getDestValue(joM6201Inpar, "chrgBchno"));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ outparam = joInpar.ToString();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ outparam = "Get6202Inpar:" + ex.Message;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ finally
|
|
|
+ {
|
|
|
+ Global.writeLog("Get6202Inpar", "", outparam);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public int Get6203Inpar(out string outparam)
|
|
|
+ {
|
|
|
+ string errMsg = "";
|
|
|
+ outparam = "";
|
|
|
+ try
|
|
|
+ {
|
|
|
+ JObject joInpar = new JObject();
|
|
|
+
|
|
|
+ if (QuerySettleInfo(out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outparam = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ JObject joRtn = JObject.Parse(errMsg);
|
|
|
+ JObject joSettl = JObject.Parse(JsonHelper.getDestValue(joRtn, "data"));
|
|
|
+
|
|
|
+
|
|
|
+ joInpar.Add("payOrdId", JsonHelper.getDestValue(joSettl, "SettlementID"));
|
|
|
+ joInpar.Add("appRefdSn", JsonHelper.getDestValue(joSettl, ""));
|
|
|
+ joInpar.Add("appRefdTime", JsonHelper.getDestValue(joSettl, ""));
|
|
|
+ joInpar.Add("totlRefdAmt", JsonHelper.getDestValue(joSettl, "Sumamt"));
|
|
|
+ joInpar.Add("psnAcctRefdAmt", JsonHelper.getDestValue(joSettl, "AccountPaySumamt"));
|
|
|
+ joInpar.Add("fundRefdAmt", JsonHelper.getDestValue(joSettl, "FundPaySumamt"));
|
|
|
+ joInpar.Add("cashRefdAmt", JsonHelper.getDestValue(joInsuAdmObj, "PersonCashPay"));
|
|
|
+ joInpar.Add("ecToken", MPat.token);
|
|
|
+ joInpar.Add("refdType", "ALL");
|
|
|
+ joInpar.Add("expData", "");
|
|
|
+ joInpar.Add("payAuthNo", MPat.payAuthNo);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ outparam = joInpar.ToString();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+
|
|
|
+ outparam = "Get6203Inpar:" + ex.Message;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ finally
|
|
|
+ {
|
|
|
+ Global.writeLog("Get6203Inpar", "", outparam);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ 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);
|
|
|
+ joInpar.Add("orgCodg", Global.inf.hospitalNO);
|
|
|
+ joInpar.Add("idNo", MPat.IDNO);
|
|
|
+ joInpar.Add("userName", MPat.name);
|
|
|
+ joInpar.Add("idType", "01");
|
|
|
+ joInpar.Add("expData", "");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ outparam = joInpar.ToString();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ outparam = "Get6301Inpar:" + ex.Message;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ finally
|
|
|
+ {
|
|
|
+ Global.writeLog("Get6301Inpar", "", outparam);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public int Get6401Inpar(out string outparam)
|
|
|
+ {
|
|
|
+ string errMsg = "";
|
|
|
+ outparam = "";
|
|
|
+ try
|
|
|
+ {
|
|
|
+ JObject joInpar = new JObject();
|
|
|
+
|
|
|
+ if (QuerySettleInfo(out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outparam = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ JObject joRtn = JObject.Parse(errMsg);
|
|
|
+ JObject joSettl = JObject.Parse(JsonHelper.getDestValue(joRtn, "data"));
|
|
|
+
|
|
|
+
|
|
|
+ joInpar.Add("payOrdId", JsonHelper.getDestValue(joSettl, "SettlementID"));
|
|
|
+ joInpar.Add("appRefdSn", JsonHelper.getDestValue(joSettl, ""));
|
|
|
+ joInpar.Add("appRefdTime", JsonHelper.getDestValue(joSettl, ""));
|
|
|
+ joInpar.Add("totlRefdAmt", JsonHelper.getDestValue(joSettl, "Sumamt"));
|
|
|
+ joInpar.Add("psnAcctRefdAmt", JsonHelper.getDestValue(joSettl, "AccountPaySumamt"));
|
|
|
+ joInpar.Add("fundRefdAmt", JsonHelper.getDestValue(joSettl, "FundPaySumamt"));
|
|
|
+ joInpar.Add("cashRefdAmt", JsonHelper.getDestValue(joInsuAdmObj, "PersonCashPay"));
|
|
|
+ joInpar.Add("ecToken", MPat.token);
|
|
|
+ joInpar.Add("refdType", "ALL");
|
|
|
+ joInpar.Add("expData", "");
|
|
|
+ joInpar.Add("payAuthNo", MPat.payAuthNo);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ outparam = joInpar.ToString();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+
|
|
|
+ outparam = "Get6203Inpar:" + ex.Message;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ finally
|
|
|
+ {
|
|
|
+ Global.writeLog("Get6203Inpar", "", outparam);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 诊断
|
|
|
+
|
|
|
+ public int getDiagnoses(out string errMsg)
|
|
|
+ {
|
|
|
+ errMsg = "";
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ string outparam = "";
|
|
|
+ if (hIS.getPatDiagnoses(MPat, out outparam) != 0)
|
|
|
+ {
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ JObject joRtn = JObject.Parse(outparam);
|
|
|
+ JObject joMdtrtInfo = JObject.Parse(JsonHelper.getDestValue(joRtn, "mdtrtinfo"));
|
|
|
+ JArray jaDiagnoses = JArray.Parse(JsonHelper.getDestValue(joRtn, "diseinfo"));
|
|
|
+
|
|
|
+
|
|
|
+ JArray jaRow = new JArray();
|
|
|
+ for (int i = 0; i < jaDiagnoses.Count; i++)
|
|
|
+ {
|
|
|
+ JObject joTmp = new JObject();
|
|
|
+ joTmp.Add("diagType", jaDiagnoses[i]["diag_type"]);
|
|
|
+ joTmp.Add("diagSrtNo", jaDiagnoses[i]["diag_srt_no"]);
|
|
|
+ joTmp.Add("diagCode", jaDiagnoses[i]["diag_code"]);
|
|
|
+ joTmp.Add("diagName", jaDiagnoses[i]["diag_name"]);
|
|
|
+ joTmp.Add("diagDept", jaDiagnoses[i]["diag_dept"]);
|
|
|
+ joTmp.Add("diseDorNo", jaDiagnoses[i]["dise_dor_no"]);
|
|
|
+ joTmp.Add("diseDorName", jaDiagnoses[i]["dise_dor_name"]);
|
|
|
+ joTmp.Add("diagTime", jaDiagnoses[i]["diag_time"]);
|
|
|
+ joTmp.Add("valiFlag", "1");
|
|
|
+ jaRow.Add(joTmp);
|
|
|
+ }
|
|
|
+ JObject joDiagRow = new JObject();
|
|
|
+ joDiagRow.Add("diseinfoList", jaRow);
|
|
|
+ joDiagRow.Add("mdtrtinfo", joMdtrtInfo);
|
|
|
+ outparam = joDiagRow.ToString();
|
|
|
+ errMsg = outparam;
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ errMsg = "getDiagnoses:" + ex.Message;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 费用
|
|
|
+ private int GetFee(out string outparam)
|
|
|
+ {
|
|
|
+ string hisFee, chrgBchno = "";
|
|
|
+ JObject jo = new JObject();
|
|
|
+ JObject joRow = new JObject();
|
|
|
+ JArray jaRow = new JArray();
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ if (hIS.getHisFee(MPat, out hisFee) != 0)
|
|
|
+ {
|
|
|
+ outparam = hisFee;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ JObject joFee = JObject.Parse(hisFee);
|
|
|
+
|
|
|
+
|
|
|
+ JObject joHisFee = JObject.Parse(hisFee);
|
|
|
+ if (mIS.convertHisFeeWithInsuCodeOfMobilePay(MPat, joHisFee, out outparam) != 0)
|
|
|
+ {
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ JArray jaFeeDetail = JArray.Parse(JsonHelper.getDestValue(JObject.Parse(outparam), "data"));
|
|
|
+ jaFee = (JArray)jaFeeDetail.DeepClone();
|
|
|
+ decimal sumFee = 0;
|
|
|
+
|
|
|
+ for (int i = 0; i < jaFeeDetail.Count; i++)
|
|
|
+ {
|
|
|
+ decimal cnt = decimal.Parse(jaFeeDetail[i]["cnt"].ToString());
|
|
|
+ decimal pric = decimal.Parse(jaFeeDetail[i]["pric"].ToString());
|
|
|
+ decimal sumamt = decimal.Parse(jaFeeDetail[i]["det_item_fee_sumamt"].ToString());
|
|
|
+ sumFee = sumFee + sumamt;
|
|
|
+
|
|
|
+ JObject joTmp = new JObject();
|
|
|
+ joTmp.Add("feedetlSn", jaFeeDetail[i]["feedetl_sn"]);
|
|
|
+
|
|
|
+
|
|
|
+ chrgBchno = jaFeeDetail[i]["chrg_bchno"].ToString();
|
|
|
+ joTmp.Add("chrgBchno", jaFeeDetail[i]["chrg_bchno"]);
|
|
|
+ joTmp.Add("diseCodg", "");
|
|
|
+ joTmp.Add("rxno", jaFeeDetail[i]["rxno"]);
|
|
|
+ joTmp.Add("rxCircFlag", jaFeeDetail[i]["rx_circ_flag"]);
|
|
|
+ joTmp.Add("feeOcurTime", jaFeeDetail[i]["fee_ocur_time"]);
|
|
|
+ joTmp.Add("medListCodg", jaFeeDetail[i]["med_list_codg"]);
|
|
|
+ joTmp.Add("medinsListCodg", jaFeeDetail[i]["medins_list_codg"]);
|
|
|
+ joTmp.Add("detItemFeeSumamt", sumamt.ToString("#0.00"));
|
|
|
+ joTmp.Add("cnt", cnt.ToString("#0.0000"));
|
|
|
+ joTmp.Add("pric", pric.ToString("#0.000000"));
|
|
|
+ joTmp.Add("sinDosDscr", jaFeeDetail[i]["sin_dos_dscr"]);
|
|
|
+ joTmp.Add("usedFrquDscr", jaFeeDetail[i]["used_frqu_dscr"]);
|
|
|
+ joTmp.Add("prdDays", jaFeeDetail[i]["prd_days"]);
|
|
|
+ joTmp.Add("medcWayDscr", jaFeeDetail[i]["medc_way_dscr"]);
|
|
|
+ joTmp.Add("bilgDeptCodg", jaFeeDetail[i]["bilg_dept_codg"]);
|
|
|
+ joTmp.Add("bilgDeptName", jaFeeDetail[i]["bilg_dept_name"]);
|
|
|
+ joTmp.Add("bilgDrCodg", jaFeeDetail[i]["bilg_dr_codg"]);
|
|
|
+ joTmp.Add("bilgDrName", jaFeeDetail[i]["bilg_dr_name"]);
|
|
|
+ joTmp.Add("acordDeptCodg", jaFeeDetail[i]["acord_dept_codg"]);
|
|
|
+ joTmp.Add("acordDeptName", jaFeeDetail[i]["acord_dept_name"]);
|
|
|
+ joTmp.Add("ordersDrCode", jaFeeDetail[i]["orders_dr_code"]);
|
|
|
+ joTmp.Add("ordersDrName", jaFeeDetail[i]["orders_dr_name"]);
|
|
|
+ joTmp.Add("hospApprFlag", jaFeeDetail[i]["hosp_appr_flag"]);
|
|
|
+ joTmp.Add("tcmdrugUsedWay", jaFeeDetail[i]["tcmdrug_used_way"]);
|
|
|
+ joTmp.Add("etipFlag", jaFeeDetail[i]["etip_flag"]);
|
|
|
+ joTmp.Add("etipHospCode", jaFeeDetail[i]["etip_hosp_code"]);
|
|
|
+ joTmp.Add("dscgTkdrugFlag", jaFeeDetail[i]["dscg_tkdrug_flag"]);
|
|
|
+ joTmp.Add("matnFeeFlag", jaFeeDetail[i]["matn_fee_flag"]);
|
|
|
+ joTmp.Add("initFeedetlSn", jaFeeDetail[i]["init_feedetl_sn"]);
|
|
|
+ joTmp.Add("drordNo", jaFeeDetail[i]["drord_no"]);
|
|
|
+ joTmp.Add("medType", jaFeeDetail[i]["med_type"]);
|
|
|
+ joTmp.Add("memo", "");
|
|
|
+ joTmp.Add("expContent", jaFeeDetail[i]["expContent"]);
|
|
|
+ joTmp.Add("medListName", jaFeeDetail[i]["medins_list_name"]);
|
|
|
+ joTmp.Add("medListSpc", jaFeeDetail[i]["med_list_spc"]);
|
|
|
+ joTmp.Add("combNo", jaFeeDetail[i]["comb_no"]);
|
|
|
+
|
|
|
+ jaRow.Add(joTmp);
|
|
|
+ }
|
|
|
+
|
|
|
+ jo.Add("medfeeSumamt", sumFee.ToString("#0.00"));
|
|
|
+ jo.Add("chrgBchno", chrgBchno);
|
|
|
+ jo.Add("feedetailList", jaRow);
|
|
|
+ outparam = jo.ToString();
|
|
|
+ return 0;
|
|
|
+
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ outparam = "获取费用异常:" + ex.Message;
|
|
|
+ Global.writeLog("GetFee", jo.ToString(), "获取费用异常:" + ex.Message);
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public int sumInsuRtnSettlInfo(JObject jo, out JObject joSumFee, out string errMsg)
|
|
|
+ {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ joSumFee = new JObject();
|
|
|
+ errMsg = "";
|
|
|
+ decimal ybAmt, psnAcctAmt, hospAmt, psnCashAmt, medFee;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ ybAmt = 0; psnAcctAmt = 0; hospAmt = 0; psnCashAmt = 0; medFee = 0;
|
|
|
+ ybAmt = MSettl.fundPaySumamt;
|
|
|
+ psnAcctAmt = MSettl.accountPaySumamt;
|
|
|
+ psnCashAmt = MSettl.personCashPay;
|
|
|
+ hospAmt = MSettl.hospitalPartAmount;
|
|
|
+ medFee = MSettl.sumamt;
|
|
|
+
|
|
|
+ joSumFee.Add("sumamt", medFee);
|
|
|
+ joSumFee.Add("ybAmt", ybAmt);
|
|
|
+ joSumFee.Add("psnAcctAmt", psnAcctAmt);
|
|
|
+ joSumFee.Add("hospAmt", hospAmt);
|
|
|
+ joSumFee.Add("psnCashAmt", psnCashAmt);
|
|
|
+
|
|
|
+ if (medFee != (ybAmt + psnAcctAmt + psnCashAmt + hospAmt))
|
|
|
+ {
|
|
|
+ errMsg = "ybAmt(" + ybAmt.ToString() + ")+" + "psnAcctAmt(" + psnAcctAmt.ToString() + ")+" + "psnCashAmt(" + psnCashAmt.ToString() + ")+" + "hospAmt(" + hospAmt.ToString() + ")" + "!=medFee(" + medFee.ToString() + ")";
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ errMsg = ex.Message;
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 结算
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public int returnMPSettlementInfo(JObject joReg, JObject joSettl, out string outParam)
|
|
|
+ {
|
|
|
+ string errMsg;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ JObject joSumFee = new JObject();
|
|
|
+ if (sumInsuRtnSettlInfo(joSettl, out joSumFee, out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outParam = "返回结算结果给HIS失败,请联系管理员!" + errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ dynamic joTmp = new JObject();
|
|
|
+ joTmp.settleInfo = joSettl;
|
|
|
+ joTmp.updateUserID = Global.user.ID;
|
|
|
+ joTmp.regInfo = joReg;
|
|
|
+ joTmp.middleSettleFlag = "";
|
|
|
+ joTmp.interfaceDr = Global.inf.interfaceDr;
|
|
|
+ dynamic joHisInfo = new JObject();
|
|
|
+ joHisInfo.admID = MPat.adm_Dr;
|
|
|
+ joHisInfo.billID = MPat.billID;
|
|
|
+ joHisInfo.recordID = MPat.recordID;
|
|
|
+ joTmp.hisInfo = joHisInfo;
|
|
|
+ joTmp.psn_type = MPat.psn_type;
|
|
|
+ joTmp.mobilePayFlag = "Y";
|
|
|
+ joTmp.sumFeeObj = joSumFee;
|
|
|
+ joTmp.mdtrtinfo = MPat.mdtrtID;
|
|
|
+ JObject joRtn = invoker.invokeHISService(JsonHelper.setIrisInpar("05110018", joTmp).ToString(), "返回移动支付结算结果给HIS");
|
|
|
+ if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outParam = "返回移动支付结算结果给HIS失败,请联系管理员!" + errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ joSumFee.Add("payAuthNo", MPat.payAuthNo);
|
|
|
+ joSumFee.Add("payOrdId", MPat.payOrdId);
|
|
|
+ joSumFee.Add("setlLatlnt", MPat.uldLatlnt);
|
|
|
+ joSumFee.Add("org_no", Global.inf.hospitalNO);
|
|
|
+ joSumFee.Add("medOrgOrd", MPat.recordID);
|
|
|
+ joSumFee.Add("mdtrtId", MPat.mdtrtID);
|
|
|
+ joSumFee.Add("gmt_out_create", MSettl.settlTime.ToString("yyyy-MM-dd HH:mm:ss"));
|
|
|
+ joRtn["result"] = joSumFee;
|
|
|
+ outParam = joRtn.ToString();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ outParam = "返回移动支付结算结果给HIS出现异常:!" + ex.Message;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public int QuerySettleInfo(out string errMsg)
|
|
|
+ {
|
|
|
+ errMsg = "";
|
|
|
+ try
|
|
|
+ {
|
|
|
+ string sqlStr = "SELECT * FROM BS_MedInsuSettlement WHERE Hospital_Dr= " + Global.inf.hospitalDr;
|
|
|
+ sqlStr = sqlStr + " and AdmType = 3 and Adm_Dr= " + MPat.adm_Dr + " and SettlementID= '" + MPat.payOrdId + "'";
|
|
|
+ JObject joSqlstr = new JObject();
|
|
|
+ joSqlstr.Add("sqlStr", sqlStr);
|
|
|
+ JObject joRtn = mIS.DynamicQuerySettlInfo(joSqlstr);
|
|
|
+ if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
|
|
|
+ {
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ errMsg = joRtn.ToString();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ errMsg = ex.Message;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 存入MI
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ private int insertPatCurInsuInfo(out string outParam)
|
|
|
+ {
|
|
|
+ JObject joTmp = new JObject();
|
|
|
+ string errMsg = "";
|
|
|
+ try
|
|
|
+ {
|
|
|
+ joTmp.Add("HospitalDr", Global.inf.hospitalDr);
|
|
|
+ joTmp.Add("InterfaceDr", Global.inf.interfaceDr);
|
|
|
+ joTmp.Add("AdmID", MPat.adm_Dr);
|
|
|
+ joTmp.Add("PatientName", MPat.name);
|
|
|
+ joTmp.Add("PersonalNO", MPat.psn_no);
|
|
|
+ joTmp.Add("MdtrtID", MPat.mdtrtID);
|
|
|
+ joTmp.Add("PsnCertType", "");
|
|
|
+ joTmp.Add("PsnCertNO", MPat.certNO);
|
|
|
+ joTmp.Add("Gend", MPat.gend);
|
|
|
+ joTmp.Add("Naty", "");
|
|
|
+ joTmp.Add("Brdy", MPat.brdy);
|
|
|
+ joTmp.Add("Age", MPat.age);
|
|
|
+ joTmp.Add("Balc", MPat.balc);
|
|
|
+ joTmp.Add("Insutype", MPat.insuType);
|
|
|
+ joTmp.Add("PsnType", MPat.psn_type);
|
|
|
+ joTmp.Add("PsnInsuStas", "");
|
|
|
+ joTmp.Add("PsnInsuDate", "");
|
|
|
+ joTmp.Add("PausInsuDate", "");
|
|
|
+ joTmp.Add("Cvlservflag", "");
|
|
|
+ joTmp.Add("insuplcAdmdvs", MPat.insuplc_admdvs);
|
|
|
+ joTmp.Add("EmpName", MPat.emp_name);
|
|
|
+ joTmp.Add("PsnIdettype", "");
|
|
|
+ joTmp.Add("PsnTypeLv", "");
|
|
|
+ joTmp.Add("IdetBegntime", "");
|
|
|
+ joTmp.Add("IdetEndtime", "");
|
|
|
+ if (string.IsNullOrEmpty(Global.user.ID)) Global.user.ID = "0";
|
|
|
+ joTmp.Add("updateUserID", Global.user.ID);
|
|
|
+
|
|
|
+ string serviceCode = "09010070";
|
|
|
+ string inpar = JsonHelper.setIrisInpar(serviceCode, joTmp).ToString();
|
|
|
+ JObject joRtn = invoker.invokeInsuService(inpar, "插入患者该次就诊参保信息");
|
|
|
+
|
|
|
+ if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outParam = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ outParam = joRtn.ToString();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ outParam = "医保平台插入患者该次就诊参保信息:" + ex.Message;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ private int saveRegisterInfo(out string outParam)
|
|
|
+ {
|
|
|
+
|
|
|
+ JObject joTmp = new JObject();
|
|
|
+ string errMsg = "";
|
|
|
+ try
|
|
|
+ {
|
|
|
+ joTmp.Add("HospitalDr", Global.inf.hospitalDr);
|
|
|
+ joTmp.Add("InterfaceDr", Global.inf.interfaceDr);
|
|
|
+ joTmp.Add("AdmDr", MPat.adm_Dr);
|
|
|
+ joTmp.Add("PatientName", MPat.name);
|
|
|
+ joTmp.Add("PersonalNO", MPat.psn_no);
|
|
|
+ joTmp.Add("InsuRegID", MPat.mdtrtID);
|
|
|
+ joTmp.Add("RegDate", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
|
|
+ joTmp.Add("InsuType", MPat.insuType);
|
|
|
+ joTmp.Add("CertificateType", MPat.certType);
|
|
|
+ joTmp.Add("CertificateNO", MPat.certNO);
|
|
|
+ joTmp.Add("MedicalType", MPat.medType);
|
|
|
+ joTmp.Add("AttendDoctorNO", MPat.admAttendDoctorNO);
|
|
|
+ joTmp.Add("ChiefPhyDocName", "");
|
|
|
+ joTmp.Add("AdmInDiagDesc", "");
|
|
|
+ joTmp.Add("AdmInDepCode", MPat.AdmInDepCode);
|
|
|
+ joTmp.Add("AdmInDepName", "");
|
|
|
+ joTmp.Add("AdmBed", "");
|
|
|
+ joTmp.Add("MainDiagCode", MPat.admDiagCode);
|
|
|
+ joTmp.Add("MainDiagName", MPat.admDiagName);
|
|
|
+ joTmp.Add("MainConditionDesc", "");
|
|
|
+ joTmp.Add("DiseasecCode", "");
|
|
|
+ joTmp.Add("DiseasecName", "");
|
|
|
+ joTmp.Add("OperationCode", "");
|
|
|
+ joTmp.Add("OperationName", "");
|
|
|
+ joTmp.Add("DiseasecTypeCode", "");
|
|
|
+ joTmp.Add("InsuranceAreaCode", MPat.insuplc_admdvs);
|
|
|
+ joTmp.Add("TreatmentAreaCode", Global.inf.areaCode);
|
|
|
+ joTmp.Add("payOrdId", MPat.payOrdId);
|
|
|
+ joTmp.Add("payToken", MPat.payToken);
|
|
|
+ joTmp.Add("RegState", "1");
|
|
|
+ joTmp.Add("ValidFlag", "1");
|
|
|
+ joTmp.Add("Type", "4");
|
|
|
+ joTmp.Add("updateUserID", Global.user.ID);
|
|
|
+ joTmp.Add("msgid", Global.curEvt.msgid);
|
|
|
+ joTmp.Add("OccurTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
|
|
+
|
|
|
+ string serviceCode = "09010044";
|
|
|
+ string inpar = JsonHelper.setIrisInpar(serviceCode, joTmp).ToString();
|
|
|
+ JObject joRtn = invoker.invokeInsuService(inpar, "新增门诊登记信息");
|
|
|
+
|
|
|
+ if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outParam = joRtn.ToString();
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ outParam = joRtn.ToString();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ outParam = "保存门诊登记信息异常:" + ex.Message;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ 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("psn_no", MPat.psn_no);
|
|
|
+ joSetlinfo.Add("psn_name", MPat.name);
|
|
|
+
|
|
|
+ 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.fundPaySumamt);
|
|
|
+ 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.accountMutualAidAmount);
|
|
|
+ joSetlinfo.Add("psn_cash_pay", MSettl.personCashPay);
|
|
|
+ joSetlinfo.Add("balc", MSettl.balance);
|
|
|
+ joSetlinfo.Add("acct_mulaid_pay", "");
|
|
|
+ joSetlinfo.Add("medins_setl_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("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("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);
|
|
|
+
|
|
|
+ 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 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("PersonnelNO", MPat.psn_no);
|
|
|
+ joSetlinfo.Add("PatientName", MPat.name);
|
|
|
+
|
|
|
+ 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.fundPaySumamt);
|
|
|
+ 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.accountMutualAidAmount);
|
|
|
+ joSetlinfo.Add("PersonCashPay", MSettl.personCashPay);
|
|
|
+ joSetlinfo.Add("Balance", MSettl.balance);
|
|
|
+ joSetlinfo.Add("AccountMutualAidAmount", "");
|
|
|
+ joSetlinfo.Add("OrganSettlementID", "");
|
|
|
+ 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("09010080", 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 int cancleSettlement(string newSettlID, out string outParam)
|
|
|
+ {
|
|
|
+ JObject joTmp = new JObject();
|
|
|
+ string errMsg = "";
|
|
|
+ try
|
|
|
+ {
|
|
|
+ joTmp.Add("HospitalDr", Global.inf.hospitalDr);
|
|
|
+ joTmp.Add("InterfaceDr", Global.inf.interfaceDr);
|
|
|
+ joTmp.Add("admID", MPat.adm_Dr);
|
|
|
+ joTmp.Add("mdtrt_id", MPat.mdtrtID);
|
|
|
+ joTmp.Add("setl_id", MPat.settlID);
|
|
|
+ joTmp.Add("new_setl_id", newSettlID);
|
|
|
+ joTmp.Add("updateUserID", Global.user.ID);
|
|
|
+ joTmp.Add("msgid", Global.curEvt.msgid);
|
|
|
+ joTmp.Add("OccurTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
|
|
+ JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010052", joTmp).ToString(), "取消结算信息");
|
|
|
+
|
|
|
+ if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outParam = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ outParam = JsonHelper.setExceptionJson(0, "云医保平台", "取消结算成功").ToString();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ outParam = "取消结算信息:" + ex.Message;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public int insertFee(JArray jaTmp, out string outParam)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ outParam = "";
|
|
|
+ string errMsg;
|
|
|
+ dynamic joTmp = new JObject();
|
|
|
+ joTmp = new JObject();
|
|
|
+ joTmp.code = "09010046";
|
|
|
+ joTmp.HospitalDr = Global.inf.hospitalDr;
|
|
|
+ joTmp.admID = MPat.adm_Dr;
|
|
|
+ joTmp.mdtrt_id = MPat.mdtrtID;
|
|
|
+ joTmp.updateUserID = Global.user.ID;
|
|
|
+ joTmp.Add("params", jaTmp);
|
|
|
+ ;
|
|
|
+ JObject joRtn = invoker.invokeInsuService(joTmp.ToString(), "插入2301明细");
|
|
|
+ if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
|
|
|
+ {
|
|
|
+ outParam = errMsg;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ outParam = joRtn.ToString();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ outParam = "insertFee 异常:" + ex.Message;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private int saveToMi(out string errMsg)
|
|
|
+ {
|
|
|
+ errMsg = "";
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+
|
|
|
+ if (insertPatCurInsuInfo(out errMsg) != 0)
|
|
|
+ {
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (saveRegisterInfo(out errMsg) != 0)
|
|
|
+ {
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach (var jo in jaFee)
|
|
|
+ {
|
|
|
+ jo["mdtrt_id"] = MPat.mdtrtID;
|
|
|
+ jo["psn_no"] = MPat.psn_no;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (insertFee(jaFee, out errMsg) != 0)
|
|
|
+ {
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ errMsg = "saveToMi:" + ex.Message;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 解析中心返回
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public int ParseCenterRtnValue(JObject joRtn, out string errorMsg)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ errorMsg = JsonHelper.getDestValue(joRtn, "message");
|
|
|
+ return int.Parse(JsonHelper.getDestValue(joRtn, "code"));
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ errorMsg = "解析银海移动支付返参发生异常:" + ex.Message;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+ }
|
|
|
+}
|