瀏覽代碼

眼科医保结算流程

wangzhinan 1 年之前
父節點
當前提交
055a3df25d

+ 26 - 0
business/base-service/src/main/java/com/yihu/jw/healthCare/service/HealthCareNewService.java

@ -93,6 +93,8 @@ public class HealthCareNewService {
    private EntranceService entranceService;
    @Autowired
    private PrescriptionDiagnosisDao prescriptionDiagnosisDao;
    @Autowired
    private YlzMedicailRelationRefundDao ylzMedicailRelationRefundDao;
    private String ylzConfigUrl;
    private String ylzConfigAppid;
@ -1307,6 +1309,14 @@ public class HealthCareNewService {
            String invalidSerial = encryptData.getString("refund_serial");
            logger.info("医保挂号冲销流水号保存成功");
        }
        YlzMedicalRelationRefundDO ylzMedicalRelationRefundDO = new YlzMedicalRelationRefundDO();
        ylzMedicalRelationRefundDO.setCode(funid);
        ylzMedicalRelationRefundDO.setName("医保挂号冲销");
        ylzMedicalRelationRefundDO.setRequest(data.toJSONString());
        ylzMedicalRelationRefundDO.setResponse(result);
        ylzMedicalRelationRefundDO.setYlzMedicalRelationId(ylzMedicalRelationDO.getId());
        ylzMedicalRelationRefundDO.setCreateTime(new Date());
        ylzMedicailRelationRefundDao.save(ylzMedicalRelationRefundDO);
        return result;
    }
@ -1477,6 +1487,14 @@ public class HealthCareNewService {
        if (object.getString("flag").equalsIgnoreCase("1")){
            logger.info("医保费用明细上传冲销保存成功");
        }
        YlzMedicalRelationRefundDO ylzMedicalRelationRefundDO = new YlzMedicalRelationRefundDO();
        ylzMedicalRelationRefundDO.setCode(funid);
        ylzMedicalRelationRefundDO.setName("医保费用明细上传冲销");
        ylzMedicalRelationRefundDO.setRequest(data.toJSONString());
        ylzMedicalRelationRefundDO.setResponse(result);
        ylzMedicalRelationRefundDO.setYlzMedicalRelationId(ylzMedicalRelationDO.getId());
        ylzMedicalRelationRefundDO.setCreateTime(new Date());
        ylzMedicailRelationRefundDao.save(ylzMedicalRelationRefundDO);
        return result;
    }
@ -1760,6 +1778,14 @@ public class HealthCareNewService {
            JSONObject encryptData = object.getJSONObject("encrypt_data");
            logger.info("医保结算冲销服务保存成功");
        }
        YlzMedicalRelationRefundDO ylzMedicalRelationRefundDO = new YlzMedicalRelationRefundDO();
        ylzMedicalRelationRefundDO.setCode(funid);
        ylzMedicalRelationRefundDO.setName("医保结算冲销服务");
        ylzMedicalRelationRefundDO.setRequest(data.toJSONString());
        ylzMedicalRelationRefundDO.setResponse(result);
        ylzMedicalRelationRefundDO.setYlzMedicalRelationId(ylzMedicalRelationDO.getId());
        ylzMedicalRelationRefundDO.setCreateTime(new Date());
        ylzMedicailRelationRefundDao.save(ylzMedicalRelationRefundDO);
        return result;
    }

+ 26 - 0
business/base-service/src/main/java/com/yihu/jw/healthCare/service/HealthCareService.java

