Explorar el Código

Lab/Imaging: new data structure (wip)

Vijayakrishnan hace 3 años
padre
commit
2a48823ae0
Se han modificado 1 ficheros con 26 adiciones y 23 borrados
  1. 26 23
      resources/views/app/patient/prescriptions/list.blade.php

+ 26 - 23
resources/views/app/patient/prescriptions/list.blade.php

@@ -647,31 +647,34 @@ GROUP BY erx_category");
                         };
                         $.post('/api/erx/create', payload, _data => {
                             if(!hasResponseError(_data)) {
-                                // fastReload();
+                                if(_type === 'LAB' || _type === 'IMAGING') {
+                                    // don't reload the page; add new obj to list and open it's edit-clinical
+                                    if(!this.prescriptions) {
+                                        this.prescriptions = [];
+                                    }
+                                    this.prescriptions.unshift({
+                                        clinical_detail_json: null,
+                                        created_at_friendly: "{{friendly_date(date('Y-m-d'))}}",
+                                        created_at_friendly_short: "{{friendly_date(date('Y-m-d'))}}",
+                                        erx_category: _type,
+                                        hcpProDisplayName: "{{$pro->displayName()}}",
+                                        hcpProUid: "{{$pro->uid}}",
+                                        hcp_pro_id: {{$pro->id}},
+                                        hcp_pro_signed_at: null,
+                                        hcp_pro_signed_by_session_id: null,
+                                        note_id: {{$note->id}},
+                                        uid: _data.data,
+                                        version_number: 1,
+                                    });
+                                    this.currentPrescription = this.prescriptions[0];
 
-                                // don't reload the page; add new obj to list and open it's edit-clinical
-                                if(!this.prescriptions) {
-                                    this.prescriptions = [];
+                                    Vue.nextTick(() => {
+                                        this.editClinicalDetails(this.currentPrescription);
+                                    });
+                                }
+                                else {
+                                    fastReload();
                                 }
-                                this.prescriptions.unshift({
-                                    clinical_detail_json: null,
-                                    created_at_friendly: "{{friendly_date(date('Y-m-d'))}}",
-                                    created_at_friendly_short: "{{friendly_date(date('Y-m-d'))}}",
-                                    erx_category: "LAB",
-                                    hcpProDisplayName: "{{$pro->displayName()}}",
-                                    hcpProUid: "{{$pro->uid}}",
-                                    hcp_pro_id: {{$pro->id}},
-                                    hcp_pro_signed_at: null,
-                                    hcp_pro_signed_by_session_id: null,
-                                    note_id: {{$note->id}},
-                                    uid: _data.data,
-                                    version_number: 1,
-                                });
-                                this.currentPrescription = this.prescriptions[0];
-
-                                Vue.nextTick(() => {
-                                    this.editClinicalDetails(this.currentPrescription);
-                                });
                             }
                         }, 'json');
                         return false;