Browse Source

Merge branch 'updateload31'

# Conflicts:
#	pom.xml
xiaochan 1 month ago
parent
commit
f462d2ffae
39 changed files with 6273 additions and 22 deletions
  1. 2 2
      pom.xml
  2. 1 1
      thyy-emr-query/src/main/resources/application.yml
  3. 26 17
      thyy-scheduled/src/main/java/org/thyy/scheduled/service/FetchClockinData.java
  4. 2 2
      thyy-scheduled/src/main/java/org/thyy/scheduled/task/AccessTokenTask.java
  5. 21 0
      thyy-three-one/HELP.md
  6. 87 0
      thyy-three-one/pom.xml
  7. 69 0
      thyy-three-one/src/main/java/org/thyy/threeone/ThyyThreeOneApplication.java
  8. 29 0
      thyy-three-one/src/main/java/org/thyy/threeone/dao/EmrPatientDao.java
  9. 263 0
      thyy-three-one/src/main/java/org/thyy/threeone/dao/InPatientDao.java
  10. 80 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/Insutype.java
  11. 103 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/PatientInfo.java
  12. 52 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/TReqSurgicalDiag.java
  13. 29 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/UserInfo.java
  14. 238 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/emr/EmrAuditDetail.java
  15. 202 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/emr/EmrPatientData.java
  16. 69 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/emr/EmrProgressNote.java
  17. 37 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/PublicInfo.java
  18. 157 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbDiagnosisDetail.java
  19. 216 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbDischargeSummary.java
  20. 222 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIp24hDeath.java
  21. 346 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIp24hDischarge.java
  22. 156 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIpAdmission.java
  23. 335 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIpAdmissionRecord.java
  24. 169 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIpDailyCourse.java
  25. 120 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIpDeathInfo.java
  26. 182 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIpDischargeSummary.java
  27. 250 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIpFirstCourse.java
  28. 741 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIpSurgery.java
  29. 184 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIpTransfer.java
  30. 124 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbQualityEmr.java
  31. 27 0
      thyy-three-one/src/main/java/org/thyy/threeone/entity/yz/ZyZkList.java
  32. 913 0
      thyy-three-one/src/main/java/org/thyy/threeone/service/InPatientServer.java
  33. 28 0
      thyy-three-one/src/main/resources/application.yml
  34. 20 0
      thyy-utils/src/main/java/org/thyy/utils/DateUtil.java
  35. 125 0
      thyy-utils/src/main/java/org/thyy/utils/SqlGenerator.java
  36. 355 0
      thyy-utils/src/main/java/org/thyy/utils/StringUtil.java
  37. 13 0
      thyy-utils/src/main/java/org/thyy/utils/emr/EmrContrast.java
  38. 271 0
      thyy-utils/src/main/java/org/thyy/utils/emr/EmrJsonUtils.java
  39. 9 0
      thyy-utils/src/main/java/org/thyy/utils/entity/CodeName.java

+ 2 - 2
pom.xml

@@ -28,7 +28,7 @@
         <thyy-medinsur>0.0.1</thyy-medinsur>
         <!--   plugins     -->
         <thyy-gateway>0.0.1</thyy-gateway>
-
+        <thyy-three-one>0.0.1</thyy-three-one>
     </properties>
     <modules>
         <module>thyy-archive</module>
@@ -40,7 +40,7 @@
         <module>thyy-scheduled</module>
         <module>thyy-plugins</module>
         <module>thyy-medinsur</module>
-
+        <module>thyy-three-one</module>
         <module>thyy-hospital-server</module>
     </modules>
     <dependencies>

+ 1 - 1
thyy-emr-query/src/main/resources/application.yml

@@ -10,7 +10,7 @@ spring:
     cache: false
   datasource:
     dynamic:
-      primary: dev
+      primary: his
       strict: false
       datasource:
         his:

+ 26 - 17
thyy-scheduled/src/main/java/org/thyy/scheduled/service/FetchClockinData.java

@@ -5,8 +5,11 @@ import cn.hutool.core.date.Week;
 import cn.hutool.core.map.BiMap;
 import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson2.JSONArray;
 import com.alibaba.fastjson2.JSONObject;
+import jakarta.annotation.PostConstruct;
 import lombok.Getter;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -43,23 +46,17 @@ public class FetchClockinData {
         this.classDao = classDao;
     }
 
-//    @PostConstruct
-//    public void init() {
-//        Date start = DateUtil.beginOfMonth(DateUtil.date());
-//        Date end = DateUtil.endOfMonth(DateUtil.date());
-//
-//        // 生成日期范围列表
-//        List<DateTime> dateList = DateUtil.rangeToList(start, end, DateField.DAY_OF_MONTH);
-//
-//        // 循环每一天
-//        for (DateTime dateTime : dateList) {
-//            try {
-//                run(DateUtil.format(dateTime, "yyyy-MM-dd"));
-//            } catch (Exception e) {
-//                e.printStackTrace();
-//            }
-//        }
-//    }
+
+    //    @PostConstruct
+    public void init() {
+        Clockin request = new Clockin();
+        String yesterday = "2025-09-20";
+        request.setTimes(yesterday, yesterday);
+        List<String> codeRsList = dao.getAllEmployeeInItDept();
+        request.setInformationDept(true);
+        request.setUseridlist(codeRsList);
+        setAnalyzeItDeptData(yesterday, getSignInfo(request));
+    }
 
     public void run(String yesterday) {
         Clockin request = new Clockin();
@@ -251,6 +248,18 @@ public class FetchClockinData {
 
         list.add(shangban);
         list.add(xiaban);
+
+        // 这个人不休息也不是周六那么就需要打卡四次
+        if (flag != Vacation.XIUXI && flag != Vacation.SATURDAY) {
+            Clockin shangwuxiaban = getDefaultData(code, Type.xiaban, starttime);
+            shangwuxiaban.setItCheckinTime2(generateRandomTime(starttime + " 12:00:00", starttime + " 12:15:00"));
+
+            Clockin xuawushangban = getDefaultData(code, Type.shangban, starttime);
+            xuawushangban.setItCheckinTime2(generateRandomTime(starttime + " 13:50:00", starttime + " 14:00:00"));
+            list.add(shangwuxiaban);
+            list.add(xuawushangban);
+        }
+
         return list;
     }
 

+ 2 - 2
thyy-scheduled/src/main/java/org/thyy/scheduled/task/AccessTokenTask.java

@@ -37,11 +37,11 @@ public class AccessTokenTask {
 
     @Scheduled(fixedRate = 5 * 60 * 1000)
     public void doLisDockSign() {
-        lisDockSign.doSign();
+        TryUtil.ignoreErr(lisDockSign::doSign);
     }
 
     @Scheduled(fixedRate = 30 * 60 * 1000)
     public void getThmzToken() {
-        thmzHttp.getToken();
+        TryUtil.ignoreErr(thmzHttp::getToken);
     }
 }

+ 21 - 0
thyy-three-one/HELP.md

@@ -0,0 +1,21 @@
+# Getting Started
+
+### Reference Documentation
+For further reference, please consider the following sections:
+
+* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
+* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/3.5.6/maven-plugin)
+* [Create an OCI image](https://docs.spring.io/spring-boot/3.5.6/maven-plugin/build-image.html)
+
+### Guides
+The following guides illustrate how to use some features concretely:
+
+* [Accessing data with MySQL](https://spring.io/guides/gs/accessing-data-mysql/)
+
+### Maven Parent overrides
+
+Due to Maven's design, elements are inherited from the parent POM to the project POM.
+While most of the inheritance is fine, it also inherits unwanted elements like `<license>` and `<developers>` from the parent.
+To prevent this, the project POM contains empty overrides for these elements.
+If you manually switch to a different parent and actually want the inheritance, you need to remove those overrides.
+

+ 87 - 0
thyy-three-one/pom.xml

@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.thyy.business</groupId>
+        <artifactId>thyy-business</artifactId>
+        <version>0.0.1</version>
+    </parent>
+    <groupId>org.thyy.threeone</groupId>
+    <artifactId>thyy-three-one</artifactId>
+    <version>${thyy-three-one}}</version>
+    <properties>
+        <java.version>21</java.version>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.mysql</groupId>
+            <artifactId>mysql-connector-j</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.thyy.business</groupId>
+            <artifactId>thyy-utils</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>2.0.52</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot3-starter</artifactId>
+            <version>4.2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>8.0.28</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <annotationProcessorPaths>
+                        <path>
+                            <groupId>org.projectlombok</groupId>
+                            <artifactId>lombok</artifactId>
+                        </path>
+                    </annotationProcessorPaths>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>
+                            <groupId>org.projectlombok</groupId>
+                            <artifactId>lombok</artifactId>
+                        </exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 69 - 0
thyy-three-one/src/main/java/org/thyy/threeone/ThyyThreeOneApplication.java

@@ -0,0 +1,69 @@
+package org.thyy.threeone;
+
+import cn.hutool.core.date.DatePattern;
+import cn.hutool.json.JSONConfig;
+import cn.hutool.json.JSONUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ComponentScan;
+import org.thyy.threeone.entity.updateTrinity.*;
+import org.thyy.threeone.service.InPatientServer;
+import org.thyy.utils.SqlGenerator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@SpringBootApplication
+@Slf4j
+@ComponentScan("org.thyy.*")
+@MapperScan("org.thyy.*.dao")
+public class ThyyThreeOneApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(ThyyThreeOneApplication.class, args);
+
+        JSONConfig jsonConfig = new JSONConfig();
+        jsonConfig.setDateFormat(DatePattern.NORM_DATETIME_PATTERN);
+
+
+        InPatientServer inPatientServer = new InPatientServer();
+//        inPatientServer.setPatList(new ArrayList<>() {{
+//            add("0427808_3");
+//        }});
+//        inPatientServer.init();
+//
+//        TbIpFirstCourse admissionRecord = (TbIpFirstCourse) inPatientServer.getPatData()
+//                .get("0427808_3")
+//                .get("TbIpFirstCourse");
+//
+//        String sql = SqlGenerator.generateInsertSql(admissionRecord);
+//        log.info("sql:{}", sql);
+//
+//        log.info("数据1:{}", JSONUtil.toJsonStr(inPatientServer.getPatData(), jsonConfig));
+
+        inPatientServer.setPatList(new ArrayList<>() {{
+            add("0416665_2");
+        }});
+        inPatientServer.setStartDate("2025-09-30");
+        inPatientServer.setEndDate("2025-09-30");
+        inPatientServer.init();
+        log.info("数据2:{}", JSONUtil.toJsonStr(inPatientServer.getPatData(), jsonConfig));
+
+        TbIpDeathInfo data = (TbIpDeathInfo) inPatientServer.getPatData()
+                .get("0416665_2")
+                .get("TbIpDeathInfo");
+        String sql1 = SqlGenerator.generateInsertSql(data);
+        log.info("sql1:{}", sql1);
+
+        List<TbDiagnosisDetail> data1 = (List<TbDiagnosisDetail>) inPatientServer.getPatData()
+                .get("0416665_2")
+                .get("TbDiagnosisDetail");
+        for (TbDiagnosisDetail item : data1) {
+            String sql2 = SqlGenerator.generateInsertSql(item);
+            log.info("sql2:{}", sql2);
+        }
+    }
+
+}

+ 29 - 0
thyy-three-one/src/main/java/org/thyy/threeone/dao/EmrPatientDao.java

@@ -0,0 +1,29 @@
+package org.thyy.threeone.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.*;
+import org.thyy.threeone.entity.emr.EmrPatientData;
+import org.thyy.threeone.entity.emr.EmrProgressNote;
+
+import java.util.List;
+
+@Mapper
+public interface EmrPatientDao extends BaseMapper<EmrPatientData> {
+
+
+    @Select("""
+            select top 1 emr_data_element as emrDataElementStr, *
+            from emr_patient_data
+            where emr_category_code = '${code}' and pat_no = #{patNo} and times = #{times} and del_flag = 0
+            order by create_date desc""")
+    EmrPatientData findEmrDataByCode(String patNo, Integer times, String code);
+
+    @Select("""
+            select * from emr_progress_note
+            where document_id =
+            (select top 1 id from emr_patient_data
+            where pat_no = '${patNo}' and times = ${times} and del_flag = 0
+            and emr_category_code = 'shoucibingchengjilu' order by modify_date desc )
+            and creation_time >= '${start} 00:00:00' and creation_time <= '${end} 23:59:59' and create_id is not null""")
+    List<EmrProgressNote> getEmrProgressNote(String patNo, Integer times, String start, String end);
+}

+ 263 - 0
thyy-three-one/src/main/java/org/thyy/threeone/dao/InPatientDao.java

@@ -0,0 +1,263 @@
+package org.thyy.threeone.dao;
+
+import org.apache.ibatis.annotations.Insert;
+import org.thyy.threeone.entity.PatientInfo;
+import org.thyy.threeone.entity.TReqSurgicalDiag;
+import org.thyy.threeone.entity.UserInfo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import org.thyy.threeone.entity.emr.EmrAuditDetail;
+import org.thyy.threeone.entity.updateTrinity.*;
+import org.thyy.threeone.entity.yz.ZyZkList;
+import org.thyy.utils.entity.CodeName;
+
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface InPatientDao {
+
+    @Select("""
+                        select rtrim(a.inpatient_no) + '_' + cast(a.admiss_times as varchar(3))             as ipt_mdtrt_sn,
+                   a.inpatient_no                                                               as patient_id,
+                   certno                                                                       as card_no,
+                   (select three_one_code from t_zd_psn_cert_type where b.psn_cert_type = code) as card_type,
+                   rtrim(a.name)                                                                as patient_name,
+                   consult_physician                                                            as resident_physician_code,
+                   0                                                                            as observation_flag,
+                   admiss_dept                                                                  as adm_dept_code,
+                   bed_no                                                                       as bed_no,
+                   admiss_date                                                                  as admission_time,
+                   ward                                                                         as ward_no,
+                   admiss_physician                                                             as visiting_physician_code,
+                   admiss_way                                                                   as admission_type_code,
+                   dis_dept                                                                     as discharge_dept_code,
+                   consult_physician                                                            as doctor_code,
+                   dis_date                                                                     as discharge_time,
+                   '400'                                                                     as mdtrt_type,
+                   0 AS vipFlag,
+                   insutype                                                                     as insurance_type,
+                   1 AS  nonlocal_flag,
+            a.sex as genderCode,naty as ethnicGroup
+            from view_zy_allpatient a
+                     left join a_patient_mi b
+                               on (a.inpatient_no = b.inpatient_no)
+                     left join t_si_setlinfo on (pat_no = a.inpatient_no and times = a.admiss_times)
+            where a.inpatient_no = '${patNo}'
+              and a.admiss_times = ${times}""")
+    TbIpAdmissionRecord getTbIpAdmissionRecord(String patNo, Integer times);
+
+
+    @Select("""
+            select a.mz_no as card_no, '3' as card_type,
+                               certno as id_number,
+            a.name as patient_name,
+                   (select three_one_code from t_zd_psn_cert_type where b.psn_cert_type = code) as id_type_code,
+                   ward as ward_no,(select rtrim(name) from zd_unit_code where code = ward) ward_name,
+                   bed_no as bed_no,refer_physician as resident_physician_id,
+                   dept as dept_code,(select rtrim(name) from zd_unit_code where code = dept) as dept_name 
+            from view_zy_allpatient a
+                     left join a_patient_mi b
+                               on (a.inpatient_no = b.inpatient_no)
+                     left join t_si_setlinfo on (pat_no = a.inpatient_no and times = a.admiss_times)
+                     where a.inpatient_no = '${patNo}'
+              and a.admiss_times = ${times} """)
+    TbIpFirstCourse getTbIpFirstCourse(String patNo, Integer times);
+
+
+    @Select("""
+            select a.mz_no                                                                      as card_no,
+                   '3'                                                                          as card_type,
+                   b.social_no                                                                  as id_number,
+                   (select three_one_code from t_zd_psn_cert_type where b.psn_cert_type = code) as id_type_code,
+                   b.name                                                                       as patient_name,
+                   b.sex                                                                        as gender_code,
+                   c.nation                                                                         as ethnic_group,
+                   a.admiss_date                                                                as admission_time,
+                   dis_date                                                                     as discharge_time,
+                   admiss_physician                                                             as admitting_doctor_code,
+                   refer_physician                                                              as resident_doctor_code,
+                   dept_director                                                                as chief_doctor_code,
+                   d.dismiss_status                                                             as discharge_condition,
+                   '80000' as occupationCode
+            from view_zy_allpatient a
+                     left join a_patient_mi b on (a.inpatient_no = b.inpatient_no)
+                     left join t_case_frontsheet_main c on (bah = a.inpatient_no and c.admiss_times = a.admiss_times)
+                     left join t_case_frontsheet_disdiag d on (a.inpatient_no = d.bah and d.times = a.admiss_times and d.no = 1)
+                     where a.inpatient_no = '${patNo}'
+              and a.admiss_times = ${times}""")
+    TbIp24hDischarge getTbIp24hDischarge(String patNo, Integer times);
+
+    @Select("""
+            select a.mz_no as card_no, '3' as card_type,
+                               certno as id_number,
+                   (select three_one_code from t_zd_psn_cert_type where b.psn_cert_type = code) as id_type_code,
+                   a.name as patient_name,a.sex as gender_code,naty as ethnic_group,
+                   a.admiss_date as  admission_time,dis_date as death_time,
+                   admiss_physician as admitting_doctor_code, refer_physician as resident_doctor_code,
+                   dept_director as chief_doctor_code,d.dismiss_status as discharge_condition,
+                   occupation as occupation_code,contact_name as informant_name,contact_relation as relation_code,
+                   1 as info_reliable,(select rtrim(zd.name) from zd_admiss_status zd where code = d.admiss_status ) as admission_condition
+            from view_zy_allpatient a
+                     left join a_patient_mi b
+                               on (a.inpatient_no = b.inpatient_no)
+                     left join t_si_setlinfo c on (pat_no = a.inpatient_no and times = a.admiss_times)
+            left join t_case_frontsheet_disdiag d on (a.inpatient_no= d.bah and d.times = a.admiss_times and d.no = 1)
+            left join t_case_frontsheet_main e on (a.inpatient_no= e.bah and a.admiss_times= e.admiss_times) 
+                     where a.inpatient_no = '${patNo}'
+              and a.admiss_times = ${times}""")
+    TbIp24hDeath getTbIp24hDeath(String patNo, Integer times);
+
+
+    @Select("""
+            select a.mz_no as card_no,  '3' as card_type,
+            rtrim(a.admiss_dept ) as adm_dept_code,(select rtrim(name) from zd_unit_code ad where code = a.admiss_dept) as adm_dept_name,
+            admiss_date as admission_time, small_dept as discharge_department, 
+            (select rtrim(name) from zd_unit_code ad where code = a.small_dept) as discharge_department_name,
+            a.dis_date as discharge_time,0 as observation_flag,
+            insutype as insurance_type,0 as vip_flag, 5 as nonlocal_flag
+            from view_zy_allpatient a 
+            left join t_si_setlinfo on (pat_no = a.inpatient_no and times = a.admiss_times)
+            where a.inpatient_no = '${patNo}' and a.admiss_times = ${times}""")
+    TbIpDischargeSummary getTbIpDischargeSummary(String patNo, Integer times);
+
+
+    @Select("select rtrim(code) as code, rtrim(name) as name," +
+            "rtrim(yb_code) as yb_code " +
+            "from a_employee_mi where code = '${code}'")
+    UserInfo getUserInfo(String code);
+
+    @Select("""
+            select rtrim(name) from zd_unit_code where code = '${code}'""")
+    String getDeptName(String code);
+
+
+    @Select("select count(1)\n" +
+            "from zd_icd_code_new\n" +
+            "where code in (${codes})\n" +
+            "  and infectiousdiseases_flag = 1;")
+    Integer isInfectious(String codes);
+
+    @Select("""
+                        select rtrim(b.sex) as genderCode,nation as ethnicGroup,
+                               occupation as occupation_code ,
+            a.admiss_date, dis_date,dept_director as chiefDoctorCode,refer_physician,dis_dept,
+            mi.social_no as idNumber,
+            (select wjw_code from zd_zy_dismiss_way where code = zy_dismiss_way) as zy_dismiss_way,
+                   isnull(a.admiss_diag, c.icd_code)                       as admDiagnosisCode,
+                   c.icd_text                                              as admDiagnosisName,
+            mi.birth_date,dept,(select name from zd_unit_code where code = dept) as deptName,
+            ward,(select name from zd_unit_code where code = ward) as wardName
+            from view_zy_allpatient a left join t_case_frontsheet_main b
+            on (a.inpatient_no= b.bah and a.admiss_times = b.admiss_times)
+            left join zy_in_diag_yb c on (a.inpatient_no = c.inpatient_no and a.admiss_times = c.admiss_times)
+            left join a_patient_mi mi on  (a.inpatient_no = mi.inpatient_no)
+            where a.inpatient_no = '${patNo}'
+              and a.admiss_times = ${times}""")
+    PatientInfo getPatientInfo(String patNo, Integer times);
+
+
+    @Select("select enter_oper as dischargeOrderDoctorCode, order_time as dischargeOrderTime " +
+            "from view_xc_all_yz a " +
+            "where inpatient_no = '${patNo}'\n" +
+            "  and admiss_times = ${times} " +
+            "and order_code in (select yz_zd_order_item_confirm.order_code from yz_zd_order_item_confirm where order_name = N'出院')"
+    )
+    PatientInfo getDischargeOrder(String patNo, Integer times);
+
+    @Select("""
+            select mz_no as card_no, '5' as card_type,
+            dept as dept_code,(select rtrim(zd.name) from zd_unit_code zd where code = dept) as dept_name,
+            ward as ward_num,(select rtrim(zd.name) from zd_unit_code zd where code = ward) as area_name,
+            bed_no as sickbed_num,
+            data_element as treat_note
+                   from emr_progress_note
+                left join view_zy_allpatient b on (b.inpatient_no = '${patNo}' and b.admiss_times = ${times})
+            where document_id = (select top 1 id from emr_patient_data where pat_no = '${patNo}'
+             and times = ${times} and del_flag = 0 order by modify_date desc ) and emr_progress_note.name like N'%转科%'
+             and creation_time >= '${start} 00:00:00' and creation_time <= '${end} 23:59:59'""")
+    List<TbIpTransfer> getZkNote(String patNo, Integer times, String start, String end);
+
+    @Select("""
+            select f_dept_code,f_ward_code,a.dept_code, a.ward_code,op_id,op_time,b.enter_oper as refer_physician,
+                   b.consult_physician
+            from zy_zk_list a left join view_xc_all_yz b on (a.act_order_no = b.act_order_no) 
+            where a.inpatient_no = '${patNo}' and a.admiss_times = ${times}""")
+    List<ZyZkList> getZkList(String patNo, Integer times);
+
+
+    @Select("""
+            select dept as dept_code,(select rtrim(zd.name) from zd_unit_code zd where code = dept) as dept_name,
+            ward as eord_num,(select rtrim(zd.name) from zd_unit_code zd where code = ward) as ward_name,
+            bed_no as sickbed_num,mz_no as card_no,'5' as card_type,refer_physician as attending_doctor_code
+            from view_zy_allpatient a
+            where a.inpatient_no = '${patNo}' and a.admiss_times = ${times}""")
+    TbIpDeathInfo getTbIpDeathInfo(String patNo, Integer times);
+
+
+    @Select("""
+            select mz_no as card_no,5 as card_type,name as patient_name,'400' as mdtrt_type,
+                   ward as wardarea_code,(select rtrim(name) from zd_unit_code zd where zd.code = ward) as wardarea_name,
+                   ward as waed_no,rtrim(a.bed_no) as bed_no,cast(record_id as varchar(max)) as appy_no,dept as dept_code,
+                   (select rtrim(name) from zd_unit_code zd where zd.code = dept) as dept_name,
+                   refer_physician as ipdr_code,act_order_no as doct_advice_no,0 as daylight_opr_mark,
+                   isnull(urgent_clinic_flag, 2) as selv_flag,isnull(urgent_clinic_flag, 2) as oprn_type,
+                   req_date as oprn_begin_time,op_endtime as oprn_end_time
+            from op_record a left join view_zy_allpatient b on (a.inpatient_no = b.inpatient_no and a.admiss_times = b.admiss_times)
+            left join t_si_setlinfo si on (si.pat_no = a.inpatient_no and si.times = a.admiss_times)
+                where a.inpatient_no = '${patNo}' and a.admiss_times = ${times}""")
+    List<TbIpSurgery> getTbIpSurgery(String patNo, Integer times);
+
+    @Select("""
+            select * from t_req_surgical_diag where req_no = ${reqNo}""")
+    List<TReqSurgicalDiag> getTReqSurgicalDiag(String reqNo);
+
+    @Select("""
+            select mz_no as card_no, 5 as card_type, 1 as coding_type, no as diag_no,
+            code as diag_code,a.name as diag_name,N'未说明' as diag_desc,
+            a.admiss_status as admission_condition,a.dismiss_status as discharge_status,a.op_id_code as diag_doctor_code,
+            b.admiss_date as create_time, b.refer_physician as diagDoctorCode
+            from
+                         t_case_frontsheet_disdiag a 
+            left join view_zy_allpatient b on (a.bah = b.inpatient_no and a.times = b.admiss_times)
+                     where bah = '${patNo}' and times = ${times}""")
+    List<TbDiagnosisDetail> getTbDiagnosisDetail(String patNo, Integer times);
+
+    @Select("""
+            select sign_date as archive_time from t_case_frontsheet_main where bah = '${patNo}' and admiss_times = ${times}""")
+    TbDiagnosisDetail getTbDiagnosisDetailMain(String patNo, Integer times);
+
+    @Insert("${sql}")
+    int insertData(String sql);
+
+    @Select("""
+            select rtrim(mi.name) as patient_name,mz_no as card_no, 5 as card_type,
+                   mi.sex as gender,dept as dept_code,(select rtrim(name) from zd_unit_code zd where code = dept) as dept_name,
+                   a.bed_no,mi.birth_date as age,admiss_date as admission_time,dis_date as discharge_time,
+                   ward as room_no, (select rtrim(name) from zd_unit_code zd where code = ward) as ward_name,home_tel as phone_no
+                   from view_zy_allpatient a
+                     left join a_patient_mi mi on (a.inpatient_no = mi.inpatient_no) 
+                     where a.inpatient_no = '${patNo}' and a.admiss_times = ${times}""")
+    TbDischargeSummary getTbDischargeSummary(String patNo, Integer times);
+
+
+    @Select("""
+            select code,name from t_case_frontsheet_disdiag where bah = '${patNo}' and times = ${times} order by no""")
+    List<CodeName> getDisDiag(String patNo, Integer times);
+
+
+    @Select("""
+            select id, pat_no, times,
+                   approver,
+                   review_time, name,
+                   scoring_criteria, remark, remediation_status,
+                   number_of_defects, modify_person, modification_time,
+                   emr_id,
+                   (select emr_document_id from emr_patient_data where emr_patient_data.id = emr_audit_detail.id) as emr_document_id,
+                   history, doctor, final_control, level, minus_points
+            from emr_audit_detail where pat_no = '${patNo}' and times = ${times}
+            and review_time >= '${start}' and review_time <= '${end}'""")
+    List<EmrAuditDetail> getEmrAuditDetail(String patNo, Integer times, String start, String end);
+
+
+}

