Peter Muturi 1 年之前
父节点
当前提交
6ee6a9d350

+ 45 - 83
resources/views/app/patient/note/dashboard.blade.php

@@ -1003,92 +1003,54 @@ use App\Models\Handout;
 
                 <div class="p-3 border-bottom" data-non-segment-section="ICDs">
                     <div class="">
-                        <div class="d-flex mr-2">
-                            <p class="font-weight-bold text-secondary m-0 mr-2">Claim ICDs</p>
-                            @include('app.patient.partials.put-rm-reasons', ['recordType' => 'NOTE', 'record' => $note])
-                        </div>
-                        <?php
-                        $noteICDData = [
-                            'icd_1' => [
-                                'title' => 'ICD 1',
-                                'reason' => $note->note_reason_icd1,
-                                'description' => $note->note_reason_icd1description
-                            ],
-                            'icd_2' => [
-                                'title' => 'ICD 2',
-                                'reason' => $note->note_reason_icd2,
-                                'description' => $note->note_reason_icd2description
-                            ],
-                            'icd_3' => [
-                                'title' => 'ICD 3',
-                                'reason' => $note->note_reason_icd3,
-                                'description' => $note->note_reason_icd3description
-                            ],
-                            'icd_4' => [
-                                'title' => 'ICD 4',
-                                'reason' => $note->note_reason_icd4,
-                                'description' => $note->note_reason_icd4description
-                            ],
-                        ];
-                        ?>
-                        <div class="d-inline-flex align-items-start flex-wrap mr-auto">
-                            <?php $emptyNoteICDs = true; ?>
-                            @foreach ($noteICDData as $noteICDKey => $noteICD)
-                                <?php
-                                $emptyICD = true;
-                                if(!empty($noteICD['reason']) || !empty($noteICD['description'])){
-                                    $emptyNoteICDs = false;
-                                    $emptyICD = false;
-                                }
-                                ?>
-                                @if(!$emptyICD)
-                                    <span class="badge badge-info px-2 mb-1 mr-2">{{$noteICD['reason']}} @if(!empty($noteICD['description']))({{ $noteICD['description'] }})@endif</span>
-                                @endif
-                            @endforeach
-                            @if($emptyNoteICDs)
-                                <small class="text-dark">-</small>
-                            @endif
-                        </div>
-                        <div class="on-hover-show d-block on-hover-opaque position-relative mx-1">
-                            <i class="fa fa-info-circle"></i>
-                            <div class="on-hover-content p-0 border-0 max-width-unset bg-white">
-                                <table class="table table-sm m-0 table-bordered border-0">
-                                    <thead>
-                                    <tr class="bg-light">
-                                        <th class="border-bottom-0">Created</th>
-                                        <th class="min-width-140px border-bottom-0">Reason 1</th>
-                                        <th class="min-width-140px border-bottom-0">Reason 2</th>
-                                        <th class="min-width-140px border-bottom-0">Reason 3</th>
-                                        <th class="min-width-140px border-bottom-0">Reason 4</th>
-                                    </tr>
-                                    </thead>
-                                    <tbody>
-                                    @foreach($note->reasonsLog as $log)
-                                        <tr>
-                                            <td class="text-nowrap">{{friendly_date_time($log->created_at)}}</td>
-                                            <td>
-                                                {{$log->note_reason_icd1}}
-                                                <div class="text-sm text-secondary">{{$log->note_reason_icd1description}}</div>
-                                            </td>
-                                            <td>
-                                                {{$log->note_reason_icd2}}
-                                                <div class="text-sm text-secondary">{{$log->note_reason_icd2description}}</div>
-                                            </td>
-                                            <td>
-                                                {{$log->note_reason_icd3}}
-                                                <div class="text-sm text-secondary">{{$log->note_reason_icd3description}}</div>
-                                            </td>
-                                            <td>
-                                                {{$log->note_reason_icd4}}
-                                                <div class="text-sm text-secondary">{{$log->note_reason_icd4description}}</div>
-                                            </td>
+                        <div class="d-flex justify-content-between mb-2">
+                            <div class="d-flex">
+                                <p class="font-weight-bold text-secondary m-0 mr-2">Claim ICDs</p>
+                                @include('app.patient.partials.put-rm-reasons', ['recordType' => 'NOTE', 'record' => $note])
+                            </div>
+                            <div class="on-hover-show d-block on-hover-opaque position-relative mx-1">
+                                <i class="fa fa-info-circle"></i>
+                                <div class="on-hover-content p-0 border-0 max-width-unset bg-white">
+                                    <table class="table table-sm m-0 table-bordered border-0">
+                                        <thead>
+                                        <tr class="bg-light">
+                                            <th class="border-bottom-0">Created</th>
+                                            <th class="min-width-140px border-bottom-0">Reason 1</th>
+                                            <th class="min-width-140px border-bottom-0">Reason 2</th>
+                                            <th class="min-width-140px border-bottom-0">Reason 3</th>
+                                            <th class="min-width-140px border-bottom-0">Reason 4</th>
                                         </tr>
