浏览代码

第三医院集成平台检查检验接口对接

wangzhinan 1 年之前
父节点
当前提交
8b2cd739cf

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

@ -8745,7 +8745,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "base_patient patient " +
                "WHERE " +
                "outpatient.patient=patient.id " +
                "AND outpatient.status in (0,1,2) " +
                "AND outpatient.status in ('0','1','2') " +
                "AND outpatient.doctor='" + doctor + "' " +
                "AND outpatient.pay_status = 1 " +
                "AND outpatient.outpatient_type= '" + outpatient_type + "'  ";
@ -8753,36 +8753,36 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        Date date = new Date();
        Calendar now = Calendar.getInstance();
        now.setTime(date);
        System.out.println(sdf.format(now.getTime()));
        now.add(Calendar.DAY_OF_MONTH, -1);
        System.out.println(sdf.format(now.getTime()));
//        System.out.println(sdf.format(now.getTime()));
//        now.add(Calendar.DAY_OF_MONTH, -1);
//        System.out.println(sdf.format(now.getTime()));
        if (!"xm_ihealth_wx".contains(wxId)){
            if ("1".equals(outpatient_type)||"3".equals(outpatient_type)) {//复诊
                sql = sql + " AND outpatient.type= '" + type + "' ";
                if ("2".equals(type)) {//视频复诊才需要判断时间,
                    if ("xm_ykyy_wx".equals(wxId)) {
                        if (flag){
                            sql += " AND outpatient.register_date is not null and outpatient.register_date >= str_to_date('" + sdf.format(now.getTime()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
                        }else {
                            sql += " AND outpatient.register_date is not null and outpatient.register_date >= to_date('" + sdf.format(now.getTime()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
                        }
                    } else {
                        sql = sql + " AND outpatient.register_date is not null AND  outpatient.register_date >= '" + sdf.format(now.getTime()) + " 00:00:00' ";
                    }
                }
//                if ("2".equals(type)) {//视频复诊才需要判断时间,
//                    if ("xm_ykyy_wx".equals(wxId)) {
//                        if (flag){
//                            sql += " AND outpatient.register_date is not null and outpatient.register_date >= str_to_date('" + sdf.format(now.getTime()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
//                        }else {
//                            sql += " AND outpatient.register_date is not null and outpatient.register_date >= to_date('" + sdf.format(now.getTime()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
//                        }
//                    } else {
//                        sql = sql + " AND outpatient.register_date is not null AND  outpatient.register_date >= '" + sdf.format(now.getTime()) + " 00:00:00' ";
//                    }
//                }
            } else if ("2".equals(outpatient_type)) {
                //协同门诊也需要判断时间
                if ("xm_ykyy_wx".equals(wxId)) {
                    if (flag){
                        sql += " AND outpatient.register_date is not null and outpatient.register_date >= str_to_date('" + sdf.format(now.getTime()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
                    }else {
                        sql += " AND outpatient.register_date is not null and outpatient.register_date >= to_date('" + sdf.format(now.getTime()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
                    }
                } else {
                    sql = sql + " AND outpatient.register_date is not null AND  outpatient.register_date >= '" + sdf.format(now.getTime()) + " 00:00:00' ";
                }
//                if ("xm_ykyy_wx".equals(wxId)) {
//                    if (flag){
//                        sql += " AND outpatient.register_date is not null and outpatient.register_date >= str_to_date('" + sdf.format(now.getTime()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
//                    }else {
//                        sql += " AND outpatient.register_date is not null and outpatient.register_date >= to_date('" + sdf.format(now.getTime()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
//                    }
//
//                } else {
//                    sql = sql + " AND outpatient.register_date is not null AND  outpatient.register_date >= '" + sdf.format(now.getTime()) + " 00:00:00' ";
//                }
            }
        }
        logger.info("接口名称:doctorReviewConsultCount-->sql="+sql);

+ 35 - 93
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -4679,35 +4679,6 @@ public class ImService {
    public List<Map<String, Object>> doctorUpcomingList2(String doctorCode, String type) {
        String sql = "";
        if ("1,15,17".equals(type)) {
			/*sql = "SELECT " +
					"a.id AS \"id\"," +
					"a.type AS \"type\"," +
					"a.title AS \"title\"," +
					"a.symptoms AS \"symptoms\",";
			if("xm_ykyy_wx".equals(wxId)){
				if (flag){
					sql = sql + "date_format(a.czrq,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
				}else{
					sql = sql + "to_char(a.czrq,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\",";
				}
			}else{
				sql = sql + "date_format(a.czrq,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
			}
			sql = sql +"b.status AS \"status\"," +
					"b.evaluate AS \"evaluate\"," +
					"b.doctor AS \"doctorCode\"," +
					"b.actual_sender AS \"generalDoctor\"," +
					"d.name AS \"patientName\"," +
					"d.id as \"patientId\"," +
					"d.idcard as \"patientIdcard\"," +
					"d.sex as \"patientsex\"," +
					"d.photo AS \"patientphoto\" " +
					"FROM wlyy_consult a," +
					"wlyy_consult_team b," +
					"base_patient d  " +
					"WHERE a.id=b.consult " +
					"AND b.patient=d.id AND b.doctor='" + doctorCode + "' AND b.type in (" + type + ") and b.status = 0 and a.pay_status=1 " +
					"ORDER BY a.czrq desc ";*/
            sql = "SELECT " +
                    " DISTINCT op.id AS \"outpatientId\"," +
                    "op.description AS \"title\"," +
@ -4751,47 +4722,18 @@ public class ImService {
                    "WHERE op.patient=patient.id " +
                    "AND op.doctor='" + doctorCode + "' " +
                    "AND op.status in ('0','1','2') and  op.pay_status=1 ";
			/*if("9".equals(type)){
				//图文复诊
				sql =sql +"AND op.type=1 AND op.outpatient_type=1 ";
			}else if("16".equals(type)){
				//视频复诊
				sql =sql +"AND op.type=2 AND op.outpatient_type=1 ";
				if("xm_ykyy_wx".equals(wxId)){
					if (flag){
						sql +=" and op.register_date >= str_to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}else {
						sql +=" and op.register_date >= to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}
				}else {
					sql +=" AND  op.register_date >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' ";
				}
			}else if("12".equals(type)){
				//视频复诊
				sql =sql +"AND op.outpatient_type=2";
				if("xm_ykyy_wx".equals(wxId)){
					if (flag){
						sql +=" and op.register_date >= str_to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}else  {
						sql +=" and op.register_date >= to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}
				}else {
					sql +=" AND  op.register_date >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' ";
				}
			}else{}*/
            if (!"xm_ihealth_wx".equalsIgnoreCase(wxId)) {
                if ("xm_ykyy_wx".equals(wxId)) {
                    if (flag) {
                        sql += " and op.register_date >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
                    } else {
                        sql += " and op.register_date >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
                    }
                } else {
//                    sql += " AND  op.register_date >= '" + DateUtil.dateToStrShort(new Date()) + " 00:00:00' ";//不加今日待办
                }
            }
//            if (!"xm_ihealth_wx".equalsIgnoreCase(wxId)) {
//                if ("xm_ykyy_wx".equals(wxId)) {
//                    if (flag) {
//                        sql += " and op.register_date >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
//                    } else {
//                        sql += " and op.register_date >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
//                    }
//
//                } else {
////                    sql += " AND  op.register_date >= '" + DateUtil.dateToStrShort(new Date()) + " 00:00:00' ";//不加今日待办
//                }
//            }
            sql = sql + " AND op.type in ('1','2') AND op.outpatient_type = 3 ";
            sql = sql + " ORDER BY op.create_time DESC";
@ -4845,32 +4787,32 @@ public class ImService {
            } else if ("16".equals(type)) {
                //视频复诊
                sql = sql + "AND op.type=2 AND op.outpatient_type=1 ";
                if (!"xm_ihealth_wx".equalsIgnoreCase(wxId)) {
                    if ("xm_ykyy_wx".equals(wxId)) {
                        if (flag) {
                            sql += " and op.register_date >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
                        } else {
                            sql += " and op.register_date >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
                        }
                    } else {
                        sql += " AND  op.register_date >= '" + DateUtil.dateToStrShort(new Date()) + " 00:00:00' ";
                    }
                }
//                if (!"xm_ihealth_wx".equalsIgnoreCase(wxId)) {
//                    if ("xm_ykyy_wx".equals(wxId)) {
//                        if (flag) {
//                            sql += " and op.register_date >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
//                        } else {
//                            sql += " and op.register_date >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
//                        }
//
//                    } else {
//                        sql += "  AND  op.register_date >= '" + DateUtil.dateToStrShort(new Date()) + " 00:00:00' ";
//                    }
//                }
            } else if ("12".equals(type)) {
                //视频复诊
                sql = sql + "AND op.outpatient_type=2";
                if (!"xm_ihealth_wx".equalsIgnoreCase(wxId)) {
                    if ("xm_ykyy_wx".equals(wxId)) {
                        if (flag) {
                            sql += " and op.register_date >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
                        } else {
                            sql += " and op.register_date >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
                        }
                    } else {
                        sql += " AND  op.register_date >= '" + DateUtil.dateToStrShort(new Date()) + " 00:00:00' ";
                    }
                }
//                if (!"xm_ihealth_wx".equalsIgnoreCase(wxId)) {
//                    if ("xm_ykyy_wx".equals(wxId)) {
//                        if (flag) {
//                            sql += " and op.register_date >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
//                        } else {
//                            sql += " and op.register_date >= to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
//                        }
//                    } else {
//                        sql += " AND  op.register_date >= '" + DateUtil.dateToStrShort(new Date()) + " 00:00:00' ";
//                    }
//                }
            } else {
            }