/// <summary>
        /// 获取个人基础资料
        /// </summary>
        /// <param name="param"></param>

        public async Task <UserInfoDto> GetUserInfo(ActiveUserInfoParam param)
        {
            return(await Task.Run(async() =>
            {
                var data = new UserInfoDto();

                var xmlStr = XmlHelp.SaveXml(param);
                if (xmlStr)
                {
                    int result = WorkersMedicalInsurance.CallService_cxjb("CXJB001");
                    if (result == 1)
                    {
                        data = XmlHelp.DeSerializerModel(new UserInfoDto());
                    }
                    else
                    {
                        throw new Exception("居民个人基础资料执行失败!!!");
                    }
                }



                return data;
            }));
        }
        /// <summary>
        /// 特殊疾病报销查询
        /// </summary>
        public string IdentificationSpecialReimbursementQuery(string param)
        {
            var resultData = new ApiJsonResultDatas {
                Code = true
            };

            try
            {
                // var paramIni = JsonConvert.DeserializeObject<IdentificationSpecialReimbursementQueryParam>(param);

                var xmlStr = XmlHelp.SaveXml(param);
                if (xmlStr)
                {
                    int result = WorkersMedicalInsurance.CallService_cxjb("MTBX008");
                    if (result == 1)
                    {
                        var dataValid = XmlHelp.ValidXml("PO_JSXX");
                        if (dataValid.PO_FHZ == "1")
                        {
                            if (dataValid.IsRows)
                            {
                                var data = XmlHelp.DeSerializerModels(
                                    new IdentificationSpecialReimbursementQueryListDto());
                                resultData.Data = JsonConvert.SerializeObject(data);
                            }
                            else
                            {
                                var data = XmlHelp.DeSerializerModels(
                                    new IdentificationSpecialReimbursementQueryDto());
                                resultData.Data = JsonConvert.SerializeObject(data);
                            }
                        }
                        else
                        {
                            throw new Exception(dataValid.PO_MSG);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                resultData.Code    = false;
                resultData.Message = e.Message;
                Logs.LogWrite(new LogParam()
                {
                    Msg          = e.Message,
                    OperatorCode = "",
                    Params       = Logs.ToJson(param),
                });
            }
            return(JsonConvert.SerializeObject(resultData));
        }
        /// <summary>
        /// 获取个人基础资料
        /// </summary>
        /// <param name="param"></param>

        public string GetUserInfo(string param)
        {
            var resultData = new ApiJsonResultDatas {
                Code = true
            };
            var data = new IniDto();

            try
            {
                var dataIni = WorkersMedicalInsurance.ConnectAppServer_cxjb("cpq2677", "888888");
                if (dataIni == 1)
                {
                    // var paramIni= JsonConvert.DeserializeObject<UserInfoParam>(param);
                    var xmlStr = XmlHelp.SaveXml(param);
                    if (xmlStr)
                    {
                        int result = WorkersMedicalInsurance.CallService_cxjb("CXJB001");
                        if (result == 1)
                        {
                            data = XmlHelp.DeSerializerModels(new UserInfoDto());
                            if (data.PO_FHZ == "1")
                            {
                                resultData.Data = JsonConvert.SerializeObject(data);
                            }
                            else
                            {
                                throw new Exception(data.PO_MSG);
                            }
                        }
                        else
                        {
                            throw new Exception("系统登录失败!!!");
                        }
                    }
                }
            }
            catch (Exception e)
            {
                resultData.Code    = false;
                resultData.Message = e.Message;
                Logs.LogWrite(new LogParam()
                {
                    Msg = e.Message,

                    Params     = Logs.ToJson(param),
                    ResultData = Logs.ToJson(data)
                });
            }

            return(JsonConvert.SerializeObject(resultData));
        }
Exemplo n.º 4
0
        /// <summary>
        /// 住院资料修改
        /// </summary>
        /// <returns></returns>
        public string SingleHospitalizationModify(string param, HisBaseParam baseParam)
        {
            var resultData = new ApiJsonResultDatas {
                Code = true
            };
            var data = new SingleHospitalizationModifyDto();

            try
            {
                var paramIni = JsonConvert.DeserializeObject <SingleHospitalizationModifyParam>(param);

                var xmlStr = XmlHelp.SaveXml(param);
                if (xmlStr)
                {
                    int result = WorkersMedicalInsurance.CallService_cxjb("TPYP202");
                    if (result == 1)
                    {
                        data = XmlHelp.DeSerializerModel(new SingleHospitalizationModifyDto());
                        if (data.PO_FHZ == "1")
                        {
                            resultData.Data = JsonConvert.SerializeObject(data);
                        }
                        else
                        {
                            throw new Exception(data.PO_MSG);
                        }

                        Logs.LogWrite(new LogParam()
                        {
                            Msg          = data.PO_MSG,
                            OperatorCode = "",
                            Params       = Logs.ToJson(param),
                            ResultData   = Logs.ToJson(data)
                        });
                    }
                }
            }
            catch (Exception e)
            {
                resultData.Code    = false;
                resultData.Message = e.Message;
                Logs.LogWrite(new LogParam()
                {
                    Msg          = e.Message,
                    OperatorCode = "",
                    Params       = Logs.ToJson(param),
                    ResultData   = Logs.ToJson(data)
                });
            }
            return(JsonConvert.SerializeObject(resultData));
        }
        /// <summary>
        /// 处方明细查询
        /// </summary>
        public string PrescriptionDetailQuery(string param)
        {
            var resultData = new ApiJsonResultDatas {
                Code = true
            };

            try
            {
                //var paramIni = JsonConvert.DeserializeObject<PrescriptionDetailQueryParam>(param);

                var xmlStr = XmlHelp.SaveXml(param);
                if (xmlStr)
                {
                    int result = WorkersMedicalInsurance.CallService_cxjb("CXJB006");
                    if (result == 1)
                    {
                        var validData = XmlHelp.ValidXml("CFMX");
                        if (validData.PO_FHZ == "1")
                        {
                            if (validData.IsRows)
                            {
                                var data = XmlHelp.DeSerializerModels(new PrescriptionDetailQueryRow());
                                resultData.Data = JsonConvert.SerializeObject(data);
                            }
                            else
                            {
                                var data = XmlHelp.DeSerializerModels(new PrescriptionDetailQueryDto());
                                resultData.Data = JsonConvert.SerializeObject(data);
                            }
                        }
                        else
                        {
                            throw new Exception(validData.PO_MSG);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                resultData.Code    = false;
                resultData.Message = e.Message;
                Logs.LogWrite(new LogParam()
                {
                    Msg          = e.Message,
                    OperatorCode = "",
                    Params       = Logs.ToJson(param),
                });
            }
            return(JsonConvert.SerializeObject(resultData));
        }
        /// <summary>
        /// 项目下载
        /// </summary>
        public string ProjectDownload(string param)
        {
            var resultData = new ApiJsonResultDatas {
                Code = true
            };
            var data = new IniDto();

            try
            {
                // var paramIni = JsonConvert.DeserializeObject<ProjectDownloadParam>(param);

                var xmlStr = XmlHelp.SaveXml(param);
                if (xmlStr)
                {
                    int result = WorkersMedicalInsurance.CallService_cxjb("CXJB019");
                    if (result == 1)
                    {
                        data = XmlHelp.DeSerializerModels(new ProjectDownloadDto());
                        if (data.PO_FHZ == "1")
                        {
                            resultData.Data = JsonConvert.SerializeObject(data);
                        }
                        else
                        {
                            throw new Exception(data.PO_MSG);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                resultData.Code    = false;
                resultData.Message = e.Message;
                Logs.LogWrite(new LogParam()
                {
                    Msg          = e.Message,
                    OperatorCode = "",
                    Params       = Logs.ToJson(param),
                    ResultData   = Logs.ToJson(data)
                });
            }

            return(JsonConvert.SerializeObject(resultData));
        }
 /// <summary>
 /// 入院登记
 /// </summary>
 /// <returns></returns>
 public async Task <HospitalizationRegisterDto> HospitalizationRegister(HospitalizationRegisterParam param)
 {
     return(await Task.Run(async() =>
     {
         var data = new HospitalizationRegisterDto();
         var xmlStr = XmlHelp.SaveXml(param);
         if (xmlStr)
         {
             int result = WorkersMedicalInsurance.CallService_cxjb("CXJB002");
             if (result == 1)
             {
                 data = XmlHelp.DeSerializerModel(new HospitalizationRegisterDto());
             }
             else
             {
                 throw  new  Exception("居民入院登记执行失败!!!");
             }
         }
         return data;
     }));
 }
        /// <summary>
        /// 项目下载
        /// </summary>
        public async Task <ProjectDownloadDto> ProjectDownload(ProjectDownloadParam param)
        {
            return(await Task.Run(async() =>
            {
                var data = new ProjectDownloadDto();
                var xmlStr = XmlHelp.SaveXml(param);
                if (xmlStr)
                {
                    int result = WorkersMedicalInsurance.CallService_cxjb("CXJB019");
                    if (result == 1)
                    {
                        data = XmlHelp.DeSerializerModel(new ProjectDownloadDto());
                    }
                }
                else
                {
                    throw new Exception("居民项目下载执行失败!!!");
                }

                return data;
            }));
        }