<!DOCTYPE html>
<html lang="ja">
<head>
    {% with subtitle = ultmarc.subtitle %}
    {% include '_header.html' %}
    {% endwith  %}
    <link rel="stylesheet" href="/static/css/ultStyle.css">

    <script type="text/javascript">
        window.onload = function(){
            // 見出し固定初期化
            FixedMidashi.create();
            // ボタン、テキストボックス初期化
            formBtDisabled();
        }
    </script>
    <script>
        $(function(){
            // 前ページ遷移処理
            $('#prev').click(function(){
                $('#page_num').val(Number($('#page_num').val()) - 1);
                $('#instInfo').submit();
            });
            // 次ページ遷移処理
            $('#next').click(function(){
                $('#page_num').val(Number($('#page_num').val()) + 1);
                $('#instInfo').submit();
            });
        });
    </script>
</head>

<body>
    <h1>
        {{ultmarc.subtitle}}
    </h1>
    {% if ultmarc.is_batch_processing %}
        <div class="docButchMsg" style="text-align: center">日次バッチ処理中のため、データが正しく表示されない可能性があります</div>
    {% endif %}

    <!-- 上部のボタン -->
    <table class="instHeaderTable">
        <tr>
            <form name="docSearch" method="post" action="/ultmarc/docSearch">
                <td class="instHeaderTd">
                    <input type="hidden" name="ctrl_dcf_dsf_inst_cd" value="{{ultmarc.inst_info_data.dcf_dsf_inst_cd or ''}}">
                    <input name="docSearchBt" class="transitionBt" type="submit" value="勤務医師" {{ultmarc.is_disabled_doctor_wrkplace()}}>
                </td>
            </form>
            <form id="instInfo" name="instInfo" method="post" action="/ultmarc/instInfo">
                <input type="hidden" name="inst_id" value="{{ultmarc.inst_id}}">
                <input type="hidden" name="page_num" id="page_num" value="{{ultmarc.page_num}}">
                <td class="instHeaderTd">
                    <input type="button" name="prev" id="prev" value="前" class="transitionBt" {{ultmarc.is_disabled_prev()}}>
                </td>
                <td class="instHeaderTd">
                    {{ultmarc.is_page_num_view()}}／{{ultmarc.post_cnt}}
                </td>
                <td class="instHeaderTd">
                    <input type="button" name="next" id="next" value="次" class="transitionBt" {{ultmarc.is_disabled_next()}}>
                </td>
            </form>
            <form id="instSearch" name="instSearch" method="" action="/ultmarc/instSearch" onsubmit="chg_send_method()">
                <script>
                    var form = document.getElementById("instSearch");
                    for (var i = 0, length = sessionStorage.length; i < length; ++i) {
                        let key = sessionStorage.key(i);
                        let value = sessionStorage.getItem(key);
                        const input = document.createElement('input');
                        input.setAttribute('type', 'text');
                        input.value = value;
                        input.name = key;
                        form.appendChild(input);
                    }

                </script>

                <td class="instHeaderTd">
                    <input type="submit" name="instSearchBt" class="transitionBt" value="施設検索一覧へ">
                </td>
            </form>
            <script>
                function chg_send_method(){
                    if(sessionStorage.length == 0){
                        $('#instSearch')('method', 'GET');
                    }else{
                        $('#instSearch').attr('method', 'POST');
                    }
                    return true;
                }
            </script>
        </tr>
    </table>

    <!-- 施設情報 -->
    <table class="instInfoTable">
        <tbody>
            <tr>
                <td class="instInfoColumn">施設コード</td>
                <td class="instData instDataLeft">
                    <input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.dcf_dsf_inst_cd or ''}}" class="instCdTextbox">
                    <input class="checkbox" type="checkbox" disabled="disabled" {{ultmarc.is_checked_unconf_flg()}}>未確認
                </td>
                <td class="instInfoColumn">施設コード変換先</td>
                <td class="instData instDataCenter">
                    <input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.dup_opp_cd or ''}}" class="instDataCenterTextbox">
                </td>
                <td class="instInfoColumn">休院店開始年月</td>
                <td class="instData instDataRight">
                    <input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.close_start_ym or ''}}" class="instDataSmallTextbox">
                    <input type="checkbox" disabled="disabled" {{ultmarc.is_checked_close_flg()}}>休院店
                </td>
            </tr>
            <tr>
                <td class="instInfoColumn">削除予定理由</td>
                <td class="instData instDataLeft">
                    <input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.delete_sche_reason_cd or ''}}" class="delReasonCdTextbox">
                    <input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.delete_sche_reason or ''}}" class="delReasonTextbox"></td>
                <td class="instInfoColumn">削除日</td>
                <td class="instData instDataCenter">
                    <input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.abolish_ymd or ''}}" class="instDataCenterTextbox">
                </td>
                <td class="instInfoColumn">開業予定年月</td>
                <td class="instData instDataRight">
                    <input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.estab_sche_ym or ''}}" class="instDataSmallTextbox">
                    <input type="checkbox" disabled="disabled" {{ultmarc.is_checked_estab_sche_flg()}}>開業
                </td>
            </tr>
            <tr>
                <td class="instInfoColumn">正式施設名(カナ)</td>
                <td class="instData"  colspan="5"><input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.form_inst_name_kana or ''}}" class="instInfoTextbox"></td>
            </tr>
            <tr>
                <td class="instInfoColumn">正式施設名(漢字)</td>
                <td class="instData" colspan="5"><input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.form_inst_name_kanji or ''}}" class="instInfoTextbox"></td>
            </tr>
            <tr>
                <td class="instInfoColumn">略式施設名(カナ)</td>
                <td class="instData instDataMid" colspan="3"><input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.inst_name_kana or ''}}" class="instInfoTextbox"></td>
                <td class="instInfoColumn">施設区分名</td>
                <td class="instData instDataSmall"><input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.inst_div_name or ''}}" class="instInfoTextbox"></td>
            </tr>
            <tr>
                <td class="instInfoColumn">略式施設名(漢字)</td>
                <td class="instData instDataMid" colspan="3"><input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.inst_name_kanji or ''}}" class="instInfoTextbox"></td>
                <td class="instInfoColumn">経営体</td>
                <td class="instData instDataSmall">
                    <input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.manage_cd or ''}}" class="manageTextbox">
                    <input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.manage_name or ''}}" class="textboxMargin manageTextbox">
                </td>
            </tr>
            <tr>
                <td class="instInfoColumn">郵便番号</td>
                <td class="instData instDataMid"  colspan="3">
                    <input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.postal_number or ''}}">
                    <input type="checkbox" class="checkboxMargin" disabled="disabled" {{ultmarc.is_checked_addr_unknown_reason_cd()}}>住所不明
                </td>
                <td class="instInfoColumn">施設電話番号</td>
                <td class="instData instDataRight">
                    <input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.inst_phone_number or ''}}" class="instDataSmallTextbox">
                    <input type="checkbox" class="checkboxMargin" disabled="disabled" {{ultmarc.is_checked_phone_number_non_flg()}}>電話なし
                </td>
            </tr>
            <tr>
                <td class="instInfoColumn">住所（カナ）</td>
                <td class="instData instDataLarge" colspan="5"><input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.inst_addr_kana or ''}}" class="instInfoTextbox"></td>
            </tr>
            <tr>
                <td class="instInfoColumn">住所（漢字）</td>
                <td class="instData instDataLarge" colspan="5"><input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.inst_addr or ''}}" class="instInfoTextbox"></td>
            </tr>
        </tbody>
    </table>

    <hr>

    <!-- 病院情報 -->
    <table class="instInfoTableHalf1">
        <tbody>
            <tr>
                <td class="hpInfoColumn">病院種別</td>
                <td class="instData hpAssrtTd"><input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.hp_assrt_name or ''}}" class="hpAssrtTextbox"></td>
                <td class="instData reExamTd"><input type="checkbox" disabled="disabled" {{ultmarc.is_checked_re_exam_cd()}}>再審査区分</input></td>
                <td class="hpInfoColumn">関連大学親名</td>
                <td class="instData">
                    <input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.rltd_univ_prnt_cd or ''}}" class="parentCdTextBox">
                    <input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.parent_name or ''}}" class="parentNameTextBox">
                </td>
            </tr>
            <tr>
                <td class="hpInfoColumn">診療科目</td>
                <td class="instData border_bottom_none" colspan="4">
                    {% if ultmarc.inst_trt_coursed_data != None %}
                        {% for inst_trt_course_data in ultmarc.inst_trt_coursed_data %}
                            <input class="trtCourseTextbox" type="text" readonly="readonly" value="{{inst_trt_course_data.trt_course_name_abb or ''}}">
                        {% endfor %}
                    {% endif %}
                    {% for i in range(60-ultmarc.is_input_inst_trt_course_data_size()) %}
                        <input class="trtCourseTextbox" type="text" readonly="readonly">
                    {% endfor %}

                </td>
            </tr>
            <tr>
                <td class="hpInfoColumn">検査工程</td>
                <td class="instData" colspan="4">
                    <label>微生物</label>
                    <input class="trtTextbox" type="text" readonly="readonly" value="{{ultmarc.inst_info_data.insp_item_micrb or ''}}">
                    <label>血清</label>
                    <input class="trtTextbox" type="text" readonly="readonly" value="{{ultmarc.inst_info_data.insp_item_serum or ''}}">
                    <label>血液</label>
                    <input class="trtTextbox" type="text" readonly="readonly" value="{{ultmarc.inst_info_data.insp_item_blood or ''}}">
                    <label>病理</label>
                    <input class="trtTextbox" type="text" readonly="readonly" value="{{ultmarc.inst_info_data.insp_item_patho or ''}}">
                    <label>寄生虫</label>
                    <input class="trtTextbox" type="text" readonly="readonly" value="{{ultmarc.inst_info_data.insp_item_paras or ''}}">
                    <label>生化</label>
                    <input class="trtTextbox" type="text" readonly="readonly" value="{{ultmarc.inst_info_data.insp_item_biochem or ''}}">
                    <label>RI</label>
                    <input class="trtTextbox" type="text" readonly="readonly" value="{{ultmarc.inst_info_data.insp_item_ri or ''}}">
                </td>
            </tr>
        </tbody>
    </table>
    <table class="instInfoTableHalf2">
            <tbody>
            <tr>
                <td class="hpInfoColumn">特務医務室</td>
                <td class="instData xSmallTd"><input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.dcf_prnt_inst_cd or ''}}" class="xSmallTextbox"></td>
                <td rowspan="2" class="hpInfoColumn">許可病床数</td>
                <td class="instData bedTd" rowspan="2">
                    <table>
                        <tbody>
                            <tr>
                                <td>一般</td>
                                <td>療養</td>
                                <td>精神</td>
                                <td>感染症</td>
                                <td>結核</td>
                                <td>その他</td>
                                <td>合計</td>
                            </tr>
                            <tr>
                                <td><input class="bedTextbox numberBox" type="text" readonly="readonly" value="{{ultmarc.inst_info_data.prmit_bed_num_gen or ''}}"></td>
                                <td><input class="bedTextbox numberBox" type="text" readonly="readonly" value="{{ultmarc.inst_info_data.prmit_bed_num_rcup or ''}}"></td>
                                <td><input class="bedTextbox numberBox" type="text" readonly="readonly" value="{{ultmarc.inst_info_data.prmit_bed_num_mental or ''}}"></td>
                                <td><input class="bedTextbox numberBox" type="text" readonly="readonly" value="{{ultmarc.inst_info_data.prmit_bed_num_infection or ''}}"></td>
                                <td><input class="bedTextbox numberBox" type="text" readonly="readonly" value="{{ultmarc.inst_info_data.prmit_bed_num_tuber or ''}}"></td>
                                <td><input class="bedTextbox numberBox" type="text" readonly="readonly" value="{{ultmarc.inst_info_data.prmit_bed_num_other or ''}}"></td>
                                <td><input class="bedTextbox numberBox" type="text" readonly="readonly" value="{{ultmarc.inst_info_data.prmit_bed_num_sum or ''}}"></td>
                            </tr>
                        </tbody>
                    </table>
                </td>
                <td class="instData" colspan="2"><input type="checkbox" disabled="disabled" {{ultmarc.is_checked_ward_abolish_flg()}}>病棟閉鎖　　<input type="checkbox" disabled="disabled" {{ultmarc.is_checked_ward_abolish_flg_part()}}>一部病棟閉鎖</td>
            </tr>
            <tr>
                <td class="hpInfoColumn">病床数(定員)</td>
                <td class="instData"><input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.bed_num or ''}}" class="xSmallTextbox numberBox"></td>
                <td class="hpInfoColumn">メンテ年月日</td>
                <td class="instData xSmallTd"><input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.prmit_bed_maint_ymd or ''}}" class="repreTextbox"></td>
            </tr>
        </tbody>
    </table>
    <!-- 施設代表者 -->
    <table class="instInfoTable">
        <tbody>
            <tr>
                <td class="instInfoColumn">代表者個人コード</td>
                <td class="instData repreTd"><input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.inst_repre_cd or ''}}" class="repreTextbox"></td>
            </tr>
            <tr>
                <td class="instInfoColumn">施設代表者(カナ)</td>
                <td class="instData repreTd"><input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.inst_repre_kana or ''}}" class="repreTextbox"></td>
            </tr>
            <tr>
                <td class="instInfoColumn">施設代表者(漢字)</td>
                <td class="instData repreTd"><input type="text" readonly="readonly" value="{{ultmarc.inst_info_data.inst_repre or ''}}" class="repreTextbox"></td>
            </tr>
            <tr>
                <td class="instInfoColumn">修正年月日</td>
                <td class="instData repreTd"><input type="text" readonly="readonly" value="{{ultmarc.is_input_sys_update_date()}}" class="repreTextbox"></td>
            </tr>
        </tbody>
    </table>
</body>
</html>