<?php /* DO NOT GENERATE */ ?>
@extends('pro.clients.view')
@section('content-inner')

<?php /*
    $client = $record;
    $isMedicareNotGood = $client->medicareStatus() !== true;
    $isBlocked = $isMedicareNotGood || !$client->mcp_pro_id || $client->has_mcp_done_onboarding_visit === 'UNKNOWN';
*/ ?>

<?php /*
<section class=z><a href=SUB_detail>
<? if(!$isBlocked): ?>
    <main>

    </main>
<? else: ?>
    <main class="blocked">
        <h5>
            <span>⚠️</span>
            <? if($isMedicareNotGood): ?>
                Need a functional medicare number.
            <? elseif(!$client->mcp_pro_id): ?>
                Hasn't been assigned a MCP yet.
            <? elseif($client->has_mcp_done_onboarding_visit === 'UNKNOWN'): ?>
                MCP hasn't done a onboarding visit.
            <? endif ?>
        </h5>
    </main>
<? endif ?>
</section>

<style>
    .z main {
        display: flex;
        flex-direction: column;
        min-height: 300px;
        padding: 20px 0;
    }

    .z .blocked {
        align-items: center;
        justify-content: center;
    }
</style>

<!-- <div class="container-fluid p-2">
    <div class="row">
        <div class="col-md-12">
            <p>{{$record->name_display()}}</p>

            <div class="p-3 border small mb-3">
                <div class="mr-3 my-1">Online:
                    <span class="font-weight-bold">
                        <?= $record->is_online ? '<span class="text-success">YES</span>' : '<span class="text-secondary">NO</span>' ?>
                    </span>
                </div>
                <div class="mr-3 my-1">Video:
                    <span class="font-weight-bold">
                        <?= $record->is_client_video_turned_on ? '<span class="text-success">ON</span>' : '<span class="text-secondary">OFF</span>' ?>
                    </span>
                    @if($record->is_online && $record->is_client_video_turned_on && isset($inCallWithPros) && count($inCallWithPros))
                        <div class="my-1 font-weight-bold">Currently talking to:</div>
                        @foreach($inCallWithPros as $inCallPro)
                            <div class="d-block my-1">
                                <i class="fa fa-chevron-right mr-1"></i>
                                <a href="/pros/view/{{ $inCallPro->uid }}/SUB_dashboard" class="text-primary">
                                    {{ $inCallPro->name_display }}
                                </a>
                            </div>
                        @endforeach
                    @endif
                </div>
                <div>
                    <a href="#" class="btn btn-sm btn-primary text-primary mt-2 font-weight-bold px-3" onclick="return window.top.openInRHS('/pro/meet/{{ $record->uid }}')">
                        <i class="fa fa-phone mr-1"></i>
                        Go to the client's meeting page
                    </a>
                </div>
            </div>

            <a up-modal=".form-contents" up-width="800" up-history="false" href="{{route('clients_SINGLE-ACTION_setIsDuplicateToTrue', $record->uid)}}" title="Set as not duplicate">Mark as duplicate</a></p>

                <div>
                    <i class="fa fa-phone" aria-hidden="true"></i>
                        {{$record->cell_number}}
                        <a up-modal=".form-contents" up-width="800" up-history="false"
                            href="{{route('clients_SINGLE-ACTION_putNewCellNumber', $record->uid)}}"><i class="fa fa-edit" aria-hidden="true"></i></a>
                </div>
                <div>
                    <i class="fa fa-envelope" aria-hidden="true"></i>
                        {{$record->email_address}}
                    <a up-modal=".form-contents" up-width="800" up-history="false" href="{{route('clients_SINGLE-ACTION_putNewEmailAddress', $record->uid)}}"><i class="fa fa-edit"></i></a>
                </div>
                <div>
                    <i class="fa fa-map-pin" aria-hidden="true"></i> {{$record->home_address_city}}
                </div>
                <div>
                    <i class="fa fa-map-pin" aria-hidden="true"></i> {{$record->home_address_state}}
                    <a up-modal=".form-contents" up-width="800" up-history="false" href="{{route('clients_SINGLE-ACTION_editAddress', $record->uid)}}"><i class="fa fa-edit"></i></a>
                </div>
                <div>
                    {{$record->gender_identity}}, {{$record->sex}}, {{$record->dob}}, {{$record->age_in_years}}
                    <a up-modal=".form-contents" up-width="800" up-history="false" href="{{route('clients_SINGLE-ACTION_editDemographics', $record->uid)}}"><i class="fa fa-edit"></i></a>
                </div>

                <small> Currently under the care of {MCP-First MCP-Last}✏️, with us since {creation.month}, {creation.date} || '8 days'}.
                @if($record->mcpPro)
                <div>
                    Currently under the care of {{$record->mcpPro->name_display}}
                    <a up-modal=".form-contents" up-width="800" up-history="false" href="{{route('clients_SINGLE-ACTION_putMcp', $record->uid)}}"><i class="fa fa-edit" aria-hidden="true"></i></a>
                    <a up-modal=".form-contents" up-width="800" up-history="false" href="{{route('clients_SINGLE-ACTION_removeMcp', $record->uid)}}"><i class="fa fa-trash" aria-hidden="true"></i></a>
                </div>
                @else
                    <div>
                        <p>No mcp pro assigned.</p>
                        <a up-modal=".form-contents" up-width="800" up-history="false" href="{{route('clients_SINGLE-ACTION_putMcp', $record->uid)}}"><i class="fa fa-edit" aria-hidden="true"></i></a>
                    </div>
                @endif

                @if(!$record->is_mcn_valid_number || !$record->mcpPro || !$record->has_mcp_done_onboarding_visit)

                    @if(!$record->is_mcn_valid_number)
                    <div>
                        MCN: {{$record->mcn}} <i class="fa fa-close"></i>
                        <a up-modal=".form-contents" up-width="800" up-history="false" href="{{route('clients_SINGLE-ACTION_putMcn', $record->uid)}}"><i class="fa fa-edit" aria-hidden="true"></i></a>
                    </div>
                    @elseif($record->is_mcn_valid_number || !$record->mcpPro )
                        Please assign a MCP to this client.
                        <a up-modal=".form-contents" up-width="800" up-history="false" href="{{route('clients_SINGLE-ACTION_putMcp', $record->uid)}}">Assign mcp pro</a>
                    @elseif($record->is_mcn_number_valid && !$record->has_mcp_done_onboarding_visit)
                        <div class="alert alert-info">This client hasn't been onboarded yet.</div>
                    @endif
                @else
                    <div>
                        <h2>Care Monitoring:</h2>
                            @if(!$record->cmPro)
                                <a up-modal=".form-contents" up-width="800" up-history="false" href="{{route('clients_SINGLE-ACTION_putCmPro', $record->uid)}}"><i class="fa fa-edit" aria-hidden="true"></i>Link cm pro</a>
                            @else
                                <p>CM Pro: <a href="">{{$record->cmPro->name_display}}</a></p>
                            @endif

                            @if($record->cmPro)
                                @if(!$record->is_enrolled_in_cm)
                                    <p>
                                        Enroll this client into CM<
                                        <a up-modal=".form-contents" up-width="800" up-history="false" href="{{route('clients_SINGLE-ACTION_setIsEnrollerInCmToTrue', $record->uid)}}">enroll in cm</a>
                                    </p>
                                @else
                                    <p>
                                        Unenroll this client from CM
                                        <a up-modal=".form-contents" up-width="800" up-history="false" href="{{route('clients_SINGLE-ACTION_setIsEnrolledInCmToFalse', $record->uid)}}">unenroll in cm</a>
                                    </p>
                                @endif
                            @endif
                        <h2>Remote Monitoring:</h2>
                            { If !rmePro } <Dropdown/Datalist of possible RMEs>
                            @if(!$record->rmePro)
                                <a up-modal=".form-contents" up-width="800" up-history="false" href="{{route('clients_SINGLE-ACTION_putRmePro', $record->uid)}}">Put RME pro</a>
                            @else
                                RME Pro: <a href="">{{$record->rmePro->name_display}}</a>
                                <a up-modal=".form-contents" up-width="800" up-history="false" href="{{route('clients_SINGLE-ACTION_changeRmePro', $record->uid)}}">change rme pro</a>
                            @endif

                            @if(!$record->rmmPro)
                              <a href="">Put RMM pro</a>
                            @else
                                {else}
                                <link>{rmmPro}</link> ✏️
                                RMM Pro:<a href="">{{$record->rmmPro->name_display}}</a>
                                <a  up-modal=".form-contents" up-width="800" up-history="false"
                                    href="{{route('clients_SINGLE-ACTION_changeRmmPro', $record->uid)}}">change rmm pro</a>
                            @endif
                            { If rmePro && rmmPro}
                            @if(!$record->is_enrolled_in_rm)
                                { If !rm} Enroll this client into RM.
                               <a href="">Enroll in RM</a>
                            @else
                                {else}
                                    <small> Unenroll out of RM.
                                        @link _____why?_____ [Unenroll]
                                <a href="">Unenroll in RM</a>
                            @endif

                        << Prev     Care Months - Month, Year     Next >> (max, one month in future)
                        <div>
                            <div>Care month: $client->careMonth->start_date </div>
                            <a href="">Prev</a>|
                            <a href="">Next</a>
                        </div>
                        @if(!$record->careMonth)
                            <div>
                                <a  up-modal=".form-contents" up-width="800" up-history="false"
                                    href="">Add care month</a>
                            </div>
                        @elseif($record->is_tm_this_month)

                        {else if tm}
                            ⚠️ Patient recently discharged, transitional care management billable for this month.
                        @elseif(!$careMonth->is_tm_this_month && ($careMonth->is_client_enrolled_in_cm || $careMonth->is_client_enrolled_in_rm))
                        {else !tm && (cm || rm)}
                            Eligible for CM_20/30_HCP/90. RM_20/30/90. {calc: careMonth.totalTimeCM / careMonth.totalTimeRM}
                            Total time billed this month: {careMonth.totalTimeCM} minutes in CM, {careMonth.totalTimeRM} minutes in RM.
                            <div>
                                Total time billed this month:
                                {{$careMonth->rm_total_time_in_seconds/60}} minutes in CM, {{$careMonth->cm_total_time_in_seconds/60}} minutes in RM.
                            </div>
                            @if($careMonth->is_client_enrolled_in_cm)
                            { If cm}
                                {cmPro} ✏️
                                <div>
                                    CM Pro: <a href="">{{$careMonth->cmPro->name_display}}</a>
                                    <a href="">Change CM pro</a>
                                </div>
                            @endif
                            @if($careMonth->is_client_enrolled_in_rm)
                            { If rm}
                                {rmePro} ✏️
                                {rmmPro} ✏️
                                <div>
                                    RME Pro: <a href="">{{$careMonth->rmePro->name_display}}</a>
                                    <a href="">Change RME pro</a>
                                </div>
                                <div>
                                    RMM Pro: <a href="">{{$careMonth->rmmPro->name_display}}</a>
                                    <a href="">Change RMM pro</a>
                                </div>
                            @endif
                            [Add an entry]
                            <a href="">Add an entry</a>
                            {Loop entries recent}
                                Created | Type (rm/cm) | Duration | Content | Pro
                            {/Loop entries}

                            <table class="table table-condensed table-striped">
                                <thead>
                                    <tr>
                                        <th>Created</th>
                                        <th>Type (rm/cm)</th>
                                        <th>Duration</th>
                                        <th>Content</th>
                                        <th>Pro</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    @foreach ($careMonth->careMonthEntries as $careMonthEntry)
                                    <tr>
                                        <td>{{$careMonthEntry->created_at}}</td>
                                        <td>{{$careMonthEntry->cm_or_rm}}</td>
                                        <td>{{$careMonthEntry->time_in_seconds}}</td>
                                        <td>{{$careMonthEntry->content_text}}</td>
                                        <td>{{$careMonthEntry->pro->name_display}}</td>
                                    </tr>
                                    @endforeach
                                </tbody>
                            </table>

                        @endif
                        </div>
                @endif

        </div>
    </div>
</div> -->

*/ ?>
@endsection
