|
@ -5,6 +5,7 @@ import com.yihu.wlyy.repository.patient.PatientDao;
|
|
import com.yihu.wlyy.repository.specialist.SpecialDiseaseDao;
|
|
import com.yihu.wlyy.repository.specialist.SpecialDiseaseDao;
|
|
import com.yihu.wlyy.repository.wechat.WechatTemplateConfigDao;
|
|
import com.yihu.wlyy.repository.wechat.WechatTemplateConfigDao;
|
|
import com.yihu.wlyy.service.app.survey.SurveyScreenResultService;
|
|
import com.yihu.wlyy.service.app.survey.SurveyScreenResultService;
|
|
|
|
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
|
|
import com.yihu.wlyy.task.PushMsgTask;
|
|
import com.yihu.wlyy.task.PushMsgTask;
|
|
import com.yihu.wlyy.web.WeixinBaseController;
|
|
import com.yihu.wlyy.web.WeixinBaseController;
|
|
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
|
|
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
|
|
@ -12,14 +13,17 @@ import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.json.JSONObject;
|
|
import org.json.JSONObject;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import java.util.HashSet;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 医生端-疾病筛查
|
|
* 医生端-疾病筛查
|
|
@ -44,11 +48,14 @@ public class DoctorSurveyScreenResultController extends WeixinBaseController {
|
|
private SurveyScreenResultService surveyScreenResultService;
|
|
private SurveyScreenResultService surveyScreenResultService;
|
|
@Autowired
|
|
@Autowired
|
|
private SpecialDiseaseDao specialDiseaseDao;
|
|
private SpecialDiseaseDao specialDiseaseDao;
|
|
|
|
@Autowired
|
|
|
|
private JMJkEduArticleService jmJkEduArticleService;
|
|
|
|
|
|
private Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
private Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取筛查结果列表
|
|
* 获取筛查结果列表
|
|
|
|
*
|
|
* @param pageNo
|
|
* @param pageNo
|
|
* @param pageSize
|
|
* @param pageSize
|
|
* @param diseaseType
|
|
* @param diseaseType
|
|
@ -60,14 +67,14 @@ public class DoctorSurveyScreenResultController extends WeixinBaseController {
|
|
@RequestMapping(value = "getResultList", method = RequestMethod.GET)
|
|
@RequestMapping(value = "getResultList", method = RequestMethod.GET)
|
|
@ApiOperation(value = "获取筛查记录列表")
|
|
@ApiOperation(value = "获取筛查记录列表")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String getResultList(@ApiParam(value = "当前页")@RequestParam(value = "pageNo") int pageNo,
|
|
|
|
@ApiParam(value = "显示记录数")@RequestParam(value = "pageSize") int pageSize,
|
|
|
|
@ApiParam(value = "疾病类型")@RequestParam(value = "diseaseType",required = false) String diseaseType,
|
|
|
|
@ApiParam(value = "处理方式(1已预约 2已跟踪 3已接诊 4待处理)")@RequestParam(value = "dealType",required = false) String dealType,
|
|
|
|
@ApiParam(value = "搜索居民的姓名")@RequestParam(value = "patientName",required = false) String patientName,
|
|
|
|
@ApiParam(value = "是否高危预警(0否 1是)")@RequestParam(value = "isDanger",required = false) String isDanger){
|
|
|
|
|
|
public String getResultList(@ApiParam(value = "当前页") @RequestParam(value = "pageNo") int pageNo,
|
|
|
|
@ApiParam(value = "显示记录数") @RequestParam(value = "pageSize") int pageSize,
|
|
|
|
@ApiParam(value = "疾病类型") @RequestParam(value = "diseaseType", required = false) String diseaseType,
|
|
|
|
@ApiParam(value = "处理方式(1已预约 2已跟踪 3已接诊 4待处理)") @RequestParam(value = "dealType", required = false) String dealType,
|
|
|
|
@ApiParam(value = "搜索居民的姓名") @RequestParam(value = "patientName", required = false) String patientName,
|
|
|
|
@ApiParam(value = "是否高危预警(0否 1是)") @RequestParam(value = "isDanger", required = false) String isDanger) {
|
|
try {
|
|
try {
|
|
return write(200, "查询成功!", "data", surveyScreenResultService.getResultList(pageNo,pageSize,getUID(),diseaseType,dealType,isDanger,patientName));
|
|
|
|
|
|
return write(200, "查询成功!", "data", surveyScreenResultService.getResultList(pageNo, pageSize, getUID(), diseaseType, dealType, isDanger, patientName));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
return write(-1, "查询失败!");
|
|
return write(-1, "查询失败!");
|
|
@ -77,7 +84,7 @@ public class DoctorSurveyScreenResultController extends WeixinBaseController {
|
|
@RequestMapping(value = "getSpecialDisease", method = RequestMethod.GET)
|
|
@RequestMapping(value = "getSpecialDisease", method = RequestMethod.GET)
|
|
@ApiOperation(value = "获取专科疾病类型")
|
|
@ApiOperation(value = "获取专科疾病类型")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String getSpecialDisease(){
|
|
|
|
|
|
public String getSpecialDisease() {
|
|
try {
|
|
try {
|
|
return write(200, "查询成功!", "data", specialDiseaseDao.findByDel("1"));
|
|
return write(200, "查询成功!", "data", specialDiseaseDao.findByDel("1"));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@ -89,6 +96,7 @@ public class DoctorSurveyScreenResultController extends WeixinBaseController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取筛查问卷列表
|
|
* 获取筛查问卷列表
|
|
|
|
*
|
|
* @param pageNo
|
|
* @param pageNo
|
|
* @param pageSize
|
|
* @param pageSize
|
|
* @param labelType
|
|
* @param labelType
|
|
@ -97,12 +105,12 @@ public class DoctorSurveyScreenResultController extends WeixinBaseController {
|
|
@RequestMapping(value = "getScreenList", method = RequestMethod.POST)
|
|
@RequestMapping(value = "getScreenList", method = RequestMethod.POST)
|
|
@ApiOperation(value = "根据问卷标签类型获取筛查问卷列表")
|
|
@ApiOperation(value = "根据问卷标签类型获取筛查问卷列表")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String getScreenList(@ApiParam(value = "当前页")@RequestParam(value = "pageNo") int pageNo,
|
|
|
|
@ApiParam(value = "显示记录数")@RequestParam(value = "pageSize") int pageSize,
|
|
|
|
@ApiParam(value = "问卷类型标签")@RequestParam(value = "labelType") int labelType,
|
|
|
|
@ApiParam(value = "问卷题目")@RequestParam(value = "title",required = false) String title) {
|
|
|
|
|
|
public String getScreenList(@ApiParam(value = "当前页") @RequestParam(value = "pageNo") int pageNo,
|
|
|
|
@ApiParam(value = "显示记录数") @RequestParam(value = "pageSize") int pageSize,
|
|
|
|
@ApiParam(value = "问卷类型标签") @RequestParam(value = "labelType") int labelType,
|
|
|
|
@ApiParam(value = "问卷题目") @RequestParam(value = "title", required = false) String title) {
|
|
try {
|
|
try {
|
|
return write(200, "获取成功!", "data", surveyScreenResultService.getScreenList(pageNo,pageSize,labelType,title));
|
|
|
|
|
|
return write(200, "获取成功!", "data", surveyScreenResultService.getScreenList(pageNo, pageSize, labelType, title));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
return write(-1, "获取失败!");
|
|
return write(-1, "获取失败!");
|
|
@ -112,7 +120,7 @@ public class DoctorSurveyScreenResultController extends WeixinBaseController {
|
|
@RequestMapping(value = "getScreenResultDetail", method = RequestMethod.GET)
|
|
@RequestMapping(value = "getScreenResultDetail", method = RequestMethod.GET)
|
|
@ApiOperation(value = "查看筛查结果记录详情")
|
|
@ApiOperation(value = "查看筛查结果记录详情")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String getScreenResultDetail(@ApiParam(value = "筛查结果唯一code")@RequestParam(value = "code") String code) {
|
|
|
|
|
|
public String getScreenResultDetail(@ApiParam(value = "筛查结果唯一code") @RequestParam(value = "code") String code) {
|
|
try {
|
|
try {
|
|
return write(200, "获取成功!", "data", surveyScreenResultService.getScreenResultDetail(code));
|
|
return write(200, "获取成功!", "data", surveyScreenResultService.getScreenResultDetail(code));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@ -124,7 +132,7 @@ public class DoctorSurveyScreenResultController extends WeixinBaseController {
|
|
@RequestMapping(value = "getTemplateAdvice", method = RequestMethod.GET)
|
|
@RequestMapping(value = "getTemplateAdvice", method = RequestMethod.GET)
|
|
@ApiOperation(value = "获取健康建议列表")
|
|
@ApiOperation(value = "获取健康建议列表")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String getTemplateAdvice(@ApiParam(value = "筛查模板code")@RequestParam(value = "templateCode") String templateCode) {
|
|
|
|
|
|
public String getTemplateAdvice(@ApiParam(value = "筛查模板code") @RequestParam(value = "templateCode") String templateCode) {
|
|
try {
|
|
try {
|
|
return write(200, "获取成功!", "data", surveyScreenResultService.getTemplateAdviceList(templateCode));
|
|
return write(200, "获取成功!", "data", surveyScreenResultService.getTemplateAdviceList(templateCode));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@ -136,14 +144,14 @@ public class DoctorSurveyScreenResultController extends WeixinBaseController {
|
|
@RequestMapping(value = "updateAfterFollwoing", method = RequestMethod.POST)
|
|
@RequestMapping(value = "updateAfterFollwoing", method = RequestMethod.POST)
|
|
@ApiOperation(value = "医生跟踪")
|
|
@ApiOperation(value = "医生跟踪")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String updateAfterFollwoing(@ApiParam(value = "筛查记录code")@RequestParam(value = "code") String code,
|
|
|
|
@ApiParam(value = "建议code,多个逗号隔开")@RequestParam(value = "adviceCodes") String advicCcodes,
|
|
|
|
@ApiParam(value = "其他建议")@RequestParam(value = "otherAdvice",required = false) String otherAdvice) {
|
|
|
|
|
|
public String updateAfterFollwoing(@ApiParam(value = "筛查记录code") @RequestParam(value = "code") String code,
|
|
|
|
@ApiParam(value = "建议code,多个逗号隔开") @RequestParam(value = "adviceCodes") String advicCcodes,
|
|
|
|
@ApiParam(value = "其他建议") @RequestParam(value = "otherAdvice", required = false) String otherAdvice) {
|
|
try {
|
|
try {
|
|
if (otherAdvice.length()>200){
|
|
|
|
return write(-1,"其他建议的字数不得超过200字");
|
|
|
|
|
|
if (otherAdvice.length() > 200) {
|
|
|
|
return write(-1, "其他建议的字数不得超过200字");
|
|
}
|
|
}
|
|
surveyScreenResultService.updateAfterFollowing(code,advicCcodes,otherAdvice);
|
|
|
|
|
|
surveyScreenResultService.updateAfterFollowing(code, advicCcodes, otherAdvice);
|
|
return write(200, "跟踪成功!");
|
|
return write(200, "跟踪成功!");
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@ -154,9 +162,9 @@ public class DoctorSurveyScreenResultController extends WeixinBaseController {
|
|
@RequestMapping(value = "updateAfterEducate", method = RequestMethod.POST)
|
|
@RequestMapping(value = "updateAfterEducate", method = RequestMethod.POST)
|
|
@ApiOperation(value = "医生筛查后进行健康教育")
|
|
@ApiOperation(value = "医生筛查后进行健康教育")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String updateAfterEducate(@ApiParam(value = "筛查记录code")@RequestParam(value = "code") String code) {
|
|
|
|
|
|
public String updateAfterEducate(@ApiParam(value = "筛查记录code") @RequestParam(value = "code") String code) {
|
|
try {
|
|
try {
|
|
surveyScreenResultService.updateColume("is_educate",1,code);
|
|
|
|
|
|
surveyScreenResultService.updateColume("is_educate", 1, code);
|
|
return write(200, "更新健康教育成功!");
|
|
return write(200, "更新健康教育成功!");
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@ -169,7 +177,7 @@ public class DoctorSurveyScreenResultController extends WeixinBaseController {
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String screenStatics() {
|
|
public String screenStatics() {
|
|
try {
|
|
try {
|
|
return write(200, "获取数据成功!","data",surveyScreenResultService.screenStatics(getUID()));
|
|
|
|
|
|
return write(200, "获取数据成功!", "data", surveyScreenResultService.screenStatics(getUID()));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
return write(-1, "获取数据失败!");
|
|
return write(-1, "获取数据失败!");
|
|
@ -186,10 +194,10 @@ public class DoctorSurveyScreenResultController extends WeixinBaseController {
|
|
@ApiOperation(value = "获取筛选条件数量(医生所签约)")
|
|
@ApiOperation(value = "获取筛选条件数量(医生所签约)")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String getAmountByDoctor(
|
|
public String getAmountByDoctor(
|
|
@ApiParam(value = "筛选条件",defaultValue = "{\"sex\":1,\"disease\":[2,5,6],\"healthCondition\":[0],\"service\":[1,3]}")
|
|
|
|
|
|
@ApiParam(value = "筛选条件", defaultValue = "{\"sex\":1,\"disease\":[2,5,6],\"healthCondition\":[0],\"service\":[1,3]}")
|
|
@RequestParam String json) {
|
|
@RequestParam String json) {
|
|
try {
|
|
try {
|
|
int amount = surveyScreenResultService.getAmountByDoctor(json,getUID());
|
|
|
|
|
|
int amount = surveyScreenResultService.getAmountByDoctor(json, getUID());
|
|
return write(200, "查询成功!", "amount", amount);
|
|
return write(200, "查询成功!", "amount", amount);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@ -225,14 +233,14 @@ public class DoctorSurveyScreenResultController extends WeixinBaseController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/getCount",method = RequestMethod.POST)
|
|
|
|
|
|
@RequestMapping(value = "/getCount", method = RequestMethod.POST)
|
|
@ApiOperation(value = "确认疾病筛查推送人数")
|
|
@ApiOperation(value = "确认疾病筛查推送人数")
|
|
public String getCount(@ApiParam(name = "labelType", value = "疾病类型", defaultValue = "3")
|
|
public String getCount(@ApiParam(name = "labelType", value = "疾病类型", defaultValue = "3")
|
|
@RequestParam(value = "labelType", required = false) String labelType,
|
|
|
|
@ApiParam(name = "serverType",value = "服务类型,多个条件以逗号分割")
|
|
|
|
@RequestParam(value = "serverType", required = false) String serverType,
|
|
|
|
@ApiParam(name = "teamCode",value = "行政团队id")
|
|
|
|
@RequestParam(value = "teamCode", required = true) Long teamCode){
|
|
|
|
|
|
@RequestParam(value = "labelType", required = false) String labelType,
|
|
|
|
@ApiParam(name = "serverType", value = "服务类型,多个条件以逗号分割")
|
|
|
|
@RequestParam(value = "serverType", required = false) String serverType,
|
|
|
|
@ApiParam(name = "teamCode", value = "行政团队id")
|
|
|
|
@RequestParam(value = "teamCode", required = true) Long teamCode) {
|
|
try {
|
|
try {
|
|
List<Map<String, Object>> patientInfo = surveyScreenResultService.initPatient(getUID(), labelType, serverType, teamCode);
|
|
List<Map<String, Object>> patientInfo = surveyScreenResultService.initPatient(getUID(), labelType, serverType, teamCode);
|
|
return write(200, "查询成功!", "data", patientInfo.size());
|
|
return write(200, "查询成功!", "data", patientInfo.size());
|
|
@ -243,22 +251,50 @@ public class DoctorSurveyScreenResultController extends WeixinBaseController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/createWorkOrder",method = RequestMethod.POST)
|
|
|
|
|
|
@RequestMapping(value = "/createWorkOrder", method = RequestMethod.POST)
|
|
@ApiOperation(value = "创建协同服务")
|
|
@ApiOperation(value = "创建协同服务")
|
|
public String getAllQuestions(@ApiParam(name = "jsonData",value = "协同服务json字符串")
|
|
|
|
@RequestParam(value = "jsonData",required = true)String jsonData,
|
|
|
|
@ApiParam(name = "labelType", value = "疾病类型", defaultValue = "3")
|
|
|
|
@RequestParam(value = "labelType", required = false) String labelType,
|
|
|
|
@ApiParam(name = "serverType",value = "服务类型,多个条件以逗号分割")
|
|
|
|
@RequestParam(value = "serverType", required = false) String serverType,
|
|
|
|
@ApiParam(name = "teamCode",value = "行政团队id")
|
|
|
|
@RequestParam(value = "teamCode", required = true) Long teamCode){
|
|
|
|
|
|
public String getAllQuestions(@ApiParam(name = "jsonData", value = "协同服务json字符串")
|
|
|
|
@RequestParam(value = "jsonData", required = true) String jsonData,
|
|
|
|
@ApiParam(name = "patientInfo", value = "居民信息")
|
|
|
|
@RequestParam(value = "patientInfo", required = true) String patientInfo) {
|
|
try {
|
|
try {
|
|
List<Map<String, Object>> patientInfo = surveyScreenResultService.initPatient(getUID(), labelType, serverType, teamCode);
|
|
|
|
return write(200, "创建成功!", "data", surveyScreenResultService.createWorkOrder(jsonData, patientInfo, getUID()));
|
|
return write(200, "创建成功!", "data", surveyScreenResultService.createWorkOrder(jsonData, patientInfo, getUID()));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
return write(-1, "创建失败!");
|
|
return write(-1, "创建失败!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "doctorSendScreenToPatients", method = RequestMethod.GET)
|
|
|
|
@ApiOperation("确认疾病筛查推送人数")
|
|
|
|
public String doctorSendArticleToPatients(
|
|
|
|
@RequestParam(value = "patient", required = false) String patient,
|
|
|
|
@RequestParam(value = "group", required = false, defaultValue = "") String group,
|
|
|
|
@RequestParam(value = "labelType", required = false) String labelType,
|
|
|
|
@RequestParam(value = "teamCode", required = true) Long teamCode) {
|
|
|
|
try {
|
|
|
|
String[] patients = new String[]{};
|
|
|
|
String[] groups = new String[]{};
|
|
|
|
if (StringUtils.isEmpty(patient) && StringUtils.isEmpty(group)) {
|
|
|
|
return new String("请至少选择一个患者!");
|
|
|
|
} else {
|
|
|
|
if (StringUtils.isNotBlank(group)) {
|
|
|
|
if (group.contains(",")) {
|
|
|
|
groups = group.split(",");
|
|
|
|
} else {
|
|
|
|
groups = new String[]{group};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Set<String> patientSet = new HashSet<>(); //放入set中可以去重复
|
|
|
|
List<Map<String, Object>> patientInfo = surveyScreenResultService.initPatients(getUID(), groups, group, labelType, teamCode, patient, patientSet);
|
|
|
|
if (patientInfo.size() == 0) {
|
|
|
|
return new String("请至少选择一个患者!");
|
|
|
|
}
|
|
|
|
return write(200, "查询成功!", "data", patientInfo);
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
return write(-1, "查询失败!");
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|