|
@ -0,0 +1,243 @@
|
|
|
package com.yihu.jw.hospital.module.rehabilitation.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.yihu.jw.entity.specialist.rehabilitation.PatientMedicalRecordsDO;
|
|
|
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationAdviceDO;
|
|
|
import com.yihu.jw.hospital.module.rehabilitation.service.RehabilitationInfoService;
|
|
|
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.MediaType;
|
|
|
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.RestController;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/doctor/rehabilitation", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
@Api(description = "医生端-康复下转管理")
|
|
|
public class DoctorRehabilitaionInfoController extends EnvelopRestEndpoint {
|
|
|
|
|
|
@Autowired
|
|
|
private RehabilitationInfoService rehabilitationInfoService;
|
|
|
@Autowired
|
|
|
private ObjectMapper objectMapper;
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "getRehabilitationPatientList", method = RequestMethod.GET)
|
|
|
@ApiOperation("获取康复下转居民列表")
|
|
|
public String getRehabilitationPatientList(@ApiParam(name = "idcard", value = "身份证", required = false)
|
|
|
@RequestParam(value = "idcard", required = false) String idcard,
|
|
|
@ApiParam(name = "isTurnDown", value = "是否已下转 -2:未下转未家签,-1未下转 0未下转全部,;1已下转(未接收);2已下转(已接收);3已下转全部;03已下转全部+未下转全部", defaultValue = "0",required = false)
|
|
|
@RequestParam(value = "isTurnDown", required = false,defaultValue = "3") String isTurnDown ,
|
|
|
@ApiParam(name = "page", value = "起始页", required = false) @RequestParam(value = "page", required = false,defaultValue = "1") Integer page,
|
|
|
@ApiParam(name = "pagesize", value = "每页显示数据条数", required = false) @RequestParam(value = "pagesize", required = false,defaultValue = "10") Integer pagesize
|
|
|
) {
|
|
|
try {
|
|
|
if(page==null){
|
|
|
page = 1;
|
|
|
}
|
|
|
if(pagesize==null){
|
|
|
pagesize = 10;
|
|
|
}
|
|
|
JSONObject result = rehabilitationInfoService.getRehabilitationPatientList(idcard, getUID(),isTurnDown,page,pagesize);
|
|
|
return write(200, "请求成功", "data", result);
|
|
|
} catch (Exception e) {
|
|
|
return error(-1,e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
// @RequestMapping(value = "createAdvice", method = RequestMethod.POST)
|
|
|
// @ApiOperation("创建/编辑康复建议模板")
|
|
|
// public String createAdvice(@ApiParam(name = "doctorCode", value = "医生code", required = false)
|
|
|
// @RequestParam(value = "doctorCode", required = false) String doctorCode,
|
|
|
// @ApiParam(name = "code", value = "模板code")
|
|
|
// @RequestParam(value = "code", required = false) String code,
|
|
|
// @ApiParam(name = "name", value = "模板名称", required = true)
|
|
|
// @RequestParam(value = "name", required = true) String name,
|
|
|
// @ApiParam(name = "content", value = "模板内容", required = true)
|
|
|
// @RequestParam(value = "content", required = true) String content) {
|
|
|
//
|
|
|
// try {
|
|
|
// if (StringUtils.isBlank(doctorCode)) {
|
|
|
// doctorCode = getUID();
|
|
|
// }
|
|
|
// rehabilitationInfoService.createAdvice(doctorCode, code, name, content);
|
|
|
// return write(200, "更新成功");
|
|
|
// } catch (Exception e) {
|
|
|
// return error(-1,e.getMessage());
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
// @RequestMapping(value = "deleteAdvice", method = RequestMethod.POST)
|
|
|
// @ApiOperation("删除康复建议模板")
|
|
|
//
|
|
|
// public String deleteAdvice(@ApiParam(name = "id", value = "模板id")
|
|
|
// @RequestParam(value = "id", required = false) Long id) {
|
|
|
//
|
|
|
// try {
|
|
|
// rehabilitationInfoService.deleteAdvice(id);
|
|
|
// return write(200, "删除成功");
|
|
|
// } catch (Exception e) {
|
|
|
// return error(-1,e.getMessage());;
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
// @RequestMapping(value = "getAdviceListByDoctor", method = RequestMethod.GET)
|
|
|
// @ApiOperation("获取医生创建康复建议模板及系统模板")
|
|
|
// public String getAdviceListByDoctor(@ApiParam(name = "doctorCode", value = "医生code", required = false)
|
|
|
// @RequestParam(value = "doctorCode", required = false) String doctorCode) {
|
|
|
//
|
|
|
// try {
|
|
|
// if (StringUtils.isBlank(doctorCode)) {
|
|
|
// doctorCode = getUID();
|
|
|
// }
|
|
|
// List<RehabilitationAdviceDO> list = rehabilitationInfoService.getAdviceListByDoctor(doctorCode);
|
|
|
// return write(200, "请求成功", "data", list);
|
|
|
// } catch (Exception e) {
|
|
|
// return error(-1,e.getMessage());;
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
// @RequestMapping(value = "createMedicalRecords", method = RequestMethod.POST)
|
|
|
// @ApiOperation("添加编辑住院病历")
|
|
|
//
|
|
|
// public String createMedicalRecords(@ApiParam(name = "doctorCode", value = "医生code", required = false)
|
|
|
// @RequestParam(value = "doctorCode", required = false) String doctorCode,
|
|
|
// @ApiParam(name = "patient", value = "居民code")
|
|
|
// @RequestParam String patient,
|
|
|
// @ApiParam(name = "patientName", value = "居民姓名")
|
|
|
// @RequestParam String patientName,
|
|
|
// @ApiParam(name = "jsonData", value = "住院病历相关数据")
|
|
|
// @RequestParam(value = "jsonData", required = true) String jsonData,
|
|
|
// @ApiParam(name = "id", value = "模板id,编辑时传入")
|
|
|
// @RequestParam(value = "id", required = false) Long id) {
|
|
|
//
|
|
|
// try {
|
|
|
// if (StringUtils.isBlank(doctorCode)) {
|
|
|
// doctorCode = getUID();
|
|
|
// }
|
|
|
// objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
|
|
|
// PatientMedicalRecordsDO patientMedicalRecordsDO = objectMapper.readValue(jsonData, PatientMedicalRecordsDO.class);
|
|
|
// return write(200, "添加成功", "data", rehabilitationInfoService.createMedicalRecords(doctorCode, patient, patientName, patientMedicalRecordsDO, id));
|
|
|
// } catch (Exception e) {
|
|
|
// return error(-1,e.getMessage());;
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
// @RequestMapping(value = "getMedicalHistoryDetail", method = RequestMethod.GET)
|
|
|
// @ApiOperation("出院就诊详情")
|
|
|
// public String getMedicalHistoryDetail(@ApiParam(name = "code", value = "code", required = true)
|
|
|
// @RequestParam(value = "code", required = true) String code) {
|
|
|
//
|
|
|
// try {
|
|
|
// XxzxMedicalHistory history = rehabilitationInfoService.getMedicalHistoryDetail(code);
|
|
|
// return write(200, "请求成功", "data", history);
|
|
|
// } catch (Exception e) {
|
|
|
// return error(-1,e.getMessage());;
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
// @RequestMapping(value = "getMedicalHistoryList", method = RequestMethod.GET)
|
|
|
// @ApiOperation("获取厦心出院就诊记录信息")
|
|
|
// public String getMedicalHistoryList(@ApiParam(name = "code", value = "居民code", required = true)
|
|
|
// @RequestParam(value = "code", required = true) String code,
|
|
|
// @ApiParam(name = "page", value = "page", required = true)
|
|
|
// @RequestParam(value = "page", required = true) Integer page,
|
|
|
// @ApiParam(name = "size", value = "size", required = true)
|
|
|
// @RequestParam(value = "size", required = true) Integer size) {
|
|
|
// try {
|
|
|
// List<Map<String,Object>> list = rehabilitationInfoService.getMedicalHistoryList(code,page,size);
|
|
|
// return write(200, "请求成功", "data", list);
|
|
|
// } catch (Exception e) {
|
|
|
// return error(-1,e.getMessage());;
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
//
|
|
|
// @RequestMapping(value = "getDischargePatientList", method = RequestMethod.GET)
|
|
|
// @ApiOperation("获取即将出院居民列表,区分家签非家签")
|
|
|
// public String getDischargePatientList(@ApiParam(name = "hospital", value = "机构code", required = false)
|
|
|
// @RequestParam(value = "hospital", required = true) String hospital) {
|
|
|
//
|
|
|
// try {
|
|
|
// JSONObject result = rehabilitationInfoService.getDischargePatientList(hospital, getUID());
|
|
|
// return write(200, "请求成功", "data", result);
|
|
|
// } catch (Exception e) {
|
|
|
// return error(-1,e.getMessage());;
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
//
|
|
|
//
|
|
|
// @RequestMapping(value = "remindDoctorReceive", method = RequestMethod.POST)
|
|
|
// @ApiOperation("提醒家医接收")
|
|
|
// public String remindDoctorReceive(@ApiParam(name = "diseaseName", value = "疾病名称", required = true)
|
|
|
// @RequestParam(value = "diseaseName", required = true) String diseaseName,
|
|
|
// @ApiParam(name = "doctorCode", value = "全科医生", required = true)
|
|
|
// @RequestParam(value = "doctorCode", required = true) String doctorCode){
|
|
|
// try {
|
|
|
// rehabilitationInfoService.remindDoctorReceive(diseaseName,getUID() , doctorCode);
|
|
|
// return success("请求成功");
|
|
|
// } catch (Exception e) {
|
|
|
// return error(-1,e.getMessage());;
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
// @RequestMapping(value = "getDeorsumvergenceCount", method = RequestMethod.GET)
|
|
|
// @ApiOperation("康复下转已下转顶头数据")
|
|
|
// public String getDeorsumvergenceCount(){
|
|
|
// try {
|
|
|
// JSONObject result = rehabilitationInfoService.getDeorsumvergenceCount(getUID());
|
|
|
// return write(200, "请求成功", "data", result);
|
|
|
// } catch (Exception e) {
|
|
|
// return error(-1,e.getMessage());;
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
//
|
|
|
//
|
|
|
// @RequestMapping(value = "sendWxMsgRemindSign", method = RequestMethod.POST)
|
|
|
// @ApiOperation("发送微信模板提醒签约消息")
|
|
|
// public String sendWxTemplate(@ApiParam(name = "patient", value = "居民code", required = false)
|
|
|
// @RequestParam(value = "patient", required = false)String patient){
|
|
|
//
|
|
|
// try {
|
|
|
// rehabilitationInfoService.sendWxMsgRemindSign(patient);
|
|
|
// return write(200, "发送成功!");
|
|
|
// } catch (Exception e) {
|
|
|
// return error(-1,e.getMessage());;
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
// @RequestMapping(value = "getPatientByIdcardOrSsc", method = RequestMethod.POST)
|
|
|
// @ApiOperation("根据患者身份证或社保卡号进行搜索添加出院记录")
|
|
|
//
|
|
|
// public String getPatientByIdcardOrSsc(@ApiParam(name = "patientInfo", value = "居民身份证或者社保卡", required = true)
|
|
|
// @RequestParam(value = "patientInfo")String patientInfo,
|
|
|
// @ApiParam(name = "type", value = "1患者家签列表 2康复下转列表", required = true)
|
|
|
// @RequestParam(value = "type") Integer type) {
|
|
|
// try {
|
|
|
//
|
|
|
// JSONObject object = rehabilitationInfoService.getPatientByIdcardOrSsc(patientInfo, type, getUID());
|
|
|
// if(object.getInteger("status") == 200) {
|
|
|
// return write(200, "添加成功!", "data", object.get("data"));
|
|
|
// }else {
|
|
|
// return write(-1, "添加失败!", "data", object.getString("msg"));
|
|
|
// }
|
|
|
// } catch (Exception e) {
|
|
|
// return error(-1,e.getMessage());;
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
|
|
|
}
|