|
@ -1,3411 +0,0 @@
|
|
|
package com.yihu.jw.afterDiagnosis.service.followup;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.fasterxml.jackson.databind.JavaType;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.yihu.jw.afterDiagnosis.dao.followup.FollowUpDao;
|
|
|
import com.yihu.jw.afterDiagnosis.dao.followup.FollowupContentDao;
|
|
|
import com.yihu.jw.afterDiagnosis.dao.followup.FollowupDrugsDao;
|
|
|
import com.yihu.jw.afterDiagnosis.dao.followup.FollowupSignDao;
|
|
|
import com.yihu.jw.doctor.dao.BaseDoctorDao;
|
|
|
import com.yihu.jw.elasticsearch.ElasticSearch7Helper;
|
|
|
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
|
import com.yihu.jw.entity.followup.Followup;
|
|
|
import com.yihu.jw.entity.followup.FollowupContent;
|
|
|
import com.yihu.jw.entity.followup.FollowupDrugs;
|
|
|
import com.yihu.jw.entity.followup.FollowupSign;
|
|
|
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
|
|
|
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
|
|
|
import com.yihu.jw.followup.FollowupContentESDO;
|
|
|
import com.yihu.jw.followup.OlderPeopleHealthCheckRecordES;
|
|
|
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
|
|
|
import com.yihu.jw.hospital.dict.service.WlyyHospitalSysDictService;
|
|
|
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
|
|
|
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
|
|
|
import com.yihu.jw.patient.dao.BasePatientDao;
|
|
|
import com.yihu.jw.util.common.CommonUtil;
|
|
|
import com.yihu.jw.util.common.IdCardUtil;
|
|
|
import com.yihu.jw.util.date.DateUtil;
|
|
|
import com.yihu.jw.util.entity.ServiceException;
|
|
|
import com.yihu.jw.util.file.FileUtil;
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.elasticsearch.action.bulk.BulkRequest;
|
|
|
import org.elasticsearch.action.bulk.BulkResponse;
|
|
|
import org.elasticsearch.action.delete.DeleteRequest;
|
|
|
import org.elasticsearch.client.RequestOptions;
|
|
|
import org.elasticsearch.client.RestHighLevelClient;
|
|
|
import org.elasticsearch.common.unit.TimeValue;
|
|
|
import org.elasticsearch.index.query.BoolQueryBuilder;
|
|
|
import org.elasticsearch.index.query.QueryBuilders;
|
|
|
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
|
import org.jsoup.Jsoup;
|
|
|
import org.jsoup.nodes.Document;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.data.domain.Sort;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.transaction.Transactional;
|
|
|
import java.io.BufferedWriter;
|
|
|
import java.io.File;
|
|
|
import java.io.FileWriter;
|
|
|
import java.text.DateFormat;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 随访服务
|
|
|
*
|
|
|
* @author hzp add 2016-12-07
|
|
|
*/
|
|
|
@Component
|
|
|
@Transactional(rollbackOn = Exception.class)
|
|
|
public class FollowUpService {
|
|
|
|
|
|
private static Logger logger = LoggerFactory.getLogger(FollowUpService.class);
|
|
|
|
|
|
//统计随访类型
|
|
|
public static String[] FOLLOWUP_TYPE = {"1","2","3","10","22"};
|
|
|
//随访类别,多类别“,”分割【1.高血压 2.糖尿病 3.肿瘤 4.精神分裂症 5.产后 6.新生儿 7.严重精神病 8.80岁以上老人 9.肺结核】
|
|
|
public static String[] FOLLOWUP_CLASS = {"1","2","1,2","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"};
|
|
|
|
|
|
@Autowired
|
|
|
private BaseDoctorDao doctorDao;
|
|
|
|
|
|
@Autowired
|
|
|
private BasePatientDao patientDao;
|
|
|
|
|
|
@Autowired
|
|
|
private FollowUpDao followupDao;
|
|
|
|
|
|
@Autowired
|
|
|
private FollowupContentDao followupContentDao;
|
|
|
@Autowired
|
|
|
private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
|
|
|
@Autowired
|
|
|
private WlyyHospitalSysDictService hospitalSysDictService;
|
|
|
@Autowired
|
|
|
private SystemMessageDao messageDao;
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
@Autowired
|
|
|
private FollowupDrugsDao followupDrugsDao;
|
|
|
@Value("${es.index.FollowUp}")
|
|
|
private String esIndex;
|
|
|
@Autowired
|
|
|
private ElasticSearch7Helper elasticSearch7Helper;
|
|
|
@Resource(name="restHighLevelClient")
|
|
|
private RestHighLevelClient restHighLevelClient;
|
|
|
@Autowired
|
|
|
private ObjectMapper objectMapper;
|
|
|
@Autowired
|
|
|
private FollowupSignDao followupSignDao;
|
|
|
@Autowired
|
|
|
private PrescriptionDao prescriptionDao;
|
|
|
@Autowired
|
|
|
private VisitDetailService visitDetailService;
|
|
|
@Value("${fastDFS.fastdfs_file_url}")
|
|
|
private String imgUrlDomain;
|
|
|
// @Autowired
|
|
|
// private RehabilitationManageService rehabilitationManageService;
|
|
|
|
|
|
/**
|
|
|
* 转译随访信息
|
|
|
*/
|
|
|
private Map<String, String> getFollowupDetail(Followup followup) throws Exception {
|
|
|
Map<String, String> re = new HashMap<>();
|
|
|
//患者信息
|
|
|
String patientCode = followup.getPatientCode();
|
|
|
BasePatientDO patient = patientDao.findById(patientCode).orElse(null);
|
|
|
if (patient != null) {
|
|
|
re.put("patientCode", patientCode);
|
|
|
re.put("patientName", patient.getName());
|
|
|
re.put("idcard", patient.getIdcard());
|
|
|
String mobile = patient.getMobile();
|
|
|
if (StringUtils.isEmpty(mobile)) {
|
|
|
mobile = patient.getMobileRemarks();
|
|
|
}
|
|
|
re.put("mobile", mobile);
|
|
|
re.put("sex", String.valueOf(patient.getSex()));
|
|
|
re.put("birthday", DateUtil.dateToStrLong(patient.getBirthday()));
|
|
|
re.put("photo", patient.getPhoto());
|
|
|
} else {
|
|
|
throw new ServiceException("查找不到用户信息!");
|
|
|
}
|
|
|
|
|
|
re.put("id", String.valueOf(followup.getId()));
|
|
|
re.put("followupNo", followup.getFollowupNo());
|
|
|
re.put("followupDate", DateUtil.dateToStrLong(followup.getFollowupDate()));
|
|
|
re.put("followupNextDate", DateUtil.dateToStrLong(followup.getFollowupNextDate()));
|
|
|
|
|
|
//随访方式转译
|
|
|
re.put("followupType", followup.getFollowupType());
|
|
|
String followupTypeName = hospitalSysDictService.getDictValue("FOLLOWUP_WAY_DICT", followup.getFollowupType());
|
|
|
re.put("followupTypeName", followupTypeName);
|
|
|
|
|
|
//随访类别转译
|
|
|
|
|
|
String followupClass = followup.getFollowupClass();
|
|
|
re.put("followupClass", followupClass);
|
|
|
|
|
|
String followupClassName = hospitalSysDictService.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 += hospitalSysDictService.getDictValue("FOLLOWUP_CLASS_DICT", followupClassArray[i]);
|
|
|
if (i != followupClassArray.length - 1) {
|
|
|
followupClassName += ",";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
re.put("followupClassName", followupClassName);
|
|
|
|
|
|
//随访管理状态转译
|
|
|
re.put("followupManagerStatus", followup.getFollowupManagerStatus());
|
|
|
String followupManagerStatusName = hospitalSysDictService.getDictValue("FOLLOWUP_MANAGER_STATUS", followup.getFollowupManagerStatus());
|
|
|
re.put("followupManagerStatusName", followupManagerStatusName);
|
|
|
|
|
|
re.put("doctorCode", followup.getDoctorCode());
|
|
|
re.put("doctorName", followup.getDoctorName());
|
|
|
re.put("orgCode", followup.getOrgCode());
|
|
|
re.put("orgName", followup.getOrgName());
|
|
|
re.put("dataFrom", followup.getDataFrom());
|
|
|
re.put("status", followup.getStatus());
|
|
|
re.put("followupContentPhone", followup.getFollowupContentPhone());
|
|
|
re.put("createTime", DateUtil.dateToStrLong(followup.getCreateTime()));
|
|
|
re.put("creater", followup.getCreater());
|
|
|
re.put("prescriptionCode",followup.getPrescriptionCode());
|
|
|
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取医生随访列表
|
|
|
*/
|
|
|
public List<Map<String, Object>> getListByDoctor(String doctorCode, String startTime, String endTime) throws Exception {
|
|
|
List<Map<String, Object>> re = new ArrayList<>();
|
|
|
Map<String, Map<String, Object>> temp = new HashMap<>();
|
|
|
|
|
|
List<Followup> list = followupDao.findByDoctor(doctorCode, DateUtil.strToDate(startTime), DateUtil.strToDate(endTime));
|
|
|
if (list != null && list.size() > 0) {
|
|
|
for (Followup followup : list) {
|
|
|
String date = DateUtil.dateToStrShort(followup.getFollowupDate());
|
|
|
Map<String, String> map = getFollowupDetail(followup);
|
|
|
if (temp.containsKey(date)) {
|
|
|
Map<String, Object> vo = temp.get(date);
|
|
|
vo.put("num", Integer.parseInt(vo.get("num").toString()) + 1);
|
|
|
((List<Map<String, String>>) vo.get("list")).add(map);
|
|
|
temp.put(date, vo);
|
|
|
} else {
|
|
|
Map<String, Object> vo = new HashMap<>();
|
|
|
List<Map<String, String>> list1 = new ArrayList<>();
|
|
|
vo.put("date", date);
|
|
|
vo.put("num", 1);
|
|
|
list1.add(map);
|
|
|
vo.put("list", list1);
|
|
|
temp.put(date, vo);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
for (Map<String, Object> map : temp.values()) {
|
|
|
re.add(map);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询居民随访列表
|
|
|
*
|
|
|
* @param patient
|
|
|
* @param teamCode
|
|
|
* @param page
|
|
|
* @param pageSize
|
|
|
* @param type 类型:0全部,1计划,2记录
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONArray getListByPatientAndTeam(String patient,String doctor, Long teamCode, int page, int pageSize, String type) {
|
|
|
Sort sort = Sort.by(Sort.Direction.DESC, "createTime");
|
|
|
PageRequest pageRequest = PageRequest.of(page, pageSize, sort);
|
|
|
Page<Object> result = null;
|
|
|
|
|
|
if (StringUtils.isBlank(type)) {
|
|
|
result = followupDao.findByPatientAndTeam(patient, teamCode, doctor, pageRequest);
|
|
|
} else if ("1".equals(type)) {
|
|
|
//已经开始的就是记录
|
|
|
result = followupDao.findPlanByPatientAndTeam(patient,teamCode, doctor, pageRequest);
|
|
|
} else if ("2".equals(type)) {
|
|
|
//未开始的就是计划
|
|
|
result = followupDao.findRecordByPatientAndTeam(patient, teamCode,doctor, pageRequest);
|
|
|
} else {
|
|
|
}
|
|
|
|
|
|
|
|
|
JSONArray array = new JSONArray();
|
|
|
|
|
|
if (result != null && result.getContent().size() > 0) {
|
|
|
Map<String, String> dictMap = new HashMap<>();
|
|
|
Map<String, String> statusMap = new HashMap<>();
|
|
|
Map<String, String> mngStatusMap = new HashMap<>();
|
|
|
List<WlyyHospitalSysDictDO> dicts = wlyyHospitalSysDictDao.findByDictName("FOLLOWUP_WAY_DICT");
|
|
|
List<WlyyHospitalSysDictDO> mngDicts = wlyyHospitalSysDictDao.findByDictName("FOLLOWUP_MANAGER_STATUS");
|
|
|
if (dicts != null) {
|
|
|
for (WlyyHospitalSysDictDO dict : dicts) {
|
|
|
dictMap.put(dict.getDictCode(), dict.getDictValue());
|
|
|
}
|
|
|
}
|
|
|
if (mngDicts != null) {
|
|
|
for (WlyyHospitalSysDictDO dict : mngDicts) {
|
|
|
mngStatusMap.put(dict.getDictCode(), dict.getDictValue());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
statusMap.put("0", "取消");
|
|
|
statusMap.put("1", "已完成");
|
|
|
statusMap.put("2", "未开始");
|
|
|
statusMap.put("3", "进行中");
|
|
|
|
|
|
for (Object obj : result) {
|
|
|
JSONObject followup = new JSONObject();
|
|
|
Object[] objArr = (Object[]) obj;
|
|
|
// 返回值增加居民信息
|
|
|
BasePatientDO patientDetail = patientDao.findByIdAndDel(patient,"1");
|
|
|
followup.put("patientName", patientDetail.getName() != null ? patientDetail.getName() : "");
|
|
|
followup.put("photo", patientDetail.getPhoto() != null ? patientDetail.getPhoto() : "");
|
|
|
followup.put("sex", patientDetail.getSex() != null ? patientDetail.getSex() : "");
|
|
|
followup.put("birthday", patientDetail.getBirthday() != null ? patientDetail.getBirthday() : "");
|
|
|
|
|
|
followup.put("id", objArr[15]);
|
|
|
followup.put("followupNo", objArr[16]);
|
|
|
followup.put("doctorCode", objArr[0]);
|
|
|
followup.put("doctorName", objArr[1]);
|
|
|
followup.put("doctorPhoto", objArr[2]);
|
|
|
followup.put("followupType", objArr[3] == null ? "" : objArr[3]);
|
|
|
followup.put("followupTypeName", objArr[3] == null ? "" : (dictMap.get(objArr[3].toString()) != null ? dictMap.get(objArr[3].toString()) : ""));
|
|
|
followup.put("followupClass", objArr[4] == null ? "" : objArr[4]);
|
|
|
|
|
|
if (objArr[4] == null) {
|
|
|
followup.put("followupClassName", "");
|
|
|
} else {
|
|
|
if (objArr[4].toString().equals("1")) {
|
|
|
followup.put("followupClassName", "高血压");
|
|
|
} else if (objArr[4].toString().equals("2")) {
|
|
|
followup.put("followupClassName", "糖尿病");
|
|
|
} else if (objArr[4].toString().equals("1,2")) {
|
|
|
followup.put("followupClassName", "高血压,糖尿病");
|
|
|
} else {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
followup.put("status", objArr[5] == null ? "" : objArr[5]);
|
|
|
followup.put("statusName", objArr[5] == null ? "" : (statusMap.get(objArr[5].toString()) != null ? statusMap.get(objArr[5].toString()) : ""));
|
|
|
followup.put("createTime", objArr[6] != null ? DateUtil.dateToStrLong((Date) objArr[6]) : "");
|
|
|
followup.put("updateTime", objArr[7] != null ? DateUtil.dateToStrLong((Date) objArr[7]) : "");
|
|
|
followup.put("followupManagerStatus", objArr[8] == null ? "" : objArr[8]);
|
|
|
followup.put("followupManagerStatusName", objArr[8] == null ? "" : (mngStatusMap.get(objArr[8].toString()) != null ? mngStatusMap.get(objArr[8].toString()) : ""));
|
|
|
followup.put("creatorCode", objArr[9]);
|
|
|
followup.put("creatorName", objArr[10]);
|
|
|
followup.put("creatorPhoto", objArr[11]);
|
|
|
followup.put("followupDate", objArr[12] != null ? DateUtil.dateToStrLong((Date) objArr[12]) : "");
|
|
|
followup.put("followupPlanDate", objArr[13] != null ? DateUtil.dateToStrLong((Date) objArr[13]) : "");
|
|
|
followup.put("followupNextDate", objArr[14] != null ? DateUtil.dateToStrLong((Date) objArr[14]) : "");
|
|
|
followup.put("prescriptionCode", objArr[17]);
|
|
|
followup.put("type", objArr[18]);
|
|
|
followup.put("total", result.getTotalElements());
|
|
|
array.put(followup);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return array;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查询居民随访列表
|
|
|
*
|
|
|
* @param patient
|
|
|
* @param page
|
|
|
* @param pageSize
|
|
|
* @param type 类型:0全部,1计划,2记录
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONArray getListByPatient(String patient, int page, int pageSize, String type) {
|
|
|
Sort sort = Sort.by(Sort.Direction.DESC, "createTime");
|
|
|
PageRequest pageRequest = PageRequest.of(page, pageSize, sort);
|
|
|
Page<Object> result = null;
|
|
|
|
|
|
if (StringUtils.isBlank(type)) {
|
|
|
result = followupDao.findByPatient(patient, pageRequest);
|
|
|
} else if ("1".equals(type)) {
|
|
|
//已经开始的就是记录
|
|
|
result = followupDao.findPlanByPatient(patient, pageRequest);
|
|
|
} else if ("2".equals(type)) {
|
|
|
//未开始的就是计划
|
|
|
result = followupDao.findRecordByPatient(patient, pageRequest);
|
|
|
} else {
|
|
|
}
|
|
|
|
|
|
|
|
|
JSONArray array = new JSONArray();
|
|
|
|
|
|
if (result != null && result.getContent().size() > 0) {
|
|
|
Map<String, String> dictMap = new HashMap<>();
|
|
|
Map<String, String> statusMap = new HashMap<>();
|
|
|
Map<String, String> mngStatusMap = new HashMap<>();
|
|
|
List<WlyyHospitalSysDictDO> dicts = wlyyHospitalSysDictDao.findByDictCode("FOLLOWUP_WAY_DICT");
|
|
|
List<WlyyHospitalSysDictDO> mngDicts = wlyyHospitalSysDictDao.findByDictCode("FOLLOWUP_MANAGER_STATUS");
|
|
|
if (dicts != null) {
|
|
|
for (WlyyHospitalSysDictDO dict : dicts) {
|
|
|
dictMap.put(dict.getDictCode(), dict.getDictValue());
|
|
|
}
|
|
|
}
|
|
|
if (mngDicts != null) {
|
|
|
for (WlyyHospitalSysDictDO dict : mngDicts) {
|
|
|
mngStatusMap.put(dict.getDictCode(), dict.getDictValue());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
statusMap.put("0", "取消");
|
|
|
statusMap.put("1", "已完成");
|
|
|
statusMap.put("2", "未开始");
|
|
|
statusMap.put("3", "进行中");
|
|
|
|
|
|
for (Object obj : result) {
|
|
|
JSONObject followup = new JSONObject();
|
|
|
Object[] objArr = (Object[]) obj;
|
|
|
// 返回值增加居民信息
|
|
|
BasePatientDO patientDetail = patientDao.findByIdAndDel(patient,"1");
|
|
|
followup.put("patientName", patientDetail.getName() != null ? patientDetail.getName() : "");
|
|
|
followup.put("photo", patientDetail.getPhoto() != null ? patientDetail.getPhoto() : "");
|
|
|
followup.put("sex", patientDetail.getSex() != null ? patientDetail.getSex() : "");
|
|
|
followup.put("birthday", patientDetail.getBirthday() != null ? patientDetail.getBirthday() : "");
|
|
|
|
|
|
followup.put("id", objArr[15]);
|
|
|
followup.put("followupNo", objArr[16]);
|
|
|
followup.put("doctorCode", objArr[0]);
|
|
|
followup.put("doctorName", objArr[1]);
|
|
|
followup.put("doctorPhoto", objArr[2]);
|
|
|
followup.put("followupType", objArr[3] == null ? "" : objArr[3]);
|
|
|
followup.put("followupTypeName", objArr[3] == null ? "" : (dictMap.get(objArr[3].toString()) != null ? dictMap.get(objArr[3].toString()) : ""));
|
|
|
followup.put("followupClass", objArr[4] == null ? "" : objArr[4]);
|
|
|
|
|
|
if (objArr[4] == null) {
|
|
|
followup.put("followupClassName", "");
|
|
|
} else {
|
|
|
if (objArr[4].toString().equals("1")) {
|
|
|
followup.put("followupClassName", "高血压");
|
|
|
} else if (objArr[4].toString().equals("2")) {
|
|
|
followup.put("followupClassName", "糖尿病");
|
|
|
} else if (objArr[4].toString().equals("1,2")) {
|
|
|
followup.put("followupClassName", "高血压,糖尿病");
|
|
|
} else {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
followup.put("status", objArr[5] == null ? "" : objArr[5]);
|
|
|
followup.put("statusName", objArr[5] == null ? "" : (statusMap.get(objArr[5].toString()) != null ? statusMap.get(objArr[5].toString()) : ""));
|
|
|
followup.put("createTime", objArr[6] != null ? DateUtil.dateToStrLong((Date) objArr[6]) : "");
|
|
|
followup.put("updateTime", objArr[7] != null ? DateUtil.dateToStrLong((Date) objArr[7]) : "");
|
|
|
followup.put("followupManagerStatus", objArr[8] == null ? "" : objArr[8]);
|
|
|
followup.put("followupManagerStatusName", objArr[8] == null ? "" : (mngStatusMap.get(objArr[8].toString()) != null ? mngStatusMap.get(objArr[8].toString()) : ""));
|
|
|
followup.put("creatorCode", objArr[9]);
|
|
|
followup.put("creatorName", objArr[10]);
|
|
|
followup.put("creatorPhoto", objArr[11]);
|
|
|
followup.put("followupDate", objArr[12] != null ? DateUtil.dateToStrLong((Date) objArr[12]) : "");
|
|
|
followup.put("followupPlanDate", objArr[13] != null ? DateUtil.dateToStrLong((Date) objArr[13]) : "");
|
|
|
followup.put("followupNextDate", objArr[14] != null ? DateUtil.dateToStrLong((Date) objArr[14]) : "");
|
|
|
followup.put("prescriptionCode", objArr[17]);
|
|
|
followup.put("total", result.getTotalElements());
|
|
|
array.put(followup);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return array;
|
|
|
}
|
|
|
/**
|
|
|
* 获取医生随访列表(创建者)
|
|
|
*/
|
|
|
public List<Map<String, String>> getListByCreater(String doctorCode, String startTime, String endTime, String page, String pageSize) throws Exception {
|
|
|
List<Map<String, String>> re = new ArrayList<>();
|
|
|
// 排序
|
|
|
Sort sort = Sort.by(Sort.Direction.ASC, "followupDate");
|
|
|
// 分页信息
|
|
|
int pageInt = Integer.valueOf(page) - 1;
|
|
|
int pageSizeInt = Integer.valueOf(pageSize);
|
|
|
Pageable pageRequest = PageRequest.of(pageInt, pageSizeInt, sort);
|
|
|
List<Followup> list = followupDao.findByCreater(doctorCode, DateUtil.strToDate(startTime), DateUtil.strToDate(endTime), pageRequest);
|
|
|
|
|
|
if (list != null && list.size() > 0) {
|
|
|
for (Followup followup : list) {
|
|
|
Map<String, String> map = getFollowupDetail(followup);
|
|
|
re.add(map);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 新增随访计划(批量)
|
|
|
*/
|
|
|
@Transactional
|
|
|
public Iterable<Followup> addFollowupPlan(String doctorCode, String patientCode, String data) throws Exception {
|
|
|
//批量随访计划
|
|
|
JavaType javaType = objectMapper.getTypeFactory().constructParametricType(List.class, Map.class);
|
|
|
List<Map<String, String>> list = objectMapper.readValue(data, javaType);
|
|
|
if (list != null && list.size() > 0) {
|
|
|
//获取患者信息
|
|
|
BasePatientDO patient = patientDao.findByIdAndDel(patientCode,"1");
|
|
|
if (patient == null) {
|
|
|
throw new ServiceException("获取不到用户信息!");
|
|
|
}
|
|
|
|
|
|
List<Followup> followupPlan = new ArrayList<>();
|
|
|
for (Map<String, String> map : list) {
|
|
|
//获取医生信息
|
|
|
BaseDoctorDO doctor = doctorDao.findByIdAndDel(map.get("doctor"));
|
|
|
if (doctor == null) {
|
|
|
throw new ServiceException("获取不到医生信息!");
|
|
|
}
|
|
|
|
|
|
Followup followup = new Followup();
|
|
|
followup.setFollowupType(map.get("type"));
|
|
|
Date date = DateUtil.strToDate(map.get("date"));
|
|
|
followup.setFollowupDate(date);
|
|
|
followup.setFollowupPlanDate(date);
|
|
|
followup.setDoctorCode(doctor.getId());
|
|
|
followup.setDoctorName(doctor.getName());
|
|
|
// followup.setOrgCode(doctor.getHospital());
|
|
|
// followup.setOrgName(doctor.getHospitalName());
|
|
|
followup.setPatientCode(patientCode);
|
|
|
followup.setPatientName(patient.getName());
|
|
|
followup.setIdcard(patient.getIdcard());
|
|
|
followup.setDataFrom("2");//数据来源 1基卫 2APP
|
|
|
followup.setStatus("2"); //状态 0取消 1已完成 2未开始 3进行中
|
|
|
followup.setCreateTime(new Date());
|
|
|
followup.setCreater(doctorCode);
|
|
|
|
|
|
followup.setFollowupClass(map.get("followupClass"));
|
|
|
followup.setType(Integer.parseInt(map.get("type1")));
|
|
|
followup.setSignType(2);
|
|
|
|
|
|
followupPlan.add(followup);
|
|
|
}
|
|
|
|
|
|
return followupDao.saveAll(followupPlan);
|
|
|
}
|
|
|
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 新增随访计划(单个)
|
|
|
*/
|
|
|
public Followup addFollowupPlanNew(String doctorCode, String patientCode, JSONObject data,String dataJson) throws Exception {
|
|
|
//获取患者信息
|
|
|
BasePatientDO patient = patientDao.findById(patientCode).orElse(null);
|
|
|
if (patient == null) {
|
|
|
throw new ServiceException("获取不到用户信息!");
|
|
|
}
|
|
|
|
|
|
//获取医生信息
|
|
|
BaseDoctorDO doctor = doctorDao.findByIdAndDel(data.getString("doctor"));
|
|
|
if (doctor == null) {
|
|
|
throw new ServiceException("获取不到医生信息!");
|
|
|
}
|
|
|
|
|
|
Followup followup = new Followup();
|
|
|
followup.setFollowupType(data.getString("type"));
|
|
|
Date date = DateUtil.strToDate(data.getString("date"));
|
|
|
followup.setFollowupDate(date);
|
|
|
followup.setFollowupPlanDate(date);
|
|
|
followup.setDoctorCode(doctor.getId());
|
|
|
followup.setDoctorName(doctor.getName());
|
|
|
// followup.setOrgCode(doctor.getHospital());
|
|
|
// followup.setOrgName(doctor.getHospitalName());
|
|
|
followup.setPatientCode(patientCode);
|
|
|
followup.setPatientName(patient.getName());
|
|
|
followup.setIdcard(patient.getIdcard());
|
|
|
followup.setDataFrom("2");//数据来源 1基卫 2APP
|
|
|
followup.setStatus("2"); //状态 0取消 1已完成 2未开始 3进行中
|
|
|
followup.setCreateTime(new Date());
|
|
|
followup.setCreater(doctorCode);
|
|
|
|
|
|
followup.setFollowupClass(data.getString("followupClass"));
|
|
|
followup.setType(Integer.parseInt(data.get("type1").toString()));
|
|
|
followup.setSignType(2);
|
|
|
|
|
|
followup = followupDao.save(followup);
|
|
|
|
|
|
// rehabilitationManageService.updateRelationCodeByDetailId(data.getString("id"),followup.getId()+"");
|
|
|
// rehabilitationManageService.saveRehabilitationOperateRecord(dataJson);
|
|
|
|
|
|
return followup;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 编辑随访计划
|
|
|
*/
|
|
|
public void editFollowupPlan(String doctorCode, String id, String date, String followupType) throws Exception {
|
|
|
Followup followup = followupDao.findById(Long.valueOf(id)).orElse(null);
|
|
|
if (followup != null) {
|
|
|
Date followupDate = DateUtil.strToDate(date);
|
|
|
followup.setFollowupDate(followupDate);
|
|
|
followup.setFollowupPlanDate(followupDate);
|
|
|
followup.setFollowupType(followupType);
|
|
|
followup.setCreater(doctorCode);
|
|
|
|
|
|
followupDao.save(followup);
|
|
|
} else {
|
|
|
throw new ServiceException("查找不到该随访!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 开始随访记录
|
|
|
*/
|
|
|
public Followup startFollowup(String id, String followupNo, String date, String followupType, String followupClass, String followupManagerStatus, String plandate, String prescriptioncode) throws Exception {
|
|
|
Followup followup = followupDao.findById(Long.valueOf(id)).orElse(null);
|
|
|
if (followup != null) {
|
|
|
if(followup.getStatus().compareTo("2") == 0) {
|
|
|
followup.setFollowupNo(followupNo);
|
|
|
followup.setFollowupDate(DateUtil.strToDate(date));
|
|
|
//计划下次随访时间--huangwenjie.2017.10.19
|
|
|
if (StringUtils.isNoneBlank(plandate)) {
|
|
|
followup.setFollowupNextDate(DateUtil.strToDate(plandate));
|
|
|
Followup nextFollowup = new Followup();
|
|
|
nextFollowup.setDataFrom(followup.getDataFrom());
|
|
|
nextFollowup.setStatus("2");
|
|
|
nextFollowup.setFollowupType(followupType);
|
|
|
nextFollowup.setFollowupNo(followup.getFollowupNo());
|
|
|
nextFollowup.setFollowupDate(DateUtil.strToDate(plandate));
|
|
|
nextFollowup.setFollowupPlanDate(DateUtil.strToDate(plandate));
|
|
|
nextFollowup.setJwdoctorCode(followup.getJwdoctorCode());
|
|
|
nextFollowup.setJworgCode(followup.getJworgCode());
|
|
|
nextFollowup.setOrgCode(followup.getOrgCode());
|
|
|
nextFollowup.setOrgName(followup.getOrgName());
|
|
|
nextFollowup.setCreater(followup.getCreater());
|
|
|
nextFollowup.setSignCode(followup.getSignCode());
|
|
|
nextFollowup.setAdminTeamCode(followup.getAdminTeamCode());
|
|
|
nextFollowup.setFollowupClass(followupClass);
|
|
|
nextFollowup.setFollowupManagerStatus(followupManagerStatus);
|
|
|
nextFollowup.setPatientName(followup.getPatientName());
|
|
|
nextFollowup.setPatientCode(followup.getPatientCode());
|
|
|
nextFollowup.setCreateTime(new Date());
|
|
|
nextFollowup.setUpdateTime(new Date());
|
|
|
nextFollowup.setDoctorCode(followup.getDoctorCode());
|
|
|
nextFollowup.setDoctorName(followup.getDoctorName());
|
|
|
nextFollowup.setIdcard(followup.getIdcard());
|
|
|
nextFollowup.setSignType(followup.getSignType());
|
|
|
nextFollowup.setType(1);
|
|
|
followupDao.save(nextFollowup);
|
|
|
|
|
|
}
|
|
|
followup.setFollowupType(followupType);
|
|
|
followup.setFollowupClass(followupClass);
|
|
|
followup.setFollowupManagerStatus(followupManagerStatus);
|
|
|
followup.setStatus("3"); //状态 0取消 1已完成 2未开始 3进行中
|
|
|
followup.setPrescriptionCode(prescriptioncode);
|
|
|
|
|
|
Followup f = followupDao.save(followup);
|
|
|
System.out.println("随访状态status" + f.getStatus());
|
|
|
return f;
|
|
|
}
|
|
|
return followup;
|
|
|
} else {
|
|
|
throw new ServiceException("查找不到该随访!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 如果今日没有计划中的随访计划,则将随访消息设成已操作
|
|
|
* @param doctor
|
|
|
*/
|
|
|
public void getNotStartFollowup(String doctor, Date followupPlanDate) {
|
|
|
//如果计划随访日已经没有未开始状态的随访计划,就将该天的随访消息设成已操作状态
|
|
|
String now = DateUtil.dateToStrShort(followupPlanDate);
|
|
|
String start = now + " 00:00:00";
|
|
|
String end = now + " 23:59:59";
|
|
|
|
|
|
String sql = "select count(1) count from wlyy_followup where status = 2 and (followup_class is null or followup_class in (1,2)) " +
|
|
|
"and followup_plan_date>='" + start + "' and followup_plan_date<='" + end + "'and doctor_code = '" +doctor +"'";
|
|
|
//获取所有未执行随访计划
|
|
|
Long followupToday = jdbcTemplate.queryForObject(sql, Long.class);
|
|
|
System.out.println("计划中随访:" + followupToday);
|
|
|
if(followupToday == 0){
|
|
|
messageDao.setMessageOverByType(doctor, 4, DateUtil.strToDateLong(start), DateUtil.strToDateLong(end));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 新增临时随访记录(返回ID)
|
|
|
*/
|
|
|
public String addFollowup(String doctorCode, String patientCode, String date, String followupType, String followupClass, String followupManagerStatus, String plandate, String prescriptioncode,Integer type) throws Exception {
|
|
|
String re = "";
|
|
|
|
|
|
//获取医生信息
|
|
|
BaseDoctorDO doctor = doctorDao.findByIdAndDel(doctorCode);
|
|
|
if (doctor == null) {
|
|
|
throw new ServiceException("查找不到医生信息!");
|
|
|
}
|
|
|
|
|
|
//获取患者信息
|
|
|
BasePatientDO patient = patientDao.findById(patientCode).orElse(null);
|
|
|
if (patient == null) {
|
|
|
throw new ServiceException("查找不到居民信息!");
|
|
|
}
|
|
|
|
|
|
Followup followup = new Followup();
|
|
|
Date followDate = DateUtil.strToDate(date);
|
|
|
followup.setFollowupDate(followDate);
|
|
|
followup.setFollowupPlanDate(followDate);
|
|
|
followup.setDoctorCode(doctorCode);
|
|
|
followup.setDoctorName(doctor.getName());
|
|
|
// followup.setOrgCode(doctor.getHospital());
|
|
|
// followup.setOrgName(doctor.getHospitalName());
|
|
|
followup.setPatientCode(patientCode);
|
|
|
followup.setPatientName(patient.getName());
|
|
|
followup.setIdcard(patient.getIdcard());
|
|
|
followup.setFollowupType(followupType);
|
|
|
followup.setFollowupClass(followupClass);
|
|
|
followup.setFollowupManagerStatus(followupManagerStatus);
|
|
|
followup.setDataFrom("2");//数据来源 1基卫 2APP
|
|
|
followup.setStatus("2"); //状态 0取消 1已完成 2未开始 3进行中
|
|
|
followup.setCreateTime(new Date());
|
|
|
followup.setCreater(doctorCode);
|
|
|
followup.setSignType(2);
|
|
|
if (type!=null&&type!=0){
|
|
|
followup.setType(type);
|
|
|
}
|
|
|
|
|
|
//如果有填入续方CODE,则添加续方关联--huangwenjie.2017.11.02
|
|
|
if (StringUtils.isNotBlank(prescriptioncode)) {
|
|
|
followup.setPrescriptionCode(prescriptioncode);
|
|
|
}
|
|
|
|
|
|
//计划下次随访时间--ysj.2017.10.26
|
|
|
if (StringUtils.isNoneBlank(plandate)) {
|
|
|
followup.setFollowupNextDate(DateUtil.strToDate(plandate));
|
|
|
Followup nextFollowup = new Followup();
|
|
|
nextFollowup.setDataFrom(followup.getDataFrom());
|
|
|
nextFollowup.setStatus("2");
|
|
|
nextFollowup.setFollowupType(followupType);
|
|
|
nextFollowup.setFollowupNo(followup.getFollowupNo());
|
|
|
nextFollowup.setFollowupDate(DateUtil.strToDate(plandate));
|
|
|
nextFollowup.setFollowupPlanDate(DateUtil.strToDate(plandate));
|
|
|
nextFollowup.setJwdoctorCode(followup.getJwdoctorCode());
|
|
|
nextFollowup.setJworgCode(followup.getJworgCode());
|
|
|
nextFollowup.setOrgCode(followup.getOrgCode());
|
|
|
nextFollowup.setOrgName(followup.getOrgName());
|
|
|
nextFollowup.setCreater(followup.getCreater());
|
|
|
nextFollowup.setSignCode(followup.getSignCode());
|
|
|
nextFollowup.setAdminTeamCode(followup.getAdminTeamCode());
|
|
|
nextFollowup.setFollowupClass(followupClass);
|
|
|
nextFollowup.setFollowupManagerStatus(followupManagerStatus);
|
|
|
nextFollowup.setPatientName(followup.getPatientName());
|
|
|
nextFollowup.setPatientCode(followup.getPatientCode());
|
|
|
nextFollowup.setCreateTime(new Date());
|
|
|
nextFollowup.setUpdateTime(new Date());
|
|
|
nextFollowup.setDoctorCode(followup.getDoctorCode());
|
|
|
nextFollowup.setDoctorName(followup.getDoctorName());
|
|
|
nextFollowup.setIdcard(followup.getIdcard());
|
|
|
nextFollowup.setSignType(followup.getSignType());
|
|
|
nextFollowup.setType(type);
|
|
|
followupDao.save(nextFollowup);
|
|
|
}
|
|
|
|
|
|
followupDao.save(followup);
|
|
|
re = String.valueOf(followup.getId());
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 取消随访计划
|
|
|
*/
|
|
|
public void cancelFollowupPlan(String id) throws Exception {
|
|
|
Followup followup = followupDao.findById(Long.valueOf(id)).orElse(null);
|
|
|
if (followup != null) {
|
|
|
followup.setStatus("0"); //状态 0取消 1已完成 2未开始 3进行中
|
|
|
followupDao.save(followup);
|
|
|
} else {
|
|
|
throw new ServiceException("查找不到该随访计划!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 完成随访记录,并上传随访记录
|
|
|
*/
|
|
|
public void finishFollowup(String id) throws Exception {
|
|
|
Followup followup = followupDao.findById(Long.valueOf(id)).orElse(null);
|
|
|
if (followup != null) {
|
|
|
followup.setStatus("1"); //状态 0取消 1已完成 2未开始 3进行中
|
|
|
followup = followupDao.save(followup);
|
|
|
|
|
|
//随访完成,增加随访状态完成的标记
|
|
|
// Prescription prescription = prescriptionDao.findByCode(followup.getPrescriptionCode());
|
|
|
// if(prescription != null){
|
|
|
// prescription.setViewSuifang(1);
|
|
|
// prescriptionDao.save(prescription);
|
|
|
// }
|
|
|
|
|
|
} else {
|
|
|
throw new ServiceException("查找不到该随访计划!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/*********************************** 随访详情 *******************************************************************/
|
|
|
/**
|
|
|
* 获取面访项目列表
|
|
|
*/
|
|
|
public Map<String, String> getFollowup(String id) throws Exception {
|
|
|
Map<String, String> re = new HashMap<>();
|
|
|
Followup followup = followupDao.findById(Long.valueOf(id)).orElse(null);
|
|
|
if (followup != null) {
|
|
|
re = getFollowupDetail(followup);
|
|
|
} else {
|
|
|
throw new ServiceException("查找不到该随访信息");
|
|
|
}
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取面访项目列表
|
|
|
*/
|
|
|
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));
|
|
|
//修改为通过ES查询---2017.11.01--huangwenjie
|
|
|
List<String> project = esfindProjectByFollowupId(id);
|
|
|
//获取所有面访项目
|
|
|
List<WlyyHospitalSysDictDO> dictList = hospitalSysDictService.findByDictName("FOLLOWUP_PROJECT");
|
|
|
if (dictList != null && dictList.size() > 0) {
|
|
|
for (WlyyHospitalSysDictDO dict : dictList) {
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
String code = dict.getDictCode();
|
|
|
map.put("projectCode", code);
|
|
|
map.put("projectName", dict.getDictValue());
|
|
|
if (project != null && project.contains(code)) {
|
|
|
map.put("status", "1"); //已填写
|
|
|
} else {
|
|
|
map.put("status", "0");//未填写
|
|
|
}
|
|
|
re.add(map);
|
|
|
}
|
|
|
}
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取面访项目数据
|
|
|
*/
|
|
|
public Map<String, String> getFollowupProjectData(String id, String followupProject) throws Exception {
|
|
|
Map<String, String> re = new HashMap<>();
|
|
|
List<FollowupContent> dataList = followupContentDao.findByFollowupIdAndFollowupProject(Long.valueOf(id), followupProject);
|
|
|
for (FollowupContent item : dataList) {
|
|
|
re.put(item.getFollowupKey(), item.getFollowupValue());
|
|
|
}
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 保存面访项目数据
|
|
|
*/
|
|
|
@Transactional
|
|
|
public void saveFollowupProjectData(String id, String followupProject, String followupProjectData) throws Exception {
|
|
|
List<FollowupContent> dataList = followupContentDao.findByFollowupIdAndFollowupProject(Long.valueOf(id), followupProject);
|
|
|
|
|
|
//删除原有记录
|
|
|
followupContentDao.deleteAll(dataList);
|
|
|
|
|
|
Map<String, String> data = objectMapper.readValue(followupProjectData, Map.class);
|
|
|
|
|
|
if (data != null && data.keySet().size() > 0) {
|
|
|
List<FollowupContent> newList = new ArrayList<>();
|
|
|
for (String key : data.keySet()) {
|
|
|
FollowupContent item = new FollowupContent();
|
|
|
item.setFollowupId(Long.valueOf(id));
|
|
|
item.setFollowupProject(followupProject);
|
|
|
item.setFollowupKey(key);
|
|
|
item.setFollowupValue(data.get(key));
|
|
|
item.setCreateTime(new Date());
|
|
|
newList.add(item);
|
|
|
}
|
|
|
followupContentDao.saveAll(newList);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/*********************************** 电话随访 *****************************************************************/
|
|
|
/**
|
|
|
* 获取电话随访内容
|
|
|
*/
|
|
|
public String getFollowupPhone(String id) throws Exception {
|
|
|
String re = "";
|
|
|
Followup followup = followupDao.findById(Long.valueOf(id)).orElse(null);
|
|
|
if (followup != null) {
|
|
|
re = followup.getFollowupContentPhone();
|
|
|
} else {
|
|
|
throw new ServiceException("查找不到该随访计划!");
|
|
|
}
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 记录电话随访内容
|
|
|
*/
|
|
|
public void saveFollowupPhone(String id, String content) throws Exception {
|
|
|
Followup followup = followupDao.findById(Long.valueOf(id)).orElse(null);
|
|
|
if (followup != null) {
|
|
|
followup.setFollowupContentPhone(content);
|
|
|
followupDao.save(followup);
|
|
|
} else {
|
|
|
throw new ServiceException("查找不到该随访计划!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/*************************************** 上次随访 ********************************************/
|
|
|
|
|
|
/**
|
|
|
* 获取上次随访
|
|
|
*/
|
|
|
public Map<String, String> getLastFollowup(String doctor, String patient, String followClass) throws Exception {
|
|
|
Map<String, String> re = new HashMap<>();
|
|
|
|
|
|
//获取医生团队成员
|
|
|
String[] doctors = new String[]{doctor};
|
|
|
|
|
|
//获取最新的随访记录
|
|
|
Followup followup = followupDao.findLastFollowup(doctors, patient, followClass);
|
|
|
|
|
|
if (followup != null) {
|
|
|
re.put("id", String.valueOf(followup.getId()));
|
|
|
re.put("followupDate", DateUtil.dateToStrShort(followup.getFollowupDate()));
|
|
|
} else {
|
|
|
re = null;
|
|
|
}
|
|
|
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取上次随访
|
|
|
*/
|
|
|
public void copyFollowup(Long id, Long fromId) throws Exception {
|
|
|
//先根据条件查找出来
|
|
|
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
|
|
searchSourceBuilder.query(
|
|
|
new BoolQueryBuilder()
|
|
|
.must(QueryBuilders.matchQuery("followup_id", fromId))
|
|
|
);
|
|
|
List<FollowupContentESDO> list = elasticSearch7Helper.search(esIndex,searchSourceBuilder,FollowupContentESDO.class);
|
|
|
|
|
|
if (list != null && list.size() > 0) {
|
|
|
List<FollowupContentESDO> copyList = new ArrayList<>();
|
|
|
for (FollowupContentESDO item : list) {
|
|
|
FollowupContentESDO copyItem = new FollowupContentESDO();
|
|
|
BeanUtils.copyProperties(item, copyItem);
|
|
|
copyItem.setId(null);
|
|
|
copyItem.setFollowup_id(id + "");
|
|
|
copyItem.setCreate_time(new Date());
|
|
|
copyList.add(copyItem);
|
|
|
}
|
|
|
|
|
|
elasticSearch7Helper.save(esIndex, copyList);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**************************************** 随访计划消息 ******************************************/
|
|
|
/**
|
|
|
* 每日发送随访计划提醒消息
|
|
|
*/
|
|
|
@Transactional
|
|
|
public void sendMessage(String date) {
|
|
|
try {
|
|
|
String start = date + " 00:00:00";
|
|
|
String end = date + " 23:59:59";
|
|
|
|
|
|
String sql = "select doctor_code,count(1) count from wlyy_followup where status not in ('0','1') and followup_plan_date>='" + start + "' and followup_plan_date<='" + end + "' group by doctor_code";
|
|
|
//获取所有未执行随访计划
|
|
|
List<Map<String, Object>> followupToday = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
if (followupToday != null) {
|
|
|
List<SystemMessageDO> list = new ArrayList<>();
|
|
|
for (Map<String, Object> map : followupToday) {
|
|
|
String doctor = String.valueOf(map.get("doctor_code"));
|
|
|
String count = String.valueOf(map.get("count"));
|
|
|
|
|
|
// 添加签约消息
|
|
|
String title = "随访计划提醒";
|
|
|
String content = "您今日有" + count + "个随访计划待处理";
|
|
|
SystemMessageDO message = new SystemMessageDO();
|
|
|
message.setCode(CommonUtil.getCode());
|
|
|
message.setCreateTime(new Date());
|
|
|
message.setContent(content);
|
|
|
message.setIsRead("0");//设置未读
|
|
|
message.setReceiver(doctor);//设置接受医生的code
|
|
|
message.setSender("system");//设置发送的用户
|
|
|
message.setTitle(title);
|
|
|
message.setType("4");//随访计划提醒
|
|
|
message.setReadonly(1);//是否只读消息
|
|
|
list.add(message);
|
|
|
}
|
|
|
|
|
|
messageDao.saveAll(list);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* ES 保存随访记录详情
|
|
|
*
|
|
|
* @author huangwenjie
|
|
|
* @date 2017/11/1 14:57
|
|
|
*/
|
|
|
@Transactional
|
|
|
public void esSaveFollowupProjectData(String id, String followupProject, String followupProjectData) throws Exception {
|
|
|
try {
|
|
|
//先根据条件查找出来
|
|
|
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
|
|
searchSourceBuilder.query(
|
|
|
new BoolQueryBuilder()
|
|
|
.must(QueryBuilders.matchQuery("followup_id", id))
|
|
|
.must(QueryBuilders.matchQuery("followup_project", followupProject))
|
|
|
);
|
|
|
|
|
|
FollowupContentESDO followupContentESDO = elasticSearch7Helper.searchOne(esIndex,searchSourceBuilder,FollowupContentESDO.class);
|
|
|
|
|
|
List<FollowupContentESDO> dataList = new ArrayList<>();
|
|
|
if(followupContentESDO != null){
|
|
|
dataList.add(followupContentESDO);
|
|
|
//删除原有记录
|
|
|
this.esDeleteFollowUpContent(dataList);
|
|
|
}
|
|
|
|
|
|
//保存新的随访详情信息
|
|
|
List<FollowupContentESDO> newdatalist = new ArrayList<>();
|
|
|
followupContentESDO = new FollowupContentESDO();
|
|
|
followupContentESDO = JSON.parseObject(followupProjectData, FollowupContentESDO.class);
|
|
|
followupContentESDO.setFollowup_id(id);
|
|
|
followupContentESDO.setFollowup_project(followupProject);
|
|
|
followupContentESDO.setCreate_time(new Date());
|
|
|
newdatalist.add(followupContentESDO);
|
|
|
elasticSearch7Helper.save(esIndex, newdatalist);
|
|
|
|
|
|
|
|
|
//如果该随访是已完成的,则添加随访信息上传映射,上传到基卫
|
|
|
Followup followup = followupDao.findById(Long.valueOf(id)).orElse(null);
|
|
|
if ("1".equals(followup.getStatus())) {
|
|
|
//随访完成,增加随访状态完成的标记
|
|
|
// Prescription prescription = prescriptionDao.findByCode(followup.getPrescriptionCode());
|
|
|
// if(prescription != null){
|
|
|
// prescription.setViewSuifang(1);
|
|
|
// prescriptionDao.save(prescription);
|
|
|
// }
|
|
|
}
|
|
|
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* ES获取面访项目数据
|
|
|
*/
|
|
|
public FollowupContentESDO esGetFollowupProjectData(String id, String followupProject) throws Exception {
|
|
|
FollowupContentESDO followupContentESDO = null;
|
|
|
try {
|
|
|
//先根据条件查找出来
|
|
|
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
|
|
searchSourceBuilder.query(
|
|
|
new BoolQueryBuilder()
|
|
|
.must(QueryBuilders.matchQuery("followup_id", id))
|
|
|
.must(QueryBuilders.matchQuery("followup_project", followupProject))
|
|
|
);
|
|
|
followupContentESDO = elasticSearch7Helper.searchOne(esIndex,searchSourceBuilder,FollowupContentESDO.class);
|
|
|
} catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
return followupContentESDO;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* ES 删除随访详情信息
|
|
|
*
|
|
|
* @author huangwenjie
|
|
|
* @date 2017/11/1 15:17
|
|
|
*/
|
|
|
public void esDeleteFollowUpContent(List<FollowupContentESDO> datalist) throws Exception {
|
|
|
try {
|
|
|
BulkRequest bulkRequest = new BulkRequest();
|
|
|
bulkRequest.timeout(TimeValue.timeValueSeconds(10));
|
|
|
for (FollowupContentESDO obj : datalist) {
|
|
|
bulkRequest.add(new DeleteRequest(esIndex)
|
|
|
.id(obj.getId()));
|
|
|
}
|
|
|
|
|
|
BulkResponse bulkResponse = restHighLevelClient.bulk(bulkRequest, RequestOptions.DEFAULT);
|
|
|
logger.info("delete data count:" + datalist.size());
|
|
|
logger.info(bulkResponse.buildFailureMessage());
|
|
|
logger.info("delete flag:" + !bulkResponse.hasFailures());
|
|
|
} catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* ES获取面访项目数据列表
|
|
|
*
|
|
|
* @author huangwenjie
|
|
|
* @date 2017/11/1 19:41
|
|
|
*/
|
|
|
public List<String> esfindProjectByFollowupId(String id) throws Exception {
|
|
|
List<String> resultList = new ArrayList<>();
|
|
|
try {
|
|
|
//根据随访ID、分类ID获取随访记录详情
|
|
|
//先根据条件查找出来
|
|
|
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
|
|
searchSourceBuilder.query(
|
|
|
new BoolQueryBuilder()
|
|
|
.must(QueryBuilders.matchQuery("followup_id", id))
|
|
|
);
|
|
|
|
|
|
List<FollowupContentESDO> followupContentESDOList = elasticSearch7Helper.search(esIndex,searchSourceBuilder,FollowupContentESDO.class);
|
|
|
if (!followupContentESDOList.isEmpty()) {
|
|
|
for (FollowupContentESDO followupContentESDO : followupContentESDOList) {
|
|
|
|
|
|
if("2".equals(followupContentESDO.getFollowup_project())){
|
|
|
if(StringUtils.isNotBlank(followupContentESDO.getBP_D()) && StringUtils.isNotBlank(followupContentESDO.getBP_U())){
|
|
|
resultList.add(followupContentESDO.getFollowup_project());
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(followupContentESDO.getBLOOD_SUGAR()) && StringUtils.isNotBlank(followupContentESDO.getBLOOD_SUGAR_TYPE())){
|
|
|
resultList.add(followupContentESDO.getFollowup_project());
|
|
|
}
|
|
|
}else if("3".equals(followupContentESDO.getFollowup_project())){
|
|
|
//判断血糖必填
|
|
|
if(StringUtils.isNotBlank(followupContentESDO.getBS_FPG()) ||
|
|
|
StringUtils.isNotBlank(followupContentESDO.getNO_BS_FPG())||
|
|
|
StringUtils.isNotBlank(followupContentESDO.getRANDOM_BLOOD_SUGAR())){
|
|
|
resultList.add(followupContentESDO.getFollowup_project());
|
|
|
}
|
|
|
}else{
|
|
|
resultList.add(followupContentESDO.getFollowup_project());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
return resultList;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* ES获取面访项目数据详情
|
|
|
*
|
|
|
* @author huangwenjie
|
|
|
* @date 2017/11/1 19:41
|
|
|
*/
|
|
|
public List<FollowupContentESDO> esfindFollowUpContestsByFollowupId(String id) throws Exception {
|
|
|
List<FollowupContentESDO> followupContentESDOList = new ArrayList<>();
|
|
|
try {
|
|
|
//根据随访ID、分类ID获取随访记录详情
|
|
|
//先根据条件查找出来
|
|
|
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
|
|
searchSourceBuilder.query(
|
|
|
new BoolQueryBuilder()
|
|
|
.must(QueryBuilders.matchQuery("followup_id", id))
|
|
|
);
|
|
|
|
|
|
followupContentESDOList = elasticSearch7Helper.search(esIndex,searchSourceBuilder,FollowupContentESDO.class);
|
|
|
} catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
return followupContentESDOList;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据续方CODE获取随访记录信息
|
|
|
*
|
|
|
* @param prescriptionCode
|
|
|
* @return
|
|
|
*/
|
|
|
|
|
|
public String getFollowupByPrescriptionCode(String prescriptionCode) {
|
|
|
Followup followup = followupDao.getFollowupByPrescriptionCode(prescriptionCode);
|
|
|
|
|
|
String jsonString = JSON.toJSONString(followup);
|
|
|
|
|
|
return jsonString;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取随访详情记录分类记录数
|
|
|
*
|
|
|
* @param followupid
|
|
|
* @param type
|
|
|
* @return
|
|
|
*/
|
|
|
public int getfollowupcontent(String followupid, String type) throws Exception {
|
|
|
|
|
|
int count = 0;
|
|
|
String[] typelist = null;
|
|
|
if (type.contains(",")) {
|
|
|
typelist = type.split(",");
|
|
|
} else {
|
|
|
typelist = new String[]{type};
|
|
|
}
|
|
|
|
|
|
for (String typekey : typelist) {
|
|
|
if (!"drug".equals(type)) {
|
|
|
|
|
|
FollowupContentESDO followupContentESDO = this.esGetFollowupProjectData(followupid, typekey);
|
|
|
if (followupContentESDO != null) {
|
|
|
count++;
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
//获取用药记录
|
|
|
List<FollowupDrugs> drugsList = followupDrugsDao.findByFollowupId(Long.valueOf(followupid));
|
|
|
if (!drugsList.isEmpty()) {
|
|
|
count = count + drugsList.size();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return count;
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 检查随访记录是否可完成
|
|
|
* @param followupid
|
|
|
* @return
|
|
|
*/
|
|
|
public boolean checkfollowupcompleted(String followupid) throws Exception {
|
|
|
boolean result = true;
|
|
|
|
|
|
List<FollowupContentESDO> eslist = this.esfindFollowUpContestsByFollowupId(followupid);
|
|
|
|
|
|
if (!eslist.isEmpty()) {
|
|
|
for (FollowupContentESDO followupContentESDO : eslist) {
|
|
|
|
|
|
if("2".equals(followupContentESDO.getFollowup_project())){
|
|
|
//判断血压必填
|
|
|
if(StringUtils.isBlank(followupContentESDO.getBP_D()) || StringUtils.isBlank(followupContentESDO.getBP_U())){
|
|
|
return false;
|
|
|
}
|
|
|
}else if("3".equals(followupContentESDO.getFollowup_project())){
|
|
|
//判断血糖必填
|
|
|
if(StringUtils.isBlank(followupContentESDO.getBS_FPG()) &&
|
|
|
StringUtils.isBlank(followupContentESDO.getNO_BS_FPG()) &&
|
|
|
StringUtils.isBlank(followupContentESDO.getRANDOM_BLOOD_SUGAR())){
|
|
|
return false;
|
|
|
}
|
|
|
}else if("5".equals(followupContentESDO.getFollowup_project())){
|
|
|
//判断评价
|
|
|
if(StringUtils.isBlank(followupContentESDO.getDIA_FOLLOWUP_TYPE_CODE()) &&
|
|
|
StringUtils.isBlank(followupContentESDO.getHYP_FOLLOWUP_TYPE_CODE())){
|
|
|
return false;
|
|
|
}
|
|
|
}else{}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 保存随访详情
|
|
|
* @param followupContentESDO
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public void esSaveFollowupContentESDAO(FollowupContentESDO followupContentESDO)throws Exception{
|
|
|
try {
|
|
|
List<FollowupContentESDO> dataList = new ArrayList<>();
|
|
|
if(followupContentESDO != null){
|
|
|
dataList.add(followupContentESDO);
|
|
|
//删除原有记录
|
|
|
this.esDeleteFollowUpContent(dataList);
|
|
|
}
|
|
|
elasticSearch7Helper.save(esIndex, dataList);
|
|
|
|
|
|
} catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void updateFollowup(Long id){
|
|
|
Followup followup = followupDao.findById(id).orElse(null);
|
|
|
followup.setStatus("1");
|
|
|
followupDao.save(followup);
|
|
|
}
|
|
|
|
|
|
|
|
|
//============================上门访视相关接口================================================
|
|
|
|
|
|
public Map<String,Object> findFollowupByMonth(String doctor,String patient,String followupClass,String patientName,String startTime,String endTime,String flag,Integer type1,String status)throws Exception{
|
|
|
String sqlList = "select wf.id as id,wf.followup_no as followupNo,wf.followup_date as followupDate,wf.followup_plan_date as followupPlanDate,wf.followup_next_date as followupNextDate," +
|
|
|
" wf.followup_type as followupType,wf.followup_class as followupClass,wf.followup_manager_status as followupManagerStatus,wf.doctor_code as doctorCode,wf.doctor_name as doctorName," +
|
|
|
"wf.jwdoctor_code as jwdoctorCode,wf.org_code as orgCode,wf.org_name as orgName,wf.jworg_code as jworgCode,wf.patient_code as patientCode,wf.patient_name as patientName,wf.idcard," +
|
|
|
"wf.data_from as dataFrom,wf.status,wf.followup_content_phone as followupContentPhone,wf.creater,wf.sign_type as signType,wf.admin_team_code as adminTeamCode,wf.sign_code as signCode," +
|
|
|
"wf.prescription_code as prescriptionCode,wf.type";
|
|
|
String sql = " from wlyy_followup wf ";
|
|
|
sql+= " where 1=1 and wf.status !=0";
|
|
|
if(!org.apache.commons.lang.StringUtils.isEmpty(doctor)){
|
|
|
sql+=" and wf.doctor_code = '"+doctor+"'";
|
|
|
}
|
|
|
if(!org.apache.commons.lang.StringUtils.isEmpty(patient)){
|
|
|
sql+=" and wf.patient_code = '"+patient+"'";
|
|
|
}
|
|
|
if(!org.apache.commons.lang.StringUtils.isEmpty(followupClass)){
|
|
|
sql+=" and wf.followup_class = '"+followupClass+"'";
|
|
|
}
|
|
|
if(!org.apache.commons.lang.StringUtils.isEmpty(patientName)){
|
|
|
sql+=" and wf.patient_name like '%"+patientName+"%'";
|
|
|
}
|
|
|
if(!org.apache.commons.lang.StringUtils.isEmpty(startTime)){
|
|
|
sql+=" and wf.followup_plan_date >='"+startTime+"'";
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(status)){
|
|
|
sql+=" and wf.status ='"+status+"' ";
|
|
|
}
|
|
|
if(!org.apache.commons.lang.StringUtils.isEmpty(endTime)){
|
|
|
Date currentTime = DateUtil.strToDate(endTime + " 23:59:59");
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
String dateString = formatter.format(currentTime);
|
|
|
sql+=" and wf.followup_plan_date <='"+dateString+"'";
|
|
|
}
|
|
|
if (type1!=null&&type1!=0){
|
|
|
sql+=" and wf.type ="+type1;
|
|
|
}
|
|
|
if(flag==null){
|
|
|
flag="0";
|
|
|
}
|
|
|
if(flag.equals("1")&&flag!=null){
|
|
|
sql+=" and wf.followup_class in(5,6,7,8,9)";
|
|
|
}
|
|
|
if(flag.equals("2")&&flag!=null){
|
|
|
sql+=" and (wf.followup_class in(1,2,3,4,11,12,13,14,15,16,17,18) or wf.followup_class IS NULL)";
|
|
|
}
|
|
|
sql+=" order by wf.followup_plan_date desc";
|
|
|
List<Followup> followups = jdbcTemplate.query(sqlList+sql,new BeanPropertyRowMapper(Followup.class));
|
|
|
//按时间分组
|
|
|
Map<String,Object> date = sortFollowupByDate(followups);
|
|
|
|
|
|
//统计每一天完成数与计划数目
|
|
|
if(date!=null&&date.size()>0){
|
|
|
for(String key : date.keySet()){
|
|
|
//获取一天的数据
|
|
|
Map<String,Object> d = (Map<String,Object>)date.get(key);
|
|
|
// 获取一天随访数据
|
|
|
List<Followup> dateFollowups = (List<Followup>)d.get("followups");
|
|
|
//统计一天各项纬度指标
|
|
|
List<Map<String,Object>> statistics = new ArrayList<>();
|
|
|
for(String type : FOLLOWUP_TYPE){
|
|
|
for(String cls:FOLLOWUP_CLASS ){
|
|
|
//统计单条
|
|
|
Map<String,Object> fs = sortFollowupList(type,cls,dateFollowups);
|
|
|
Integer count = (Integer)fs.get("count");
|
|
|
if(count!=0){
|
|
|
statistics.add(fs);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
d.put("statistics",statistics);
|
|
|
}
|
|
|
}
|
|
|
return date;
|
|
|
}
|
|
|
|
|
|
public Map<String,Object> sortFollowupByDate(List<Followup> followups){
|
|
|
//按时间分组
|
|
|
Map<String,Object> date = new HashedMap();
|
|
|
if(followups!=null&&followups.size()>0){
|
|
|
Iterator it = followups.iterator();
|
|
|
while (it.hasNext()){
|
|
|
Followup followup = (Followup)it.next();
|
|
|
|
|
|
//1.获取日期分组
|
|
|
Map<String,Object> dateFollows = (Map<String,Object>)date.get(DateUtil.dateToStr(followup.getFollowupPlanDate(),"yyyy-MM-dd"));
|
|
|
|
|
|
//判断随访时间是否已经创建分组
|
|
|
if(dateFollows!=null&&dateFollows.size()>0){
|
|
|
//同一天时间已经有分组则加入list
|
|
|
List<Followup> list = (List<Followup>)dateFollows.get("followups");
|
|
|
list.add(followup);
|
|
|
|
|
|
}else{
|
|
|
//同一天的时间没有该分组则创建这天的随访计划List
|
|
|
Map<String,Object> newdateFollow = new HashedMap();
|
|
|
|
|
|
List<Followup> dateFollowups = new ArrayList<>();
|
|
|
dateFollowups.add(followup);
|
|
|
newdateFollow.put("followups",dateFollowups);
|
|
|
|
|
|
date.put(DateUtil.dateToStr(followup.getFollowupPlanDate(),"yyyy-MM-dd"),newdateFollow);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return date;
|
|
|
}
|
|
|
|
|
|
public Map<String,Object> sortFollowupList(String followupType,String followupClass,List<Followup> followups){
|
|
|
//统计完成数
|
|
|
Integer compeleCount = 0;
|
|
|
//总数
|
|
|
Integer count = 0;
|
|
|
//迭代数组
|
|
|
List<Followup> rs = new ArrayList<>();
|
|
|
if(followups!=null&&followups.size()>0){
|
|
|
Iterator it = followups.iterator();
|
|
|
while (it.hasNext()){
|
|
|
Followup followup = (Followup)it.next();
|
|
|
//判断随访类型与类别
|
|
|
if(followupClass.equals(followup.getFollowupClass())&& followupType.equals(followup.getFollowupType())){
|
|
|
rs.add(followup);
|
|
|
if("1".equals(followup.getStatus())){
|
|
|
compeleCount++;
|
|
|
}
|
|
|
//删除迭代器中元素
|
|
|
//it.remove();
|
|
|
}
|
|
|
}
|
|
|
//设置总数
|
|
|
count = rs.size();
|
|
|
}
|
|
|
|
|
|
Map<String,Object> mapFollow =new HashedMap();
|
|
|
mapFollow.put("followupType",followupType);
|
|
|
mapFollow.put("followupClass",followupClass);
|
|
|
mapFollow.put("compeleCount",compeleCount);
|
|
|
mapFollow.put("count",count);
|
|
|
return mapFollow;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取随访计划
|
|
|
* @param doctor
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public List<Followup> findFollowupList(String followIds,String doctor,String patient,String followupClass,String patientName,String startTime,String endTime,String flag,Integer type,String status)throws Exception {
|
|
|
//1.查找时间段中所有计划中的随访
|
|
|
|
|
|
String sqlList = "select wf.id as id,wf.followup_no as followupNo,wf.followup_date as followupDate,wf.followup_plan_date as followupPlanDate,wf.followup_next_date as followupNextDate," +
|
|
|
" wf.followup_type as followupType,wf.followup_class as followupClass,wf.followup_manager_status as followupManagerStatus,wf.doctor_code as doctorCode,wf.doctor_name as doctorName," +
|
|
|
"wf.jwdoctor_code as jwdoctorCode,wf.org_code as orgCode,wf.org_name as orgName,wf.jworg_code as jworgCode,wf.patient_code as patientCode,wf.patient_name as patientName,wf.idcard," +
|
|
|
"wf.data_from as dataFrom,wf.status,wf.followup_content_phone as followupContentPhone,wf.creater,wf.sign_type as signType,wf.admin_team_code as adminTeamCode,wf.sign_code as signCode," +
|
|
|
"wf.prescription_code as prescriptionCode,wf.age,wf.sex,wf.mobile,wf.idcard_encrypt AS idcardEncrypt,wf.type" +
|
|
|
"";
|
|
|
String sql = " from wlyy_followup wf ";
|
|
|
sql+= " where 1=1 and wf.status !=0";
|
|
|
if (StringUtils.isNotBlank(followIds)){
|
|
|
List<String> followId = Arrays.asList(followIds.split(","));
|
|
|
String wfIds = followId.stream().map(String::valueOf).collect(Collectors.joining("','"));
|
|
|
sql+=" and wf.id in ('"+wfIds+"') ";
|
|
|
}
|
|
|
if(!org.apache.commons.lang.StringUtils.isEmpty(doctor)){
|
|
|
sql+=" and wf.doctor_code = '"+doctor+"'";
|
|
|
}
|
|
|
if(!org.apache.commons.lang.StringUtils.isEmpty(patient)){
|
|
|
sql+=" and wf.patient_code = '"+patient+"'";
|
|
|
}
|
|
|
if(!org.apache.commons.lang.StringUtils.isEmpty(followupClass)){
|
|
|
sql+=" and wf.followup_class = '"+followupClass+"'";
|
|
|
}
|
|
|
if(!org.apache.commons.lang.StringUtils.isEmpty(patientName)){
|
|
|
sql+=" and wf.patient_name like '%"+patientName+"%'";
|
|
|
}
|
|
|
if(!org.apache.commons.lang.StringUtils.isEmpty(startTime)){
|
|
|
sql+=" and wf.followup_plan_date >='"+startTime+"'";
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(status)){
|
|
|
sql+=" and wf.status ='"+status+"' ";
|
|
|
}
|
|
|
if(!org.apache.commons.lang.StringUtils.isEmpty(endTime)){
|
|
|
Date currentTime = DateUtil.strToDate(endTime + " 23:59:59");
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
String dateString = formatter.format(currentTime);
|
|
|
sql+=" and wf.followup_plan_date <='"+dateString+"'";
|
|
|
}
|
|
|
if(flag==null){
|
|
|
flag="0";
|
|
|
}
|
|
|
if (type!=null&&type!=0){
|
|
|
sql+=" AND wf.type ="+type;
|
|
|
}
|
|
|
if(flag.equals("1")&&flag!=null){
|
|
|
sql+=" and wf.followup_class in(5,6,7,8,9)";
|
|
|
}
|
|
|
if(flag.equals("2")&&flag!=null){
|
|
|
sql+=" and (wf.followup_class in(1,2,3,4,11,12,13,14,15,16,17,18) or wf.followup_class IS NULL)";
|
|
|
}
|
|
|
sql+=" order by wf.followup_plan_date desc";
|
|
|
List<Followup> followupAll = jdbcTemplate.query(sqlList+sql,new BeanPropertyRowMapper(Followup.class));
|
|
|
List<Followup> followups = new ArrayList<>();
|
|
|
for(Followup followup:followupAll){
|
|
|
BasePatientDO patient1 = patientDao.findById(followup.getPatientCode()).orElse(null);
|
|
|
int age = IdCardUtil.getAgeForIdcard(followup.getIdcard());
|
|
|
patient1.setAge(age);
|
|
|
List<Map<String,Object>> map = findPatientLabel(followup.getPatientCode());
|
|
|
followup.setPatient(patient1);
|
|
|
followup.setFollowupLabelPatient(map);
|
|
|
followups.add(followup);
|
|
|
}
|
|
|
return followups;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取随访标签列表带居民数
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Map<String,Object>> findLabelListWithCount(){
|
|
|
List<Map<String,Object>> rs = findFollowupLabel();
|
|
|
if(rs!=null&& rs.size()>0){
|
|
|
for(Map<String,Object> map:rs){
|
|
|
String labelCode = (String)map.get("LableCode");
|
|
|
map.put("count",findPatientFollowLabelCount(labelCode));
|
|
|
}
|
|
|
}
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取随访标签列表
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Map<String,Object>> findFollowupLabel(){
|
|
|
String sql=" SELECT " +
|
|
|
" l.label_code AS LableCode, " +
|
|
|
" l.label_name AS labelName " +
|
|
|
" FROM " +
|
|
|
" wlyy_followup_label l " +
|
|
|
" ORDER BY " +
|
|
|
" l.sort " +
|
|
|
" ASC ";
|
|
|
List<Map<String, Object>> rs = jdbcTemplate.queryForList(sql);
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 计算随访标签人数
|
|
|
* @param labelCode
|
|
|
* @return
|
|
|
*/
|
|
|
public Long findPatientFollowLabelCount(String labelCode){
|
|
|
String sql =" SELECT " +
|
|
|
" COUNT(1) AS total " +
|
|
|
" FROM " +
|
|
|
" wlyy_followup_label l " +
|
|
|
" JOIN wlyy_followup_label_patient p ON l.label_code = p.label_code " +
|
|
|
" WHERE " +
|
|
|
" l.label_code ='"+labelCode+"'";
|
|
|
List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sql);
|
|
|
Long count = 0L;
|
|
|
if (rstotal != null && rstotal.size() > 0) {
|
|
|
count = (Long) rstotal.get(0).get("total");
|
|
|
}
|
|
|
return count;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取随访居民
|
|
|
* @param namekey
|
|
|
* @param labelCode
|
|
|
* @param page
|
|
|
* @param size
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public Map<String,Object> findFollowUpPatient(String namekey,String doctor,String labelCode,Integer page,Integer size)throws Exception{
|
|
|
String totalSql = " SELECT " +
|
|
|
" DISTINCT p.id " +
|
|
|
" FROM " +
|
|
|
" wlyy_followup_label l " +
|
|
|
" JOIN wlyy_followup_label_patient lp ON l.label_code = lp.label_code " +
|
|
|
" JOIN base_patient p ON lp.patient = p.id " +
|
|
|
" WHERE " +
|
|
|
" 1=1 ";
|
|
|
if(StringUtils.isNotBlank(namekey)){
|
|
|
totalSql +=" AND p.name LIKE '%"+namekey+"%'";
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(labelCode)){
|
|
|
totalSql +=" AND lp.label_code ='"+labelCode+"' ";
|
|
|
}
|
|
|
List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
|
|
|
Integer count = 0;
|
|
|
if (rstotal != null && rstotal.size() > 0) {
|
|
|
count = rstotal.size();
|
|
|
}
|
|
|
|
|
|
|
|
|
String sql = " SELECT DISTINCT" +
|
|
|
" p.id, " +
|
|
|
" p.`name`, " +
|
|
|
" p.sex, " +
|
|
|
" IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " +
|
|
|
" p.photo" +
|
|
|
" FROM " +
|
|
|
" wlyy_followup_label l " +
|
|
|
" JOIN wlyy_followup_label_patient lp ON l.label_code = lp.label_code " +
|
|
|
" JOIN base_patient p ON lp.patient = p.id " +
|
|
|
" WHERE " +
|
|
|
" 1=1 ";
|
|
|
if(StringUtils.isNotBlank(namekey)){
|
|
|
sql +=" AND p.name LIKE '%"+namekey+"%'";
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(labelCode)){
|
|
|
sql +=" AND lp.label_code ='"+labelCode+"' ";
|
|
|
}
|
|
|
|
|
|
sql +=" limit " + (page-1)*size +"," + size;
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
//设置标签
|
|
|
if(list!=null&&list.size()>0){
|
|
|
for(Map<String,Object> map:list){
|
|
|
String patient = (String)map.get("code");
|
|
|
map.put("labels",findPatientLabel(patient));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
Map<String,Object> rs = new HashedMap();
|
|
|
rs.put("total",count);
|
|
|
|
|
|
//统计随访数目
|
|
|
rs.put("list",findPatientFollowCount(list,doctor));
|
|
|
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 统计当前医生的居民计划数与完成数
|
|
|
* @param list
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public List<Map<String, Object>> findPatientFollowCount(List<Map<String,Object>> list,String doctor)throws Exception{
|
|
|
if(list!=null&&list.size()>0){
|
|
|
for(Map<String,Object> map:list){
|
|
|
String patient = (String)map.get("code");
|
|
|
List<Followup> followups = followupDao.findAllPatientPlan(patient,doctor);
|
|
|
|
|
|
//统计数目
|
|
|
Integer count = 0;
|
|
|
Integer compeleCount =0;
|
|
|
|
|
|
if(followups!=null&&followups.size()>0){
|
|
|
count = followups.size();
|
|
|
for(Followup followup:followups){
|
|
|
if("1".equals(followup.getStatus())){
|
|
|
compeleCount++;
|
|
|
}
|
|
|
}
|
|
|
map.put("count",count);
|
|
|
map.put("compeleCount",compeleCount);
|
|
|
map.put("followups",followups);
|
|
|
}else{
|
|
|
map.put("count",count);
|
|
|
map.put("compeleCount",compeleCount);
|
|
|
map.put("followups",followups);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取居民详情
|
|
|
* @param patient
|
|
|
* @return
|
|
|
*/
|
|
|
public Map<String,Object> findPatientInfo(String patient){
|
|
|
String sql = " SELECT " +
|
|
|
" p.`name`, " +
|
|
|
" p.id, " +
|
|
|
" p.sex, " +
|
|
|
" IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " +
|
|
|
" p.photo, " +
|
|
|
" l.label_code AS labelCode, " +
|
|
|
" l.label_name AS labelName, " +
|
|
|
" p.address," +
|
|
|
" p.idcard," +
|
|
|
" p.mobile" +
|
|
|
" FROM " +
|
|
|
" wlyy_followup_label l " +
|
|
|
" JOIN wlyy_followup_label_patient lp ON l.label_code = lp.label_code " +
|
|
|
" JOIN base_patient p ON lp.patient = p.id " +
|
|
|
" WHERE " +
|
|
|
" p.id = '"+patient+ "'";
|
|
|
List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
|
|
|
if(rs!=null&&rs.size()>0){
|
|
|
return rs.get(0);
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取居民随访列表
|
|
|
* @param patient
|
|
|
* @param doctor
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public List<Followup> findPatientFollowList(String patient,String doctor)throws Exception{
|
|
|
List<Followup> followups = followupDao.findAllPatientPlan(patient,doctor);
|
|
|
return followups;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取居民随访列表
|
|
|
* @param patient
|
|
|
* @param doctor
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public List<Followup> findPatientFollowListByCondition(String patient,String doctor,String followupType,String followupClass,String type,
|
|
|
String status,String startDate,String endDate)throws Exception{
|
|
|
StringBuilder sql = new StringBuilder("select * from wlyy_followup a where 1=1 ");
|
|
|
if (StringUtils.isNotBlank(patient)){
|
|
|
sql.append(" and a.patient_code ='"+patient+"' ");
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(doctor)){
|
|
|
sql.append(" and a.doctor_code ='"+doctor+"' ");
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(followupType)){
|
|
|
sql.append(" and a.followup_type ='"+followupType+"' ");
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(followupClass)){
|
|
|
sql.append(" and a.followup_class in("+followupClass+") ");
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(type)){
|
|
|
sql.append(" and a.type ='"+type+"' ");
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(status)){
|
|
|
sql.append(" and a.status ='"+status+"' ");
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(startDate)){
|
|
|
sql.append(" and a.followup_date >='"+startDate+"' ");
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(endDate)){
|
|
|
sql.append(" and a.followup_date <='"+endDate+"' ");
|
|
|
}
|
|
|
sql.append("order by a.followup_date desc");
|
|
|
List<Followup> followups = jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper<>(Followup.class));
|
|
|
|
|
|
for (Followup tmp:followups){
|
|
|
//随访方式
|
|
|
sql = new StringBuilder("select dict_value from wlyy_hospital_sys_dict where dict_name='FOLLOWUP_WAY_DICT' and dict_code ='"+tmp.getFollowupType()+"'");
|
|
|
tmp.setFollowupTypeName(jdbcTemplate.queryForObject(sql.toString(),String.class));
|
|
|
//随访类别
|
|
|
String followupClassTmp = tmp.getFollowupClass();
|
|
|
sql =new StringBuilder("select GROUP_CONCAT(\n" +
|
|
|
" dict_value SEPARATOR ','\n" +
|
|
|
" ) AS followupClassName from wlyy_hospital_sys_dict where dict_name='FOLLOWUP_CLASS_DICT' ");
|
|
|
sql.append(" and dict_code in ('").append(followupClassTmp.replace(",","','")).append("')");
|
|
|
tmp.setFollowupClassName(jdbcTemplate.queryForObject(sql.toString(),String.class));
|
|
|
}
|
|
|
|
|
|
return followups;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 创建随访
|
|
|
* @param jsonFollowup
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public Followup saveFollowup(String jsonFollowup)throws Exception{
|
|
|
Followup followup = objectMapper.readValue(jsonFollowup,Followup.class);
|
|
|
//访视添加居民信息
|
|
|
if(StringUtils.isBlank(followup.getPatientName()) && StringUtils.isBlank(followup.getIdcard())) {
|
|
|
BasePatientDO p = patientDao.findById(followup.getPatientCode()).orElse(null);
|
|
|
followup.setPatientName(p.getName());
|
|
|
followup.setIdcard(p.getIdcard());
|
|
|
}
|
|
|
List<Date> dateList = followupDao.findFollowupDateList(followup.getDoctorCode(),followup.getPatientCode());
|
|
|
Date prior = null;
|
|
|
for (Date date : dateList) {
|
|
|
try {
|
|
|
if (prior == null) {
|
|
|
prior = date;
|
|
|
} else {
|
|
|
if(prior.after(date)) {
|
|
|
prior = date;
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
Set statusList = followupDao.findStatusList(followup.getDoctorCode(), followup.getPatientCode());
|
|
|
if (statusList.size() == 1 && statusList.iterator().next().equals("2")) {
|
|
|
return followupDao.save(followup);
|
|
|
}
|
|
|
if (prior != null) {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
String sdf1 = sdf.format(followup.getFollowupDate());
|
|
|
String sdf2 = sdf.format(prior);
|
|
|
DateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
|
|
Date followupDate = df.parse(sdf1);
|
|
|
Date priorDate = df.parse(sdf2);
|
|
|
Boolean b = null;
|
|
|
if (followup.getId() != null) {
|
|
|
b = this.isFirstTimeFollowup(followup.getDoctorCode(), followup.getPatientCode(), "9", followup.getId().intValue());
|
|
|
List<Followup> followupList = followupDao.findFollowupList(followup.getDoctorCode(), followup.getPatientCode());
|
|
|
if (b == true && followupList.size() >= 2) {
|
|
|
String two = sdf.format(followupList.get(1).getFollowupDate());
|
|
|
Date twoDate = df.parse(two);
|
|
|
if (followupDate.getTime() >= twoDate.getTime()) {
|
|
|
throw new ServiceException("第一次访视时间不能晚于第二次访视时间!");
|
|
|
}
|
|
|
} else if (priorDate.getTime() >= followupDate.getTime()) {
|
|
|
throw new ServiceException("随访时间不能早于第一次随访时间!");
|
|
|
} else {
|
|
|
return followupDao.save(followup);
|
|
|
}
|
|
|
|
|
|
} else if (priorDate.getTime() >= followupDate.getTime()) {
|
|
|
throw new ServiceException("随访时间不能早于第一次随访时间!");
|
|
|
} else {
|
|
|
return followupDao.save(followup);
|
|
|
}
|
|
|
}
|
|
|
return followupDao.save(followup);
|
|
|
}
|
|
|
|
|
|
public Followup delFollowup(Long followupId)throws Exception{
|
|
|
Followup followup = followupDao.findById(followupId).orElse(null);
|
|
|
List<Followup> followupList = followupDao.findFollowupList(followup.getDoctorCode(),followup.getPatientCode());
|
|
|
if(followupList.size()>=2){
|
|
|
if(followupList.get(1)!=null&&followupList.get(1).getStatus().equals("1")){
|
|
|
throw new ServiceException("当前状态不可删除!");
|
|
|
}
|
|
|
}
|
|
|
followupDao.deleteById(followupId);
|
|
|
return followup;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取随访详情
|
|
|
* @param followupId
|
|
|
* @return
|
|
|
*/
|
|
|
public Followup findFollowupInfo(Long followupId){
|
|
|
Followup followup = followupDao.findById(followupId).orElse(null);
|
|
|
BasePatientDO patient = patientDao.findById(followup.getPatientCode()).orElse(null);
|
|
|
followup.setPhoto(patient.getPhoto());
|
|
|
followup.setPatient(patient);
|
|
|
return followup;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 随访签到
|
|
|
* @param jsonSign
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public Boolean saveFollowupSign(String jsonSign)throws Exception{
|
|
|
FollowupSign followupSign = objectMapper.readValue(jsonSign,FollowupSign.class);
|
|
|
List<FollowupSign> sign = followupSignDao.findByFollowupIdAndDel(followupSign.getFollowupId(),0);
|
|
|
if(sign!=null&&sign.size()>0){
|
|
|
//做更新操作
|
|
|
for(FollowupSign s:sign){
|
|
|
s.setDel(1);
|
|
|
}
|
|
|
followupSignDao.saveAll(sign);
|
|
|
}else{
|
|
|
//修改随访状态为进行中
|
|
|
Followup followup = followupDao.findById(followupSign.getFollowupId()).orElse(null);
|
|
|
followup.setStatus("3");
|
|
|
}
|
|
|
|
|
|
//新增更新随访状态
|
|
|
followupSign.setCode(CommonUtil.getCode());
|
|
|
followupSign.setCreateTime(new Date());
|
|
|
followupSign.setDel(0);
|
|
|
followupSignDao.save(followupSign);
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 修改签到记录
|
|
|
* @param jsonSign
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public Boolean updateFollowupSign(String jsonSign)throws Exception{
|
|
|
//重新签到
|
|
|
FollowupSign followupSign = objectMapper.readValue(jsonSign,FollowupSign.class);
|
|
|
FollowupSign sign = followupSignDao.findById(followupSign.getId()).orElse(null);
|
|
|
sign.setDel(1);
|
|
|
followupSignDao.save(sign);
|
|
|
|
|
|
FollowupSign newSign = new FollowupSign();
|
|
|
|
|
|
newSign.setCode(CommonUtil.getCode());
|
|
|
newSign.setFollowupId(sign.getFollowupId());
|
|
|
newSign.setAddress(sign.getAddress());
|
|
|
newSign.setType(sign.getType());
|
|
|
newSign.setCreateTime(new Date());
|
|
|
newSign.setDoctor(sign.getDoctor());
|
|
|
newSign.setDoctorName(sign.getDoctorName());
|
|
|
newSign.setImg(sign.getImg());
|
|
|
newSign.setLatitude(sign.getLatitude());
|
|
|
newSign.setLongitude(sign.getLongitude());
|
|
|
newSign.setDel(0);
|
|
|
|
|
|
followupSignDao.save(newSign);
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 门牌地址解析
|
|
|
* @param url
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public String urlAnalysis(String url)throws Exception{
|
|
|
url.replace("http://www.fjadd.com/addr?","http://www.fjadd.com/shhyy/addr_list.jsp?showtp=1&system");
|
|
|
Document doc = Jsoup.connect(url).get();
|
|
|
String html = doc.toString();
|
|
|
int start = html.indexOf("href=\"");
|
|
|
int end = html.indexOf("\"}");
|
|
|
|
|
|
int ed = url.indexOf("com");
|
|
|
String ym = url.substring(0,ed+3);
|
|
|
String path = html.substring(start+6,end);
|
|
|
|
|
|
Document d = Jsoup.connect(ym+path).get();
|
|
|
String address = d.select("div.dzksfd1_lz2").eq(0).text()+d.select("div.dzksfd1_lz2").eq(1).text();
|
|
|
|
|
|
logger.info("url:"+url+" path:"+ym+path+" adress:"+address);
|
|
|
return address;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 随访完成
|
|
|
* @param followupId
|
|
|
* @return
|
|
|
*/
|
|
|
public Boolean updateFollowStatus(Long followupId,Integer isFlag)throws Exception{
|
|
|
Followup followup = followupDao.findById(followupId).orElse(null);
|
|
|
followup.setStatus("1");
|
|
|
followupDao.save(followup);
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 签到详细
|
|
|
* @param followupId
|
|
|
* @return
|
|
|
*/
|
|
|
public FollowupSign findByFollowupId(Long followupId){
|
|
|
List<FollowupSign> sign = followupSignDao.findByFollowupIdAndDel(followupId,0);
|
|
|
if(sign!=null&&sign.size()>0){
|
|
|
return sign.get(0);
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
|
|
|
public List<Map<String,Object>> findPatientLabel(String patient){
|
|
|
String sql ="SELECT " +
|
|
|
" pl.label_code AS labelCode, " +
|
|
|
" pl.label_name AS labelName " +
|
|
|
" FROM " +
|
|
|
" wlyy_followup_label_patient pl " +
|
|
|
" WHERE " +
|
|
|
" pl.patient = '"+patient+"'";
|
|
|
List<Map<String,Object>> label = jdbcTemplate.queryForList(sql);
|
|
|
return label;
|
|
|
}
|
|
|
|
|
|
public Boolean isFirstTimeFollowup(String doctor,String patient,String followupClass,Integer followupId){
|
|
|
//按时间升序取第一条
|
|
|
String sql =" SELECT " +
|
|
|
" f.id, " +
|
|
|
" f.create_time " +
|
|
|
" FROM " +
|
|
|
" wlyy_followup f " +
|
|
|
" WHERE " +
|
|
|
// " f.doctor_code = '"+doctor+"' AND " +
|
|
|
" f.patient_code = '"+patient+"' " +
|
|
|
" AND f.followup_class = '"+followupClass+"' and f.status != 0 " +
|
|
|
" ORDER BY " +
|
|
|
" f.followup_date " +
|
|
|
" ASC " +
|
|
|
" LIMIT 0,1";
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
if(list!=null&&list.size()>0){
|
|
|
int id = (Integer)list.get(0).get("id");
|
|
|
//如果与第一条的id不等,则非第一次
|
|
|
if(!(id==followupId)){
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
|
|
|
//============================上门访视相关接口end================================================
|
|
|
|
|
|
//============================高血压糖尿病表单整合start================================================
|
|
|
|
|
|
/**
|
|
|
* ES获取表单项目数据
|
|
|
*/
|
|
|
public FollowupContentESDO esGetFollowupProjectDataList(String id, String followupProject) throws Exception {
|
|
|
FollowupContentESDO followupContentESDO = null;
|
|
|
try {
|
|
|
//根据随访ID、分类ID获取随访记录详情
|
|
|
//先根据条件查找出来
|
|
|
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
|
|
if(StringUtils.isNotBlank(followupProject)) {
|
|
|
searchSourceBuilder.query(
|
|
|
new BoolQueryBuilder()
|
|
|
.must(QueryBuilders.matchQuery("followup_id", id))
|
|
|
.must(QueryBuilders.matchQuery("followup_project", followupProject))
|
|
|
);
|
|
|
}else {
|
|
|
searchSourceBuilder.query(
|
|
|
new BoolQueryBuilder()
|
|
|
.must(QueryBuilders.matchQuery("followup_id", id))
|
|
|
.mustNot(QueryBuilders.existsQuery("followup_project"))
|
|
|
);
|
|
|
}
|
|
|
followupContentESDO = elasticSearch7Helper.searchOne(esIndex,searchSourceBuilder,FollowupContentESDO.class);
|
|
|
} catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
return followupContentESDO;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* ES 保存随访记录详情
|
|
|
*
|
|
|
* @author huangwenjie
|
|
|
* @date 2017/11/1 14:57
|
|
|
*/
|
|
|
@Transactional
|
|
|
public void saveAllFollowupProjectData(String id, String followupProjectData) throws Exception {
|
|
|
try {
|
|
|
//先根据条件查找出来
|
|
|
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
|
|
searchSourceBuilder.query(
|
|
|
new BoolQueryBuilder()
|
|
|
.must(QueryBuilders.matchQuery("followup_id", id))
|
|
|
);
|
|
|
|
|
|
List<FollowupContentESDO> followupContentESDOS = elasticSearch7Helper.search(esIndex,searchSourceBuilder,FollowupContentESDO.class);
|
|
|
|
|
|
List<FollowupContentESDO> dataList = new ArrayList<>();
|
|
|
if(followupContentESDOS != null){
|
|
|
dataList.addAll(followupContentESDOS);
|
|
|
//删除原有记录
|
|
|
this.esDeleteFollowUpContent(dataList);
|
|
|
}
|
|
|
|
|
|
//保存新的随访详情信息
|
|
|
List<FollowupContentESDO> newdatalist = new ArrayList<>();
|
|
|
FollowupContentESDO followupContentESDO = new FollowupContentESDO();
|
|
|
followupContentESDO = JSON.parseObject(followupProjectData, FollowupContentESDO.class);
|
|
|
followupContentESDO.setFollowup_id(id);
|
|
|
followupContentESDO.setCreate_time(new Date());
|
|
|
newdatalist.add(followupContentESDO);
|
|
|
elasticSearch7Helper.save(esIndex, newdatalist);
|
|
|
} catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public File writeWordFile(List<Long> orderId, HttpServletResponse response) throws Exception {
|
|
|
String zipFileName = "入户访视详情";
|
|
|
long time = System.currentTimeMillis();
|
|
|
String exportConclusionList = time+"exportList";
|
|
|
String path = this.getClass().getResource("/").getPath() + exportConclusionList;
|
|
|
File file = new File(path);
|
|
|
// 删除文件夹、文件
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
|
|
|
System.out.println("创建文件夹时间:"+sdf.format(new Date()));
|
|
|
if (file.exists()) {
|
|
|
if (file != null){
|
|
|
CommonUtil.deleteFolder(file);
|
|
|
file.mkdir();
|
|
|
}else {
|
|
|
file.delete();
|
|
|
file.mkdir();
|
|
|
}
|
|
|
}else {
|
|
|
file.mkdir();
|
|
|
}
|
|
|
int j =1;
|
|
|
long doorStart = System.currentTimeMillis();
|
|
|
long feeDetailStart = System.currentTimeMillis();
|
|
|
long feeDetailEnd = System.currentTimeMillis();
|
|
|
|
|
|
System.out.println("feeDetail用时:"+(feeDetailEnd-feeDetailStart)/1000);
|
|
|
System.out.println("开始生成Word:"+sdf.format(new Date()));
|
|
|
for (int i = 0; i < orderId.size(); i++) {
|
|
|
try {
|
|
|
Long followId = orderId.get(i);
|
|
|
Followup followup = followupDao.findById(followId).orElse(null);
|
|
|
if (null==followup){
|
|
|
continue;
|
|
|
}
|
|
|
if (!"8".equals(followup.getFollowupClass())){
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
String fileName = "入户访视详情_"+followup.getPatientName()+"_"+followId+".doc";;
|
|
|
j = j + 1;
|
|
|
// fileName = URLEncoder.encode(fileName, "utf-8");
|
|
|
fileName = java.net.URLEncoder.encode(fileName,"UTF-8");
|
|
|
fileName = java.net.URLDecoder.decode(fileName,"UTF-8");
|
|
|
// response.setHeader("Content-Disposition", "attachment;filename=" + new String( fileName.getBytes(), "iso-8859-1"));
|
|
|
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
|
|
|
String pathName = this.getClass().getResource("/").getPath() + "health_examination.mht";
|
|
|
Document doc = Jsoup.parse(new File(pathName), "UTF-8");
|
|
|
String html = this.handleHealthExamData(doc, orderId.get(i),followup);
|
|
|
if (StringUtils.isNotBlank(html)){
|
|
|
BufferedWriter bw = new BufferedWriter(new FileWriter(path+"/"+fileName));//创建的文件
|
|
|
bw.write(html);
|
|
|
bw.close();
|
|
|
File zipFile = new File(path.replace(exportConclusionList, "") + zipFileName + ".zip");
|
|
|
if (zipFile.exists()) {
|
|
|
zipFile.delete();
|
|
|
}
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
System.out.println("Word生成结束:"+sdf.format(new Date()));
|
|
|
// 打包文件夹
|
|
|
if (FileUtil.fileToZip(path, path.replace(exportConclusionList, ""), zipFileName)) {
|
|
|
return new File(path.replace(exportConclusionList, "") + zipFileName + ".zip");
|
|
|
} else {
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public String handleHealthExamData(Document doc, Long orderId,Followup followup) throws Exception {
|
|
|
String html = doc.toString();
|
|
|
//根据随访ID获取随访记录详情
|
|
|
OlderPeopleHealthCheckRecordES olderPeopleHealthCheckRecord = visitDetailService.getOlderPeopleHealthCheckRecord(orderId+"",null);
|
|
|
if (null==olderPeopleHealthCheckRecord){
|
|
|
return null;
|
|
|
}
|
|
|
html = html.replace("${patientName}", null==olderPeopleHealthCheckRecord.getName()?"":olderPeopleHealthCheckRecord.getName());
|
|
|
html = html.replace("${idcard}", null==olderPeopleHealthCheckRecord.getIdcard()?"":olderPeopleHealthCheckRecord.getIdcard());
|
|
|
html = html.replace("${number}", null==olderPeopleHealthCheckRecord.getNumber()?"":olderPeopleHealthCheckRecord.getNumber());
|
|
|
html = html.replace("${duty}", null==olderPeopleHealthCheckRecord.getDuty()?" ":DateUtil.dateToStrShort(olderPeopleHealthCheckRecord.getDuty()));
|
|
|
html = html.replace("${responsibility_doctor_name}",olderPeopleHealthCheckRecord.getResponsibility_doctor_name());
|
|
|
if (null==olderPeopleHealthCheckRecord.getSymptom()){
|
|
|
html = html.replace("${symptom}"," ");
|
|
|
}else {
|
|
|
StringBuilder symptomName = new StringBuilder();
|
|
|
String symptom = olderPeopleHealthCheckRecord.getSymptom();
|
|
|
String[] symptoms = symptom.split(",");
|
|
|
for (String tmp:symptoms){
|
|
|
symptomName.append(getSymptomName(tmp));
|
|
|
}
|
|
|
html = html.replace("${symptom}",symptomName.toString());
|
|
|
}
|
|
|
html = html.replace("${symptom_other}",olderPeopleHealthCheckRecord.getSymptom_other());
|
|
|
/**一般状况**/
|
|
|
html = html.replace("${temperature}",null==olderPeopleHealthCheckRecord.getTemperature()?" ":olderPeopleHealthCheckRecord.getTemperature()+"");
|
|
|
html = html.replace("${pulse_frequency}",olderPeopleHealthCheckRecord.getPulse_frequency());
|
|
|
html = html.replace("${breath_frequency}",olderPeopleHealthCheckRecord.getBreath_frequency());
|
|
|
html = html.replace("${blood_pressure_left_low}",null==olderPeopleHealthCheckRecord.getBlood_pressure_left_low()?" ":olderPeopleHealthCheckRecord.getBlood_pressure_left_low()+"");
|
|
|
html = html.replace("${blood_pressure_left_high}",null==olderPeopleHealthCheckRecord.getBlood_pressure_left_high()?" ":olderPeopleHealthCheckRecord.getBlood_pressure_left_high()+"");
|
|
|
html = html.replace("${blood_pressure_right_low}",null==olderPeopleHealthCheckRecord.getBlood_pressure_right_low()?" ":olderPeopleHealthCheckRecord.getBlood_pressure_right_low()+"");
|
|
|
html = html.replace("${blood_pressure_right_high}",null==olderPeopleHealthCheckRecord.getBlood_pressure_right_high()?" ":olderPeopleHealthCheckRecord.getBlood_pressure_right_high()+"");
|
|
|
html = html.replace("${height}",null==olderPeopleHealthCheckRecord.getHeight()?" ":olderPeopleHealthCheckRecord.getHeight()+"");
|
|
|
html = html.replace("${weight}",null==olderPeopleHealthCheckRecord.getWeight()?" ":olderPeopleHealthCheckRecord.getWeight()+"");
|
|
|
html = html.replace("${waistline}",null==olderPeopleHealthCheckRecord.getWaistline()?" ":olderPeopleHealthCheckRecord.getWaistline()+"");
|
|
|
html = html.replace("${BMI}",null==olderPeopleHealthCheckRecord.getBMI()?" ":olderPeopleHealthCheckRecord.getBMI()+"");
|
|
|
if (null==olderPeopleHealthCheckRecord.getHealth_status()){
|
|
|
html = html.replace("${health_status}"," ");
|
|
|
}else {
|
|
|
Integer health_status = olderPeopleHealthCheckRecord.getHealth_status();
|
|
|
switch (health_status){
|
|
|
case 1:html = html.replace("${health_status}","满意");break;
|
|
|
case 2:html = html.replace("${health_status}","基本满意");break;
|
|
|
case 3:html = html.replace("${health_status}","说不清");break;
|
|
|
case 4:html = html.replace("${health_status}","不太满意");break;
|
|
|
case 5:html = html.replace("${health_status}","不满意");break;
|
|
|
default:html = html.replace("${health_status}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if (null==olderPeopleHealthCheckRecord.getSelfcare_ability()){
|
|
|
html = html.replace("${selfcare_ability}"," ");
|
|
|
}else {
|
|
|
Integer selfcare_ability = olderPeopleHealthCheckRecord.getSelfcare_ability();
|
|
|
switch (selfcare_ability){
|
|
|
case 1:html = html.replace("${selfcare_ability}","可自理(0~3)分");break;
|
|
|
case 2:html = html.replace("${selfcare_ability}","轻度依赖(4~8)分");break;
|
|
|
case 3:html = html.replace("${selfcare_ability}","中度依赖(9~18)分");break;
|
|
|
case 4:html = html.replace("${selfcare_ability}","不能自理(≥19)分");break;
|
|
|
default:html = html.replace("${selfcare_ability}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if (null==olderPeopleHealthCheckRecord.getCognitive_function()){
|
|
|
html = html.replace("${cognitive_function}"," ");
|
|
|
}else {
|
|
|
Integer cognitiveFunction = olderPeopleHealthCheckRecord.getCognitive_function();
|
|
|
switch (cognitiveFunction){
|
|
|
case 1:html = html.replace("${cognitive_function}","粗筛阴性");break;
|
|
|
case 2:html = html.replace("${cognitive_function}","粗筛阳性");break;
|
|
|
default:html = html.replace("${cognitive_function}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${cognitive_function_score}",null==olderPeopleHealthCheckRecord.getCognitive_function_score()?" ":olderPeopleHealthCheckRecord.getCognitive_function_score()+"");
|
|
|
if (null==olderPeopleHealthCheckRecord.getEmotional_state()){
|
|
|
html = html.replace("${emotional_state}"," ");
|
|
|
}else {
|
|
|
Integer emotionalState = olderPeopleHealthCheckRecord.getEmotional_state();
|
|
|
switch (emotionalState){
|
|
|
case 1:html = html.replace("${emotional_state}","粗筛阴性");break;
|
|
|
case 2:html = html.replace("${emotional_state}","粗筛阳性");break;
|
|
|
default:html = html.replace("${emotional_state}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${emotional_state_score}",null==olderPeopleHealthCheckRecord.getEmotional_state_score()?" ":olderPeopleHealthCheckRecord.getEmotional_state_score()+"");
|
|
|
/**体育锻炼**/
|
|
|
if (null==olderPeopleHealthCheckRecord.getExercise_frequency()){
|
|
|
html = html.replace("${exercise_frequency}"," ");
|
|
|
}else {
|
|
|
Integer exerciseFrequency = olderPeopleHealthCheckRecord.getExercise_frequency();
|
|
|
switch (exerciseFrequency){
|
|
|
case 1:html = html.replace("${exercise_frequency}","每天");break;
|
|
|
case 2:html = html.replace("${exercise_frequency}","每周一次以上");break;
|
|
|
case 3:html = html.replace("${exercise_frequency}","偶尔");break;
|
|
|
case 4:html = html.replace("${exercise_frequency}","不锻炼");break;
|
|
|
default:html = html.replace("${exercise_frequency}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${exercise_time}",null==olderPeopleHealthCheckRecord.getExercise_time()?" ":olderPeopleHealthCheckRecord.getExercise_time()+"");
|
|
|
html = html.replace("${sustain_exercise_time}",null==olderPeopleHealthCheckRecord.getSustain_exercise_time()?" ":olderPeopleHealthCheckRecord.getSustain_exercise_time()+"");
|
|
|
html = html.replace("${exercise_type}",null==olderPeopleHealthCheckRecord.getExercise_type()?" ":olderPeopleHealthCheckRecord.getExercise_type()+"");
|
|
|
/**饮食习惯**/
|
|
|
if (null==olderPeopleHealthCheckRecord.getDietary_habit()){
|
|
|
html = html.replace("${dietary_habit}"," ");
|
|
|
}else {
|
|
|
String smokingState = olderPeopleHealthCheckRecord.getDietary_habit();
|
|
|
String[] smokingStates = smokingState.split(",");
|
|
|
String valueStrTmp = " ";
|
|
|
for (String tmp:smokingStates){
|
|
|
switch (tmp){
|
|
|
case "1":valueStrTmp+="荤素均衡 ";break;
|
|
|
case "2":valueStrTmp+="荤食为主 ";break;
|
|
|
case "3":valueStrTmp+="素食为主 ";break;
|
|
|
case "4":valueStrTmp+="嗜盐 ";break;
|
|
|
case "5":valueStrTmp+="嗜油 ";break;
|
|
|
case "6":valueStrTmp+="嗜糖 ";break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${dietary_habit}",valueStrTmp);
|
|
|
}
|
|
|
|
|
|
/**吸烟情况**/
|
|
|
if (null==olderPeopleHealthCheckRecord.getSmoking_state()){
|
|
|
html = html.replace("${smoking_state}"," ");
|
|
|
}else {
|
|
|
Integer smokingState = olderPeopleHealthCheckRecord.getSmoking_state();
|
|
|
switch (smokingState){
|
|
|
case 1:html = html.replace("${smoking_state}","从不吸烟");break;
|
|
|
case 2:html = html.replace("${smoking_state}","已戒烟");break;
|
|
|
case 3:html = html.replace("${smoking_state}","吸烟");break;
|
|
|
default:html = html.replace("${smoking_state}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${smoking_daily}",null==olderPeopleHealthCheckRecord.getSmoking_daily()?" ":olderPeopleHealthCheckRecord.getSmoking_daily()+"");
|
|
|
html = html.replace("${start_smoking_age}",null==olderPeopleHealthCheckRecord.getStart_smoking_age()?" ":olderPeopleHealthCheckRecord.getStart_smoking_age()+"");
|
|
|
html = html.replace("${stop_smoking_age}",null==olderPeopleHealthCheckRecord.getStop_smoking_age()?" ":olderPeopleHealthCheckRecord.getStop_smoking_age()+"");
|
|
|
/**饮酒情况**/
|
|
|
if (null==olderPeopleHealthCheckRecord.getDrinking_frequency()){
|
|
|
html = html.replace("${drinking_frequency}"," ");
|
|
|
}else {
|
|
|
Integer drinkingFrequency = olderPeopleHealthCheckRecord.getDrinking_frequency();
|
|
|
switch (drinkingFrequency){
|
|
|
case 1:html = html.replace("${drinking_frequency}","从不");break;
|
|
|
case 2:html = html.replace("${drinking_frequency}","偶尔");break;
|
|
|
case 3:html = html.replace("${drinking_frequency}","经常");break;
|
|
|
case 4:html = html.replace("${drinking_frequency}","每天");break;
|
|
|
default:html = html.replace("${drinking_frequency}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${drinking_daily}",null==olderPeopleHealthCheckRecord.getDrinking_daily()?" ":olderPeopleHealthCheckRecord.getDrinking_daily()+"");
|
|
|
|
|
|
if (null==olderPeopleHealthCheckRecord.getIs_stop_drinking()){
|
|
|
html = html.replace("${is_stop_drinking}"," ");
|
|
|
}else {
|
|
|
Integer isStopDrinking = olderPeopleHealthCheckRecord.getIs_stop_drinking();
|
|
|
switch (isStopDrinking){
|
|
|
case 1:html = html.replace("${is_stop_drinking}","否");break;
|
|
|
case 2:html = html.replace("${is_stop_drinking}","是");break;
|
|
|
default:html = html.replace("${is_stop_drinking}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${stop_drinking_age}",null==olderPeopleHealthCheckRecord.getStop_drinking_age()?" ":olderPeopleHealthCheckRecord.getStop_drinking_age()+"");
|
|
|
html = html.replace("${start_drinking_age}",null==olderPeopleHealthCheckRecord.getStart_drinking_age()?" ":olderPeopleHealthCheckRecord.getStart_drinking_age()+"");
|
|
|
if (null==olderPeopleHealthCheckRecord.getDrunkenness()){
|
|
|
html = html.replace("${drunkenness}"," ");
|
|
|
}else {
|
|
|
Integer drunkenness = olderPeopleHealthCheckRecord.getDrunkenness();
|
|
|
switch (drunkenness){
|
|
|
case 1:html = html.replace("${drunkenness}","是");break;
|
|
|
case 2:html = html.replace("${drunkenness}","否");break;
|
|
|
default:html = html.replace("${drunkenness}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if (null==olderPeopleHealthCheckRecord.getDrinking_type()){
|
|
|
html = html.replace("${drinking_type}"," ");
|
|
|
}else {
|
|
|
String smokingState = olderPeopleHealthCheckRecord.getDrinking_type();
|
|
|
String[] smokingStates = smokingState.split(",");
|
|
|
String valueStrTmp = " ";
|
|
|
for (String tmp:smokingStates){
|
|
|
switch (tmp){
|
|
|
case "1":valueStrTmp+="白酒 ";break;
|
|
|
case "2":valueStrTmp+="啤酒 ";break;
|
|
|
case "3":valueStrTmp+="红酒 ";break;
|
|
|
case "4":valueStrTmp+="黄酒 ";break;
|
|
|
case "5":valueStrTmp+="其他 ";break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${drinking_type}",valueStrTmp);
|
|
|
}
|
|
|
html = html.replace("${other_drinking_type}",null==olderPeopleHealthCheckRecord.getOther_drinking_type()?" ":olderPeopleHealthCheckRecord.getOther_drinking_type());
|
|
|
/**职业病危害因素接触史**/
|
|
|
html = html.replace("${dust}",null==olderPeopleHealthCheckRecord.getDust()?" ":olderPeopleHealthCheckRecord.getDust());
|
|
|
if (null==olderPeopleHealthCheckRecord.getDust_protective_measures()){
|
|
|
html = html.replace("${dust_protective_measures}"," ");
|
|
|
}else {
|
|
|
Integer dustProtectiveMeasures = olderPeopleHealthCheckRecord.getDust_protective_measures();
|
|
|
switch (dustProtectiveMeasures){
|
|
|
case 1:html = html.replace("${dust_protective_measures}","无");break;
|
|
|
case 2:html = html.replace("${dust_protective_measures}","有");break;
|
|
|
default:html = html.replace("${dust_protective_measures}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${dust_protective_measures_has}",null==olderPeopleHealthCheckRecord.getDust_protective_measures_has()?" ":olderPeopleHealthCheckRecord.getDust_protective_measures_has());
|
|
|
html = html.replace("${radiogen}",null==olderPeopleHealthCheckRecord.getRadiogen()?" ":olderPeopleHealthCheckRecord.getRadiogen());
|
|
|
if (null==olderPeopleHealthCheckRecord.getRadiogen_protective_measures()){
|
|
|
html = html.replace("${radiogen_protective_measures}"," ");
|
|
|
}else {
|
|
|
Integer radiogenProtectiveMeasures = olderPeopleHealthCheckRecord.getRadiogen_protective_measures();
|
|
|
switch (radiogenProtectiveMeasures){
|
|
|
case 1:html = html.replace("${radiogen_protective_measures}","无");break;
|
|
|
case 2:html = html.replace("${radiogen_protective_measures}","有");break;
|
|
|
default:html = html.replace("${radiogen_protective_measures}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${radiogen_protective_measures_has}",null==olderPeopleHealthCheckRecord.getRadiogen_protective_measures_has()?" ":olderPeopleHealthCheckRecord.getRadiogen_protective_measures_has());
|
|
|
html = html.replace("${physical_factor}",null==olderPeopleHealthCheckRecord.getPhysical_factor()?" ":olderPeopleHealthCheckRecord.getPhysical_factor());
|
|
|
if (null==olderPeopleHealthCheckRecord.getPhysical_protective_measures()){
|
|
|
html = html.replace("${physical_protective_measures}"," ");
|
|
|
}else {
|
|
|
Integer physicalProtectiveMeasures = olderPeopleHealthCheckRecord.getPhysical_protective_measures();
|
|
|
switch (physicalProtectiveMeasures){
|
|
|
case 1:html = html.replace("${physical_protective_measures}","无");break;
|
|
|
case 2:html = html.replace("${physical_protective_measures}","有");break;
|
|
|
default:html = html.replace("${physical_protective_measures}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${physical_protective_measures_has}",null==olderPeopleHealthCheckRecord.getPhysical_protective_measures_has()?" ":olderPeopleHealthCheckRecord.getPhysical_protective_measures_has());
|
|
|
html = html.replace("${chemical_factor}",null==olderPeopleHealthCheckRecord.getChemical_factor()?" ":olderPeopleHealthCheckRecord.getChemical_factor());
|
|
|
if (null==olderPeopleHealthCheckRecord.getChemical_protective_measures()){
|
|
|
html = html.replace("${chemical_protective_measures}"," ");
|
|
|
}else {
|
|
|
Integer chemicalProtectiveMeasures = olderPeopleHealthCheckRecord.getChemical_protective_measures();
|
|
|
switch (chemicalProtectiveMeasures){
|
|
|
case 1:html = html.replace("${chemical_protective_measures}","无");break;
|
|
|
case 2:html = html.replace("${chemical_protective_measures}","有");break;
|
|
|
default:html = html.replace("${chemical_protective_measures}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${chemical_protective_measures_has}",null==olderPeopleHealthCheckRecord.getChemical_protective_measures_has()?" ":olderPeopleHealthCheckRecord.getChemical_protective_measures_has());
|
|
|
html = html.replace("${physical_protective_measures_has}",null==olderPeopleHealthCheckRecord.getPhysical_protective_measures_has()?" ":olderPeopleHealthCheckRecord.getPhysical_protective_measures_has());
|
|
|
html = html.replace("${other_hazard_factors}",null==olderPeopleHealthCheckRecord.getOther_hazard_factors()?" ":olderPeopleHealthCheckRecord.getOther_hazard_factors());
|
|
|
if (null==olderPeopleHealthCheckRecord.getOther_hazard_protective_measures()){
|
|
|
html = html.replace("${other_hazard_protective_measures}"," ");
|
|
|
}else {
|
|
|
Integer other_hazard_protective_measures = olderPeopleHealthCheckRecord.getOther_hazard_protective_measures();
|
|
|
switch (other_hazard_protective_measures){
|
|
|
case 1:html = html.replace("${other_hazard_protective_measures}","无");break;
|
|
|
case 2:html = html.replace("${other_hazard_protective_measures}","有");break;
|
|
|
default:html = html.replace("${other_hazard_protective_measures}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${other_hazard_protective_measures_has}",null==olderPeopleHealthCheckRecord.getOther_hazard_protective_measures_has()?" ":olderPeopleHealthCheckRecord.getOther_hazard_protective_measures_has());
|
|
|
if (null==olderPeopleHealthCheckRecord.getLip()){
|
|
|
html = html.replace("${lip}"," ");
|
|
|
}else {
|
|
|
Integer lip = olderPeopleHealthCheckRecord.getLip();
|
|
|
switch (lip){
|
|
|
case 1:html = html.replace("${lip}","红润");break;
|
|
|
case 2:html = html.replace("${lip}","苍白");break;
|
|
|
case 3:html = html.replace("${lip}","发钳");break;
|
|
|
case 4:html = html.replace("${lip}","皲裂");break;
|
|
|
case 5:html = html.replace("${lip}","疱疹");break;
|
|
|
default:html = html.replace("${lip}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if (null==olderPeopleHealthCheckRecord.getDentition()){
|
|
|
html = html.replace("${dentition}"," ");
|
|
|
}else {
|
|
|
Integer dentition = olderPeopleHealthCheckRecord.getDentition();
|
|
|
switch (dentition){
|
|
|
case 1:html = html.replace("${dentition}","正常");break;
|
|
|
case 2:html = html.replace("${dentition}","缺齿");break;
|
|
|
case 3:html = html.replace("${dentition}","龋齿");break;
|
|
|
case 4:html = html.replace("${dentition}","义齿,假牙");break;
|
|
|
default:html = html.replace("${dentition}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if (null==olderPeopleHealthCheckRecord.getOropharynx()){
|
|
|
html = html.replace("${oropharynx}"," ");
|
|
|
}else {
|
|
|
Integer oropharynx = olderPeopleHealthCheckRecord.getOropharynx();
|
|
|
switch (oropharynx){
|
|
|
case 1:html = html.replace("${oropharynx}","无充血");break;
|
|
|
case 2:html = html.replace("${oropharynx}","充血");break;
|
|
|
case 3:html = html.replace("${oropharynx}","淋巴滤泡增生");break;
|
|
|
default:html = html.replace("${oropharynx}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${left_eyesight}",null==olderPeopleHealthCheckRecord.getLeft_eyesight()?"":olderPeopleHealthCheckRecord.getLeft_eyesight()+"");
|
|
|
html = html.replace("${right_eyesight}",null==olderPeopleHealthCheckRecord.getRight_eyesight()?"":olderPeopleHealthCheckRecord.getRight_eyesight()+"");
|
|
|
html = html.replace("${left_correctional_eyesight}",null==olderPeopleHealthCheckRecord.getLeft_correctional_eyesight()?"":olderPeopleHealthCheckRecord.getLeft_correctional_eyesight()+"");
|
|
|
html = html.replace("${right_correctional_eyesight}",null==olderPeopleHealthCheckRecord.getRight_correctional_eyesight()?"":olderPeopleHealthCheckRecord.getRight_correctional_eyesight()+"");
|
|
|
if (null==olderPeopleHealthCheckRecord.getHearing()){
|
|
|
html = html.replace("${hearing}"," ");
|
|
|
}else {
|
|
|
Integer hearing = olderPeopleHealthCheckRecord.getHearing();
|
|
|
switch (hearing){
|
|
|
case 1:html = html.replace("${hearing}","听见");break;
|
|
|
case 2:html = html.replace("${hearing}","听不清或无法听见");break;
|
|
|
default:html = html.replace("${hearing}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if (null==olderPeopleHealthCheckRecord.getMotor_function()){
|
|
|
html = html.replace("${motor_function}"," ");
|
|
|
}else {
|
|
|
Integer motor_function = olderPeopleHealthCheckRecord.getMotor_function();
|
|
|
switch (motor_function){
|
|
|
case 1:html = html.replace("${motor_function}","可顺利完成");break;
|
|
|
case 2:html = html.replace("${motor_function}","无法独立完成任何一个动作");break;
|
|
|
default:html = html.replace("${motor_function}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if (null==olderPeopleHealthCheckRecord.getFundus()){
|
|
|
html = html.replace("${fundus}"," ");
|
|
|
}else {
|
|
|
Integer function = olderPeopleHealthCheckRecord.getFundus();
|
|
|
switch (function){
|
|
|
case 1:html = html.replace("${fundus}","正常");break;
|
|
|
case 2:html = html.replace("${fundus}","异常");break;
|
|
|
default:html = html.replace("${fundus}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${fundus_abnormal}",null==olderPeopleHealthCheckRecord.getFundus_abnormal()?"":olderPeopleHealthCheckRecord.getFundus_abnormal());
|
|
|
if (null==olderPeopleHealthCheckRecord.getSkin()){
|
|
|
html = html.replace("${skin}"," ");
|
|
|
}else {
|
|
|
Integer skin = olderPeopleHealthCheckRecord.getSkin();
|
|
|
switch (skin){
|
|
|
case 1:html = html.replace("${skin}","正常");break;
|
|
|
case 2:html = html.replace("${skin}","潮红");break;
|
|
|
case 3:html = html.replace("${skin}","苍白");break;
|
|
|
case 4:html = html.replace("${skin}","发钳");break;
|
|
|
case 5:html = html.replace("${skin}","黄染");break;
|
|
|
case 6:html = html.replace("${skin}","色素沉着");break;
|
|
|
case 7:html = html.replace("${skin}","其他");break;
|
|
|
default:html = html.replace("${skin}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${skin_other}",null==olderPeopleHealthCheckRecord.getSkin_other()?"":olderPeopleHealthCheckRecord.getSkin_other());
|
|
|
if (null==olderPeopleHealthCheckRecord.getSclera()){
|
|
|
html = html.replace("${sclera}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getSclera();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${sclera}","正常");break;
|
|
|
case 2:html = html.replace("${sclera}","黄染");break;
|
|
|
case 3:html = html.replace("${sclera}","充血");break;
|
|
|
case 4:html = html.replace("${sclera}","其他");break;
|
|
|
default:html = html.replace("${sclera}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${sclera_other}",null==olderPeopleHealthCheckRecord.getSclera_other()?"":olderPeopleHealthCheckRecord.getSclera_other());
|
|
|
if (null==olderPeopleHealthCheckRecord.getLymphaden()){
|
|
|
html = html.replace("${lymphaden}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getLymphaden();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${lymphaden}","未触及");break;
|
|
|
case 2:html = html.replace("${lymphaden}","锁骨上");break;
|
|
|
case 3:html = html.replace("${lymphaden}","腋窝");break;
|
|
|
case 4:html = html.replace("${lymphaden}","其他");break;
|
|
|
default:html = html.replace("${lymphaden}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${lymphaden_other}",null==olderPeopleHealthCheckRecord.getLymphaden_other()?"":olderPeopleHealthCheckRecord.getLymphaden_other());
|
|
|
if (null==olderPeopleHealthCheckRecord.getBarrel_chest()){
|
|
|
html = html.replace("${barrel_chest}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getBarrel_chest();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${barrel_chest}","否");break;
|
|
|
case 2:html = html.replace("${barrel_chest}","是");break;
|
|
|
default:html = html.replace("${barrel_chest}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if (null==olderPeopleHealthCheckRecord.getBreath_sounds()){
|
|
|
html = html.replace("${breath_sounds}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getBreath_sounds();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${breath_sounds}","正常");break;
|
|
|
case 2:html = html.replace("${breath_sounds}","异常");break;
|
|
|
default:html = html.replace("${breath_sounds}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${breath_sounds_abnormal}",null==olderPeopleHealthCheckRecord.getBreath_sounds_abnormal()?"":olderPeopleHealthCheckRecord.getBreath_sounds_abnormal());
|
|
|
if (null==olderPeopleHealthCheckRecord.getRale()){
|
|
|
html = html.replace("${rale}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getRale();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${rale}","无");break;
|
|
|
case 2:html = html.replace("${rale}","干罗音");break;
|
|
|
case 3:html = html.replace("${rale}","湿罗音");break;
|
|
|
case 4:html = html.replace("${rale}","其他");break;
|
|
|
default:html = html.replace("${rale}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${rale_abnormal}",null==olderPeopleHealthCheckRecord.getRale_abnormal()?"":olderPeopleHealthCheckRecord.getRale_abnormal());
|
|
|
html = html.replace("${heart_rate}",null==olderPeopleHealthCheckRecord.getHeart_rate()?"":olderPeopleHealthCheckRecord.getHeart_rate()+"");
|
|
|
if (null==olderPeopleHealthCheckRecord.getHeart_rhythm()){
|
|
|
html = html.replace("${heart_rhythm}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getHeart_rhythm();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${heart_rhythm}","齐");break;
|
|
|
case 2:html = html.replace("${heart_rhythm}","不齐");break;
|
|
|
case 3:html = html.replace("${heart_rhythm}","绝对不齐");break;
|
|
|
default:html = html.replace("${heart_rhythm}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if (null==olderPeopleHealthCheckRecord.getHeart_noise()){
|
|
|
html = html.replace("${heart_noise}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getHeart_noise();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${heart_noise}","无");break;
|
|
|
case 2:html = html.replace("${heart_noise}","有");break;
|
|
|
default:html = html.replace("${heart_noise}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${heart_noise_has}",null==olderPeopleHealthCheckRecord.getHeart_noise_has()?"":olderPeopleHealthCheckRecord.getHeart_noise_has());
|
|
|
if (null==olderPeopleHealthCheckRecord.getAbdominal_tenderness()){
|
|
|
html = html.replace("${abdominal_tenderness}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getAbdominal_tenderness();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${abdominal_tenderness}","无");break;
|
|
|
case 2:html = html.replace("${abdominal_tenderness}","有");break;
|
|
|
default:html = html.replace("${abdominal_tenderness}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${tenderness_has}",null==olderPeopleHealthCheckRecord.getTenderness_has()?"":olderPeopleHealthCheckRecord.getTenderness_has());
|
|
|
if (null==olderPeopleHealthCheckRecord.getAbdominal_mass()){
|
|
|
html = html.replace("${abdominal_mass}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getAbdominal_mass();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${abdominal_mass}","无");break;
|
|
|
case 2:html = html.replace("${abdominal_mass}","有");break;
|
|
|
default:html = html.replace("${abdominal_mass}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${mass_has}",null==olderPeopleHealthCheckRecord.getMass_has()?"":olderPeopleHealthCheckRecord.getMass_has());
|
|
|
if (null==olderPeopleHealthCheckRecord.getAbdominal_hepatomegaly()){
|
|
|
html = html.replace("${abdominal_hepatomegaly}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getAbdominal_hepatomegaly();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${abdominal_hepatomegaly}","无");break;
|
|
|
case 2:html = html.replace("${abdominal_hepatomegaly}","有");break;
|
|
|
default:html = html.replace("${abdominal_hepatomegaly}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${hepatomegaly_has}",null==olderPeopleHealthCheckRecord.getHepatomegaly_has()?"":olderPeopleHealthCheckRecord.getHepatomegaly_has());
|
|
|
if (null==olderPeopleHealthCheckRecord.getAbdominal_spleen_big()){
|
|
|
html = html.replace("${abdominal_spleen_big}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getAbdominal_spleen_big();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${abdominal_spleen_big}","无");break;
|
|
|
case 2:html = html.replace("${abdominal_spleen_big}","有");break;
|
|
|
default:html = html.replace("${abdominal_spleen_big}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${spleen_big_has}",null==olderPeopleHealthCheckRecord.getSpleen_big_has()?"":olderPeopleHealthCheckRecord.getSpleen_big_has());
|
|
|
if (null==olderPeopleHealthCheckRecord.getAbdominal_shifting_dullness()){
|
|
|
html = html.replace("${abdominal_shifting_dullness}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getAbdominal_shifting_dullness();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${abdominal_shifting_dullness}","无");break;
|
|
|
case 2:html = html.replace("${abdominal_shifting_dullness}","有");break;
|
|
|
default:html = html.replace("${abdominal_shifting_dullness}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${shifting_dullness_has}",null==olderPeopleHealthCheckRecord.getShifting_dullness_has()?"":olderPeopleHealthCheckRecord.getShifting_dullness_has());
|
|
|
if (null==olderPeopleHealthCheckRecord.getCrura_edema()){
|
|
|
html = html.replace("${crura_edema}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getCrura_edema();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${crura_edema}","无");break;
|
|
|
case 2:html = html.replace("${crura_edema}","单侧");break;
|
|
|
case 3:html = html.replace("${crura_edema}","双侧不对称");break;
|
|
|
case 4:html = html.replace("${crura_edema}","双侧对称");break;
|
|
|
default:html = html.replace("${crura_edema}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if (null==olderPeopleHealthCheckRecord.getDorsal_foot_pulse()){
|
|
|
html = html.replace("${dorsal_foot_pulse}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getDorsal_foot_pulse();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${dorsal_foot_pulse}","未接触");break;
|
|
|
case 2:html = html.replace("${dorsal_foot_pulse}","触及双侧对称");break;
|
|
|
case 3:html = html.replace("${dorsal_foot_pulse}","触及左侧弱或消失");break;
|
|
|
case 4:html = html.replace("${dorsal_foot_pulse}","触及右侧弱或消失");break;
|
|
|
default:html = html.replace("${dorsal_foot_pulse}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if (null==olderPeopleHealthCheckRecord.getAnus_dre()){
|
|
|
html = html.replace("${anus_dre}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getAnus_dre();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${anus_dre}","未见异常");break;
|
|
|
case 2:html = html.replace("${anus_dre}","触痛");break;
|
|
|
case 3:html = html.replace("${anus_dre}","包块");break;
|
|
|
case 4:html = html.replace("${anus_dre}","前列腺异常");break;
|
|
|
case 5:html = html.replace("${anus_dre}","其他");break;
|
|
|
default:html = html.replace("${anus_dre}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${anus_dre_other}",null==olderPeopleHealthCheckRecord.getAnus_dre_other()?"":olderPeopleHealthCheckRecord.getAnus_dre_other());
|
|
|
if (null==olderPeopleHealthCheckRecord.getBreast()){
|
|
|
html = html.replace("${breast}"," ");
|
|
|
}else {
|
|
|
String smokingState = olderPeopleHealthCheckRecord.getBreast();
|
|
|
String[] smokingStates = smokingState.split(",");
|
|
|
String valueStrTmp = " ";
|
|
|
for (String tmp:smokingStates){
|
|
|
switch (tmp){
|
|
|
case "1":valueStrTmp+="未见异常 ";break;
|
|
|
case "2":valueStrTmp+="乳房切除 ";break;
|
|
|
case "3":valueStrTmp+="异常泌乳 ";break;
|
|
|
case "4":valueStrTmp+="乳腺包块 ";break;
|
|
|
case "5":valueStrTmp+="其他 ";break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${breast}",valueStrTmp);
|
|
|
}
|
|
|
html = html.replace("${breast_other}",null==olderPeopleHealthCheckRecord.getBreast_other()?"":olderPeopleHealthCheckRecord.getBreast_other());
|
|
|
if (null==olderPeopleHealthCheckRecord.getVulva()){
|
|
|
html = html.replace("${vulva}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getVulva();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${vulva}","未见异常");break;
|
|
|
case 2:html = html.replace("${vulva}","异常");break;
|
|
|
default:html = html.replace("${vulva}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${vulva_abnormal}",null==olderPeopleHealthCheckRecord.getVulva_abnormal()?"":olderPeopleHealthCheckRecord.getVulva_abnormal());
|
|
|
if (null==olderPeopleHealthCheckRecord.getVagina()){
|
|
|
html = html.replace("${vagina}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getVagina();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${vagina}","未见异常");break;
|
|
|
case 2:html = html.replace("${vagina}","异常");break;
|
|
|
default:html = html.replace("${vagina}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${vagina_abnormal}",null==olderPeopleHealthCheckRecord.getVagina_abnormal()?"":olderPeopleHealthCheckRecord.getVagina_abnormal());
|
|
|
if (null==olderPeopleHealthCheckRecord.getCervical()){
|
|
|
html = html.replace("${cervical}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getCervical();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${cervical}","未见异常");break;
|
|
|
case 2:html = html.replace("${cervical}","异常");break;
|
|
|
default:html = html.replace("${cervical}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${cervical_abnormal}",null==olderPeopleHealthCheckRecord.getCervical_abnormal()?"":olderPeopleHealthCheckRecord.getCervical_abnormal());
|
|
|
if (null==olderPeopleHealthCheckRecord.getCorpus()){
|
|
|
html = html.replace("${corpus}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getCorpus();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${corpus}","未见异常");break;
|
|
|
case 2:html = html.replace("${corpus}","异常");break;
|
|
|
default:html = html.replace("${corpus}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${corpus_abnormal}",null==olderPeopleHealthCheckRecord.getCorpus_abnormal()?"":olderPeopleHealthCheckRecord.getCorpus_abnormal());
|
|
|
if (null==olderPeopleHealthCheckRecord.getGynecologic_appendix()){
|
|
|
html = html.replace("${gynecologic_appendix}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getGynecologic_appendix();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${gynecologic_appendix}","未见异常");break;
|
|
|
case 2:html = html.replace("${gynecologic_appendix}","异常");break;
|
|
|
default:html = html.replace("${gynecologic_appendix}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${appendix_abnormal}",null==olderPeopleHealthCheckRecord.getAppendix_abnormal()?"":olderPeopleHealthCheckRecord.getAppendix_abnormal());
|
|
|
html = html.replace("${physical_examination_other}",null==olderPeopleHealthCheckRecord.getPhysical_examination_other()?"":olderPeopleHealthCheckRecord.getPhysical_examination_other());
|
|
|
html = html.replace("${hemoglobin}",null==olderPeopleHealthCheckRecord.getHemoglobin()?"":olderPeopleHealthCheckRecord.getHemoglobin()+"");
|
|
|
html = html.replace("${leukocyte}",null==olderPeopleHealthCheckRecord.getLeukocyte()?"":olderPeopleHealthCheckRecord.getLeukocyte()+"");
|
|
|
html = html.replace("${thrombocyte}",null==olderPeopleHealthCheckRecord.getThrombocyte()?"":olderPeopleHealthCheckRecord.getThrombocyte()+"");
|
|
|
html = html.replace("${blood_routine_other}",null==olderPeopleHealthCheckRecord.getBlood_routine_other()?"":olderPeopleHealthCheckRecord.getBlood_routine_other()+"");
|
|
|
html = html.replace("${urine_protein}",null==olderPeopleHealthCheckRecord.getUrine_protein()?"":olderPeopleHealthCheckRecord.getUrine_protein()+"");
|
|
|
html = html.replace("${urine_sugar}",null==olderPeopleHealthCheckRecord.getUrine_sugar()?"":olderPeopleHealthCheckRecord.getUrine_sugar()+"");
|
|
|
html = html.replace("${urine_acetone_bodies}",null==olderPeopleHealthCheckRecord.getUrine_acetone_bodies()?"":olderPeopleHealthCheckRecord.getUrine_acetone_bodies()+"");
|
|
|
html = html.replace("${urine_occult_blood}",null==olderPeopleHealthCheckRecord.getUrine_occult_blood()?"":olderPeopleHealthCheckRecord.getUrine_occult_blood()+"");
|
|
|
html = html.replace("${urine_routine_other}",null==olderPeopleHealthCheckRecord.getUrine_routine_other()?"":olderPeopleHealthCheckRecord.getUrine_routine_other()+"");
|
|
|
html = html.replace("${fasting_blood_glucose_L}",null==olderPeopleHealthCheckRecord.getFasting_blood_glucose_L()?"":olderPeopleHealthCheckRecord.getFasting_blood_glucose_L()+"");
|
|
|
html = html.replace("${fasting_blood_glucose_dL}",null==olderPeopleHealthCheckRecord.getFasting_blood_glucose_dL()?"":olderPeopleHealthCheckRecord.getFasting_blood_glucose_dL()+"");
|
|
|
if (null==olderPeopleHealthCheckRecord.getElectrocardiogram()){
|
|
|
html = html.replace("${electrocardiogram}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getElectrocardiogram();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${electrocardiogram}","正常");break;
|
|
|
case 2:html = html.replace("${electrocardiogram}","异常");break;
|
|
|
default:html = html.replace("${electrocardiogram}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${electrocardiogram_abnormal}",null==olderPeopleHealthCheckRecord.getElectrocardiogram_abnormal()?"":olderPeopleHealthCheckRecord.getElectrocardiogram_abnormal()+"");
|
|
|
html = html.replace("${microalbuminuria}",null==olderPeopleHealthCheckRecord.getMicroalbuminuria()?"":olderPeopleHealthCheckRecord.getMicroalbuminuria()+"");
|
|
|
if(null==olderPeopleHealthCheckRecord.getOccult_blood_in_stool()){
|
|
|
html = html.replace("${occult_blood_in_stool}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getOccult_blood_in_stool();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${occult_blood_in_stool}","阴性");break;
|
|
|
case 2:html = html.replace("${occult_blood_in_stool}","阳性");break;
|
|
|
default:html = html.replace("${occult_blood_in_stool}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${glycated_hemoglobin}",null==olderPeopleHealthCheckRecord.getGlycated_hemoglobin()?"":olderPeopleHealthCheckRecord.getGlycated_hemoglobin()+"");
|
|
|
if(null==olderPeopleHealthCheckRecord.getHBsAg()){
|
|
|
html = html.replace("${HBsAg}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getHBsAg();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${HBsAg}","阴性");break;
|
|
|
case 2:html = html.replace("${HBsAg}","阳性");break;
|
|
|
default:html = html.replace("${HBsAg}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${ALT}",null==olderPeopleHealthCheckRecord.getALT()?"":olderPeopleHealthCheckRecord.getALT()+"");
|
|
|
html = html.replace("${SGOT}",null==olderPeopleHealthCheckRecord.getSGOT()?"":olderPeopleHealthCheckRecord.getSGOT()+"");
|
|
|
html = html.replace("${albumin}",null==olderPeopleHealthCheckRecord.getAlbumin()?"":olderPeopleHealthCheckRecord.getAlbumin()+"");
|
|
|
html = html.replace("${total_bilirubin}",null==olderPeopleHealthCheckRecord.getTotal_bilirubin()?"":olderPeopleHealthCheckRecord.getTotal_bilirubin()+"");
|
|
|
html = html.replace("${conjugated_bilirubin}",null==olderPeopleHealthCheckRecord.getConjugated_bilirubin()?"":olderPeopleHealthCheckRecord.getConjugated_bilirubin()+"");
|
|
|
html = html.replace("${serum_creatinine}",null==olderPeopleHealthCheckRecord.getConjugated_bilirubin()?"":olderPeopleHealthCheckRecord.getConjugated_bilirubin()+"");
|
|
|
html = html.replace("${blood_urea_nitrogen}",null==olderPeopleHealthCheckRecord.getBlood_urea_nitrogen()?"":olderPeopleHealthCheckRecord.getBlood_urea_nitrogen()+"");
|
|
|
html = html.replace("${blood_potassium_concentration}",null==olderPeopleHealthCheckRecord.getBlood_potassium_concentration()?"":olderPeopleHealthCheckRecord.getBlood_potassium_concentration()+"");
|
|
|
html = html.replace("${blood_Na_concentration}",null==olderPeopleHealthCheckRecord.getBlood_Na_concentration()?"":olderPeopleHealthCheckRecord.getBlood_Na_concentration()+"");
|
|
|
html = html.replace("${uric_acid}",null==olderPeopleHealthCheckRecord.getUric_acid()?"":olderPeopleHealthCheckRecord.getUric_acid()+"");
|
|
|
html = html.replace("${total_cholesterol}",null==olderPeopleHealthCheckRecord.getTotal_cholesterol()?"":olderPeopleHealthCheckRecord.getTotal_cholesterol()+"");
|
|
|
html = html.replace("${triglyceride}",null==olderPeopleHealthCheckRecord.getTriglyceride()?"":olderPeopleHealthCheckRecord.getTriglyceride()+"");
|
|
|
html = html.replace("${LDL_cholesterol}",null==olderPeopleHealthCheckRecord.getLDL_cholesterol()?"":olderPeopleHealthCheckRecord.getLDL_cholesterol()+"");
|
|
|
html = html.replace("${HDL_cholesterol}",null==olderPeopleHealthCheckRecord.getHDL_cholesterol()?"":olderPeopleHealthCheckRecord.getHDL_cholesterol()+"");
|
|
|
html = html.replace("${alpha_fetal_protein}",null==olderPeopleHealthCheckRecord.getAlpha_fetal_protein()?"":olderPeopleHealthCheckRecord.getAlpha_fetal_protein()+"");
|
|
|
if(null==olderPeopleHealthCheckRecord.getChest_Xray()){
|
|
|
html = html.replace("${chest_Xray}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getChest_Xray();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${chest_Xray}","正常");break;
|
|
|
case 2:html = html.replace("${chest_Xray}","异常");break;
|
|
|
default:html = html.replace("${chest_Xray}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${chest_Xray_abnormal}",null==olderPeopleHealthCheckRecord.getChest_Xray_abnormal()?"":olderPeopleHealthCheckRecord.getChest_Xray_abnormal());
|
|
|
if(null==olderPeopleHealthCheckRecord.getAbdomen_B_ultrasonic()){
|
|
|
html = html.replace("${abdomen_B_ultrasonic}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getAbdomen_B_ultrasonic();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${abdomen_B_ultrasonic}","正常");break;
|
|
|
case 2:html = html.replace("${abdomen_B_ultrasonic}","异常");break;
|
|
|
default:html = html.replace("${abdomen_B_ultrasonic}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${abdomen_B_ultrasonic_abnormal}",null==olderPeopleHealthCheckRecord.getAbdomen_B_ultrasonic_abnormal()?"":olderPeopleHealthCheckRecord.getAbdomen_B_ultrasonic_abnormal());
|
|
|
if(null==olderPeopleHealthCheckRecord.getB_ultrasonic_other()){
|
|
|
html = html.replace("${B_ultrasonic_other}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getB_ultrasonic_other();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${B_ultrasonic_other}","正常");break;
|
|
|
case 2:html = html.replace("${B_ultrasonic_other}","异常");break;
|
|
|
default:html = html.replace("${B_ultrasonic_other}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${B_ultrasonic_other_abnormal}",null==olderPeopleHealthCheckRecord.getB_ultrasonic_other_abnormal()?"":olderPeopleHealthCheckRecord.getB_ultrasonic_other_abnormal());
|
|
|
if(null==olderPeopleHealthCheckRecord.getCervical_smear()){
|
|
|
html = html.replace("${cervical_smear}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getCervical_smear();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${cervical_smear}","正常");break;
|
|
|
case 2:html = html.replace("${cervical_smear}","异常");break;
|
|
|
default:html = html.replace("${cervical_smear}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${cervical_smear_abnormal}",null==olderPeopleHealthCheckRecord.getCervical_smear_abnormal()?"":olderPeopleHealthCheckRecord.getCervical_smear_abnormal());
|
|
|
html = html.replace("${auxiliary_examination_other}",null==olderPeopleHealthCheckRecord.getAuxiliary_examination_other()?"":olderPeopleHealthCheckRecord.getAuxiliary_examination_other());
|
|
|
if(null==olderPeopleHealthCheckRecord.getMild_physical()){
|
|
|
html = html.replace("${mild_physical}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getMild_physical();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${mild_physical}","是");break;
|
|
|
case 2:html = html.replace("${mild_physical}","倾向是");break;
|
|
|
default:html = html.replace("${mild_physical}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getQi_deficiency()){
|
|
|
html = html.replace("${qi_deficiency}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getQi_deficiency();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${qi_deficiency}","是");break;
|
|
|
case 2:html = html.replace("${qi_deficiency}","基本是");break;
|
|
|
default:html = html.replace("${qi_deficiency}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getYang_deficiency()){
|
|
|
html = html.replace("${yang_deficiency}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getYang_deficiency();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${yang_deficiency}","是");break;
|
|
|
case 2:html = html.replace("${yang_deficiency}","基本是");break;
|
|
|
default:html = html.replace("${yang_deficiency}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getYin_deficiency()){
|
|
|
html = html.replace("${yin_deficiency}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getYin_deficiency();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${yin_deficiency}","是");break;
|
|
|
case 2:html = html.replace("${yin_deficiency}","基本是");break;
|
|
|
default:html = html.replace("${yin_deficiency}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getPhlegm_dampness()){
|
|
|
html = html.replace("${phlegm_dampness}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getPhlegm_dampness();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${phlegm_dampness}","是");break;
|
|
|
case 2:html = html.replace("${phlegm_dampness}","基本是");break;
|
|
|
default:html = html.replace("${phlegm_dampness}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getDampness_heat()){
|
|
|
html = html.replace("${dampness_heat}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getDampness_heat();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${dampness_heat}","是");break;
|
|
|
case 2:html = html.replace("${dampness_heat}","基本是");break;
|
|
|
default:html = html.replace("${dampness_heat}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getBlood_stasis()){
|
|
|
html = html.replace("${blood_stasis}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getBlood_stasis();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${blood_stasis}","是");break;
|
|
|
case 2:html = html.replace("${blood_stasis}","基本是");break;
|
|
|
default:html = html.replace("${blood_stasis}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getLogistic_regression()){
|
|
|
html = html.replace("${logistic_regression}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getLogistic_regression();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${logistic_regression}","是");break;
|
|
|
case 2:html = html.replace("${logistic_regression}","基本是");break;
|
|
|
default:html = html.replace("${logistic_regression}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getGrasp_quality()){
|
|
|
html = html.replace("${grasp_quality}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getGrasp_quality();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${grasp_quality}","是");break;
|
|
|
case 2:html = html.replace("${grasp_quality}","基本是");break;
|
|
|
default:html = html.replace("${grasp_quality}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getCerebrovascular_disease()){
|
|
|
html = html.replace("${cerebrovascular_disease}"," ");
|
|
|
}else {
|
|
|
String smokingState = olderPeopleHealthCheckRecord.getCerebrovascular_disease();
|
|
|
String[] smokingStates = smokingState.split(",");
|
|
|
String valueStrTmp = " ";
|
|
|
for (String tmp:smokingStates){
|
|
|
switch (tmp){
|
|
|
case "1":valueStrTmp+="未发现 ";break;
|
|
|
case "2":valueStrTmp+="缺血性卒中 ";break;
|
|
|
case "3":valueStrTmp+="脑出血 ";break;
|
|
|
case "4":valueStrTmp+="蛛网膜下腔出血 ";break;
|
|
|
case "5":valueStrTmp+="短暂性脑缺血发作 ";break;
|
|
|
case "6":valueStrTmp+="其他 ";break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${cerebrovascular_disease}",valueStrTmp);
|
|
|
}
|
|
|
html = html.replace("${cerebrovascular_disease_other}",null==olderPeopleHealthCheckRecord.getCerebrovascular_disease_other()?"":olderPeopleHealthCheckRecord.getCerebrovascular_disease_other());
|
|
|
if(null==olderPeopleHealthCheckRecord.getNephropathy()){
|
|
|
html = html.replace("${nephropathy}"," ");
|
|
|
}else {
|
|
|
String smokingState = olderPeopleHealthCheckRecord.getNephropathy();
|
|
|
String[] smokingStates = smokingState.split(",");
|
|
|
String valueStrTmp = " ";
|
|
|
for (String tmp:smokingStates){
|
|
|
switch (tmp){
|
|
|
case "1":valueStrTmp+="未发现 ";break;
|
|
|
case "2":valueStrTmp+="糖尿病肾病 ";break;
|
|
|
case "3":valueStrTmp+="肾功能衰竭 ";break;
|
|
|
case "4":valueStrTmp+="急性肾炎 ";break;
|
|
|
case "5":valueStrTmp+="慢性肾炎 ";break;
|
|
|
case "6":valueStrTmp+="其他 ";break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${nephropathy}",valueStrTmp);
|
|
|
|
|
|
}
|
|
|
html = html.replace("${nephropathy_other}",null==olderPeopleHealthCheckRecord.getNephropathy_other()?"":olderPeopleHealthCheckRecord.getNephropathy_other());
|
|
|
if(null==olderPeopleHealthCheckRecord.getHeart_disease()){
|
|
|
html = html.replace("${heart_disease}"," ");
|
|
|
}else {
|
|
|
String smokingState = olderPeopleHealthCheckRecord.getHeart_disease();
|
|
|
String[] smokingStates = smokingState.split(",");
|
|
|
String valueStrTmp = " ";
|
|
|
for (String tmp:smokingStates){
|
|
|
switch (tmp){
|
|
|
case "1":valueStrTmp+="未发现 ";break;
|
|
|
case "2":valueStrTmp+="心肌梗死 ";break;
|
|
|
case "3":valueStrTmp+="心绞痛 ";break;
|
|
|
case "4":valueStrTmp+="冠状动脉血运重建 ";break;
|
|
|
case "5":valueStrTmp+="充血性心力衰竭 ";break;
|
|
|
case "6":valueStrTmp+="心前区疼痛 ";break;
|
|
|
case "7":valueStrTmp+="其他 ";break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${heart_disease}",valueStrTmp);
|
|
|
}
|
|
|
html = html.replace("${heart_disease_other}",null==olderPeopleHealthCheckRecord.getHeart_disease_other()?"":olderPeopleHealthCheckRecord.getHeart_disease_other());
|
|
|
if(null==olderPeopleHealthCheckRecord.getVascular_disease()){
|
|
|
html = html.replace("${vascular_disease}"," ");
|
|
|
}else {
|
|
|
String smokingState = olderPeopleHealthCheckRecord.getVascular_disease();
|
|
|
String[] smokingStates = smokingState.split(",");
|
|
|
String valueStrTmp = " ";
|
|
|
for (String tmp:smokingStates){
|
|
|
switch (tmp){
|
|
|
case "1":valueStrTmp+="未发现 ";break;
|
|
|
case "2":valueStrTmp+="夹层动脉瘤 ";break;
|
|
|
case "3":valueStrTmp+="动脉闭塞性疾病 ";break;
|
|
|
case "4":valueStrTmp+="其他 ";break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${vascular_disease}",valueStrTmp);
|
|
|
|
|
|
}
|
|
|
html = html.replace("${vascular_disease_other}",null==olderPeopleHealthCheckRecord.getVascular_disease_other()?"":olderPeopleHealthCheckRecord.getVascular_disease_other());
|
|
|
if(null==olderPeopleHealthCheckRecord.getEye_disease()){
|
|
|
html = html.replace("${eye_disease}"," ");
|
|
|
}else {
|
|
|
String smokingState = olderPeopleHealthCheckRecord.getEye_disease();
|
|
|
String[] smokingStates = smokingState.split(",");
|
|
|
String valueStrTmp = " ";
|
|
|
for (String tmp:smokingStates){
|
|
|
switch (tmp){
|
|
|
case "1":valueStrTmp+="未发现 ";break;
|
|
|
case "2":valueStrTmp+="视网膜出血或渗出 ";break;
|
|
|
case "3":valueStrTmp+="视乳头水肿 ";break;
|
|
|
case "4":valueStrTmp+="白内障 ";break;
|
|
|
case "5":valueStrTmp+="其他 ";break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${eye_disease}",valueStrTmp);
|
|
|
|
|
|
}
|
|
|
html = html.replace("${eye_disease_other}",null==olderPeopleHealthCheckRecord.getEye_disease_other()?"":olderPeopleHealthCheckRecord.getEye_disease_other());
|
|
|
if(null==olderPeopleHealthCheckRecord.getNervous_system_disease()){
|
|
|
html = html.replace("${nervous_system_disease}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getNervous_system_disease();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${nervous_system_disease}","未发现");break;
|
|
|
case 2:html = html.replace("${nervous_system_disease}","有");break;
|
|
|
default:html = html.replace("${nervous_system_disease}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${nervous_system_disease_has}",null==olderPeopleHealthCheckRecord.getNervous_system_disease_has()?"":olderPeopleHealthCheckRecord.getNervous_system_disease_has());
|
|
|
if(null==olderPeopleHealthCheckRecord.getOther_system_disease()){
|
|
|
html = html.replace("${other_system_disease}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getOther_system_disease();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${other_system_disease}","未发现");break;
|
|
|
case 2:html = html.replace("${other_system_disease}","有");break;
|
|
|
default:html = html.replace("${other_system_disease}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${other_system_disease_has}",null==olderPeopleHealthCheckRecord.getOther_system_disease_has()?"":olderPeopleHealthCheckRecord.getOther_system_disease_has());
|
|
|
html = html.replace("${admission_date1}",null==olderPeopleHealthCheckRecord.getAdmission_date1()?"":DateUtil.dateToStrShort(olderPeopleHealthCheckRecord.getAdmission_date1()));
|
|
|
html = html.replace("${admission_date2}",null==olderPeopleHealthCheckRecord.getAdmission_date2()?"":DateUtil.dateToStrShort(olderPeopleHealthCheckRecord.getAdmission_date2()));
|
|
|
html = html.replace("${discharge_date1}",null==olderPeopleHealthCheckRecord.getDischarge_date1()?"":DateUtil.dateToStrShort(olderPeopleHealthCheckRecord.getDischarge_date1()));
|
|
|
html = html.replace("${discharge_date2}",null==olderPeopleHealthCheckRecord.getDischarge_date2()?"":DateUtil.dateToStrShort(olderPeopleHealthCheckRecord.getDischarge_date2()));
|
|
|
html = html.replace("${admission_reason1}",null==olderPeopleHealthCheckRecord.getAdmission_reason1()?"":olderPeopleHealthCheckRecord.getAdmission_reason1());
|
|
|
html = html.replace("${admission_reason2}",null==olderPeopleHealthCheckRecord.getAdmission_reason2()?"":olderPeopleHealthCheckRecord.getAdmission_reason2());
|
|
|
html = html.replace("${admission_hospital_name1}",null==olderPeopleHealthCheckRecord.getAdmission_hospital_name1()?"":olderPeopleHealthCheckRecord.getAdmission_hospital_name1());
|
|
|
html = html.replace("${admission_hospital_name2}",null==olderPeopleHealthCheckRecord.getAdmission_hospital_name2()?"":olderPeopleHealthCheckRecord.getAdmission_hospital_name2());
|
|
|
html = html.replace("${admission_number1}",null==olderPeopleHealthCheckRecord.getAdmission_number1()?"":olderPeopleHealthCheckRecord.getAdmission_number1());
|
|
|
html = html.replace("${admission_number2}",null==olderPeopleHealthCheckRecord.getAdmission_number2()?"":olderPeopleHealthCheckRecord.getAdmission_number2());
|
|
|
html = html.replace("${building_bed_date1}",null==olderPeopleHealthCheckRecord.getBuilding_bed_date1()?"":DateUtil.dateToStrShort(olderPeopleHealthCheckRecord.getBuilding_bed_date1()));
|
|
|
html = html.replace("${building_bed_date2}",null==olderPeopleHealthCheckRecord.getBuilding_bed_date2()?"":DateUtil.dateToStrShort(olderPeopleHealthCheckRecord.getBuilding_bed_date2()));
|
|
|
html = html.replace("${cancel_bed_date1}",null==olderPeopleHealthCheckRecord.getCancel_bed_date1()?"":DateUtil.dateToStrShort(olderPeopleHealthCheckRecord.getCancel_bed_date1()));
|
|
|
html = html.replace("${cancel_bed_date2}",null==olderPeopleHealthCheckRecord.getCancel_bed_date2()?"":DateUtil.dateToStrShort(olderPeopleHealthCheckRecord.getCancel_bed_date2()));
|
|
|
html = html.replace("${building_bed_reason1}",null==olderPeopleHealthCheckRecord.getBuilding_bed_reason1()?"":olderPeopleHealthCheckRecord.getBuilding_bed_reason1());
|
|
|
html = html.replace("${building_bed_reason2}",null==olderPeopleHealthCheckRecord.getBuilding_bed_reason2()?"":olderPeopleHealthCheckRecord.getBuilding_bed_reason2());
|
|
|
html = html.replace("${building_bed_hospiatl_name1}",null==olderPeopleHealthCheckRecord.getBuilding_bed_hospiatl_name1()?"":olderPeopleHealthCheckRecord.getBuilding_bed_hospiatl_name1());
|
|
|
html = html.replace("${building_bed_hospiatl_name2}",null==olderPeopleHealthCheckRecord.getBuilding_bed_hospiatl_name2()?"":olderPeopleHealthCheckRecord.getBuilding_bed_hospiatl_name2());
|
|
|
html = html.replace("${building_bed_number1}",null==olderPeopleHealthCheckRecord.getBuilding_bed_number1()?"":olderPeopleHealthCheckRecord.getBuilding_bed_number1());
|
|
|
html = html.replace("${building_bed_number2}",null==olderPeopleHealthCheckRecord.getBuilding_bed_number2()?"":olderPeopleHealthCheckRecord.getBuilding_bed_number2());
|
|
|
html = html.replace("${medicine1}",null==olderPeopleHealthCheckRecord.getMedicine1()?"":olderPeopleHealthCheckRecord.getMedicine1());
|
|
|
html = html.replace("${medicine2}",null==olderPeopleHealthCheckRecord.getMedicine2()?"":olderPeopleHealthCheckRecord.getMedicine2());
|
|
|
html = html.replace("${medicine3}",null==olderPeopleHealthCheckRecord.getMedicine3()?"":olderPeopleHealthCheckRecord.getMedicine3());
|
|
|
html = html.replace("${medicine4}",null==olderPeopleHealthCheckRecord.getMedicine4()?"":olderPeopleHealthCheckRecord.getMedicine4());
|
|
|
html = html.replace("${medicine5}",null==olderPeopleHealthCheckRecord.getMedicine5()?"":olderPeopleHealthCheckRecord.getMedicine5());
|
|
|
html = html.replace("${medicine6}",null==olderPeopleHealthCheckRecord.getMedicine6()?"":olderPeopleHealthCheckRecord.getMedicine6());
|
|
|
html = html.replace("${medicine1_use}",null==olderPeopleHealthCheckRecord.getMedicine1_use()?"":olderPeopleHealthCheckRecord.getMedicine1_use());
|
|
|
html = html.replace("${medicine2_use}",null==olderPeopleHealthCheckRecord.getMedicine2_use()?"":olderPeopleHealthCheckRecord.getMedicine2_use());
|
|
|
html = html.replace("${medicine3_use}",null==olderPeopleHealthCheckRecord.getMedicine3_use()?"":olderPeopleHealthCheckRecord.getMedicine3_use());
|
|
|
html = html.replace("${medicine4_use}",null==olderPeopleHealthCheckRecord.getMedicine4_use()?"":olderPeopleHealthCheckRecord.getMedicine4_use());
|
|
|
html = html.replace("${medicine5_use}",null==olderPeopleHealthCheckRecord.getMedicine5_use()?"":olderPeopleHealthCheckRecord.getMedicine5_use());
|
|
|
html = html.replace("${medicine6_use}",null==olderPeopleHealthCheckRecord.getMedicine6_use()?"":olderPeopleHealthCheckRecord.getMedicine6_use());
|
|
|
html = html.replace("${medicine1_dosage}",null==olderPeopleHealthCheckRecord.getMedicine1_dosage()?"":olderPeopleHealthCheckRecord.getMedicine1_dosage());
|
|
|
html = html.replace("${medicine2_dosage}",null==olderPeopleHealthCheckRecord.getMedicine2_dosage()?"":olderPeopleHealthCheckRecord.getMedicine2_dosage());
|
|
|
html = html.replace("${medicine3_dosage}",null==olderPeopleHealthCheckRecord.getMedicine3_dosage()?"":olderPeopleHealthCheckRecord.getMedicine3_dosage());
|
|
|
html = html.replace("${medicine4_dosage}",null==olderPeopleHealthCheckRecord.getMedicine4_dosage()?"":olderPeopleHealthCheckRecord.getMedicine4_dosage());
|
|
|
html = html.replace("${medicine5_dosage}",null==olderPeopleHealthCheckRecord.getMedicine5_dosage()?"":olderPeopleHealthCheckRecord.getMedicine5_dosage());
|
|
|
html = html.replace("${medicine6_dosage}",null==olderPeopleHealthCheckRecord.getMedicine6_dosage()?"":olderPeopleHealthCheckRecord.getMedicine6_dosage());
|
|
|
html = html.replace("${medication1_time}",null==olderPeopleHealthCheckRecord.getMedication1_time()?"":olderPeopleHealthCheckRecord.getMedication1_time());
|
|
|
html = html.replace("${medication2_time}",null==olderPeopleHealthCheckRecord.getMedication2_time()?"":olderPeopleHealthCheckRecord.getMedication2_time());
|
|
|
html = html.replace("${medication3_time}",null==olderPeopleHealthCheckRecord.getMedication3_time()?"":olderPeopleHealthCheckRecord.getMedication3_time());
|
|
|
html = html.replace("${medication4_time}",null==olderPeopleHealthCheckRecord.getMedication4_time()?"":olderPeopleHealthCheckRecord.getMedication4_time());
|
|
|
html = html.replace("${medication5_time}",null==olderPeopleHealthCheckRecord.getMedication5_time()?"":olderPeopleHealthCheckRecord.getMedication5_time());
|
|
|
html = html.replace("${medication6_time}",null==olderPeopleHealthCheckRecord.getMedication6_time()?"":olderPeopleHealthCheckRecord.getMedication6_time());
|
|
|
if(null==olderPeopleHealthCheckRecord.getMedication1_compliance()){
|
|
|
html = html.replace("${medication1_compliance}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getMedication1_compliance();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${medication1_compliance}","规律");break;
|
|
|
case 2:html = html.replace("${medication1_compliance}","间断");break;
|
|
|
case 3:html = html.replace("${medication1_compliance}","不服药");break;
|
|
|
default:html = html.replace("${medication1_compliance}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getMedication2_compliance()){
|
|
|
html = html.replace("${medication2_compliance}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getMedication2_compliance();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${medication2_compliance}","规律");break;
|
|
|
case 2:html = html.replace("${medication2_compliance}","间断");break;
|
|
|
case 3:html = html.replace("${medication2_compliance}","不服药");break;
|
|
|
default:html = html.replace("${medication2_compliance}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getMedication3_compliance()){
|
|
|
html = html.replace("${medication3_compliance}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getMedication3_compliance();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${medication3_compliance}","规律");break;
|
|
|
case 2:html = html.replace("${medication3_compliance}","间断");break;
|
|
|
case 3:html = html.replace("${medication3_compliance}","不服药");break;
|
|
|
default:html = html.replace("${medication3_compliance}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getMedication4_compliance()){
|
|
|
html = html.replace("${medication4_compliance}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getMedication4_compliance();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${medication4_compliance}","规律");break;
|
|
|
case 2:html = html.replace("${medication4_compliance}","间断");break;
|
|
|
case 3:html = html.replace("${medication4_compliance}","不服药");break;
|
|
|
default:html = html.replace("${medication4_compliance}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getMedication5_compliance()){
|
|
|
html = html.replace("${medication5_compliance}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getMedication5_compliance();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${medication5_compliance}","规律");break;
|
|
|
case 2:html = html.replace("${medication5_compliance}","间断");break;
|
|
|
case 3:html = html.replace("${medication5_compliance}","不服药");break;
|
|
|
default:html = html.replace("${medication5_compliance}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getMedication6_compliance()){
|
|
|
html = html.replace("${medication6_compliance}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getMedication6_compliance();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${medication6_compliance}","规律");break;
|
|
|
case 2:html = html.replace("${medication6_compliance}","间断");break;
|
|
|
case 3:html = html.replace("${medication6_compliance}","不服药");break;
|
|
|
default:html = html.replace("${medication6_compliance}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${vaccination_name1}",null==olderPeopleHealthCheckRecord.getVaccination_name1()?"":olderPeopleHealthCheckRecord.getVaccination_name1());
|
|
|
html = html.replace("${vaccination_name2}",null==olderPeopleHealthCheckRecord.getVaccination_name2()?"":olderPeopleHealthCheckRecord.getVaccination_name2());
|
|
|
html = html.replace("${vaccination_name3}",null==olderPeopleHealthCheckRecord.getVaccination_name3()?"":olderPeopleHealthCheckRecord.getVaccination_name3());
|
|
|
html = html.replace("${vaccination_date1}",null==olderPeopleHealthCheckRecord.getVaccination_date1()?"":DateUtil.dateToStrShort(olderPeopleHealthCheckRecord.getVaccination_date1()));
|
|
|
html = html.replace("${vaccination_date2}",null==olderPeopleHealthCheckRecord.getVaccination_date2()?"":DateUtil.dateToStrShort(olderPeopleHealthCheckRecord.getVaccination_date2()));
|
|
|
html = html.replace("${vaccination_date3}",null==olderPeopleHealthCheckRecord.getVaccination_date3()?"":DateUtil.dateToStrShort(olderPeopleHealthCheckRecord.getVaccination_date3()));
|
|
|
html = html.replace("${vaccination_hospital_name1}",null==olderPeopleHealthCheckRecord.getVaccination_hospital_name1()?"":olderPeopleHealthCheckRecord.getVaccination_hospital_name1());
|
|
|
html = html.replace("${vaccination_hospital_name2}",null==olderPeopleHealthCheckRecord.getVaccination_hospital_name2()?"":olderPeopleHealthCheckRecord.getVaccination_hospital_name2());
|
|
|
html = html.replace("${vaccination_hospital_name3}",null==olderPeopleHealthCheckRecord.getVaccination_hospital_name3()?"":olderPeopleHealthCheckRecord.getVaccination_hospital_name3());
|
|
|
if(null==olderPeopleHealthCheckRecord.getHealth_examination()){
|
|
|
html = html.replace("${health_examination}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getHealth_examination();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${health_examination}","无");break;
|
|
|
case 2:html = html.replace("${health_examination}","有异常");break;
|
|
|
default:html = html.replace("${health_examination}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${health_examination_abnormal1}",null==olderPeopleHealthCheckRecord.getHealth_examination_abnormal1()?"":olderPeopleHealthCheckRecord.getHealth_examination_abnormal1());
|
|
|
html = html.replace("${health_examination_abnormal2}",null==olderPeopleHealthCheckRecord.getHealth_examination_abnormal2()?"":olderPeopleHealthCheckRecord.getHealth_examination_abnormal2());
|
|
|
html = html.replace("${health_examination_abnormal3}",null==olderPeopleHealthCheckRecord.getHealth_examination_abnormal3()?"":olderPeopleHealthCheckRecord.getHealth_examination_abnormal3());
|
|
|
html = html.replace("${health_examination_abnormal4}",null==olderPeopleHealthCheckRecord.getHealth_examination_abnormal4()?"":olderPeopleHealthCheckRecord.getHealth_examination_abnormal4());
|
|
|
if(null==olderPeopleHealthCheckRecord.getRegular_followup()){
|
|
|
html = html.replace("${regular_followup}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getRegular_followup();
|
|
|
switch (sclera){
|
|
|
case 2:html = html.replace("${regular_followup}","定期随访:是");break;
|
|
|
default:html = html.replace("${regular_followup}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getChronic_health_management()){
|
|
|
html = html.replace("${chronic_health_management}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getChronic_health_management();
|
|
|
switch (sclera){
|
|
|
case 2:html = html.replace("${chronic_health_management}","纳入慢性病患者健康管理:是");break;
|
|
|
default:html = html.replace("${chronic_health_management}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getSuggest_recheck()){
|
|
|
html = html.replace("${suggest_recheck}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getSuggest_recheck();
|
|
|
switch (sclera){
|
|
|
case 2:html = html.replace("${suggest_recheck}","建议复查:是");break;
|
|
|
default:html = html.replace("${suggest_recheck}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getSuggest_referral()){
|
|
|
html = html.replace("${suggest_referral}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getSuggest_referral();
|
|
|
switch (sclera){
|
|
|
case 2:html = html.replace("${suggest_referral}","建议转诊:是");break;
|
|
|
default:html = html.replace("${suggest_referral}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getOther_health_guidance()){
|
|
|
html = html.replace("${other_health_guidance}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getOther_health_guidance();
|
|
|
switch (sclera){
|
|
|
case 2:html = html.replace("${other_health_guidance}","其他");break;
|
|
|
default:html = html.replace("${other_health_guidance}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${other_health_guidance_description}",null==olderPeopleHealthCheckRecord.getOther_health_guidance_description()?"":olderPeopleHealthCheckRecord.getOther_health_guidance_description());
|
|
|
if(null==olderPeopleHealthCheckRecord.getStop_smoking()){
|
|
|
html = html.replace("${stop_smoking}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getStop_smoking();
|
|
|
switch (sclera){
|
|
|
case 2:html = html.replace("${stop_smoking}","戒烟:是");break;
|
|
|
default:html = html.replace("${stop_smoking}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getHealthy_drinking()){
|
|
|
html = html.replace("${healthy_drinking}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getHealthy_drinking();
|
|
|
switch (sclera){
|
|
|
case 2:html = html.replace("${healthy_drinking}","健康饮酒:是");break;
|
|
|
default:html = html.replace("${healthy_drinking}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getDiet()){
|
|
|
html = html.replace("${diet}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getDiet();
|
|
|
switch (sclera){
|
|
|
case 2:html = html.replace("${diet}","饮食:是");break;
|
|
|
default:html = html.replace("${diet}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getExercise()){
|
|
|
html = html.replace("${exercise}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getExercise();
|
|
|
switch (sclera){
|
|
|
case 2:html = html.replace("${exercise}","锻炼:是");break;
|
|
|
default:html = html.replace("${exercise}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getLose_weight()){
|
|
|
html = html.replace("${lose_weight}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getLose_weight();
|
|
|
switch (sclera){
|
|
|
case 2:html = html.replace("${lose_weight}","减肥:是");break;
|
|
|
default:html = html.replace("${lose_weight}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${goal_weight}",null==olderPeopleHealthCheckRecord.getGoal_weight()?"":"目标:"+olderPeopleHealthCheckRecord.getGoal_weight()+"Kg");
|
|
|
if(null==olderPeopleHealthCheckRecord.getRecommended_vaccination()){
|
|
|
html = html.replace("${recommended_vaccination}"," ");
|
|
|
}else {
|
|
|
String sclera = olderPeopleHealthCheckRecord.getRecommended_vaccination();
|
|
|
switch (sclera){
|
|
|
case "2":html = html.replace("${recommended_vaccination}","建议接种疫苗:是");break;
|
|
|
default:html = html.replace("${recommended_vaccination}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getOther_advice()){
|
|
|
html = html.replace("${other_advice}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getOther_advice();
|
|
|
switch (sclera){
|
|
|
case 2:html = html.replace("${other_advice}","其他建议:是");break;
|
|
|
default:html = html.replace("${other_advice}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${other_advice_description}",null==olderPeopleHealthCheckRecord.getOther_advice_description()?"":olderPeopleHealthCheckRecord.getOther_advice_description());
|
|
|
if(null==olderPeopleHealthCheckRecord.getEat()){
|
|
|
html = html.replace("${eat}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getEat();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${eat}"," 独立完成0-3分");break;
|
|
|
case 2:html = html.replace("${eat}"," 轻度依赖4-8分");break;
|
|
|
case 3:html = html.replace("${eat}"," 中度依赖9-18分");break;
|
|
|
case 4:html = html.replace("${eat}"," 不能自理≥19分");break;
|
|
|
default:html = html.replace("${eat}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getWash()){
|
|
|
html = html.replace("${wash}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getWash();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${wash}"," 独立完成0-3分");break;
|
|
|
case 2:html = html.replace("${wash}"," 轻度依赖4-8分");break;
|
|
|
case 3:html = html.replace("${wash}"," 中度依赖9-18分");break;
|
|
|
case 4:html = html.replace("${wash}"," 不能自理≥19分");break;
|
|
|
default:html = html.replace("${wash}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getDress()){
|
|
|
html = html.replace("${dress}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getDress();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${dress}"," 独立完成0-3分");break;
|
|
|
case 2:html = html.replace("${dress}"," 轻度依赖4-8分");break;
|
|
|
case 3:html = html.replace("${dress}"," 中度依赖9-18分");break;
|
|
|
case 4:html = html.replace("${dress}"," 不能自理≥19分");break;
|
|
|
default:html = html.replace("${dress}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getToilet()){
|
|
|
html = html.replace("${toilet}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getToilet();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${toilet}"," 独立完成0-3分");break;
|
|
|
case 2:html = html.replace("${toilet}"," 轻度依赖4-8分");break;
|
|
|
case 3:html = html.replace("${toilet}"," 中度依赖9-18分");break;
|
|
|
case 4:html = html.replace("${toilet}"," 不能自理≥19分");break;
|
|
|
default:html = html.replace("${toilet}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
if(null==olderPeopleHealthCheckRecord.getActivity()){
|
|
|
html = html.replace("${activity}"," ");
|
|
|
}else {
|
|
|
Integer sclera = olderPeopleHealthCheckRecord.getActivity();
|
|
|
switch (sclera){
|
|
|
case 1:html = html.replace("${activity}"," 独立完成0-3分");break;
|
|
|
case 2:html = html.replace("${activity}"," 轻度依赖4-8分");break;
|
|
|
case 3:html = html.replace("${activity}"," 中度依赖9-18分");break;
|
|
|
case 4:html = html.replace("${activity}"," 能自理≥19分");break;
|
|
|
default:html = html.replace("${activity}"," ");break;
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${score}",null==olderPeopleHealthCheckRecord.getScore()?"":olderPeopleHealthCheckRecord.getScore()+"");
|
|
|
|
|
|
String sign_wayStr="";
|
|
|
String sign_time="";
|
|
|
String sign_address="";
|
|
|
String sign_imgs="";
|
|
|
|
|
|
List<FollowupSign> followupSignDOs = followupSignDao.findByFollowupIdAndDel(Long.valueOf(olderPeopleHealthCheckRecord.getFollowup_id()),0);
|
|
|
if (followupSignDOs.size()>0){
|
|
|
FollowupSign followupSignDO = followupSignDOs.get(0);
|
|
|
if (null!=followupSignDO){
|
|
|
try {
|
|
|
switch (followupSignDO.getType()){
|
|
|
case "1":sign_wayStr="定位"; break;
|
|
|
case "2":sign_wayStr="拍照";break;
|
|
|
case "3":sign_wayStr="门牌";break;
|
|
|
default:sign_wayStr=" ";break;
|
|
|
}
|
|
|
sign_address = null==followupSignDO.getAddress()?" ":followupSignDO.getAddress();
|
|
|
if(StringUtils.isNotBlank(followupSignDO.getImg())) {
|
|
|
String imgs = followupSignDO.getImg();
|
|
|
String[] imgsArray;
|
|
|
if (imgs.contains(",")) {
|
|
|
imgsArray = imgs.split(",");
|
|
|
} else {
|
|
|
imgsArray = new String[]{imgs};
|
|
|
}
|
|
|
for (String img : imgsArray) {
|
|
|
sign_imgs += "<img width='80' height='100' src='" + imgUrlDomain + img + "' /> ";
|
|
|
}
|
|
|
}
|
|
|
sign_time = DateUtil.dateToStrLong(followupSignDO.getCreateTime());
|
|
|
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
html = html.replace("${sign_way}",sign_wayStr);
|
|
|
html = html.replace("${sign_time}",sign_time);
|
|
|
html = html.replace("${sign_address}",sign_address);
|
|
|
html = html.replace("${sigm_imgs}",sign_imgs);
|
|
|
return html;
|
|
|
}
|
|
|
|
|
|
public String getSymptomName(String symptom){
|
|
|
String symptomName="";
|
|
|
switch (symptom){
|
|
|
case "1": symptomName = " 无症状 ";break;
|
|
|
case "2": symptomName = " 头痛 ";break;
|
|
|
case "3": symptomName = " 头晕 ";break;
|
|
|
case "4": symptomName = " 心悸 ";break;
|
|
|
case "5": symptomName = " 胸闷 ";break;
|
|
|
case "6": symptomName = " 胸痛 ";break;
|
|
|
case "7": symptomName = " 慢性咳嗽 ";break;
|
|
|
case "8": symptomName = " 咳痰 ";break;
|
|
|
case "9": symptomName = " 呼吸困难 ";break;
|
|
|
case "10": symptomName = "多饮 ";break;
|
|
|
case "11": symptomName = "多尿 ";break;
|
|
|
case "12": symptomName = "体重下降 ";break;
|
|
|
case "13": symptomName = "乏力 ";break;
|
|
|
case "14": symptomName = "关节肿痛 ";break;
|
|
|
case "15": symptomName = "视力模糊 ";break;
|
|
|
case "16": symptomName = "手脚麻木 ";break;
|
|
|
case "17": symptomName = "尿急 ";break;
|
|
|
case "18": symptomName = "尿痛 ";break;
|
|
|
case "19": symptomName = "便秘 ";break;
|
|
|
case "20": symptomName = "腹泻 ";break;
|
|
|
case "21": symptomName = "恶心呕吐 ";break;
|
|
|
case "22": symptomName = "眼花 ";break;
|
|
|
case "23": symptomName = "耳鸣 ";break;
|
|
|
case "24": symptomName = "乳房胀痛 ";break;
|
|
|
case "25": symptomName = "其他 ";break;
|
|
|
default:symptomName=" ";break;
|
|
|
}
|
|
|
return symptomName;
|
|
|
}
|
|
|
|
|
|
}
|