Bläddra i källkod

中山医院优化开发

wangzhinan 1 år sedan
förälder
incheckning
c4f4385c26

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

@ -2723,6 +2723,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param diagnosisJson
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    public Map<String, Object> makeDiagnosis(String outPatientId,String prescriptionId, String advice, String type, String infoJsons, String diagnosisJson, String inspectionJson, String emrJson,String hisId,String diseaseCode,String diseaseName,String isDisease) throws Exception {
        Map<String, Object> result = new HashedMap();
@ -2736,6 +2737,30 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        outpatientDO.setDiseaseName(diseaseName);
        outpatientDO.setIsDisease(isDisease);
        String sql = "SELECT\n" +
                "\tpi.drug_no AS \"drugNo\",\n" +
                "\tpi.drug_name AS \"drugName\"\n" +
                "FROM\n" +
                "\twlyy_prescription_info pi,\n" +
                "\twlyy_prescription p\n" +
                "WHERE\n" +
                "\tp.id = pi.prescription_id\n" +
                " and p.outpatient_id= '"+outPatientId+"'" +
                "and p.status >= 20 and p.real_order is not null ";
        List<Map<String,Object>> maps = jdbcTemplate.queryForList(sql);
        if (StringUtils.isNoneBlank(infoJsons)){
            List<WlyyPrescriptionInfoDO> infoDOs = (List<WlyyPrescriptionInfoDO>) com.alibaba.fastjson.JSONArray.parseArray(infoJsons, WlyyPrescriptionInfoDO.class);
            for (WlyyPrescriptionInfoDO infoDO:infoDOs){
                for (int i=0;i<maps.size();i++){
                    if (infoDO.getDrugNo().equalsIgnoreCase(maps.get(i).get("drugNo").toString())){
                        throw new Exception("您当前开的药品有重复,请先作废处方再重新开。");
                    }
                }
            }
        }
        //========================处方操作=============================================================
        //创建处方记录
        WlyyPrescriptionDO  prescriptionDO= new WlyyPrescriptionDO();
@ -9296,14 +9321,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            String baseUrl = findDomainUrlInDict();
            if (one.getType().equalsIgnoreCase("1")){
                title = "图文复诊";
                msg = name+"("+sex+" "+age+"岁)向您发起了图文复诊已更换其他医生接诊,请您知悉。";
                msg = name+"("+sex+" "+age+"岁)向您发起了图文复诊已更换其他医生接诊,您无需接诊。";
            }else if (one.getType().equalsIgnoreCase("2")){
                title = "视频复诊";
                date = DateUtil.dateToStrLong(one.getRegisterDate());
                msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊已更换其他医生接诊,请您知悉。";
                msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊已更换其他医生接诊,您无需接诊。";
            }
            if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
                String url=baseUrl+"/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+one.getDescription()+"&type=3&id="+one.getId();
                String url = "";
//                String url=baseUrl+"/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+one.getDescription()+"&type=3&id="+one.getId();
                enterpriseService.sendTWMesByDoctor("zsyy",one.getDoctor(),title,msg,url);
            }else if (wechatId.equalsIgnoreCase("xm_ykyy_wx")){
                String url=baseUrl+"/ims-app-web/#/onlineChat/detail?_rs_title="+one.getDescription()+"&type=3&id="+one.getId();
@ -10344,6 +10370,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param prescriptionId
     * @return
     */
    public WlyyPrescriptionCheckDO saveCheck(String operate, String operateName, String reason, Integer status, String prescriptionId, String wxId,String ip) throws Exception {
        WlyyPrescriptionCheckDO prescriptionCheckDO = new WlyyPrescriptionCheckDO();
        prescriptionCheckDO.setCreateTime(new Date());