Skip to content

Commit 0f43de1

Browse files
committed
Fix: reporting app was showing inconsistent child counts in the consent summary
The total in the top-row red "No consent recorded" box no longer matched the sum of the white boxes beneath it after introducing the newer consent statuses no_contact_details, request_scheduled and request_not_scheduled. This fixes this by including those status enums inconsent_no_response_count query. Jira-Issue: MAV-7075
1 parent 9f0eb01 commit 0f43de1

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

app/models/reporting_api/total.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ class ReportingAPI::Total < ApplicationRecord
5757
REQUEST_NOT_SCHEDULED
5858
].freeze
5959

60+
CONSENT_NO_RESPONSE_STATUSES = [
61+
CONSENT_NO_RESPONSE,
62+
NO_CONTACT_DETAILS,
63+
REQUEST_SCHEDULED,
64+
REQUEST_NOT_SCHEDULED
65+
].freeze
66+
6067
scope :not_archived, -> { where(is_archived: false) }
6168
scope :vaccinated,
6269
-> do
@@ -92,7 +99,9 @@ def self.no_consent_count
9299
end
93100

94101
def self.consent_no_response_count
95-
where(consent_status: CONSENT_NO_RESPONSE).distinct.count(:patient_id)
102+
where(consent_status: CONSENT_NO_RESPONSE_STATUSES).distinct.count(
103+
:patient_id
104+
)
96105
end
97106

98107
def self.consent_refused_count

0 commit comments

Comments
 (0)