Răsfoiți Sursa

Updated RM Reasons

Samson Mutunga 3 ani în urmă
părinte
comite
97bd559cee

+ 0 - 59
resources/views/app/patient/care-month/put-rm-reasons.blade.php

@@ -1,59 +0,0 @@
-<div moe relative>
-	<a start show><i class="fas fa-edit"></i></a>
-	<form url="/api/careMonth/putRmReasons" class="mcp-theme-1" right>
-		<input type="hidden" name="uid" value="{{$careMonth->uid}}">
-		<div>
-			<table class="table table-sm table-bordered">
-				<thead class="bg-light">
-					<tr>
-						<th class="border-bottom-0">ICD</th>
-						<th class="border-bottom-0">Description</th>
-					</tr>
-				</thead>
-				<tbody>
-					<tr>
-						<td>
-							<input type="text" class="icd-input" icd-autocomplete-code data-target="input[name=rmReasonIcd1Description]" name="rmReasonIcd1" value="{{ $careMonth->rm_reason_icd1 }}" placeholder="ICD 1" />
-						</td>
-						<td>
-							<input id="" type="text" class="form-control form-control-sm" icd-autocomplete-description name="rmReasonIcd1Description" value="{{ $careMonth->rm_reason_icd1description }}">
-						</td>
-					</tr>
-					<tr>
-						<td>
-							<input type="text" class="icd-input" icd-autocomplete-code name="rmReasonIcd2" data-target="input[name=rmReasonIcd2Description]" value="{{ $careMonth->rm_reason_icd2 }}" placeholder="ICD 2" />
-						</td>
-						<td>
-							<input type="text" class="form-control form-control-sm" icd-autocomplete-description name="rmReasonIcd2Description" value="{{ $careMonth->rm_reason_icd2description }}">
-						</td>
-					</tr>
-					<tr>
-						<td>
-							<input type="text" class="icd-input" icd-autocomplete-code name="rmReasonIcd3" data-target="input[name=rmReasonIcd3Description]" value="{{ $careMonth->rm_reason_icd3 }}" placeholder="ICD 3" />
-						</td>
-						<td>
-							<input type="text" class="form-control form-control-sm" icd-autocomplete-description name="rmReasonIcd3Description" value="{{ $careMonth->rm_reason_icd3description }}" >
-						</td>
-					</tr>
-					<tr>
-						<td>
-							<input type="text" class="icd-input" icd-autocomplete-code name="rmReasonIcd4" data-target="input[name=rmReasonIcd4Description]" value="{{ $careMonth->rm_reason_icd4 }}" placeholder="ICD 4"/>
-						</td>
-						<td>
-							<input type="text" class="form-control form-control-sm" icd-autocomplete-description name="rmReasonIcd4Description" value="{{ $careMonth->rm_reason_icd4description }}">
-						</td>
-					</tr>
-				</tbody>
-			</table>
-		</div>
-
-		<div class="mb-3">
-			<label class="font-weight-bold">RM Reason Memo</label>
-			<input type="text" class="form-control form-control-sm" name="rmReasonMemo" value="{{ $careMonth->rm_reason_memo }}">
-		</div>
-		<div>
-			<button submit class="btn btn-sm btn-primary mr-1">Submit</button>
-			<button cancel class="btn btn-sm btn-default border">Cancel</button>
-		</div>
-	</form>
-</div>

+ 2 - 45
resources/views/app/patient/care-month/rm-reasons.blade.php

@@ -1,50 +1,7 @@
 <div class="d-flex align-items-center mb-1">
     <span class="mr-2">RM Reasons:</span>
-    @include('app.patient.care-month.put-rm-reasons')
+    @include('app.patient.partials.put-rm-reasons', ['recordType' => 'CARE_MONTH', 'record' => $careMonth])
 </div>
 <div class="">
