Bladeren bron

康复代码

suqinyi 1 jaar geleden
bovenliggende
commit
3ac4a3854c

+ 85 - 0
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/controller/DoctorDiagnosisInformationController.java

@ -0,0 +1,85 @@
package com.yihu.jw.hospital.module.rehabilitation.controller;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.service.BaseDoctorInfoService;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.hospital.module.rehabilitation.service.DiagnosisInformationService;
import com.yihu.jw.restmodel.web.Envelop;
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.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;
/**
 * Created by humingfen on 2019/2/11.
 */
@RestController
@RequestMapping(value = "/doctor/specialist/diagnosisInformation", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端-诊疗信息管理")
public class DoctorDiagnosisInformationController extends EnvelopRestEndpoint {
    @Autowired
    private BaseDoctorInfoService doctorService;
    @Autowired
    private BaseDoctorDao doctorDao;
    @Autowired
    private DiagnosisInformationService diagnosisInformationService;
//    @RequestMapping(value = "/createDiagnosisInformation", method = RequestMethod.POST)
//    @ApiOperation(value = "创建诊疗信息")
//    public String createDiagnosisInformation(
//            @ApiParam(name = "patient", value = "居民code") @RequestParam String patient,
//            @ApiParam(name = "patientName", value = "居民姓名") @RequestParam String patientName,
//            @ApiParam(name = "planId", value = "康复计划id") @RequestParam String planId,
//            @ApiParam(name = "hospital", value = "诊疗医院code") @RequestParam(required = false) String hospital,
//            @ApiParam(name = "hospitalName", value = "诊疗医院名称") @RequestParam String hospitalName,
//            @ApiParam(name = "department", value = "入院科室") @RequestParam String department,
//            @ApiParam(name = "attendingDoctorName", value = "主治医生名称") @RequestParam String attendingDoctorName,
//            @ApiParam(name = "admittingDiagnosis", value = "入院诊断") @RequestParam String admittingDiagnosis,
//            @ApiParam(name = "dischargeDiagnosis", value = "出院诊断") @RequestParam String dischargeDiagnosis,
//            @ApiParam(name = "advice", value = "医嘱小结") @RequestParam String advice,
//            @ApiParam(name = "dischargeTime", value = "出院时间") @RequestParam String dischargeTime) {
//        try {
//            BaseDoctorDO d = doctorDao.findById(getUID()).orElse(null);
//            //i健康调用2.0
//            Envelop information = diagnosisInformationService.createDiagnosisInformation(patient, patientName, planId, hospital, hospitalName, department,
//                    attendingDoctorName, admittingDiagnosis, dischargeDiagnosis, advice, dischargeTime, d);
//            return write(200, "保存成功", "data",information);
//        } catch (Exception e) {
//            return error(-1,e.getMessage());
//        }
//    }
    @RequestMapping(value = "/findDiagnosisInformationByPlanId", method = RequestMethod.GET)
    @ApiOperation(value = "根据康复计划id获取诊疗信息")
    public String findDiagnosisInformationByPlanId(@ApiParam(name = "planId", value = "康复计划id")
                                                   @RequestParam String planId) {
        try {
            return write(200, "获取成功", "data", diagnosisInformationService.findDiagnosisInformationByPlanId(planId));
        } catch (Exception e) {
            return error(-1,e.getMessage());
        }
    }
    @RequestMapping(value = "/findDiagnosisInformationByPatient", method = RequestMethod.GET)
    @ApiOperation(value = "根据居民获取诊疗信息")
    public String findDiagnosisInformationByPatient(@ApiParam(name = "patient", value = "居民code")
                                                    @RequestParam(value = "patient") String patient,
                                                    @ApiParam(name = "page", value = "第几页,page从0开始")
                                                    @RequestParam(value = "page") Integer page,
                                                    @ApiParam(name = "size", value = "行数")
                                                    @RequestParam(value = "size") Integer size) {
        try {
            return write(200, "获取成功", "data", diagnosisInformationService.findDiagnosisInformationByPatient(patient, page, size));
        } catch (Exception e) {
            return error(-1,e.getMessage());
        }
    }
}

+ 243 - 0
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/controller/DoctorRehabilitaionInfoController.java

@ -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());;
//        }
//    }
}

+ 1 - 2
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/controller/RehabilitationPlanController.java

@ -42,8 +42,7 @@ public class RehabilitationPlanController extends EnvelopRestEndpoint {
    @Autowired
    private RehabilitationPlanService rehabilitationPlanService;
    //    @Autowired
//    private Tracer tracer;
    @Autowired
    private RehabilitationOperateRecordsDao rehabilitationOperateRecordsDao;
    @Autowired

+ 28 - 0
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/service/DiagnosisInformationService.java

@ -9,6 +9,8 @@ import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.rm.specialist.SpecialistMapping;
import org.apache.commons.collections.map.HashedMap;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
@ -16,6 +18,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * Created by humingfen on 2019/1/11.
@ -33,6 +37,30 @@ public class DiagnosisInformationService extends BaseJpaService<PatientDiagnosis
     * @return
     */
    public Envelop createDiagnosisInformation(PatientDiagnosisInformationDO diagnosisInformationDO) {
//        JSONObject json = new JSONObject();
//        json.put("patient", patient);
//        json.put("patientName", patientName);
//        json.put("hospital", hospital);
//        json.put("hospitalName", hospitalName);
//        json.put("planId", planId);
//        json.put("department", department);
//        json.put("attendingDoctorName", attendingDoctorName);
//        List<Doctor> d = doctorDao.findDoctorByName(attendingDoctorName);
//        if(d != null && d.size() == 1){
//            json.put("attendingDoctorCode", d.get(0).getCode());
//        }
//        json.put("admittingDiagnosis", admittingDiagnosis);
//        json.put("dischargeDiagnosis", dischargeDiagnosis);
//        json.put("advice", advice);
//        json.put("createUser", doctor.getCode());
//        json.put("createUserName", doctor.getName());
//        json.put("dischargeTime", dischargeTime);
//        Map<String, Object> param = new HashedMap();
//        param.put("diagnosisInformationJson", json.toString());
//        PatientDiagnosisInformationDO diagnosisInformationDO = objectMapper.readValue(diagnosisInformationJson, PatientDiagnosisInformationDO.class);
        Date date = new Date();
        diagnosisInformationDO.setCreateTime(date);
        diagnosisInformationDao.save(diagnosisInformationDO);

+ 3 - 5
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/service/RehabilitationInfoService.java

@ -801,11 +801,9 @@ public class RehabilitationInfoService  {
//    }
    /**
     *
     * @param patientInfo
     * @param type 1患者家签列表 2康复下转列表
     * @param doctorCode
     * @return
     * patientInfo
     * type 1患者家签列表 2康复下转列表
     * doctorCode
     */
//    public JSONObject getPatientByIdcardOrSsc(String patientInfo, Integer type, String doctorCode) {
//        //加签列表查询wlyy_patient_discharge表,与type无关。当家签处添加时(即type=1),统一保存type=2的记录