瀏覽代碼

病案首页优化与添加新功能

lighter 1 年之前
父節點
當前提交
9133461142

+ 45 - 4
src/main/java/thyyxxk/webserver/controller/inpatient/casefrontsheet/CaseFrontSheetController.java

@@ -3,14 +3,15 @@ package thyyxxk.webserver.controller.inpatient.casefrontsheet;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import thyyxxk.webserver.config.auth.PassToken;
+import thyyxxk.webserver.config.exception.ExceptionEnum;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.casefrontsheet.*;
 import thyyxxk.webserver.entity.casefrontsheet.request.*;
 import thyyxxk.webserver.entity.casefrontsheet.response.DismissCount;
-import thyyxxk.webserver.entity.casefrontsheet.response.SheetOverviewForBas;
 import thyyxxk.webserver.entity.dictionary.CodeName;
 import thyyxxk.webserver.service.inpatient.casefrontsheet.CaseFrontSheetAnalyzeService;
 import thyyxxk.webserver.service.inpatient.casefrontsheet.CaseFrontSheetMainService;
+import thyyxxk.webserver.utils.ResultVoUtil;
 import thyyxxk.webserver.utils.TokenUtil;
 
 import java.util.List;
@@ -62,13 +63,17 @@ public class CaseFrontSheetController {
     }
 
     @PostMapping("/basOutPatients")
-    public ResultVo<SheetOverviewForBas> getOutPatientsForBas(@RequestBody DismissedSheetInquiry param) {
-        return service.getOutPatientForBas(param);
+    public ResultVo<List<SheetOverview>> getOutPatientsForBas(@RequestBody DismissedSheetInquiry param) {
+        return service.basOutPatients(param);
     }
 
     @PostMapping("/getSheetInfo")
     public ResultVo<CaseFrontsheetMain> getPatientInfo(@RequestBody SheetOverview overview) {
-        return service.getPatientInfo(overview);
+        CaseFrontsheetMain response = service.getPatientInfo(overview);
+        if (null == response) {
+            return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
+        }
+        return ResultVoUtil.success(response);
     }
 
     @GetMapping("/getYbDiags")
@@ -147,4 +152,40 @@ public class CaseFrontSheetController {
     public ResultVo<Map<String, List<CodeName>>> sheetVerification(@RequestBody SheetOverview view) {
         return service.sheetVerification(view);
     }
+
+    @PostMapping("/markDuplicate")
+    public ResultVo<String> markDuplicate(@RequestBody MarkStateRequest request) {
+        String response = service.markDuplicate(request);
+        if (response.equals("OK")) {
+            return ResultVoUtil.success(response);
+        }
+        return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, response);
+    }
+
+    @PostMapping("/markClosedown")
+    public ResultVo<String> markClosedown(@RequestBody MarkStateRequest request) {
+        String response = service.markClosedown(request);
+        if (response.equals("OK")) {
+            return ResultVoUtil.success(response);
+        }
+        return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, response);
+    }
+
+    @GetMapping("/signedByDateCount")
+    public ResultVo<Map<String, List<SheetOverview>>> signedByDateCount(@RequestParam("signDate") String signDate) {
+        return ResultVoUtil.success(service.signedByDateCount(signDate));
+    }
+
+    @PostMapping("/autoSign")
+    public String autoSign(@RequestBody SheetOverview overview) {
+        CaseFrontsheetMain mainSheet = service.getPatientInfo(overview);
+        if (null == mainSheet) {
+            return "未找到病案数据。";
+        }
+        String prtres = service.printVerifyForAutoSign(mainSheet);
+        if (!prtres.equals("OK")) {
+            return prtres;
+        }
+        return service.autoSign(mainSheet);
+    }
 }

+ 8 - 7
src/main/java/thyyxxk/webserver/dao/his/inpatient/casefrontsheet/BasSelectOverviewDao.java

@@ -26,6 +26,9 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
             "a.dis_date " +
             "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
             "where " +
+            "a.inpatient_no not like 'S%' and " +
+            "a.inpatient_no not like 'JT%' and " +
+            "a.zk_ward!='1090000' and " +
             "a.inpatient_no=#{bah} and " +
             "a.inpatient_no=b.zyh and " +
             "a.admiss_times=b.zycs and " +
@@ -34,11 +37,8 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
             "isnull(a.file_status, 0)!=1 order by a.zk_ward,b.zyys")
     List<SheetOverview> selectPatientsForBasByBah(DismissedSheetInquiry param);
 
-    @Select("select count(1) from zy_actpatient where inpatient_no=#{bah} ")
-    int selectInHospCount(String bah);
-
     @Select("select sign_date,file_status,bah,name, " +
-            "admiss_times as times,admiss_date,sex, " +
+            "admiss_times as times,admiss_date,sex,zy_dismiss_way, " +
             "dismiss_dept as deptName,admiss_doctor_name as doctorName,late_flag, " +
             "lateDays=datediff(day, dismiss_date, sign_date), " +
             "dismiss_date as disDate from t_case_frontsheet_main with(nolock) " +
@@ -65,12 +65,12 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
             "a.admiss_times=b.zycs and " +
             "a.dis_date>=#{start} and " +
             "a.dis_date<=#{end} and " +
-            "a.zk_ward = #{ward} and " +
+            "a.zk_ward=#{ward} and " +
             "isnull(a.file_status, 0)!=1 and " +
             "charindex('$',a.inpatient_no)=0 order by a.zk_ward,b.zyys")
     List<SheetOverview> selectPatientsForBasByWard(DismissedSheetInquiry param);
 
