fix report
This commit is contained in:
parent
a15f2a1081
commit
d86eb050a8
6 changed files with 64 additions and 17 deletions
|
|
@ -33,6 +33,32 @@ namespace BMA.EHR.Report.Service.Services
|
|||
|
||||
#region " Report Query "
|
||||
|
||||
public async Task<IEnumerable<dynamic>?> GetOrganizationTypes(string type)
|
||||
{
|
||||
var Organizations = await _context.Organizations.ToListAsync();
|
||||
|
||||
var OrganizationOrganizations = await _context.OrganizationOrganizations.ToListAsync();
|
||||
var OrganizationTypes = await _context.OrganizationTypes.FirstOrDefaultAsync(x => x.Name == type);
|
||||
|
||||
if (OrganizationTypes == null)
|
||||
{
|
||||
throw new Exception("Invalid Organization type.");
|
||||
}
|
||||
|
||||
var dataType = (from o in Organizations
|
||||
join os in OrganizationOrganizations on o.OrganizationOrganizationId equals os.Id into os1
|
||||
from os in os1.DefaultIfEmpty()
|
||||
where o.OrganizationTypeId == OrganizationTypes.Id && os != null
|
||||
orderby o.OrganizationOrder
|
||||
select new
|
||||
{
|
||||
organizationId = o.Id,
|
||||
organizationName = os.Name
|
||||
}).ToList();
|
||||
|
||||
return dataType;
|
||||
}
|
||||
|
||||
public async Task<List<Account1ResultItem>> GetReport1Query(Guid ocId)
|
||||
{
|
||||
var ocIdList = _profileService.GetAllIdByRoot(ocId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue