Forráskód Böngészése

病案首页可编辑接口新增

wangsy 8 hónapja
szülő
commit
dd41cb39f9

+ 28 - 54
pom.xml

@@ -204,62 +204,36 @@
         </dependency>
     </dependencies>
 
-   
+
     <build>
         <plugins>
-			<plugin>
-				<artifactId>maven-dependency-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>copy</id>
-						<phase>package</phase>
-						<goals>
-							<goal>copy-dependencies</goal>
-						</goals>
-						<configuration>
-							<outputDirectory>${project.build.directory}/lib</outputDirectory>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-			<plugin>
-				<artifactId>maven-resources-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>copy-resources</id>
-						<phase>package</phase>
-						<goals>
-							<goal>copy-resources</goal>
-						</goals>
-						<configuration>
-							<resources>
-								<resource>
-									<directory>src/main/resources</directory>
-								</resource>
-							</resources>
-							<outputDirectory>${project.build.directory}/resources</outputDirectory>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-			<plugin>
-				<artifactId>maven-jar-plugin</artifactId>
-				<configuration>
-					<excludes>
-						<exclude>*.**</exclude>
-					</excludes>
-					<archive>
-						<manifest>
-							<mainClass>${main-class}</mainClass>
-							<addClasspath>true</addClasspath>
-							<classpathPrefix>lib/</classpathPrefix>
-							<useUniqueVersions>false</useUniqueVersions>
-						</manifest>
-					</archive>
-					<outputDirectory>${project.build.directory}</outputDirectory>
-				</configuration>
-			</plugin>
-		</plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+            <!-- 添加docker-maven插件 -->
+            <plugin>
+                <groupId>com.spotify</groupId>
+                <artifactId>docker-maven-plugin</artifactId>
+                <version>1.1.1</version>
+                <configuration>
+                    <imageName>${docker.image.prefix}/${project.artifactId}:${project.version}</imageName>
+                    <forceTags>true</forceTags>
+                    <!--镜像的FROM,使用压缩的小镜像-->
+                    <baseImage>frolvlad/alpine-oraclejre8:slim</baseImage>
+                    <entryPoint>["java", "-jar", "-Xms256m", "-Xmx1024m", "-Duser.timezone=GMT+8", "/${project.build.finalName}.jar"]</entryPoint>
+                    <resources>
+                        <resource>
+                            <targetPath>/</targetPath>
+                            <directory>${project.build.directory}</directory>
+                            <include>${project.build.finalName}.jar</include>
+                        </resource>
+                    </resources>
+                    <serverId>docker-registry</serverId>
+                    <registryUrl>${registryUrl}</registryUrl>
+                </configuration>
+            </plugin>
+        </plugins>
     </build>
 
 </project>

+ 1 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -163,6 +163,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/data/sendPatientInfo").permitAll()
                 .antMatchers("/qc/data/sendDoctorAdvice").permitAll()
                 .antMatchers("/qc/data/sendHomePageIng").permitAll()
+                .antMatchers("/qc/data/executeHomePageIng").permitAll()
                 .antMatchers("/qc/data/sendHomePage").permitAll()
                 .antMatchers("/qc/data/sendHomeDiagnose").permitAll()
                 .antMatchers("/qc/data/sendHomeOperation").permitAll()

+ 1 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -236,6 +236,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/data/sendPatientInfo", request)
                 || matchers("/qc/data/sendDoctorAdvice", request)
                 || matchers("/qc/data/sendHomePageIng", request)
+                || matchers("/qc/data/executeHomePageIng", request)
                 || matchers("/qc/data/sendHomePage", request)
                 || matchers("/qc/data/sendHomeDiagnose", request)
                 || matchers("/qc/data/sendHomeOperation", request)

+ 10 - 0
src/main/java/com/diagbot/facade/data/AHomeDiagnoseInfoFacade.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.data.AHomeDiagnoseDTO;
 import com.diagbot.entity.HomeDiagnoseInfo;
+import com.diagbot.entity.HomePage;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.HomeDiagnoseInfoServiceImpl;
 import com.diagbot.util.BeanUtil;
