Browse Source

住院门诊接口

lipc 6 years ago
parent
commit
7e16ac7ff0

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

@@ -69,8 +69,8 @@ spring:
   #redis
   redis:
     database:
-      mr: 8 # Redis病历索引
-    host: 192.168.2.236  #Redis服务器地址
+      mr: 7 # Redis病历索引
+    host: 127.0.0.1  #Redis服务器地址
     port: 6379 # Redis服务器连接端口
     password: lantone # Redis服务器连接密码(默认为空)
     lettuce:

+ 7 - 0
tran-service/pom.xml

@@ -19,6 +19,13 @@
     </parent>
 
     <dependencies>
+        <!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/sqljdbc4 -->
+        <dependency>
+            <groupId>com.microsoft.sqlserver</groupId>
+            <artifactId>sqljdbc4</artifactId>
+            <version>4.0</version>
+        </dependency>
+
         <!-- https://mvnrepository.com/artifact/wsdl4j/wsdl4j -->
         <dependency>
             <groupId>wsdl4j</groupId>

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

@@ -6,6 +6,9 @@ import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 
+import com.diagbot.dto.HisInquirysForDjDTO;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.HisInquirysForDjVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
@@ -47,7 +50,55 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl{
 	@Autowired
 	@Qualifier("inquiryDetailServiceImpl")
 	private InquiryDetailServiceImpl inquiryDetailServiceImpl;
-	
+
+    public List<HisInquirysForDjDTO> hisInquirysForDj(HisInquirysForDjVO hisInquirysForDjVO){
+        QueryWrapper<InquiryInfo> queryWrapper = new QueryWrapper<InquiryInfo>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+        queryWrapper.eq("hospital_id", hisInquirysForDjVO.getHospitalId());
+        if (hisInquirysForDjVO.getHospitalDeptId() != null) {
+            queryWrapper.eq("hospital_dept_id", hisInquirysForDjVO.getHospitalDeptId());
+        }
+        if (hisInquirysForDjVO.getDoctorId() != null) {
+            queryWrapper.eq("doctor_id", hisInquirysForDjVO.getDoctorId());
+        }
+        if (hisInquirysForDjVO.getPatientId() != null) {
+            queryWrapper.eq("patient_id", hisInquirysForDjVO.getPatientId());
+        }
+        if (StringUtil.isNotBlank(hisInquirysForDjVO.getInquiryCode())) {
+            queryWrapper.eq("inquiry_code", hisInquirysForDjVO.getInquiryCode());
+        }
+        if (hisInquirysForDjVO.getType() != null) {
+            queryWrapper.eq("type", hisInquirysForDjVO.getType());
+        }
+        if (hisInquirysForDjVO.getSign() != null) {
+            queryWrapper.eq("sign", hisInquirysForDjVO.getSign());
+        }
+        if (hisInquirysForDjVO.getStartDate() != null) {
+            queryWrapper.ge("gmt_create", hisInquirysForDjVO.getStartDate());
+        }
+        if (hisInquirysForDjVO.getEndDate() != null) {
+            queryWrapper.le("gmt_create", hisInquirysForDjVO.getEndDate());
+        }
+        if (hisInquirysForDjVO.getOrderType() == 1) {
+            queryWrapper.orderByDesc("gmt_modified");
+        } else if (hisInquirysForDjVO.getOrderType() == 2) {
+            queryWrapper.orderByAsc("gmt_modified");
+        }
+        List<InquiryInfo> inquiryInfoList = this.list(queryWrapper);
+        if (ListUtil.isEmpty(inquiryInfoList)) {
+            return null;
+        }
+
+        Map<Long, List<InquiryDetail>> inquiryDetailMap = inquiryDetailFacade.getDetailsByInquryIds(inquiryInfoList.stream().map(i -> i.getId()).collect(Collectors.toList()));
+        List<HisInquirysForDjDTO> hisInquirysForDjDTOList = BeanUtil.listCopyTo(inquiryInfoList, HisInquirysForDjDTO.class);
+
+        hisInquirysForDjDTOList.forEach(i -> {
+            i.setContentList(inquiryDetailMap.get(i.getId()).stream().map(k -> k.getContentValue()).collect(Collectors.toList()));
+        });
+
+        return hisInquirysForDjDTOList;
+    }
+
 	/**
      * 问诊记录保存
      *

+ 1 - 1
tran-service/src/main/java/com/diagbot/mapper/PacsConfigMapper.java

@@ -17,5 +17,5 @@ import java.util.List;
  */
 public interface PacsConfigMapper extends BaseMapper<PacsConfig> {
 
-    public PacsConfigDTO getPacsConfigByNameAndHosCode(LisPacsInfoForDJVO lisPacsInfoForDJVO);
+    public List<PacsConfigDTO> getPacsConfigByNameAndHosCode(LisPacsInfoForDJVO lisPacsInfoForDJVO);
 }

+ 1 - 1
tran-service/src/main/java/com/diagbot/mapper/TranLisConfigMapper.java

@@ -20,6 +20,6 @@ public interface TranLisConfigMapper extends BaseMapper<TranLisConfig> {
 
 	List<LisConfigDTO> getLisConfigByhospitalIds(LisHospitalCodeVO lisHospitalCodeVO);
 
-	LisConfigDTO getLisConfigByNamesAndHosCode(LisPacsInfoForDJVO lisPacsInfoForDJVO);
+	List<LisConfigDTO> getLisConfigByNamesAndHosCode(LisPacsInfoForDJVO lisPacsInfoForDJVO);
 
 }

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

@@ -17,5 +17,5 @@ import java.util.List;
  */
 public interface PacsConfigService extends IService<PacsConfig> {
 
-    public PacsConfigDTO getPacsConfigByNameAndHosCode(LisPacsInfoForDJVO lisPacsInfoForDJVO);
+    public List<PacsConfigDTO> getPacsConfigByNameAndHosCode(LisPacsInfoForDJVO lisPacsInfoForDJVO);
 }

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

@@ -20,6 +20,6 @@ public interface TranLisConfigService extends IService<TranLisConfig> {
 	
 	public List<LisConfigDTO> getLisConfigByhospitalId(LisHospitalCodeVO lisHospitalCodeVO);
 
-	public LisConfigDTO getLisConfigByNamesAndHosCode(LisPacsInfoForDJVO lisPacsInfoForDJVO);
+	public List<LisConfigDTO> getLisConfigByNamesAndHosCode(LisPacsInfoForDJVO lisPacsInfoForDJVO);
 
 }

+ 1 - 1
tran-service/src/main/java/com/diagbot/service/impl/PacsConfigServiceImpl.java

@@ -23,7 +23,7 @@ import java.util.List;
 public class PacsConfigServiceImpl extends ServiceImpl<PacsConfigMapper, PacsConfig> implements PacsConfigService {
 
     @Override
-    public PacsConfigDTO getPacsConfigByNameAndHosCode(LisPacsInfoForDJVO lisPacsInfoForDJVO){
+    public List<PacsConfigDTO> getPacsConfigByNameAndHosCode(LisPacsInfoForDJVO lisPacsInfoForDJVO){
         return baseMapper.getPacsConfigByNameAndHosCode(lisPacsInfoForDJVO);
     }
 

+ 1 - 1
tran-service/src/main/java/com/diagbot/service/impl/TranLisConfigServiceImpl.java

@@ -29,7 +29,7 @@ public class TranLisConfigServiceImpl extends ServiceImpl<TranLisConfigMapper, T
 	}
 
 	@Override
-	public LisConfigDTO getLisConfigByNamesAndHosCode(LisPacsInfoForDJVO lisPacsInfoForDJVO){
+	public List<LisConfigDTO> getLisConfigByNamesAndHosCode(LisPacsInfoForDJVO lisPacsInfoForDJVO){
 		return baseMapper.getLisConfigByNamesAndHosCode(lisPacsInfoForDJVO);
 	}
 

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

@@ -14,13 +14,13 @@ import java.util.List;
 @Setter
 public class NLPInputRemote {
 
-    private String symptomJson;
-    private String pastJson;
-    private String otherJson;
-    private String vitalsJson;
+    private String symptomJson = "";
+    private String pastJson = "";
+    private String otherJson = "";
+    private String vitalsJson = "";
     private List<LisResultVO> labsJson;
-    private String pacsJson;
-    private String disJson;
+    private String pacsJson = "";
+    private String disJson = "";
     private String drugJson;
     private Long age;
     private String sexType;
@@ -29,4 +29,6 @@ public class NLPInputRemote {
     private String brjzid; //就诊序号
     private String doctorNo;//医生id
     private String deptId;//科室id
+
+    private String code;
 }

+ 8 - 1
tran-service/src/main/java/com/diagbot/vo/PushJoinVO.java

@@ -60,5 +60,12 @@ public class PushJoinVO {
     @ApiModelProperty(hidden = true)
     private String expireTimeStr;
 
-    private String code;
+
+    private String hosptialDeptCode;
+    private String doctorCode;
+    private String inquiryCode;
+    private String code;//0病程录 1医嘱 2首程 3大病历 4查阅报告危急值提醒 5开单合理性 6化验静态知识 7辅检静态知识
+
+    private String lisMrn;//his化验病历号
+    private String pacsMrn;//his辅检病历号
 }

+ 310 - 152
tran-service/src/main/java/com/diagbot/web/InquiryInfoController.java

@@ -23,6 +23,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 /**
  * <p>
@@ -52,6 +54,9 @@ public class InquiryInfoController {
     private TranLisConfigFacade tranLisConfigFacade;
     @Autowired
     private PacsConfigFacade pacsConfigFacade;
+    @Autowired
+    private MrFacade mrFacade;
+
     /**
      * 问诊记录保存
      *
@@ -66,7 +71,7 @@ public class InquiryInfoController {
 
         Boolean a = inquiryInfoFacade.saveInquiryToHis(saveInquiryToHisVO);
         //增加统计功能
-        InputInfo inputInfo=new InputInfo();
+        InputInfo inputInfo = new InputInfo();
         inputInfo.setHospitalCode(saveInquiryToHisVO.getHospitalId().toString());
         inputInfo.setHosptialDeptCode(saveInquiryToHisVO.getHospitalDeptId().toString());
         inputInfo.setDoctorCode(saveInquiryToHisVO.getDoctorId().toString());
@@ -185,44 +190,85 @@ public class InquiryInfoController {
      */
     @PostMapping(value = "/get_syf_inquiry")
     @ResponseBody
-    public String getSyfDisease(@RequestBody  NLPInputRemote nlpRemote) {
+    public String getSyfDisease(@RequestBody NLPInputRemote nlpRemote) {
         try {
-
-            if(nlpRemote.getSymptomJson()==null){
-                nlpRemote.setSymptomJson("");
-            }
-            if(nlpRemote.getPastJson()==null){
-                nlpRemote.setPastJson("");
-            }
-            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();
             StringBuffer dn = new StringBuffer();
-            String dn1= "";
-            if(nlpRemote.getDisJson()!=null&&!"".equals(nlpRemote.getDisJson())) {
+            String mrId ;
+            String url ;
+            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(GetDiseaseNameDTO di : a){
-                        dn.append(di.getConceptDisName()+ ",") ;
+                if (a.size() != 0) {
+                    for (GetDiseaseNameDTO di : a) {
+                        dn.append(di.getConceptDisName() + ",");
                     }
                     dn1 = dn.substring(0, dn.length() - 1);
                 }
             }
 
-            String url1 = "http://192.1.3.116:5446/index.html?lisJson="
-            /*String url1 = "http://192.168.1.104:5446/landscape.html?lisJson="*/
+            PushJoinVO pushJoinVO = new PushJoinVO();
+            pushJoinVO.setAge(nlpRemote.getAge().intValue());
+            pushJoinVO.setSex(Integer.parseInt(nlpRemote.getSexType()));
+            pushJoinVO.setSymptom(nlpRemote.getSymptomJson());
+            pushJoinVO.setVital(nlpRemote.getVitalsJson());
+            pushJoinVO.setOther(nlpRemote.getOtherJson());
+            pushJoinVO.setDiag(dn1);
+            pushJoinVO.setHosCode(nlpRemote.getHospitalCode());
+
+            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));
+
+            switch (nlpRemote.getCode()) {
+
+                case "0":
+
+                    mrId = mrFacade.createMr(pushJoinVO);
+
+                    url = "http://127.0.0.1:5446/index.html?" +
+                            "mrId=" + mrId +
+                            "&tipsName=" +
+                            "&tipsType=" +
+                            "showTab=0" +
+                            "&hospitalCode=" + pushJoinVO.getHosCode() +
+                            "&plan=0";
+
+                    inputInfo.setParamOut(url);
+                    inputInfoFacade.saveInputInfo(inputInfo);
+                    return url;
+
+                case "1":
+
+                    mrId = mrFacade.createMr(pushJoinVO);
+
+                    url = "http://127.0.0.1:5446/indexHorizontal.html?" +
+                            "mrId=" + mrId +
+                            "&tipsName=" +
+                            "&tipsType=" +
+                            "showTab=0" +
+                            "&hospitalCode=" + pushJoinVO.getHosCode() +
+                            "&plan=1";
+
+                    inputInfo.setParamOut(url);
+                    inputInfoFacade.saveInputInfo(inputInfo);
+                    return url;
+
+            }
+
+
+            /*String url1 = "http://192.1.3.116:5446/index.html?lisJson="
+             *//*String url1 = "http://192.168.1.104:5446/landscape.html?lisJson="*//*
                     + JSONObject.toJSONString(nlpRemote.getLabsJson())
                     + "&diagJson=" + dn1
                     + "&age=" + nlpRemote.getAge()
@@ -235,7 +281,7 @@ public class InquiryInfoController {
                     + "&hospitalCode=" + nlpRemote.getHospitalCode();
 
             String url2 = "http://192.1.3.116:5446/indexHorizontal.html?lisJson="
-            /*String url2 = "http://192.168.1.104:5446/landscapeMedical.html?lisJson="*/
+            *//*String url2 = "http://192.168.1.104:5446/landscapeMedical.html?lisJson="*//*
                     + JSONObject.toJSONString(nlpRemote.getLabsJson())
                     + "&diagJson=" + dn1
                     + "&age=" + nlpRemote.getAge()
@@ -250,23 +296,10 @@ public class InquiryInfoController {
             UrlOut uo = new UrlOut();
             uo.setUrl1(url1.trim());
             uo.setUrl2(url2.trim());
-            String data = JSONObject.toJSONString(uo);
+            String data = JSONObject.toJSONString(uo);*/
 
-            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);
+            return "暂无推送";
 
-            System.out.println("邵逸夫界面提示窗接口++++++++++++++++++++++++++++++++++++++" + data);
-            return data;
         } catch (Exception e) {
             e.printStackTrace();
             return e.getMessage();
@@ -274,6 +307,7 @@ public class InquiryInfoController {
     }
 
 
+
     /**
      * 急诊-历史病历列表
      *
@@ -314,143 +348,267 @@ public class InquiryInfoController {
         return RespDTO.onSuc(inquiryInfoFacade.getExportInquirys(inquiryIds));
     }
 
-    /**
-     * 邵逸夫化验静态知识
-     * type 5:化验 6:辅检
-     * @param lisPacsInfoForDJVO
-     * @return
-     */
-    @PostMapping(value = "/getLisPacsInfo")
-    @ResponseBody
-    public String getLisInfoForDJ(@RequestBody LisPacsInfoForDJVO lisPacsInfoForDJVO) {
-        String url= "";
-        if(lisPacsInfoForDJVO.getType() == 5) {
-            LisConfigDTO a = tranLisConfigFacade.getLisConfigByNamesAndHosCode(lisPacsInfoForDJVO);
-            url = "http://127.0.0.1:5446/information.html?type=" + lisPacsInfoForDJVO.getType() +
-                    "&position=2" + "&name=" + a.getUniqueName();
-        }else if (lisPacsInfoForDJVO.getType() == 6){
-            List<PacsConfigDTO> b = pacsConfigFacade.getPacsConfigByNameAndHosCode(lisPacsInfoForDJVO);
-            url = "http://127.0.0.1:5446/information.html?type=" + lisPacsInfoForDJVO.getType() +
-                    "&position=2" + "&name=" + b.get(0).getUniqueName();
-        }else if (lisPacsInfoForDJVO.getType() == 7){
-            GetDiseaseNameVO getDiseaseNameVO =new GetDiseaseNameVO();
-            getDiseaseNameVO.setHospitalCode(lisPacsInfoForDJVO.getHosCode());
-            getDiseaseNameVO.setHisDiseaseName(lisPacsInfoForDJVO.getDiseaseName());
-            List<GetDiseaseNameDTO> c = diseaseIcdFacade.getDiseaseNames(getDiseaseNameVO);
-            url = "http://127.0.0.1:5446/information.html?type=" + lisPacsInfoForDJVO.getType() +
-                    "&position=2" + "&name=" + c.get(0).getConceptDisName();
-        }
-        return url;
-    }
 
     /**
      * 数据服务模式
+     *
      * @param pushJoinVO
      * @return
      */
     @PostMapping("/getDataService")
     @SysLogger("getDataService")
-    public String getDataService(PushJoinVO pushJoinVO){
-        GetDiseaseNameVO getDiseaseNameVO =new GetDiseaseNameVO();
-        switch (pushJoinVO.getCode()){
+    public String getDataService(@RequestBody PushJoinVO pushJoinVO) throws Exception {
+        GetDiseaseNameVO getDiseaseNameVO = new GetDiseaseNameVO();
+        LisPacsInfoForDJVO lisPacsInfoForDJVO = new LisPacsInfoForDJVO();
+        List<LisConfigDTO> lisConfigDTO;
+        List<PacsConfigDTO> pacsConfigDTO;
+        String mrId;
+        String url;
+
+        InputInfo inputInfo = new InputInfo();
+        inputInfo.setHospitalCode(pushJoinVO.getHosCode());
+        inputInfo.setHosptialDeptCode(pushJoinVO.getHosptialDeptCode());
+        inputInfo.setDoctorCode(pushJoinVO.getDoctorCode());
+        inputInfo.setInquiryCode(pushJoinVO.getInquiryCode());
+        inputInfo.setDiseaseName(pushJoinVO.getDiag());
+        inputInfo.setAge(pushJoinVO.getAge().intValue());
+        inputInfo.setSexType(pushJoinVO.getSex() == 1 ? "男" : "女");
+        inputInfo.setTransTime(DateUtil.format(new Date(), DateUtil.DATE_TIME_FORMAT));
+        inputInfo.setParamIn(JSONObject.toJSONString(pushJoinVO));
+
+        switch (pushJoinVO.getCode()) {
             //首程推送
-            case "0":
+            case "2":
                 getDiseaseNameVO.setHospitalCode(pushJoinVO.getHosCode());
-                getDiseaseNameVO.setHisDiseaseName(pushJoinVO.getDiseaseName());
+                getDiseaseNameVO.setHisDiseaseName(pushJoinVO.getDiag());
                 List<GetDiseaseNameDTO> a = diseaseIcdFacade.getDiseaseNames(getDiseaseNameVO);
-                pushJoinVO.setDiseaseName(a.get(0).getConceptDisName());
+                pushJoinVO.setDiag(a.get(0).getConceptDisName());
+
+                mrId = mrFacade.createMr(pushJoinVO);
+
+                url = "http://127.0.0.1:5446/index.html?" +
+                        "mrId=" + mrId +
+                        "&tipsName=" +
+                        "&tipsType=" +
+                        "&showTab=0" +
+                        "&hospitalCode=" + pushJoinVO.getHosCode() +
+                        "&plan=2";
 
+                inputInfo.setRemark("邵逸夫首程推送接口");
+                inputInfo.setParamOut(url);
+                inputInfoFacade.saveInputInfo(inputInfo);
+                return url;
 
-                String url0 = "http://127.0.0.1:5446/index.html?mrId=xxx&hospitalCode=A001&plan=0";
-                return url0;
             //大病历推送
-            case "1":
+            case "3":
                 getDiseaseNameVO.setHospitalCode(pushJoinVO.getHosCode());
-                getDiseaseNameVO.setHisDiseaseName(pushJoinVO.getDiseaseName());
+                getDiseaseNameVO.setHisDiseaseName(pushJoinVO.getDiag());
                 List<GetDiseaseNameDTO> b = diseaseIcdFacade.getDiseaseNames(getDiseaseNameVO);
-                pushJoinVO.setDiseaseName(b.get(0).getConceptDisName());
-                String url1 = "http://127.0.0.1:5446/index.html?mrId=xxx&hospitalCode=A001&plan=1";
-                return url1;
-            //查阅报告危急值提醒
-            case "2":
-                LisPacsInfoForDJVO lisPacsInfoForDJVO = new LisPacsInfoForDJVO();
-                LisConfigDTO lisConfigDTO;
-                List<LisResult> lis = pushJoinVO.getLis();
-                for (int i = 0; i <= lis.size(); i++) {
-                    lisPacsInfoForDJVO.setHosCode(pushJoinVO.getHosCode());
-                    lisPacsInfoForDJVO.setMealName(lis.get(i).getName());
-                    lisPacsInfoForDJVO.setItemName(lis.get(i).getDetailName());
-                    lisConfigDTO = tranLisConfigFacade.getLisConfigByNamesAndHosCode(lisPacsInfoForDJVO);
-                    lis.get(i).setUniqueName(lisConfigDTO.getUniqueName());
-                }
-                pushJoinVO.setLis(lis);
-
-                PacsConfigDTO pacsConfigDTO;
-                List<PacsResult> pacs = pushJoinVO.getPacsList();
-                StringBuffer sb = new StringBuffer();
-                for (int j = 0; j <= pacs.size(); j++) {
-                    lisPacsInfoForDJVO.setHosCode(pushJoinVO.getHosCode());
-                    lisPacsInfoForDJVO.setMealName(pacs.get(j).getName());
-                    pacsConfigDTO = pacsConfigFacade.getPacsConfigByNameAndHosCode(lisPacsInfoForDJVO);
-                    pacs.get(j).setName(pacsConfigDTO.getUniqueName());
-                    sb.append(pacsConfigDTO.getUniqueName() + ":" + pacs.get(j).getResult() + ";");
-                }
-                pushJoinVO.setPacs(sb.toString());
-                String url2 = "http://127.0.0.1:5446/index.html?mrId=xxx&hospitalCode=A001&plan=2";
-                return url2;
-            //开单合理性
-            case "3":
-
-
-
-                String url3 = "http://127.0.0.1:5446/index.html?mrId=xxx&hospitalCode=A001&plan=3";
-                return url3;
+                pushJoinVO.setDiag(b.get(0).getConceptDisName());
+
+                mrId = mrFacade.createMr(pushJoinVO);
+
+                url = "http://127.0.0.1:5446/index.html?" +
+                        "mrId=" + mrId +
+                        "&tipsName=" +
+                        "&tipsType=" +
+                        "&showTab=0" +
+                        "&hospitalCode=" + pushJoinVO.getHosCode() +
+                        "&plan=3";
+                inputInfo.setRemark("邵逸夫大病历推送接口");
+                inputInfo.setParamOut(url);
+                inputInfoFacade.saveInputInfo(inputInfo);
+                return url;
+
+            //查阅报告危急值提醒(视图)
             case "4":
+                if (pushJoinVO.getLisMrn() != null & !"".equals(pushJoinVO.getLisMrn().trim())) {
+                    String username = "u2019_LT";// 数据库用户名
+                    String password = "lt@2019";// 数据库密码
+                    String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";//驱动
+                    String dbUrl = "jdbc:sqlserver://192.1.2.92:1433;DatabaseName=lis";//数据库地址
+                    Connection conn;
+                    Class.forName(driver);
+                    conn = DriverManager.getConnection(dbUrl, username, password);
+                    String sql = "select * from V_LIS_PANICVALUE where MRN = " + pushJoinVO.getLisMrn();
+                    PreparedStatement pst;
+                    pst = conn.prepareStatement(sql);
+                    ResultSet rs = pst.executeQuery();
+
+                    List<LisResult> lrs = new ArrayList<>();
+                    LisResult lisResult = new LisResult();
+                    while (rs.next()) {
+                        lisResult.setName(rs.getString("SPECIMENNAME"));//套餐名
+                        lisResult.setDetailName(rs.getString("CHINNAME"));//化验项名
+                        //判断是否为数字,是则传入value,不是则传入otherValue
+                        if (isNum(rs.getString("NOTES"))) {
+                            lisResult.setValue(Double.valueOf(rs.getString("NOTES")));//值
+                        } else {
+                            lisResult.setOtherValue(rs.getString("NOTES"));//其他结果,包括阴性阳性,文字描述等
+                        }
+
+
+                        if (rs.getString("refhigh") != null) {
+                            if (isNum(rs.getString("refhigh"))) {
+                                lisResult.setMaxValue(Double.valueOf(rs.getString("refhigh")));//值
+                            } else {
+                                lisResult.setMaxValue(0.0);//其他结果,包括阴性阳性,文字描述等
+                            }
+                        } else {
+                            lisResult.setMaxValue(0.0);
+                        }
+
+                        if (rs.getString("reflow") != null) {
+                            if (isNum(rs.getString("reflow"))) {
+                                lisResult.setMinValue(Double.valueOf(rs.getString("reflow")));//值
+                            } else {
+                                lisResult.setMinValue(0.0);//其他结果,包括阴性阳性,文字描述等
+                            }
+                        } else {
+                            lisResult.setMinValue(0.0);
+                        }
+
+                        lisResult.setUnits(rs.getString("jydw"));//单位
+                        lisResult.setSource(1);//数据来源
+                        lrs.add(lisResult);
+                    }
+                    rs.close();
+                    pst.close();
+                    conn.close();
+
+                    for (int i = 0; i < lrs.size(); i++) {
+                        lisPacsInfoForDJVO.setHosCode(pushJoinVO.getHosCode());
+                        lisPacsInfoForDJVO.setMealName(lrs.get(i).getName());
+                        lisPacsInfoForDJVO.setItemName(lrs.get(i).getDetailName());
+                        lisConfigDTO = tranLisConfigFacade.getLisConfigByNamesAndHosCode(lisPacsInfoForDJVO);
+                        if(lisConfigDTO.size()!=0){
+                            lrs.get(i).setUniqueName(lisConfigDTO.get(0).getUniqueName());
+                        }
+                    }
+                    pushJoinVO.setLis(lrs);
+
+                } else if (pushJoinVO.getPacsMrn() != null && !"".equals(pushJoinVO.getPacsMrn().trim())) {
+                    String username = "u2019_LT";// 数据库用户名
+                    String password = "lt@2019";// 数据库密码
+                    String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";//驱动
+                    String dbUrl1 = "jdbc:oracle:thin:@192.1.2.92:1521:lis";//数据库地址
+                    Connection conn;
+                    Class.forName(driver);
+                    conn = DriverManager.getConnection(dbUrl1, username, password);
+                    String sql = "select * from V_PACS_PANICVALUE where MRN = " + pushJoinVO.getPacsMrn();
+                    PreparedStatement pst;
+                    pst = conn.prepareStatement(sql);
+                    ResultSet rs = pst.executeQuery();
+
+                    PacsResult pacsResult = new PacsResult();
+                    List<PacsResult> lpr = new ArrayList<>();
+                    while (rs.next()) {
+                        pacsResult.setName(rs.getString("SPECIMENNAME"));
+                        pacsResult.setResult(rs.getString("SPECIMENNAME"));
+                        lpr.add(pacsResult);
+                    }
 
+                    rs.close();
+                    pst.close();
+                    conn.close();
+
+                    StringBuffer sb = new StringBuffer();
+                    for (int j = 0; j <= lpr.size(); j++) {
+                        lisPacsInfoForDJVO.setHosCode(pushJoinVO.getHosCode());
+                        lisPacsInfoForDJVO.setMealName(lpr.get(j).getName());
+                        pacsConfigDTO = pacsConfigFacade.getPacsConfigByNameAndHosCode(lisPacsInfoForDJVO);
+                        if (pacsConfigDTO.size() != 0) {
+                            lpr.get(j).setName(pacsConfigDTO.get(0).getUniqueName());
+                        }
+                        sb.append(pacsConfigDTO.get(0).getUniqueName() + ":" + lpr.get(j).getResult() + ";");
+                    }
+                    pushJoinVO.setPacs(sb.toString());
 
-                String url4 = "http://127.0.0.1:5446/index.html?mrId=xxx&hospitalCode=A001&plan=4";
-                return url4;
-            case "5":
-
-                String url5 = "http://127.0.0.1:5446/index.html?mrId=xxx&hospitalCode=A001&plan=5";
-                return url5;
-        }
+                }
 
+                mrId = mrFacade.createMr(pushJoinVO);
 
+                url = "http://127.0.0.1:5446/index.html?" +
+                        "mrId=" + mrId +
+                        "&tipsName=" +
+                        "&tipsType=" +
+                        "&showTab=0" +
+                        "&hospitalCode=" + pushJoinVO.getHosCode() +
+                        "&plan=4";
+                inputInfo.setRemark("邵逸夫查阅报告危急值提醒接口");
+                inputInfo.setParamOut(url);
+                inputInfoFacade.saveInputInfo(inputInfo);
+                return url;
 
-        //化验辅检静态知识
+            //开单合理性
+            case "5":
 
+                mrId = mrFacade.createMr(pushJoinVO);
+
+                url = "http://127.0.0.1:5446/index.html?" +
+                        "mrId=" + mrId +
+                        "&tipsName=" +
+                        "&tipsType=" +
+                        "&showTab=0" +
+                        "&hospitalCode=" + pushJoinVO.getHosCode() +
+                        "&plan=5";
+                inputInfo.setRemark("邵逸夫开单合理性接口");
+                inputInfo.setParamOut(url);
+                inputInfoFacade.saveInputInfo(inputInfo);
+                return url;
+
+            //辅检静态知识
+            case "6":
+                if (pushJoinVO.getLisOrder() != null && !"".equals(pushJoinVO.getLisOrder().trim())) {
+                    lisPacsInfoForDJVO.setMealName(pushJoinVO.getLisOrder());
+                    lisPacsInfoForDJVO.setHosCode(pushJoinVO.getHosCode());
+                    lisConfigDTO = tranLisConfigFacade.getLisConfigByNamesAndHosCode(lisPacsInfoForDJVO);
+                    pushJoinVO.setLisOrder(lisConfigDTO.get(0).getUniqueName());
 
+                    mrId = mrFacade.createMr(pushJoinVO);
 
-        //查看检验检查报告静态知识
+                    url = "http://127.0.0.1:5446/index.html?" +
+                            "mrId=" + mrId +
+                            "&tipsName=" + pushJoinVO.getLisOrder() +
+                            "&tipsType=5" +
+                            "&showTab=1" +
+                            "&hospitalCode=" + pushJoinVO.getHosCode() +
+                            "&plan=6";
 
+                    inputInfo.setRemark("邵逸夫化验静态知识接口");
+                    inputInfo.setParamOut(url);
+                    inputInfoFacade.saveInputInfo(inputInfo);
+                    return url;
 
-        String username = "root";// 数据库用户名
-        String password = "langtong";// 数据库密码
-        String driver = "oracle.jdbc.driver.OracleDriver";//驱动
-        String url="jdbc:oracle:thin:@192.168.3.177:1521:orcl";//数据库地址
-        Connection conn = null;
-        try {
-            Class.forName(driver);
-            conn = (Connection) DriverManager.getConnection(url, username, password);
-            String sql = "";
-
-            PreparedStatement pst = null;
-            pst = (PreparedStatement) conn.prepareStatement(sql);
-            ResultSet rs = pst.executeQuery();
-            while(rs.next()){
-                System.out.println(rs.getString("count"));
-            }
-            rs.close();
-            pst.close();
-            conn.close();
-        } catch (Exception e) {
-            e.printStackTrace();
+                } else if (pushJoinVO.getPacOrder() != null && !"".equals(pushJoinVO.getPacOrder().trim())) {
+                    lisPacsInfoForDJVO.setMealName(pushJoinVO.getPacOrder());
+                    lisPacsInfoForDJVO.setHosCode(pushJoinVO.getHosCode());
+                    pacsConfigDTO = pacsConfigFacade.getPacsConfigByNamesAndHosCode(lisPacsInfoForDJVO);
+                    pushJoinVO.setPacOrder(pacsConfigDTO.get(0).getUniqueName());
+
+                    mrId = mrFacade.createMr(pushJoinVO);
+
+                    url = "http://127.0.0.1:5446/index.html?" +
+                            "mrId=" + mrId +
+                            "&tipsName=" + pushJoinVO.getPacOrder() +
+                            "&tipsType=6" +
+                            "&showTab=1" +
+                            "&hospitalCode=" + pushJoinVO.getHosCode() +
+                            "&plan=7";
+
+                    inputInfo.setRemark("邵逸夫辅检静态知识接口");
+                    inputInfo.setParamOut(url);
+                    inputInfoFacade.saveInputInfo(inputInfo);
+                    return url;
+                }
         }
+        return "暂无推送";
+
+    }
 
-        /*String code = mrFacade.createMr(pushJoinVO);
-        String url =*/
-        return null;
+    public static boolean isNum(String str) {
+        Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
+        return pattern.matcher(str).matches();
     }
 
 }