Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="param"></param>
        /// <param name="baseParam"></param>
        /// <returns></returns>
        public ResidentUserInfoJsonDto GetUserInfoEntity(string param, HisBaseParam baseParam)
        {
            var data = new ResidentUserInfoJsonDto();

            try
            {//
                var userInfoParam = new ResidentUserInfoParam()
                {
                    AfferentSign = baseParam.AfferentSign,
                    IdentityMark = baseParam.IdentityMark
                };
                Logs.LogWrite(new LogParam()
                {
                    Params = JsonConvert.SerializeObject(userInfoParam),
                    Msg    = JsonConvert.SerializeObject(baseParam)
                });
                var xmlStr = XmlHelp.SaveXmlEntity(userInfoParam);
                if (!xmlStr)
                {
                    throw new Exception("获取个人基础资料保存参数出错");
                }
                var loginData = MedicalInsuranceDll.ConnectAppServer_cxjb(baseParam.Account, baseParam.Pwd);
                if (loginData != 1)
                {
                    throw new Exception("医保登陆失败!!!");
                }
                int result = MedicalInsuranceDll.CallService_cxjb("CXJB001");
                if (result == 1)
                {
                    data = XmlHelp.DeSerializerModel(new ResidentUserInfoJsonDto(), true);
                    if (data.ReturnState == "1")
                    {
                        Logs.LogWriteData(new LogWriteDataParam()
                        {
                            JoinJson   = JsonConvert.SerializeObject(param),
                            ReturnJson = JsonConvert.SerializeObject(data),
                            OperatorId = baseParam.OperatorId
                        });
                    }
                    else
                    {
                        throw new Exception(data.Msg);
                    }
                }
            }
            catch (Exception e)
            {
                Logs.LogWrite(new LogParam()
                {
                    Msg          = e.Message + "error:" + e.StackTrace,
                    OperatorCode = baseParam.OperatorId,
                    Params       = Logs.ToJson(param),
                    ResultData   = Logs.ToJson(data)
                });
            }
            MedicalInsuranceDll.DisConnectAppServer_cxjb("CXJB001");
            return(data);
        }
Example #2
0
        /// <summary>
        /// 处方数据上传
        /// </summary>
        /// <param name="param"></param>
        /// <param name="baseParam"></param>
        /// <returns></returns>
        public ApiJsonResultData PrescriptionUploadData(string param, HisBaseParam baseParam)
        {
            var resultData = new ApiJsonResultData {
                Success = true
            };

            try
            {
                Logs.LogWrite(new LogParam()
                {
                    Params = param,
                    Msg    = JsonConvert.SerializeObject(baseParam)
                });
                var uploadDataParam = JsonConvert.DeserializeObject <PrescriptionUploadParam>(param);
                var xmlStr          = XmlHelp.SaveXmlEntity(uploadDataParam);
                if (!xmlStr)
                {
                    throw new Exception("处方数据上传保存参数出错!!!");
                }
                var loginData = MedicalInsuranceDll.ConnectAppServer_cxjb(baseParam.Account, baseParam.Pwd);
                if (loginData != 1)
                {
                    throw new Exception("处方数据上传医保执行失败!!!");
                }
                int result = MedicalInsuranceDll.CallService_cxjb("CXJB004");
                if (result == 1)
                {
                    var resultStr = XmlHelp.DeSerializerModel(new PrescriptionUploadDto(), true);

                    var batchConfirmParam = new BatchConfirmParam()
                    {
                        BatchNumber = resultStr.ProjectBatch,
                        ConfirmType = 1,
                        MedicalInsuranceHospitalizationNo = uploadDataParam.MedicalInsuranceHospitalizationNo,
                        Operators = uploadDataParam.Operators
                    };
                    //批次确认
                    XmlHelp.SaveXmlEntity(batchConfirmParam);
                    MedicalInsuranceDll.CallService_cxjb("CXJB007");
                    var iniResult = XmlHelp.DeSerializerModel(new IniDto(), true);
                    Logs.LogWriteData(new LogWriteDataParam()
                    {
                        JoinJson   = param,
                        ReturnJson = JsonConvert.SerializeObject(baseParam),
                        OperatorId = baseParam.OperatorId
                    });
                    resultData.Data = resultStr;
                }
            }
            catch (Exception e)
            {
                resultData.Success = false;
                resultData.Message = e.Message;
            }
            MedicalInsuranceDll.DisConnectAppServer_cxjb("CXJB007");

            return(resultData);
        }
