LAPTOP-KB9HII50\70708 пре 3 година
родитељ
комит
aa544ad74e

+ 52 - 44
business/base-service/src/main/java/com/yihu/jw/healthCare/service/HealthCareService.java

@ -280,55 +280,63 @@ public class HealthCareService {
    /**
     * 2.4.1 事前提醒
     */
    public String advanceWarning(String outpatientId) throws Exception{
        WlyyOutpatientDO outpatientDO = outpatientDao.findOne(outpatientId);
        if (outpatientDO == null){
            throw new Exception("事前提醒失败:门诊信息不存在");
        }
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("ylzConfigOrgCode");
        if(hospitalSysDictDO == null){
            throw new Exception("未配置网点编号");
        }
        String icCardNo = outpatientDO.getCardNo();
        String his_serial = outpatientDO.getRegisterNo();
        String org_code = hospitalSysDictDO.getDictCode();
    public String advanceWarning(String prescriptionId){
        try {
            WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
            if (wlyyPrescriptionDO == null){
                throw new Exception("续方信息不存在");
            }
            WlyyOutpatientDO outpatientDO = outpatientDao.findOne(wlyyPrescriptionDO.getOutpatientId());
            if (outpatientDO == null){
                throw new Exception("门诊信息不存在");
            }
            WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("ylzConfigOrgCode");
            if(hospitalSysDictDO == null){
                throw new Exception("未配置网点编号");
            }
        JSONObject data;
        //获取his处方信息
        String getSettleInfoUrl = entranceUrl + "getSettleInfo?icCardNo="+icCardNo+"&his_serial="+his_serial+"&org_code="+org_code;
        String infoResponse = httpClientUtil.get(getSettleInfoUrl,"GBK");
        logger.info("处方infoResponse:"+infoResponse);
        JSONObject infoObject = JSONObject.parseObject(infoResponse);
        if (infoObject.getString("status").equalsIgnoreCase("200")) {
            JSONObject obj = infoObject.getJSONObject("obj");
            if("0".equals(obj.getString("ret_code"))){
                data = obj;
            String icCardNo = outpatientDO.getCardNo();
            String his_serial = outpatientDO.getRegisterNo();
            String org_code = hospitalSysDictDO.getDictCode();
            JSONObject data;
            //获取his处方信息
            String getRecipeInfoUrl = entranceUrl + "getRecipeInfo?icCardNo="+icCardNo+"&his_serial="+his_serial+"&org_code="+org_code;
            String infoResponse = httpClientUtil.get(getRecipeInfoUrl,"GBK");
            logger.info("处方infoResponse:"+infoResponse);
            JSONObject infoObject = JSONObject.parseObject(infoResponse);
            if (infoObject.getString("status").equalsIgnoreCase("200")) {
                JSONObject obj = infoObject.getJSONObject("obj");
                if("0".equals(obj.getString("ret_code"))){
                    data = obj;
                }else {
                    throw new Exception("获取his处方信息失败:"+obj.getString("ret_mess"));
                }
            }else {
                throw new Exception("获取his处方信息失败:"+obj.getString("ret_mess"));
                throw new Exception("获取his处方信息失败");
            }
        }else {
            throw new Exception("获取his处方信息失败");
        }
        data.remove("ret_code");
        data.remove("ret_mess");
        data.remove("log_no");
            data.remove("ret_code");
            data.remove("ret_mess");
            data.remove("log_no");
        data.put("ticket_no","");//	单据流水号
            data.put("ticket_no","");//	单据流水号
        String result = requestYlz(data,"N20.17.03.03","事前提醒");
        if(result == null){
            throw new Exception("医保请求失败");
        }
        logger.info("事前提醒:"+result);
        JSONObject object = JSONObject.parseObject(result);
        if (object.getString("flag").equalsIgnoreCase("1")){
            JSONObject encryptData = object.getJSONObject("encrypt_data");
            return encryptData.toJSONString();
            String result = requestYlz(data,"N20.17.03.03","事前提醒");
            if(result == null){
                throw new Exception("医保请求失败");
            }
            logger.info("事前提醒:"+result);
            JSONObject object = JSONObject.parseObject(result);
            if (object.getString("flag").equalsIgnoreCase("1")){
                JSONObject encryptData = object.getJSONObject("encrypt_data");
                return encryptData.toJSONString();
            }
            return result;
        }catch (Exception e){
            e.printStackTrace();
        }
        return result;
        return null;
    }
    /**
@ -355,8 +363,8 @@ public class HealthCareService {
        JSONObject data;
        //获取his处方信息
        String getSettleInfoUrl = entranceUrl + "getSettleInfo?icCardNo="+icCardNo+"&his_serial="+his_serial+"&org_code="+org_code;
        String infoResponse = httpClientUtil.get(getSettleInfoUrl,"GBK");
        String getRecipeInfoUrl = entranceUrl + "getRecipeInfo?icCardNo="+icCardNo+"&his_serial="+his_serial+"&org_code="+org_code;
        String infoResponse = httpClientUtil.get(getRecipeInfoUrl,"GBK");
        logger.info("处方infoResponse:"+infoResponse);
        JSONObject infoObject = JSONObject.parseObject(infoResponse);
        if (infoObject.getString("status").equalsIgnoreCase("200")) {

+ 9 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -9153,6 +9153,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                            wlyyPrescriptionDO.setAdmNo(outpatientDO.getAdmNo());
                            wlyyPrescriptionDO.setSerialNo(outpatientDO.getAdmNo());
                            wlyyPrescriptionDO.setRealOrder(realOrder);
                            //调医保接口
                            try {
                                healthCareService.advanceWarning(wlyyPrescriptionDO.getId());
                                healthCareService.doctorPrescriptionUpload(wlyyPrescriptionDO.getId());
                            }catch (Exception e){
                                e.printStackTrace();
                            }
                        }
                    }
                    logger.info("进入处方签名");

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

@ -2536,6 +2536,45 @@ public class XzzxEntranceService{
        return json;
    }
    /**
     * 2.1.3	获取处方信息
     * @return
     */
    public String getRecipeInfo(String icCardNo,String his_serial,String org_code)throws Exception{
        String api = "getRecipeInfo";
        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(icCardNo)){
            condition += "<icCardNo>"+icCardNo+"</icCardNo>";
        }
        if (!StringUtils.isEmpty(his_serial)){
            condition += "<his_serial>"+his_serial+"</his_serial>";
        }
        if (!StringUtils.isEmpty(org_code)){
            condition += "<org_code>"+org_code+"</org_code>";
        }
        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("getRecipeInfo params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
        logger.info("getRecipeInfo json:"+xml);
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        return json;
    }
    /**
     * 2.1.4电子票开票结果确认
     *

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

@ -216,22 +216,22 @@ public class XzzxCotroller extends EnvelopRestEndpoint {
    }
    /**
     * 2.1.1	获取患者结算信息
     * 2.1.3	获取患者结算信息
     * @param icCardNo 社保卡号(必传)
     * @param his_serial his挂号号(必传)
     * @param org_code 医院编码(必传)
     * @return
     * @throws Exception
     */
    @GetMapping(value = "/getSettleInfo")
    @ApiOperation(value = "获取患者结算信息", notes = "获取患者结算信息")
    public ObjEnvelop getSettleInfo(@ApiParam(name = "icCardNo", value = "社保卡号", required = true)
    @GetMapping(value = "/getRecipeInfo")
    @ApiOperation(value = "获取处方信息", notes = "获取处方信息")
    public ObjEnvelop getRecipeInfo(@ApiParam(name = "icCardNo", value = "社保卡号", required = true)
                                            @RequestParam(value = "icCardNo",required = true)String icCardNo,
                                            @ApiParam(name = "his_serial", value = "his挂号号", required = true)
                                            @RequestParam(value = "his_serial",required = true)String his_serial,
                                            @ApiParam(name = "org_code", value = "医院编码", required = true)
                                            @RequestParam(value = "org_code",required = true)String org_code)throws Exception{
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.getSettleInfo(icCardNo,his_serial,org_code));
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.getRecipeInfo(icCardNo,his_serial,org_code));
    }
    /**