@ -93,6 +93,8 @@ public class HealthCareService {
    private EntranceService entranceService;
    @Autowired
    private PrescriptionDiagnosisDao prescriptionDiagnosisDao;
    @Autowired
    private YlzMedicailRelationRefundDao ylzMedicailRelationRefundDao;
    private String ylzConfigUrl;
    private String ylzConfigAppid;
@ -1274,6 +1276,14 @@ public class HealthCareService {
            String invalidSerial = encryptData.getString("refund_serial");
            logger.info("医保挂号冲销流水号保存成功");
        }
        YlzMedicalRelationRefundDO ylzMedicalRelationRefundDO = new YlzMedicalRelationRefundDO();
        ylzMedicalRelationRefundDO.setCode(funid);
        ylzMedicalRelationRefundDO.setName("医保挂号冲销");
        ylzMedicalRelationRefundDO.setRequest(data.toJSONString());
        ylzMedicalRelationRefundDO.setResponse(result);
        ylzMedicalRelationRefundDO.setYlzMedicalRelationId(ylzMedicalRelationDO.getId());
        ylzMedicalRelationRefundDO.setCreateTime(new Date());
        ylzMedicailRelationRefundDao.save(ylzMedicalRelationRefundDO);
        return result;
    }
@ -1437,6 +1447,14 @@ public class HealthCareService {
        if (object.getString("flag").equalsIgnoreCase("1")){
            logger.info("医保费用明细上传冲销保存成功");
        }
        YlzMedicalRelationRefundDO ylzMedicalRelationRefundDO = new YlzMedicalRelationRefundDO();
        ylzMedicalRelationRefundDO.setCode(funid);
        ylzMedicalRelationRefundDO.setName("医保费用明细上传冲销");
        ylzMedicalRelationRefundDO.setRequest(data.toJSONString());
        ylzMedicalRelationRefundDO.setResponse(result);
        ylzMedicalRelationRefundDO.setYlzMedicalRelationId(ylzMedicalRelationDO.getId());
        ylzMedicalRelationRefundDO.setCreateTime(new Date());
        ylzMedicailRelationRefundDao.save(ylzMedicalRelationRefundDO);
        return result;
    }
@ -1715,6 +1733,14 @@ public class HealthCareService {
            JSONObject encryptData = object.getJSONObject("encrypt_data");
            logger.info("医保结算冲销服务保存成功");
        }
        YlzMedicalRelationRefundDO ylzMedicalRelationRefundDO = new YlzMedicalRelationRefundDO();
        ylzMedicalRelationRefundDO.setCode(funid);
        ylzMedicalRelationRefundDO.setName("医保结算冲销服务");
        ylzMedicalRelationRefundDO.setRequest(data.toJSONString());
        ylzMedicalRelationRefundDO.setResponse(result);
        ylzMedicalRelationRefundDO.setYlzMedicalRelationId(ylzMedicalRelationDO.getId());
        ylzMedicalRelationRefundDO.setCreateTime(new Date());
        ylzMedicailRelationRefundDao.save(ylzMedicalRelationRefundDO);
        return result;
    }

+ 17 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/healthCare/YlzMedicailRelationRefundDao.java

@ -0,0 +1,17 @@
package com.yihu.jw.hospital.healthCare;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalRelationDO;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalRelationRefundDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by wangzhinan 20211003
 * 医保冲销记录
 */
public interface YlzMedicailRelationRefundDao extends PagingAndSortingRepository<YlzMedicalRelationRefundDO, String>, JpaSpecificationExecutor<YlzMedicalRelationRefundDO> {
}

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

