瀏覽代碼

随访开发

hzp 8 年之前
父節點
當前提交
6505ce0aa6

+ 9 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/dict/DmDrugsGroupItem.java

@ -17,6 +17,7 @@ public class DmDrugsGroupItem extends IdEntity {
	private String groupName;// 分组名称
	private String drugsCode;// 药品代码
	private String drugsName;// 药品名称
	private String drugsUnit;// 用药单位【字典MEASURE_UNIT_DICT】
	private String drugsQpy;// 药品名称全拼
	private String drugsSpy;// 药品名称首拼
	private Integer order; //排序
@ -54,6 +55,14 @@ public class DmDrugsGroupItem extends IdEntity {
		this.drugsName = drugsName;
	}
	public String getDrugsUnit() {
		return drugsUnit;
	}
	public void setDrugsUnit(String drugsUnit) {
		this.drugsUnit = drugsUnit;
	}
	public String getDrugsQpy() {
		return drugsQpy;
	}

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/followup/Followup.java

@ -23,11 +23,11 @@ public class Followup extends IdEntity {
	private Date followupDate;
	//计划下次随访时间
	private Date followupNextDate;
	//随访类型【字典VISIT_WAY_CODE】
	//随访方式【字典FOLLOWUP_WAY_DICT】
	private String followupType;
	//随访类别【1.高血压 2.糖尿病】
	private String followupClass;
	//随访管理状态【字典MANAGER_STATUS】
	//随访管理状态【字典FOLLOWUP_MANAGER_STATUS】
	private String followupManagerStatus;
	//医生代码
	private String doctorCode;

+ 5 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/dict/DmDrugsGroupItemDao.java

@ -7,8 +7,12 @@ package com.yihu.wlyy.repository.dict;
import com.yihu.wlyy.entity.dict.DmDrugsGroupItem;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface DmDrugsGroupItemDao extends PagingAndSortingRepository<DmDrugsGroupItem, Long>, JpaSpecificationExecutor<DmDrugsGroupItem> {
import java.util.List;
public interface DmDrugsGroupItemDao extends PagingAndSortingRepository<DmDrugsGroupItem, Long>, JpaSpecificationExecutor<DmDrugsGroupItem> {
    @Query(value = "select b.* from wlyy_followup_class_drugs a,dm_drugs_group_item b left join dm_drugs_group c on c.group_code = b.group_code and c.status='1' where a.drugs_code=b.drugs_code and a.followup_class=?1 and b.status='1' order by c.order,b.order",nativeQuery = true)
    List<DmDrugsGroupItem> findByFollowupClass(String followupClass) throws Exception;
}

+ 8 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/followup/FollowUpDao.java

@ -5,11 +5,19 @@
 *******************************************************************************/
package com.yihu.wlyy.repository.followup;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import com.yihu.wlyy.entity.followup.Followup;
import java.util.Date;
import java.util.List;
public interface FollowupDao extends PagingAndSortingRepository<Followup, Long>, JpaSpecificationExecutor<Followup> {
    @Query("select a from Followup a where a.doctorCode = ?1 and a.followupDate between ?2 and ?3 and a.status <> '0'")
    List<Followup> findByDoctor(String doctor, Date begin, Date end, Pageable pageRequest) throws Exception;
}

+ 7 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/followup/FollowupContentDao.java

@ -7,8 +7,15 @@ package com.yihu.wlyy.repository.followup;
import com.yihu.wlyy.entity.followup.FollowupContent;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface FollowupContentDao extends PagingAndSortingRepository<FollowupContent, Long>, JpaSpecificationExecutor<FollowupContent> {
    @Query("select distinct a.followupProject from FollowupContent a where a.followupId=?1")
    List<String> findProjectByFollowupId(Long followupId) throws Exception;
    List<FollowupContent> findByFollowupIdAndFollowupProject(Long followupId,String followupProject);
}

+ 9 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/followup/FollowupDrugsDao.java

@ -5,10 +5,19 @@
 *******************************************************************************/
package com.yihu.wlyy.repository.followup;
import com.yihu.wlyy.entity.dict.DmDrugsGroupItem;
import com.yihu.wlyy.entity.followup.FollowupDrugs;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface FollowupDrugsDao extends PagingAndSortingRepository<FollowupDrugs, Long>, JpaSpecificationExecutor<FollowupDrugs> {
    @Modifying
    @Query("delete FollowupDrugs a where a.followupId=?1")
    int deleteByFollowupId(Long followupId) throws Exception;
    List<FollowupDrugs> findByFollowupId(Long followupId) throws Exception;
}

+ 121 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/followup/FollowupDrugsService.java

@ -0,0 +1,121 @@
package com.yihu.wlyy.service.app.followup;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.entity.dict.DmDrugsGroupItem;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.followup.Followup;
import com.yihu.wlyy.entity.followup.FollowupContent;
import com.yihu.wlyy.entity.followup.FollowupDrugs;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.repository.dict.DmDrugsGroupItemDao;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.followup.FollowupContentDao;
import com.yihu.wlyy.repository.followup.FollowupDao;
import com.yihu.wlyy.repository.followup.FollowupDrugsDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Component;
import javax.transaction.Transactional;
import java.util.*;
/**
 * 随访用药服务
 * @author hzp add 2016-12-08
 *
 */
@Component
@Transactional(rollbackOn = Exception.class)
public class FollowupDrugsService extends BaseService {
	@Autowired
	private FollowupContentDao followupContentDao;
	@Autowired
	private FollowupDrugsDao followupDrugsDao;
	@Autowired
	private DmDrugsGroupItemDao dmDrugsGroupItemDao;
	@Autowired
	private SystemDictDao systemDictDao;
	@Autowired
	private ObjectMapper objectMapper;
	private String drugsProject = "6";
	/**
	 * 获取面访用药数据
	 */
	public Map<String,Object> getFollowupDrugs(String id) throws Exception
	{
		Map<String,Object> re = new HashMap<>();
		List<FollowupContent> dataList =  followupContentDao.findByFollowupIdAndFollowupProject(Long.valueOf(id),drugsProject);
		for(FollowupContent item:dataList)
		{
			re.put(item.getFollowupKey(),item.getFollowupValue());
		}
		//获取用药记录
		List<FollowupDrugs> drugsList = followupDrugsDao.findByFollowupId(Long.valueOf(id));
		re.put("DRUG_LIST",drugsList);
		return re;
	}
	/**
	 *保存面访用药数据
	 */
	@Transactional
	public void saveFollowupDrugs(String id,String drugsData) throws Exception {
		JavaType javaType = objectMapper.getTypeFactory().constructParametricType(List.class, Map.class);
		List<Map<String,String>> list = objectMapper.readValue(drugsData,javaType);
		Long followupId = Long.valueOf(id);
		//删除原有用药记录
		followupDrugsDao.deleteByFollowupId(Long.valueOf(followupId));
		if(list!=null && list.size()>0)
		{
			List<FollowupDrugs> newList = new ArrayList<>();
			for(Map<String,String> item:list)
			{
				FollowupDrugs drug = new FollowupDrugs();
				drug.setFollowupId(followupId);
				drug.setDrugsGroup(item.get("drugsGroup"));
				drug.setDrugsCode(item.get("drugsCode"));
				drug.setDrugsName(item.get("drugsName"));
				drug.setDose(Double.valueOf(String.valueOf(item.get("dose"))));
				drug.setUnit(item.get("unit"));
				drug.setFrequency(item.get("frequency"));
				drug.setCreateTime(new Date());
				newList.add(drug);
			}
			followupDrugsDao.save(newList);
		}
	}
	/*********************************** 疾病用药 *****************************************************************/
	/**
	 *获取疾病用药
	 */
	public List<DmDrugsGroupItem> getFollowupClassDrugs(String followupClass) throws Exception {
		return dmDrugsGroupItemDao.findByFollowupClass(followupClass);
	}
}

+ 162 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/archives/DoctorArchivesController.java

@ -0,0 +1,162 @@
package com.yihu.wlyy.web.doctor.archives;
import com.yihu.wlyy.service.app.archives.PatientEventService;
import com.yihu.wlyy.service.app.archives.PatientRecordService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
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 java.util.List;
import java.util.Map;
/**
 * Created by hzp on 2016/11/24.
 */
@Controller
@RequestMapping(value = "/doctor/archives", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端-健康档案服务接口")
public class DoctorArchivesController extends BaseController {
    @Autowired
    private PatientRecordService patientRecordService;
    @Autowired
    private PatientEventService patientEventService;
    @ApiOperation("获取门诊记录/住院记录(基卫+APP)")
    @RequestMapping(value = "/event", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    public String getAllEvent(@ApiParam(name="patient",value="患者代码",defaultValue = "")
                              @RequestParam(value="patient",required = false) String patient,
                              @ApiParam(name="type",value="类型",defaultValue = "")
                              @RequestParam(value="type",required = false) String type,
                              @ApiParam(name="page",value="第几页",defaultValue = "1")
                              @RequestParam(value="page",required = true) String page,
                              @ApiParam(name="pageSize",value="每页几行",defaultValue = "10")
                              @RequestParam(value="pageSize",required = true) String pageSize,
                              @ApiParam(name="lastTime",value="最后一条时间",defaultValue = "2010-10-10 00:00:00")
                              @RequestParam(value="lastTime",required = false) String lastTime) {
        try {
            List<Map<String,String>> result = patientRecordService.getAllEvent(patient,type,page,pageSize,lastTime);
            return write(200, "获取就诊记录成功!", "data", result);
        } catch (Exception e) {
            return invalidUserException(e, -1, "获取门/急诊数据失败!");
        }
    }
    @RequestMapping(value = "/event/healthData", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取健康档案详情(基卫)")
    public String getHealthData(@ApiParam(name="patient",value="患者代码",defaultValue = "")
                                @RequestParam(value="patient",required = false) String patient,
                                @ApiParam(name="event",value="事件ID",defaultValue = "")
                                @RequestParam(value="event",required = true) String event,
                                @ApiParam(name="catalog",value="档案类型",defaultValue = "")
                                @RequestParam(value="catalog",required = true) String catalog,
                                @ApiParam(name="serial",value="该类别顺序号,默认填1",defaultValue = "1")
                                @RequestParam(value="serial",required = true) String serial) {
        try {
            String result = patientRecordService.getHealthData(patient, event, catalog, serial);
            return write(200, "获取健康档案详情成功!", "data", result);
        } catch (Exception e) {
            return invalidUserException(e, -1, "获取健康档案详情失败!");
        }
    }
    @RequestMapping(value = "/event/catalog", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("通过事件号获取档案类型列表(基卫)")
    public String getEventCatalog(@ApiParam(name="patient",value="患者代码",defaultValue = "")
                                  @RequestParam(value="patient",required = false) String patient,
                                  @ApiParam(name="event",value="事件ID",defaultValue = "")
                                  @RequestParam(value="event",required = true) String event) {
        try {
            List<Map<String,String>> result = patientRecordService.getEventCatalog(patient,event);
            return write(200, "通过事件号获取档案类型列表成功!", "data", result);
        } catch (Exception e) {
            return invalidUserException(e, -1, e.getMessage());
        }
    }
    @RequestMapping(value = "/event/drug", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取用药记录(基卫)")
    public String getDrugsList(@ApiParam(name="patient",value="患者代码",defaultValue = "")
                               @RequestParam(value="patient",required = false) String patient,
                               @ApiParam(name="page",value="第几页",defaultValue = "1")
                               @RequestParam(value="page",required = true) String page,
                               @ApiParam(name="pageSize",value="每页几行",defaultValue = "10")
                               @RequestParam(value="pageSize",required = true) String pageSize) {
        try {
            String result = patientRecordService.getDrugsListPage(patient, page, pageSize);
            return write(200, "获取用药记录成功!", "data", result);
        } catch (Exception e) {
            return invalidUserException(e, -1, "获取用药记录失败!");
        }
    }
    @ApiOperation("获取检查检验报告(基卫+APP)")
    @RequestMapping(value = "/event/report", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    public String getReportList(@ApiParam(name="patient",value="患者代码",defaultValue = "")
                                @RequestParam(value="patient",required = false) String patient,
                                @ApiParam(name="page",value="第几页",defaultValue = "1")
                                @RequestParam(value="page",required = true) String page,
                                @ApiParam(name="pageSize",value="每页几行",defaultValue = "10")
                                @RequestParam(value="pageSize",required = true) String pageSize)
    {
        try {
            List<Map<String,String>> result = patientRecordService.getExamAndLabReport(patient, page, pageSize);
            return write(200, "获取检查检验报告成功!", "data", result);
        } catch (Exception e) {
            return invalidUserException(e, -1, "获取检查检验报告失败!");
        }
    }
    /******************************************* 就诊事件管理 **********************************************************/
    @RequestMapping(value = "/event/detail", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取就诊事件详情")
    public String getEventDetail(@ApiParam(name="event",value="事件ID",defaultValue = "")
                                 @RequestParam(value="event",required = true) String event)
    {
        try {
            JSONObject result = patientEventService.getEventDetail(event);
            return write(200, "获取就诊事件详情成功!", "data", result);
        } catch (Exception e) {
            return invalidUserException(e, -1, "获取就诊事件详情失败!");
        }
    }
    @RequestMapping(value = "/event/save", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("保存就诊事件详情")
    public String saveEventDetail(@ApiParam(name="data",value="就诊事件json数据",defaultValue = "")
                                 @RequestParam(value="data",required = true) String data)
    {
        try {
            patientEventService.saveEventDetail(data);
            return write(200, "保存就诊事件成功!");
        } catch (Exception e) {
            return invalidUserException(e, -1, "保存就诊事件失败!");
        }
    }
}

+ 27 - 66
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/followup/DoctorFollowUpController.java

@ -2,13 +2,11 @@ package com.yihu.wlyy.web.doctor.followup;
import java.util.*;
import com.yihu.wlyy.service.app.followup.FollowUpService;
import com.yihu.wlyy.entity.followup.Followup;
import com.yihu.wlyy.service.app.followup.FollowupService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
@ -17,10 +15,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.BaseController;
/**
@ -32,10 +26,10 @@ import com.yihu.wlyy.web.BaseController;
@Controller
@RequestMapping(value = "/doctor/followup", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端-随访接口")
public class DoctorFollowUpController extends BaseController {
public class DoctorFollowupController extends BaseController {
	@Autowired
	private FollowUpService followUpService;
	private FollowupService followUpService;
	/*************************************** 随访计划 ****************************************************************************/
	@ApiOperation("获取随访列表")
@ -50,7 +44,7 @@ public class DoctorFollowUpController extends BaseController {
							  @ApiParam(name="pageSize",value="每页几行",defaultValue = "10")
							  @RequestParam(value="pageSize",required = true) String pageSize) {
		try {
			List<Map<String,String>> result = followUpService.getListByDoctor(getUID(),startTime,endTime,page,pageSize);
			List<Followup> result = followUpService.getListByDoctor(getUID(),startTime,endTime,page,pageSize);
			return write(200, "获取随访列表成功!", "data", result);
		} catch (Exception e) {
@ -61,7 +55,7 @@ public class DoctorFollowUpController extends BaseController {
	@ApiOperation("新增随访计划(简单)")
	@RequestMapping(value = "/addFollowupPlan", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
	@ResponseBody
	public String addFollowupPlan(@ApiParam(name="patient",value="患者代码",defaultValue = "")
	public String addFollowupPlan(@ApiParam(name="patient",value="患者代码",defaultValue = "443a196ef8744536a531260eb26c05d7")
						  @RequestParam(value="patient",required = true) String patient,
						  @ApiParam(name="date",value="下次随访时间",defaultValue = "2016-12-14 20:00:00")
						  @RequestParam(value="date",required = true) String date) {
@ -80,36 +74,35 @@ public class DoctorFollowUpController extends BaseController {
	@ResponseBody
	public String startFollowup(@ApiParam(name="id",value="随访记录ID",defaultValue = "")
								 @RequestParam(value="id",required = true) String id,
								 @ApiParam(name="date",value="下次随访时间",defaultValue = "2016-12-14 20:00:00")
								 @ApiParam(name="date",value="随访时间",defaultValue = "2016-12-14 20:00:00")
								 @RequestParam(value="date",required = true) String date,
								 @ApiParam(name="followupType",value="随访方式【字典VISIT_WAY_CODE】",defaultValue = "")
								 @ApiParam(name="followupType",value="随访方式【字典FOLLOWUP_WAY_DICT】",defaultValue = "12")
								 @RequestParam(value="followupType",required = true) String followupType,
								 @ApiParam(name="followupClass",value="随访方式【字典VISIT_WAY_CODE】",defaultValue = "")
								 @ApiParam(name="followupClass",value="随访类别【1.高血压 2.糖尿病】",defaultValue = "1")
								 @RequestParam(value="followupClass",required = true) String followupClass,
								 @ApiParam(name="followupManagerStatus",value="随访管理状态【字典MANAGER_STATUS】",defaultValue = "")
								 @ApiParam(name="followupManagerStatus",value="随访管理状态【字典FOLLOWUP_MANAGER_STATUS】",defaultValue = "1")
								 @RequestParam(value="followupManagerStatus",required = false) String followupManagerStatus) {
		try {
			followUpService.startFollowup(id,date,followupType,followupClass,followupManagerStatus);
			return write(200, "新增随访计划成功!");
			return write(200, "开始随访记录成功!");
		} catch (Exception e) {
			return invalidUserException(e, -1, "新增随访计划失败!");
			return invalidUserException(e, -1, "开始随访记录失败!");
		}
	}
	@ApiOperation("新增临时随访记录(返回ID)")
	@RequestMapping(value = "/addFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
	@ResponseBody
	public String addFollowup(
			                    @ApiParam(name="patient",value="患者代码",defaultValue = "")
	public String addFollowup(@ApiParam(name="patient",value="患者代码",defaultValue = "443a196ef8744536a531260eb26c05d7")
								@RequestParam(value="patient",required = true) String patient,
								@ApiParam(name="date",value="下次随访时间",defaultValue = "2016-12-14 20:00:00")
								@ApiParam(name="date",value="下次随访时间",defaultValue = "2016-12-15 20:00:00")
								@RequestParam(value="date",required = true) String date,
								@ApiParam(name="followupType",value="随访方式【字典VISIT_WAY_CODE】",defaultValue = "")
								@ApiParam(name="followupType",value="随访方式【字典FOLLOWUP_WAY_DICT】",defaultValue = "12")
								@RequestParam(value="followupType",required = true) String followupType,
								@ApiParam(name="followupClass",value="随访类别【1.高血压 2.糖尿病】",defaultValue = "")
								@ApiParam(name="followupClass",value="随访类别【1.高血压 2.糖尿病】",defaultValue = "1")
								@RequestParam(value="followupClass",required = true) String followupClass,
								@ApiParam(name="followupManagerStatus",value="随访管理状态【字典MANAGER_STATUS】",defaultValue = "")
								@ApiParam(name="followupManagerStatus",value="随访管理状态【字典FOLLOWUP_MANAGER_STATUS】",defaultValue = "1")
								@RequestParam(value="followupManagerStatus",required = false) String followupManagerStatus) {
		try {
			String response = followUpService.addFollowup(getUID(),patient,date,followupType,followupClass,followupManagerStatus);
@ -139,7 +132,7 @@ public class DoctorFollowUpController extends BaseController {
	@ApiOperation("获取面访项目列表")
	@RequestMapping(value = "/getFollowupProject", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
	@ResponseBody
	public String getFollowupProject(@ApiParam(name="id",value="随访记录ID",defaultValue = "")
	public String getFollowupProject(@ApiParam(name="id",value="随访记录ID",defaultValue = "4")
									 @RequestParam(value="id",required = true) String id)
	{
		try {
@ -154,43 +147,29 @@ public class DoctorFollowUpController extends BaseController {
	@ApiOperation("获取面访项目数据")
	@RequestMapping(value = "/getFollowupProjectData", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
	@ResponseBody
	public String getFollowupProjectData(@ApiParam(name="id",value="随访记录ID",defaultValue = "")
	public String getFollowupProjectData(@ApiParam(name="id",value="随访记录ID",defaultValue = "4")
									 @RequestParam(value="id",required = true) String id,
									 @ApiParam(name="followupProject",value="面访项目",defaultValue = "")
									 @ApiParam(name="followupProject",value="面访项目",defaultValue = "2")
									 @RequestParam(value="followupProject",required = true) String followupProject)
	{
		try {
			List<Map<String,String>> list = followUpService.getFollowupProjectData(id,followupProject);
			Map<String,String> response = followUpService.getFollowupProjectData(id,followupProject);
			return write(200, "获取面访项目数据成功!","data",list);
			return write(200, "获取面访项目数据成功!","data",response);
		} catch (Exception e) {
			return invalidUserException(e, -1, "获取面访项目数据失败!");
		}
	}
	@ApiOperation("获取面访用药数据")
	@RequestMapping(value = "/getFollowupDrugs", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
	@ResponseBody
	public String getFollowupDrugs(@ApiParam(name="id",value="随访记录ID",defaultValue = "")
									@RequestParam(value="id",required = true) String id)
	{
		try {
			List<Map<String,String>> list = followUpService.getFollowupDrugs(id);
			return write(200, "获取面访用药数据成功!","data",list);
		} catch (Exception e) {
			return invalidUserException(e, -1, "获取面访用药数据失败!");
		}
	}
	@ApiOperation("保存面访项目数据")
	@RequestMapping(value = "/saveFollowupProjectData", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
	@ResponseBody
	public String saveFollowupProjectData(@ApiParam(name="id",value="随访记录ID",defaultValue = "")
	public String saveFollowupProjectData(@ApiParam(name="id",value="随访记录ID",defaultValue = "4")
								   @RequestParam(value="id",required = true) String id,
								   @ApiParam(name="followupProject",value="面访项目",defaultValue = "")
								   @ApiParam(name="followupProject",value="面访项目",defaultValue = "2")
								   @RequestParam(value="followupProject",required = true) String followupProject,
								   @ApiParam(name="followupProjectData",value="面访项目数据",defaultValue = "")
								   @ApiParam(name="followupProjectData",value="面访项目数据",defaultValue = "{\"WEIGHT\":\"76\",\"WEIGHT_EXP\":\"60\",\"BMI\":\"11\"}")
								   @RequestParam(value="followupProjectData",required = true) String followupProjectData)
	{
		try {
@ -202,30 +181,12 @@ public class DoctorFollowUpController extends BaseController {
		}
	}
	@ApiOperation("保存面访用药数据")
	@RequestMapping(value = "/saveFollowupDrugs", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
	@ResponseBody
	public String saveFollowupDrugs(@ApiParam(name="id",value="随访记录ID",defaultValue = "")
										  @RequestParam(value="id",required = true) String id,
										  @ApiParam(name="followupProjectData",value="面访项目数据",defaultValue = "")
										  @RequestParam(value="followupProjectData",required = true) String followupProjectData,
									      @ApiParam(name="drugsData",value="面访项目数据",defaultValue = "")
										  @RequestParam(value="drugsData",required = true) String drugsData)
	{
		try {
			followUpService.saveFollowupDrugs(id,followupProjectData,drugsData);
			return write(200, "保存面访用药数据成功!");
		} catch (Exception e) {
			return invalidUserException(e, -1, "保存面访用药数据失败!");
		}
	}
	/*********************************** 电话随访 *****************************************************************/
	@ApiOperation("获取电话随访内容")
	@RequestMapping(value = "/saveFollowupPhone", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
	@RequestMapping(value = "/getFollowupPhone", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
	@ResponseBody
	public String saveFollowupPhone(@ApiParam(name="id",value="随访记录ID",defaultValue = "")
	public String getFollowupPhone(@ApiParam(name="id",value="随访记录ID",defaultValue = "")
									@RequestParam(value="id",required = true) String id) {
		try {
			String response = followUpService.getFollowupPhone(id);

+ 84 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/followup/DoctorFollowupDrugsController.java

@ -0,0 +1,84 @@
package com.yihu.wlyy.web.doctor.followup;
import com.yihu.wlyy.entity.dict.DmDrugsGroupItem;
import com.yihu.wlyy.service.app.followup.FollowupDrugsService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
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 java.util.List;
import java.util.Map;
/**
 * 医生端:随访接口
 * 
 * @author hzp add 2016-12-07
 *
 */
@Controller
@RequestMapping(value = "/doctor/followup/drugs", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端-随访用药接口")
public class DoctorFollowupDrugsController extends BaseController {
	@Autowired
	private FollowupDrugsService followupDrugsService;
	@ApiOperation("获取面访用药数据")
	@RequestMapping(value = "/getFollowupDrugs", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
	@ResponseBody
	public String getFollowupDrugs(@ApiParam(name="id",value="随访记录ID",defaultValue = "")
									@RequestParam(value="id",required = true) String id)
	{
		try {
			Map<String,Object> response = followupDrugsService.getFollowupDrugs(id);
			return write(200, "获取面访用药数据成功!","data",response);
		} catch (Exception e) {
			return invalidUserException(e, -1, "获取面访用药数据失败!"+e.getMessage());
		}
	}
	@ApiOperation("保存面访用药数据")
	@RequestMapping(value = "/saveFollowupDrugs", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
	@ResponseBody
	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 = "/getFollowupClassDrugs", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
	@ResponseBody
	public String getFollowupClassDrugs(@ApiParam(name="followupClass",value="随访类别:1.高血压 2.糖尿病",defaultValue = "")
									@RequestParam(value="followupClass",required = true) String followupClass)
	{
		try {
			List<DmDrugsGroupItem> list = followupDrugsService.getFollowupClassDrugs(followupClass);
			return write(200, "获取随访类别用药列表成功!","data",list);
		} catch (Exception e) {
			return invalidUserException(e, -1, "获取随访类别用药列表失败!"+e.getMessage());
		}
	}
}

+ 0 - 7
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/archives/PatientArchivesController.java

@ -49,7 +49,6 @@ public class PatientArchivesController extends BaseController {
            return write(200, "获取就诊记录成功!", "data", result);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "获取门/急诊数据失败!");
        }
    }
@ -68,7 +67,6 @@ public class PatientArchivesController extends BaseController {
            return write(200, "获取健康档案详情成功!", "data", result);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "获取健康档案详情失败!");
        }
    }
@ -83,7 +81,6 @@ public class PatientArchivesController extends BaseController {
            return write(200, "通过事件号获取档案类型列表成功!", "data", result);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, e.getMessage());
        }
    }
@ -101,7 +98,6 @@ public class PatientArchivesController extends BaseController {
            return write(200, "获取用药记录成功!", "data", result);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "获取用药记录失败!");
        }
    }
@ -119,7 +115,6 @@ public class PatientArchivesController extends BaseController {
            return write(200, "获取检查检验报告成功!", "data", result);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "获取检查检验报告失败!");
        }
    }
@ -136,7 +131,6 @@ public class PatientArchivesController extends BaseController {
            return write(200, "获取就诊事件详情成功!", "data", result);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "获取就诊事件详情失败!");
        }
    }
@ -152,7 +146,6 @@ public class PatientArchivesController extends BaseController {
            return write(200, "保存就诊事件成功!");
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "保存就诊事件失败!");
        }
    }