Przeglądaj źródła

眼科医院处方物流

ysj 5 lat temu
rodzic
commit
70dece127f

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

@ -965,7 +965,7 @@ public class YkyyEntranceService {
                "FROM\n" +
                "\tV_ZKSG_BRCX x\n" +
                "WHERE\n" +
                "\tsfzh.sfzh = '"+idcard+"' ";
                "\tx.sfzh = '"+idcard+"' ";
        JSONArray array = new JSONArray();
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
@ -1089,7 +1089,7 @@ public class YkyyEntranceService {
     * @throws Exception
     */
    public JSONArray findHisIcd10(String code) throws Exception{
        String sql ="select v.code,v.name,v.flag from V_HLW_ICD10 v WHERE v.code = '"+code+"'";
        String sql ="select v.code,v.name,v.flag from V_HLW_ICD10 v WHERE v.code = '"+code.trim()+"'";
        JSONArray array = new JSONArray();
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
@ -1164,13 +1164,10 @@ public class YkyyEntranceService {
        hlwGhmxDO.setJZXH(0);
        hlwGhmxDO.setKSDM(wlyyPrescriptionVO.getDept());
        hlwGhmxDO.setBRID(Integer.parseInt(patientMappingDO.getMappingCode()));
        hlwGhmxDO.setGHSJ(DateUtil.strToDate(DateUtil.dateToStr(wlyyPrescriptionVO.getCreateTime(),"yyyy-MM-dd HH:mm:ss")));//挂号时间
        hlwGhmxDO.setGHSJ(new Date());//挂号时间
        hlwGhmxDO.setGHLB(1);//挂号类别
        hlwGhmxDO.setYSDM(doctorMappingDO.getMappingCode());//医生代码
        hlwGhmxDO.setJZYS(doctorMappingDO.getMappingCode());//接诊医生
        if (StringUtils.isNoneBlank(wlyyPrescriptionVO.getAdmNo())){
            hlwGhmxDO.setJZXH(Integer.parseInt(wlyyPrescriptionVO.getAdmNo()));
        }
        //病人性质
        JSONArray jsonArray = findHisPatient(patientMappingDO.getIdcard());
        if(jsonArray!=null&&jsonArray.size()>0){
@ -1181,9 +1178,9 @@ public class YkyyEntranceService {
        //操作工号
        JSONArray jsonArray1 = findHisDoctor(doctorMappingDO.getIdcard());
        if(jsonArray1!=null&&jsonArray1.size()>0){
            //获取居民信息
            //获取医生信息
            JSONObject json = jsonArray1.getJSONObject(0);
            hlwGhmxDO.setBRXZ(json.getInteger("YGBH"));
            hlwGhmxDO.setCZGH(json.getString("YGBH"));
        }
        // 同一个医生同一个病人,一天一条挂号记录。
@ -1229,15 +1226,12 @@ public class YkyyEntranceService {
        }
        Integer icd10Flag = 0;
        Integer jzxh = 0;
        List<WlyyPrescriptionDiagnosisDO> diagnosisDOs = prescriptionDiagnosisDao.findByPrescriptionId(wlyyPrescriptionVO.getId());
        for (WlyyPrescriptionDiagnosisDO diagnosisDO : diagnosisDOs){
            //疾病诊断表HLWYS_MZ_JBZD
            HlwYsMzJbzdDO hlwYsMzJbzdDO = new HlwYsMzJbzdDO();
            //hlwYsMzJbzdDO.setJLBH(0);
            hlwYsMzJbzdDO.setJZXH(0);
            if (StringUtils.isNoneBlank(wlyyPrescriptionVO.getAdmNo())){
                hlwYsMzJbzdDO.setJZXH(Integer.parseInt(wlyyPrescriptionVO.getAdmNo()));
            }
            hlwYsMzJbzdDO.setYSDM(doctorMappingDO.getMappingCode());
            hlwYsMzJbzdDO.setICD(diagnosisDO.getCode());
            hlwYsMzJbzdDO.setMSZD(diagnosisDO.getName());
@ -1265,7 +1259,22 @@ public class YkyyEntranceService {
            logger.info("HlwYsMzJbzdDO:"+jsonString1);
            HttpResponse response1 = HttpUtils.doGet(saveUrl,params1);
            if (response1.getStatus()==200){
                logger.info("content"+response1.getContent());
                String content = response1.getContent();
                logger.info("content"+content);
                //获取就诊序号,更新处方表数据
                JSONObject jsonObject = JSONObject.parseObject(content);
                JSONObject object = jsonObject.getJSONObject("obj");
                if (object!=null){
                    jzxh = object.getInteger("JZXH");
                    wlyyPrescriptionVO.setAdmNo(jzxh+"");
                    logger.info("JZXH=========="+jzxh);
                    List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(wlyyPrescriptionVO.getId());
                    if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){
                        WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOS.get(0);
                        wlyyPrescriptionDO.setAdmNo(jzxh+"");
                        prescriptionDao.save(wlyyPrescriptionDO);
                    }
                }
                logger.info("表hlwYsMzJbzdDO同步成功!");
            }
        }

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

@ -90,6 +90,10 @@ public class YkyyController extends EnvelopRestEndpoint {
            HlwCf02DO hlwCf02VO =  JSONObject.toJavaObject(object,HlwCf02DO.class);
            ykyyEntranceService.update(hlwCf02VO);
            envelop.setObj(hlwCf02VO);
        }else if(table.equalsIgnoreCase("HlwGhmxDO")){
            HlwGhmxDO hlwGhmxDO =  JSONObject.toJavaObject(object,HlwGhmxDO.class);
            ykyyEntranceService.update(hlwGhmxDO);
            envelop.setObj(hlwGhmxDO);
        }
        return success(envelop);
    }