Merge branch 'develop' of github.com:Frappet/BMA-EHR-BackEnd into develop
This commit is contained in:
commit
50b5a632f3
1 changed files with 44 additions and 0 deletions
|
|
@ -397,6 +397,50 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
return Success(new List<dynamic>());
|
return Success(new List<dynamic>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet("exam-probation/{citizenId:length(13)}")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> GetDataExamByPlacement(string citizenId)
|
||||||
|
{
|
||||||
|
var dateAppoint = string.Empty;
|
||||||
|
var apiUrl = $"{_configuration["API"]}/org/profile/citizenid/position/{citizenId}";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||||
|
var _res = await client.SendAsync(_req);
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
if (_res.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
var json = JObject.Parse(_result);
|
||||||
|
var dateAppointToken = json["result"]?["dateAppoint"];
|
||||||
|
if (dateAppointToken != null)
|
||||||
|
{
|
||||||
|
dateAppoint = dateAppointToken.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var placementProfile = await _context.PlacementProfiles
|
||||||
|
.Include(x => x.Placement)
|
||||||
|
.Select(x => new
|
||||||
|
{
|
||||||
|
fullName = $"{x.Prefix}{x.Firstname} {x.Lastname}",
|
||||||
|
citizenId = x.CitizenId,
|
||||||
|
examName = x.Placement.Name,
|
||||||
|
})
|
||||||
|
.Where(x => x.citizenId == citizenId.ToString())
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
var data = new
|
||||||
|
{
|
||||||
|
fullName = placementProfile != null ? placementProfile.fullName : "",
|
||||||
|
citizenId = placementProfile != null ? placementProfile.citizenId : "",
|
||||||
|
examName = placementProfile != null ? placementProfile.examName : "",
|
||||||
|
dateAppoint = dateAppoint
|
||||||
|
};
|
||||||
|
return Success(data);
|
||||||
|
}
|
||||||
|
|
||||||
[HttpGet("personal/{personalId:length(36)}")]
|
[HttpGet("personal/{personalId:length(36)}")]
|
||||||
public async Task<ActionResult<ResponseObject>> GetProfileByUser(Guid personalId)
|
public async Task<ActionResult<ResponseObject>> GetProfileByUser(Guid personalId)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue