Exemple #1
0
        /// <summary>
        /// 8、	注册(创建)医院
        /// </summary>
        /// <param name="title">医院名称</param>
        /// <param name="contact">联系人</param>
        /// <param name="idcard">18位身份证</param>
        /// <param name="mobile">手机,后6位为管理员的登录密码</param>
        /// <returns></returns>
        /// Jack Ding
        public HospitalRegisterResponse Register(string token, string title, string contact, string idcard, string mobile, string address, string telphone, string deptname)
        {
            string strResponse = string.Empty;
            HospitalRegisterResponse response = new HospitalRegisterResponse();

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();
                sPara.Add("title", title);
                sPara.Add("contact", contact);
                sPara.Add("idcard", idcard);
                sPara.Add("mobile", mobile);
                sPara.Add("address", address);
                sPara.Add("tel", telphone);
                sPara.Add("deptname", deptname);

                strResponse = F8YLSubmit.BuildRequest(sPara, "hospital/register?token=" + token);

                response = JsonHelper.DeserializeJsonToObject <HospitalRegisterResponse>(strResponse);

                return(response);
            }
            catch
            {
                throw;
            }
        }
Exemple #2
0
        /// <summary>
        /// 15、	创建模板
        /// </summary>
        /// <param name="name">模板名称</param>
        /// <param name="period">周期(应大于0)</param>
        /// <param name="freqs">一个周其内的次研究次数</param>
        /// <param name="editbypat">是否可由病人编辑</param>
        /// <param name="kindid">模板种类id(如:10:术前,20:访问等)</param>
        /// <param name="remark">简要说明</param>
        /// <param name="sharpid">它的作用是为了将一个模板中的指标人为地分若干个片</param>
        /// <param name="termid"></param>
        /// <returns></returns>
        /// Jack Ding
        public TplCreateResponse TplCreate(string name, int period, int freqs, int editbypat, int kindid, string remark, int[] sharpid, int[] termid, string token)
        {
            string            strResponse = string.Empty;
            TplCreateResponse response    = new TplCreateResponse();

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();
                sPara.Add("name", name);
                sPara.Add("period", period.ToString());
                sPara.Add("freqs", freqs.ToString());
                sPara.Add("editbypat", editbypat.ToString());
                sPara.Add("kindid", kindid.ToString());
                sPara.Add("remark", remark);

                Dictionary <string, string[]> sParas = new Dictionary <string, string[]>();
                sParas.Add("sharpid[]", Array.ConvertAll(sharpid, new Converter <int, string>(F8YLCore.IntToStr)));
                sParas.Add("termid[]", Array.ConvertAll(termid, new Converter <int, string>(F8YLCore.IntToStr)));

                strResponse = F8YLSubmit.BuildRequest(sParas, sPara, "tpl/create?token=" + token);

                response = JsonHelper.DeserializeJsonToObject <TplCreateResponse>(strResponse);

                return(response);
            }
            catch
            {
                throw;
            }
        }
Exemple #3
0
        /// <summary>
        /// 1、	登录
        /// </summary>
        /// <param name="loginname">登录名(手机号或身分证)</param>
        /// <param name="password">密码的md5值</param>
        /// <returns></returns>
        /// Jerry Shi
        public string Login(string loginname, string password)
        {
            string apiResponse = string.Empty;

            //LoginResponse response = new LoginResponse();
            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();

                password = F8YLMD5.Sign(password);
                sPara.Add("loginname", loginname);
                sPara.Add("password", password);
                apiResponse = F8YLSubmit.BuildRequest(sPara, "auth/login");
                //response = JsonHelper.DeserializeJsonToObject<LoginResponse>(strResponse);

                //string token = response.data.token;

                //F8YLConfig.Token = "f04ea436bc0ff295ac6631647ccb05e4";
                //response = Logout();
            }
            catch (Exception)
            {
                throw;
            }

            return(apiResponse);
        }
