Переглянути джерело

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

Ciallo 9 місяців тому
батько
коміт
810b8f0f4d
29 змінених файлів з 434 додано та 90 видалено
  1. 17 6
      ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/ObrController.java
  2. 25 11
      ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/ObxController.java
  3. 76 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/OrdersController.java
  4. 14 6
      ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/PatientController.java
  5. 9 15
      ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/Pv1Controller.java
  6. 68 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/Orders.java
  7. 13 3
      ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/PatientCard.java
  8. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/DgMapper.java
  9. 4 1
      ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/ObrMapper.java
  10. 3 1
      ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/ObxMapper.java
  11. 17 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/OrdersMapper.java
  12. 2 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/PatientMapper.java
  13. 4 2
      ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/Pv1Mapper.java
  14. 3 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IObrService.java
  15. 2 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IObxService.java
  16. 16 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IOrdersService.java
  17. 1 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IPatientService.java
  18. 4 3
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IPv1Service.java
  19. 13 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/ObrServiceImpl.java
  20. 12 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/ObxServiceImpl.java
  21. 32 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/OrdersServiceImpl.java
  22. 5 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/PatientServiceImpl.java
  23. 12 28
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/Pv1ServiceImpl.java
  24. 2 2
      ruoyi-admin/src/main/resources/mapper/work/DgMapper.xml
  25. 6 2
      ruoyi-admin/src/main/resources/mapper/work/ObrMapper.xml
  26. 11 2
      ruoyi-admin/src/main/resources/mapper/work/ObxMapper.xml
  27. 34 0
      ruoyi-admin/src/main/resources/mapper/work/OrdersMapper.xml
  28. 16 2
      ruoyi-admin/src/main/resources/mapper/work/PatientMapper.xml
  29. 12 5
      ruoyi-admin/src/main/resources/mapper/work/Pv1Mapper.xml

+ 17 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/ObrController.java

@@ -2,14 +2,13 @@ package com.ruoyi.web.work.controller;
 
 import java.util.Arrays;
 import java.util.List;
+
+import com.ruoyi.common.annotation.Anonymous;
+import com.ruoyi.web.work.domain.Obx;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
@@ -23,12 +22,24 @@ import com.ruoyi.common.core.page.TableDataInfo;
  * @author lsw
  * @date 2024-07-23
  */
