Skip to content

Commit

Permalink
Update VL category alert (#1613)
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliouzbett authored May 17, 2023
1 parent 67724ff commit 570732a
Showing 1 changed file with 25 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,41 +239,33 @@ export class HivProgramSnapshotComponent implements OnInit {
_.each(eligiblility, (vl_eligibiliy: any) => {
if (vl_eligibiliy.title === 'Viral Load Reminder') {
isEligible = 1;
} else {
isEligible = 2;
}
});
if (isEligible) {
switch (true) {
case latestViralLoad < 50 &&
latestViralLoad != null &&
isEligible === 2:
this.viralLoadCategory = 'LDL';
this.viralloadColor = 'green';
break;
case latestViralLoad >= 50 && latestViralLoad < 200 && isEligible === 2:
this.viralLoadCategory = 'Low Risk Low Level Viremia';
this.viralloadColor = 'yellowgreen';
break;
case latestViralLoad >= 200 &&
latestViralLoad < 1000 &&
isEligible === 2:
this.viralLoadCategory = 'High Risk Low Level Viremia';
this.viralloadColor = 'orange';
break;
case latestViralLoad >= 1000 && isEligible === 2:
this.viralLoadCategory = 'Suspected Treatment Failure';
this.viralloadColor = 'red';
break;
case isEligible === 1:
this.viralLoadCategory = 'Missing VL';
this.viralloadColor = 'purple';
break;
default:
this.viralLoadCategory = 'N/A';
this.viralloadColor = 'black';
break;
}
switch (true) {
case isEligible === 1:
this.viralLoadCategory = 'Missing VL';
this.viralloadColor = 'purple';
break;
case latestViralLoad < 50 && latestViralLoad != null:
this.viralLoadCategory = 'LDL';
this.viralloadColor = 'green';
break;
case latestViralLoad >= 50 && latestViralLoad < 200:
this.viralLoadCategory = 'Low Risk Low Level Viremia';
this.viralloadColor = 'yellowgreen';
break;
case latestViralLoad >= 200 && latestViralLoad < 1000:
this.viralLoadCategory = 'High Risk Low Level Viremia';
this.viralloadColor = 'orange';
break;
case latestViralLoad >= 1000:
this.viralLoadCategory = 'Suspected Treatment Failure';
this.viralloadColor = 'red';
break;
default:
this.viralLoadCategory = 'N/A';
this.viralloadColor = 'black';
break;
}
}

Expand Down

0 comments on commit 570732a

Please sign in to comment.