Jelajahi Sumber

合理用药审核接口

wangjun 4 tahun lalu
induk
melakukan
66570632b2

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

@ -8579,21 +8579,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    //调用天际合理用药审方接口
    public String checkPrescriptionTJ(String prescriptionId){
        String doctor="";
        String patient="";
        List<WlyyPrescriptionInfoDO> infos = new ArrayList<>();
        List<WlyyPrescriptionDiagnosisDO> diagnosisDOS = new ArrayList<>();
        WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
        if (null!=wlyyPrescriptionDO){
            doctor = wlyyPrescriptionDO.getDoctor();
            patient = wlyyPrescriptionDO.getPatientCode();
            infos = prescriptionInfoDao.findByPrescriptionId(prescriptionId,1);
            diagnosisDOS = prescriptionDiagnosisDao.findByPrescriptionId(prescriptionId,1);
        }
        String res = "";
        try {
            res= xzzxEntranceService.checkInputInfo(doctor,patient,infos,diagnosisDOS);
            res= xzzxEntranceService.checkInputInfo(wlyyPrescriptionDO,infos,diagnosisDOS);
        } catch (Exception e) {
            logger.info(res);
            e.printStackTrace();
        }
        return  res;

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

@ -2874,11 +2874,11 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
        return map;
    }
    //组装审药参数
    public String checkInputInfo(String doctorId,String patientId,List<WlyyPrescriptionInfoDO> infos,List<WlyyPrescriptionDiagnosisDO> wlyyPrescriptionDiagnosisDOS ) throws Exception{
    //组装审药参数并发送到entrance
    public String checkInputInfo(WlyyPrescriptionDO prescriptionDO,List<WlyyPrescriptionInfoDO> infos,List<WlyyPrescriptionDiagnosisDO> wlyyPrescriptionDiagnosisDOS ) throws Exception{
        JSONObject jsonObject = new JSONObject();
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctorId);
        BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doctorId);
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(prescriptionDO.getDoctor());
        BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(prescriptionDO.getDoctor());
        jsonObject.put("DOCTOR_NAME", baseDoctorDO.getName());
        jsonObject.put("DEPT_CODE", baseDoctorDO.getVisitDept());
        jsonObject.put("DEPT_NAME", baseDoctorDO.getVisitDeptName());
@ -2886,8 +2886,8 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
            jsonObject.put("doctorId", doctorMappingDO.getMappingCode());
            jsonObject.put("POSITION", baseDoctorDO.getJobTitleName());
        }
        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patientId);
        BasePatientDO basePatientDO = patientDao.findById(patientId);
        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(prescriptionDO.getPatientCode());
        BasePatientDO basePatientDO = patientDao.findById(prescriptionDO.getPatientCode());
        jsonObject.put("patientName", basePatientDO.getName());
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        if (null != patientMappingDO && null != basePatientDO) {
@ -2897,7 +2897,6 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
        }
        if (null!=infos&&infos.size()>0) {
            WlyyPrescriptionInfoDO wlyyPrescriptionInfoDO = infos.get(0);
            WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(wlyyPrescriptionInfoDO.getPrescriptionId());
            if (null != prescriptionDO) {
                jsonObject.put("PATIENT_PRES_ID", prescriptionDO.getId());
                jsonObject.put("FEE_TYPE", prescriptionDO.getPayType() == 1 ? "医保" : "自费");
@ -2926,7 +2925,7 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
                    List<Map<String,Object>> returnList = transXmlCommen(obj);
                    returnJson = JSONArray.toJSONString(returnList);
                    logger.info("返回到互联网医院的解析后的结果:"+returnJson);
                    wlyyHttpLogDO.setDoctor(doctorId);
                    wlyyHttpLogDO.setDoctor(prescriptionDO.getDoctor());
                    wlyyHttpLogDO.setCreateTime(new Date());
                    wlyyHttpLogDO.setRequest(infos + jsonObject.toString());
                    wlyyHttpLogDO.setResponse(returnJson);
@ -2935,7 +2934,7 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
                    returnJson = "审方返回接口为空请检查参数是否正确";
                    logger.info(returnJson);
                    wlyyHttpLogDO.setCode("error");
                    wlyyHttpLogDO.setDoctor(doctorId);
                    wlyyHttpLogDO.setDoctor(prescriptionDO.getDoctor());
                    wlyyHttpLogDO.setCreateTime(new Date());
                    wlyyHttpLogDO.setRequest(infos + jsonObject.toString());
                    wlyyHttpLogDO.setResponse(returnJson);
@ -2944,7 +2943,7 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
            } else {
                returnJson = "entranceUrl接口调用失败";
                wlyyHttpLogDO.setCode("error");
                wlyyHttpLogDO.setDoctor(doctorId);
                wlyyHttpLogDO.setDoctor(prescriptionDO.getDoctor());
                wlyyHttpLogDO.setCreateTime(new Date());
                wlyyHttpLogDO.setRequest(infos + jsonObject.toString());
                wlyyHttpLogDO.setResponse(returnJson);