Skip to content

Update kpi.main.functions.R#450

Merged
michellesloan-cdc merged 1 commit into
hotfixfrom
449-function-for-country-abbreviations-failing-due-to-multiple-code-for-madagascar
Jun 10, 2026
Merged

Update kpi.main.functions.R#450
michellesloan-cdc merged 1 commit into
hotfixfrom
449-function-for-country-abbreviations-failing-due-to-multiple-code-for-madagascar

Conversation

@michellesloan-cdc

Copy link
Copy Markdown
Collaborator

Added manual code to account for a mistyped Madagascar epid in function get_ctry_abbrev(). That function creates country abbreviations by grabbing the first 3 letters of epids. When epids are enterred incorrectly, multiple country codes are created and there is manual R code in the function to remove the incorrect country code. For this, I added the following to remove the incorrect Madagascar code:
!(place.admin.0 == "MADAGASCAR" & ctry.short == "MAN")

This closes issue #449.

To test, run necessary code to try to get the country codes and also try to run a function that uses it:

raw_data <- get_all_polio_data()

afp_data <- raw_data$afp

c1 <- generate_c1_table(raw_data, "2024-01-01", "2025-12-31")

get_ctry_abbrev(afp_data)

# first change your user id instead of ABC1, or a path you choose
generate_kpi_npafp_bar (c1, afp_data = afp_data, output_path = "C:/Users/ABC1/Downloads")

correction for bad madagascar code in an epid
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 2.00%. Comparing base (b0bca89) to head (e383890).

Files with missing lines Patch % Lines
R/kpi.main.functions.R 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           hotfix    #450      +/-   ##
=========================================
- Coverage    2.00%   2.00%   -0.01%     
=========================================
  Files          38      38              
  Lines       15079   15080       +1     
=========================================
  Hits          302     302              
- Misses      14777   14778       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chadhunt2 chadhunt2 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The update works as expected.

@michellesloan-cdc michellesloan-cdc merged commit da1db79 into hotfix Jun 10, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants