Browse Source

患者问诊信息

wjj 2 tuần trước cách đây
mục cha
commit
c1dedf28c9

+ 52 - 0
fs-admin/src/main/java/com/fs/his/controller/FsInquiryPatientInfoController.java

@@ -0,0 +1,52 @@
+package com.fs.his.controller;
+
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.enums.BusinessType;
+import com.fs.his.param.FsInquiryPatientParam;
+import com.fs.his.service.IFsInquiryPatientInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 问诊患者信息(FsInquiryPatientInfo)
+ */
+@RestController
+@RequestMapping("/his/inquiryPatientInfo")
+public class FsInquiryPatientInfoController extends BaseController {
+
+
+    @Autowired
+    private IFsInquiryPatientInfoService patientInfoService;
+
+
+
+
+    /**
+     * 新增患者问诊信息
+     */
+    @PreAuthorize("@ss.hasPermi('his:inquiryPatientInfo:add')")
+    @Log(title = "患者问诊信息", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsInquiryPatientParam param){
+        return toAjax(patientInfoService.insertFsInquiryPatientInfo(param));
+    }
+
+    /**
+     * 修改患者问诊信息
+     */
+    @PreAuthorize("@ss.hasPermi('his:inquiryPatientInfo:edit')")
+    @Log(title = "患者问诊信息", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsInquiryPatientParam param){
+        return toAjax(patientInfoService.updateFsInquiryPatientInfo(param));
+    }
+
+    @GetMapping("/detail/{inquiryOrderId}")
+    public AjaxResult get(@PathVariable("inquiryOrderId") Long inquiryOrderId){
+        return AjaxResult.success(patientInfoService.selectFsInquiryPatientInfo(inquiryOrderId));
+    }
+}

+ 94 - 0
fs-service/src/main/java/com/fs/his/domain/FsInquiryPatientInfo.java

@@ -0,0 +1,94 @@
+package com.fs.his.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class FsInquiryPatientInfo extends BaseEntity {
+
+    /** ID */
+    private Long id;
+
+    /**
+     * 患者id
+     */
+    private Long patientId;
+
+    /**
+     * 销售id
+     */
+    private Long companyUserId;
+    /**
+     * 患者会员id
+     */
+    private Long userId;
+    /**
+     * 问诊订单id
+     */
+    private Long inquiryOrderId;
+    /**
+     * 课程id
+     */
+    private Long courseId;
+
+    /**
+     * 就诊状态 1-初诊 2-复诊
+     */
+    private Integer diagnosisStatus;
+
+    /**
+     * 客户标签
+     */
+    private String tag;
+
+    /**
+     * 课程/档期
+     */
+    private String courseName;
+
+    /**
+     * 患者病情主诉
+     */
+    private String patientCondition;
+
+    /**
+     * 部门负责人
+     */
+    private String deptManager;
+
+    /**
+     * 医生建议及处置
+     */
+    private String doctorAdviceJson;
+
+    /**
+     * 禁忌
+     */
+    private String taboo;
+    /**
+     * 客户需求
+     */
+    private String customerRequire;
+
+    /**
+     * 职业医生
+     */
+    private String professionalDoctor;
+
+    /**
+     * 助理医生
+     */
+    private String assistantDoctor;
+
+    /**
+     * 预约时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date subTime;
+
+    private Long subDoctorId;
+
+}

+ 16 - 0
fs-service/src/main/java/com/fs/his/mapper/FsInquiryPatientInfoMapper.java

@@ -0,0 +1,16 @@
+package com.fs.his.mapper;
+
+import com.fs.his.domain.FsInquiryPatientInfo;
+import com.fs.his.vo.FsInquiryPatientVO;
+import org.apache.ibatis.annotations.Select;
+
+public interface FsInquiryPatientInfoMapper {
+
+    int insertFsInquiryPatientInfo(FsInquiryPatientInfo fsInquiryPatientInfo);
+
+    int updateFsInquiryPatientInfo(FsInquiryPatientInfo fsInquiryPatientInfo);
+
+    FsInquiryPatientInfo selectFsInquiryPatientInfoInquiryOrderId(Long inquiryOrderId);
+
+    FsInquiryPatientVO selectUserAndCompanyUserByInquiryOrderId(Long inquiryOrderId);
+}

+ 88 - 0
fs-service/src/main/java/com/fs/his/param/FsInquiryPatientParam.java

@@ -0,0 +1,88 @@
+package com.fs.his.param;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.his.vo.DoctorAdviceVO;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class FsInquiryPatientParam {
+    private Long id;
+
+    /**
+     * 患者id
+     */
+    private Long patientId;
+
+    /**
+     * 销售id
+     */
+    private Long companyUserId;
+    /**
+     * 患者会员id
+     */
+    private Long userId;
+    /**
+     * 问诊订单id
+     */
+    private Long inquiryOrderId;
+    /**
+     * 课程id
+     */
+    private Long courseId;
+
+    /**
+     * 就诊状态 1-初诊 2-复诊
+     */
+    private Integer diagnosisStatus;
+
+    /**
+     * 客户标签
+     */
+    private String tag;
+
+    /**
+     * 课程/档期
+     */
+    private String courseName;
+
+    /**
+     * 患者病情主诉
+     */
+    private String patientCondition;
+
+    /**
+     * 部门负责人
+     */
+    private String deptManager;
+
+    /**
+     * 医生建议及处置
+     */
+    private DoctorAdviceVO doctorAdviceJson;
+
+    /**
+     * 禁忌
+     */
+    private String taboo;
+    /**
+     * 客户需求
+     */
+    private String customerRequire;
+
+    /**
+     * 职业医生
+     */
+    private String professionalDoctor;
+
+    /**
+     * 助理医生
+     */
+    private String assistantDoctor;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date subTime;
+
+    private Long subDoctorId;
+}

