|
30 | 30 | from tlo.methods.hsi_event import HSI_Event
|
31 | 31 | from tlo.methods.hsi_generic_first_appts import GenericFirstAppointmentsMixin
|
32 | 32 | from tlo.methods.symptommanager import Symptom
|
33 |
| -from tlo.util import random_date |
| 33 | +from tlo.util import random_date, read_csv_files |
34 | 34 |
|
35 | 35 | if TYPE_CHECKING:
|
36 | 36 | from tlo.methods.hsi_generic_first_appts import HSIEventScheduler
|
@@ -259,32 +259,33 @@ def __init__(self, name=None, resourcefilepath=None, do_log_df: bool = False, do
|
259 | 259 | def read_parameters(self, data_folder):
|
260 | 260 | """Read parameter values from files for condition onset, removal, deaths, and initial prevalence.
|
261 | 261 |
|
262 |
| - ResourceFile_cmd_condition_onset.xlsx = parameters for onset of conditions |
263 |
| - ResourceFile_cmd_condition_removal.xlsx = parameters for removal of conditions |
264 |
| - ResourceFile_cmd_condition_death.xlsx = parameters for death rate from conditions |
265 |
| - ResourceFile_cmd_condition_prevalence.xlsx = initial and target prevalence for conditions |
266 |
| - ResourceFile_cmd_condition_symptoms.xlsx = symptoms for conditions |
267 |
| - ResourceFile_cmd_condition_hsi.xlsx = HSI parameters for conditions |
268 |
| - ResourceFile_cmd_condition_testing.xlsx = community testing parameters for conditions (currently only |
269 |
| - hypertension) |
270 |
| - ResourceFile_cmd_events.xlsx = parameters for occurrence of events |
271 |
| - ResourceFile_cmd_events_death.xlsx = parameters for death rate from events |
272 |
| - ResourceFile_cmd_events_symptoms.xlsx = symptoms for events |
273 |
| - ResourceFile_cmd_events_hsi.xlsx = HSI parameters for events |
| 262 | + Folders |
| 263 | + ResourceFile_cmd_condition_onset = parameters for onset of conditions |
| 264 | + ResourceFile_cmd_condition_removal = parameters for removal of conditions |
| 265 | + ResourceFile_cmd_condition_death = parameters for death rate from conditions |
| 266 | + ResourceFile_cmd_condition_prevalence = initial and target prevalence for conditions |
| 267 | + ResourceFile_cmd_condition_symptoms = symptoms for conditions |
| 268 | + ResourceFile_cmd_condition_hsi = HSI parameters for conditions |
| 269 | + ResourceFile_cmd_condition_testing = community testing parameters for conditions (currently only |
| 270 | + hypertension) |
| 271 | + ResourceFile_cmd_events = parameters for occurrence of events |
| 272 | + ResourceFile_cmd_events_death = parameters for death rate from events |
| 273 | + ResourceFile_cmd_events_symptoms = symptoms for events |
| 274 | + ResourceFile_cmd_events_hsi = HSI parameters for events |
274 | 275 |
|
275 | 276 | """
|
276 | 277 | cmd_path = Path(self.resourcefilepath) / "cmd"
|
277 |
| - cond_onset = pd.read_excel(cmd_path / "ResourceFile_cmd_condition_onset.xlsx", sheet_name=None) |
278 |
| - cond_removal = pd.read_excel(cmd_path / "ResourceFile_cmd_condition_removal.xlsx", sheet_name=None) |
279 |
| - cond_death = pd.read_excel(cmd_path / "ResourceFile_cmd_condition_death.xlsx", sheet_name=None) |
280 |
| - cond_prevalence = pd.read_excel(cmd_path / "ResourceFile_cmd_condition_prevalence.xlsx", sheet_name=None) |
281 |
| - cond_symptoms = pd.read_excel(cmd_path / "ResourceFile_cmd_condition_symptoms.xlsx", sheet_name=None) |
282 |
| - cond_hsi = pd.read_excel(cmd_path / "ResourceFile_cmd_condition_hsi.xlsx", sheet_name=None) |
283 |
| - cond_testing = pd.read_excel(cmd_path / "ResourceFile_cmd_condition_testing.xlsx", sheet_name=None) |
284 |
| - events_onset = pd.read_excel(cmd_path / "ResourceFile_cmd_events.xlsx", sheet_name=None) |
285 |
| - events_death = pd.read_excel(cmd_path / "ResourceFile_cmd_events_death.xlsx", sheet_name=None) |
286 |
| - events_symptoms = pd.read_excel(cmd_path / "ResourceFile_cmd_events_symptoms.xlsx", sheet_name=None) |
287 |
| - events_hsi = pd.read_excel(cmd_path / "ResourceFile_cmd_events_hsi.xlsx", sheet_name=None) |
| 278 | + cond_onset = read_csv_files(cmd_path / "ResourceFile_cmd_condition_onset", files=None) |
| 279 | + cond_removal = read_csv_files(cmd_path / "ResourceFile_cmd_condition_removal", files=None) |
| 280 | + cond_death = read_csv_files(cmd_path / "ResourceFile_cmd_condition_death", files=None) |
| 281 | + cond_prevalence = read_csv_files(cmd_path / "ResourceFile_cmd_condition_prevalence", files=None) |
| 282 | + cond_symptoms = read_csv_files(cmd_path / "ResourceFile_cmd_condition_symptoms", files=None) |
| 283 | + cond_hsi = read_csv_files(cmd_path / "ResourceFile_cmd_condition_hsi", files=None) |
| 284 | + cond_testing = read_csv_files(cmd_path / "ResourceFile_cmd_condition_testing", files=None) |
| 285 | + events_onset = read_csv_files(cmd_path / "ResourceFile_cmd_events", files=None) |
| 286 | + events_death = read_csv_files(cmd_path / "ResourceFile_cmd_events_death", files=None) |
| 287 | + events_symptoms = read_csv_files(cmd_path / "ResourceFile_cmd_events_symptoms", files=None) |
| 288 | + events_hsi = read_csv_files(cmd_path / "ResourceFile_cmd_events_hsi", files=None) |
288 | 289 |
|
289 | 290 | self.load_parameters_from_dataframe(pd.read_csv(cmd_path / "ResourceFile_cmd_parameters.csv"))
|
290 | 291 |
|
|
0 commit comments