sum gender ขร3

This commit is contained in:
DESKTOP-2S5P7D1\Windows 10 2023-09-06 10:28:37 +07:00
parent fa8dfc51e4
commit 6242003091

View file

@ -37,6 +37,17 @@ namespace BMA.EHR.Application.Repositories.Reports
#endregion
#region " Methods "
// public async Task<dynamic> GetOcInsigniaPeriod(Guid id)
// {
// var period = await _dbContext.Set<InsigniaPeriod>()
// .FirstOrDefaultAsync(x => x.Id == id);
// if (period == null)
// throw new Exception(GlobalMessages.InsigniaPeriodNotFound);
// period.
// var OCName = r.OcId == null ? "-" : _organizationCommonRepository.GetOrganizationNameFullPath(r.OcId.Value, false, false);
// return OCName;
// }
public async Task<dynamic> GetYearInsigniaPeriod(Guid id)
{
var period = await _dbContext.Set<InsigniaPeriod>()
@ -348,6 +359,8 @@ namespace BMA.EHR.Application.Repositories.Reports
ProfileId = r.Profile.Id,
FullName = $"{r.Profile.Prefix?.Name}{r.Profile.FirstName} {r.Profile.LastName}",
Gender = r.Profile.Gender == null ? null : r.Profile.Gender.Name,
Male = r.Profile.Gender == null ? 0 : (r.Profile.Gender.Name == "ชาย" ? 1 : 0),
Female = r.Profile.Gender == null ? 0 : (r.Profile.Gender.Name == "หญิง" ? 1 : 0),
InsigniaId = r.RequestInsignia.Id,
OCName = _organizationCommonRepository.GetOrganizationNameFullPath(r.Request.Organization.Id, false, false)
})
@ -371,6 +384,8 @@ namespace BMA.EHR.Application.Repositories.Reports
ProfileId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
FullName = "",
Gender = "",
Male = 0,
Female = 0,
InsigniaId = ins.InsigniaId,
OCName = ""
};
@ -590,6 +605,8 @@ namespace BMA.EHR.Application.Repositories.Reports
ProfileId = r.Profile.Id,
FullName = $"{r.Profile.Prefix?.Name}{r.Profile.FirstName} {r.Profile.LastName}",
Gender = r.Profile.Gender == null ? null : r.Profile.Gender.Name,
Male = r.Profile.Gender == null ? 0 : (r.Profile.Gender.Name == "ชาย" ? 1 : 0),
Female = r.Profile.Gender == null ? 0 : (r.Profile.Gender.Name == "หญิง" ? 1 : 0),
InsigniaId = r.RequestInsignia.Id,
OCName = _organizationCommonRepository.GetOrganizationNameFullPath(r.Request.Organization.Id, false, false)
})
@ -613,6 +630,8 @@ namespace BMA.EHR.Application.Repositories.Reports
ProfileId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
FullName = "",
Gender = "",
Male = 0,
Female = 0,
InsigniaId = ins.InsigniaId,
OCName = ""
};