|
@ -158,22 +158,22 @@ public class FollowUpService extends BaseService {
|
|
|
re.put("followupTypeName", followupTypeName);
|
|
|
|
|
|
//随访类别转译
|
|
|
|
|
|
|
|
|
String followupClass = followup.getFollowupClass();
|
|
|
re.put("followupClass", followupClass);
|
|
|
|
|
|
|
|
|
String followupClassName = systemDictService.getDictValue("FOLLOWUP_CLASS_DICT", followup.getFollowupClass());
|
|
|
if(StringUtils.isNoneBlank(followupClass) && followupClass.contains(",")){
|
|
|
if (StringUtils.isNoneBlank(followupClass) && followupClass.contains(",")) {
|
|
|
String[] followupClassArray = followupClass.split(",");
|
|
|
followupClassName = "";
|
|
|
for (int i = 0; i < followupClassArray.length; i++) {
|
|
|
followupClassName += systemDictService.getDictValue("FOLLOWUP_CLASS_DICT", followupClassArray[i]);
|
|
|
if(i != followupClassArray.length -1){
|
|
|
followupClassName +=",";
|
|
|
if (i != followupClassArray.length - 1) {
|
|
|
followupClassName += ",";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
re.put("followupClassName", followupClassName);
|
|
|
|
|
|
//随访管理状态转译
|
|
@ -206,23 +206,23 @@ public class FollowUpService extends BaseService {
|
|
|
for (Followup followup : list) {
|
|
|
String date = DateUtil.dateToStrShort(followup.getFollowupDate());
|
|
|
Map<String, String> map = getFollowupDetail(followup);
|
|
|
if(temp.containsKey(date)){
|
|
|
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{
|
|
|
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);
|
|
|
vo.put("date", date);
|
|
|
vo.put("num", 1);
|
|
|
list1.add(map);
|
|
|
vo.put("list",list1);
|
|
|
temp.put(date,vo);
|
|
|
vo.put("list", list1);
|
|
|
temp.put(date, vo);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
for (Map<String, Object> map:temp.values()){
|
|
|
for (Map<String, Object> map : temp.values()) {
|
|
|
re.add(map);
|
|
|
}
|
|
|
}
|
|
@ -237,25 +237,26 @@ public class FollowUpService extends BaseService {
|
|
|
* @param teamCode
|
|
|
* @param page
|
|
|
* @param pageSize
|
|
|
* @param type 类型:0全部,1计划,2记录
|
|
|
* @param type 类型:0全部,1计划,2记录
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONArray getListByPatientAndTeam(String patient, Long teamCode, int page, int pageSize, String type) {
|
|
|
Sort sort = new Sort(Sort.Direction.DESC,"createTime");
|
|
|
PageRequest pageRequest = new PageRequest(page, pageSize,sort);
|
|
|
Sort sort = new Sort(Sort.Direction.DESC, "createTime");
|
|
|
PageRequest pageRequest = new PageRequest(page, pageSize, sort);
|
|
|
Page<Object> result = null;
|
|
|
|
|
|
if(StringUtils.isBlank(type)){
|
|
|
|
|
|
if (StringUtils.isBlank(type)) {
|
|
|
result = followupDao.findByPatientAndTeam(patient, teamCode, pageRequest);
|
|
|
}else if("1".equals(type)){
|
|
|
} else if ("1".equals(type)) {
|
|
|
//已经开始的就是记录
|
|
|
result = followupDao.findPlanByPatientAndTeam(patient, teamCode, pageRequest);
|
|
|
}else if("2".equals(type)){
|
|
|
} else if ("2".equals(type)) {
|
|
|
//未开始的就是计划
|
|
|
result = followupDao.findRecordByPatientAndTeam(patient, teamCode, pageRequest);
|
|
|
}else{}
|
|
|
|
|
|
|
|
|
} else {
|
|
|
}
|
|
|
|
|
|
|
|
|
JSONArray array = new JSONArray();
|
|
|
|
|
|
if (result != null && result.getContent().size() > 0) {
|
|
@ -285,10 +286,10 @@ public class FollowUpService extends BaseService {
|
|
|
Object[] objArr = (Object[]) obj;
|
|
|
// 返回值增加居民信息
|
|
|
Patient patientDetail = patientDao.findByCode(patient);
|
|
|
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("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]);
|
|
@ -298,34 +299,35 @@ public class FollowUpService extends BaseService {
|
|
|
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]);
|
|
|
|
|
|
|
|
|
// followup.put("followupClassName", objArr[4] == null ? "" : (objArr[4].toString().equals("1") ? "高血压" : "糖尿病"));
|
|
|
|
|
|
if( objArr[4] == null){
|
|
|
|
|
|
if (objArr[4] == null) {
|
|
|
followup.put("followupClassName", "");
|
|
|
}else{
|
|
|
if(objArr[4].toString().equals("1")){
|
|
|
} else {
|
|
|
if (objArr[4].toString().equals("1")) {
|
|
|
followup.put("followupClassName", "高血压");
|
|
|
}else if(objArr[4].toString().equals("2")){
|
|
|
} else if (objArr[4].toString().equals("2")) {
|
|
|
followup.put("followupClassName", "糖尿病");
|
|
|
}else if(objArr[4].toString().equals("3")){
|
|
|
} else if (objArr[4].toString().equals("3")) {
|
|
|
followup.put("followupClassName", "高血压,糖尿病");
|
|
|
}else{}
|
|
|
} 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("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("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]) : "");
|
|
|
array.put(followup);
|
|
|
}
|
|
|
}
|
|
@ -373,7 +375,7 @@ public class FollowUpService extends BaseService {
|
|
|
SignFamily signFamily = signFamilyDao.findByjiatingPatient(patientCode);
|
|
|
if (signFamily == null) {
|
|
|
signFamily = signFamilyDao.findBySanshiPatient(patientCode);
|
|
|
if(signFamily==null){
|
|
|
if (signFamily == null) {
|
|
|
throw new Exception("can not find patient's family sign info");
|
|
|
}
|
|
|
}
|
|
@ -438,12 +440,12 @@ public class FollowUpService extends BaseService {
|
|
|
/**
|
|
|
* 开始随访记录
|
|
|
*/
|
|
|
public void startFollowup(String id, String date, String followupType, String followupClass, String followupManagerStatus,String plandate,String prescriptioncode) throws Exception {
|
|
|
public void startFollowup(String id, String date, String followupType, String followupClass, String followupManagerStatus, String plandate, String prescriptioncode) throws Exception {
|
|
|
Followup followup = followupDao.findOne(Long.valueOf(id));
|
|
|
if (followup != null) {
|
|
|
followup.setFollowupDate(DateUtil.strToDate(date));
|
|
|
//计划下次随访时间--huangwenjie.2017.10.19
|
|
|
if(StringUtils.isNoneBlank(plandate)){
|
|
|
if (StringUtils.isNoneBlank(plandate)) {
|
|
|
followup.setFollowupNextDate(DateUtil.strToDate(plandate));
|
|
|
Followup nextFollowup = new Followup();
|
|
|
nextFollowup.setDataFrom(followup.getDataFrom());
|
|
@ -470,7 +472,7 @@ public class FollowUpService extends BaseService {
|
|
|
nextFollowup.setIdcard(followup.getIdcard());
|
|
|
nextFollowup.setSignType(followup.getSignType());
|
|
|
followupDao.save(nextFollowup);
|
|
|
|
|
|
|
|
|
}
|
|
|
followup.setFollowupType(followupType);
|
|
|
followup.setFollowupClass(followupClass);
|
|
@ -487,7 +489,7 @@ public class FollowUpService extends BaseService {
|
|
|
/**
|
|
|
* 新增临时随访记录(返回ID)
|
|
|
*/
|
|
|
public String addFollowup(String doctorCode, String patientCode, String date, String followupType, String followupClass, String followupManagerStatus,String plandate,String prescriptioncode) throws Exception {
|
|
|
public String addFollowup(String doctorCode, String patientCode, String date, String followupType, String followupClass, String followupManagerStatus, String plandate, String prescriptioncode) throws Exception {
|
|
|
String re = "";
|
|
|
|
|
|
//获取医生信息
|
|
@ -504,8 +506,8 @@ public class FollowUpService extends BaseService {
|
|
|
SignFamily signFamily = signFamilyDao.findByjiatingPatient(patientCode);
|
|
|
if (signFamily == null) {
|
|
|
signFamily = signFamilyDao.findBySanshiPatient(patientCode);
|
|
|
if(signFamily==null)
|
|
|
throw new Exception("can not find patient's family sign info");
|
|
|
if (signFamily == null)
|
|
|
throw new Exception("can not find patient's family sign info");
|
|
|
}
|
|
|
|
|
|
Followup followup = new Followup();
|
|
@ -530,14 +532,14 @@ public class FollowUpService extends BaseService {
|
|
|
followup.setSignType(2);
|
|
|
//保存质询code
|
|
|
followup.setSignCode(patientService.getSignCodeByPatient(patientCode));
|
|
|
|
|
|
|
|
|
//如果有填入续方CODE,则添加续方关联--huangwenjie.2017.11.02
|
|
|
if(StringUtils.isNotBlank(prescriptioncode)){
|
|
|
if (StringUtils.isNotBlank(prescriptioncode)) {
|
|
|
followup.setPrescriptionCode(prescriptioncode);
|
|
|
}
|
|
|
|
|
|
//计划下次随访时间--ysj.2017.10.26
|
|
|
if(StringUtils.isNoneBlank(plandate)){
|
|
|
if (StringUtils.isNoneBlank(plandate)) {
|
|
|
followup.setFollowupNextDate(DateUtil.strToDate(plandate));
|
|
|
Followup nextFollowup = new Followup();
|
|
|
nextFollowup.setDataFrom(followup.getDataFrom());
|
|
@ -593,22 +595,22 @@ public class FollowUpService extends BaseService {
|
|
|
if (followup != null) {
|
|
|
followup.setStatus("1"); //状态 0取消 1已完成 2未开始 3进行中
|
|
|
followup = followupDao.save(followup);
|
|
|
|
|
|
|
|
|
//上传随访计划映射表记录
|
|
|
FollowupMapping followupMapping = followUpMappingDao.findByFollowupId(Integer.parseInt(String.valueOf(followup.getId())));
|
|
|
|
|
|
if(followupMapping == null){
|
|
|
|
|
|
if (followupMapping == null) {
|
|
|
followupMapping = new FollowupMapping();
|
|
|
}
|
|
|
|
|
|
|
|
|
followupMapping.setFollowupId(Integer.parseInt(String.valueOf(followup.getId())));
|
|
|
followupMapping.setCode(UUID.randomUUID().toString());
|
|
|
followupMapping.setCreateTime(DateUtil.getNowTimestamp());
|
|
|
followupMapping.setUpdateTime(DateUtil.getNowTimestamp());
|
|
|
followupMapping.setNeedUpload(1);
|
|
|
|
|
|
|
|
|
followUpMappingDao.save(followupMapping);
|
|
|
|
|
|
|
|
|
// new Thread(new FollowupUploadTask(String.valueOf(followup.getId()))).start();
|
|
|
} else {
|
|
|
throw new Exception("not exit follow:" + id + ".\r\n");
|
|
@ -697,13 +699,13 @@ public class FollowUpService extends BaseService {
|
|
|
followupContentDao.save(newList);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Followup followup = followupDao.findOne(Long.valueOf(id));
|
|
|
|
|
|
|
|
|
//如果该随访是已完成的,则添加随访信息上传映射,上传到基卫
|
|
|
if("1".equals(followup.getStatus())){
|
|
|
if ("1".equals(followup.getStatus())) {
|
|
|
FollowupMapping followupMapping = followUpMappingDao.findByFollowupId(Integer.parseInt(id));
|
|
|
if(followupMapping == null){
|
|
|
if (followupMapping == null) {
|
|
|
followupMapping = new FollowupMapping();
|
|
|
followupMapping.setCode(UUID.randomUUID().toString());
|
|
|
followupMapping.setFollowupId(Integer.parseInt(id));
|
|
@ -861,7 +863,10 @@ public class FollowUpService extends BaseService {
|
|
|
// 推送消息给医生
|
|
|
pushMsgTask.put(doctor, "4", title, content, "");
|
|
|
|
|
|
|
|
|
// 新增发送医生助手模板消息 v1.4.0 by wujunjie
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
List<Followup> followups = followupDao.getByDoctor(doctor, format.parse(start), format.parse(end));
|
|
|
Doctor doctor1 = doctorDao.findByCode(doctor);
|
|
|
String doctorOpenID = doctor1.getOpenid();
|
|
|
if (StringUtils.isNotEmpty(doctorOpenID)) {
|
|
@ -872,8 +877,8 @@ public class FollowUpService extends BaseService {
|
|
|
params.add(new BasicNameValuePair("url", targetUrl));
|
|
|
params.add(new BasicNameValuePair("first", "您今日有1个随访计划待处理"));
|
|
|
params.add(new BasicNameValuePair("remark", ""));
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
|
|
|
String newDate = format.format(new Date());
|
|
|
SimpleDateFormat formatDate = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
|
|
|
String newDate = formatDate.format(new Date());
|
|
|
String keywords = "patientName" + newDate + "," + "请进入手机APP查看";
|
|
|
params.add(new BasicNameValuePair("keywords", keywords));
|
|
|
|
|
@ -889,15 +894,16 @@ public class FollowUpService extends BaseService {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
*ES 保存随访记录详情
|
|
|
*@author huangwenjie
|
|
|
*@date 2017/11/1 14:57
|
|
|
* ES 保存随访记录详情
|
|
|
*
|
|
|
* @author huangwenjie
|
|
|
* @date 2017/11/1 14:57
|
|
|
*/
|
|
|
@Transactional
|
|
|
public void esSaveFollowupProjectData(String id, String followupProject, String followupProjectData) throws Exception {
|
|
|
|
|
|
|
|
|
JestClient jestClient = elasticFactory.getJestClient();
|
|
|
//先根据条件查找出来
|
|
|
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
|
@ -906,33 +912,33 @@ public class FollowUpService extends BaseService {
|
|
|
.must(QueryBuilders.matchQuery("followup_id", id))
|
|
|
.must(QueryBuilders.matchQuery("followup_project", followupProject))
|
|
|
);
|
|
|
|
|
|
|
|
|
Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType)
|
|
|
.build();
|
|
|
SearchResult result = jestClient.execute(search);
|
|
|
List<FollowupContentESDO> dataList = result.getSourceAsObjectList(FollowupContentESDO.class);
|
|
|
|
|
|
|
|
|
//删除原有记录
|
|
|
this.esDeleteFollowUpContent(dataList);
|
|
|
|
|
|
|
|
|
//保存新的随访详情信息
|
|
|
List<FollowupContentESDO> newdatalist = new ArrayList<>();
|
|
|
FollowupContentESDO followupContentESDO = new FollowupContentESDO();
|
|
|
|
|
|
followupContentESDO = JSON.parseObject(followupProjectData,FollowupContentESDO.class);
|
|
|
|
|
|
|
|
|
followupContentESDO = JSON.parseObject(followupProjectData, FollowupContentESDO.class);
|
|
|
|
|
|
followupContentESDO.setFollowup_id(id);
|
|
|
followupContentESDO.setFollowup_project(followupProject);
|
|
|
followupContentESDO.setCreate_time(new Date());
|
|
|
newdatalist.add(followupContentESDO);
|
|
|
elastricSearchSave.save(newdatalist,esIndex,esType);
|
|
|
|
|
|
|
|
|
elastricSearchSave.save(newdatalist, esIndex, esType);
|
|
|
|
|
|
|
|
|
//如果该随访是已完成的,则添加随访信息上传映射,上传到基卫
|
|
|
Followup followup = followupDao.findOne(Long.valueOf(id));
|
|
|
if("1".equals(followup.getStatus())){
|
|
|
if ("1".equals(followup.getStatus())) {
|
|
|
FollowupMapping followupMapping = followUpMappingDao.findByFollowupId(Integer.parseInt(id));
|
|
|
if(followupMapping == null){
|
|
|
if (followupMapping == null) {
|
|
|
followupMapping = new FollowupMapping();
|
|
|
followupMapping.setCode(UUID.randomUUID().toString());
|
|
|
followupMapping.setFollowupId(Integer.parseInt(id));
|
|
@ -943,13 +949,13 @@ public class FollowUpService extends BaseService {
|
|
|
followUpMappingDao.save(followupMapping);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* ES获取面访项目数据
|
|
|
*/
|
|
|
public FollowupContentESDO esGetFollowupProjectData(String id, String followupProject) throws Exception {
|
|
|
//根据随访ID、分类ID获取随访记录详情
|
|
|
|
|
|
|
|
|
JestClient jestClient = elasticFactory.getJestClient();
|
|
|
//先根据条件查找出来
|
|
|
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
|
@ -958,20 +964,21 @@ public class FollowUpService extends BaseService {
|
|
|
.must(QueryBuilders.matchQuery("followup_id", id))
|
|
|
.must(QueryBuilders.matchQuery("followup_project", followupProject))
|
|
|
);
|
|
|
|
|
|
|
|
|
Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType)
|
|
|
.build();
|
|
|
SearchResult result = jestClient.execute(search);
|
|
|
FollowupContentESDO followupContentESDO = result.getSourceAsObject(FollowupContentESDO.class);
|
|
|
FollowupContentESDO followupContentESDO = result.getSourceAsObject(FollowupContentESDO.class);
|
|
|
return followupContentESDO;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
*ES 删除随访详情信息
|
|
|
*@author huangwenjie
|
|
|
*@date 2017/11/1 15:17
|
|
|
* ES 删除随访详情信息
|
|
|
*
|
|
|
* @author huangwenjie
|
|
|
* @date 2017/11/1 15:17
|
|
|
*/
|
|
|
public void esDeleteFollowUpContent(List<FollowupContentESDO> datalist) throws Exception{
|
|
|
public void esDeleteFollowUpContent(List<FollowupContentESDO> datalist) throws Exception {
|
|
|
try {
|
|
|
JestClient jestClient = elasticFactory.getJestClient();
|
|
|
//根据id批量删除
|
|
@ -981,25 +988,26 @@ public class FollowUpService extends BaseService {
|
|
|
bulk.addAction(index);
|
|
|
}
|
|
|
BulkResult br = jestClient.execute(bulk.build());
|
|
|
|
|
|
|
|
|
logger.info("delete data count:" + datalist.size());
|
|
|
logger.info("delete flag:" + br.isSucceeded());
|
|
|
}catch (Exception e){
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* ES获取面访项目数据列表
|
|
|
*@author huangwenjie
|
|
|
*@date 2017/11/1 19:41
|
|
|
*
|
|
|
* @author huangwenjie
|
|
|
* @date 2017/11/1 19:41
|
|
|
*/
|
|
|
public List<String> esfindProjectByFollowupId(String id) throws Exception {
|
|
|
public List<String> esfindProjectByFollowupId(String id) throws Exception {
|
|
|
//根据随访ID、分类ID获取随访记录详情
|
|
|
|
|
|
|
|
|
List<String> resultList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
JestClient jestClient = elasticFactory.getJestClient();
|
|
|
//先根据条件查找出来
|
|
|
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
|
@ -1007,33 +1015,34 @@ public class FollowUpService extends BaseService {
|
|
|
new BoolQueryBuilder()
|
|
|
.must(QueryBuilders.matchQuery("followup_id", id))
|
|
|
);
|
|
|
|
|
|
|
|
|
Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType)
|
|
|
.build();
|
|
|
SearchResult result = jestClient.execute(search);
|
|
|
|
|
|
|
|
|
List<FollowupContentESDO> followupContentESDOList = new ArrayList<>();
|
|
|
|
|
|
followupContentESDOList = result.getSourceAsObjectList(FollowupContentESDO.class);
|
|
|
if(!followupContentESDOList.isEmpty()){
|
|
|
for (FollowupContentESDO followupContentESDO: followupContentESDOList) {
|
|
|
|
|
|
followupContentESDOList = result.getSourceAsObjectList(FollowupContentESDO.class);
|
|
|
if (!followupContentESDOList.isEmpty()) {
|
|
|
for (FollowupContentESDO followupContentESDO : followupContentESDOList) {
|
|
|
resultList.add(followupContentESDO.getFollowup_project());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
return resultList;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* ES获取面访项目数据详情
|
|
|
*@author huangwenjie
|
|
|
*@date 2017/11/1 19:41
|
|
|
*
|
|
|
* @author huangwenjie
|
|
|
* @date 2017/11/1 19:41
|
|
|
*/
|
|
|
public List<FollowupContentESDO> esfindFollowUpContestsByFollowupId(String id) throws Exception {
|
|
|
public List<FollowupContentESDO> esfindFollowUpContestsByFollowupId(String id) throws Exception {
|
|
|
//根据随访ID、分类ID获取随访记录详情
|
|
|
|
|
|
|
|
|
List<String> resultList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
JestClient jestClient = elasticFactory.getJestClient();
|
|
|
//先根据条件查找出来
|
|
|
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
|
@ -1041,29 +1050,30 @@ public class FollowUpService extends BaseService {
|
|
|
new BoolQueryBuilder()
|
|
|
.must(QueryBuilders.matchQuery("followup_id", id))
|
|
|
);
|
|
|
|
|
|
|
|
|
Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType)
|
|
|
.build();
|
|
|
SearchResult result = jestClient.execute(search);
|
|
|
|
|
|
|
|
|
List<FollowupContentESDO> followupContentESDOList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
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
|
|
@ -1071,7 +1081,7 @@ public class FollowUpService extends BaseService {
|
|
|
* @return
|
|
|
*/
|
|
|
public int getfollowupcontent(String followupid, String type) throws Exception {
|
|
|
|
|
|
|
|
|
int count = 0;
|
|
|
String[] typelist = null;
|
|
|
if(type.contains(",")){
|
|
@ -1079,15 +1089,15 @@ public class FollowUpService extends BaseService {
|
|
|
}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));
|
|
@ -1096,7 +1106,7 @@ public class FollowUpService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
return count;
|
|
|
|
|
|
}
|