Parcourir la source

杭州七院:按照模板创建日期查询入院记录和首次病程录

wangsy il y a 11 mois
Parent
commit
cf19bd4186

+ 6 - 0
src/main/java/com/diagbot/dto/RecordContentDTO.java

@@ -5,6 +5,7 @@ import lombok.Data;
 import java.io.Serializable;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -54,6 +55,11 @@ public class RecordContentDTO implements Serializable {
      */
     private String recDate;
 
+    /**
+     * 文书首次创建时间
+     */
+    private Date firstCreateDate;
+
     /**
      * 医院文书id
      */

+ 35 - 2
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -869,7 +869,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         if (ListUtil.isNotEmpty(strAdmissionNoteList)) {
             newAddData("入院记录", strAdmissionNoteList, recMap, medrecVoList);
         } else {
-            addData("入院记录", recMap, medrecVoList);
+            addDataHZQY("入院记录", recMap, medrecVoList, "1", analyzeVO.getBehospitalCode());
         }
 
         //输血效果评价
@@ -919,7 +919,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         if (ListUtil.isNotEmpty(strFirstRecordList)) {
             newAddData("首次病程录", strFirstRecordList, recMap, medrecVoList);
         } else {
-            addData("首次病程录", recMap, medrecVoList);
+            addDataHZQY("首次病程录", recMap, medrecVoList, "2", analyzeVO.getBehospitalCode());
         }
 
         //病危通知单
@@ -1175,6 +1175,39 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         }
     }
 
+    /**
+     * 拼接数据
+     *
+     * @param key
+     * @param recMap
+     * @param medrecVoList
+     */
+    public void addDataHZQY(String key, Map<String, List<RecordContentDTO>> recMap, List<MedrecVo> medrecVoList, String modeId,String behospitalCode) {
+        List<RecordContentDTO> list = recMap.get(key);
+        List<MedicalRecord> recordList = medicalRecordFacade.list(new QueryWrapper<MedicalRecord>()
+                .eq("mode_id", modeId)
+                .eq("hospital_id", "14")
+                .eq("behospital_code", behospitalCode)
+                .orderByAsc("rec_date")
+        );
+
+        if (ListUtil.isNotEmpty(list)) {
+            for (RecordContentDTO recordContentDTO : list) {
+                recordContentDTO.setIsParsed(0);
+                recordContentDTO.setFirstCreateDate(recordList.get(0).getRecDate());
+            }
+        }
+        if (ListUtil.isNotEmpty(list)) {
+            MedrecVo medrecVo = new MedrecVo();
+            Map<String, Object> content = new HashMap<>();
+            content.put("content", list);
+            medrecVo.setTitle(key);
+            medrecVo.setContent(content);
+            medrecVoList.add(medrecVo);
+        }
+    }
+
+
     /**
      * 1.5.0拼接数据(手术、会诊)
      *

+ 7 - 0
src/main/java/com/diagbot/util/TZDBConn.java

@@ -496,6 +496,13 @@ public class TZDBConn {
                 medicalRecord.setOrgCode(rs.getString("orgCode"));//组织机构代码
                 medicalRecord.setRecTypeId(rs.getString("recTypeId"));//对应his模板ID
                 medicalRecord.setRecDate(rs.getString("recDate") != null ? DateUtil.parseDateTime(rs.getString("recDate")) : null);//病历日期
+                if(StringUtil.isNotBlank(rs.getString("zuixinbz"))){
+                    if( rs.getString("zuixinbz").equals("1")){
+                        medicalRecord.setIsDeleted("N");
+                    }else {
+                        medicalRecord.setIsDeleted("Y");
+                    }
+                }
                 medicalRecord.setRecTitle(rs.getString("recTitle"));//病历标题
 
                 medicalRecordList.add(medicalRecord);