Explorar o código

Rx wizard - direct access - no need for child-plan

Vijayakrishnan %!s(int64=3) %!d(string=hai) anos
pai
achega
38f7a0ee68
Modificáronse 1 ficheiros con 11 adicións e 1 borrados
  1. 11 1
      resources/views/app/patient/medications-center.blade.php

+ 11 - 1
resources/views/app/patient/medications-center.blade.php

@@ -362,12 +362,14 @@ $medications = $points;
                                 <textarea rows="1" data-name="description" class="form-control form-control-sm"></textarea>
                             </div>-->
 
+                            @if($patient->core_note_id !== $note->id)
                             <div class="mb-2">
                                 <label class="text-sm mb-1">Directions</label>
                                 <div note-rte
                                      class="form-group mb-2 border-left border-right rte-holder bg-white"
                                      data-field-name="value"></div>
                             </div>
+                            @endif
 
                             <hr class="my-3">
 
@@ -582,6 +584,7 @@ $medications = $points;
                         parsed = JSON.parse(dataField.val());
                     }
 
+                    @if($patient->core_note_id !== $note->id)
                     // store plan content
                     let planContent = parsed.value ? parsed.value : '';
                     if(!$.trim($('<div/>').html(planContent).text())) {
@@ -589,6 +592,7 @@ $medications = $points;
                         return false;
                     }
                     if(parsed.value) delete parsed.value;
+                    @endif
 
                     form.find('[data-name]').each(function() {
                         if(!parsed) parsed = {};
@@ -620,17 +624,23 @@ $medications = $points;
                     $.post(form.attr('action'), form.serialize(), _data => {
                         if(!hasResponseError(_data)) {
 
+                            hideMask();
+
                             // save child plan
+                            @if($patient->core_note_id !== $note->id)
+                                debugger
                             $.post('/api/visitPoint/upsertChildPlan', {
                                 uid: _data.data,
                                 segmentUid: '{{$note->getSegmentByInternalName('plan_medications')->uid}}',
                                 data: JSON.stringify({value: planContent})
                             }, _data => {
                                 if(!hasResponseError(_data)) {
-                                    hideMask();
                                     refreshDynamicStagPopup();
                                 }
                             }, 'json');
+                            @else
+                            refreshDynamicStagPopup();
+                            @endif
 
                             $('.visit-segment[data-segment-template-name="intake_medications"]').find('.refresh-segment').trigger('click');
                         }