瀏覽代碼

患者就诊/住院记录,添加获取科室,更据科室,姓名查询就诊信息列表,根据患者ID查询所有信息列表

Ciallo 10 月之前
父節點
當前提交
ae938b85c4

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/PatientController.java

@@ -28,6 +28,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
 @RestController
 @RequestMapping("/work/patient")
 public class PatientController extends BaseController {
+
     @Autowired
     private IPatientService patientService;
 
@@ -42,7 +43,6 @@ public class PatientController extends BaseController {
     }
 
 
-
     @ApiOperation(value = "获取患者信息列表")
     @Anonymous
     //@PreAuthorize("@ss.hasPermi('work:patient:list')")
@@ -53,7 +53,7 @@ public class PatientController extends BaseController {
         return getDataTable(list);
     }
 
-    @ApiOperation(value = "根据id查询信息")
+    @ApiOperation(value = "根据id查询患者个人信息")
     @Anonymous
     //@PreAuthorize("@ss.hasPermi('work:patient:query')")
     @GetMapping(value = "/detail/{id}")

+ 13 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/Pv1Controller.java

@@ -34,13 +34,23 @@ public class Pv1Controller extends BaseController {
     @Autowired
     private IPv1Service pv1Service;
 
+    @ApiOperation(value = "获取所有科室")
+    @Anonymous
+    @GetMapping("/department")
+    public TableDataInfo getAllDepartment() {
+        startPage();
+        List<PatientCard> list=pv1Service.getAllDepartment();
+        return getDataTable(list);
+    }
+
+
 
     @ApiOperation(value = "根据姓名、科室、病种查询就诊信息列表")
     @Anonymous
     @GetMapping("/patientCard")
-    public TableDataInfo getPatientCardByNameOrRoomOrEntity(@RequestParam("patientName") String patientName,
-                                                            @RequestParam("departmentName") String departmentName,
-                                                            @RequestParam("entity") String entity) {
+    public TableDataInfo getPatientCardByNameOrRoomOrEntity(@RequestParam(value = "patientName",required = false) String patientName,
+                                                            @RequestParam(value = "departmentName",required = false) String departmentName,
+                                                            @RequestParam(value = "entity",required = false) String entity) {
         startPage();
         List<PatientCard> list=pv1Service.getPatientCardByNameOrRoomOrEntity(patientName,departmentName,entity);
         return getDataTable(list);

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/Patient.java

@@ -110,7 +110,7 @@ public class Patient{
     private Date updateTime;
 
     @ApiModelProperty(value = "消息体主表ID")
-    private String msgId;
+    private String msgType;
 
 
 }

+ 6 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/Pv1.java

@@ -100,5 +100,11 @@ public class Pv1{
     @ApiModelProperty(value = "患者信息ID")
     private Long msgId;
 
+    @ApiModelProperty(value = "病区代码")
+    private String wardCode;
+
+    @ApiModelProperty(value = "病区代名称")
+    private String wardName;
+
 
 }

+ 3 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/Pv1Mapper.java

@@ -7,6 +7,7 @@ import com.ruoyi.web.work.domain.Patient;
 import com.ruoyi.web.work.domain.PatientCard;
 import com.ruoyi.web.work.domain.Pv1;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * @author lsw
@@ -15,8 +16,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 public interface Pv1Mapper extends BaseMapper<Pv1> {
     List<Pv1> selectList(Pv1 pv1);
 
-    List<PatientCard> getPatientCardByNameOrRoomOrEntity(String patientName, String departmentName, String entity);
+    List<PatientCard> getPatientCardByNameOrRoomOrEntity(@Param("patientName") String patientName,@Param("departmentName") String departmentName,@Param("entity") String entity);
 
     List<Pv1> getPv1ByPatientId(Integer id);
 
+    List<PatientCard> getAllDepartment();
 }

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IPatientService.java

@@ -12,6 +12,6 @@ import com.ruoyi.web.work.domain.PatientCard;
 public interface IPatientService extends IService<Patient>{
     List<Patient> selectList(Patient patient);
 
-
     List<PatientCard> getPatientByDepartment(String department);
+
 }

+ 1 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IPv1Service.java

@@ -19,4 +19,5 @@ public interface IPv1Service extends IService<Pv1>{
     Map<String, Object> getPatientCardPatientId(Integer id);
 
 
+    List<PatientCard> getAllDepartment();
 }

+ 5 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/Pv1ServiceImpl.java

@@ -40,7 +40,7 @@ public class Pv1ServiceImpl extends ServiceImpl<Pv1Mapper, Pv1> implements IPv1S
 
     @Override
     public List<PatientCard> getPatientCardByNameOrRoomOrEntity(String patientName, String departmentName, String entity) {
-        return pv1Mapper.getPatientCardByNameOrRoomOrEntity(patientName,departmentName,entity);
+          return pv1Mapper.getPatientCardByNameOrRoomOrEntity(patientName,departmentName,entity);
     }
 
     @Override
@@ -59,6 +59,10 @@ public class Pv1ServiceImpl extends ServiceImpl<Pv1Mapper, Pv1> implements IPv1S
         return map;
     }
 
+    @Override
+    public List<PatientCard> getAllDepartment() {
+        return pv1Mapper.getAllDepartment();
+    }
 
 
 }

+ 1 - 1
ruoyi-admin/src/main/resources/mapper/work/PatientMapper.xml

@@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="cardRecord != null  and cardRecord != ''"> and card_record = #{cardRecord}</if>
             <if test="cardType != null  and cardType != ''"> and card_type = #{cardType}</if>
             <if test="cardNumber != null  and cardNumber != ''"> and card_number = #{cardNumber}</if>
-            <if test="msgId != null  and msgId != ''"> and msg_id = #{msgId}</if>
+            <if test="msgType != null  and msgId != ''"> and msg_Type = #{msgType}</if>
         </where>
     </select>
 

+ 24 - 15
ruoyi-admin/src/main/resources/mapper/work/Pv1Mapper.xml

@@ -23,32 +23,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="dischargeTime != null  and dischargeTime != ''"> and discharge_time = #{dischargeTime}</if>
             <if test="msgId != null "> and msg_id = #{msgId}</if>
             <if test="department != null  and department != ''"> and department = #{department}</if>
+            <if test="wardCode != null  and wardCode != ''"> and ward_code = #{wardCode}</if>
+            <if test="wardName != null  and wardName != ''"> and ward_name = #{wardName}</if>
         </where>
     </select>
 
 
     <select id="getPatientCardByNameOrRoomOrEntity" resultType="com.ruoyi.web.work.domain.PatientCard">
-        select * from tb_pv1
-<!--        <where>-->
-<!--            <if test="patientName!=null or patientName!=''">-->
-<!--                patient_id in (select id from tb_patient where tb_patient.name=#{patientName} )-->
-<!--            </if>-->
-<!--            <if test="departmentName!=null or departmentName!=''">-->
-<!--                and department=#{departmentName}-->
-<!--            </if>-->
-<!--            <if test="entity!=null or entity!=''">-->
-<!--                and entity=#{entity}-->
-<!--            </if>-->
-<!--        </where>-->
-
-
+        SELECT
+            tb_pv1.department,
+            tb_pv1.physician,
+            tb_patient.`name`,
+            tb_pv1.discharge_method,
+            tb_pv1.discharge_time,
+            tb_pv1.patient_id
+        FROM
+            tb_pv1
+                JOIN
+            tb_patient ON tb_pv1.patient_id = tb_patient.id
+        <where>
+            <if test="patientName!='' and patientName!=null">
+                tb_patient.`name` like concat('%', #{patientName}, '%')
+            </if>
+            <if test="departmentName!='' and departmentName!= null">
+                AND tb_pv1.department like concat('%', #{departmentName}, '%')
+            </if>
+        </where>
     </select>
 
     <select id="getPv1ByPatientId" resultType="com.ruoyi.web.work.domain.Pv1">
         select * from tb_pv1 where patient_id=#{id}
     </select>
 
-
+    <select id="getAllDepartment" resultType="com.ruoyi.web.work.domain.PatientCard">
+        select department from tb_pv1
+    </select>
 
 
 </mapper>