Commit b88730a5437a4646f3125321babfc8a3ede0996b

Authored by landong2015
1 parent dca58212f0

新增出院小结接口

Showing 6 changed files with 172 additions and 9 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/DischargeAbstractMotherDao.java View file @ b88730a
... ... @@ -16,5 +16,7 @@
16 16 List<DischargeAbstractMotherModel> query(MongoQuery mongoQuery);
17 17  
18 18 void update(DischargeAbstractMotherModel dischargeAbstractMotherModel);
  19 +
  20 + DischargeAbstractMotherModel findOneById(String id);
19 21 }
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/DischargeAbstractMotherDaoImpl.java View file @ b88730a
... ... @@ -27,5 +27,10 @@
27 27 public void update(DischargeAbstractMotherModel dischargeAbstractMotherModel) {
28 28 super.update(new MongoQuery(new MongoCondition("id", dischargeAbstractMotherModel.getId(), MongoOper.IS)).convertToMongoQuery(), dischargeAbstractMotherModel);
29 29 }
  30 +
  31 + @Override
  32 + public DischargeAbstractMotherModel findOneById(String id) {
  33 + return findById(id);
  34 + }
30 35 }
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/DischargeAbstractMotherService.java View file @ b88730a
... ... @@ -29,5 +29,10 @@
29 29 public void update(DischargeAbstractMotherModel dischargeAbstractMotherModel) {
30 30 dischargeAbstractMotherDao.update(dischargeAbstractMotherModel);
31 31 }
  32 +
  33 + public DischargeAbstractMotherModel findOneById(String id){
  34 + return dischargeAbstractMotherDao.findOneById(id);
  35 + }
  36 +
32 37 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java View file @ b88730a
... ... @@ -82,7 +82,7 @@
82 82 }
83 83  
84 84 /**
85   - * 查看复查接口
  85 + * 查看产后复查
86 86 * @param id
87 87 * @return
88 88 */
... ... @@ -93,8 +93,17 @@
93 93 return viewFacade.findPostReviewData(id);
94 94 }
95 95  
96   - //查看出院小结接口
97   -
  96 + /**
  97 + * 查看出院小结
  98 + * @param id
  99 + * @return
  100 + */
  101 + @RequestMapping(value = "/findDischargeAbstractData", method = RequestMethod.GET)
  102 + @ResponseBody
  103 +// @TokenRequired
  104 + public BaseObjectResponse findDischargeAbstractData(@RequestParam("id")String id){
  105 + return viewFacade.findDischargeAbstractData(id);
  106 + }
98 107  
99 108  
100 109 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java View file @ b88730a
... ... @@ -14,6 +14,7 @@
14 14 import com.lyms.platform.permission.service.OrganizationService;
15 15 import com.lyms.platform.permission.service.UsersService;
16 16 import com.lyms.platform.pojo.*;
  17 +import com.lyms.platform.query.DischargeAbstractBabyQuery;
17 18 import org.apache.commons.collections.CollectionUtils;
18 19 import org.apache.commons.collections.MapUtils;
19 20 import org.apache.commons.lang.StringUtils;
... ... @@ -46,6 +47,10 @@
46 47 private MatDeliverService matDeliverService;
47 48 @Autowired
48 49 private PostReviewService postReviewService;
  50 + @Autowired
  51 + private DischargeAbstractMotherService dischargeAbstractMotherService;
  52 + @Autowired
  53 + private DischargeAbstractBabyService dischargeAbstractBabyService;
