Просмотр исходного кода

Use careMonth->days_between_most_recent_mcp_note_date_and_end_of_care_month in billability checks

Vijayakrishnan 3 лет назад
Родитель
Сommit
0620b62d45
1 измененных файлов с 16 добавлено и 0 удалено
  1. 16 0
      app/Models/CareMonth.php

+ 16 - 0
app/Models/CareMonth.php

@@ -158,6 +158,14 @@ class CareMonth extends Model
         $has16PlusDays = $this->number_of_days_with_remote_measurements >= 16;
         $hasMcpBilled20Minutes = $this->rm_total_time_in_seconds_by_mcp >= 1200;
         $hasMcpInteracted = $this->has_mcp_interacted_with_client_about_rm;
+
+        if (is_null($this->days_between_most_recent_mcp_note_date_and_end_of_care_month) || $this->days_between_most_recent_mcp_note_date_and_end_of_care_month > 120) {
+            return [
+                'billable' => false,
+                'reason' => "Patient has not had a visit recent enough to bill for RPM"
+            ];
+        }
+
         if($strategy == 'X16_DAYS'){
             //only check for 16 days
             if($has16PlusDays){
@@ -226,6 +234,14 @@ class CareMonth extends Model
         $has16PlusDays = $this->number_of_days_with_remote_measurements >= 16;
         $hasRmmBilled20Minutes = $this->rm_total_time_in_seconds_by_rmm_pro >= 1200;
         $hasMcpInteracted = $this->has_mcp_interacted_with_client_about_rm;
+
+        if (is_null($this->days_between_most_recent_mcp_note_date_and_end_of_care_month) || $this->days_between_most_recent_mcp_note_date_and_end_of_care_month > 120) {
+            return [
+                'billable' => false,
+                'reason' => "Patient has not had a visit recent enough to bill for RPM"
+            ];
+        }
+
         if($strategy == 'X16_DAYS'){
             //only check for 16 days
             if($has16PlusDays){