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

import com.lantone.qc.kernel.catalogue.QCCatalogue;
import com.lantone.qc.pub.model.InputInfo;
import com.lantone.qc.pub.model.OutputInfo;
import com.lantone.qc.pub.model.entity.Lis;
import com.lantone.qc.pub.model.entity.Medicine;
import com.lantone.qc.pub.model.entity.Operation;
import com.lantone.qc.pub.model.entity.Pacs;
import com.lantone.qc.pub.model.entity.Treat;
import com.lantone.qc.pub.model.label.PresentLabel;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * @ClassName : BEH0023
 * @Description :  现病史未描述入院前有无相关治疗检查
 * @Author : 楼辉荣
 * @Date: 2020-03-06 17:28
 */
@Component
public class BEH0023 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        if (inputInfo.getBeHospitalizedDoc() == null) {
            return;
        }
        PresentLabel presentLabel = inputInfo.getBeHospitalizedDoc().getPresentLabel();
        if (presentLabel == null) {
            return;
        }
        List<Lis> lises = presentLabel.getLises();
        List<Pacs> pacses = presentLabel.getPacses();
        List<Treat> treats = presentLabel.getTreats();
        List<Operation> operations = presentLabel.getOperations();
        List<Medicine> medicines = presentLabel.getMedicines();
        if (lises.size() == 0 && pacses.size() == 0 && treats.size() == 0 && operations.size() == 0 && medicines.size() == 0) {
            status.set("-1");
        }
        //添加硬规则
        if (inputInfo.getBeHospitalizedDoc().getPresentLabel().getText().contains("未予以重视")) {
            status.set("0");
        }
    }
}