Fix: Don't recommend quitting to former smokers
Former smokers have already quit - they can't take further action on smoking. Treat them as optimal for the smoking behavior. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
247388c61a
commit
fb494a349c
1 changed files with 3 additions and 1 deletions
|
|
@ -104,7 +104,9 @@ BehavioralInputs _setToOptimal(BehavioralInputs inputs, String behaviorKey) {
|
||||||
bool _isOptimal(BehavioralInputs inputs, String behaviorKey) {
|
bool _isOptimal(BehavioralInputs inputs, String behaviorKey) {
|
||||||
switch (behaviorKey) {
|
switch (behaviorKey) {
|
||||||
case 'smoking':
|
case 'smoking':
|
||||||
return inputs.smoking == SmokingStatus.never;
|
// Former smokers have already quit - no further action possible
|
||||||
|
return inputs.smoking == SmokingStatus.never ||
|
||||||
|
inputs.smoking == SmokingStatus.former;
|
||||||
case 'alcohol':
|
case 'alcohol':
|
||||||
return inputs.alcohol == AlcoholLevel.none ||
|
return inputs.alcohol == AlcoholLevel.none ||
|
||||||
inputs.alcohol == AlcoholLevel.light;
|
inputs.alcohol == AlcoholLevel.light;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue