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="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 #4
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 #5
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 #6
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 #7
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 #8
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 #9
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);
        }