+ 80 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/Insutype.java

@@ -0,0 +1,80 @@
+package org.thyy.threeone.entity;
+
+
+import org.thyy.utils.StringUtil;
+
+/**
+ * @description: 险种类型
+ * @author: DingJie
+ * @create: 2021/7/129:12
+ */
+public enum Insutype {
+
+    BASIC_MEDICAL_INSURANCE_FOR_EMPLOYEES("310", "职工基本医疗保险"),
+
+    MEDICAID_FOR_CIVIL_SERVANTS("320", "公务员医疗补助"),
+
+    LARGE_MEDICAL_EXPENSES_SUBSIDY("330", "大额医疗费用补助"),
+
+    MEDICAL_SECURITY_FOR_RETIRED_PERSONNEL("340", "离休人员医疗保障"),
+
+    MEDICAID_FOR_DISABLED_SOLDIERS("350", "一至六级残废军人医疗补助"),
+
+    MEDICAID_FOR_ELDERLY_RED_ARMY("360", "老红军医疗保障"),
+
+    ENTERPRISE_SUPPLEMENTARY_MEDICAL_INSURANCE("370", "企业补充医疗保险"),
+
+    NEW_RURAL_COOPERATIVE_MEDICAL_SYSTEM("380", "新型农村合作医疗"),
+
+    BASIC_MEDICAL_INSURANCE_FOR_RURAL_RESIDENTS("390", "城乡居民基本医疗保险"),
+
+    BASIC_MEDICAL_INSURANCE_FOR_URBAN_RESIDENTS("391", "城镇居民基本医疗保险"),
+
+    SERIOUS_ILLNESS_MEDICAL_INSURANCE_FOR_URBAN_AND_RURAL_RESIDENTS("392", "城乡居民大病医疗保险"),
+
+    MEDICAL_SECURITY_FOR_OTHER_SPECIAL_PERSONNEL("399", "其他特殊人员医疗保障"),
+
+    LONG_TERM_CARE_INSURANCE("410", "长期照护保险"),
+
+    MATERNITY_INSURANCE("510", "生育保险");
+
+    private final String code;
+    private final String name;
+
+    Insutype(String code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public static Insutype get(String code) {
+        if (StringUtil.isBlank(code)) {
+            return null;
+        }
+        for (Insutype insutype : Insutype.values()) {
+            if (code.trim().equals(insutype.getCode())) {
+                return insutype;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(String code) {
+        if (StringUtil.isBlank(code)) {
+            return null;
+        }
+        for (Insutype insutype : Insutype.values()) {
+            if (code.trim().equals(insutype.getCode())) {
+                return insutype.getName();
+            }
+        }
+        return null;
+    }
+}

+ 103 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/PatientInfo.java

@@ -0,0 +1,103 @@
+package org.thyy.threeone.entity;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class PatientInfo {
+    // 补充 性别
+    private String genderCode;
+
+    // 补充名族
+    private String ethnicGroup;
+
+    // 职业
+    private String occupationCode;
+    // 入院时间
+    private Date admissDate;
+    // 出院时间
+    private Date disDate;
+    // 出院科室
+    private String disDept;
+    // 出院科室名字
+    private String disDeptName;
+    // 出院医生
+    private String dischargeOrderDoctorCode;
+    // 出院医生名字
+    private String dischargeOrderDoctorName;
+
+    // 出院医生时间
+    private Date dischargeOrderTime;
+
+    /**
+     * 主任医师代码 - 主任医师医保贯标码
+     */
+    private String chiefDoctorCode;
+
+    /**
+     * 主任医师签名 - 具有主任医师专业技术职务资格的医师签署的在公安户籍管理部门正式登记注册的姓氏和名称
+     */
+    private String chiefDoctorName;
+
+    /**
+     * 管床医生
+     */
+    private String referPhysician;
+    private String referPhysicianName;
+    private String zyDismissWay;
+
+    /**
+     * 入院诊断编码(主要诊断)
+     */
+    private String admDiagnosisCode;
+    /**
+     * 入院诊断名称(主要诊断)
+     */
+    private String admDiagnosisName;
+
+    /**
+     * 患者姓名 - 患者本人在公安户籍管理部门正式登记注册的姓氏和名称
+     */
+    private String patientName;
+
+    /**
+     * 证件类别代码 - LY.00.97人员证件类型
+     */
+    private String idTypeCode;
+
+    /**
+     * 证件号码
+     */
+    private String idNumber;
+
+    /**
+     * 年龄(岁) - 患者年龄满1周岁的实足年龄
+     */
+    private String ageYear;
+
+    /**
+     * 年龄(月) - 年龄不足1周岁的实足年龄的月龄
+     */
+    private String ageMonth;
+
+    /**
+     * 年龄 - 需要带单位,比如 10 岁 ,3 天,6 月
+     */
+    private String age;
+
+
+    /**
+     * 婚姻状况代码 - GB/T2261.2-2003婚姻状况代码表
+     */
+    private String maritalStatus;
+
+
+    private String birthDate;
+
+    private String dept;
+    private String deptName;
+    private String ward;
+    private String wardName;
+
+}

+ 52 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/TReqSurgicalDiag.java

@@ -0,0 +1,52 @@
+package org.thyy.threeone.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+@Data
+@TableName(value = "t_req_surgical_diag")
+@Accessors(chain = true)
+public class TReqSurgicalDiag implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 5678998233181202666L;
+    public static final int SURGERY = 1;
+    public static final int DIAGNOSIS = 2;
+
+
+    /**
+     * 申请单号
+     */
+    @TableField(value = "req_no")
+    private Integer reqNo;
+
+    /**
+     * 编码
+     */
+    @TableField(value = "code")
+    private String code;
+
+    /**
+     * 名称
+     */
+    @TableField(value = "name")
+    private String name;
+
+    /**
+     * 1-手术 2- 诊断
+     */
+    @TableField(value = "type")
+    private Integer type;
+
+    /**
+     * 排序
+     */
+    @TableField(value = "sort")
+    private Integer sort;
+
+}

+ 29 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/UserInfo.java

@@ -0,0 +1,29 @@
+package org.thyy.threeone.entity;
+
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author dj
+ */
+@Data
+public class UserInfo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 编码
+     */
+    private String code;
+
+    /**
+     * 名字
+     */
+
+    private String name;
+
+    private String ybCode;
+}

+ 238 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/emr/EmrAuditDetail.java

@@ -0,0 +1,238 @@
+package org.thyy.threeone.entity.emr;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.Getter;
+import lombok.experimental.Accessors;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@Accessors(chain = true)
+@TableName("emr_audit_detail")
+public class EmrAuditDetail implements Serializable {
+
+    @Getter
+    public enum ScoringCriteriaEnum {
+
+        light(1, "轻"),
+
+        middle(2, "中"),
+
+        heavy(3, "重");
+
+
+        private final Integer code;
+        private final String name;
+
+        ScoringCriteriaEnum(Integer code, String name) {
+            this.code = code;
+            this.name = name;
+        }
+
+        public static String getNameByCode(Integer code) {
+            for (ScoringCriteriaEnum value : ScoringCriteriaEnum.values()) {
+                if (value.getCode().equals(code)) {
+                    return value.getName();
+                }
+            }
+            return "";
+        }
+
+    }
+
+    @Getter
+    public enum RemediationStatusEnum {
+        rectified(1, "已整改"),
+
+        itIsKnownThatNoRectificationIsRequired(2, "已知无需整改");
+
+        private final Integer code;
+        private final String name;
+
+        RemediationStatusEnum(Integer code, String name) {
+            this.code = code;
+            this.name = name;
+        }
+
+        public static String getNameByCode(Integer code) {
+            for (RemediationStatusEnum value : RemediationStatusEnum.values()) {
+                if (value.getCode().equals(code)) {
+                    return value.getName();
+                }
+            }
+            return "";
+        }
+    }
+
+    @Getter
+    public enum levelEnum {
+        HOSP(0, "全院"),
+        DEPT(1, "科室"),
+        DOCTOR(2, "医生");
+
+        private final Integer code;
+        private final String name;
+
+        levelEnum(Integer code, String name) {
+            this.code = code;
+            this.name = name;
+        }
+
+        public static String getNameByCode(Integer code) {
+            for (levelEnum value : levelEnum.values()) {
+                if (value.getCode().equals(code)) {
+                    return value.getName();
+                }
+            }
+            return "";
+        }
+    }
+
+    @Serial
+    private static final long serialVersionUID = 3711491177934905816L;
+
+    @TableField(value = "pat_no")
+    private String patNo;
+
+    @TableField(value = "times")
+    private Integer times;
+
+    @TableField(exist = false)
+    private String patName;
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO, value = "id")
+    private Integer id;
+
+    /**
+     * 审核人id
+     */
+    @TableField(value = "approver")
+    private String approver;
+
+    @TableField(exist = false)
+    private String approverName;
+
+    /**
+     * 审核时间
+     */
+    @TableField(value = "review_time")
+    private Date reviewTime;
+
+    /**
+     * 质控名称
+     */
+    @TableField(value = "name")
+    private String name;
+
+    /**
+     * 1-轻度 2-中度 3-重度
+     */
+    @TableField(value = "scoring_criteria")
+    private Integer scoringCriteria;
+
+    /**
+     * 备注
+     */
+    @TableField(value = "remark")
+    private String remark;
+
+    /**
+     * 1-已整改 2-无需整改
+     */
+    @TableField(value = "remediation_status")
+    private Integer remediationStatus;
+
+    /**
+     * 缺陷数
+     */
+    @TableField(value = "number_of_defects")
+    private Integer numberOfDefects;
+
+    /**
+     * 修改人
+     */
+    @TableField(value = "modify_person")
+    private String modifyPerson;
+
+    @TableField(exist = false)
+    private String modifyPersonName;
+
+    /**
+     * 修改时间
+     */
+    @TableField(value = "modification_time")
+    private Date modificationTime;
+
+    /**
+     * 电子病历id
+     */
+    @TableField(value = "emr_id")
+    private Integer emrId;
+
+    /**
+     * 0-最新 1-历史
+     */
+    @TableField(value = "history")
+    private Integer history;
+
+    /**
+     * 电子病历中的名称
+     */
+    @TableField(exist = false)
+    private String emrName;
+
+    /**
+     * 需要发送给那个医生
+     */
+    @TableField(value = "doctor")
+    private String doctor;
+
+    /**
+     * 在查询的审核查看是否已经匹配上了
+     */
+    @TableField(exist = false)
+    private Boolean matching = false;
+
+    /**
+     * 是否为终末质控
+     */
+    @TableField(value = "final_control")
+    private Integer finalControl;
+
+    @TableField(value = "level")
+    private Integer level;
+
+    @TableField(exist = false)
+    private Integer sort;
+
+    private String emrDocumentId;
+
+    /**
+     * 减分
+     */
+    @TableField(value = "minus_points")
+    private BigDecimal minusPoints;
+
+    public String getLevelName() {
+        return levelEnum.getNameByCode(level);
+    }
+
+    public String getScoringCriteriaName() {
+        return ScoringCriteriaEnum.getNameByCode(scoringCriteria);
+    }
+
+    public String getRemediationStatusName() {
+        return RemediationStatusEnum.getNameByCode(remediationStatus);
+    }
+
+}

+ 202 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/emr/EmrPatientData.java

@@ -0,0 +1,202 @@
+package org.thyy.threeone.entity.emr;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.thyy.utils.emr.EmrJsonUtils;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * @author xc
+ */
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class EmrPatientData implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 172057163746918134L;
+
+    /**
+     * id
+     * 自增id
+     */
+    private Integer id;
+
+    /**
+     * 患者住院号
+     */
+    private String patNo;
+
+    /**
+     * 患者住院次数
+     */
+    private Integer times;
+
+    /**
+     * 电子病历中的唯一值
+     */
+    @TableId
+    private String emrDocumentId;
+
+    /**
+     * 病历模板编码。
+     */
+    private String emrCategoryCode;
+
+    /**
+     * 是否删除
+     */
+    private Integer delFlag;
+
+    /**
+     * 模板的名称
+     */
+    private String emrName;
+
+    /**
+     * 医生取得名称
+     */
+    private String name;
+
+    /**
+     * 创建人
+     */
+    private String createId;
+
+    private String createName;
+
+    /**
+     * 创建时间
+     */
+    private Date createDate;
+
+    /**
+     * 修改人
+     */
+    private String modifyId;
+
+    /**
+     * 修改时间
+     */
+    private Date modifyDate;
+
+    /**
+     * 子节点
+     */
+    @TableField(exist = false)
+    private List<EmrPatientData> children;
+
+    /**
+     * 电子病历结构化数据
+     */
+    @TableField(exist = false)
+    private JSONObject emrDataElement;
+
+    @TableField(exist = false)
+    private String emrDataElementStr;
+
+    /**
+     * 是否提交
+     */
+    private Integer submit;
+
+    /**
+     * 提交人
+     */
+    private String submitId;
+
+    /**
+     * 提交时间
+     */
+    private Date submitTime;
+
+
+    /**
+     * 前端保存的页面数据结构
+     */
+    @TableField(exist = false)
+    private JSONObject documentData;
+
+    /**
+     * 病程记录的片段
+     */
+    @TableField(exist = false)
+    private List<EmrProgressNote> fragment;
+
+    /**
+     * 父级节点
+     */
+    private String parent;
+
+    /**
+     * 管床医生
+     */
+    private String referPhysician;
+
+    /**
+     * 主治医生
+     */
+    private String consultPhysician;
+
+    /**
+     * 主任医生
+     */
+    private String deptDirector;
+
+    /**
+     * 审核医生
+     */
+    private String reviewDoctors;
+
+    /**
+     * 审核时间
+     */
+    private Date reviewTime;
+
+    public String getType() {
+        if ("This is Dir".equals(emrCategoryCode)) {
+            return "group-category";
+        }
+        return "category";
+    }
+
+    /**
+     * { code: 1, name: "扫码" },   { code: 2, name: "移动平板" },   { code: 3, name: "有线手写板" }
+     */
+    private Integer signType;
+
+    /**
+     * 0-初始化值 1-医生发起签名的请求到移动平板上面 2-发送请求到了ca的接口 3-完成签名
+     */
+    private Integer signComplete;
+
+    @TableField(exist = false)
+    private Integer sort;
+
+    public String getEmrDataElementStr() {
+        if (emrDataElement != null) {
+            return emrDataElement.toString();
+        }
+        return emrDataElementStr;
+    }
+
+    public EmrJsonUtils jsonUtils2() {
+        return new EmrJsonUtils(this.emrDataElementStr);
+    }
+
+    public static LambdaQueryWrapper<EmrPatientData> lambdaQueryWrapper() {
+        return new LambdaQueryWrapper<>();
+    }
+}

+ 69 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/emr/EmrProgressNote.java

@@ -0,0 +1,69 @@
+package org.thyy.threeone.entity.emr;
+
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class EmrProgressNote implements Serializable {
+
+    private static final long serialVersionUID = 6840863528152959447L;
+
+    /**
+     * id
+     */
+    private Integer id;
+
+    /**
+     * 文档id对应 emr_patient_data 表中的 id
+     */
+    private String documentId;
+
+    /**
+     * 病程片段的名称
+     */
+    private String name;
+
+    /**
+     * 创建人
+     */
+    private String createId;
+
+    /**
+     * 创建时间
+     */
+    private Date creationTime;
+
+    /**
+     * 管床医生
+     */
+    private String referPhysician;
+
+    /**
+     * 主治医生
+     */
+    private String consultPhysician;
+
+    /**
+     * 主任医生
+     */
+    private String deptDirector;
+
+    private String dataElement;
+
+    public NoteDataElement dateElementJson() {
+        return StrUtil.isBlank(dataElement) ? null : JSONUtil.toBean(dataElement, NoteDataElement.class);
+    }
+
+    @Data
+    public static class NoteDataElement {
+        private String text;
+        private JSONObject dataElement;
+    }
+
+
+}

+ 37 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/PublicInfo.java

@@ -0,0 +1,37 @@
+package org.thyy.threeone.entity.updateTrinity;
+
+import lombok.Data;
+
+@Data
+public class PublicInfo {
+
+    /**
+     * 医疗机构代码 - 定点医疗机构代码12位,H+6位行政区划码+5位定点医疗机构顺序码
+     */
+    private String orgCode = "H43010500370";
+
+    /**
+     * 密级 - LY.00.279 密级
+     */
+    private String securityLevel = "000";
+
+    /**
+     * 就诊流水号 - 患者每次住院的院内唯一标识号
+     */
+    private String iptMdtrtSn;
+
+    /**
+     * 患者ID - 机构内患者基本信息唯一标识
+     */
+    private String patientId;
+
+    /**
+     * 卡号
+     */
+    private String cardNo;
+
+    /**
+     * 卡类型 - LY.00.245医疗卡类型
+     */
+    private String cardType;
+}

+ 157 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbDiagnosisDetail.java

