예제 #1
0
        public ApiJsonResultData MedicalInsuranceXmlCancelSettlement([FromUri] MedicalInsuranceXmlUiParam param)
        {
            return(new ApiJsonResultData(ModelState, new UiInIParam()).RunWithTry(y =>
            {
                var userBase = webServiceBasicService.GetUserBaseInfo(param.UserId);
                //更新医保信息
                var strXmlIntoParam = XmlSerializeHelper.XmlParticipationParam();
                //回参构建
                var xmlData = new HospitalSettlementCancelXml()
                {
                    SettlementNo = param.SettlementNo
                };

                var strXmlBackParam = XmlSerializeHelper.HisXmlSerialize(xmlData);
                var saveXmlData = new SaveXmlData();
                saveXmlData.OrganizationCode = userBase.OrganizationCode;
                saveXmlData.AuthCode = userBase.AuthCode;
                saveXmlData.BusinessId = param.BusinessId;
                saveXmlData.TransactionId = param.TransKey;
                saveXmlData.MedicalInsuranceBackNum = "CXJB003";
                saveXmlData.BackParam = CommonHelp.EncodeBase64("utf-8", strXmlBackParam);
                saveXmlData.IntoParam = CommonHelp.EncodeBase64("utf-8", strXmlIntoParam);
                saveXmlData.MedicalInsuranceCode = "42";
                saveXmlData.UserId = userBase.UserId;
                //存基层
                webServiceBasic.HIS_InterfaceList("38", JsonConvert.SerializeObject(saveXmlData));
            }));
        }
