diff --git a/app/helpers/screening_assessment_helper.rb b/app/helpers/screening_assessment_helper.rb index 37d9fc01bf..df08c18336 100644 --- a/app/helpers/screening_assessment_helper.rb +++ b/app/helpers/screening_assessment_helper.rb @@ -16,4 +16,12 @@ def date_of_birth_in_words(date_of_birth, locale = :en) "No Date of Birth" end end + + def by_age_translation(developmental_marker_name) + developmental_marker_name = '1 year' if developmental_marker_name.match(/12 months/) + developmental_marker_name = '1.5 years' if developmental_marker_name.match(/18 months/) + developmental_marker_name = developmental_marker_name.downcase.gsub(" ", "_").gsub(".", "_") + + t("inline_help.cb_dmat.by_age_#{developmental_marker_name}").html_safe + end end diff --git a/app/services/usage_report_builder.rb b/app/services/usage_report_builder.rb index 5553dc1bfe..68d7ef1a9b 100644 --- a/app/services/usage_report_builder.rb +++ b/app/services/usage_report_builder.rb @@ -56,6 +56,7 @@ def cross_referral_from_primero_cases data[:adult_male_without_disability] = data[:adult_male] - data[:adult_male_with_disability] data[:child_female_without_disability] = data[:child_female] - data[:child_female_with_disability] data[:child_male_without_disability] = data[:child_male] - data[:child_male_with_disability] + data[:other] = data[:total] - data[:adult_female] - data[:adult_male] - data[:child_male] - data[:child_female] data end @@ -87,6 +88,8 @@ def cross_referral_to_primero_cases data[:adult_male_without_disability] = data[:adult_male] - data[:adult_male_with_disability] data[:child_female_without_disability] = data[:child_female] - data[:child_female_with_disability] data[:child_male_without_disability] = data[:child_male] - data[:child_male_with_disability] + data[:other] = data[:total] - data[:adult_female] - data[:adult_male] - data[:child_male] - data[:child_female] + data end @@ -117,6 +120,8 @@ def cross_referral_cases data[:adult_male_without_disability] = data[:adult_male] - data[:adult_male_with_disability] data[:child_female_without_disability] = data[:child_female] - data[:child_female_with_disability] data[:child_male_without_disability] = data[:child_male] - data[:child_male_with_disability] + data[:other] = data[:total] - data[:adult_female] - data[:adult_male] - data[:child_male] - data[:child_female] + data end