@ -15433,6 +15433,61 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    /**
     * 医保冲销
     *
     * @param outpatientId
     * @param remark
     * @return
     * @throws Exception
     */
    public String ybRefund(String outpatientId,String remark) throws Exception {
        YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByOutpatient(outpatientId);
        if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
            String preSettlementRefundRes = healthCareService.preSettlementRefund(outpatientId);
            com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(preSettlementRefundRes);
            if (object.getString("flag").equalsIgnoreCase("1")){
                com.alibaba.fastjson.JSONObject encryptData = object.getJSONObject("encrypt_data");
                logger.info("医保结算冲销服务保存成功");
                String feeDetailRefundRes =healthCareService.feeDetailRefund(outpatientId,remark);
                com.alibaba.fastjson.JSONObject object1 = com.alibaba.fastjson.JSONObject.parseObject(feeDetailRefundRes);
                if (object1.getString("flag").equalsIgnoreCase("1")){
                    com.alibaba.fastjson.JSONObject encryptData1 = object1.getJSONObject("encrypt_data");
                    logger.info("医保费用明细上传冲销成功!");
                    String  registerBackRes = healthCareService.registerBack(outpatientId);
                    com.alibaba.fastjson.JSONObject registerbackObj = com.alibaba.fastjson.JSONObject.parseObject(registerBackRes);
                    if (registerbackObj.getString("flag").equalsIgnoreCase("1")){
                        com.alibaba.fastjson.JSONObject encryptData2 = registerbackObj.getJSONObject("encrypt_data");
                        logger.info("医保挂号冲销成功!");
                        ylzMedicalRelationDO.setStatus(1);
                        ylzMedicailRelationDao.save(ylzMedicalRelationDO);
                    }
                }
            }
            return preSettlementRefundRes;
        }else {
            String preSettlementRefundRes = healthCareNewService.preSettlementRefund(outpatientId);
            com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(preSettlementRefundRes);
            if (object.getString("flag").equalsIgnoreCase("1")){
                logger.info("医保结算冲销服务保存成功");
                String feeDetailRefundRes =healthCareNewService.feeDetailRefund(outpatientId,remark);
                com.alibaba.fastjson.JSONObject object1 = com.alibaba.fastjson.JSONObject.parseObject(feeDetailRefundRes);
                if (object1.getString("flag").equalsIgnoreCase("1")){
                    logger.info("医保费用明细上传冲销成功!");
                    String  registerBackRes = healthCareNewService.registerBack(outpatientId);
                    com.alibaba.fastjson.JSONObject registerbackObj = com.alibaba.fastjson.JSONObject.parseObject(registerBackRes);
                    if (registerbackObj.getString("flag").equalsIgnoreCase("1")){
                        com.alibaba.fastjson.JSONObject encryptData2 = registerbackObj.getJSONObject("encrypt_data");
                        logger.info("医保挂号冲销成功!");
                        ylzMedicalRelationDO.setStatus(0);
                        ylzMedicailRelationDao.save(ylzMedicalRelationDO);
                    }
                }
            }
            return preSettlementRefundRes;
        }
    }
    /**

+ 27 - 4
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java

@ -49,10 +49,7 @@ import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.utils.CheckSumBuilder;
import com.yihu.jw.utils.FileUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.YkyySMSService;
import com.yihu.jw.utils.*;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
@ -1441,4 +1438,30 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        }
    }
   //============================电子发票=========================
    public String dzfp() throws Exception {
        String url = "http://10.110.98.135:8090/dataReport/services/HipService?wsdl";
        String namespace="OutPatientBilling";
        String api="OutPatientBilling";
        String msgHeader ="<Sender>HIS</Sender>\n" +
                "<MsgType>MR_0101</MsgType>\n" +
                "<MsgVersion>3.0</MsgVersion>";
        String param = "\t<ClerkId>王云海</ClerkId>\n" +
                "\t<BuyerName>王云海</BuyerName>\n" +
                "\t<BuyerTaxNum></BuyerTaxNum>\n" +
                "\t<BuyerTel>13850005761</BuyerTel>\n" +
                "\t<BuyerAddress></BuyerAddress>\n" +
                "\t<BuyerAccount></BuyerAccount>\n" +
                "\t<PushMode>1</PushMode>\n" +
                "\t<BuyerPhone></BuyerPhone>\n" +
                "\t<Email></Email>\n" +
                "\t<PatientId>569768</PatientId>\n" +
                "\t<BillNo>123456</BillNo>\n" +
                "\t<Extra></Extra>";
        Map<String,String> params = new HashedMap();
        params.put("MsgHeader",msgHeader);
        params.put("Param",param);
        return WebserviceUtil.postYk(url,api,params);
    }
}

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

@ -3963,6 +3963,8 @@ public class YkyyEntranceService {
            medicalMxDO.setMedicalPerName(doctorDO.getName());
            if (StringUtils.isNoneBlank(infoDO.getSfybxm())){
                medicalMxDO.setLimitType(infoDO.getSfybxm());
            }else {
                medicalMxDO.setLimitType("Y");
            }
            medicalMxDO.setHisItemCode(infoDO.getGjbm());
            medicalMxDO.setHisItemName(infoDO.getGjmc());

+ 51 - 0
business/base-service/src/main/java/com/yihu/jw/utils/WebserviceUtil.java

@ -69,4 +69,55 @@ public class WebserviceUtil {
        }
    }
    /**
     * webservice 调用接口
     */
    public static String postYk(String urlString,String api, Map<String,String> params) throws Exception {
        try {
            logger.info("url:"+urlString);
            logger.info("service:"+api);
            Service service = new Service();
            logger.info("=======>通过service创建call对象");
            Call call = (Call) service.createCall();// 通过service创建call对象
            logger.info("=======>设置service所在URL");
            // 设置service所在URL
            call.setTargetEndpointAddress(new java.net.URL(urlString));
            call.setOperationName(new QName(api));
            call.setUseSOAPAction(true);
            Object[] objs = null;
            logger.info("=======>组装参数:"+params.size());
            if(params!=null && params.size()>0)
            {
                logger.info("=======>遍历参数");
                objs = new Object[params.size()];
                int i=0;
                for(String key : params.keySet())
                {
                    logger.info("=======>参数key:"+key);
                    logger.info("=======>接口参数:"+key);
                    call.addParameter(new QName(key), org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);//接口的参数
                    logger.info("=======>参数值:"+params.get(key));
                    objs[i] = params.get(key);
                    i++;
                }
            }
            logger.info("=======>设置返回类型");
            call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);//设置返回类型
            logger.info("=======>开始请求");
            String  ret = (String)call.invoke(objs);
            logger.info("=======>请求结果:"+ret);
            logger.info("=======>请求结果.toString():"+ret.toString());
            return ret.toString();
        } catch (Exception e) {
            logger.info("=======>CA请求报错:"+e.getMessage());
            e.printStackTrace();
            throw e;
        }
    }
}

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

