public int SetPidDetails(Hl7Pid pid) { ApiResponse apiResponse = new ApiResponse(); SetPidRequest objRequest = new SetPidRequest(); objRequest.Params = pid; apiResponse = ApiCommunicator.CallApi(ConfigManager.ApiUrl + "pid/AddPid", JsonHelper.ConvertToJson(objRequest), "POST", "application/json"); if (apiResponse.Status == "Success") { if (!string.IsNullOrEmpty(apiResponse.Message)) { return(JsonHelper.ConvertFromJson <int>(apiResponse.Message)); } else { return(0); } } else { return(0); } }
public void PostPid(Hl7Pid pid, string url) { ApiResponse apiResponse = new ApiResponse(); SetPidRequest objRequest = new SetPidRequest(); objRequest.Params = pid; apiResponse = ApiCommunicator.CallApi(url, JsonHelper.ConvertToJson(objRequest), "POST", "application/json"); }
public IHttpActionResult AddPid(SetPidRequest pid) { if (pid != null) { return(this.Ok(pidManager.SetPid(pid.Params))); } throw new ApiException(HttpStatusCode.BadRequest , "PID information cannot be empty" , "Request information is not valid"); }