package com.docus.server.report.webservice.impl;

import com.docus.server.report.webservice.IReportServer;
import com.docus.server.report.webservice.WebserviceMessageType;
import com.docus.server.report.webservice.WebserviceReceiveServerHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author wyb
 * @date 2023年3月3日13:42:36
 */
@Service
@Slf4j
public class SdryReportServerImpl implements IReportServer {

    @Autowired
    private Map<String,WebserviceReceiveServerHandler> webserviceReceiveServerHandler=new ConcurrentHashMap<>();

    @Override
    public String pushSAReport(String saReportMessage) {
       return webserviceReceiveServerHandler.get(WebserviceMessageType.SA).handle(saReportMessage);
    }

    @Override
    public String pushICUReport(String icuReportMessage) {
        return webserviceReceiveServerHandler.get(WebserviceMessageType.ICU).handle(icuReportMessage);
    }

    @Override
    public String pushExaminationReport(String examinationReportMessage){
        return webserviceReceiveServerHandler.get(WebserviceMessageType.LABORATORY).handle(examinationReportMessage);
    }

    @Override
    public String pushAddInspectionReport(String inspectionReportMessage) {
        return webserviceReceiveServerHandler.get(WebserviceMessageType.HIP1008).handle(inspectionReportMessage);
    }

    @Override
    public String pushUpdateInspectionReport(String inspectionReportMessage) {
        return webserviceReceiveServerHandler.get(WebserviceMessageType.HIP1009).handle(inspectionReportMessage);
    }

    @Override
    public String pdfUpload(String uploadMessage) {
        return webserviceReceiveServerHandler.get(WebserviceMessageType.HIP1166).handle(uploadMessage);
    }

    @Override
    public String pushAddLaboratoryReport(String laboratoryMessage) {
        return webserviceReceiveServerHandler.get(WebserviceMessageType.HIP1010).handle(laboratoryMessage);

    }

    @Override
    public String pushUpdateLaboratoryReport(String laboratoryMessage) {
        return webserviceReceiveServerHandler.get(WebserviceMessageType.HIP1011).handle(laboratoryMessage);
    }

    @Override
    public String pushMaternalInfantRelationship(String maternalInfantRelationshipMessage) {
        return webserviceReceiveServerHandler.get(WebserviceMessageType.HIP1264).handle(maternalInfantRelationshipMessage);
    }
}