@@ -0,0 +1,157 @@
+package org.thyy.threeone.entity.updateTrinity;
+
+import lombok.Data;
+import java.util.Date;
+
+/**
+ * 诊断明细表(TB_DIAGNOSIS_DETAIL)实体类
+ */
+@Data
+public class TbDiagnosisDetail {
+
+    /**
+     * 医疗机构代码 - 定点医疗机构代码12位,H+6位行政区划码+5位定点医疗机构顺序码
+     * 复合主键
+     */
+    private String orgCode;
+
+    /**
+     * 记录ID
+     * 复合主键
+     */
+    private String recordId;
+
+    /**
+     * 就诊流水号
+     * 复合主键
+     */
+    private String iptMdtrtSn;
+
+    /**
+     * 患者ID - 机构内患者基本信息唯一标识
+     * 外键,关联患者基本信息表(TB_BAS_PATIENT_INFO)
+     */
+    private String patientId;
+
+    /**
+     * 卡号
+     */
+    private String cardNo;
+
+    /**
+     * 卡类型 - LY.00.245医疗卡类型
+     */
+    private String cardType;
+
+    /**
+     * 编码类型 - 1=西医;2=中医;3=中医证候
+     */
+    private Integer codingType;
+
+    /**
+     * 诊断序号
+     */
+    private String diagNo;
+
+    /**
+     * 诊断时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date diagTime;
+
+    /**
+     * 诊断编码 - 出院诊断编码
+     * 西医:《疾病分类代码国家临床版2.0》;中医:《中医病证分类与代码(2019版)》 编码
+     */
+    private String diagCode;
+
+    /**
+     * 诊断名称 - 出院诊断名称
+     * 西医:《疾病分类代码国家临床版2.0》;中医:《中医病证分类与代码(2019版)》 名称
+     */
+    private String diagName;
+
+    /**
+     * 诊断说明
+     */
+    private String diagDesc;
+
+    /**
+     * 主要诊断标志 - 1=主要诊断、2=其他诊断
+     */
+    private Integer mainDiagFlag;
+
+    /**
+     * 疑似诊断标志 - 1=仍疑似;0=已确诊
+     */
+    private Integer suspectDiagFlag;
+
+    /**
+     * 入院病情 - LY.00.254入院病情代码
+     */
+    private String admissionCondition;
+
+    /**
+     * 出院情况编码 - CV05.10.010病情转归代码
+     */
+    private String dischargeStatus;
+
+    /**
+     * 诊断医生代码 - 医保贯标码
+     */
+    private String diagDoctorCode;
+
+    /**
+     * 诊断医生名称
+     */
+    private String diagDoctorName;
+
+    /**
+     * 病案归档时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date archiveTime;
+
+    /**
+     * 医保诊断编码
+     */
+    private String insuranceDiagCode;
+
+    /**
+     * 医保诊断名称
+     */
+    private String insuranceDiagName;
+
+    /**
+     * 操作人ID
+     */
+    private String operatorId;
+
+    /**
+     * 密级 - LY.00.279 密级
+     */
+    private String securityLevel;
+
+    /**
+     * 有效标志 - 0=无效,1=有效
+     */
+    private Integer valiFlag;
+
+    /**
+     * 创建时间 - 记录创建时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date createTime;
+
+    /**
+     * 更新时间 - 记录最后更新时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date updateTime;
+
+    /**
+     * 医院批次号 - 批次号由医疗机构代码-填报日期(格式为YYYYMMDD)-当天批次(两位数字)-上传类型(1新增;2重传)
+     * 复合主键,xxx-20250605-01-1表示单位编码为xxx的单位在2025年06月05日进行第一次上传,上传类型为新增
+     */
+    private String orgBatchNo;
+}

+ 216 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbDischargeSummary.java

@@ -0,0 +1,216 @@
+package org.thyy.threeone.entity.updateTrinity;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 出院小结表(TB_DISCHARGE_SUMMARY)
+ */
+@Data
+public class TbDischargeSummary {
+    /**
+     * 医疗机构代码
+     */
+    private String orgCode;
+    /**
+     * 住院就诊流水号
+     */
+    private String iptMdtrtSn;
+    /**
+     * 患者ID
+     */
+    private String patientId;
+    /**
+     * 患者姓名
+     */
+    private String patientName;
+    /**
+     * 卡号
+     */
+    private String cardNo;
+    /**
+     * 卡类型
+     */
+    private String cardType;
+    /**
+     * 性别
+     */
+    private String gender;
+    /**
+     * 科室名称
+     */
+    private String deptName;
+    /**
+     * 科室代码
+     */
+    private String deptCode;
+    /**
+     * 床号
+     */
+    private String bedNo;
+    /**
+     * 年龄
+     */
+    private String age;
+    /**
+     * 入院时间
+     */
+    private Date admissionTime;
+    /**
+     * 出院时间
+     */
+    private Date dischargeTime;
+    /**
+     * 住院天数
+     */
+    private Long hospitalizationDays;
+    /**
+     * 门诊诊断编码
+     */
+    private String outpatientDiagnosisCode;
+    /**
+     * 门诊诊断名称
+     */
+    private String outpatientDiagnosisName;
+    /**
+     * 入院诊断编码
+     */
+    private String admissionDiagnosisCode;
+    /**
+     * 入院诊断名称
+     */
+    private String admissionDiagnosisName;
+    /**
+     * 出院诊断编码
+     */
+    private String dischargeDiagnosisCode;
+    /**
+     * 出院诊断名称
+     */
+    private String dischargeDiagnosisName;
+    /**
+     * 入院时主要症状及体征
+     */
+    private String admissionSymptoms;
+    /**
+     * 实验室检查及主要会诊
+     */
+    private String labExamination;
+    /**
+     * 住院期间特殊检查
+     */
+    private String specialExamination;
+    /**
+     * 诊疗过程
+     */
+    private String treatmentProcess;
+    /**
+     * 合并症
+     */
+    private String complication;
+    /**
+     * 出院时情况
+     */
+    private String dischargeCondition;
+    /**
+     * 出院/死亡记录文本
+     */
+    private String dischargeHpText;
+    /**
+     * 出院医嘱
+     */
+    private String dischargeOrders;
+    /**
+     * 主治医师编码
+     */
+    private String attendingDoctorCode;
+    /**
+     * 主治医师姓名
+     */
+    private String attendingDoctorName;
+    /**
+     * 住院医师编码
+     */
+    private String residentDoctorCode;
+    /**
+     * 住院医师姓名
+     */
+    private String residentDoctorName;
+    /**
+     * 病区名称
+     */
+    private String wardName;
+    /**
+     * 病房号
+     */
+    private String roomNo;
+    /**
+     * 职业类别代码
+     */
+    private String occupationCode;
+    /**
+     * 患者电话号码
+     */
+    private String phoneNo;
+    /**
+     * 阳性辅助检查结果
+     */
+    private String positiveTestResult;
+    /**
+     * 麻醉方法代码
+     */
+    private String anesthesiaCode;
+    /**
+     * 医院麻醉方法代码名称
+     */
+    private String anesthesiaName;
+    /**
+     * 出院时症状与体征
+     */
+    private String dischargeSymptoms;
+    /**
+     * 病情转归代码
+     */
+    private String outcomeCode;
+    /**
+     * 医院病情转归代码名称
+     */
+    private String outcomeName;
+    /**
+     * 是否有中医"四诊"
+     */
+    private Integer tcmFlag;
+    /**
+     * 是否有手术明细
+     */
+    private Integer surgeryFlag;
+    /**
+     * 归档时间
+     */
+    private Date archiveTime;
+    /**
+     * 操作人ID
+     */
+    private String operatorId;
+    /**
+     * 密级
+     */
+    private String securityLevel;
+    /**
+     * 有效标志
+     */
+    private Integer valiFlag;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+    /**
+     * 医院批次号
+     */
+    private String orgBatchNo;
+}

+ 222 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIp24hDeath.java

@@ -0,0 +1,222 @@
+package org.thyy.threeone.entity.updateTrinity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 24H内入院死亡记录(TB_IP_24H_DEATH)
+ */
+@Data
+@TableName("tb_ip_24h_death")
+public class TbIp24hDeath {
+    /**
+     * 医疗机构代码
+     */
+    private String orgCode;
+    /**
+     * 记录ID
+     */
+    private String recordId;
+    /**
+     * 就诊流水号
+     */
+    private String iptMdtrtSn;
+    /**
+     * 患者ID
+     */
+    private String patientId;
+    /**
+     * 证件类别代码
+     */
+    private String idTypeCode;
+    /**
+     * 患者证件号码
+     */
+    private String idNumber;
+    /**
+     * 卡号
+     */
+    private String cardNo;
+    /**
+     * 卡类型
+     */
+    private String cardType;
+    /**
+     * 患者姓名
+     */
+    private String patientName;
+    /**
+     * 性别代码
+     */
+    private String genderCode;
+    /**
+     * 年龄(岁)
+     */
+    private String ageYear;
+    /**
+     * 年龄(月)
+     */
+    private String ageMonth;
+    /**
+     * 民族
+     */
+    private String ethnicGroup;
+    /**
+     * 婚姻状况代码
+     */
+    private String maritalStatus;
+    /**
+     * 职业类别代码
+     */
+    private String occupationCode;
+    /**
+     * 病史陈述者姓名
+     */
+    private String informantName;
+    /**
+     * 陈述者与患者的关系代码
+     */
+    private String relationCode;
+    /**
+     * 陈述内容可靠标志
+     */
+    private Integer infoReliable;
+    /**
+     * 入院日期时间
+     */
+    private Date admissionTime;
+    /**
+     * 死亡日期时间
+     */
+    private Date deathTime;
+    /**
+     * 中医“四诊”观察结果
+     */
+    private String tcmObservation;
+    /**
+     * 治则治法
+     */
+    private String tcmTreatment;
+    /**
+     * 入院诊断-西医诊断编码
+     */
+    private String admdiagWmCode;
+    /**
+     * 入院诊断-西医诊断名称
+     */
+    private String admdiagWmName;
+    /**
+     * 入院诊断-中医病名代码
+     */
+    private String admdiagTcmDiseaseCode;
+    /**
+     * 入院诊断-中医病名名称
+     */
+    private String admdiagTcmDiseaseName;
+    /**
+     * 入院诊断-中医证候代码
+     */
+    private String admdiagTcmSyndromeCode;
+    /**
+     * 入院诊断-中医证候名称
+     */
+    private String admdiagTcmSyndromeName;
+    /**
+     * 诊疗过程描述
+     */
+    private String treatmentProcess;
+    /**
+     * 死亡原因
+     */
+    private String causeOfDeath;
+    /**
+     * 死亡诊断-西医诊断编码
+     */
+    private String deathWmCode;
+    /**
+     * 死亡诊断-西医诊断名称
+     */
+    private String deathWmName;
+    /**
+     * 死亡诊断-中医病名代码
+     */
+    private String deathTcmDiseaseCode;
+    /**
+     * 死亡诊断-中医病名名称
+     */
+    private String deathTcmDiseaseName;
+    /**
+     * 死亡诊断-中医证候代码
+     */
+    private String deathTcmSyndromeCode;
+    /**
+     * 死亡诊断-中医证候名称
+     */
+    private String deathTcmSyndromeName;
+    /**
+     * 接诊医师代码
+     */
+    private String admittingDoctorCode;
+    /**
+     * 接诊医师签名
+     */
+    private String admittingDoctorName;
+    /**
+     * 住院医师代码
+     */
+    private String residentDoctorCode;
+    /**
+     * 住院医师签名
+     */
+    private String residentDoctorName;
+    /**
+     * 主治医师代码
+     */
+    private String attendingDoctorCode;
+    /**
+     * 主治医师签名
+     */
+    private String attendingDoctorName;
+    /**
+     * 主任医师代码
+     */
+    private String chiefDoctorCode;
+    /**
+     * 主任医师签名
+     */
+    private String chiefDoctorName;
+    /**
+     * 入院情况
+     */
+    private String admissionCondition;
+    /**
+     * 操作人ID
+     */
+    private String operatorId;
+    /**
+     * 操作时间
+     */
+    private Date operatorTime;
+    /**
+     * 密级
+     */
+    private String securityLevel;
+    /**
+     * 有效标志
+     */
+    private Integer valiFlag;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+    /**
+     * 医院批次号
+     */
+    private String orgBatchNo;
+}

+ 346 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIp24hDischarge.java

@@ -0,0 +1,346 @@
+package org.thyy.threeone.entity.updateTrinity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import org.thyy.utils.emr.EmrContrast;
+
+import java.util.Date;
+
+/**
+ * 24小时内入出院记录(TB_IP_24H_DISCHARGE)实体类
+ */
+@Data
+@TableName("tb_ip_24h_discharge")
+public class TbIp24hDischarge {
+
+    /**
+     * 医疗机构代码 - 定点医疗机构代码12位,H+6位行政区划码+5位定点医疗机构顺序码
+     * 复合主键
+     */
+    private String orgCode;
+
+    /**
+     * 记录ID
+     * 复合主键
+     */
+    private String recordId;
+
+    /**
+     * 就诊流水号 - 患者每次住院的院内唯一标识号
+     * 复合主键
+     */
+    private String iptMdtrtSn;
+
+    /**
+     * 患者ID - 外键,关联患者基本信息表(TB_BAS_PATIENT_INFO)
+     */
+    private String patientId;
+
+    /**
+     * 患者证件类别代码 - LY.00.97人员证件类型
+     */
+    private String idTypeCode;
+
+    /**
+     * 证件号码
+     */
+    private String idNumber;
+
+    /**
+     * 卡号
+     */
+    private String cardNo;
+
+    /**
+     * 卡类型 - LY.00.245医疗卡类型
+     */
+    private String cardType;
+
+    /**
+     * 患者姓名 - 患者本人在公安户籍管理部门正式登记注册的姓氏和名称
+     */
+    private String patientName;
+
+    /**
+     * 性别代码 - GB/T2261.1-2003性别代码
+     */
+    private String genderCode;
+
+    /**
+     * 年龄(岁) - 患者年龄满1周岁的实足年龄,为患者出生后按照日历计算的历法年龄,以实足年龄的相应整数填写
+     */
+    private String ageYear;
+
+    /**
+     * 年龄(月) - 年龄不足1周岁的实足年龄的月龄,以分数形式表示:分数的整数部分代表实足月龄,分数部分分母为30,分子为不足1个月的天数
+     */
+    private String ageMonth;
+
+    /**
+     * 民族 - GB/T3304-1991中国各民族名称罗马字母拼音写法和代码
+     */
+    private String ethnicGroup;
+
+    /**
+     * 婚姻状况代码 - GB/T2261.2-2003婚姻状况代码表
+     */
+    private String maritalStatusCode;
+
+    /**
+     * 职业类别代码 - GB/T 6565-2015 职业类别代码
+     */
+    private String occupationCode;
+
+    /**
+     * 病史陈述者姓名 - 患者病史的陈述人在公安户籍管理部门正式登记注册的姓氏和名称
+     */
+    private String informantName;
+
+    /**
+     * 陈述者与患者的关系代码 - GB/T4761-2008联系人关系
+     */
+    private String informantRelationCode;
+
+    /**
+     * 陈述内容可靠标志
+     * 0=否,1=是
+     */
+    private Integer informationReliableFlag;
+
+    /**
+     * 入院日期时间 - 患者实际办理入院手续时的公元纪年日期和时间的完整描述
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date admissionTime;
+
+    /**
+     * 出院日期时间 - 患者实际办理出院手续时的公元纪年日期和时间的完整描述
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date dischargeTime;
+
+    /**
+     * 主诉 - 对患者本次疾病相关的主要症状及其持续时间的描述,一般由患者本人或监护人描述
+     */
+    @EmrContrast("主诉")
+    private String chiefComplaint;
+
+    /**
+     * 现病史 - 对患者当前所患疾病情况的详细描述
+     */
+    @EmrContrast("现病史")
+    private String presentIllness;
+
+    /**
+     * 入院情况 - 对患者入院情况的详细描述
+     */
+    @EmrContrast("住院经过")
+    private String admissionCondition;
+
+    /**
+     * 症状名称 - 患者出现的临床主要症状的名称
+     */
+    private String symptomName = "-";
+
+    /**
+     * 症状描述 - 对患者出现症状的详细描述
+     */
+    @EmrContrast("住院经过")
+    private String symptomDescription;
+
+    /**
+     * 中医"四诊"观察结果 - 中医"四诊"观察结果的详细描述,包括望、闻、问、切四诊内容
+     */
+    private String tcmObservation;
+
+    /**
+     * 治则治法 - GB/T16751.3-2023中医临床诊疗术语第3部分:治法
+     * 填类别名称
+     */
+    private String treatmentPrinciple;
+
+    /**
+     * 入院诊断-西医诊断编码 - 多个以"|"间隔
+     * LY.00.801西医诊断编码(疾病诊断国临版2.0ICD-10)编码
+     */
+    private String admdiagWmCode;
+
+    /**
+     * 入院诊断-西医诊断名称 - 多个以"|"间隔
+     * LY.00.801西医诊断编码(疾病诊断国临版2.0ICD-10)名称
+     */
+    private String admdiagWmName;
+
+    /**
+     * 入院诊断-中医病名代码 - 多个以"|"间隔
+     * LY.00.802中医疾病诊断名称与编码编码
+     */
+    private String admdiagTcmDiseaseCode;
+
+    /**
+     * 入院诊断-中医病名名称 - 多个以"|"间隔
+     * LY.00.802中医疾病诊断名称与编码名称
+     */
+    private String admdiagTcmDiseaseName;
+
+    /**
+     * 入院诊断-中医证候代码 - 多个以"|"间隔
+     * LY.00.803中医证候诊断名称与编码编码
+     * 患者入院时做出的疾病诊断在中医证候特定分类体系中的代码
+     */
+    private String admdiagTcmSyndromeCode;
+
+    /**
+     * 入院诊断-中医证候名称 - 多个以"|"间隔
+     * LY.00.803中医证候诊断名称与编码名称
+     * 由医师根据患者入院时的情况,综合分析所作出的中医证候名称
+     */
+    private String admdiagTcmSyndromeName;
+
+    /**
+     * 诊疗过程描述
+     */
+    private String treatmentProcess;
+
+    /**
+     * 出院情况 - CV05.10.010病情转归代码编码
+     */
+    private String dischargeCondition;
+
+    /**
+     * 出院诊断-西医诊断编码 - 多个以"|"间隔
+     * LY.00.801西医诊断编码(疾病诊断国临版2.0ICD-10)编码
+     */
+    private String dischDiagWmCode;
+
+    /**
+     * 出院诊断-西医诊断名称 - 多个以"|"间隔
+     * LY.00.801西医诊断编码(疾病诊断国临版2.0ICD-10)名称
+     */
+    private String dischDiagWmName;
+
+    /**
+     * 出院诊断-中医病名代码 - 多个以"|"间隔
+     * LY.00.802中医疾病诊断名称与编码编码
+     */
+    private String dischDiagTcmDiseaseCode;
+
+    /**
+     * 出院诊断-中医病名名称 - 多个以"|"间隔
+     * LY.00.802中医疾病诊断名称与编码名称
+     */
+    private String dischDiagTcmDiseaseName;
+
+    /**
+     * 出院诊断-中医证候代码 - 多个以"|"间隔
+     * LY.00.803中医证候诊断名称与编码编码
+     */
+    private String dischDiagTcmSyndromeCode;
+
+    /**
+     * 出院诊断-中医证候名称 - 多个以"|"间隔
+     * LY.00.803中医证候诊断名称与编码名称
+     */
+    private String dischDiagTcmSyndromeName;
+
+    /**
+     * 出院医嘱 - 对患者出院医嘱的详细描述
+     */
+    private String dischargeOrder;
+
+    /**
+     * 出院医嘱开立人编号 - 医保贯标码
+     */
+    private String dischargeOrderDoctorCode;
+
+    /**
+     * 出院医嘱开立人签名
+     */
+    private String dischargeOrderDoctorName;
+
+    /**
+     * 出院医嘱开立日期时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date dischargeOrderTime;
+
+    /**
+     * 接诊医师代码 - 接诊医师医保贯标码
+     */
+    private String admittingDoctorCode;
+
+    /**
+     * 接诊医师签名 - 负责患者入院接诊的医师签署的在公安户籍管理部门正式登记注册的姓氏和名称
+     */
+    private String admittingDoctorName;
+
+    /**
+     * 住院医师代码 - 住院医师医保贯标码
+     */
+    private String residentDoctorCode;
+
+    /**
+     * 住院医师签名 - 患者出院时所在科室具体负责诊治的,具有住院医师专业技术职务任职资格的医师签署的在公安户籍管理部门正式登记注册的姓氏和名称
+     */
+    private String residentDoctorName;
+
+    /**
+     * 主治医师代码 - 主治医师医保贯标码
+     */
+    private String attendingDoctorCode;
+
+    /**
+     * 主治医师签名 - 具有主治医师专业技术职务资格的医师签署的在公安户籍管理部门正式登记注册的姓氏和名称
+     */
+    private String attendingDoctorName;
+
+    /**
+     * 主任医师代码 - 主任医师医保贯标码
+     */
+    private String chiefDoctorCode;
+
+    /**
+     * 主任医师签名 - 具有主任医师专业技术职务资格的医师签署的在公安户籍管理部门正式登记注册的姓氏和名称
+     */
+    private String chiefDoctorName;
+
+    /**
+     * 操作人ID - 操作人工号
+     */
+    private String operatorId;
+
+    /**
+     * 操作时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date operationTime;
+
+    /**
+     * 密级 - LY.00.279 密级
+     */
+    private String securityLevel;
+
+    /**
+     * 有效标志
+     * 0=无效,1=有效
+     */
+    private Integer valiFlag;
+
+    /**
+     * 创建时间 - 记录创建时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date createTime;
+
+    /**
+     * 更新时间 - 记录最后更新时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date updateTime;
+
+    /**
+     * 医院批次号 - 批次号由医疗机构代码-填报日期(格式为YYYYMMDD)-当天批次(两位数字)-上传类型(1新增;2重传)
+     * 复合主键,xxx-20250605-01-1表示单位编码为xxx的单位在2025年06月05日进行第一次上传,上传类型为新增
+     */
+    private String orgBatchNo;
+}

+ 156 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIpAdmission.java

