Commit 7b567482fd6d2db15407ad2343f6f785de9edeae
1 parent
d275f199da
Exists in
master
and in
1 other branch
增加统计
Showing 4 changed files with 74 additions and 15 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntExRecordService.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntenatalExaminationService.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntExRecordService.java
View file @
7b56748
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntenatalExaminationService.java
View file @
7b56748
| ... | ... | @@ -7,6 +7,7 @@ |
| 7 | 7 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 8 | 8 | import com.lyms.platform.common.enums.YnEnums; |
| 9 | 9 | import com.lyms.platform.pojo.AntExChuModel; |
| 10 | +import com.lyms.platform.pojo.AntExRecordModel; | |
| 10 | 11 | import com.lyms.platform.pojo.AntenatalExaminationModel; |
| 11 | 12 | import com.lyms.platform.query.AntExChuQuery; |
| 12 | 13 | import com.lyms.platform.query.VisitQuery; |
| ... | ... | @@ -20,7 +21,7 @@ |
| 20 | 21 | |
| 21 | 22 | /** |
| 22 | 23 | * 产前检查服务实现 |
| 23 | - * <p> | |
| 24 | + * <p/> | |
| 24 | 25 | * Created by Administrator on 2016/6/16 0016. |
| 25 | 26 | */ |
| 26 | 27 | @Service |
| 27 | 28 | |
| ... | ... | @@ -29,11 +30,13 @@ |
| 29 | 30 | private IAntenatalExaminationDao iAntenatalExaminationDao; |
| 30 | 31 | @Autowired |
| 31 | 32 | private IAntExChuDao iAntExChuDao; |
| 33 | + @Autowired | |
| 34 | + private AntExRecordService antExRecordService; | |
| 32 | 35 | |
| 33 | 36 | public List<AntenatalExaminationModel> findAllByParentId(String parentId) { |
| 34 | 37 | Assert.notNull(parentId, "findAllByParentId parentId must not be null."); |
| 35 | - MongoCondition condition = MongoCondition.newInstance("parentId", parentId, MongoOper.IS).and("yn", YnEnums.YES.getId(),MongoOper.IS); | |
| 36 | - return iAntenatalExaminationDao.queryAntenatalExamination(condition.toMongoQuery().addOrder(Sort.Direction.DESC,"created")); | |
| 38 | + MongoCondition condition = MongoCondition.newInstance("parentId", parentId, MongoOper.IS).and("yn", YnEnums.YES.getId(), MongoOper.IS); | |
| 39 | + return iAntenatalExaminationDao.queryAntenatalExamination(condition.toMongoQuery().addOrder(Sort.Direction.DESC, "created")); | |
| 37 | 40 | } |
| 38 | 41 | |
| 39 | 42 | |
| 40 | 43 | |
| 41 | 44 | |
| ... | ... | @@ -43,12 +46,14 @@ |
| 43 | 46 | |
| 44 | 47 | /** |
| 45 | 48 | * 查询条数 |
| 49 | + * | |
| 46 | 50 | * @param query |
| 47 | 51 | * @return |
| 48 | 52 | */ |
| 49 | - public int queryAntExChuCount(MongoQuery query){ | |
| 50 | - return (int)iAntExChuDao.count(query); | |
| 53 | + public int queryAntExChuCount(MongoQuery query) { | |
| 54 | + return (int) iAntExChuDao.count(query); | |
| 51 | 55 | } |
| 56 | + | |
| 52 | 57 | /** |
| 53 | 58 | * 按条件查询所有 |
| 54 | 59 | * |
| 55 | 60 | |
| ... | ... | @@ -80,10 +85,31 @@ |
| 80 | 85 | Assert.notNull(babyVisitModel, "addOneBabyAnt babyVisitModel must not be null."); |
| 81 | 86 | babyVisitModel.setCreated(new Date()); |
| 82 | 87 | babyVisitModel.setModified(new Date()); |
| 88 | + | |
| 83 | 89 | return iAntenatalExaminationDao.addOneAntenatalExamination(babyVisitModel); |
| 84 | 90 | } |
| 85 | 91 | |
| 86 | 92 | /** |
| 93 | + * @param id | |
| 94 | + * @param type 1 初诊 2 复诊 | |
| 95 | + */ | |
| 96 | + public void updateAntExRecord(String id, int type) { | |
| 97 | + AntExRecordModel antExRecordModel = null; | |
| 98 | + if (type == 2) { | |
| 99 | + AntenatalExaminationModel ant = findOneById(id); | |
| 100 | + antExRecordModel = antExRecordService.convert(ant); | |
| 101 | + } else { | |
| 102 | + AntExChuModel chu = findOne(id); | |
| 103 | + antExRecordModel = antExRecordService.convert(chu); | |
| 104 | + } | |
| 105 | + | |
| 106 | + if (null != antExRecordModel) { | |
| 107 | + antExRecordService.addOneRecord(antExRecordModel); | |
| 108 | + } | |
| 109 | + } | |
| 110 | + | |
| 111 | + | |
| 112 | + /** | |
| 87 | 113 | * 修改一条新生儿访视记录 |
| 88 | 114 | * |
| 89 | 115 | * @param babyVisitModel 新生儿访视记录模型 |
| ... | ... | @@ -93,6 +119,7 @@ |
| 93 | 119 | Assert.notNull(id, "updateOneAnt id must not be null."); |
| 94 | 120 | babyVisitModel.setModified(new Date()); |
| 95 | 121 | iAntenatalExaminationDao.updateAntenatalExamination(babyVisitModel, id); |
| 122 | + | |
| 96 | 123 | } |
| 97 | 124 | |
| 98 | 125 | /** |
| ... | ... | @@ -115,6 +142,7 @@ |
| 115 | 142 | public void updateAntExChu(AntExChuModel antExChuModel, String id) { |
| 116 | 143 | antExChuModel.setModified(new Date()); |
| 117 | 144 | iAntExChuDao.updateOneAntEx(antExChuModel, id); |
| 145 | + | |
| 118 | 146 | } |
| 119 | 147 | |
| 120 | 148 | /** |
| 121 | 149 | |
| 122 | 150 | |
| 123 | 151 | |
| 124 | 152 | |
| ... | ... | @@ -126,21 +154,24 @@ |
| 126 | 154 | public AntExChuModel addOneAntEx(AntExChuModel obj) { |
| 127 | 155 | obj.setCreated(new Date()); |
| 128 | 156 | obj.setModified(new Date()); |
| 157 | + | |
| 129 | 158 | return iAntExChuDao.addOneAntEx(obj); |
| 130 | 159 | } |
| 131 | 160 | |
| 132 | - public List<AntExChuModel> queryAntExChu(AntExChuQuery antExChuQuery){ | |
| 161 | + public List<AntExChuModel> queryAntExChu(AntExChuQuery antExChuQuery) { | |
| 133 | 162 | return iAntExChuDao.query(antExChuQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); |
| 134 | 163 | } |
| 135 | 164 | |
| 136 | - public List<AntExChuModel> queryAntExChu(MongoQuery mongoQuery){ | |
| 165 | + public List<AntExChuModel> queryAntExChu(MongoQuery mongoQuery) { | |
| 137 | 166 | return iAntExChuDao.query(mongoQuery); |
| 138 | 167 | } |
| 139 | - public List<AntenatalExaminationModel> queryYuyueAntenatalExamination(Date yuYueDate,String hospitalId) { | |
| 168 | + | |
| 169 | + public List<AntenatalExaminationModel> queryYuyueAntenatalExamination(Date yuYueDate, String hospitalId) { | |
| 140 | 170 | return iAntenatalExaminationDao.queryYuyueAntenatalExamination(yuYueDate, hospitalId); |
| 141 | 171 | } |
| 142 | - public List<AntenatalExaminationModel> queryYuyueAntenatalExamination(Date startDate,String hospitalId,String pid) { | |
| 143 | - return iAntenatalExaminationDao.queryYuyueAntenatalExamination(startDate, hospitalId,pid); | |
| 172 | + | |
| 173 | + public List<AntenatalExaminationModel> queryYuyueAntenatalExamination(Date startDate, String hospitalId, String pid) { | |
| 174 | + return iAntenatalExaminationDao.queryYuyueAntenatalExamination(startDate, hospitalId, pid); | |
| 144 | 175 | } |
| 145 | 176 | |
| 146 | 177 |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java
View file @
7b56748
| 1 | 1 | package com.lyms.platform.biz.service; |
| 2 | 2 | |
| 3 | -import com.lyms.platform.biz.dal.IPatientDao; | |
| 4 | -import com.lyms.platform.biz.dal.IReferralApplyOrderDao; | |
| 5 | -import com.lyms.platform.biz.dal.ISieveApplyOrderDao; | |
| 6 | -import com.lyms.platform.biz.dal.ISieveDao; | |
| 3 | +import com.lyms.platform.biz.dal.*; | |
| 7 | 4 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 8 | 5 | import com.lyms.platform.common.enums.SieveStatusEnums; |
| 9 | 6 | import com.lyms.platform.common.enums.YnEnums; |
| ... | ... | @@ -37,6 +34,8 @@ |
| 37 | 34 | private IReferralApplyOrderDao iReferralApplyOrderDao; |
| 38 | 35 | @Autowired |
| 39 | 36 | private PersonService personService; |
| 37 | + @Autowired | |
| 38 | + private IAntExRecordDao iAntExRecordDao; | |
| 40 | 39 | |
| 41 | 40 | public Patients addPatient(Patients obj) { |
| 42 | 41 | return iPatientDao.addPatient(obj); |
| 43 | 42 | |
| 44 | 43 | |
| ... | ... | @@ -241,8 +240,25 @@ |
| 241 | 240 | //修改转诊 |
| 242 | 241 | updateRefer(patients); |
| 243 | 242 | } |
| 243 | + //修改产检管理的孕妇基本信息 | |
| 244 | + private void updateExRecord(Patients patients){ | |
| 245 | + AntExRecordQuery antExRecordQuery=new AntExRecordQuery(); | |
| 246 | + antExRecordQuery.setParentId(patients.getId()); | |
| 244 | 247 | |
| 248 | + AntExRecordModel antExRecordModel=new AntExRecordModel(); | |
| 249 | + antExRecordModel.setLastMenses(patients.getLastMenses()); | |
| 250 | + antExRecordModel.setBuildTime(patients.getBookbuildingDate()); | |
| 251 | + antExRecordModel.setDueDate(patients.getDueDate()); | |
| 252 | + antExRecordModel.setName(patients.getUsername()); | |
| 253 | + antExRecordModel.setBrith(patients.getBirth()); | |
| 254 | + if(patients.getType()==1){ | |
| 255 | + antExRecordModel.setStatus(2); | |
| 256 | + }else { | |
| 257 | + antExRecordModel.setStatus(1); | |
| 258 | + } | |
| 245 | 259 | |
| 260 | + iAntExRecordDao.batchUpdateRecord(antExRecordModel, antExRecordQuery.convertToQuery()); | |
| 261 | + } | |
| 246 | 262 | /** |
| 247 | 263 | * 修改产筛数据 |
| 248 | 264 | * |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
7b56748
| ... | ... | @@ -145,6 +145,9 @@ |
| 145 | 145 | updateLastRhTime(patients.getId(), hospitalId); |
| 146 | 146 | //修改最后一次检查时间 |
| 147 | 147 | setLashCTimes(hospitalId, antExAddRequest.getParentId(), 2); |
| 148 | + | |
| 149 | + //复诊,修改产检管理 | |
| 150 | + antenatalExaminationService.updateAntExRecord(antExAddRequest.getParentId(), 2); | |
| 148 | 151 | } else { |
| 149 | 152 | AntenatalExaminationModel model = antExAddRequest.convertToDataModel(); |
| 150 | 153 | model.setOperator(userId); |
| ... | ... | @@ -181,6 +184,8 @@ |
| 181 | 184 | |
| 182 | 185 | //修改本院最后一次定义高危 |
| 183 | 186 | updateLastRhTime(patients.getId(), hospitalId); |
| 187 | + //复诊,修改产检管理 | |
| 188 | + antenatalExaminationService.updateAntExRecord(antExAddRequest.getParentId(),2); | |
| 184 | 189 | if (null != patients.getBuildType() && patients.getBuildType() == 3) { |
| 185 | 190 | ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery(); |
| 186 | 191 | referralApplyOrderQuery.setParentId(patients.getId()); |
| ... | ... | @@ -264,6 +269,9 @@ |
| 264 | 269 | |
| 265 | 270 | setLashCTimes(hospitalId, antExChuModel.getParentId(), 1); |
| 266 | 271 | |
| 272 | + //初诊,修改产检管理 | |
| 273 | + antenatalExaminationService.updateAntExRecord(antExChuModel.getParentId(), 1); | |
| 274 | + | |
| 267 | 275 | } else { |
| 268 | 276 | AntExChuQuery antExChuQuery1 = new AntExChuQuery(); |
| 269 | 277 | antExChuQuery1.setParentId(excAddRequest.getParentId()); |
| ... | ... | @@ -304,6 +312,7 @@ |
| 304 | 312 | //修改本院最后一次定义高危 |
| 305 | 313 | updateLastRhTime(patients.getId(), hospitalId); |
| 306 | 314 | setLashCTimes(hospitalId, antExChuModel.getParentId(), 1); |
| 315 | + antenatalExaminationService.updateAntExRecord(antExChuModel.getParentId(), 1); | |
| 307 | 316 | if (null != patients.getBuildType() && patients.getBuildType() == 3) { |
| 308 | 317 | Patients patients1 = new Patients(); |
| 309 | 318 | patients1.setEnable("1"); |