|
@ -84,70 +84,47 @@ public class RPCUtil {
|
|
|
*
|
|
|
*/
|
|
|
public static void main(String[] args) {
|
|
|
// TODO Auto-generated method stub
|
|
|
String apiName = "ZEUS.HosHOPWs.GetReportInfo";
|
|
|
String apiName="";
|
|
|
String param="";
|
|
|
//获取报告单列表
|
|
|
// apiName = "ZEUS.HosHOPWs.GetReportList";
|
|
|
//param = "<Req><TransactionCode>5001</TransactionCode><Data><CardType>1</CardType><CardNo>000021341249</CardNo><IdCardNo>352103197603094519</IdCardNo><StartDate>2016-01-01</StartDate><EndDate>2016-04-05</EndDate><Mobile>1885215394</Mobile><PatientName>周春生</PatientName><ReportType>1</ReportType></Data></Req>";
|
|
|
|
|
|
// apiName = "ZEUS.HosHOPWs.QueryUserInfo";
|
|
|
String param = "<Req><TransactionCode>5001</TransactionCode><Data><ReportId>201405228-A-110B</ReportId><ReportType>0</ReportType><CardNo>000021341249</CardNo></Data></Req>";
|
|
|
String apiparam = "{\"ChannelId\"=\"" + Config.channelId + "\"," +
|
|
|
"\"ParamType\"=1," +
|
|
|
"\"Params\"=\"" + param + "\"," +
|
|
|
"\"Guid\"=\"" + "00000001111111" + "\"," +
|
|
|
"\"V\"=\"3.0.0\"," +
|
|
|
"\"OutType\"=1," +
|
|
|
"\"HospitalId\"=\"1026333\"}";
|
|
|
String result = null;
|
|
|
try {
|
|
|
result = ServiceBus.getInstance(
|
|
|
"172.18.20.21:2181",
|
|
|
"EsbCloud").call(apiName, apiparam);
|
|
|
System.out.println("返回的数据:" + result);
|
|
|
} catch (Exception e) {
|
|
|
// TODO Auto-generated catch block
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
System.out.println("result=" + result);
|
|
|
}
|
|
|
/*
|
|
|
public static void main(String[] args) {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
|
|
String data =
|
|
|
"<Req>" +
|
|
|
"<TransactionCode>yy.yygh.QueryNumbers</TransactionCode>" +
|
|
|
"<Data>" +
|
|
|
"<CardType>123</CardType>" +
|
|
|
"<CardNo>333</CardNo>" +
|
|
|
"<PatientId>333</PatientId>" +
|
|
|
"</Data>" +
|
|
|
"</Req>";
|
|
|
String SERVER_URL = "http://service.yihu.com:8080/WSGW/services/ServiceGateWay";
|
|
|
String namespace = "http://com.yihu.wsgw/ServiceGateWay";
|
|
|
String methos = "service";
|
|
|
Class[] classes = new Class[]{String.class, String.class, String.class, String.class, Integer.class, Integer.class, String.class};
|
|
|
Object[] v = new Object[7];
|
|
|
v[0] = "{ClientVersion:1,ClientId:'EsbCloud',Sign:'Sign',SessionKey:''}";//authInfo
|
|
|
v[1] = sdf.format(new Date());//sequenceNo
|
|
|
v[2] = "report.ReportWs.GetReportInfo";//api
|
|
|
v[3] = data;
|
|
|
v[4] = 1;//paramType(0: json 1: Xml)
|
|
|
v[5] = 1;//outType(0: json 1: Xml)
|
|
|
v[6] = "1.0";//API版本号
|
|
|
Object s = RPCUtil.getRPCData( classes, v);
|
|
|
try {
|
|
|
//新建RPC服务客户端
|
|
|
RPCServiceClient serviceClient = new RPCServiceClient();
|
|
|
Options options = serviceClient.getOptions();
|
|
|
//设置URL
|
|
|
EndpointReference targetEPR = new EndpointReference(SERVER_URL);
|
|
|
options.setTo(targetEPR);
|
|
|
//设置参数的类型
|
|
|
//设置namespace和方法名
|
|
|
QName opAddEntry = new QName(namespace, methos);
|
|
|
//数组的第一个值为返回值
|
|
|
String xml = (String) (serviceClient.invokeBlocking(opAddEntry, v, classes))[0];
|
|
|
System.out.println(xml);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
//检查/检验报告单
|
|
|
// apiName = "ZEUS.HosHOPWs.GetReportInfo";
|
|
|
// param = "<Req><TransactionCode>5002</TransactionCode><Data><ReportId>201405228-A-110B</ReportId><ReportType>0</ReportType><CardNo>000021341249</CardNo></Data></Req>";
|
|
|
|
|
|
//查询病人信息
|
|
|
apiName = "ZEUS.HosHOPWs.QueryUserInfo";
|
|
|
param = "<Req><TransactionCode>5003</TransactionCode><Data><CardType>1</CardType><CardNo>000021341249</CardNo><Mobile></Mobile><PatientId></PatientId></Data></Req>";
|
|
|
|
|
|
//挂号事件推送
|
|
|
// apiName = "ZEUS.HosHOPWs.PushGuaHaoEvent";
|
|
|
// param = "<Req><TransactionCode></TransactionCode><Data><EventType>事件类型:门诊、住院</EventType><EventNo>事件编码:门诊号、住院号</EventNo><CardType>证件类型</CardType><CardNo>证件号</CardNo><PatientId>病人id</PatientId></Data></Req>";
|
|
|
|
|
|
//检查/检验报告单推送
|
|
|
// apiName = "ZEUS.HosHOPWs.PushReport";
|
|
|
// param = "<Req><TransactionCode></TransactionCode><Data><CardType>卡类型</CardType><CardNo>卡号</CardNo><ReportType>报告单类型</ReportType><ReportId>报告单号</ReportId></Data></Req>";
|
|
|
|
|
|
// apiName = "ZEUS.HosHOPWs.QueryHospital";
|
|
|
// param = "<Req><TransactionCode></TransactionCode><Data><HosId>944</HosId></Data></Req>";
|
|
|
|
|
|
String apiparam = "{\"ChannelId\"=\"100123\"," + "\"ParamType\"=1,"
|
|
|
+ "\"Params\"=\"" + param + "\"," + "\"Guid\"=\""
|
|
|
+ "00000001111111" + "\"," + "\"V\"=\"3.0.0\","
|
|
|
+ "\"OutType\"=1," + "\"HospitalId\"=\"1026333\"}";
|
|
|
String result = null;
|
|
|
|
|
|
try {
|
|
|
result = ServiceBus.getInstance(
|
|
|
"172.18.20.21:2181",
|
|
|
"EsbCloud")
|
|
|
.call(apiName, apiparam);
|
|
|
} catch (Exception e) {
|
|
|
// TODO Auto-generated catch block
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
System.out.println("result=" + result);
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
}
|