|
@ -3,7 +3,6 @@ package com.yihu.jw.hospital.module.rehabilitation.service;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.yihu.jw.doctor.dao.BaseDoctorDao;
|
|
|
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
@ -12,6 +11,7 @@ import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
|
|
|
import com.yihu.jw.entity.patient.BasePatientDischargeRecord;
|
|
|
import com.yihu.jw.entity.specialist.RehabilitationServiceItemDO;
|
|
|
import com.yihu.jw.entity.specialist.rehabilitation.*;
|
|
|
import com.yihu.jw.hospital.dict.service.WlyyHospitalSysDictService;
|
|
|
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
|
|
|
import com.yihu.jw.hospital.module.rehabilitation.dao.PatientRehabilitationPlanDao;
|
|
|
import com.yihu.jw.hospital.module.rehabilitation.dao.RehabilitationDetailDao;
|
|
@ -21,7 +21,6 @@ import com.yihu.jw.hospital.module.specialist.dao.PatientMedicalRecordsRehabilit
|
|
|
import com.yihu.jw.hospital.prescription.service.DsyyPrescriptionService;
|
|
|
import com.yihu.jw.patient.dao.BasePatientDao;
|
|
|
import com.yihu.jw.patient.dao.BasePatientDischargeRecordDao;
|
|
|
import com.yihu.jw.patient.service.BasePatientService;
|
|
|
import com.yihu.jw.rehabilitation.ServiceItemPlanDao;
|
|
|
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
|
|
|
import com.yihu.jw.util.common.IdCardUtil;
|
|
@ -49,25 +48,15 @@ public class SynchronizePatientService {
|
|
|
|
|
|
private Logger logger = LoggerFactory.getLogger(SynchronizePatientService.class);
|
|
|
|
|
|
|
|
|
private Boolean demoFlag=true;
|
|
|
@Autowired
|
|
|
private BaseDoctorDao doctorDao;
|
|
|
@Autowired
|
|
|
private ObjectMapper objectMapper;
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
@Autowired
|
|
|
private BasePatientDao patientDao;
|
|
|
@Autowired
|
|
|
private RehabilitationPatientInfoDao rehabilitationPatientInfoDao;
|
|
|
@Autowired
|
|
|
private BasePatientService patientService;
|
|
|
@Autowired
|
|
|
private RehabilitationInfoService rehabilitationInfoService;
|
|
|
@Autowired
|
|
|
private PatientRecordService patientRecordService;
|
|
|
@Autowired
|
|
|
private ServiceItemPlanDao serviceItemPlanDao;
|
|
|
@Autowired
|
|
|
private PatientRehabilitationPlanDao patientRehabilitationPlanDao;
|
|
@ -87,6 +76,8 @@ public class SynchronizePatientService {
|
|
|
private DoctorMappingDao doctorMappingDao;
|
|
|
@Autowired
|
|
|
private PatientMedicalRecordsRehabilitationDao patientMedicalRecordsDao;
|
|
|
@Autowired
|
|
|
private WlyyHospitalSysDictService sysDictService;
|
|
|
|
|
|
//手动重新下转
|
|
|
public String synchronizePationSingle(Long id) throws Exception{
|
|
@ -453,10 +444,27 @@ public class SynchronizePatientService {
|
|
|
}
|
|
|
|
|
|
//基卫补推送出院小结后,重新下转
|
|
|
public StringBuilder reSynchronizePation(String type,String hospital,String createTime) throws Exception{
|
|
|
StringBuilder results = new StringBuilder("居民下转\n");
|
|
|
|
|
|
return results;
|
|
|
public void reSynchronizePation(String status,String eventType) throws Exception{
|
|
|
Date nowDate = new Date();
|
|
|
String preDays = sysDictService.getDictValue("synchronizePation","preDays");
|
|
|
if(StringUtils.isBlank(preDays)){
|
|
|
preDays = "7";
|
|
|
}
|
|
|
Date preTime = DateUtil.getPreDays(nowDate, -Integer.parseInt(preDays));
|
|
|
String preTimeStr = DateUtil.dateToStrShort(preTime);
|
|
|
String sql = " select id from wlyy_rehabilitation_patient_info where status='"+status+"' and create_time>'"+preTimeStr+"' ";
|
|
|
if(StringUtils.isNotBlank(eventType)){
|
|
|
sql += " and event_type='"+eventType+"' ";
|
|
|
}
|
|
|
sql += " order by id limit 30";
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
for (Map<String,Object> map:list){
|
|
|
try {
|
|
|
synchronizePationSingle(Long.parseLong(map.get("id")+""));
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//康复管理自动下转
|