+ 19 - 0
fs-service/src/main/java/com/fs/his/service/IFsInquiryPatientInfoService.java

@@ -0,0 +1,19 @@
+package com.fs.his.service;
+
+import com.fs.his.domain.FsInquiryPatientInfo;
+import com.fs.his.param.FsInquiryPatientParam;
+import com.fs.his.vo.FsInquiryPatientVO;
+
+/**
+ * 问诊患者信息Service接口
+ */
+public interface IFsInquiryPatientInfoService {
+
+
+    int insertFsInquiryPatientInfo(FsInquiryPatientParam fsInquiryPatientInfo);
+
+    int updateFsInquiryPatientInfo(FsInquiryPatientParam fsInquiryPatientInfo);
+
+    FsInquiryPatientVO selectFsInquiryPatientInfo(Long inquiryOrderId);
+
+}

+ 61 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsInquiryPatientInfoServiceImpl.java

@@ -0,0 +1,61 @@
+package com.fs.his.service.impl;
+
+import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson.JSON;
+import com.fs.common.BeanCopyUtils;
+import com.fs.common.exception.CustomException;
+import com.fs.his.domain.FsInquiryPatientInfo;
+import com.fs.his.mapper.FsInquiryOrderMapper;
+import com.fs.his.mapper.FsInquiryPatientInfoMapper;
+import com.fs.his.param.FsInquiryPatientParam;
+import com.fs.his.service.IFsInquiryPatientInfoService;
+import com.fs.his.vo.DoctorAdviceVO;
+import com.fs.his.vo.FsInquiryPatientVO;
+import org.checkerframework.checker.units.qual.A;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 问诊患者信息Service业务层处理
+ */
+@Service
+public class FsInquiryPatientInfoServiceImpl implements IFsInquiryPatientInfoService {
+    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    @Autowired
+    private FsInquiryPatientInfoMapper fsInquiryPatientInfoMapper;
+
+    @Autowired
+    private FsInquiryOrderMapper inquiryOrderMapper;
+    @Override
+    public int insertFsInquiryPatientInfo(FsInquiryPatientParam param) {
+        FsInquiryPatientInfo fsInquiryPatientInfo = new FsInquiryPatientInfo();
+        BeanCopyUtils.copy(param, fsInquiryPatientInfo);
+        fsInquiryPatientInfo.setDoctorAdviceJson(JSON.toJSONString(param.getDoctorAdviceJson()));
+        return fsInquiryPatientInfoMapper.insertFsInquiryPatientInfo(fsInquiryPatientInfo);
+    }
+
+    @Override
+    public int updateFsInquiryPatientInfo(FsInquiryPatientParam param) {
+        if (param.getId() == null) {
+            throw new CustomException("更新患者问诊信息错误");
+        }
+        FsInquiryPatientInfo fsInquiryPatientInfo = new FsInquiryPatientInfo();
+        BeanCopyUtils.copy(param, fsInquiryPatientInfo);
+        fsInquiryPatientInfo.setDoctorAdviceJson(JSON.toJSONString(param.getDoctorAdviceJson()));
+        return fsInquiryPatientInfoMapper.updateFsInquiryPatientInfo(fsInquiryPatientInfo);
+    }
+
+    @Override
+    public FsInquiryPatientVO selectFsInquiryPatientInfo(Long inquiryOrderId) {
+        FsInquiryPatientVO inquiryPatientVO = fsInquiryPatientInfoMapper.selectUserAndCompanyUserByInquiryOrderId(inquiryOrderId);
+        FsInquiryPatientInfo fsInquiryPatientInfo = fsInquiryPatientInfoMapper.selectFsInquiryPatientInfoInquiryOrderId(inquiryOrderId);
+        if (fsInquiryPatientInfo != null) {
+            BeanCopyUtils.copy(fsInquiryPatientInfo, inquiryPatientVO);
+            inquiryPatientVO.setDoctorAdviceJson(JSONUtil.toBean(fsInquiryPatientInfo.getDoctorAdviceJson(), DoctorAdviceVO.class));
+        }
+        return inquiryPatientVO;
+    }
+}

