|
@ -8,6 +8,7 @@ import com.yihu.jw.doctor.dao.BaseDoctorDao;
|
|
|
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
|
import com.yihu.jw.entity.base.servicePackage.ServiceItemPlanDO;
|
|
|
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.*;
|
|
@ -102,7 +103,7 @@ public class SynchronizePatientService {
|
|
|
String idcard = infoDO.getIdcard();
|
|
|
String conNo = infoDO.getConNo();//就诊次数
|
|
|
String visitNo = infoDO.getVisitNo();//就诊号
|
|
|
String hisPid = infoDO.getHisPid();//就诊号
|
|
|
String hisPid = infoDO.getHisPid();//his居民id
|
|
|
|
|
|
JSONArray cardList = null;
|
|
|
BasePatientDO patient = null;
|
|
@ -236,10 +237,10 @@ public class SynchronizePatientService {
|
|
|
WlyyOutpatientVO outpatientVO = dsyyPrescriptionService.selectOutpatientInfoByHisId(hisPid,conNo);
|
|
|
dept = outpatientVO.getDept();
|
|
|
deptName = outpatientVO.getDeptName();
|
|
|
// List<DoctorMappingDO> doctorMappingDOS = doctorMappingDao.findByMappingCode(outpatientVO.getDoctor());
|
|
|
// if(doctorMappingDOS.size()>0){
|
|
|
// doctorIdMz = doctorMappingDOS.get(0).getDoctor();
|
|
|
// }
|
|
|
List<DoctorMappingDO> doctorMappingDOS = doctorMappingDao.findByMappingCode(outpatientVO.getDoctor());
|
|
|
if(doctorMappingDOS.size()>0){
|
|
|
doctorIdMz = doctorMappingDOS.get(0).getDoctor();
|
|
|
}
|
|
|
doctorNameMz = outpatientVO.getDoctorName();
|
|
|
mzTime = DateUtil.dateToStrLong(outpatientVO.getConDate());
|
|
|
}catch (Exception e){
|
|
@ -303,11 +304,13 @@ public class SynchronizePatientService {
|
|
|
infoDO.setTemplatePlanId(planTemplateDO.getId());
|
|
|
infoDO.setTemplatePlanName(planTemplateDO.getTitle());
|
|
|
if("1".equals(eventType)){
|
|
|
doctorIdMz = findDoctorByName(doctorNameMz,planTemplateDO.getDepts());
|
|
|
if(StringUtils.isBlank(doctorIdMz)){
|
|
|
infoDO.setStatus(4);
|
|
|
rehabilitationPatientInfoDao.save(infoDO);
|
|
|
return "医生信息查询不到";
|
|
|
doctorIdMz = findDoctorByName(doctorNameMz,planTemplateDO.getDepts());
|
|
|
if(StringUtils.isBlank(doctorIdMz)){
|
|
|
infoDO.setStatus(4);
|
|
|
rehabilitationPatientInfoDao.save(infoDO);
|
|
|
return "医生信息查询不到";
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
doctorIdZy = findDoctorByName(doctorNameZy,planTemplateDO.getDepts());
|
|
@ -445,6 +448,7 @@ public class SynchronizePatientService {
|
|
|
if (StringUtils.isBlank(type)){//为空
|
|
|
results.append("未分配居民下转type:"+type+"\n");
|
|
|
sql = " select * from base_patient_discharge_record where status is null and create_time>'"+preTimeStr+"' order by create_time limit 30";
|
|
|
// sql = " select * from base_patient_discharge_record where status is null and create_time>'2025-07-01' order by create_time limit 100";
|
|
|
}else{
|
|
|
results.append("指定状态居民下转type:"+type+"\n");
|
|
|
sql = " select * from base_patient_discharge_record where status='"+type+"' and create_time>'"+preTimeStr+"' order by create_time limit 30";
|
|
@ -500,6 +504,7 @@ public class SynchronizePatientService {
|
|
|
infoDO.setConNo(conNo);
|
|
|
infoDO.setVisitNo(visitNo);
|
|
|
infoDO.setSignStatus(0);
|
|
|
infoDO.setCrzq(DateUtil.dateToStrLong(re.getCreateTime()));
|
|
|
infoDO.setDischargeRecordId(re.getId());
|
|
|
rehabilitationPatientInfoDao.save(infoDO);
|
|
|
re.setStatus("1");
|
|
@ -511,7 +516,7 @@ public class SynchronizePatientService {
|
|
|
basePatientDischargeRecordDao.save(re);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
String turnDate = DateUtil.dateToStrShort(re.getCreateTime());//下转日期
|
|
|
BasePatientDO patient = null;
|
|
|
List<BasePatientDO> patientList = patientDao.getPatientByIdcard(re.getIdcard());//获取患者信息
|
|
|
JSONArray cardList = dsyyPrescriptionService.findCardNo(idcard);
|
|
@ -560,6 +565,7 @@ public class SynchronizePatientService {
|
|
|
String mzbl = dsyyPrescriptionService.selectReportInfo("JHIDS-USD-HLWMZBL-014",SICK_ID,conNo,1,1);
|
|
|
if(StringUtils.isNotBlank(mzbl)&&!"[]".equals(mzbl)){
|
|
|
jaMzbl = JSONArray.parseArray(mzbl).getJSONObject(0);
|
|
|
//判断门诊病历是否下转当天的数据
|
|
|
eventType = "1";
|
|
|
hisPid = SICK_ID;
|
|
|
ssc = CARD_NO;
|
|
@ -634,10 +640,10 @@ public class SynchronizePatientService {
|
|
|
WlyyOutpatientVO outpatientVO = dsyyPrescriptionService.selectOutpatientInfoByHisId(hisPid,conNo);
|
|
|
dept = outpatientVO.getDept();
|
|
|
deptName = outpatientVO.getDeptName();
|
|
|
// List<DoctorMappingDO> doctorMappingDOS = doctorMappingDao.findByMappingCode(outpatientVO.getDoctor());
|
|
|
// if(doctorMappingDOS.size()>0){
|
|
|
// doctorIdMz = doctorMappingDOS.get(0).getDoctor();
|
|
|
// }
|
|
|
List<DoctorMappingDO> doctorMappingDOS = doctorMappingDao.findByMappingCode(outpatientVO.getDoctor());
|
|
|
if(doctorMappingDOS.size()>0){
|
|
|
doctorIdMz = doctorMappingDOS.get(0).getDoctor();
|
|
|
}
|
|
|
doctorNameMz = outpatientVO.getDoctorName();
|
|
|
mzTime = DateUtil.dateToStrLong(outpatientVO.getConDate());
|
|
|
}catch (Exception e){
|
|
@ -699,11 +705,13 @@ public class SynchronizePatientService {
|
|
|
infoDO.setTemplatePlanId(planTemplateDO.getId());
|
|
|
infoDO.setTemplatePlanName(planTemplateDO.getTitle());
|
|
|
if("1".equals(eventType)){
|
|
|
doctorIdMz = findDoctorByName(doctorNameMz,planTemplateDO.getDepts());
|
|
|
if(StringUtils.isBlank(doctorIdMz)){
|
|
|
infoDO.setStatus(4);
|
|
|
rehabilitationPatientInfoDao.save(infoDO);
|
|
|
continue;
|
|
|
doctorIdMz = findDoctorByName(doctorNameMz,planTemplateDO.getDepts());
|
|
|
if(StringUtils.isBlank(doctorIdMz)){
|
|
|
infoDO.setStatus(4);
|
|
|
rehabilitationPatientInfoDao.save(infoDO);
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
doctorIdZy = findDoctorByName(doctorNameZy,planTemplateDO.getDepts());
|