Example #3
0
        /// <summary>
        /// 职工入院登记修改
        /// </summary>
        /// <param name="paramc"></param>
        /// <param name="baseParam"></param>
        /// <returns></returns>
        public ApiJsonResultData ModifyWorkerHospitalization(string paramc, HisBaseParam baseParam)
        {
            var resultValue = new ApiJsonResultData {
                Success = true
            };

            try
            {
                Logs.LogWrite(new LogParam()
                {
                    Params = paramc,
                    Msg    = JsonConvert.SerializeObject(baseParam)
                });
                var loginData = MedicalInsuranceDll.ConnectAppServer_cxjb(baseParam.Account, baseParam.Pwd);
                var param     = JsonConvert.DeserializeObject <ModifyWorkerHospitalizationParam>(paramc);
                //返回状态
                var resultState = new byte[1024];
                //消息
                var msg = new byte[1024];

                MedicalInsuranceDll.ModifyHospitalization
                    (param.OrganizationCode,
                    param.MedicalInsuranceHospitalizationNo,
                    param.AdministrativeArea,
                    param.AdmissionDate,
                    param.AdmissionMainDiagnosisIcd10,
                    param.DiagnosisIcd10Two,
                    param.DiagnosisIcd10Three,
                    param.AdmissionMainDiagnosis,
                    param.InpatientArea,
                    param.BedNumber,
                    param.HospitalizationNo,
                    resultState,
                    msg
                    );
                if (CommonHelp.StrToTransCoding(resultState) != "1")
                {
                    throw new Exception(CommonHelp.StrToTransCoding(msg));
                }


                Logs.LogWriteData(new LogWriteDataParam()
                {
                    JoinJson   = JsonConvert.SerializeObject(param),
                    ReturnJson = "职工住院登记修改成功",
                    OperatorId = baseParam.OperatorId
                });
                resultValue.Data = "职工住院登记修改成功";
            }
            catch (Exception e)
            {
                resultValue.Success = false;
                resultValue.Message = e.Message;
            }
            return(resultValue);
        }
Example #4
0
        /// <summary>
        /// 职工取消结算
        /// </summary>
        /// <param name="paramc"></param>
        /// <param name="baseParam"></param>
        /// <returns></returns>
        public ApiJsonResultData WorkerSettlementCancel(string paramc, HisBaseParam baseParam)
        {
            var resultValue = new ApiJsonResultData {
                Success = true
            };

            try
            {
                Logs.LogWrite(new LogParam()
                {
                    Params = paramc,
                    Msg    = JsonConvert.SerializeObject(baseParam)
                });
                var loginData = MedicalInsuranceDll.ConnectAppServer_cxjb(baseParam.Account, baseParam.Pwd);
                var param     = JsonConvert.DeserializeObject <WorkerSettlementCancelParam>(paramc);

                //返回状态
                var resultState = new byte[1024];
                //消息
                var msg      = new byte[1024];
                var yearSign = new byte[1024];
                MedicalInsuranceDll.WorkerSettlementCancel
                    (param.AdministrativeArea,
                    param.OrganizationCode,
                    param.MedicalInsuranceHospitalizationNo,
                    param.SettlementNo,
                    param.CancelLimit,
                    param.User.UserName,
                    yearSign,
                    resultState,
                    msg
                    );
                if (CommonHelp.StrToTransCoding(resultState) != "1")
                {
                    throw new Exception(CommonHelp.StrToTransCoding(msg));
                }

                Logs.LogWriteData(new LogWriteDataParam()
                {
                    JoinJson = JsonConvert.SerializeObject(param),

                    OperatorId = baseParam.OperatorId
                });
                resultValue.Data      = "取消成功!!!";
                resultValue.OtherInfo = CommonHelp.StrToTransCoding(yearSign);
            }
            catch (Exception e)
            {
                resultValue.Success = false;
                resultValue.Message = e.Message;
            }
            return(resultValue);
        }
