แก้รายชื่อแนบท้ายไม่แสดง

This commit is contained in:
Suphonchai Phoonsawat 2023-08-07 11:53:11 +07:00
parent 8a84d7faa8
commit 10207e76f0
5 changed files with 106 additions and 15 deletions

View file

@ -1,16 +1,13 @@
using Amazon.S3.Model.Internal.MarshallTransformations;
using BMA.EHR.Application.Repositories;
using BMA.EHR.Application.Repositories;
using BMA.EHR.Application.Repositories.Commands;
using BMA.EHR.Application.Requests.Commands;
using BMA.EHR.Command.Service.Requests;
using BMA.EHR.Domain.Common;
using BMA.EHR.Domain.Extensions;
using BMA.EHR.Domain.Models.Commands.Core;
using BMA.EHR.Domain.Models.MetaData;
using BMA.EHR.Domain.Shared;
using BMA.EHR.Infrastructure.Persistence;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Annotations;
using System.Security.Claims;
@ -35,6 +32,7 @@ namespace BMA.EHR.Command.Service.Controllers
private readonly PrefixRepository _prefixRepository;
private readonly CommandTypeRepository _commandTypeRepository;
private readonly CommandStatusRepository _commandStatusRepository;
private readonly UserProfileRepository _userProfileRepository;
#endregion
@ -47,7 +45,8 @@ namespace BMA.EHR.Command.Service.Controllers
IHttpContextAccessor httpContextAccessor,
PrefixRepository prefixRepository,
CommandTypeRepository commandTypeRepository,
CommandStatusRepository commandStatusRepository)
CommandStatusRepository commandStatusRepository,
UserProfileRepository userProfileRepository)
{
_repository = repository;
_context = context;
@ -57,6 +56,7 @@ namespace BMA.EHR.Command.Service.Controllers
_prefixRepository = prefixRepository;
_commandTypeRepository = commandTypeRepository;
_commandStatusRepository = commandStatusRepository;
_userProfileRepository = userProfileRepository;
}
#endregion
@ -69,6 +69,17 @@ namespace BMA.EHR.Command.Service.Controllers
private bool? PlacementAdmin => _httpContextAccessor?.HttpContext?.User?.IsInRole("placement1");
private Guid OcId
{
get
{
if (UserId != null || UserId != "")
return _userProfileRepository.GetUserOCId(Guid.Parse(UserId!));
else
return Guid.Empty;
}
}
#endregion
#region " Methods "
@ -382,7 +393,9 @@ namespace BMA.EHR.Command.Service.Controllers
ConclusionRegisterDate = req.conclusionRegisterDate,
ConclusionResultNo = req.conclusionResultNo,
ConclusionResultDate = req.conclusionResultDate,
CommandAffectDate = req.orderDate
CommandAffectDate = req.orderDate,
OwnerGovId = OcId
};
var result = await _repository.AddAsync(inserted);
@ -496,6 +509,7 @@ namespace BMA.EHR.Command.Service.Controllers
{
// TODO : หาค่า Education มาแสดง
var receivers = (await _repository.GetReceiverByCommmandIdAsync(orderId))
.OrderBy(x => x.Sequence)
.Select(r => new
{
personId = r.Id,
@ -515,8 +529,11 @@ namespace BMA.EHR.Command.Service.Controllers
}
/// <summary>
/// PM7-27 : ข้อมูลเลือกรายชื่อออกคำสั่ง
/// PM7-27 : ข้อมูลเลือกรายชื่อออกคำสั่ง ** ยังไม่ได้กรองหน่วยงาน **
/// </summary>
/// <remarks>
/// ** ยังไม่ได้กรองหน่วยงาน **
/// </remarks>
/// <param name="personalId">Record Id ของผู้รับคำสั่งในรายการบัญชีแนบท้าย</param>
/// <returns></returns>
/// <response code="200">เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ</response>