| | |
| | | import com.ltkj.hosp.sqlDomain.LtkjExamJcbgd; |
| | | import com.ltkj.hosp.sqlDomain.LtkjExamJcsqd; |
| | | import com.ltkj.system.service.ISysDeptService; |
| | | import com.sun.jna.platform.win32.WinDef; |
| | | import com.sun.org.apache.xpath.internal.operations.Bool; |
| | | import jodd.util.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.InputStreamReader; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | |
| | | /** |
| | | * @Company: 西安路泰科技有限公司 |
| | |
| | | @Autowired |
| | | private LtkjExamJcbgdService ltkjExamJcbgdService; |
| | | |
| | | // 体检开检查申请单调用此接口推送给pacs服务 |
| | | public boolean OrderAdd(String tjNumber) |
| | | { |
| | | try { |
| | | //从体检数据库中查询出申请单数据 调用 pacs webservice 接口 OrderAdd实现申请单推送 |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | if (true){ |
| | | HashMap<String, Object> result = new HashMap<>(); |
| | | // result.put("PatientId",0); |
| | | // result.put("PatType","PatType"); |
| | | // result.put("Operator","Operator"); |
| | | // result.put("HisID","HisID"); |
| | | |
| | | hashMap.put("Root",result); |
| | | } |
| | | return ComSjyjtPacs(XmlUtil.mapToXmlStr(hashMap)); |
| | | }catch (Exception ex) |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | // 体检撤销申请单后调用此接口撤销pacs申请单 |
| | | public boolean OrderDelete(String tjNumber) |
| | | { |
| | | //入参字段 |
| | | // <PatientId> HIS或体检病人ID </PatientId> |
| | | // <PatType>病人类型</PatType > |
| | | // <Operator>操作人工号</Operator> |
| | | // <HisID>HIS或体检申请单号</HisID> |
| | | try { |
| | | //从体检数据库中查询出申请单数据 调用 pacs webservice 接口 OrderAdd实现申请单推送 |
| | | |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | if (null == null){ |
| | | HashMap<String, Object> result = new HashMap<>(); |
| | | result.put("PatientId",0); |
| | | result.put("PatType","PatType"); |
| | | result.put("Operator","Operator"); |
| | | result.put("HisID","HisID"); |
| | | |
| | | hashMap.put("Root",result); |
| | | } |
| | | return ComSjyjtPacs(XmlUtil.mapToXmlStr(hashMap)); |
| | | }catch (Exception ex) |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | // 陕健医集团调用pacs接口Webservice |
| | | public boolean ComSjyjtPacs(String inputLine) |
| | | { |
| | | String apiUrl = "http://100.100.100.222:8000/WebInterfaceService.asmx"; // 替换为你的API URL |
| | | |
| | | try { |
| | | URL url = new URL(apiUrl); |
| | | HttpURLConnection connection = (HttpURLConnection) url.openConnection(); |
| | | connection.setRequestMethod("GET"); |
| | | |
| | | int responseCode = connection.getResponseCode(); |
| | | if (responseCode == HttpURLConnection.HTTP_OK) { |
| | | BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream())); |
| | | |
| | | StringBuffer response = new StringBuffer(); |
| | | |
| | | while ((inputLine = in.readLine()) != null) { |
| | | response.append(inputLine); |
| | | } |
| | | |
| | | in.close(); |
| | | |
| | | // 打印结果 |
| | | System.out.println(response.toString()); |
| | | } else { |
| | | // System.out.println("ComSjyjtPacs陕健医集团调用pacs接口Webservice调用失败!”); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return true; |
| | | |
| | | } |
| | | |
| | | |
| | | @PostMapping("InvokeRisService") |
| | | public String InvokeRisService(String dataSourceName, String action, String message) |
| | | { |
| | | |
| | | String rusue=null; |
| | | switch (StringUtil.toLowerCase(action) ) |
| | | { |
| | | case "qeryorder": |
| | | return queryOrder(dataSourceName); |
| | | rusue= queryOrder(dataSourceName); |
| | | break; |
| | | case "updateorderstatus": |
| | | updateOrderstatus(dataSourceName); |
| | | rusue= updateOrderstatus(dataSourceName); |
| | | break; |
| | | case "reportverifyupload": |
| | | return reportVerifyUpload(dataSourceName); |
| | | rusue= reportVerifyUpload(dataSourceName); |
| | | break; |
| | | |
| | | } |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | // <Code>执行状态 执行状态 1 成功, 0失败</Code> |
| | | // <Message>结果消息</Message> |
| | | HashMap<String, Object> result = new HashMap<>(); |
| | | if(rusue==null) |
| | | { |
| | | result.put("Code", 1); |
| | | result.put("Message", "接口成功"); |
| | | } |
| | | else { |
| | | result.put("Code", 0); |
| | | result.put("Message", rusue); |
| | | } |
| | | hashMap.put("ResultInfor", result); |
| | | return XmlUtil.mapToXmlStr(hashMap); |
| | | } |
| | | |
| | | |
| | | private String updateOrderstatus(@RequestBody String json) { |
| | | // <PatientId> HIS或体检病人ID </PatientId> |
| | | // <PatType>病人类型</PatType > |