From 6242003091c0a3a5b296a6530a34ff73a9c395a6 Mon Sep 17 00:00:00 2001 From: "DESKTOP-2S5P7D1\\Windows 10" Date: Wed, 6 Sep 2023 10:28:37 +0700 Subject: [PATCH] =?UTF-8?q?sum=20gender=20=E0=B8=82=E0=B8=A33?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reports/InsigniaReportRepository.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs b/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs index 29649f98..5afced0e 100644 --- a/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs @@ -37,6 +37,17 @@ namespace BMA.EHR.Application.Repositories.Reports #endregion #region " Methods " + // public async Task GetOcInsigniaPeriod(Guid id) + // { + // var period = await _dbContext.Set() + // .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 GetYearInsigniaPeriod(Guid id) { var period = await _dbContext.Set() @@ -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 = "" };