-    <table class="table table-sm table-striped table-bordered">
-        <tbody>
-            <tr>
-                <td class="text-nowrap">ICD 1</td>
-                <td>
-                    <div class="d-flex">
-                        <span class="font-weight-bold text-sm mr-2" style="min-width:60px;">{{ $careMonth->rm_reason_icd1 ? $careMonth->rm_reason_icd1 . ':' : '' }}</span>
-                        <small class="text-muted text-sm">{{ $careMonth->rm_reason_icd1description }}</small>
-                    </div>
-                </td>
-            </tr>
-            <tr>
-                <td class="text-nowrap">ICD 2</td>
-                <td>
-                    <div class="d-flex">
-                        <span class="font-weight-bold text-sm mr-2" style="min-width:60px;">{{ $careMonth->rm_reason_icd2 ? $careMonth->rm_reason_icd2 . ':' :'' }}</span>
-                        <small class="text-muted text-sm">{{ $careMonth->rm_reason_icd2description }}</small>
-                    </div>
-                </td>
-            </tr>
-            <tr>
-                <td class="text-nowrap">ICD 3</td>
-                <td>
-                    <div class="d-flex">
-                        <span class="font-weight-bold text-sm mr-2" style="min-width:60px;">{{ $careMonth->rm_reason_icd3 ? $careMonth->rm_reason_icd3 . ':' : '' }}</span>
-                        <small class="text-muted text-sm">{{ $careMonth->rm_reason_icd3description }}</small>
-                    </div>
-                </td>
-            </tr>
-            <tr>
-                <td class="text-nowrap">ICD 4</td>
-                <td>
-                    <div class="d-flex">
-                        <span class="font-weight-bold text-sm mr-2" style="min-width:60px;">{{ $careMonth->rm_reason_icd4 ? $careMonth->rm_reason_icd4 . ':' : '' }}</span>
-                        <small class="text-muted text-sm">{{ $careMonth->rm_reason_icd4description }}</small>
-                    </div>
-                </td>
-            </tr>
-            <tr>
-                <td class="text-nowrap">Memo</td>
-                <td class="text-muted text-sm">{{ $careMonth->rm_reason_memo }}</td>
-            </tr>
-        </tbody>
-    </table>
+@include('app.patient.partials.rm-reasons-display', ['recordType' => 'CARE_MONTH', 'record' => $careMonth])
 </div>

+ 2 - 3
resources/views/app/patient/note/rm-setup.blade.php

@@ -122,16 +122,15 @@
             </div> 
         @endif
         
-
         <div class="d-flex align-items-baseline mb-3">
             <div class="flex-grow-1">
                 <div>
                     <div class="d-flex align-items-center mb-1">
                         <span class="mr-2">RM Reasons:</span>
-                        @include('app.patient.partials.put-rm-reasons')
+                        @include('app.patient.partials.put-rm-reasons', ['recordType' => 'NOTE', 'record' => $note])
                     </div>
                     <div class="">
