|
@ -7,23 +7,21 @@ 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.base.system.SystemDictDO;
|
|
|
import com.yihu.jw.entity.door.SignFamily;
|
|
|
import com.yihu.jw.entity.followup.Followup;
|
|
|
import com.yihu.jw.entity.followup.FollowupContent;
|
|
|
import com.yihu.jw.entity.followup.FollowupMapping;
|
|
|
import com.yihu.jw.entity.followup.FollowupSign;
|
|
|
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
|
|
|
import com.yihu.jw.entity.hospital.message.MessageNoticeSetting;
|
|
|
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
|
|
|
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
|
|
|
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
|
|
|
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
|
|
|
import com.yihu.jw.hospital.message.service.SystemMessageService;
|
|
|
import com.yihu.jw.hospital.module.followup.dao.*;
|
|
|
import com.yihu.jw.hospital.module.rehabilitation.service.RehabilitationManageService;
|
|
|
import com.yihu.jw.hospital.module.system.service.SystemDictService;
|
|
|
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
|
|
|
import com.yihu.jw.hospital.task.PushMsgTask;
|
|
|
import com.yihu.jw.hospital.team.dao.WlyySignFamilyDao;
|
|
|
import com.yihu.jw.patient.dao.BasePatientDao;
|
|
|
import com.yihu.jw.patient.service.BasePatientService;
|
|
|
import com.yihu.jw.util.date.DateUtil;
|
|
@ -83,10 +81,7 @@ public class FollowUpService {
|
|
|
private FollowupContentDao followupContentDao;
|
|
|
|
|
|
@Autowired
|
|
|
private SystemDictService systemDictService;
|
|
|
|
|
|
@Autowired
|
|
|
private WlyySignFamilyDao signFamilyDao;
|
|
|
private WlyyHospitalSysDictDao hospitalSysDictDao;
|
|
|
|
|
|
// @Autowired
|
|
|
// private DrHealthTeamService drHealthTeamService;
|
|
@ -97,9 +92,6 @@ public class FollowUpService {
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
@Autowired
|
|
|
SystemDictService dictService;
|
|
|
|
|
|
@Autowired
|
|
|
private BasePatientService patientService;
|
|
|
@Autowired
|
|
@ -139,18 +131,15 @@ public class FollowUpService {
|
|
|
@Autowired
|
|
|
private RehabilitationManageService rehabilitationManageService;
|
|
|
|
|
|
// @Autowired
|
|
|
// private VisitDetailService visitDetailService;
|
|
|
|
|
|
// @Autowired
|
|
|
// private ElasticFactory elasticFactory;
|
|
|
// @Autowired
|
|
|
// private ElastricSearchSave elastricSearchSave;
|
|
|
// @Autowired
|
|
|
// private ElasticsearchUtil elasticsearchUtil;
|
|
|
// @Autowired
|
|
|
// private BusinessMappingDao businessMappingDao;
|
|
|
|
|
|
//字典
|
|
|
public String getDictValue(String dictName,String code){
|
|
|
WlyyHospitalSysDictDO dictDO = hospitalSysDictDao.findOneByDictNameAndDictCode(dictName,code);
|
|
|
if(dictDO!=null){
|
|
|
return dictDO.getDictValue();
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 转译随访信息
|
|
@ -183,7 +172,7 @@ public class FollowUpService {
|
|
|
|
|
|
//随访方式转译
|
|
|
re.put("followupType", followup.getFollowupType());
|
|
|
String followupTypeName = systemDictService.getDictValue("FOLLOWUP_WAY_DICT", followup.getFollowupType());
|
|
|
String followupTypeName = getDictValue("FOLLOWUP_WAY_DICT", followup.getFollowupType());
|
|
|
re.put("followupTypeName", followupTypeName);
|
|
|
|
|
|
//随访类别转译
|
|
@ -191,12 +180,12 @@ public class FollowUpService {
|
|
|
String followupClass = followup.getFollowupClass();
|
|
|
re.put("followupClass", followupClass);
|
|
|
|
|
|
String followupClassName = systemDictService.getDictValue("FOLLOWUP_CLASS_DICT", followup.getFollowupClass());
|
|
|
String followupClassName = getDictValue("FOLLOWUP_CLASS_DICT", followup.getFollowupClass());
|
|
|
if (StringUtils.isNoneBlank(followupClass) && followupClass.contains(",")) {
|
|
|
String[] followupClassArray = followupClass.split(",");
|
|
|
followupClassName = "";
|
|
|
for (int i = 0; i < followupClassArray.length; i++) {
|
|
|
followupClassName += systemDictService.getDictValue("FOLLOWUP_CLASS_DICT", followupClassArray[i]);
|
|
|
followupClassName += getDictValue("FOLLOWUP_CLASS_DICT", followupClassArray[i]);
|
|
|
if (i != followupClassArray.length - 1) {
|
|
|
followupClassName += ",";
|
|
|
}
|
|
@ -207,7 +196,7 @@ public class FollowUpService {
|
|
|
|
|
|
//随访管理状态转译
|
|
|
re.put("followupManagerStatus", followup.getFollowupManagerStatus());
|
|
|
String followupManagerStatusName = systemDictService.getDictValue("FOLLOWUP_MANAGER_STATUS", followup.getFollowupManagerStatus());
|
|
|
String followupManagerStatusName = getDictValue("FOLLOWUP_MANAGER_STATUS", followup.getFollowupManagerStatus());
|
|
|
re.put("followupManagerStatusName", followupManagerStatusName);
|
|
|
|
|
|
re.put("doctorCode", followup.getDoctorCode());
|
|
@ -293,18 +282,16 @@ public class FollowUpService {
|
|
|
Map<String, String> dictMap = new HashMap<>();
|
|
|
Map<String, String> statusMap = new HashMap<>();
|
|
|
Map<String, String> mngStatusMap = new HashMap<>();
|
|
|
List<SystemDictDO> dicts = dictService.getDictByDictName("FOLLOWUP_WAY_DICT");
|
|
|
List<SystemDictDO> mngDicts = dictService.getDictByDictName("FOLLOWUP_MANAGER_STATUS");
|
|
|
List<WlyyHospitalSysDictDO> dicts = hospitalSysDictDao.findByDictName("FOLLOWUP_WAY_DICT");
|
|
|
List<WlyyHospitalSysDictDO> mngDicts = hospitalSysDictDao.findByDictName("FOLLOWUP_MANAGER_STATUS");
|
|
|
if (dicts != null) {
|
|
|
for (SystemDictDO dict : dicts) {
|
|
|
// dictMap.put(dict.getCode(), dict.getValue());
|
|
|
dictMap.put(dict.getCode(), dict.getName());
|
|
|
for (WlyyHospitalSysDictDO dict : dicts) {
|
|
|
dictMap.put(dict.getDictCode(), dict.getDictValue());
|
|
|
}
|
|
|
}
|
|
|
if (mngDicts != null) {
|
|
|
for (SystemDictDO dict : mngDicts) {
|
|
|
// mngStatusMap.put(dict.getCode(), dict.getValue());
|
|
|
mngStatusMap.put(dict.getCode(), dict.getName());
|
|
|
for (WlyyHospitalSysDictDO dict : mngDicts) {
|
|
|
mngStatusMap.put(dict.getDictCode(), dict.getDictValue());
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -404,18 +391,16 @@ public class FollowUpService {
|
|
|
Map<String, String> dictMap = new HashMap<>();
|
|
|
Map<String, String> statusMap = new HashMap<>();
|
|
|
Map<String, String> mngStatusMap = new HashMap<>();
|
|
|
List<SystemDictDO> dicts = dictService.getDictByDictName("FOLLOWUP_WAY_DICT");
|
|
|
List<SystemDictDO> mngDicts = dictService.getDictByDictName("FOLLOWUP_MANAGER_STATUS");
|
|
|
List<WlyyHospitalSysDictDO> dicts = hospitalSysDictDao.findByDictName("FOLLOWUP_WAY_DICT");
|
|
|
List<WlyyHospitalSysDictDO> mngDicts = hospitalSysDictDao.findByDictName("FOLLOWUP_MANAGER_STATUS");
|
|
|
if (dicts != null) {
|
|
|
for (SystemDictDO dict : dicts) {
|
|
|
// dictMap.put(dict.getCode(), dict.getValue());
|
|
|
dictMap.put(dict.getCode(), dict.getName());
|
|
|
for (WlyyHospitalSysDictDO dict : dicts) {
|
|
|
dictMap.put(dict.getDictCode(), dict.getDictCode());
|
|
|
}
|
|
|
}
|
|
|
if (mngDicts != null) {
|
|
|
for (SystemDictDO dict : mngDicts) {
|
|
|
// mngStatusMap.put(dict.getCode(), dict.getValue());
|
|
|
mngStatusMap.put(dict.getCode(), dict.getName());
|
|
|
for (WlyyHospitalSysDictDO dict : mngDicts) {
|
|
|
mngStatusMap.put(dict.getDictCode(), dict.getDictCode());
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -518,9 +503,6 @@ public class FollowUpService {
|
|
|
if (patient == null) {
|
|
|
throw new RuntimeException("获取不到用户信息!");
|
|
|
}
|
|
|
SignFamily signFamily = signFamilyDao.findByjiatingPatient(patientCode);
|
|
|
Long adminCodeId = 0L;
|
|
|
|
|
|
List<Followup> followupPlan = new ArrayList<>();
|
|
|
for (Map<String, String> map : list) {
|
|
|
//获取医生信息
|
|
@ -545,17 +527,10 @@ public class FollowUpService {
|
|
|
followup.setStatus("2"); //状态 0取消 1已完成 2未开始 3进行中
|
|
|
followup.setCreateTime(new Date());
|
|
|
followup.setCreater(doctorCode);
|
|
|
if (!map.get("followupClass").toString().equalsIgnoreCase("10")) {
|
|
|
if (signFamily == null) {
|
|
|
throw new RuntimeException("非家签居民仅支持创建体温异常随访");
|
|
|
} else {
|
|
|
adminCodeId = signFamily.getAdminTeamId();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
followup.setFollowupClass(map.get("followupClass"));
|
|
|
followup.setType(Integer.parseInt(map.get("type1").toString()));
|
|
|
followup.setAdminTeamCode(adminCodeId);
|
|
|
// followup.setAdminTeamCode(adminCodeId);
|
|
|
followup.setSignType(2);
|
|
|
|
|
|
//获取随访医生角色类型
|
|
@ -774,16 +749,6 @@ public class FollowUpService {
|
|
|
if (patient == null) {
|
|
|
throw new RuntimeException("查找不到居民信息!");
|
|
|
}
|
|
|
SignFamily signFamily = signFamilyDao.findByjiatingPatient(patientCode);
|
|
|
Long adminId = 0L;
|
|
|
if (!followupClass.equalsIgnoreCase("10")) {
|
|
|
if (signFamily == null) {
|
|
|
throw new RuntimeException("非家签居民仅支持创建体温异常随访");
|
|
|
} else {
|
|
|
adminId = signFamily.getAdminTeamId();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
Followup followup = new Followup();
|
|
|
Date followDate = DateUtil.strToDate(date);
|
|
@ -803,7 +768,7 @@ public class FollowUpService {
|
|
|
followup.setStatus("2"); //状态 0取消 1已完成 2未开始 3进行中
|
|
|
followup.setCreateTime(new Date());
|
|
|
followup.setCreater(doctorCode);
|
|
|
followup.setAdminTeamCode(signFamily.getAdminTeamId());
|
|
|
// followup.setAdminTeamCode(signFamily.getAdminTeamId());
|
|
|
followup.setSignType(2);
|
|
|
if (type != null && type != 0) {
|
|
|
followup.setType(type);
|
|
@ -923,18 +888,17 @@ public class FollowUpService {
|
|
|
public List<Map<String, String>> getFollowupProject(String id) throws Exception {
|
|
|
List<Map<String, String>> re = new ArrayList<>();
|
|
|
//获取已填写的面访项目
|
|
|
// List<String> project = followupContentDao.findProjectByFollowupId(Long.valueOf(id));
|
|
|
List<String> project = followupContentDao.findProjectByFollowupId(Long.valueOf(id));
|
|
|
//修改为通过ES查询---2017.11.01--huangwenjie
|
|
|
// List<String> project = esfindProjectByFollowupId(id);
|
|
|
List<String> project = null;
|
|
|
//获取所有面访项目
|
|
|
List<SystemDictDO> dictList = systemDictService.getDictByDictName("FOLLOWUP_PROJECT");
|
|
|
List<WlyyHospitalSysDictDO> dictList = hospitalSysDictDao.findByDictName("FOLLOWUP_PROJECT");
|
|
|
if (dictList != null && dictList.size() > 0) {
|
|
|
for (SystemDictDO dict : dictList) {
|
|
|
for (WlyyHospitalSysDictDO dict : dictList) {
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
String code = dict.getCode();
|
|
|
String code = dict.getDictCode();
|
|
|
map.put("projectCode", code);
|
|
|
map.put("projectName", dict.getName());
|
|
|
map.put("projectName", dict.getDictValue());
|
|
|
if (project != null && project.contains(code)) {
|
|
|
map.put("status", "1"); //已填写
|
|
|
} else {
|
|
@ -986,21 +950,21 @@ public class FollowUpService {
|
|
|
|
|
|
}
|
|
|
|
|
|
Followup followup = followupDao.findById(Long.valueOf(id)).orElse(null);
|
|
|
// Followup followup = followupDao.findById(Long.valueOf(id)).orElse(null);
|
|
|
|
|
|
//如果该随访是已完成的,则添加随访信息上传映射,上传到基卫
|
|
|
if ("1".equals(followup.getStatus())) {
|
|
|
FollowupMapping followupMapping = followUpMappingDao.findByFollowupId(Integer.parseInt(id));
|
|
|
if (followupMapping == null) {
|
|
|
followupMapping = new FollowupMapping();
|
|
|
followupMapping.setCode(UUID.randomUUID().toString());
|
|
|
followupMapping.setFollowupId(Integer.parseInt(id));
|
|
|
followupMapping.setUpdateTime(DateUtil.getNowTimestamp());
|
|
|
followupMapping.setCreateTime(DateUtil.getNowTimestamp());
|
|
|
}
|
|
|
followupMapping.setNeedUpload(1);
|
|
|
followUpMappingDao.save(followupMapping);
|
|
|
}
|
|
|
// if ("1".equals(followup.getStatus())) {
|
|
|
// FollowupMapping followupMapping = followUpMappingDao.findByFollowupId(Integer.parseInt(id));
|
|
|
// if (followupMapping == null) {
|
|
|
// followupMapping = new FollowupMapping();
|
|
|
// followupMapping.setCode(UUID.randomUUID().toString());
|
|
|
// followupMapping.setFollowupId(Integer.parseInt(id));
|
|
|
// followupMapping.setUpdateTime(DateUtil.getNowTimestamp());
|
|
|
// followupMapping.setCreateTime(DateUtil.getNowTimestamp());
|
|
|
// }
|
|
|
// followupMapping.setNeedUpload(1);
|
|
|
// followUpMappingDao.save(followupMapping);
|
|
|
// }
|
|
|
}
|
|
|
|
|
|
|
|
@ -1041,7 +1005,7 @@ public class FollowUpService {
|
|
|
private List<BaseDoctorDO> getTeamDoctors(String doctor, String patient) throws Exception {
|
|
|
List<BaseDoctorDO> doctors = new ArrayList<>();
|
|
|
//获取医生团队成员
|
|
|
SignFamily signFamily = signFamilyDao.findByFamilyDoctorAndPatient(doctor, patient);
|
|
|
// SignFamily signFamily = signFamilyDao.findByFamilyDoctorAndPatient(doctor, patient);
|
|
|
// 查询家庭医生团队
|
|
|
// if (signFamily != null) {
|
|
|
// doctors = drHealthTeamService.findTeamDoctors(signFamily.getTeamCode());
|
|
@ -2045,12 +2009,6 @@ public class FollowUpService {
|
|
|
BasePatientDO p = patientDao.findById(followup.getPatientCode()).orElse(null);
|
|
|
followup.setPatientName(p.getName());
|
|
|
followup.setIdcard(p.getIdcard());
|
|
|
|
|
|
//新增保存签约id v1.6.8.3
|
|
|
SignFamily signFamily = signFamilyDao.findByjiatingPatient(followup.getPatientCode());
|
|
|
if (signFamily != null) {
|
|
|
followup.setAdminTeamCode(signFamily.getAdminTeamId());
|
|
|
}
|
|
|
}
|
|
|
List<Date> dateList = followupDao.findFollowupDateList(followup.getDoctorCode(), followup.getPatientCode());
|
|
|
Date prior = null;
|