49 54  
50 55  
51 56 public BaseObjectResponse findPatientData(String id) {
... ... @@ -80,7 +85,7 @@
80 85 map.put("pliveType", getBasicConfig(data.getPliveTypeId()));
81 86 map.put("pprofessionType", getBasicConfig(data.getPprofessionTypeId()));
82 87 map.put("plevelType", getBasicConfig(data.getPlevelTypeId()));
83   - //TODO 家庭人均收入(暂时去掉)
  88 + //家庭人均收入(暂时去掉)
84 89  
85 90 /* 孕妇联系方式 */
86 91 map.put("residence", CommonsHelper.getResidence(data.getProvinceId(), data.getCityId(),
... ... @@ -109,7 +114,7 @@
109 114 map.put("correctionLastMenses", DateUtil.getyyyy_MM_dd(data.getLastMenses()));
110 115 map.put("dueDate", DateUtil.getyyyy_MM_dd(data.getDueDate()));
111 116 map.put("vcCardNo", data.getVcCardNo());
112   - //TODO 条码(暂时去掉)
  117 + //条码(暂时去掉)
113 118 //档案编号
114 119 map.put("fileCode", data.getFileCode());
115 120 map.put("mremark", data.getMremark());
... ... @@ -665,7 +670,8 @@
665 670 highScoreResult = ResolveUtils.queryRisk(patients.getRiskFactorId(),true,basicConfigService);
666 671 }
667 672  
668   - map.put("riskFactorId", highScoreResult);
  673 + map.put("riskFactor", highScoreResult);
  674 + map.put("riskScore", UnitUtils.unitSplice(patients.getRiskScore(),UnitConstants.FEN));
669 675  
670 676 map.put("deliveryDate", data.getDueDate());
671 677 map.put("dueWeek", data.getDueWeek());
672 678  
... ... @@ -1006,12 +1012,17 @@
1006 1012 map.put("fmWeek",patients.getFmWeek());
1007 1013 map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate()));
1008 1014 map.put("mremark",patients.getMremark());
1009   - map.put("oRiskFactor",patients.getoRiskFactor());
1010   - map.put("riskScore",patients.getRiskScore());
  1015 + //高危因素
  1016 + HighScoreResult highScoreResult = null;
  1017 + if (CollectionUtils.isNotEmpty(patients.getRiskFactorId())){
  1018 + highScoreResult = ResolveUtils.queryRisk(patients.getRiskFactorId(),true,basicConfigService);
  1019 + }
  1020 +
  1021 + map.put("riskFactor", highScoreResult);
  1022 + map.put("riskScore",UnitUtils.unitSplice(patients.getRiskScore(),UnitConstants.FEN));
