Jelajahi Sumber

Merge branch 'dev' of chenyongxing/patient-co-management into dev

chenweida 8 tahun lalu
induk
melakukan
2fe14d2bdc

+ 32 - 11
patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/controller/medicine/PhysicalExaminationController.java

@ -4,8 +4,11 @@ import com.yihu.mm.controller.BaseController;
import com.yihu.mm.entity.Patient;
import com.yihu.mm.service.PatientService;
import com.yihu.mm.service.PhysicalExaminationService;
import com.yihu.mm.util.HttpClientUtil;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
@ -13,6 +16,9 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
@RestController
@RequestMapping(value = "/medicine/physicalExamination")
public class PhysicalExaminationController extends BaseController {
@ -20,6 +26,9 @@ public class PhysicalExaminationController extends BaseController {
    @Value("${examCode}")
    private String examCode;
    @Value(("${yuerenApi}"))
    private String yuerenApi;
    @Autowired
    private PatientService patientService;
@ -30,28 +39,38 @@ public class PhysicalExaminationController extends BaseController {
    @ApiOperation(value = "获取试卷列表")
    @RequestMapping(value = "/findExames",produces="application/json;charset=UTF-8")
    @ResponseBody
    public String findExames(@ApiParam(name = "tp_type", value = "'问卷类型',(备选值:1,2,4)1:初筛问卷,2:助理问卷,4:现场问卷", required = true)@RequestParam(required = false, name = "tp_type") String tp_type) {
        physicalExaminationService.findExames(tp_type,examCode);
        return null;
    public String findExames(@ApiParam(name = "tp_type", value = "'问卷类型',(备选值:1,2,4)1:初筛问卷,2:助理问卷,4:现场问卷", required = true)@RequestParam(required = false, name = "tp_type") String tp_type,
                             HttpServletRequest req
                             ) {
        HttpSession session = req.getSession();
        String key = (String) session.getAttribute("key");
        if(StringUtils.isBlank(key)){
            key = HttpClientUtil.postBody(yuerenApi + "/phonekey", new JSONObject());
            session.setMaxInactiveInterval(60*60*4);
            session.setAttribute("key",key);
        }
        return physicalExaminationService.findExames(key,tp_type, examCode);
    }
    @ApiOperation(value = "新增预约单/获取咨询编号等信息")
    @RequestMapping(value = "/insertslip",produces="application/json;charset=UTF-8")
    @ResponseBody
    public String insertslip(@ApiParam(name = "patientCode", value = "居民code", required = true)@RequestParam(required = true, name = "patientCode") String patientCode){
    public String insertslip(@ApiParam(name = "patientCode", value = "居民code", required = true)@RequestParam(required = true, name = "patientCode") String patientCode, HttpServletRequest req){
        String key = (String) req.getSession().getAttribute("key");
        Patient patient = patientService.findByCode(patientCode);
        return physicalExaminationService.insertslip(patient);
        return physicalExaminationService.insertslip(key,patient);
    }
    @ApiOperation(value = "获取试题")
    @RequestMapping(value = "/findExames",produces="application/json;charset=UTF-8")
    @RequestMapping(value = "/findQuestion",produces="application/json;charset=UTF-8")
    @ResponseBody
    public String findQuestion(@ApiParam(name = "tp_id", value = "试卷id", required = true)@RequestParam(required = false, name = "tp_id") String tp_id,
                               @ApiParam(name = "pb_id", value = "问卷编号,第一题为0", required = true)@RequestParam(required = false, name = "pb_id") String pb_id,
                               @ApiParam(name = "pb_id", value = "咨询编号", required = true)@RequestParam(required = false, name = "pb_id") String ct_id){
        return null;
                               @ApiParam(name = "ct_id", value = "咨询编号", required = true)@RequestParam(required = false, name = "ct_id") String ct_id,
                               HttpServletRequest req){
        String key = (String) req.getSession().getAttribute("key");
        return physicalExaminationService.findQuestion(key,tp_id,pb_id,ct_id);
    }
    @ApiOperation(value = "提交试卷答案")
@ -60,9 +79,11 @@ public class PhysicalExaminationController extends BaseController {
    public String handleExam(@ApiParam(name = "tp_id", value = "试卷id", required = true)@RequestParam(required = true, name = "tp_id") String tp_id,
                               @ApiParam(name = "pb_id", value = "问卷编号,第一题为0", required = true)@RequestParam(required = true, name = "pb_id") String pb_id,
                               @ApiParam(name = "dc_answer", value = "问题答案", required = true)@RequestParam(required = true, name = "dc_answer") String dc_answer,
                             @ApiParam(name = "ct_id", value = "咨询编号", required = true)@RequestParam(required = true, name = "ct_id") String ct_id){
                             @ApiParam(name = "ct_id", value = "咨询编号", required = true)@RequestParam(required = true, name = "ct_id") String ct_id,
                            HttpServletRequest req){
        String key = (String) req.getSession().getAttribute("key");
        return physicalExaminationService.handleExam(key,tp_id,pb_id,dc_answer,ct_id);
        return null;
    }
    @ApiOperation(value = "四诊资料采集")

+ 64 - 3
patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/service/PhysicalExaminationService.java

@ -1,20 +1,81 @@
package com.yihu.mm.service;
import com.yihu.mm.entity.Patient;
import com.yihu.mm.util.HttpClientUtil;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
@Service
public class PhysicalExaminationService {
    @Value(("${yuerenApi}"))
    private String yuerenApi;
    public String findExames(String key,String type, String examCode) {
        //先获取key值
        JSONObject params = new JSONObject();
        params.put("key",key);
        params.put("tp_type", type);
        params.put("sh_id", examCode);
        return HttpClientUtil.postBody(yuerenApi + "/findtest", params);
    public void findExames(String type, String examCode) {
    }
    public String insertslip(String key,Patient patient) {
        Date date = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        JSONObject params = new JSONObject();
        params.put("key", key);
        params.put("sl_date", sdf.format(date));
        params.put("sl_state", "未签到");
        params.put("u_tel", patient.getMobile());
        params.put("u_name", patient.getName());
        Integer sex = patient.getSex();
        String sexStr = "";
        if(sex==1){
            sexStr="男";
        }else if(sex==2){
            sexStr="女";
        }
        params.put("u_sex",sexStr );
        //todo    sh_id 需要从数据库获取   wlyy_medicine_strores_no
        params.put("sh_id", "");
        params.put("u_idnum", patient.getIdcard());
        //params.put("u_native", u_native);//籍贯
        params.put("u_birthday", patient.getBirthday());
        params.put("u_province", patient.getProvinceName());
        params.put("u_city", patient.getCityName());
        params.put("u_area", patient.getTownName());
        params.put("u_address", patient.getAddress());
        //params.put("sl_pass", );//报告单是否审核通过
        return HttpClientUtil.postBody(yuerenApi + "/findtest", params);
    }
    public String insertslip(Patient patient) {
    public String findQuestion(String key, String tp_id, String pb_id, String ct_id) {
        JSONObject params = new JSONObject();
        params.put("key", key);
        params.put("ct_id", ct_id);
        params.put("tp_id", tp_id);
        params.put("pb_id", pb_id);
        String postStr = HttpClientUtil.postBody("/yueren/giveproblem", params);
        return postStr;
    }
    public String handleExam(String key, String tp_id, String pb_id, String dc_answer, String ct_id) {
        return null;
        JSONObject params = new JSONObject();
        params.put("key", key);
        params.put("ct_id", ct_id);
        params.put("tp_id", tp_id);
        params.put("pb_id", pb_id);
        params.put("dc_answer", dc_answer);
        return HttpClientUtil.postBody("/yueren/handleproblem", params);
    }
}

+ 1 - 0
patient-co-customization/patient-co-modern-medicine/src/main/resources/application.yml

@ -2,6 +2,7 @@ server:
  port: 8080
examCode:         #越人试卷题目code
yuerenApi: http://192.168.131.123:8180/wlyy_admin/yueren       #越人api调用地址
security:
  basic:

+ 14 - 14
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/yueren/YueRenController.java

@ -12,8 +12,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Map;
/**
 * Created by Administrator on 2017/8/14.
@ -33,7 +31,7 @@ public class YueRenController extends BaseController {
     * 获取每个接口需要传递的key值
     * @return
     */
    @RequestMapping(value = "/phonekey", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
    @RequestMapping(value = "/phonekey", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String getPhoneKey() {
        String postStr = remoteCall("/yueren/phonekey", new JSONObject());
@ -66,7 +64,7 @@ public class YueRenController extends BaseController {
     * @param sl_pass 报告单是否审核通过
     * @return
     */
    @RequestMapping(value = "insertslip", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
    @RequestMapping(value = "insertslip", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String insertSlip(String key, String sl_date,String sl_state,String u_tel, String u_name, String u_sex,
                             String sh_id, String u_idnum, String u_native, String u_birthday, String u_province,
@ -98,7 +96,7 @@ public class YueRenController extends BaseController {
     * @param file 附件
     * @return
     */
    @RequestMapping(value = "/uploadattachment", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
    @RequestMapping(value = "/uploadattachment", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String uploadAttachment(String file, String e_no) {
        JSONObject params = new JSONObject();
@ -117,7 +115,7 @@ public class YueRenController extends BaseController {
     * @param object_type 对象类型,备选数值(1,2,3)1脸型,2舌像,3录音
     * @return
     */
    @RequestMapping(value = "dillphoneimgdata", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
    @RequestMapping(value = "dillphoneimgdata", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String inserTemp(String key, String at_id, String answer, String answer_type, String ct_id, String object_type) {
        JSONObject params = new JSONObject();
@ -140,9 +138,11 @@ public class YueRenController extends BaseController {
     * @param sh_id 所属门店编号
     * @return
     */
    @RequestMapping(value = "findtest", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
    @RequestMapping(value = "findtest", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String findTest(String key, String tp_type, String sh_id) {
        String key1 = request.getParameter("key");
        System.out.println(key1);
        JSONObject params = new JSONObject();
        params.put("key", key);
        params.put("tp_type", tp_type);
@ -159,7 +159,7 @@ public class YueRenController extends BaseController {
     * @param pb_id 问题编号
     * @return
     */
    @RequestMapping(value = "giveproblem", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
    @RequestMapping(value = "giveproblem", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String giveproblem(String key,String ct_id, String tp_id, String pb_id) {
        JSONObject params = new JSONObject();
@ -180,7 +180,7 @@ public class YueRenController extends BaseController {
     * @param dc_answer 答案数组
     * @return 将用户提交的试卷题目的答案进行保存
     */
    @RequestMapping(value = "handleproblem", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
    @RequestMapping(value = "handleproblem", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String handleproblem(String key, String ct_id, String tp_id,String pb_id, String[] dc_answer) {
        JSONObject params = new JSONObject();
@ -199,7 +199,7 @@ public class YueRenController extends BaseController {
     * @param ct_id 咨询编号
     * @return
     */
    @RequestMapping(value = "centralizedproblem", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
    @RequestMapping(value = "centralizedproblem", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String centralizedproblem(String key, String ct_id) {
        JSONObject params = new JSONObject();
@ -215,7 +215,7 @@ public class YueRenController extends BaseController {
     * @param ct_id 咨询编号
     * @return
     */
    @RequestMapping(value = "conclusionfactor", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
    @RequestMapping(value = "conclusionfactor", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String conclusionFactor(String key, String ct_id) {
        JSONObject params = new JSONObject();
@ -233,7 +233,7 @@ public class YueRenController extends BaseController {
     * @param ct_id 咨询编号
     * @return
     */
    @RequestMapping(value = "insertconconhealth", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
    @RequestMapping(value = "insertconconhealth", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String insertConsultConclusionHealth(String key, String ct_id) {
        JSONObject params = new JSONObject();
@ -250,7 +250,7 @@ public class YueRenController extends BaseController {
     * @param reqtype 请求类型(备选数值1)
     * @return
     */
    @RequestMapping(value = "findconconhealth", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
    @RequestMapping(value = "findconconhealth", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String insertConsultConclusion(String key, String ct_id, String reqtype) {
        JSONObject params = new JSONObject();
@ -267,7 +267,7 @@ public class YueRenController extends BaseController {
     * @param ct_id 咨询编号
     * @return
     */
    @RequestMapping(value = "findintegral", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
    @RequestMapping(value = "findintegral", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String findIntegral(String key, String ct_id) {
        JSONObject params = new JSONObject();