Explorar el Código

病案首页。

lighter hace 3 años
padre
commit
6afe392e79

+ 5 - 2
src/main/java/thyyxxk/webserver/dao/his/casefrontsheet/CaseFrontSheetDao.java

@@ -20,7 +20,7 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
             "sex," +
             "doctorName=(select rtrim(name) from a_employee_mi where code=refer_physician), " +
             "admissDate=convert(varchar(10), admiss_date, 21) " +
-            "from zy_actpatient where ward=#{ward} and " +
+            "from zy_actpatient where (small_dept=#{ward} or ward=#{ward}) and " +
             "charindex('$',inpatient_no)=0 " +
             "ORDER BY cast(bed_no AS int)")
     List<SheetOverview> getPatientOverview(@Param("ward") String ward);
@@ -34,7 +34,7 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
             "sex " +
             "from zy_inactpatient where " +
             "dis_date>=#{start} and dis_date<=#{end} and " +
-            "ward=#{ward} and " +
+            "(small_dept=#{ward} or ward=#{ward}) and " +
             "charindex('$',inpatient_no)=0 " +
             "ORDER BY cast(bed_no AS int)")
     List<SheetOverview> getOutPatients(GetOutSheetParam param);
@@ -531,6 +531,9 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
             "from zy_dis_diag_yb where inpatient_no=#{bah} and admiss_times=#{times}")
     List<YiBaoDisdiag> getYbDiags(@Param("bah") String bah, @Param("times") int times);
 
+    @Update("update zy_actpatient set operation=#{operation} where inpatient_no=#{patNo}")
+    void updateOperation(@Param("patNo") String patNo, @Param("operation") String operation);
+
     @Delete("delete from zy_dis_diag_yb where inpatient_no=#{bah} and admiss_times=#{times}")
     void deleteOldYbDiag(@Param("bah") String bah, @Param("times") int times);
 

+ 3 - 0
src/main/java/thyyxxk/webserver/dao/his/casefrontsheet/SheetCreatedDao.java

@@ -12,6 +12,9 @@ import java.util.List;
 @Mapper
 public interface SheetCreatedDao extends BaseMapper<CaseFrontsheetDisdiag> {
 
+    @Select("select role_id from dj_user_role where user_code=#{code}")
+    List<Integer> selectUserRoles(@Param("code") String code);
+
     @Select("SELECT DISTINCT " +
             "name=(SELECT rtrim(name) FROM zd_unit_code WHERE code=a.dept), " +
             "code=rtrim(a.dept) FROM zd_dept_all a, a_employee_mi b " +

+ 1 - 0
src/main/java/thyyxxk/webserver/entity/casefrontsheet/SaveYbDiagParam.java

@@ -8,5 +8,6 @@ import java.util.List;
 public class SaveYbDiagParam {
     private String bah;
     private Integer times;
+    private String operation;
     private List<YiBaoDisdiag> ybDiags;
 }

+ 0 - 1
src/main/java/thyyxxk/webserver/entity/dictionary/SearchDataParam.java

@@ -12,7 +12,6 @@ public class SearchDataParam {
     private String target;
     @NotBlank(message = "查询内容不能为空")
     private String content;
-    @NotBlank(message = "医疗类别不能为空")
     private String medType;
     private Integer page;
     private boolean accurateSearch = false;

+ 10 - 2
src/main/java/thyyxxk/webserver/service/casefrontsheet/CaseFrontSheetService.java

@@ -90,7 +90,14 @@ public class CaseFrontSheetService {
     }
 
     public ResultVo<List<PureCodeName>> getUserWards() {
-        List<PureCodeName> list = createdDao.getUserWards(TokenUtil.getTokenUserId());
+        String code = TokenUtil.getTokenUserId();
+        List<Integer> roles = createdDao.selectUserRoles(code);
+        List<PureCodeName> list;
+        if (roles.contains(7) || roles.contains(1)) {
+            list = createdDao.getAllWards();
+        } else {
+            list = createdDao.getUserWards(code);
+        }
         list.removeIf(Objects::isNull);
         return ResultVoUtil.success(list);
     }
@@ -147,7 +154,7 @@ public class CaseFrontSheetService {
             ret.setList(list);
             return ResultVoUtil.success(ret);
         }
-        if (!StringUtil.isBlank(param.getWard())) {
+        if (StringUtil.notBlank(param.getWard())) {
             if (param.getFileStatus() == 0) {
                 list = basDao.selectPatientsForBasByWard(param);
             } else {
@@ -443,6 +450,7 @@ public class CaseFrontSheetService {
 
     @Transactional
     public ResultVo<String> saveYbDiags(SaveYbDiagParam param) {
+        dao.updateOperation(param.getBah(), param.getOperation());
         dao.deleteOldYbDiag(param.getBah(), param.getTimes());
         for (int i = 0; i < param.getYbDiags().size(); i++) {
             YiBaoDisdiag diag = param.getYbDiags().get(i);