Browse Source

眼科医保结算流程

wangzhinan 1 year ago
parent
commit
5bc5ff09bf

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

@ -2153,7 +2153,7 @@ public class HealthCareService {
    }
    public Boolean isHospitalFlag(){
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("medicalFlagTest");
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("medicalFlag");
        if (hospitalSysDictDO!=null){
            if (hospitalSysDictDO.getDictValue().equalsIgnoreCase("1")){
                return true;

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

@ -339,6 +339,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private ZhongShanSMSService zhongShanSMSService;
    @Autowired
    private BaseDictIcd10Dao dictIcd10Dao;
    @Autowired
    private YkyyPrescriptionService ykyyPrescriptionService;
    public static String entranceUrl = "http://172.16.100.240:10023/xzzx/";
@ -15448,8 +15450,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @throws Exception
     */
    public String ybRefund(String outpatientId,String remark) throws Exception {
        YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByOutpatient(outpatientId);
        if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
            YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByOutpatient(outpatientId);
            String preSettlementRefundRes = healthCareService.preSettlementRefund(outpatientId);
            com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(preSettlementRefundRes);
            if (object.getString("flag").equalsIgnoreCase("1")){
@ -15472,6 +15474,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            }
            return preSettlementRefundRes;
        }else {
            List<YlzMedicalRelationDO> ylzMedicalRelationDOS = ylzMedicailRelationDao.findByOutpatientNoStatus(outpatientId);
            YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicalRelationDOS.get(0);
            String preSettlementRefundRes = healthCareNewService.preSettlementRefund(outpatientId);
            com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(preSettlementRefundRes);
            if (object.getString("flag").equalsIgnoreCase("1")){
@ -15487,6 +15491,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        logger.info("医保挂号冲销成功!");
                        ylzMedicalRelationDO.setStatus(0);
                        ylzMedicailRelationDao.save(ylzMedicalRelationDO);
                        if (wechatId.equalsIgnoreCase("xm_ykyy_wx")){
                            ykyyPrescriptionService.updateHisHlwMzybjs(ylzMedicalRelationDO);
                            ykyyPrescriptionService.requestBillingNew(ylzMedicalRelationDO.getRelationCode(),2);
                        }
                    }
                }
            }

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

@ -67,6 +67,7 @@ import com.yihu.utils.security.MD5;
import jdk.nashorn.internal.ir.IfNode;
import nuonuo.open.sdk.NNOpenSDK;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang.time.DateUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -150,6 +151,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    private PrescriptionLogDao prescriptionLogDao;
    private final static String saveUrl="http://192.168.20.55:10023/ykyy/save";
    private final static String updateEntityUrl="http://192.168.20.55:10023/ykyy/update";
    private final static String url="http://192.168.20.55:10023/ykyy/createSQLQuery";
@ -1300,6 +1302,10 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                    e.printStackTrace();
                }
                HlwMzybjsDO hlwMzybjsDO = new HlwMzybjsDO();
                PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(outpatientDO.getPatient());
                if (patientMappingDO!=null){
                    hlwMzybjsDO.setBrid(patientMappingDO.getMappingCode());
                }
                hlwMzybjsDO.setInsuranceSerial(ylzMedicalRelationDO.getInsuranceSerial());
                hlwMzybjsDO.setAccountBalance(Double.parseDouble(ylzMedicalRelationDO.getAccountBalance()));
                hlwMzybjsDO.setBillSerial(ylzMedicalRelationDO.getBillSerial());
@ -1347,7 +1353,8 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                hlwMzybjsDO.setPayTime(DateUtil.dateToShortStrHh(ylzMedicalRelationDO.getPayDate()));
                hlwMzybjsDO.setCollector(ylzMedicalRelationDO.getCollector());
                hlwMzybjsDO.setJsrq(new Date());
                hlwMzybjsDO.setFphm(invoiceDO.getInvoiceNo());
                logger.info("发票流水号"+invoiceDO.getInvoiceSerialNum());
                hlwMzybjsDO.setFphm(invoiceDO.getInvoiceSerialNum());
                String jsonString1 = JSONObject.toJSONString(hlwMzybjsDO);
                logger.info("医保结算============");
                Map<String,Object> params1 = new HashedMap();
@ -1473,6 +1480,18 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    }
    /**
     * 更新作废
     * @param relationDO
     * @return
     * @throws Exception
     */
    public void updateHisHlwMzybjs(YlzMedicalRelationDO relationDO) throws Exception {
        String updatesql = "update v_hlw_mzybjs set zfpb=1,zfrq= to_date('" + DateUtil.getStringDate() + "', 'yyyy-mm-dd hh24:mi:ss')"+" where INSURANCE_SERIAL='"+relationDO.getInsuranceSerial()+"' ";
        ykyyEntranceService.updateHisStatus(updatesql);
    }
   //============================电子发票=========================
