微信电子健康卡——注册健康卡接口

﹥>﹥吖頭↗ 提交于 2019-12-17 02:36:12
        //注册单个注册健康卡

        public string Lx_registerHealthCard(string lxbirthday, string lxidtype, string lxgender, string lxidCard,string lxname,string lxnation,string lxaddress,string lxphone1,string lxwechatcode)
        {
            var result = proxy.RegisterHealthCard(
                new RegisterHealthCardReq
                {
                    birthday = lxbirthday,
                    idType = lxidtype,
                    gender = lxgender,
                    idNumber = lxidCard,
                    name = lxname,
                    nation = lxnation,
                    phone1 = lxphone1,
                    
                    wechatCode = lxwechatcode

                },
                new com.tencent.healthcard.HealthCardOpenAPI.CommonIn
                {
                    requestId = System.Guid.NewGuid().ToString(),
                    hospitalId = LxAppConfig.GetHospitalId(),
                    //channelNum = 0,
                    appToken = appToken
                }
            );

            var commonOut =(com.tencent.healthcard.HealthCardOpenAPI.CommonOut)result["commonOut"];
            var rsp = (RegisterHealthCardRsp)result["rsp"];
            return JsonConvert.SerializeObject(rsp);

        }

        //注册批量健康卡
        public string Lx_RegisterBatchHealthCard()
        {
            #region 测试和程序代码
            
            BatchHealthCardItem[] items = new BatchHealthCardItem[2];
            for (int i = 0; i < 2; i++)
            {
                BatchHealthCardItem item = new BatchHealthCardItem
                {
                    birthday = "1996-01-23",
                    idType = "01",
                    gender = "男",
                    idCard = "432901196310056419",
                    name = "蒋建正",
                    nation = "汉族",
                    phone1 = "18656130435",
                    wechatCode = "13B8AC208CEDACE7DD1DF57963150664"
                };
                items[i] = item;
            }

            var result = proxy.RegisterBatchHealthCard(
                new RegisterBatchHealthCardReq
                {
                    healthCardItems = items
                },
                new com.tencent.healthcard.HealthCardOpenAPI.CommonIn
                {
                    requestId = System.Guid.NewGuid().ToString(),
                    hospitalId = "20006",
                    appToken = appToken
                }
            );
            var commonOut = (com.tencent.healthcard.HealthCardOpenAPI.CommonOut)result["commonOut"];
            var rsp = (RegisterBatchHealthCardRsp)result["rsp"];
            return JsonConvert.SerializeObject(rsp);
        }

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!