1011 1023 /* 复查信息 */
1012 1024 map.put("checkTime",DateUtil.getyyyy_MM_dd(data.getCheckTime()));
1013 1025 map.put("day",data.getDay());
1014   - map.put("day",data.getDay());
1015 1026 String prodDoctor = "";
1016 1027  
1017 1028 if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getProdDoctor())){
... ... @@ -1091,6 +1102,101 @@
1091 1102 return br;
1092 1103 }
1093 1104  
  1105 + public BaseObjectResponse findDischargeAbstractData(String id){
  1106 + BaseObjectResponse br = new BaseObjectResponse();
  1107 + if (org.apache.commons.lang.StringUtils.isEmpty(id)){
  1108 + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR);
  1109 + br.setErrormsg("id为空");
  1110 + return br;
  1111 + }
  1112 +
  1113 +
  1114 + DischargeAbstractMotherModel data = dischargeAbstractMotherService.findOneById(id);
  1115 + if (data==null){
  1116 + br.setErrorcode(ErrorCodeConstants.NO_DATA);
  1117 + br.setErrormsg("没有查询到数据");
  1118 + return br;
  1119 + }
  1120 +
  1121 + /* 基本信息 */
  1122 + if (StringUtils.isEmpty(data.getPatientId())){
  1123 + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR);
  1124 + br.setErrormsg("数据异常");
  1125 + return br;
  1126 + }
  1127 +
  1128 + Patients patients = patientsService.findOnePatientById(data.getPatientId());
  1129 + if (patients==null){
  1130 + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR);
  1131 + br.setErrormsg("数据异常");
  1132 + return br;
  1133 + }
  1134 + Map<String,Object> map= new HashMap<>();
  1135 + /* 基础信息 */
  1136 + map.put("id",data.getId());
  1137 + map.put("username",patients.getUsername());
  1138 + map.put("birth",DateUtil.getyyyy_MM_dd(patients.getBirth()));
  1139 + map.put("age",UnitUtils.unitSplice(DateUtil.getAge(patients.getBirth()),UnitConstants.SUI));
  1140 + map.put("phone",patients.getPhone());
  1141 + map.put("fmWeek",patients.getFmWeek());
  1142 + map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate()));
  1143 + map.put("mremark",patients.getMremark());
  1144 + //高危因素
  1145 + HighScoreResult highScoreResult = null;
  1146 + if (CollectionUtils.isNotEmpty(patients.getRiskFactorId())){
  1147 + highScoreResult = ResolveUtils.queryRisk(patients.getRiskFactorId(),true,basicConfigService);
  1148 + }
  1149 + map.put("riskFactor",highScoreResult);
  1150 + map.put("riskScore",UnitUtils.unitSplice(patients.getRiskScore(),UnitConstants.FEN));
  1151 + map.put("leaveHospitalDate", DateUtil.getyyyy_MM_dd(data.getLeaveHospitalDate()));
  1152 + map.put("afterMakeBabyDays", data.getAfterMakeBabyDays()==null?"":"产后"+data.getAfterMakeBabyDays()+"天");
  1153 + map.put("inputMan",data.getInputMan());
  1154 + /* 出院信息 */
  1155 + map.put("description",data.getDescription());
  1156 +
  1157 + List<Map> babys = new ArrayList<>();
  1158 +
  1159 + DischargeAbstractBabyQuery babyQuery = new DischargeAbstractBabyQuery();
  1160 + babyQuery.setMotherId(data.getId());
  1161 + List<DischargeAbstractBabyModel> babyModelList = dischargeAbstractBabyService.query(babyQuery);
  1162 + if (CollectionUtils.isNotEmpty(babyModelList)){
  1163 + for (DischargeAbstractBabyModel temp : babyModelList){
  1164 + Map<String,Object> babyMap = new HashMap<>();
  1165 + babyMap.put("description",temp.getDescription());
  1166 + babyMap.put("birthCertificateId",temp.getBirthCertificateId());
  1167 + babyMap.put("isBCG",FunvCommonUtil.checkIsInoculation(temp.getIsBCG()));
  1168 + babyMap.put("isHBV",FunvCommonUtil.checkIsInoculation(temp.getIsHBV()));
  1169 + babyMap.put("bCGAndHBVVaccinationDosage",temp.getbCGAndHBVVaccinationDosage());
  1170 + babyMap.put("bCGAndHBVVaccinationDate",DateUtil.getyyyy_MM_dd(temp.getbCGAndHBVVaccinationDate()));
  1171 + babyMap.put("bCGAndHBVVaccinationInjectUserName",temp.getbCGAndHBVVaccinationInjectUserName());
  1172 + babyMap.put("isHBIG",FunvCommonUtil.checkIsInoculation(temp.getIsHBIG()));
  1173 + babyMap.put("hBIGInjectDosage",temp.gethBIGInjectDosage());
  1174 + babyMap.put("hBIGInjectDate",DateUtil.getyyyy_MM_dd(temp.gethBIGInjectDate()));
  1175 + babyMap.put("hBIGInjectUserName",temp.gethBIGInjectUserName());
  1176 +
  1177 + babyMap.put("isPKU",FunvCommonUtil.checkIsScreening(temp.getIsPKU()));
  1178 + babyMap.put("isCH",FunvCommonUtil.checkIsScreening(temp.getIsCH()));
  1179 + babyMap.put("isUNHS",FunvCommonUtil.checkIsScreening(temp.getIsUNHS()));
  1180 +
  1181 + String isOtherScreen = "";
  1182 + if (temp.getIsOtherScreen()!=null){
  1183 + if (temp.getIsOtherScreen()==1){
  1184 + isOtherScreen = temp.getOrderScreenDescription();
  1185 + }else if (temp.getIsOtherScreen()==0){
  1186 + isOtherScreen = "否";
  1187 + }
  1188 + }
  1189 + babyMap.put("isOtherScreen",isOtherScreen);
  1190 + babys.add(babyMap);
  1191 + }
  1192 + }
  1193 + map.put("babys",babys);
  1194 +
  1195 + br.setErrorcode(ErrorCodeConstants.SUCCESS);
  1196 + br.setErrormsg("成功");
  1197 + br.setData(map);
  1198 + return br;
  1199 + }
1094 1200  
1095 1201  
1096 1202  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/FunvCommonUtil.java View file @ b88730a
... ... @@ -358,6 +358,42 @@
358 358 return "";
359 359 }
360 360  
  361 + /**
  362 + * 验证是否接种
  363 + * @param isInoculation
  364 + * @return
  365 + */
  366 + public static String checkIsInoculation(Integer isInoculation){
  367 + if (isInoculation==null){
  368 + return "";
  369 + }
  370 +
  371 + if (isInoculation==1){
  372 + return "已接种";
  373 + }else if (isInoculation==0){
  374 + return "未接种";
  375 + }
  376 + return "";
  377 + }
  378 +
  379 + /**
  380 + * 验证是否筛查
  381 + * @param isScreening
  382 + * @return
  383 + */
  384 + public static String checkIsScreening(Integer isScreening){
  385 + if (isScreening==null){
  386 + return "";
  387 + }
  388 +
  389 + if (isScreening==1){
  390 + return "已筛查";
  391 + }else if (isScreening==0){
  392 + return "未筛查";
  393 + }
  394 + return "";
  395 + }
  396 +
361 397  
362 398 }