Example #5
0
        /// <summary>
        /// 门诊计划生育结算
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public ApiJsonResultData OutpatientPlanBirthSettlement(string param, HisBaseParam baseParam)
        {
            var resultData = new ApiJsonResultData {
                Success = true
            };

            try
            {
                Logs.LogWrite(new LogParam()
                {
                    Params = param,
                    Msg    = JsonConvert.SerializeObject(baseParam)
                });
                var xmlStr = XmlHelp.SaveXmlStr(param);
                if (!xmlStr)
                {
                    throw new Exception("门诊计划生育结算保存参数出错");
                }
                var loginData = MedicalInsuranceDll.ConnectAppServer_cxjb(baseParam.Account, baseParam.Pwd);
                if (loginData != 1)
                {
                    throw new Exception("医保登陆失败!!!");
                }
                int result = MedicalInsuranceDll.CallService_cxjb("SYBX005");
                if (result != 1)
                {
                    throw new Exception("门诊计划生育结算执行出错!!!");
                }
                if (result == 1)
                {
                    var resultStr = XmlHelp.SerializerModelJson();
                    Logs.LogWriteData(new LogWriteDataParam()
                    {
                        JoinJson   = param,
                        ReturnJson = resultStr,
                        OperatorId = baseParam.OperatorId
                    });
                    resultData.Data = resultStr;
                    MedicalInsuranceDll.DisConnectAppServer_cxjb("SYBX005");
                    //获取用余额
                    var userInfo = GetUserInfoEntity("", baseParam);
                    resultData.OtherInfo = userInfo.InsuranceType == "310" ? userInfo.WorkersInsuranceBalance.ToString(CultureInfo.InvariantCulture)
                        : userInfo.ResidentInsuranceBalance.ToString(CultureInfo.InvariantCulture);
                }
            }
            catch (Exception e)
            {
                resultData.Success = false;
                resultData.Message = e.Message;
            }

            return(resultData);
        }
Example #6
0
        /// <summary>
        /// 门诊月结汇总
        /// </summary>
        /// <param name="param"></param>
        public ApiJsonResultData MonthlyHospitalization(string param, HisBaseParam baseParam)
        {
            Logs.LogWrite(new LogParam()
            {
                Params = param,
                Msg    = JsonConvert.SerializeObject(baseParam)
            });
            var resultData = new ApiJsonResultData {
                Success = true
            };

            try
            {
                var iniParam = JsonConvert.DeserializeObject <MonthlyHospitalizationParticipationParam>(param);
                iniParam.StartTime = Convert.ToDateTime(iniParam.StartTime).ToString("yyyyMMdd");
                iniParam.EndTime   = Convert.ToDateTime(iniParam.EndTime).ToString("yyyyMMdd");
                var xmlStr = XmlHelp.SaveXmlEntity(iniParam);
                if (!xmlStr)
                {
                    throw new Exception("门诊月结汇总保存参数出错");
                }

                var loginData = MedicalInsuranceDll.ConnectAppServer_cxjb(baseParam.Account, baseParam.Pwd);
                if (loginData != 1)
                {
                    throw new Exception("医保登陆失败!!!");
                }
                int result = MedicalInsuranceDll.CallService_cxjb("TPYP214");
                if (result != 1)
                {
                    throw new Exception("门诊月结汇总执行出错!!!");
                }
                if (result == 1)
                {
                    var resultStr = XmlHelp.SerializerModelJson();
                    Logs.LogWriteData(new LogWriteDataParam()
                    {
                        JoinJson   = param,
                        ReturnJson = resultStr,
                        OperatorId = baseParam.OperatorId
                    });
                    resultData.Data = resultStr;
                }
            }
            catch (Exception e)
            {
                resultData.Success = false;
                resultData.Message = e.Message;
            }
            MedicalInsuranceDll.DisConnectAppServer_cxjb("TPYP214");
            return(resultData);
        }
