/// <summary>
        /// 异地出院办理
        /// </summary>
        /// <param name="param"></param>
        public LeaveHospitalHandleDto LeaveHospitalHandle(LeaveHospitalHandleParam param)
        {
            var resultData = new LeaveHospitalHandleDto();
            var xmlStr     = XmlHelp.SaveXml(param);

            if (!xmlStr)
            {
                throw new Exception("异地出院办理保存参数出错");
            }
            int result = MedicalInsuranceDll.CallService_cxjb("YYJK006");

            if (result != 1)
            {
                throw new Exception("异地出院办理医保执行出错!!!");
            }
            var data = XmlHelp.DeSerializerModel(new LeaveHospitalHandleJsonDto(), true);

            if (data != null)
            {
                resultData.OperationTime = data.OperationTime;
            }
            return(resultData);
        }
Exemple #2
0
        /// <summary>
        ///查询医保出院结算信息
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public HospitalizationPresettlementDto QueryLeaveHospitalSettlement(QueryLeaveHospitalSettlementParam param)
        {
            var data   = new HospitalizationPresettlementDto();
            var xmlStr = XmlHelp.SaveXml(param);

            if (!xmlStr)
            {
                throw new Exception("查询医保出院结算信息保存参数出错");
            }
            int result = MedicalInsuranceDll.CallService_cxjb("CXJB012");

            if (result != 1)
            {
                throw new Exception("查询医保出院结算信息执行出错");
            }
            var dataIni = XmlHelp.DeSerializerModel(new HospitalizationPresettlementJsonDto(), true);

            if (dataIni != null)
            {
                data = AutoMapper.Mapper.Map <HospitalizationPresettlementDto>(dataIni);
            }
            return(data);
        }
Exemple #3
0
        /// <summary>
        /// 住院预结算
        /// </summary>
        /// <param name="param"></param>

        /// <returns></returns>
        public HospitalizationPresettlementDto HospitalizationPreSettlement(HospitalizationPresettlementParam param)
        {
            HospitalizationPresettlementDto data = null;
            var xmlStr = XmlHelp.SaveXml(param);

            if (!xmlStr)
            {
                return(data);
            }
            int result = MedicalInsuranceDll.CallService_cxjb("CXJB009");

            if (result != 1)
            {
                throw new Exception("居民住院预结算执行失败!!!");
            }
            var dataIni = XmlHelp.DeSerializerModel(new HospitalizationPresettlementJsonDto(), true);

            if (dataIni != null)
            {
                data = AutoMapper.Mapper.Map <HospitalizationPresettlementDto>(dataIni);
            }
            return(data);
        }
Exemple #4
0
        /// <summary>
        /// 职工生育结算
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public WorkerHospitalizationPreSettlementDto WorkerBirthSettlement(WorkerBirthSettlementParam param)
        {
            WorkerHospitalizationPreSettlementDto data = null;
            var xmlStr = XmlHelp.SaveXml(param);

            if (!xmlStr)
            {
                throw new Exception("职工生育结算保存参数出错");
            }
            int result = MedicalInsuranceDll.CallService_cxjb("SYBX003");

            if (result != 1)
            {
                throw new Exception("职工生育结算执行出错!!!");
            }
            var dataIni = XmlHelp.DeSerializerModel(new WorkerBirthPreSettlementJsonDto(), true);

            if (dataIni != null)
            {
                data = AutoMapper.Mapper.Map <WorkerHospitalizationPreSettlementDto>(dataIni);
            }
            return(data);
        }
