|
@ -66,6 +66,7 @@ import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@ -77,6 +78,7 @@ import java.io.InputStream;
|
|
import java.io.OutputStream;
|
|
import java.io.OutputStream;
|
|
import java.lang.Boolean;
|
|
import java.lang.Boolean;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Created by Trick on 2019/5/17
|
|
* Created by Trick on 2019/5/17
|
|
@ -147,6 +149,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
private PrescriptionLogService prescriptionLogService;
|
|
private PrescriptionLogService prescriptionLogService;
|
|
@Autowired
|
|
@Autowired
|
|
private WlyyInspectionDao wlyyInspectionDao;
|
|
private WlyyInspectionDao wlyyInspectionDao;
|
|
|
|
@Autowired
|
|
|
|
private StringRedisTemplate redisTemplate;
|
|
|
|
|
|
|
|
|
|
@Value("${demo.flag}")
|
|
@Value("${demo.flag}")
|
|
@ -2375,6 +2379,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
"patient.sex AS sex," +
|
|
"patient.sex AS sex," +
|
|
"patient.idcard AS idcard," +
|
|
"patient.idcard AS idcard," +
|
|
"patient.photo AS photo," +
|
|
"patient.photo AS photo," +
|
|
|
|
"outpatient.mobile AS mobile," +
|
|
"patient.birthday AS birthday," +
|
|
"patient.birthday AS birthday," +
|
|
"room.consult_type AS consult_type," +
|
|
"room.consult_type AS consult_type," +
|
|
"date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS timedate_format," +
|
|
"date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS timedate_format," +
|
|
@ -3088,11 +3093,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
//根据身份证计算年龄
|
|
//根据身份证计算年龄
|
|
for(Map<String,Object> outpatient :list){
|
|
for(Map<String,Object> outpatient :list){
|
|
String idcard = (String)outpatient.get("idcard");
|
|
String idcard = (String)outpatient.get("idcard");
|
|
|
|
String patient_id = (String)outpatient.get("patient_id");
|
|
outpatient.put("age",DateUtil.getAgeForIdcard(idcard));
|
|
outpatient.put("age",DateUtil.getAgeForIdcard(idcard));
|
|
|
|
|
|
String outpatient_id = (String)outpatient.get("id");
|
|
String outpatient_id = (String)outpatient.get("id");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String isAlert = redisTemplate.opsForValue().get("patient_alert_"+patient_id);
|
|
|
|
if(StringUtils.isBlank(isAlert)){
|
|
|
|
outpatient.put("alert_tag",0);//已提醒
|
|
|
|
}else{
|
|
|
|
outpatient.put("alert_tag",1);//未提醒
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@ -3110,6 +3121,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
"patient.photo AS photo," +
|
|
"patient.photo AS photo," +
|
|
"patient.birthday AS birthday," +
|
|
"patient.birthday AS birthday," +
|
|
"patient.mobile AS mobile," +
|
|
"patient.mobile AS mobile," +
|
|
|
|
"outpatient.mobile AS outpatient_mobile," +
|
|
"room.consult_type AS consult_type," +
|
|
"room.consult_type AS consult_type," +
|
|
"date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS time," +
|
|
"date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS time," +
|
|
"date_format(room.reservation_time ,'%Y-%m-%d' ) AS group_date," +
|
|
"date_format(room.reservation_time ,'%Y-%m-%d' ) AS group_date," +
|
|
@ -3141,6 +3153,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
//根据身份证计算年龄
|
|
//根据身份证计算年龄
|
|
for(Map<String,Object> outpatient :list){
|
|
for(Map<String,Object> outpatient :list){
|
|
String idcard = (String)outpatient.get("idcard");
|
|
String idcard = (String)outpatient.get("idcard");
|
|
|
|
String patient_id = (String)outpatient.get("patient_id");
|
|
outpatient.put("age",DateUtil.getAgeForIdcard(idcard));
|
|
outpatient.put("age",DateUtil.getAgeForIdcard(idcard));
|
|
|
|
|
|
String group_date = (String)outpatient.get("group_date");
|
|
String group_date = (String)outpatient.get("group_date");
|
|
@ -3156,8 +3169,19 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
//全科医生来源
|
|
//全科医生来源
|
|
outpatient.put("general_doctor_info","");//全科医生名字
|
|
outpatient.put("general_doctor_info","");//全科医生名字
|
|
outpatient.put("general_doctor_hospital","");//全科医生社区
|
|
outpatient.put("general_doctor_hospital","");//全科医生社区
|
|
outpatient.put("alert_tag",0);//是否已提醒
|
|
|
|
|
|
String isAlert = redisTemplate.opsForValue().get("patient_alert_"+patient_id);
|
|
|
|
if(StringUtils.isBlank(isAlert)){
|
|
|
|
outpatient.put("alert_tag",0);//已提醒
|
|
|
|
}else{
|
|
|
|
outpatient.put("alert_tag",1);//未提醒
|
|
|
|
}
|
|
|
|
|
|
outpatient.put("online_tag",0);//在线状态
|
|
outpatient.put("online_tag",0);//在线状态
|
|
|
|
|
|
|
|
String outpatient_mobile = (String)outpatient.get("outpatient_mobile");
|
|
|
|
if(StringUtils.isNoneBlank(outpatient_mobile)){
|
|
|
|
outpatient.put("mobile",outpatient_mobile);//复诊有手机号,传递复诊手机号
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|