The calculator returns a "0" score for ECI_raw with van-walraven weights for rows where it should return score of <0. For example for a row with a "drug" comorbidity without other flags, it should return -7 in ECI_raw (and a corresponding value for ECI_age).
I believe the problem stems from this code in calculator.py:
# if sum of weights is less than zero, set it zero (this only applies to UK SHMI) dfp["comorbidity_score"] = dfp["comorbidity_score"].where( dfp["comorbidity_score"] >= 0, 0 ) return dfp
There is no check in that code for weighting="shmi". Commenting out the code ensures the calculator returns the full range of results for non SHMI weighted scores.
Description
The calculator returns a "0" score for ECI_raw with van-walraven weights for rows where it should return score of <0. For example for a row with a "drug" comorbidity without other flags, it should return -7 in ECI_raw (and a corresponding value for ECI_age).
I believe the problem stems from this code in calculator.py:
# if sum of weights is less than zero, set it zero (this only applies to UK SHMI) dfp["comorbidity_score"] = dfp["comorbidity_score"].where( dfp["comorbidity_score"] >= 0, 0 ) return dfp
There is no check in that code for weighting="shmi". Commenting out the code ensures the calculator returns the full range of results for non SHMI weighted scores.