Browse Source

Erx UI - Go to newly added pres automatically

Vijayakrishnan 3 years ago
parent
commit
72aeedaa36
1 changed files with 5 additions and 5 deletions
  1. 5 5
      resources/views/app/patient/prescriptions/index.blade.php

+ 5 - 5
resources/views/app/patient/prescriptions/index.blade.php

@@ -268,9 +268,9 @@
                 $prescription->hcpProDisplayName = $prescription->hcpPro ? $prescription->hcpPro->displayName() : '-';
                 $prescription->hcpProDisplayName = $prescription->hcpPro ? $prescription->hcpPro->displayName() : '-';
                 $prescription->hcpProUid = $prescription->hcpPro ? $prescription->hcpPro->uid : '';
                 $prescription->hcpProUid = $prescription->hcpPro ? $prescription->hcpPro->uid : '';
 
 
-//                if(!!@$currentErx && $currentErx->uid === $prescription->uid) {
-//
-//                }
+                if(!!@$currentErx && $currentErx->uid === $prescription->uid) {
+                    $currentPrescription = $prescription;
+                }
             }
             }
             ?>
             ?>
 
 
@@ -286,7 +286,7 @@
                         currentPrescriptionType: '',
                         currentPrescriptionType: '',
 
 
                         // selected
                         // selected
-                        currentPrescription:  null,
+                        currentPrescription:  <?= $currentPrescription ?>,
 
 
                         // for editing clinical details
                         // for editing clinical details
                         currentPrescription_DRUG: {
                         currentPrescription_DRUG: {
@@ -517,7 +517,7 @@
                                         if(!hasResponseError(_data)) {
                                         if(!hasResponseError(_data)) {
                                             toastr.success('Prescription added');
                                             toastr.success('Prescription added');
                                             closeStagPopup();
                                             closeStagPopup();
-                                            fastReload();
+                                            fastLoad('/patients/view/{{$patient->uid}}/prescriptions/' + this.currentPrescriptionType.toLowerCase() + '/' + _data.data);
                                         }
                                         }
                                     }, 'json');
                                     }, 'json');
                                     break;
                                     break;