Parcourir la source

Merge branch 'dev' into dev-vj

Vijayakrishnan il y a 3 ans
Parent
commit
e8128864c6

+ 3 - 3
app/Http/Controllers/HomeController.php

@@ -557,7 +557,7 @@ WHERE cl.shadow_pro_id IS NULL
             ->whereNotNull('ts')
             ->whereNotIn('label', ['SBP', 'DBP'])
             ->where('is_cellular_zero', '<>', true)
-            ->where('is_removed', false)
+            ->where('is_active', true)
             ->where('has_been_stamped_by_mcp', false)
             ->whereNotNull('client_bdt_measurement_id')
             ->paginate(15);
@@ -991,7 +991,7 @@ FROM measurement
          join client on measurement.client_id = client.id
 WHERE measurement.label NOT IN ('SBP', 'DBP')
   AND (measurement.is_cellular_zero = FALSE or measurement.is_cellular_zero IS NULL)
-  AND measurement.is_removed IS FALSE
+  AND measurement.is_active IS TRUE
   AND measurement.has_been_stamped_by_mcp IS FALSE
   AND measurement.ts IS NOT NULL
   AND measurement.client_bdt_measurement_id IS NOT NULL
@@ -1035,7 +1035,7 @@ FROM measurement
          join care_month on client.id = care_month.client_id
 WHERE measurement.label NOT IN ('SBP', 'DBP')
   AND (measurement.is_cellular_zero = FALSE or measurement.is_cellular_zero IS NULL)
-  AND measurement.is_removed IS FALSE
+  AND measurement.is_active IS TRUE
   AND measurement.has_been_stamped_by_mcp IS FALSE
   AND measurement.ts IS NOT NULL
   AND measurement.client_bdt_measurement_id IS NOT NULL

+ 8 - 8
app/Models/Client.php

