|
@ -11,8 +11,10 @@ import net.sf.json.JSON;
|
|
|
import net.sf.json.JSONObject;
|
|
|
import net.sf.json.xml.XMLSerializer;
|
|
|
import org.dom4j.Document;
|
|
|
import org.dom4j.DocumentHelper;
|
|
|
import org.dom4j.Element;
|
|
|
import org.dom4j.io.SAXReader;
|
|
|
import org.jdom2.input.SAXBuilder;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@ -21,6 +23,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.StringReader;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.LinkedList;
|
|
@ -51,9 +54,10 @@ public class QLCController {
|
|
|
@ApiParam(value = "PatientId", required = true) @RequestParam(value = "PatientId") String PatientId,
|
|
|
@ApiParam(value = "医院ID", required = true) @RequestParam(value = "HospitalId") String HospitalId,
|
|
|
HttpServletRequest request) {
|
|
|
String returnMessage = "成功";
|
|
|
try {
|
|
|
String param = "<Req><TransactionCode>5001</TransactionCode><Data><CardType>" + CardType + "</CardType><CardNo>" + CardNo + "</CardNo><PatientId>" + PatientId + "</PatientId></Data></Req>";
|
|
|
String apiparam = "{\"ChannelId\"=\"\"+Config.channelId+\"\"," +
|
|
|
String apiparam = "{\"ChannelId\"=\"" + Config.channelId + "\"," +
|
|
|
"\"ParamType\"=1," +
|
|
|
"\"Params\"=\"" + param + "\"," +
|
|
|
"\"Guid\"=\"" + "00000001111111" + "\"," +
|
|
@ -63,9 +67,9 @@ public class QLCController {
|
|
|
Object s = RPCUtil.getRPCData("ZEUS.HosHOPWs.QueryUserInfo", apiparam);
|
|
|
//解析xml
|
|
|
SAXReader saxReader = new SAXReader();
|
|
|
Document document = saxReader.read(s.toString());
|
|
|
Document document = DocumentHelper.parseText(s.toString());
|
|
|
Element root = document.getRootElement();
|
|
|
if ("10000".equals(root.element("RespCode"))) {
|
|
|
if ("10000".equals(root.element("RespCode").getText())) {
|
|
|
//xml轉json
|
|
|
Element dataXML = root.element("Data");
|
|
|
JSONObject obj = xml2json(root.element("Data"));
|
|
@ -84,16 +88,19 @@ public class QLCController {
|
|
|
params.put("cardNo", CardNo);
|
|
|
params.put("eventNo", PatientId);
|
|
|
httpClientUtil.doPost(Config.startCollect, params, null, null);
|
|
|
} else {
|
|
|
returnMessage = "RPC返回RespCode:" + root.element("RespCode").getText();
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return e.getMessage();
|
|
|
}
|
|
|
return "成功";
|
|
|
return returnMessage;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 院方_检查/检验报告单推送---数据说明
|
|
|
* localhost:8890/gateway/transfer?api=patientInformationPush¶m={CardType:"",CardNo:"",ReportType:"",ReportId:"",State:"",HospitalId:""}&requestId="目前没用随便写"
|
|
|
* localhost:8890/gateway/transfer?api=patientInformationPush¶m={CardType:"",CardNo:"",ReportType:"",ReportId:"",State:"",HospitalId:""}&requestId="目前没用随便写"
|
|
|
*/
|
|
|
@RequestMapping(value = "/patientInformation", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "检查/检验报告单推送-", response = Object.class, produces = "application/json", notes = "检查/检验报告单推送-")
|
|
@ -104,6 +111,7 @@ public class QLCController {
|
|
|
@ApiParam(value = "报告单状态1 报告未出 2报告已出", required = true) @RequestParam(value = "State") String State,
|
|
|
@ApiParam(value = "医院ID", required = true) @RequestParam(value = "HospitalId") String HospitalId,
|
|
|
HttpServletRequest request) {
|
|
|
String returnMessage = "成功";
|
|
|
try {
|
|
|
if ("1".equals(State)) {
|
|
|
return "报告未出,结束 ";
|
|
@ -111,7 +119,7 @@ public class QLCController {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
|
|
String data =
|
|
|
"<Req><TransactionCode>5001</TransactionCode><Data><CardNo>" + CardNo + "</CardNo><ReportId>" + ReportId + "</ReportId><ReportType>" + ReportType + "</ReportType></Data></Req>";
|
|
|
String apiparam = "{\"ChannelId\"=\"\"+Config.channelId+\"\"," +
|
|
|
String apiparam = "{\"ChannelId\"=\"" + Config.channelId + "\"," +
|
|
|
"\"ParamType\"=1," +
|
|
|
"\"Params\"=\"" + data + "\"," +
|
|
|
"\"Guid\"=\"" + "00000001111111" + "\"," +
|
|
@ -120,10 +128,11 @@ public class QLCController {
|
|
|
"\"HospitalId\"=\"" + HospitalId + "\"}";
|
|
|
Object s = RPCUtil.getRPCData("ZEUS.HosHOPWs.GetReportInfo", apiparam);
|
|
|
//解析xml
|
|
|
SAXReader saxReader = new SAXReader();
|
|
|
Document document = saxReader.read(s.toString());
|
|
|
SAXReader saxReader = new SAXReader(false);
|
|
|
Document document = DocumentHelper.parseText(s.toString());
|
|
|
Element root = document.getRootElement();
|
|
|
if ("10000".equals(root.element("RespCode"))) {
|
|
|
System.out.println(root.element("RespCode").getText());
|
|
|
if ("10000".equals(root.element("RespCode").getText())) {
|
|
|
//xml轉json
|
|
|
JSONObject obj = new JSONObject();
|
|
|
//得到Data节点
|
|
@ -156,11 +165,14 @@ public class QLCController {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
} else {
|
|
|
returnMessage = "RPC返回RespCode:" + root.element("RespCode").getText();
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return e.getMessage();
|
|
|
}
|
|
|
return "成功";
|
|
|
return returnMessage;
|
|
|
}
|
|
|
|
|
|
/**
|