|
@@ -189,11 +189,15 @@ parentSegment.find('[name="removalReasonCategory"]')
|
|
|
}
|
|
|
if(form.find('[name="removalReasonCategory"]:checked').val() === 'ON_INTAKE') {
|
|
|
form.find('[if-removal-on-intake]').removeClass('d-none');
|
|
|
+ __reset(form.find('[data-name="start_date"]'));
|
|
|
+ __reset(form.find('[data-name="prescriber"]'));
|
|
|
__reset(form.find('[name="removalEffectiveDate"]'));
|
|
|
__reset(form.find('[name="removalReasonMemo"]'));
|
|
|
}
|
|
|
else if(form.find('[name="removalReasonCategory"]:checked').val() === 'DURING_VISIT') {
|
|
|
form.find('[if-removal-during-visit]').removeClass('d-none');
|
|
|
+ __reset(form.find('[data-name="start_date"]'));
|
|
|
+ __reset(form.find('[data-name="prescriber"]'));
|
|
|
form.find('[name="removalEffectiveDate"]').val('{{$patient->core_note_id !== $note->id ? $note->effective_dateest : date("Y-m-d")}}');
|
|
|
form.find('[name="removalReasonMemo"]').val('{{$patient->core_note_id !== $note->id ? ($note->hcpPro ? $note->hcpPro->displayName() : "") : ""}}');
|
|
|
}
|
|
@@ -507,4 +511,37 @@ parentSegment.find('.tracker-input')
|
|
|
}, 'json');
|
|
|
});
|
|
|
|
|
|
+parentSegment.find('.btn-entry-type')
|
|
|
+ .off('click')
|
|
|
+ .on('click', function() {
|
|
|
+ $(this).siblings().removeClass('btn-info').addClass('btn-default bg-white');
|
|
|
+ $(this).removeClass('btn-default bg-white').addClass('btn-info');
|
|
|
+
|
|
|
+ switch ($(this).attr('data-entry-type')) {
|
|
|
+ case 'Pre-Existing':
|
|
|
+ parentSegment.find('[name="removalReasonCategory"]').prop('checked', false).trigger('change');
|
|
|
+ parentSegment.find('[name="isRemoved"][value="0"]').prop('checked', true).trigger('change');
|
|
|
+ parentSegment.find('[name="additionReasonCategory"][value="ON_INTAKE"]').prop('checked', true).trigger('change');
|
|
|
+ break;
|
|
|
+ case 'Added during this visit':
|
|
|
+ parentSegment.find('[name="removalReasonCategory"]').prop('checked', false).trigger('change');
|
|
|
+ parentSegment.find('[name="isRemoved"][value="0"]').prop('checked', true).trigger('change');
|
|
|
+ parentSegment.find('[name="additionReasonCategory"][value="DURING_VISIT"]').prop('checked', true).trigger('change');
|
|
|
+ break;
|
|
|
+ case 'Historic':
|
|
|
+ parentSegment.find('[name="additionReasonCategory"]').prop('checked', false).trigger('change');
|
|
|
+ parentSegment.find('[name="isRemoved"][value="1"]').prop('checked', true).trigger('change');
|
|
|
+ parentSegment.find('[name="removalReasonCategory"][value="ON_INTAKE"]').prop('checked', true).trigger('change');
|
|
|
+ break;
|
|
|
+ case 'Removed during this visit':
|
|
|
+ parentSegment.find('[name="additionReasonCategory"]').prop('checked', false).trigger('change');
|
|
|
+ parentSegment.find('[name="isRemoved"][value="1"]').prop('checked', true).trigger('change');
|
|
|
+ parentSegment.find('[name="removalReasonCategory"][value="DURING_VISIT"]').prop('checked', true).trigger('change');
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+parentSegment.find('.btn-entry-type[data-entry-type="Pre-Existing"]').trigger('click');
|
|
|
+
|
|
|
initStagSuggest();
|