Exemple #4
0
        /// <summary>
        /// 48、	消息发送
        /// </summary>
        /// <param name="token">token</param>
        /// <param name="type">10为公告; 0为消息 type=10,targetid=项目id --表示项目公告;2,type=0,targetid=0--表示广播消息;3,type=0,targetid=用户id--表示发送好友消息;</param>
        /// <param name="targetid">当type为10时,targerid可以为项目id或userid,如果它为空且type为0就表示广播</param>
        /// <param name="content">消息内容</param>
        /// <param name="url">完整的url信息,表示该消息要链接到目标地址</param>
        /// <param name="label">要显示的文本</param>
        /// <returns></returns>
        public string send(string token, string type, string targetid, string content, string url, string label)
        {
            try
            {
                string ApiResponse = string.Empty;
                //RecvResponse recvResponse = new RecvResponse();
                Dictionary <string, string> sPara = new Dictionary <string, string>();

                sPara.Add("type", type);
                //string targetParam = "&";
                //string[] tID = targetid.Split(',');
                //for (int i = 0; i < tID.Length; i++)
                //{
                //    targetParam = targetParam + "targetid[]=" + tID[i] + "&";
                //}
                //targetParam = targetParam.Substring(0, targetParam.Length - 1);
                string[] tID = targetid.Split(',');
                Dictionary <string, string[]> sParas = new Dictionary <string, string[]>();
                sParas.Add("targetid[]", tID);

                sPara.Add("content", content);
                sPara.Add("url", url);
                sPara.Add("label", label);
                ApiResponse = F8YLSubmit.BuildRequest(sParas, sPara, "message/send?token=" + token);  //+ targetParam
                //recvResponse = JsonHelper.DeserializeJsonToObject<RecvResponse>(ApiResponse);

                return(ApiResponse);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #5
0
        /// <summary>
        /// 33、	为项目添加医生
        /// </summary>
        /// <param name="token">token</param>
        /// <param name="projectid">项目id</param>
        /// <param name="doctorid">doctorid序列,实为医生的userid,它们所对应的PI为当前登录用户</param>
        /// <param name="overwrite">是否覆盖之前的医生</param>
        /// <returns></returns>
        /// Jerry Shi
        public string DoctorAppend(string token, string projectid, string doctorid, bool overwrite, string num_goal)
        {
            string apiRespone = string.Empty;

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();

                sPara.Add("projectid", projectid);

                //List<string> doctoridList = JsonHelper.DeserializeJsonToObject<List<string>>(doctorid);
                //foreach (string item in doctoridList)
                //{
                //    sPara.Add("doctorid[]", item);
                //}
                string[] dID = doctorid.Split(',');
                Dictionary <string, string[]> sParas = new Dictionary <string, string[]>();
                sParas.Add("doctorid[]", dID);

                sPara.Add("overwrite", overwrite == true ? "true" : "false");
                sPara.Add("num_goal", num_goal);
                apiRespone = F8YLSubmit.BuildRequest(sParas, sPara, "project/doctor/append?token=" + token);
            }
            catch (Exception ex)
            {
                AppLog.Instance.Write("DoctorAppend", AppLog.LogMessageType.Error, ex);
            }
            return(apiRespone);
        }
Exemple #6
0
        /// <summary>
        /// 44、	项目变换(修改)
        /// </summary>
        /// <param name="projectid">指标id序列</param>
        /// <param name="piid">id序列</param>
        /// <returns></returns>
        /// Gerry Ge
        ///
        public string Change(string token, string projectid, string piid, string projectname, string num_goal, string opendate, string closedate)
        {
            string strResponse = string.Empty;

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();
                sPara.Add("projectid", projectid);
                sPara.Add("piid[]", piid);
                if (projectname != "")
                {
                    sPara.Add("name", projectname);
                }
                if (num_goal != "")
                {
                    sPara.Add("num_goal", num_goal);
                }
                if (opendate != "")
                {
                    sPara.Add("opendate", opendate);
                }
                if (closedate != "")
                {
                    sPara.Add("closedate", closedate);
                }

                strResponse = F8YLSubmit.BuildRequest(sPara, "project/change?token=" + token);
            }
            catch (Exception ex)
            {
                AppLog.Instance.Write("Change", AppLog.LogMessageType.Error, ex);
            }
            return(strResponse);
        }
