Пример #1
0
 public ApiJsonResultData CancelOutpatientDepartmentCost([FromUri] CancelOutpatientDepartmentCostUiParam param)
 {
     return(new ApiJsonResultData(ModelState).RunWithTry(y =>
     {
         var userBase = webServiceBasicService.GetUserBaseInfo(param.UserId);
         userBase.TransKey = param.TransKey;
         var xmlData = new MedicalInsuranceXmlDto();
         xmlData.BusinessId = param.BusinessId;
         xmlData.HealthInsuranceNo = "42";//42MZ
         xmlData.TransactionId = param.TransKey;
         xmlData.AuthCode = userBase.AuthCode;
         xmlData.UserId = param.UserId;
         xmlData.OrganizationCode = userBase.OrganizationCode;
         var jsonParam = JsonConvert.SerializeObject(xmlData);
         var data = webServiceBasic.HIS_Interface("39", jsonParam);
         HisHospitalizationSettlementCancelJsonDto dataValue = JsonConvert.DeserializeObject <HisHospitalizationSettlementCancelJsonDto>(data.Msg);
         //{\"基础信息\":{\"ORGID\":\"9F44A548B22A4F84BC59A59FF4796D53\",\"YBCODE\":\"123\",\"INFID\":\"6F63E04260974852B0F461D6108DB688\",\"结算编号\":\"34556\",\"就诊编号\":\"34556\",\"经办人\":\"医保接口\"}}
         ////回参构建
         var xmlDatas = new OutpatientDepartmentCostCancelXml()
         {
             SettlementNo = dataValue.InfoData.SettlementNo
         };
         var strXmlBackParam = XmlSerializeHelper.HisXmlSerialize(xmlDatas);
         var saveXml = new SaveXmlDataParam()
         {
             User = userBase,
             MedicalInsuranceBackNum = "Qxjs",
             MedicalInsuranceCode = "42MZ",
             BusinessId = param.BusinessId,
             BackParam = strXmlBackParam
         };
         //存基层
         webServiceBasic.SaveXmlData(saveXml);
         //_outpatientDepartmentNewService.CancelOutpatientDepartmentCost(param);
     }));
 }
        //门诊取消结算
        public void CancelOutpatientDepartmentCost(CancelOutpatientDepartmentCostUiParam param)
        {
            var userBase = _serviceBasicService.GetUserBaseInfo(param.UserId);

            userBase.TransKey = param.TransKey;
            //获取医保病人信息
            var queryResidentParam = new QueryMedicalInsuranceResidentInfoParam()
            {
                BusinessId       = param.BusinessId,
                OrganizationCode = userBase.OrganizationCode
            };
            var residentData = _medicalInsuranceSqlRepository.QueryMedicalInsuranceResidentInfo(queryResidentParam);

            if (residentData == null)
            {
                throw new Exception("当前病人未结算,不能取消结算!!!");
            }
            if (residentData.MedicalInsuranceState != MedicalInsuranceState.HisSettlement)
            {
                throw new Exception("当前病人未结算,不能取消结算!!!");
            }
            //计划生育
            if (residentData.IsBirthHospital == 1)
            {
                _outpatientDepartmentRepository.OutpatientPlanBirthSettlementCancel(new OutpatientPlanBirthSettlementCancelParam()
                {
                    SettlementNo  = residentData.SettlementNo,
                    CancelRemarks = param.CancelSettlementRemarks
                });
            }
            else  //普通门诊
            {
                _outpatientDepartmentRepository.CancelOutpatientDepartmentCost(new CancelOutpatientDepartmentCostParam()
                {
                    DocumentNo = residentData.SettlementNo
                });
            }



            //添加日志
            var logParam = new AddHospitalLogParam()
            {
                JoinOrOldJson = JsonConvert.SerializeObject(param),
                User          = userBase,
                Remark        = "门诊取消结算",
                RelationId    = residentData.Id,
                BusinessId    = param.BusinessId,
            };

            _systemManageRepository.AddHospitalLog(logParam);

            //回参构建
            var xmlData = new OutpatientDepartmentCostCancelXml()
            {
                SettlementNo = residentData.SettlementNo
            };
            var strXmlBackParam = XmlSerializeHelper.HisXmlSerialize(xmlData);
            var saveXml         = new SaveXmlDataParam()
            {
                User = userBase,
                MedicalInsuranceBackNum = "Qxjs",
                MedicalInsuranceCode    = "42MZ",
                BusinessId = param.BusinessId,
                BackParam  = strXmlBackParam
            };

            //存基层
            _webBasicRepository.SaveXmlData(saveXml);

            var updateParamData = new UpdateMedicalInsuranceResidentSettlementParam()
            {
                UserId = param.UserId,
                Id     = residentData.Id,
                CancelTransactionId     = param.TransKey,
                MedicalInsuranceState   = MedicalInsuranceState.MedicalInsuranceCancelSettlement,
                IsHisUpdateState        = true,
                CancelSettlementRemarks = param.CancelSettlementRemarks
            };

            //更新中间层
            _medicalInsuranceSqlRepository.UpdateMedicalInsuranceResidentSettlement(updateParamData);
        }
Пример #3
0
        public ApiJsonResultData MedicalInsuranceXmlCancelSettlement([FromUri] MedicalInsuranceXmlUiParam param)
        {
            return(new ApiJsonResultData(ModelState, new UiInIParam()).RunWithTry(y =>
            {
                var userBase = webServiceBasicService.GetUserBaseInfo(param.UserId);
                userBase.TransKey = param.TransKey;

                //回参构建
                var xmlData = new OutpatientDepartmentCostCancelXml()
                {
                    SettlementNo = param.SettlementNo
                };
                var strXmlBackParam = XmlSerializeHelper.HisXmlSerialize(xmlData);
                var saveXml = new SaveXmlDataParam()
                {
                    User = userBase,
                    MedicalInsuranceBackNum = "Qxjs",
                    MedicalInsuranceCode = "42MZ",
                    BusinessId = param.BusinessId,
                    BackParam = strXmlBackParam
                };
                //存基层
                webServiceBasic.SaveXmlData(saveXml);

                ////回参构建
                //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 ddd = "123";
                ////更新医保信息
                //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));
            }));
        }