@@ -31,6 +32,8 @@ public class AHomeDiagnoseInfoFacade extends HomeDiagnoseInfoServiceImpl{
     private HomeDiagnoseInfoServiceImpl homeDiagnoseInfoService;
     @Autowired
     private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Autowired
+    private AHomePageFacade aHomePageFacade;
     @Value("${log_switch.enable}")
     private boolean logSwitch;
 
@@ -56,6 +59,13 @@ public class AHomeDiagnoseInfoFacade extends HomeDiagnoseInfoServiceImpl{
         try{
             if(list!=null && list.size()>0){
                 List<HomeDiagnoseInfo> homeDiagnoseList=Lists.newArrayList();
+                list.forEach(s->{
+                    HomePage homePage = aHomePageFacade.getOne(new QueryWrapper<HomePage>()
+                            .eq("behospital_code", s.getBehospitalCode()), false);
+                    if(homePage != null){
+                        s.setHomePageId(homePage.getHomePageId());
+                    }
+                });
                 homeDiagnoseList=BeanUtil.listCopyTo(list,HomeDiagnoseInfo.class);
                 execute(homeDiagnoseList);
                 if(logSwitch){

+ 9 - 0
src/main/java/com/diagbot/facade/data/AHomeOperationInfoFacade.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.data.AHomeOperationDTO;
 import com.diagbot.entity.HomeOperationInfo;
+import com.diagbot.entity.HomePage;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.HomeOperationInfoServiceImpl;
 import com.diagbot.util.BeanUtil;
@@ -31,6 +32,8 @@ public class AHomeOperationInfoFacade extends HomeOperationInfoServiceImpl{
     private HomeOperationInfoServiceImpl homeOperationInfoService;
     @Autowired
     private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
+    @Autowired
+    private AHomePageFacade aHomePageFacade;
     @Value("${log_switch.enable}")
     private boolean logSwitch;
 
@@ -59,6 +62,12 @@ public class AHomeOperationInfoFacade extends HomeOperationInfoServiceImpl{
             if(list!=null && list.size()>0){
                 list.stream().forEach(s->{
                     HomeOperationInfo homeOperationInfo=new HomeOperationInfo();
+                    String behospitalCode=s.getBehospitalCode();
+                    HomePage homePage = aHomePageFacade.getOne(new QueryWrapper<HomePage>()
+                            .eq("behospital_code", behospitalCode), false);
+                    if(homePage!=null){
+                        s.setHomePageId(homePage.getHomePageId());
+                    }
                     BeanUtil.copyProperties(s,homeOperationInfo);
                     homeOperationInfo.setOperationDate(DateUtil.parseDateTime(s.getOperationDate()));
                     homeOperationList.add(homeOperationInfo);

+ 349 - 1
src/main/java/com/diagbot/facade/data/AHomePageFacade.java

@@ -123,6 +123,63 @@ public class AHomePageFacade extends HomePageServiceImpl{
         }
     }
 
+    /**
+     * 病案首页编辑功能
+     *
+     * @param aHomePageIngVO
+     * @return
+     */
+    public RespDTO<Map<String, Object>> executeHomePageEdit(AHomePageIngVO aHomePageIngVO) {
+        if (aHomePageIngVO.getHomePages() != null && aHomePageIngVO.getHomePages().size() > 0) {
+            //验证数据有效性
+            for (AHomePageVO aHomePageVO : aHomePageIngVO.getHomePages()) {
+                /*if("".equals(aHomePageVO.getHomePageId())) {
+                    return RespDTO.onError("请输入病案首页编号!");
+                }else */
+                if (aHomePageVO.getHospitalId() == null) {
+                    return RespDTO.onError("请输入医院编码!");
+                } else if ("".equals(aHomePageVO.getBehospitalCode())) {
+                    return RespDTO.onError("请输入病人住院编码!");
+                }
+                //出院诊断
+                if (aHomePageVO.getLeaveDiags() != null && aHomePageVO.getLeaveDiags().size() > 0) {
+                    for (AHomeDiagnoseVO aHomeDiagnoseVO : aHomePageVO.getLeaveDiags()) {
+                        /*if("".equals(aHomeDiagnoseVO.getHomePageId())) {
+                            return RespDTO.onError("出院诊断未输入病案首页编号!");
+                        }else*/
+                        if (aHomeDiagnoseVO.getHospitalId() == null) {
+                            return RespDTO.onError("出院诊断未输入医院编码!");
+                        } else if ("".equals(aHomeDiagnoseVO.getDiagnoseOrderNo())) {
+                            return RespDTO.onError("出院诊断未输入顺序号!");
+                        }
+                    }
+                }
+                ;
+
+                //住院手术
+                if (aHomePageVO.getOperations() != null && aHomePageVO.getOperations().size() > 0) {
+                    for (AHomeOperationVO aHomeOperationVO : aHomePageVO.getOperations()) {
+                       /* if("".equals(aHomeOperationVO.getHomePageId())) {
+                            return RespDTO.onError("住院手术未输入病案首页编号!");
+                        }else*/
+                        if (aHomeOperationVO.getHospitalId() == null) {
+                            return RespDTO.onError("住院手术未输入医院编码!");
+                        } else if ("".equals(aHomeOperationVO.getOperationOrderNo())) {
+                            return RespDTO.onError("住院手术未输入顺序号!");
+                        }
+                    }
+                }
+            }
+
+            //装载数据
+            updateHomePageEdit(aHomePageIngVO);
+            //评分后返回结构体
+            return homePageIng(aHomePageIngVO);
+        } else {
+            return RespDTO.onError("未接收到数据!");
+        }
+    }
+
     /**
      * 更新数据到数据库
      * @param aHomePageIngVO
@@ -148,6 +205,297 @@ public class AHomePageFacade extends HomePageServiceImpl{
         }
     }
 
+    /**
+     * 编辑功能更新数据到数据库
+     *
+     * @param aHomePageIngVO
+     */
+    private void updateHomePageEdit(AHomePageIngVO aHomePageIngVO) {
+        try {
+            List<HomePage> homePageList = Lists.newArrayList();
+            aHomePageIngVO.getHomePages().stream().forEach(s -> {
+                HomePage homePage1 = this.getOne(new QueryWrapper<HomePage>()
+                        .eq("behospital_code", s.getBehospitalCode()), false);
+                if (homePage1 != null) {
+                    s.setHomePageId(homePage1.getHomePageId());
+                }
+                //初始化入参
+                HomePage homePage = new HomePage();
+                BeanUtil.copyProperties(s, homePage);
+//                homePage.setBirthday(DateUtil.parseDate(s.getBirthday()));
+                if (StringUtil.isNotEmpty(s.getBirthday())) {
+                    homePage.setBirthday(DateUtil.parseDate(s.getBirthday()));
+                }
+                if (StringUtil.isNotEmpty(s.getBehospitalDate())) {
+                    homePage.setBehospitalDate(DateUtil.parseDateTime(s.getBehospitalDate()));
+                }
+                if (StringUtil.isNotEmpty(s.getLeaveHospitalDate())) {
+                    homePage.setLeaveHospitalDate(DateUtil.parseDateTime(s.getLeaveHospitalDate()));
+                }
+                if (StringUtil.isNotEmpty(s.getQcDate())) {
+                    homePage.setQcDate(DateUtil.parseDateTime(s.getQcDate()));
+                }
+                // 拆分年龄
+                if (StringUtil.isNotEmpty(s.getAgeType())) {
+                    List<String> ageTypeList = SplitUtil.splitAge(s.getAgeType());
+                    for (String ageType : ageTypeList) {
+                        String[] ageTypeArr = ageType.split(",");
+                        if (ageTypeArr.length != 2) continue;
+                        homePage.setAge(ageTypeArr[0]);
+                        homePage.setAgeUnit(ageTypeArr[1]);
+                    }
+                }
+
+                // 拆分新生儿年龄
+                if (StringUtil.isNotBlank(s.getNewbornAgeUnit())) {
+                    homePage.setNewbornMonth(s.getNewbornAgeUnit().replace("月", ""));
+//                    List<String> newbornAgeUnitList = SplitUtil.splitAge(s.getNewbornAgeUnit());
+//                    for (String newbornAgeUnit : newbornAgeUnitList) {
+//                        String[] newbornAgeUnitArr = newbornAgeUnit.split(",");
+//                        if (newbornAgeUnitArr.length != 2) continue;
+//                        if (newbornAgeUnitArr[1].equals("月")) {
+//                            homePage.setNewbornMonth(newbornAgeUnitArr[0]);
+//                        } else if (newbornAgeUnitArr[1].equals("天")) {
+//                            homePage.setNewbornDay(newbornAgeUnitArr[0]);
+//                        }
+//                    }
+                }
+
+                // 拆分新生儿出生体重
+                if (StringUtil.isNotBlank(s.getNewbornWeightUnit())) {
+                    List<String> newbornWeightUnitList = SplitUtil.splitWeight(s.getNewbornWeightUnit());
+                    for (String newbornWeightUnit : newbornWeightUnitList) {
+                        String[] newbornWeightUnitArr = newbornWeightUnit.split(",");
+                        if (newbornWeightUnitArr.length != 2) continue;
+                        homePage.setNewbornWeight(newbornWeightUnitArr[0]);
+                    }
+                }
+
+                // 拆分新生儿入院体重
+                if (StringUtil.isNotBlank(s.getNewbornBehospitalWeightUnit())) {
+                    List<String> newbornBehospitalWeightUnitList = SplitUtil.splitWeight(s.getNewbornBehospitalWeightUnit());
+                    for (String newbornBehospitalWeightUnit : newbornBehospitalWeightUnitList) {
+                        String[] newbornBehospitalWeightUnitArr = newbornBehospitalWeightUnit.split(",");
+                        if (newbornBehospitalWeightUnitArr.length != 2) continue;
+                        homePage.setNewbornBehospitalWeight(newbornBehospitalWeightUnitArr[0]);
+                    }
+                }
+
+                // 拆分总费用
+                if (StringUtil.isNotBlank(s.getBehospitalFee())) {
+                    List<String> behospitalFeeList = SplitUtil.splitTotalFees(s.getBehospitalFee());
+                    for (String fee : behospitalFeeList) {
+                        String[] feeArr = fee.split(",");
+                        if (feeArr.length != 2) continue;
+                        if (feeArr[0].equals("总费用")) {
+                            homePage.setTotalFee(feeArr[1]);
+                        } else if (feeArr[0].equals("自付金额")) {
+                            homePage.setOwnFee(feeArr[1]);
+                        }
+                    }
+                }
+
+                // 拆分综合医疗服务类
+                if (StringUtil.isNotBlank(s.getGeneralMedicalFee())) {
+                    List<String> generalMedicalFeeList = SplitUtil.splitFees(s.getGeneralMedicalFee());
+                    for (String fee : generalMedicalFeeList) {
+                        String[] feeArr = fee.split(",");
+                        if (feeArr.length != 2) continue;
+                        if (feeArr[0].equals("一般医疗服务费")) {
+                            homePage.setGeneralFee(feeArr[1]);
+                        } else if (feeArr[0].equals("一般治疗服务费")) {
+                            homePage.setServiceFee(feeArr[1]);
+                        } else if (feeArr[0].equals("护理费")) {
+                            homePage.setNurseFee(feeArr[1]);
+                        } else if (feeArr[0].equals("其他费用")) {
+                            homePage.setOtherFee(feeArr[1]);
+                        }
+                    }
+                }
+
+                // 拆分诊断类
+                if (StringUtil.isNotBlank(s.getDiagnoseTypeFee())) {
+                    List<String> diagnoseTypeFeeList = SplitUtil.splitFees(s.getDiagnoseTypeFee());
+                    for (String diagnoseTypeFee : diagnoseTypeFeeList) {
+                        String[] diagnoseTypeFeeArr = diagnoseTypeFee.split(",");
+                        if (diagnoseTypeFeeArr.length != 2) continue;
+                        if (diagnoseTypeFeeArr[0].equals("病理诊断费")) {
+                            homePage.setPathologyFee(diagnoseTypeFeeArr[1]);
+                        } else if (diagnoseTypeFeeArr[0].equals("实验室诊断费")) {
+                            homePage.setLabFee(diagnoseTypeFeeArr[1]);
+                        } else if (diagnoseTypeFeeArr[0].equals("影像学诊断费")) {
+                            homePage.setPacsFee(diagnoseTypeFeeArr[1]);
+                        } else if (diagnoseTypeFeeArr[0].equals("临床诊断项目费")) {
+                            homePage.setClinicDiagnoseFee(diagnoseTypeFeeArr[1]);
+                        }
+                    }
+                }
+
+                // 拆分治疗类
+                if (StringUtil.isNotBlank(s.getTreatFee())) {
+                    List<String> treatFeeList = SplitUtil.splitFees(s.getTreatFee());
+                    for (String treatFee : treatFeeList) {
+                        String[] treatFeeArr = treatFee.split(",");
+                        if (treatFeeArr.length != 2) continue;
+                        if (treatFeeArr[0].equals("非手术治疗项目费")) {
+                            homePage.setNotOperationFee(treatFeeArr[1]);
+                        } else if (treatFeeArr[0].equals("临床物理治疗费")) {
+                            homePage.setClinicPhysicFee(treatFeeArr[1]);
+                        } else if (treatFeeArr[0].equals("手术治疗费")) {
+                            homePage.setOperationTreatFee(treatFeeArr[1]);
+                        } else if (treatFeeArr[0].equals("麻醉费")) {
+                            homePage.setAnaesthesiaFee(treatFeeArr[1]);
+                        } else if (treatFeeArr[0].equals("手术费")) {
+                            homePage.setOperationFee(treatFeeArr[1]);
+                        }
+                    }
+                }
+
+                // 拆分康复类
+                if (StringUtil.isNotBlank(s.getHealthFee())) {
+                    List<String> healthFeeList = SplitUtil.splitFees(s.getHealthFee());
+                    for (String healthFee : healthFeeList) {
+                        String[] healthFeeArr = healthFee.split(",");
+                        if (healthFeeArr.length != 2) continue;
+                        if (healthFeeArr[0].equals("康复费")) {
+                            homePage.setHealthTypeFee(healthFeeArr[1]);
+                        }
+                    }
+                }
+
+                // 拆分中医类
+                if (StringUtil.isNotBlank(s.getChnFee())) {
+                    List<String> chnFeeList = SplitUtil.splitFees(s.getChnFee());
+                    for (String chnFee : chnFeeList) {
+                        String[] chnFeeArr = chnFee.split(",");
+                        if (chnFeeArr.length != 2) continue;
+                        if (chnFeeArr[0].equals("中医治疗费")) {
+                            homePage.setChnTreatFee(chnFeeArr[1]);
+                        }
+                    }
+                }
+
+                // 拆分西药类
+                if (StringUtil.isNotBlank(s.getWesternFee())) {
+                    List<String> westernFeeList = SplitUtil.splitFees(s.getWesternFee());
+                    for (String westernFee : westernFeeList) {
+                        String[] westernFeeArr = westernFee.split(",");
+                        if (westernFeeArr.length != 2) continue;
+                        if (westernFeeArr[0].equals("西药费")) {
+                            homePage.setWesternMedFee(westernFeeArr[1]);
+                        } else if (westernFeeArr[0].equals("抗菌药物费用")) {
+                            homePage.setAntibiosisFee(westernFeeArr[1]);
+                        }
+                    }
+                }
+
+                // 拆分中药类
+                if (StringUtil.isNotBlank(s.getChnMedicineFee())) {
+                    List<String> chnMedicineFeeList = SplitUtil.splitFees(s.getChnMedicineFee());
+                    for (String chnMedicineFee : chnMedicineFeeList) {
+                        String[] chnMedicineFeeArr = chnMedicineFee.split(",");
+                        if (chnMedicineFeeArr.length != 2) continue;
+                        if (chnMedicineFeeArr[0].equals("中成药费")) {
+                            homePage.setChnMedFee(chnMedicineFeeArr[1]);
+                        } else if (chnMedicineFeeArr[0].equals("中草药费")) {
+                            homePage.setChnHerbFee(chnMedicineFeeArr[1]);
+                        }
+                    }
+                }
+
+                // 拆分血液类
+                if (StringUtil.isNotBlank(s.getBloodTypeFee())) {
+                    List<String> bloodTypeFeeList = SplitUtil.splitFees(s.getBloodTypeFee());
+                    for (String bloodTypeFee : bloodTypeFeeList) {
+                        String[] bloodTypeFeeArr = bloodTypeFee.split(",");
+                        if (bloodTypeFeeArr.length != 2) continue;
+                        if (bloodTypeFeeArr[0].equals("血费")) {
+                            homePage.setBloodFee(bloodTypeFeeArr[1]);
+                        } else if (bloodTypeFeeArr[0].equals("白蛋白类制品费")) {
+                            homePage.setAlbumenFee(bloodTypeFeeArr[1]);
+                        } else if (bloodTypeFeeArr[0].equals("球蛋白类制品费")) {
+                            homePage.setGlobulinFee(bloodTypeFeeArr[1]);
+                        } else if (bloodTypeFeeArr[0].equals("凝血因子类制品费")) {
+                            homePage.setBloodFactorFee(bloodTypeFeeArr[1]);
+                        } else if (bloodTypeFeeArr[0].equals("细胞因子类制品费")) {
+                            homePage.setCellFactorFee(bloodTypeFeeArr[1]);
+                        }
+                    }
+                }
+
+                // 拆分检查类
+                if (StringUtil.isNotBlank(s.getMaterialFee())) {
+                    List<String> materialFeeList = SplitUtil.splitFees(s.getMaterialFee());
+                    for (String materialFee : materialFeeList) {
+                        String[] materialFeeArr = materialFee.split(",");
+                        if (materialFeeArr.length != 2) continue;
+                        if (materialFeeArr[0].equals("检查用一次性医用材料费")) {
+                            homePage.setCheckMaterialFee(materialFeeArr[1]);
+                        } else if (materialFeeArr[0].equals("治疗用一次性医用材料费")) {
+                            homePage.setTreatMaterialFee(materialFeeArr[1]);
+                        } else if (materialFeeArr[0].equals("手术用一次性医用材料费")) {
+                            homePage.setOperationMaterialFee(materialFeeArr[1]);
+                        }
+                    }
+                }
+
+                // 拆分治疗类
+                if (StringUtil.isNotBlank(s.getOtherLeftFee())) {
+                    List<String> otherLeftFeeList = SplitUtil.splitFees(s.getOtherLeftFee());
+                    for (String otherLeftFee : otherLeftFeeList) {
+                        String[] otherLeftFeeArr = otherLeftFee.split(",");
+                        if (otherLeftFeeArr.length != 2) continue;
+                        if (otherLeftFeeArr[0].equals("其他费")) {
+                            homePage.setOtherTypeFee(otherLeftFeeArr[1]);
+                        }
+                    }
+                }
+
+                // 拆分其他类
+                if (StringUtil.isNotBlank(s.getIsDiagnoseFit())) {
+                    List<String> isDiagnoseFitList = SplitUtil.checkDiagnosis(s.getIsDiagnoseFit());
+                    for (String isDiagnoseFit : isDiagnoseFitList) {
+                        String[] isDiagnoseFitArr = isDiagnoseFit.split(",");
+                        if (isDiagnoseFitArr.length != 2) continue;
+                        if (isDiagnoseFitArr[0].equals("门诊与出院")) {
+                            homePage.setIsOutpatientBehospital(isDiagnoseFitArr[1]);
+                        } else if (isDiagnoseFitArr[0].equals("入院与出院")) {
+                            homePage.setIsLeaveBehospital(isDiagnoseFitArr[1]);
+                        } else if (isDiagnoseFitArr[0].equals("术前与术后")) {
+                            homePage.setIsOperationBeforeAfter(isDiagnoseFitArr[1]);
+                        } else if (isDiagnoseFitArr[0].equals("临床与病理")) {
+                            homePage.setIsClinicPathology(isDiagnoseFitArr[1]);
+                        } else if (isDiagnoseFitArr[0].equals("放射与病理")) {
+                            homePage.setIsRadiatePathology(isDiagnoseFitArr[1]);
+                        }
+                    }
+                }
+
+                // 拆分抢救次数
+                if (StringUtil.isNotBlank(s.getRescueOverview())) {
+                    List<String> rescueOverviewList = SplitUtil.splitRescueTimes(s.getRescueOverview());
+                    // 第一个是抢救次数,第二个是成功次数
+                    if (rescueOverviewList.size() == 2) {
+                        homePage.setRescueNum(rescueOverviewList.get(0));
+                        homePage.setRescueSuccessNum(rescueOverviewList.get(1));
+                    }
+                }
+
+//                sendDataDealFacade.sendInfo(s.getBehospitalCode());
+
+                homePageList.add(homePage);
+
+                //初始化诊断和手术,并同步到数据库
+                aHomeDiagnoseInfoFacade.executeHomeDiagnose(s.getLeaveDiags());//首页诊断
+                aHomeOperationInfoFacade.executeHomeOperation(s.getOperations());//首页手术
+            });
+            execute(homePageList);
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            aMedAbnormalInfoFacade.saveAbnormalInfo("病案首页", "", JSON.toJSONString(aHomePageIngVO), "", e.getMessage());
+        }
+    }
+
     /**
      * 评分后返回结构体
      * @param aHomePageIngVO
@@ -246,7 +594,7 @@ public class AHomePageFacade extends HomePageServiceImpl{
             if (homePageList != null && homePageList.size() > 0) {
                 homePageList.stream().forEach(s -> {
                     HomePage homePage = this.getOne(new QueryWrapper<HomePage>()
-                            .eq("home_page_id", s.getHomePageId())
+//                            .eq("home_page_id", s.getHomePageId())
                             .eq("hospital_id", s.getHospitalId())
                             .eq("behospital_code", s.getBehospitalCode()), false);
                     if (homePage != null) {

+ 245 - 0
src/main/java/com/diagbot/util/SplitUtil.java

@@ -0,0 +1,245 @@
+package com.diagbot.util;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @description: 分割工具类
+ * @author: SGTY
+ * @create: 2024/8/14 17:40
+ */
+
+public class SplitUtil {
+
+    /**
+     * @description: 拆分年龄、(年龄不足一周岁的)年龄
+     * @name: splitAge
+     * @return: java.util.List<java.lang.String>
+     * @author: SGTY
+     * @create: 2024/8/15 11:02
+     */
+    public static List<String> splitAge(String data) {
+        List<String> ageList = new ArrayList<>();
+        StringBuilder currentAge = new StringBuilder();
+        StringBuilder currentAgeUnit = new StringBuilder();
+        for (int i = 0; i < data.length(); i++) {
+            char ch = data.charAt(i);
+            if (ch == '岁' || ch == '月' || ch == '天') {
+                currentAgeUnit.append(ch);
+                ageList.add(currentAge + "," + currentAgeUnit);
+                currentAge.setLength(0);
+                currentAgeUnit.setLength(0);
+            } else if (ch >= '0' && ch <= '9') {
+                currentAge.append(ch);
+            }
+        }
+        if (currentAge.length() != 0) {
+            ageList.add(currentAge + "," + currentAgeUnit);
+        }
+        return ageList;
+    }
+
+    /**
+     * @description: 拆分新生儿出生体重、新生儿入院体重
+     * @name: splitWeight
+     * @return: java.util.List<java.lang.String>
+     * @author: SGTY
+     * @create: 2024/8/15 11:08
+     */
+    public static List<String> splitWeight(String data) {
+        List<String> weightList = new ArrayList<>();
+        StringBuilder currentWeight = new StringBuilder();
+        StringBuilder currentWeightUnit = new StringBuilder();
+        // 遍历字符串
+        for (int i = 0; i < data.length(); i++) {
+            char ch = data.charAt(i);
+            if (ch == '克') {
+                currentWeightUnit.append(ch);
+                weightList.add(currentWeight + "," + currentWeightUnit);
+                currentWeight.setLength(0);
+                currentWeightUnit.setLength(0);
+            } else if (ch >= '0' && ch <= '9') {
+                currentWeight.append(ch);
+            }
+        }
+        if (currentWeight.length() != 0) {
+            weightList.add(currentWeight + "," + currentWeightUnit);
+        }
+        return weightList;
+    }
+
+    /**
+     * @description: 拆分综合医疗服务类、诊断类、治疗类、康复类、中医类、西药类、中药类、血液和血液制品类、耗材类、其他类等费用
+     * @name: splitFees
+     * @return: java.util.List<java.lang.String>
+     * @author: SGTY
+     * @create: 2024/8/14 17:50
+     */
+    public static List<String> splitFees(String data) {
+        List<String> feesList = new ArrayList<>();
+        Pattern pattern = Pattern.compile("[\\u4e00-\\u9fa5]+:\\d*(\\.?\\d{0,2})");
+        Matcher matcher = pattern.matcher(data);
+        while (matcher.find()) {
+            String split2 = matcher.group().replace(":", ",");
+            feesList.add(split2);
+        }
+        return feesList;
+    }
+
+    /**
+     * @description: 拆分总费用、自付金额
+     * @name: splitTotalFees
+     * @return: java.util.List<java.lang.String>
+     * @author: SGTY
+     * @create: 2024/8/15 11:44
+     */
+    public static List<String> splitTotalFees(String data) {
+        List<String> TotalFeesList = new ArrayList<>();
+        String[] parts = data.split("(|)"); // 使用“(”和“)”作为分隔符分割字符串
+        StringBuilder currentFeeValue = new StringBuilder();
+
+        for (int i = 3; i < parts[0].length(); i++) {
+            currentFeeValue.append(parts[0].charAt(i));
+        }
+        TotalFeesList.add("总费用" + "," + currentFeeValue);
+        currentFeeValue.setLength(0);
+        for (int i = 4; i < parts[1].length(); i++) {
+            currentFeeValue.append(parts[1].charAt(i));
+        }
+        TotalFeesList.add("自付金额" + "," + currentFeeValue);
+
+        return TotalFeesList;
+    }
+
+    /**
+     * @description: 拆分抢救次数、成功次数
+     * @name: splitRescueTimes
+     * @return: java.util.List<java.lang.String>
+     * @author: SGTY
+     * @create: 2024/8/15 11:51
+     */
+    public static List<String> splitRescueTimes(String data) {
+        List<String> numbers = new ArrayList<>();
+        // 正则表达式匹配一个或多个数字
+        Pattern pattern = Pattern.compile("\\d+");
+        Matcher matcher = pattern.matcher(data);
+        while (matcher.find()) {
+            numbers.add(matcher.group());
+        }
+        return numbers;
+    }
+
+    /**
+     * @description: 拆分符合与不符合的诊断
+     * @name: checkDiagnosis
+     * @return: java.util.List<java.lang.String>
+     * @author: SGTY
+     * @create: 2024/8/16 09:11
+     */
+    public static List<String> checkDiagnosis(String data) {
+        List<String> complianceStatusList = new ArrayList<>();
+        String[] split = data.split("\\d+\\.");
+        for (String s : split) {
+            if (!s.equals("")) {
+                String[] split1 = s.split(":");
+                complianceStatusList.add(split1[0] + "," + split1[1]);
+            }
+        }
+        return complianceStatusList;
+    }
+
+    public static void main(String[] args) {
+        String data1 = "(1)一般医疗服务费:850.00(2)一般治疗服务费:(3)护理费:572.60(4)其他费用:120.00";
+        String data2 = "(5)病理诊断费:0.00(6)实验室诊断费:0.00(7)影像学诊断费:0.00(8)临床诊断项目费:0.00";
+        String data3 = "(9)非手术治疗项目费:0.00(临床物理治疗费:0.00)(10)手术治疗费:10939.50(麻醉费:1063.00手术费:1063.00)";
+        String data4 = "(11)康复费:";
+        String data5 = "(12)中医治疗费:0.00";
+        String data6 = "(13)西药费:3364.59(抗菌药物费用:0.00)";
+        String data7 = "(14)中成药费:0.00(15)中草药费:0.00";
+        String data8 = "(16)血费:0.00(17)白蛋白类制品费:0.00(18)球蛋白类制品费:0.00(19)凝血因子类制品费:0.00(20)细胞因子类制品费:0.00";
+        String data9 = "(21)检查用一次性医用耗材费:(22)治疗用一次性医用耗材费:(23)手术用一次性医用耗材费:";
+        String data10 = "(24)其他费:0.00";
+        List<String> fees = splitFees(data1);
+        for (String fee : fees) {
+            System.out.println(fee);
+        }
+        System.out.println("=====================================");
+        fees = splitFees(data2);
+        for (String fee : fees) {
+            System.out.println(fee);
+        }
+        System.out.println("=====================================");
+        fees = splitFees(data3);
+        for (String fee : fees) {
+            System.out.println(fee);
+        }
+        System.out.println("=====================================");
+        fees = splitFees(data4);
+        for (String fee : fees) {
+            System.out.println(fee);
+        }
+        System.out.println("=====================================");
+        fees = splitFees(data5);
+        for (String fee : fees) {
+            System.out.println(fee);
+        }
+        System.out.println("=====================================");
+        fees = splitFees(data6);
+        for (String fee : fees) {
+            System.out.println(fee);
+        }
+        System.out.println("=====================================");
+        fees = splitFees(data7);
+        for (String fee : fees) {
+            System.out.println(fee);
+        }
+        System.out.println("=====================================");
+        fees = splitFees(data8);
+        for (String fee : fees) {
+            System.out.println(fee);
+        }
+        System.out.println("=====================================");
+        fees = splitFees(data9);
+        for (String fee : fees) {
+            System.out.println(fee);
+        }
+        System.out.println("=====================================");
+        fees = splitFees(data10);
+        for (String fee : fees) {
+            System.out.println(fee);
+        }
+        System.out.println("=====================================");
+        String age = "- 月- 天";
+        List<String> ages = splitAge(age);
+        System.out.println(ages);
+//        for (String a : ages) {
+//            System.out.println(a);
+//        }
+        System.out.println("=====================================");
+        String weight = "-克";
+        List<String> weights = splitWeight(weight);
+        for (String w : weights) {
+            System.out.println(w);
+        }
+        System.out.println("=====================================");
+        String total = "总费用28142.34(自付金额9992.46)";
+        List<String> totals = splitTotalFees(total);
+        for (String t : totals) {
+            System.out.println(t);
+        }
+        System.out.println("=====================================");
+        String rescueTimes = "抢救0次,成功0次";
+        List<String> times = splitRescueTimes(rescueTimes);
+        for (String t : times) {
+            System.out.println(t);
+        }
+        System.out.println("=====================================");
+        String diagnosis = "1.门诊与出院:符合2.入院与出院:符合3.术前与术后:符合4.临床与病理:符合5.放射与病理:符合";
+        List<String> complianceList = checkDiagnosis(diagnosis);
+        for (String c : complianceList) {
+            System.out.println(c);
+        }
+    }
+}

+ 5 - 0
src/main/java/com/diagbot/vo/data/AHomeDiagnoseVO.java

@@ -38,4 +38,9 @@ public class AHomeDiagnoseVO {
     private String pathologyDiagnose;
 
     private String icdCode;
+
+    /**
+     * 病人住院序号
+     */
+    private String behospitalCode;
 }

+ 10 - 0
src/main/java/com/diagbot/vo/data/AHomeOperationVO.java

@@ -73,4 +73,14 @@ public class AHomeOperationVO {
      * 拟手术名称
      */
     private String shamOperationName;
+
+    /**
+     * 病人住院序号
+     */
+    private String behospitalCode;
+
+    /**
+     * 麻醉医师
+     */
+    private String anaesthesiaDoctor;
 }

+ 155 - 0
src/main/java/com/diagbot/vo/data/AHomePageVO.java

@@ -73,6 +73,11 @@ public class AHomePageVO {
      */
     private String birthday;
 
+    /**
+     * 年龄类
+     */
+    private String ageType;
+
     /**
      * 年龄
      */
@@ -88,6 +93,11 @@ public class AHomePageVO {
      */
     private String nationality;
 
+    /**
+     * 新生儿出生年龄带单位
+     */
+    private String newbornAgeUnit;
+
     /**
      * 新生儿出生月数
      */
@@ -98,11 +108,21 @@ public class AHomePageVO {
      */
     private String newbornDay;
 
+    /**
+     * 新生儿出生体重带单位
+     */
+    private String newbornWeightUnit;
+
     /**
      * 新生儿出生体重
      */
     private String newbornWeight;
 
+    /**
+     * 新生儿入院体重带单位
+     */
+    private String newbornBehospitalWeightUnit;
+
     /**
      * 新生儿入院体重
      */
@@ -433,6 +453,11 @@ public class AHomePageVO {
      */
     private String tbiAfterMinute;
 
+    /**
+     * 住院费用(元)
+     */
+    private String behospitalFee;
+
     /**
      * 总费用
      */
@@ -443,6 +468,11 @@ public class AHomePageVO {
      */
     private String ownFee;
 
+    /**
+     * 综合医疗服务类
+     */
+    private String generalMedicalFee;
+
     /**
      * 一般医疗服务费
      */
@@ -463,6 +493,11 @@ public class AHomePageVO {
      */
     private String otherFee;
 
+    /**
+     * 诊断类费用
+     */
+    private String diagnoseTypeFee;
+
     /**
      * 病理诊断费
      */
@@ -483,6 +518,11 @@ public class AHomePageVO {
      */
     private String clinicDiagnoseFee;
 
+    /**
+     * 治疗费用
+     */
+    private String treatFee;
+
     /**
      * 非手术治疗项目费
      */
@@ -508,16 +548,31 @@ public class AHomePageVO {
      */
     private String operationFee;
 
+    /**
+     * 康复类费用
+     */
+    private String healthFee;
+
     /**
      * 康复类
      */
     private String healthTypeFee;
 
+    /**
+     * 中医类费用
+     */
+    private String chnFee;
+
     /**
      * 中医治疗费
      */
     private String chnTreatFee;
 
+    /**
+     * 西药类费用
+     */
+    private String westernFee;
+
     /**
      * 西药费
      */
@@ -528,6 +583,11 @@ public class AHomePageVO {
      */
     private String antibiosisFee;
 
+    /**
+     * 中药类费用
+     */
+    private String chnMedicineFee;
+
     /**
      * 中成药费
      */
@@ -538,6 +598,11 @@ public class AHomePageVO {
      */
     private String chnHerbFee;
 
+    /**
+     * 血液和血液制品类费用
+     */
+    private String bloodTypeFee;
+
     /**
      * 血费
      */
@@ -563,6 +628,11 @@ public class AHomePageVO {
      */
     private String cellFactorFee;
 
+    /**
+     * 耗材类费用
+     */
+    private String materialFee;
+
     /**
      * 检查用一次性医用材料费
      */
@@ -578,6 +648,11 @@ public class AHomePageVO {
      */
     private String operationMaterialFee;
 
+    /**
+     * 剩余其他类费用
+     */
+    private String otherLeftFee;
+
     /**
      * 其他类其他费
      */
@@ -593,6 +668,11 @@ public class AHomePageVO {
      */
     private String clinicPathwayManage;
 
+    /**
+     * 诊断符合情况
+     */
+    private String isDiagnoseFit;
+
     /**
      * 门诊与住院
      */
@@ -618,6 +698,11 @@ public class AHomePageVO {
      */
     private String isRadiatePathology;
 
+    /**
+     * 病人抢救总览
+     */
+    private String rescueOverview;
+
     /**
      * 病人抢救次数
      */
@@ -638,6 +723,76 @@ public class AHomePageVO {
      */
     private String returnToType;
 
+    /**
+     * 住院期间身体约束
+     */
+    private String isPhysicalRestraint;
+
+    /**
+     * 颅脑损伤患者昏迷时间(入院前)
+     */
+    private String tbiBehospitalBeforeTime;
+
+    /**
+     * 颅脑损伤患者昏迷时间(入院后)
+     */
+    private String tbiBehospitalAfterTime;
+
+    /**
+     * 住院期间是否发生跌倒或坠床
+     */
+    private String isFallBed;
+
+    /**
+     * 医院感染
+     */
+    private String isNosocomialInfection;
+
+    /**
+     * 入住ICU情况
+     */
+    private String isIntoIcu;
+
+    /**
+     * 并发症情况
+     */
+    private String isComplications;
+
+    /**
+     * 是否发生压疮
+     */
+    private String isPressureSore;
+
+    /**
+     * 是否住院期间发生压疮
+     */
+    private String isBehospitalPressureSore;
+
+    /**
+     * 非计划再次手术
+     */
+    private String isUnplannedReoperation;
+
+    /**
+     * 治疗结果
+     */
+    private String treatmentResults;
+
+    /**
+     * 并发症
+     */
+    private String complicationsResults;
+
+    /**
+     * 感染部位
+     */
+    private String infectionSite;
+
+    /**
+     * 住院期间有无告病危
+     */
+    private String isBeInDanger;
+
     /**
      * 出院诊断
      */

+ 8 - 1
src/main/java/com/diagbot/web/DataController.java

@@ -107,10 +107,17 @@ public class DataController {
         return aDoctorAdviceFacade.executeDoctorAdvice(list);
     }
 
-    @ApiOperation(value = "运行质控-获取病案首页")
+    @ApiOperation(value = "病案首页编辑功能")
     @PostMapping("/sendHomePageIng")
     @SysLogger("sendHomePageIng")
     public RespDTO<Map<String, Object>> sendHomePageIng(@Valid @RequestBody AHomePageIngVO aHomePageIngVO){
+        return aHomePageFacade.executeHomePageEdit(aHomePageIngVO);
+    }
+
+    @ApiOperation(value = "运行质控-获取病案首页")
+    @PostMapping("/executeHomePageIng")
+    @SysLogger("executeHomePageIng")
+    public RespDTO<Map<String, Object>> executeHomePageIng(@Valid @RequestBody AHomePageIngVO aHomePageIngVO){
         return aHomePageFacade.executeHomePageIng(aHomePageIngVO);
     }
 

+ 4 - 4
src/main/resources/application-dev.yml

@@ -104,7 +104,7 @@ spring:
         master:
           driver-class-name: com.mysql.cj.jdbc.Driver
           platform: mysql
-          url: jdbc:mysql://173.18.12.191:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+          url: jdbc:mysql://173.18.12.194:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
           username: root
           password: dsYun8!@#
           druid:
@@ -112,7 +112,7 @@ spring:
         slave:
           driver-class-name: com.mysql.cj.jdbc.Driver
           platform: mysql
-          url: jdbc:mysql://173.18.12.191:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+          url: jdbc:mysql://173.18.12.194:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
           username: root
           password: dsYun8!@#
           druid:
@@ -127,7 +127,7 @@ spring:
     database:
       cache: 8 # cache索引
       token: 8 # Token索引
-    host: 173.18.12.191  #Redis服务器地址
+    host: 173.18.12.194  #Redis服务器地址
     port: 6379 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
     password: # Redis服务器连接密码(默认为空)
     lettuce:
@@ -196,4 +196,4 @@ initmodeid:
 log_switch:
   enable: true
 
-appeal.address: http://173.18.12.192:8871
+appeal.address: http://173.18.12.195:8871

+ 4 - 0
src/main/resources/mapper/HomeOperationInfoMapper.xml

@@ -18,6 +18,7 @@
         <result column="operation_level" property="operationLevel" />
         <result column="anaesthesia_name" property="anaesthesiaName" />
         <result column="sham_operation_name" property="shamOperationName" />
+        <result column="anaesthesia_doctor" property="anaesthesiaDoctor" />
         <result column="is_deleted" property="isDeleted" />
         <result column="gmt_create" property="gmtCreate" />
         <result column="gmt_modified" property="gmtModified" />
@@ -62,6 +63,9 @@
                 <if test="item.shamOperationName != null">
                     sham_operation_name = #{item.shamOperationName},
                 </if>
+                <if test="item.anaesthesiaDoctor != null">
+                    anaesthesia_doctor = #{item.anaesthesiaDoctor},
+                </if>
                 <if test="item.gmtModified != null">
                     gmt_modified = #{item.gmtModified},
                 </if>