Exemple #5
0
        /// <summary>
        /// 处方数据上传
        /// </summary>
        /// <param name="param"></param>
        /// <param name="businessId"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        private PrescriptionUploadDto PrescriptionUploadData(PrescriptionUploadParam param, string businessId,
                                                             UserInfoDto user)
        {
            var data   = new PrescriptionUploadDto();
            var rowXml = param.RowDataList.Select(c => new HospitalizationFeeUploadRowXml()
            {
                SerialNumber = c.DetailId
            }).ToList();
            var xmlStr = XmlHelp.SaveXml(param);

            if (xmlStr)
            {
                int result = MedicalInsuranceDll.CallService_cxjb("CXJB004");
                if (result == 1)
                {
                    //如果业务id存在则不直接抛出异常
                    if (!string.IsNullOrWhiteSpace(businessId))
                    {
                        data = XmlHelp.DeSerializerModel(new PrescriptionUploadDto(), false);
                    }
                    else
                    {
                        data = XmlHelp.DeSerializerModel(new PrescriptionUploadDto(), true);
                    }

                    if (data.ReturnState == "1")
                    {
                        //交易码
                        var transactionId = Guid.NewGuid().ToString("N");
                        //添加批次
                        var updateFeeParam = param.RowDataList.Select(d => new UpdateHospitalizationFeeParam
                        {
                            Id            = d.Id,
                            BatchNumber   = data.ProjectBatch,
                            TransactionId = transactionId,
                            UploadAmount  = d.Amount
                        }).ToList();
                        _medicalInsuranceSqlRepository.UpdateHospitalizationFee(updateFeeParam, false, user);

                        //回参
                        var xmlData = new HospitalizationFeeUploadXml()
                        {
                            MedicalInsuranceHospitalizationNo = param.MedicalInsuranceHospitalizationNo,
                            RowDataList = rowXml,
                        };

                        var strXmlBackParam = XmlSerializeHelper.HisXmlSerialize(xmlData);
                        user.TransKey = businessId;
                        var saveXml = new SaveXmlDataParam()
                        {
                            User = user,
                            MedicalInsuranceBackNum = "CXJB004",
                            MedicalInsuranceCode    = "31",
                            BusinessId = businessId,
                            BackParam  = strXmlBackParam
                        };
                        //存基层
                        _webBasicRepository.SaveXmlData(saveXml);
                        var batchConfirmParam = new BatchConfirmParam()
                        {
                            ConfirmType = 1,
                            MedicalInsuranceHospitalizationNo = param.MedicalInsuranceHospitalizationNo,
                            BatchNumber = data.ProjectBatch,
                            Operators   = CommonHelp.GuidToStr(user.UserId)
                        };
                        var batchConfirmData = BatchConfirm(batchConfirmParam);
                        //如果批次号确认失败,更新病人处方上传标示为 0(未上传)
                        if (batchConfirmData == false)
                        {
                            _medicalInsuranceSqlRepository.UpdateHospitalizationFee(updateFeeParam, true, user);
                        }
                    }
                }
                else
                {
                    throw new Exception("[" + user.UserId + "]" + "处方上传执行出错!!!");
                }
            }

            return(data);
        }
Exemple #6
0
        /// <summary>
        /// 取消医保出院结算
        /// </summary>
        /// <param name="param"></param>
        /// <param name="infoParam"></param>
        /// <returns></returns>
        public void LeaveHospitalSettlementCancel(LeaveHospitalSettlementCancelParam param,
                                                  LeaveHospitalSettlementCancelInfoParam infoParam)
        {
            var cancelLimit = param.CancelLimit;

            if (param.CancelLimit == "1")
            {
                Cancel(param);
                var updateParam = new UpdateMedicalInsuranceResidentSettlementParam()
                {
                    UserId = infoParam.User.UserId,
                    Id     = infoParam.Id,
                    CancelTransactionId   = infoParam.User.TransKey,
                    MedicalInsuranceState = MedicalInsuranceState.MedicalInsurancePreSettlement
                };
                //存入中间层
                _medicalInsuranceSqlRepository.UpdateMedicalInsuranceResidentSettlement(updateParam);
                //添加日志
                var logParam = new AddHospitalLogParam()
                {
                    JoinOrOldJson = JsonConvert.SerializeObject(param),
                    User          = infoParam.User,
                    Remark        = "居民住院结算取消",
                    RelationId    = infoParam.Id,
                };
                //回参构建
                var xmlData = new HospitalizationRegisterXml()
                {
                    MedicalInsuranceHospitalizationNo = param.MedicalInsuranceHospitalizationNo,
                };
                var strXmlBackParam = XmlSerializeHelper.HisXmlSerialize(xmlData);
                var saveXml         = new SaveXmlDataParam()
                {
                    User = infoParam.User,
                    MedicalInsuranceBackNum = "CXJB011",
                    MedicalInsuranceCode    = "42",
                    BusinessId = infoParam.BusinessId,
                    BackParam  = strXmlBackParam
                };
                //存基层
                _webBasicRepository.SaveXmlData(saveXml);
            }
            else if (param.CancelLimit == "2") //取消入院登记并删除资料
            {
                Cancel(param);
                //回参构建
                var xmlData = new HospitalizationRegisterCancelXml()
                {
                    MedicalInsuranceHospitalizationNo = param.MedicalInsuranceHospitalizationNo
                };
                var strXmlBackParam = XmlSerializeHelper.HisXmlSerialize(xmlData);
                var saveXml         = new SaveXmlDataParam()
                {
                    User = infoParam.User,
                    MedicalInsuranceBackNum = "CXJB004",
                    MedicalInsuranceCode    = "22",
                    BusinessId = infoParam.BusinessId,
                    BackParam  = strXmlBackParam
                };
                //存基层
                _webBasicRepository.SaveXmlData(saveXml);
            }
            void Cancel(LeaveHospitalSettlementCancelParam paramc)
            {
                var xmlStr = XmlHelp.SaveXml(paramc);

                if (xmlStr)
                {
                    int result = MedicalInsuranceDll.CallService_cxjb("CXJB011");
                    if (result == 1)
                    {
                        var data = XmlHelp.DeSerializerModel(new IniDto(), true);
                    }
                }
            }
        }