Browse Source

Merge branch 'dev' of wangjun/wlyy2.0 into dev

wangzhinan 4 years ago
parent
commit
b490b8b8da

+ 80 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java

@ -1732,6 +1732,46 @@ public class XzzxEntranceService{
        return xml;
    }
    /**
     *
     *  获取历史病历
     *
     * @param patientId
     * @param eventNo
     * @return
     * @throws Exception
     */
    public String SelectEmrInfo(String patientId,String eventNo)throws Exception{
        String api = "SelectEmrInfo";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "</root>";
        String condition ="";
        if (!StringUtils.isEmpty(patientId)){
            condition += "<patientId>"+patientId+"</patientId>";
        }
        if (StringUtils.isNotBlank(eventNo)&&!"null".equalsIgnoreCase(eventNo)){
            condition += "<eventNo>"+eventNo+"</eventNo>";
        }
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("SelectEmrInfo params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("SelectEmrInfo json:"+json);
        return json;
    }
//=====================微信模板消息推送===================================
    public String sendMes(String wxId,String patient,String cardNo,String first,String noticeContent,String remark,String redirectUrl){
@ -2423,6 +2463,14 @@ public class XzzxEntranceService{
                    }
                    wlyyPrescriptionVO.setInspectionVOs(wlyyInspectionVOList);
                }
                try {
                    List<WlyyPrescriptionEmrDO> listEmr = selectHistoryEmr(patNo,"");
                    if (null!=listEmr&&listEmr.size()>0){
                        wlyyPrescriptionVO.setWlyyPrescriptionEmrDO(listEmr.get(0));
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
                prescriptionVOList.add(wlyyPrescriptionVO);
            }
        }
@ -3125,6 +3173,38 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
        }
        return jsonObject;
    }
    /**
     * 获取历史病历
     * @param patientId 病人id
     * @param eventNo 病人住院号
     * @return
     */
    public List<WlyyPrescriptionEmrDO> selectHistoryEmr(String patientId,String eventNo) throws Exception {
        String response="";
        String url = entranceUrl+"selectEmrInfo?patientId="+patientId+"&eventNo="+eventNo;
        response = httpClientUtil.get(url,"GBK");
        JSONObject object = JSONObject.parseObject(response);
        List<WlyyPrescriptionEmrDO> wlyyPrescriptionEmrDOList = new ArrayList<>();
        if(object.getInteger("status")==200){
            String obj = object.getString("obj");
            logger.info("obj:"+obj);
            JSONArray array = JSONArray.parseArray(obj.replace("[]","\"\"")).getJSONArray(0);
            logger.info("arrayResponse:"+array.toJSONString());
            for (int i=0;i<array.size();i++){
                JSONObject jsonObject = array.getJSONObject(i);
                logger.info("jsonObject:"+jsonObject);
                WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO = new WlyyPrescriptionEmrDO();
                wlyyPrescriptionEmrDO.setComplaint(null==jsonObject.get("CHIEF_COMPLAINT")?"":jsonObject.get("CHIEF_COMPLAINT").toString());
                wlyyPrescriptionEmrDO.setMedicalHistory(null==jsonObject.get("PRESENT_ILLNESS")?"":jsonObject.get("PRESENT_ILLNESS").toString());
                wlyyPrescriptionEmrDO.setPastHistory(null==jsonObject.get("PAST_HISTORY")?"":jsonObject.get("PAST_HISTORY").toString());
                wlyyPrescriptionEmrDO.setPhysicalExamination(null==jsonObject.get("PHYSICAL_EXAMINATION")?"":jsonObject.get("PHYSICAL_EXAMINATION").toString());
                wlyyPrescriptionEmrDO.setAssistExamination(null==jsonObject.get("OBSERVE_RESULT")?"":jsonObject.get("OBSERVE_RESULT").toString());
                wlyyPrescriptionEmrDO.setAllergicHistory(null==jsonObject.get("ALLERGY_HISTORY")?"":jsonObject.get("ALLERGY_HISTORY").toString());
                wlyyPrescriptionEmrDOList.add(wlyyPrescriptionEmrDO);
            }
        }
        return wlyyPrescriptionEmrDOList;
    }
//=====================hospital应用调用entrance应用============end=================

+ 16 - 0
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/XzzxCotroller.java

@ -605,5 +605,21 @@ public class XzzxCotroller extends EnvelopRestEndpoint {
        WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO = toEntity(emrInfo,WlyyPrescriptionEmrDO.class);
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.returnEmrHtmlByHLW(jsonObject,wlyyPrescriptionEmrDO));
    }
    /**
     * 查询历史就诊病历
     * @param patientId 病人id(必填)
     * @param eventNo 住院号
     * @return
     * @throws Exception
     */
    @GetMapping(value = "/selectEmrInfo")
    @ApiOperation(value = "查询历史就诊病历", notes = "查询历史就诊病历")
    public ObjEnvelop findHistoryEmr (@ApiParam(name = "patientId", value = "病人id", required = false)
                                      @RequestParam(value = "patientId",required = false)String patientId,
                                      @ApiParam(name = "eventNo", value = "住院号", required = false)
                                      @RequestParam(value = "eventNo",required = false)String eventNo)throws Exception{
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.SelectEmrInfo(patientId,eventNo));
    }
}

+ 15 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/Xzyy/XzyyController.java

@ -142,5 +142,20 @@ public class XzyyController extends EnvelopRestEndpoint {
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.updatePreStatus(admNo,realOrder,status));
    }
    /**
     * 查询历史就诊病历
     * @param patientId 病人id(必填)
     * @param eventNo 病人住院号
     * @return
     * @throws Exception
     */
    @GetMapping(value = "/findHistoryEmr")
    @ApiOperation(value = "查询历史就诊病历", notes = "查询历史就诊病历")
    public ObjEnvelop findHistoryEmr(@ApiParam(name = "patientId", value = "病人id", required = false)
                                      @RequestParam(value = "patientId",required = false)String patientId,
                                      @ApiParam(name = "eventNo", value = "病人住院号", required = false)
                                      @RequestParam(value = "eventNo",required = false)String eventNo)throws Exception{
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.selectHistoryEmr(patientId,eventNo));
    }
}