@ -3710,6 +3710,21 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        }
    }
    @PostMapping("/ybRefund")
    @ApiOperation(value = "确认费用结算", notes = "确认费用结算")
    public Envelop ybRefund(
            @ApiParam(name = "outpatientId", value = "outpatientId")
            @RequestParam(value = "outpatientId", required = true) String outpatientId,
            @ApiParam(name = "remark", value = "remark")
            @RequestParam(value = "remark", required = false) String remark) throws Exception {
        try {
            return success("操作成功", prescriptionService.ybRefund(outpatientId,remark));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
    }
    @PostMapping("/selectMedicareStatus")
    @ApiOperation(value = "查询是否有医保已结算", notes = "查询是否有医保已结算")
    public Envelop selectMedicareStatus(

+ 22 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/ykyy/YkyyController.java

@ -3,6 +3,7 @@ package com.yihu.jw.hospital.endpoint.ykyy;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.YkyyPrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.im.dao.ConsultTeamDao;
@ -53,6 +54,8 @@ public class YkyyController extends EnvelopRestEndpoint {
    private ConsultTeamDao consultTeamDao;
    @Autowired
    private PrescriptionService prescriptionService;
    @Autowired
    private YkyyPrescriptionService ykyyPrescriptionService;
    @Value("${demo.flag}")
    private boolean demoFlag;
@ -524,4 +527,23 @@ public class YkyyController extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    /**
     *
     * 电子病历
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "dzfp", method = RequestMethod.POST)
    @ApiOperation("电子病历")
    public ObjEnvelop dzfp() throws Exception {
        try {
            ykyyPrescriptionService.dzfp();
            return ObjEnvelop.getSuccess("ok","");
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
}