@@ -0,0 +1,156 @@
+package org.thyy.threeone.entity.updateTrinity;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 入院登记表(TB_IP_ADMISSION)实体类
+ */
+@Data
+public class TbIpAdmission {
+
+    /**
+     * 定点医疗机构代码12位,H+6位行政区划码+5位定点医疗机构顺序码
+     * 复合主键
+     */
+    private String orgCode;
+
+    /**
+     * 入院登记时产生的代表该次住院的信息系统唯一识别编号
+     * 复合主键
+     */
+    private String iptMdtrtSn;
+
+    /**
+     * 就诊ID
+     * 医保必填
+     */
+    private String mdtrtId;
+
+    /**
+     * 机构内患者基本信息唯一标识
+     * 外键,关联患者基本信息表(TB_BAS_PATIENT_INFO)
+     */
+    private String patientId;
+
+    /**
+     * 卡号
+     */
+    private String cardNo;
+
+    /**
+     * 卡类型
+     * LY.00.245医疗卡类型
+     */
+    private String cardType;
+
+    /**
+     * 患者来源分类
+     * LY.00.259患者就诊来源
+     */
+    private String patientSource;
+
+    /**
+     * 患者真实姓名
+     */
+    private String patientName;
+
+    /**
+     * 性别代码
+     * GB/T2261.1-2003性别代码
+     */
+    private String genderCode;
+
+    /**
+     * 年龄,需要带单位
+     * 比如 10 岁 ,3 天,6 月
+     */
+    private String age;
+
+    /**
+     * 医生医保贯标码
+     */
+    private String attendingDoctorCode;
+
+    /**
+     * 主治医生姓名
+     */
+    private String attendingDoctorName;
+
+    /**
+     * 是否留观患者
+     * 0=否,1=是
+     */
+    private Integer observationFlag;
+
+    /**
+     * 入院的院内科室代码
+     */
+    private String admissionDeptCode;
+
+    /**
+     * 入院科室名称
+     */
+    private String admissionDeptName;
+
+    /**
+     * 入院分配的床位号
+     */
+    private String admissionBedNo;
+
+    /**
+     * 主要诊断的ICD编码
+     * 西医:LY.00.801诊断编码(国家临床版2.0疾病诊断编码(ICD-10);
+     * 中医:LY.00.802中医疾病诊断名称与编码(GB/T15657-2021中医病证分类与代码)
+     */
+    private String mainDiagnosisCode;
+
+    /**
+     * 主要诊断名称
+     * 西医:LY.00.801诊断编码(国家临床版2.0疾病诊断编码(ICD-10);
+     * 中医:LY.00.802中医疾病诊断名称与编码(GB/T15657-2021中医病证分类与代码)
+     */
+    private String mainDiagnosisName;
+
+    /**
+     * 入院诊断的详细描述
+     */
+    private String admissionDiagnosisDesc;
+
+    /**
+     * 患者入院时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date admissionTime;
+
+    /**
+     * 密级
+     * LY.00.279密级
+     */
+    private String securityLevel;
+
+    /**
+     * 有效标志
+     * 0=无效,1=有效
+     */
+    private Integer valiFlag;
+
+    /**
+     * 记录创建时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date createTime;
+
+    /**
+     * 记录最后更新时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date updateTime;
+
+    /**
+     * 批次号由医疗机构代码-填报日期(格式为YYYYMMDD)-当天批次(两位数字)-上传类型(1新增;2重传)
+     * 复合主键,xxx-20250605-01-1表示单位编码为xxx的单位在2025年06月05日进行第一次上传,上传类型为新增
+     */
+    private String orgBatchNo;
+}

+ 335 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIpAdmissionRecord.java

@@ -0,0 +1,335 @@
+package org.thyy.threeone.entity.updateTrinity;
+
+import lombok.Data;
+import org.thyy.utils.emr.EmrContrast;
+
+import java.util.Date;
+
+/**
+ * 入院记录表(TB_IP_ADMISSION_RECORD)实体类
+ */
+@Data
+public class TbIpAdmissionRecord {
+
+    /**
+     * 医疗机构代码 - 定点医疗机构代码12位,H+6位行政区划码+5位定点医疗机构顺序码
+     * 复合主键
+     */
+    private String orgCode;
+
+    /**
+     * 住院就诊流水号 - 患者每次住院的院内唯一标识号
+     * 复合主键
+     */
+    private String iptMdtrtSn;
+
+    /**
+     * 患者ID - 机构内患者基本信息唯一标识
+     * 外键,关联患者基本信息表(TB_BAS_PATIENT_INFO)
+     */
+    private String patientId;
+
+    /**
+     * 患者姓名
+     */
+    private String patientName;
+
+    /**
+     * 卡号
+     */
+    private String cardNo;
+
+    /**
+     * 卡类型 - LY.00.245医疗卡类型
+     */
+    private String cardType;
+
+    /**
+     * 入院科室编码 - 医院系统内部定义的科室编号
+     */
+    private String admDeptCode;
+
+    /**
+     * 入院科室名称 - 医院系统内部定义的科室编号
+     */
+    private String admDeptName;
+
+    /**
+     * 入院时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date admissionTime;
+
+    /**
+     * 留观标志
+     * 0:一般住院;1:留院观察
+     */
+    private Integer observationFlag;
+
+    /**
+     * 病区名称
+     */
+    private String wardName;
+
+    /**
+     * 病房号
+     */
+    private String wardNo;
+
+    /**
+     * 病床号
+     */
+    private String bedNo;
+
+    /**
+     * 接诊医师工号 - 接诊医生医保贯标码
+     */
+    private String visitingPhysicianCode;
+
+    /**
+     * 接诊医师名称
+     */
+    private String visitingPhysicianName;
+
+    /**
+     * 住院医师工号 - 住院医生医保贯标码
+     */
+    private String residentPhysicianCode;
+
+    /**
+     * 住院医师名称
+     */
+    private String residentPhysicianName;
+
+    /**
+     * 主诉 - 对患者本次疾病相关的主要症状及其持续时间的描述,一般由患者本人或监护人描述
+     */
+    @EmrContrast("主诉")
+    private String chiefComplaint;
+
+    /**
+     * 现病史 - 对患者当前所患疾病情况的详细描述
+     */
+    @EmrContrast("现病史")
+    private String presentIllness;
+
+    /**
+     * 既往史(包括外伤)
+     */
+    @EmrContrast({"既往史"})
+    private String pastHist;
+
+    /**
+     * 个人史
+     */
+    @EmrContrast("个人史")
+    private String personalHist;
+
+    /**
+     * 婚育史
+     */
+    @EmrContrast("婚育史")
+    private String maritalHist;
+
+    /**
+     * 家族史
+     */
+    @EmrContrast("家族史")
+    private String familyHist;
+
+    /**
+     * 传染病史
+     */
+    @EmrContrast({"家族遗传倾向疾病", "传染病流行区居住史"})
+    private String infectionHist;
+
+    /**
+     * 预防接种史
+     */
+    private String vaccinationHist;
+
+    /**
+     * 手术史
+     */
+    private String surgeryHist;
+
+    /**
+     * 输血史
+     */
+    @EmrContrast("输血史")
+    private String btHist;
+
+    /**
+     * 过敏史
+     */
+    @EmrContrast("过敏史")
+    private String allergyHist;
+
+    /**
+     * 月经史
+     */
+    @EmrContrast("月经史")
+    private String menstruationHist;
+
+    /**
+     * 治则治法 - 根据辨证结果采用的治则治法名称术语
+     * GB/T16751.3-2023中医临床诊疗术语第3部分:治法
+     */
+    private String treatmentPrinciple;
+
+    /**
+     * 中医"四诊"观察结果
+     */
+    private String fourDiagnosis;
+
+    /**
+     * 体征
+     */
+    @EmrContrast("体格检查")
+    private String signs;
+
+    /**
+     * 专项检查
+     */
+    @EmrContrast("专科情况")
+    private String specialExam;
+
+    /**
+     * 辅助检查
+     */
+    @EmrContrast("辅助检查结果")
+    private String studiesSumm;
+
+    /**
+     * 西医-初步诊断编码 - 多个诊断用"|"分隔
+     * LY.00.801诊断编码(ICD-10)编码
+     */
+    private String westernDiagCode;
+
+    /**
+     * 西医-初步诊断名称 - 多个诊断用"|"分隔
+     * LY.00.801诊断编码(ICD-10)名称
+     */
+    private String westernDiagName;
+
+    /**
+     * 中医-初步诊断编码 - 多个诊断用"|"分隔
+     * LY.00.802中医疾病诊断名称与编码编码
+     */
+    private String tcmDiagCode;
+
+    /**
+     * 中医-初步诊断名称 - 多个诊断用"|"分隔
+     * LY.00.802中医疾病诊断名称与编码名称
+     */
+    private String tcmDiagName;
+
+    /**
+     * 中医证候-初步诊断编码 - 多个诊断用"|"分隔
+     * LY.00.803中医证候诊断名称与编码编码
+     */
+    private String tcmSyndromeCode;
+
+    /**
+     * 中医证候-初步诊断名称 - 多个诊断用"|"分隔
+     * LY.00.803中医证候诊断名称与编码名称
+     */
+    private String tcmSyndromeName;
+
+    /**
+     * 患者传染性标志
+     * 0=否,1=是
+     */
+    private Integer isInfectious;
+
+    /**
+     * 住院次数
+     */
+    private Integer inpatientTimes;
+
+    /**
+     * 入院类型代码
+     * LY.00.117入院途径
+     */
+    private String admissionTypeCode;
+
+    /**
+     * 就诊类型
+     * LY.00.183就诊类型标志(用于区分住院就诊业务类型)
+     */
+    private String mdtrtType;
+
+    /**
+     * 保险类型 - 用来区分对象所属保险类
+     * LY.00.63险种类型
+     */
+    private String insuranceType;
+
+    /**
+     * 特需标志
+     * 0:非特需,1:特需
+     */
+    private Integer vipFlag;
+
+    /**
+     * 外地标志
+     * LY.00.242外地标志
+     */
+    private String nonlocalFlag;
+
+    /**
+     * 出院科室编码 - 出院科室代码
+     */
+    private String dischargeDeptCode;
+
+    /**
+     * 出院科室名称
+     */
+    private String dischargeDeptName;
+
+    /**
+     * 主治医生工号 - 主治医生医保贯标码
+     */
+    private String doctorCode;
+
+    /**
+     * 主治医生名称
+     */
+    private String doctorName;
+
+    /**
+     * 出院时间 - 若无出院时间,填写"1900-01-01 00:00:00"
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date dischargeTime;
+
+    /**
+     * 密级
+     * LY.00.279 密级
+     */
+    private String securityLevel;
+
+    /**
+     * 有效标志
+     * 0=无效,1=有效
+     */
+    private Integer valiFlag;
+
+    /**
+     * 创建时间 - 记录创建时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date createTime;
+
+    /**
+     * 更新时间 - 记录最后更新时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date updateTime;
+
+    /**
+     * 医院批次号 - 批次号由医疗机构代码-填报日期(格式为YYYYMMDD)-当天批次(两位数字)-上传类型(1新增;2重传)
+     * 复合主键,xxx-20250605-01-1表示单位编码为xxx的单位在2025年06月05日进行第一次上传,上传类型为新增
+     */
+    private String orgBatchNo;
+}

+ 169 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIpDailyCourse.java

@@ -0,0 +1,169 @@
+package org.thyy.threeone.entity.updateTrinity;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 住院日常病程记录(TB_IP_DAILY_COURSE)实体类
+ */
+@Data
+public class TbIpDailyCourse {
+
+    /**
+     * 医疗机构代码 - 定点医疗机构代码12位,H+6位行政区划码+5位定点医疗机构顺序码
+     * 复合主键
+     */
+    private String orgCode;
+
+    /**
+     * 记录ID
+     * 复合主键
+     */
+    private String recordIid;
+
+    /**
+     * 就诊流水号 - 患者每次住院的院内唯一标识号
+     * 复合主键
+     */
+    private String iptMdtrtSn;
+
+    /**
+     * 患者ID - 机构内患者基本信息唯一标识
+     * 外键,关联患者基本信息表(TB_BAS_PATIENT_INFO)
+     */
+    private String patientId;
+
+    /**
+     * 患者姓名
+     */
+    private String patientName;
+
+    /**
+     * 卡号
+     */
+    private String cardNo;
+
+    /**
+     * 卡类型 - LY.00.245医疗卡类型
+     */
+    private String cardType;
+
+    /**
+     * 证件类别代码 - LY.00.97人员证件类型
+     */
+    private String idTypeCode;
+
+    /**
+     * 证件号
+     */
+    private String idNumber;
+
+    /**
+     * 病区名称
+     */
+    private String wardName;
+
+    /**
+     * 病房号
+     */
+    private String wardNo;
+
+    /**
+     * 病床号
+     */
+    private String bedNo;
+
+    /**
+     * 记录日期时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date recordCreateTime;
+
+    /**
+     * 住院病程
+     */
+    private String admCourse;
+
+    /**
+     * 医嘱内容
+     */
+    private String orderContent;
+
+    /**
+     * 中医"四诊"观察结果
+     */
+    private String observationResult;
+
+    /**
+     * 辨证论治详细描述
+     */
+    private String treatment;
+
+    /**
+     * 病情转归代码 - 治疗后病情转归的标准编码
+     * CV05.10.010病情转归代码
+     */
+    private String outcomeCode;
+
+    /**
+     * 住院医师代码 - 住院医师医保贯穿码
+     */
+    private String residentPhysicianId;
+
+    /**
+     * 住院医师名称
+     */
+    private String residentPhysicianName;
+
+    /**
+     * 科室代码 - 填写院内科室代码
+     */
+    private String deptCode;
+
+    /**
+     * 科室名称
+     */
+    private String deptName;
+
+    /**
+     * 操作人ID - 操作人工号
+     */
+    private String operatorId;
+
+    /**
+     * 操作时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date operationTime;
+
+    /**
+     * 密级
+     * LY.00.279 密级
+     */
+    private String securityLevel;
+
+    /**
+     * 有效标志
+     * 0=无效,1=有效
+     */
+    private Integer valiFlag;
+
+    /**
+     * 创建时间 - 记录创建时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date createTime;
+
+    /**
+     * 更新时间 - 记录最后更新时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date updateTime;
+
+    /**
+     * 医院批次号 - 批次号由医疗机构代码-填报日期(格式为YYYYMMDD)-当天批次(两位数字)-上传类型(1新增;2重传)
+     * 复合主键,xxx-20250605-01-1表示单位编码为xxx的单位在2025年06月05日进行第一次上传,上传类型为新增
+     */
+    private String orgBatchNo;
+}

+ 120 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIpDeathInfo.java

@@ -0,0 +1,120 @@
+package org.thyy.threeone.entity.updateTrinity;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 死亡信息(TB_IP_DEATH_INFO)
+ */
+@Data
+public class TbIpDeathInfo {
+    /**
+     * 医疗机构代码
+     */
+    private String orgCode;
+    /**
+     * 住院就诊流水号
+     */
+    private String iptMdtrtSn;
+    /**
+     * 患者ID
+     */
+    private String patientId;
+    /**
+     * 科室编码
+     */
+    private String deptCode;
+    /**
+     * 科室名称
+     */
+    private String deptName;
+    /**
+     * 病区名称
+     */
+    private String wardName;
+    /**
+     * 病房号
+     */
+    private String eordNum;
+    /**
+     * 病床号
+     */
+    private String sickbedNum;
+    /**
+     * 卡类型
+     */
+    private String cardType;
+    /**
+     * 卡号
+     */
+    private String cardNo;
+    /**
+     * 诊疗过程描述
+     */
+    private String treatmentProcessDesc;
+    /**
+     * 死亡日期时间
+     */
+    private Date deathDt;
+    /**
+     * 直接死亡原因名称
+     */
+    private String directDeathCauseName;
+    /**
+     * 直接死亡原因编码
+     */
+    private String directDeathCauseCode;
+    /**
+     * 死亡诊断名称
+     */
+    private String deathDiagnosisName;
+    /**
+     * 死亡诊断编码
+     */
+    private String deathDiagnosisCode;
+    /**
+     * 主治医师编码
+     */
+    private String attendingDoctorCode;
+    /**
+     * 主治医师名称
+     */
+    private String attendingDoctor;
+    /**
+     * 主任医师编码
+     */
+    private String chiefDoctorCode;
+    /**
+     * 主任医师名称
+     */
+    private String chiefDoctor;
+    /**
+     * 操作人ID
+     */
+    private String operatorId;
+    /**
+     * 操作时间
+     */
+    private Date operationTime;
+    /**
+     * 密级
+     */
+    private String securityLevel;
+    /**
+     * 有效标志
+     */
+    private Integer valiFlag;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+    /**
+     * 医院批次号
+     */
+    private String orgBatchNo;
+}

+ 182 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIpDischargeSummary.java

@@ -0,0 +1,182 @@
+package org.thyy.threeone.entity.updateTrinity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 出院记录(TB_IP_DISCHARGE_SUMMARY)
+ */
+@Data
+public class TbIpDischargeSummary {
+    /**
+     * 医疗机构代码
+     */
+    private String orgCode;
+    /**
+     * 住院就诊流水号
+     */
+    private String iptMdtrtSn;
+    /**
+     * 患者ID
+     */
+    private String patientId;
+    /**
+     * 卡号
+     */
+    private String cardNo;
+    /**
+     * 卡类型
+     */
+    private String cardType;
+    /**
+     * 入院科室编号
+     */
+    private String admDeptCode;
+    /**
+     * 入院科室名称
+     */
+    private String admDeptName;
+    /**
+     * 入院时间
+     */
+    private Date admissionTime;
+    /**
+     * 出院科室
+     */
+    private String dischargeDepartment;
+    /**
+     * 出院科室名称
+     */
+    private String dischargeDepartmentName;
+    /**
+     * 出院时间
+     */
+    private Date dischargeTime;
+    /**
+     * 留观标志
+     */
+    private Integer observationFlag;
+    /**
+     * 保险类型
+     */
+    private String insuranceType;
+    /**
+     * 医院保险类型名称
+     */
+    private String hospitalInsuranceName;
+    /**
+     * 外地标志
+     */
+    private String nonlocalFlag;
+    /**
+     * 特需标志
+     */
+    private Integer vipFlag;
+    /**
+     * 出院诊断编码(主要诊断)
+     */
+    private String primaryDiagnosisCode;
+    /**
+     * 医院出院诊断名称(主要诊断)
+     */
+    private String hospitalDiagnosisName;
+    /**
+     * 诊断编码类型
+     */
+    private Integer diagnosisCodeType;
+    /**
+     * 住院天数
+     */
+    private Integer inpatientDay;
+    /**
+     * 是否24小时入出院
+     */
+    @TableField("is24_hr_adm_disch")
+    private Integer is24HrAdmDisch;
+    /**
+     * 离院方式
+     */
+    private String dischargeMode;
+    /**
+     * 入院情况
+     */
+    private String admSummery;
+    /**
+     * 出院情况
+     */
+    private String dischargeSummery;
+    /**
+     * 入院诊断编码(主要诊断)
+     */
+    private String admDiagnosisCode;
+    /**
+     * 入院诊断名称(主要诊断)
+     */
+    private String admDiagnosisName;
+    /**
+     * 辅助检查结果
+     */
+    private String auxiliaryObservationResult;
+    /**
+     * 中医"四诊"观察结果
+     */
+    private String tcmObservationResult;
+    /**
+     * 诊疗经过
+     */
+    private String treatmentDesc;
+    /**
+     * 治则治法
+     */
+    private String therapeuticPrincipleMethod;
+    /**
+     * 中药煎煮方法
+     */
+    private String chmDecoctingMethods;
+    /**
+     * 中药用药方法
+     */
+    private String chmTakeMethods;
+    /**
+     * 出院情况编码
+     */
+    private String dischargeStatus;
+    /**
+     * 出院时症状与体征
+     */
+    private String dischargeCondition;
+    /**
+     * 出院医嘱
+     */
+    private String outOrder;
+    /**
+     * 操作人ID
+     */
+    private String operatorId;
+    /**
+     * 操作时间
+     */
+    private Date operationTime;
+    /**
+     * 密级
+     */
+    private String securityLevel;
+    /**
+     * 有效标志
+     */
+    private Integer valiFlag;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+    /**
+     * 医院批次号
+     */
+    private String orgBatchNo;
+}

+ 250 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIpFirstCourse.java

