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

import com.docus.server.collection.webservice.BasicService;
import com.docus.server.collection.webservice.IDeptServer;
import com.docus.server.collection.webservice.IUserServer;
import com.docus.server.collection.webservice.ReceiveServer;
import com.docus.server.report.webservice.IReportServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @BelongsProject: docus-webservice-sdry
 * @BelongsPackage: com.docus.server.collection.webservice.impl
 * @Author: chierhao
 * @CreateTime: 2023-02-27  10:02
 * @Description: TODO
 * @Version: 1.0
 */
@Service
@Slf4j
public class ReceiveServerImpl implements ReceiveServer {
    @Resource
    private  IUserServer userServer;
    @Resource
    private  IDeptServer deptServer;
    @Resource
    private BasicService basicService;
    @Resource
    private IReportServer reportServer;


    @Override
    public String deptModify(String receiveDept) {
        return deptServer.deptModify(receiveDept);
    }

    @Override
    public String setTBasic(String str) {
        return basicService.setTBasic(str);
    }

    @Override
    public String updateTBasic(String str) {
        return basicService.updateTBasic(str);
    }

    @Override
    public String setAdmissTBasic(String message) {
        return basicService.setAdmissTBasic(message);
    }

    @Override
    public String updateAdmissTBasic(String message) {
        return basicService.updateAdmissTBasic(message) ;
    }

    @Override
    public String userModify(String receiveUser) {
        return userServer.userModify(receiveUser);
    }




    @Override
    public String pushICUReport(String icuReportMessage) {
        return reportServer.pushICUReport(icuReportMessage);
    }

    @Override
    public String pushExaminationReport(String examinationReportMessage) {
        return reportServer.pushExaminationReport(examinationReportMessage);
    }
    @Override
    public String pdfUpload(String uploadMessage) {
        return reportServer.pdfUpload(uploadMessage);
    }

    @Override
    public String pushAddInspectionReport(String inspectionReportMessage) {
        return reportServer.pushAddInspectionReport(inspectionReportMessage);
    }

    @Override
    public String pushUpdateInspectionReport(String inspectionReportMessage) {
        return reportServer.pushUpdateInspectionReport(inspectionReportMessage);
    }

    @Override
    public String pushAddLaboratoryReport(String laboratoryMessage) {
        return reportServer.pushAddLaboratoryReport(laboratoryMessage);
    }

    @Override
    public String pushUpdateLaboratoryReport(String laboratoryMessage) {
        return reportServer.pushUpdateLaboratoryReport(laboratoryMessage);
    }

    @Override
    public String pushMaternalInfantRelationship(String maternalInfantRelationshipMessage) {
        return reportServer.pushMaternalInfantRelationship(maternalInfantRelationshipMessage);
    }

    @Override
    public String querySdJxIndexTest(String xml) {
        System.out.println("收到那个人想查报告的动机，参数为："+xml);
        return "<PRPA_HIP1179 xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ITSVersion=\"XML_1.0\" xmlns=\"urn:hl7-org:v3\" xsi:schemaLocation=\"urn:hl7-org:v3 ../multicacheschemas/PRPA_IN201306UV02.xsd\">\n" +
                "\t<id root=\"2.16.156.10011.0\" extension=\"8D73520B-D489-4B70-8F4B-7B5C2D7961B5\"/>\n" +
                "\t<creationTime value=\"20120101010101\"/>\n" +
                "\t<interactionId root=\"2.16.840.1.113883.1.6\" extension=\"PRPA_HIP1179\"/>\n" +
                "\t<processingCode code=\"P\"/>\n" +
                "\t<processingModeCode/>\n" +
                "\t<acceptAckCode code=\"AL\"/>\n" +
                "\t<receiver typeCode=\"RCV\">\n" +
                "\t\t<telecom/>\n" +
                "\t\t<device classCode=\"DEV\" determinerCode=\"INSTANCE\">\n" +
                "\t\t\t<id>\n" +
                "\t\t\t\t<item root=\"2.16.156.10011.0.1.1\" extension=\"Orion-001\"/>\n" +
                "\t\t\t</id>\n" +
                "\t\t</device>\n" +
                "\t</receiver>\n" +
                "\t<sender typeCode=\"SND\">\n" +
                "\t\t<telecom/>\n" +
                "\t\t<device classCode=\"DEV\" determinerCode=\"INSTANCE\">\n" +
                "\t\t\t<id>\n" +
                "\t\t\t\t<item root=\"2.16.156.10011.0.1.2\" extension=\"\"/>\n" +
                "\t\t\t</id>\n" +
                "\t\t</device>\n" +
                "\t</sender>\n" +
                "\t<acknowledgement typeCode=\"AA\">\n" +
                "\t\t<targetMessage>\n" +
                "\t\t\t<id root=\"2.16.156.10011.0\" extension=\"22a0f9e0-4454-11dc-a6be-3603d6866807\"/>\n" +
                "\t\t</targetMessage>\n" +
                "\t\t<acknowledgementDetail>\n" +
                "\t\t\t<text value=\"处理结果说明\"/>\n" +
                "\t\t</acknowledgementDetail>\n" +
                "\t</acknowledgement>\n" +
                "\t<controlActProcess classCode=\"CACT\" moodCode=\"EVN\">\n" +
                "\t\t<subject typeCode=\"SUBJ\">\n" +
                "\t\t\t<!-- 交叉索引信息 -->\n" +
                "\t\t\t<empiIndex>\n" +
                "\t\t\t\t<patientIds>\n" +
                "\t\t\t\t\t<!--patientId节点循环（有多个）-->\n" +
                "\t\t\t\t\t<patientId>ceshi1</patientId>\n" +
                "\t\t\t\t\t<patientId>ceshi2</patientId>\n" +
                "\t\t\t\t\t<patientId>ceshi3</patientId>\n" +
                "\t\t\t\t</patientIds>\n" +
                "\t\t\t\t<idCards>\n" +
                "\t\t\t\t\t<!-- type：卡类型 value：卡号 name：患者姓名-->\n" +
                "\t\t\t\t\t<idCard type=\"居民身份证\" value=\"xxx\" name=\"xxx\"/>\n" +
                "\t\t\t\t</idCards>\n" +
                "\t\t\t</empiIndex>\n" +
                "\t\t</subject>\n" +
                "\t</controlActProcess>\n" +
                "</PRPA_HIP1179>\n";
    }