+ 44 - 0
fs-service/src/main/java/com/fs/his/vo/DoctorAdviceVO.java

@@ -0,0 +1,44 @@
+package com.fs.his.vo;
+
+import lombok.Data;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 医生建议
+ */
+@Data
+public class DoctorAdviceVO {
+
+    /**
+     * 诊断
+     */
+    private String diagnosis;
+
+    /**
+     * 饮食方面
+     */
+    private String foodAdvice;
+
+    /**
+     * 运动方面
+     */
+    private String sportAdvice;
+
+    /**
+     * 保健方面
+     */
+    private String healthAdvice;
+
+    /**
+     * 治疗方面
+     */
+    private List<TreatAdvice> treatmentAdvice;
+    @Data
+    static
+    class TreatAdvice{
+        private String content;
+        private String advice;
+    }
+}

+ 76 - 0
fs-service/src/main/java/com/fs/his/vo/FsInquiryPatientVO.java

@@ -0,0 +1,76 @@
+package com.fs.his.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class FsInquiryPatientVO {
+
+    private Long id;
+
+    /**
+     * 患者会员手机号
+     */
+    private String userPhone;
+
+    /**
+     * 客服姓名(销售姓名)
+     */
+    private String companyUserName;
+
+    /**
+     * 就诊状态 1-初诊 2-复诊
+     */
+    private Integer diagnosisStatus;
+
+    /**
+     * 客户标签
+     */
+    private String tag;
+
+    /**
+     * 课程/档期
+     */
+    private String courseName;
+
+    /**
+     * 患者病情主诉
+     */
+    private String patientCondition;
+
+    /**
+     * 部门负责人
+     */
+    private String deptManager;
+
+    /**
+     * 医生建议及处置
+     */
+    private DoctorAdviceVO doctorAdviceJson;
+
+    /**
+     * 禁忌
+     */
+    private String taboo;
+    /**
+     * 客户需求
+     */
+    private String customerRequire;
+
+    /**
+     * 职业医生
+     */
+    private String professionalDoctor;
+
+    /**
+     * 助理医生
+     */
+    private String assistantDoctor;
+
+    private Long subDoctorId;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date subTime;
+}

+ 108 - 0
fs-service/src/main/resources/mapper/his/FsInquiryPatientInfoMapper.xml

