change icd conditions to a state based system