@@ -206,7 +206,7 @@ class Client extends Model
     public function recentMeasurements()
     {
         return $this->hasMany(Measurement::class, 'client_id', 'id')
-            ->where('is_removed', false)
+            ->where('is_active', true)
             ->whereNotNull('label')
             ->where('label', '<>', 'SBP')
             ->where('label', '<>', 'DBP')
@@ -219,7 +219,7 @@ class Client extends Model
     {
         return $this->hasMany(Measurement::class, 'client_id', 'id')
             /*->distinct('label')*/
-            ->where('is_removed', false)
+            ->where('is_active', true)
             ->where('is_cellular_zero', false)
             ->orderBy('effective_date', 'desc');
     }
@@ -227,7 +227,7 @@ class Client extends Model
     public function getNonZeroBpMeasurements(){
         return $this->hasMany(Measurement::class, 'client_id', 'id')
             /*->distinct('label')*/
-            ->where('is_removed', false)
+            ->where('is_active', true)
             ->where('label', '=', 'BP')
             ->where('sbp_mm_hg', '>', 0)
             ->where('dbp_mm_hg', '>', 0)
@@ -237,7 +237,7 @@ class Client extends Model
     public function getNonZeroWeightMeasurements(){
         return $this->hasMany(Measurement::class, 'client_id', 'id')
             /*->distinct('label')*/
-            ->where('is_removed', false)
+            ->where('is_active', true)
             ->where('label', '=', 'Wt. (lbs.)')
             ->where('numeric_value', '>', 0)
             ->orderBy('ts', 'desc');
@@ -264,7 +264,7 @@ class Client extends Model
             ::where('client_id', $this->id)
             ->whereRaw('EXTRACT(MONTH FROM effective_date) = ?', [$month])
             ->whereRaw('EXTRACT(YEAR FROM effective_date) = ?', [$year])
-            ->where('is_removed', false)
+            ->where('is_active', true)
             ->orderBy('ts', 'desc')
             ->get();
         return $measurements;
@@ -273,7 +273,7 @@ class Client extends Model
     public function allMeasurements()
     {
         return $this->hasMany(Measurement::class, 'client_id', 'id')
-            ->where('is_removed', false)
+            ->where('is_active', true)
             ->whereNull('parent_measurement_id')
             ->orderBy('label', 'asc')
             ->orderBy('effective_date', 'desc');
@@ -316,7 +316,7 @@ class Client extends Model
             ->whereNotNull('bdt_measurement_id')
             ->whereNotNull('ts')
             ->where('is_cellular_zero', false)
-            ->where('is_removed', false)
+            ->where('is_active', true)
             ->where('label', '=', $_type)
             ->orderBy('ts', 'desc')
             ->first();
@@ -778,7 +778,7 @@ FROM measurement m
 WHERE m.care_month_id = :careMonthID
         AND m.label NOT IN ('SBP', 'DBP')
         AND m.bdt_measurement_id IS NOT NULL
-        AND m.is_removed IS FALSE
+        AND m.is_active IS TRUE
         AND (m.is_cellular_zero = FALSE or m.is_cellular_zero IS NULL)
         AND m.ts IS NOT NULL
         AND m.client_bdt_measurement_id IS NOT NULL

+ 1 - 1
app/Models/Measurement.php

@@ -48,7 +48,7 @@ class Measurement extends Model
 
     public function childMeasurements() {
         return Measurement::where('parent_measurement_id', $this->id)
-            ->where('is_removed', false)
+            ->where('is_active', true)
             ->get();
     }
 }

+ 1 - 1
app/Models/Pro.php

@@ -620,7 +620,7 @@ WHERE mcp_pro_id = :pro_id
         $start *= 1000;
         $end *= 1000;
 
-        $measurementsQuery = Measurement::where('is_removed', false)
+        $measurementsQuery = Measurement::where('measurement.is_active', true)
             ->join('client', 'client.id', '=', 'measurement.client_id')
             ->whereNotNull('measurement.client_bdt_measurement_id')
             ->whereNotNull('measurement.ts')

+ 4 - 4
database/seeds/MeasurementSeeder.php

@@ -98,7 +98,7 @@ class MeasurementSeeder extends Seeder
                 'created_at' => date('Y-m-d'),
                 'type' => 'Measurement',
                 'uid' => Str::uuid(),
-                'is_removed' => false,
+                'is_active' => true,
                 'removal_memo' => null,
                 'removed_at' => null,
                 'effective_date' => $date,
@@ -121,7 +121,7 @@ class MeasurementSeeder extends Seeder
                 'created_at' => date('Y-m-d'),
                 'type' => 'Measurement',
                 'uid' => Str::uuid(),
-                'is_removed' => false,
+                'is_active' => true,
                 'removal_memo' => null,
                 'removed_at' => null,
                 'effective_date' => $date,
@@ -144,7 +144,7 @@ class MeasurementSeeder extends Seeder
                 'created_at' => date('Y-m-d'),
                 'type' => 'Measurement',
                 'uid' => Str::uuid(),
-                'is_removed' => false,
+                'is_active' => true,
                 'removal_memo' => null,
                 'removed_at' => null,
                 'effective_date' => $date,
@@ -219,7 +219,7 @@ class MeasurementSeeder extends Seeder
                 'created_at' => date('Y-m-d'),
                 'type' => 'Measurement',
                 'uid' => Str::uuid(),
-                'is_removed' => false,
+                'is_active' => true,
                 'removal_memo' => null,
                 'removed_at' => null,
                 'effective_date' => $date,

+ 1 - 61
resources/views/app/mcp/patients-table.blade.php

@@ -1,33 +1,5 @@
-<style>
-	td,
-	th {
-		text-align: center !important;
-	}
-</style>
-
-<<<<<<< HEAD
-<table class="table table-condensed p-0 m-0 table-sm table-bordered">
-	<thead class="bg-light">
-		<tr>
-			<th class="px-3 border-0x">#</th>
-			<th class="px-3 border-0x">Name</th>
-			<th class="px-3 border-0x">DOB</th>
-			<th class="px-3 border-0x">Age</th>
-			<th class="px-3 border-0x">Sex</th>
-			<th class="px-3 border-0x">Insurance</th>
-			<th class="px-3 border-0x">Last Visit</th>
-			<th class="px-3 border-0x">Next Appt.</th>
-			<th class="px-3 border-0x">Status</th>
-
-            <th class="px-3 border-0x">BP</th>
-            <th class="px-3 border-0x"> <i class="fa fa-heartbeat"></i> </th>
-            <th class="px-3 border-0x">Pulse</th>
-            <th class="px-3 border-0x d-none">BP/Pulse Timestamp</th>
-            <th class="px-3 border-0x">Weight</th>
-            <th class="px-3 border-0x d-none">Weight Timestamp</th>
-=======
 <div class="table-responsive">
-	<table class="table table-striped p-0 m-0 table-sm border-top text-nowrap">
+	<table class="table table-striped p-0 m-0 table-sm border-top border-bottom text-nowrap">
 		<thead class="bg-light">
 			<tr>
 				<th class="border-0">#</th>
@@ -47,7 +19,6 @@
 				<th class="border-0">BP/Pulse Timestamp</th>
 				<th class="border-0">Weight</th>
 				<th class="border-0">Weight Timestamp</th>
->>>>>>> 5728faa93ac349dab39f7b515e7970bf1f20b8f6
 
 				{{-- <th>Scale <i class="fa fa-battery"></i></th>--}}
 				{{-- <th class="border-0">RPM</th>--}}
@@ -56,28 +27,6 @@
 				{{-- <th class="border-0 d-none">Last BP</th>--}}
 				<th class="border-0">Assigned On</th>
 
-<<<<<<< HEAD
-        @if($pro->pro_type == 'ADMIN')
-                <th class="px-3 border-0x">MCP</th>
-            @endif
-		</tr>
-	</thead>
-	<tbody>
-		@foreach($patients as $patient)
-		<tr>
-			<td class="px-3 text-nowrap">
-				<a native target="_blank" href="{{route('patients.view.dashboard', $patient)}}">
-					{{$patient->chart_number}}
-				</a>
-			</td>
-			<td class="text-nowrap">{{$patient->displayName()}}</td>
-			<td class="text-nowrap">{{ friendly_date_time($patient->dob, false) }}</td>
-			<td class="text-nowrap">{{ $patient->age_in_years ?  $patient->age_in_years : '-' }}</td>
-			<td class="text-nowrap">{{ $patient->sex }}</td>
-			<td class="d-none text-nowrap">
-				<div class="d-none d-dflex flex-column">
-					@if($patient->usual_bmi_min && $patient->usual_bmi_max)
-=======
 				@if($pro->pro_type == 'ADMIN')
 				<th class="border-0">MCP</th>
 				@endif
@@ -98,7 +47,6 @@
 				<td>
 					<div class="d-none d-dflex flex-column">
 						@if($patient->usual_bmi_min && $patient->usual_bmi_max)
->>>>>>> 5728faa93ac349dab39f7b515e7970bf1f20b8f6
 						<small class="text-muted">BMI (Usual): <b>{{ $patient->usual_bmi_min }}</b> {{ $patient->usual_bmi_min_category }} to <b>{{ $patient->usual_bmi_max }}</b> {{ $patient->usual_bmi_max_category }}</small>
 						@endif
 						@if($patient->ideal_bmi)
@@ -139,19 +87,11 @@
 
 				<td>{{ $patient->most_recent_cellular_bp_value_pulse }}</td>
 
-<<<<<<< HEAD
-            <td class="text-nowrap d-none">{{ friendlier_date_time($patient->most_recent_cellular_bp_measurement_at, false) }}</td>
-=======
 				<td>{{ friendlier_date_time($patient->most_recent_cellular_bp_measurement_at, false) }}</td>
->>>>>>> 5728faa93ac349dab39f7b515e7970bf1f20b8f6
 
 				<td>{{ $patient->most_recent_cellular_weight_value ? round($patient->most_recent_cellular_weight_value, 2) : '--' }}</td>
 
-<<<<<<< HEAD
-            <td class="text-nowrap d-none">{{ friendlier_date_time($patient->most_recent_cellular_weight_measurement_at, false) }}</td>
-=======
 				<td>{{ friendlier_date_time($patient->most_recent_cellular_weight_measurement_at, false) }}</td>
->>>>>>> 5728faa93ac349dab39f7b515e7970bf1f20b8f6
 
 				{{-- <td>{{$patient->is_enrolled_in_cm ? 'Yes' : 'No'}}</td>--}}
 				{{-- <td>{{$patient->is_enrolled_in_rm ? 'Yes' : 'No'}}</td>--}}

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

@@ -226,12 +226,13 @@
                 }, 'json')
             },
             getPrefillValues: function() {
-                this.payload.lines = [{
-                    cpt: '',
-                    dateOfService: '{{date('Y-m-d')}}',
-                    icds: JSON.parse(JSON.stringify(window.rmReasons)),
-                    numberOfUnits: 1
-                }];
+                @if(@$careMonth && !empty($careMonth->claim_suggestion_json))
+                    let csj = {!! $careMonth->claim_suggestion_json !!};
+                    if(csj && csj.lines && csj.lines.length) {
+                        this.payload.lines.splice(0, 1);
+                        this.payload.lines = csj.lines;
+                    }
+                @endif
             }
         },
         mounted: function () {