@@ -0,0 +1,250 @@
+package org.thyy.threeone.entity.updateTrinity;
+
+import lombok.Data;
+import org.thyy.utils.emr.EmrContrast;
+
+import java.util.Date;
+
+/**
+ * 住院首次病程记录(TB_IP_FIRST_COURSE)实体类
+ */
+@Data
+public class TbIpFirstCourse {
+
+    /**
+     * 医疗机构代码 - 定点医疗机构代码12位,H+6位行政区划码+5位定点医疗机构顺序码
+     * 复合主键
+     */
+    private String orgCode;
+
+    /**
+     * 就诊流水号 - 患者每次住院的院内唯一标识号
+     * 复合主键
+     */
+    private String iptMdtrtSn;
+
+    /**
+     * 记录ID
+     * 复合主键
+     */
+    private String recordId;
+
+    /**
+     * 患者ID - 机构内患者基本信息唯一标识
+     * 外键,关联患者基本信息表(TB_BAS_PATIENT_INFO)
+     */
+    private String patientId;
+
+    /**
+     * 患者姓名
+     */
+    private String patientName;
+
+    /**
+     * 卡号
+     */
+    private String cardNo;
+
+    /**
+     * 卡类型 - LY.00.245医疗卡类型
+     */
+    private String cardType;
+
+    /**
+     * 证件类别代码 - LY.00.97人员证件类型
+     */
+    private String idTypeCode;
+
+    /**
+     * 证件号
+     */
+    private String idNumber;
+
+    /**
+     * 病区名称
+     */
+    private String wardName;
+
+    /**
+     * 病房号
+     */
+    private String wardNo;
+
+    /**
+     * 病床号
+     */
+    private String bedNo;
+
+    /**
+     * 记录日期时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date recordCreateTime;
+
+    /**
+     * 主诉
+     */
+    private String chiefComplaint;
+
+    /**
+     * 病例特点
+     */
+    @EmrContrast("病例特点")
+    private String presentIllnessHis;
+
+    /**
+     * 中医"四诊"观察结果
+     */
+    private String observationResult;
+
+    /**
+     * 诊断依据
+     */
+    @EmrContrast("诊断依据")
+    private String diagnosisBasis;
+
+    /**
+     * 初步诊断-西医诊断编码
+     * LY.00.801诊断编码(ICD-10)编码
+     */
+    private String wmInitalDiagnosisCode;
+
+    /**
+     * 初步诊断-西医诊断名称
+     * LY.00.801诊断编码(ICD-10)名称
+     */
+    private String wmInitalDiagnosisName;
+
+    /**
+     * 初步诊断-中医病名代码
+     * LY.00.802中医疾病诊断名称与编码编码
+     */
+    private String tcmInitalDiagnosisCode;
+
+    /**
+     * 初步诊断-中医病名名称
+     * LY.00.802中医疾病诊断名称与编码名称
+     */
+    private String tcmInitalDiagnosisName;
+
+    /**
+     * 初步诊断-中医证候代码
+     * LY.00.803中医证候诊断名称与编码编码
+     */
+    private String tcmInitalSyndromeCode;
+
+    /**
+     * 初步诊断-中医证候名称
+     * LY.00.803中医证候诊断名称与编码名称
+     */
+    private String tcmInitalSyndromeName;
+
+    /**
+     * 鉴别诊断-西医诊断代码
+     * LY.00.801诊断编码(ICD-10)编码
+     */
+    private String wmDiffDiagnosisCode;
+
+    /**
+     * 鉴别诊断-西医诊断名称
+     * LY.00.801诊断编码(ICD-10)名称
+     */
+    private String wmDiffDiagnosisName;
+
+    /**
+     * 鉴别诊断-中医病名代码
+     * LY.00.802中医疾病诊断名称与编码编码
+     */
+    private String tcmPrimaryDiagnosisCode;
+
+    /**
+     * 鉴别诊断-中医病名名称
+     * LY.00.802中医疾病诊断名称与编码名称
+     */
+    private String tcmPrimaryDiagnosisName;
+
+    /**
+     * 鉴别诊断-中医证候代码
+     * LY.00.803中医证候诊断名称与编码编码
+     */
+    private String tcmPrimarySyndromeCode;
+
+    /**
+     * 鉴别诊断-中医证候名称
+     * LY.00.803中医证候诊断名称与编码名称
+     */
+    private String tcmPrimarySyndromeName;
+
+    /**
+     * 治则治法 - 根据辨证结果采用的治则治法名称术语
+     * GB/T16751.3-2023中医临床诊疗术语第3部分:治法
+     */
+    private String treatmentPrinciple;
+
+    /**
+     * 诊疗计划
+     */
+    @EmrContrast("诊疗计划")
+    private String treatmentPlan;
+
+    /**
+     * 病情转归代码 - 治疗后病情转归的标准编码
+     * CV05.10.010病情转归代码
+     */
+    private String outcomeCode;
+
+    /**
+     * 住院医师代码 - 住院医师医保贯穿码
+     */
+    private String residentPhysicianId;
+
+    /**
+     * 住院医师名称
+     */
+    private String residentPhysicianName;
+
+    /**
+     * 科室代码 - 院内科室编码
+     */
+    private String deptCode;
+
+    /**
+     * 科室名称
+     */
+    private String deptName;
+
+    /**
+     * 操作人ID - 操作人工号
+     */
+    private String operatorId;
+
+    /**
+     * 密级
+     * LY.00.279 密级
+     */
+    private String securityLevel = "000";
+
+    /**
+     * 有效标志
+     * 0=无效,1=有效
+     */
+    private Integer valiFlag;
+
+    /**
+     * 创建时间 - 记录创建时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date createTime;
+
+    /**
+     * 更新时间 - 记录最后更新时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date updateTime;
+
+    /**
+     * 医院批次号 - 批次号由医疗机构代码-填报日期(格式为YYYYMMDD)-当天批次(两位数字)-上传类型(1新增;2重传)
+     * 复合主键,xxx-20250605-01-1表示单位编码为xxx的单位在2025年06月05日进行第一次上传,上传类型为新增
+     */
+    private String orgBatchNo;
+}

+ 741 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIpSurgery.java

@@ -0,0 +1,741 @@
+package org.thyy.threeone.entity.updateTrinity;
+
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 手术操作记录表(TB_IP_SURGERY)实体类
+ */
+@Data
+public class TbIpSurgery {
+
+    /**
+     * 医疗机构代码 - 定点医疗机构代码12位,H+6位行政区划码+5位定点医疗机构顺序码
+     * 复合主键
+     */
+    private String orgCode;
+
+    /**
+     * 住院就诊流水号 - 患者每次住院的院内唯一标识号
+     * 复合主键
+     */
+    private String iptMdtrtSn;
+
+    /**
+     * 记录ID - 手术明细流水号是医院内部唯一标示此手术明细记录的一个序号
+     * 复合主键
+     */
+    private String recordId;
+
+    /**
+     * 卡号
+     */
+    private String cardNo;
+
+    /**
+     * 卡类型 - LY.00.245医疗卡类型
+     */
+    private String cardType;
+
+    /**
+     * 患者ID - 机构内患者基本信息唯一标识
+     * 外键,关联患者基本信息表(TB_BAS_PATIENT_INFO)
+     */
+    private String patientId;
+
+    /**
+     * 患者姓名
+     */
+    private String patientName;
+
+    /**
+     * 就诊类型 - LY.00.183就诊类型标志(用于区分住院就诊业务类型)
+     */
+    private String mdtrtType;
+
+    /**
+     * 病区代码 - 填写院内病区代码
+     */
+    private String wardareaCode;
+
+    /**
+     * 病区名称 - 填写院内病区名称
+     */
+    private String wardareaName;
+
+    /**
+     * 病房号 - 患者入院时,所住病房对应的编号
+     */
+    private String wardNo;
+
+    /**
+     * 病床号
+     */
+    private String bedNo;
+
+    /**
+     * 手术申请单编号
+     */
+    private String appyNo;
+
+    /**
+     * 就诊科室名称 - 院内科室名称
+     */
+    private String deptName;
+
+    /**
+     * 就诊科室代码 - 院内科室代码
+     */
+    private String deptCode;
+
+    /**
+     * 住院医师代码 - 住院医师医保贯标码
+     */
+    private String ipdrCode;
+
+    /**
+     * 住院医师名称
+     */
+    private String ipdrName;
+
+    /**
+     * 年龄(岁) - 患者年龄满1周岁的实足年龄
+     */
+    private Integer ageYear;
+
+    /**
+     * 年龄(月) - 年龄不足1周岁的实足年龄的月龄
+     */
+    private Integer ageMonth;
+
+    /**
+     * 年龄(天) - 年龄不满1月时填写
+     */
+    private Integer ageDay;
+
+    /**
+     * 麻醉记录流水号 - 麻醉记录唯一标识
+     */
+    private String anstRecSno;
+
+    /**
+     * ABO血型代码 - CV04.50.005ABO血型代码
+     */
+    private String blotypeAbo;
+
+    /**
+     * 相关医嘱ID - 相关医嘱标识
+     */
+    private String doctAdviceNo;
+
+    /**
+     * 日间手术标志 - 是否日间手术 0=否,1=是,9=未知或其它
+     */
+    private Integer daylightOprMark;
+
+    /**
+     * 择期手术标志 - 1=择期手术,2=非择期手术,9=不明确
+     */
+    private Integer selvFlag;
+
+    /**
+     * 手术类型 - LY.00.125手术类型
+     */
+    private String oprnType;
+
+    /**
+     * 手术及操作编码 - 采用手术操作分类代码国家临床版3.0手术操作编码(ICD-9-CM3)对应的编码,多个以"|"间隔
+     * LY.00.804手术及操作编码(ICD-9-CM3) 编码
+     */
+    private String oprnOprtCode;
+
+    /**
+     * 手术及操作名称 - 采用手术操作分类代码国家临床版3.0手术操作编码(ICD-9-CM3)对应的名称,多个以"|"间隔
+     * LY.00.804手术及操作编码(ICD-9-CM3) 名称
+     */
+    private String oprnOprtName;
+
+    /**
+     * 手术前诊断编码 - 采用疾病分类代码国家临床版2.0疾病诊断编码(ICD-10)
+     * LY.00.801诊断编码(ICD-10) 编码
+     */
+    private String bfpnDiagCode;
+
+    /**
+     * 手术前诊断名称 - 采用疾病分类代码国家临床版2.0疾病诊断编码(ICD-10)对应的名称,多个以"|"间隔
+     * LY.00.801诊断编码(ICD-10) 名称
+     */
+    private String bfpnDiagName;
+
+    /**
+     * 手术后诊断编码 - 采用疾病分类代码国家临床版2.0疾病诊断编码(ICD-10)对应的编码,多个以"|"间隔
+     * LY.00.801诊断编码(ICD-10) 编码
+     */
+    private String afpnDiagCode;
+
+    /**
+     * 手术后诊断名称 - 采用疾病分类代码国家临床版2.0疾病诊断编码(ICD-10)对应的名称,多个以"|"间隔
+     * LY.00.801诊断编码(ICD-10) 名称
+     */
+    private String afpnDiagName;
+
+    /**
+     * 手术开始日期时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date oprnBeginTime;
+
+    /**
+     * 手术结束日期时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date oprnEndTime;
+
+    /**
+     * 进手术室日期时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date inOperateRoomTime;
+
+    /**
+     * 出手术室日期时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date outOperateRoomTime;
+
+    /**
+     * 手术级别编码 - LY.00.41手术级别 编码
+     */
+    private String oprnLvCode;
+
+    /**
+     * 手术级别名称 - LY.00.41手术级别 名称
+     */
+    private String oprnLvName;
+
+    /**
+     * 手术医生编码 - 手术医生医保贯标码
+     */
+    private String oprnOperCode;
+
+    /**
+     * 手术医生姓名
+     */
+    private String oprnOperName;
+
+    /**
+     * 手术医生I助编码 - 手术医生I助医保贯标码
+     */
+    private String oprnAsitCode1;
+
+    /**
+     * 手术医生I助姓名
+     */
+    private String oprnAsitName1;
+
+    /**
+     * 手术医生II助编码 - 手术医生II助医保贯标码
+     */
+    private String oprnAsitCode2;
+
+    /**
+     * 手术医生II助姓名
+     */
+    private String oprnAsitName2;
+
+    /**
+     * 指导医师编码 - 指导医师医保贯标码
+     */
+    private String guiderCode;
+
+    /**
+     * 指导医师姓名
+     */
+    private String guideName;
+
+    /**
+     * 麻醉医师编码 - 麻醉医生医保贯标码
+     */
+    private String anstDrCode;
+
+    /**
+     * 麻醉医师姓名
+     */
+    private String anstDrName;
+
+    /**
+     * 麻醉执行科室代码 - 院内科室代码
+     */
+    private String exeAnstDeptCode;
+
+    /**
+     * 麻醉执行科室名称 - 院内科室名称
+     */
+    private String exeAnstDeptName;
+
+    /**
+     * 肿瘤部位计量单位
+     */
+    private String tumorPartUnit;
+
+    /**
+     * 肿瘤计量数量
+     */
+    private Integer tumorPartCnt;
+
+    /**
+     * 麻醉前用药 - 用药说明
+     */
+    private String preAnaesUseDrug;
+
+    /**
+     * 麻醉开始日期时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date anstBegntime;
+
+    /**
+     * 麻醉清醒日期时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date anstAwakeTime;
+
+    /**
+     * 入复苏室日期时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date pacuBegntime;
+
+    /**
+     * 出复苏室日期时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date pacuEndtime;
+
+    /**
+     * 麻醉持续时间(分钟)
+     */
+    private Integer anstConTime;
+
+    /**
+     * 麻醉效果
+     */
+    private String anstEfft;
+
+    /**
+     * 麻醉方式代码 - CV06.00.103麻醉方法代码表 编码
+     */
+    private String anstMtdCode;
+
+    /**
+     * 麻醉方式名称 - CV06.00.103麻醉方法代码表 名称
+     */
+    private String anstMtdName;
+
+    /**
+     * 手术切口类别代码 - CV05.10.022手术切口类别代码 编码
+     */
+    private String sincTypeCode;
+
+    /**
+     * 手术切口类别名称 - CV05.10.022手术切口类别代码 名称
+     */
+    private String sincTypeName;
+
+    /**
+     * 手术切口愈合等级代码 - CV5501.14手术切口愈合等级 编码
+     */
+    private String sincHealLvCode;
+
+    /**
+     * 手术切口愈合等级名称 - CV5501.14手术切口愈合等级 名称
+     */
+    private String sincHealLvName;
+
+    /**
+     * 无菌手术标志 - 0=否,1=是
+     */
+    private Integer oprnAsps;
+
+    /**
+     * 手术合并症标志 - 0=否,1=是
+     */
+    private Integer oprnMerg;
+
+    /**
+     * 标准手术时间超时标志 - 0=否,1=是
+     */
+    private Integer outStdOprnTime;
+
+    /**
+     * 无菌手术是否感染 - 0=否,1=是
+     */
+    private Integer oprnAspsIfet;
+
+    /**
+     * 预防使用抗菌药物天数
+     */
+    private Integer abtlMednDays;
+
+    /**
+     * 抗菌药物使用开始日期时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date abtlBegnTime;
+
+    /**
+     * 抗菌药物使用结束日期时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date abtlEndTime;
+
+    /**
+     * 抗菌药物用药目的 - 1=预防,2=治疗
+     */
+    private Integer abtlPup;
+
+    /**
+     * 抗菌药物用药途径 - LY.00.79给药途径
+     */
+    private String abtlRute;
+
+    /**
+     * 手术预防用抗菌药物标志 - 0=否,1=是
+     */
+    private Integer prevAbtlMedn;
+
+    /**
+     * 预防性用抗菌药物选择一、二代头孢菌素标志 - 0=否,1=是
+     */
+    private Integer prevAbtlChocephMark;
+
+    /**
+     * 手术序号 - 指本条记录表述的是第几个手术
+     */
+    private String oprnOprtSn;
+
+    /**
+     * 医源性手术 - 指由于医院原因导致该手术 0=否,1=是
+     */
+    private Integer iatrogenicOprn;
+
+    /**
+     * 手术来源 - 指是否源于本院的手术 0=否,1=是
+     */
+    private Integer oprnSouc;
+
+    /**
+     * 术前是否发生院内感染 - 0=否,1=是
+     */
+    private Integer bfpnInhospIfet;
+
+    /**
+     * 麻醉反应标志 - LY.00.282麻醉反应标志
+     */
+    private String anstReactMark;
+
+    /**
+     * 术后并发症标志 - 0=无,1=有,2=不明确
+     */
+    private Integer oprnConc;
+
+    /**
+     * 手术并发症编码 - 采用疾病分类代码国家临床版2.0疾病诊断编码(ICD-10)对应的编码,多个以"|"间隔
+     * LY.00.801诊断编码(ICD-10) 编码
+     */
+    private String oprnConcCode;
+
+    /**
+     * 手术并发症名称 - 采用疾病分类代码国家临床版2.0疾病诊断编码(ICD-10)对应的名称,多个以"|"间隔
+     */
+    private String oprnConcName;
+
+    /**
+     * 手术组号 - 用以标记同时做的手术
+     */
+    private String oprtGrpno;
+
+    /**
+     * 主次标志 - 1=主手术,2=非主手术
+     */
+    private Integer mainOprnMark;
+
+    /**
+     * 冰冻切片标志 - 是否做冰冻切片 0=否,1=是
+     */
+    private Integer frozenSectionMark;
+
+    /**
+     * 冰冻与石蜡诊断符合标志 - 0=否,1=是,2=未做
+     */
+    private Integer caseProcPathologyCode;
+
+    /**
+     * 重返手术室标志 - 0=否,1=是
+     */
+    private Integer backOprn;
+
+    /**
+     * 手术执行科室代码 - 院内科室代码
+     */
+    private String oprnAnstDeptCode;
+
+    /**
+     * 手术执行科室名称 - 院内科室名称
+     */
+    private String oprnAnstDeptName;
+
+    /**
+     * 手术体位代码 - CV06.00.223手术体位代码
+     */
+    private String procPositionCode;
+
+    /**
+     * 皮肤消毒描述
+     */
+    private String skinDisinfectDescr;
+
+    /**
+     * 手术过程描述
+     */
+    private String procProcDescr;
+
+    /**
+     * 实施手术及操作的详细描述
+     */
+    private String opDetailDesc;
+
+    /**
+     * 手术史标志 - 0=否,1=是
+     */
+    private Integer oprnHistMark;
+
+    /**
+     * 手术切口描述
+     */
+    private String sincDesc;
+
+    /**
+     * 出血量(mL)
+     */
+    private Integer bleedingNum;
+
+    /**
+     * 输液量(mL)
+     */
+    private Integer transfuseNum;
+
+    /**
+     * 输血量(mL)
+     */
+    private Integer bldAmt;
+
+    /**
+     * 尿量(mL)
+     */
+    private Integer urineAmt;
+
+    /**
+     * 术前用药 - 多个以"|"间隔
+     */
+    private String preProcDrugUseWay;
+
+    /**
+     * 术中用药 - 多个以"|"间隔
+     */
+    private String inProcDrugUseWay;
+
+    /**
+     * 输血反应标志 - 0=否,1=是
+     */
+    private Integer transfuseReactionMark;
+
+    /**
+     * 器械护士姓名 - 院内人员姓名
+     */
+    private String instrumentNurseName;
+
+    /**
+     * 器械护士工号 - 器械护士医保贯标码
+     */
+    private String instrumentNurseCode;
+
+    /**
+     * 巡台护士姓名 - 院内人员姓名
+     */
+    private String tourNurseName;
+
+    /**
+     * 巡台护士工号 - 巡台护士医保贯标码
+     */
+    private String tourNurseCode;
+
+    /**
+     * 手术及操作目标部位名称 - 当为其他时,填写具体的操作部位
+     */
+    private String oprnOprtTagtPartName;
+
+    /**
+     * 手术及操作目标部位代码 - CV06.00.227操作部位代码表 编码
+     */
+    private String oprnOprtTagtPartCode;
+
+    /**
+     * 引流标志 - 标识术中是否有引流 0=否,1=是
+     */
+    private Integer drainMark;
+
+    /**
+     * 引流材料名称
+     */
+    private String drainMaterName;
+
+    /**
+     * 引流材料数目
+     */
+    private String drainMaterCnt;
+
+    /**
+     * 放置部位 - 引流管放置在病人体内的具体位置
+     */
+    private String placePart;
+
+    /**
+     * 手术后情况
+     */
+    private String afpnInfo;
+
+    /**
+     * 其他医学处置
+     */
+    private String othMedDspo;
+
+    /**
+     * 病理检查 - 病理检查结果描述
+     */
+    private String palgDise;
+
+    /**
+     * 记录日期时间 - 手术记录日期
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date recTime;
+
+    /**
+     * 国家医保手术及操作编码 - 多个诊断用"|"分隔
+     */
+    private String nhsProcedureCode;
+
+    /**
+     * 国家医保手术及操作名称 - 多个诊断用"|"分隔
+     */
+    private String nhsProcedureName;
+
+    /**
+     * 医保就诊ID - 医保病人必填
+     */
+    private String mdtrtId;
+
+    /**
+     * 手术时间(手术日期)
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date oprnTime;
+
+    /**
+     * 麻醉ASA分级代码 - WS445.5-2014美国麻醉医师学会(ASA)分级标准代码表 编码
+     */
+    private String anstAsaLvCode;
+
+    /**
+     * 麻醉ASA分级名称 - WS445.5-2014美国麻醉医师学会(ASA)分级标准代码表 名称
+     */
+    private String anstAsaLvName;
+
+    /**
+     * 麻醉药物代码
+     */
+    private String anstMednCode;
+
+    /**
+     * 麻醉药物名称
+     */
+    private String anstMednName;
+
+    /**
+     * 麻醉药物剂量
+     */
+    private String anstMednDos;
+
+    /**
+     * 麻醉计量单位
+     */
+    private String anstDosunt;
+
+    /**
+     * 麻醉合并症代码 - 多个诊断用"|"分隔
+     * LY.00.801诊断编码(ICD-10)
+     */
+    private String anstCopnCode;
+
+    /**
+     * 麻醉合并症名称 - 多个诊断用"|"分隔
+     */
+    private String anstCopnName;
+
+    /**
+     * 麻醉合并症描述
+     */
+    private String anstCopnDscr;
+
+    /**
+     * 手术间编号
+     */
+    private String ssjbh;
+
+    /**
+     * 介入物名称
+     */
+    private String jrwmc;
+
+    /**
+     * 操作人ID
+     */
+    private String operatorId;
+
+    /**
+     * 操作时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date operationTime;
+
+    /**
+     * 密级 - LY.00.279 密级
+     */
+    private String securityLevel;
+
+    /**
+     * 有效标志 - 0=无效,1=有效
+     */
+    private Integer valiFlag;
+
+    /**
+     * 创建时间 - 记录创建时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date createTime;
+
+    /**
+     * 更新时间 - 记录最后更新时间
+     * 格式:YYYY-MM-DD HH24:MI:SS
+     */
+    private Date updateTime;
+
+    /**
+     * 医院批次号 - 批次号由医疗机构代码-填报日期(格式为YYYYMMDD)-当天批次(两位数字)-上传类型(1新增;2重传)
+     * 复合主键,xxx-20250605-01-1表示单位编码为xxx的单位在2025年06月05日进行第一次上传,上传类型为新增
+     */
+    private String orgBatchNo;
+}

+ 184 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbIpTransfer.java

