Commit d94da6fcc30efed26c908d4584109c84654662af
1 parent
7e2262d000
Exists in
dev
#fix:新增大同分娩数据同步逻辑,未建档孕妇主动创建档案
Showing 4 changed files with 55 additions and 14 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/LisServiceImpl.java
- platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/dtdyrm/DtdyrmFmService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/LisServiceImpl.java
View file @
d94da6f
| ... | ... | @@ -246,7 +246,7 @@ |
| 246 | 246 | ReferConfigQuery referConfigQuery = new ReferConfigQuery(); |
| 247 | 247 | referConfigQuery.setYn(YnEnums.YES.getId()); |
| 248 | 248 | referConfigQuery.setHospitalId(Integer.valueOf(hospitalId)); |
| 249 | - referConfigQuery.setLimit(50); | |
| 249 | + referConfigQuery.setLimit(100); | |
| 250 | 250 | List<ReferValue> referValueList = referConfigService.queryRefer(referConfigQuery); |
| 251 | 251 | Map<String, ReferValue> referValueMap = new HashMap<>(); |
| 252 | 252 | for (ReferValue referValue : referValueList) { |
| ... | ... | @@ -583,8 +583,8 @@ |
| 583 | 583 | antExRecordModel.setCardNo(patients.getCardNo()); |
| 584 | 584 | antExRecordModel.setCheckDoctor(String.valueOf(patients.getOperator())); |
| 585 | 585 | antExRecordModel.setType(1); |
| 586 | - antExRecordModel.setCheckTime(patients.getBookbuildingDate()); | |
| 587 | - antExRecordModel.setBuildTime(patients.getBookbuildingDate()); | |
| 586 | + antExRecordModel.setCheckTime(new Date()); | |
| 587 | + antExRecordModel.setBuildTime(new Date()); | |
| 588 | 588 | if (antExRecordModel.getDueDate() != null) { |
| 589 | 589 | antExRecordModel.setStatus(antExRecordModel.getDueDate().compareTo(new Date()) > 0 ? 2 : 1); |
| 590 | 590 | antExRecordModel.setDueStatus(antExRecordModel.getStatus()); |
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
d94da6f
| ... | ... | @@ -1513,6 +1513,7 @@ |
| 1513 | 1513 | return calendar.getTime(); |
| 1514 | 1514 | } |
| 1515 | 1515 | |
| 1516 | + | |
| 1516 | 1517 | public static Integer getCurrentYear() { |
| 1517 | 1518 | Calendar calendar = Calendar.getInstance(); |
| 1518 | 1519 | calendar.setTime(new Date()); |
| ... | ... | @@ -1987,12 +1988,12 @@ |
| 1987 | 1988 | return dateTime.plusDays(days).toDate(); |
| 1988 | 1989 | } |
| 1989 | 1990 | public static void main(String[] args) { |
| 1990 | - String currentDueDate ="35周2天"; | |
| 1991 | - String []array= currentDueDate.split("周"); | |
| 1992 | - Integer day= Integer.valueOf(array[0])*7+Integer.valueOf(array[1].split("天")[0]); | |
| 1993 | - Date time = DateUtil.addDay(DateUtil.parseYMD("2024-03-29"), -day); | |
| 1994 | - String str = DateUtil.getyyyy_MM_dd(time); | |
| 1995 | - System.out.println(str); | |
| 1991 | + /* String cardNo="140224199503115242"; | |
| 1992 | + System.out.println(DateUtil.getBirthFromIdCard(cardNo)); | |
| 1993 | + System.out.println(DateUtil.parseYMD(DateUtil.getBirthFromIdCard(cardNo))) ;*/ | |
| 1994 | + //System.out.println(getWeekDay(-39)); | |
| 1995 | + String week="41"; | |
| 1996 | + System.out.println(week.length()>2?-Integer.valueOf(week.substring(0,2)):-Integer.valueOf(week)); | |
| 1996 | 1997 | } |
| 1997 | 1998 | |
| 1998 | 1999 | } |
platform-operate-api/src/main/java/com/lyms/hospitalapi/dtdyrm/DtdyrmFmService.java
View file @
d94da6f
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | import com.lyms.hospitalapi.qhddeyy.QhddeyyFmServiceImpl; |
| 5 | 5 | import com.lyms.hospitalapi.qhdfy.FmItem; |
| 6 | 6 | import com.lyms.platform.biz.service.PatientsService; |
| 7 | +import com.lyms.platform.biz.service.PersonService; | |
| 7 | 8 | import com.lyms.platform.common.enums.FmTypeEnums; |
| 8 | 9 | import com.lyms.platform.common.enums.RenShenJieJuEnums; |
| 9 | 10 | import com.lyms.platform.common.enums.TpmcTypeEnums; |
| ... | ... | @@ -20,6 +21,7 @@ |
| 20 | 21 | import com.lyms.platform.permission.service.UsersService; |
| 21 | 22 | import com.lyms.platform.pojo.MaternalDeliverModel; |
| 22 | 23 | import com.lyms.platform.pojo.Patients; |
| 24 | +import com.lyms.platform.pojo.PersonModel; | |
| 23 | 25 | import com.lyms.platform.query.PatientsQuery; |
| 24 | 26 | import org.apache.commons.collections.CollectionUtils; |
| 25 | 27 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -40,6 +42,8 @@ |
| 40 | 42 | |
| 41 | 43 | @Autowired |
| 42 | 44 | private UsersService usersService; |
| 45 | + @Autowired | |
| 46 | + private PersonService personService; | |
| 43 | 47 | |
| 44 | 48 | @Autowired |
| 45 | 49 | private BabyBookbuildingFacade babyBookbuildingFacade; |
| ... | ... | @@ -92,6 +96,7 @@ |
| 92 | 96 | } |
| 93 | 97 | PatientsQuery query = new PatientsQuery(); |
| 94 | 98 | query.setYn(YnEnums.YES.getId()); |
| 99 | + query.setHospitalId(HOSPITALID); | |
| 95 | 100 | //20201230 半年后把这个打开 |
| 96 | 101 | // query.setType(1); //孕妇 |
| 97 | 102 | // query.setDueStatus(0); //未终止妊娠 |
| 98 | 103 | |
| ... | ... | @@ -104,11 +109,11 @@ |
| 104 | 109 | |
| 105 | 110 | //获取指定医生id |
| 106 | 111 | try { |
| 107 | - System.out.println("query hosptial chanke doctor--"); | |
| 108 | 112 | UsersQuery usersQuery = new UsersQuery(); |
| 109 | 113 | usersQuery.setYn(YnEnums.YES.getId()); |
| 110 | 114 | usersQuery.setOrgId(new Integer(Integer.parseInt(HOSPITALID))); |
| 111 | - usersQuery.setName("产科"); | |
| 115 | + //usersQuery.setName("产科"); | |
| 116 | + usersQuery.setDeptId(2100004940); | |
| 112 | 117 | users = usersService.queryUsers(usersQuery); |
| 113 | 118 | } catch (NumberFormatException e) { |
| 114 | 119 | e.printStackTrace(); |
| 115 | 120 | |
| ... | ... | @@ -117,9 +122,43 @@ |
| 117 | 122 | patient = patientses.get(0); |
| 118 | 123 | |
| 119 | 124 | } else{ |
| 120 | - System.out.println("no patients in database:"+ allFm.toString()); | |
| 125 | + | |
| 126 | + if (StringUtils.isNotEmpty(allFm.getIDCARD())){ | |
| 127 | + PersonModel pmodel = new PersonModel(); | |
| 128 | + pmodel.setName(allFm.getNAME()); | |
| 129 | + pmodel.setPhone(allFm.getPHONE()); | |
| 130 | + pmodel.setCardNo(allFm.getIDCARD()); | |
| 131 | + pmodel.setType(3); | |
| 132 | + pmodel.setModified(new Date()); | |
| 133 | + | |
| 134 | + pmodel.setYn(YnEnums.YES.getId()); | |
| 135 | + pmodel.setCreated(new Date()); | |
| 136 | + PersonModel resperson = personService.addPerson(pmodel); | |
| 137 | + | |
| 138 | + patient=new Patients(); | |
| 139 | + patient.setHospitalId(HOSPITALID); | |
| 140 | + patient.setFmHospital(HOSPITALID); | |
| 141 | + patient.setFmDate(new Date()); | |
| 142 | + patient.setCardNo(allFm.getIDCARD()); | |
| 143 | + patient.setYn(1); | |
| 144 | + patient.setBookbuildingDate(new Date()); | |
| 145 | + //patient.setBookbuildingDoctor(); | |
| 146 | + patient.setUsername(allFm.getNAME()); | |
| 147 | + patient.setPhone(allFm.getPHONE()); | |
| 148 | + patient.setPid(resperson.getId()); | |
| 149 | + patient.setOperator(users.get(0).getId()); | |
| 150 | + patient.setLastMenses(DateUtil.getWeekDay(allFm.getDUE_WEEK().length()>2?-Integer.valueOf(allFm.getDUE_WEEK().substring(0,2)):-Integer.valueOf(allFm.getDUE_WEEK()))); | |
| 151 | + patient.setBirth(DateUtil.parseYMD(DateUtil.getBirthFromIdCard(allFm.getIDCARD()))); | |
| 152 | + patient.setDeliverDoctor(String.valueOf(users.get(0).getId())); | |
| 153 | + patient.setCreated(new Date()); | |
| 154 | + patient.setModified(new Date()); | |
| 155 | + patient=patientsService.addPatient(patient); | |
| 156 | + | |
| 157 | + }else { | |
| 158 | + System.out.println("no idCardNo in database:"+ allFm.toString()); | |
| 121 | 159 | continue; |
| 122 | - } | |
| 160 | + } | |
| 161 | + } | |
| 123 | 162 | |
| 124 | 163 | if (patient != null && StringUtils.isNotEmpty(patient.getId())) { |
| 125 | 164 | if (CollectionUtils.isNotEmpty(users) && users.get(0).getId() != null) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
d94da6f
| ... | ... | @@ -1755,6 +1755,7 @@ |
| 1755 | 1755 | stopWatch.start(); |
| 1756 | 1756 | |
| 1757 | 1757 | Query yn = null; |
| 1758 | + | |
| 1758 | 1759 | if ("1".equals(riskPatientsQueryRequest.getTwinsType())) { |
| 1759 | 1760 | Criteria criteria1 = Criteria.where("name").is("亚临床甲减"); |
| 1760 | 1761 | yn = Query.query(Criteria.where("yn").is(1).orOperator(criteria1)); |
| ... | ... | @@ -1782,7 +1783,7 @@ |
| 1782 | 1783 | } |
| 1783 | 1784 | } |
| 1784 | 1785 | |
| 1785 | - patientsQuery.setjFactorList(rFactorList); | |
| 1786 | + patientsQuery.setrFactorList(rFactorList); | |
| 1786 | 1787 | List <Patients> patientses = patientsService.queryPatientBySort(patientsQuery, riskPatientsQueryRequest.getSort(), riskPatientsQueryRequest.getOrder()); |
| 1787 | 1788 | stopWatch.stop(); |
| 1788 | 1789 |