Browse Source

海沧医保接口

wangzhinan 2 years ago
parent
commit
9495c28e2f

+ 4 - 4
business/base-service/src/main/java/com/yihu/jw/dailyReport/service/DailyReportUploadService.java

@ -1525,7 +1525,7 @@ public class DailyReportUploadService {
            boolean flag = true;
            for (BaseDoctorRoleDO roleDO:baseDoctorRoleDOS){
                if (roleDO.getRoleCode().equalsIgnoreCase("admin")||roleDO.getRoleCode().equalsIgnoreCase("deptAdmin")){
                    flag = false;
                    flag = true;
                    if (StringUtils.isNotBlank(filterOthers)){//只返回自己应核实的数据
                        if("1".equals(filterOthers)){
                            List<String> myDoctors = getDoctorByRole(user);
@ -1537,7 +1537,7 @@ public class DailyReportUploadService {
                }
            }
            if (flag){
                condition += " and doc.id='"+user+"' ";
                condition += " and doc.id<>'"+user+"' ";
            }
        }
@ -1560,7 +1560,7 @@ public class DailyReportUploadService {
                    "from base_doctor_daily_report_upload d1 INNER JOIN base_doctor doc on d1.doctor_id = doc.id " +
                    "INNER JOIN base_doctor_hospital dh on doc.id = dh.doctor_code and dh.del=1  " +
                    "LEFT JOIN base_daily_report_detail de on d1.id = de.report_id " +
                    "where doc.del=1 and doc.identity=0 and doc.id='"+user+"' " +sqlCondition +" GROUP BY d1.id  ";
                    "where doc.del=1 and doc.identity=0 and doc.id<>'"+user+"' " +sqlCondition +" GROUP BY d1.id  ";
        }
        sql += " order by reportDate desc ";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
@ -4561,7 +4561,7 @@ public class DailyReportUploadService {
                sql =" select distinct dh2.doctor_code from base_doctor_hospital dh " +
                        "INNER JOIN base_doctor_hospital dh2 on dh.dept_code = dh2.dept_code " +
                        "INNER JOIN base_doctor doc on dh2.doctor_code = doc.id   " +
                        "where dh.doctor_code='"+user+"' and dh.del=1 and doc.identity=0 and dh2.del=1 and doc.del=1  ";
                        "where dh.doctor_code='"+user+"' and dh.del=1 and doc.identity=0 and dh2.del=1 and doc.del=1 and dh2.doctor_code <>'"+user+"' ";
                doctors = jdbcTemplate.queryForList(sql,String.class);
            }
        }

+ 21 - 32
business/base-service/src/main/java/com/yihu/jw/file_upload/FileUploadService.java

@ -504,41 +504,30 @@ public class FileUploadService {
        return url;
    }
    public String request(String remote_url, MultipartFile file, String type) {
    public String request(String remote_url, MultipartFile file, String type) throws IOException {
        CloseableHttpClient httpClient = HttpClientBuilder.create().build();
        String result = "";
        try {
            String fileName = file.getOriginalFilename();
            HttpPost httpPost = new HttpPost(remote_url);
            MultipartEntityBuilder builder = MultipartEntityBuilder.create();
            builder.addBinaryBody("file", file.getInputStream(), ContentType.MULTIPART_FORM_DATA, fileName);// 文件流
            builder.addTextBody("filename", fileName);// 类似浏览器表单提交,对应input的name和value
            if (!org.springframework.util.StringUtils.isEmpty(type)) {
                builder.addTextBody("type", type); //发送类型
            }
            logger.info("type===="+type);
            if (!isFileFlag(type)){
                throw new FileWrongFormatException("不符合文件上传格式");
            }
            HttpEntity entity = builder.build();
            httpPost.setEntity(entity);
            HttpResponse response = httpClient.execute(httpPost);// 执行提交
            HttpEntity responseEntity = response.getEntity();
            if (responseEntity != null) {
                // 将响应内容转换为字符串
                result = EntityUtils.toString(responseEntity, Charset.forName("UTF-8"));
            }
        } catch (IOException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                httpClient.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        String fileName = file.getOriginalFilename();
        HttpPost httpPost = new HttpPost(remote_url);
        MultipartEntityBuilder builder = MultipartEntityBuilder.create();
        builder.addBinaryBody("file", file.getInputStream(), ContentType.MULTIPART_FORM_DATA, fileName);// 文件流
        builder.addTextBody("filename", fileName);// 类似浏览器表单提交,对应input的name和value
        if (!org.springframework.util.StringUtils.isEmpty(type)) {
            builder.addTextBody("type", type); //发送类型
        }
        logger.info("type===="+type);
        if (!isFileFlag(type)){
            throw new FileWrongFormatException("不符合文件上传格式");
        }
        HttpEntity entity = builder.build();
        httpPost.setEntity(entity);
        HttpResponse response = httpClient.execute(httpPost);// 执行提交
        HttpEntity responseEntity = response.getEntity();
        if (responseEntity != null) {
            // 将响应内容转换为字符串
            result = EntityUtils.toString(responseEntity, Charset.forName("UTF-8"));
        }
        httpClient.close();
        return result;
    }

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

@ -639,7 +639,7 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                    prescriptionInfoVO.setUnit(isEmty(infoJson.getString("UNIT")));
                    prescriptionInfoVO.setUnitName(isEmty(infoJson.getString("UNITNAME")));
                    prescriptionInfoVO.setPackUnitName(isEmty(infoJson.getString("PACKUNITNAME")));
                    prescriptionInfoVO.setPackUnit(isEmty(infoJson.getString("PACKUNIT")));
                    prescriptionInfoVO.setPackUnit(isEmty(infoJson.getString("PACKUNITNAME")));
                    prescriptionInfoVO.setUsageCode(isEmty(infoJson.getString("USAGECODE")));
                    prescriptionInfoVO.setUsageName(isEmty(infoJson.getString("USAGENAME")));
                    prescriptionInfoVO.setSupplyCode(isEmty(infoJson.getString("SUPPLYCODE")));

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

@ -757,6 +757,157 @@ public class EntranceService {
                    icdNames += "," + diagFive[0];
                }
//                String icds = null == jsonObjectMgsInfo.get("icd_name") ? "" : jsonObjectMgsInfo.get("icd_name") + "";
//                String[] icdcodeAndName = icds.split("&");
//                wlyyOutpatientVO.setIcd10(icdcodeAndName.length > 1 ? icdcodeAndName[1].toString() : "");
//                wlyyOutpatientVO.setIcd10Name(icdcodeAndName.length > 0 ? icdcodeAndName[0].toString() : "");
                wlyyOutpatientVO.setIcd10(icdcodes);
                wlyyOutpatientVO.setIcd10Name(icdNames);
                String admDate = null == jsonObjectMgsInfo.get("ADM_DAT") ? "" : jsonObjectMgsInfo.get("ADM_DAT") + "";
                String conDate = null == jsonObjectMgsInfo.get("CON_DATE") ? "" : jsonObjectMgsInfo.get("CON_DATE") + "";
                wlyyOutpatientVO.setAdmDate(DateUtil.strToDate(admDate, DateUtil.YYYY_MM_DD_HH_MM_SS_));
                wlyyOutpatientVO.setConDate(DateUtil.strToDate(conDate, DateUtil.YYYY_MM_DD_HH_MM_SS_));
                wlyyOutpatientVOS.add(wlyyOutpatientVO);
            }
        }
        return wlyyOutpatientVOS;
    }
    /**
     * 患者门诊就诊记录
     * 使用时间查询的话,很可能会超时。时间没有索引,所以超时时间需要加长
     *
     * @param PAT_NO    居民唯一号 一个居民在该医院只有一个号,该接口必须输入的参数
     * @param conNo     就诊次数,使用居民唯一号+就诊次数获取唯一一条就诊记录
     *                  // *  @param admNo 就诊唯一号 每一次就诊都有一个唯一号:居民号+就诊次数,查询确定的一条就诊记录时需要传,否则传null
     *                  // *  @param registerSn 挂号流水号,查询确定的一条就诊记录时需要传,否则传null
     * @param startTime 开始时间 (查询一段时间内就诊记录开始时间,查询就诊记录列表时需要传,否则传null)
     * @param endTime   结束时间 (查询一段时间内就诊记录结束时间,查询就诊记录列表时需要传,否则传null)
     * @return
     * @throws Exception
     */
    public List<WlyyOutpatientVO> BS10016(String PAT_NO, String conNo, String startTime, String endTime, boolean demoFlag ,String ksdm) throws Exception {
        System.out.println("ksdm="+ksdm);
        String fid = "BS10016";
        logger.info("EntranceService " + fid + " PAT_NO :" + PAT_NO + " conNo:" + conNo + " startTime:" + startTime + " endTime:" + endTime);
        String resp = "";
        String orgCode = "350211A1002";
        String orgName = "厦门大学附属中山医院";
        if (demoFlag) {
            resp = getJosnFileResullt(fid);
        } else {
            StringBuffer sbs = new StringBuffer();
            //AccessControl :用户、密码、服务id
            sbs.append("<ESBEntry><AccessControl><Fid>" + fid + "</Fid><UserName>" + mqUser + "</UserName><Password>" + mqPwd + "</Password></AccessControl>");
            //MessageHeader :固定值 消费方系统编号 S60,提供方系统编号 S01
            sbs.append("<MessageHeader><Fid>" + fid + "</Fid><MsgDate>" + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_HH_MM_SS) + "</MsgDate><SourceSysCode>" + sourceSysCode + "</SourceSysCode><TargetSysCode>" + targetSysCode + "</TargetSysCode></MessageHeader>");
            //查询信息拼接
            sbs.append("<MsgInfo><onceFlag>1</onceFlag><startNum>1</startNum><endNum>50000</endNum><Msg>");
            if (StringUtils.isNotBlank(PAT_NO)) {
                /*sbs.append("<query compy=\"=\" item=\"PAT_NO\" splice=\"and\" value=\"'" + PAT_NO + "'\"/>");*/
                sbs.append(" and Pat_Admit_ID = '"+PAT_NO+"' ");
            }
            if (StringUtils.isNotBlank(startTime)) {
                /*sbs.append("<query compy=\"&gt;=\" item=\"CON_DATE\" splice=\"and\" value=\"'" + startTime + "'\"/>");*/
                sbs.append(" and Discharge_Date &gt;= '"+startTime+"' ");
            }
            if (StringUtils.isNotBlank(endTime)) {
                /*sbs.append("<query compy=\"&lt;\" item=\"CON_DATE\" splice=\"and\" value=\"'" + endTime + "'\"/>");*/
                sbs.append(" and Discharge_Date &lt;= '"+endTime+"' ");
            }
            if (StringUtils.isNotBlank(ksdm)) {
                /*      sbs.append("<query compy=\"=\" item=\"ADM_SPEC\" splice=\"and\" value=\"'" + ksdm + "'\"/>");*/
                /*sbs.append("<query compy=\"=\" item=\"under_dept\" splice=\"and\" value=\"'" + ksdm + "'\"/>");*/
                sbs.append(" and Discharge_Dept_Code = '"+ksdm+"' ");
            }
            sbs.append(" order by Admit_Dept_Code desc ");
            //查询信息结束
            sbs.append("</Msg> ");
            sbs.append("</MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            logger.info("resp===" + resp);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
        }
        JSONArray jsonArray = ConvertUtil.convertListEnvelopInRow(resp);
        if (null == jsonArray) {
            return null;        }
        List<WlyyOutpatientVO> wlyyOutpatientVOS = new ArrayList<>();
        WlyyOutpatientVO wlyyOutpatientVO;
        for (Object object : jsonArray) {
            net.sf.json.JSONObject jsonObjectMgsInfo = (net.sf.json.JSONObject) object;
            if (null != jsonObjectMgsInfo) {
                wlyyOutpatientVO = new WlyyOutpatientVO();
                //中山医院固定入参
                wlyyOutpatientVO.setHospital(orgCode);
                wlyyOutpatientVO.setHospitalName(orgName);
                wlyyOutpatientVO.setWinNo("6");
                wlyyOutpatientVO.setAdmNo(null == jsonObjectMgsInfo.get("Admit_Num") ? "" : jsonObjectMgsInfo.get("Admit_Num") + "");
                wlyyOutpatientVO.setRegisterNo(null == jsonObjectMgsInfo.get("REGISTER_SN") ? "" : jsonObjectMgsInfo.get("REGISTER_SN") + "");
                wlyyOutpatientVO.setDept(null == jsonObjectMgsInfo.get("ADM_SPEC") ? "" : jsonObjectMgsInfo.get("ADM_SPEC") + "");
                wlyyOutpatientVO.setDeptName(null == jsonObjectMgsInfo.get("ADM_SPEC_NAME") ? "" : jsonObjectMgsInfo.get("ADM_SPEC_NAME") + "");
                String patNo = null != jsonObjectMgsInfo.get("PAT_NO") ? jsonObjectMgsInfo.get("PAT_NO").toString() : "";
                String patientName = null != jsonObjectMgsInfo.get("PAT_NAME") ? jsonObjectMgsInfo.get("PAT_NAME").toString() : "";
                PatientMappingDO patientMappingDo = new PatientMappingDO();
                if (StringUtils.isNotBlank(patNo)) {
                    patientMappingDo = patientMappingDao.findByMappingCodeAndSource(patNo.trim(), "1");
                    patNo = null == patientMappingDo ? null : patientMappingDo.getPatient();
                    patientName = null == patientMappingDo ? null : patientMappingDo.getPatientName();
                }
                wlyyOutpatientVO.setPatient(patNo);
                wlyyOutpatientVO.setPatientName(patientName);
                wlyyOutpatientVO.setConNo(null == jsonObjectMgsInfo.get("CON_NO") ? "" : jsonObjectMgsInfo.get("CON_NO") + "");
                String doctor = null == jsonObjectMgsInfo.get("CON_DOC") ? "" : jsonObjectMgsInfo.get("CON_DOC") + "";
                //转化医生
                String mappingCode = doctor.trim();
                String doctorCode = "";
                if (StringUtils.isNotBlank(mappingCode)) {
                    List<DoctorMappingDO> mappingDOs = doctorMappingDao.findByOrgCodeAndMappingCode(orgCode, mappingCode);
                    if (mappingDOs != null && mappingDOs.size() > 0) {
                        doctorCode = mappingDOs.get(0).getDoctor();
                    }
                }
                wlyyOutpatientVO.setDoctor(doctorCode);
                wlyyOutpatientVO.setDoctorName(null == jsonObjectMgsInfo.get("CON_DOC_NAME") ? "" : jsonObjectMgsInfo.get("CON_DOC_NAME") + "");
//                wlyyOutpatientVO.setIdcard(null == jsonObjectMgsInfo.get("social_no") ? "" : jsonObjectMgsInfo.get("social_no") + "");
                wlyyOutpatientVO.setMjz(null == jsonObjectMgsInfo.get("MJZ") ? "" : jsonObjectMgsInfo.get("MJZ") + "");
                //主诊断 毒蛇咬伤&T63.001
                String[] icdName = jsonObjectMgsInfo.get("icd_name").toString().split("&");
                String[] diagTwo = jsonObjectMgsInfo.get("diag_two").toString().split("&");
                String[] diagThree = jsonObjectMgsInfo.get("diag_three").toString().split("&");
                String[] diagFour = jsonObjectMgsInfo.get("diag_four").toString().split("&");
                String[] diagFive = jsonObjectMgsInfo.get("diag_five").toString().split("&");
                String icdcodes = "";
                String icdNames = "";
                if (icdName.length > 1) {
                    icdcodes += icdName[1];
                    icdNames += icdName[0];
                }
                if (diagTwo.length > 1) {
                    icdcodes += "," + diagTwo[1];
                    icdNames += "," + diagTwo[0];
                }
                if (diagThree.length > 1) {
                    icdcodes += "," + diagThree[1];
                    icdNames += "," + diagThree[0];
                }
                if (diagFour.length > 1) {
                    icdcodes += "," + diagFour[1];
                    icdNames += "," + diagFour[0];
                }
                if (diagFive.length > 1) {
                    icdcodes += "," + diagFive[1];
                    icdNames += "," + diagFive[0];
                }
//                String icds = null == jsonObjectMgsInfo.get("icd_name") ? "" : jsonObjectMgsInfo.get("icd_name") + "";
//                String[] icdcodeAndName = icds.split("&");
//                wlyyOutpatientVO.setIcd10(icdcodeAndName.length > 1 ? icdcodeAndName[1].toString() : "");

+ 1 - 0
gateway/ag-basic/src/main/resources/application.yml

@ -338,6 +338,7 @@ spring:
  redis:
    host: 127.0.0.1 # Redis server host.
    port: 6380 # Redis server port.
    password: Kb6wKDQP1W4
---
spring:

+ 18 - 29
server/svr-authentication/src/main/java/com/yihu/jw/security/service/FileUploadService.java

@ -198,37 +198,26 @@ public class FileUploadService {
        return uploadVO;
    }
    public String request(String remote_url, MultipartFile file, String type) {
    public String request(String remote_url, MultipartFile file, String type) throws IOException {
        CloseableHttpClient httpClient = HttpClientBuilder.create().build();
        String result = "";
        try {
            String fileName = file.getOriginalFilename();
            HttpPost httpPost = new HttpPost(remote_url);
            MultipartEntityBuilder builder = MultipartEntityBuilder.create();
            builder.addBinaryBody("file", file.getInputStream(), ContentType.MULTIPART_FORM_DATA, fileName);// 文件流
            builder.addTextBody("filename", fileName);// 类似浏览器表单提交,对应input的name和value
            if (!org.springframework.util.StringUtils.isEmpty(type)) {
                builder.addTextBody("type", type); //发送类型
            }
            HttpEntity entity = builder.build();
            httpPost.setEntity(entity);
            HttpResponse response = httpClient.execute(httpPost);// 执行提交
            HttpEntity responseEntity = response.getEntity();
            if (responseEntity != null) {
                // 将响应内容转换为字符串
                result = EntityUtils.toString(responseEntity, Charset.forName("UTF-8"));
            }
        } catch (IOException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                httpClient.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        String fileName = file.getOriginalFilename();
        HttpPost httpPost = new HttpPost(remote_url);
        MultipartEntityBuilder builder = MultipartEntityBuilder.create();
        builder.addBinaryBody("file", file.getInputStream(), ContentType.MULTIPART_FORM_DATA, fileName);// 文件流
        builder.addTextBody("filename", fileName);// 类似浏览器表单提交,对应input的name和value
        if (!org.springframework.util.StringUtils.isEmpty(type)) {
            builder.addTextBody("type", type); //发送类型
        }
        HttpEntity entity = builder.build();
        httpPost.setEntity(entity);
        HttpResponse response = httpClient.execute(httpPost);// 执行提交
        HttpEntity responseEntity = response.getEntity();
        if (responseEntity != null) {
            // 将响应内容转换为字符串
            result = EntityUtils.toString(responseEntity, Charset.forName("UTF-8"));
        }
        httpClient.close();
        return result;
    }

+ 2 - 2
svr/svr-internet-hospital/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name:  svr-internet-hospital-wangzhinan
    name:  svr-internet-hospital
  cloud:
    config:
      failFast: true
@ -127,7 +127,7 @@ spring:
  profiles: ZjxlProd
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://127.0.0.1:1221}
      uri: ${wlyy.pring.config.uri:http://172.19.103.134:1221}
      label: ${wlyy.spring.config.label:master}
---