@@ -0,0 +1,184 @@
+package org.thyy.threeone.entity.updateTrinity;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 转科记录(TB_IP_TRANSFER)
+ */
+@Data
+public class TbIpTransfer {
+    /**
+     * 医疗机构代码
+     */
+    private String orgCode;
+    /**
+     * 记录ID
+     */
+    private String recordId;
+    /**
+     * 住院就诊流水号
+     */
+    private String iptMdtrtSn;
+    /**
+     * 患者ID
+     */
+    private String patientId;
+    /**
+     * 卡号
+     */
+    private String cardNo;
+    /**
+     * 卡类型
+     */
+    private String cardType;
+    /**
+     * 科室代码
+     */
+    private String deptCode;
+    /**
+     * 科室名称
+     */
+    private String deptName;
+    /**
+     * 病区名称
+     */
+    private String areaName;
+    /**
+     * 病房号
+     */
+    private String wardNum;
+    /**
+     * 病床号
+     */
+    private String sickbedNum;
+    /**
+     * 诊疗过程描述
+     */
+    private String treatNote;
+    /**
+     * 目前情况
+     */
+    private String presentSituation;
+    /**
+     * 目前诊断-西医诊断名称
+     */
+    private String currDiagWeDiagName;
+    /**
+     * 目前诊断-西医诊断编码
+     */
+    private String currDiagWeDiagCode;
+    /**
+     * 目前诊断-中医病名名称
+     */
+    private String currDiagCdName;
+    /**
+     * 目前诊断-中医病名代码
+     */
+    private String currDiagCdCode;
+    /**
+     * 目前诊断-中医证候名称
+     */
+    private String currDiagCsynName;
+    /**
+     * 目前诊断-中医证候代码
+     */
+    private String currDiagCsynCode;
+    /**
+     * 转科目的
+     */
+    private String changeMajorPurpose;
+    /**
+     * 转入诊疗计划
+     */
+    private String inDiagTreatPlan;
+    /**
+     * 中药处方医嘱内容
+     */
+    private String chMedPresDac;
+    /**
+     * 中药煎煮方法
+     */
+    private String tcmDecoctionMethod;
+    /**
+     * 中药用药方法
+     */
+    private String medicationMethod;
+    /**
+     * 注意事项
+     */
+    private String mattersAttention;
+    /**
+     * 转科记录类型
+     */
+    private Integer transferRecordType;
+    /**
+     * 转出日期时间
+     */
+    private Date rollOutDate;
+    /**
+     * 转出科室代码
+     */
+    private String rollOutDeptCode;
+    /**
+     * 转出科室名称
+     */
+    private String rollOutDepName;
+    /**
+     * 转出医师代码
+     */
+    private String rollOutDocCode;
+    /**
+     * 转出医师签名
+     */
+    private String rollOutDocName;
+    /**
+     * 转入日期时间
+     */
+    private Date intoDate;
+    /**
+     * 转入科室代码
+     */
+    private String intoDeptCode;
+    /**
+     * 转入科室名称
+     */
+    private String intoDepName;
+    /**
+     * 转入医师代码
+     */
+    private String intoDocCode;
+    /**
+     * 转入医师签名
+     */
+    private String intoDocName;
+    /**
+     * 操作人ID
+     */
+    private String operatorId;
+    /**
+     * 操作时间
+     */
+    private Date operatorTime;
+    /**
+     * 密级
+     */
+    private String securityLevel;
+    /**
+     * 有效标志
+     */
+    private Integer valiFlag;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+    /**
+     * 医院批次号
+     */
+    private String orgBatchNo;
+}

+ 124 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/updateTrinity/TbQualityEmr.java

@@ -0,0 +1,124 @@
+package org.thyy.threeone.entity.updateTrinity;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 病历质量控制基本信息表(TB_QUALITY_EMR)
+ */
+@Data
+public class TbQualityEmr {
+    /**
+     * 医疗机构代码
+     */
+    private String orgCode;
+    /**
+     * 病历质控记录ID
+     */
+    private String qcId;
+    /**
+     * 病历ID
+     */
+    private String recordId;
+    /**
+     * 患者标识
+     */
+    private String patientId;
+    /**
+     * 卡号
+     */
+    private String cardNo;
+    /**
+     * 卡类型
+     */
+    private String cardType;
+    /**
+     * 科室代码
+     */
+    private String deptCode;
+    /**
+     * 科室名称
+     */
+    private String deptName;
+    /**
+     * 医生代码
+     */
+    private String doctorCode;
+    /**
+     * 医生名称
+     */
+    private String doctorName;
+    /**
+     * 质控项目名称
+     */
+    private String qcItemname;
+    /**
+     * 质控项目编码
+     */
+    private String qcItemcode;
+    /**
+     * 质控时间
+     */
+    private Date qcTime;
+    /**
+     * 质控人员编码
+     */
+    private String qcStaffid;
+    /**
+     * 质控人员名称
+     */
+    private String qcStaffname;
+    /**
+     * 病历质控问题描述
+     */
+    private String qcIssuedesc;
+    /**
+     * 病案评分
+     */
+    private Double recordScore;
+    /**
+     * 时限超时标志
+     */
+    private Integer timeoutFlag;
+    /**
+     * 病历修改时间
+     */
+    private Date modifyTime;
+    /**
+     * 病历修改人
+     */
+    private String modifier;
+    /**
+     * 质控确认完成时间
+     */
+    private Date qcConfirmtime;
+    /**
+     * 质控确认完成人名称
+     */
+    private String qcConfirmer;
+    /**
+     * 质控状态
+     */
+    private Integer qcStatus;
+    /**
+     * 密级
+     */
+    private String securityLevel;
+    /**
+     * 有效标志
+     */
+    private Integer valiFlag;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+    /**
+     * 医院批次号
+     */
+    private String orgBatchNo;
+}

+ 27 - 0
thyy-three-one/src/main/java/org/thyy/threeone/entity/yz/ZyZkList.java

@@ -0,0 +1,27 @@
+package org.thyy.threeone.entity.yz;
+
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class ZyZkList implements Serializable {
+    @Serial
+    private static final long serialVersionUID = 1L;
+    private Date opTime;
+    private String fDeptCode;
+    private String fWardCode;
+    private String deptCode;
+    private String wardCode;
+    private String opId;
+    private String referPhysician;
+    private String consultPhysician;
+
+    /**
+     * 是否转科超过 24 小时
+     */
+    private boolean timeout;
+
+}

+ 913 - 0
thyy-three-one/src/main/java/org/thyy/threeone/service/InPatientServer.java

