|
@@ -0,0 +1,117 @@
|
|
|
+using Newtonsoft.Json;
|
|
|
+using WingServerCommon.Log;
|
|
|
+
|
|
|
+namespace VitalService.Factury
|
|
|
+{
|
|
|
+ public class JingQiApiHelper : BaseApiHelper
|
|
|
+ {
|
|
|
+ private string _serverUrl;
|
|
|
+
|
|
|
+ public JingQiApiHelper(string serverUrl, double seconds = 30) : base(seconds)
|
|
|
+ {
|
|
|
+ _serverUrl = serverUrl;
|
|
|
+ Logger.WriteLineInfo($"VitalMixtureService JingQiApiHelper init, serverUrl:{serverUrl}, seconds:{seconds}");
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 体检登记
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="request"></param>
|
|
|
+ /// <param name="headers"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<JingQiResult<JingQiExamRegisterResult>> ExamRegisterAsync(JingQiExamRegisterRequest request, Dictionary<string, string> headers)
|
|
|
+ {
|
|
|
+ Logger.WriteLineInfo($"VitalMixtureService JingQiApiHelper ExamRegisterAsync start, request:{request}");
|
|
|
+ return await GetJingQiResult<JingQiExamRegisterResult>(JsonConvert.SerializeObject(request), headers);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 删除登记记录
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="request"></param>
|
|
|
+ /// <param name="headers"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<JingQiResult<JingQiExamDeleteResult>> ExamDeleteAsync(JingQiExamDeleteRequest request, Dictionary<string, string> headers)
|
|
|
+ {
|
|
|
+ Logger.WriteLineInfo($"VitalMixtureService JingQiApiHelper ExamDeleteAsync start, request:{request}");
|
|
|
+ return await GetJingQiResult<JingQiExamDeleteResult>(JsonConvert.SerializeObject(request), headers);
|
|
|
+ }
|
|
|
+
|
|
|
+ private async Task<JingQiResult<TResult>> GetJingQiResult<TResult>(string request, Dictionary<string, string> headers)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var res = await GetResult(_serverUrl, request, headers);
|
|
|
+ Logger.WriteLineInfo($"VitalMixtureService JingQiApiHelper GetJingQiResult success, res:{res}");
|
|
|
+ if (!string.IsNullOrWhiteSpace(res))
|
|
|
+ {
|
|
|
+ var jingQiResult = JsonConvert.DeserializeObject<JingQiResult<TResult>>(res);
|
|
|
+ if (jingQiResult.status == "0")
|
|
|
+ {
|
|
|
+ Logger.WriteLineInfo($"VitalMixtureService JingQiApiHelper GetJingQiResult success, ErroMsg:{jingQiResult.ErroMsg}");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Logger.WriteLineError($"VitalMixtureService JingQiApiHelper GetJingQiResult failed, status:{jingQiResult.status}, ErroMsg:{jingQiResult.ErroMsg}");
|
|
|
+ }
|
|
|
+ return jingQiResult;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ Logger.WriteLineWarn($"VitalMixtureService JingQiApiHelper GetJingQiResult error, ex:{ex}");
|
|
|
+ }
|
|
|
+ return default;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public class JingQiResult<TResult>
|
|
|
+ {
|
|
|
+ public string status { get; set; }
|
|
|
+ public string ErroMsg { get; set; }
|
|
|
+ public TResult data { get; set; }
|
|
|
+ }
|
|
|
+
|
|
|
+ #region 体检登记
|
|
|
+
|
|
|
+ public class JingQiExamRegisterRequest
|
|
|
+ {
|
|
|
+ public string identity { get; set; }
|
|
|
+ public string orgcode { get; set; }
|
|
|
+ public string usrcode { get; set; }
|
|
|
+ public string phydatetime { get; set; }
|
|
|
+ }
|
|
|
+
|
|
|
+ public class JingQiExamRegisterResult
|
|
|
+ {
|
|
|
+ public string phyid { get; set; }
|
|
|
+ public string PATNAME { get; set; }
|
|
|
+ public string GRENDER { get; set; }
|
|
|
+ public string PATAGE { get; set; }
|
|
|
+ public string PHONE { get; set; }
|
|
|
+ public string ORGNAME { get; set; }
|
|
|
+ public string adress { get; set; }
|
|
|
+ public string lisclu { get; set; }
|
|
|
+ public string PHYDATE { get; set; }
|
|
|
+ public string PatientID { get; set; }
|
|
|
+ public string NO { get; set; }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 取消登记
|
|
|
+
|
|
|
+ public class JingQiExamDeleteRequest
|
|
|
+ {
|
|
|
+ public string phyid { get; set; }
|
|
|
+ public string modstatus { get; set; } = "1";
|
|
|
+ }
|
|
|
+
|
|
|
+ public class JingQiExamDeleteResult
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+}
|