${data}
@@ -240,6 +240,11 @@ export class ActivitiesComponent implements OnInit {
}
return '';
}
+ },
+ {
+ title: 'Patients',
+ data: columnIdMap[7],
+ orderable: false
}]
}
@@ -291,6 +296,12 @@ export class ActivitiesComponent implements OnInit {
activity = 'Successful Submission'
}
+ let patients = 'N/A';
+
+ if (report.totalPatients >= 0 && report.maxTotalInIP >= 0) {
+ patients = report.maxTotalInIP + '/' + report.totalPatients;
+ }
+
return {
ID: report.id,
STATUS: status,
@@ -303,7 +314,8 @@ export class ActivitiesComponent implements OnInit {
MEASURES: report.measureIds.map(m => {
const measure = this.pascalCaseToSpace.transform(m)
return measure.split(' ')[0]
- })
+ }),
+ PATIENTS: patients
};
});
}
diff --git a/web/src/app/pages/facilities/facilities.component.ts b/web/src/app/pages/facilities/facilities.component.ts
index 5ffe009e9..f71358ce3 100644
--- a/web/src/app/pages/facilities/facilities.component.ts
+++ b/web/src/app/pages/facilities/facilities.component.ts
@@ -1,16 +1,16 @@
-import { Component, OnInit } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { from } from 'rxjs';
-import { HeroComponent } from 'src/app/shared/hero/hero.component';
-import { IconComponent } from 'src/app/shared/icon/icon.component';
-import { ButtonComponent } from 'src/app/shared/button/button.component';
-import { SectionComponent } from 'src/app/shared/section/section.component';
-import { SectionHeadingComponent } from 'src/app/shared/section-heading/section-heading.component';
-import { TableComponent } from 'src/app/shared/table/table.component';
-import { Tenant } from 'src/app/shared/interfaces/tenant.model';
-import { SearchBar } from 'src/app/shared/interfaces/table.model';
-import { FacilitiesApiService } from 'src/services/api/facilities/facilities-api.service';
-import { PascalCaseToSpace, ConvertDateString, ConvertToLocaleTime } from 'src/app/helpers/GlobalPipes.pipe';
+import {Component, OnInit} from '@angular/core';
+import {CommonModule} from '@angular/common';
+import {from} from 'rxjs';
+import {HeroComponent} from 'src/app/shared/hero/hero.component';
+import {IconComponent} from 'src/app/shared/icon/icon.component';
+import {ButtonComponent} from 'src/app/shared/button/button.component';
+import {SectionComponent} from 'src/app/shared/section/section.component';
+import {SectionHeadingComponent} from 'src/app/shared/section-heading/section-heading.component';
+import {TableComponent} from 'src/app/shared/table/table.component';
+import {Tenant} from 'src/app/shared/interfaces/tenant.model';
+import {SearchBar} from 'src/app/shared/interfaces/table.model';
+import {FacilitiesApiService} from 'src/services/api/facilities/facilities-api.service';
+import {ConvertDateString, ConvertToLocaleTime, PascalCaseToSpace} from 'src/app/helpers/GlobalPipes.pipe';
@Component({
selector: 'app-facilities',
@@ -28,7 +28,7 @@ export class FacilitiesComponent implements OnInit {
private convertToLocaleTime = new ConvertToLocaleTime
dtOptions: DataTables.Settings = {};
-
+
dtSearchBar: SearchBar = {
title: 'Search Facilities',
placeholder: 'Enter facility name, NHSN Org ID, etc.'
@@ -105,13 +105,17 @@ export class FacilitiesComponent implements OnInit {
data: columnIdMap[2],
orderable: false,
createdCell: (cell, cellData) => {
- if (cellData.toLowerCase().includes('progress')) {
+ if (cellData && cellData.toLowerCase().includes('progress')) {
$(cell).addClass('cell--initiated');
} else {
$(cell).addClass('cell--complete');
}
},
render: function (data, type, row) {
+ if (!row.DETAILS || row.DETAILS === 'No Scheduled Reports') {
+ return 'N/A';
+ }
+
return `
Bundle
#${data}`
}
},
@@ -120,8 +124,11 @@ export class FacilitiesComponent implements OnInit {
data: columnIdMap[3],
orderable: true,
render: function(data, type, row) {
- let parts = data.split(' ', 2)
- return parts[0] + '
' + data.substring(parts[0].length).trim()
+ if (data) {
+ let parts = data.split(' ', 2)
+ return parts[0] + '
' + data.substring(parts[0].length).trim()
+ }
+ return 'N/A';
}
},
{
@@ -144,7 +151,7 @@ export class FacilitiesComponent implements OnInit {
// This is the method that would accept the reponse data from the api and process it further to be sent to the dt options.
processDataForTable(tenantsData: Tenant[] | undefined) {
- if(!tenantsData)
+ if (!tenantsData)
return
return tenantsData.map(td => {
@@ -165,12 +172,12 @@ export class FacilitiesComponent implements OnInit {
NHSN_ORG_ID: td.nhsnOrgId,
DETAILS: td.lastSubmissionId,
SUBMISSION_DATE: submissionDate,
- MEASURES: td.measures
+ MEASURES: td.measures ? td.measures
.filter(m => m && m.shortName)
.map(m => {
const measure = this.pascalCaseToSpace.transform(m.shortName.trimStart())
return measure.split(' ')[0]
- })
+ }) : 'No Scheduled Reports'
};
});
}
diff --git a/web/src/app/shared/interfaces/report.model.ts b/web/src/app/shared/interfaces/report.model.ts
index 6c5e828ba..27a9a5f22 100644
--- a/web/src/app/shared/interfaces/report.model.ts
+++ b/web/src/app/shared/interfaces/report.model.ts
@@ -12,9 +12,11 @@ export interface Report {
tenantId: string;
tenantName: string;
cdcOrgId: string;
- reportId: string
+ reportId: string;
details: string;
-};
+ totalPatients: number;
+ maxTotalInIP: number;
+}
export interface ReportFilter {
tenantId?: string;
@@ -29,4 +31,4 @@ export interface ReportFilter {
export interface ReportSummary {
total: number
reports: Report[]
-}
\ No newline at end of file
+}
diff --git a/web/src/services/api/report/report-api.service.ts b/web/src/services/api/report/report-api.service.ts
index 7a0fb5779..139951ea3 100644
--- a/web/src/services/api/report/report-api.service.ts
+++ b/web/src/services/api/report/report-api.service.ts
@@ -1,7 +1,7 @@
-import { Injectable } from '@angular/core';
-import { DataService } from 'src/services/api/data.service';
-import { firstValueFrom } from 'rxjs';
-import { ReportFilter } from 'src/app/shared/interfaces/report.model';
+import {Injectable} from '@angular/core';
+import {DataService} from 'src/services/api/data.service';
+import {firstValueFrom} from 'rxjs';
+import {ReportFilter} from 'src/app/shared/interfaces/report.model';
@Injectable({
providedIn: 'root'
@@ -22,7 +22,7 @@ export class ReportApiService {
});
// Determine the URL to call based on whether there are filters
- const url = queryParams.toString() ? `report/?${queryParams}` : 'report/';
+ const url = queryParams.toString() ? `report?${queryParams}` : 'report/';
// Fetch the data
const response = await firstValueFrom(this.dataService.getData
(url));