From eebbd0afc949ea2e102dc773aefdf053da32f325 Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Fri, 5 Jul 2024 17:17:48 +0530 Subject: [PATCH] avniproject/avni-client#1448 - total standard report card type support. --- src/ReportCard.js | 16 ++++++++++++++++ src/StandardReportCardType.js | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/ReportCard.js b/src/ReportCard.js index 0bbdb48..b28c30e 100644 --- a/src/ReportCard.js +++ b/src/ReportCard.js @@ -203,6 +203,22 @@ class ReportCard extends BaseEntity { isRecentType() { return this.isStandardReportType() && this.standardReportCardType.isRecentType(); } + + hasInputForSubject() { + return this.standardReportCardInputSubjectTypes.length > 0; + } + + hasInputForEnrolment() { + return this.standardReportCardInputPrograms.length > 0; + } + + hasInputForProgramEncounter() { + return this.hasInputForEnrolment() && this.standardReportCardInputEncounterTypes.length > 0; + } + + hasInputForGeneralEncounter() { + return this.standardReportCardInputEncounterTypes.length > 0; + } } export default ReportCard; diff --git a/src/StandardReportCardType.js b/src/StandardReportCardType.js index 6e5c81a..7c68e3e 100644 --- a/src/StandardReportCardType.js +++ b/src/StandardReportCardType.js @@ -50,7 +50,7 @@ class StandardReportCardType extends BaseEntity { Comments: "Comments", CallTasks: "Call tasks", OpenSubjectTasks: "Open subject tasks", - DueChecklist: "Due checklist", + DueChecklist: "Due checklist" }; static recentCardDurationUnits = [ @@ -144,6 +144,7 @@ class StandardReportCardType extends BaseEntity { StandardReportCardType.type.RecentRegistrations, StandardReportCardType.type.RecentEnrolments, StandardReportCardType.type.RecentVisits, + StandardReportCardType.type.Total, ].includes(this.name); }