Bläddra i källkod

修改邵逸夫质控代码

lipc 5 år sedan
förälder
incheckning
d6f7fa544c

+ 6 - 0
pom.xml

@@ -56,6 +56,12 @@
     <dependencies>
 
         <!-- https://mvnrepository.com/artifact/wsdl4j/wsdl4j -->
+        <dependency>
+            <groupId>org.jsoup</groupId>
+            <artifactId>jsoup</artifactId>
+            <version>1.12.1</version>
+        </dependency>
+
         <dependency>
             <groupId>wsdl4j</groupId>
             <artifactId>wsdl4j</artifactId>

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

@@ -148,6 +148,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/data/sendPacsResults").permitAll()
                 .antMatchers("/qc/data/sendLisResults").permitAll()
                 .antMatchers("/base/patientInfo/savePatientList").permitAll()
+                .antMatchers("/qc/data/selectDataAndSave").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }

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

@@ -177,6 +177,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/data/sendLisResults", request)
                 || matchers("/qc/data/sendPacsResults", request)
                 || matchers("/base/patientInfo/savePatientList", request)
+                || matchers("/qc/data/selectDataAndSave", request)
                 || matchers("/", request);
     }
 

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1238 - 2
src/main/java/com/diagbot/entity/HomePage.java


+ 108 - 0
src/main/java/com/diagbot/entity/shaoyifu/util/ShaoyfDateUtil.java

@@ -0,0 +1,108 @@
+package com.diagbot.entity.shaoyifu.util;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.time.DateUtils;
+
+import java.text.ParseException;
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2020/7/13 18:31
+ */
+public class ShaoyfDateUtil {
+
+    public static Date parseDateTime(String datetime) {
+        Date date = null;
+        try {
+            datetime = remove_ctl(datetime);
+
+            if (datetime.contains("至")) {
+                datetime = datetime.split("至")[1].replaceAll("[\\u4e00-\\u9fa5]", "");
+            }
+
+            if (datetime.endsWith(":")) {
+                datetime = datetime.substring(0, datetime.length() - 1);
+            }
+
+            if (datetime.length() > 0 && !datetime.equals("-")) {
+                date = DateUtils.parseDate(datetime, dateFormats);
+            }
+        } catch (ParseException ex) {
+            ex.printStackTrace();
+        }
+        return date;
+    }
+
+    public static String remove_ctl(String str) {
+        String trim = "";
+        if (StringUtils.isNotEmpty(str)) {
+            trim = str.replaceAll("\r|\n|\r\n|/r/n", "").trim();
+        }
+        return trim;
+    }
+
+    public static String[] dateFormats = {
+            "yyyy年MM月dd日HH时mm分",
+            "yyyy年MM月dd日HH:mm",
+            "yyyy年MM月dd日H时mm分",
+            "yyyy年MM月dd日HH时m分",
+            "yyyy年MM月dd日H时m分",
+            "yyyy年M月dd日HH时mm分",
+            "yyyy年M月dd日H时mm分",
+            "yyyy年M月dd日HH时m分",
+            "yyyy年M月dd日H时m分",
+            "yyyy年MM月d日HH时mm分",
+            "yyyy年MM月d日H时mm分",
+            "yyyy年MM月d日HH时m分",
+            "yyyy年MM月d日H时m分",
+            "yyyy年M月d日HH时mm分",
+            "yyyy年M月d日H时mm分",
+            "yyyy年M月d日HH时m分",
+            "yyyy年M月d日H时m分",
+            "yyyy-MM-ddHH:mm:ss",
+            "yyyy-MM-ddHH:mm",
+            "yyyy-MM-ddHH:m",
+            "yyyy-MM-ddH:mm",
+            "yyyy-MM-ddH:m",
+            "yyyy-M-ddHH:mm",
+            "yyyy-M-ddHH:m",
+            "yyyy-M-ddH:mm",
+            "yyyy-M-ddH:m",
+            "yyyy-MM-dHH:mm",
+            "yyyy-MM-dHH:m",
+            "yyyy-MM-dH:mm",
+            "yyyy-MM-dH:m",
+            "yyyy-M-dHH:mm",
+            "yyyy-M-dHH:m",
+            "yyyy-M-dH:mm",
+            "yyyy-M-dH:m",
+            "yyyy-MM-dd",
+            "yyyy年MM月dd日H时",
+            "yyyy/MM/ddHH:mm:ss",
+            "yyyy/MM/ddHH:mm",
+            "yyyy/MM/ddHH:m",
+            "yyyy/MM/ddH:mm",
+            "yyyy/MM/ddH:m",
+            "yyyy/M/ddHH:mm",
+            "yyyy/M/ddHH:m",
+            "yyyy/M/ddH:mm",
+            "yyyy/M/ddH:m",
+            "yyyy/MM/dHH:mm",
+            "yyyy/MM/dHH:m",
+            "yyyy/MM/dH:mm",
+            "yyyy/MM/dH:m",
+            "yyyy/M/dHH:mm",
+            "yyyy/M/dHH:m",
+            "yyyy/M/dH:mm",
+            "yyyy/M/dH:m",
+            "yyyy/MM/dd",
+            "yyyy.MM.dd",
+            "yyyy-MM-ddHH:mm:ss.000",
+            "yyyyMMddHH:mm",
+            "yyyy-MM-dd'T'HH:mm:ss",
+    };
+
+
+}

+ 353 - 104
src/main/java/com/diagbot/facade/data/AMedicalRecordFacade.java

@@ -1,6 +1,8 @@
 package com.diagbot.facade.data;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.diagbot.dto.AnalyzeRunDTO;
@@ -16,24 +18,25 @@ import com.diagbot.entity.shaoyifu.response.MedicalRecordResponse;
 import com.diagbot.entity.shaoyifu.response.PatientListResponse;
 import com.diagbot.entity.shaoyifu.util.HttpApi;
 import com.diagbot.entity.shaoyifu.util.SYFNlRequest;
+import com.diagbot.entity.shaoyifu.util.ShaoyfDateUtil;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.facade.BehospitalInfoFacade;
 import com.diagbot.facade.ModelHospitalFacade;
 import com.diagbot.facade.QcTypeFacade;
-import com.diagbot.service.impl.MedicalRecordServiceImpl;
-import com.diagbot.service.impl.PatientInfoServiceImpl;
-import com.diagbot.service.impl.QcAbnormalServiceImpl;
+import com.diagbot.service.impl.*;
 import com.diagbot.util.*;
 import com.diagbot.vo.AnalyzeRunVO;
 import com.diagbot.vo.data.ADeleteFlagVO;
 import com.diagbot.vo.data.AMedicalRecordVO;
 import com.diagbot.vo.data.AMrContentVO;
 import com.google.common.collect.Lists;
+import com.ibm.wsdl.extensions.schema.SchemaImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 
 import java.text.SimpleDateFormat;
+import java.time.format.DateTimeFormatter;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -52,9 +55,23 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
     @Autowired
     private AMedicalRecordContentFacade aMedicalRecordContentFacade;
 
