<?php

use App\Models\Point;

$category = 'COVID_FOLLOW-UP';

$point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, $category, $sessionKey, true);

$contentData = [
    "ans_has_received_printed_cdc_covid_matrials" => null, // yes/no
    "ans_has_signed_up_for_gvt_covid_kit" => null, // yes/no/not_sure
    "ans_apply_gvt_covid_kit_for_patient" => null, // yes/no/not_sure
    "ans_has_reviewed_printed_cdc_covid_matrials" => null,
    "cdc_self_protection_emphasis_vaccination" => null,
    "cdc_self_protection_emphasis_mask_wearing" => null,
    "cdc_self_protection_emphasis_mask_wearing" => null,
    "cdc_self_protection_emphasis_social_distancing" => null,
    "cdc_self_protection_emphasis_avoid_crowds" => null,
    "cdc_self_protection_emphasis_test_appropriately" => null,
    "cdc_self_protection_emphasis_wash_hands_often" => null,
    "cdc_self_protection_emphasis_cover_coughs" => null,
    "cdc_self_protection_emphasis_disinfect" => null,
    "cdc_self_protection_emphasis_monitor_health_daily" => null,
    "cdc_self_protection_emphasis_quarantine" => null,
    "cdc_self_protection_emphasis_isolation" => null,
    "cdc_self_protection_emphasis_travel_precaution" => null,
    "ans_has_answered_all_covid_19_questions" => null,
    "ans_has_received_printed_cdc_mental_health_matrials" => null, // yes/no
    "ans_educated_patient_on_mental_health_screening" => null,
    "ans_how_patient_is_doing_regarding_stress" => null,
    "total_phq2" => null,
    "phq_action_taken" => null,
    "cdc_stress_emphasis_covid_19_effects" => null,
    "cdc_stress_emphasis_stressful_challenges" => null,
    "cdc_stress_emphasis_public_health_actions" => null,
    "cdc_stress_emphasis_physical_reactions" => null,
    "cdc_stress_emphasis_coping_with_stress" => null,
    "ans_hypertension_rpm_education" => null,
    "remarks" => null,

];

if ($point->lastChildReview && $point->lastChildReview->data) {
    $point->lastChildReview->data = json_decode($point->lastChildReview->data, true);
    $contentData = $point->lastChildReview->data;
}

?>

