package com.ann.demo.controller;

import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;

public class EatThread extends Thread {
    @Override
    public void run() {
        JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
        Client client = dcf.createClient("http://localhost:8080/services/HomepageDictionary?wsdl");
        Object[] objects = new Object[0];
        try {
            // invoke("方法名",参数1,参数2,参数3....);
            //
            objects = client.invoke("HIPMessageServer","InPatientAddRequest", "<PRPA_IN402001UV02 ITSVersion='XML_1.0' xsi:schemaLocation='urn:hl7-org:v3 ../../Schemas/PRPA_IN402001UV.xsd' xmlns='urn:hl7-org:v3' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> <id root='1.2.156.112698.1.1.3.3' extension='3C226305-3D91-4AEE-9B9A-CEB654D83367'/> <creationTime value='20191107084809'/> <interactionId root='2.16.840.1.113883.1.6' extension='PRPA_IN402001UV02'/> <processingCode code='P'/> <processingModeCode code='T'/> <acceptAckCode code='AL'/> <receiver typeCode='RCV'> <device classCode='DEV' determinerCode='INSTANCE'> <id> <item root='1.2.156.112698.1.1.1' extension='JHIP'/> </id> </device> </receiver> <sender typeCode='SND'> <device classCode='DEV' determinerCode='INSTANCE'> <id> <item root='1.2.156.112698.2.1.1' extension='HIS'/> </id> </device> </sender> <controlActProcess classCode='CACT' moodCode='EVN'> <code code='new'/> <subject typeCode='SUBJ'> <inpatientEncounterEvent classCode='ENC' moodCode='EVN '> <id> <item extension='2' root='1.2.156.112698.1.1.2.1.22'/> <item extension='02_000579337900' root='1.2.156.112698.1.1.2.1.21'/> </id> <code codeSystem='1.2.156.112698.1.1.1.4.10' code=''> <displayName value=''/> </code> <statusCode code='active'/> <effectiveTime> <any value='20191107084559'/> </effectiveTime> <nursing code='' value=''/> <babyflag value='0'/> <daytimesurgeryflag value='0'/> <priorityCode code='' codeSystem='1.2.156.112698.1.1.1.4.26'> <displayName value=''/> </priorityCode> <reasonCode> <item> <displayName value=''/> </item> </reasonCode> <specialCourtesiesCode> <item code='' codeSystem='1.2.156.112698.1.1.1.3.19'> <displayName value=''/> </item> <item code='9n' codeSystem='1.2.156.112698.1.1.1.3.14'> <displayName value='城镇居民基本医保'/> </item> <item code='05' codeSystem='1.2.156.112698.1.1.1.3.13'> <displayName value='公费'/> </item> </specialCourtesiesCode> <subject typeCode='SBJ'> <patient classCode='PAT '> <id> <item root='1.2.156.112698.1.1.2.1.5' extension='02'/> <item root='1.2.156.112698.1.1.2.1.6' extension='000579337900'/> <item root='1.2.156.112698.1.1.2.1.21' extension='02_000579337900'/> <item root='1.2.156.112698.1.1.2.1.2' extension='1424490"+System.currentTimeMillis()+"'/> </id> <addr use='BAG_AD'> <item use='TMP'> <part type='BNR' value='神经外科(2区)' code='1130200' codeSystem='1.2.156.112698.1.1.1.4.7'/> <part type='CAR' value='024'/> </item> </addr> <patientPerson> <name>庞金子</name> <administrativeGenderCode code='2' codeSystem='1.2.156.112698.1.1.1.2.1'/> <birthTime value='19711214000000'> <originalText value='48岁'/> </birthTime> <birthPlace> <birthplace classCode='PLC' determinerCode='INSTANCE'> <addr use='H'> <part code='' value=''/> </addr> </birthplace> </birthPlace> </patientPerson> <providerOrganization classCode='ORG' determinerCode='INSTANCE'> <id/> <asOrganizationPartOf classCode='PART'> <wholeOrganization classCode='ORG' determinerCode='INSTANCE'> <id> <item extension='12440000455858169P'/> </id> <name/> </wholeOrganization> </asOrganizationPartOf> </providerOrganization> </patient> </subject> <responsibleParty typeCode='RESP'> <time/> <assignedOrganization classCode='ASSIGNED'> <representedOrganization classCode='ORG' determinerCode='INSTANCE'> <id/> <contactParty classCode='CON'> <id> <item root='1.2.156.112698.1.1.1.4.2' extension=''/> </id> <contactPerson classCode='PSN' determinerCode='INSTANCE'> <name/> </contactPerson> </contactParty> </representedOrganization> </assignedOrganization> </responsibleParty> <admitter typeCode='ADM '> <time/> <assignedPerson classCode='ASSIGNED'> <id> <item root='1.2.156.112698.1.1.1.4.2' extension='09046'/> </id> <assignedPerson classCode='PSN' determinerCode='INSTANCE'> <name>黄梓雄</name> </assignedPerson> </assignedPerson> </admitter> <attender typeCode='ATND '> <time/> <assignedPerson classCode='ASSIGNED'> <id> <item root='1.2.156.112698.1.1.1.4.2' extension=''/> </id> <assignedPerson classCode='PSN' determinerCode='INSTANCE'> <name/> </assignedPerson> </assignedPerson> </attender> <location typeCode='DST'> <time/> <statusCode/> <serviceDeliveryLocation classCode='DSDLOC '> <id> <item root='1.2.156.112698.1.1.1.4.1' extension='1130200'/> </id> <name>神经外科(2区)</name> </serviceDeliveryLocation> </location> <inFulfillmentOf typeCode='FLFS'> <actAppointment classCode='ACT' moodCode='APT'> <id extension=''/> <subject typeCode='SBJ'> <patient classCode='PAT'> <id/> <patientPerson> <name use='BAG_EN'/> </patientPerson> </patient> </subject> </actAppointment> </inFulfillmentOf> <reason typeCode='RSON'> <observationDx classCode='OBS ' moodCode='EVN '> <code code='' codeSystem='1.2.156.112698.1.1.1.3.11'> <displayName value=''/> </code> <statusCode code='completed'/> <value code='I60.801' codeSystem='1.2.156.112698.1.1.1.1.2'> <displayName value='脑动静脉畸形破裂伴蛛网膜下腔出血'/> </value> </observationDx> </reason> </inpatientEncounterEvent> </subject> </controlActProcess> </PRPA_IN402001UV02>");
            System.out.println("成功");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