-                        @include('app.patient.partials.rm-reasons-display')
+                        @include('app.patient.partials.rm-reasons-display', ['recordType' => 'NOTE', 'record' => $note])
                     </div>
                 </div>
                 {{--<div>

+ 50 - 11
resources/views/app/patient/partials/put-rm-reasons.blade.php

@@ -1,7 +1,46 @@
+<?php
+$rmDisplayData = [
+	'icd_1' => [
+		'title' => 'ICD 1',
+		'reason' => $record->rm_reason_icd1,
+		'description' => $record->rm_reason_icd1description
+	],
+	'icd_2' => [
+		'title' => 'ICD 2',
+		'reason' => $record->rm_reason_icd2,
+		'description' => $record->rm_reason_icd2description
+	],
+	'icd_3' => [
+		'title' => 'ICD 3',
+		'reason' => $record->rm_reason_icd3,
+		'description' => $record->rm_reason_icd3description
+	],
+	'icd_4' => [
+		'title' => 'ICD 4',
+		'reason' => $record->rm_reason_icd4,
+		'description' => $record->rm_reason_icd4description
+	],
+];
+if($recordType === 'NOTE'){
+	$rmDisplayData['icd_1']['reason'] = $record->note_reason_icd1;
+	$rmDisplayData['icd_1']['description'] = $record->note_reason_icd1description;
+	$rmDisplayData['icd_2']['reason'] = $record->note_reason_icd2;
+	$rmDisplayData['icd_2']['description'] = $record->note_reason_icd2description;
+	$rmDisplayData['icd_3']['reason'] = $record->note_reason_icd3;
+	$rmDisplayData['icd_3']['description'] = $record->note_reason_icd3description;
+	$rmDisplayData['icd_4']['reason'] = $record->note_reason_icd4;
+	$rmDisplayData['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 moe>
 	<a start show><i class="fas fa-edit on-hover-opaque"></i></a>
-	<form url="/api/client/putRmReasons" class="mcp-theme-1">
-		<input type="hidden" name="uid" value="{{$patient->uid}}">
+	<form url="{{ $submitUrl }}" class="mcp-theme-1">
+		<input type="hidden" name="uid" value="{{$record->uid}}">
 		<div>
 			<table class="table table-sm table-bordered">
 				<thead class="bg-light">
@@ -13,34 +52,34 @@
 				<tbody>
 					<tr>
 						<td>
-							<input type="text" class="icd-input" icd-autocomplete-code data-target="input[name=rmReasonIcd1Description]" name="rmReasonIcd1" value="{{ $patient->rm_reason_icd1 }}" placeholder="ICD 1" />
+							<input type="text" class="icd-input" icd-autocomplete-code data-target="input[name=reasonIcd1Description]" name="reasonIcd1" value="{{ $rmDisplayData['icd_1']['reason'] }}" placeholder="ICD 1" />
 						</td>
 						<td>
-							<input id="" type="text" class="form-control form-control-sm" icd-autocomplete-description name="rmReasonIcd1Description" value="{{ $patient->rm_reason_icd1description }}">
+							<input id="" type="text" class="form-control form-control-sm" icd-autocomplete-description name="reasonIcd1Description" value="{{ $rmDisplayData['icd_1']['description'] }}">
 						</td>
 					</tr>
 					<tr>
 						<td>
-							<input type="text" class="icd-input" icd-autocomplete-code name="rmReasonIcd2" data-target="input[name=rmReasonIcd2Description]" value="{{ $patient->rm_reason_icd2 }}" placeholder="ICD 2" />
+							<input type="text" class="icd-input" icd-autocomplete-code name="reasonIcd2" data-target="input[name=reasonIcd2Description]" value="{{ $rmDisplayData['icd_2']['reason'] }}" placeholder="ICD 2" />
 						</td>
 						<td>
-							<input type="text" class="form-control form-control-sm" icd-autocomplete-description name="rmReasonIcd2Description" value="{{ $patient->rm_reason_icd2description }}">
+							<input type="text" class="form-control form-control-sm" icd-autocomplete-description name="reasonIcd2Description" value="{{ $rmDisplayData['icd_2']['description'] }}">
 						</td>
 					</tr>
 					<tr>
 						<td>
-							<input type="text" class="icd-input" icd-autocomplete-code name="rmReasonIcd3" data-target="input[name=rmReasonIcd3Description]" value="{{ $patient->rm_reason_icd3 }}" placeholder="ICD 3" />
+							<input type="text" class="icd-input" icd-autocomplete-code name="reasonIcd3" data-target="input[name=reasonIcd3Description]" value="{{ $rmDisplayData['icd_3']['reason'] }}" placeholder="ICD 3" />
 						</td>
 						<td>
-							<input type="text" class="form-control form-control-sm" icd-autocomplete-description name="rmReasonIcd3Description" value="{{ $patient->rm_reason_icd3description }}">
+							<input type="text" class="form-control form-control-sm" icd-autocomplete-description name="reasonIcd3Description" value="{{ $rmDisplayData['icd_3']['description'] }}">
 						</td>
 					</tr>
 					<tr>
 						<td>
-							<input type="text" class="icd-input" icd-autocomplete-code name="rmReasonIcd4" data-target="input[name=rmReasonIcd4Description]" value="{{ $patient->rm_reason_icd4 }}" placeholder="ICD 4" />
+							<input type="text" class="icd-input" icd-autocomplete-code name="reasonIcd4" data-target="input[name=reasonIcd4Description]" value="{{ $rmDisplayData['icd_4']['reason'] }}" placeholder="ICD 4" />
 						</td>
 						<td>
-							<input type="text" class="form-control form-control-sm" icd-autocomplete-description name="rmReasonIcd4Description" value="{{ $patient->rm_reason_icd4description }}">
+							<input type="text" class="form-control form-control-sm" icd-autocomplete-description name="reasonIcd4Description" value="{{ $rmDisplayData['icd_4']['description'] }}">
 						</td>
 					</tr>
 				</tbody>
@@ -48,7 +87,7 @@
 		</div>
 		<div class="mb-2">
 			<label class="font-weight-bold mb-1">RM Reason Memo:</label>
-			<input type="text" class="form-control form-control-sm" name="rmReasonMemo" value="{{ $patient->rm_reason_memo }}">
+			<input type="text" class="form-control form-control-sm" name="reasonMemo" value="{{ $recordType === 'NOTE' ? $record->note_reason_memo : $record->rm_reason_memo }}">
 		</div>
 		<div>
 			<button submit class="btn btn-sm btn-primary mr-1">Submit</button>

+ 44 - 31
resources/views/app/patient/partials/rm-reasons-display.blade.php

@@ -1,44 +1,57 @@
+<?php
+	$displayData = [
+		'icd_1' => [
+			'title' => 'ICD 1',
+			'reason' => $record->rm_reason_icd1,
+			'description' => $record->rm_reason_icd1description
+		],
+		'icd_2' => [
+			'title' => 'ICD 2',
+			'reason' => $record->rm_reason_icd2,
+			'description' => $record->rm_reason_icd2description
+		],
+		'icd_3' => [
+			'title' => 'ICD 3',
+			'reason' => $record->rm_reason_icd3,
+			'description' => $record->rm_reason_icd3description
+		],
+		'icd_4' => [
+			'title' => 'ICD 4',
+			'reason' => $record->rm_reason_icd4,
+			'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;
+	}
+?>
 <table class="table table-sm table-striped table-bordered mb-0">
 	<tbody>
+		@foreach($displayData as $rmKey=>$rmData)
 		<tr>
-			<td class="text-nowrap">ICD 1</td>
+			<td class="text-nowrap">{{ $rmData['title'] }}</td>
 			<td>
 				<div class="d-flex">
-					<span class="font-weight-bold text-sm mr-2" style="min-width: 60px;">{{ $patient->rm_reason_icd1 ? $patient->rm_reason_icd1. ':':'' }}</span>
-					<small class="text-muted text-sm">{{ $patient->rm_reason_icd1description }}</small>
-				</div>
-			</td>
-		</tr>
-		<tr>
-			<td class="text-nowrap">ICD 2</td>
-			<td>
-				<div class="d-flex">
-					<span class="font-weight-bold text-sm mr-2" style="min-width: 60px;">{{ $patient->rm_reason_icd2 ? $patient->rm_reason_icd2 . ':':'' }}</span>
-					<small class="text-muted text-sm">{{ $patient->rm_reason_icd2description }}</small>
-				</div>
-			</td>
-		</tr>
-		<tr>
-			<td class="text-nowrap">ICD 3</td>
-			<td>
-				<div class="d-flex">
-					<span class="font-weight-bold text-sm mr-2" style="min-width: 60px;">{{ $patient->rm_reason_icd3 ? $patient->rm_reason_icd3 . ':':'' }}</span>
-					<small class="text-muted text-sm">{{ $patient->rm_reason_icd3description }}</small>
-				</div>
-			</td>
-		</tr>
-		<tr>
-			<td class="text-nowrap">ICD 4</td>
-			<td>
-				<div class="d-flex">
-					<span class="font-weight-bold text-sm mr-2" style="min-width: 60px;">{{ $patient->rm_reason_icd4 ? $patient->rm_reason_icd4. ':' : '' }}</span>
-					<small class="text-muted text-sm">{{ $patient->rm_reason_icd4description }}</small>
+					<span class="font-weight-bold text-sm mr-2" style="min-width: 60px;">{{ $rmData['reason'] ? $rmData['reason']. ':':'' }}</span>
+					<small class="text-muted text-sm">{{ $rmData['description'] }}</small>
 				</div>
 			</td>
 		</tr>
+		@endforeach
 		<tr>
 			<td class="text-nowrap">Memo</td>
-			<td class="text-muted text-sm">{{ $patient->rm_reason_memo }}</td>
+			@if($recordType == 'NOTE')
+				<td class="text-muted text-sm">{{ $record->note_reason_memo }}</td>
+			@else
+				<td class="text-muted text-sm">{{ $record->rm_reason_memo }}</td>
+			@endif
 		</tr>
 	</tbody>
 </table>

+ 2 - 2
resources/views/app/patient/partials/rm-setup.blade.php

@@ -106,10 +106,10 @@
         </div>
         <div class="d-flex align-items-center mb-1">
             <span class="mr-2">RM Reasons:</span>
-            @include('app.patient.partials.put-rm-reasons')
+            @include('app.patient.partials.put-rm-reasons', ['recordType' => 'CLIENT', 'record' => $patient])
         </div>
         <div class="pl-3" style="max-width: 570px;">
-            @include('app.patient.partials.rm-reasons-display')
+            @include('app.patient.partials.rm-reasons-display', ['recordType' => 'CLIENT', 'record' => $patient])
         </div>
         {{--<div class="d-flex align-items-baseline mb-3">
             <span class="width-200px">RM Reasons:</span>