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

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.doc.LeaveHospitalDoc;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import java.text.ParseException;
import java.util.Map;

/**
 * @author kwz
 * 出院记录无副主任/主任医师签名
 * @date 2020/4/7
 * @time 21:42
 */
@Component
public class LEA0508 extends QCCatalogue {
    @Override
    public void start(InputInfo inputInfo, OutputInfo outputInfo) throws ParseException {
        status.set("0");
        LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
        if (leaveHospitalDoc == null) {
            return;
        }
        Map<String, String> structureMap = leaveHospitalDoc.getStructureMap();
        if (structureMap != null) {
            if (StringUtils.isEmpty(structureMap.get("医师签名"))) {
                status.set("-1");
            }
        }
    }
}
