|
@@ -21,22 +21,28 @@ $displayData = [
|
|
'description' => $record->rm_reason_icd4description
|
|
'description' => $record->rm_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>
|
|
- <div class="d-flex flex-wrap">
|
|
|
|
|
|
+ <div class="d-flex">
|
|
<?php $emptyICDs = true; ?>
|
|
<?php $emptyICDs = true; ?>
|
|
- @foreach($displayData as $rmKey=>$rmData)
|
|
|
|
- <?php
|
|
|
|
- $emptyICD = true;
|
|
|
|
- if (!empty($rmData['reason']) || !empty($rmData['description'])) {
|
|
|
|
- $emptyICDs = false;
|
|
|
|
- $emptyICD = false;
|
|
|
|
- }
|
|
|
|
- ?>
|
|
|
|
- @if(!$emptyICD)
|
|
|
|
- <span class="badge badge-info px-2 mb-1 mr-2">{{$rmData['reason']}} @if(!empty($rmData['description']))({{ $rmData['description'] }})@endif</span>
|
|
|
|
- @endif
|
|
|
|
- @endforeach
|
|
|
|
|
|
+ <ul id="sort_icds" class="pl-0">
|
|
|
|
+ @foreach($displayData as $rmKey=>$rmData)
|
|
|
|
+ <?php
|
|
|
|
+ $emptyICD = true;
|
|
|
|
+ if (!empty($rmData['reason']) || !empty($rmData['description'])) {
|
|
|
|
+ $emptyICDs = false;
|
|
|
|
+ $emptyICD = false;
|
|
|
|
+ }
|
|
|
|
+ ?>
|
|
|
|
+ @if(!$emptyICD)
|
|
|
|
+ <li title="Drag and drop to rearrange the order" class="d-block badge badge-info p-2 px-3 text-left mb-1 mr-2" id="{{$rmKey}}"><i class="fas fa-ellipsis-v"></i><i class="fas fa-ellipsis-v mr-2"></i> {{$rmData['reason']}} @if(!empty($rmData['description']))({{ $rmData['description'] }})@endif</li>
|
|
|
|
+ @endif
|
|
|
|
+ @endforeach
|
|
|
|
+ </ul>
|
|
@if($emptyICDs)
|
|
@if($emptyICDs)
|
|
@if($patient->is_enrolled_in_rm)
|
|
@if($patient->is_enrolled_in_rm)
|
|
<div class="d-flex">
|
|
<div class="d-flex">
|
|
@@ -57,3 +63,35 @@ $displayData = [
|
|
</div>
|
|
</div>
|
|
@endif
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
+<script type="text/javascript">
|
|
|
|
+ var initialOrder = <?= json_encode($displayData) ?>;
|
|
|
|
+
|
|
|
|
+ $( function() {
|
|
|
|
+ $( "#sort_icds" ).sortable({
|
|
|
|
+ stop: function(event, ui) {
|
|
|
|
+ var els = $('.badge-info.ui-sortable-handle');
|
|
|
|
+ var newOrder = {};
|
|
|
|
+ for (var i = 0; i < els.length; i++) {
|
|
|
|
+ var icd_num = els[i].id;
|
|
|
|
+ newOrder["icd_"+ (1+i)] = initialOrder[icd_num]
|
|
|
|
+ }
|
|
|
|
+ var data = {
|
|
|
|
+ uid: "{{$record->uid}}",
|
|
|
|
+ reasonIcd1: newOrder['icd_1'].reason,
|
|
|
|
+ reasonIcd1Description: newOrder['icd_1'].description,
|
|
|
|
+ reasonIcd2: newOrder['icd_2'].reason,
|
|
|
|
+ reasonIcd2Description: newOrder['icd_2'].description,
|
|
|
|
+ reasonIcd3: newOrder['icd_3'].reason,
|
|
|
|
+ reasonIcd3Description: newOrder['icd_3'].description,
|
|
|
|
+ reasonIcd4: newOrder['icd_4'].reason,
|
|
|
|
+ reasonIcd4Description: newOrder['icd_4'].description
|
|
|
|
+ };
|
|
|
|
+ $.post("{{$submitUrl}}", data, function(results){
|
|
|
|
+ if (results.success) {
|
|
|
|
+ fastReload();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+</script>
|