Browse Source

[医保代码]

wangzhinan 3 years ago
parent
commit
cbb26debae

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

@ -11994,7 +11994,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    public Map saveNatAppointment(String chargeAmount,String inspectionName,String mediaCard,String patientId,String name,String cardNo,String cardType,String mobile,
                                   String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName,String pm,String pushFlag,String cardNoType,String consumer,
                                  String checkPart,String chargeFlag,String chargeCode,String icdCode,String preNo) throws Exception {
                                  String checkPart,String chargeFlag,String chargeCode,String icdCode,String preNo,String idnoType) throws Exception {
        Map returnMap = new HashMap();
        Integer winNo = 6;
        if (checkPart==null||checkPart==""){
@ -12040,6 +12040,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            jsondate.put("targetChild",secondJobName);
            jsondate.put("target",firstJobName);
            jsondate.put("quantity",1);
            jsondate.put("idno_type",idnoType);
            Map<String,Object> map = findRandomDoctor();
            net.sf.json.JSONObject rs = new JSONObject();
            if (map!=null){
@ -12087,6 +12088,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    baseNatAppointmentDO.setIcdCode(icdCode);
                    baseNatAppointmentDO.setChargeCode(chargeCode);
                    baseNatAppointmentDO.setWinNo(String.valueOf(winNo));
                    baseNatAppointmentDO.setIdnoType(idnoType);
                    baseNatAppointmentDO.setDept("3150000");
                    baseNatAppointmentDO.setDeptName("感染疾病科");
                    baseNatAppointmentDO.setAmpm(pm);
@ -12259,6 +12261,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            baseNatAppointmentDO.setAmpm(pm);
            baseNatAppointmentDO.setHospitalFlag(pushFlag);
            baseNatAppointmentDO.setConsumer(consumer);
            baseNatAppointmentDO.setIdnoType(idnoType);
            BasePatientDO basePatientDO = basePatientDao.findById(consumer);
            baseNatAppointmentDO.setConsumerName(basePatientDO.getName());
            baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
@ -12388,6 +12391,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                baseNatAppointmentDO.setName(name);
                baseNatAppointmentDO.setCardNo(cardNo.trim());
                baseNatAppointmentDO.setCardType(cardType);
                baseNatAppointmentDO.setIdnoType(idnoType);
                baseNatAppointmentDO.setAddress(address);
                baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDateLong(natTime));
                baseNatAppointmentDO.setOderNum(orderNum);

+ 3 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -1096,7 +1096,9 @@ public class EntranceService {
                if (StringUtils.isNotBlank(vo.getArea())) {
                    sbs.append(" area=\"" + vo.getArea() + "\"");
                }
                if (StringUtils.isNotBlank(vo.getIdnoType())) {
                    sbs.append(" idno_type=\"" + vo.getIdnoType() + "\"");
                }
                if (StringUtils.isNotBlank(vo.getTarget())) {
                    sbs.append(" target=\"" + vo.getTarget() + "\"");
                }

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

@ -624,6 +624,35 @@ public class YkyyEntranceService {
        return new JSONArray();
    }
    /**
     * 查找眼科his 未审核未付款
     * @throws Exception
     */
    public JSONArray getUnCheckPrescription(String startTime,String endTime) throws Exception{
        String sql = "SELECT h.BRID,h.CFSB,h.SJLY from v_ms_dd01 h WHERE h.SPZT = 0 and h.FKZT = 0 ";
        if(!StringUtil.isBlank(startTime)){
            sql += " and h.KFRQ >= to_date('"+startTime+"', 'YYYY-MM-DD HH24:MI:SS')";
        }
        if(!StringUtil.isBlank(endTime)){
            sql += " and h.KFRQ <= to_date('"+endTime+"', 'YYYY-MM-DD HH24:MI:SS')";
        }
        sql+=" order by h.KFRQ desc ";
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        params.put("page","1");
        params.put("size","60");
        HttpResponse response = HttpUtils.doGet(jdbcUrl,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if(status!=null&&status == 200){
            return rs.getJSONArray("detailModelList");
        }
        return new JSONArray();
    }
    /**
     * HIS就诊患者历史查询
     * @throws Exception

+ 11 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/BaseNatAppointmentDO.java

@ -2,6 +2,7 @@ package com.yihu.jw.entity.hospital.prescription;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -60,6 +61,7 @@ public class BaseNatAppointmentDO extends IntegerIdentityEntity {
    private String consumer;
    private String consumerName;
    private String oderNum;
    private String idnoType;
    public String getOderNum() {
        return oderNum;
@ -453,4 +455,13 @@ public class BaseNatAppointmentDO extends IntegerIdentityEntity {
    public void setConsumerName(String consumerName) {
        this.consumerName = consumerName;
    }
    @Column(name = "idno_type")
    public String getIdnoType() {
        return idnoType;
    }
    public void setIdnoType(String idnoType) {
        this.idnoType = idnoType;
    }
}

+ 7 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyHisPrescriptionVO.java

@ -145,9 +145,16 @@ public class WlyyHisPrescriptionVO extends UuidIdentityVOWithOperator {
    private String target;
    private String targetChild;
    private String idnoType;
    public String getIdnoType() {
        return idnoType;
    }
    public void setIdnoType(String idnoType) {
        this.idnoType = idnoType;
    }
    public String getCardNo() {
        return cardNo;

+ 40 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/ykyy/UnCheckPrescriptionJob.java

@ -0,0 +1,40 @@
package com.yihu.jw.job.ykyy;
import com.yihu.jw.service.channel.PrescriptionStatusUpdateService;
import com.yihu.jw.service.channel.UnSettledHISPrescriptionService;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
 * 定时查询HIS的01表中的审方状态,如果已审方,且未结算,则推送一条模板消息给居民,让居民进行支付结算。
 * Created by yeshijie on 2020/4/26.
 *
 * @author yeshijie.
 */
@DisallowConcurrentExecution
public class UnCheckPrescriptionJob implements Job{
    private static final Logger logger = LoggerFactory.getLogger(UnCheckPrescriptionJob.class);
    @Autowired
    private PrescriptionStatusUpdateService prescriptionStatusUpdateService;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("START========unCheckPrescription========");
        try {
            prescriptionStatusUpdateService.unCheckPrescription();
            logger.info("END========unCheckPrescription 执行结束========");
        }catch (Exception e){
            e.printStackTrace();
            logger.error("END===ERROE===unCheckPrescription,message:"+e.getMessage());
        }
    }
}

+ 77 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/PrescriptionStatusUpdateService.java

@ -1,8 +1,12 @@
package com.yihu.jw.service.channel;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.WxPushLogDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO;
import com.yihu.jw.entity.hospital.doctor.WlyyPatientRegisterTimeDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
@ -26,9 +30,15 @@ import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.status.EnvelopStatus;
import com.yihu.jw.sms.dao.HospitalSysDictDao;
import com.yihu.jw.util.DateUtil;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.http.HttpUtils;
import com.yihu.jw.utils.YkyySMSService;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.wechat.dao.WxPushLogDao;
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;
@ -87,6 +97,16 @@ public class PrescriptionStatusUpdateService {
    private PrescriptionService prescriptionService;
    @Autowired
    private SystemMessageService systemMessageService;
    @Autowired
    private YkyyEntranceService ykyyEntranceService;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Autowired
    private HospitalSysDictDao hospitalSysDictDao;
    @Autowired
    private WxPushLogDao wxPushLogDao;
    @Autowired
    private YkyySMSService ykyySMSService;
    public void autoPush() throws Exception {
@ -831,6 +851,63 @@ public class PrescriptionStatusUpdateService {
        return msgReurn;
    }
    public void unCheckPrescription() throws Exception {
        String startTime= DateUtil.getStringDateShort() +" 00:00:00";
        String endTime= DateUtil.getStringDateShort() +" 23:59:59";
        JSONArray array = ykyyEntranceService.getUnCheckPrescription(startTime,endTime);
        String sendMesControl = "1";//1 开启发送短信 0 关闭
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = hospitalSysDictDao.findById("ykSmsControl");
        WlyyHospitalSysDictDO yunweiSysDict = hospitalSysDictDao.findById("yunweiMobile");
        String remind = yunweiSysDict.getDictValue();
        String mobiles = yunweiSysDict.getDictCode();
        if (wlyyHospitalSysDictDO!=null){
            sendMesControl = wlyyHospitalSysDictDO.getDictValue();
        }
        if(array!=null&&array.size()>0) {
            for (int i = 0; i < array.size(); i++) {
                JSONObject json = array.getJSONObject(i);
                String brid = json.getString("BRID");
                String cfsb = json.getString("CFSB");
                //查找居民信息
                BasePatientDO patientDO = ykyyEntranceService.findPatientByMapingCode(brid);
                if (patientDO != null) {
                    //查找对应的处方
                    String sql = "SELECT w.OUTPATIENT_ID,w.ID,w.DOCTOR_NAME,to_char(w.CREATE_TIME ,'yyyy/MM/dd hh24:mi:ss' ) as CREATE_TIME from WLYY_PRESCRIPTION w WHERE REAL_ORDER = '" + cfsb + "' ORDER BY w.CREATE_TIME desc";
                    List<Map<String, Object>> pre = hibenateUtils.createSQLQuery(sql);
                    if(pre!=null && pre.size()>0){
                        String outpatientId = pre.get(0).get("OUTPATIENT_ID").toString();
                        String createTime =pre.get(0).get("CREATE_TIME").toString();
                        Date createDate =  DateUtil.strToDateLong(createTime);
                        Calendar cal= Calendar.getInstance();
                        cal.setTime(createDate);
                        cal.add(Calendar.MINUTE,Integer.parseInt(remind));
                        Long now = new Date().getTime();
                        Long min = cal.getTime().getTime();
                        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId);
                        if (min<=now){
                            String mobileList[] = mobiles.split(",");
                            if ("1".equalsIgnoreCase(sendMesControl)){
                                for (int j=0;j<mobileList.length;j++){
                                    WxPushLogDO wxPushLogDO = new WxPushLogDO();
                                    wxPushLogDO.setTempName("未审核提醒");
                                    wxPushLogDO.setOpenid(wlyyOutpatientDO.getId());
                                    wxPushLogDO.setReceiver(wlyyOutpatientDO.getPatient());
                                    wxPushLogDO.setCreateTime(new Date());
                                    wxPushLogDao.save(wxPushLogDO);
                                    ykyySMSService.ykyySendSMS(mobileList[j],wlyyOutpatientDO.getDoctorName()+"已为患者:开具处方,请尽快通知相关人员处理。");
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    public String finishOldConsult(String consult){
        int resutl = imService.finish(consult,"admin",2);

+ 12 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java

@ -11,6 +11,7 @@ import com.yihu.jw.internet.service.YkyyCommonService;
import com.yihu.jw.internet.service.ykyy.YkyyInternetService;
import com.yihu.jw.job.*;
import com.yihu.jw.job.yk.YKYYDataUploadJob;
import com.yihu.jw.job.ykyy.UnCheckPrescriptionJob;
import com.yihu.jw.job.ykyy.UnSettledHISPrescriptionJob;
import com.yihu.jw.job.ykyy.UpdateStatusByPayTimeJob;
import com.yihu.jw.job.ykyy.YkyyDataUploadJob;
@ -196,6 +197,17 @@ public class JobController extends BaseController {
                        logger.info("unsettled_prescription_notice_job  job exist");
                    }
                    break;
                case "uncheck_prescription_notice_job" :
                    //互联网医院 待结算消息推送
                    if (!quartzHelper.isExistJob("uncheck_prescription_notice_job")) {
                        String trigger = SystemConf.getInstance().getSystemProperties().getProperty("uncheck_prescription_notice_job");
                        quartzHelper.addJob(UnCheckPrescriptionJob.class, trigger, "uncheck_prescription_notice_job", new HashMap<String, Object>());
                        logger.info("uncheck_prescription_notice_job  job success");
                    } else {
                        logger.info("uncheck_prescription_notice_job  job exist");
                    }
                    break;
                case "pay_status_notice_job" :
                    //互联网医院 待结算消息推送

+ 3 - 0
svr/svr-internet-hospital-job/src/main/resources/system.properties

@ -24,3 +24,6 @@ data_common_upload_job=0 0 0 * * ?
#-------------------------眼科医院-----------------------------#
data_ykupload_job_2=0 0 0 * * ?
uncheck_prescription_notice_job=0 */1 * * * ?

+ 4 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -2513,11 +2513,13 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                      @ApiParam(name = "icdCode", value = "icdCode")
                                          @RequestParam(value = "icdCode",required = false)String icdCode,
                                      @ApiParam(name = "preNo", value = "preNo")
                                          @RequestParam(value = "preNo",required = false)String preNo){
                                          @RequestParam(value = "preNo",required = false)String preNo,
                                      @ApiParam(name = "idnoType", value = "idnoType")
                                          @RequestParam(value = "idnoType",required = false)String idnoType){
        try {
            return success(prescriptionService.saveNatAppointment(chargeAmount,inspectionName,mediaCard,patientId,name,cardNo,cardType,mobile,firstJobCode,firstJobName,secondJobCode,secondJobName,natTime,address,provinceName,
                    cityName,townName,streetName,pm,pushFlag,cardNoType,getUID(),checkPart,chargeFlag,chargeCode,icdCode,preNo));
                    cityName,townName,streetName,pm,pushFlag,cardNoType,getUID(),checkPart,chargeFlag,chargeCode,icdCode,preNo,idnoType));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }

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

@ -3205,10 +3205,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                      @ApiParam(name = "icdCode", value = "icdCode")
                                      @RequestParam(value = "icdCode", required = false) String icdCode,
                                      @ApiParam(name = "preNo", value = "preNo")
                                      @RequestParam(value = "preNo", required = false) String preNo) {
                                      @RequestParam(value = "preNo", required = false) String preNo,
                                      @ApiParam(name = "idnoType", value = "idnoType")
                                          @RequestParam(value = "idnoType", required = false) String idnoType) {
        try {
            return success(prescriptionService.saveNatAppointment(chargeAmount, inspectionName, mediaCard, patientId, name, cardNo, cardType, mobile, firstJobCode, firstJobName, secondJobCode, secondJobName, natTime, address, provinceName,
                    cityName, townName, streetName, pm, pushFlag, cardNoType, getUID(), checkPart, chargeFlag, chargeCode, icdCode, preNo));
                    cityName, townName, streetName, pm, pushFlag, cardNoType, getUID(), checkPart, chargeFlag, chargeCode, icdCode, preNo,idnoType));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }