|
@@ -0,0 +1,393 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+$days = $patient->cmMeasurementsMatrix($careMonth, ($pro->pro_type === 'ADMIN' ? null : $pro));
|
|
|
+
|
|
|
+$performerRole = false;
|
|
|
+if ($pro->pro_type === 'ADMIN') {
|
|
|
+ $performerRole = 'ADMIN';
|
|
|
+} else if ($careMonth->mcp_pro_id === $pro->id) {
|
|
|
+ $performerRole = 'MCP';
|
|
|
+} else if ($careMonth->rme_pro_id === $pro->id || $careMonth->rmm_pro_id === $pro->id) {
|
|
|
+ $performerRole = 'NON-HCP';
|
|
|
+}
|
|
|
+
|
|
|
+$unstampedMCP = [];
|
|
|
+$unstampedNonHCP = [];
|
|
|
+foreach ($days as $k => $day) {
|
|
|
+ $unstampedMCP[$k] = [];
|
|
|
+ $unstampedNonHCP[$k] = [];
|
|
|
+ foreach ($days[$k] as $mIndex => $m) {
|
|
|
+ if(!$m->has_been_stamped_by_mcp) {
|
|
|
+ $unstampedMCP[$k][] = $m->measurement_uid;
|
|
|
+ }
|
|
|
+ if(!$m->has_been_stamped_by_non_hcp) {
|
|
|
+ $unstampedNonHCP[$k][] = $m->measurement_uid;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+?>
|
|
|
+
|
|
|
+<div id="cm-matrix-{{$patient->id}}">
|
|
|
+@if(!@$onlyMatrix)
|
|
|
+<div class="d-flex align-items-baseline mb-3" tab-links>
|
|
|
+ <a class="tab-link-active" href="#" tab-link="time-entries">Time Entries</a>
|
|
|
+ <a class="" href="#" tab-link="bmi-summary">BMI/Weight Management Settings</a>
|
|
|
+ <a class="" href="#" tab-link="bp-summary">BP Management Settings</a>
|
|
|
+</div>
|
|
|
+@endif
|
|
|
+<div class="my-3 border p-3 cm-tab" tab-key="time-entries">
|
|
|
+ @if($careMonth->is_client_enrolled_in_rm)
|
|
|
+ <div class="d-flex align-items-center">
|
|
|
+ <h6 class="my-0 text-secondary font-weight-bold text-dark lh-24px">Time Entries</h6>
|
|
|
+ @if(!$activeRMBill)
|
|
|
+ <span class="mx-2 text-secondary">|</span>
|
|
|
+ <div moe large>
|
|
|
+ <a start show class="py-0 mb-3">Add</a>
|
|
|
+ <form url="/api/careMonthEntry/createForRm">
|
|
|
+ <input type="hidden" name="careMonthUid" value="{{ $careMonth->uid }}">
|
|
|
+ <div class="mb-2">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-4 pr-0">
|
|
|
+ <select class="form-control form-control-sm w-100" name="proUid" provider-search data-pro-uid="{{ @$pro->uid }}"
|
|
|
+ required>
|
|
|
+ <option value="">-- Select Pro --</option>
|
|
|
+ @foreach($pros as $iPro)
|
|
|
+ <option {{ $iPro->uid === $pro->uid ? 'selected' : '' }}
|
|
|
+ value="{{ $iPro->uid }}">{{ $iPro->displayName() }}</option>
|
|
|
+ @endforeach
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div class="col-4 pr-0">
|
|
|
+ <?php
|
|
|
+ $sD = strtotime($careMonth->start_date);
|
|
|
+ $y = date('Y', $sD);
|
|
|
+ $m = date('m', $sD);
|
|
|
+ $d = date('t', $sD);
|
|
|
+ $yCurrent = date('Y');
|
|
|
+ $mCurrent = date('m');
|
|
|
+ $isToday = false;
|
|
|
+ if($y === $yCurrent && $m === $mCurrent) {
|
|
|
+ $d = date('d');
|
|
|
+ $isToday = true;
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ <input autofocus type="date" min="{{ date($y . '-' . $m . '-01') }}" max="{{ date($y . '-' . $m . '-' . $d) }}"
|
|
|
+ value="{{date('Y-m-d')}}"
|
|
|
+ class="form-control form-control-sm w-100" name="effectiveDate"
|
|
|
+ placeholder="Effective Date" required>
|
|
|
+ </div>
|
|
|
+ <div class="col-4">
|
|
|
+ <select name="timeInSeconds" class="form-control form-control-sm w-100 cm-time-value" required>
|
|
|
+ <option value="">-- Minutes --</option>
|
|
|
+ <option value="60">1 minute</option>
|
|
|
+ <option value="300">5 minutes</option>
|
|
|
+ <option value="600">10 minutes</option>
|
|
|
+ <option value="1200">20 minutes</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="mb-2 border border-info p-2 mt-2 bg-light">
|
|
|
+ <span><i class="fa fa-phone rotateh text-dark mr-1"></i>This time entry involved interactive communication (audio, video, or in-person) with the patient and/or caretaker.</span>
|
|
|
+ <div class="d-flex border-top mt-2">
|
|
|
+ <label class="mt-2 mb-0 d-inline-flex align-items-center mr-3">
|
|
|
+ <input type="radio" class="mr-2" name="didProInteractWithClientAboutRm" value="true" required>
|
|
|
+ <span>Yes</span>
|
|
|
+ </label>
|
|
|
+ <label class="mt-2 mb-0 d-inline-flex align-items-center">
|
|
|
+ <input type="radio" class="mr-2" name="didProInteractWithClientAboutRm" value="false" required>
|
|
|
+ <span>No</span>
|
|
|
+ </label>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="mb-2">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-12">
|
|
|
+ <div cm-rte data-content="Reviewed/managed patient measurements" data-name="contentText"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="d-flex align-items-center">
|
|
|
+ <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
|
|
|
+ <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ @else
|
|
|
+ <span class="mx-2 text-secondary">|</span>
|
|
|
+ <span class="text-secondary">Can't modify since a bill exists</span>
|
|
|
+ @endif
|
|
|
+ </div>
|
|
|
+ <table class="table table-striped table-sm table-bordered mt-2 mb-0 table-hover">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th class="px-2 text-secondary border-bottom-0">Effective Date</th>
|
|
|
+ <th class="px-2 text-secondary border-bottom-0">Time</th>
|
|
|
+ <th class="px-2 text-secondary border-bottom-0">Created</th>
|
|
|
+ <th class="px-2 text-secondary border-bottom-0">Communicated</th>
|
|
|
+ <th class="px-2 text-secondary border-bottom-0 w-50">Comments</th>
|
|
|
+ <th class="px-2 text-secondary border-bottom-0 delete-column"> </th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ @foreach($careMonth->entries as $entry)
|
|
|
+ @if(!$entry->is_removed && $entry->cm_or_rm === "RM")
|
|
|
+ <tr>
|
|
|
+ <td class="px-2">
|
|
|
+ <div class="font-weight-bold">{{friendly_date_time($entry->effective_date, false)}}</div>
|
|
|
+ </td>
|
|
|
+ <td class="px-2">
|
|
|
+ {{time_in_hrminsec($entry->time_in_seconds)}}
|
|
|
+ </td>
|
|
|
+ <td class="px-2">
|
|
|
+ {{friendly_date_time($entry->created_at)}}
|
|
|
+ </td>
|
|
|
+ <td class="px-2">
|
|
|
+ {{$entry->did_pro_interact_with_client_about_rm ? 'Yes' : 'No'}}
|
|
|
+ </td>
|
|
|
+ <td class="px-2">
|
|
|
+ <div class="text-secondary in-table-markup">{!! $entry->content_text !!}</div>
|
|
|
+ <!-- <div class="text-secondary text-sm">{{$entry->content_detail}}</div>-->
|
|
|
+ </td>
|
|
|
+ <td class="px-2 text-right">
|
|
|
+ @if(!$activeRMBill)
|
|
|
+ <div moe large class="mr-2">
|
|
|
+ <a start show class="py-0 mb-3">Edit</a>
|
|
|
+ <form url="/api/careMonthEntry/updateSimpleForRm" right>
|
|
|
+ <input type="hidden" name="uid" value="{{ $entry->uid }}">
|
|
|
+ <div class="mb-2">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-4 pr-0">
|
|
|
+ <select class="form-control form-control-sm w-100" name="proUid" provider-search data-pro-uid="{{ @$entry->pro->uid }}"
|
|
|
+ required>
|
|
|
+ <option value="">-- Select Pro --</option>
|
|
|
+ @foreach($pros as $iPro)
|
|
|
+ <option {{ $iPro->uid === $pro->uid ? 'selected' : '' }}
|
|
|
+ value="{{ $iPro->uid }}">{{ $iPro->displayName() }}</option>
|
|
|
+ @endforeach
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div class="col-4 pr-0">
|
|
|
+ <?php
|
|
|
+ $sD = strtotime($careMonth->start_date);
|
|
|
+ $y = date('Y', $sD);
|
|
|
+ $m = date('m', $sD);
|
|
|
+ $d = date('t', $sD);
|
|
|
+ $yCurrent = date('Y');
|
|
|
+ $mCurrent = date('m');
|
|
|
+ $isToday = false;
|
|
|
+ if($y === $yCurrent && $m === $mCurrent) {
|
|
|
+ $d = date('d');
|
|
|
+ $isToday = true;
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ <input autofocus type="date" min="{{ date($y . '-' . $m . '-01') }}" max="{{ date($y . '-' . $m . '-' . $d) }}"
|
|
|
+ value="{{$entry->effective_date}}"
|
|
|
+ class="form-control form-control-sm w-100" name="effectiveDate"
|
|
|
+ placeholder="Effective Date" required>
|
|
|
+ </div>
|
|
|
+ <div class="col-4">
|
|
|
+ <select name="timeInSeconds" class="form-control form-control-sm w-100 cm-time-value" required>
|
|
|
+ <option value="">-- Minutes --</option>
|
|
|
+ <option value="60" {{$entry->time_in_seconds === 60 ? 'selected' : ''}}>1:00</option>
|
|
|
+ <option value="75" {{$entry->time_in_seconds === 75 ? 'selected' : ''}}>1:15</option>
|
|
|
+ <option value="300" {{$entry->time_in_seconds === 300 ? 'selected' : ''}}>5:00</option>
|
|
|
+ <option value="600" {{$entry->time_in_seconds === 600 ? 'selected' : ''}}>10:00</option>
|
|
|
+ <option value="1200" {{$entry->time_in_seconds === 1200 ? 'selected' : ''}}>20:00</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="mb-2 border border-info p-2 mt-2 bg-light text-left">
|
|
|
+ <span><i class="fa fa-phone rotateh text-dark mr-1"></i>This time entry involved interactive communication (audio, video, or in-person) with the patient and/or caretaker.</span>
|
|
|
+ <div class="d-flex border-top mt-2">
|
|
|
+ <label class="mt-2 mb-0 d-inline-flex align-items-center mr-3">
|
|
|
+ <input type="radio" class="mr-2" name="didProInteractWithClientAboutRm" value="true" {{$entry->did_pro_interact_with_client_about_rm ? 'checked' : ''}} required>
|
|
|
+ <span>Yes</span>
|
|
|
+ </label>
|
|
|
+ <label class="mt-2 mb-0 d-inline-flex align-items-center">
|
|
|
+ <input type="radio" class="mr-2" name="didProInteractWithClientAboutRm" value="false" {{$entry->did_pro_interact_with_client_about_rm ? '' : 'checked' }} required>
|
|
|
+ <span>No</span>
|
|
|
+ </label>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="mb-2">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-12">
|
|
|
+ <div cm-rte data-content="Reviewed/managed patient measurements" data-name="contentText"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="d-flex align-items-center">
|
|
|
+ <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
|
|
|
+ <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ <div moe relative>
|
|
|
+ <a start show class="text-danger">Delete</a>
|
|
|
+ <form url="/api/careMonthEntry/remove" right class="text-left">
|
|
|
+ <input type="hidden" name="uid" value="{{ $entry->uid }}">
|
|
|
+ <p class="small">Are you sure you want to delete this RM entry?</p>
|
|
|
+ <div class="d-flex align-items-center">
|
|
|
+ <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
|
|
|
+ <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ @else
|
|
|
+ <span class="text-sm text-secondary">Can't modify since a bill exists</span>
|
|
|
+ @endif
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ @endif
|
|
|
+ @endforeach
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ @else
|
|
|
+ <h6 class="mb-2 text-secondary font-weight-bold text-dark lh-24px">Time Entries</h6>
|
|
|
+ <div class="alert alert-secondary mt-2 mb-0">
|
|
|
+ <b>{{ $patient->displayName() }}</b> is currently not enrolled in <b>RM</b>.
|
|
|
+ <span moe class="">
|
|
|
+ <a start show class="font-weight-bold">Enroll Now</a>
|
|
|
+ <form url="/api/careMonth/setIsClientEnrolledInRmToTrue">
|
|
|
+ <input type="hidden" name="uid" value="{{ $careMonth->uid }}">
|
|
|
+ <p class="small">Enroll this client in RM?</p>
|
|
|
+ <div class="d-flex align-items-center">
|
|
|
+ <button class="btn btn-sm btn-primary mr-2" submit>Yes</button>
|
|
|
+ <button class="btn btn-sm btn-default mr-2 border" cancel>No</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ @endif
|
|
|
+</div>
|
|
|
+<div class="my-3 border p-3 d-none cm-tab" tab-key="bmi-summary">
|
|
|
+ <div class="d-flex align-items-baseline mb-2">
|
|
|
+ <b>BMI/Weight Management</b>
|
|
|
+ <span class="mx-2 text-secondary">|</span>
|
|
|
+ @include('app.patient.vitals-settings.bmi-management-form')
|
|
|
+ </div>
|
|
|
+ @include('app.patient.vitals-settings.bmi-management-summary')
|
|
|
+</div>
|
|
|
+<div class="my-3 border p-3 d-none cm-tab" tab-key="bp-summary">
|
|
|
+ <div class="d-flex align-items-baseline mb-2">
|
|
|
+ <b>BP Management</b>
|
|
|
+ <span class="mx-2 text-secondary">|</span>
|
|
|
+ @include('app.patient.vitals-settings.bp-management-form')
|
|
|
+ </div>
|
|
|
+ @include('app.patient.vitals-settings.bp-management-summary')
|
|
|
+</div>
|
|
|
+</div>
|
|
|
+<script>
|
|
|
+ (function() {
|
|
|
+ function init() {
|
|
|
+
|
|
|
+ $('.btn-stamp')
|
|
|
+ .off('click')
|
|
|
+ .on('click', function () {
|
|
|
+ let form = $(this).closest('form');
|
|
|
+ if(!form[0].checkValidity()) {
|
|
|
+ form[0].reportValidity();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ showMask();
|
|
|
+
|
|
|
+ let payload = {
|
|
|
+ uid: form.find('[name="uid"]').val(),
|
|
|
+ memo: form.find('[name="memo"]').val(),
|
|
|
+ }
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ url: form.attr('url'),
|
|
|
+ type:"POST",
|
|
|
+ data: JSON.stringify(payload),
|
|
|
+ contentType:"application/json; charset=utf-8",
|
|
|
+ dataType:"json",
|
|
|
+ success: function(_data) {
|
|
|
+ if(!hasResponseError(_data)) {
|
|
|
+ if(form.closest('.stag-popup').length) {
|
|
|
+ refreshDynamicStagPopup();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ fastReload();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).then(() => {
|
|
|
+ hideMask();
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+
|
|
|
+ $('.btn-bulk-stamp')
|
|
|
+ .off('click')
|
|
|
+ .on('click', function () {
|
|
|
+ let form = $(this).closest('form');
|
|
|
+ if(!form[0].checkValidity()) {
|
|
|
+ form[0].reportValidity();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ showMask();
|
|
|
+
|
|
|
+ let payload = {
|
|
|
+ clientUid: '{{$patient->uid}}',
|
|
|
+ toStamp: form.find('.measurements-uids').val().split('|').map(_x => {
|
|
|
+ return {
|
|
|
+ measurementUid: _x,
|
|
|
+ memo: null,
|
|
|
+ detailJson: null
|
|
|
+ }
|
|
|
+ }),
|
|
|
+ shouldAddEntry: form.find('.shouldAddEntry').prop('checked') ? 1 : 0,
|
|
|
+ entryDate: form.find('[name="entryDate"]').val(),
|
|
|
+ entryMemo: form.find('[name="entryMemo"]').val(),
|
|
|
+ entryNumberOfSeconds: form.find('[name="entryNumberOfSeconds"]').val() ? +(form.find('[name="entryNumberOfSeconds"]').val()) : 0
|
|
|
+ }
|
|
|
+
|
|
|
+ if(form.find('[name="didProInteractWithClientAboutRm"]:checked').length) {
|
|
|
+ payload.didProInteractWithClientAboutRm = (form.find('[name="didProInteractWithClientAboutRm"]:checked').val() === 'true');
|
|
|
+ }
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ url: form.attr('url'),
|
|
|
+ type:"POST",
|
|
|
+ data: JSON.stringify(payload),
|
|
|
+ contentType:"application/json; charset=utf-8",
|
|
|
+ dataType:"json",
|
|
|
+ success: function(_data) {
|
|
|
+ if(!hasResponseError(_data)) {
|
|
|
+ if(form.closest('.stag-popup').length) {
|
|
|
+ refreshDynamicStagPopup();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ fastReload();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).then(() => {
|
|
|
+ hideMask();
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+
|
|
|
+ $('.shouldAddEntry')
|
|
|
+ .off('change')
|
|
|
+ .on('change', function () {
|
|
|
+ let form = $(this).closest('form');
|
|
|
+ if(this.checked) {
|
|
|
+ form.find('.if-adding-time-entry').removeClass('d-none');
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ form.find('.if-adding-time-entry').addClass('d-none');
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ })
|
|
|
+ .trigger('change');
|
|
|
+ }
|
|
|
+ addMCInitializer('cm-matrix-{{$patient->id}}', init, '#cm-matrix-{{$patient->id}}');
|
|
|
+ }).call(window);
|
|
|
+</script>
|