Example #7
0
        /// <summary>
        /// 门诊计划生育结算查询
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public ApiJsonResultData OutpatientPlanBirthSettlementQuery(string param, HisBaseParam baseParam)
        {
            var resultData = new ApiJsonResultData {
                Success = true
            };

            try
            {
                Logs.LogWrite(new LogParam()
                {
                    Params = param,
                    Msg    = JsonConvert.SerializeObject(baseParam)
                });
                var xmlStr = XmlHelp.SaveXmlStr(param);
                if (!xmlStr)
                {
                    throw new Exception("门诊计划生育结算查询保存参数出错");
                }
                var loginData = MedicalInsuranceDll.ConnectAppServer_cxjb(baseParam.Account, baseParam.Pwd);
                if (loginData != 1)
                {
                    throw new Exception("医保登陆失败!!!");
                }
                int result = MedicalInsuranceDll.CallService_cxjb("SYBX007");
                if (result != 1)
                {
                    throw new Exception("门诊计划生育结算查询执行出错!!!");
                }
                if (result == 1)
                {
                    var data      = XmlHelp.DeSerializerModel(new WorkerBirthPreSettlementJsonDto(), true);
                    var resultStr = JsonConvert.SerializeObject(data);
                    Logs.LogWriteData(new LogWriteDataParam()
                    {
                        JoinJson   = param,
                        ReturnJson = resultStr,
                        OperatorId = baseParam.OperatorId
                    });
                    resultData.Data = resultStr;
                }
            }
            catch (Exception e)
            {
                resultData.Success = false;
                resultData.Message = e.Message;
            }
            MedicalInsuranceDll.DisConnectAppServer_cxjb("SYBX007");
            return(resultData);
        }
Example #8
0
        /// <summary>
        /// 医保出院费用结算
        /// </summary>
        /// <param name="param"></param>
        /// <param name="baseParam"></param>
        /// <returns></returns>
        public ApiJsonResultData LeaveHospitalSettlement(string param, HisBaseParam baseParam)
        {
            var resultData = new ApiJsonResultData {
                Success = true
            };

            try
            {
                Logs.LogWrite(new LogParam()
                {
                    Params = param,
                    Msg    = JsonConvert.SerializeObject(baseParam)
                });
                var xmlStr = XmlHelp.SaveXmlStr(param);
                if (!xmlStr)
                {
                    throw new Exception("居民住院结算保存参数出错!!!");
                }
                var loginData = MedicalInsuranceDll.ConnectAppServer_cxjb(baseParam.Account, baseParam.Pwd);
                if (loginData != 1)
                {
                    throw new Exception("居民住院结算医保执行失败!!!");
                }
                int result = MedicalInsuranceDll.CallService_cxjb("CXJB010");
                if (result == 1)
                {
                    var resultStr = XmlHelp.SerializerModelJson();
                    MedicalInsuranceDll.DisConnectAppServer_cxjb("CXJB010");
                    var userInfo = GetUserInfoEntity(baseParam);
                    Logs.LogWriteData(new LogWriteDataParam()
                    {
                        JoinJson   = param,
                        ReturnJson = resultStr,
                        OperatorId = baseParam.OperatorId
                    });
                    resultData.Data      = resultStr;
                    resultData.OtherInfo = userInfo.ResidentInsuranceBalance.ToString();
                }
            }
            catch (Exception e)
            {
                resultData.Success = false;
                resultData.Message = e.Message;
            }

            return(resultData);
        }
Example #9
0
        /// <summary>
        /// 项目下载
        /// </summary>
        public ApiJsonResultData ProjectDownload(string param, HisBaseParam baseParam)
        {
            var resultData = new ApiJsonResultData {
                Success = true
            };

            try
            {
                Logs.LogWrite(new LogParam()
                {
                    Params = param,
                    Msg    = JsonConvert.SerializeObject(baseParam)
                });
                var xmlStr = XmlHelp.SaveXmlStr(param);
                if (!xmlStr)
                {
                    throw new Exception("项目下载保存参数出错");
                }
                var loginData = MedicalInsuranceDll.ConnectAppServer_cxjb(baseParam.Account, baseParam.Pwd);
                if (loginData != 1)
                {
                    throw new Exception("项目下载执行出错!!!");
                }
                int result = MedicalInsuranceDll.CallService_cxjb("CXJB019");
                if (result == 1)
                {
                    string strXml    = XmlHelp.DeSerializerModelStr("ROWDATA");
                    var    data      = XmlHelp.DeSerializer <ResidentProjectDownloadDto>(strXml);
                    var    resultStr = JsonConvert.SerializeObject(data);
                    Logs.LogWriteData(new LogWriteDataParam()
                    {
                        JoinJson   = param,
                        ReturnJson = resultStr,
                        OperatorId = baseParam.OperatorId
                    });
                    resultData.Data = resultStr;
                }
            }
            catch (Exception e)
            {
                resultData.Success = false;
                resultData.Message = e.Message;
            }
            MedicalInsuranceDll.DisConnectAppServer_cxjb("CXJB019");
            return(resultData);
        }
