Commit dcfe74ee217e4a0a5fd1ebd2bfb307643a7c9cba
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 16 changed files
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntExRecordService.java
- platform-dal/src/main/java/com/lyms/platform/pojo/AntExRecordModel.java
- platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/AntExQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/AntExRecordQuery.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/Cdfy/CdGwInterface.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/Cdfy/ConnTools.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/zcfy/ConnTools.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/zcfy/ZcPrenatalService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/AntExManagerQueryRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntExRecordService.java
View file @
dcfe74e
| ... | ... | @@ -187,6 +187,8 @@ |
| 187 | 187 | |
| 188 | 188 | public AntExRecordModel convert(AntenatalExaminationModel antEx) { |
| 189 | 189 | AntExRecordModel antExRecordModel = new AntExRecordModel(); |
| 190 | + | |
| 191 | + antExRecordModel.setTreatOpinion(antEx.getTreatmentOpinion()); | |
| 190 | 192 | antExRecordModel.setScreenResult(antEx.getScreenResult()); |
| 191 | 193 | antExRecordModel.setParentId(antEx.getParentId()); |
| 192 | 194 | antExRecordModel.setfId(antEx.getId()); |
| ... | ... | @@ -253,6 +255,7 @@ |
| 253 | 255 | |
| 254 | 256 | public AntExRecordModel convert(AntExChuModel antExChuModel) { |
| 255 | 257 | AntExRecordModel antExRecordModel = new AntExRecordModel(); |
| 258 | + antExRecordModel.setTreatOpinion(antExChuModel.getTreatOpinion()); | |
| 256 | 259 | antExRecordModel.setScreenResult(antExChuModel.getScreenResult()); |
| 257 | 260 | antExRecordModel.setCheckDoctor(antExChuModel.getProdDoctor()); |
| 258 | 261 | antExRecordModel.setHospitalId(antExChuModel.getHospitalId()); |
platform-dal/src/main/java/com/lyms/platform/pojo/AntExRecordModel.java
View file @
dcfe74e
| ... | ... | @@ -91,6 +91,17 @@ |
| 91 | 91 | |
| 92 | 92 | private Integer first; // 1否 2 是,是否当前医院第一次初诊 德州需求 |
| 93 | 93 | |
| 94 | + //处理意见 | |
| 95 | + private String treatOpinion; | |
| 96 | + | |
| 97 | + public String getTreatOpinion() { | |
| 98 | + return treatOpinion; | |
| 99 | + } | |
| 100 | + | |
| 101 | + public void setTreatOpinion(String treatOpinion) { | |
| 102 | + this.treatOpinion = treatOpinion; | |
| 103 | + } | |
| 104 | + | |
| 94 | 105 | public List getIncrhRisk() { |
| 95 | 106 | return incrhRisk; |
| 96 | 107 | } |
platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java
View file @
dcfe74e
| ... | ... | @@ -37,6 +37,16 @@ |
| 37 | 37 | // 其他高危 |
| 38 | 38 | private String otherHighRisk; |
| 39 | 39 | |
| 40 | + private boolean isOpinion; | |
| 41 | + | |
| 42 | + public boolean isOpinion() { | |
| 43 | + return isOpinion; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public void setIsOpinion(boolean isOpinion) { | |
| 47 | + this.isOpinion = isOpinion; | |
| 48 | + } | |
| 49 | + | |
| 40 | 50 | public String getCheckDoctor() { |
| 41 | 51 | return checkDoctor; |
| 42 | 52 | } |
| ... | ... | @@ -188,6 +198,11 @@ |
| 188 | 198 | if (null != otherHighRisk) { |
| 189 | 199 | condition = condition.and("otherHighRisk", otherHighRisk, MongoOper.NE); |
| 190 | 200 | } |
| 201 | + | |
| 202 | + if (isOpinion) { | |
| 203 | + condition = condition.and("treatOpinion", true, MongoOper.EXISTS); | |
| 204 | + } | |
| 205 | + | |
| 191 | 206 | if(CollectionUtils.isNotEmpty(parentIds)){ |
| 192 | 207 | condition = condition.and("parentId", parentIds, MongoOper.IN); |
| 193 | 208 | } |
platform-dal/src/main/java/com/lyms/platform/query/AntExQuery.java
View file @
dcfe74e
| ... | ... | @@ -40,6 +40,16 @@ |
| 40 | 40 | //其他高危 |
| 41 | 41 | private String otherRisk; |
| 42 | 42 | |
| 43 | + private boolean isOpinion; | |
| 44 | + | |
| 45 | + public boolean isOpinion() { | |
| 46 | + return isOpinion; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public void setIsOpinion(boolean isOpinion) { | |
| 50 | + this.isOpinion = isOpinion; | |
| 51 | + } | |
| 52 | + | |
| 43 | 53 | public String getOtherRisk() { |
| 44 | 54 | return otherRisk; |
| 45 | 55 | } |
| ... | ... | @@ -156,6 +166,9 @@ |
| 156 | 166 | condition= condition.and("checkDoctor",checkDoctor, MongoOper.IS); |
| 157 | 167 | } |
| 158 | 168 | |
| 169 | + if (isOpinion) { | |
| 170 | + condition = condition.and("treatOpinion", true, MongoOper.EXISTS); | |
| 171 | + } | |
| 159 | 172 | |
| 160 | 173 | boolean isAddStart = Boolean.FALSE; |
| 161 | 174 | Criteria c = null; |
platform-dal/src/main/java/com/lyms/platform/query/AntExRecordQuery.java
View file @
dcfe74e
| ... | ... | @@ -65,6 +65,27 @@ |
| 65 | 65 | private Integer type; |
| 66 | 66 | private String neqId; |
| 67 | 67 | |
| 68 | + //处理意见 | |
| 69 | + private String treatOpinion; | |
| 70 | + | |
| 71 | + private boolean isOpinion; | |
| 72 | + | |
| 73 | + public boolean isOpinion() { | |
| 74 | + return isOpinion; | |
| 75 | + } | |
| 76 | + | |
| 77 | + public void setIsOpinion(boolean isOpinion) { | |
| 78 | + this.isOpinion = isOpinion; | |
| 79 | + } | |
| 80 | + | |
| 81 | + public String getTreatOpinion() { | |
| 82 | + return treatOpinion; | |
| 83 | + } | |
| 84 | + | |
| 85 | + public void setTreatOpinion(String treatOpinion) { | |
| 86 | + this.treatOpinion = treatOpinion; | |
| 87 | + } | |
| 88 | + | |
| 68 | 89 | public List<String> getIds() { |
| 69 | 90 | return ids; |
| 70 | 91 | } |
| ... | ... | @@ -497,6 +518,8 @@ |
| 497 | 518 | condition = condition.and("checkDoctor", null, MongoOper.NE); |
| 498 | 519 | } |
| 499 | 520 | |
| 521 | + | |
| 522 | + | |
| 500 | 523 | if (StringUtils.isNotEmpty(levelId)) { |
| 501 | 524 | condition = condition.and("hLevel", levelId, MongoOper.IN); |
| 502 | 525 | } |
| ... | ... | @@ -553,6 +576,23 @@ |
| 553 | 576 | |
| 554 | 577 | |
| 555 | 578 | Criteria c = null; |
| 579 | + | |
| 580 | + if (isOpinion) | |
| 581 | + { | |
| 582 | + if (null != treatOpinion) { | |
| 583 | + condition = condition.and("treatOpinion", treatOpinion, MongoOper.LIKE); | |
| 584 | + } | |
| 585 | + else | |
| 586 | + { | |
| 587 | + condition = condition.and("treatOpinion", null, MongoOper.NE); | |
| 588 | + } | |
| 589 | + } | |
| 590 | + else | |
| 591 | + { | |
| 592 | + condition = condition.and("treatOpinion", false, MongoOper.EXISTS); | |
| 593 | + } | |
| 594 | + | |
| 595 | + | |
| 556 | 596 | if (null != buildTimeStart) { |
| 557 | 597 | c = Criteria.where("buildTime").gte(buildTimeStart); |
| 558 | 598 | } |
platform-operate-api/src/main/java/com/lyms/hospitalapi/Cdfy/CdGwInterface.java
View file @
dcfe74e
| 1 | 1 | package com.lyms.hospitalapi.Cdfy; |
| 2 | 2 | |
| 3 | 3 | import com.lyms.hospitalapi.pojo.HealthRecord; |
| 4 | +import com.lyms.platform.biz.service.BasicConfigService; | |
| 5 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
| 6 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
| 7 | +import com.lyms.platform.common.utils.PropertiesUtil; | |
| 8 | +import com.lyms.platform.operate.web.utils.CommonsHelper; | |
| 4 | 9 | import com.lyms.platform.pojo.Patients; |
| 10 | +import org.apache.commons.dbutils.DbUtils; | |
| 11 | +import org.apache.commons.dbutils.QueryRunner; | |
| 12 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 5 | 13 | import org.springframework.stereotype.Service; |
| 6 | 14 | |
| 15 | +import java.sql.Connection; | |
| 16 | + | |
| 7 | 17 | /** |
| 8 | - * Created by Administrator on 2018/4/18. | |
| 18 | + * Created by Administrator on 2018/5/21. | |
| 9 | 19 | * 承德公共卫生系统接口(gxk) |
| 20 | + * 保存个人基本信息,保存地址信息 | |
| 10 | 21 | */ |
| 11 | 22 | @Service("cdGwInterface") |
| 12 | 23 | public class CdGwInterface { |
| 13 | 24 | |
| 14 | - //保存孕妇建档(更新健康档案暂时不支持) | |
| 15 | - private static String jdUrl = "http://gxgg.greatsoft.net:8083/maternal/personInfo/savePersonInfo"; | |
| 25 | + @Autowired | |
| 26 | + private BasicConfigService basicConfigService; | |
| 16 | 27 | |
| 28 | + public BaseObjectResponse saveBaseInfo(Patients patient,String hosipitalId){ | |
| 17 | 29 | |
| 18 | - public String saveRecord(Patients patient,String hosipitalId){ | |
| 30 | + //户籍地址 | |
| 31 | + String hjSheng = CommonsHelper.getName1(patient.getProvinceId(),basicConfigService); | |
| 32 | + String hjShi = CommonsHelper.getName1(patient.getCityId(),basicConfigService); | |
| 33 | + String hjXian = CommonsHelper.getName1(patient.getAreaId(), basicConfigService); | |
| 34 | + String hjXiang = CommonsHelper.getName1(patient.getStreetId(),basicConfigService); | |
| 19 | 35 | |
| 36 | + //居住地址 | |
| 37 | + String jzSheng = CommonsHelper.getName1(patient.getProvinceRegisterId(),basicConfigService); | |
| 38 | + String jzShi = CommonsHelper.getName1(patient.getCityRegisterId(),basicConfigService); | |
| 39 | + String jzXian = CommonsHelper.getName1(patient.getAreaRegisterId(),basicConfigService); | |
| 40 | + String jzXiang = CommonsHelper.getName1(patient.getStreetRegisterId(),basicConfigService); | |
| 20 | 41 | |
| 42 | + //产后居住地 | |
| 43 | + String chSheng = CommonsHelper.getName1(patient.getProvincePostRestId(),basicConfigService); | |
| 44 | + String chShi = CommonsHelper.getName1(patient.getCityPostRestId(),basicConfigService); | |
| 45 | + String chXian = CommonsHelper.getName1(patient.getAreaPostRestId(),basicConfigService); | |
| 46 | + String chXiang = CommonsHelper.getName1(patient.getStreetPostRestId(),basicConfigService); | |
| 21 | 47 | |
| 22 | - HealthRecord HealthRecord = new HealthRecord(); | |
| 23 | - HealthRecord.setPersonInfoId(""); | |
| 24 | - HealthRecord.setName(patient.getUsername()); | |
| 25 | - HealthRecord.setPinYinStr("无"); | |
| 26 | - HealthRecord.setIdNo(patient.getCardNo()); | |
| 27 | - HealthRecord.setTelNo(patient.getPhone()); | |
| 28 | - HealthRecord.setBirthday(patient.getBirth()); | |
| 29 | - HealthRecord.setAddress(""); | |
| 48 | + BaseObjectResponse br = new BaseObjectResponse(); | |
| 49 | + Connection conn = ConnTools.makeGwConnection(); | |
| 50 | + QueryRunner queryRunner = new QueryRunner(); | |
| 51 | + //个人基本信息语句 | |
| 52 | + String inBaseInfoSql = "insert into baseinfo(ORG_CODE,PATIENT_ID,CARD_NO,CARD_TYPE_CODE,NAME,\n" + | |
| 53 | + "SEX_CODE,BIRTH_DATE,ID_TYPE_CODE,ID_NO,EMPLOYER_NAME,TEL_NO,\n" + | |
| 54 | + "CONTACT_NAME,CONTACT_TEL_NO,NATIONALITY_CODE,ABO_CODE,RH_CODE,\n" + | |
| 55 | + "EDUCATION_CODE,OCCUPATION_CODE,MARRIAGE_CODE,DRUG_ALLERGY_MARK,OP_HISTORY_MARK,TRAUMA_HISTORY_MARK,\n" + | |
| 56 | + "BLOOD_TRANSF_MARK,GENETIC_DISEASE_HISTORY,OPERATION_HISTORY,Sec_Type_Code,Employer_Tel_No,DELETE_MARK)\n" + | |
| 57 | + "vakues("+patient.getHospitalId()+","+patient.getId()+","+patient.getVcCardNo()+",'03',"+patient.getUsername()+",\n" + | |
| 58 | + "'2',"+patient.getBirth()+",'01',"+patient.getCardNo()+","+patient.getPworkUnit()+","+patient.getPhone()+",\n" + | |
| 59 | + ""+patient.getHusbandName()+","+patient.getHusbandPhone()+","+patient.getPnationId()+",'5','4',\n" + | |
| 60 | + "'',"+patient.getPprofessionTypeId()+",'20','0','0','0',\n" + | |
| 61 | + "'9','无','无','01','无','0')"; | |
| 30 | 62 | |
| 63 | + //地址信息语句,01:户籍地址 | |
| 64 | + String inAddressSql01 = "insert into baseinfo_address(ORG_CODE,PATIENT_ID,Address_Type_Code,Addr_Province,Addr_City,\n" + | |
| 65 | + "Addr_County,Addr_Town,Addr_Village,Addr_House_No,Postal_Code,DELETE_MARK) \n" + | |
| 66 | + "values("+patient.getHospitalId()+","+patient.getId()+",'01',"+hjSheng+","+hjShi+",\n" + | |
| 67 | + ""+hjXian+","+hjXiang+","+patient.getAddress()+","+patient.getAddress()+",'','0')"; | |
| 31 | 68 | |
| 32 | - HealthRecord.setIsAppCreate("9"); | |
| 33 | - HealthRecord.setRemarks("无"); | |
| 34 | - HealthRecord.setModifier(""); | |
| 35 | - HealthRecord.setModifierId(""); | |
| 69 | + //地址信息语句,03:居住地址 | |
| 70 | + String inAddressSql03 = "insert into baseinfo_address(ORG_CODE,PATIENT_ID,Address_Type_Code,Addr_Province,Addr_City,\n" + | |
| 71 | + "Addr_County,Addr_Town,Addr_Village,Addr_House_No,Postal_Code,DELETE_MARK) \n" + | |
| 72 | + "values("+patient.getHospitalId()+","+patient.getId()+",'03',"+jzSheng+","+jzShi+",\n" + | |
| 73 | + ""+jzXian+","+jzXiang+","+patient.getAddressRegister()+","+patient.getAddressRegister()+",'','0')"; | |
| 74 | + | |
| 75 | + //地址信息语句,07:产后居住地 | |
| 76 | + String inAddressSql07 = "insert into baseinfo_address(ORG_CODE,PATIENT_ID,Address_Type_Code,Addr_Province,Addr_City,\n" + | |
| 77 | + "Addr_County,Addr_Town,Addr_Village,Addr_House_No,Postal_Code,DELETE_MARK) \n" + | |
| 78 | + "values("+patient.getHospitalId()+","+patient.getId()+",'07',"+chSheng+","+chShi+",\n" + | |
| 79 | + ""+chXian+","+chXiang+","+patient.getAddressPostRest()+","+patient.getAddressPostRest()+",'','0')"; | |
| 80 | + | |
| 81 | + try{ | |
| 82 | + //执行插入个人基本信息表(BASEINFO) | |
| 83 | + int result = queryRunner.update(conn,inBaseInfoSql); | |
| 84 | + if(result > 0){ | |
| 85 | + int adress01 = queryRunner.update(conn,inAddressSql01); | |
| 86 | + if(adress01 > 0){ | |
| 87 | + int adress03 = queryRunner.update(conn,inAddressSql03); | |
| 88 | + if(adress03 > 0){ | |
| 89 | + int adress07 = queryRunner.update(conn,inAddressSql07); | |
| 90 | + if(adress07 > 0){ | |
| 91 | + br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 92 | + br.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); | |
| 93 | + return br; | |
| 94 | + }else{ | |
| 95 | + br.setErrorcode(-1); | |
| 96 | + br.setErrormsg("产后居住地址信息保存有误!"); | |
| 97 | + return br; | |
| 98 | + } | |
| 99 | + }else{ | |
| 100 | + br.setErrorcode(-1); | |
| 101 | + br.setErrormsg("居住地址信息保存有误!"); | |
| 102 | + return br; | |
| 103 | + } | |
| 104 | + }else { | |
| 105 | + br.setErrorcode(-1); | |
| 106 | + br.setErrormsg("户籍地址信息保存有误!"); | |
| 107 | + return br; | |
| 108 | + } | |
| 109 | + | |
| 110 | + } | |
| 111 | + }catch (Exception e){ | |
| 112 | + e.printStackTrace(); | |
| 113 | + }finally { | |
| 114 | + DbUtils.closeQuietly(conn); | |
| 115 | + } | |
| 116 | + | |
| 117 | + | |
| 36 | 118 | |
| 37 | 119 | |
| 38 | 120 | return null; |
platform-operate-api/src/main/java/com/lyms/hospitalapi/Cdfy/ConnTools.java
View file @
dcfe74e
| ... | ... | @@ -15,6 +15,14 @@ |
| 15 | 15 | private static String hisPassword = "his"; |
| 16 | 16 | |
| 17 | 17 | |
| 18 | + private static String gwDirverClassName = "oracle.jdbc.driver.OracleDriver"; | |
| 19 | + private static String gwUrl = "jdbc:oracle:thin:@10.0.255.18:1521:fycehr"; | |
| 20 | + private static String gwUser = "FYCEHR"; | |
| 21 | + private static String gwPassword = "fycehr"; | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 18 | 26 | public static Connection makeHisConnection() { |
| 19 | 27 | Connection conn = null; |
| 20 | 28 | try { |
| ... | ... | @@ -29,6 +37,25 @@ |
| 29 | 37 | } |
| 30 | 38 | return conn; |
| 31 | 39 | } |
| 40 | + | |
| 41 | + | |
| 42 | + public static Connection makeGwConnection() { | |
| 43 | + Connection conn = null; | |
| 44 | + try { | |
| 45 | + Class.forName(gwDirverClassName); | |
| 46 | + } catch (ClassNotFoundException e) { | |
| 47 | + e.printStackTrace(); | |
| 48 | + } | |
| 49 | + try { | |
| 50 | + conn = DriverManager.getConnection(gwUrl, gwUser, gwPassword); | |
| 51 | + } catch (SQLException e) { | |
| 52 | + e.printStackTrace(); | |
| 53 | + } | |
| 54 | + return conn; | |
| 55 | + } | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 32 | 59 | |
| 33 | 60 | } |
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java
View file @
dcfe74e
| ... | ... | @@ -925,11 +925,11 @@ |
| 925 | 925 | |
| 926 | 926 | SimpleDateFormat fmt2 = new SimpleDateFormat("yyyy-MM-dd"); |
| 927 | 927 | SimpleDateFormat fmt1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| 928 | - MaternalDeliverResult maternalDeliverResult = new MaternalDeliverResult(); | |
| 928 | + SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMddHH:mm:ss"); | |
| 929 | 929 | |
| 930 | - SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
| 931 | - Date startTime = DateUtil.addMonth(new Date(),8); | |
| 932 | - String start = fmt.format(startTime); | |
| 930 | +// SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
| 931 | +// Date startTime = DateUtil.addMonth(new Date(),-8); | |
| 932 | +// String start = fmt.format(startTime); | |
| 933 | 933 | |
| 934 | 934 | Connection conn = ConnTools.makeFmConnection(); |
| 935 | 935 | QueryRunner queryRunner = new QueryRunner(); |
| 936 | 936 | |
| ... | ... | @@ -979,12 +979,13 @@ |
| 979 | 979 | " SRKS as srks,\n" + |
| 980 | 980 | " JSZ as jsz"; |
| 981 | 981 | |
| 982 | - String sql1="select "+cloumns+" from JHMK_FMJL_LYMS where JSZ is not null and SC is not null and TZ is not null and CONVERT(DATETIME,left(JLRQ,8)+' '+RIGHT(JLRQ,8),20) > CONVERT(DATETIME,'"+start+"', 120) and SYXH='"+patInfo.getSyxh()+"'"; | |
| 982 | + String sql1="select "+cloumns+" from JHMK_FMJL_LYMS where JSZ is not null and SC is not null and TZ is not null and SYXH='"+patInfo.getSyxh()+"'"; | |
| 983 | 983 | |
| 984 | 984 | List<FmItem> duoTaiList = queryRunner.query(conn,sql1 |
| 985 | 985 | , new BeanListHandler<FmItem>(FmItem.class)); |
| 986 | 986 | |
| 987 | 987 | if (CollectionUtils.isNotEmpty(duoTaiList)) { |
| 988 | + MaternalDeliverResult maternalDeliverResult = new MaternalDeliverResult(); | |
| 988 | 989 | Map<String,List<FmItem>> maps = new HashMap<>(); |
| 989 | 990 | for(FmItem item : duoTaiList) |
| 990 | 991 | { |
| ... | ... | @@ -1099,6 +1100,7 @@ |
| 1099 | 1100 | maternalDeliverResult.setBabies(babys); |
| 1100 | 1101 | } |
| 1101 | 1102 | } |
| 1103 | + return maternalDeliverResult; | |
| 1102 | 1104 | } |
| 1103 | 1105 | } |
| 1104 | 1106 | }catch (Exception e){ |
| ... | ... | @@ -1109,7 +1111,7 @@ |
| 1109 | 1111 | |
| 1110 | 1112 | } |
| 1111 | 1113 | |
| 1112 | - return maternalDeliverResult; | |
| 1114 | + return null; | |
| 1113 | 1115 | } |
| 1114 | 1116 | |
| 1115 | 1117 |
platform-operate-api/src/main/java/com/lyms/hospitalapi/zcfy/ConnTools.java
View file @
dcfe74e
| ... | ... | @@ -19,7 +19,13 @@ |
| 19 | 19 | private static String fmUser = "lymsfm"; |
| 20 | 20 | private static String fmPassword = "lyms123"; |
| 21 | 21 | |
| 22 | + private static String czDirverClassName = "com.mysql.jdbc.Driver"; | |
| 23 | + private static String czUrl = "jdbc:mysql://119.90.57.26:3306/platform?useUnicode=true&characterEncoding=utf8"; | |
| 24 | + private static String czUser = "platform"; | |
| 25 | + private static String czPassword = "platform123"; | |
| 22 | 26 | |
| 27 | + | |
| 28 | + | |
| 23 | 29 | public static Connection makeHisConnection() { |
| 24 | 30 | Connection conn = null; |
| 25 | 31 | try { |
| ... | ... | @@ -48,6 +54,26 @@ |
| 48 | 54 | } |
| 49 | 55 | try { |
| 50 | 56 | conn = DriverManager.getConnection(fmUrl, fmUser, fmPassword); |
| 57 | + } catch (SQLException e) { | |
| 58 | + e.printStackTrace(); | |
| 59 | + } | |
| 60 | + return conn; | |
| 61 | + } | |
| 62 | + | |
| 63 | + | |
| 64 | + /** | |
| 65 | + * 诸城初诊,复诊连接源 | |
| 66 | + * @return | |
| 67 | + */ | |
| 68 | + public static Connection makeCzConnection() { | |
| 69 | + Connection conn = null; | |
| 70 | + try { | |
| 71 | + Class.forName(czDirverClassName); | |
| 72 | + } catch (ClassNotFoundException e) { | |
| 73 | + e.printStackTrace(); | |
| 74 | + } | |
| 75 | + try { | |
| 76 | + conn = DriverManager.getConnection(czUrl, czUser, czPassword); | |
| 51 | 77 | } catch (SQLException e) { |
| 52 | 78 | e.printStackTrace(); |
| 53 | 79 | } |
platform-operate-api/src/main/java/com/lyms/hospitalapi/zcfy/ZcPrenatalService.java
View file @
dcfe74e
| 1 | +package com.lyms.hospitalapi.zcfy; | |
| 2 | + | |
| 3 | +import com.lyms.platform.biz.service.PatientsService; | |
| 4 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
| 5 | +import com.lyms.platform.common.result.BaseListResponse; | |
| 6 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
| 7 | +import com.lyms.platform.operate.web.facade.ViewFacade; | |
| 8 | +import com.lyms.platform.pojo.AntExChuModel; | |
| 9 | +import com.lyms.platform.pojo.AntenatalExaminationModel; | |
| 10 | +import com.lyms.platform.pojo.Patients; | |
| 11 | +import org.apache.commons.lang.StringUtils; | |
| 12 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 13 | +import org.springframework.stereotype.Service; | |
| 14 | + | |
| 15 | +import java.sql.Connection; | |
| 16 | +import java.sql.PreparedStatement; | |
| 17 | +import java.sql.ResultSet; | |
| 18 | +import java.util.List; | |
| 19 | +import java.util.Map; | |
| 20 | + | |
| 21 | +/** | |
| 22 | + * 诸城初诊复诊接口(GXK) | |
| 23 | + * Created by Administrator on 2018/6/17. | |
| 24 | + */ | |
| 25 | +@Service("zcPrenatalService") | |
| 26 | +public class ZcPrenatalService { | |
| 27 | + | |
| 28 | + @Autowired | |
| 29 | + private PatientsService patientsService; | |
| 30 | + @Autowired | |
| 31 | + private ViewFacade viewFacade; | |
| 32 | + | |
| 33 | + //初诊 | |
| 34 | + public BaseObjectResponse saveAntexChu(AntExChuModel antExChuModel) { | |
| 35 | + | |
| 36 | + PreparedStatement ps = null; | |
| 37 | + ResultSet rs = null; | |
| 38 | + Connection conn = ConnTools.makeCzConnection(); | |
| 39 | + int count = 0; | |
| 40 | + | |
| 41 | + try { | |
| 42 | + //首先查询孕妇的基本信息(就诊卡号,身份证,电话号码),以便于对方查询数据 | |
| 43 | + Patients patients = patientsService.findOnePatientById(antExChuModel.getParentId()); | |
| 44 | + | |
| 45 | + BaseObjectResponse br = viewFacade.findAntExChu(antExChuModel.getId()); | |
| 46 | + | |
| 47 | + if (br.getData() != null && patients != null) { | |
| 48 | + | |
| 49 | + if (StringUtils.isNotEmpty(antExChuModel.getId())) { | |
| 50 | + | |
| 51 | + String slSql = "select count(*) from lyms_zccscz where id = \"" + antExChuModel.getId() + "\""; | |
| 52 | + ps=conn.prepareStatement(slSql); | |
| 53 | + rs=ps.executeQuery(); | |
| 54 | + if(rs.next()){ | |
| 55 | + count=rs.getInt(1); | |
| 56 | + } | |
| 57 | + if(count > 0){//更新数据 | |
| 58 | + | |
| 59 | + String upSql = "delete from lyms_zccscz where id =\""+antExChuModel.getId()+"\""; | |
| 60 | + ps = conn.prepareStatement(upSql); | |
| 61 | + int delCount = ps.executeUpdate(); | |
| 62 | + if(delCount == 1){ | |
| 63 | + System.out.print("旧数据删除成功!"); | |
| 64 | + } | |
| 65 | + | |
| 66 | + } | |
| 67 | + | |
| 68 | + //新增数据 | |
| 69 | + Map<String,Object> map = (Map)br.getData(); | |
| 70 | + List<Map<String,Object>> list = (List)map.get("placentas"); | |
| 71 | + String fetalPosition = null; | |
| 72 | + String heartRate = null; | |
| 73 | + String fetalPresentation = null; | |
| 74 | + String join1 = null; | |
| 75 | + /*String dueDate = map.get("dueDate").toString(); | |
| 76 | + String lastMenses = map.get("lastMenses").toString();*/ | |
| 77 | + | |
| 78 | + | |
| 79 | + if(list != null && list.size()>0){ | |
| 80 | + fetalPosition = list.get(0).get("fetalPosition").toString();//胎方位 | |
| 81 | + heartRate = list.get(0).get("heartRate").toString();//心率 | |
| 82 | + fetalPresentation = list.get(0).get("fetalPresentation").toString();//胎先露 | |
| 83 | + join1 = list.get(0).get("join").toString();//衔接 | |
| 84 | + | |
| 85 | + } | |
| 86 | + String inSql = "insert into lyms_zccscz(id,name,idcard,vccardno,\n" + | |
| 87 | + "phone,genRemark,gynRemark,treatmentOpinion3,\n" + | |
| 88 | + "quicken,quickenRemark,resultSupple,syjgSelect,\n" + | |
| 89 | + "hivktSelect,neoDeathTodo,birthDefectTodo,neoDeath,\n" + | |
| 90 | + "birthDefect,dueDate,lastMenses,bg,pastHistory,\n" + | |
| 91 | + "familyHistory,personalHistory,ymjzHistory,ywgmHistory,\n" + | |
| 92 | + "fksxHistory,ysfyHistory,cestationInfo,hHealthInfo,\n" + | |
| 93 | + "pregnancyTimes,prodTime,delivery,planedProd,\n" + | |
| 94 | + "abortion,stillbirth,stillChan,height,weight,\n" + | |
| 95 | + "yqWeight,baricIndex,bp,heart,lungs,\n" + | |
| 96 | + "vulva,vagina,cervical,uterus,fujian,\n" + | |
| 97 | + "gonggao,fuwei,edema,tireNumber,xhdb,\n" + | |
| 98 | + "bxbjs,platelet,chgOther,ndb,nt,\n" + | |
| 99 | + "urineKetone,bld,ncgOther,abo,rh,\n" + | |
| 100 | + "bloodSugar,xqgbzam,xqgczam,albumin,totalBilirubin,\n" + | |
| 101 | + "jhBilirubin,ygbmky,ygbmkt,ygeky,ygekt,\n" + | |
| 102 | + "yghxkt,xqjq,xnsd,hivkt,ydfmw,ydqjd,\n" + | |
| 103 | + "bChao,heartRate,fetalPosition,fetalPresentation,join1,checkDate,\n" + | |
| 104 | + "cDueWeek,checkDoctor,hospital,dirOpinion) " + | |
| 105 | + "values(\""+antExChuModel.getId()+"\",\""+patients.getUsername()+"\",\""+patients.getCardNo()+"\",\""+patients.getVcCardNo()+"\",\n" + | |
| 106 | + "\""+patients.getPhone()+"\",\""+map.get("genRemark")+"\",\""+map.get("gynRemark")+"\",\""+map.get("treatmentOpinion3")+"\",\n" + | |
| 107 | + "\""+map.get("quicken")+"\",\""+map.get("quickenRemark")+"\",\""+map.get("resultSupple")+"\",\""+map.get("syjgSelect")+"\",\n" + | |
| 108 | + "\""+map.get("hivktSelect")+"\",\""+map.get("neoDeathTodo")+"\",\""+map.get("birthDefectTodo")+"\",\""+map.get("neoDeath")+"\",\n" + | |
| 109 | + "\""+map.get("birthDefect")+"\",\""+map.get("dueDate")+"\",\""+map.get("lastMenses")+"\",\""+map.get("bg")+"\",\""+map.get("pastHistory")+"\",\n" + | |
| 110 | + "\""+map.get("familyHistory")+"\",\""+map.get("personalHistory")+"\",\""+map.get("ymjzHistory")+"\",\""+map.get("ywgmHistory")+"\",\n" + | |
| 111 | + "\""+map.get("fksxHistory")+"\",\""+map.get("ysfyHistory")+"\",\""+map.get("cestationInfo")+"\",\""+map.get("hHealthInfo")+"\",\n" + | |
| 112 | + "\""+map.get("pregnancyTimes")+"\",\""+map.get("prodTime")+"\",\""+map.get("delivery")+"\",\""+map.get("planedProd")+"\",\n" + | |
| 113 | + "\""+map.get("abortion")+"\",\""+map.get("stillbirth")+"\",\""+map.get("stillChan")+"\",\""+map.get("height")+"\",\""+map.get("weight")+"\",\n" + | |
| 114 | + "\""+map.get("yqWeight")+"\",\""+map.get("baricIndex")+"\",\""+map.get("bp")+"\",\""+map.get("heart")+"\",\""+map.get("lungs")+"\",\n" + | |
| 115 | + "\""+map.get("vulva")+"\",\""+map.get("vagina")+"\",\""+map.get("cervical")+"\",\""+map.get("uterus")+"\",\""+map.get("fujian")+"\",\n" + | |
| 116 | + "\""+map.get("gonggao")+"\",\""+map.get("fuwei")+"\",\""+map.get("edema")+"\",\""+map.get("tireNumber")+"\",\""+map.get("xhdb")+"\",\n" + | |
| 117 | + "\""+map.get("bxbjs")+"\",\""+map.get("platelet")+"\",\""+map.get("chgOther")+"\",\""+map.get("ndb")+"\",\""+map.get("nt")+"\",\n" + | |
| 118 | + "\""+map.get("urineKetone")+"\",\""+map.get("bld")+"\",\""+map.get("ncgOther")+"\",\""+map.get("abo")+"\",\""+map.get("rh")+"\",\n" + | |
| 119 | + "\""+map.get("bloodSugar")+"\",\""+map.get("xqgbzam")+"\",\""+map.get("xqgczam")+"\",\""+map.get("albumin")+"\",\""+map.get("totalBilirubin")+"\",\n" + | |
| 120 | + "\""+map.get("jhBilirubin")+"\",\""+map.get("ygbmky")+"\",\""+map.get("ygbmkt")+"\",\""+map.get("ygeky")+"\",\""+map.get("ygekt")+"\",\n" + | |
| 121 | + "\""+map.get("yghxkt")+"\",\""+map.get("xqjq")+"\",\""+map.get("xnsd")+"\",\""+map.get("hivkt")+"\",\""+map.get("ydfmw")+"\",\""+map.get("ydqjd")+"\",\n" + | |
| 122 | + "\""+map.get("bChao")+"\",\""+heartRate+"\",\""+fetalPosition+"\",\""+fetalPresentation+"\",\""+join1+"\",\""+map.get("checkDate")+"\",\n" + | |
| 123 | + "\""+map.get("cDueWeek")+"\",\""+map.get("checkDoctor")+"\",\""+map.get("hospital")+"\",\""+map.get("dirOpinion")+"\")"; | |
| 124 | + | |
| 125 | + ps=conn.prepareStatement(inSql); | |
| 126 | + int result = ps.executeUpdate(); | |
| 127 | + if(result > 0){ | |
| 128 | + br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 129 | + br.setErrormsg("成功"); | |
| 130 | + return br; | |
| 131 | + } | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + } | |
| 138 | + | |
| 139 | + } | |
| 140 | + | |
| 141 | + return null; | |
| 142 | + } catch (Exception e) { | |
| 143 | + e.printStackTrace(); | |
| 144 | + }finally { | |
| 145 | + try{ | |
| 146 | + ps.close(); | |
| 147 | + rs.close(); | |
| 148 | + conn.close(); | |
| 149 | + }catch (Exception e){ | |
| 150 | + e.printStackTrace(); | |
| 151 | + } | |
| 152 | + | |
| 153 | + } | |
| 154 | + return null; | |
| 155 | + } | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + //复诊 | |
| 160 | + public BaseObjectResponse saveAntexFu(AntenatalExaminationModel antenatalExaminationModel) { | |
| 161 | + | |
| 162 | + PreparedStatement ps = null; | |
| 163 | + ResultSet rs = null; | |
| 164 | + Connection conn = ConnTools.makeCzConnection(); | |
| 165 | + int count = 0; | |
| 166 | + | |
| 167 | + try{ | |
| 168 | + //首先查询孕妇基本信息 | |
| 169 | + Patients patients = patientsService.findOnePatientById(antenatalExaminationModel.getParentId()); | |
| 170 | + | |
| 171 | + BaseObjectResponse br = viewFacade.findAntenatalExamination(antenatalExaminationModel.getId()); | |
| 172 | + | |
| 173 | + if(br.getData() != null && patients != null){ | |
| 174 | + | |
| 175 | + String slSql = "select count(*) from lyms_zccsfz where id = \"" + antenatalExaminationModel.getId() + "\""; | |
| 176 | + ps = conn.prepareStatement(slSql); | |
| 177 | + rs = ps.executeQuery(); | |
| 178 | + while(rs.next()){ | |
| 179 | + count = rs.getInt(1); | |
| 180 | + } | |
| 181 | + | |
| 182 | + if(count > 0){//更新数据 | |
| 183 | + String delSql = "delete from lyms_zccsfz where id=\""+antenatalExaminationModel.getId()+"\""; | |
| 184 | + ps = conn.prepareStatement(delSql); | |
| 185 | + int delCount = ps.executeUpdate(); | |
| 186 | + if(delCount == 1){ | |
| 187 | + System.out.print("旧数据删除成功!"); | |
| 188 | + } | |
| 189 | + | |
| 190 | + } | |
| 191 | + | |
| 192 | + | |
| 193 | + //新增数据 | |
| 194 | + Map<String,Object> map = (Map)br.getData(); | |
| 195 | + List<Map<String,Object>> list = (List)map.get("tireData"); | |
| 196 | + String fetalPosition = null; | |
| 197 | + String heartRate = null; | |
| 198 | + String fetalPresentation = null; | |
| 199 | + String join1 = null; | |
| 200 | + | |
| 201 | + if(list != null && list.size()>0){ | |
| 202 | + fetalPosition = list.get(0).get("fetalPosition").toString();//胎方位 | |
| 203 | + heartRate = list.get(0).get("heartRate").toString();//心率 | |
| 204 | + fetalPresentation = list.get(0).get("fetalPresentation").toString();//胎先露 | |
| 205 | + join1 = list.get(0).get("join").toString();//衔接 | |
| 206 | + | |
| 207 | + } | |
| 208 | + | |
| 209 | + String inSql = "insert into lyms_zccsfz(id,name,idcard,vccardno,\n" + | |
| 210 | + "phone,checkDate,currentDueDate,checkDoctor,\n" + | |
| 211 | + "hospital,chiefComplaint,bp,weight,gongGao,\n" + | |
| 212 | + "abdominalCircumference,edema,tireNumber,quicken,\n" + | |
| 213 | + "quickenRemark,heartRate,FetalPosition,fetalPresentation,join1,\n" + | |
| 214 | + "hemoglobin,urineProtein,bloodSugar,bloodSugar2,\n" + | |
| 215 | + "bloodSugar3,bloodSugar4,bChao,diagnosis,\n" + | |
| 216 | + "diagnosisOther,treatmentOpinion,guide) " + | |
| 217 | + "values(\""+antenatalExaminationModel.getId()+"\",\""+patients.getUsername()+"\",\""+patients.getCardNo()+"\",\""+patients.getVcCardNo()+"\",\n" + | |
| 218 | + "\""+patients.getPhone()+"\",\""+map.get("checkDate")+"\",\""+map.get("currentDueDate")+"\",\""+map.get("checkDoctor")+"\",\n" + | |
| 219 | + "\""+map.get("hospital")+"\",\""+map.get("chiefComplaint")+"\",\""+map.get("bp")+"\",\""+map.get("weight")+"\",\""+map.get("gongGao")+"\",\n" + | |
| 220 | + "\""+map.get("abdominalCircumference")+"\",\""+map.get("edema")+"\",\""+map.get("tireNumber")+"\",\""+map.get("quicken")+"\",\n" + | |
| 221 | + "\""+map.get("quickenRemark")+"\",\""+heartRate+"\",\""+fetalPosition+"\",\""+fetalPresentation+"\",\""+join1+"\",\n" + | |
| 222 | + "\""+map.get("hemoglobin")+"\",\""+map.get("urineProtein")+"\",\""+map.get("bloodSugar")+"\",\""+map.get("bloodSugar2")+"\",\n" + | |
| 223 | + "\""+map.get("bloodSugar3")+"\",\""+map.get("bloodSugar4")+"\",\""+map.get("bChao")+"\",\""+map.get("diagnosis")+"\",\n" + | |
| 224 | + "\""+map.get("diagnosisOther")+"\",\""+map.get("treatmentOpinion")+"\",\""+map.get("guide")+"\")"; | |
| 225 | + | |
| 226 | + ps = conn.prepareStatement(inSql); | |
| 227 | + int result = ps.executeUpdate(); | |
| 228 | + if(result > 0){ | |
| 229 | + br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 230 | + br.setErrormsg("成功"); | |
| 231 | + return br; | |
| 232 | + } | |
| 233 | + | |
| 234 | + } | |
| 235 | + | |
| 236 | + }catch (Exception e){ | |
| 237 | + | |
| 238 | + e.printStackTrace(); | |
| 239 | + | |
| 240 | + }finally { | |
| 241 | + try{ | |
| 242 | + ps.close(); | |
| 243 | + rs.close(); | |
| 244 | + conn.close(); | |
| 245 | + }catch (Exception e){ | |
| 246 | + e.printStackTrace(); | |
| 247 | + } | |
| 248 | + | |
| 249 | + } | |
| 250 | + | |
| 251 | + return null; | |
| 252 | + } | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
dcfe74e
| ... | ... | @@ -6,6 +6,7 @@ |
| 6 | 6 | import com.lyms.hospitalapi.lcdcf.LcdcfFmService; |
| 7 | 7 | import com.lyms.hospitalapi.qhdfy.QhdfyFmService; |
| 8 | 8 | import com.lyms.hospitalapi.qhdfy.QhdfyHisService; |
| 9 | +import com.lyms.hospitalapi.zcfy.ZcPrenatalService; | |
| 9 | 10 | import com.lyms.platform.biz.JdbcUtil; |
| 10 | 11 | import com.lyms.platform.biz.service.*; |
| 11 | 12 | import com.lyms.platform.common.annotation.TokenRequired; |
| 12 | 13 | |
| ... | ... | @@ -143,7 +144,10 @@ |
| 143 | 144 | @Autowired |
| 144 | 145 | private com.lyms.hospitalapi.lcdcf.LcdcfFmService lcdcfFmService; |
| 145 | 146 | |
| 147 | + @Autowired | |
| 148 | + private ZcPrenatalService zcPrenatalService; | |
| 146 | 149 | |
| 150 | + | |
| 147 | 151 | static Map<String, String> highRisks = new HashMap<>(); |
| 148 | 152 | |
| 149 | 153 | static { |
| ... | ... | @@ -1655,6 +1659,125 @@ |
| 1655 | 1659 | return "upateNewHighRisk finish"; |
| 1656 | 1660 | } |
| 1657 | 1661 | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + @RequestMapping(value = "/updateRecordOpinionFu", method = RequestMethod.GET) | |
| 1665 | + @ResponseBody | |
| 1666 | + public String updateRecordOpinionFu(@RequestParam(required = false) String hospitalId | |
| 1667 | + , @RequestParam(required = false) String id) { | |
| 1668 | + | |
| 1669 | + // 查询复诊 | |
| 1670 | + AntExQuery antExQuery = new AntExQuery(); | |
| 1671 | + antExQuery.setIsOpinion(true); | |
| 1672 | + if (StringUtils.isNotEmpty(hospitalId)) { | |
| 1673 | + | |
| 1674 | + antExQuery.setHospitalId(hospitalId); | |
| 1675 | + } | |
| 1676 | + if (StringUtils.isNotEmpty(id)) | |
| 1677 | + { | |
| 1678 | + antExQuery.setId(id); | |
| 1679 | + } | |
| 1680 | + | |
| 1681 | + List<AntenatalExaminationModel> antenatalExaminationModelList = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
| 1682 | + if (CollectionUtils.isNotEmpty(antenatalExaminationModelList)) { | |
| 1683 | + int batchSize = 100; | |
| 1684 | + int end = 0; | |
| 1685 | + for (int i = 0; i < antenatalExaminationModelList.size(); i += batchSize) { | |
| 1686 | + end = (end + batchSize); | |
| 1687 | + if (end > antenatalExaminationModelList.size()) { | |
| 1688 | + end = antenatalExaminationModelList.size(); | |
| 1689 | + } | |
| 1690 | + System.out.println("fstart:" + i + ",fend:" + end); | |
| 1691 | + final List<AntenatalExaminationModel> tempList = antenatalExaminationModelList.subList(i, end); | |
| 1692 | + commonThreadPool.execute(new Runnable() { | |
| 1693 | + @Override | |
| 1694 | + public void run() { | |
| 1695 | + if (CollectionUtils.isNotEmpty(tempList)) { | |
| 1696 | + for (AntenatalExaminationModel fuModel : tempList) { | |
| 1697 | + | |
| 1698 | + AntExRecordQuery pageAntExRecordsQuery = new AntExRecordQuery(); | |
| 1699 | + pageAntExRecordsQuery.setfId(fuModel.getId()); | |
| 1700 | + List<AntExRecordModel> recordModels = recordService.queryAntExRecords(pageAntExRecordsQuery); | |
| 1701 | + if (CollectionUtils.isNotEmpty(recordModels)) | |
| 1702 | + { | |
| 1703 | + if (StringUtils.isNotEmpty(fuModel.getTreatmentOpinion())) | |
| 1704 | + { | |
| 1705 | + System.out.println("fId=" + fuModel.getId()+";"+fuModel.getTreatmentOpinion()); | |
| 1706 | + AntExRecordModel recordModel = recordModels.get(0); | |
| 1707 | + recordModel.setTreatOpinion(fuModel.getTreatmentOpinion()); | |
| 1708 | + recordService.updateOne(recordModel,recordModel.getId()); | |
| 1709 | + } | |
| 1710 | + } | |
| 1711 | + } | |
| 1712 | + } | |
| 1713 | + } | |
| 1714 | + }); | |
| 1715 | + } | |
| 1716 | + } | |
| 1717 | + | |
| 1718 | + return "updateRecordOpinionFu finish"; | |
| 1719 | + } | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + @RequestMapping(value = "/updateRecordOpinionChu", method = RequestMethod.GET) | |
| 1723 | + @ResponseBody | |
| 1724 | + public String updateRecordOpinionChu(@RequestParam(required = false) String hospitalId, @RequestParam(required = false) String id) { | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
| 1728 | + antExChuQuery.setIsOpinion(true); | |
| 1729 | + if (StringUtils.isNotEmpty(hospitalId)) { | |
| 1730 | + | |
| 1731 | + antExChuQuery.setHospitalId(hospitalId); | |
| 1732 | + } | |
| 1733 | + if (StringUtils.isNotEmpty(id)) | |
| 1734 | + { | |
| 1735 | + antExChuQuery.setId(id); | |
| 1736 | + } | |
| 1737 | + | |
| 1738 | + List<AntExChuModel> antExChuModelList = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
| 1739 | + | |
| 1740 | + if (CollectionUtils.isNotEmpty(antExChuModelList)) { | |
| 1741 | + int batchSize = 100; | |
| 1742 | + int end = 0; | |
| 1743 | + for (int i = 0; i < antExChuModelList.size(); i += batchSize) { | |
| 1744 | + end = (end + batchSize); | |
| 1745 | + if (end > antExChuModelList.size()) { | |
| 1746 | + end = antExChuModelList.size(); | |
| 1747 | + } | |
| 1748 | + System.out.println("start:" + i + ",end:" + end); | |
| 1749 | + final List<AntExChuModel> tempList = antExChuModelList.subList(i, end); | |
| 1750 | + commonThreadPool.execute(new Runnable() { | |
| 1751 | + @Override | |
| 1752 | + public void run() { | |
| 1753 | + if (CollectionUtils.isNotEmpty(tempList)) { | |
| 1754 | + for (AntExChuModel chuModel : tempList) { | |
| 1755 | + | |
| 1756 | + AntExRecordQuery pageAntExRecordsQuery = new AntExRecordQuery(); | |
| 1757 | + pageAntExRecordsQuery.setfId(chuModel.getId()); | |
| 1758 | + List<AntExRecordModel> recordModels = recordService.queryAntExRecords(pageAntExRecordsQuery); | |
| 1759 | + if (CollectionUtils.isNotEmpty(recordModels)) | |
| 1760 | + { | |
| 1761 | + if (StringUtils.isNotEmpty(chuModel.getTreatOpinion())) | |
| 1762 | + { | |
| 1763 | + System.out.println("chuId=" + chuModel.getId()+";"+chuModel.getTreatOpinion()); | |
| 1764 | + AntExRecordModel recordModel = recordModels.get(0); | |
| 1765 | + recordModel.setTreatOpinion(chuModel.getTreatOpinion()); | |
| 1766 | + recordService.updateOne(recordModel,recordModel.getId()); | |
| 1767 | + } | |
| 1768 | + } | |
| 1769 | + } | |
| 1770 | + } | |
| 1771 | + } | |
| 1772 | + }); | |
| 1773 | + } | |
| 1774 | + } | |
| 1775 | + return "updateRecordOpinionChu finish"; | |
| 1776 | + } | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1658 | 1781 | @Autowired |
| 1659 | 1782 | private CommonService commonService; |
| 1660 | 1783 | @Autowired |
| ... | ... | @@ -1814,6 +1937,35 @@ |
| 1814 | 1937 | Map<String, Object> map = new HashMap<String, Object>(); |
| 1815 | 1938 | map.put("id", "1236544"); |
| 1816 | 1939 | return map; |
| 1940 | + } | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + /** | |
| 1944 | + *诸城初诊测试 | |
| 1945 | + * @return | |
| 1946 | + */ | |
| 1947 | + @RequestMapping(value="/zc/cz") | |
| 1948 | + @ResponseBody | |
| 1949 | + public BaseObjectResponse getCsCz(@RequestParam("id")String id,@RequestParam("parentId")String parentId){ | |
| 1950 | + AntExChuModel antExChuModel = new AntExChuModel(); | |
| 1951 | + antExChuModel.setId(id); | |
| 1952 | + antExChuModel.setParentId(parentId); | |
| 1953 | + BaseObjectResponse br = zcPrenatalService.saveAntexChu(antExChuModel); | |
| 1954 | + return br; | |
| 1955 | + } | |
| 1956 | + | |
| 1957 | + /** | |
| 1958 | + *诸城复诊测试 | |
| 1959 | + * @return | |
| 1960 | + */ | |
| 1961 | + @RequestMapping(value="/zc/fz") | |
| 1962 | + @ResponseBody | |
| 1963 | + public BaseObjectResponse getCsFz(@RequestParam("id")String id,@RequestParam("parentId")String parentId){ | |
| 1964 | + AntenatalExaminationModel antenatalExaminationModel = new AntenatalExaminationModel(); | |
| 1965 | + antenatalExaminationModel.setId(id); | |
| 1966 | + antenatalExaminationModel.setParentId(parentId); | |
| 1967 | + BaseObjectResponse br = zcPrenatalService.saveAntexFu(antenatalExaminationModel); | |
| 1968 | + return br; | |
| 1817 | 1969 | } |
| 1818 | 1970 | |
| 1819 | 1971 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
View file @
dcfe74e
| ... | ... | @@ -107,10 +107,24 @@ |
| 107 | 107 | antExRecordQuery.setFirst(antExManagerQueryRequest.getFirst()); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | + if (antExManagerQueryRequest.getIsOpinion() != null) | |
| 111 | + { | |
| 112 | + //是否有处理意见 0否 1是 | |
| 113 | + if (antExManagerQueryRequest.getIsOpinion() == 0) | |
| 114 | + { | |
| 115 | + antExRecordQuery.setIsOpinion(false); | |
| 116 | + } | |
| 117 | + else if (antExManagerQueryRequest.getIsOpinion() == 1) | |
| 118 | + { | |
| 119 | + antExRecordQuery.setIsOpinion(true); | |
| 120 | + if (StringUtils.isNotEmpty(antExManagerQueryRequest.getTreatOpinion())) | |
| 121 | + { | |
| 122 | + antExRecordQuery.setTreatOpinion(antExManagerQueryRequest.getTreatOpinion()); | |
| 123 | + } | |
| 124 | + } | |
| 125 | + } | |
| 110 | 126 | |
| 111 | - | |
| 112 | 127 | //产检日期 |
| 113 | - | |
| 114 | 128 | Date currentDate = DateUtil.formatDate(new Date()); |
| 115 | 129 | if (org.apache.commons.lang.StringUtils.isNotEmpty(antExManagerQueryRequest.getcTime())) { |
| 116 | 130 | String nextDateStr = antExManagerQueryRequest.getcTime(); |
| ... | ... | @@ -654,7 +668,7 @@ |
| 654 | 668 | List currentRiskList = oneRecord.gethRisk(); |
| 655 | 669 | List beforeRiskList = twoRecord.gethRisk(); |
| 656 | 670 | |
| 657 | - if (CollectionUtils.isNotEmpty(beforeRiskList) && beforeRiskList.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6")) | |
| 671 | + if (CollectionUtils.isNotEmpty(beforeRiskList) && beforeRiskList.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6") && getConditionRisk(request.getRiskFactorId(),currentRiskList)) | |
| 658 | 672 | { |
| 659 | 673 | ids.add(oneRecord.getId()); |
| 660 | 674 | incriskMap.put(oneRecord.getId(), currentRiskList); |
| ... | ... | @@ -669,7 +683,7 @@ |
| 669 | 683 | incrHrisk.add(riskId); |
| 670 | 684 | } |
| 671 | 685 | } |
| 672 | - if (CollectionUtils.isNotEmpty(incrHrisk)) | |
| 686 | + if (CollectionUtils.isNotEmpty(incrHrisk) && getConditionRisk(request.getRiskFactorId(),incrHrisk)) | |
| 673 | 687 | { |
| 674 | 688 | ids.add(oneRecord.getId()); |
| 675 | 689 | incriskMap.put(oneRecord.getId(), incrHrisk); |
| ... | ... | @@ -697,7 +711,7 @@ |
| 697 | 711 | |
| 698 | 712 | List currentRiskList = oneRecord.gethRisk(); |
| 699 | 713 | List beforeRiskList = twoRecord.gethRisk(); |
| 700 | - if (CollectionUtils.isNotEmpty(beforeRiskList) && beforeRiskList.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6")) | |
| 714 | + if (CollectionUtils.isNotEmpty(beforeRiskList) && beforeRiskList.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6") && getConditionRisk(request.getRiskFactorId(),currentRiskList)) | |
| 701 | 715 | { |
| 702 | 716 | ids.add(oneRecord.getId()); |
| 703 | 717 | incriskMap.put(oneRecord.getId(), currentRiskList); |
| ... | ... | @@ -712,7 +726,7 @@ |
| 712 | 726 | incrHrisk.add(String.valueOf(riskId)); |
| 713 | 727 | } |
| 714 | 728 | } |
| 715 | - if (CollectionUtils.isNotEmpty(incrHrisk)) | |
| 729 | + if (CollectionUtils.isNotEmpty(incrHrisk) && getConditionRisk(request.getRiskFactorId(),incrHrisk)) | |
| 716 | 730 | { |
| 717 | 731 | ids.add(oneRecord.getId()); |
| 718 | 732 | incriskMap.put(oneRecord.getId(), incrHrisk); |
| 719 | 733 | |
| ... | ... | @@ -722,14 +736,17 @@ |
| 722 | 736 | } |
| 723 | 737 | } |
| 724 | 738 | } |
| 739 | + | |
| 740 | + if (CollectionUtils.isEmpty(ids)) | |
| 741 | + { | |
| 742 | + return null; | |
| 743 | + } | |
| 725 | 744 | pageAntExRecordsQuery.setNeed("true"); |
| 726 | 745 | pageAntExRecordsQuery.setPage(request.getPage()); |
| 727 | 746 | pageAntExRecordsQuery.setLimit(request.getLimit()); |
| 728 | 747 | pageAntExRecordsQuery.setIds(ids); |
| 729 | 748 | pageAntExRecordsQuery.setLevelId(request.getLevel()); |
| 730 | 749 | |
| 731 | - pageAntExRecordsQuery.setrFactor(request.getRiskFactorId()); | |
| 732 | - pageAntExRecordsQuery.setrFactorList(StringUtils.covertToList(request.getRiskFactorId(), String.class)); | |
| 733 | 750 | |
| 734 | 751 | List<AntExRecordModel> pageAntExRecords = recordService.queryAntExRecords(pageAntExRecordsQuery); |
| 735 | 752 | if (CollectionUtils.isNotEmpty(pageAntExRecords)) |
| ... | ... | @@ -741,6 +758,15 @@ |
| 741 | 758 | } |
| 742 | 759 | |
| 743 | 760 | return pageAntExRecords; |
| 761 | + } | |
| 762 | + | |
| 763 | + private boolean getConditionRisk(String riskId,List<String> incrHrisk) | |
| 764 | + { | |
| 765 | + if (StringUtils.isEmpty(riskId)) | |
| 766 | + { | |
| 767 | + return true; | |
| 768 | + } | |
| 769 | + return incrHrisk.contains(riskId); | |
| 744 | 770 | } |
| 745 | 771 | |
| 746 | 772 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
dcfe74e
| ... | ... | @@ -1565,14 +1565,6 @@ |
| 1565 | 1565 | if (CollectionUtils.isNotEmpty(personModels)) { |
| 1566 | 1566 | for (PersonModel babayPerson : personModels) { |
| 1567 | 1567 | BabyInfoResult result = new BabyInfoResult(); |
| 1568 | - result.setPid(babayPerson.getId()); | |
| 1569 | - result.setCardNo(babayPerson.getCardNo());//母亲的身份证号码 | |
| 1570 | - result.setName(babayPerson.getName()); | |
| 1571 | - if (babayPerson.getBirth() != null) { | |
| 1572 | - result.setMonthAge(DateUtil.getBabyMonthAge(babayPerson.getBirth(), new Date())); | |
| 1573 | - } else { | |
| 1574 | - result.setMonthAge(""); | |
| 1575 | - } | |
| 1576 | 1568 | |
| 1577 | 1569 | //通过pid查询儿童的建档记录 |
| 1578 | 1570 | BabyModelQuery babyQuery = new BabyModelQuery(); |
| ... | ... | @@ -1591,6 +1583,17 @@ |
| 1591 | 1583 | |
| 1592 | 1584 | List<Map<String, String>> list = new ArrayList<>(); |
| 1593 | 1585 | if (CollectionUtils.isNotEmpty(builds)) { |
| 1586 | + | |
| 1587 | + | |
| 1588 | + result.setPid(babayPerson.getId()); | |
| 1589 | + result.setCardNo(babayPerson.getCardNo());//母亲的身份证号码 | |
| 1590 | + result.setName(babayPerson.getName()); | |
| 1591 | + if (babayPerson.getBirth() != null) { | |
| 1592 | + result.setMonthAge(DateUtil.getBabyMonthAge(babayPerson.getBirth(), new Date())); | |
| 1593 | + } else { | |
| 1594 | + result.setMonthAge(""); | |
| 1595 | + } | |
| 1596 | + | |
| 1594 | 1597 | for (BabyModel build : builds) { |
| 1595 | 1598 | if (build == null || StringUtils.isEmpty(build.getHospitalId())) { |
| 1596 | 1599 | continue; |
| ... | ... | @@ -1621,6 +1624,11 @@ |
| 1621 | 1624 | } |
| 1622 | 1625 | result.setBuildRecords(list); |
| 1623 | 1626 | } |
| 1627 | + else | |
| 1628 | + { | |
| 1629 | + continue; | |
| 1630 | + } | |
| 1631 | + | |
| 1624 | 1632 | results.add(result); |
| 1625 | 1633 | } |
| 1626 | 1634 | } |
| 1627 | 1635 | |
| ... | ... | @@ -2304,9 +2312,9 @@ |
| 2304 | 2312 | // 省 |
| 2305 | 2313 | babyQuery.setProvinceId(StringUtils.isEmpty(request.getProvinceId())?null:request.getProvinceId()); |
| 2306 | 2314 | // 市 |
| 2307 | - babyQuery.setCityId(StringUtils.isEmpty(request.getCityId())?null:request.getCityId()); | |
| 2315 | + babyQuery.setCityId(StringUtils.isEmpty(request.getCityId()) ? null : request.getCityId()); | |
| 2308 | 2316 | // 区/县 |
| 2309 | - babyQuery.setAreaId(StringUtils.isEmpty(request.getAreaId())?null:request.getAreaId()); | |
| 2317 | + babyQuery.setAreaId(StringUtils.isEmpty(request.getAreaId()) ? null : request.getAreaId()); | |
| 2310 | 2318 | |
| 2311 | 2319 | babyQuery.setStreetId(StringUtils.isEmpty(request.getStreetId()) ? null : request.getStreetId()); |
| 2312 | 2320 | babyQuery.setQueryNo(request.getQueryNo()); |
| 2313 | 2321 | |
| ... | ... | @@ -2454,11 +2462,17 @@ |
| 2454 | 2462 | //获取最近一次的建档记录 |
| 2455 | 2463 | List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery); |
| 2456 | 2464 | //去掉删除的数据 |
| 2457 | - removeDeleted(models); | |
| 2465 | + models = removeDeleted(models); | |
| 2458 | 2466 | if (CollectionUtils.isNotEmpty(models)) { |
| 2459 | 2467 | BabyModel babyModel = models.get(0); |
| 2460 | 2468 | |
| 2461 | 2469 | result = new BabyBuildResult(); |
| 2470 | + | |
| 2471 | + if (babyModel.getDataStatus() != null && babyModel.getDataStatus() == 1) | |
| 2472 | + { | |
| 2473 | + result.setId(babyModel.getId()); | |
| 2474 | + } | |
| 2475 | + | |
| 2462 | 2476 | result.setYn(babyModel.getYn()); |
| 2463 | 2477 | result.setDataStatus(babyModel.getDataStatus()); |
| 2464 | 2478 | result.setMommyName(babyModel.getMname()); |
| 2465 | 2479 | |
| 2466 | 2480 | |
| ... | ... | @@ -2526,14 +2540,17 @@ |
| 2526 | 2540 | * 移除yn为0 的 |
| 2527 | 2541 | * @param babyModels |
| 2528 | 2542 | */ |
| 2529 | - private void removeDeleted(List<BabyModel> babyModels){ | |
| 2543 | + private List<BabyModel> removeDeleted(List<BabyModel> babyModels){ | |
| 2544 | + List<BabyModel> results = new ArrayList<>(); | |
| 2530 | 2545 | if(CollectionUtils.isNotEmpty(babyModels)){ |
| 2531 | - for(int i=0;i<babyModels.size();i++){ | |
| 2532 | - if((YnEnums.NO.getId()+"").equals(babyModels.get(i).getYn()+"")){ | |
| 2533 | - babyModels.remove(i); | |
| 2534 | - } | |
| 2546 | + for(BabyModel model : results){ | |
| 2547 | + if (model.getYn() == YnEnums.YES.getId() || (model.getYn() == YnEnums.NO.getId() && model.getDataStatus() != null && model.getDataStatus() == 1)) | |
| 2548 | + { | |
| 2549 | + results.add(model); | |
| 2550 | + } | |
| 2535 | 2551 | } |
| 2536 | 2552 | } |
| 2553 | + return results; | |
| 2537 | 2554 | } |
| 2538 | 2555 | |
| 2539 | 2556 | public void exportChilds(BabyManageRequest request, Integer userId, HttpServletResponse httpServletResponse) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
dcfe74e
| ... | ... | @@ -799,7 +799,13 @@ |
| 799 | 799 | } |
| 800 | 800 | //判断妊娠结局是活产才添加数据 |
| 801 | 801 | if ((RenShenJieJuEnums.O.getId() + "").equals(baby.getPregnancyOut())) { |
| 802 | - babyModel.setYn(YnEnums.YES.getId()); | |
| 802 | + //babyModel.setYn(YnEnums.YES.getId()); | |
| 803 | + | |
| 804 | + | |
| 805 | + //改成这种是因为需求要求 分娩自动流转儿童信息,建档时间为空,医生确认建档 | |
| 806 | + babyModel.setYn(YnEnums.NO.getId()); | |
| 807 | + babyModel.setDataStatus(1); | |
| 808 | + | |
| 803 | 809 | PersonModel personModel = new PersonModel(); |
| 804 | 810 | personModel.setType(2); |
| 805 | 811 | personModel.setYn(YnEnums.YES.getId()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/AntExManagerQueryRequest.java
View file @
dcfe74e
| ... | ... | @@ -80,6 +80,28 @@ |
| 80 | 80 | |
| 81 | 81 | private Integer first; // 1否 2 是,是否当前医院第一次初诊 德州需求 |
| 82 | 82 | |
| 83 | + //处理意见 | |
| 84 | + private String treatOpinion; | |
| 85 | + | |
| 86 | + //是否有处理意见 0否 1是 | |
| 87 | + private Integer isOpinion; | |
| 88 | + | |
| 89 | + public String getTreatOpinion() { | |
| 90 | + return treatOpinion; | |
| 91 | + } | |
| 92 | + | |
| 93 | + public void setTreatOpinion(String treatOpinion) { | |
| 94 | + this.treatOpinion = treatOpinion; | |
| 95 | + } | |
| 96 | + | |
| 97 | + public Integer getIsOpinion() { | |
| 98 | + return isOpinion; | |
| 99 | + } | |
| 100 | + | |
| 101 | + public void setIsOpinion(Integer isOpinion) { | |
| 102 | + this.isOpinion = isOpinion; | |
| 103 | + } | |
| 104 | + | |
| 83 | 105 | public int getShowDetail() { |
| 84 | 106 | return showDetail; |
| 85 | 107 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
dcfe74e
| ... | ... | @@ -75,6 +75,9 @@ |
| 75 | 75 | private DoctorUserMapService doctorUserMapService; |
| 76 | 76 | |
| 77 | 77 | |
| 78 | + private static Map<String,String> WEIGHT_RANGE = new HashMap<>(); | |
| 79 | + | |
| 80 | + | |
| 78 | 81 | private static Map<String,String> N_S_AREA = new HashMap<>(); |
| 79 | 82 | static |
| 80 | 83 | { |
| ... | ... | @@ -111,6 +114,101 @@ |
| 111 | 114 | N_S_AREA.put("吉林省","北方"); |
| 112 | 115 | N_S_AREA.put("黑龙江省","北方"); |
| 113 | 116 | N_S_AREA.put("宁夏回族自治区","北方"); |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + WEIGHT_RANGE.put("BMI<18.5孕0-12周","1.00-1.50"); | |
| 121 | + WEIGHT_RANGE.put("BMI<18.5孕13周","1.41-2.09"); | |
| 122 | + WEIGHT_RANGE.put("BMI<18.5孕14周","1.82-2.68"); | |
| 123 | + WEIGHT_RANGE.put("BMI<18.5孕15周","2.23-3.27"); | |
| 124 | + WEIGHT_RANGE.put("BMI<18.5孕16周","2.64-3.86"); | |
| 125 | + WEIGHT_RANGE.put("BMI<18.5孕17周","3.05-4.45"); | |
| 126 | + WEIGHT_RANGE.put("BMI<18.5孕18周","3.46-5.04"); | |
| 127 | + WEIGHT_RANGE.put("BMI<18.5孕19周","3.87-5.63"); | |
| 128 | + WEIGHT_RANGE.put("BMI<18.5孕20周","4.28-6.22"); | |
| 129 | + WEIGHT_RANGE.put("BMI<18.5孕21周","4.69-6.81"); | |
| 130 | + WEIGHT_RANGE.put("BMI<18.5孕22周","5.10-7.40"); | |
| 131 | + WEIGHT_RANGE.put("BMI<18.5孕23周","5.51-7.99"); | |
| 132 | + WEIGHT_RANGE.put("BMI<18.5孕24周","5.92-8.58"); | |
| 133 | + WEIGHT_RANGE.put("BMI<18.5孕25周","6.33-9.17"); | |
| 134 | + WEIGHT_RANGE.put("BMI<18.5孕26周","6.74-9.76"); | |
| 135 | + WEIGHT_RANGE.put("BMI<18.5孕27周","7.15-10.35"); | |
| 136 | + WEIGHT_RANGE.put("BMI<18.5孕28周","7.56-10.94"); | |
| 137 | + WEIGHT_RANGE.put("BMI<18.5孕29周","7.97-11.53"); | |
| 138 | + WEIGHT_RANGE.put("BMI<18.5孕30周","8.38-12.12"); | |
| 139 | + WEIGHT_RANGE.put("BMI<18.5孕31周","8.79-12.71"); | |
| 140 | + WEIGHT_RANGE.put("BMI<18.5孕32周","9.20-13.30"); | |
| 141 | + WEIGHT_RANGE.put("BMI<18.5孕33周","9.61-13.89"); | |
| 142 | + WEIGHT_RANGE.put("BMI<18.5孕34周","10.02-14.48"); | |
| 143 | + WEIGHT_RANGE.put("BMI<18.5孕35周","10.43-15.07"); | |
| 144 | + WEIGHT_RANGE.put("BMI<18.5孕36周","10.84-15.66"); | |
| 145 | + WEIGHT_RANGE.put("BMI<18.5孕37周","11.25-16.25"); | |
| 146 | + WEIGHT_RANGE.put("BMI<18.5孕38周","11.66-16.84"); | |
| 147 | + WEIGHT_RANGE.put("BMI<18.5孕39周","12.07-17.43"); | |
| 148 | + WEIGHT_RANGE.put("BMI<18.5孕40周","12.50-18.00"); | |
| 149 | + | |
| 150 | + | |
| 151 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕0-12周","1.00-1.50"); | |
| 152 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕13周","1.37-2.02"); | |
| 153 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕14周","1.75-2.54"); | |
| 154 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕15周","2.12-3.06"); | |
| 155 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕16周","2.50-3.58"); | |
| 156 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕17周","2.87-4.10"); | |
| 157 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕18周","3.25-4.62"); | |
| 158 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕19周","3.62-5.14"); | |
| 159 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕20周","4.00-5.66"); | |
| 160 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕21周","4.37-6.18"); | |
| 161 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕22周","4.75-6.70"); | |
| 162 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕23周","5.12-7.22"); | |
| 163 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕24周","5.50-7.74"); | |
| 164 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕25周","5.87-8.26"); | |
| 165 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕26周","6.25-8.78"); | |
| 166 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕27周","6.62-9.30"); | |
| 167 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕28周","7.00-9.82"); | |
| 168 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕29周","7.37-10.34"); | |
| 169 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕30周","7.75-10.86"); | |
| 170 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕31周","8.12-11.38"); | |
| 171 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕32周","8.50-11.90"); | |
| 172 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕33周","8.87-12.42"); | |
| 173 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕34周","9.25-12.94"); | |
| 174 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕35周","9.62-13.46"); | |
| 175 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕36周","10.00-13.98"); | |
| 176 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕37周","10.37-14.50"); | |
| 177 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕38周","10.75-15.02"); | |
| 178 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕39周","11.12-15.54"); | |
| 179 | + WEIGHT_RANGE.put("BMI=18.5-24.9孕40周","11.50-16.00"); | |
| 180 | + | |
| 181 | + | |
| 182 | + WEIGHT_RANGE.put("BMI=25-29.9孕0-12周","1.00-1.50"); | |
| 183 | + WEIGHT_RANGE.put("BMI=25-29.9孕13周","1.21-1.86"); | |
| 184 | + WEIGHT_RANGE.put("BMI=25-29.9孕14周","1.42-2.22"); | |
| 185 | + WEIGHT_RANGE.put("BMI=25-29.9孕15周","1.64-2.58"); | |
| 186 | + WEIGHT_RANGE.put("BMI=25-29.9孕16周","1.85-2.94"); | |
| 187 | + WEIGHT_RANGE.put("BMI=25-29.9孕17周","2.07-3.30"); | |
| 188 | + WEIGHT_RANGE.put("BMI=25-29.9孕18周","2.28-3.66"); | |
| 189 | + WEIGHT_RANGE.put("BMI=25-29.9孕19周","2.49-4.02"); | |
| 190 | + WEIGHT_RANGE.put("BMI=25-29.9孕20周","2.71-4.38"); | |
| 191 | + WEIGHT_RANGE.put("BMI=25-29.9孕21周","2.92-4.74"); | |
| 192 | + WEIGHT_RANGE.put("BMI=25-29.9孕22周","3.14-5.10"); | |
| 193 | + WEIGHT_RANGE.put("BMI=25-29.9孕23周","3.35-5.46"); | |
| 194 | + WEIGHT_RANGE.put("BMI=25-29.9孕24周","3.56-5.82"); | |
| 195 | + WEIGHT_RANGE.put("BMI=25-29.9孕25周","3.78-6.18"); | |
| 196 | + WEIGHT_RANGE.put("BMI=25-29.9孕26周","3.99-6.54"); | |
| 197 | + WEIGHT_RANGE.put("BMI=25-29.9孕27周","4.21-6.90"); | |
| 198 | + WEIGHT_RANGE.put("BMI=25-29.9孕28周","4.42-7.26"); | |
| 199 | + WEIGHT_RANGE.put("BMI=25-29.9孕29周","4.63-7.62"); | |
| 200 | + WEIGHT_RANGE.put("BMI=25-29.9孕30周","4.85-7.98"); | |
| 201 | + WEIGHT_RANGE.put("BMI=25-29.9孕31周","5.06-8.34"); | |
| 202 | + WEIGHT_RANGE.put("BMI=25-29.9孕32周","5.28-8.70"); | |
| 203 | + WEIGHT_RANGE.put("BMI=25-29.9孕33周","5.49-9.06"); | |
| 204 | + WEIGHT_RANGE.put("BMI=25-29.9孕34周","5.70-9.42"); | |
| 205 | + WEIGHT_RANGE.put("BMI=25-29.9孕35周","5.92-9.78"); | |
| 206 | + WEIGHT_RANGE.put("BMI=25-29.9孕36周","6.13-10.14"); | |
| 207 | + WEIGHT_RANGE.put("BMI=25-29.9孕37周","6.35-10.50"); | |
| 208 | + WEIGHT_RANGE.put("BMI=25-29.9孕38周","6.56-10.86"); | |
| 209 | + WEIGHT_RANGE.put("BMI=25-29.9孕39周","6.77-11.22"); | |
| 210 | + WEIGHT_RANGE.put("BMI=25-29.9孕40周","7.00-11.50"); | |
| 211 | + | |
| 114 | 212 | } |
| 115 | 213 | |
| 116 | 214 | |
| 117 | 215 | |
| 118 | 216 | |
| 119 | 217 | |
| 120 | 218 | |
| 121 | 219 | |
| 122 | 220 | |
| 123 | 221 | |
| ... | ... | @@ -1356,28 +1454,35 @@ |
| 1356 | 1454 | //基础kcal值 |
| 1357 | 1455 | int basekul = (week > 12 && week <= 27) ? 340 : 450; |
| 1358 | 1456 | |
| 1359 | - double avge = 0; | |
| 1457 | + | |
| 1458 | + String bmiStr = ""; | |
| 1360 | 1459 | if (bmi < 18.5) |
| 1361 | 1460 | { |
| 1362 | - avge = 0.51; | |
| 1461 | + bmiStr = "BMI<18.5孕"+week+"周"; | |
| 1363 | 1462 | } |
| 1364 | 1463 | else if (bmi <= 24.9 && bmi >= 18.5) |
| 1365 | 1464 | { |
| 1366 | - avge = 0.42; | |
| 1465 | + bmiStr = "BMI=18.5-24.9孕"+week+"周"; | |
| 1367 | 1466 | } |
| 1368 | 1467 | else if (bmi <= 29.9 && bmi >= 25) |
| 1369 | 1468 | { |
| 1370 | - avge = 0.28; | |
| 1469 | + bmiStr = "BMI=25-29.9孕"+week+"周"; | |
| 1371 | 1470 | } |
| 1372 | - else if (bmi >= 30) | |
| 1471 | + | |
| 1472 | + if (StringUtils.isEmpty(bmiStr)) | |
| 1373 | 1473 | { |
| 1374 | - avge = 0.22; | |
| 1474 | + return map; | |
| 1375 | 1475 | } |
| 1376 | 1476 | |
| 1377 | - int rangeweek = week - 12; | |
| 1477 | + String[] rangeWeight = WEIGHT_RANGE.get(bmiStr).split("-"); | |
| 1378 | 1478 | |
| 1379 | - double addWeightStart = 1 + rangeweek*avge; | |
| 1380 | - double addWeightEnd = 1.5 + rangeweek*avge; | |
| 1479 | + if (rangeWeight == null || rangeWeight.length != 2) | |
| 1480 | + { | |
| 1481 | + return map; | |
| 1482 | + } | |
| 1483 | + | |
| 1484 | + double addWeightStart = Double.parseDouble(rangeWeight[0]); | |
| 1485 | + double addWeightEnd = Double.parseDouble(rangeWeight[1]); | |
| 1381 | 1486 | |
| 1382 | 1487 | double kstart = (beforeWeight + addWeightStart) * 25 + basekul; |
| 1383 | 1488 | double kend = (beforeWeight + addWeightEnd) * 25 + basekul; |