<?php
date_default_timezone_set("Asia/Jakarta");
?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            Pemeriksaan
            <small>Klinik</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
            <li class="active">Pemeriksaan</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">

        <div class="row">
            <div class="col-md-3">


                <!-- ------------------------- -->
                <div class="box box-solid box-success">
                    <div class="box-header with-border">
                        <span><small><i class="fa fa-edit"> Anamnesa</i></small> </span>
                        <div class="box-tools">
                            <button type="button" class="btn btn-box-tool" data-widget="collapse">
                                <i class="fa fa-minus"></i>
                            </button>
                        </div>
                    </div>
                    <div class="box-body no-padding">
                        <ul class="nav nav-pills nav-stacked">

                            <li>
                                <a title="Berat Badan">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> Berat Badan :
                                        <?= $pasien['BeratBadan']; ?> kg.</small>
                                </a>
                            </li>
                            <li>
                                <a title="Tinggi Badan">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> Tinggi Badan :
                                        <?= $pasien['TinggiBadan']; ?> cm.</small>
                                </a>
                            </li>
                            <li>
                                <a title="RespRate">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> RespRate :
                                        <?= $pasien['respRate']; ?></small>
                                </a>
                            </li>
                            <li>
                                <a title="Suhu">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> Suhu : <?= $pasien['Suhu']; ?></small>
                                </a>
                            </li>
                            <li>
                                <a title="Tensi">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> Tensi :
                                        <?= $pasien['Tensi']; ?></small>
                                </a>
                            </li>
                            <li>
                                <a title="Diastole">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> Diastole :
                                        <?= $pasien['Diastole']; ?></small>
                                </a>
                            </li>
                            <li>
                                <a title="HeartRate">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> HeartRate :
                                        <?= $pasien['heartRate']; ?></small>
                                </a>
                            </li>
                            <li>
                                <a title="Keluhan">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> Keluhan :
                                        <?= $pasien['Keluhan']; ?></small>
                                </a>
                            </li>

                        </ul>
                        <label id="lbltglplgsep" class="hidden"></label>
                    </div>
                    <!-- /.box-body -->
                </div>
                <div class="box box-solid box-warning">
                    <div class="box-header with-border">
                        <span><small><i class="fa fa-user"> Pasien</i></small> </span>
                        <div class="box-tools">
                            <button type="button" class="btn btn-box-tool" data-widget="collapse">
                                <i class="fa fa-minus"></i>
                            </button>
                        </div>
                    </div>
                    <div class="box-body no-padding">
                        <ul class="nav nav-pills nav-stacked">
                            <li>
                                <a title="No.MR">
                                    <small><i class="fa fa-fw fa-sort-numeric-asc"></i>
                                        <?= $pasien['PatientCode']; ?></small>
                                </a>
                            </li>
                            <li>
                                <a title="Nama">
                                    <small><i class="fa fa-fw fa-medkit"></i>
                                        <?= $pasien['Description']; ?></small>
                                </a>
                            </li>
                            <li>
                                <a title="Tgl.Kunjungan">
                                    <small><i class="fa fa-fw fa-calendar"></i> <?= $pasien['Intake Date']; ?></small>
                                </a>
                            </li>

                            <li>
                                <a title="Poli">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> <?= $pasien['Unit']; ?></small>
                                </a>
                            </li>
                            <li>
                                <a title="Diagnosa">
                                    <small><i class="fa fa-fw fa-bookmark-o"></i> <?= $pasien['NoAntrian']; ?></small>
                                </a>
                            </li>

                        </ul>
                        <label id="lbltglplgsep" class="hidden"></label>
                    </div>
                    <!-- /.box-body -->
                </div>
            </div>
            <div class="col-md-9">
                <!-- SELECT2 EXAMPLE -->
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title">Set Diagnosa</h3>
                        <div class="box-tools pull-right">
                            <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                            <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button>
                        </div>
                    </div><!-- /.box-header -->
                    <div class="box-body">
                        <form action="<?= base_url('rekamMedis/prosesDiagnosa/'.$pasien['Case ID']); ?>" method="post">
                        <small>
                            <label for="">Diagnosa</label>
                            <br>
                            <input type="text" name="caseID" hidden value="<?= $pasien['Case ID']; ?>">
                            <select style="background-color: white;" required name="Diagnosa" class="teanganData "
                                data-live-search="true">
                                <option value="">-- Pilih Diagnosa --</option>
                                <?php
                                foreach ($diagnosa as $dd) :
                                    $teks = 50;
                                    if ($teks > 50) {
                                        $titik = "...";
                                    } else {
                                        $titik = "";
                                    }
                                ?>
                                <option value="<?= $dd['ICD_CODE']; ?>">
                                    <?= $dd['ICD_CODE']; ?> -
                                    <?= substr($dd['DESCRPTION'], 0, $teks) . $titik; ?>
                                </option>
                                <?php
                                endforeach;
                                ?>
                            </select>
                            <br>
                            <button type="submit" class="btn btn-sm btn-success" style="margin-top: 10px;">Simpan Diagnosa</button>
                        </small>
                        </form>
                    </div><!-- /.box-body -->
                    <div class="box-footer">
                        <small>Daftar Pemeriksaan <?= date('d F Y'); ?> - @Klinik <?= date('Y'); ?></small>
                    </div>
                </div><!-- /.box -->
            </div>
        </div>



    </section><!-- /.content -->
</div><!-- /.content-wrapper -->