|
@@ -10,9 +10,12 @@ $apptsPending = [
|
|
|
|
|
|
<div class="card mb-4">
|
|
<div class="card mb-4">
|
|
<div class="card-header pl-2">
|
|
<div class="card-header pl-2">
|
|
- <strong>
|
|
|
|
- Appointment Status Changes
|
|
|
|
- </strong>
|
|
|
|
|
|
+ <div class="d-flex justify-content-between">
|
|
|
|
+ <strong>
|
|
|
|
+ Appointment Status Changes
|
|
|
|
+ </strong>
|
|
|
|
+ <button type="button" class="d-none btn btn-sm btn-primary" data-action="acknowledgeStatusAsAppointmentPro" submit-ack-appts>Ack. Selected (<span></span>)</button>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<div class="card-body p-0">
|
|
<div class="card-body p-0">
|
|
@if(!count($apptsPending['status']))
|
|
@if(!count($apptsPending['status']))
|
|
@@ -24,6 +27,7 @@ $apptsPending = [
|
|
<table class="table table-sm table-striped">
|
|
<table class="table table-sm table-striped">
|
|
<thead>
|
|
<thead>
|
|
<tr>
|
|
<tr>
|
|
|
|
+ <th><input type="checkbox" select-all-appts data-target="#apptsStatusChanges" /></th>
|
|
<th>Patient</th>
|
|
<th>Patient</th>
|
|
<th>Time</th>
|
|
<th>Time</th>
|
|
<th>Memo</th>
|
|
<th>Memo</th>
|
|
@@ -31,9 +35,10 @@ $apptsPending = [
|
|
<th></th>
|
|
<th></th>
|
|
</tr>
|
|
</tr>
|
|
</thead>
|
|
</thead>
|
|
- <tbody>
|
|
|
|
|
|
+ <tbody id="apptsStatusChanges">
|
|
@foreach($apptsPending['status'] as $appt)
|
|
@foreach($apptsPending['status'] as $appt)
|
|
<tr discardable-container>
|
|
<tr discardable-container>
|
|
|
|
+ <td><input type="checkbox" name="uids[]" value="{{ $appt->uid }}" select-appt /></td>
|
|
<td>
|
|
<td>
|
|
<a class="d-block"
|
|
<a class="d-block"
|
|
href="/patients/view/{{$appt->client->uid}}">{{$appt->client->displayName()}}</a>
|
|
href="/patients/view/{{$appt->client->uid}}">{{$appt->client->displayName()}}</a>
|
|
@@ -76,9 +81,12 @@ $apptsPending = [
|
|
|
|
|
|
<div class="card mb-4">
|
|
<div class="card mb-4">
|
|
<div class="card-header pl-2">
|
|
<div class="card-header pl-2">
|
|
- <strong>
|
|
|
|
- Appointment Confirmation Changes
|
|
|
|
- </strong>
|
|
|
|
|
|
+ <div class="d-flex justify-content-between">
|
|
|
|
+ <strong>
|
|
|
|
+ Appointment Confirmation Changes
|
|
|
|
+ </strong>
|
|
|
|
+ <button type="button" class="d-none btn btn-sm btn-primary" data-action="acknowledgeDecisionAsAppointmentPro" submit-ack-appts>Ack. Selected (<span></span>)</button>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<div class="card-body p-0">
|
|
<div class="card-body p-0">
|
|
@if(!count($apptsPending['decision']))
|
|
@if(!count($apptsPending['decision']))
|
|
@@ -90,15 +98,17 @@ $apptsPending = [
|
|
<table class="table table-sm table-striped">
|
|
<table class="table table-sm table-striped">
|
|
<thead>
|
|
<thead>
|
|
<tr>
|
|
<tr>
|
|
|
|
+ <th><input type="checkbox" select-all-appts data-target="#apptsConfirmationChanges" /></th>
|
|
<th>Patient</th>
|
|
<th>Patient</th>
|
|
<th>Time</th>
|
|
<th>Time</th>
|
|
<th>Status</th>
|
|
<th>Status</th>
|
|
<th></th>
|
|
<th></th>
|
|
</tr>
|
|
</tr>
|
|
</thead>
|
|
</thead>
|
|
- <tbody>
|
|
|
|
|
|
+ <tbody id="apptsConfirmationChanges">
|
|
@foreach($apptsPending['decision'] as $appt)
|
|
@foreach($apptsPending['decision'] as $appt)
|
|
<tr discardable-container>
|
|
<tr discardable-container>
|
|
|
|
+ <td><input type="checkbox" name="uids[]" value="{{ $appt->uid }}" select-appt /></td>
|
|
<td>
|
|
<td>
|
|
<a class="d-block"
|
|
<a class="d-block"
|
|
href="/patients/view/{{$appt->client->uid}}">{{$appt->client->displayName()}}</a>
|
|
href="/patients/view/{{$appt->client->uid}}">{{$appt->client->displayName()}}</a>
|
|
@@ -123,3 +133,69 @@ $apptsPending = [
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ (function($){
|
|
|
|
+ const BulkAckAppointments = {
|
|
|
|
+ handleOnCheck: function(container){
|
|
|
|
+ const selectedAppts = container.find('input[type=checkbox]:checked');
|
|
|
|
+ const button = $(container).closest('.card').find('.card-header').find('button');
|
|
|
|
+ if(selectedAppts.length){
|
|
|
|
+ button.find('span').text(selectedAppts.length);
|
|
|
|
+ button.removeClass('d-none');
|
|
|
|
+ }else{
|
|
|
|
+ button.addClass('d-none');
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ onCheck: function(){
|
|
|
|
+ var self = this;
|
|
|
|
+ $('[select-appt]').click(function(evt){
|
|
|
|
+ const container = $(evt.currentTarget).closest('tbody');
|
|
|
|
+ self.handleOnCheck(container);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ onCheckAll: function(){
|
|
|
|
+ var self = this;
|
|
|
|
+ $('[select-all-appts]').click(function(evt){
|
|
|
|
+ const isChecked = evt.currentTarget.checked ? true:false;
|
|
|
|
+
|
|
|
|
+ const containerTargetRef = $(evt.currentTarget).data('target');
|
|
|
|
+ const container = $(containerTargetRef);
|
|
|
|
+ container.find('input[type=checkbox]').prop('checked', isChecked);
|
|
|
|
+ self.handleOnCheck(container);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ onSubmit: function(){
|
|
|
|
+ var self = this;
|
|
|
|
+ $('[submit-ack-appts]').click(function(evt){
|
|
|
|
+ const action = $(evt.currentTarget).data('action');
|
|
|
|
+ const container = $(evt.currentTarget).closest('.card').find('tbody');
|
|
|
|
+ const checkedInputs = container.find('[select-appt]:checked');
|
|
|
|
+ console.log({checkedInputs});
|
|
|
|
+ const UIDS = [];
|
|
|
|
+ $.each(checkedInputs, function(index, input){
|
|
|
|
+ const value = input.value;
|
|
|
|
+ UIDS.push(value);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ $.post('/acknowledge-as-appointment-pro', {uids: UIDS, action: action}, function(response){
|
|
|
|
+ if(response.success){
|
|
|
|
+ toastr.success();
|
|
|
|
+ location.reload();
|
|
|
|
+ }else{
|
|
|
|
+ toastr.error(response.message);
|
|
|
|
+ location.reload();
|
|
|
|
+ }
|
|
|
|
+ }, 'json');
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ init: function(){
|
|
|
|
+ this.onCheck();
|
|
|
|
+ this.onCheckAll();
|
|
|
|
+ this.onSubmit();
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ BulkAckAppointments.init();
|
|
|
|
+ })(jQuery);
|
|
|
|
+</script>
|