Pārlūkot izejas kodu

CM single - layout updates

Vijayakrishnan 2 gadi atpakaļ
vecāks
revīzija
5903e7cf38

+ 16 - 0
app/Models/CareMonth.php

@@ -41,6 +41,22 @@ class CareMonth extends Model
             ->orderBy('effective_date', 'DESC');
     }
 
+    public function entriesByPro($_proId) {
+        return CareMonthEntry::where('care_month_id', $this->id)
+            ->where('pro_id', $_proId)
+            ->where('cm_or_rm_or_rtm_msk_or_rtm_lung', 'RM')
+            ->orderBy('effective_date', 'DESC')
+            ->get();
+    }
+
+    public function entriesNotByPro($_proId) {
+        return CareMonthEntry::where('care_month_id', $this->id)
+            ->where('pro_id', '!=', $_proId)
+            ->where('cm_or_rm_or_rtm_msk_or_rtm_lung', 'RM')
+            ->orderBy('effective_date', 'DESC')
+            ->get();
+    }
+
     public function rtmEntries() {
         return $this->hasMany(CareMonthEntry::class, 'care_month_id', 'id')
             ->whereRaw("(cm_or_rm_or_rtm_msk_or_rtm_lung = 'RTM_MSK' OR cm_or_rm_or_rtm_msk_or_rtm_lung = 'RTM_LUNG')")

+ 34 - 4
resources/views/app/patient/care-month/_matrix-v2.blade.php

@@ -38,23 +38,27 @@ foreach ($days as $k => $day) {
 @endif
 <div class="my-3 border p-3 cm-tab" tab-key="time-entries">
     @if($careMonth->is_client_enrolled_in_rm)
+        <?php
+        $myEntries = $careMonth->entriesByPro($pro->id);
+        $otherEntries = $careMonth->entriesNotByPro($pro->id);
+        ?>
         <div class="d-flex align-items-center">
-            <h6 class="my-0 text-secondary font-weight-bold text-dark lh-24px">Time Entries</h6>
+            <h6 class="my-0 text-secondary font-weight-bold text-dark lh-24px">My Time Entries</h6>
             <span class="mx-2 text-secondary">|</span>
             @include('app.practice-management.care_month_add_entry_form', ['right' => false])
         </div>
         <table class="table table-striped table-sm table-bordered mt-2 mb-0 table-hover">
             <thead>
             <tr>
-                <th class="px-2 text-secondary border-bottom-0">Effective Date</th>
+                <th class="px-2 text-secondary border-bottom-0">Date</th>
                 <th class="px-2 text-secondary border-bottom-0">Time</th>
-                <th class="px-2 text-secondary border-bottom-0">Communicated</th>
+                <th class="px-2 text-secondary border-bottom-0">Inter.</th>
                 <th class="px-2 text-secondary border-bottom-0 w-50">Comments</th>
                 <th class="px-2 text-secondary border-bottom-0 delete-column">&nbsp;</th>
             </tr>
             </thead>
             <tbody>
-            @foreach($careMonth->entries as $entry)
+            @foreach($myEntries as $entry)
                 @if(!$entry->is_removed && $entry->cm_or_rm_or_rtm_msk_or_rtm_lung === "RM")
                     <tr>
                         <td class="px-2">
@@ -93,6 +97,32 @@ foreach ($days as $k => $day) {
             @endforeach
             </tbody>
         </table>
+
+        <div class="d-flex align-items-center mt-3">
+            <h6 class="my-0 text-secondary font-weight-bold text-dark lh-24px">Other Time Entries</h6>
+        </div>
+        <table class="table table-striped table-sm table-bordered mt-2 mb-0 table-hover">
+            <thead>
+            <tr>
+                <th class="px-2 text-secondary border-bottom-0 width-100px">Date</th>
+                <th class="px-2 text-secondary border-bottom-0 w-100">Comments</th>
+            </tr>
+            </thead>
+            <tbody>
+            @foreach($otherEntries as $entry)
+                @if(!$entry->is_removed && $entry->cm_or_rm_or_rtm_msk_or_rtm_lung === "RM")
+                    <tr>
+                        <td class="px-2">
+                            <div class="font-weight-bold">{{friendly_date_time($entry->effective_date, false)}}</div>
+                        </td>
+                        <td class="px-2">
+                            <div class="text-secondary in-table-markup">{!! $entry->content_text !!}</div>
+                        </td>
+                    </tr>
+                @endif
+            @endforeach
+            </tbody>
+        </table>
     @else
         <h6 class="mb-2 text-secondary font-weight-bold text-dark lh-24px">Time Entries</h6>
         <div class="alert alert-secondary mt-2 mb-0">

+ 8 - 8
resources/views/app/patient/care-month/_matrix.blade.php

@@ -39,16 +39,16 @@ foreach ($days as $k => $day) {
 <table class="table table-condensed table-sm table-bordered mb-3 cm-tab" tab-key="matrix">
     <thead>
     <tr>
-        <th class="px-2 text-secondary align-bottom" rowspan="2">Date</th>
+        <th class="px-2 text-secondary align-bottom border-bottom-0" rowspan="2">Date</th>
         <th class="px-2 text-secondary border-bottom-0" colspan="4">Measurements</th>
-        <th class="px-2 text-secondary align-bottom" rowspan="2">{{$performerRole === 'ADMIN' ? 'Stamp Status' : 'Stamp + Entry'}}</th>
-        <th class="px-2 text-secondary" rowspan="2">Entries</th>
+        <th class="px-2 text-secondary align-bottom border-bottom-0" rowspan="2">{{$performerRole === 'ADMIN' ? 'Stamp Status' : 'Stamp + Entry'}}</th>
+        <th class="px-2 text-secondary border-bottom-0" rowspan="2">Entries</th>
     </tr>
     <tr>
-        <th class="text-secondary text-sm">Time</th>
-        <th class="text-secondary text-sm">Type</th>
-        <th class="text-secondary text-sm">Value</th>
-        <th class="text-secondary text-sm">Stamp</th>
+        <th class="text-secondary text-sm border-bottom-0">Time</th>
+        <th class="text-secondary text-sm border-bottom-0">Type</th>
+        <th class="text-secondary text-sm border-bottom-0">Value</th>
+        <th class="text-secondary text-sm border-bottom-0">Stamp</th>
     </tr>
     </thead>
     <tbody>
@@ -323,7 +323,7 @@ foreach ($days as $k => $day) {
                         @endif
                     @endif
                 </td>
-                <td rowspan="{{count($days[$k])}}" class="px-2">
+                <td rowspan="{{count($days[$k])}}" class="px-1 pt-1 pb-0 bg-light">
                     @foreach($m->entries as $entry)
                         <div class="border px-2 py-1 mb-1 bg-white">
                             <div class="d-flex align-items-baseline flex-nowrap">

+ 72 - 49
resources/views/app/patient/care-month/dashboard.blade.php

@@ -177,32 +177,15 @@
 
         <?php $vitalLabels = ['Ht. (in.)','Wt. (lbs.)','Temp. (F)','Pulse','Resp.','Pulse Ox.','SBP','DBP','Smoking Status', 'BMI']; ?>
 
-        <div class="row mb-3">
+        <div class="row">
             <div class="col-12">
                 <div class="mt-0">
 
-                    <div class="mb-2">
-                        <h6 class="mb-3 font-weight-bold text-dark">Measurements</h6>
-                        <div class="row mb-3">
-                            <div class="col-9">
-                                <div class="d-flex align-items-baseline mb-3" tab-links>
-                                    <a class="tab-link-active" href="#" tab-link="measurements-graph">Graph</a>
-                                    <a class="" href="#" tab-link="measurements-calendar">Calendar</a>
-                                </div>
-
-                                <div class="cm-tab border pr-4" tab-key="measurements-graph">
-                                    @include('app.patient.care-month._vitals_graph_unified')
-                                </div>
-
-                                <div class="cm-tab" tab-key="measurements-calendar">
-                                    <div id="caremonth-measurements-calendar-{{$calendarID}}" class="caremonth-measurements-calendar">
-
-                                    </div>
-                                </div>
-
-                            </div>
-                            <div class="col-3 px-0">
+                    <div class="mb-3">
+                        <div class="d-flex align-items-stretch">
 
+                            <div class="border mr-3 px-3 pb-2 bg-light">
+                                <!-- last visit -->
                                 <div class="mt-2">
                                     <?php $daysDiff = -1; ?>
                                     @if($patient->most_recent_completed_mcp_note_date)
@@ -226,6 +209,7 @@
                                     </b>
                                 </div>
 
+                                <!-- days with meas. -->
                                 <div class="mt-2">
                                     <span class="font-weight-bold text-secondary">Days with meas.:</span>
                                     <b class="{{$careMonth->number_of_days_with_remote_measurements >= 16 ? 'text-success' : 'text-warning-mellow'}}">
@@ -270,6 +254,7 @@
                                     @endif
                                 @endif
 
+                                {{-- inter. --}}
                                 <div class="mt-2">
                                     <?php $spoken = $careMonth->has_mcp_interacted_with_client_about_rm; ?>
                                     <span class="font-weight-bold text-secondary">MCP spoke to patient:</span>
@@ -282,9 +267,10 @@
                                         @endif
                                     </b>
                                 </div>
+                            </div>
 
-
-
+                            <div class="border mr-3 px-3 pb-2 bg-light">
+                                <!-- mins billes -->
                                 <div class="mt-2">
                                     <?php
                                     $minsBilled = 0;
@@ -305,10 +291,10 @@
 
                                     @if($pro->pro_type == 'ADMIN')
                                         <span class="font-weight-bold text-secondary">Mins. billed:</span>
-                                    @else 
+                                    @else
                                         <span class="font-weight-bold text-secondary">Mins. I have billed:</span>
                                     @endif
-                                    
+
                                     <b class="{{$minsBilled >= 20 ? 'text-success' : 'text-warning-mellow'}}">
                                         {{$minsBilled}}
                                         @if($minsBilled < 20)
@@ -322,26 +308,6 @@
                                     @include('app.practice-management.care_month_add_entry_form', ['right' => true])
                                 </div>
 
-                                @if($performer->pro->pro_type == 'ADMIN')
-                                    <div>
-                                        <div class="my-1 font-weight-bold text-secondary">Has Anyone Interacted With Client About RM: {{$careMonth->has_anyone_interacted_with_client_about_rm? 'Yes': 'No'}}</div> 
-                                        <div class="my-1 font-weight-bold text-secondary">Has Mcp Interacted With Client About RM: {{$careMonth->has_mcp_interacted_with_client_about_rm? 'Yes': 'No'}}</div>	
-                                        <div class="my-1 font-weight-bold text-secondary">Has Admin Interacted With Client About RM: {{$careMonth->has_admin_interacted_with_client_about_rm? 'Yes': 'No'}}</div>
-                                        <div class="my-1 font-weight-bold text-secondary">Has Rmm Interacted With Client About RM: {{$careMonth->has_rmm_interacted_with_client_about_rm? 'Yes': 'No'}}</div>
-                                         
-                                        <div class="my-1 font-weight-bold text-secondary">Most Recent Mcp Note Date: {{$careMonth->most_recent_mcp_note_date}}</div>
-                                        <div class="my-1 font-weight-bold text-secondary">Days Between Most Recent Mcp Note Date And End Of Care Month: {{$careMonth->days_between_most_recent_mcp_note_date_and_end_of_care_month}}</div>
-                                        <div class="my-1 font-weight-bold text-secondary">Rm Total Time In Seconds: {{$careMonth->rm_total_time_in_seconds}}</div>
-                                        <div class="my-1 font-weight-bold text-secondary">Rm Total Time In Seconds By Mcp: {{$careMonth->rm_total_time_in_seconds_by_mcp}}</div>
-                                        <div class="my-1 font-weight-bold text-secondary">Rm Total Time In Seconds By Rmm Pro: {{$careMonth->rm_total_time_in_seconds_by_rmm_pro}}</div>
-                                        <div class="my-1 font-weight-bold text-secondary">Rm Total Time In Seconds By Rme Pro: {{$careMonth->rm_total_time_in_seconds_by_rme_pro}}</div>
-                                    </div>
-                                @endif
-
-                                @if($performer->pro->pro_type == 'ADMIN')
-                                    @include('app.patient.care-month._rtm_stats')
-                                @endif
-
                                 {{-- mcp billing --}}
                                 @if($performer->pro->pro_type == 'ADMIN' || $careMonth->mcp && $pro->id === $careMonth->mcp->id)
                                     <div class="mt-2 d-flex align-items-baseline">
@@ -469,9 +435,12 @@
                                         </div>
                                     </div>
                                 @endif
+                            </div>
 
+                            <div class="border mr-3 px-3 pb-2 bg-light">
+
+                                {{-- rm reasons --}}
                                 <div class="mt-2">
-                                    {{-- rm reasons --}}
                                     <div class="mb-2">
                                         @include('app/patient/care-month/rm-reasons')
                                     </div>
@@ -480,7 +449,61 @@
                         </div>
                     </div>
 
-                    @include('app.patient.care-month._matrix-v2')
+                    <hr class="m-neg-4 my-3">
+
+                    <div class="mb-2">
+                        <h6 class="mb-3 font-weight-bold text-dark">Measurements</h6>
+                        <div class="row">
+                            <div class="col-7">
+                                <div class="d-flex align-items-baseline mb-3" tab-links>
+                                    <a class="tab-link-active" href="#" tab-link="measurements-graph">Graph</a>
+                                    <a class="" href="#" tab-link="measurements-calendar">Calendar</a>
+                                    @if($performer->pro->pro_type == 'ADMIN')
+                                        <a class="" href="#" tab-link="measurements-admin">Admin</a>
+                                    @endif
+                                </div>
+
+                                <div class="cm-tab border pr-4" tab-key="measurements-graph">
+                                    @include('app.patient.care-month._vitals_graph_unified')
+                                </div>
+
+                                <div class="cm-tab" tab-key="measurements-calendar">
+                                    <div id="caremonth-measurements-calendar-{{$calendarID}}" class="caremonth-measurements-calendar">
+
+                                    </div>
+                                </div>
+
+                                @if($performer->pro->pro_type == 'ADMIN')
+                                    <div class="cm-tab border p-3 d-none" tab-key="measurements-admin">
+                                        <div>
+                                            <div class="my-1 font-weight-bold text-secondary">Has Anyone Interacted With Client About RM: {{$careMonth->has_anyone_interacted_with_client_about_rm? 'Yes': 'No'}}</div>
+                                            <div class="my-1 font-weight-bold text-secondary">Has Mcp Interacted With Client About RM: {{$careMonth->has_mcp_interacted_with_client_about_rm? 'Yes': 'No'}}</div>
+                                            <div class="my-1 font-weight-bold text-secondary">Has Admin Interacted With Client About RM: {{$careMonth->has_admin_interacted_with_client_about_rm? 'Yes': 'No'}}</div>
+                                            <div class="my-1 font-weight-bold text-secondary">Has Rmm Interacted With Client About RM: {{$careMonth->has_rmm_interacted_with_client_about_rm? 'Yes': 'No'}}</div>
+
+                                            <div class="my-1 font-weight-bold text-secondary">Most Recent Mcp Note Date: {{$careMonth->most_recent_mcp_note_date}}</div>
+                                            <div class="my-1 font-weight-bold text-secondary">Days Between Most Recent Mcp Note Date And End Of Care Month: {{$careMonth->days_between_most_recent_mcp_note_date_and_end_of_care_month}}</div>
+                                            <div class="my-1 font-weight-bold text-secondary">Rm Total Time In Seconds: {{$careMonth->rm_total_time_in_seconds}}</div>
+                                            <div class="my-1 font-weight-bold text-secondary">Rm Total Time In Seconds By Mcp: {{$careMonth->rm_total_time_in_seconds_by_mcp}}</div>
+                                            <div class="my-1 font-weight-bold text-secondary">Rm Total Time In Seconds By Rmm Pro: {{$careMonth->rm_total_time_in_seconds_by_rmm_pro}}</div>
+                                            <div class="my-1 font-weight-bold text-secondary">Rm Total Time In Seconds By Rme Pro: {{$careMonth->rm_total_time_in_seconds_by_rme_pro}}</div>
+                                        </div>
+
+                                        @include('app.patient.care-month._rtm_stats')
+                                    </div>
+                                @endif
+
+                            </div>
+                            <div class="col-5">
+                                @include('app.patient.care-month._matrix-v2')
+                            </div>
+                        </div>
+                        <div class="mt-3">
+                            @include('app.patient.care-month._matrix', ['onlyMatrix' => true])
+                        </div>
+                    </div>
+
+
 
                     <table class="table table-striped table-sm table-bordered mt-2 mb-0 d-none">
                         <thead>
@@ -616,7 +639,7 @@
         {{-- BDT Measurements --}}
         {{-- <hr class="m-negator mt-4 mb-3">
 
-        <div class="row mb-3">
+        <div class="row">
             <div class="col-12">
                 <div class="d-flex align-items-center">
                     <h6 class="my-0 text-secondary font-weight-bold text-dark lh-24px">Cellular Measurements</h6>

+ 0 - 19
resources/views/app/practice-management/care_month_add_entry_form.blade.php

@@ -38,10 +38,6 @@
                     </div>
                     <div class="col-4">
                         <label class="mb-1 text-sm text-secondary text-left">Minutes</label>
-                        <!--<input type="hidden" name="timeInSeconds" value="{{@$entry ? $entry->time_in_seconds : (@$defaultSeconds ?: '')}}">
-                        <input type="number" min="1" max="20" name="timeInMinutes" class="form-control form-control-sm w-100 cm-time-value"
-                               value="{{@$entry ? round($entry->time_in_seconds / 60, 0) : (@$defaultSeconds ? $defaultSeconds/60 : '')}}"
-                               required>-->
                         <select name="timeInSeconds" class="form-control form-control-sm min-width-unset" required>
                             <option value="">-- select --</option>
                             @for($i = 0; $i <= 20; $i++)
@@ -81,18 +77,3 @@
     <span class="mx-2 text-secondary">|</span>
     <span class="text-secondary">Can't modify since a bill exists</span>
 @endif
-<script>
-    (function() {
-        function init() {
-            $(document)
-                .off('input change paste keyup', '[name="timeInMinutes"]')
-                .on('input change paste keyup', '[name="timeInMinutes"]', function() {
-                    let form = $(this).closest('form'), val = '' + $(this).val();
-                    if(!isNaN(val)) {
-                        form.find('[name="timeInSeconds"]').val(+val * 60);
-                    }
-                });
-        }
-        addMCInitializer('cm-entry-form{{@$entry ? '-' . $entry->uid : ''}}', init, '#cm-entry-form{{@$entry ? '-' . $entry->uid : ''}}');
-    }).call(window);
-</script>