Example #10
0
        /// <summary>
        /// 医保操作
        /// </summary>
        /// <param name="param"></param>
        /// <param name="baseParam"></param>
        /// <param name="code">医保编码</param>
        /// <param name="tipsMsg">提示信息</param>
        /// <returns></returns>
        private ApiJsonResultData MedicalInsuranceOperation(string param, HisBaseParam baseParam, string code, string tipsMsg)
        {
            var resultData = new ApiJsonResultData {
                Success = true
            };

            try
            {
                Logs.LogWrite(new LogParam()
                {
                    Params = param,
                    Msg    = JsonConvert.SerializeObject(baseParam)
                });
                var xmlStr = XmlHelp.SaveXmlStr(param);
                if (!xmlStr)
                {
                    throw new Exception(tipsMsg + "保存参数出错!!!");
                }
                var loginData = MedicalInsuranceDll.ConnectAppServer_cxjb(baseParam.Account, baseParam.Pwd);
                if (loginData != 1)
                {
                    throw new Exception(tipsMsg + "医保执行失败!!!");
                }
                int result = MedicalInsuranceDll.CallService_cxjb(code);
                if (result == 1)
                {
                    var resultStr = XmlHelp.SerializerModelJson();

                    Logs.LogWriteData(new LogWriteDataParam()
                    {
                        JoinJson   = param,
                        ReturnJson = resultStr,
                        OperatorId = baseParam.OperatorId
                    });
                    resultData.Data = resultStr;
                }
            }
            catch (Exception e)
            {
                resultData.Success = false;
                resultData.Message = e.Message;
            }
            MedicalInsuranceDll.DisConnectAppServer_cxjb(code);
            return(resultData);
        }
Example #11
0
        /// <summary>
        /// 取消门诊月结汇总
        /// </summary>
        /// <param name="param"></param>
        public ApiJsonResultData CancelMonthlyHospitalization(string param, HisBaseParam baseParam)
        {
            var resultData = new ApiJsonResultData {
                Success = true
            };

            try
            {
                var xmlStr = XmlHelp.SaveXmlStr(param);
                if (!xmlStr)
                {
                    throw new Exception("取消门诊月结汇总保存参数出错");
                }
                var loginData = MedicalInsuranceDll.ConnectAppServer_cxjb(baseParam.Account, baseParam.Pwd);
                if (loginData != 1)
                {
                    throw new Exception("医保登陆失败!!!");
                }
                int result = MedicalInsuranceDll.CallService_cxjb("TPYP215");
                if (result != 1)
                {
                    throw new Exception("取消门诊月结汇总执行出错!!!");
                }
                if (result == 1)
                {
                    var resultStr = XmlHelp.SerializerModelJson();
                    Logs.LogWriteData(new LogWriteDataParam()
                    {
                        JoinJson   = param,
                        ReturnJson = resultStr,
                        OperatorId = baseParam.OperatorId
                    });
                    resultData.Data = resultStr;
                }
            }
            catch (Exception e)
            {
                resultData.Success = false;
                resultData.Message = e.Message;
            }
            MedicalInsuranceDll.DisConnectAppServer_cxjb("TPYP215");
            return(resultData);
        }