-    @Select("select sign_date,file_status,bah,admiss_times as times, " +
+    @Select("select sign_date,file_status,bah,admiss_times as times,zy_dismiss_way, " +
             "name,sex,admiss_date,dismiss_dept as deptName,admiss_doctor_name as doctorName, " +
             "late_flag,lateDays=datediff(day,dismiss_date,sign_date), " +
             "dismiss_date as disDate from t_case_frontsheet_main with(nolock) " +
@@ -92,6 +92,7 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
             "where " +
             "a.inpatient_no not like 'S%' and " +
             "a.inpatient_no not like 'JT%' and " +
+            "a.zk_ward!='1090000' and " +
             "a.inpatient_no=b.zyh and " +
             "a.admiss_times=b.zycs and " +
             "a.dis_date>=#{start} and " +
@@ -100,7 +101,7 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
             "charindex('$',a.inpatient_no)=0 order by a.zk_ward,b.zyys")
     List<SheetOverview> selectPatientsForBasByFileStatus(DismissedSheetInquiry param);
 
-    @Select("select sign_date,file_status,bah,admiss_times as times," +
+    @Select("select sign_date,file_status,bah,admiss_times as times,zy_dismiss_way," +
             "name,sex,admiss_date,dismiss_dept as deptName,admiss_doctor_name as doctorName," +
             "late_flag,lateDays=datediff(day, dismiss_date, sign_date)," +
             "dismiss_date as disDate from t_case_frontsheet_main with(nolock) " +

+ 35 - 10
src/main/java/thyyxxk/webserver/dao/his/inpatient/casefrontsheet/CaseFrontSheetDao.java

@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.*;
 import thyyxxk.webserver.entity.casefrontsheet.*;
 import thyyxxk.webserver.entity.casefrontsheet.request.AdvanceSearch;
 import thyyxxk.webserver.entity.casefrontsheet.request.DismissedSheetInquiry;
+import thyyxxk.webserver.entity.casefrontsheet.request.MarkStateRequest;
 import thyyxxk.webserver.entity.casefrontsheet.request.SheetOverview;
 import thyyxxk.webserver.entity.covid.Region;
 import thyyxxk.webserver.entity.dictionary.CodeName;
@@ -455,11 +456,8 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
             "#{assistantTwo},#{cut},#{heal},#{anaesthesia},#{anaesthesiaor},#{date},#{opEndDate},#{anstStartDate},#{anstEndDate})")
     void writeNewZySurgeryRecord(CaseFrontsheetSurgery surgery);
 
-    @Update("update t_case_frontsheet_main set file_status=1, sign_date=getdate(), " +
-            "late_flag=#{late},sign_staff=#{staff} " +
-            "where bah=#{bah} and admiss_times=#{times}")
-    void updateSignStatus(@Param("bah") String bah, @Param("times") int times,
-                          @Param("late") int late, @Param("staff") String staff);
+    @Update("update t_case_frontsheet_main set file_status=0 where bah=#{bah} and admiss_times=#{times}")
+    void updateSignStateToUnsigned(@Param("bah") String bah, @Param("times") int times);
 
     @Insert("insert into ba_op_log (op_type, op_id, op_time, inpatient_no, admiss_times) values " +
             "(#{opType}, #{staffId}, getDate(), #{bah}, #{admissTimes})")
@@ -541,12 +539,17 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
     Integer selectFileStatus(@Param("bah") String bah,
                              @Param("admissTimes") Integer admissTimes);
 
+    @Select("select late_flag from t_case_frontsheet_main with(nolock) where bah=#{bah} and times=#{admissTimes}")
+    Integer selectLateFlag(@Param("bah") String bah,
+                             @Param("times") Integer times);
+
+    @Select("select sign_staff from t_case_frontsheet_main with(nolock) where bah=#{bah} and admiss_times=#{times}")
+    String selectSignStaff(@Param("bah") String bah,
+                                        @Param("times") Integer times);
+
     @Select("select role_id from dj_user_role where user_code=#{code}")
     List<Integer> getUserRoles(@Param("code") String code);
 
-    @Select("select rtrim(dept_code) from a_employee_mi where code=#{code}")
-    String selectUserDept(@Param("code") String code);
-
     @Select("select count(1) from t_yb_setl_modify_req where pat_no=#{bah} and times=#{times}")
     Integer selectModified(@Param("bah") String bah, @Param("times") Integer times);
 
@@ -564,8 +567,11 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
     @Update("update zd_icd_code set weight=(weight+1) where code=#{code}")
     void increaseDiagWeight(@Param("code") String code);
 
-    @Select("select * from t_case_frontsheet_main where bah=#{bah} and admiss_times=#{times}")
-    CaseFrontsheetMain selectSignedSheetMain(@Param("bah") String bah, @Param("times") Integer times);
+    @Select("select *, " +
+            "duplicated=(select count(1) from t_case_frontsheet_duplicate where bah=#{bah} and times=#{times})," +
+            "closedown=(select count(1) from t_case_frontsheet_closedown where bah=#{bah} and times=#{times}) " +
+            "from t_case_frontsheet_main where bah=#{bah} and admiss_times=#{times} and file_status=1")
+    CaseFrontsheetMain selectStoredSheetMain(@Param("bah") String bah, @Param("times") Integer times);
 
     @Select("select * from t_case_frontsheet_disdiag where bah=#{bah} and times=#{times} ")
     List<CaseFrontsheetDisdiag> selectSignedSheetDiags(@Param("bah") String bah, @Param("times") Integer times);
@@ -666,4 +672,23 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
 
     @Delete("delete from t_case_frontsheet_main where bah=#{bah} and admiss_times=#{times}")
     void deleteOldSheet(String bah, int times);
+
+    @Insert("insert into t_case_frontsheet_duplicate (bah, times, duplicate_staff, " +
+            "visit_staff, remark) " +
+            "values (#{bah},#{times},#{opStaff},#{visitStaff},#{remark})")
+    int executeDuplicate(MarkStateRequest request);
+
+    @Select("select count(1) from t_case_frontsheet_closedown where bah=#{bah} and times=#{times}")
+    int closedownCount(String bah, int times);
+
+    @Insert("insert into t_case_frontsheet_closedown (bah, times, closedown_staff, remark) " +
+            "values (#{bah},#{times},#{opStaff},#{remark})")
+    int executeClosedown(MarkStateRequest request);
+
+    @Select("select bah,admiss_times as times,name,sex,sign_staff, " +
+            "signTime=convert(varchar(8),sign_date,14), " +
+            "signStaffName=(select rtrim(d.name) from a_employee_mi d where d.code=sign_staff) " +
+            "from t_case_frontsheet_main where file_status=1 and sign_date>=#{start} " +
+            "and sign_date<=#{end} order by sign_date")
+    List<SheetOverview> signedListByDate(String start, String end);
 }

+ 6 - 0
src/main/java/thyyxxk/webserver/entity/casefrontsheet/CaseFrontsheetMain.java

@@ -830,6 +830,12 @@ public class CaseFrontsheetMain implements Serializable {
     @TableField(exist = false)
     private Boolean isDoctorPrint;
 
+    @TableField(exist = false)
+    private Integer duplicated;
+
+    @TableField(exist = false)
+    private Integer closedown;
+
     public List<CaseFrontsheetDisdiag> getDisdiagList() {
         return null == disdiagList ? new ArrayList<>() : disdiagList;
     }

+ 12 - 0
src/main/java/thyyxxk/webserver/entity/casefrontsheet/request/MarkStateRequest.java

@@ -0,0 +1,12 @@
+package thyyxxk.webserver.entity.casefrontsheet.request;
+
+import lombok.Data;
+
+@Data
+public class MarkStateRequest {
+    private String bah;
+    private Integer times;
+    private String opStaff;
+    private String visitStaff;
+    private String remark;
+}

+ 16 - 5
src/main/java/thyyxxk/webserver/entity/casefrontsheet/request/SheetOverview.java

@@ -3,6 +3,7 @@ package thyyxxk.webserver.entity.casefrontsheet.request;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
+import thyyxxk.webserver.utils.StringUtil;
 
 import java.util.Date;
 
@@ -20,12 +21,16 @@ public class SheetOverview {
     private String deptName;
     private String doctorName;
     private Date disDate;
+    private String zyDismissWay;
+    private String zyDismissWayName;
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Date signDate;
+    private String signStaff;
+    private String signStaffName;
+    private String signTime;
     private Integer lateDays;
     private Integer lateFlag;
-    private Boolean renew;
 
     public Integer getLateDays() {
         if (null == lateDays) return 0;
@@ -45,6 +50,16 @@ public class SheetOverview {
         return "未知";
     }
 
+    public String getZyDismissWayName() {
+        if (StringUtil.isBlank(this.zyDismissWay)) {
+            return "";
+        }
+        if (this.zyDismissWay.equals("4")) {
+            return "已死亡";
+        }
+        return "";
+    }
+
     public Integer getLateFlag() {
         return null == lateFlag ? 0 : lateFlag;
     }
@@ -56,8 +71,4 @@ public class SheetOverview {
     public Integer getInOutFlag() {
         return null == inOutFlag ? 1 : inOutFlag;
     }
-
-    public Boolean getRenew() {
-        return null != renew && renew;
-    }
 }

+ 0 - 12
src/main/java/thyyxxk/webserver/entity/casefrontsheet/response/SheetOverviewForBas.java

@@ -1,12 +0,0 @@
-package thyyxxk.webserver.entity.casefrontsheet.response;
-
-import lombok.Data;
-import thyyxxk.webserver.entity.casefrontsheet.request.SheetOverview;
-
-import java.util.List;
-
-@Data
-public class SheetOverviewForBas {
-    private String cdPercentage;
-    private List<SheetOverview> list;
-}

+ 19 - 0
src/main/java/thyyxxk/webserver/entity/casefrontsheet/state/State.java

@@ -0,0 +1,19 @@
+package thyyxxk.webserver.entity.casefrontsheet.state;
+
+public class State {
+    public static class LateFlag {
+        public static final int NOT_LATE = 0;
+        public static final int LATE = 1;
+        public static final int ALL = 3;
+    }
+
+    public static class FileStatus {
+        public static final int UNSIGNED = 0;
+        public static final int SIGNED = 1;
+    }
+
+    public static class InHospital {
+        public static final int YES = 1;
+        public static final int NO = 2;
+    }
+}

+ 0 - 6
src/main/java/thyyxxk/webserver/entity/inpatient/ZyActpatient.java

@@ -858,12 +858,6 @@ public class ZyActpatient implements Serializable {
      */
     private String fileStatus;
 
-    /**
-     * lendFlag
-     */
-    private Integer lendFlag;
-
-
     /**
      * 违规费用
      */

+ 173 - 95
src/main/java/thyyxxk/webserver/service/inpatient/casefrontsheet/CaseFrontSheetMainService.java

@@ -21,7 +21,7 @@ import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.api.forpowersi.drgdip.frontsheetqualitycheck.QualityCheckParams;
 import thyyxxk.webserver.entity.casefrontsheet.*;
 import thyyxxk.webserver.entity.casefrontsheet.request.*;
-import thyyxxk.webserver.entity.casefrontsheet.response.SheetOverviewForBas;
+import thyyxxk.webserver.entity.casefrontsheet.state.State;
 import thyyxxk.webserver.entity.covid.Region;
 import thyyxxk.webserver.entity.dictionary.CodeName;
 import thyyxxk.webserver.entity.dictionary.HisWjwMatchEntity;
@@ -141,89 +141,88 @@ public class CaseFrontSheetMainService {
      * @param param 查询的条件
      * @return 返回数据
      */
-    public ResultVo<SheetOverviewForBas> getOutPatientForBas(DismissedSheetInquiry param) {
-        SheetOverviewForBas response = new SheetOverviewForBas();
-        if (StringUtil.notBlank(param.getWard())) {
-            int cd = dao.getCDBlfxCount(param.getWard());
-            int all = dao.getAllDisPatientCount(param.getWard());
-            if (cd == 0 || all == 0) {
-                response.setCdPercentage("0.00%");
-            } else {
-                response.setCdPercentage(DecimalUtil.getPercent(cd, all));
-            }
-        }
-        if (StringUtil.notBlank(param.getStart())) {
-            param.setStart(param.getStart() + " 00:00:00");
-        }
-        if (StringUtil.notBlank(param.getEnd())) {
-            param.setEnd(param.getEnd() + " 23:59:59");
+    public ResultVo<List<SheetOverview>> basOutPatients(DismissedSheetInquiry param) {
+        if (StringUtil.isBlank(param.getStart()) || StringUtil.isBlank(param.getEnd())) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "日期范围不能为空。");
         }
+        param.setStart(param.getStart() + " 00:00:00");
+        param.setEnd(param.getEnd() + " 23:59:59");
+
         List<SheetOverview> baseList;
         List<SheetOverview> seedList;
+
         if (StringUtil.notBlank(param.getBah())) {
             baseList = basDao.selectPatientsFromSignedBase(param);
+            if (Objects.equals(param.getFileStatus(), State.FileStatus.SIGNED)) {
+                if (baseList.isEmpty()) {
+                    return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST,
+                            "没有找到此患者的已归档病案。");
+                }
+                if (!Objects.equals(param.getLateFlag(), State.LateFlag.ALL)) {
+                    baseList.removeIf(item -> !Objects.equals(item.getLateFlag(), param.getLateFlag()));
+                }
+                return ResultVoUtil.success(baseList);
+            }
+
             seedList = basDao.selectPatientsForBasByBah(param);
             baseList = removeDuplicateData(baseList, seedList);
             if (baseList.isEmpty()) {
-                String describe = param.getFileStatus() == 0 ? "未归档" : "已归档";
                 return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST,
-                        "没有找到此患者的" + describe + "病案。");
+                        "没有找到此患者的未归档病案。");
             }
-            if (param.getLateFlag() != 3) {
-                baseList.removeIf(item -> !item.getLateFlag().equals(param.getLateFlag()));
+            if (!Objects.equals(param.getLateFlag(), State.LateFlag.ALL)) {
+                baseList.removeIf(item -> !Objects.equals(item.getLateFlag(), param.getLateFlag()));
             }
-            response.setList(baseList);
-            return ResultVoUtil.success(response);
+            return ResultVoUtil.success(baseList);
         }
         if (StringUtil.notBlank(param.getWard())) {
             baseList = basDao.selectPatientsForBasByWard2(param);
-            seedList = basDao.selectPatientsForBasByWard(param);
-            baseList = removeDuplicateData(baseList, seedList);
-            if (param.getLateFlag() != 3) {
-                baseList.removeIf(item -> !item.getLateFlag().equals(param.getLateFlag()));
+            if (param.getFileStatus() == State.FileStatus.UNSIGNED) {
+                seedList = basDao.selectPatientsForBasByWard(param);
+                baseList = removeDuplicateData(baseList, seedList);
+            }
+            if (!Objects.equals(param.getLateFlag(), State.LateFlag.ALL)) {
+                baseList.removeIf(item -> !Objects.equals(item.getLateFlag(), param.getLateFlag()));
             }
-            response.setList(baseList);
-            return ResultVoUtil.success(response);
+            return ResultVoUtil.success(baseList);
         }
         baseList = basDao.selectPatientsForBasByFileStatus2(param);
-        seedList = basDao.selectPatientsForBasByFileStatus(param);
-        baseList = removeDuplicateData(baseList, seedList);
-        if (param.getLateFlag() != 3) {
-            baseList.removeIf(item -> !item.getLateFlag().equals(param.getLateFlag()));
+        if (param.getFileStatus() == State.FileStatus.UNSIGNED) {
+            seedList = basDao.selectPatientsForBasByFileStatus(param);
+            baseList = removeDuplicateData(baseList, seedList);
         }
-        response.setList(baseList);
-        return ResultVoUtil.success(response);
+        if (!Objects.equals(param.getLateFlag(), State.LateFlag.ALL)) {
+            baseList.removeIf(item -> !Objects.equals(item.getLateFlag(), param.getLateFlag()));
+        }
+        return ResultVoUtil.success(baseList);
     }
 
     private List<SheetOverview> removeDuplicateData(List<SheetOverview> baseList,
-                                                                          List<SheetOverview> seedList) {
+                                                    List<SheetOverview> seedList) {
         if (baseList.isEmpty()) {
             return seedList;
         }
         if (seedList.isEmpty()) {
             return baseList;
         }
-        Map<String, Integer> map = new HashMap<>(seedList.size());
-        for (SheetOverview overview : seedList) {
+        List<String> keys = new ArrayList<>();
+        for (SheetOverview overview : baseList) {
             String key = overview.getBah().trim() + "-" + overview.getTimes();
-            map.put(key, 1);
+            keys.add(key);
         }
-        baseList.removeIf(item -> map.containsKey(item.getBah().trim() + "-" + item.getTimes()));
+        seedList.removeIf(item -> keys.contains(item.getBah().trim() + "-" + item.getTimes()));
         baseList.addAll(seedList);
         return baseList;
     }
 
-    public ResultVo<CaseFrontsheetMain> getPatientInfo(SheetOverview overview) {
+    public CaseFrontsheetMain getPatientInfo(SheetOverview overview) {
         String bah = overview.getBah();
         Integer times = overview.getTimes();
-        if (overview.getRenew()) {
-            dao.deleteOldSheet(bah, times);
-        }
         StandardAddressMember standardAddressMember = getStandardAddressMember(bah);
-        CaseFrontsheetMain sheet = dao.selectSignedSheetMain(bah, times);
+        CaseFrontsheetMain sheet = dao.selectStoredSheetMain(bah, times);
         if (null != sheet) {
-            sheet.setDisdiagList(getSheetDisDiags(bah, times, 1));
-            sheet.setSurgeryList(getSheetSurgeries(bah, times, 1));
+            sheet.setDisdiagList(getSheetDisDiags(bah, times, State.FileStatus.SIGNED));
+            sheet.setSurgeryList(getSheetSurgeries(bah, times, State.FileStatus.SIGNED));
             if (null != standardAddressMember) {
                 sheet.setStandardAddress(standardAddressMember.makeStandardAddress());
                 sheet.setLivePlaceCombo(standardAddressMember.makeAddressCombo() + sheet.getLivePlace());
@@ -254,17 +253,21 @@ public class CaseFrontSheetMainService {
                 sheet.setAdmissDays(0 == days ? "1" : String.valueOf(days));
             }
             autoFillPart(sheet);
-            return ResultVoUtil.success(sheet);
+            return sheet;
         }
-        int flag = overview.getInOutFlag();
-        if (flag == 2) {
-            flag = dao.selectActCount(bah, times) > 0 ? 1 : 2;
+        int inHospital = overview.getInOutFlag();
+        if (inHospital == State.InHospital.NO) {
+            if (dao.selectActCount(bah, times) > 0) {
+                inHospital = State.InHospital.YES;
+            }
         }
         sheet = dao.getAPatientMi(bah);
-        CaseFrontsheetMain sheet1 = flag == 1 ? dao.getZyActPatient("zy_actpatient", "yz_act_order", bah, times) :
+        CaseFrontsheetMain sheet1 = inHospital == State.InHospital.YES ?
+                dao.getZyActPatient("zy_actpatient", "yz_act_order", bah, times) :
                 dao.getZyActPatient("zy_inactpatient", "yz_inact_order", bah, times);
         if (null == sheet1) {
-            sheet1 = flag == 1 ? dao.getZyActPatient("zy_inactpatient", "yz_inact_order", bah, times) :
+            sheet1 = inHospital == State.InHospital.YES ?
+                    dao.getZyActPatient("zy_inactpatient", "yz_inact_order", bah, times) :
                     dao.getZyActPatient("zy_actpatient", "yz_act_order", bah, times);
         }
         sheet.setAge(DateUtil.calculateAge(sheet.getBirthDate(), sheet1.getAdmissDate()));
@@ -282,7 +285,7 @@ public class CaseFrontSheetMainService {
         final int hasInfant = dao.getInfant(bah, times);
         sheet1.setHasInfant(String.valueOf(hasInfant));
         if (null == sheet1.getDismissDate()) {
-            final Date dismissDate = flag == 1 ?
+            final Date dismissDate = inHospital == State.InHospital.YES ?
                     dao.getDismissDateFromYzActOrder("yz_inact_order", bah, times)
                     : dao.getDismissDateFromYzActOrder("yz_act_order", bah, times);
             sheet1.setDismissDate(dismissDate);
@@ -293,7 +296,7 @@ public class CaseFrontSheetMainService {
                     sheet1.getAdmissDept(), sheet1.getAdmissWard());
             log.info("insert batjBa1>>> " + bah + ", " + times);
         }
-        CaseFrontsheetMain sheet3 = flag == 1 ? dao.getBatjBa2ForInPatient(bah, times) :
+        CaseFrontsheetMain sheet3 = inHospital == 1 ? dao.getBatjBa2ForInPatient(bah, times) :
                 dao.getBatjBa2ForOutPatient(bah, times);
         if (sheet3 == null && dao.isBatjBa2Exist(bah, times) == 0) {
             dao.createBatjBa2(bah, times);
@@ -328,7 +331,7 @@ public class CaseFrontSheetMainService {
         }
         sheet.setSurgicalFee(DecimalUtil.add(sheet.getAnesthetizeFee(), sheet.getSurgeryFee()));
         autoFillPart(sheet);
-        return ResultVoUtil.success(sheet);
+        return sheet;
     }
 
     private void autoFillPart(CaseFrontsheetMain sheet) {
@@ -402,7 +405,7 @@ public class CaseFrontSheetMainService {
     }
 
     private List<CaseFrontsheetDisdiag> getSheetDisDiags(String bah, int times, int status) {
-        List<CaseFrontsheetDisdiag> disdiags = status == 1 ?
+        List<CaseFrontsheetDisdiag> disdiags = status == State.FileStatus.SIGNED ?
                 dao.selectSignedSheetDiags(bah, times) : dao.getDisdiags(bah, times);
         if (disdiags.isEmpty()) {
             JSONObject emrPatientData = emrService.getEmrPatientData(bah, times);
@@ -430,7 +433,7 @@ public class CaseFrontSheetMainService {
     }
 
     private List<CaseFrontsheetSurgery> getSheetSurgeries(String bah, int times, int status) {
-        List<CaseFrontsheetSurgery> surgeries = status == 1 ?
+        List<CaseFrontsheetSurgery> surgeries = status == State.FileStatus.SIGNED ?
                 dao.selectSignedSheetSurgeries(bah, times) : dao.getSurgeries(bah, times);
         if (surgeries.isEmpty()) {
             JSONArray oprtList = emrService.getPatientSurgery(bah, times);
@@ -580,33 +583,31 @@ public class CaseFrontSheetMainService {
     private ResultVo<List<CodeName>> archiveSheet(CaseFrontsheetMain sheet) {
         String staff = TokenUtil.getInstance().getTokenUserId();
         List<Integer> roles = userDao.getUserRoles(staff);
-        if (roles.contains(7) || roles.contains(1)) {
-            String bah = sheet.getBah();
-            int times = sheet.getAdmissTimes();
-            int lateFlag = isLateSubmit(sheet.getDismissDate()) ? 1 : 0;
-            sheet.setLateFlag(lateFlag);
-            //插入数据 SignDate 签收日期  在点击签收后 向数据库中插入
-            sheet.setSignDate(new Date());
-            sheet.setSignStaff(staff);
-            sheet.setFileStatus(1);
-            //判断是否已经插入过了
-            Integer fileStatus = dao.selectFileStatus(sheet.getBah(), sheet.getAdmissTimes());
-            if (null == fileStatus) {
-                insertSheetData(sheet);
-                basDao.updateActFileStatus(bah, times, 1);
-                return ResultVoUtil.success();
-            }
-            if (fileStatus == 1) {
-                return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请勿重复签收 ( ˉ ⌓ ˉ ๑)");
-            }
-            dao.updateSignStatus(bah, times, lateFlag, staff);
-            basDao.updateActFileStatus(bah, times, 1);
+        if (!roles.contains(7) && !roles.contains(1)) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "您没有签收首页的权限。");
+        }
+        String bah = sheet.getBah();
+        int times = sheet.getAdmissTimes();
+        sheet.setSignDate(new Date());
+        sheet.setSignStaff(staff);
+        sheet.setFileStatus(State.FileStatus.SIGNED);
+        //判断是否已经签收过了
+        Integer fileStatus = dao.selectFileStatus(sheet.getBah(), sheet.getAdmissTimes());
+        if (!Objects.equals(fileStatus, State.FileStatus.SIGNED)) {
+            insertSheetData(sheet);
+            basDao.updateActFileStatus(bah, times, State.FileStatus.SIGNED);
             return ResultVoUtil.success();
         }
-        return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "您没有签收首页的权限。");
+        return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请勿重复签收。");
     }
 
     private void insertSheetData(CaseFrontsheetMain sheet) {
+        Integer lateFlag = dao.selectLateFlag(sheet.getBah(), sheet.getAdmissTimes());
+        if (null == lateFlag) {
+            lateFlag = calculateLateState(sheet.getDismissDate());
+        }
+        sheet.setLateFlag(lateFlag);
+        sheet.setSignStaff(dao.selectSignStaff(sheet.getBah(), sheet.getAdmissTimes()));
         dao.deleteOldSheet(sheet.getBah(), sheet.getAdmissTimes());
         //在t_case_frontsheet_main表中插入 主体的内容
         dao.insert(sheet);
@@ -639,18 +640,12 @@ public class CaseFrontSheetMainService {
     @Transactional(rollbackFor = Exception.class)
     public synchronized ResultVo<String> unArchiveSheet(OpCaseFrontsheet param) {
         CaseFrontsheetMain sheet = param.getSheet();
-        if (sheet.getFileStatus() == 0) {
+        if (sheet.getFileStatus() == State.FileStatus.UNSIGNED) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "未签收的病案首页无需解除签收!");
         }
-        dao.deleteOldSheet(sheet.getBah(), sheet.getAdmissTimes());
-        Map<String, Object> map = new HashMap<>();
-        map.put("bah", sheet.getBah());
-        map.put("times", sheet.getAdmissTimes());
-        createdDao.deleteByMap(map);
-        basDao.deleteByMap(map);
+        dao.updateSignStateToUnsigned(sheet.getBah(), sheet.getAdmissTimes());
         log.info("解除签收状态, 操作员:{} >>> 住院号:{}, 住院次数:{}",
                 param.getStaffId(), sheet.getBah(), sheet.getAdmissTimes());
-        basDao.updateActFileStatus(sheet.getBah(), sheet.getAdmissTimes(), 0);
         dao.writeBaOpLog(param.getOpType(), param.getStaffId(), sheet.getBah(), sheet.getAdmissTimes());
         log.info("写入病案操作日志, 操作员:{} >>> 住院号:{}, 住院次数:{}, 操作编码:{}",
                 param.getStaffId(), sheet.getBah(), sheet.getAdmissTimes(), param.getOpType());
@@ -710,7 +705,7 @@ public class CaseFrontSheetMainService {
     public ResultVo<Map<String, List<CodeName>>> printVerification(OpCaseFrontsheet param) {
         CaseFrontsheetMain sheet = param.getSheet();
         Integer status = dao.selectFileStatus(sheet.getBah(), sheet.getAdmissTimes());
-        if (null != status && status == 1) {
+        if (null != status && status == State.FileStatus.SIGNED) {
             List<Integer> roles = dao.getUserRoles(param.getStaffId());
             if (roles.contains(60)) {
                 return ResultVoUtil.success();
@@ -744,15 +739,16 @@ public class CaseFrontSheetMainService {
         String bah = sheet.getBah();
         int times = sheet.getAdmissTimes();
         Integer fileStatus = dao.selectFileStatus(bah, times);
-        if (null == fileStatus || 0 == fileStatus) {
-            sheet.setFileStatus(0);
+        if (null == fileStatus || fileStatus == State.FileStatus.UNSIGNED) {
+            sheet.setFileStatus(State.FileStatus.UNSIGNED);
             insertSheetData(sheet);
         }
     }
 
     public ResultVo<List<CodeName>> saveVerify(OpCaseFrontsheet info) {
         CaseFrontsheetMain sheet = info.getSheet();
-        if (sheet.getFileStatus() == 1 && !userDao.getUserRoles(TokenUtil.getInstance().getTokenUserId()).contains(7)) {
+        Integer status = dao.selectFileStatus(sheet.getBah(), sheet.getAdmissTimes());
+        if (null != status && status == State.FileStatus.SIGNED) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "已签收的病案首页无法保存,如需保存,请联系病案室对此病案解除签收。");
         }
         sheet.setAddressMember(getStandardAddress(sheet.getStandardAddress()));
@@ -812,7 +808,7 @@ public class CaseFrontSheetMainService {
         if (StringUtil.isBlank(view.getBah()) || null == view.getTimes() || null == view.getInOutFlag()) {
             return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "住院号、住院次数、在院状态不能为空。");
         }
-        CaseFrontsheetMain sheet = getPatientInfo(view).getData();
+        CaseFrontsheetMain sheet = getPatientInfo(view);
         if (null == sheet) {
             return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "没有查询到病案数据。");
         }
@@ -890,9 +886,9 @@ public class CaseFrontSheetMainService {
         return ResultVoUtil.success("有对照的非手术分值:" + disefamilyGrade.getNoneOprnGrade());
     }
 
-    private boolean isLateSubmit(Date dismissDate) {
+    private Integer calculateLateState(Date dismissDate) {
         long days = (System.currentTimeMillis() - dismissDate.getTime()) / 1000 / (3600 * 24);
-        return (int) days > 7;
+        return (int) days > 6 ? State.LateFlag.LATE : State.LateFlag.NOT_LATE;
     }
 
     public void increaseDiagWeight(String code) {
@@ -989,4 +985,86 @@ public class CaseFrontSheetMainService {
         }
         return ResultVoUtil.success();
     }
+
+    public String markDuplicate(MarkStateRequest request) {
+        Integer fileStatus = dao.selectFileStatus(request.getBah(), request.getTimes());
+        if (null == fileStatus || fileStatus == State.FileStatus.UNSIGNED) {
+            return "未签收的病案不可标记复印。";
+        }
+        if (StringUtil.isBlank(request.getVisitStaff())) {
+            return "请填写来访人员。";
+        }
+        request.setOpStaff(TokenUtil.getInstance().getTokenUserId());
+        int insert = dao.executeDuplicate(request);
+        if (insert == 0) {
+            return "操作失败,无法向数据库插入记录。";
+        }
+        return "OK";
+    }
+
+    public String markClosedown(MarkStateRequest request) {
+        Integer fileStatus = dao.selectFileStatus(request.getBah(), request.getTimes());
+        if (null == fileStatus || fileStatus == State.FileStatus.UNSIGNED) {
+            return "未签收的病案不可标记封存。";
+        }
+        int closedownCount = dao.closedownCount(request.getBah(), request.getTimes());
+        if (closedownCount > 0) {
+            return "已是封存状态,请勿重复封存。";
+        }
+        if (StringUtil.isBlank(request.getVisitStaff())) {
+            return "请填写来访人员。";
+        }
+        request.setOpStaff(TokenUtil.getInstance().getTokenUserId());
+        int insert = dao.executeClosedown(request);
+        if (insert == 0) {
+            return "操作失败,无法向数据库插入记录。";
+        }
+        return "OK";
+    }
+
+    public Map<String, List<SheetOverview>> signedByDateCount(String signDate) {
+        String start = signDate + " 00:00:00.000";
+        String end = signDate + " 23:59:59.999";
+        List<SheetOverview> list = dao.signedListByDate(start, end);
+        Map<String, List<SheetOverview>> map = new HashMap<>();
+        for (SheetOverview overview : list) {
+            String key = overview.getSignStaff() + "-" + overview.getSignStaffName();
+            if (map.containsKey(key)) {
+                map.get(key).add(overview);
+            } else {
+                List<SheetOverview> tempList = new ArrayList<>();
+                tempList.add(overview);
+                map.put(key, tempList);
+            }
+        }
+        return map;
+    }
+
+    public String printVerifyForAutoSign(CaseFrontsheetMain sheet) {
+        Integer status = dao.selectFileStatus(sheet.getBah(), sheet.getAdmissTimes());
+        if (null != status && status == State.FileStatus.SIGNED) {
+            return "OK";
+        }
+        sheet.setAddressMember(getStandardAddress(sheet.getStandardAddress()));
+        ResultVo<List<CodeName>> save = saveSheet(sheet);
+        if (save.getCode() != ExceptionEnum.SUCCESS.getCode()) {
+            return "校验未通过。";
+        }
+        Map<String, List<CodeName>> warnings = beginAnalyzeSheet(sheet,4);
+        if (warnings.get("force").isEmpty()) {
+            return "OK";
+        }
+        return "校验未通过。";
+    }
+
+    public String autoSign(CaseFrontsheetMain sheet) {
+        String bah = sheet.getBah();
+        int times = sheet.getAdmissTimes();
+        sheet.setSignDate(new Date());
+        sheet.setFileStatus(State.FileStatus.SIGNED);
+        sheet.setSignStaff(dao.selectSignStaff(bah, times));
+        insertSheetData(sheet);
+        basDao.updateActFileStatus(bah, times, State.FileStatus.SIGNED);
+        return "OK";
+    }
 }

+ 35 - 36
src/main/java/thyyxxk/webserver/service/medicalinsurance/SetlListUpldService.java

@@ -522,49 +522,48 @@ public class SetlListUpldService {
         overview.setInOutFlag(2);
         overview.setBah(patNo);
         overview.setTimes(times);
-        ResultVo<CaseFrontsheetMain> patientInfo = caseFrontSheetMainService.getPatientInfo(overview);
-        if (patientInfo.getData() != null) {
-            CaseFrontsheetMain caseFrontsheetMain = patientInfo.getData();
-            setlinfoUpld.setNtly(caseFrontsheetMain.getCountry() != null ? dao.getCountrySiCode(caseFrontsheetMain.getCountry()) : null);
-            setlinfoUpld.setPrfs(StringUtil.isBlank(caseFrontsheetMain.getOccupation()) ? getPrfs(setlinfoUpld) : caseFrontsheetMain.getOccupation());
-            setlinfoUpld.setCertno(caseFrontsheetMain.getSocialNo());
-            setlinfoUpld.setCurrAddr(caseFrontsheetMain.getLivePlace());
-            setlinfoUpld.setEmpName(caseFrontsheetMain.getUnitName());
-            setlinfoUpld.setEmpAddr(caseFrontsheetMain.getUnitPlace());
-            setlinfoUpld.setEmpTel(caseFrontsheetMain.getUnitPhone());
-            setlinfoUpld.setPoscode("310".equals(caseFrontsheetMain.getInsutype()) && StringUtil.isBlank(caseFrontsheetMain.getUnitZipCode()) ? "410000" : caseFrontsheetMain.getUnitZipCode());
-            setlinfoUpld.setNaty(redisLikeService.getWjwNation(caseFrontsheetMain.getNation()));
-            setlinfoUpld.setConerName(caseFrontsheetMain.getContactName());
-            setlinfoUpld.setBrdy(DateUtil.formatDatetime(caseFrontsheetMain.getBirthDate(), "yyyy-MM-dd"));
-            setlinfoUpld.setAge(String.valueOf(caseFrontsheetMain.getAge()));
-            setlinfoUpld.setGend(caseFrontsheetMain.getSex());
-            setlinfoUpld.setPatnRlts(redisLikeService.getYbCodeContactRelation(caseFrontsheetMain.getContactRelation()));
-            setlinfoUpld.setConerTel(caseFrontsheetMain.getContactPhone());
-            setlinfoUpld.setPwcryBfadmComaDura(caseFrontsheetMain.getComaDaysBeforeAdmiss() + "/" + caseFrontsheetMain.getComaHoursBeforeAdmiss() + "/" + caseFrontsheetMain.getComaMinutesBeforeAdmiss());
-            setlinfoUpld.setPwcryAfadmComaDura(caseFrontsheetMain.getComaDaysAfterAdmiss() + "/" + caseFrontsheetMain.getComaHoursAfterAdmiss() + "/" + caseFrontsheetMain.getComaMinutesAfterAdmiss());
-            setlinfoUpld.setDscgWay(caseFrontsheetMain.getZyDismissWay());
-            setlinfoUpld.setAcpMedinsName(caseFrontsheetMain.getDismissDestination());
-            setlinfoUpld.setDaysRinpFlag31(caseFrontsheetMain.getAdmissAgainInOneMonth());
-            setlinfoUpld.setDaysRinpPup31(caseFrontsheetMain.getAdmissAgainPurpose());
-            setlinfoUpld.setChfpdrName(StringUtil.isBlank(caseFrontsheetMain.getMainDoctorName()) ? caseFrontsheetMain.getAdmissDoctorName() : caseFrontsheetMain.getMainDoctorName());
-            setlinfoUpld.setChfpdrCode(StringUtil.isBlank(getYbCode(caseFrontsheetMain.getMainDoctor())) ? getYbCode(caseFrontsheetMain.getAdmissDoctor()) : getYbCode(caseFrontsheetMain.getMainDoctor()));
-            setlinfoUpld.setNwbAge(caseFrontsheetMain.getAgeDays() == null ? "" : caseFrontsheetMain.getAgeDays().toString());
-            setlinfoUpld.setConerAddr(StringUtil.isBlank(caseFrontsheetMain.getContactAddrName()) ? caseFrontsheetMain.getLivePlace() : caseFrontsheetMain.getContactAddrName());
-            setlinfoUpld.setNwbBirWt(caseFrontsheetMain.getNewBornWeight() == null ? "" : caseFrontsheetMain.getNewBornWeight().toString());
-            setlinfoUpld.setAdmWay(StringUtil.isBlank(setlinfoUpld.getAdmWay()) ? StringUtil.isBlank(caseFrontsheetMain.getZyAdmissWay()) ? "2" : caseFrontsheetMain.getZyAdmissWay() : setlinfoUpld.getAdmWay());
-            setlinfoUpld.setNwbAdmWt(Convert.toStr(caseFrontsheetMain.getNewBornAdmissWeight(), ""));
-            String dutyNurse = getYbCode(caseFrontsheetMain.getDutyNurse());
+        CaseFrontsheetMain patientInfo = caseFrontSheetMainService.getPatientInfo(overview);
+        if (patientInfo != null) {
+            setlinfoUpld.setNtly(patientInfo.getCountry() != null ? dao.getCountrySiCode(patientInfo.getCountry()) : null);
+            setlinfoUpld.setPrfs(StringUtil.isBlank(patientInfo.getOccupation()) ? getPrfs(setlinfoUpld) : patientInfo.getOccupation());
+            setlinfoUpld.setCertno(patientInfo.getSocialNo());
+            setlinfoUpld.setCurrAddr(patientInfo.getLivePlace());
+            setlinfoUpld.setEmpName(patientInfo.getUnitName());
+            setlinfoUpld.setEmpAddr(patientInfo.getUnitPlace());
+            setlinfoUpld.setEmpTel(patientInfo.getUnitPhone());
+            setlinfoUpld.setPoscode("310".equals(patientInfo.getInsutype()) && StringUtil.isBlank(patientInfo.getUnitZipCode()) ? "410000" : patientInfo.getUnitZipCode());
+            setlinfoUpld.setNaty(redisLikeService.getWjwNation(patientInfo.getNation()));
+            setlinfoUpld.setConerName(patientInfo.getContactName());
+            setlinfoUpld.setBrdy(DateUtil.formatDatetime(patientInfo.getBirthDate(), "yyyy-MM-dd"));
+            setlinfoUpld.setAge(String.valueOf(patientInfo.getAge()));
+            setlinfoUpld.setGend(patientInfo.getSex());
+            setlinfoUpld.setPatnRlts(redisLikeService.getYbCodeContactRelation(patientInfo.getContactRelation()));
+            setlinfoUpld.setConerTel(patientInfo.getContactPhone());
+            setlinfoUpld.setPwcryBfadmComaDura(patientInfo.getComaDaysBeforeAdmiss() + "/" + patientInfo.getComaHoursBeforeAdmiss() + "/" + patientInfo.getComaMinutesBeforeAdmiss());
+            setlinfoUpld.setPwcryAfadmComaDura(patientInfo.getComaDaysAfterAdmiss() + "/" + patientInfo.getComaHoursAfterAdmiss() + "/" + patientInfo.getComaMinutesAfterAdmiss());
+            setlinfoUpld.setDscgWay(patientInfo.getZyDismissWay());
+            setlinfoUpld.setAcpMedinsName(patientInfo.getDismissDestination());
+            setlinfoUpld.setDaysRinpFlag31(patientInfo.getAdmissAgainInOneMonth());
+            setlinfoUpld.setDaysRinpPup31(patientInfo.getAdmissAgainPurpose());
+            setlinfoUpld.setChfpdrName(StringUtil.isBlank(patientInfo.getMainDoctorName()) ? patientInfo.getAdmissDoctorName() : patientInfo.getMainDoctorName());
+            setlinfoUpld.setChfpdrCode(StringUtil.isBlank(getYbCode(patientInfo.getMainDoctor())) ? getYbCode(patientInfo.getAdmissDoctor()) : getYbCode(patientInfo.getMainDoctor()));
+            setlinfoUpld.setNwbAge(patientInfo.getAgeDays() == null ? "" : patientInfo.getAgeDays().toString());
+            setlinfoUpld.setConerAddr(StringUtil.isBlank(patientInfo.getContactAddrName()) ? patientInfo.getLivePlace() : patientInfo.getContactAddrName());
+            setlinfoUpld.setNwbBirWt(patientInfo.getNewBornWeight() == null ? "" : patientInfo.getNewBornWeight().toString());
+            setlinfoUpld.setAdmWay(StringUtil.isBlank(setlinfoUpld.getAdmWay()) ? StringUtil.isBlank(patientInfo.getZyAdmissWay()) ? "2" : patientInfo.getZyAdmissWay() : setlinfoUpld.getAdmWay());
+            setlinfoUpld.setNwbAdmWt(Convert.toStr(patientInfo.getNewBornAdmissWeight(), ""));
+            String dutyNurse = getYbCode(patientInfo.getDutyNurse());
             if (StringUtil.notBlank(dutyNurse)) {
                 setlinfoUpld.setRespNursCode(dutyNurse);
             }
-            if (StringUtil.notBlank(caseFrontsheetMain.getDutyNurseName())) {
-                setlinfoUpld.setRespNursName(caseFrontsheetMain.getDutyNurseName());
+            if (StringUtil.notBlank(patientInfo.getDutyNurseName())) {
+                setlinfoUpld.setRespNursName(patientInfo.getDutyNurseName());
             }
-            String refldeptDept = redisLikeService.getYbDept(caseFrontsheetMain.getTransDeptCode());
+            String refldeptDept = redisLikeService.getYbDept(patientInfo.getTransDeptCode());
             if (refldeptDept != null) {
                 setlinfoUpld.setRefldeptDept(refldeptDept);
             }
-            String dscCaty = redisLikeService.getYbDept(caseFrontsheetMain.getAdmissDeptCode());
+            String dscCaty = redisLikeService.getYbDept(patientInfo.getAdmissDeptCode());
             if (dscCaty != null) {
                 setlinfoUpld.setDscgCaty(dscCaty);
             }