|
@ -2,32 +2,41 @@ package com.yihu.wlyy.web.third.synergy;/**
|
|
* Created by nature of king on 2018/10/8.
|
|
* Created by nature of king on 2018/10/8.
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.yihu.es.entity.FollowupContentESDO;
|
|
import com.yihu.wlyy.aop.ObserverRequired;
|
|
import com.yihu.wlyy.aop.ObserverRequired;
|
|
import com.yihu.wlyy.service.app.followup.FollowUpService;
|
|
import com.yihu.wlyy.service.app.followup.FollowUpService;
|
|
|
|
import com.yihu.wlyy.service.app.followup.FollowupDrugsService;
|
|
|
|
import com.yihu.wlyy.service.third.jw.ZyDictService;
|
|
import com.yihu.wlyy.web.BaseController;
|
|
import com.yihu.wlyy.web.BaseController;
|
|
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.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @author wangzhinan
|
|
* @author wangzhinan
|
|
* @create 2018-10-08 13:56
|
|
* @create 2018-10-08 13:56
|
|
* @desc 协同管理
|
|
* @desc 协同管理
|
|
**/
|
|
**/
|
|
@Controller
|
|
|
|
@RequestMapping(value = "/synergy", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
|
|
|
@RestController
|
|
|
|
@RequestMapping(value = "/third/synergy", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
@Api(description = "协同管理接口")
|
|
@Api(description = "协同管理接口")
|
|
public class SynergyManagerController extends BaseController{
|
|
public class SynergyManagerController extends BaseController{
|
|
@Autowired
|
|
@Autowired
|
|
private FollowUpService followUpService;
|
|
private FollowUpService followUpService;
|
|
|
|
@Autowired
|
|
|
|
private ZyDictService zyDictService;
|
|
|
|
@Autowired
|
|
|
|
private FollowupDrugsService followupDrugsService;
|
|
|
|
|
|
@ApiOperation("新增临时随访记录(返回ID)")
|
|
@ApiOperation("新增临时随访记录(返回ID)")
|
|
@RequestMapping(value = "/addFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/addFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
@ -65,14 +74,15 @@ public class SynergyManagerController extends BaseController{
|
|
@RequestMapping(value = "/saveFollowupProjectData", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/saveFollowupProjectData", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@ObserverRequired
|
|
@ObserverRequired
|
|
public String saveFollowupProjectData(@ApiParam(name = "followup", value = "随访项目对象")
|
|
|
|
|
|
public String saveFollowupProjectData(@ApiParam(name = "id", value = "随访记录id")
|
|
|
|
@RequestParam(value = "id", required = true)String id,
|
|
|
|
@ApiParam(name = "followup", value = "随访项目对象")
|
|
@RequestParam(value = "followup", required = true)String followup ) {
|
|
@RequestParam(value = "followup", required = true)String followup ) {
|
|
try {
|
|
try {
|
|
JSONArray array = JSONArray.parseArray(followup);
|
|
JSONArray array = JSONArray.parseArray(followup);
|
|
// followUpService.saveFollowupProjectData(id, followupProject, followupProjectData);
|
|
// followUpService.saveFollowupProjectData(id, followupProject, followupProjectData);
|
|
//修改为通过ES查询---2017.11.01--huangwenjie
|
|
//修改为通过ES查询---2017.11.01--huangwenjie
|
|
for (int i =0;i<array.size();i++){
|
|
for (int i =0;i<array.size();i++){
|
|
String id = array.getJSONObject(i).getString("id");
|
|
|
|
String followupProject = array.getJSONObject(i).getString("followupProject");
|
|
String followupProject = array.getJSONObject(i).getString("followupProject");
|
|
String followupProjectData = array.getJSONObject(i).getString("followupProjectData");
|
|
String followupProjectData = array.getJSONObject(i).getString("followupProjectData");
|
|
followUpService.esSaveFollowupProjectData(id, followupProject, followupProjectData);
|
|
followUpService.esSaveFollowupProjectData(id, followupProject, followupProjectData);
|
|
@ -85,20 +95,90 @@ public class SynergyManagerController extends BaseController{
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* @RequestMapping(value = "/findDictByName", method = RequestMethod.GET)
|
|
|
|
|
|
/**
|
|
|
|
* 获取药品
|
|
|
|
*
|
|
|
|
* @param name
|
|
|
|
* @param isinsulin
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
@RequestMapping(value = "/findDictByName", method = RequestMethod.POST)
|
|
@ApiOperation(value = "药品列表")
|
|
@ApiOperation(value = "药品列表")
|
|
public String findDictByName(@ApiParam(name = "name", value = "药品名称(中文或拼音首字母查询)", defaultValue = "胰岛素")
|
|
public String findDictByName(@ApiParam(name = "name", value = "药品名称(中文或拼音首字母查询)", defaultValue = "胰岛素")
|
|
@RequestParam(value = "name", required = false) String name,
|
|
@RequestParam(value = "name", required = false) String name,
|
|
@ApiParam(name = "isinsulin", value = "是否过滤胰岛素:1非胰岛素,2胰岛素", defaultValue = "")
|
|
@ApiParam(name = "isinsulin", value = "是否过滤胰岛素:1非胰岛素,2胰岛素", defaultValue = "")
|
|
@RequestParam(value = "isinsulin", required = false) String isinsulin) {
|
|
|
|
|
|
@RequestParam(value = "isinsulin", required = false) String isinsulin,
|
|
|
|
@ApiParam(name = "doctor", value = "医生code", defaultValue = "")
|
|
|
|
@RequestParam(value = "doctor", required = false) String doctor) {
|
|
try {
|
|
try {
|
|
// return write(200, "操作成功!", "data",zyDictService.findDictByDoctorAndName("e3b3bfb3644011e69616fa163e424525",name,isinsulin));
|
|
// return write(200, "操作成功!", "data",zyDictService.findDictByDoctorAndName("e3b3bfb3644011e69616fa163e424525",name,isinsulin));
|
|
return write(200, "操作成功!", "data",zyDictService.findDictByDoctorAndName(getUID(), name,isinsulin));
|
|
|
|
|
|
return write(200, "操作成功!", "data",zyDictService.findDictByDoctorAndName(doctor, name,isinsulin));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
error(e);
|
|
error(e);
|
|
return error(-1, "查询失败!");
|
|
return error(-1, "查询失败!");
|
|
}
|
|
}
|
|
}*/
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("保存面访用药数据")
|
|
|
|
@RequestMapping(value = "/saveFollowupDrugs", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
|
|
@ResponseBody
|
|
|
|
@ObserverRequired
|
|
|
|
public String saveFollowupDrugs(@ApiParam(name="id",value="随访记录ID",defaultValue = "")
|
|
|
|
@RequestParam(value="id",required = true) String id,
|
|
|
|
@ApiParam(name="drugsData",value="面访用药数据",defaultValue = "[]")
|
|
|
|
@RequestParam(value="drugsData",required = true) String drugsData)
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
followupDrugsService.saveFollowupDrugs(id,drugsData);
|
|
|
|
|
|
|
|
return write(200, "保存面访用药数据成功!");
|
|
|
|
} catch (Exception e) {
|
|
|
|
return invalidUserException(e, -1, "保存面访用药数据失败!"+e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("查询体征数据")
|
|
|
|
@RequestMapping(value = "/findByPatient", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
|
|
@ResponseBody
|
|
|
|
@ObserverRequired
|
|
|
|
public String findByPatient(@ApiParam(name="patient",value="居民code",defaultValue = "")
|
|
|
|
@RequestParam(value="patient",required = true) String patient)
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
return write(200, "查询成功","data",zyDictService.findByPatient(patient));
|
|
|
|
} catch (Exception e) {
|
|
|
|
return invalidUserException(e, -1, "查询失败"+e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("获取随访数据")
|
|
|
|
@RequestMapping(value = "/getFollowupProjectData", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
|
|
|
|
@ResponseBody
|
|
|
|
public String getFollowupProjectData(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "4")
|
|
|
|
@RequestParam(value = "id", required = true) String id,
|
|
|
|
@ApiParam(name = "followupProject", value = "随访项目", defaultValue = "2")
|
|
|
|
@RequestParam(value = "followupProject", required = true) String followupProject) {
|
|
|
|
try {
|
|
|
|
// Map<String, String> response = followUpService.getFollowupProjectData(id, followupProject);
|
|
|
|
//修改为通过ES查询---2017.11.01--huangwenjie
|
|
|
|
Map<String, String> response = followUpService.getFollowup(id);
|
|
|
|
JSONArray array = JSON.parseArray(followupProject);
|
|
|
|
List<FollowupContentESDO> followupContentESDOS = new ArrayList<>();
|
|
|
|
for (int i =0;i<array.size();i++){
|
|
|
|
FollowupContentESDO followupContentESDO = followUpService.esGetFollowupProjectData(id, array.getString(i));
|
|
|
|
followupContentESDOS.add(followupContentESDO);
|
|
|
|
}
|
|
|
|
JSONObject object = new JSONObject();
|
|
|
|
object.put("followup",response);
|
|
|
|
object.put("followupContent",followupContentESDOS);
|
|
|
|
return write(200, "获取随访项目数据成功!", "data", object);
|
|
|
|
} catch (Exception e) {
|
|
|
|
error(e);
|
|
|
|
return invalidUserException(e, -1, "获取随访项目数据失败!" + e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|