Example #12
0
        /// <summary>
        /// 职工结算
        /// </summary>
        /// <param name="paramc"></param>
        /// <param name="baseParam"></param>
        /// <returns></returns>
        public ApiJsonResultData WorkerHospitalizationSettlement(string paramc, HisBaseParam baseParam)
        {
            var resultValue = new ApiJsonResultData {
                Success = true
            };

            try
            {
                Logs.LogWrite(new LogParam()
                {
                    Params = paramc,
                    Msg    = JsonConvert.SerializeObject(baseParam)
                });
                var loginData = MedicalInsuranceDll.ConnectAppServer_cxjb(baseParam.Account, baseParam.Pwd);
                var param     = JsonConvert.DeserializeObject <WorkerHospitalizationSettlementParam>(paramc);

                //社保住院号
                var documentNo = new byte[1024];
                //发生费用金额
                var totalAmount = new byte[1024];
                //基本统筹支付
                var basicOverallPay = new byte[1024];
                //补充医疗保险支付金额
                var supplementPayAmount = new byte[1024];
                //专项基金支付金额
                var specialFundPayAmount = new byte[1024];
                //公务员补贴
                var civilServantsSubsidies = new byte[1024];
                //公务员补助
                var civilServantsSubsidy = new byte[1024];
                //其它支付金额
                var otherPaymentAmount = new byte[1024];
                //账户支付
                var accountPayment = new byte[1024];
                //现金支付
                var cashPayment = new byte[1024];
                //起付金额
                var paidAmount = new byte[1024];
                // 备注
                var remark = new byte[1024];
                //返回状态
                var resultState = new byte[1024];
                //消息
                var msg = new byte[1024];
                MedicalInsuranceDll.WorkerHospitalizationSettlement
                    (param.OrganizationCode,
                    param.MedicalInsuranceHospitalizationNo,
                    param.AdministrativeArea,
                    param.IsHospitalizationFrequency,
                    param.Operators,
                    param.LeaveHospitalDate,
                    param.LeaveHospitalState,
                    param.AdmissionMainDiagnosisIcd10,
                    param.DiagnosisIcd10Two,
                    param.DiagnosisIcd10Three,
                    param.LeaveHospitalMainDiagnosis,
                    totalAmount,
                    basicOverallPay,
                    supplementPayAmount,
                    specialFundPayAmount,
                    civilServantsSubsidies,
                    civilServantsSubsidy,
                    otherPaymentAmount,
                    accountPayment,
                    cashPayment,
                    paidAmount,
                    documentNo,
                    remark,
                    resultState,
                    msg
                    );
                if (CommonHelp.StrToTransCoding(resultState) != "1")
                {
                    throw new Exception(CommonHelp.StrToTransCoding(msg));
                }
                var resultData = new WorkerHospitalizationPreSettlementDto()
                {
                    DocumentNo             = CommonHelp.StrToTransCoding(documentNo),
                    TotalAmount            = Convert.ToDecimal(CommonHelp.StrToTransCoding(totalAmount)),
                    BasicOverallPay        = Convert.ToDecimal(CommonHelp.StrToTransCoding(basicOverallPay)),
                    SupplementPayAmount    = Convert.ToDecimal(CommonHelp.StrToTransCoding(supplementPayAmount)),
                    SpecialFundPayAmount   = Convert.ToDecimal(CommonHelp.StrToTransCoding(specialFundPayAmount)),
                    CivilServantsSubsidies = Convert.ToDecimal(CommonHelp.StrToTransCoding(civilServantsSubsidies)),
                    CivilServantsSubsidy   = Convert.ToDecimal(CommonHelp.StrToTransCoding(civilServantsSubsidy)),
                    OtherPaymentAmount     = Convert.ToDecimal(CommonHelp.StrToTransCoding(otherPaymentAmount)),
                    AccountPayment         = Convert.ToDecimal(CommonHelp.StrToTransCoding(accountPayment)),
                    CashPayment            = Convert.ToDecimal(CommonHelp.StrToTransCoding(cashPayment)),
                    PaidAmount             = Convert.ToDecimal(CommonHelp.StrToTransCoding(paidAmount)),
                    Remark = CommonHelp.StrToTransCoding(cashPayment),
                };
                var infoEntity = GetUserInfoEntity(baseParam);
                resultValue.OtherInfo = infoEntity.WorkersInsuranceBalance.ToString();
                Logs.LogWriteData(new LogWriteDataParam()
                {
                    JoinJson   = JsonConvert.SerializeObject(param),
                    ReturnJson = JsonConvert.SerializeObject(resultData),
                    OperatorId = baseParam.OperatorId
                });
                resultValue.Data = JsonConvert.SerializeObject(resultData);
            }
            catch (Exception e)
            {
                resultValue.Success = false;
                resultValue.Message = e.Message;
            }
            return(resultValue);
        }