@@ -0,0 +1,913 @@
+package org.thyy.threeone.service;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.convert.Convert;
+import cn.hutool.core.date.DatePattern;
+import cn.hutool.core.date.DateUnit;
+import cn.hutool.extra.spring.SpringUtil;
+import cn.hutool.json.JSONUtil;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
+import org.thyy.threeone.dao.EmrPatientDao;
+import org.thyy.threeone.dao.InPatientDao;
+import org.thyy.threeone.entity.Insutype;
+import org.thyy.threeone.entity.PatientInfo;
+import org.thyy.threeone.entity.TReqSurgicalDiag;
+import org.thyy.threeone.entity.emr.EmrAuditDetail;
+import org.thyy.threeone.entity.emr.EmrPatientData;
+import org.thyy.threeone.entity.emr.EmrProgressNote;
+import org.thyy.threeone.entity.updateTrinity.*;
+import org.thyy.threeone.entity.yz.ZyZkList;
+import org.thyy.utils.DateUtil;
+import org.thyy.utils.StringUtil;
+import org.thyy.utils.emr.EmrJsonUtils;
+import org.thyy.utils.entity.CodeName;
+import org.thyy.threeone.entity.UserInfo;
+
+import java.util.*;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.function.Consumer;
+
+
+@Slf4j
+public class InPatientServer {
+
+    private final InPatientDao dao = SpringUtil.getBean(InPatientDao.class);
+    private final EmrPatientDao emrDao = SpringUtil.getBean(EmrPatientDao.class);
+
+    private final Map<String, UserInfo> userInfoMap = new HashMap<>();
+    private final Map<String, String> deptMap = new HashMap<>();
+
+    private static final String securityLevel = "000";
+    private static final String orgCode = "H43010500370";
+    private final String orgBatchNo = orgCode + "-" + DateUtil.format(new Date(), "yyyyMMdd") + "-01-1";
+
+    /**
+     * 住院使用患者的住院次数加住院号下划线拼接
+     */
+    @Setter
+    private List<String> patList;
+
+    @Setter
+    private String startDate = DateUtil.format(new Date(), DatePattern.NORM_DATE_PATTERN);
+
+    @Setter
+    private String endDate = DateUtil.format(new Date(), DatePattern.NORM_DATE_PATTERN);
+
+    private String patNo;
+    private Integer times;
+    private TbIpAdmissionRecord currentAdmissionRecord;
+
+
+    @Getter
+    private Map<String, Map<String, Object>> patData = new HashMap<>();
+
+    private PatientInfo patInfoCurrent;
+
+
+    private void getUserInfo(String key, Consumer<UserInfo> consumer) {
+        if (userInfoMap.containsKey(key)) {
+            if (userInfoMap.get(key) != null) {
+                consumer.accept(userInfoMap.get(key));
+            }
+            return;
+        }
+        UserInfo info = dao.getUserInfo(key);
+        userInfoMap.put(key, info);
+        if (info != null) {
+            consumer.accept(info);
+        }
+    }
+
+
+    private String getUserInfoName(String key) {
+        AtomicReference<String> name = new AtomicReference<>("");
+        getUserInfo(key, val -> {
+            name.set(val.getName());
+        });
+        return name.get();
+    }
+
+    private String getDeptName(String key) {
+        if (deptMap.containsKey(key)) {
+            return deptMap.get(key);
+        }
+        String deptName = dao.getDeptName(key);
+        deptMap.put(key, deptName);
+        return deptName;
+    }
+
+
+    public void init() {
+        currentAdmissionRecord = new TbIpAdmissionRecord();
+        patInfoCurrent = new PatientInfo();
+        patData = new HashMap<>();
+
+        for (String item : patList) {
+            String[] split = item.split("_");
+            patNo = split[0];
+            times = Convert.toInt(split[1]);
+            if (!patData.containsKey(item)) {
+                patData.put(item, new HashMap<>());
+            }
+            patInfoCurrent = dao.getPatientInfo(patNo, times);
+            if (patInfoCurrent == null) {
+                patInfoCurrent = new PatientInfo();
+            } else {
+                getUserInfo(patInfoCurrent.getReferPhysician(), val -> {
+                    patInfoCurrent.setReferPhysician(val.getYbCode());
+                    patInfoCurrent.setReferPhysicianName(val.getName());
+                });
+
+                getUserInfo(patInfoCurrent.getChiefDoctorCode(), val -> {
+                    patInfoCurrent.setChiefDoctorCode(val.getYbCode());
+                    patInfoCurrent.setChiefDoctorName(val.getName());
+                });
+
+                patInfoCurrent.setDisDeptName(getDeptName(patInfoCurrent.getDisDept()));
+            }
+            currentAdmissionRecord = getTbIpAdmission();
+            try {
+                patData.get(item).put("TbIpAdmissionRecord", getTbIpAdmission());
+            } catch (Exception e) {
+                log.error("TbIpAdmissionRecord", e);
+            }
+            try {
+                patData.get(item).put("TbIpFirstCourse", getTbIpFirstCourse());
+            } catch (Exception e) {
+                log.error("TbIpFirstCourse", e);
+            }
+            try {
+                patData.get(item).put("TbIpDailyCourse", getTbIpDailyCourse());
+            } catch (Exception e) {
+                log.error("TbIpDailyCourse", e);
+            }
+            try {
+                patData.get(item).put("TbIp24hDischarge", getTbIp24hDischarge());
+            } catch (Exception e) {
+                log.error("TbIp24hDischarge", e);
+            }
+            try {
+                patData.get(item).put("TbIp24hDeath", getTbIp24hDeath());
+            } catch (Exception e) {
+                log.error("TbIp24hDeath", e);
+            }
+            try {
+                patData.get(item).put("TbIpDischargeSummary", getTbIpDischargeSummary());
+            } catch (Exception e) {
+                log.error("TbIpDischargeSummary", e);
+            }
+            try {
+                patData.get(item).put("TbIpTransfer", getTbIpTransfer());
+            } catch (Exception e) {
+                log.error("TbIpTransfer", e);
+            }
+            try {
+                patData.get(item).put("TbIpDeathInfo", getTbIpDeathInfo());
+            } catch (Exception e) {
+                log.error("TbIpDeathInfo", e);
+            }
+            try {
+                patData.get(item).put("TbIpSurgery", getTbIpSurgery());
+
+            } catch (Exception e) {
+                log.error("TbIpSurgery", e);
+            }
+            try {
+                patData.get(item).put("TbDiagnosisDetail", getTbDiagnosisDetail());
+            } catch (Exception e) {
+                log.error("TbDiagnosisDetail", e);
+            }
+
+        }
+    }
+
+    /**
+     * 入院记录表
+     */
+    public TbIpAdmissionRecord getTbIpAdmission() {
+        TbIpAdmissionRecord info = dao.getTbIpAdmissionRecord(patNo, times);
+        info.setAdmDeptName(getDeptName(info.getAdmDeptCode()));
+        info.setWardName(getDeptName(info.getWardNo()));
+
+        getUserInfo(info.getVisitingPhysicianCode(), (userInfo) -> {
+            info.setVisitingPhysicianCode(userInfo.getYbCode());
+            info.setVisitingPhysicianName(userInfo.getName());
+        });
+
+        getUserInfo(info.getResidentPhysicianCode(), (userInfo) -> {
+            info.setResidentPhysicianCode(userInfo.getYbCode());
+            info.setResidentPhysicianName(userInfo.getName());
+        });
+
+        EmrPatientData emrData = emrDao.findEmrDataByCode(patNo, times, "ruyuanjiluzhuanyong");
+        if (emrData != null) {
+            EmrJsonUtils json = emrData.jsonUtils2();
+            json.getArr("入院诊断", (val) -> {
+                StringBuilder code = new StringBuilder();
+                StringBuilder name = new StringBuilder();
+                String codes = "";
+                for (CodeName codeName : val) {
+                    code.append(codeName.getCode()).append("|");
+                    name.append(codeName.getName()).append("|");
+                    codes = "'" + codeName.getCode() + "',";
+                }
+                codes = codes.substring(0, codes.length() - 1);
+                info.setWesternDiagCode(code.substring(0, code.length() - 1));
+                info.setWesternDiagName(name.toString());
+                Integer infectious = dao.isInfectious(codes);
+                if (infectious > 0) {
+                    info.setIsInfectious(0);
+                } else {
+                    info.setIsInfectious(1);
+                }
+                patInfoCurrent.setAdmDiagnosisCode(val.getFirst().getCode());
+                patInfoCurrent.setAdmDiagnosisName(val.getFirst().getName());
+            });
+            getUserInfo(info.getDoctorCode(), userInfo -> {
+                info.setDoctorCode(userInfo.getYbCode());
+                info.setDoctorName(userInfo.getName());
+            });
+            json.setObjectByEmrBusiness(info);
+            info.setInpatientTimes(times);
+            info.setValiFlag(emrData.getDelFlag());
+            info.setCreateTime(emrData.getCreateDate());
+            info.setUpdateTime(emrData.getModifyDate());
+            info.setDischargeDeptName(getDeptName(info.getDischargeDeptCode()));
+
+            info.setSecurityLevel("000");
+            info.setOrgCode(orgCode);
+            info.setIptMdtrtSn(patNo + "_" + times);
+            info.setPatientId(patNo);
+            info.setOrgBatchNo(orgBatchNo);
+        }
+        info.setIsInfectious(0);
+        return info;
+    }
+
+    /**
+     * 首次病程
+     */
+    public TbIpFirstCourse getTbIpFirstCourse() {
+        TbIpFirstCourse info = dao.getTbIpFirstCourse(patNo, times);
+        EmrPatientData emrData = emrDao.findEmrDataByCode(patNo, times, "shoucibingchengjilu");
+        if (emrData == null) {
+            return null;
+        }
+
+        info.setSecurityLevel("000");
+        info.setOrgCode(orgCode);
+        info.setIptMdtrtSn(patNo + "_" + times);
+        info.setPatientId(patNo);
+        info.setOrgBatchNo(orgBatchNo);
+
+        info.setRecordId(emrData.getEmrDocumentId());
+        info.setRecordCreateTime(emrData.getCreateDate());
+        EmrJsonUtils json = emrData.jsonUtils2();
+        info.setChiefComplaint(json.getStr("主诉"));
+        json.setObjectByEmrBusiness(info);
+        info.setOperatorId(emrData.getCreateId());
+        info.setValiFlag(emrData.getDelFlag());
+        info.setUpdateTime(emrData.getModifyDate());
+        info.setPresentIllnessHis(json.getStr("病例特点"));
+        info.setDiagnosisBasis(json.getStr("诊断依据"));
+        json.getFirstArr("入院诊断", val -> {
+            info.setWmInitalDiagnosisCode(val.getCode());
+            info.setWmInitalDiagnosisName(val.getName());
+            info.setWmDiffDiagnosisCode(val.getCode());
+            info.setWmDiffDiagnosisName(val.getName());
+        });
+        info.setTreatmentPlan(json.getStr("诊疗计划"));
+        getUserInfo(info.getResidentPhysicianId(), (val) -> {
+            info.setResidentPhysicianId(val.getYbCode());
+            info.setResidentPhysicianName(val.getName());
+        });
+        info.setSecurityLevel(securityLevel);
+        info.setValiFlag(1);
+        info.setCreateTime(emrData.getCreateDate());
+        info.setUpdateTime(emrData.getModifyDate());
+        return info;
+    }
+
+    /**
+     * 住院日常病程记录
+     */
+    public List<TbIpDailyCourse> getTbIpDailyCourse() {
+        List<TbIpDailyCourse> rst = new ArrayList<>();
+
+        List<EmrProgressNote> emrProgressNote = emrDao.getEmrProgressNote(patNo, times, startDate, endDate);
+
+        if (emrProgressNote == null || emrProgressNote.isEmpty()) {
+            return rst;
+        }
+
+        TbIpFirstCourse course = dao.getTbIpFirstCourse(patNo, times);
+        getUserInfo(course.getResidentPhysicianId(), (val) -> {
+            course.setResidentPhysicianId(val.getYbCode());
+            course.setResidentPhysicianName(val.getName());
+        });
+
+        for (EmrProgressNote item : emrProgressNote) {
+            TbIpDailyCourse bean = BeanUtil.toBean(course, TbIpDailyCourse.class);
+            EmrProgressNote.NoteDataElement note = item.dateElementJson();
+
+            bean.setIdNumber(patInfoCurrent.getIdNumber());
+            bean.setOrgBatchNo(securityLevel);
+            bean.setSecurityLevel("000");
+            bean.setOrgCode(orgCode);
+            bean.setIptMdtrtSn(patNo + "_" + times);
+            bean.setPatientId(patNo);
+            bean.setRecordCreateTime(item.getCreationTime());
+            bean.setRecordIid(String.valueOf(item.getId()));
+            bean.setAdmCourse(note.getText());
+            bean.setOrderContent("");
+            bean.setOperationTime(item.getCreationTime());
+            bean.setOperatorId(item.getCreateId());
+            bean.setCreateTime(item.getCreationTime());
+            bean.setValiFlag(1);
+            bean.setUpdateTime(new Date());
+            rst.add(bean);
+        }
+
+        return rst;
+    }
+
+    public TbIp24hDischarge getTbIp24hDischarge() {
+        if (patInfoCurrent.getDisDate() == null) {
+            return null;
+        }
+        long between = DateUtil.between(patInfoCurrent.getAdmissDate(), patInfoCurrent.getDisDate(), DateUnit.HOUR);
+        if (between > 24) {
+            return null;
+        }
+
+        EmrPatientData emrData = emrDao.findEmrDataByCode(patNo, times, "chuyuanjilu");
+
+        if (emrData == null) {
+            return null;
+        }
+        TbIp24hDischarge info = dao.getTbIp24hDischarge(patNo, times);
+        EmrJsonUtils json = emrData.jsonUtils2();
+        info.setSecurityLevel("000");
+        info.setOrgCode(orgCode);
+        info.setIptMdtrtSn(patNo + "_" + times);
+        info.setPatientId(patNo);
+        info.setOrgBatchNo(orgBatchNo);
+
+        Date birthByIdCard = DateUtil.parse(patInfoCurrent.getBirthDate(), "yyyy-MM-dd");
+        info.setAgeYear(Convert.toStr(DateUtil.age(birthByIdCard, emrData.getCreateDate())));
+        info.setAgeMonth(Convert.toStr(DateUtil.getAgeInMonths(birthByIdCard)));
+        info.setMaritalStatusCode("90");
+        json.getFirstArr("婚姻", val -> {
+            switch (val.getCode()) {
+                case "1":
+                    info.setMaritalStatusCode("10");
+                    break;
+                case "2":
+                    info.setMaritalStatusCode("20");
+                    break;
+                case "3":
+                    info.setMaritalStatusCode("30");
+                    break;
+                case "4":
+                    info.setMaritalStatusCode("40");
+                    break;
+                default:
+                    info.setMaritalStatusCode("90");
+                    break;
+            }
+        });
+        info.setOccupationCode(patInfoCurrent.getOccupationCode());
+        info.setInformationReliableFlag(1);
+        info.setAdmissionTime(patInfoCurrent.getAdmissDate());
+        info.setDischargeTime(patInfoCurrent.getDisDate());
+        info.setDischargeOrder(json.getStr("出院医嘱"));
+
+        info.setAdmdiagWmCode(patInfoCurrent.getAdmDiagnosisCode());
+        info.setAdmdiagWmName(patInfoCurrent.getAdmDiagnosisName());
+
+        info.setInformantRelationCode("0");
+        info.setInformationReliableFlag(1);
+        info.setInformantName(info.getPatientName());
+
+
+        getUserInfo(info.getAdmittingDoctorCode(), (val) -> {
+            info.setAdmittingDoctorCode(val.getYbCode());
+            info.setAdmittingDoctorName(val.getName());
+        });
+
+        getUserInfo(info.getResidentDoctorCode(), val -> {
+            info.setResidentDoctorCode(val.getYbCode());
+            info.setResidentDoctorName(val.getName());
+
+            info.setAttendingDoctorCode(val.getYbCode());
+            info.setAttendingDoctorName(val.getName());
+        });
+
+        getUserInfo(info.getChiefDoctorCode(), val -> {
+            info.setChiefDoctorCode(val.getYbCode());
+            info.setChiefDoctorName(val.getName());
+        });
+
+        json.getFirstArr("出院诊断", val -> {
+            info.setDischDiagWmCode(val.getCode());
+            info.setDischDiagWmName(val.getName());
+        });
+
+        PatientInfo dischargeOrder = dao.getDischargeOrder(patNo, times);
+        if (dischargeOrder != null) {
+            getUserInfo(dischargeOrder.getDischargeOrderDoctorCode(), val -> {
+                info.setDischargeOrderDoctorCode(val.getYbCode());
+                info.setDischargeOrderDoctorName(val.getName());
+            });
+        } else {
+            getUserInfo(emrData.getCreateId(), val -> {
+                info.setDischargeOrderDoctorCode(val.getYbCode());
+                info.setDischargeOrderDoctorName(val.getName());
+            });
+        }
+        info.setRecordId(emrData.getEmrDocumentId());
+        info.setDischargeOrderTime(json.getDate("出院时间"));
+        info.setDischargeTime(json.getDate("出院时间"));
+        info.setTcmObservation("-");
+        info.setTreatmentPrinciple("-");
+        info.setDischargeCondition("9");
+
+        info.setAdmdiagTcmDiseaseCode(currentAdmissionRecord.getWesternDiagCode());
+        info.setAdmdiagTcmDiseaseName(currentAdmissionRecord.getWesternDiagName());
+        info.setAdmdiagTcmSyndromeCode("-");
+        info.setAdmdiagTcmSyndromeName("-");
+        info.setTreatmentProcess(json.getStr("诊疗经过", "-"));
+        info.setDischDiagTcmDiseaseCode("-");
+        info.setDischDiagTcmDiseaseName("-");
+        info.setDischDiagTcmSyndromeCode("-");
+        info.setDischDiagTcmSyndromeName("-");
+        info.setCreateTime(emrData.getCreateDate());
+        info.setUpdateTime(emrData.getModifyDate() == null ? new Date() : emrData.getModifyDate());
+        info.setOperatorId(emrData.getCreateId());
+        info.setOperationTime(emrData.getCreateDate());
+        info.setValiFlag(emrData.getDelFlag());
+        info.setUpdateTime(emrData.getModifyDate());
+        json.setObjectByEmrBusiness(info);
+        return info;
+    }
+
+    // 4.5.5 24H内入院死亡记录(TB_IP_24H_DEATH)
+    public TbIp24hDeath getTbIp24hDeath() {
+        if (patInfoCurrent.getDisDate() == null) {
+            return null;
+        }
+        long between = DateUtil.between(patInfoCurrent.getAdmissDate(), patInfoCurrent.getDisDate(), DateUnit.HOUR);
+        if (between > 24) {
+            return null;
+        }
+
+        EmrPatientData emrData = emrDao.findEmrDataByCode(patNo, times, "siwangjilu");
+        if (emrData == null) {
+            return null;
+        }
+        TbIp24hDeath info = dao.getTbIp24hDeath(patNo, times);
+        info.setSecurityLevel("000");
+        info.setOrgCode(orgCode);
+        info.setIptMdtrtSn(patNo + "_" + times);
+        info.setPatientId(patNo);
+        info.setOrgBatchNo(orgBatchNo);
+
+
+        EmrJsonUtils json = emrData.jsonUtils2();
+        info.setTreatmentProcess(json.getStr("诊疗经过"));
+        info.setCauseOfDeath(info.getTreatmentProcess());
+
+        Date birthByIdCard = DateUtil.parse(patInfoCurrent.getBirthDate(), "yyyy-MM-dd");
+        info.setAgeYear(Convert.toStr(DateUtil.age(birthByIdCard, emrData.getCreateDate())));
+        info.setAgeMonth(Convert.toStr(DateUtil.getAgeInMonths(birthByIdCard)));
+        info.setMaritalStatus("90");
+        json.getFirstArr("婚姻", val -> {
+            switch (val.getCode()) {
+                case "1":
+                    info.setMaritalStatus("10");
+                    break;
+                case "2":
+                    info.setMaritalStatus("20");
+                    break;
+                case "3":
+                    info.setMaritalStatus("30");
+                    break;
+                case "4":
+                    info.setMaritalStatus("40");
+                    break;
+                default:
+                    info.setMaritalStatus("90");
+                    break;
+            }
+        });
+
+        json.getFirstArr("入院诊断", val -> {
+            info.setAdmdiagWmCode(val.getCode());
+            info.setAdmdiagWmName(val.getName());
+        });
+
+
+        getUserInfo(info.getAdmittingDoctorCode(), (val) -> {
+            info.setAdmittingDoctorCode(val.getYbCode());
+            info.setAdmittingDoctorName(val.getName());
+        });
+
+        getUserInfo(info.getResidentDoctorCode(), val -> {
+            info.setResidentDoctorCode(val.getYbCode());
+            info.setResidentDoctorName(val.getName());
+
+            info.setAttendingDoctorCode(val.getYbCode());
+            info.setAttendingDoctorName(val.getName());
+        });
+
+        getUserInfo(info.getChiefDoctorCode(), val -> {
+            info.setChiefDoctorCode(val.getYbCode());
+            info.setChiefDoctorName(val.getName());
+        });
+
+        json.getFirstArr("出院诊断", val -> {
+            info.setDeathWmCode(val.getCode());
+            info.setDeathWmName(val.getName());
+        });
+        info.setTreatmentProcess(json.getStr("诊疗经过"));
+        info.setCauseOfDeath(info.getTreatmentProcess());
+
+        info.setOperatorId(emrData.getCreateId());
+        info.setOperatorTime(emrData.getCreateDate());
+        info.setCreateTime(emrData.getCreateDate());
+        info.setValiFlag(emrData.getDelFlag());
+        info.setUpdateTime(emrData.getModifyDate());
+        info.setAdmissionCondition(json.getStr("入院情况"));
+        info.setRecordId(emrData.getEmrDocumentId());
+        info.setTcmObservation("-");
+        info.setTcmTreatment("-");
+        info.setAdmdiagTcmDiseaseCode("-");
+        info.setAdmdiagTcmDiseaseName("-");
+        info.setDeathTcmSyndromeCode("-");
+        info.setDeathTcmSyndromeName("-");
+        info.setAdmdiagTcmSyndromeCode("-");
+        info.setAdmdiagTcmSyndromeName("-");
+        info.setDeathTcmDiseaseCode("-");
+        info.setDeathTcmDiseaseName("-");
+        return info;
+    }
+
+    public TbIpDischargeSummary getTbIpDischargeSummary() {
+        EmrPatientData emrData = emrDao.findEmrDataByCode(patNo, times, "chuyuanjilu");
+        if (emrData == null) {
+            return null;
+        }
+        TbIpDischargeSummary info = dao.getTbIpDischargeSummary(patNo, times);
+        EmrJsonUtils json = emrData.jsonUtils2();
+        info.setHospitalInsuranceName(Insutype.getName(info.getInsuranceType()));
+
+        info.setSecurityLevel("000");
+        info.setOrgCode(orgCode);
+        info.setIptMdtrtSn(patNo + "_" + times);
+        info.setPatientId(patNo);
+        info.setOrgBatchNo(orgBatchNo);
+
+        info.setDiagnosisCodeType(1);
+        json.getFirstArr("出院诊断", val -> {
+            info.setPrimaryDiagnosisCode(val.getCode());
+            info.setHospitalDiagnosisName(val.getName());
+        });
+        if (info.getDischargeTime() == null) {
+            info.setDischargeTime(new Date());
+        }
+        long between = DateUtil.between(info.getAdmissionTime(), info.getDischargeTime(), DateUnit.DAY);
+        info.setInpatientDay(Convert.toInt(between));
+        info.setIs24HrAdmDisch(between == 0 ? 1 : 0);
+        info.setDischargeMode(patInfoCurrent.getZyDismissWay());
+        if (info.getDischargeMode() == null) {
+            info.setDischargeMode("9");
+        }
+        String 住院经过 = json.getStr("住院经过");
+        info.setAdmSummery(住院经过);
+        info.setDischargeSummery(住院经过);
+        info.setAdmDiagnosisCode(patInfoCurrent.getAdmDiagnosisCode());
+        info.setAdmDiagnosisName(patInfoCurrent.getAdmDiagnosisName());
+        info.setAuxiliaryObservationResult(currentAdmissionRecord.getStudiesSumm());
+        info.setTreatmentDesc(住院经过);
+        info.setDischargeStatus("9");
+        info.setDischargeCondition(json.getStr("主诉"));
+        info.setOutOrder(json.getStr("出院医嘱"));
+
+        info.setOperatorId(emrData.getCreateId());
+        info.setOperationTime(emrData.getCreateDate());
+        info.setValiFlag(emrData.getDelFlag());
+        info.setCreateTime(emrData.getCreateDate());
+        info.setUpdateTime(emrData.getModifyDate());
+        return info;
+    }
+
+    // 11
+    public List<TbIpTransfer> getTbIpTransfer() {
+        List<TbIpTransfer> rst = new ArrayList<>();
+        List<TbIpTransfer> zkNote = dao.getZkNote(patNo, times, startDate, endDate);
+        List<ZyZkList> zkList = dao.getZkList(patNo, times);
+
+        for (int i = 0; i < zkNote.size(); i++) {
+            TbIpTransfer info = zkNote.get(i);
+            EmrProgressNote.NoteDataElement json = JSONUtil.toBean(info.getTreatNote(), EmrProgressNote.NoteDataElement.class);
+            String text = StringUtil.truncateString(json.getText(), 1800);
+
+            info.setCurrDiagWeDiagCode(patInfoCurrent.getAdmDiagnosisCode());
+            info.setCurrDiagWeDiagName(patInfoCurrent.getAdmDiagnosisName());
+
+            info.setIptMdtrtSn(patNo + "_" + times);
+            info.setRecordId(info.getIptMdtrtSn() + "_" + i);
+            info.setPresentSituation(text);
+            info.setTreatNote(text);
+            info.setChangeMajorPurpose("病情需要");
+            info.setSecurityLevel("000");
+            info.setOrgCode(orgCode);
+            info.setPatientId(patNo);
+            info.setOrgBatchNo(orgBatchNo);
+
+            info.setInDiagTreatPlan(text);
+            info.setTransferRecordType(1);
+
+            try {
+                ZyZkList item = zkList.get(i);
+                if (item.getReferPhysician() == null) {
+                    return null;
+                }
+                info.setRollOutDate(item.getOpTime());
+                info.setRollOutDeptCode(item.getDeptCode());
+                info.setRollOutDepName(getDeptName(item.getDeptCode()));
+                info.setIntoDeptCode(item.getFDeptCode());
+                info.setIntoDepName(getDeptName(item.getFDeptCode()));
+                info.setIntoDate(item.getOpTime());
+                info.setRollOutDocCode(item.getReferPhysician());
+                info.setRollOutDocName(getUserInfoName(item.getReferPhysician()));
+
+                info.setIntoDocCode(item.getOpId());
+                info.setIntoDocName(getUserInfoName(item.getOpId()));
+                info.setOperatorId(item.getOpId());
+                info.setOperatorTime(item.getOpTime());
+                info.setCreateTime(item.getOpTime());
+            } catch (Exception ignore) {
+                return null;
+            }
+
+
+            info.setValiFlag(1);
+
+            info.setUpdateTime(new Date());
+            info.setSecurityLevel("000");
+            info.setOrgCode(orgCode);
+            info.setIptMdtrtSn(patNo + "_" + times);
+            info.setPatientId(patNo);
+            rst.add(info);
+        }
+
+
+        return rst;
+    }
+
+    public TbIpDeathInfo getTbIpDeathInfo() {
+        EmrPatientData emrData = emrDao.findEmrDataByCode(patNo, times, "siwangjilu");
+        if (emrData == null) {
+            return null;
+        }
+        TbIpDeathInfo info = dao.getTbIpDeathInfo(patNo, times);
+
+        info.setSecurityLevel("000");
+        info.setOrgCode(orgCode);
+        info.setIptMdtrtSn(patNo + "_" + times);
+        info.setPatientId(patNo);
+        info.setOrgBatchNo(orgBatchNo);
+
+        EmrJsonUtils json = emrData.jsonUtils2();
+        info.setTreatmentProcessDesc(json.getStr("病情摘要"));
+        Date deathDt = json.getDate("死亡时间");
+        info.setDeathDt(deathDt == null ? emrData.getCreateDate() : deathDt);
+        json.getFirstArr("出院诊断", val -> {
+            info.setDirectDeathCauseCode(val.getCode());
+            info.setDirectDeathCauseName(val.getName());
+
+            info.setDeathDiagnosisCode(val.getCode());
+            info.setDeathDiagnosisName(val.getName());
+        });
+
+        getUserInfo(info.getAttendingDoctorCode(), val -> {
+            info.setAttendingDoctorCode(val.getYbCode());
+            info.setAttendingDoctor(val.getName());
+        });
+
+        info.setAttendingDoctor(currentAdmissionRecord.getDoctorCode());
+        info.setAttendingDoctor(currentAdmissionRecord.getDoctorName());
+        info.setChiefDoctorCode(patInfoCurrent.getChiefDoctorCode());
+        info.setChiefDoctor(patInfoCurrent.getChiefDoctorName());
+        info.setOperatorId(emrData.getCreateId());
+        info.setOperationTime(emrData.getCreateDate());
+        info.setValiFlag(1);
+        info.setCreateTime(emrData.getCreateDate());
+        info.setUpdateTime(emrData.getModifyDate() == null ? new Date() : emrData.getModifyDate());
+        return info;
+    }
+
+    public List<TbIpSurgery> getTbIpSurgery() {
+        List<TbIpSurgery> rst = dao.getTbIpSurgery(patNo, times);
+        if (rst.isEmpty()) {
+            return null;
+        }
+        for (TbIpSurgery info : rst) {
+            getUserInfo(info.getIpdrCode(), val -> {
+                info.setIpdrName(val.getName());
+                info.setIpdrCode(val.getYbCode());
+            });
+            List<TReqSurgicalDiag> diag = dao.getTReqSurgicalDiag(info.getAppyNo());
+            info.setSelvFlag(getSelvFlag(info.getSelvFlag()));
+            info.setOprnType(getOprnType(info.getOprnType()));
+
+            info.setSecurityLevel("000");
+            info.setOrgCode(orgCode);
+            info.setIptMdtrtSn(patNo + "_" + times);
+            info.setPatientId(patNo);
+            info.setOrgBatchNo(orgBatchNo);
+
+            if (!diag.isEmpty()) {
+                Optional<TReqSurgicalDiag> tReqSurgicalDiag = diag
+                        .stream()
+                        .findFirst()
+                        .filter(i -> i.getType() == 1 && i.getSort() == 1);
+                if (tReqSurgicalDiag.isPresent()) {
+                    info.setOprnOprtCode(tReqSurgicalDiag.get().getCode());
+                    info.setOprnOprtName(tReqSurgicalDiag.get().getName());
+                }
+                Optional<TReqSurgicalDiag> firstDiag = diag
+                        .stream()
+                        .findFirst()
+                        .filter(i -> i.getType() == 2 && i.getSort() == 1);
+                if (firstDiag.isPresent()) {
+                    info.setBfpnDiagCode(firstDiag.get().getCode());
+                    info.setBfpnDiagName(firstDiag.get().getName());
+                }
+            }
+
+        }
+        return rst;
+    }
+
+    public List<TbDiagnosisDetail> getTbDiagnosisDetail() {
+        List<TbDiagnosisDetail> rst = dao.getTbDiagnosisDetail(patNo, times);
+        for (TbDiagnosisDetail info : rst) {
+
+            info.setSecurityLevel("000");
+            info.setOrgCode(orgCode);
+            info.setIptMdtrtSn(patNo + "_" + times);
+            info.setPatientId(patNo);
+            info.setOrgBatchNo(orgBatchNo);
+
+            info.setRecordId(patNo + "_" + times + "_" + info.getDiagNo());
+
+            info.setDiagTime(new Date());
+            info.setMainDiagFlag("1".equals(info.getDiagNo()) ? 1 : 2);
+            info.setSuspectDiagFlag(0);
+            getUserInfo(info.getDiagDoctorCode(), (val) -> {
+                info.setOperatorId(info.getDiagDoctorCode());
+                info.setDiagDoctorCode(val.getYbCode());
+                info.setDiagDoctorName(val.getName());
+            });
+
+            info.setInsuranceDiagCode("-");
+            info.setInsuranceDiagName("-");
+            info.setValiFlag(1);
+            info.setUpdateTime(new Date());
+        }
+
+        return rst;
+    }
+
+
+    public TbDischargeSummary getTbDischargeSummary() {
+        EmrPatientData emrData = emrDao.findEmrDataByCode(patNo, times, "chuyuanjilu");
+        if (emrData == null) {
+            return null;
+        }
+        EmrJsonUtils json = emrData.jsonUtils2();
+        TbDischargeSummary info = dao.getTbDischargeSummary(patNo, times);
+        Date birth = DateUtil.parse(patInfoCurrent.getBirthDate(), "yyyy-MM-dd");
+        int age = DateUtil.age(birth, patInfoCurrent.getAdmissDate());
+        info.setAge(String.valueOf(age));
+        long between = DateUtil.between(info.getAdmissionTime(), info.getDischargeTime(), DateUnit.DAY);
+        info.setHospitalizationDays(between);
+        info.setOutpatientDiagnosisCode(patInfoCurrent.getAdmDiagnosisCode());
+        info.setOutpatientDiagnosisName(patInfoCurrent.getAdmDiagnosisName());
+        info.setAdmissionDiagnosisCode(currentAdmissionRecord.getWesternDiagCode());
+        info.setAdmissionDiagnosisName(currentAdmissionRecord.getWesternDiagName());
+        List<CodeName> disDiag = dao.getDisDiag(patNo, times);
+        if (!disDiag.isEmpty()) {
+            StringBuilder code = new StringBuilder();
+            StringBuilder name = new StringBuilder();
+            for (CodeName codeName : disDiag) {
+                code.append(codeName.getCode()).append("|");
+                name.append(codeName.getName()).append("|");
+            }
+            info.setDischargeDiagnosisCode(code.toString());
+            info.setDischargeDiagnosisName(name.toString());
+        }
+        info.setDischargeCondition(json.getStr("出院情况"));
+        info.setDischargeHpText(emrData.getEmrDataElementStr());
+        info.setDischargeOrders(json.getStr("出院医嘱"));
+
+        info.setAttendingDoctorCode(patInfoCurrent.getReferPhysician());
+        info.setAttendingDoctorName(patInfoCurrent.getReferPhysicianName());
+        info.setResidentDoctorCode(patInfoCurrent.getChiefDoctorCode());
+        info.setResidentDoctorName(patInfoCurrent.getChiefDoctorName());
+        info.setOccupationCode(patInfoCurrent.getOccupationCode());
+
+        info.setAnesthesiaCode("9");
+        info.setAnesthesiaName("其他麻醉方法");
+
+        info.setOutcomeCode("9");
+        info.setOutcomeName("其他");
+
+        info.setTcmFlag(0);
+        info.setSurgeryFlag(0);
+
+        info.setArchiveTime(new Date());
+        info.setOperatorId(emrData.getCreateId());
+        info.setSecurityLevel("000");
+        info.setOrgCode(orgCode);
+        info.setIptMdtrtSn(patNo + "_" + times);
+        info.setPatientId(patNo);
+        info.setOrgBatchNo(orgBatchNo);
+
+        return info;
+    }
+
+    public List<TbQualityEmr> getTbQualityEmr() {
+        List<EmrAuditDetail> emrAuditDetail = dao.getEmrAuditDetail(patNo, times, startDate, endDate);
+
+        if (emrAuditDetail.isEmpty()) {
+            return null;
+        }
+
+        List<TbQualityEmr> rst = new ArrayList<>();
+
+        for (EmrAuditDetail item : emrAuditDetail) {
+            TbQualityEmr info = new TbQualityEmr();
+            info.setSecurityLevel("000");
+            info.setOrgCode(orgCode);
+            info.setPatientId(patNo);
+            info.setOrgBatchNo(orgBatchNo);
+
+            info.setQcId(Convert.toStr(item.getId()));
+            info.setRecordId(item.getEmrDocumentId());
+            info.setCardNo(patInfoCurrent.getIdNumber());
+            info.setCardType("4");
+            info.setDeptCode(patInfoCurrent.getDept());
+            info.setDeptName(patInfoCurrent.getDeptName());
+            getUserInfo(item.getDoctor(), (val) -> {
+                info.setDoctorCode(val.getYbCode());
+                info.setDoctorName(val.getName());
+            });
+
+            info.setQcItemname(item.getName());
+            info.setQcItemcode(item.getName());
+            info.setQcTime(item.getReviewTime());
+
+            getUserInfo(item.getApprover(), (val) -> {
+                info.setQcStaffid(val.getYbCode());
+                info.setQcStaffname(val.getName());
+            });
+
+            info.setQcIssuedesc(item.getName() + item.getRemark());
+            info.setRecordScore(item.getMinusPoints().doubleValue());
+            info.setTimeoutFlag(0);
+
+            info.setModifyTime(info.getModifyTime());
+            getUserInfo(item.getModifyPerson(), val -> {
+                info.setModifier(val.getName());
+                info.setQcConfirmer(val.getName());
+            });
+            info.setQcConfirmtime(item.getModificationTime());
+            info.setQcStatus(1);
+
+        }
+
+        return rst;
+    }
+
+    private String getOprnType(String code) {
+        return switch (code) {
+            case "0" -> "5";
+            case "1" -> "4";
+            case null, default -> "1";
+        };
+    }
+
+    private Integer getSelvFlag(Integer code) {
+        return switch (code) {
+            case 0 -> 1;
+            case 1 -> 2;
+            case null, default -> 9;
+        };
+    }
+
+}

+ 28 - 0
thyy-three-one/src/main/resources/application.yml

@@ -0,0 +1,28 @@
+spring:
+  application:
+    name: thyy-three-one
+
+  datasource:
+    dynamic:
+      primary: master
+      strict: false
+      datasource:
+        master:
+          url: "jdbc:sqlserver://172.16.32.168:1433;databaseName=thxyhisdb"
+          username: "sa"
+          password:
+          driver-class-name: "com.microsoft.sqlserver.jdbc.SQLServerDriver"
+        threeone:
+          url: "jdbc:mysql://172.16.32.206:3306/medical_treatment_data"
+          username: "medical_treatment_user"
+          password: "*Thyy@2025#"
+          driver-class-name: com.mysql.cj.jdbc.Driver
+        dcsm:
+          url: "jdbc:mysql://172.16.32.181:3306/lancet-aims"
+          username: "dcsm"
+          password: "dcsm@123"
+          driver-class-name: com.mysql.cj.jdbc.Driver
+
+logging:
+  level:
+    org.thyy.threeone.dao: debug

