package com.lantone.qc.kernel.structure.ai;

import com.lantone.qc.kernel.client.CRFServiceClient;
import com.lantone.qc.kernel.client.SimilarityServiceClient;
import com.lantone.qc.kernel.structure.ai.model.CrfOut;
import com.lantone.qc.pub.model.InputInfo;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class AIAnalyze {

    private CRFServiceClient crfServiceClient;
    private SimilarityServiceClient similarityServiceClient;
    BeHospitalizedAI beHospitalizedAI = new BeHospitalizedAI();
    FirstCourseRecordAI firstCourseRecordAI = new FirstCourseRecordAI();
    LeaveHospitalAI leaveHospitalAI = new LeaveHospitalAI();
    ThreeLevelWardAI threeLevelWardAI = new ThreeLevelWardAI();
    OperationAI operationAI = new OperationAI();

    public AIAnalyze(CRFServiceClient crfService, SimilarityServiceClient similarityServiceClient) {
        this.crfServiceClient = crfService;
        this.similarityServiceClient = similarityServiceClient;
    }

    public void aiProcess(InputInfo inputInfo) {
        long start = System.currentTimeMillis();
        beHospitalizedAI.medrec(inputInfo, crfServiceClient);
        long end = System.currentTimeMillis();
        System.out.println("入院记录 AI处理....." + (end - start));
        start = System.currentTimeMillis();

        firstCourseRecordAI.medrec(inputInfo, crfServiceClient, similarityServiceClient);
        end = System.currentTimeMillis();
        System.out.println("首次病程录 AI处理....." + (end - start));
        start = System.currentTimeMillis();

        leaveHospitalAI.medrec(inputInfo, crfServiceClient);
        end = System.currentTimeMillis();
        System.out.println("出院小结 AI处理....." + (end - start));
        start = System.currentTimeMillis();

        threeLevelWardAI.medrec(inputInfo, crfServiceClient);
        end = System.currentTimeMillis();
        System.out.println("三级查房 AI处理....." + (end - start));
        start = System.currentTimeMillis();

        operationAI.medrec(inputInfo, crfServiceClient);
        end = System.currentTimeMillis();
        System.out.println("手术 AI处理....." + (end - start));
    }


}