@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.his.mapper.FsInquiryPatientInfoMapper">
+
+    <resultMap type="FsInquiryPatientInfo" id="FsInquiryPatientInfoResult">
+        <result property="id"    column="id"    />
+        <result property="patientId"    column="patient_id"    />
+        <result property="companyUserId"    column="company_user_id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="inquiryOrderId"    column="inquiry_order_id"    />
+        <result property="courseId"    column="course_id"    />
+        <result property="diagnosisStatus"    column="diagnosis_status"    />
+        <result property="tag"    column="tag"    />
+        <result property="courseName"    column="course_name"    />
+        <result property="patientCondition"    column="patient_condition"    />
+        <result property="deptManager"    column="dept_manager"    />
+        <result property="doctorAdviceJson"    column="doctor_advice_json"    />
+        <result property="taboo"    column="taboo"    />
+        <result property="customerRequire"    column="customer_require"    />
+        <result property="professionalDoctor"    column="professional_doctor"    />
+        <result property="assistantDoctor"    column="assistant_doctor"    />
+        <result property="subTime"    column="sub_time"    />
+    </resultMap>
+
+    <sql id="selectFsInquiryPatientInfoVo">
+        select id, patient_id, company_user_id, user_id, inquiry_order_id, course_id, diagnosis_status, tag, course_name, patient_condition, dept_manager, doctor_advice_json, taboo, customer_require, professional_doctor, assistant_doctor, sub_time from fs_inquiry_patient_info
+    </sql>
+
+    <select id="selectFsInquiryPatientInfoInquiryOrderId" parameterType="Long" resultMap="FsInquiryPatientInfoResult">
+        <include refid="selectFsInquiryPatientInfoVo"/>
+        where inquiry_order_id = #{inquiryOrderId}
+    </select>
+
+    <insert id="insertFsInquiryPatientInfo" parameterType="FsInquiryPatientInfo" useGeneratedKeys="true" keyProperty="id">
+        insert into fs_inquiry_patient_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="patientId != null">patient_id,</if>
+            <if test="companyUserId != null">company_user_id,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="inquiryOrderId != null">inquiry_order_id,</if>
+            <if test="courseId != null">course_id,</if>
+            <if test="diagnosisStatus != null">diagnosis_status,</if>
+            <if test="tag != null">tag,</if>
+            <if test="courseName != null">course_name,</if>
+            <if test="patientCondition != null">patient_condition,</if>
+            <if test="deptManager != null">dept_manager,</if>
+            <if test="doctorAdviceJson != null">doctor_advice_json,</if>
+            <if test="taboo != null">taboo,</if>
+            <if test="customerRequire != null">customer_require,</if>
+            <if test="professionalDoctor != null">professional_doctor,</if>
+            <if test="assistantDoctor != null">assistant_doctor,</if>
+            <if test="subTime != null">sub_time,</if>
+            <if test="subDoctorId != null">sub_doctor_id</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="patientId != null">#{patientId},</if>
+            <if test="companyUserId != null">#{companyUserId},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="inquiryOrderId != null">#{inquiryOrderId},</if>
+            <if test="courseId != null">#{courseId},</if>
+            <if test="diagnosisStatus != null">#{diagnosisStatus},</if>
+            <if test="tag != null">#{tag},</if>
+            <if test="courseName != null">#{courseName},</if>
+            <if test="patientCondition != null">#{patientCondition},</if>
+            <if test="deptManager != null">#{deptManager},</if>
+            <if test="doctorAdviceJson != null">#{doctorAdviceJson},</if>
+            <if test="taboo != null">#{taboo},</if>
+            <if test="customerRequire != null">#{customerRequire},</if>
+            <if test="professionalDoctor != null">#{professionalDoctor},</if>
+            <if test="assistantDoctor != null">#{assistantDoctor},</if>
+            <if test="subTime != null">#{subTime},</if>
+            <if test="subDoctorId != null">#{subDoctorId},</if>
+        </trim>
+    </insert>
+
+    <update id="updateFsInquiryPatientInfo" parameterType="FsInquiryPatientInfo">
+        update fs_inquiry_patient_info
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="patientId != null">patient_id = #{patientId},</if>
+            <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="inquiryOrderId != null">inquiry_order_id = #{inquiryOrderId},</if>
+            <if test="courseId != null">course_id = #{courseId},</if>
+            <if test="diagnosisStatus != null">diagnosis_status = #{diagnosisStatus},</if>
+            <if test="tag != null">tag = #{tag},</if>
+            <if test="courseName != null">course_name = #{courseName},</if>
+            <if test="patientCondition != null">patient_condition = #{patientCondition},</if>
+            <if test="deptManager != null">dept_manager = #{deptManager},</if>
+            <if test="doctorAdviceJson != null">doctor_advice_json = #{doctorAdviceJson},</if>
+            <if test="taboo != null">taboo = #{taboo},</if>
+            <if test="customerRequire != null">customer_require = #{customerRequire},</if>
+            <if test="professionalDoctor != null">professional_doctor = #{professionalDoctor},</if>
+            <if test="assistantDoctor != null">assistant_doctor = #{assistantDoctor},</if>
+            <if test="subTime != null">sub_time = #{subTime},</if>
+            <if test="subDoctorId != null">sub_doctor_id = #{subDoctorId},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <select id="selectUserAndCompanyUserByInquiryOrderId" resultType="com.fs.his.vo.FsInquiryPatientVO">
+        SELECT cu.nick_name companyUserName ,u.phone userPhone FROM fs_inquiry_order io
+        LEFT JOIN company_user cu ON cu.user_id = io.company_user_id
+        LEFT JOIN fs_user u ON u.user_id = io.user_id
+        WHERE io.order_id = #{inquiryOrderId}
+    </select>
+</mapper>