resplab / epicR

R package for the Evaluation Platform in COPD (EPIC), an agent-based whole-disease model for projection of health and economic outcomes and COPD interventions.
11 stars 11 forks source link

a small bug in outputs for diagnosed patients #115

Closed safaahmadian closed 2 years ago

safaahmadian commented 2 years ago

In model.cpp > event_exacerbation_process, the section for # (OUTPUT_EX & OUTPUT_EX_EXACERBATION)>0 should be moved to the end of the function, after diagnosis_flag is updated.

aminadibi commented 2 years ago

Can you explain the rationale for why that should be the case? @safaahmadian

safaahmadian commented 2 years ago

Some outputs depend on the state of diagnosis. When a patient has an exacerbation, she might get diagnosed immediately. In that case, we should add to the number of exacerbations in diagnosed patients, rather than undiagnosed ones. I found the bug due to the inconsistency between the event_matrix and the outputex, because the exacerbation event is pushed to the matrix after the diagnosis has been updated.

aminadibi commented 2 years ago

It's a compatibility issue between Cgetoutput and get_event_matrix().