api ประวัติการออกคำสั่ง

This commit is contained in:
Kittapath 2024-01-05 09:25:03 +07:00
parent a61bc8fc77
commit 528ebda465
3 changed files with 56 additions and 0 deletions

View file

@ -8683,5 +8683,26 @@ namespace BMA.EHR.Application.Repositories.Commands
#endregion
public async Task<dynamic> GetHistoryCommandByProfileAsync(string type, Guid id)
{
try
{
var command = await _dbContext.Set<Command>()
.Where(x => x.CommandType.Category == type.Trim().ToLower())
.Where(x => x.Receivers.Where(x => x.RefPlacementProfileId == id).FirstOrDefault() != null)
.Select(x => new
{
CommandSubject = x.CommandSubject,
CreatedAt = x.CreatedAt,
LastUpdatedAt = x.LastUpdatedAt,
})
.ToListAsync();
return command;
}
catch
{
throw;
}
}
}
}