<?php

use App\Models\Point;

$category = 'INFORMED_CONSENT';
$endPoint = 'upsertNoteSingleton';

$point = Point::where('added_in_note_id', $note->id)->where('category', $category)->orderBy('id', 'DESC')->first();
$contentData = [
    "informed_consent" => false
];
if (!!@$point->data) {
    $contentData = json_decode($point->data, true);
}
?>
<div visit-moe close-on-save close-on-cancel class="d-block px-3 py-2">
    <form show url="/api/visitPoint/<?= $endPoint ?>" class="mcp-theme-1 mt-2">
        <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
        <input type="hidden" name="category" value="<?= $category ?>">
        <input type="hidden" name="data" value="{{json_encode($contentData)}}">

        <label class="d-flex align-items-baseline">
            <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
                <input type="checkbox" data-name="informed_consent" {{@($contentData["informed_consent"] ? 'checked' : '')}}>
            </div>
            <span> This is a {{$note->method}} visit that was performed on {{friendly_date($note->effective_dateest)}}. Verbal consent to participate in a video visit was obtained.</span>
        </label>

        <div class="mb-2">
            <!-- <div>This visit occurred during the Coronavirus (COVID-19) Public Health Emergency.</div> -->
            <div>I discussed with the patient the nature of our visit, that:</div>
            <div class="ml-3">- I would evaluate the patient and recommend diagnostics and treatments based on my assessment.</div>
            <div class="ml-3">- Our sessions are not being recorded, and that personal health information is protected.</div>
            <div class="ml-3">- Our team would provide follow-up care in person if/when the patient needs it.</div>
            <div class="ml-3">- No physical exam was performed due to the remote nature of this evaluation.</div>
        </div>

        <div class="pt-2">
            <button submit class="btn btn-sm btn-primary mr-2"><i class="fa fa-save"></i></button>
            <div class="d-inline-flex align-self-stretch align-items-center">
                <span class="autosave-indicator saving text-sm text-secondary">Saving changes &hellip;</span>
                <span class="autosave-indicator saved text-sm text-secondary">
                    <i class="fa fa-check"></i>
                    Saved
                </span>
            </div>
        </div>
    </form>
</div>
