Peter Muturi 1 年之前
父节点
当前提交
933d944955
共有 1 个文件被更改,包括 8 次插入7 次删除
  1. 8 7
      resources/views/app/patient/partials/rm-reasons-display.blade.php

+ 8 - 7
resources/views/app/patient/partials/rm-reasons-display.blade.php

@@ -66,7 +66,7 @@ if($recordType === 'NOTE'){
 	@if($recordType == 'NOTE')
 	<div id="suggestedICDComponent">
 		<em v-if="unclaimedICDs.length > 0">Suggestions relevant to this note:</em>
-		<em v-else>Missing suggestions listed in Assessment? please refresh <a href="#" class="ml-1 text-primary small" onclick="return fastReload()"><i class="fa fa-sync on-hover-opaque"></i></a></em>
+		<em v-else>Missing suggestions listed in Assessment? <a href="#" class="ml-1 text-primary small" onclick="return fastReload()"><i class="fa fa-sync on-hover-opaque"></i></a></em>
 		<div class="mb-2">
 			<a href="javascript:;" @click.prevent="addICD(icd, $event)" v-for="icd in unclaimedICDs" class="badge badge-success p-1 text-left text-sm text-white d-inline-flex justify-content-between mr-2">@{{icd.reason}} (@{{icd.description}}) <i class="ml-3 fas fa-plus-square"></i></a>
 		</div>
@@ -117,6 +117,7 @@ if($recordType === 'NOTE'){
 	@endif
 </div>
 <script type="text/javascript">
+	var currentOrder = []; // to update the edit moe form order.
 	$( function() {
 		$( "#sortIcds{{@$recordType}}" ).sortable({
 			stop: function(event, ui) {
@@ -138,7 +139,7 @@ if($recordType === 'NOTE'){
 					reasonIcd4: newOrder['icd_4'] ? newOrder['icd_4'].reason : '',
 					reasonIcd4Description: newOrder['icd_4'] ? newOrder['icd_4'].description : ''
 				};
-
+				currentOrder = data; // to update the moe form order.
 				$.post("{{$submitUrl}}", data, function(results){
 					if (!results.success) {
 						toastr.error(results.message || 'Failed to rearrange');
@@ -155,7 +156,7 @@ if($recordType === 'NOTE'){
 		el: '#suggestedICDComponent',
 		delimiters: ["@{{","}}"],
 		data: {
-			record: <?= json_encode($displayData) ?>,
+			params: <?= json_encode($displayData) ?>,
 			problems: <?= json_encode($problems) ?>,
 			unclaimedICDs: [],
 			adding: false,
@@ -169,13 +170,13 @@ if($recordType === 'NOTE'){
 				var obj = {};
 				self.adding = true;
 				for (var x = 1; x <= 4; x++) { // loop through all reasons initiated at the top
-					if (!self.record['icd_'+x].reason) { // check if already added
+					if (!self.params['icd_'+x].reason) { // check if already added
 						obj['reasonIcd'+x] = _icd.reason;
 						obj['reasonIcd'+x+'Description'] = _icd.description;
 						break; // stop loop;
 					}else {
-						obj['reasonIcd'+x] = self.record['icd_'+x].reason;
-						obj['reasonIcd'+x+'Description'] = self.record['icd_'+x].description;
+						obj['reasonIcd'+x] = self.params['icd_'+x].reason;
+						obj['reasonIcd'+x+'Description'] = self.params['icd_'+x].description;
 					}
 				}
 				var data = {
@@ -210,7 +211,7 @@ if($recordType === 'NOTE'){
 					var reasonExists = false;
 
 					for (var x = 1; x <= 4; x++) { // loop through all reasons initiated at the top
-						if (this.record['icd_'+x].reason == reason) { // check if already added
+						if (this.params['icd_'+x].reason == reason) { // check if already added
 						 	reasonExists = true;
 						}
 					}