Exemple #7
0
        /// <summary>
        /// 22、	提交报告(保存调研报告)
        /// </summary>
        /// <param name="tplid">模板id</param>
        /// <param name="name">报告的title</param>
        /// <param name="remark">报告简要说明</param>
        /// <param name="id">如果存在表示修改</param>
        /// <param name="detailid">特别注意:这个id来自于”模板”与”指标”之间的那个关系id</param>
        /// <param name="answer">答案值</param>
        /// <returns></returns>
        /// Jack Ding
        public string TplReportCommit(string token, string tplid, string periodid, string detailids, string answers, string patientid)
        {
            string apiResponse = string.Empty;

            //TplReportCommitResponse response = new TplReportCommitResponse();
            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();
                sPara.Add("tplid", tplid);
                sPara.Add("periodid", periodid);
                sPara.Add("patientid", patientid);

                Dictionary <string, string[]> sParas = new Dictionary <string, string[]>();

                string[] reportDetailIds = detailids.Substring(0, detailids.Length - 1).Split('$');
                string[] reportAnswers   = reportAnswers = answers.Substring(0, answers.Length - 1).Split('$');

                sParas.Add("detailid[]", reportDetailIds);
                sParas.Add("answer[]", reportAnswers);

                apiResponse = F8YLSubmit.BuildRequest(sParas, sPara, "tpl/report/commit?token=" + token);

                //apiResponse = JsonHelper.DeserializeJsonToObject<TplReportCommitResponse>(strResponse);

                return(apiResponse);
            }
            catch
            {
                throw;
            }
        }
Exemple #8
0
        /// <summary>
        /// 4、用户详情设置
        /// </summary>
        /// <param name="token"></param>
        /// <param name="username"></param>
        /// <param name="truename"></param>
        /// <param name="deptid"></param>
        /// <param name="avatar"></param>
        /// <param name="age"></param>
        /// <returns></returns>
        /// Jack Ding
        public string SaveUserProfile(string token, string username, string truename, string deptid, string avatar, string age, string duty, string tel, string email, string userid)
        {
            string strReturn = string.Empty;

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();

                sPara.Add("username", username);
                sPara.Add("truename", truename);
                sPara.Add("deptname", deptid);
                if (avatar != string.Empty)
                {
                    sPara.Add("avatar", avatar);
                }
                sPara.Add("age", age);
                sPara.Add("duty", duty);
                sPara.Add("tel", tel);
                sPara.Add("email", email);
                if (!string.IsNullOrEmpty(userid))
                {
                    sPara.Add("userid", userid);
                }

                strReturn = F8YLSubmit.BuildRequest(sPara, "ucenter/user/profile?token=" + token);
            }
            catch (Exception ex)
            {
                AppLog.Instance.Write("SaveUserProfile", AppLog.LogMessageType.Error, ex);
            }

            return(strReturn);
        }
Exemple #9
0
        /// <summary>
        /// 19、	模板变换(修改)
        /// </summary>
        /// <param name="period">data中的period周期</param>
        /// <param name="freqs">data中的freqs频次</param>
        /// <param name="termids">tpl_detail中的termid数组</param>
        /// <param name="ids">tpl_detail中的id数组</param>
        /// <param name="editbypats">tpl_detail中的editbypat数组</param>
        /// <param name="token"></param>
        /// <returns></returns>
        /// Gerry Ge
        public string TplChange(string id, string period, string freqs, string termids, string ids, string editbypats, string token)
        {
            string            strResponse = string.Empty;
            TplChangeResponse response    = new TplChangeResponse();

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();

                sPara.Add("period", period);
                sPara.Add("freqs", freqs);

                Dictionary <string, string[]> sParas = new Dictionary <string, string[]>();
                string[] Tpltermids    = termids.Split(',');
                string[] Tplids        = ids.Split(',');
                string[] Tpleditbypats = editbypats.Split(',');
                sParas.Add("id[]", Tplids);
                sParas.Add("termid[]", Tpltermids);
                sParas.Add("editbypat[]", Tpleditbypats);

                strResponse = F8YLSubmit.BuildRequest(sParas, sPara, "tpl/change?token=" + token + "&id=" + id);

                //response = JsonHelper.DeserializeJsonToObject<TplChangeResponse>(strResponse);

                return(strResponse);
            }
            catch
            {
                throw;
            }
        }