+    @Autowired
+    private MedicalRecordContentServiceImpl medicalRecordContentServiceImpl;
+
     @Autowired
     private BehospitalInfoFacade behospitalInfoFacade;
 
+    @Autowired
+    private HomePageServiceImpl homePageServiceImpl;
+
+    @Autowired
+    @Qualifier("homeDiagnoseInfoServiceImpl")
+    private HomeDiagnoseInfoServiceImpl homeDiagnoseInfoService;
+
+    @Autowired
+    @Qualifier("homeOperationInfoServiceImpl")
+    private HomeOperationInfoServiceImpl homeOperationInfoService;
+
     @Autowired
     @Qualifier("qcAbnormalServiceImpl")
     private QcAbnormalServiceImpl qcAbnormalService;
@@ -76,13 +93,240 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
 
     private TZDBConn tzDBConn = new TZDBConn();
 
+    public void selectDataAndSave() {
+        QueryWrapper<MedicalRecord> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("mode_id", 6);
+        List<MedicalRecord> medicalRecordList = medicalRecordService.list(queryWrapper);
+        if (medicalRecordList.size() > 0) {
+            medicalRecordList.stream().forEach(s -> {
+
+                try {
+                    MedicalRecordContent medicalRecordContent = medicalRecordContentServiceImpl.getOne(new QueryWrapper<MedicalRecordContent>().eq("rec_id", s.getRecId()));
+
+                    ShaoyfHtmlUtil shaoyfHtmlUtil = new ShaoyfHtmlUtil();
+                    Map<String, Object> ret = shaoyfHtmlUtil.getPageMap(medicalRecordContent.getHtmlText());
+                    JSONObject paramsObj = new JSONObject(ret);
+                    JSONObject homePageObject = paramsObj.getJSONObject("病案首页");
+
+                    HomePage homePage = new HomePage();
+                    homePage.setHomePageId(s.getRecId());
+                    homePage.setHospitalId(Long.parseLong("2"));
+                    homePage.setBehospitalCode(s.getBehospitalCode());
+                    //homePage.setBehospitalCode(patientListResponse.getData().get(i).getMRN() + "_" + patientListResponse.getData().get(i).getSERIES());
+                    homePage.setHospitalCode("A001");
+                    homePage.setHospitalName("邵逸夫");
+                    homePage.setOrgCode("A001");
+                    homePage.setPayType(homePageObject.getString("医疗付费方式"));
+                    homePage.setHealthCard(homePageObject.getString("健康卡号"));
+                    homePage.setBehospitalNum(homePageObject.getString("住院次数"));
+                    homePage.setFileCode(homePageObject.getString("病历号"));
+                    homePage.setName(homePageObject.getString("本人姓名"));
+                    homePage.setSex(homePageObject.getString("性别"));
+                    homePage.setBirthday(ShaoyfDateUtil.parseDateTime(homePageObject.getString("生日")));
+                    homePage.setAge(homePageObject.getString("年龄"));
+                    homePage.setAgeUnit(homePageObject.getString("年龄单位"));
+                    homePage.setNationality(homePageObject.getString("国籍"));
+                    homePage.setNewbornDay(homePageObject.getString("新生儿年龄日"));
+                    homePage.setNewbornMonth(homePageObject.getString("新生儿年龄月"));
+                    homePage.setNewbornWeight(homePageObject.getString("出生体重1"));
+                    homePage.setNewbornBehospitalWeight(homePageObject.getString("新生儿入院体重"));
+                    homePage.setBornAddress(homePageObject.getString("出生地址"));
+                    homePage.setBornPlace(homePageObject.getString("籍贯"));
+                    homePage.setNation(homePageObject.getString("民族"));
+                    homePage.setIdentityCardNo(homePageObject.getString("居民身份证"));
+                    homePage.setJobType(homePageObject.getString("退休人员"));
+                    homePage.setMarriage(homePageObject.getString("婚姻"));
+                    homePage.setCurAddress(homePageObject.getString("现住址"));
+                    homePage.setCurPhone(homePageObject.getString("家庭电话"));
+                    homePage.setCurPostCode(homePageObject.getString("居住地邮政编码"));
+                    homePage.setResidenceAddress(homePageObject.getString("户籍住址"));
+                    homePage.setResidencePostCode(homePageObject.getString("户口地址邮政编码"));
+                    homePage.setWorkAddress(homePageObject.getString("工作场所"));
+                    homePage.setWorkPhone(homePageObject.getString("本人工作单位电话"));
+                    homePage.setWorkPostCode(homePageObject.getString("工作单位邮政编码"));
+                    homePage.setContactName(homePageObject.getString("联系人姓名"));
+                    homePage.setContactRelation(homePageObject.getString("联系人关系"));
+                    homePage.setContactAddress(homePageObject.getString("联系人地址"));
+                    homePage.setContactPhone(homePageObject.getString("联系电话"));
+                    homePage.setBehospitalWay(homePageObject.getString("入院途径"));
+                    homePage.setBehospitalDept(homePageObject.getString("入院科室"));
+                    homePage.setBehospitalWard(homePageObject.getString("病房(入)"));
+                    //homePage.setBehospitalBedCode(homePageResponse.getData().getBedid_in());
+                    homePage.setChangeDept(homePageObject.getString("转科科室"));
+                    homePage.setJobType(homePageObject.getString("职业"));
+                    homePage.setLeaveHospitalDate(ShaoyfDateUtil.parseDateTime(homePageObject.getString("出院日期")));
+                    homePage.setBehospitalDate(ShaoyfDateUtil.parseDateTime(homePageObject.getString("入院日期")));
+                    homePage.setIsPhysicalRestraint(homePageObject.getString("住院期间身体约束"));
+                    homePage.setTbiBehospitalBeforeTime(homePageObject.getString("颅脑损伤患者昏迷时间(入院前)"));
+                    homePage.setTbiBehospitalAfterTime(homePageObject.getString("颅脑损伤患者昏迷时间(入院后)"));
+                    homePage.setIsFallBed(homePageObject.getString("住院期间是否发生跌倒或坠床"));
+                    homePage.setIsNosocomialInfection(homePageObject.getString("医院感染"));
+                    homePage.setIsIntoIcu(homePageObject.getString("入住ICU情况"));
+                    homePage.setIsComplications(homePageObject.getString("并发症情况"));
+                    homePage.setIsPressureSore(homePageObject.getString("是否发生压疮"));
+                    homePage.setIsBehospitalPressureSore(homePageObject.getString("是否住院期间发生压疮"));
+                    homePage.setTreatmentResults(homePageObject.getString("治疗结果"));
+                    homePage.setComplicationsResults(homePageObject.getString("并发症"));
+                    homePage.setInfectionSite(homePageObject.getString("感染部位"));
+                    homePage.setIsBeInDanger(homePageObject.getString("住院期间有无告病危"));
+                    homePage.setIsUnplannedReoperation(homePageObject.getString("非计划再次手术"));
+                    homePage.setOtherTypeFee(homePageObject.getString("综合医疗其他服务费"));
+                    homePage.setTotalFee(homePageObject.getString("住院费用"));
+                    homePage.setIsOperationBeforeAfter(homePageObject.getString("术前诊断与术后诊断"));
+                    homePage.setIsLeaveBehospital(homePageObject.getString("入院诊断与出院诊断"));
+                    homePage.setIsClinicPathology(homePageObject.getString("临床诊断与病理诊断"));
+                    homePage.setIsOutpatientBehospital(homePageObject.getString("门诊诊断与住院诊断"));
+                    homePage.setIsRadiatePathology(homePageObject.getString("放射诊断与病理诊断"));
+                    homePage.setMedAllergyName(homePageObject.getString("过敏史"));
+                    homePage.setAcceptOrgCode(homePageObject.getString("拟接收医疗机构名称"));
+                    homePage.setAgainBehospitalGoal(homePageObject.getString("目的"));
+                    homePage.setContactPhone(homePageObject.getString("联系电话"));
+                    homePage.setRescueSuccessNum(homePageObject.getString("成功次数"));
+                    homePage.setLeaveHospitalDept(homePageObject.getString("出院科室"));
+                    homePage.setLeaveHospitalWard(homePageObject.getString("病房(出)"));
+                    homePage.setBehospitalDayNum(homePageObject.getString("实际住院天数"));
+                    homePage.setOutpatientEmrDiagnose(homePageObject.getString("门急诊诊断"));
+                    homePage.setOutpatientEmrDiagnoseCode(homePageObject.getString("门急诊诊断编码"));
+                    homePage.setPoisonFactor(homePageObject.getString("损伤中毒因素"));
+                    homePage.setPoisonFactorCode(homePageObject.getString("损伤中毒因素编码"));
+                    homePage.setPathologyDiagnose(homePageObject.getString("病理诊断"));
+                    homePage.setPathologyDiagnoseId(homePageObject.getString("病理诊断编号"));
+                    //homePage.setMedAllergyName(homePageResponse.getData().getDrug_allergy());
+                    homePage.setAutopsy(homePageObject.getString("尸检"));
+                    homePage.setBloodType(homePageObject.getString("血型"));
+                    homePage.setRh(homePageObject.getString("Rh血型"));
+                    homePage.setDeptDirector(homePageObject.getString("科主任"));
+                    homePage.setDirectorDoctor(homePageObject.getString("主任医生"));
+                    homePage.setAttendingDoctor(homePageObject.getString("主治医生"));
+                    homePage.setBehospitalDoctor(homePageObject.getString("住院医生"));
+                    homePage.setResponseNurse(homePageObject.getString("住院医生"));
+                    homePage.setStudyDoctor(homePageObject.getString("进修医生"));
+                    homePage.setPracticeDoctor(homePageObject.getString("实习医生"));
+                    homePage.setEncodeMan(homePageObject.getString("编码员"));
+                    homePage.setHomePageQuality(homePageObject.getString("病案质量"));
+                    homePage.setQcDoctor(homePageObject.getString("质控医生"));
+                    homePage.setQcNurse(homePageObject.getString("质控护士"));
+                    homePage.setQcDate(ShaoyfDateUtil.parseDateTime(homePageObject.getString("质控日期")));
+                    homePage.setLeaveHospitalType(homePageObject.getString("离院方式"));
+                    //homePage.setAcceptOrgCode(homePageResponse.getData().getAcceptOrgCode());
+                    homePage.setAgainBehospitalPlan(homePageObject.getString("出院31天再入院计划"));
+                    //homePage.setAgainBehospitalGoal(homePageResponse.getData().getAgainBehospitalGoal());
+                    //homePage.setTbiBeforeDay(homePageResponse.getData().getBraininjurybefore_day());
+                    //homePage.setTbiBeforeHour(homePageResponse.getData().getBraininjurybefore_hour());
+                    //homePage.setTbiBeforeMinute(homePageResponse.getData().getBraininjurybefore_minute());
+                    //homePage.setTbiAfterDay(homePageResponse.getData().getBraininjuryafter_day());
+                    //homePage.setTbiAfterHour(homePageResponse.getData().getBraininjuryafter_hour());
+                    //homePage.setTbiAfterMinute(homePageResponse.getData().getBraininjuryafter_minute());
+                    //homePage.setTotalFee(homePageResponse.getData().getTotalcost());
+                    homePage.setOwnFee(homePageObject.getString("住院自付金额"));
+                    homePage.setGeneralFee(homePageObject.getString("一般医疗服务费"));
+                    homePage.setServiceFee(homePageObject.getString("一般治疗操作费"));
+                    homePage.setNurseFee(homePageObject.getString("护理费"));
+                    homePage.setOtherFee(homePageObject.getString("其他费"));
+                    homePage.setPathologyFee(homePageObject.getString("病理诊断费"));
+                    homePage.setLabFee(homePageObject.getString("实验室诊断费"));
+                    homePage.setPacsFee(homePageObject.getString("影像学诊断费"));
+                    homePage.setClinicDiagnoseFee(homePageObject.getString("临床诊断项目费"));
+                    homePage.setNotOperationFee(homePageObject.getString("非手术治疗项目费"));
+                    homePage.setClinicPhysicFee(homePageObject.getString("临床物理治疗费"));
+                    homePage.setOperationTreatFee(homePageObject.getString("手术治疗费"));
+                    homePage.setAnaesthesiaFee(homePageObject.getString("麻醉费"));
+                    homePage.setOperationFee(homePageObject.getString("手术费"));
+                    homePage.setHealthTypeFee(homePageObject.getString("康复费"));
+                    homePage.setChnTreatFee(homePageObject.getString("中医治疗费"));
+                    homePage.setWesternMedFee(homePageObject.getString("西药费"));
+                    homePage.setAntibiosisFee(homePageObject.getString("抗菌药物费用"));
+                    homePage.setChnMedFee(homePageObject.getString("中成药费"));
+                    homePage.setChnHerbFee(homePageObject.getString("中草药费"));
+                    homePage.setBloodFee(homePageObject.getString("血费"));
+                    homePage.setAlbumenFee(homePageObject.getString("白蛋白类制品费"));
+                    homePage.setGlobulinFee(homePageObject.getString("球蛋白类制品费"));
+                    homePage.setBloodFactorFee(homePageObject.getString("凝血因子类制品费"));
+                    homePage.setCellFactorFee(homePageObject.getString("细胞因子类制品费"));
+                    homePage.setCheckMaterialFee(homePageObject.getString("检查用一次性医用材料费"));
+                    homePage.setTreatMaterialFee(homePageObject.getString("治疗用一次性医用材料费"));
+                    homePage.setOperationMaterialFee(homePageObject.getString("手术用一次性医用材料费"));
+                    //homePage.setOtherTypeFee(homePageResponse.getData().getOthercost());
+                    homePage.setSingleDiagManage(homePageObject.getString("单病种管理"));
+                    homePage.setClinicPathwayManage(homePageObject.getString("临床路径管理"));
+                    //homePage.setIsOutpatientBehospital(homePageResponse.getData().getIsOutpatientBehospital());
+                    //homePage.setIsLeaveBehospital(homePageResponse.getData().getIsLeaveBehospital());
+                    //homePage.setIsOperationBeforeAfter(homePageResponse.getData().getIsOperationBeforeAfter());
+                    //homePage.setIsClinicPathology(homePageResponse.getData().getIsClinicPathology());
+                    //homePage.setIsRadiatePathology(homePageResponse.getData().getIsRadiatePathology());
+                    homePage.setRescueNum(homePageObject.getString("抢救次数"));
+                    //homePage.setRescueSuccessNum(homePageResponse.getData().getRescueSuccessNum());
+                    //homePage.setIsAutoLeavehospital(homePageResponse.getData().getIsAutoLeavehospital());
+                    homePage.setReturnToType(homePageObject.getString("治疗结果"));
+                    homePage.setPathologyDiagnoseCode(homePageObject.getString("病理诊断编码"));
+
+                    //JSONObject homePageDiagObject = paramsObj.getJSONObject("诊断信息");
+                    List<Object> list = paramsObj.getJSONArray("诊断信息");
+                    List<HomeDiagnoseInfo> homeDiagnoseInfoList = Lists.newLinkedList();
+                    for (int i = 0; i < list.size(); i++) {
+                        HomeDiagnoseInfo homeDiagnoseInfo = new HomeDiagnoseInfo();
+                        homeDiagnoseInfo.setHomePageId(s.getRecId());
+                        /*homeDiagnoseInfo.setHomePageId(patientListResponse.getData().get(i).getRDN());*/
+                        homeDiagnoseInfo.setHospitalId(Long.parseLong("2"));
+                        //homeDiagnoseInfo.setDiagnoseOrderNo(homePageDiagnoseResponse.getData().get(j).getRdn());
+                        //homeDiagnoseInfo.setDiagnoseType(homePageDiagnoseResponse.getData().get(j).getPrimaryflag());
+                        //homeDiagnoseInfo.setDiagnoseTypeShort(homePageDiagnoseResponse.getData().get(j).getPrimaryflag());
+                        homeDiagnoseInfo.setDiagnoseName(((JSONArray) list).getJSONObject(i).getString("诊断名称"));
+                        homeDiagnoseInfo.setBehospitalType(((JSONArray) list).getJSONObject(i).getString("入院情况"));
+                        homeDiagnoseInfo.setIcdCode(((JSONArray) list).getJSONObject(i).getString("诊断编码"));
+                        if (i == 0) {
+                            homeDiagnoseInfo.setDiagnoseType("主要诊断");
+                        } else {
+                            homeDiagnoseInfo.setDiagnoseType("其他诊断");
+                        }
+                        homeDiagnoseInfoList.add(homeDiagnoseInfo);
+
+                    }
+
+                    List<Object> list1 = paramsObj.getJSONArray("手术信息");
+                    List<HomeOperationInfo> homeOperationInfoList = Lists.newLinkedList();
+                    for (int i = 0; i < list1.size(); i++) {
+                        HomeOperationInfo homeOperationInfo = new HomeOperationInfo();
+                        homeOperationInfo.setHomePageId(s.getRecId());
+                        /*homeOperationInfo.setHomePageId(patientListResponse.getData().get(i).getRDN());*/
+                        homeOperationInfo.setHospitalId(Long.parseLong("2"));
+                        homeOperationInfo.setOperationDate(ShaoyfDateUtil.parseDateTime(((JSONArray) list1).getJSONObject(i).getString("手术日期2")));
+                        homeOperationInfo.setOperationCode(((JSONArray) list1).getJSONObject(i).getString("手术操作代码"));
+                        homeOperationInfo.setOperationName(((JSONArray) list1).getJSONObject(i).getString("手术名称"));
+                        homeOperationInfo.setOperationDoctorId(((JSONArray) list1).getJSONObject(i).getString("手术医师"));
+                        homeOperationInfo.setFirstAssistantId(((JSONArray) list1).getJSONObject(i).getString("助手"));
+                        homeOperationInfo.setSecondAssistantId(((JSONArray) list1).getJSONObject(i).getString("助手II"));
+                        homeOperationInfo.setHealingLevel(((JSONArray) list1).getJSONObject(i).getString("切口愈合等级"));
+                        homeOperationInfo.setOperationLevel(((JSONArray) list1).getJSONObject(i).getString("手术级别"));
+                        homeOperationInfo.setCutLevel(((JSONArray) list1).getJSONObject(i).getString("切口等级"));
+                        homeOperationInfo.setAnaesthesiaName(((JSONArray) list1).getJSONObject(i).getString("麻醉方式"));
+
+                        homeOperationInfoList.add(homeOperationInfo);
+                    }
+
+
+                    homePageServiceImpl.save(homePage);
+                    homeDiagnoseInfoService.saveBatch(homeDiagnoseInfoList);
+                    homeOperationInfoService.saveBatch(homeOperationInfoList);
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            });
+
+
+        }
+
+
+    }
+
     /**
      * 终末质控-同步前一天的病历记录
      */
     public void executeMrRecord() {
         try {
             /*PatientListRequest patientListRequest = new PatientListRequest();
-            *//*patientListRequest.setDATESTART(sdf.format(startTime));
+             *//*patientListRequest.setDATESTART(sdf.format(startTime));
             patientListRequest.setDATEEND(sdf.format(endTime));*//*
             patientListRequest.setDATESTART("2020-04-01 00:00:00");
             patientListRequest.setDATEEND("2020-04-08 00:00:00");
@@ -130,6 +374,7 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
                     medicalRecordContent.setHtmlText(syfMedicalRecordList.get(j).getBLNR());
                     medicalRecordContent.setXmlText(syfMedicalRecordList.get(j).getXMLWD());
                     medicalRecordContentList.add(medicalRecordContent);
+
                 }
 
                 execute(medicalRecordList);
@@ -143,12 +388,13 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
 
     /**
      * 终末质控-通过接口更新病历记录
+     *
      * @param list
      * @return
      */
     public RespDTO<List<AMedicalRecordDTO>> executeMrRecord(List<AMedicalRecordVO> list) {
         try {
-            if(list!=null && list.size()>0) {
+            if (list != null && list.size() > 0) {
                 //循环验证数据有效性
                 for (AMedicalRecordVO aMedicalRecordVO : list) {
                     if ("".equals(aMedicalRecordVO.getRecId())) {
@@ -162,9 +408,9 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
 
                 //装载数据
                 List<MedicalRecord> medicalRecordList = Lists.newArrayList();
-                list.stream().forEach(s->{
-                    MedicalRecord medicalRecord=new MedicalRecord();
-                    BeanUtil.copyProperties(s,medicalRecord);
+                list.stream().forEach(s -> {
+                    MedicalRecord medicalRecord = new MedicalRecord();
+                    BeanUtil.copyProperties(s, medicalRecord);
                     medicalRecord.setRecDate(DateUtil.parseDateTime(s.getRecDate()));
                     medicalRecordList.add(medicalRecord);
                 });
@@ -172,25 +418,26 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
 
                 List<AMedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(list, AMedicalRecordDTO.class);
                 return RespDTO.onSuc(medicalRecordDTOList);
-            }else{
-                aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(list),"","未接收到数据!");
+            } else {
+                aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息", JSON.toJSONString(list), "", "未接收到数据!");
                 return RespDTO.onError("未接收到数据!");
             }
-        }catch (Exception e){
-            aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(list),"",e.getMessage());
+        } catch (Exception e) {
+            aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息", JSON.toJSONString(list), "", e.getMessage());
             return RespDTO.onError(e.getMessage());
         }
     }
 
     /**
      * 运行质控-通过接口更新病历记录
+     *
      * @param aMrContentVO
      * @return
      */
     public RespDTO<Map<String, Object>> executeMrRecordIng(AMrContentVO aMrContentVO) {
         try {
-            if(aMrContentVO.getRecords()!=null && aMrContentVO.getRecords().size()>0){
-                AMrContentDTO aMrContentDTO=new AMrContentDTO();
+            if (aMrContentVO.getRecords() != null && aMrContentVO.getRecords().size() > 0) {
+                AMrContentDTO aMrContentDTO = new AMrContentDTO();
                 //循环验证数据有效性
                 for (AMedicalRecordVO aMedicalRecordVO : aMrContentVO.getRecords()) {
                     if ("".equals(aMedicalRecordVO.getRecId())) {
@@ -218,129 +465,130 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
                 //评分后返回结构体
                 return mrIng(aMrContentVO);
 
-            }else{
-                aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(aMrContentVO),"","未接收到数据!");
+            } else {
+                aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息", JSON.toJSONString(aMrContentVO), "", "未接收到数据!");
                 return RespDTO.onError("未接收到数据!");
             }
-        }catch (Exception e){
-            aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(aMrContentVO),"",e.getMessage());
+        } catch (Exception e) {
+            aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息", JSON.toJSONString(aMrContentVO), "", e.getMessage());
             return RespDTO.onError(e.getMessage());
         }
     }
 
     /**
      * 评分后返回结构体
+     *
      * @param aMrContentVO
      * @return
      */
-    private RespDTO<Map<String, Object>> mrIng(AMrContentVO aMrContentVO){
+    private RespDTO<Map<String, Object>> mrIng(AMrContentVO aMrContentVO) {
         try {
-            String behospitalCode =aMrContentVO.getRecords().get(0).getBehospitalCode();
-            Long hospitalId=aMrContentVO.getRecords().get(0).getHospitalId();
-            MedicalRecord medicalRecord=new MedicalRecord();
-            BeanUtil.copyProperties(aMrContentVO.getRecords().get(0),medicalRecord);
-            Long modeId=initModeId(medicalRecord);
-            if(aMrContentVO.getDockModeType().equals("0")){
-                Map<String,Object> map=new HashMap<String,Object>();
+            String behospitalCode = aMrContentVO.getRecords().get(0).getBehospitalCode();
+            Long hospitalId = aMrContentVO.getRecords().get(0).getHospitalId();
+            MedicalRecord medicalRecord = new MedicalRecord();
+            BeanUtil.copyProperties(aMrContentVO.getRecords().get(0), medicalRecord);
+            Long modeId = initModeId(medicalRecord);
+            if (aMrContentVO.getDockModeType().equals("0")) {
+                Map<String, Object> map = new HashMap<String, Object>();
                 List<AMedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(aMrContentVO.getRecords(), AMedicalRecordDTO.class);
-                map.put("records",medicalRecordDTOList);
-                aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(aMrContentVO),JSON.toJSONString(RespDTO.onSuc(map)),"操作正常!");
+                map.put("records", medicalRecordDTOList);
+                aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息", JSON.toJSONString(aMrContentVO), JSON.toJSONString(RespDTO.onSuc(map)), "操作正常!");
                 return RespDTO.onSuc(map);
-            }else if(aMrContentVO.getDockModeType().equals("1")){
-                if(modeId==0 || modeId==null){
+            } else if (aMrContentVO.getDockModeType().equals("1")) {
+                if (modeId == 0 || modeId == null) {
                     return RespDTO.onError("无对应的文书类型");
                 }
                 //页面模式
-                String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+hospitalId+"&modeId="+modeId;
-                Map<String,Object> map=new HashMap<String,Object>();
-                map.put("url",url);
-                aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(aMrContentVO),JSON.toJSONString(RespDTO.onSuc(map)),"操作正常!");
+                String url = readProperties.getProcessQcUrl() + "?behospitalCode=" + behospitalCode + "&hospitalId=" + hospitalId + "&modeId=" + modeId;
+                Map<String, Object> map = new HashMap<String, Object>();
+                map.put("url", url);
+                aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息", JSON.toJSONString(aMrContentVO), JSON.toJSONString(RespDTO.onSuc(map)), "操作正常!");
                 return RespDTO.onSuc(map);
-            }else if(aMrContentVO.getDockModeType().equals("2")){
-                AnalyzeRunVO analyzeRunVO=new AnalyzeRunVO();
+            } else if (aMrContentVO.getDockModeType().equals("2")) {
+                AnalyzeRunVO analyzeRunVO = new AnalyzeRunVO();
                 analyzeRunVO.setBehospitalCode(behospitalCode);
                 analyzeRunVO.setHospitalId(hospitalId);
                 analyzeRunVO.setModeId(modeId);
-                AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
-                Map<String,Object> map=new HashMap<String,Object>();
-                if(analyzeRunDTO.getMsgDTOList().size()>0){
-                    map.put("analyze",analyzeRunDTO.getMsgDTOList());
+                AnalyzeRunDTO analyzeRunDTO = behospitalInfoFacade.analyzeRun(analyzeRunVO);
+                Map<String, Object> map = new HashMap<String, Object>();
+                if (analyzeRunDTO.getMsgDTOList().size() > 0) {
+                    map.put("analyze", analyzeRunDTO.getMsgDTOList());
                 }
-                aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(aMrContentVO),JSON.toJSONString(RespDTO.onSuc(map)),"操作正常!");
+                aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息", JSON.toJSONString(aMrContentVO), JSON.toJSONString(RespDTO.onSuc(map)), "操作正常!");
                 //接口引擎模式
                 return RespDTO.onSuc(map);
-            }else{
-                if(modeId==0 || modeId==null){
+            } else {
+                if (modeId == 0 || modeId == null) {
                     return RespDTO.onError("无对应的文书类型");
                 }
                 //页面模式
-                String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+hospitalId+"&modeId="+modeId;
+                String url = readProperties.getProcessQcUrl() + "?behospitalCode=" + behospitalCode + "&hospitalId=" + hospitalId + "&modeId=" + modeId;
 
-                AnalyzeRunVO analyzeRunVO=new AnalyzeRunVO();
+                AnalyzeRunVO analyzeRunVO = new AnalyzeRunVO();
                 analyzeRunVO.setBehospitalCode(behospitalCode);
                 analyzeRunVO.setHospitalId(hospitalId);
                 analyzeRunVO.setModeId(modeId);
-                AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
-                Map<String,Object> map=new HashMap<String,Object>();
-                if(analyzeRunDTO.getMsgDTOList().size()>0){
-                    map.put("url",url);
-                    map.put("analyze",analyzeRunDTO.getMsgDTOList());
+                AnalyzeRunDTO analyzeRunDTO = behospitalInfoFacade.analyzeRun(analyzeRunVO);
+                Map<String, Object> map = new HashMap<String, Object>();
+                if (analyzeRunDTO.getMsgDTOList().size() > 0) {
+                    map.put("url", url);
+                    map.put("analyze", analyzeRunDTO.getMsgDTOList());
                 }
-                aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(aMrContentVO),JSON.toJSONString(RespDTO.onSuc(map)),"操作正常!");
+                aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息", JSON.toJSONString(aMrContentVO), JSON.toJSONString(RespDTO.onSuc(map)), "操作正常!");
                 return RespDTO.onSuc(map);
             }
-        }catch (Exception e){
-            aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(aMrContentVO),"",e.getMessage());
+        } catch (Exception e) {
+            aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息", JSON.toJSONString(aMrContentVO), "", e.getMessage());
             return RespDTO.onError(e.getMessage());
         }
 
     }
 
-    public void execute(List<MedicalRecord> medicalRecordList){
+    public void execute(List<MedicalRecord> medicalRecordList) {
         try {
             List<MedicalRecord> addE = Lists.newLinkedList();
             List<MedicalRecord> updateE = Lists.newLinkedList();
-            List<BehospitalInfo> behospitalInfoList=Lists.newLinkedList();
+            List<BehospitalInfo> behospitalInfoList = Lists.newLinkedList();
             List<QcAbnormal> qcAbnormalList = Lists.newLinkedList();
             if (medicalRecordList != null && medicalRecordList.size() > 0) {
                 medicalRecordList.stream().forEach(s -> {
                     //初始化mode_id
-                    Long modeId=initModeId(s);
-                    if(modeId==Long.valueOf("0")){
+                    Long modeId = initModeId(s);
+                    if (modeId == Long.valueOf("0")) {
                         //新增类型到监测表中
-                        QcAbnormal qcAbnormal=new QcAbnormal();
+                        QcAbnormal qcAbnormal = new QcAbnormal();
                         qcAbnormal.setHospitalId(s.getHospitalId());
                         qcAbnormal.setBehospitalCode(s.getBehospitalCode());
                         qcAbnormal.setType(1);
                         qcAbnormal.setDescription(s.getRecTitle());
                         qcAbnormal.setGmtCreate(new Date());
                         qcAbnormalList.add(qcAbnormal);
-                    }else if(modeId==Long.valueOf("1")){
+                    } else if (modeId == Long.valueOf("1")) {
                         BehospitalInfo behospitalInfo = behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>()
                                 .eq("behospital_code", s.getBehospitalCode())
                                 .eq("hospital_id", s.getHospitalId())
-                                .eq("is_deleted",IsDeleteEnum.N), false);
-                        if(behospitalInfo!=null){
+                                .eq("is_deleted", IsDeleteEnum.N), false);
+                        if (behospitalInfo != null) {
                             //如果病人住院信息存在,更新对应的qc_type_id
-                            Long qcTypeId=Long.valueOf("0");
-                            QcType qcType=qcTypeFacade.getOne(new QueryWrapper<QcType>()
-                                    .eq("name",s.getRecTitle())
+                            Long qcTypeId = Long.valueOf("0");
+                            QcType qcType = qcTypeFacade.getOne(new QueryWrapper<QcType>()
+                                    .eq("name", s.getRecTitle())
                                     .eq("hospital_id", s.getHospitalId())
-                                    .eq("is_deleted",IsDeleteEnum.N), false);
-                            if(qcType!=null){
+                                    .eq("is_deleted", IsDeleteEnum.N), false);
+                            if (qcType != null) {
                                 behospitalInfo.setQcTypeId(qcType.getId());
-                            }else{
+                            } else {
                                 //新增类型到qc_type表中
-                                QcType qctype=new QcType();
+                                QcType qctype = new QcType();
                                 qctype.setHospitalId(s.getHospitalId());
                                 qctype.setName(s.getRecTitle());
                                 qctype.setGmtCreate(new Date());
 
-                                Long id=qcTypeFacade.saveT(qctype);
+                                Long id = qcTypeFacade.saveT(qctype);
                                 behospitalInfo.setQcTypeId(id);
 
                                 //新增类型到监测表中
-                                QcAbnormal qcAbnormal=new QcAbnormal();
+                                QcAbnormal qcAbnormal = new QcAbnormal();
                                 qcAbnormal.setHospitalId(s.getHospitalId());
                                 qcAbnormal.setBehospitalCode(s.getBehospitalCode());
                                 qcAbnormal.setType(2);
@@ -366,52 +614,53 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
                     }
                 });
             }
-            if(addE.size()>0){
+            if (addE.size() > 0) {
                 medicalRecordService.saveBatch(addE);
             }
-            if(updateE.size()>0){
+            if (updateE.size() > 0) {
                 medicalRecordService.updateBatchByKey(updateE);
             }
-            if(qcAbnormalList.size()>0){
+            if (qcAbnormalList.size() > 0) {
                 qcAbnormalService.saveBatch(qcAbnormalList);
             }
-            if(behospitalInfoList.size()>0){
+            if (behospitalInfoList.size() > 0) {
                 behospitalInfoFacade.updateBatchByKey(behospitalInfoList);
             }
-            aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(medicalRecordList),"","操作正常!");
-        }catch (Exception e){
-            aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(medicalRecordList),"",e.getMessage());
+            aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息", JSON.toJSONString(medicalRecordList), "", "操作正常!");
+        } catch (Exception e) {
+            aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息", JSON.toJSONString(medicalRecordList), "", e.getMessage());
         }
     }
 
 
     /**
      * 初始化模型ID
+     *
      * @param medicalRecord
      * @return
      */
-    private Long initModeId(MedicalRecord medicalRecord){
-        Long modeId=Long.valueOf("0");
+    private Long initModeId(MedicalRecord medicalRecord) {
+        Long modeId = Long.valueOf("0");
         try {
             QueryWrapper<ModelHospital> wrapper = new QueryWrapper<>();
-            wrapper.eq("hospital_id",medicalRecord.getHospitalId());
-            wrapper.eq("hospital_model_name",medicalRecord.getRecTitle());
-            ModelHospital mode=modelHospitalFacade.getOne(wrapper, false);
-            if(mode!=null){
-                modeId=mode.getStandModelId();
-            }else{
-                modeId=Long.valueOf("0");
+            wrapper.eq("hospital_id", medicalRecord.getHospitalId());
+            wrapper.eq("hospital_model_name", medicalRecord.getRecTitle());
+            ModelHospital mode = modelHospitalFacade.getOne(wrapper, false);
+            if (mode != null) {
+                modeId = mode.getStandModelId();
+            } else {
+                modeId = Long.valueOf("0");
             }
-            aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息-初始化modeId",JSON.toJSONString(medicalRecord),modeId.toString(),"操作成功!");
+            aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息-初始化modeId", JSON.toJSONString(medicalRecord), modeId.toString(), "操作成功!");
             return modeId;
-        }catch (Exception e){
-            aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息-初始化modeId",JSON.toJSONString(medicalRecord),"",e.getMessage());
+        } catch (Exception e) {
+            aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息-初始化modeId", JSON.toJSONString(medicalRecord), "", e.getMessage());
             return modeId;
         }
 
     }
 
-    public RespDTO deleteFlag(ADeleteFlagVO aDeleteFlagVO){
+    public RespDTO deleteFlag(ADeleteFlagVO aDeleteFlagVO) {
         try {
             //验证数据是否存在
             if (StringUtil.isEmpty(aDeleteFlagVO.getRecId())) {
@@ -420,32 +669,32 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
                 return RespDTO.onError("请输入医院编码!");
             } else if (StringUtil.isEmpty(aDeleteFlagVO.getBehospitalCode())) {
                 return RespDTO.onError("请输入病人住院编码!");
-            }else {
-                UpdateWrapper<MedicalRecord> updateWrapper=new UpdateWrapper<>();
+            } else {
+                UpdateWrapper<MedicalRecord> updateWrapper = new UpdateWrapper<>();
                 updateWrapper.eq("rec_id", aDeleteFlagVO.getRecId())
                         .eq("hospital_id", aDeleteFlagVO.getHospitalId())
                         .eq("behospital_code", aDeleteFlagVO.getBehospitalCode())
-                        .eq("is_deleted",IsDeleteEnum.N)
-                        .set("is_deleted",IsDeleteEnum.Y)
+                        .eq("is_deleted", IsDeleteEnum.N)
+                        .set("is_deleted", IsDeleteEnum.Y)
                         .set("gmt_modified", DateUtil.now());
 
-                Boolean flag=update(new MedicalRecord(),updateWrapper);
-                if(flag){
-                    UpdateWrapper<MedicalRecordContent> updateWrapperContent=new UpdateWrapper<>();
+                Boolean flag = update(new MedicalRecord(), updateWrapper);
+                if (flag) {
+                    UpdateWrapper<MedicalRecordContent> updateWrapperContent = new UpdateWrapper<>();
                     updateWrapperContent.eq("rec_id", aDeleteFlagVO.getRecId())
                             .eq("hospital_id", aDeleteFlagVO.getHospitalId())
-                            .eq("is_deleted",IsDeleteEnum.N)
-                            .set("is_deleted",IsDeleteEnum.Y)
+                            .eq("is_deleted", IsDeleteEnum.N)
+                            .set("is_deleted", IsDeleteEnum.Y)
                             .set("gmt_modified", DateUtil.now());
 
-                    Boolean flagContent=aMedicalRecordContentFacade.update(new MedicalRecordContent(),updateWrapperContent);
-                    aMedAbnormalInfoFacade.saveAbnormalInfo("文书内容-删除",JSON.toJSONString(aDeleteFlagVO),JSON.toJSONString(RespDTO.onSuc(flagContent)),"操作成功!");
+                    Boolean flagContent = aMedicalRecordContentFacade.update(new MedicalRecordContent(), updateWrapperContent);
+                    aMedAbnormalInfoFacade.saveAbnormalInfo("文书内容-删除", JSON.toJSONString(aDeleteFlagVO), JSON.toJSONString(RespDTO.onSuc(flagContent)), "操作成功!");
                 }
-                aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息-删除",JSON.toJSONString(aDeleteFlagVO),JSON.toJSONString(RespDTO.onSuc(flag)),"操作成功!");
+                aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息-删除", JSON.toJSONString(aDeleteFlagVO), JSON.toJSONString(RespDTO.onSuc(flag)), "操作成功!");
                 return RespDTO.onSuc(flag);
             }
-        }catch (Exception e){
-            aMedAbnormalInfoFacade.saveAbnormalInfo("文书-删除",JSON.toJSONString(aDeleteFlagVO),"",e.getMessage());
+        } catch (Exception e) {
+            aMedAbnormalInfoFacade.saveAbnormalInfo("文书-删除", JSON.toJSONString(aDeleteFlagVO), "", e.getMessage());
             return RespDTO.onError(e.getMessage());
         }
     }

+ 149 - 0
src/main/java/com/diagbot/util/ShaoyfHtmlUtil.java

@@ -0,0 +1,149 @@
+package com.diagbot.util;
+
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2020/7/10 18:44
+ */
+public class ShaoyfHtmlUtil {
+
+    public Map<String, Object> getPageMap(String html) {
+        Map<String, Object> ret = null;
+        try {
+            ret = new HashMap<>();
+            Document doc = Jsoup.parse(html);
+            ret.put("病案首页", getOtherPageMap(doc));
+            ret.put("手术信息", getOperMaps(doc));
+            ret.put("诊断信息", getDiagMaps(doc));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return ret;
+    }
+
+    private Map<String, String> getOtherPageMap(Document doc) {
+        Elements tableElements = doc.getElementsByTag("table");
+        Map<String, String> otherPageMap = new HashMap<>();
+        for (int i = 0; i < tableElements.size(); i++) {
+            if (i == 13 || i == 20 || i == 4 || i == 14 || i == 15 || i == 12) {
+                continue;
+            }
+            tableElements.get(i).getElementsByAttributeValue("token", "term").forEach(spanElement -> {
+                otherPageMap.put(
+                        spanElement.attr("Comment"),
+                        spanElement.text().replaceAll("&nbsp;", "")
+                );
+            });
+        }
+        otherPageMap.put("联系人关系", otherPageMap.get("关系"));
+        otherPageMap.remove("关系");
+
+        tableElements.get(4).getElementsByAttributeValue("token", "term").forEach(spanElement -> {
+            String comment = spanElement.attr("Comment");
+            String text = spanElement.text().replaceAll("&nbsp;", "");
+            if (comment.equals("新生儿年龄")) {
+                comment = comment + spanElement.nextElementSibling().text();
+            }
+            otherPageMap.put(comment, text);
+        });
+
+        tableElements.get(12).getElementsByAttributeValue("token", "term").forEach(spanElement -> {
+            String comment = spanElement.attr("Comment");
+            String text = spanElement.text().replaceAll("&nbsp;", "");
+            if (comment.equals("ICD10")) {
+                otherPageMap.put("门急诊诊断编码", text);
+            } else {
+                otherPageMap.put("门急诊诊断", text);
+            }
+        });
+
+        tableElements.get(14).getElementsByAttributeValue("token", "term").forEach(spanElement -> {
+            String comment = spanElement.attr("Comment");
+            String text = spanElement.text().replaceAll("&nbsp;", "");
+            if (comment.equals("ICD10")) {
+                otherPageMap.put("损伤中毒因素编码", text);
+            } else {
+                otherPageMap.put("损伤中毒因素", text);
+            }
+        });
+
+        tableElements.get(15).getElementsByAttributeValue("token", "term").forEach(spanElement -> {
+            String comment = spanElement.attr("Comment");
+            String text = spanElement.text().replaceAll("&nbsp;", "");
+            if (comment.equals("ICD10")) {
+                otherPageMap.put("病理诊断编码", text);
+            } else if (comment.equals("病理号")) {
+                otherPageMap.put("病理诊断编号", text);
+            } else {
+                otherPageMap.put("病理诊断", text);
+            }
+        });
+        return otherPageMap;
+    }
+
+    private List<Map<String, String>> getDiagMaps(Document doc) {
+        Element tableElement = doc.getElementsByClass("tr1").get(1);
+        Elements trElements = tableElement.getElementsByTag("tr");
+        List<String> spanTexts = new ArrayList<>();
+        for (int i = 1; i < trElements.size() - 1; i++) {
+            trElements.get(i).getElementsByAttributeValue("token", "term").forEach(spanElement -> {
+                spanTexts.add(spanElement.text());
+            });
+        }
+        List<Map<String, String>> diagMaps = new ArrayList<>();
+        Map<String, String> diagMap = null;
+        String spanText = null;
+        for (int i = 0; i < spanTexts.size(); i++) {
+            spanText = spanTexts.get(i).replaceAll("&nbsp;", "");
+            if (i % 3 == 0) {
+                if (!spanText.equals("")) {
+                    diagMap = new HashMap<>();
+                    diagMap.put("诊断名称", spanText);
+                } else {
+                    diagMap = null;
+                }
+            }
+            if (diagMap == null) {
+                continue;
+            }
+            if (i % 3 == 1) {
+                diagMap.put("诊断编码", spanText);
+            }
+            if (i % 3 == 2) {
+                diagMap.put("入院情况", spanText);
+                diagMaps.add(diagMap);
+            }
+        }
+        return diagMaps;
+    }
+
+    private List<Map<String, String>> getOperMaps(Document doc) {
+        Element tableElement = doc.getElementsByClass("tr1").get(2);
+        Elements trElements = tableElement.getElementsByTag("tr");
+        List<Map<String, String>> operMaps = new ArrayList<>();
+        for (int i = 2; i < trElements.size(); i++) {
+            Map<String, String> operMap = new HashMap<>();
+            trElements.get(i).getElementsByAttributeValue("token", "term").forEach(spanElement -> {
+                operMap.put(
+                        spanElement.attr("Comment"),
+                        spanElement.text().replaceAll("&nbsp;", "")
+                );
+            });
+            if (!operMap.get("手术名称").equals("")) {
+                operMaps.add(operMap);
+            }
+        }
+        return operMaps;
+    }
+
+}

+ 7 - 0
src/main/java/com/diagbot/web/DataController.java

@@ -201,4 +201,11 @@ public class DataController {
         return RespDTO.onSuc(true);
     }
 
+    @ApiOperation(value = "筛选病案首页的手术诊断信息")
+    @PostMapping("/selectDataAndSave")
+    @SysLogger("selectDataAndSave")
+    public void selectDataAndSave(){
+        aMedicalRecordFacade.selectDataAndSave();
+    }
+
 }

+ 1 - 1
src/main/resources/application-local.yml

@@ -59,7 +59,7 @@ spring:
     druid:
       driver-class-name: com.mysql.cj.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://127.0.0.1:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+      url: jdbc:mysql://192.1.3.141:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
       username: root
       password: langtong
       # 连接池的配置信息

+ 14 - 0
src/main/resources/mapper/HomePageMapper.xml

@@ -135,6 +135,20 @@
         <result column="gmt_modified" property="gmtModified" />
         <result column="creator" property="creator" />
         <result column="modifier" property="modifier" />
+        <result column="is_physical_restraint" property="isPhysicalRestraint" />
+        <result column="tbi_behospital_before_time" property="tbiBehospitalBeforeTime" />
+        <result column="tbi_behospital_after_time" property="tbiBehospitalAfterTime" />
+        <result column="is_fall_bed" property="isFallBed" />
+        <result column="is_nosocomial_infection" property="isNosocomialInfection" />
+        <result column="is_into_icu" property="isIntoIcu" />
+        <result column="is_complications" property="isComplications" />
+        <result column="is_pressure_sore" property="isPressureSore" />
+        <result column="is_behospital_pressure_sore" property="isBehospitalPressureSore" />
+        <result column="is_unplanned_reoperation" property="isUnplannedReoperation" />
+        <result column="treatment_results" property="treatmentResults" />
+        <result column="complications_results" property="complicationsResults" />
+        <result column="infection_site" property="infectionSite" />
+        <result column="is_be_in_danger" property="isBeInDanger" />
     </resultMap>
 
 

+ 5 - 5
src/test/java/com/diagbot/CodeGeneration.java

@@ -27,13 +27,13 @@ public class CodeGeneration {
 
         // 全局配置
         GlobalConfig gc = new GlobalConfig();
-        gc.setOutputDir("E://code//mrqcsys");
+        gc.setOutputDir("C://code//mrqcsys");
         gc.setFileOverride(true);
         gc.setActiveRecord(false);// 不需要ActiveRecord特性的请改为false
         gc.setEnableCache(false);// XML 二级缓存
         gc.setBaseResultMap(true);// XML ResultMap
         gc.setBaseColumnList(false);// XML columList
-        gc.setAuthor("gaodm");// 作者
+        gc.setAuthor("lipc");// 作者
 
         // 自定义文件命名,注意 %s 会自动填充表实体属性!
         gc.setControllerName("%sController");
@@ -48,15 +48,15 @@ public class CodeGeneration {
         dsc.setDbType(DbType.MYSQL);
         dsc.setDriverName("com.mysql.cj.jdbc.Driver");
         dsc.setUsername("root");
-        dsc.setPassword("lantone");
-        dsc.setUrl("jdbc:mysql://192.168.3.5:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8");
+        dsc.setPassword("langtong");
+        dsc.setUrl("jdbc:mysql://192.1.3.141:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8");
         mpg.setDataSource(dsc);
 
         // 策略配置
         StrategyConfig strategy = new StrategyConfig();
 //        strategy.setTablePrefix(new String[] { "med_" });// 此处可以修改为您的表前缀
         strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
-        strategy.setInclude("med_pacs_result","med_lis_result"); // 需要生成的表
+        strategy.setInclude("med_home_page"); // 需要生成的表
 
         strategy.setSuperServiceClass(null);
         strategy.setSuperServiceImplClass(null);