package thyyxxk.webserver.service.zhuyuanyisheng.emr;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import thyyxxk.webserver.config.exception.ExceptionEnum;
import thyyxxk.webserver.constants.Message;
import thyyxxk.webserver.dao.his.zhuyuanyisheng.emr.EmrControlDaoV2;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.socketmessage.ApiMessageBody;
import thyyxxk.webserver.entity.zhuyuanyisheng.emr.EmrAuditDetail;
import thyyxxk.webserver.entity.zhuyuanyisheng.emr.EmrProgressNote;
import thyyxxk.webserver.entity.zhuyuanyisheng.emr.EmrRuleData;
import thyyxxk.webserver.entity.zhuyuanyisheng.emr.ProblemQualityControl;
import thyyxxk.webserver.entity.zhuyuanyisheng.emrcontrolrule.EmrRuleV2;
import thyyxxk.webserver.entity.zhuyuanyisheng.emrcontrolrule.FinalQuery;
import thyyxxk.webserver.entity.zhuyuanyisheng.emrcontrolrule.QualityControlAnalysisOfMedicalRecords;
import thyyxxk.webserver.service.externalhttp.WebSocketService;
import thyyxxk.webserver.service.externalhttp.emr.EmrEditor;
import thyyxxk.webserver.utils.*;

import javax.websocket.Session;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;

@Service
@Slf4j
public class EmrControlRuleSeverV2 {
    private final EmrControlDaoV2 dao;

    public EmrControlRuleSeverV2(EmrControlDaoV2 dao) {
        this.dao = dao;
    }

    public ResultVo<List<EmrAuditDetail>> myPatientQualityControl() {
        List<EmrAuditDetail> list = dao.getUnprocessedRecommendationsByDoctor(TokenUtil.getInstance().getTokenUserId());
        return ResultVoUtil.success(list);
    }
}
