Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev aa #302

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,6 @@ After running all the line in the run_ph_integrated_tables.R, below are the set
>`Healthcare is Needed Column` <- Healthcare is Needed Column<br>
>`Healthcare is Received Column` <- Healthcare is Received Column<br>
>`Individual Age Column` <- Individual Age Column<br>
>`Individual Age Column` <- Individual Age Column<br>
>`HH UUID Health Loop column` <- Household unique identifier in health members individual sheet(usually _submission__uuid)<br>
>`HH UUID Main Sheet column` <- Household unique identifier in main household sheet(usually _uuid)<br>
>`Nutrition Sheet` <- Nutrition Individual Sheet<br>
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1721,7 +1721,6 @@ Details
> `Healthcare is Needed Column` \<- Healthcare is Needed Column<br>
> `Healthcare is Received Column` \<- Healthcare is Received Column<br>
> `Individual Age Column` \<- Individual Age Column<br>
> `Individual Age Column` \<- Individual Age Column<br>
> `HH UUID Health Loop column` \<- Household unique identifier in health
> members individual sheet(usually \_submission\_\_uuid)<br>
> `HH UUID Main Sheet column` \<- Household unique identifier in main
Expand Down
4 changes: 2 additions & 2 deletions inst/fsl_cleaning/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@
"RemoteHost": "api.github.com",
"RemoteRepo": "impactR4PHU",
"RemoteUsername": "impact-initiatives",
"RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768",
"RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6",
"Requirements": [
"GGally",
"R",
Expand All @@ -1011,7 +1011,7 @@
"writexl",
"zscorer"
],
"Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36"
"Hash": "0bdd86fcdc1313767413a2fb44ad6c42"
},
"isoband": {
"Package": "isoband",
Expand Down
4 changes: 2 additions & 2 deletions inst/fsl_descriptive_analysis/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,7 @@
"RemoteHost": "api.github.com",
"RemoteRepo": "impactR4PHU",
"RemoteUsername": "impact-initiatives",
"RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768",
"RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6",
"Requirements": [
"GGally",
"R",
Expand All @@ -1169,7 +1169,7 @@
"writexl",
"zscorer"
],
"Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36"
"Hash": "0bdd86fcdc1313767413a2fb44ad6c42"
},
"isoband": {
"Package": "isoband",
Expand Down
4 changes: 2 additions & 2 deletions inst/fsl_quality_report/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@
"RemoteHost": "api.github.com",
"RemoteRepo": "impactR4PHU",
"RemoteUsername": "impact-initiatives",
"RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768",
"RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6",
"Requirements": [
"GGally",
"R",
Expand All @@ -1011,7 +1011,7 @@
"writexl",
"zscorer"
],
"Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36"
"Hash": "0bdd86fcdc1313767413a2fb44ad6c42"
},
"isoband": {
"Package": "isoband",
Expand Down
4 changes: 2 additions & 2 deletions inst/iphra_analysis/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@
"RemoteHost": "api.github.com",
"RemoteRepo": "impactR4PHU",
"RemoteUsername": "impact-initiatives",
"RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768",
"RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6",
"Requirements": [
"GGally",
"R",
Expand All @@ -820,7 +820,7 @@
"writexl",
"zscorer"
],
"Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36"
"Hash": "0bdd86fcdc1313767413a2fb44ad6c42"
},
"isoband": {
"Package": "isoband",
Expand Down
4 changes: 2 additions & 2 deletions inst/iphra_cleaning/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@
"RemoteHost": "api.github.com",
"RemoteRepo": "impactR4PHU",
"RemoteUsername": "impact-initiatives",
"RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768",
"RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6",
"Requirements": [
"GGally",
"R",
Expand All @@ -896,7 +896,7 @@
"writexl",
"zscorer"
],
"Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36"
"Hash": "0bdd86fcdc1313767413a2fb44ad6c42"
},
"isoband": {
"Package": "isoband",
Expand Down
4 changes: 2 additions & 2 deletions inst/iycf_cleaning/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@
"RemoteHost": "api.github.com",
"RemoteRepo": "impactR4PHU",
"RemoteUsername": "impact-initiatives",
"RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768",
"RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6",
"Requirements": [
"GGally",
"R",
Expand All @@ -1011,7 +1011,7 @@
"writexl",
"zscorer"
],
"Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36"
"Hash": "0bdd86fcdc1313767413a2fb44ad6c42"
},
"isoband": {
"Package": "isoband",
Expand Down
4 changes: 2 additions & 2 deletions inst/iycf_descriptive_analysis/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@
"RemoteHost": "api.github.com",
"RemoteRepo": "impactR4PHU",
"RemoteUsername": "impact-initiatives",
"RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768",
"RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6",
"Requirements": [
"GGally",
"R",
Expand All @@ -1076,7 +1076,7 @@
"writexl",
"zscorer"
],
"Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36"
"Hash": "0bdd86fcdc1313767413a2fb44ad6c42"
},
"isoband": {
"Package": "isoband",
Expand Down
4 changes: 2 additions & 2 deletions inst/iycf_quality_report/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@
"RemoteHost": "api.github.com",
"RemoteRepo": "impactR4PHU",
"RemoteUsername": "impact-initiatives",
"RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768",
"RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6",
"Requirements": [
"GGally",
"R",
Expand All @@ -944,7 +944,7 @@
"writexl",
"zscorer"
],
"Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36"
"Hash": "0bdd86fcdc1313767413a2fb44ad6c42"
},
"isoband": {
"Package": "isoband",
Expand Down
4 changes: 2 additions & 2 deletions inst/mort_cleaning/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@
"RemoteHost": "api.github.com",
"RemoteRepo": "impactR4PHU",
"RemoteUsername": "impact-initiatives",
"RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768",
"RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6",
"Requirements": [
"GGally",
"R",
Expand All @@ -1011,7 +1011,7 @@
"writexl",
"zscorer"
],
"Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36"
"Hash": "0bdd86fcdc1313767413a2fb44ad6c42"
},
"isoband": {
"Package": "isoband",
Expand Down
4 changes: 2 additions & 2 deletions inst/mort_descriptive_analysis/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@
"RemoteHost": "api.github.com",
"RemoteRepo": "impactR4PHU",
"RemoteUsername": "impact-initiatives",
"RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768",
"RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6",
"Requirements": [
"GGally",
"R",
Expand All @@ -1076,7 +1076,7 @@
"writexl",
"zscorer"
],
"Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36"
"Hash": "0bdd86fcdc1313767413a2fb44ad6c42"
},
"isoband": {
"Package": "isoband",
Expand Down
4 changes: 2 additions & 2 deletions inst/mort_quality_report/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@
"RemoteHost": "api.github.com",
"RemoteRepo": "impactR4PHU",
"RemoteUsername": "impact-initiatives",
"RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768",
"RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6",
"Requirements": [
"GGally",
"R",
Expand All @@ -1011,7 +1011,7 @@
"writexl",
"zscorer"
],
"Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36"
"Hash": "0bdd86fcdc1313767413a2fb44ad6c42"
},
"isoband": {
"Package": "isoband",
Expand Down
4 changes: 2 additions & 2 deletions inst/ph_integrated_tables/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@
"RemoteHost": "api.github.com",
"RemoteRepo": "impactR4PHU",
"RemoteUsername": "impact-initiatives",
"RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768",
"RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6",
"Requirements": [
"GGally",
"R",
Expand All @@ -1179,7 +1179,7 @@
"writexl",
"zscorer"
],
"Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36"
"Hash": "0bdd86fcdc1313767413a2fb44ad6c42"
},
"isoband": {
"Package": "isoband",
Expand Down
64 changes: 64 additions & 0 deletions inst/ph_integrated_tables/run_ph_integrated_tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -1521,9 +1521,19 @@ if(!file.exists("inputs/environment.Rdata")) {
} else if (length(ind_healthcare_needed) == 0) {
ind_healthcare_needed <- svDialogs::dlg_input(message= "Enter the name of the healthcare is needed","health_ind_healthcare_needed")$res
}

## To comment out line 1527 and 1528 (In case new version humind change the levels)

ind_healthcare_needed_levels <- unique(unlist(data.list[[healthcare_sheet]][,ind_healthcare_needed]))
ind_healthcare_needed_levels <- ind_healthcare_needed_levels[!is.na(ind_healthcare_needed_levels)]

## To uncomment out line 1532, 1533, and 1534 (In case new version humind change the levels)

# ind_healthcare_needed_yes <- tcltk::tk_select.list(unique(unlist(data.list[[healthcare_sheet]][,ind_healthcare_needed])), title = "Yes Value")
# ind_healthcare_needed_no <- tcltk::tk_select.list(unique(unlist(data.list[[healthcare_sheet]][,ind_healthcare_needed])), title = "No Value")
# ind_healthcare_needed_undefined <- tcltk::tk_select.list(unique(unlist(data.list[[healthcare_sheet]][,ind_healthcare_needed])), title = "Undefined Value", multiple =T)


## healthcare is needed
ind_healthcare_received <- names(data.list[[healthcare_sheet]])[grepl("healthcare_received",names(data.list[[healthcare_sheet]]))]
if(length(ind_healthcare_received) == 1){
Expand All @@ -1539,9 +1549,19 @@ if(!file.exists("inputs/environment.Rdata")) {
} else if (length(ind_healthcare_received) == 0) {
ind_healthcare_received <- svDialogs::dlg_input(message= "Enter the name of the healthcare is received","health_ind_healthcare_received")$res
}

## To comment out line 1555 and 1556 (In case new version humind change the levels)

ind_healthcare_received_levels <- unique(unlist(data.list[[healthcare_sheet]][,ind_healthcare_received]))
ind_healthcare_received_levels <- ind_healthcare_received_levels[!is.na(ind_healthcare_received_levels)]
## ind age

## To uncomment out line 1561, 1562, and 1563 (In case new version humind change the levels)

# ind_healthcare_received_yes <- tcltk::tk_select.list(unique(unlist(data.list[[healthcare_sheet]][,ind_healthcare_received])), title = "Yes Value")
# ind_healthcare_received_no <- tcltk::tk_select.list(unique(unlist(data.list[[healthcare_sheet]][,ind_healthcare_received])), title = "No Value")
# ind_healthcare_received_undefined <- tcltk::tk_select.list(unique(unlist(data.list[[healthcare_sheet]][,ind_healthcare_received])), title = "Undefined Value", multiple =T)

ind_age <- names(data.list[[healthcare_sheet]])[grepl("ind_age",names(data.list[[healthcare_sheet]]))]
if(length(ind_age) == 1){
yes_no <- svDialogs::dlg_message(paste0("Is '", ind_age, "' the correct column for age of individual?"), type = "yesno")$res
Expand Down Expand Up @@ -1590,6 +1610,8 @@ if(!file.exists("inputs/environment.Rdata")) {
}
}

## To comment out line 1615 to 1627 (In case new version humind change the levels)

unmet_loop_df <- data.list[[healthcare_sheet]] %>%
humind::add_loop_healthcare_needed_cat(ind_healthcare_needed = ind_healthcare_needed,
ind_healthcare_needed_levels = ind_healthcare_needed_levels,
Expand All @@ -1604,6 +1626,28 @@ unmet_loop_df <- data.list[[healthcare_sheet]] %>%
unmet_healthcare = sum/n) %>%
dplyr::select(admin1,unmet_healthcare)

## To uncomment out line 1631 to 1647 (In case new version humind change the levels)

# unmet_loop_df <- data.list[[healthcare_sheet]] %>%
# humind::add_loop_healthcare_needed_cat(ind_healthcare_needed = ind_healthcare_needed,
# ind_healthcare_needed_yes = ind_healthcare_needed_yes,
# ind_healthcare_needed_no = ind_healthcare_needed_no,
# ind_healthcare_needed_undefined = ind_healthcare_needed_undefined,
# ind_healthcare_received = ind_healthcare_received,
# ind_healthcare_received_yes = ind_healthcare_received_yes,
# ind_healthcare_received_no = ind_healthcare_received_no,
# ind_healthcare_received_undefined = ind_healthcare_received_undefined,
# ind_age = ind_age) %>%
# srvyr::as_survey_design(weights = weight) %>%
# dplyr::mutate(admin1 = !!rlang::sym(admin1)) %>%
# dplyr::group_by(admin1) %>%
# dplyr::summarise(n = n(),
# sum = srvyr::survey_total(health_ind_healthcare_needed_yes_unmet),
# unmet_healthcare = sum/n) %>%
# dplyr::select(admin1,unmet_healthcare)

## To comment out line 1651 to 1663 (In case new version humind change the levels)

unmet_loop_df_national <- data.list[[healthcare_sheet]] %>%
humind::add_loop_healthcare_needed_cat(ind_healthcare_needed = ind_healthcare_needed,
ind_healthcare_needed_levels = ind_healthcare_needed_levels,
Expand All @@ -1618,6 +1662,26 @@ unmet_loop_df_national <- data.list[[healthcare_sheet]] %>%
unmet_healthcare = sum/n) %>%
dplyr::select(admin1,unmet_healthcare)

## To uncomment out line 1667 to 1683 (In case new version humind change the levels)

# unmet_loop_df_national <- data.list[[healthcare_sheet]] %>%
# humind::add_loop_healthcare_needed_cat(ind_healthcare_needed = ind_healthcare_needed,
# ind_healthcare_needed_yes = ind_healthcare_needed_yes,
# ind_healthcare_needed_no = ind_healthcare_needed_no,
# ind_healthcare_needed_undefined = ind_healthcare_needed_undefined,
# ind_healthcare_received = ind_healthcare_received,
# ind_healthcare_received_yes = ind_healthcare_received_yes,
# ind_healthcare_received_no = ind_healthcare_received_no,
# ind_healthcare_received_undefined = ind_healthcare_received_undefined,
# ind_age = ind_age) %>%
# srvyr::as_survey_design(weights = weight) %>%
# dplyr::mutate(admin1 = "national") %>%
# dplyr::group_by(admin1) %>%
# dplyr::summarise(n = n(),
# sum = srvyr::survey_total(health_ind_healthcare_needed_yes_unmet),
# unmet_healthcare = sum/n) %>%
# dplyr::select(admin1,unmet_healthcare)


## Nutrition
if(!file.exists("inputs/environment.Rdata")) {
Expand Down
Loading