Skip to content

Commit

Permalink
Merge branch 'md/usage-report' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
tvcam committed Aug 25, 2023
2 parents c5006cf + 3860431 commit ca474c5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/helpers/screening_assessment_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions app/services/usage_report_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit ca474c5

Please sign in to comment.