-                                    @endforeach
-                                    </tbody>
-                                </table>
+                                        </thead>
+                                        <tbody>
+                                        @foreach($note->reasonsLog as $log)
+                                            <tr>
+                                                <td class="text-nowrap">{{friendly_date_time($log->created_at)}}</td>
+                                                <td>
+                                                    {{$log->note_reason_icd1}}
+                                                    <div class="text-sm text-secondary">{{$log->note_reason_icd1description}}</div>
+                                                </td>
+                                                <td>
+                                                    {{$log->note_reason_icd2}}
+                                                    <div class="text-sm text-secondary">{{$log->note_reason_icd2description}}</div>
+                                                </td>
+                                                <td>
+                                                    {{$log->note_reason_icd3}}
+                                                    <div class="text-sm text-secondary">{{$log->note_reason_icd3description}}</div>
+                                                </td>
+                                                <td>
+                                                    {{$log->note_reason_icd4}}
+                                                    <div class="text-sm text-secondary">{{$log->note_reason_icd4description}}</div>
+                                                </td>
+                                            </tr>
+                                        @endforeach
+                                        </tbody>
+                                    </table>
+                                </div>
                             </div>
                         </div>
-                        <div></div>
+                        <div>
+                            @include('app.patient.partials.rm-reasons-display', ['recordType' => 'NOTE', 'record' => $note])
+                        </div>
                     </div>
                     @if(!empty($note->note_reason_memo))
                         <div style="padding-left: 60px;">

+ 15 - 3
resources/views/app/patient/partials/rm-reasons-display.blade.php

@@ -21,10 +21,22 @@ $displayData = [
 		'description' => $record->rm_reason_icd4description
 	],
 ];
+if($recordType === 'NOTE'){
+	$displayData['icd_1']['reason'] = $record->note_reason_icd1;
+	$displayData['icd_1']['description'] = $record->note_reason_icd1description;
+	$displayData['icd_2']['reason'] = $record->note_reason_icd2;
+	$displayData['icd_2']['description'] = $record->note_reason_icd2description;
+	$displayData['icd_3']['reason'] = $record->note_reason_icd3;
+	$displayData['icd_3']['description'] = $record->note_reason_icd3description;
+	$displayData['icd_4']['reason'] = $record->note_reason_icd4;
+	$displayData['icd_4']['description'] = $record->note_reason_icd4description;
+}
+
 	$submitUrl = null;
 	if(@$recordType === 'CLIENT') $submitUrl = '/api/client/putRmReasons';
 	if(@$recordType === 'NOTE') $submitUrl = '/api/note/putReasons';
 	if(@$recordType === 'CARE_MONTH') $submitUrl = '/api/careMonth/putRmReasons';
+
 ?>
 <div>
 	<div class="d-flex">
@@ -47,7 +59,7 @@ $displayData = [
 			@if($patient->is_enrolled_in_rm)
 			<div class="d-flex">
 				<div class="alert alert-danger p-1 mb-0">
-					Patient is enrolled and is missing RM reason(s).
+					Patient is enrolled for Remote Monitoring. Please add RM reason(s).
 				</div>
 			</div>
 			@else
@@ -87,8 +99,8 @@ $displayData = [
 					reasonIcd4Description: newOrder['icd_4'].description
 				};
 				$.post("{{$submitUrl}}", data, function(results){
-					if (results.success) {
-						fastReload();
+					if (!results.success) {
+						toastr.error(results.message || 'Failed to rearrange');
 					}
 			  });
 			}