瀏覽代碼

Updated determin tier

Samson Mutunga 1 年之前
父節點
當前提交
d590343280
共有 3 個文件被更改,包括 12 次插入16 次删除
  1. 10 10
      app/Helpers/helpers.php
  2. 1 5
      app/Models/CareMonth.php
  3. 1 1
      resources/views/app/patient/care-month/_create-claim.blade.php

+ 10 - 10
app/Helpers/helpers.php

@@ -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;
     }
 }

+ 1 - 5
app/Models/CareMonth.php

@@ -339,10 +339,6 @@ class CareMonth extends Model
     }
 
     public function tier() {
-        $lastVisitWithinDays = ($this->days_between_most_recent_mcp_note_date_and_end_of_care_month  <= config('app.maxDaysSinceLastVisit'));
-        $days = $this->number_of_days_with_remote_measurements;
-        $mins = $this->rm_total_time_in_seconds_by_mcp / 60;
-        $interaction = $lastVisitWithinDays && $this->has_mcp_interacted_with_client_about_rm;
-        return determineTier($days, $mins, $interaction);
+        return determineTier($this);
     }
 }

+ 1 - 1
resources/views/app/patient/care-month/_create-claim.blade.php

@@ -136,7 +136,7 @@
                 lines: [
                     {
                         cpt: '',
-                        dateOfService: '{{date_format($careMonth->created_at, 'Y-m-d')}}',
+                        dateOfService: '{{date("Y-m-d", strtotime($careMonth->created_at))}}',
                         icds: JSON.parse(JSON.stringify(window.rmReasons)),
                         numberOfUnits: 1
                     }