|
@ -364,6 +364,25 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
@Autowired
|
|
|
private HealthCareNewService healthCareNewService;
|
|
|
|
|
|
//已就诊医生列表
|
|
|
public PageEnvelop visitedDoctorPage(String patientId,String startTime,String endTime,Integer page,Integer size){
|
|
|
String sql = "SELECT d.id,d.name,d.job_title_name jobTitleName,o.dept_name deptName,d.photo,date_format(MAX(o.create_time),'%Y-%m-%d %H:%i:%S' )" +
|
|
|
" createTime,o.outpatient_type outpatientType ";
|
|
|
String countSql = " select count(distinct d.id)";
|
|
|
String filter = "" +
|
|
|
"from wlyy_outpatient o,base_doctor d " +
|
|
|
"WHERE o.patient='"+patientId+"' and o.doctor=d.id ";
|
|
|
if(StringUtils.isNotBlank(startTime)){
|
|
|
filter += " and o.create_time>='"+startTime+"' ";
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(endTime)){
|
|
|
filter += " and o.create_time<='"+endTime+" 23:59:59' ";
|
|
|
}
|
|
|
String orderBy = " GROUP BY d.id order by createTime desc limit "+(page-1)*size+","+size;
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql+filter+orderBy);
|
|
|
Long count = jdbcTemplate.queryForObject(countSql+filter,Long.class);
|
|
|
return PageEnvelop.getSuccessListWithPage("查询成功",list,page,size,count);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取居民就诊记录接口
|
|
@ -7908,16 +7927,27 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
|
|
|
|
|
|
public Map<String, Object> updatePatientInfo(String patient, String name, String idcard, String ssc, Integer sex, String townCode, String townName, String committeeCode, String committeeName, String address, String photo, String mobile, String province, String provinceName, String city, String cityName) {
|
|
|
public Map<String, Object> updatePatientInfo(String patient, String name, String idcard,String cardType, String ssc, Integer sex, String townCode, String townName, String committeeCode, String committeeName, String address, String photo, String mobile, String province, String provinceName, String city, String cityName) {
|
|
|
Map<String, Object> rs = new HashedMap();
|
|
|
BasePatientDO basePatientDO = basePatientDao.findById(patient).orElse(null);
|
|
|
PatientMedicareCardDO patientMedicareCardDO = basePatientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01", patient, "1");
|
|
|
if (StringUtils.isNoneBlank(name)) {
|
|
|
basePatientDO.setName(name);
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(idcard)) {
|
|
|
basePatientDO.setIdcard(idcard);
|
|
|
if(StringUtils.isBlank(basePatientDO.getIdcard())){
|
|
|
//身份证空才允许修改
|
|
|
if (StringUtils.isNoneBlank(idcard)) {
|
|
|
boolean tmp = basePatientDao.existsByIdcardAndDel(idcard,"1");
|
|
|
if(tmp){
|
|
|
throw new ServiceException("该身份证已存在账号,不允许修改成此身份证");
|
|
|
}
|
|
|
basePatientDO.setIdcard(idcard);
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(cardType)) {
|
|
|
basePatientDO.setCardType(cardType);
|
|
|
}
|
|
|
|
|
|
if (sex != null) {
|
|
|
basePatientDO.setSex(sex);
|
|
|
}
|