11from gbd_mapping import sequelae
22from vivarium_gbd_access import constants as gbd_constants
3- from vivarium_gbd_access import gbd
43from vivarium_gbd_access import utilities as vi_utils
4+ from vivarium_gbd_access .gbd import base_data as gbd
55from vivarium_inputs import globals as vi_globals
66from vivarium_inputs import utility_data
77
88from vivarium_gates_nutrition_optimization .constants import data_keys
99from vivarium_gates_nutrition_optimization .data import utilities
1010
1111
12- @gbd . memory .cache
13- def load_lbwsg_exposure (location : str ):
12+ @vi_utils .cache
13+ def load_2021_lbwsg_birth_exposure (location : str ):
1414 entity = utilities .get_entity (data_keys .LBWSG .EXPOSURE )
1515 location_id = utility_data .get_location_id (location )
16- data = vi_utils .get_draws (
16+ data = gbd .get_draws (
1717 gbd_id_type = "rei_id" ,
1818 gbd_id = entity .gbd_id ,
1919 source = gbd_constants .SOURCES .EXPOSURE ,
2020 location_id = location_id ,
21- year_id = 2021 ,
21+ year_id = 2022 ,
2222 sex_id = gbd_constants .SEX .MALE + gbd_constants .SEX .FEMALE ,
2323 age_group_id = 164 , # Birth prevalence
2424 release_id = gbd_constants .RELEASE_IDS .GBD_2021 ,
2525 )
2626 return data
2727
2828
29- @gbd . memory .cache
29+ @vi_utils .cache
3030def get_all_cause_yld_rate (location : str ):
3131 entity = utilities .get_entity ("cause.all_causes.ylds" )
3232 location_id = utility_data .get_location_id (location )
33- data = vi_utils .get_draws (
33+ data = gbd .get_draws (
3434 "cause_id" ,
3535 entity .gbd_id ,
3636 source = gbd_constants .SOURCES .COMO ,
3737 location_id = location_id ,
38- release_id = gbd_constants .RELEASE_IDS .GBD_2021 ,
38+ release_id = gbd_constants .RELEASE_IDS .GBD_2023 ,
3939 measure_id = vi_globals .MEASURES ["YLDs" ],
4040 metric_id = 3 , # rate
4141 )
4242 return data
4343
4444
45- @gbd . memory .cache
45+ @vi_utils .cache
4646def get_maternal_disorder_ylds (location : str , metric_id = None ):
4747 entity = utilities .get_entity (data_keys .MATERNAL_DISORDERS .YLDS )
4848 location_id = utility_data .get_location_id (location )
49- data = vi_utils .get_draws (
49+ data = gbd .get_draws (
5050 "cause_id" ,
5151 entity .gbd_id ,
5252 source = gbd_constants .SOURCES .COMO ,
5353 location_id = location_id ,
54- year_id = 2021 ,
55- release_id = gbd_constants .RELEASE_IDS .GBD_2021 ,
54+ year_id = 2023 ,
55+ release_id = gbd_constants .RELEASE_IDS .GBD_2023 ,
5656 measure_id = vi_globals .MEASURES ["YLDs" ],
5757 metric_id = metric_id ,
5858 )
5959 return data
6060
6161
62- @gbd . memory .cache
62+ @vi_utils .cache
6363def get_anemia_ylds (location : str , metric_id = None ):
6464 anemia_sequelae = [
6565 sequelae .mild_anemia_due_to_maternal_hemorrhage ,
@@ -68,38 +68,39 @@ def get_anemia_ylds(location: str, metric_id=None):
6868 ]
6969 anemia_ids = [s .gbd_id for s in anemia_sequelae ]
7070 location_id = utility_data .get_location_id (location )
71- data = vi_utils .get_draws (
71+ data = gbd .get_draws (
7272 "sequela_id" ,
7373 anemia_ids ,
7474 source = gbd_constants .SOURCES .COMO ,
7575 location_id = location_id ,
76- year_id = 2021 ,
77- release_id = gbd_constants .RELEASE_IDS .GBD_2021 ,
76+ year_id = 2023 ,
77+ release_id = gbd_constants .RELEASE_IDS .GBD_2023 ,
7878 measure_id = vi_globals .MEASURES ["YLDs" ],
7979 metric_id = metric_id ,
8080 )
8181 return data
8282
8383
84- @gbd . memory .cache
84+ @vi_utils .cache
8585def get_anemia_yld_rate (location : str ):
8686 location_id = utility_data .get_location_id (location )
87- data = vi_utils .get_draws (
87+ data = gbd .get_draws (
8888 "rei_id" ,
8989 192 ,
9090 source = gbd_constants .SOURCES .COMO ,
9191 location_id = location_id ,
92- release_id = gbd_constants .RELEASE_IDS .GBD_2021 ,
92+ release_id = gbd_constants .RELEASE_IDS .GBD_2023 ,
9393 measure_id = vi_globals .MEASURES ["YLDs" ],
9494 metric_id = 3 ,
9595 )
9696 return data
9797
9898
99- @gbd .memory .cache
99+ ## This is left as 2021 because the changes to hemoglobin RRs are very significant and would require other model updates we don't plan to make.
100+ @vi_utils .cache
100101def get_hemoglobin_maternal_disorders_rr ():
101102 """Relative risk associated with one g/dL decrease in hemoglobin concentration below 12 g/dL"""
102- data = vi_utils .get_draws (
103+ data = gbd .get_draws (
103104 gbd_id_type = "rei_id" ,
104105 gbd_id = 95 ,
105106 release_id = gbd_constants .RELEASE_IDS .GBD_2021 ,
0 commit comments