예제 #2
0
        public ApiJsonResultData MedicalInsuranceXmlCancel([FromUri] MedicalInsuranceXmlUiParam param)
        {
            return(new ApiJsonResultData(ModelState, new UiInIParam()).RunWithTry(y =>
            {
                var userBase = webServiceBasicService.GetUserBaseInfo(param.UserId);
                userBase.TransKey = param.TransKey;
                //回参构建
                var xmlData = new HospitalSettlementCancelXml()
                {
                    SettlementNo = param.SettlementNo,
                };
                var strXmlBackParam = XmlSerializeHelper.HisXmlSerialize(xmlData);
                var saveXml = new SaveXmlDataParam()
                {
                    User = userBase,
                    MedicalInsuranceBackNum = "CXJB011",
                    MedicalInsuranceCode = "42",
                    BusinessId = param.BusinessId,
                    BackParam = strXmlBackParam
                };
                //存基层
                webServiceBasic.SaveXmlData(saveXml);
                //var userBase = webServiceBasicService.GetUserBaseInfo(param.UserId);
                ////更新医保信息
                //var strXmlIntoParam = XmlSerializeHelper.XmlParticipationParam();
                ////回参构建
                //var xmlData = new HospitalizationRegisterCancelXml()
                //{

                //    MedicalInsuranceHospitalizationNo = "44116476",

                //};

                //var strXmlBackParam = XmlSerializeHelper.HisXmlSerialize(xmlData);
                //var saveXmlData = new SaveXmlData();
                //saveXmlData.OrganizationCode = userBase.OrganizationCode;
                //saveXmlData.AuthCode = userBase.AuthCode;
                //saveXmlData.BusinessId = param.BusinessId;
                //saveXmlData.TransactionId = Guid.Parse("EA144C5D-1146-4229-87FB-7D9EEA0B3F78").ToString("N");
                //saveXmlData.MedicalInsuranceBackNum = "CXJB003";
                //saveXmlData.BackParam = CommonHelp.EncodeBase64("utf-8", strXmlBackParam);
                //saveXmlData.IntoParam = CommonHelp.EncodeBase64("utf-8", strXmlIntoParam);
                //saveXmlData.MedicalInsuranceCode = "22";
                //saveXmlData.UserId = userBase.UserId;
                ////存基层
                //webServiceBasic.HIS_InterfaceList("38", JsonConvert.SerializeObject(saveXmlData));
            }));
        }
        /// <summary>
        ///取消结算
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public string WorkerSettlementCancel(WorkerSettlementCancelParam param)
        {
            string resultData = null;

            if (param.CancelLimit == "1")
            { //划卡取消
                if (param.WorkersStrokeCardNo != null)
                {
                    _workerMedicalInsuranceRepository.CancelWorkerStrokeCard(new CancelWorkersStrokeCardParam()
                    {
                        WorkersStrokeCardNo = param.WorkersStrokeCardNo,
                        Operate             = param.User.UserName,
                        Remarks             = param.CancelSettlementRemarks
                    });
                }

                // 结算取消
                resultData = _workerMedicalInsuranceRepository.WorkerSettlementCancel(param);
                //取消交易id
                var cancelTransactionId = param.User.TransKey;
                //回参构建
                var xmlData = new HospitalSettlementCancelXml()
                {
                    SettlementNo = param.SettlementNo,
                };
                var strXmlBackParam = XmlSerializeHelper.HisXmlSerialize(xmlData);
                var saveXml         = new SaveXmlDataParam()
                {
                    User = param.User,
                    MedicalInsuranceBackNum = param.MedicalInsuranceHospitalizationNo,
                    MedicalInsuranceCode    = "42",
                    BusinessId = param.BusinessId,
                    BackParam  = strXmlBackParam
                };
                //存基层
                _webBasicRepository.SaveXmlData(saveXml);
                var updateParam = new UpdateMedicalInsuranceResidentSettlementParam()
                {
                    UserId = param.User.UserId,
                    Id     = param.Id,
                    CancelTransactionId     = cancelTransactionId,
                    MedicalInsuranceState   = MedicalInsuranceState.MedicalInsurancePreSettlement,
                    CancelSettlementRemarks = param.CancelSettlementRemarks
                };
                //存入中间层
                _medicalInsuranceSqlRepository.UpdateMedicalInsuranceResidentSettlement(updateParam);
                //添加日志
                var logParam = new AddHospitalLogParam()
                {
                    JoinOrOldJson   = JsonConvert.SerializeObject(param),
                    ReturnOrNewJson = "{ yearSign= " + resultData + " }",
                    User            = param.User,
                    Remark          = "职工住院结算取消",
                    RelationId      = param.Id,
                };
                _systemManageRepository.AddHospitalLog(logParam);
            }
            else if (param.CancelLimit == "2")//取消结算,并删除资料<==>删除资料与取消入院
            {
                //回参构建
                var xmlData = new HospitalizationRegisterXml()
                {
                    MedicalInsuranceHospitalizationNo = param.MedicalInsuranceHospitalizationNo,
                };
                var strXmlBackParam = XmlSerializeHelper.HisXmlSerialize(xmlData);
                var saveXml         = new SaveXmlDataParam()
                {
                    User = param.User,
                    MedicalInsuranceBackNum = "Qxjs",
                    MedicalInsuranceCode    = "22",
                    BusinessId = param.BusinessId,
                    BackParam  = strXmlBackParam
                };
                //存基层
                _webBasicRepository.SaveXmlData(saveXml);

                var updateParamData = new UpdateMedicalInsuranceResidentSettlementParam()
                {
                    UserId = param.User.UserId,
                    Id     = param.Id,
                    CancelTransactionId   = param.User.TransKey,
                    MedicalInsuranceState = MedicalInsuranceState.MedicalInsuranceCancelSettlement,
                    IsHisUpdateState      = true
                };
                //更新中间层
                _medicalInsuranceSqlRepository.UpdateMedicalInsuranceResidentSettlement(updateParamData);
            }



            //if (param.CancelLimit == "2") //取消结算,并删除资料<==>删除资料与取消入院
            //{
            //    //回参构建
            //    var xmlData = new HospitalizationRegisterXml()
            //    {
            //        MedicalInsuranceHospitalizationNo = param.MedicalInsuranceHospitalizationNo,
            //    };
            //    var strXmlBackParam = XmlSerializeHelper.HisXmlSerialize(xmlData);
            //    var saveXml = new SaveXmlDataParam()
            //    {
            //        User = param.User,
            //        MedicalInsuranceBackNum = "Qxjs",
            //        MedicalInsuranceCode = "22",
            //        BusinessId = param.BusinessId,
            //        BackParam = strXmlBackParam
            //    };
            //    //存基层
            //    _webBasicRepository.SaveXmlData(saveXml);

            //    var updateParamData = new UpdateMedicalInsuranceResidentSettlementParam()
            //    {
            //        UserId = param.User.UserId,
            //        Id = param.Id,
            //        CancelTransactionId = cancelTransactionId,
            //        MedicalInsuranceState = MedicalInsuranceState.MedicalInsuranceCancelSettlement,
            //        IsHisUpdateState = true
            //    };
            //    //更新中间层
            //    _medicalInsuranceSqlRepository.UpdateMedicalInsuranceResidentSettlement(updateParamData);

            //}
            return(resultData);
        }