+ 20 - 0
thyy-utils/src/main/java/org/thyy/utils/DateUtil.java

@@ -0,0 +1,20 @@
+package org.thyy.utils;
+
+import java.time.LocalDate;
+import java.time.temporal.ChronoUnit;
+import java.util.Date;
+
+public class DateUtil extends cn.hutool.core.date.DateUtil {
+    /**
+     * 根据Date对象计算当前月龄
+     *
+     * @param birthDate 生日Date对象
+     * @return 月龄
+     */
+    public static long getAgeInMonths(Date birthDate) {
+        // 将Date转换为LocalDate
+        LocalDate birthLocalDate = DateUtil.toLocalDateTime(birthDate).toLocalDate();
+        LocalDate currentDate = LocalDate.now();
+        return ChronoUnit.MONTHS.between(birthLocalDate, currentDate);
+    }
+}

+ 125 - 0
thyy-utils/src/main/java/org/thyy/utils/SqlGenerator.java

@@ -0,0 +1,125 @@
+package org.thyy.utils;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.List;
+
+public class SqlGenerator {
+
+    /**
+     * 根据实体类生成完整的插入SQL语句,忽略null值字段
+     * 表名和字段名自动从驼峰转换为下划线
+     *
+     * @param entity 实体类对象
+     * @return 生成的完整SQL语句
+     */
+    public static String generateInsertSql(Object entity) {
+        if (entity == null) {
+            throw new IllegalArgumentException("实体对象不能为空");
+        }
+
+        Class<?> clazz = entity.getClass();
+
+        // 从类名获取表名(驼峰转下划线)
+        String tableName = convertCamelToSnake(clazz.getSimpleName());
+        TableName tableNameAnn = entity.getClass().getAnnotation(TableName.class);
+        if (tableNameAnn != null) {
+            tableName = tableNameAnn.value();
+        }
+
+        Field[] fields = clazz.getDeclaredFields();
+        List<String> columnNames = new ArrayList<>();
+        List<String> values = new ArrayList<>();
+
+        try {
+            for (Field field : fields) {
+                field.setAccessible(true);
+                Object value = field.get(entity);
+
+                // 如果字段值为null,则跳过
+                if (value == null) {
+                    continue;
+                }
+
+                TableField annotation = field.getAnnotation(TableField.class);
+                String columnName = convertCamelToSnake(field.getName());
+                if (annotation != null) {
+                    columnName = annotation.value();
+                }
+                // 字段名驼峰转下划线
+
+                columnNames.add(columnName);
+
+                // 根据字段类型处理值
+                String formattedValue = formatValue(value);
+                values.add(formattedValue);
+            }
+        } catch (IllegalAccessException e) {
+            throw new RuntimeException("无法访问实体类字段", e);
+        }
+
+        if (columnNames.isEmpty()) {
+            throw new IllegalArgumentException("实体类中没有非null字段");
+        }
+
+        String columns = String.join(", ", columnNames);
+        String valueList = String.join(", ", values);
+
+        return String.format("INSERT INTO %s (%s) VALUES (%s)", tableName, columns, valueList);
+    }
+
+    /**
+     * 格式化字段值,处理字符串、数字、布尔值等不同类型
+     */
+    private static String formatValue(Object value) {
+        if (value == null) {
+            return "NULL";
+        }
+
+        if (value instanceof String) {
+            return "'" + escapeSql((String) value) + "'";
+        } else if (value instanceof java.util.Date) {
+            return "'" + new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(value) + "'";
+        } else if (value instanceof java.sql.Date) {
+            return "'" + value.toString() + "'";
+        } else if (value instanceof java.sql.Timestamp) {
+            return "'" + new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(value) + "'";
+        } else if (value instanceof Boolean) {
+            return (Boolean) value ? "1" : "0";
+        } else if (value instanceof Character) {
+            return "'" + escapeSql(String.valueOf(value)) + "'";
+        } else if (value instanceof Number) {
+            return value.toString();
+        } else {
+            // 其他类型按字符串处理
+            return "'" + escapeSql(value.toString()) + "'";
+        }
+    }
+
+    /**
+     * SQL字符串转义,防止SQL注入
+     */
+    private static String escapeSql(String str) {
+        if (str == null) {
+            return "";
+        }
+        return str.replace("'", "''");
+    }
+
+    /**
+     * 驼峰命名转换为下划线命名
+     */
+    private static String convertCamelToSnake(String camelCase) {
+        if (camelCase == null || camelCase.isEmpty()) {
+            return camelCase;
+        }
+
+        // 处理连续大写字母的情况
+        String result = camelCase.replaceAll("([A-Z]+)([A-Z][a-z])", "$1_$2")
+                .replaceAll("([a-z])([A-Z])", "$1_$2");
+        return result.toLowerCase();
+    }
+}

+ 355 - 0
thyy-utils/src/main/java/org/thyy/utils/StringUtil.java

@@ -0,0 +1,355 @@
+package org.thyy.utils;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.util.PropertyPlaceholderHelper;
+import org.springframework.util.StringUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @author dj
+ */
+@Slf4j
+public class StringUtil {
+
+    private static final Pattern CHINESE_CHARACTERS = Pattern.compile("[\u4E00-\u9FA5|\\!|\\,|\\。|\\(|\\)|\\《|\\》|\\“|\\”|\\?|\\:|\\;|\\【|\\】]");
+
+    private static final Pattern CARRY_ENGLISH = Pattern.compile(".*\\d+.*");
+
+    public static boolean isBlank(String str) {
+        return null == str || str.trim().isEmpty();
+    }
+
+    public static <T> T nullIf(T t1, T t2) {
+        if (t1 instanceof String) {
+            return isBlank((String) t1) ? t2 : t1;
+        }
+        return null == t1 ? t2 : t1;
+    }
+
+    public static boolean notBlank(String str) {
+        return null != str && !"".equals(str.trim());
+    }
+
+    public static boolean validValue(String str) {
+        return notBlank(str) && !"-".equals(str.trim());
+    }
+
+    public static boolean equalsIgnoreNull(String a, String b) {
+        if (null == a) {
+            a = "";
+        }
+        if (null == b) {
+            b = "";
+        }
+        return a.equals(b);
+    }
+
+    public static boolean invalidValue(String str) {
+        return isBlank(str) || "-".equals(str.trim());
+    }
+
+    public static boolean invalidBirthPlace(String str) {
+        return isBlank(str) || str.trim().length() < 6;
+    }
+
+    public static String[] triageDeptString2Array(String deptCodes) {
+        return null == deptCodes ? new String[]{} : deptCodes.substring(1, deptCodes.length() - 1).replaceAll("\"", "").split(",");
+    }
+
+    public static String desensitizeName(String name) {
+        if (isBlank(name) || name.length() == 1) {
+            return name;
+        }
+        if (!name.contains(" ")) {
+            return executeDesensitize(name);
+        }
+        String[] arr = name.split(" ");
+        StringBuilder result = new StringBuilder();
+        for (String part : arr) {
+            result.append(" ").append(executeDesensitize(part));
+        }
+        return result.substring(1);
+    }
+
+    private static String executeDesensitize(String str) {
+        if (str.length() == 2) {
+            return str.charAt(0) + "*";
+        }
+        StringBuilder builder = new StringBuilder();
+        builder.append(str.charAt(0));
+        for (int i = 1; i < str.length() - 1; i++) {
+            if (str.charAt(i) == ' ') {
+                builder.append(" ");
+            } else {
+                builder.append("*");
+            }
+        }
+        builder.append(str.charAt(str.length() - 1));
+        return builder.toString();
+    }
+
+    /**
+     * 把原始字符串分割成指定长度的字符串列表
+     *
+     * @param inputString 原始字符串
+     * @param length      指定长度
+     * @return 。。
+     */
+    public static List<String> getStringList(String inputString, int length) {
+        int size = inputString.length() / length;
+        if (inputString.length() % length != 0) {
+            size += 1;
+        }
+        return getStrList(inputString, length, size);
+    }
+
+    /**
+     * 把原始字符串分割成指定长度的字符串列表
+     *
+     * @param inputString 原始字符串
+     * @param length      指定长度
+     * @param size        指定列表大小
+     * @return ..
+     */
+    public static List<String> getStrList(String inputString, int length, int size) {
+        List<String> list = new ArrayList<>();
+        for (int i = 0; i < size; i++) {
+            String childStr = substring(inputString, i * length, (i + 1) * length);
+            list.add(childStr);
+        }
+        return list;
+    }
+
+    /**
+     * @param str 需要判断的字符串
+     * @return 返回 到底要不要 toUpperCase
+     */
+    public static String isContainChinese(String str) {
+        if (isBlank(str)) {
+            return "%";
+        }
+        str = str.trim();
+        if (isChinese(str)) {
+            return "%" + str + "%";
+        }
+
+        Matcher m1 = CARRY_ENGLISH.matcher(str);
+        if (m1.matches()) {
+            return "%" + str + "%";
+        }
+        return "%" + str.toUpperCase() + "%";
+    }
+
+    /**
+     * 判断是否是中文
+     *
+     * @param str 字符串
+     * @return 提示
+     */
+    public static boolean isChinese(String str) {
+        if (isBlank(str)) {
+            return false;
+        }
+        str = str.trim();
+        Matcher m = CHINESE_CHARACTERS.matcher(str);
+
+        return m.find();
+    }
+
+    public static String englishToCapital(String str) {
+        if (isBlank(str)) {
+            return "";
+        }
+        Matcher m = CHINESE_CHARACTERS.matcher(str);
+        if (m.find()) {
+            return str;
+        }
+        return str.toUpperCase();
+    }
+
+    /**
+     * 驼峰转下划线
+     *
+     * @param str 数据
+     * @return 返回数据
+     */
+    public static String humpToUnderline(String str) {
+        String regex = "([A-Z])";
+        Matcher matcher = Pattern.compile(regex).matcher(str);
+        while (matcher.find()) {
+            String target = matcher.group();
+            str = str.replaceAll(target, "_" + target.toLowerCase());
+        }
+        return str;
+    }
+
+    private static final Pattern linePattern = Pattern.compile("_(\\w)");
+
+
+    public static String lineToHump(String str) {
+        str = str.toLowerCase();
+        Matcher matcher = linePattern.matcher(str);
+        StringBuffer sb = new StringBuffer();
+        while (matcher.find()) {
+            matcher.appendReplacement(sb, matcher.group(1).toUpperCase());
+        }
+        matcher.appendTail(sb);
+        return sb.toString();
+    }
+
+
+    /**
+     * 分割字符串,如果开始位置大于字符串长度,返回空
+     *
+     * @param str 原始字符串
+     * @param f   开始位置
+     * @param t   结束位置
+     * @return 。。
+     */
+    public static String substring(String str, int f, int t) {
+        if (f > str.length()) {
+            return null;
+        }
+        if (t > str.length()) {
+            return str;
+        } else {
+            return str.substring(f, t);
+        }
+    }
+
+    /**
+     * 字符串相似度算法
+     */
+    public static double getSimilarDegree(String source, String target) {
+        Map<Character, int[]> vector = new HashMap<>();
+        int[] charCountArray;
+        for (char sourceChar : source.toCharArray()) {
+            if (vector.containsKey(sourceChar)) {
+                vector.get(sourceChar)[0]++;
+            } else {
+                charCountArray = new int[2];
+                charCountArray[0] = 1;
+                vector.put(sourceChar, charCountArray);
+            }
+        }
+        for (char targetChar : target.toCharArray()) {
+            if (vector.containsKey(targetChar)) {
+                vector.get(targetChar)[1]++;
+            } else {
+                charCountArray = new int[2];
+                charCountArray[1] = 1;
+                vector.put(targetChar, charCountArray);
+            }
+        }
+        double v1Modulo = 0d;
+        double v2Modulo = 0d;
+        double vProduct = 0d;
+        for (Map.Entry<Character, int[]> entry : vector.entrySet()) {
+            int[] tempArray = entry.getValue();
+            v1Modulo += tempArray[0] * tempArray[0];
+            v2Modulo += tempArray[1] * tempArray[1];
+            vProduct += tempArray[0] * tempArray[1];
+        }
+        v1Modulo = Math.sqrt(v1Modulo);
+        v2Modulo = Math.sqrt(v2Modulo);
+        return vProduct / (v1Modulo * v2Modulo);
+    }
+
+    public static String stringArrayToCharacter(String[] lytype) {
+        if (lytype == null) {
+            return null;
+        }
+        StringBuilder sb = new StringBuilder();
+        if (lytype.length > 0) {
+            for (int i = 0; i < lytype.length; i++) {
+                if (i < lytype.length - 1) {
+                    sb.append(lytype[i]).append(",");
+                } else {
+                    sb.append(lytype[i]);
+                }
+            }
+        }
+        return sb.toString();
+    }
+
+
+    public static String replaceElementValue(String str, Map<String, String> map) {
+        if (!StringUtils.hasText(str)) {
+            return str;
+        }
+        //定义${开头 ,}结尾的占位符
+        PropertyPlaceholderHelper propertyPlaceholderHelper = new PropertyPlaceholderHelper("${", "}");
+        //调用替换
+        return propertyPlaceholderHelper.replacePlaceholders(str, map::get);
+    }
+
+    /**
+     * 首字母大写(进行字母的ascii编码前移,效率是最高的)
+     *
+     * @param fieldName 需要转化的字符串
+     */
+    public static String capitalizeTheFirstLetter(String fieldName) {
+        char[] chars = fieldName.toCharArray();
+        chars[0] = toUpperCase(chars[0]);
+        return String.valueOf(chars);
+    }
+
+    public static String getMethodName(String fieldName) {
+        return "get" + capitalizeTheFirstLetter(fieldName);
+    }
+
+    public static String setMethodName(String fieldName) {
+        return "set" + capitalizeTheFirstLetter(fieldName);
+    }
+
+    /**
+     * 字符转成大写
+     *
+     * @param c 需要转化的字符
+     */
+    public static char toUpperCase(char c) {
+        if (97 <= c && c <= 122) {
+            c ^= 32;
+        }
+        return c;
+    }
+
+    public static boolean isEmpty(String[] string) {
+        return string == null || string.length == 0;
+    }
+
+    public static boolean isEmpty(String string) {
+        return string == null || string.trim().isEmpty() || "null".equals(string.trim());
+    }
+
+    public static boolean isNotEmpty(String string) {
+        return !isEmpty(string);
+    }
+
+    public static boolean isEmpty(Object o) {
+        return o == null || "".equals(o);
+    }
+
+    public static String trim(String str) {
+        return str == null ? null : str.trim();
+    }
+
+    public static String truncateString(String input, int length) {
+        if (input == null) {
+            return null;
+        }
+        // 直接按字符数截取,适用于中英文混合
+        if (input.length() > length) {
+            return input.substring(0, length);
+        }
+        return input;
+    }
+
+}
+

+ 13 - 0
thyy-utils/src/main/java/org/thyy/utils/emr/EmrContrast.java

@@ -0,0 +1,13 @@
+package org.thyy.utils.emr;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ElementType.FIELD, ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface EmrContrast {
+
+    String[] value() default "";
+}

+ 271 - 0
thyy-utils/src/main/java/org/thyy/utils/emr/EmrJsonUtils.java

@@ -0,0 +1,271 @@
+package org.thyy.utils.emr;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ReflectUtil;
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import lombok.Getter;
+import org.thyy.utils.StringUtil;
+import org.thyy.utils.entity.CodeName;
+
+import java.lang.reflect.Field;
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.function.Consumer;
+import java.util.function.Supplier;
+
+public class EmrJsonUtils {
+
+    private final String VALUE = ".value";
+
+
+    public static enum TypeEnum {
+        JSONObject,
+        JSONArray,
+        String
+    }
+
+    @Getter
+    private JSONObject json;
+
+    public static EmrJsonUtils create(String value) {
+        return new EmrJsonUtils(value);
+    }
+
+    public EmrJsonUtils(String value) {
+        json = JSONUtil.parseObj(value);
+    }
+
+    public boolean isEmpty() {
+        return json.isEmpty();
+    }
+
+    private <T> T tryValue(Supplier<T> supplier, T defaultValue) {
+        try {
+            return supplier.get();
+        } catch (Exception ignore) {
+            return defaultValue;
+        }
+    }
+
+    private <T> T tryValue(Supplier<T> supplier) {
+        try {
+            return supplier.get();
+        } catch (Exception ignore) {
+            return null;
+        }
+    }
+
+    /**
+     * <pre>{
+     *     "value": "暂缺。",
+     *     "id": "k56CUd_u1PmL",
+     *     "format": null,
+     *  }
+     * </pre>
+     *
+     * @param key 业务编码
+     * @return 返回 value
+     */
+    public String getStr(String key) {
+        return getStr(key, "");
+    }
+
+    public String getStr(String key, String defaultValue) {
+        return tryValue(() -> {
+            Object byPath = json.getByPath(key + VALUE, Object.class);
+            if (byPath instanceof String) {
+                return (String) byPath;
+            }
+
+            if (byPath instanceof JSONArray) {
+                return ((JSONArray) byPath).getJSONObject(0).getStr("name");
+            }
+            return "";
+        }, defaultValue);
+    }
+
+    public Date getDate(String key) {
+        return tryValue(() -> DateUtil.parse(getStr(key)), null);
+    }
+
+    /**
+     * 解析下面的数据格式
+     *
+     * <pre> {
+     *     "value": [
+     *         {
+     *             "code": "01",
+     *             "name": "未见蠕动波"
+     *         }
+     *     ],
+     *     "id": "P5nWuuGSLVOL",
+     *     "format": null,
+     * }
+     *
+     * </pre>
+     *
+     * @param key 业务编码
+     * @return 返回 List<CodeName>
+     */
+    public List<CodeName> getArr(String key) {
+        return tryValue(() -> json.getByPath(key + VALUE, JSONArray.class).toList(CodeName.class));
+    }
+
+    public void getArr(String key, Consumer<List<CodeName>> predicate) {
+        List<CodeName> list = tryValue(() -> json.getByPath(key + VALUE, JSONArray.class).toList(CodeName.class));
+        predicate.accept(list);
+    }
+
+    /**
+     * 获取数组对象的第一个数据,解析上面的数据格式
+     *
+     * @param key 业务编码
+     * @return CodeName
+     */
+    public CodeName getFirstArr(String key) {
+        List<CodeName> arr = getArr(key);
+        if (arr != null) {
+            return arr.getFirst();
+        }
+        return null;
+    }
+
+    public String getFirstArrCode(String key) {
+        AtomicReference<String> code = new AtomicReference<>("");
+        getFirstArr(key, (val) -> {
+            code.set(val.getCode());
+        });
+        return code.get();
+    }
+
+
+    public void getFirstArr(String key, Consumer<CodeName> predicate) {
+        CodeName firstArr = getFirstArr(key);
+        if (firstArr != null) {
+            predicate.accept(firstArr);
+        }
+    }
+
+
+    /**
+     * 如果一个数据源在一份病历中有多个的话就会是一个数组
+     * <pre>
+     * {"key" : [{"value": null}, {"value": "2025-09-18 00:00:00"}]}
+     * </pre>
+     *
+     * @param key   编码
+     * @param index 要第几个
+     * @return str
+     */
+    public String getKeyArrStrValue(String key, int index) {
+        return tryValue(() -> json.getByPath(key + "[" + index + "]" + VALUE, String.class));
+    }
+
+
+    /**
+     * <pre>
+     *
+     * "补充诊断": [
+     *         {
+     *             "value": [
+     *                 {
+     *                     "code": "A00.100x001",
+     *                     "name": "埃尔托生物型霍乱"
+     *                 }
+     *             ]
+     *         },
+     *         {
+     *             "value": null
+     *         },
+     *         {
+     *             "value": null
+     *         },
+     *         {
+     *             "value": null
+     *         }
+     *     ]
+     * </pre>
+     */
+    public List<CodeName> getKeyArrValue(String key, Integer index) {
+        return tryValue(() -> json.getByPath(key + "[" + index + "]" + VALUE, JSONArray.class).toList(CodeName.class));
+    }
+
+    public void getKeyArrValue(String key, Integer index, Consumer<List<CodeName>> consumer) {
+        List<CodeName> value = getKeyArrValue(key, index);
+        if (value != null) {
+            consumer.accept(value);
+        }
+    }
+
+
+    public TypeEnum getType(String key) {
+        Object obj = json.getObj(key);
+        if (obj instanceof JSONObject) {
+            return TypeEnum.JSONObject;
+        }
+
+        if (obj instanceof JSONArray) {
+            return TypeEnum.JSONArray;
+        }
+        return null;
+    }
+
+    /**
+     * 获取 json 的value类型
+     *
+     * @param key 业务编码
+     * @return 数据
+     */
+    public TypeEnum getValueType(String key) {
+        Object obj = json.getByPath(key + VALUE, Object.class);
+        if (obj instanceof String) {
+            return TypeEnum.String;
+        }
+
+        if (obj instanceof JSONArray) {
+            return TypeEnum.JSONArray;
+        }
+        if (obj instanceof JSONObject) {
+            return TypeEnum.JSONObject;
+        }
+        return null;
+    }
+
+
+    public void setObjectByEmrBusiness(Object clazz) {
+        if (json.isEmpty()) {
+            return;
+        }
+        for (Field field : clazz.getClass().getDeclaredFields()) {
+            EmrContrast annotation = field.getAnnotation(EmrContrast.class);
+            if (annotation != null) {
+                String value = parseData(annotation.value());
+                ReflectUtil.invoke(clazz, StringUtil.setMethodName(field.getName()), value);
+            }
+        }
+    }
+
+    private String parseData(String[] key) {
+        StringBuilder sb = new StringBuilder();
+        for (String s : key) {
+            TypeEnum type = getValueType(s);
+            if (type == null) {
+                continue;
+            }
+            if (type == TypeEnum.String) {
+                sb.append(getStr(s));
+            }
+            if (type == TypeEnum.JSONArray) {
+                getFirstArr(s, (val) -> {
+                    sb.append(val.getName());
+                });
+            }
+        }
+        return sb.toString();
+    }
+
+
+}

+ 9 - 0
thyy-utils/src/main/java/org/thyy/utils/entity/CodeName.java

@@ -0,0 +1,9 @@
+package org.thyy.utils.entity;
+
+import lombok.Data;
+
+@Data
+public class CodeName {
+    private String code;
+    private String name;
+}