Exemple #10
0
        /// <summary>
        ///  6、	添加用户
        /// </summary>
        /// <param name="token"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        /// Gerry Ge
        /// 请求方式:POST
        public string AddUser(string token, UserAddResponseDataEntity user)
        {
            string             strResponse = string.Empty;
            UserJoinedResponse apiResponse = new UserJoinedResponse();

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();
                foreach (System.Reflection.PropertyInfo p in user.GetType().GetProperties())
                {
                    if (p.Name == "hospitalid")
                    {
                        sPara.Add(p.Name, p.GetValue(user).ToString());
                    }
                    else if (p.Name == "role")
                    {
                        sPara.Add(p.Name, p.GetValue(user).ToString());
                    }
                    else if (p.Name == "idcard")
                    {
                        sPara.Add(p.Name, p.GetValue(user).ToString());
                    }
                    else if (p.Name == "username")
                    {
                        sPara.Add(p.Name, p.GetValue(user).ToString());
                    }
                    else if (p.Name == "mobile")
                    {
                        sPara.Add(p.Name, p.GetValue(user).ToString());
                    }
                    else if (p.Name == "email")
                    {
                        sPara.Add(p.Name, p.GetValue(user).ToString());
                    }
                    else if (p.Name == "deptname")
                    {
                        sPara.Add(p.Name, p.GetValue(user).ToString());
                    }
                    else if (p.Name == "duty")
                    {
                        sPara.Add(p.Name, p.GetValue(user).ToString());
                    }
                    else if (p.Name == "tel")
                    {
                        sPara.Add(p.Name, p.GetValue(user).ToString());
                    }
                }

                strResponse = F8YLSubmit.BuildRequest(sPara, "ucenter/user/add?token=" + token);
            }
            catch (Exception)
            {
            }
            return(strResponse);
        }
Exemple #11
0
        /// <summary>
        /// 更新医院信息
        /// </summary>
        /// <param name="token"></param>
        /// <param name="id">医院id</param>
        /// <param name="info">更新信息</param>
        /// <returns></returns>
        public string Edit(string token, string id, HospitalEntity info)
        {
            string strResponse = string.Empty;

            //HospitalDetailResponse response = new HospitalDetailResponse();
            //string id, string title, string contact, string mobile, string address
            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();

                sPara.Add("id", id);
                foreach (System.Reflection.PropertyInfo p in info.GetType().GetProperties())
                {
                    if (p.Name == "title")
                    {
                        sPara.Add(p.Name, p.GetValue(info).ToString());
                    }
                    else if (p.Name == "contact")
                    {
                        sPara.Add(p.Name, p.GetValue(info).ToString());
                    }
                    else if (p.Name == "mobile")
                    {
                        sPara.Add(p.Name, p.GetValue(info).ToString());
                    }
                    else if (p.Name == "address")
                    {
                        sPara.Add(p.Name, p.GetValue(info).ToString());
                    }
                    else if (p.Name == "telphone")
                    {
                        sPara.Add(p.Name, p.GetValue(info).ToString());
                    }
                    else if (p.Name == "deptname")
                    {
                        sPara.Add(p.Name, p.GetValue(info).ToString());
                    }
                    //if (p.Name != "id" || p.Name != "adminid")
                    //{
                    //    sPara.Add(p.Name, p.GetValue(info).ToString());
                    //}
                }

                strResponse = F8YLSubmit.BuildRequest(sPara, "hospital/detail?token=" + token);

                //response = JsonHelper.DeserializeJsonToObject<HospitalDetailResponse>(strResponse);

                return(strResponse);
            }
            catch
            {
                throw;
            }
        }
