<!doctype html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <th:block th:include="include :: header('南京市口腔医院病历质控分配规则')"/>
    <link rel="stylesheet" th:href="@{/mrqc/css/public.css}">
    <link rel="stylesheet" th:href="@{/mrqc/css/list.css}">
    <link rel="stylesheet" th:href="@{/mrqc/css/manage_index.css}">
</head>
<script>
    var ctx = '[[@{/}]]';
    var prefix = ctx + "/manageRecord";
</script>
<body>
<div class="popup_addStaff" id="configQcRuleDiv">

    <div class="manageRule" id="detailQcRule">
        
        <!--
        <p>
            1、质控时间每月<input type="text" id="kqyy.startQcDay" th:value="${@config.getKey('mrqc.rule.getEmr.kqyy.startQcDay')}">日-<input
                type="text" id="kqyy.endQcDay" th:value="${@config.getKey('mrqc.rule.getEmr.kqyy.endQcDay')}">日;
        </p>
        -->
        <p>
            1、每位质控员每月质控<input type="text" id="kqyy.emrsPerMonth" th:value="${@config.getKey('mrqc.rule.getEmr.kqyy.emrsPerMonth')}">份病历；
        </p>
        <p>
            2、耳鼻咽喉科三病区每月最多质控<input type="text" id="kqyy.ebyhk3bq" th:value="${@config.getKey('mrqc.rule.getEmr.kqyy.ebyhk3bq')}">份病历；
        </p>
        <p>
            3、按以下顺序优先分配病历：死亡、危重、四级手术、三级手术，若条件相同的，以住院时长作判断条件；
        </p>
        <p>
            4、质控的病区范围：<select id="kqyy.priority" class="form-control " style="display:inline;width: 500px;">
            <option value="sameAreaMode" th:selected="${@config.getKey('mrqc.rule.getEmr.kqyy.priority') == 'sameAreaMode'}">同区模式：系统只给质控员分配所在病区的病历</option>
            <option value="crossConnectionMode" th:selected="${@config.getKey('mrqc.rule.getEmr.kqyy.priority') == 'crossConnectionMode'}">顺序交叉模式：系统将二病区病历分配给一病区质控员，以此类推</option>
            <option value="randomMode" th:selected="${@config.getKey('mrqc.rule.getEmr.kqyy.priority') == 'randomMode'}">随机模式：不论病区，根据第3条规则随机分配病历</option>
            <option value="randomConnectionMode" th:selected="${@config.getKey('mrqc.rule.getEmr.kqyy.priority') == 'randomConnectionMode'}">随机交叉模式：不看自己病区,一病区质控员随机看二、三、四病区病历</option>
            
            如
        </select>
        </p>
        <p>
            5、医务处可对系统分配的病历进行调整和重新分配；如自动分配给质控员的病历不足
            <input type="text" id="kqyy.manualDistributionThreashold" th:value="${@config.getKey('mrqc.rule.getEmr.kqyy.manualDistributionThreashold')}">份，由医务处手工检索抽取后分配给质控员。
        </p>
        
    </div>
</div>
</body>
<div th:include="include :: footer"></div>
<script>
    function submitHandler() {
        var data = {};
        $('#detailQcRule input,select').each( function(index){  
        	data[this.id] = $(this).val();
        });
        
        $.ajax({
            url: prefix + "/saveDistributeRule",
            contentType: "application/json",
            data: JSON.stringify(data),
            type: 'post',
            beforeSend: function () {
                $.modal.loading("正在处理中，请稍后...");
                $.modal.disable();
            },
            success: function (result) {
                $.modal.closeLoading();
                $.modal.enable();
                if (result.code === web_status.SUCCESS) {
                    $.modal.alertSuccess("保存成功")
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                } else {
                    $.modal.alertError("保存失败，" + result.msg);
                }
            }
        });
    }
</script>
</html>
