|
|
|
@ -1,33 +1,27 @@
|
|
|
|
|
package com.emr.controller;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.emr.dao.Emr_DictionaryMapper;
|
|
|
|
|
import com.emr.dao.TPrintinfoMapper;
|
|
|
|
|
import com.emr.entity.*;
|
|
|
|
|
import com.emr.service.Archive_DetailService;
|
|
|
|
|
import com.emr.service.Archive_MasterService;
|
|
|
|
|
import com.emr.service.PushInfoService;
|
|
|
|
|
import com.emr.service.ipml.*;
|
|
|
|
|
import com.emr.util.CommonResult;
|
|
|
|
|
import com.emr.util.DateUtil;
|
|
|
|
|
import com.emr.util.ExceptionPrintUtil;
|
|
|
|
|
import com.emr.util.Msg;
|
|
|
|
|
import com.emr.vo.*;
|
|
|
|
|
import net.sf.json.JSONObject;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.cxf.endpoint.Client;
|
|
|
|
|
import org.apache.http.HttpEntity;
|
|
|
|
|
import org.apache.http.client.ClientProtocolException;
|
|
|
|
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
|
|
|
|
import org.apache.http.client.methods.HttpGet;
|
|
|
|
|
import org.apache.http.client.methods.HttpPost;
|
|
|
|
|
import org.apache.http.entity.StringEntity;
|
|
|
|
|
import org.apache.http.impl.client.CloseableHttpClient;
|
|
|
|
|
import org.apache.http.impl.client.HttpClientBuilder;
|
|
|
|
|
import org.apache.http.impl.client.HttpClients;
|
|
|
|
|
import org.apache.http.util.EntityUtils;
|
|
|
|
|
import org.apache.shiro.util.CollectionUtils;
|
|
|
|
|
import org.dom4j.Document;
|
|
|
|
|
import org.dom4j.DocumentHelper;
|
|
|
|
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -40,11 +34,12 @@ import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.ui.Model;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import javax.servlet.http.HttpSession;
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.io.StringReader;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
@ -52,13 +47,13 @@ import java.util.*;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author zwh
|
|
|
|
|
* */
|
|
|
|
|
*/
|
|
|
|
|
@Controller
|
|
|
|
|
@RequestMapping("font/")
|
|
|
|
|
public class FontController {
|
|
|
|
|
@Value("${pdfWater}")
|
|
|
|
|
private String pdfWater;
|
|
|
|
|
// @Value("${RoomDetailsUrl}")
|
|
|
|
|
// @Value("${RoomDetailsUrl}")
|
|
|
|
|
// private String RoomDetailsUrl;
|
|
|
|
|
// @Value("${RoomDetailsUrlName}")
|
|
|
|
|
// private String RoomDetailsUrlName;
|
|
|
|
@ -69,6 +64,8 @@ public class FontController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private TPrintinfoService printinfoService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private PushInfoService pushInfoService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private Archive_DetailService archiveDetailService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private Archive_MasterService archiveMasterService;
|
|
|
|
@ -808,262 +805,53 @@ public class FontController {
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// /**
|
|
|
|
|
// * 调用第三方接口获取唯一标识patientid
|
|
|
|
|
// *
|
|
|
|
|
// * @return
|
|
|
|
|
// * @throws Exception
|
|
|
|
|
// */
|
|
|
|
|
// @RequestMapping(value = "getRoomDetails")
|
|
|
|
|
// @ResponseBody
|
|
|
|
|
// public String selRoomDetails(EsbPublicVo esbPublicVo,SecureloginVo secureloginVo, HttpServletRequest request) throws Exception {
|
|
|
|
|
// //创建连接工厂
|
|
|
|
|
// String patientId1 = esbPublicVo.getPatientId();
|
|
|
|
|
// System.out.println("patientId1:::::"+patientId1);
|
|
|
|
|
// JAXDynamicClientFactory dcf = JAXDynamicClientFactory.newInstance();
|
|
|
|
|
// //创建客户端 wsUrl为webService接口地址
|
|
|
|
|
// Client client = dcf.createClient(RoomDetailsUrl);
|
|
|
|
|
// String xmlStr = createXml(patientId1);
|
|
|
|
|
// Object[] objects = client.invoke(RoomDetailsUrlName, xmlStr);
|
|
|
|
|
// //销毁连接
|
|
|
|
|
// client.destroy();
|
|
|
|
|
// //接收结果
|
|
|
|
|
// String result = objects[0].toString();
|
|
|
|
|
// System.out.println("result::::::"+result);
|
|
|
|
|
// String patientId=null;
|
|
|
|
|
// if (StringUtils.isNotBlank(result)) {
|
|
|
|
|
// Map<String, String> map = new HashMap<>();
|
|
|
|
|
// map = parseXml2Map(result, map);
|
|
|
|
|
// //获取序列号
|
|
|
|
|
// patientId = map.get("Body.ResultContent.patientid");
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// // 获得Http客户端
|
|
|
|
|
// CloseableHttpClient httpClient = HttpClientBuilder.create().build();
|
|
|
|
|
// // 创建Post请求
|
|
|
|
|
// HttpPost httpPost = new HttpPost("http://10.100.12.12:37727/api/account/securelogin");
|
|
|
|
|
// //json格式转换
|
|
|
|
|
// JSONObject jsonParam = new JSONObject();
|
|
|
|
|
// jsonParam.put("idp","NSDP");
|
|
|
|
|
// jsonParam.put("secret", "Secret");
|
|
|
|
|
// jsonParam.put("userName","002030");
|
|
|
|
|
// jsonParam.put("password", "123456");
|
|
|
|
|
// jsonParam.put("scopes", "openid profile cr-api roles");
|
|
|
|
|
// jsonParam.put("key", patientId1);
|
|
|
|
|
// System.out.println(jsonParam);
|
|
|
|
|
// StringEntity entity = new StringEntity(jsonParam.toString(), "UTF-8");
|
|
|
|
|
// httpPost.setEntity(entity);
|
|
|
|
|
// httpPost.setHeader("Content-Type","application/json");
|
|
|
|
|
// // 响应模型
|
|
|
|
|
// CloseableHttpResponse response = null;
|
|
|
|
|
// HttpEntity responseEntity=null;
|
|
|
|
|
// String token="";
|
|
|
|
|
// String s ="";
|
|
|
|
|
// try {
|
|
|
|
|
// // 由客户端执行(发送)Post请求
|
|
|
|
|
// response = httpClient.execute(httpPost);
|
|
|
|
|
// // 从响应模型中获取响应实体
|
|
|
|
|
// responseEntity=response.getEntity();
|
|
|
|
|
// System.out.println("响应状态为:" + response.getStatusLine());
|
|
|
|
|
// if (responseEntity != null) {
|
|
|
|
|
// Map<String,Object> mapType = JSON.parseObject(EntityUtils.toString(responseEntity),Map.class);
|
|
|
|
|
// token = mapType.get("token").toString();
|
|
|
|
|
// System.out.println("token:::"+token);
|
|
|
|
|
// s = StringUtils.substringAfter(token, " ");
|
|
|
|
|
// System.out.println("s:::"+s);
|
|
|
|
|
// }
|
|
|
|
|
// } catch (ClientProtocolException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// } finally {
|
|
|
|
|
// try {
|
|
|
|
|
// // 释放资源
|
|
|
|
|
// if (httpClient != null) {
|
|
|
|
|
// httpClient.close();
|
|
|
|
|
// }
|
|
|
|
|
// if (response != null) {
|
|
|
|
|
// response.close();
|
|
|
|
|
// }
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// String pdfUrl="http://10.100.12.3:33600/view/subjects/"+patientId+"/records/"+secureloginVo.getVisitId()+"?token="+s+"&token_type=Bearer";
|
|
|
|
|
// return pdfUrl;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// /* *//*
|
|
|
|
|
// * <Request>
|
|
|
|
|
// <Header>
|
|
|
|
|
// <SourceSystem>HIS</SourceSystem>
|
|
|
|
|
// <MessageId>D561C89A-6320-4b27-83DE-A6169B1D0761</MessageId>
|
|
|
|
|
// <CreateTime>2021-07-18 11:12:41</CreateTime>
|
|
|
|
|
// <MethodName>Get360PatientId</MethodName>
|
|
|
|
|
// </Header>
|
|
|
|
|
// <Body>
|
|
|
|
|
// <PatientId>0000623132</PatientId>
|
|
|
|
|
// </Body>
|
|
|
|
|
//</Request>
|
|
|
|
|
// * */
|
|
|
|
|
// public static String createXml(String patientId1) {
|
|
|
|
|
// String strXML = null;
|
|
|
|
|
// try {
|
|
|
|
|
//// Document document = DocumentHelper.createDocument();
|
|
|
|
|
//// org.dom4j.Element request = document.addElement("Request");
|
|
|
|
|
//// org.dom4j.Element header = request.addElement("Header");
|
|
|
|
|
//// org.dom4j.Element sourceSystem = header.addElement("SourceSystem");
|
|
|
|
|
//// org.dom4j.Element messageId = header.addElement("MessageId");
|
|
|
|
|
//// org.dom4j.Element createTime = header.addElement("CreateTime");
|
|
|
|
|
//// org.dom4j.Element methodName = header.addElement("MethodName");
|
|
|
|
|
//// sourceSystem.setText("record");
|
|
|
|
|
//// messageId.setText(UUID.randomUUID().toString().toUpperCase());
|
|
|
|
|
//// createTime.setText(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
|
|
//// methodName.setText("Get360PatientId");
|
|
|
|
|
//// org.dom4j.Element body = request.addElement("Body");
|
|
|
|
|
//// Element patientIdEle = body.addElement("PatientId");
|
|
|
|
|
//// patientIdEle.setText(patientId);
|
|
|
|
|
//// return document.toString();
|
|
|
|
|
// Document document = DocumentHelper.createDocument();
|
|
|
|
|
// //创建根节点
|
|
|
|
|
// Element request = document.addElement("Request");
|
|
|
|
|
// //添加子节点
|
|
|
|
|
// Element header = request.addElement("Header");
|
|
|
|
|
// //给Header标签添加子节点
|
|
|
|
|
// Element sourceSystem = header.addElement("SourceSystem");
|
|
|
|
|
// Element messageId = header.addElement("MessageId");
|
|
|
|
|
// Element createTime = header.addElement("CreateTime");
|
|
|
|
|
// Element methodName = header.addElement("MethodName");
|
|
|
|
|
// //给Request标签添加子节点
|
|
|
|
|
// Element body = request.addElement("Body");
|
|
|
|
|
// //给Body标签添加子节点
|
|
|
|
|
// Element patientIdEle = body.addElement("PatientId");
|
|
|
|
|
// //给xml赋值
|
|
|
|
|
// sourceSystem.addText("CaseSys");
|
|
|
|
|
// UUID guid = UUID.randomUUID();
|
|
|
|
|
// messageId.addText(guid.toString());
|
|
|
|
|
// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
// createTime.addText(df.format(new Date()));
|
|
|
|
|
// methodName.addText("Get360PatientId");
|
|
|
|
|
// patientIdEle.addText(patientId1);
|
|
|
|
|
// strXML = document.asXML();
|
|
|
|
|
// System.out.println("strXML:::::" + strXML);
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// System.out.println("生成rssNew.xml失败");
|
|
|
|
|
// }
|
|
|
|
|
// return strXML;
|
|
|
|
|
// }
|
|
|
|
|
// /**
|
|
|
|
|
// * 获取token
|
|
|
|
|
// * @return
|
|
|
|
|
// * @throws
|
|
|
|
|
// */
|
|
|
|
|
// @RequestMapping(value="getToken")
|
|
|
|
|
// @ResponseBody
|
|
|
|
|
// public void selToken(SecureloginVo secureloginVo, HttpServletRequest request){
|
|
|
|
|
// System.out.println(secureloginVo.getKey());
|
|
|
|
|
// // 获得Http客户端
|
|
|
|
|
// CloseableHttpClient httpClient = HttpClientBuilder.create().build();
|
|
|
|
|
// // 创建Post请求
|
|
|
|
|
// HttpPost httpPost = new HttpPost("http://10.100.12.12:37727/api/account/securelogin");
|
|
|
|
|
// secureloginVo.setIDP("NSDP");
|
|
|
|
|
// secureloginVo.setSecret("Secret");
|
|
|
|
|
//// Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");
|
|
|
|
|
//// secureloginVo.setUserName(user.getUserName());
|
|
|
|
|
// secureloginVo.setUserName("002030");
|
|
|
|
|
// secureloginVo.setPassword("123456");
|
|
|
|
|
// secureloginVo.setScopes("openid profile cr-api roles");
|
|
|
|
|
//
|
|
|
|
|
// //json格式转换
|
|
|
|
|
// String jsonString = JSON.toJSONString(secureloginVo);
|
|
|
|
|
// StringEntity entity = new StringEntity(jsonString, "UTF-8");
|
|
|
|
|
// // post请求是将参数放在请求体里面传过去的;这里将entity放入post请求体中
|
|
|
|
|
// httpPost.setEntity(entity);
|
|
|
|
|
// httpPost.setHeader("Content-Type", "application/json;charset=utf8");
|
|
|
|
|
// // 响应模型
|
|
|
|
|
// CloseableHttpResponse response = null;
|
|
|
|
|
// try {
|
|
|
|
|
// // 由客户端执行(发送)Post请求
|
|
|
|
|
// response = httpClient.execute(httpPost);
|
|
|
|
|
// // 从响应模型中获取响应实体
|
|
|
|
|
// HttpEntity responseEntity = response.getEntity();
|
|
|
|
|
// System.out.println("responseEntity::::"+responseEntity);
|
|
|
|
|
// System.out.println("响应状态为:" + response.getStatusLine());
|
|
|
|
|
// if (responseEntity != null) {
|
|
|
|
|
// System.out.println("响应内容长度为:" + responseEntity.getContentLength());
|
|
|
|
|
// System.out.println("响应内容为:" + EntityUtils.toString(responseEntity));
|
|
|
|
|
// }
|
|
|
|
|
// } catch (ClientProtocolException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// } finally {
|
|
|
|
|
// try {
|
|
|
|
|
// // 释放资源
|
|
|
|
|
// if (httpClient != null) {
|
|
|
|
|
// httpClient.close();
|
|
|
|
|
// }
|
|
|
|
|
// if (response != null) {
|
|
|
|
|
// response.close();
|
|
|
|
|
// }
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// /**
|
|
|
|
|
// * 获取二维码
|
|
|
|
|
// * @return
|
|
|
|
|
// * @throws
|
|
|
|
|
// */
|
|
|
|
|
// @RequestMapping(value="getQRcode")
|
|
|
|
|
// @ResponseBody
|
|
|
|
|
// public void getQRcode(QRcode qRcode, HttpServletRequest request) {
|
|
|
|
|
// // 获得Http客户端
|
|
|
|
|
// CloseableHttpClient httpClient = HttpClientBuilder.create().build();
|
|
|
|
|
// // 创建Post请求
|
|
|
|
|
// HttpPost httpPost = new HttpPost("https://zh.fstth.cn");
|
|
|
|
|
// qRcode.setType(3);
|
|
|
|
|
// qRcode.setProjectUid("cloudkey-fstth");
|
|
|
|
|
// qRcode.setApplicationId("fstth-wzh");
|
|
|
|
|
// //json格式转换
|
|
|
|
|
// String jsonString = JSON.toJSONString(qRcode);
|
|
|
|
|
// StringEntity entity = new StringEntity(jsonString, "UTF-8");
|
|
|
|
|
// // post请求是将参数放在请求体里面传过去的;这里将entity放入post请求体中
|
|
|
|
|
// httpPost.setEntity(entity);
|
|
|
|
|
// httpPost.setHeader("Content-Type", "application/json;charset=utf8");
|
|
|
|
|
// // 响应模型
|
|
|
|
|
// CloseableHttpResponse response = null;
|
|
|
|
|
// try {
|
|
|
|
|
// // 由客户端执行(发送)Post请求
|
|
|
|
|
// response = httpClient.execute(httpPost);
|
|
|
|
|
// // 从响应模型中获取响应实体
|
|
|
|
|
// HttpEntity responseEntity = response.getEntity();
|
|
|
|
|
// System.out.println("responseEntity::::" + responseEntity);
|
|
|
|
|
// System.out.println("响应状态为:" + response.getStatusLine());
|
|
|
|
|
// if (responseEntity != null) {
|
|
|
|
|
// System.out.println("响应内容长度为:" + responseEntity.getContentLength());
|
|
|
|
|
// System.out.println("响应内容为:" + EntityUtils.toString(responseEntity));
|
|
|
|
|
// }
|
|
|
|
|
// } catch (ClientProtocolException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// } finally {
|
|
|
|
|
// try {
|
|
|
|
|
// // 释放资源
|
|
|
|
|
// if (httpClient != null) {
|
|
|
|
|
// httpClient.close();
|
|
|
|
|
// }
|
|
|
|
|
// if (response != null) {
|
|
|
|
|
// response.close();
|
|
|
|
|
// }
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 佛山三院电子病历/护理记录接口
|
|
|
|
|
* @params:
|
|
|
|
|
* @return:
|
|
|
|
|
* @author linjj
|
|
|
|
|
* @date: 2023/12/7 15:07
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "pushInfo")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Msg pushInfo(@Valid PushInfoVo pushInfoVo) {
|
|
|
|
|
if (pushInfoVo == null) {
|
|
|
|
|
return Msg.pushFail("参数不得为空");
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isBlank(pushInfoVo.getDataType() + "")) {
|
|
|
|
|
return Msg.pushFail("提交类型不得为空");
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isBlank(pushInfoVo.getInpNo())) {
|
|
|
|
|
return Msg.pushFail("住院号不得为空");
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isBlank(pushInfoVo.getVisitId())) {
|
|
|
|
|
return Msg.pushFail("住院次数不得为空");
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isBlank(pushInfoVo.getSubmitCode())) {
|
|
|
|
|
return Msg.pushFail("提交时间不得为空");
|
|
|
|
|
}
|
|
|
|
|
if (pushInfoService.pushInfo(pushInfoVo)) {
|
|
|
|
|
return Msg.fail("成功");
|
|
|
|
|
}
|
|
|
|
|
return Msg.pushFail("失败");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "getTask")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public CommonResult GetTask(String collectid) {
|
|
|
|
|
return pushInfoService.GetTask(collectid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "repairTask")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Msg repairTask(String masterId){
|
|
|
|
|
if (StringUtils.isBlank(masterId)){
|
|
|
|
|
return Msg.pushFail("masterId不能为空");
|
|
|
|
|
}
|
|
|
|
|
if (pushInfoService.repairTask(masterId)){
|
|
|
|
|
return Msg.fail("成功");
|
|
|
|
|
}
|
|
|
|
|
return Msg.pushFail("失败");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|