Exemple #12
0
        /// <summary>
        /// 47、	项目激活
        /// </summary>
        /// <param name="token">token</param>
        /// <param name="projectid">要激活的项目id</param>
        /// <returns></returns>
        public string Active(string token, string projectid)
        {
            string apiResponse = string.Empty;

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();
                sPara.Add("projectid", projectid);
                apiResponse = F8YLSubmit.BuildRequest(sPara, "project/active?token=" + token);
            }
            catch (Exception ex)
            {
                AppLog.Instance.Write("Active", AppLog.LogMessageType.Error, ex);
            }
            return(apiResponse);
        }
Exemple #13
0
        /// <summary>
        /// 55、	用户导入
        /// </summary>
        /// <param name="token">token</param>
        /// <param name="filexls">来自上传所返回的文件名</param>
        /// <returns></returns>
        public string UserImport(string token, string filexls)
        {
            string apiResponse = string.Empty;

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();
                sPara.Add("filexls", filexls);
                apiResponse = F8YLSubmit.BuildRequest(sPara, "ucenter/user/import?token=" + token);
                return(apiResponse);
            }
            catch
            {
                throw;
            }
        }
Exemple #14
0
        /// <summary>
        /// 4、用户详情设置与获取 get
        /// </summary>
        /// <param name="token"></param>
        /// <param name="username"></param>
        /// <param name="truename"></param>
        /// <param name="deptid"></param>
        /// <param name="avatar"></param>
        /// <param name="age"></param>
        /// <returns></returns>
        /// Jack Ding
        public string getProfiles(string token, string username, string email, string deptid, string avatar, string sex, string ethnic, string height, string weight, string address, string doctorid, string userid, string mobile, string telphone, string num_il)
        {
            try
            {
                string ApiResponse = string.Empty;
                UserProfileResponse         userProfileResponse = new UserProfileResponse();
                Dictionary <string, string> sPara = new Dictionary <string, string>();

                sPara.Add("username", username);
                sPara.Add("mobile", mobile);
                sPara.Add("email", email);
                sPara.Add("tel", telphone);
                //sPara.Add("deptid", deptid);
                if (avatar != string.Empty)
                {
                    sPara.Add("avatar", avatar);
                }
                if (sex != string.Empty)
                {
                    sPara.Add("sex", sex);
                }
                if (ethnic != string.Empty)
                {
                    sPara.Add("ethnic", ethnic);
                }
                if (userid != string.Empty)
                {
                    sPara.Add("userid", userid);
                }

                sPara.Add("height", height);
                sPara.Add("weight", weight);
                sPara.Add("address", address);
                sPara.Add("doctorid", doctorid);
                sPara.Add("num_ill", num_il);



                ApiResponse = F8YLSubmit.BuildRequest(sPara, "ucenter/user/profile?token=" + token);

                return(ApiResponse);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #15
0
        public string UserStatusDisable(string token, string id)
        {
            string          strResponse = string.Empty;
            APIResponseBase apiResponse = new APIResponseBase();

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();
                sPara.Add("userid", id);

                strResponse = F8YLSubmit.BuildRequest(sPara, "ucenter/user/status/disable?token=" + token);
            }
            catch (Exception)
            {
            }
            return(strResponse);
        }
Exemple #16
0
        /// <summary>
        /// 5、	修改密码
        /// </summary>
        /// <param name="pass_old">原始密码(明文)</param>
        /// <param name="pass_new1">新密码(明文)</param>
        /// <param name="pass_new2">新密码(明文)</param>
        /// <returns></returns>
        /// Jack Ding
        public string ModifyUserPassword(string pass_old, string pass_new1, string pass_new2, string token)
        {
            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();

                sPara.Add("pass_old", pass_old);
                sPara.Add("pass_new1", pass_new1);
                sPara.Add("pass_new2", pass_new2);

                return(F8YLSubmit.BuildRequest(sPara, "ucenter/user/passwd?token=" + token));
            }
            catch
            {
                throw;
            }
        }
