Skip to content

Commit 57e0395

Browse files
[PRMT-249] Update get total successful count
1 parent 67f3f87 commit 57e0395

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

lambdas/models/report/bulk_upload_report_output.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,16 @@ def get_total_successful_nhs_numbers(self) -> list:
2626
return [patient[0] for patient in self.total_successful]
2727
return []
2828

29-
def get_total_successful_count(self) -> int:
30-
return len(self.total_successful)
29+
def get_total_successful_count(self) -> str:
30+
successful_percentage = (
31+
f"{(len(self.total_successful) / len(self.total_ingested)) * 100:.2f}".rstrip(
32+
"0"
33+
).rstrip(
34+
"."
35+
)
36+
+ "%"
37+
)
38+
return successful_percentage
3139

3240
def get_total_registered_elsewhere_count(self) -> int:
3341
return len(self.total_registered_elsewhere)

lambdas/services/bulk_upload_report_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def write_items_to_csv(items: list[BulkUploadReport], csv_file_path: str):
307307
def write_summary_data_to_csv(
308308
file_name: str,
309309
total_ingested: int,
310-
total_successful: int,
310+
total_successful: str,
311311
total_registered_elsewhere: int,
312312
total_suspended: int,
313313
total_deceased: int = None,

0 commit comments

Comments
 (0)