|
@@ -1199,15 +1199,15 @@ if(!function_exists('getSurveyData')) {
|
|
|
}
|
|
|
|
|
|
if(!function_exists('determineTier')) {
|
|
|
- function determineTier($days, $minutes, $interaction) {
|
|
|
- #tier 1: 7-15 days of meas. & 10mins of billing & inter.
|
|
|
- #tier 2: >15 days of meas. & 20mins of billing & inter.
|
|
|
- if ($days >= 7 && $days <= 15 && $minutes >= 10 && $interaction == true) {
|
|
|
- return "TIER_1";
|
|
|
- } elseif ($days > 15 && $minutes >= 20 && $interaction == true) {
|
|
|
- return "TIER_2";
|
|
|
- } else {
|
|
|
- return null;
|
|
|
- }
|
|
|
+ function determineTier($careMonth) {
|
|
|
+ $tier = null;
|
|
|
+ if($careMonth->number_of_days_with_remote_measurements >= 7 && $careMonth->rm_total_time_in_seconds_by_mcp >= 10*60 ){
|
|
|
+ $tier = 'TIER_1';
|
|
|
+ }
|
|
|
+
|
|
|
+ if($careMonth->number_of_days_with_remote_measurements >= 16 && $careMonth->rm_total_time_in_seconds >= 20*60) {
|
|
|
+ $tier = 'TIER_2';
|
|
|
+ }
|
|
|
+ return $tier;
|
|
|
}
|
|
|
}
|