Example #13
0
        /// <summary>
        /// 职工入院登记
        /// </summary>
        /// <param name="paramc"></param>
        /// <param name="baseParam"></param>
        /// <returns></returns>
        public ApiJsonResultData WorkerHospitalizationRegister(string paramc, HisBaseParam baseParam)
        {
            var resultValue = new ApiJsonResultData {
                Success = true
            };

            try
            {
                Logs.LogWrite(new LogParam()
                {
                    Params = paramc,
                    Msg    = JsonConvert.SerializeObject(baseParam)
                });
                var loginData = MedicalInsuranceDll.ConnectAppServer_cxjb(baseParam.Account, baseParam.Pwd);
                var param     = JsonConvert.DeserializeObject <WorKerHospitalizationRegisterParam>(paramc);
                WorkerHospitalizationRegisterDto resultData;
                //社保住院号
                var medicalInsuranceHospitalizationNo = new byte[1024];
                //审批编号
                var approvalNumber = new byte[1024];
                //年住院次数
                var yearHospitalizationNumber = new byte[1024];
                //统筹已付金额
                var overallPlanningAlreadyAmount = new byte[1024];
                //统筹可付金额
                var overallPlanningCanAmount = new byte[1024];
                //返回状态
                var resultState = new byte[1024];
                //消息
                var msg = new byte[1024];
                //  param.AdministrativeArea,
                MedicalInsuranceDll.HospitalizationRegister
                    (param.IdentityMark,
                    param.AfferentSign,
                    param.AdministrativeArea,
                    param.OrganizationCode,
                    param.MedicalCategory,
                    param.AdmissionDate,
                    param.AdmissionMainDiagnosisIcd10,
                    param.DiagnosisIcd10Two,
                    param.DiagnosisIcd10Three,
                    param.AdmissionMainDiagnosis,
                    param.InpatientArea,
                    param.BedNumber,
                    param.HospitalizationNo,
                    param.Operators,
                    medicalInsuranceHospitalizationNo,
                    approvalNumber,
                    yearHospitalizationNumber,
                    overallPlanningAlreadyAmount,
                    overallPlanningCanAmount,
                    resultState,
                    msg
                    );
                if (CommonHelp.StrToTransCoding(resultState) != "1")
                {
                    throw new Exception(CommonHelp.StrToTransCoding(msg));
                }
                resultData = new WorkerHospitalizationRegisterDto()
                {
                    MedicalInsuranceHospitalizationNo = CommonHelp.StrToTransCoding(medicalInsuranceHospitalizationNo),
                    ApprovalNumber               = CommonHelp.StrToTransCoding(approvalNumber),
                    YearHospitalizationNumber    = CommonHelp.StrToTransCoding(yearHospitalizationNumber),
                    OverallPlanningAlreadyAmount = CommonHelp.StrToTransCoding(overallPlanningAlreadyAmount),
                    OverallPlanningCanAmount     = CommonHelp.StrToTransCoding(overallPlanningCanAmount),
                };
                var resultStr = JsonConvert.SerializeObject(resultData);
                Logs.LogWriteData(new LogWriteDataParam()
                {
                    JoinJson   = JsonConvert.SerializeObject(resultData),
                    ReturnJson = resultStr,
                    OperatorId = baseParam.OperatorId
                });
                resultValue.Data = resultStr;
            }
            catch (Exception e)
            {
                resultValue.Success = false;
                resultValue.Message = e.Message;
            }
            return(resultValue);
        }