Exemple #17
0
        /// <summary>
        /// 45、	删除项目
        /// </summary>
        /// <param name="projectid">要删除的项目id</param>
        /// <returns></returns>
        /// Gerry Ge
        /// 请求方式:POST
        public string Drop(int projectid)
        {
            string strResponse = string.Empty;

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();

                sPara.Add("projectid", projectid.ToString());
                strResponse = F8YLSubmit.BuildRequest(sPara, "project/drop");
            }
            catch (Exception ex)
            {
                AppLog.Instance.Write("Drop", AppLog.LogMessageType.Error, ex);
            }
            return(strResponse);
        }
Exemple #18
0
        /// <summary>
        /// 54、	下载接口
        /// </summary>
        /// <param name="token">token</param>
        /// <param name="Filedata">手机商上传:它是一普通的post参数,它的值为file文件的base64编码</param>
        /// <returns></returns>
        /// Jerry Shi
        public string UploadMobile(string token, string Filedata)
        {
            try
            {
                string ApiResponse = string.Empty;
                Dictionary <string, string> sPara = new Dictionary <string, string>();

                sPara.Add("Filedata", Filedata);
                ApiResponse = F8YLSubmit.BuildRequest(sPara, "upload/mobile?token=" + token);

                return(ApiResponse);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #19
0
        /// <summary>
        /// 51、	删除消息
        /// </summary>
        /// <param name="id">要删除的消息id</param>
        /// <returns></returns>
        /// Jerry Shi
        public string Drop(string token, string id)
        {
            try
            {
                string ApiResponse = string.Empty;
                Dictionary <string, string> sPara = new Dictionary <string, string>();

                sPara.Add("id", id);
                ApiResponse = F8YLSubmit.BuildRequest(sPara, "message/drop?token=" + token);

                return(ApiResponse);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #20
0
        public string ImportUser(string token, string filexls)
        {
            string          strResponse = string.Empty;
            APIResponseBase apiResponse = new APIResponseBase();

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();
                sPara.Add("filexls", filexls);

                strResponse = F8YLSubmit.BuildRequest(sPara, "ucenter/user/import?token=" + token);
            }
            catch (Exception ex)
            {
                AppLog.Instance.Write("ImportUser", AppLog.LogMessageType.Error, ex);
            }
            return(strResponse);
        }
Exemple #21
0
        /// <summary>
        /// 53、	上传接口
        /// </summary>
        /// <param name="filedata"></param>
        /// <param name="token"></param>
        /// <returns></returns>
        /// Jack Ding
        public UploadWebResponse UploadWeb(string filedata, string token)
        {
            string strResponse = string.Empty;

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();
                sPara.Add("Filedata", filedata);

                strResponse = F8YLSubmit.BuildRequest(sPara, "upload/web?token=" + token);

                return(JsonHelper.DeserializeJsonToObject <UploadWebResponse>(strResponse));
            }
            catch
            {
                throw;
            }
        }
Exemple #22
0
        /// <summary>
        /// 57、	移动病人到其它医生下
        /// </summary>
        /// <param name="projectid">项目id</param>
        /// <param name="patientid">病人userid</param>
        /// <param name="doctorid_new">新医生userid</param>
        /// <param name="doctorid_old">原医生userid</param>
        /// <returns></returns>
        public string PatientMove(string token, string projectid, string patientid, string doctorid_new, string doctorid_old)
        {
            string apiResponse = string.Empty;

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();
                sPara.Add("projectid", projectid);
                sPara.Add("patientid", patientid);
                sPara.Add("doctorid_new", doctorid_new);
                sPara.Add("doctorid_old", doctorid_old);
                apiResponse = F8YLSubmit.BuildRequest(sPara, "project/patient/move?token=" + token);
            }
            catch (Exception ex)
            {
                AppLog.Instance.Write("PatientMove", AppLog.LogMessageType.Error, ex);
            }
            return(apiResponse);
        }
Exemple #23
0
        /// <summary>
        /// 31、	创建项目(立项)
        /// </summary>
        /// <param name="token"></param>
        /// <param name="name">项目名称</param>
        /// <param name="opendate">立项日期</param>
        /// <param name="closedate">结束日期</param>
        /// <param name="num_goal">项目目标病人数</param>
        /// <param name="remark">简要说明</param>
        /// <returns></returns>
        /// Jerry Shi
        public string create(string token, string name, string opendate, string closedate, string num_goal, string remark)
        {
            string response = string.Empty;

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();

                sPara.Add("name", name);
                sPara.Add("opendate", opendate);
                sPara.Add("closedate", closedate);
                sPara.Add("num_goal", num_goal);
                sPara.Add("remark", remark);
                response = F8YLSubmit.BuildRequest(sPara, "project/create?token=" + token);
            }
            catch (Exception ex)
            {
                AppLog.Instance.Write("create", AppLog.LogMessageType.Error, ex);
            }
            return(response);
        }
