Browse Source

Add-form logic - apply to edit form

Vijayakrishnan 3 years ago
parent
commit
58c2bf6ba0
1 changed files with 8 additions and 6 deletions
  1. 8 6
      resources/views/app/patient/medications-center.blade.php

+ 8 - 6
resources/views/app/patient/medications-center.blade.php

@@ -424,16 +424,16 @@ $medications = $points;
                     if(this.value === 'HISTORIC') {
                         form.find('[name="additionReasonCategory"]').val('ON_INTAKE');
                         form.find('[name="isRemoved"]').val('1');
-                        form.find('.start_date_ui').show().find('input').val('');
-                        form.find('.prescriber_ui').show().find('input').val('');
-                        form.find('.removalEffectiveDate_ui').show().find('input').val('');
-                        form.find('.removalReasonMemo_ui').show().find('input').val('');
+                        form.find('.start_date_ui').show();
+                        form.find('.prescriber_ui').show();
+                        form.find('.removalEffectiveDate_ui').show();
+                        form.find('.removalReasonMemo_ui').show();
                     }
                     else if(this.value === 'PRE_EXISTING') {
                         form.find('[name="additionReasonCategory"]').val('ON_INTAKE');
                         form.find('[name="isRemoved"]').val('0');
-                        form.find('.start_date_ui').show().find('input').val('');
-                        form.find('.prescriber_ui').show().find('input').val('');
+                        form.find('.start_date_ui').show();
+                        form.find('.prescriber_ui').show();
                     }
                     else if(this.value === 'NEW') {
                         form.find('[name="additionReasonCategory"]').val('DURING_VISIT');
@@ -553,6 +553,8 @@ $medications = $points;
                 });
 
             initStagSuggest();
+
+            $('.additionReasonCategory_ui').trigger('change');
         }
         addMCInitializer('medications-center-{{$note->id}}', init, '#medications-center-{{$note->id}}')
     }).call(window);