Browse Source

邵逸夫接口

lipc 6 years ago
parent
commit
c6ea35e6d1

+ 2 - 2
config-server/src/main/resources/shared/icss-service-local.yml

@@ -7,7 +7,7 @@ spring:
     druid:
       driver-class-name: com.mysql.cj.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://127.0.0.1:3306/sys-icss?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      url: jdbc:mysql://127.0.0.1:3306/sys-icss?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowPublicKeyRetrieval=true
       username: root
       password: langtong
       # 连接池的配置信息
@@ -76,7 +76,7 @@ spring:
   redis:
     database:
       cache: 15 # Redis缓存索引
-    host: 192.1.3.116  #Redis服务器地址
+    host: 127.0.0.1  #Redis服务器地址
     port: 6379 # Redis服务器连接端口
     password: lantone # Redis服务器连接密码(默认为空)
     lettuce:

+ 15 - 31
tran-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java

@@ -129,38 +129,22 @@ public class PatientInfoFacade extends PatientInfoServiceImpl {
             ServiceAlipaySoap soap = new ServiceAlipaySoapProxy();
             JsonMapper mapper = JsonMapper.nonDefaultMapper();
             String res = soap.apply(mapper.toJson(requestData));
-
-            //增加统计功能
-            InputInfo inputInfo=new InputInfo();
-            inputInfo.setHospitalCode(patientInfoVO.getHospitalCode());
-            inputInfo.setHosptialDeptCode(patientInfoVO.getHospitalDeptCode());
-            inputInfo.setDoctorCode(patientInfoVO.getDoctorCode());
-            if(patientInfoVO.getSex()!=null&&!"".equals(patientInfoVO.getSex())){
-                inputInfo.setSexType(patientInfoVO.getSex()==1?"男":"女");
+            if(patientInfoVO.getHospitalDeptCode()!=null&&!"".equals(patientInfoVO.getHospitalDeptCode())){
+                //增加统计功能
+                InputInfo inputInfo=new InputInfo();
+                inputInfo.setHospitalCode(patientInfoVO.getHospitalCode());
+                inputInfo.setHosptialDeptCode(patientInfoVO.getHospitalDeptCode());
+                inputInfo.setDoctorCode(patientInfoVO.getDoctorCode());
+                if(patientInfoVO.getSex()!=null&&!"".equals(patientInfoVO.getSex())){
+                    inputInfo.setSexType(patientInfoVO.getSex()==1?"男":"女");
+                }
+                inputInfo.setTransTime(DateUtil.format(new Date(), DateUtil.DATE_TIME_FORMAT));
+                inputInfo.setRemark("邵逸夫患者信息接口");
+                inputInfo.setParamIn(JSONObject.toJSONString(requestPatientInfo));
+                inputInfo.setParamOut(res);
+
+                inputInfoFacade.saveInputInfo(inputInfo);
             }
-            inputInfo.setTransTime(DateUtil.format(new Date(), DateUtil.DATE_TIME_FORMAT));
-            inputInfo.setRemark("邵逸夫患者信息接口");
-            inputInfo.setParamIn(JSONObject.toJSONString(requestPatientInfo));
-            inputInfo.setParamOut(res);
-
-            inputInfoFacade.saveInputInfo(inputInfo);
-
-            /*try {
-                //接口调用信息记录
-                HttpApi<InterfaceResponse> api = new HttpApi<InterfaceResponse>();
-                InterfaceInfoWrapper interfaces = new InterfaceInfoWrapper();
-                interfaces.setHospitalId(patientInfoVO.getHospitalCode());
-                interfaces.setDoctorNo(patientInfoVO.getDoctorCode());
-                interfaces.setDeptId(patientInfoVO.getHospitalDeptCode());
-                interfaces.setName("邵逸夫患者信息接口");
-                interfaces.setParamIn(patientInfoVO.getPatientCode());
-                interfaces.setParamOut(res);
-                interfaces.setTransTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
-                interfaces.setRemark("江干区邵逸夫");
-                api.doPost("http://localhost:8082/note-web/interfaces/record", interfaces, InterfaceResponse.class);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }*/
 
             PatientInfoResponse responsePatientInfo = mapper.fromJson(res, PatientInfoResponse.class);
             System.out.println("*********************res:" + res);

+ 1 - 1
tran-service/src/main/java/com/diagbot/facade/TranDiseaseIcdFacade.java

@@ -57,7 +57,7 @@ public class TranDiseaseIcdFacade extends DiseaseIcdServiceImpl {
      */
     public List<GetDiseaseNameDTO> getDiseaseNames(GetDiseaseNameVO getDiseaseNameVO) {
         Map paramMap = new HashMap<>();
-        paramMap.put("hisDiseaseName", Arrays.asList(getDiseaseNameVO.getHisDiseaseName().split(",")));
+        paramMap.put("hisDiseaseName", Arrays.asList(getDiseaseNameVO.getHisDiseaseName().split("")));
         paramMap.put("hospitalCode", getDiseaseNameVO.getHospitalCode());
         return this.getDiseaseNames(paramMap);
     }

+ 8 - 4
tran-service/src/main/java/com/diagbot/shaoyifu/entity/NLPInputRemote.java

@@ -1,8 +1,11 @@
 package com.diagbot.shaoyifu.entity;
 
+import com.diagbot.vo.LisResultVO;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.List;
+
 /**
  * 定义原始输入参数
  * Created by Administrator on 2018/4/3.
@@ -15,14 +18,15 @@ public class NLPInputRemote {
     private String pastJson;
     private String otherJson;
     private String vitalsJson;
-    private String labsJson;
+    private List<LisResultVO> labsJson;
     private String pacsJson;
     private String disJson;
     private String drugJson;
     private Long age;
     private String sexType;
-    private String type;
     private String hospitalCode; //医院编码
-    private String patientId;  //病人id
-    private String recordId; //就诊序号
+    private String clinicId;  //病人id
+    private String brjzid; //就诊序号
+    private String doctorNo;//医生id
+    private String deptId;//科室id
 }

+ 16 - 0
tran-service/src/main/java/com/diagbot/shaoyifu/entity/UrlOut.java

@@ -0,0 +1,16 @@
+package com.diagbot.shaoyifu.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+@Getter
+@Setter
+@SuppressWarnings("serial")
+public class UrlOut implements Serializable {
+    //病程录url
+	private String url1;
+	//医嘱url
+    private String url2;
+}

+ 22 - 0
tran-service/src/main/java/com/diagbot/vo/LisResultVO.java

@@ -0,0 +1,22 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+import javax.validation.constraints.NotNull;
+
+@Getter
+@Setter
+public class LisResultVO {
+    //数据来源
+    @NotNull(message = "请输入数据来源")
+    private Integer source;
+    private String name;//套餐名称
+    private String detailName;//化验项名称
+    private String uniqueName;//公表名称
+    private Double value;//值
+    private Double maxValue;//最大值
+    private Double minValue;//最小值
+    private String units;//单位
+    private String otherValue;//其他结果,包括阴性阳性,文字描述等
+
+}

+ 61 - 53
tran-service/src/main/java/com/diagbot/web/InquiryInfoController.java

@@ -7,6 +7,7 @@ import com.diagbot.entity.DiseaseIcd;
 import com.diagbot.entity.InputInfo;
 import com.diagbot.facade.*;
 import com.diagbot.shaoyifu.entity.NLPInputRemote;
+import com.diagbot.shaoyifu.entity.UrlOut;
 import com.diagbot.shaoyifu.entity.wrapper.InterfaceInfoWrapper;
 import com.diagbot.shaoyifu.response.InterfaceResponse;
 import com.diagbot.shaoyifu.util.HttpApi;
@@ -76,9 +77,9 @@ public class InquiryInfoController {
         return RespDTO.onSuc(a);
     }
 
-    @PostMapping("/hisInquirysForDj")
+    @RequestMapping("/hisInquirysForDj")
     @SysLogger("hisInquirysForDj")
-    public String hisInquirysForDj(@RequestBody HisInquirysForDjVO hisInquirysForDjVO) {
+    public String hisInquirysForDj(HisInquirysForDjVO hisInquirysForDjVO) {
         //根据医院编码获取本地数据库医院id
         HospitalInfoVO hospitalInfoVO = new HospitalInfoVO();
         hospitalInfoVO.setCode(hisInquirysForDjVO.getHospitalCode());
@@ -157,7 +158,8 @@ public class InquiryInfoController {
                 }
             }
 
-            String url = "http://192.1.3.116:5446/landscape.html?" +
+            String url = "http://192.1.3.116:5446/landscapeMedical.html?" +
+                    /*String url = "http://192.168.1.104:5446/landscapeMedical.html?" +*/
                     "age=" + age +
                     "&diagJson=" + dn +
                     "&lisJson=" + a.getContentList().get(5) +
@@ -179,46 +181,11 @@ public class InquiryInfoController {
      * @Description:邵逸夫医嘱界面提示窗接口
      * @author:lpc
      */
-    @PostMapping(value = "/get_syf_disease")
-    @ResponseBody
-    public String getSyfDisease(NLPInputRemote nlpRemote) {
-        try {
-
-            GetDiseaseNameVO getDiseaseNameVO = new GetDiseaseNameVO();
-            getDiseaseNameVO.setHisDiseaseName(nlpRemote.getDisJson());
-            getDiseaseNameVO.setHospitalCode(nlpRemote.getHospitalCode());
-            List<GetDiseaseNameDTO> a = diseaseIcdFacade.getDiseaseNames(getDiseaseNameVO);
-            DiseaseIcd di = new DiseaseIcd();
-            BeanUtil.copyProperties(a.get(0), di);
-
-            String url = "http://192.1.3.116:5446/landscapeMedical.html?" +
-                    "age=" + nlpRemote.getAge() +
-                    "&diagJson=" + di.getConceptDisName() +
-                    "&lisJson=" + nlpRemote.getLabsJson() +
-                    /*"&pastJson=" + a.getContentList().get(1) +*/
-                    "&otherJson=" + nlpRemote.getOtherJson() +
-                    "&pacsJson=" + nlpRemote.getPacsJson() +
-                    "&sex=" + (Integer.parseInt(nlpRemote.getSexType()) == 1 ? "男" : "女") +
-                    "&symptomJson=" + nlpRemote.getSymptomJson() +
-                    "&vitalJson=" + nlpRemote.getVitalsJson() +
-                    "&hospitalId=" + nlpRemote.getHospitalCode();
-            url = url.trim();
-            System.out.println("邵逸夫医嘱界面提示窗接口++++++++++++++++++++++++++++++++++++++" + url);
-            return url;
-        } catch (Exception e) {
-            e.printStackTrace();
-            return e.getMessage();
-        }
-    }
-
-    /**
-     * @Description:邵逸夫病程录提示窗接口
-     * @author:lpc
-     */
     @PostMapping(value = "/get_syf_inquiry")
     @ResponseBody
-    public String getSyfInquiry(NLPInputRemote nlpRemote) {
+    public String getSyfDisease(@RequestBody  NLPInputRemote nlpRemote) {
         try {
+
             if(nlpRemote.getSymptomJson()==null){
                 nlpRemote.setSymptomJson("");
             }
@@ -228,40 +195,81 @@ public class InquiryInfoController {
             if(nlpRemote.getVitalsJson()==null){
                 nlpRemote.setVitalsJson("");
             }
+            if(nlpRemote.getDisJson()==null){
+                nlpRemote.setDisJson("");
+            }
             if(nlpRemote.getPacsJson()==null){
                 nlpRemote.setPacsJson("");
             }
             if(nlpRemote.getOtherJson()==null){
                 nlpRemote.setOtherJson("");
             }
-
             GetDiseaseNameVO getDiseaseNameVO = new GetDiseaseNameVO();
-            getDiseaseNameVO.setHisDiseaseName(nlpRemote.getDisJson());
-            getDiseaseNameVO.setHospitalCode(nlpRemote.getHospitalCode());
-            List<GetDiseaseNameDTO> a = diseaseIcdFacade.getDiseaseNames(getDiseaseNameVO);
-            DiseaseIcd di = new DiseaseIcd();
-            BeanUtil.copyProperties(a.get(0),di);
+            StringBuffer dn = new StringBuffer();
+            String dn1= "";
+            if(nlpRemote.getDisJson()!=null&&!"".equals(nlpRemote.getDisJson())) {
+                getDiseaseNameVO.setHisDiseaseName(nlpRemote.getDisJson());
+                getDiseaseNameVO.setHospitalCode(nlpRemote.getHospitalCode());
+                List<GetDiseaseNameDTO> a = diseaseIcdFacade.getDiseaseNames(getDiseaseNameVO);
+                if(a.size()!=0){
+                    for(DiseaseIcd di : a){
+                        dn.append(di.getConceptDisName()+ ",") ;
+                    }
+                    dn1 = dn.substring(0, dn.length() - 1);
+                }
+            }
+
+            String url1 = "http://192.1.3.116:5446/landscape.html?lisJson="
+            /*String url1 = "http://192.168.1.104:5446/landscape.html?lisJson="*/
+                    + "&diagJson=" + dn1
+                    + "&age=" + nlpRemote.getAge()
+                    + "&sex=" + (Integer.parseInt(nlpRemote.getSexType())==1?"男":"女")
+                    + "&symptomJson=" + URLEncoder.encode(nlpRemote.getSymptomJson(),"utf-8")
+                    + "&pastJson=" + URLEncoder.encode(nlpRemote.getPastJson(),"utf-8")
+                    + "&pacsJson=" + URLEncoder.encode(nlpRemote.getPacsJson(),"utf-8")
+                    + "&vitalJson=" + URLEncoder.encode(nlpRemote.getVitalsJson(),"utf-8")
+                    + "&otherJson=" + URLEncoder.encode(nlpRemote.getOtherJson(),"utf-8")
+                    + "&hospitalCode=" + nlpRemote.getHospitalCode();
 
-            String url = "http://192.1.3.116:5446/landscape.html?"
-                    + "lisJson=" + nlpRemote.getLabsJson()
-                    + "&diagJson=" + di.getConceptDisName()
+            String url2 = "http://192.1.3.116:5446/landscapeMedical.html?lisJson="
+            /*String url2 = "http://192.168.1.104:5446/landscapeMedical.html?lisJson="*/
+                    + "&diagJson=" + dn1
                     + "&age=" + nlpRemote.getAge()
                     + "&sex=" + (Integer.parseInt(nlpRemote.getSexType())==1?"男":"女")
                     + "&symptomJson=" + URLEncoder.encode(nlpRemote.getSymptomJson(),"utf-8")
                     + "&pastJson=" + URLEncoder.encode(nlpRemote.getPastJson(),"utf-8")
                     + "&pacsJson=" + URLEncoder.encode(nlpRemote.getPacsJson(),"utf-8")
                     + "&vitalJson=" + URLEncoder.encode(nlpRemote.getVitalsJson(),"utf-8")
-                    + "&otherJson=" + URLEncoder.encode(nlpRemote.getOtherJson(),"utf-8");
-            url = url.trim();
-            System.out.println("创业电子病历提示窗接口++++++++++++++++++++++++++++++++++++++" + url);
+                    + "&otherJson=" + URLEncoder.encode(nlpRemote.getOtherJson(),"utf-8")
+                    + "&hospitalCode=" + nlpRemote.getHospitalCode();
+
+            UrlOut uo = new UrlOut();
+            uo.setUrl1(url1.trim());
+            uo.setUrl2(url2.trim());
+            String data = JSONObject.toJSONString(uo);
 
-            return url;
+            InputInfo inputInfo=new InputInfo();
+            inputInfo.setHospitalCode(nlpRemote.getHospitalCode());
+            inputInfo.setHosptialDeptCode(nlpRemote.getDeptId());
+            inputInfo.setDoctorCode(nlpRemote.getDoctorNo());
+            inputInfo.setInquiryCode(nlpRemote.getClinicId());
+            inputInfo.setDiseaseName(nlpRemote.getDisJson());
+            inputInfo.setAge(nlpRemote.getAge().intValue());
+            inputInfo.setSexType(nlpRemote.getSexType());
+            inputInfo.setTransTime(DateUtil.format(new Date(), DateUtil.DATE_TIME_FORMAT));
+            inputInfo.setRemark("邵逸夫界面提示窗接口");
+            inputInfo.setParamIn(JSONObject.toJSONString(nlpRemote));
+            inputInfo.setParamOut(data);
+
+            System.out.println("邵逸夫界面提示窗接口++++++++++++++++++++++++++++++++++++++" + data);
+            return data;
         } catch (Exception e) {
             e.printStackTrace();
             return e.getMessage();
         }
     }
 
+
     /**
      * 急诊-历史病历列表
      *