Exemple #24
0
        /// <summary>
        /// 5、	修改密码
        /// </summary>
        /// <param name="pass_old">原始密码(明文)</param>
        /// <param name="pass_new1">新密码(明文)</param>
        /// <param name="pass_new2">新密码(明文)</param>
        /// <returns></returns>
        /// Jack Ding
        public string getUCenterUserPasswd(string pass_old, string pass_new1, string pass_new2, string token)
        {
            string strResponse = string.Empty;

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();

                sPara.Add("pass_old", pass_old);
                sPara.Add("pass_new1", pass_new1);
                sPara.Add("pass_new2", pass_new2);

                strResponse = F8YLSubmit.BuildRequest(sPara, "ucenter/user/passwd?token=" + token);

                return(strResponse);
            }
            catch
            {
                throw;
            }
        }
Exemple #25
0
        /// <summary>
        /// 24、	添加一个模板分类
        /// </summary>
        /// <param name="name">分类的名称</param>
        /// <returns></returns>
        /// Jack Ding
        public TplKindAddResponse TplKindAdd(string name, string token)
        {
            string             strResponse = string.Empty;
            TplKindAddResponse response    = new TplKindAddResponse();

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();

                sPara.Add("name", name);

                strResponse = F8YLSubmit.BuildRequest(sPara, "tpl/kind/add?token=" + token);

                response = JsonHelper.DeserializeJsonToObject <TplKindAddResponse>(strResponse);

                return(response);
            }
            catch
            {
                throw;
            }
        }
Exemple #26
0
        /// <summary>
        /// 34、	为项目添加病人
        /// </summary>
        /// <param name="token">token</param>
        /// <param name="projectid">项目id</param>
        /// <param name="doctorid">不需要传,就是当前登录的用户</param>
        /// <param name="patientid">patientid序列;实为病人的userid,它们所对应的医生为当前登录用户。如果不传此值,那下面的mobile,idcard必填</param>
        /// <param name="username">病人姓名</param>
        /// <param name="mobile">病人手机</param>
        /// <param name="idcard">病人身份证 18位</param>
        /// <param name="overwrite">是否覆盖之前的病人</param>
        /// <param name="height">身高</param>
        /// <param name="weight">体重</param>
        /// <param name="address">地址</param>
        /// <param name="tel">电话</param>
        /// <returns></returns>
        /// Jerry Shi
        public string PatientAppend(string token, string projectid, string doctorid, string patientid, string username, string mobile, string idcard, bool overwrite, string height, string weight, string address, string tel, string num_il, string ethnic, string sex)
        {
            string apiRespone = string.Empty;

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();
                sPara.Add("projectid", projectid);
                //sPara.Add("doctorid", doctorid);   //此参数不需要传递,就是当前用户
                if (patientid != "")
                {
                    List <string> patientidList = JsonHelper.DeserializeJsonToObject <List <string> >(patientid);
                    foreach (string item in patientidList)
                    {
                        sPara.Add("patientid[]", item);
                    }
                }
                sPara.Add("username", username);
                sPara.Add("mobile", mobile);
                sPara.Add("idcard", idcard);

                sPara.Add("overwrite", overwrite == true ? "true" : "false");
                sPara.Add("height", height);
                sPara.Add("weight", weight);
                sPara.Add("address", address);
                sPara.Add("tel", tel);
                sPara.Add("num_ill", num_il);
                sPara.Add("ethnic", ethnic);
                sPara.Add("sex", sex);
                sPara.Add("doctorid", doctorid);

                apiRespone = F8YLSubmit.BuildRequest(sPara, "project/patient/append?token=" + token);
            }
            catch (Exception ex)
            {
                AppLog.Instance.Write("PatientAppend", AppLog.LogMessageType.Error, ex);
            }
            return(apiRespone);
        }