<div class="events-none form-read-mode">
    <div class="mb-2">
        <label><b>{{ $patient->displayName() }}</b> is a <b>{{$patient->age_in_years }} y.o.</b>
            @if($patient->sex == 'M')
                <b>M</b>
            @elseif($patient->sex == 'F')
                <b>F</b>
            @endif
            presenting for follow-up regarding CDC COVID-19 guidelines & ongoing medical care.</label>
    </div>

    <div class="mb-2">
        <h6><b><u>CDC: How to Protect Yourself & Others: Education</u></b></h6>
        @if(@$contentData['ans_has_received_printed_cdc_covid_matrials'] == 'yes')
            Patient has received printed materials from CDC, “How to Protect Yourself & Others”.
        @elseif(@$contentData['ans_has_received_printed_cdc_covid_matrials'] == 'no')
            Patient has not received printed materials from CDC, “How to Protect Yourself & Others”.
        @else

        @endif
    </div>

    <div class="mb-2">
        <label>Asked patient if they have already signed up for government supplied COVID-19 home diagnostic kits? Patient replied:</label>
        @if(@$contentData['ans_has_signed_up_for_gvt_covid_kit'] == 'yes')
            <?= segment_template_summary_value_display('Yes') ?>
        @elseif(@$contentData['ans_has_signed_up_for_gvt_covid_kit'] == 'no')
            <?= segment_template_summary_value_display('No') ?>
        @elseif(@$contentData['ans_has_signed_up_for_gvt_covid_kit'] == 'not_sure')
            <?= segment_template_summary_value_display('Not Sure') ?>
        @else
            <?= segment_template_summary_value_display('') ?>
        @endif
    </div>

    @if(@$contentData['ans_has_signed_up_for_gvt_covid_kit'] && @$contentData['ans_has_signed_up_for_gvt_covid_kit'] != 'yes')
        <div class="mb-2">
            <label>Asked patient if we can apply on CovidTests.gov for them? Patient replied:</label>
            @if(@$contentData['ans_apply_gvt_covid_kit_for_patient'] == 'yes')
                <?= segment_template_summary_value_display('Yes') ?>
            @elseif(@$contentData['ans_apply_gvt_covid_kit_for_patient'] == 'no')
                <?= segment_template_summary_value_display('No') ?>
            @elseif(@$contentData['ans_apply_gvt_covid_kit_for_patient'] == 'not_sure')
                <?= segment_template_summary_value_display('Not Sure') ?>
            @else
                <?= segment_template_summary_value_display('') ?>
            @endif
        </div>
    @endif

    @if(@$contentData['ans_has_reviewed_printed_cdc_covid_matrials'])
        <div class="mb-2">
            <label>Reviewed “<b>CDC: How to Protect Yourself & Others</b>” with patient.</label>
            <div>
                <a native href="https://www.cdc.gov/coronavirus/2019-ncov/prevent-getting-sick/prevention.html" target="_blank">https://www.cdc.gov/coronavirus/2019-ncov/prevent-getting-sick/prevention.html</a>
            </div>
        </div>
    @endif

    <div class="mb-2">
        <label> Emphasis placed on:</label>
        <ul>
            @if(@$contentData['cdc_self_protection_emphasis_vaccination'])
                <li>Vaccination</li>
            @endif

            @if(@$contentData['cdc_self_protection_emphasis_mask_wearing'])
                <li>Mask wearing.</li>
            @endif

            @if(@$contentData['cdc_self_protection_emphasis_social_distancing'])
                <li>Social distancing.</li>
            @endif

            @if(@$contentData['cdc_self_protection_emphasis_avoid_crowds'])
                <li>Avoid poorly ventilated spaces and crowds.</li>
            @endif

            @if(@$contentData['cdc_self_protection_emphasis_test_appropriately'])
                <li>Test appropriately</li>
            @endif

            @if(@$contentData['cdc_self_protection_emphasis_vaccination'])
                <li>Wash your hands often</li>
            @endif

            @if(@$contentData['cdc_self_protection_emphasis_cover_coughs'])
                <li>Cover coughs</li>
            @endif

            @if(@$contentData['cdc_self_protection_emphasis_disinfect'])
                <li>Clean and disinfect surfaces</li>
            @endif

            @if(@$contentData['cdc_self_protection_emphasis_monitor_health_daily'])
                <li>Monitor your health daily; Monitoring symptoms is especially important if you are running errands, going into the office or workplace, and in settings where it may be difficult to keep a physical distance of 6 feet.</li>
            @endif

            @if(@$contentData['cdc_self_protection_emphasis_quarantine'])
                <li>Follow recommendations for quarantine; If you come into close contact with someone with COVID-19: follow CDC’s recommendations for quarantine.</li>
            @endif

            @if(@$contentData['cdc_self_protection_emphasis_isolation'])
                <li>Follow recommendations for isolation; If you test positive for COVID-19 or have symptoms: follow CDC’s recommendations for isolation.</li>
            @endif

            @if(@$contentData['cdc_self_protection_emphasis_travel_precaution'])
                <li>Take precautions when you travel; Follow CDC’s recommendations for domestic and international travel.</li>
            @endif
        </ul>
    </div>

    <div class="mb-2">
        @if(@$contentData['ans_has_answered_all_covid_19_questions'] == 'yes')
            <label>Answered all questions relating to COVID-19.</label>
            <?= segment_template_summary_value_display('Patient verbalizes understanding.') ?>
        @elseif(@$contentData['ans_has_answered_all_covid_19_questions'] == 'no')

        @endif
    </div>

    <div class="mb-2">
        <h6><b><u>CDC: Coping with Stress - Mental Health Screening</b></u></h6>
    </div>
    @if(@$contentData['ans_has_received_printed_cdc_mental_health_matrials'] == 'yes')
        <div class="mb-2">
            <label>Patient has received printed materials from the CDC “<b>Coping with Stress</b>”.</label>
            <div>
                <a native href="https://www.cdc.gov/mentalhealth/stress-coping/cope-with-stress/index.html" target="_blank">https://www.cdc.gov/mentalhealth/stress-coping/cope-with-stress/index.html</a>
            </div>
        </div>
    @elseif(@$contentData['ans_has_received_printed_cdc_mental_health_matrials'] == 'no')
        <div class="mb-2">
            <label>Patient has not received printed materials from the CDC “<b>Coping with Stress</b>”.</label>
            <div>
                <a native href="https://www.cdc.gov/mentalhealth/stress-coping/cope-with-stress/index.html" target="_blank">https://www.cdc.gov/mentalhealth/stress-coping/cope-with-stress/index.html</a>
            </div>
        </div>
    @endif

    @if(@$contentData['ans_educated_patient_on_mental_health_screening'])
        <div class="mb-2">
            <label>Educated patient that stress and mental health screening is important because 7 in 10 adults are reporting feelings of anxiety, sadness, and depression due to COVID-19.</label>
        </div>
    @endif

    <div class="mb-2">
        <label>Asked patient, how are you doing regarding stress? Patient replied:</label>
        <?= segment_template_summary_value_display(@$contentData['ans_how_patient_is_doing_regarding_stress']) ?>
    </div>

    <div class="mb-2">
        <label>Conducted PHQ-2 with patient. Patient score is:</label>
        <?= segment_template_summary_value_display(@$contentData['total_phq2']) ?>
    </div>

    @if((int) @$contentData['total_phq2'] > 3)
        <ul>
            @if(@$contentData['phq_action_taken'])
                <li>
                    @if(@$contentData['phq_action_taken'] == 'phq_administer_phq_9_now')
                        Administer PHQ-9 now.
                    @elseif(@$contentData['phq_action_taken'] == 'phq_schedule_phq_9_now')
                        Schedule PHQ-9 now.
                    @elseif(@$contentData['phq_action_taken'] == 'phq_schedule_phq_9_later')
                        Schedule PHQ-9 later.
                    @elseif(@$contentData['phq_action_taken'] == 'phq_refer_to_psych_np')
                        Referral to Psych NP - “Stress Specialist”.
                    @endif
                </li>
            @endif
        </ul>
    @endif

    <div class="mb-2 d-none">
        <h6><b><u>OPTIONAL: Election to participate in PHQ-9:</u></b></h6>
    </div>
    <div class="mb-2">
        <label>Reviewed “<b>CDC: Coping with Stress</b>” with patient. Went over the following points.</label>
    </div>
    <div class="mb-2">
        <ul>
            @if(@$contentData['cdc_stress_emphasis_covid_19_effects'])
                <li>The COVID-19 pandemic has had a major effect on our lives.</li>
            @endif
            
            @if(@$contentData['cdc_stress_emphasis_stressful_challenges'])
                <li>Many of us are facing challenges that can be stressful.</li>
            @endif

            @if(@$contentData['cdc_stress_emphasis_public_health_actions'])
                <li>Public health actions like social distancing can increase stress and anxiety / isolation.</li>
            @endif

            @if(@$contentData['cdc_stress_emphasis_physical_reactions'])
                <li>Stress can cause adverse feelings and physical reactions, especially relating to HTN and DM.</li>
            @endif

            @if(@$contentData['cdc_stress_emphasis_coping_with_stress'])
                <li>Educated patient on healthy ways to cope with stress (as per CDC: Coping with Stress):
                    <?php
                    $healthyWaysOptions = [
                        'take_break_from_social_media' => 'Take breaks from news and social media.',
                        'take_care_of_your_body' => 'Take care of your body',
                        'take_deep_breaths' => 'Take deep breaths, stretch, or meditate',
                        'try_to_eat_healthy' => 'Try to eat healthy, well-balanced meals',
                        'exercise_regularly' => 'Exercise regularly',
                        'get_plenty_of_sleep' => 'Get plenty of sleep',
                        'avoid_excessive_alcohol' => 'Avoid excessive alcohol, tobacco, and substance use',
                        'continue_with_routine_preventive_measures' => 'Continue with routine preventive measures (such as vaccinations, cancer screenings, etc.) as recommended by your healthcare provider',
                        'get_vaccinated_with_covid' => 'Get vaccinated with a COVID-19 vaccine',
                        'make_time_unwind' => 'Make time to unwind — Try to do some other activities you enjoy',
                        'connect_with_others' => 'Connect with others — Talk with people you trust about your concerns and how you are feeling',
                        'connect_with_your_community' => 'Connect with your community- or faith-based organizations — While social distancing measures are in place, try connecting online, through social media, or by phone or mail'
                    ];
                    ?>
                    <ul>
                        @foreach($healthyWaysOptions as $hOptionKey => $hOptionLabel)
                            @if(@$contentData[$hOptionKey])
                                <li>{{ $hOptionLabel }}</li>
                            @endif
                        @endforeach
                    </ul>
                </li>
            @endif
        </ul>
    </div>

	<hr class="my-3">

    <div class="mb-2">
        <label class="mb-1">Asked patient top three wishes for health. They replied:</label>
        @if(!@$contentData['top_wish_1'] && !@$contentData['top_wish_2'] && !@$contentData['top_wish_3'])
            <?= segment_template_summary_value_display(''); ?>
        @endif
        <ol class="mt-1">
            @if(@$contentData['top_wish_1'])
                <li>{{@$contentData['top_wish_1']}}</li>   
            @endif
            @if(@$contentData['top_wish_2'])
                <li>{{@$contentData['top_wish_2']}}</li>   
            @endif
            @if(@$contentData['top_wish_3'])
                <li>{{@$contentData['top_wish_3']}}</li>   
            @endif
        </ol>
    </div>
    <hr class="my-3">

    <div class="mb-2">
        <label class="mb-1">Next follow-up for:</label>
        <?= segment_template_summary_value_display(@$contentData['follow_up_for']) ?>
    </div>

    @if(@$contentData['ans_hypertension_rpm_education'])
        <h6 class="d-none"><b><u>OPTIONAL: Election to enroll into hypertension RPM: (Requires H&P)</u></b></h6>
        <p>Educated patient regarding AHA position statement on HTN & RPM, educated about availability of CCM, informed patient about importance as per AHA position statement. Patient consents to RPM.</p>
        <p>Remote patient monitoring (RPM) can empower patients to better manage their health and participate in their health care. When used by clinicians, RPM can provide a more holistic view of a patient’s health over time, increase visibility into a patient’s adherence to a treatment, and enable timely intervention before a costly care episode. Clinicians can strengthen their relationships with, and improve the experience of, their patients by using the data sent to them via RPM to develop a personalized care plan and to engage in joint decision-making to foster better outcomes. The American Heart Association supports initiatives that increase access to and incentivize the appropriate design and use of evidence-based remote patient monitoring technologies.</p>
    @endif

    @if(@$contentData['remarks'])
        <div class="mb-3">
            <label class="font-weight-bold">Remarks:</label>
            <div class="border p-3"><?= nl2br(@$contentData['remarks']) ?></div>      
        </div>
    @endif

</div>