    @Override
    public String querySdJxIndexNoResultTest(String xml) {
        System.out.println("收到那个人想查报告的动机，参数为："+xml);
        return "<PRPA_HIP1179 xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ITSVersion=\"XML_1.0\" xmlns=\"urn:hl7-org:v3\" xsi:schemaLocation=\"urn:hl7-org:v3 ../multicacheschemas/PRPA_IN201306UV02.xsd\">\n" +
                "\t<id root=\"2.16.156.10011.0\" extension=\"8D73520B-D489-4B70-8F4B-7B5C2D7961B5\"/>\n" +
                "\t<creationTime value=\"20120101010101\"/>\n" +
                "\t<interactionId root=\"2.16.840.1.113883.1.6\" extension=\"PRPA_HIP1179\"/>\n" +
                "\t<processingCode code=\"P\"/>\n" +
                "\t<processingModeCode/>\n" +
                "\t<acceptAckCode code=\"AL\"/>\n" +
                "\t<receiver typeCode=\"RCV\">\n" +
                "\t\t<telecom/>\n" +
                "\t\t<device classCode=\"DEV\" determinerCode=\"INSTANCE\">\n" +
                "\t\t\t<id>\n" +
                "\t\t\t\t<item root=\"2.16.156.10011.0.1.1\" extension=\"Orion-001\"/>\n" +
                "\t\t\t</id>\n" +
                "\t\t</device>\n" +
                "\t</receiver>\n" +
                "\t<sender typeCode=\"SND\">\n" +
                "\t\t<telecom/>\n" +
                "\t\t<device classCode=\"DEV\" determinerCode=\"INSTANCE\">\n" +
                "\t\t\t<id>\n" +
                "\t\t\t\t<item root=\"2.16.156.10011.0.1.2\" extension=\"\"/>\n" +
                "\t\t\t</id>\n" +
                "\t\t</device>\n" +
                "\t</sender>\n" +
                "\t<acknowledgement typeCode=\"AA\">\n" +
                "\t\t<targetMessage>\n" +
                "\t\t\t<id root=\"2.16.156.10011.0\" extension=\"22a0f9e0-4454-11dc-a6be-3603d6866807\"/>\n" +
                "\t\t</targetMessage>\n" +
                "\t\t<acknowledgementDetail>\n" +
                "\t\t\t<text value=\"处理结果说明\"/>\n" +
                "\t\t</acknowledgementDetail>\n" +
                "\t</acknowledgement>\n" +
                "\t<controlActProcess classCode=\"CACT\" moodCode=\"EVN\">\n" +
                "\t\t<subject typeCode=\"SUBJ\">\n" +
                "\t\t\t<!-- 交叉索引信息 -->\n" +
                "\t\t\t<empiIndex>\n" +
                "\t\t\t\t<patientIds>\n" +
                "\t\t\t\t\t<!--patientId节点循环（有多个）-->\n" +
                "\t\t\t\t</patientIds>\n" +
                "\t\t\t\t<idCards>\n" +
                "\t\t\t\t\t<!-- type：卡类型 value：卡号 name：患者姓名-->\n" +
                "\t\t\t\t\t<idCard type=\"居民身份证\" value=\"xxx\" name=\"xxx\"/>\n" +
                "\t\t\t\t</idCards>\n" +
                "\t\t\t</empiIndex>\n" +
                "\t\t</subject>\n" +
                "\t</controlActProcess>\n" +
                "</PRPA_HIP1179>\n";
    }
}