Exemple #27
0
        /// <summary>
        /// 17、	删除模板
        /// </summary>
        /// <param name="id">要删除的模板id</param>
        /// <returns></returns>
        /// Jack Ding
        public TplDropResponse TplDrop(int id, string token)
        {
            string          strResponse = string.Empty;
            TplDropResponse response    = new TplDropResponse();

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();

                sPara.Add("id", id.ToString());

                strResponse = F8YLSubmit.BuildRequest(sPara, "tpl/drop?token=" + token);

                response = JsonHelper.DeserializeJsonToObject <TplDropResponse>(strResponse);

                return(response);
            }
            catch
            {
                throw;
            }
        }
Exemple #28
0
        public string UpdateUser(string token, string userid, string username, string deptname, string duty, string tel, string email)
        {
            string          strResponse = string.Empty;
            APIResponseBase apiResponse = new APIResponseBase();

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();
                sPara.Add("userid", userid);
                sPara.Add("username", username);
                sPara.Add("deptname", deptname);
                sPara.Add("duty", duty);
                sPara.Add("tel", tel);
                sPara.Add("email", email);

                strResponse = F8YLSubmit.BuildRequest(sPara, "ucenter/user/profile?token=" + token);
            }
            catch (Exception)
            {
            }
            return(strResponse);
        }
Exemple #29
0
        /// <summary>
        /// 禁用医院
        /// </summary>
        /// <param name="token"></param>
        /// <param name="id">医院id</param>
        /// <returns></returns>
        public string Disable(string token, string id)
        {
            string strResponse = string.Empty;

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();

                sPara.Add("hospitalid", id);

                strResponse = F8YLSubmit.BuildRequest(sPara, "hospital/status/disable?token=" + token);

                //response = JsonHelper.DeserializeJsonToObject<HospitalDetailResponse>(strResponse);

                return(strResponse);
            }
            catch (Exception ex)
            {
                AppLog.Instance.Write("Drop Hospital Error.", AppLog.LogMessageType.Error, ex);
            }
            return(strResponse);
        }
Exemple #30
0
        /// <summary>
        /// 38、	为项目添加模板
        /// </summary>
        /// <param name="token">token</param>
        /// <param name="projectid">项目id</param>
        /// <param name="tplid">tplid序列;模板id</param>
        /// <param name="overwrite">是否覆盖之前的模板</param>
        /// <returns></returns>
        /// Jerry Shi
        public string TplAppend(string token, string projectid, string tplid, bool overwrite)
        {
            string apiRespone = string.Empty;

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();

                sPara.Add("projectid", projectid);

                List <string> tplidList = JsonHelper.DeserializeJsonToObject <List <string> >(tplid);
                foreach (string item in tplidList)
                {
                    sPara.Add("doctorid[]", item);
                }
                sPara.Add("overwrite", overwrite == true ? "true" : "false");
                apiRespone = F8YLSubmit.BuildRequest(sPara, "project/tpl/append?token=" + token);
            }
            catch (Exception ex)
            {
                AppLog.Instance.Write("TplAppend", AppLog.LogMessageType.Error, ex);
            }
            return(apiRespone);
        }