Skip to content

Function to correct unknown guids in the afp linelist - #414

Open
mcuadera wants to merge 16 commits into
hotfixfrom
413-function-to-correct-unknown-guids-in-the-afp-linelist
Open

Function to correct unknown guids in the afp linelist#414
mcuadera wants to merge 16 commits into
hotfixfrom
413-function-to-correct-unknown-guids-in-the-afp-linelist

Conversation

@mcuadera

Copy link
Copy Markdown
Collaborator

Closes #413

This pull request solves an issue where NPAFP rates are not being calculated correctly because there is a mismatch in GUIDs for district/provinces in the AFP linelist and the population datasets. To see the issue and how they are solve, please run the following:

raw_data <- get_all_polio_data(attach.spatial.data = F)
ctry_data <- extract_country_data("democratic republic of the congo", raw_data)
dist.extract <- f.npafp.rate.01(ctry_data$afp.all.2, ctry_data$dist.pop, "2025-01-01", "2025-12-31", "dist") # observe results

ctry_afp_fixed <- match_afp_guids_to_sf(ctry_data$afp.all.2, ctry_data$prov.pop, ctry_data$dist.pop)
dist.extract.fixed <-  f.npafp.rate.01(ctry_afp_fixed, ctry_data$dist.pop, "2025-01-01", "2025-12-31", "dist") # observe results

The correction works for both the global AFP linelist and the country AFP linelist, which have different column names. No records should be added or dropped during the cleaning process (which sometimes happen during join operations, especially when there are many-to-many relationships).

@mcuadera mcuadera self-assigned this Feb 23, 2026
@mcuadera mcuadera added the bug Something isn't working label Feb 23, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 88 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (hotfix@05e8abc). Learn more about missing BASE report.

Files with missing lines Patch % Lines
R/match_afp_guid_to_sf.R 0.00% 65 Missing ⚠️
R/dal.R 0.00% 11 Missing ⚠️
R/dr.figure.functions.R 0.00% 10 Missing ⚠️
R/get_edav_pins_board.R 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             hotfix    #414   +/-   ##
========================================
  Coverage          ?   2.01%           
========================================
  Files             ?      39           
  Lines             ?   15010           
  Branches          ?       0           
========================================
  Hits              ?     302           
  Misses            ?   14708           
  Partials          ?       0           

☔ 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.

@mcuadera mcuadera linked an issue Mar 24, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Function to correct unknown GUIDs in the AFP linelist

2 participants