+@Anonymous
 @RestController
 @RequestMapping("/work/obr")
 public class ObrController extends BaseController {
     @Autowired
     private IObrService obrService;
 
+    @ApiOperation(value = "根据就诊卡号获取患者的全部检测报告",notes = "通过就诊卡号获取")
+    @Anonymous
+    //@PreAuthorize("@ss.hasPermi('work:obr:list')")
+    @GetMapping("/patientObr")
+    public TableDataInfo getPatientObrByCard(@RequestParam("card") String card){
+        startPage();
+        List<Obx> list = obrService.getPatientObrByCard(card);
+        return getDataTable(list);
+    }
+
+
     @PreAuthorize("@ss.hasPermi('work:obr:list')")
     @GetMapping("/list")
     public TableDataInfo list(Obr obr){

+ 25 - 11
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/ObxController.java

@@ -2,14 +2,12 @@ package com.ruoyi.web.work.controller;
 
 import java.util.Arrays;
 import java.util.List;
+
+import com.ruoyi.common.annotation.Anonymous;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
@@ -23,13 +21,25 @@ import com.ruoyi.common.core.page.TableDataInfo;
  * @author lsw
  * @date 2024-07-23
  */
+@Anonymous
 @RestController
 @RequestMapping("/work/obx")
 public class ObxController extends BaseController {
     @Autowired
     private IObxService obxService;
 
-    @PreAuthorize("@ss.hasPermi('work:obx:list')")
+    @ApiOperation(value = "根据就诊卡号获取患者的全部检查项目",notes = "通过就诊卡号获取")
+    @Anonymous
+    //@PreAuthorize("@ss.hasPermi('work:obx:list')")
+    @GetMapping("/patientObx")
+    public TableDataInfo getPatientObxByCard(@RequestParam("card") String card){
+        startPage();
+        List<Obx> list = obxService.getPatientObxByCard(card);
+        return getDataTable(list);
+    }
+
+    @Anonymous
+    //@PreAuthorize("@ss.hasPermi('work:obx:list')")
     @GetMapping("/list")
     public TableDataInfo list(Obx obx){
         startPage();
@@ -37,27 +47,31 @@ public class ObxController extends BaseController {
         return getDataTable(list);
     }
 
-    @PreAuthorize("@ss.hasPermi('work:obx:query')")
+    @Anonymous
+    //@PreAuthorize("@ss.hasPermi('work:obx:query')")
     @GetMapping(value = "/detail/{id}")
     public AjaxResult detail(@PathVariable("id") Long id){
         return AjaxResult.success(obxService.getById(id));
     }
 
-    @PreAuthorize("@ss.hasPermi('work:obx:add')")
+    @Anonymous
+    //@PreAuthorize("@ss.hasPermi('work:obx:add')")
     @Log(title = "obx", businessType = BusinessType.INSERT)
     @PostMapping("/add")
     public AjaxResult add(@RequestBody Obx obx){
         return toAjax(obxService.save(obx));
     }
 
-    @PreAuthorize("@ss.hasPermi('work:obx:edit')")
+    @Anonymous
+    //@PreAuthorize("@ss.hasPermi('work:obx:edit')")
     @Log(title = "obx", businessType = BusinessType.UPDATE)
     @PostMapping("/edit")
     public AjaxResult edit(@RequestBody Obx obx){
         return toAjax(obxService.updateById(obx));
     }
 
-    @PreAuthorize("@ss.hasPermi('work:obx:remove')")
+    @Anonymous
+    //@PreAuthorize("@ss.hasPermi('work:obx:remove')")
     @Log(title = "obx", businessType = BusinessType.DELETE)
     @GetMapping("/remove/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids){

+ 76 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/OrdersController.java

@@ -0,0 +1,76 @@
+package com.ruoyi.web.work.controller;
+
+import java.util.Arrays;
+import java.util.List;
+
+import com.ruoyi.common.annotation.Anonymous;
+import com.ruoyi.web.work.domain.Pv1;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.web.work.domain.Orders;
+import com.ruoyi.web.work.service.IOrdersService;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * orders
+ * @author lsw
+ * @date 2024-07-24
+ */
+@Anonymous
+@RestController
+@RequestMapping("/work/orders")
+public class OrdersController extends BaseController {
+    @Autowired
+    private IOrdersService ordersService;
+
+    @ApiOperation(value = "根据就诊卡号查询患者的医嘱信息",notes = "通过就诊卡号获取")
+    @Anonymous
+    @GetMapping("/patientPv1")
+    public TableDataInfo getPatientOderByCard(@RequestParam("card") String card) {
+        startPage();
+        List<Orders> list =ordersService.getPatientOderByCard(card);
+        return getDataTable(list);
+    }
+
+
+    @PreAuthorize("@ss.hasPermi('work:orders:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(Orders orders){
+        startPage();
+        List<Orders> list = ordersService.selectList(orders);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:orders:query')")
+    @GetMapping(value = "/detail/{id}")
+    public AjaxResult detail(@PathVariable("id") Long id){
+        return AjaxResult.success(ordersService.getById(id));
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:orders:add')")
+    @Log(title = "orders", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@RequestBody Orders orders){
+        return toAjax(ordersService.save(orders));
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:orders:edit')")
+    @Log(title = "orders", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    public AjaxResult edit(@RequestBody Orders orders){
+        return toAjax(ordersService.updateById(orders));
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:orders:remove')")
+    @Log(title = "orders", businessType = BusinessType.DELETE)
+    @GetMapping("/remove/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids){
+        return toAjax(ordersService.removeByIds(Arrays.asList(ids)));
+    }
+}

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

@@ -32,17 +32,25 @@ public class PatientController extends BaseController {
     @Autowired
     private IPatientService patientService;
 
-    @ApiOperation(value = "查询科室中所有患者信息列表")
+    //@ApiOperation(value = "查询科室中所有患者就诊列表")
+    //@Anonymous
+    //@GetMapping("/department")
+    //public TableDataInfo getPatientByDepartment(@RequestParam("department")String department) {
+    //    startPage();
+    //    List<PatientCard> list=patientService.getPatientByDepartment(department);
+    //    return getDataTable(list);
+    //}
+
+    @ApiOperation(value = "根据就诊卡号获取患者信息列表")
     @Anonymous
-    @GetMapping("/department")
-    public TableDataInfo getPatientByDepartment(@RequestParam("department")String department) {
-        startPage();
+    //@PreAuthorize("@ss.hasPermi('work:patient:list')")
+    @GetMapping("/card")
+    public TableDataInfo getPatientByCard(@RequestParam("card") String card){
         startPage();
-        List<PatientCard> list=patientService.getPatientByDepartment(department);
+        List<Patient> list = patientService.getPatientByCard(card);
         return getDataTable(list);
     }
 
-
     @ApiOperation(value = "获取患者信息列表")
     @Anonymous
     //@PreAuthorize("@ss.hasPermi('work:patient:list')")

+ 9 - 15
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/Pv1Controller.java

@@ -43,30 +43,24 @@ public class Pv1Controller extends BaseController {
         return getDataTable(list);
     }
 
-
-
-    @ApiOperation(value = "根据姓名、科室、病种查询就诊信息列表")
+    @ApiOperation(value = "根据姓名、科室、主治医生查询就诊信息列表",notes = "可单条件或多条件查询,需要查哪个就传哪个")
     @Anonymous
     @GetMapping("/patientCard")
-    public TableDataInfo getPatientCardByNameOrRoomOrEntity(@RequestParam(value = "patientName",required = false) String patientName,
+    public TableDataInfo getPatientCardByNameOrDepartment(@RequestParam(value = "patientName",required = false) String patientName,
                                                             @RequestParam(value = "departmentName",required = false) String departmentName,
-                                                            @RequestParam(value = "entity",required = false) String entity) {
+                                                          @RequestParam(value = "physician",required = false) String physician){
         startPage();
-        List<PatientCard> list=pv1Service.getPatientCardByNameOrRoomOrEntity(patientName,departmentName,entity);
+        List<PatientCard> list=pv1Service.getPatientCardByNameOrDepartment(patientName,departmentName,physician);
         return getDataTable(list);
     }
 
-    @ApiOperation(value = "根据患者ID查询所有信息列表")
+    @ApiOperation(value = "根据就诊卡号查询就诊信息",notes = "通过就诊卡号获取")
     @Anonymous
-    @GetMapping("/patient")
-    public Map getPatientCardPatientId(@RequestParam("patientId")Integer id) {
+    @GetMapping("/patientPv1")
+    public TableDataInfo getPatientPv1ByCard(@RequestParam("card") String card) {
         startPage();
-        Map<String,Object> map=pv1Service.getPatientCardPatientId(id);
-        Map<String,Object> result=new HashMap<>();
-        result.put("code",200);
-        result.put("msg","success");
-        result.put("data",map);
-        return result;
+        List<Pv1> list =pv1Service.getPatientPv1ByCard(card);
+        return getDataTable(list);
     }
 
 

+ 68 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/Orders.java

@@ -0,0 +1,68 @@
+package com.ruoyi.web.work.domain;
+
+import lombok.Data;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.experimental.Accessors;
+/**
+ * @author lsw
+ * @date 2024-07-24
+ */
+@Data
+@TableName(value = "tb_orders")
+@Accessors(chain = true)
+public class Orders{
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    @ApiModelProperty(value = "就诊卡号")
+    private String cardId;
+
+    @ApiModelProperty(value = "医嘱操作码")
+    private String operation;
+
+    @ApiModelProperty(value = "申请单序号")
+    private String applicationNo;
+
+    @ApiModelProperty(value = "医嘱组号")
+    private String orderGroupNumber;
+
+    @ApiModelProperty(value = "医嘱确认状态:0需确认 1已确认")
+    private String orderStatus;
+
+    @ApiModelProperty(value = "医嘱明细数量")
+    private String orderDetailsNumber;
+
+    @ApiModelProperty(value = "医嘱录入者代码")
+    private String orderInputerCode;
+
+    @ApiModelProperty(value = "医嘱录入者")
+    private String orderInputer;
+
+    @ApiModelProperty(value = "录入标志 0-his 系统,1-医技系统")
+    private String sign;
+
+    @ApiModelProperty(value = "申请人信息代码")
+    private String orderApplicantCode;
+
+    @ApiModelProperty(value = "申请人信息名称")
+    private String orderApplicantName;
+
+    @ApiModelProperty(value = "医嘱生效日期")
+    private String effectiveDate;
+
+    @ApiModelProperty(value = "医嘱确认代码")
+    private String orderConfirmCode;
+
+    @ApiModelProperty(value = "医嘱确认姓名")
+    private String orderConfirmName;
+
+    @ApiModelProperty(value = "医嘱确认科室编码")
+    private String departmentCode;
+
+    @ApiModelProperty(value = "医嘱确认科室名称")
+    private String departmentName;
+
+
+}

+ 13 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/PatientCard.java

@@ -1,27 +1,37 @@
 package com.ruoyi.web.work.domain;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import lombok.experimental.Accessors;
 
 @Data
+@Accessors(chain = true)
 public class PatientCard {
 
     //科室
+    @ApiModelProperty(value = "科室")
     private String department;
 
     //主治医生姓名
+    @ApiModelProperty(value = "主治医生姓名")
     private String physician;
 
     //患者姓名
+    @ApiModelProperty(value = "患者姓名")
     private String name;
 
     //出院方式
+    @ApiModelProperty(value = "出院方式")
     private String dischargeMethod;
 
+
     //出院时间
+    @ApiModelProperty(value = "出院时间")
     private String dischargeTime;
-    //
-    ////患者ID
-    private Integer patientId;
+
+    //就诊卡号
+    @ApiModelProperty(value = "就诊卡号")
+    private String cardId;
     //
     ////病历号
     //private String blh;

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

@@ -11,5 +11,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 public interface DgMapper extends BaseMapper<Dg> {
     List<Dg> selectList(Dg dg);
 
-    List<Dg> getDgByPatientId(Integer id);
+    List<Dg> getDgByCard(String card);
 }

+ 4 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/ObrMapper.java

@@ -3,6 +3,7 @@ package com.ruoyi.web.work.mapper;
 import java.util.List;
 import com.ruoyi.web.work.domain.Obr;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.web.work.domain.Obx;
 
 /**
  * @author lsw
@@ -11,5 +12,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 public interface ObrMapper extends BaseMapper<Obr> {
     List<Obr> selectList(Obr obr);
 
-    List<Obr> getObrByPatientId(Integer id);
+    List<Obr> getObrByCard(String card);
+
+    List<Obx> getPatientObrByPatientId(Integer patientId);
 }

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

@@ -11,5 +11,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 public interface ObxMapper extends BaseMapper<Obx> {
     List<Obx> selectList(Obx obx);
 
-    List<Obx> getObxByPatientId(Integer id);
+    List<Obx> getObxByCard(String card);
+
+    List<Obx> getPatientObxByPatientId(Integer patientId);
 }

+ 17 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/OrdersMapper.java

@@ -0,0 +1,17 @@
+package com.ruoyi.web.work.mapper;
+
+import java.util.List;
+import com.ruoyi.web.work.domain.Orders;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.web.work.domain.Pv1;
+
+/**
+ * @author lsw
+ * @date 2024-07-24
+ */
+public interface OrdersMapper extends BaseMapper<Orders> {
+    List<Orders> selectList(Orders orders);
+
+    List<Orders> getOrdersByCard(String card);
+
+}

+ 2 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/PatientMapper.java

@@ -17,4 +17,6 @@ public interface PatientMapper extends BaseMapper<Patient> {
     List<Patient> getPatientByPatientId(Integer id);
 
     List<PatientCard> getPatientByDepartment(String department);
+
+    List<Patient> getPatientByCard(String card);
 }

+ 4 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/Pv1Mapper.java

@@ -16,9 +16,11 @@ import org.apache.ibatis.annotations.Param;
 public interface Pv1Mapper extends BaseMapper<Pv1> {
     List<Pv1> selectList(Pv1 pv1);
 
-    List<PatientCard> getPatientCardByNameOrRoomOrEntity(@Param("patientName") String patientName,@Param("departmentName") String departmentName,@Param("entity") String entity);
+    List<PatientCard> getPatientCardByNameOrDepartment(@Param("patientName") String patientName,@Param("departmentName") String departmentName,@Param("physician") String physician);
 
-    List<Pv1> getPv1ByPatientId(Integer id);
+    List<Pv1> getPv1ByCard(String card);
 
     List<PatientCard> getAllDepartment();
+
+    Integer getPatientIdByCard(String card);
 }

+ 3 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IObrService.java

@@ -3,6 +3,7 @@ package com.ruoyi.web.work.service;
 import java.util.List;
 import com.ruoyi.web.work.domain.Obr;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.web.work.domain.Obx;
 
 /**
  * @author lsw
@@ -10,4 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IObrService extends IService<Obr>{
     List<Obr> selectList(Obr obr);
+
+    List<Obx> getPatientObrByCard(String card);
 }

+ 2 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IObxService.java

@@ -10,4 +10,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IObxService extends IService<Obx>{
     List<Obx> selectList(Obx obx);
+
+    List<Obx> getPatientObxByCard(String card);
 }

+ 16 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IOrdersService.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.work.service;
+
+import java.util.List;
+import com.ruoyi.web.work.domain.Orders;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.web.work.domain.Pv1;
+
+/**
+ * @author lsw
+ * @date 2024-07-24
+ */
+public interface IOrdersService extends IService<Orders>{
+    List<Orders> selectList(Orders orders);
+
+    List<Orders> getPatientOderByCard(String card);
+}

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

@@ -14,4 +14,5 @@ public interface IPatientService extends IService<Patient>{
 
     List<PatientCard> getPatientByDepartment(String department);
 
+    List<Patient> getPatientByCard(String card);
 }

+ 4 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IPv1Service.java

@@ -14,10 +14,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
 public interface IPv1Service extends IService<Pv1>{
     List<Pv1> selectList(Pv1 pv1);
 
-    List<PatientCard> getPatientCardByNameOrRoomOrEntity(String patientName, String departmentName, String entity);
+    List<PatientCard> getPatientCardByNameOrDepartment(String patientName, String departmentName,String physician);
 
-    Map<String, Object> getPatientCardPatientId(Integer id);
+    List<PatientCard> getAllDepartment();
 
+    Integer getPatientIdByCard(String card);
 
-    List<PatientCard> getAllDepartment();
+    List<Pv1> getPatientPv1ByCard(String card);
 }

+ 13 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/ObrServiceImpl.java

@@ -1,6 +1,10 @@
 package com.ruoyi.web.work.service.impl;
 
+import java.util.Collections;
 import java.util.List;
+
+import com.ruoyi.web.work.domain.Obx;
+import com.ruoyi.web.work.mapper.Pv1Mapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.web.work.mapper.ObrMapper;
@@ -17,8 +21,17 @@ public class ObrServiceImpl extends ServiceImpl<ObrMapper, Obr> implements IObrS
     @Autowired
     private ObrMapper obrMapper;
 
+    @Autowired
+    private Pv1Mapper pv1Mapper;
+
     @Override
     public List<Obr> selectList(Obr obr) {
         return obrMapper.selectList(obr);
     }
+
+    @Override
+    public List<Obx> getPatientObrByCard(String card) {
+        Integer patientId=pv1Mapper.getPatientIdByCard(card);
+        return obrMapper.getPatientObrByPatientId(patientId);
+    }
 }

+ 12 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/ObxServiceImpl.java

@@ -1,6 +1,9 @@
 package com.ruoyi.web.work.service.impl;
 
+import java.util.Collections;
 import java.util.List;
+
+import com.ruoyi.web.work.mapper.Pv1Mapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.web.work.mapper.ObxMapper;
@@ -17,8 +20,17 @@ public class ObxServiceImpl extends ServiceImpl<ObxMapper, Obx> implements IObxS
     @Autowired
     private ObxMapper obxMapper;
 
+    @Autowired
+    private Pv1Mapper pv1Mapper;
+
     @Override
     public List<Obx> selectList(Obx obx) {
         return obxMapper.selectList(obx);
     }
+
+    @Override
+    public List<Obx> getPatientObxByCard(String card) {
+        Integer patientId=pv1Mapper.getPatientIdByCard(card);
+        return obxMapper.getPatientObxByPatientId(patientId);
+    }
 }

+ 32 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/OrdersServiceImpl.java

@@ -0,0 +1,32 @@
+package com.ruoyi.web.work.service.impl;
+
+import java.util.Collections;
+import java.util.List;
+
+import com.ruoyi.web.work.domain.Pv1;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.web.work.mapper.OrdersMapper;
+import com.ruoyi.web.work.domain.Orders;
+import com.ruoyi.web.work.service.IOrdersService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @author lsw
+ * @date 2024-07-24
+ */
+@Service
+public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, Orders> implements IOrdersService {
+    @Autowired
+    private OrdersMapper ordersMapper;
+
+    @Override
+    public List<Orders> selectList(Orders orders) {
+        return ordersMapper.selectList(orders);
+    }
+
+    @Override
+    public List<Orders> getPatientOderByCard(String card) {
+        return ordersMapper.getOrdersByCard(card);
+    }
+}

+ 5 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/PatientServiceImpl.java

@@ -30,5 +30,10 @@ public class PatientServiceImpl extends ServiceImpl<PatientMapper, Patient> impl
         return patientMapper.getPatientByDepartment(department);
     }
 
+    @Override
+    public List<Patient> getPatientByCard(String card) {
+        return patientMapper.getPatientByCard(card);
+    }
+
 
 }

+ 12 - 28
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/Pv1ServiceImpl.java

@@ -21,17 +21,6 @@ public class Pv1ServiceImpl extends ServiceImpl<Pv1Mapper, Pv1> implements IPv1S
     @Autowired
     private Pv1Mapper pv1Mapper;
 
-    @Autowired
-    private DgMapper dgMapper;
-
-    @Autowired
-    private PatientMapper patientMapper;
-
-    @Autowired
-    private ObxMapper obxMapper;
-
-    @Autowired
-    private ObrMapper obrMapper;
 
     @Override
     public List<Pv1> selectList(Pv1 pv1) {
@@ -39,30 +28,25 @@ 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);
+    public List<PatientCard> getPatientCardByNameOrDepartment(String patientName, String departmentName,String physician) {
+          return pv1Mapper.getPatientCardByNameOrDepartment(patientName,departmentName,physician);
     }
 
-    @Override
-    public Map<String, Object> getPatientCardPatientId(Integer id) {
-        List<Pv1> pv1 = pv1Mapper.getPv1ByPatientId(id);
-        List<Dg> dg=dgMapper.getDgByPatientId(id);
-        List<Patient> patient=patientMapper.getPatientByPatientId(id);
-        List<Obx> obx=obxMapper.getObxByPatientId(id);
-        List<Obr> obr=obrMapper.getObrByPatientId(id);
-        Map<String, Object> map=new HashMap<>();
-        map.put("patient",patient);
-        map.put("dg",dg);
-        map.put("obx",obx);
-        map.put("obr",obr);
-        map.put("pv1",pv1);
-        return map;
-    }
 
     @Override
     public List<PatientCard> getAllDepartment() {
         return pv1Mapper.getAllDepartment();
     }
 
+    @Override
+    public Integer getPatientIdByCard(String card) {
+        return pv1Mapper.getPatientIdByCard(card);
+    }
+
+    @Override
+    public List<Pv1> getPatientPv1ByCard(String card) {
+        return pv1Mapper.getPv1ByCard(card);
+    }
+
 
 }

+ 2 - 2
ruoyi-admin/src/main/resources/mapper/work/DgMapper.xml

@@ -15,8 +15,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
 
-    <select id="getDgByPatientId" resultType="com.ruoyi.web.work.domain.Dg">
-        select * from tb_dg where patient_id=#{id}
+    <select id="getDgByCard" resultType="com.ruoyi.web.work.domain.Dg">
+        select * from tb_dg where card_id=#{card}
     </select>
 
 </mapper>

+ 6 - 2
ruoyi-admin/src/main/resources/mapper/work/ObrMapper.xml

@@ -44,8 +44,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
 
-    <select id="getObrByPatientId" resultType="com.ruoyi.web.work.domain.Obr">
-        select * from tb_obr where patient_id=#{id}
+    <select id="getObrByCard" resultType="com.ruoyi.web.work.domain.Obr">
+        select * from tb_obr where card_id=#{card}
+    </select>
+
+    <select id="getPatientObrByPatientId" resultType="com.ruoyi.web.work.domain.Obx">
+        select * from tb_obr where patient_id=#{patientId}
     </select>
 
 </mapper>

+ 11 - 2
ruoyi-admin/src/main/resources/mapper/work/ObxMapper.xml

@@ -23,8 +23,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
 
-    <select id="getObxByPatientId" resultType="com.ruoyi.web.work.domain.Obx">
-        select * from tb_obx where patient_id=#{id}
+    <select id="getObxByCard" resultType="com.ruoyi.web.work.domain.Obx">
+        SELECT * FROM tb_obx
+            JOIN tb_obr on tb_obx.obr_id=tb_obr.id
+                where tb_obr.card_id=#{card}
     </select>
 
+    <select id="getPatientObxByPatientId" resultType="com.ruoyi.web.work.domain.Obx">
+        select * from tb_obx
+            join tb_obr on tb_obx.obr_id=tb_obr.id
+                where tb_obr.patient_id=#{patientId}
+    </select>
+
+
 </mapper>

+ 34 - 0
ruoyi-admin/src/main/resources/mapper/work/OrdersMapper.xml

@@ -0,0 +1,34 @@
+<?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.ruoyi.web.work.mapper.OrdersMapper">
+
+    <select id="selectList" resultType="com.ruoyi.web.work.domain.Orders">
+        select * from tb_orders
+        <where>
+            <if test="cardId != null  and cardId != ''"> and card_id = #{cardId}</if>
+            <if test="operation != null  and operation != ''"> and operation = #{operation}</if>
+            <if test="applicationNo != null  and applicationNo != ''"> and application_no = #{applicationNo}</if>
+            <if test="orderGroupNumber != null  and orderGroupNumber != ''"> and order_group_number = #{orderGroupNumber}</if>
+            <if test="orderStatus != null  and orderStatus != ''"> and order_status = #{orderStatus}</if>
+            <if test="orderDetailsNumber != null  and orderDetailsNumber != ''"> and order_details_number = #{orderDetailsNumber}</if>
+            <if test="orderInputerCode != null  and orderInputerCode != ''"> and order_inputer_code = #{orderInputerCode}</if>
+            <if test="orderInputer != null  and orderInputer != ''"> and order_inputer = #{orderInputer}</if>
+            <if test="sign != null  and sign != ''"> and sign = #{sign}</if>
+            <if test="orderApplicantCode != null  and orderApplicantCode != ''"> and order_applicant_code = #{orderApplicantCode}</if>
+            <if test="orderApplicantName != null  and orderApplicantName != ''"> and order_applicant_name like concat('%', #{orderApplicantName}, '%')</if>
+            <if test="effectiveDate != null  and effectiveDate != ''"> and effective_date = #{effectiveDate}</if>
+            <if test="orderConfirmCode != null  and orderConfirmCode != ''"> and order_confirm_code = #{orderConfirmCode}</if>
+            <if test="orderConfirmName != null  and orderConfirmName != ''"> and order_confirm_name like concat('%', #{orderConfirmName}, '%')</if>
+            <if test="departmentCode != null  and departmentCode != ''"> and department_code = #{departmentCode}</if>
+            <if test="departmentName != null  and departmentName != ''"> and department_name like concat('%', #{departmentName}, '%')</if>
+        </where>
+    </select>
+
+    <select id="getOrdersByCard" resultType="com.ruoyi.web.work.domain.Orders">
+        select * from tb_orders where card_id=#{card}
+    </select>
+
+
+</mapper>

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

@@ -43,8 +43,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="getPatientByDepartment" resultType="com.ruoyi.web.work.domain.PatientCard">
-        select * from tb_patient
-        where id in (select patient_id from tb_pv1 where department=#{department})
+        SELECT
+            tb_pv1.department,
+            tb_pv1.physician,
+            tb_patient.`name`,
+            tb_pv1.discharge_method,
+            tb_pv1.discharge_time,
+            tb_pv1.card_id
+        FROM
+            tb_pv1
+                JOIN
+            tb_patient ON tb_pv1.patient_id = tb_patient.id
+        where tb_pv1.department=#{department}
+    </select>
+
+    <select id="getPatientByCard" resultType="com.ruoyi.web.work.domain.Patient">
+        select * from tb_patient where card_number=#{card}
     </select>
 
 </mapper>

+ 12 - 5
ruoyi-admin/src/main/resources/mapper/work/Pv1Mapper.xml

@@ -29,14 +29,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
 
-    <select id="getPatientCardByNameOrRoomOrEntity" resultType="com.ruoyi.web.work.domain.PatientCard">
+    <select id="getPatientCardByNameOrDepartment" resultType="com.ruoyi.web.work.domain.PatientCard">
         SELECT
             tb_pv1.department,
             tb_pv1.physician,
             tb_patient.`name`,
             tb_pv1.discharge_method,
             tb_pv1.discharge_time,
-            tb_pv1.patient_id
+            tb_pv1.card_id
         FROM
             tb_pv1
                 JOIN
@@ -48,15 +48,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="departmentName!='' and departmentName!= null">
                 AND tb_pv1.department like concat('%', #{departmentName}, '%')
             </if>
+            <if test="physician!='' and physician!= null">
+                AND tb_pv1.physician like concat('%', #{physician}, '%')
+            </if>
         </where>
     </select>
 
-    <select id="getPv1ByPatientId" resultType="com.ruoyi.web.work.domain.Pv1">
-        select * from tb_pv1 where patient_id=#{id}
+    <select id="getPv1ByCard" resultType="com.ruoyi.web.work.domain.Pv1">
+        select * from tb_pv1 where card_id=#{card}
     </select>
 
     <select id="getAllDepartment" resultType="com.ruoyi.web.work.domain.PatientCard">
-        select department from tb_pv1
+        select department from tb_pv1 GROUP BY department
+    </select>
+
+    <select id="getPatientIdByCard" resultType="java.lang.Integer">
+        select patient_id from tb_pv1 where card_id=#{card}
     </select>