package com.lantone.qc.kernel.catalogue.threelevelward;

import com.lantone.qc.kernel.catalogue.QCCatalogue;
import com.lantone.qc.kernel.util.CatalogueUtil;
import com.lantone.qc.pub.Content;
import com.lantone.qc.pub.model.InputInfo;
import com.lantone.qc.pub.model.OutputInfo;
import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
import com.lantone.qc.pub.util.StringUtil;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @ClassName : THR0698
 * @Description : 查房记录无记录时间
 * @Author : 胡敬
 * @Date: 2020-04-20 15:23
 */
@Component
public class THR0698 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
        if (threeLevelWardDocs.size() == 0) {
            status.set("0");
            return;
        }
        List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDocs.get(0).getAllDoctorWradDocs();
        if (allDoctorWradDocs.size() == 0) {
            status.set("0");
            return;
        }
        List<ThreeLevelWardDoc> recordDoctorList = allDoctorWradDocs
                .stream()
                .filter(doc -> StringUtil.isBlank(doc.getStructureMap().get("记录时间")))
                .collect(Collectors.toList());
        if (recordDoctorList.size() == 0) {
            status.set("0");
        }

    }
}