|
@@ -85,7 +85,7 @@ foreach ($days as $k => $day) {
|
|
|
@else
|
|
|
<div moe relative>
|
|
|
<a href="#" start show>Stamp</a>
|
|
|
- <form url="/api/measurement/stampAsMcp" right class="width-300px">
|
|
|
+ <form url="/api/measurement/stamp" right class="width-300px">
|
|
|
<input type="hidden" name="uid" value="{{$m->measurement_uid}}">
|
|
|
<p class="mb-1">Stamp this measurement?</p>
|
|
|
<div class="mt-2 bg-light border p-2">
|
|
@@ -105,7 +105,7 @@ foreach ($days as $k => $day) {
|
|
|
{{ $m->date }} {{ $m->time }} EST
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="mb-2 border border-info p-2 mt-2 bg-light">
|
|
|
+ <!--<div class="mb-2 border border-info p-2 mt-2 bg-light">
|
|
|
<span>I have had interactive communication with <b>{{$patient->displayName()}}</b> during this care month.</span>
|
|
|
<div class="d-flex border-top mt-2">
|
|
|
<label class="mt-2 mb-0 d-inline-flex align-items-center mr-3">
|
|
@@ -117,7 +117,7 @@ foreach ($days as $k => $day) {
|
|
|
<span>No</span>
|
|
|
</label>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div>-->
|
|
|
<div class="mb-2">
|
|
|
<label class="mb-1 text-secondary text-sm">Memo</label>
|
|
|
<textarea class="form-control form-control-sm" name="memo"></textarea>
|
|
@@ -142,7 +142,7 @@ foreach ($days as $k => $day) {
|
|
|
@endif
|
|
|
</td>
|
|
|
@if($mIndex === 0)
|
|
|
- <td rowspan="{{count($days[$k])}}">
|
|
|
+ <td rowspan="{{count($days[$k])}}" class="px-2">
|
|
|
@if($performerRole === 'ADMIN')
|
|
|
<div class="my-1">
|
|
|
<span class="text-secondary">MCP Unstamped:</span>
|
|
@@ -156,12 +156,13 @@ foreach ($days as $k => $day) {
|
|
|
@if(count($unstampedMCP[$k]))
|
|
|
<div moe relative class="btn-stamp-all">
|
|
|
<a href="#" start show class="">
|
|
|
- Stamp All & Create Entry
|
|
|
+ Stamp All
|
|
|
</a>
|
|
|
- <form url="/api/measurement/bulkStampAsMcp">
|
|
|
- <input type="hidden" name="measurementUids" value="{{implode('|', $unstampedMCP[$k])}}">
|
|
|
- <p class="mb-1">Stamp all measurements?</p>
|
|
|
- <div class="mb-2 border border-info p-2 mt-2 bg-light width-300px">
|
|
|
+ <form url="/api/measurement/bulkStamp" class="width-300px">
|
|
|
+ <input type="hidden" name="clientUid" value="{{$patient->uid}}">
|
|
|
+ <input type="hidden" class="measurements-uids" value="{{implode('|', $unstampedMCP[$k])}}">
|
|
|
+ <p class="mb-2 font-weight-bold">Stamp all measurements?</p>
|
|
|
+ <!--<div class="mb-2 border border-info p-2 mt-2 bg-light width-300px">
|
|
|
<span>I have had interactive communication with <b>{{$patient->displayName()}}</b> during this care month.</span>
|
|
|
<div class="d-flex border-top mt-2">
|
|
|
<label class="mt-2 mb-0 d-inline-flex align-items-center mr-3">
|
|
@@ -173,18 +174,43 @@ foreach ($days as $k => $day) {
|
|
|
<span>No</span>
|
|
|
</label>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="mb-2">
|
|
|
- <label class="mb-1 text-secondary text-sm">Memo</label>
|
|
|
- <textarea class="form-control form-control-sm" name="memo"></textarea>
|
|
|
- </div>
|
|
|
- <div class="mb-2">
|
|
|
- <label class="mb-1 text-secondary text-sm">Minutes</label>
|
|
|
- <input type="number" min="1" max="15" class="form-control form-control-sm w-100" name="entryMinutes"
|
|
|
- value="2" placeholder="Time (mins.)" required>
|
|
|
+ </div>-->
|
|
|
+ <?php
|
|
|
+ $dayTotalMinutes = 0;
|
|
|
+ foreach($m->entries as $entry) {
|
|
|
+ $dayTotalMinutes += round($entry->time_in_seconds / 60);
|
|
|
+ }
|
|
|
+ $autoCheckEntry = false;
|
|
|
+ $autoCheckEntry = ($dayTotalMinutes < 2 && $patient->is_enrolled_in_rm);
|
|
|
+ ?>
|
|
|
+ <div class="p-2 border border-info bg-light mb-2">
|
|
|
+ <div class="">
|
|
|
+ <label class="mb-0 d-flex align-items-center">
|
|
|
+ <input type="checkbox" class="should-add-entry mr-2 my-0" {{$autoCheckEntry ? 'checked' : ''}}>
|
|
|
+ <span>Add Time Entry</span>
|
|
|
+ </label>
|
|
|
+ </div>
|
|
|
+ <div class="mb-2">
|
|
|
+ <label class="mb-1 text-secondary text-sm">Memo</label>
|
|
|
+ <textarea class="form-control form-control-sm" name="entryMemo"></textarea>
|
|
|
+ </div>
|
|
|
+ <div class="if-adding-time-entry pt-2 d-none">
|
|
|
+ <div class="mb-2">
|
|
|
+ <label class="mb-1 text-secondary text-sm">Minutes</label>
|
|
|
+ <input type="number" min="1" max="15"
|
|
|
+ class="form-control form-control-sm w-100" name="entryMinutes"
|
|
|
+ value="2" placeholder="Time (mins.)">
|
|
|
+ </div>
|
|
|
+ <div class="mb-2">
|
|
|
+ <label class="mb-1 text-secondary text-sm">Date</label>
|
|
|
+ <input type="date" class="form-control form-control-sm w-100"
|
|
|
+ name="entryDate"
|
|
|
+ value="{{Date('Y-m-d')}}">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="form-group m-0">
|
|
|
- <button submit class="btn btn-primary btn-sm mr-2">Submit</button>
|
|
|
+ <button type="button" class="btn btn-primary btn-sm mr-2 btn-bulk-stamp">Submit</button>
|
|
|
<button cancel class="btn btn-default border btn-sm mr-2">Cancel</button>
|
|
|
</div>
|
|
|
</form>
|
|
@@ -198,18 +224,18 @@ foreach ($days as $k => $day) {
|
|
|
@elseif($performerRole === 'NON-MCP')
|
|
|
@endif
|
|
|
</td>
|
|
|
- <td rowspan="{{count($days[$k])}}">
|
|
|
+ <td rowspan="{{count($days[$k])}}" class="px-2">
|
|
|
@foreach($m->entries as $entry)
|
|
|
- <div class="my-1 d-flex align-items-start flex-nowrap">
|
|
|
+ <div class="my-1 d-flex align-items-baseline flex-nowrap">
|
|
|
<b class="mr-2">{{round($entry->time_in_seconds / 60)}}m</b>
|
|
|
<span class="text-secondary mr-2 text-nowrap text-sm">({{date('h:i a', strtotime($entry->created_at))}})</span>
|
|
|
<span class="text-secondary inline-html-container flex-grow-1">{!! $entry->content_text !!}</span>
|
|
|
</div>
|
|
|
@endforeach
|
|
|
@if($performerRole === 'MCP' || $performerRole === 'NON-HCP')
|
|
|
- <div moe large>
|
|
|
+ <div moe large relative>
|
|
|
<a start show class="py-0 mb-3 text-sm">+ Add</a>
|
|
|
- <form url="/api/careMonthEntry/createForRm">
|
|
|
+ <form url="/api/careMonthEntry/createForRm" right>
|
|
|
<input type="hidden" name="careMonthUid" value="{{ $careMonth->uid }}">
|
|
|
<div class="mb-2">
|
|
|
<div class="row">
|
|
@@ -280,6 +306,96 @@ foreach ($days as $k => $day) {
|
|
|
$('.cm-tab[tab-key="' + tab + '"]').removeClass('d-none');
|
|
|
return false;
|
|
|
});
|
|
|
+
|
|
|
+ $('.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)) {
|
|
|
+ closeStagPopup();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).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('.should-add-entry').prop('checked'),
|
|
|
+ entryDate: form.find('[name="entryDate"]').val(),
|
|
|
+ entryMemo: form.find('[name="entryMemo"]').val(),
|
|
|
+ entryNumberOfMinutes: form.find('[name="entryNumberOfMinutes"]').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)) {
|
|
|
+ closeStagPopup();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).then(() => {
|
|
|
+ hideMask();
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+
|
|
|
+ $('.should-add-entry')
|
|
|
+ .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);
|