Commit 6b5b26f4c660facc5e8e268cddc3773ed4be4e08

Authored by jiangjiazhi
1 parent b5b0763842

修改新电子病历

Showing 2 changed files with 54 additions and 8 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ 6b5b26f
... ... @@ -1095,7 +1095,7 @@
1095 1095 * @return
1096 1096 */
1097 1097 public BaseResponse queryAntenatalExamination(AntenatalExaminationQueryRequest queryRequest, Integer userId) {
1098   -
  1098 + String hospitalId = autoMatchFacade.getHospitalId(userId);
1099 1099 Patients patients = null;
1100 1100 if (!StringUtils.isEmpty(queryRequest.getPatientId())) {
1101 1101 PatientsQuery patientsQuery = new PatientsQuery();
1102 1102  
... ... @@ -1107,13 +1107,9 @@
1107 1107 patients = list.get(0);
1108 1108 }
1109 1109 } else {
1110   - List<Integer> list1 = autoMatchFacade.matchOrgId(userId);
1111   - String hospital = null;
1112   - if (CollectionUtils.isNotEmpty(list1)) {
1113   - hospital = list1.get(0) + "";
1114   - }
  1110 +
1115 1111 //查询产妇数据
1116   - patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospital, 1, false, null);
  1112 + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospitalId, 1, false, null);
1117 1113 }
1118 1114  
1119 1115 if (null == patients) {
1120 1116  
... ... @@ -1176,8 +1172,45 @@
1176 1172 antexListResult.setIsSieve(cap(patients.getLastMenses(), patients.getId()));
1177 1173 antexListResult.setRiskFactor(highScoreResult.getHighRisk());
1178 1174 antexListResult.setRiskScore(highScoreResult.getScoreStr());
  1175 +
  1176 + //获取最后一次检查的记录
  1177 + AntExQuery antExQuery1=new AntExQuery();
  1178 + antExQuery1.setHospitalId(hospitalId);
  1179 + antExQuery1.setPid(patients.getPid());
  1180 + antExQuery1.setYn(YnEnums.YES.getId());
  1181 + List<AntenatalExaminationModel> examinationModelList = antenatalExaminationService.queryAntenatalExamination(antExQuery1.convertToQuery().addOrder(Sort.Direction.DESC, "created"));
  1182 +
  1183 + String lastTime ="";
  1184 +
  1185 + if(CollectionUtils.isNotEmpty(examinationModelList)){
  1186 + lastTime= DateUtil.getyyyy_MM_dd(examinationModelList.get(0).getCheckDate());
  1187 + }else{
  1188 + AntExChuQuery antExChuQuery1=new AntExChuQuery();
  1189 + antExChuQuery1.setPid(patients.getPid());
  1190 + antExChuQuery1.setHospitalId(hospitalId);
  1191 + antExChuQuery1.setYn(YnEnums.YES.getId());
  1192 +
  1193 + List<AntExChuModel> antExChuModels= antenatalExaminationService.queryAntExChu(antExChuQuery1);
  1194 +
  1195 + if(CollectionUtils.isNotEmpty(antExChuModels)){
  1196 + lastTime =DateUtil.getyyyy_MM_dd(antExChuModels.get(0).getCheckTime());
  1197 + }else{
  1198 + PatientsQuery patientsQuery1=new PatientsQuery();
  1199 + patientsQuery1.setYn(YnEnums.YES.getId());
  1200 + patientsQuery1.setPid(patients.getPid());
  1201 + patientsQuery1.setHospitalId(hospitalId);
  1202 + List<Patients> patientses = patientsService.queryPatient(patientsQuery1);
  1203 +
  1204 + if(CollectionUtils.isNotEmpty(patientses)){
  1205 + lastTime = DateUtil.getyyyy_MM_dd(patientses.get(0).getBookbuildingDate());
  1206 + }
  1207 + }
  1208 + }
  1209 +
  1210 +
  1211 + antexListResult.setLastBuildTime(lastTime);
1179 1212 int days = DateUtil.getDays(patients.getLastMenses(), new Date());
1180   -// 28孕周(28+1—28+6)
  1213 + //28孕周(28+1—28+6)
1181 1214 if ((days >= 197) && days <= 202) {
1182 1215 antexListResult.setIsH("1");
1183 1216 }
... ... @@ -1325,6 +1358,8 @@
1325 1358  
1326 1359 return new BaseObjectResponse().setData(object).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
1327 1360 }
  1361 +
  1362 +
1328 1363  
1329 1364 public HighScoreResult queryRisk(List<String> id, boolean n) {
1330 1365 HighScoreResult highScoreResult = new HighScoreResult();
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntexListResult.java View file @ 6b5b26f
... ... @@ -38,6 +38,9 @@
38 38 private String lastMenses;
39 39 //建档时间
40 40 private String buildTime;
  41 + //最后一次建档时间
  42 + private String lastBuildTime;
  43 +
41 44 private String birth;
42 45  
43 46 private String cardNo;
... ... @@ -46,6 +49,14 @@
46 49 private String isH = "0";
47 50 //<!---------基本信息----------->
48 51  
  52 +
  53 + public String getLastBuildTime() {
  54 + return lastBuildTime;
  55 + }
  56 +
  57 + public void setLastBuildTime(String lastBuildTime) {
  58 + this.lastBuildTime = lastBuildTime;
  59 + }
49 60  
50 61 public String getIsH() {
51 62 return isH;