@ -1550,7 +1569,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        String content = "";
        JSONObject object = new JSONObject();
        JSONObject order = new JSONObject();
        order.put("buyerName","王云海");
        order.put("buyerName",medicalRelationDO.getName());
        order.put("buyerTaxNum",salertaxnum);
        order.put("buyerTel",salertel);
        order.put("buyerAddress",saleraddress);
@ -1560,7 +1579,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        order.put("salerAddress",saleraddress);
        order.put("salerAccount",saleraccount);
        order.put("orderNo",medicalRelationDO.getHisSettleNo());
        order.put("invoiceDate","2022-01-13 12:30:00");//订单时间
        order.put("invoiceDate",DateUtil.dateToStrLong(medicalRelationDO.getPayDate()));//订单时间
        order.put("clerkId","2527");
        order.put("clerk","互联网医院");
        order.put("pushMode","-1");//推送方式:-1,不推送;0,邮箱;1,手机(默认);2,邮箱、手机
@ -1573,8 +1592,8 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                throw new Exception("发票代码为空,不能冲红");
            }
            order.put("invoiceType","2");//开票类型:1:蓝票;2:红票 (全电发票暂不支持红票)
            order.put("invoiceCode","");//
            order.put("invoiceNum","");//
            order.put("invoiceCode",ylzMedicalRelationInvoiceDO.getInvoiceCode());//
            order.put("invoiceNum",ylzMedicalRelationInvoiceDO.getInvoiceNo());//
            ylzMedicalRelationInvoiceDO.setStatus(2);
        }
        order.put("invoiceLine","p");
@ -1697,7 +1716,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                ylzMedicalRelationInvoiceDO.setInvoiceNo(res.getString("invoiceNo"));
                ylzMedicalRelationInvoiceDO.setResult(result);
                ylzMedicalRelationInvoiceDO.setCreateTime(new Date());
                ylzMedicailRelationInvoiceDao.save(ylzMedicalRelationInvoiceDO);
                ylzMedicalRelationInvoiceDO = ylzMedicailRelationInvoiceDao.save(ylzMedicalRelationInvoiceDO);
            }
        }
        return ylzMedicalRelationInvoiceDO;

+ 3 - 3
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -19,13 +19,13 @@ public abstract class IntegerIdentityEntity implements Serializable {
    @Id
//==========mysql 环境 id策略======================================================
/*    @GeneratedValue(generator = "generator")
    @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "identity")
    @Column(name = "id", unique = true, nullable = false)*/
    @Column(name = "id", unique = true, nullable = false)
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
/*   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
        return id;

+ 12 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/HlwMzybjsDO.java

@ -64,6 +64,18 @@ public class HlwMzybjsDO {
    private Integer zfpb;//作废判别ZFPB
    private Date zfrq;//作废日期ZFRQ
    private String brid;//病人id
    @Basic
    @Column(name = "BRID")
    public String getBrid() {
        return brid;
    }
    public void setBrid(String brid) {
        this.brid = brid;
    }
    @Id
    @Column(name = "INSURANCE_SERIAL")

+ 1 - 1
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/YkyyController.java

@ -79,7 +79,7 @@ public class YkyyController extends EnvelopRestEndpoint {
    @GetMapping(value = "/update")
    @ApiOperation(value = "更新支付")
    @ApiOperation(value = "更新实体")
    public ObjEnvelop udapte(@ApiParam(name = "json", value = "json", required = true)
                                 @RequestParam(value = "json",required = true)String json,
                             @ApiParam(name = "table", value = "table", required = true)

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

@ -3712,7 +3712,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @PostMapping("/ybRefund")
    @ApiOperation(value = "确认费用结算", notes = "确认费用结算")
    @ApiOperation(value = "医保冲销", notes = "医保冲销")
    public Envelop ybRefund(
            @ApiParam(name = "outpatientId", value = "outpatientId")
            @RequestParam(value = "outpatientId", required = true) String outpatientId,