Example #14
0
        /// <summary>
        /// 读卡获取个人基础资料
        /// </summary>
        /// <param name="param"></param>
        /// <param name="baseParam"></param>
        public ApiJsonResultData ReadCardUserInfo(string param, HisBaseParam baseParam)
        {
            var resultData = new ApiJsonResultData {
                Success = true
            };
            var data = new ResidentUserInfoJsonDto();

            try
            {
                var iniFile = new IniFile();
                //端口号
                var port = iniFile.GetIni();
                Logs.LogWrite(new LogParam()
                {
                    Params = param,
                    Msg    = JsonConvert.SerializeObject(baseParam)
                });
                if (!string.IsNullOrWhiteSpace(param) == false)
                {
                    throw  new  Exception("密码不能为空!!!");
                }
                var loginData = MedicalInsuranceDll.ConnectAppServer_cxjb(baseParam.Account, baseParam.Pwd);
                if (loginData != 1)
                {
                    throw new Exception("医保登陆失败!!!");
                }
                int result = MedicalInsuranceDll.ReadCardInfo_cxjb(port, param);
                if (result == 1)
                {
                    data = XmlHelp.DeSerializerModel(new ResidentUserInfoJsonDto(), true);
                    if (data.ReturnState == "1")
                    {
                        var userInfoDto = UserInfoToDto(data);
                        resultData.Data = JsonConvert.SerializeObject(userInfoDto);
                        Logs.LogWriteData(new LogWriteDataParam()
                        {
                            JoinJson   = JsonConvert.SerializeObject(param),
                            ReturnJson = JsonConvert.SerializeObject(userInfoDto),
                            OperatorId = baseParam.OperatorId
                        });
                    }
                    else
                    {
                        throw new Exception(data.Msg);
                    }
                }
            }
            catch (Exception e)
            {
                resultData.Success = false;
                resultData.Message = e.Message;
                Logs.LogWrite(new LogParam()
                {
                    Msg          = e.Message + "error:" + e.StackTrace,
                    OperatorCode = baseParam.OperatorId,
                    Params       = Logs.ToJson(param),
                    ResultData   = Logs.ToJson(data)
                });
            }
            return(resultData);
        }
Example #15
0
        // <summary>
        // 读卡获取信息
        // </summary>
        ///<param name = "paramStr"></param >
        /// <param name="baseParam"></param>
        public ApiJsonResultData ReadCardInfo(string paramStr, HisBaseParam baseParam)
        {
            var param      = JsonConvert.DeserializeObject <ReadCardInfoParam>(paramStr);
            var resultData = new ApiJsonResultData {
                Success = true
            };
            //姓名
            var patientName = new byte[1024];
            //性别
            var patientSex = new byte[1024];
            //出生日期
            var birthday = new byte[1024];

            //身份证号
            var idCardNo = new byte[1024];
            //联系地址
            var contactAddress = new byte[1024];
            //职工医保账户余额
            var workersInsuranceBalance = new byte[1024];
            //职工卡号
            var workersCardNo = new byte[1024];
            //返回状态
            var resultState = new byte[1024];
            //消息
            var msg      = new byte[1024];
            var userData = new GetResidentUserInfoDto();

            try
            {
                if (param == null)
                {
                    throw new Exception("职工结算入参不能为空!!!");
                }
                if (string.IsNullOrWhiteSpace(baseParam.Account))
                {
                    throw new Exception("医保账户不能为空!!!");
                }
                if (string.IsNullOrWhiteSpace(baseParam.Pwd))
                {
                    throw new Exception("医保账户密码不能为空!!!");
                }
                if (string.IsNullOrWhiteSpace(param.CardPwd))
                {
                    throw new Exception("卡密码不能为空!!!");
                }
                var loginData = MedicalInsuranceDll.ConnectAppServer_cxjb(baseParam.Account, baseParam.Pwd);
                if (loginData != 1)
                {
                    throw new Exception("医保登陆失败!!!");
                }
                //居民职工
                if (param.InsuranceType == 0)
                {
                    var readCardData = MedicalInsuranceDll.ReadCardInfo_cxjb("1", param.CardPwd);
                    if (readCardData != 1)
                    {
                        throw new Exception("读卡失败!!!");
                    }
                    userData = XmlHelp.DeSerializerModel(new Model.Dto.GetResidentUserInfoDto(), true);
                    //数据日志存入
                    param.CardPwd = "******";
                    Logs.LogWriteData(new LogWriteDataParam()
                    {
                        JoinJson   = JsonConvert.SerializeObject(param),
                        ReturnJson = JsonConvert.SerializeObject(userData),
                        OperatorId = baseParam.OperatorId
                    });
                    if (userData.ReturnState == "1")
                    {
                        resultData.Data = JsonConvert.SerializeObject(userData);
                    }
                    else
                    {
                        throw new Exception(userData.Msg);
                    }
                }
            }
            catch (Exception e)
            {
                resultData.Success = false;
                resultData.Message = e.Message;
                Logs.LogWrite(new LogParam()
                {
                    Msg          = e.Message,
                    OperatorCode = baseParam.OperatorId,
                    Params       = Logs.ToJson(param),
                    ResultData   = Logs.ToJson(userData)
                });
            }
            return(resultData);
        }