Commit f4386f7c406c69e0fb44506b8a38b25e6b1ea7c4

Authored by hujiaqi

Merge remote-tracking branch 'origin/master'

Showing 12 changed files

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/DischargeAbstractMotherDao.java View file @ f4386f7
... ... @@ -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 @ f4386f7
... ... @@ -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 @ f4386f7
... ... @@ -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/hospitalapi/qhdfy/QhdfyFmService.java View file @ f4386f7
... ... @@ -111,7 +111,6 @@
111 111 " and (SFFZRSTDT = ' 是 ' or SFSTDT = ' 是 '))";
112 112 List<FmItem> list = queryRunner.query(conn, sql, new BeanListHandler<FmItem>(FmItem.class));
113 113 ExceptionUtils.catchException("size====" + list.size());
114   - ExceptionUtils.catchException("sql===" + sql);
115 114 if (CollectionUtils.isNotEmpty(list)) {
116 115 for (FmItem item : list) {
117 116 try {
... ... @@ -215,7 +214,7 @@
215 214 babies.add(baby);
216 215 deliverAddRequest.setFmHospital("216"); //设置为秦皇岛分娩医院
217 216 ExceptionUtils.catchException("deliverAddRequest===" + deliverAddRequest);
218   -// matDeliverFacade.addOrUpdateMatDeliver(deliverAddRequest, users.get(0).getId());
  217 + matDeliverFacade.addOrUpdateMatDeliver(deliverAddRequest, users.get(0).getId());
219 218 }
220 219  
221 220 }
... ... @@ -390,7 +389,7 @@
390 389 }
391 390 deliverAddRequest.setFmHospital("216");
392 391 ExceptionUtils.catchException("double deliverAddRequest===" + deliverAddRequest);
393   -// matDeliverFacade.addOrUpdateMatDeliver(deliverAddRequest, users.get(0).getId());
  392 + matDeliverFacade.addOrUpdateMatDeliver(deliverAddRequest, users.get(0).getId());
394 393 }
395 394  
396 395 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java View file @ f4386f7
1 1 package com.lyms.platform.operate.web.controller;
2 2  
3 3  
  4 +import com.lyms.platform.biz.service.BasicConfigService;
4 5 import com.lyms.platform.biz.service.OrganizationGroupsService;
5 6 import com.lyms.platform.common.annotation.TokenRequired;
6 7 import com.lyms.platform.common.base.BaseController;
... ... @@ -18,6 +19,7 @@
18 19 import com.lyms.platform.operate.web.session.strategy.ISessionProvider;
19 20 import com.lyms.platform.permission.model.*;
20 21 import com.lyms.platform.permission.service.*;
  22 +import com.lyms.platform.pojo.BasicConfig;
21 23 import com.lyms.platform.pojo.DataPermissionsModel;
22 24 import com.lyms.platform.pojo.OrganizationGroups;
23 25 import org.apache.commons.collections.CollectionUtils;
... ... @@ -74,6 +76,8 @@
74 76 private SessionProvider iSessionProvider;
75 77 @Autowired
76 78 private AutoMatchFacade autoMatchFacade;
  79 + @Autowired
  80 + private BasicConfigService basicConfigService;
77 81  
78 82 private static final String LYMS = "龙源美生";
79 83  
... ... @@ -479,6 +483,15 @@
479 483 organizations = organizationService.queryOrganization(organizationQuery);
480 484 } else {
481 485 Organization organization = organizationService.getOrganization(users.getOrgId());
  486 + if(null!=organization&&StringUtils.isNotEmpty(organization.getCityId())){
  487 + BasicConfig bg= basicConfigService.getOneBasicConfigById(organization.getCityId());
  488 + Map<String,String> map = new HashMap<>();
  489 + map.put("id",organization.getCityId());
  490 + if(null!=bg){
  491 + map.put("name",bg.getName());
  492 + }
  493 + organization.setCity(map);
  494 + }
482 495 organizations.add(organization);
483 496 users.setOrganization(organization);
484 497 //是否是建档医院
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java View file @ f4386f7
... ... @@ -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/AntenatalExaminationFacade.java View file @ f4386f7
... ... @@ -1691,6 +1691,9 @@
1691 1691 String hospitalId = autoMatchFacade.getHospitalId(userId);
1692 1692 Patients patients = null;
1693 1693 Organization og = organizationService.getOrganization(Integer.valueOf(hospitalId));
  1694 + //获取当前用户在的医院
  1695 + List<String> currentGroupHospital=groupsFacade.findGroupHospital(userId, false);
  1696 +
1694 1697 if (!StringUtils.isEmpty(queryRequest.getPatientId())) {
1695 1698 PatientsQuery patientsQuery = new PatientsQuery();
1696 1699 patientsQuery.setId(queryRequest.getPatientId());
1697 1700  
1698 1701  
... ... @@ -1709,30 +1712,30 @@
1709 1712  
1710 1713 PatientCheckTicket checkTicket = patientCheckTicketService.getTicket(queryRequest.getBarCode());
1711 1714 if (null != checkTicket) {
1712   - Patients patients1 = patientsService.findOnePatientById(checkTicket.getPatientId());
1713   - if (null != patients1) {
1714   - if (StringUtils.isNotEmpty(patients1.getSource())) {
1715   - patients = patientsService.findOnePatientById(patients1.getSource());
1716   - } else {
1717   - patients = patients1;
  1715 + if(null!=currentGroupHospital&&currentGroupHospital.contains(checkTicket.getHospitalId())){
  1716 + Patients patients1 = patientsService.findOnePatientById(checkTicket.getPatientId());
  1717 + if (null != patients1) {
  1718 + if (StringUtils.isNotEmpty(patients1.getSource())) {
  1719 + patients = patientsService.findOnePatientById(patients1.getSource());
  1720 + } else {
  1721 + patients = patients1;
  1722 + }
1718 1723 }
1719 1724 }
1720 1725 }
1721 1726 } else {
1722   - patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, groupsFacade.findGroupHospital(userId, false), 1, false, null, og.getbStatus() == 1);
  1727 + if(StringUtils.isEmpty(queryRequest.getCardNo())&&StringUtils.isEmpty(queryRequest.getVcCardNo())){
  1728 + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请输入查询条件");
  1729 + }
  1730 + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null,currentGroupHospital , 1, false, null, og.getbStatus() == 1);
1723 1731 //查询产妇数据
1724 1732 // patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospitalId, 1, false, null, false);
1725 1733 }
1726 1734  
1727 1735 if (null == patients) {
1728   -// if (ErrorCodeConstants.RUN_MODE.equals(runType)) {
1729   -// //查询是否还有其他记录
1730   -// patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospitalId, 3, false, null, true);
1731   -// } else {
1732   -// //查询是否还有其他记录
1733   -// patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospitalId, 3, false, null, false);
1734   -// }
1735   - patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, groupsFacade.findGroupHospital(userId, false), 3, false, null, og.getbStatus() == 1);
  1736 + if(StringUtils.isNotEmpty(queryRequest.getCardNo())&&StringUtils.isNotEmpty( queryRequest.getVcCardNo())){
  1737 + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, currentGroupHospital, 3, false, null, og.getbStatus() == 1);
  1738 + }
1736 1739  
1737 1740 //原来单机
1738 1741 if (null != patients) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java View file @ f4386f7
... ... @@ -196,6 +196,9 @@
196 196 patientsLocal.setIsAutoFm(YnEnums.NO.getId());
197 197 patientsLocal.setType(3);
198 198 patientsLocal.setFmHospital(hospitalId);
  199 + if(null!=patients.get(0).getBuildType()&&patients.get(0).getBuildType()==2){
  200 + patientsLocal.setBuildType(0);
  201 + }
199 202 patientsLocal.setFmType(MapUtils.isNotEmpty(deliverAddRequest.getDeliveryMode())?null:deliverAddRequest.getDeliveryMode().toString());
200 203 try {
201 204 patientsLocal.setFmAge(DateUtil.getAge(patients1.getBirth(), fmDate));
... ... @@ -300,6 +303,9 @@
300 303 patients1.setIsAutoFm(YnEnums.NO.getId());
301 304 patients1.setFmHospital(hospitalId);
302 305 patients1.setFmType(MapUtils.isNotEmpty(deliverAddRequest.getDeliveryMode())?null:deliverAddRequest.getDeliveryMode().toString());
  306 + if(null!=patients.getBuildType()&&patients.getBuildType()==2){
  307 + patients1.setBuildType(0);
  308 + }
303 309 try {
304 310 patients1.setFmAge(DateUtil.getAge(patients.getBirth(), fmDate));
305 311 } catch (Exception e) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java View file @ f4386f7
... ... @@ -7,12 +7,15 @@
7 7 import com.lyms.platform.common.utils.DateUtil;
8 8 import com.lyms.platform.common.utils.JsonUtil;
9 9 import com.lyms.platform.operate.web.request.MatDeliverAddRequest;
  10 +import com.lyms.platform.operate.web.result.HighScoreResult;
10 11 import com.lyms.platform.operate.web.utils.*;
11 12 import com.lyms.platform.permission.model.Organization;
12 13 import com.lyms.platform.permission.model.Users;
13 14 import com.lyms.platform.permission.service.OrganizationService;
14 15 import com.lyms.platform.permission.service.UsersService;
15 16 import com.lyms.platform.pojo.*;
  17 +import com.lyms.platform.query.BabyModelQuery;
  18 +import com.lyms.platform.query.DischargeAbstractBabyQuery;
16 19 import org.apache.commons.collections.CollectionUtils;
17 20 import org.apache.commons.collections.MapUtils;
18 21 import org.apache.commons.lang.StringUtils;
... ... @@ -45,6 +48,12 @@
45 48 private MatDeliverService matDeliverService;
46 49 @Autowired
47 50 private PostReviewService postReviewService;
  51 + @Autowired
  52 + private DischargeAbstractMotherService dischargeAbstractMotherService;
  53 + @Autowired
  54 + private DischargeAbstractBabyService dischargeAbstractBabyService;
  55 + @Autowired
  56 + private BabyService babyService;
48 57  
49 58  
50 59 public BaseObjectResponse findPatientData(String id) {
... ... @@ -79,7 +88,7 @@
79 88 map.put("pliveType", getBasicConfig(data.getPliveTypeId()));
80 89 map.put("pprofessionType", getBasicConfig(data.getPprofessionTypeId()));
81 90 map.put("plevelType", getBasicConfig(data.getPlevelTypeId()));
82   - //TODO 家庭人均收入
  91 + //家庭人均收入(暂时去掉)
83 92  
84 93 /* 孕妇联系方式 */
85 94 map.put("residence", CommonsHelper.getResidence(data.getProvinceId(), data.getCityId(),
... ... @@ -108,7 +117,7 @@
108 117 map.put("correctionLastMenses", DateUtil.getyyyy_MM_dd(data.getLastMenses()));
109 118 map.put("dueDate", DateUtil.getyyyy_MM_dd(data.getDueDate()));
110 119 map.put("vcCardNo", data.getVcCardNo());
111   - //TODO 条码
  120 + //条码(暂时去掉)
112 121 //档案编号
113 122 map.put("fileCode", data.getFileCode());
114 123 map.put("mremark", data.getMremark());
... ... @@ -185,8 +194,48 @@
185 194 map.put("fmWeek",patients.getFmWeek());
186 195 map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate()));
187 196 map.put("mremark",patients.getMremark());
188   - map.put("oRiskFactor",patients.getoRiskFactor());//TODO 高危需要处理
189   - map.put("riskScore",patients.getRiskScore());
  197 +
  198 + HighScoreResult highScoreResult = null;
  199 + if (StringUtils.isNotEmpty(data.getHighrisk())){
  200 + List<String> ids = JsonUtil.toList(data.getHighrisk(), String.class);
  201 + if (CollectionUtils.isNotEmpty(ids)){
  202 + highScoreResult = ResolveUtils.queryRisk(ids, true, basicConfigService);
  203 + }
  204 + }
  205 + Integer score = 0;
  206 + if (highScoreResult.getScore()!=null){
  207 + score = highScoreResult.getScore();
  208 + }
  209 +
  210 + List<Map<String, Object>> list = ResolveUtils.queryHighRisk(highScoreResult);
  211 +
  212 + Map<String,Object> otherRisk = null;
  213 + if (StringUtils.isNotEmpty(data.getOtherHighRisk()) && !"{}".equals(data.getOtherHighRisk())){
  214 + otherRisk = new HashMap<>();
  215 + ResolveUtils.queryOtherRisk(data.getOtherHighRisk(),otherRisk,basicConfigService);
  216 + }
  217 +
  218 + Map<String,Object> otherMap = new HashMap<>();
  219 +
  220 + if (otherRisk!=null){
  221 + if (otherRisk.get("name")!=null){
  222 + otherMap.put("name",otherRisk.get("name"));
  223 + }
  224 + if (otherRisk.get("color")!=null){
  225 + otherMap.put("color",otherRisk.get("color"));
  226 + }
  227 + if (otherRisk.get("score")!=null){
  228 + String s = (String)otherRisk.get("score");
  229 + if (FunvCommonUtil.isNumeric(s)){
  230 + score = score + Integer.parseInt(s);
  231 + }
  232 + }
  233 + list.add(otherMap);
  234 + }
  235 +
  236 + map.put("score",score);
  237 + map.put("highRisk",list);
  238 +
190 239 //产检基本信息
191 240 map.put("checkDate",DateUtil.getyyyy_MM_dd(data.getCheckTime()));
192 241 //TODO 产检孕周
... ... @@ -404,7 +453,7 @@
404 453 }
405 454  
406 455 map.put("ydfmw",ydfmw);
407   - map.put("ydqjd",ydqjd);
  456 + map.put("ydqjd",FunvCommonUtil.getBaseicConfigByid(ydqjd,basicConfigService));
408 457 map.put("bChao",data.getbChao());
409 458  
410 459  
411 460  
... ... @@ -474,13 +523,25 @@
474 523 map.put("id",data.getId());
475 524 map.put("username",patients.getUsername());
476 525 map.put("birth",DateUtil.getyyyy_MM_dd(patients.getBirth()));
477   - map.put("age",DateUtil.getAge(patients.getBirth()));
  526 + map.put("age",UnitUtils.unitSplice(DateUtil.getAge(patients.getBirth()),UnitConstants.SUI));
478 527 map.put("phone",patients.getPhone());
479 528 map.put("fmWeek",patients.getFmWeek());
480 529 map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate()));
481 530 map.put("mremark",patients.getMremark());
482   - map.put("oRiskFactor",patients.getoRiskFactor());
483   - map.put("riskScore",patients.getRiskScore());
  531 + HighScoreResult highScoreResult = null;
  532 + if (StringUtils.isNotEmpty(data.getRiskFactor())){
  533 + List<String> ids = JsonUtil.toList(data.getRiskFactor(), String.class);
  534 + if (CollectionUtils.isNotEmpty(ids)){
  535 + highScoreResult = ResolveUtils.queryRisk(ids, true, basicConfigService);
  536 + }
  537 + }
  538 + map.put("highRisk",highScoreResult);
  539 +
  540 + Map<String,Object> otherRisk = new HashMap<>();
  541 + if (StringUtils.isNotEmpty(data.getOtherRisk()) && !"{}".equals(data.getOtherRisk())){
  542 + ResolveUtils.queryOtherRisk(data.getOtherRisk(),otherRisk,basicConfigService);
  543 + }
  544 + map.put("otherHighRisk",otherRisk);
484 545 //产检基本信息
485 546 map.put("checkDate",DateUtil.getyyyy_MM_dd(data.getCheckDate()));
486 547 map.put("currentDueDate",data.getCurrentDueDate());
487 548  
488 549  
489 550  
490 551  
... ... @@ -630,41 +691,15 @@
630 691 map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate()));
631 692 map.put("mremark",patients.getMremark());
632 693  
633   - String riskFactor = "";
634   - if (StringUtils.isNotEmpty(patients.getoRiskFactor())){
635   - riskFactor = patients.getoRiskFactor();
636   - }
637   -
  694 + //高危因素
  695 + HighScoreResult highScoreResult = null;
638 696 if (CollectionUtils.isNotEmpty(patients.getRiskFactorId())){
639   - if (StringUtils.isEmpty(riskFactor)){
640   - riskFactor = commonService.resloveFactor(patients.getRiskFactorId());
641   - }else {
642   - riskFactor = riskFactor + "," + commonService.resloveFactor(patients.getRiskFactorId());
643   - }
  697 + highScoreResult = ResolveUtils.queryRisk(patients.getRiskFactorId(),true,basicConfigService);
644 698 }
645   - map.put("oRiskFactor",riskFactor);
646 699  
647   - String riskLevel = "";
  700 + map.put("riskFactor", highScoreResult);
  701 + map.put("riskScore", UnitUtils.unitSplice(patients.getRiskScore(),UnitConstants.FEN));
648 702  
649   - if (StringUtils.isNotEmpty(patients.getRiskLevelId())){
650   - List<String> riskLevels = JsonUtil.toList(patients.getRiskLevelId(), String.class);
651   - if (CollectionUtils.isNotEmpty(riskLevels)){
652   - StringBuilder sb = new StringBuilder();
653   - for (String r : riskLevels){
654   - sb.append(FunvCommonUtil.getBaseicConfigByid(r, basicConfigService)).append(",");
655   - }
656   -
657   - if (sb.toString().endsWith(",")){
658   - riskLevel = sb.substring(0, sb.length() - 1);
659   - }else {
660   - riskLevel = sb.toString();
661   - }
662   -
663   - }
664   - }
665   - map.put("riskLevel", riskLevel);
666   - map.put("riskScore", UnitUtils.unitSplice(patients.getRiskScore(), UnitConstants.FEN));
667   -
668 703 map.put("deliveryDate", data.getDueDate());
669 704 map.put("dueWeek", data.getDueWeek());
670 705  
671 706  
... ... @@ -1004,12 +1039,17 @@
1004 1039 map.put("fmWeek",patients.getFmWeek());
1005 1040 map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate()));
1006 1041 map.put("mremark",patients.getMremark());
1007   - map.put("oRiskFactor",patients.getoRiskFactor());
1008   - map.put("riskScore",patients.getRiskScore());
  1042 + //高危因素
  1043 + HighScoreResult highScoreResult = null;
  1044 + if (CollectionUtils.isNotEmpty(patients.getRiskFactorId())){
  1045 + highScoreResult = ResolveUtils.queryRisk(patients.getRiskFactorId(),true,basicConfigService);
  1046 + }
  1047 +
  1048 + map.put("riskFactor", highScoreResult);
  1049 + map.put("riskScore",UnitUtils.unitSplice(patients.getRiskScore(),UnitConstants.FEN));
1009 1050 /* 复查信息 */
1010 1051 map.put("checkTime",DateUtil.getyyyy_MM_dd(data.getCheckTime()));
1011 1052 map.put("day",data.getDay());
1012   - map.put("day",data.getDay());
1013 1053 String prodDoctor = "";
1014 1054  
1015 1055 if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getProdDoctor())){
... ... @@ -1089,6 +1129,118 @@
1089 1129 return br;
1090 1130 }
1091 1131  
  1132 + public BaseObjectResponse findDischargeAbstractData(String id){
  1133 + BaseObjectResponse br = new BaseObjectResponse();
  1134 + if (org.apache.commons.lang.StringUtils.isEmpty(id)){
  1135 + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR);
  1136 + br.setErrormsg("id为空");
  1137 + return br;
  1138 + }
  1139 +
  1140 + DischargeAbstractMotherModel data = dischargeAbstractMotherService.findOneById(id);
  1141 + if (data==null){
  1142 + br.setErrorcode(ErrorCodeConstants.NO_DATA);
  1143 + br.setErrormsg("没有查询到数据");
  1144 + return br;
  1145 + }
  1146 +
  1147 + /* 基本信息 */
  1148 + if (StringUtils.isEmpty(data.getPatientId())){
  1149 + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR);
  1150 + br.setErrormsg("数据异常");
  1151 + return br;
  1152 + }
  1153 +
  1154 + Patients patients = patientsService.findOnePatientById(data.getPatientId());
  1155 + if (patients==null){
  1156 + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR);
  1157 + br.setErrormsg("数据异常");
  1158 + return br;
  1159 + }
  1160 + Map<String,Object> map= new HashMap<>();
  1161 + /* 基础信息 */
  1162 + map.put("id",data.getId());
  1163 + map.put("username",patients.getUsername());
  1164 + map.put("birth",DateUtil.getyyyy_MM_dd(patients.getBirth()));
  1165 + map.put("age",UnitUtils.unitSplice(DateUtil.getAge(patients.getBirth()),UnitConstants.SUI));
  1166 + map.put("phone",patients.getPhone());
  1167 + map.put("fmWeek",patients.getFmWeek());
  1168 + map.put("dueDate",DateUtil.getyyyy_MM_dd(patients.getDueDate()));
  1169 + map.put("mremark",patients.getMremark());
  1170 + //高危因素
  1171 + HighScoreResult highScoreResult = null;
  1172 + if (CollectionUtils.isNotEmpty(patients.getRiskFactorId())){
  1173 + highScoreResult = ResolveUtils.queryRisk(patients.getRiskFactorId(),true,basicConfigService);
  1174 + }
  1175 + map.put("riskFactor",highScoreResult);
  1176 + map.put("riskScore",UnitUtils.unitSplice(patients.getRiskScore(),UnitConstants.FEN));
  1177 + map.put("leaveHospitalDate", DateUtil.getyyyy_MM_dd(data.getLeaveHospitalDate()));
  1178 + map.put("afterMakeBabyDays", data.getAfterMakeBabyDays()==null?"":"产后"+data.getAfterMakeBabyDays()+"天");
  1179 + String inputMan = "";
  1180 + if (StringUtils.isNotEmpty(data.getInputMan()) && FunvCommonUtil.isNumeric(data.getInputMan())){
  1181 + Users users = usersService.getUsers(Integer.parseInt(data.getInputMan()));
  1182 + if (users!=null && users.getYn()==YnEnums.YES.getId()){
  1183 + inputMan = users.getName();
  1184 + }
  1185 + }
  1186 + map.put("inputMan",inputMan);
  1187 + /* 出院信息 */
  1188 + map.put("description",data.getDescription());
  1189 +
  1190 + List<Map> babys = new ArrayList<>();
  1191 +
  1192 + DischargeAbstractBabyQuery babyQuery = new DischargeAbstractBabyQuery();
  1193 + babyQuery.setMotherId(data.getId());
  1194 + List<DischargeAbstractBabyModel> babyModelList = dischargeAbstractBabyService.query(babyQuery);
  1195 + if (CollectionUtils.isNotEmpty(babyModelList)){
  1196 + for (DischargeAbstractBabyModel temp : babyModelList){
  1197 + if (temp.getpId()==null){
  1198 + continue;
  1199 + }
  1200 + BabyModelQuery babyModelQuery = new BabyModelQuery();
  1201 + babyModelQuery.setYn(YnEnums.YES.getId());
  1202 + babyModelQuery.setPid(temp.getpId());
  1203 + babyModelQuery.setPregnancyOut(RenShenJieJuEnums.O.getId());
  1204 + List<BabyModel> babyModels = babyService.queryBabyWithQuery(babyModelQuery);
  1205 + if (CollectionUtils.isEmpty(babyModels)){
  1206 + continue;
  1207 + }
  1208 +
  1209 + Map<String,Object> babyMap = new HashMap<>();
  1210 + babyMap.put("description",temp.getDescription());
  1211 + babyMap.put("birthCertificateId",temp.getBirthCertificateId());
  1212 + babyMap.put("isBCG",FunvCommonUtil.checkIsInoculation(temp.getIsBCG()));
  1213 + babyMap.put("isHBV",FunvCommonUtil.checkIsInoculation(temp.getIsHBV()));
  1214 + babyMap.put("bCGAndHBVVaccinationDosage",temp.getbCGAndHBVVaccinationDosage());
  1215 + babyMap.put("bCGAndHBVVaccinationDate",DateUtil.getyyyy_MM_dd(temp.getbCGAndHBVVaccinationDate()));
  1216 + babyMap.put("bCGAndHBVVaccinationInjectUserName",temp.getbCGAndHBVVaccinationInjectUserName());
  1217 + babyMap.put("isHBIG",FunvCommonUtil.checkIsInoculation(temp.getIsHBIG()));
  1218 + babyMap.put("hBIGInjectDosage",temp.gethBIGInjectDosage());
  1219 + babyMap.put("hBIGInjectDate",DateUtil.getyyyy_MM_dd(temp.gethBIGInjectDate()));
  1220 + babyMap.put("hBIGInjectUserName",temp.gethBIGInjectUserName());
  1221 +
  1222 + babyMap.put("isPKU",FunvCommonUtil.checkIsScreening(temp.getIsPKU()));
  1223 + babyMap.put("isCH",FunvCommonUtil.checkIsScreening(temp.getIsCH()));
  1224 + babyMap.put("isUNHS",FunvCommonUtil.checkIsScreening(temp.getIsUNHS()));
  1225 +
  1226 + String isOtherScreen = "";
  1227 + if (temp.getIsOtherScreen()!=null){
  1228 + if (temp.getIsOtherScreen()==1){
  1229 + isOtherScreen = temp.getOrderScreenDescription();
  1230 + }else if (temp.getIsOtherScreen()==0){
  1231 + isOtherScreen = "否";
  1232 + }
  1233 + }
  1234 + babyMap.put("isOtherScreen",isOtherScreen);
  1235 + babys.add(babyMap);
  1236 + }
  1237 + }
  1238 + map.put("babys",babys);
  1239 + br.setErrorcode(ErrorCodeConstants.SUCCESS);
  1240 + br.setErrormsg("成功");
  1241 + br.setData(map);
  1242 + return br;
  1243 + }
1092 1244  
1093 1245  
1094 1246  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatDeliverAddRequest.java View file @ f4386f7
... ... @@ -593,6 +593,25 @@
593 593 public void setPregnancyOut(String pregnancyOut) {
594 594 this.pregnancyOut = pregnancyOut;
595 595 }
  596 +
  597 + @Override
  598 + public String toString() {
  599 + return "Baby{" +
  600 + "id='" + id + '\'' +
  601 + ", babyGender='" + babyGender + '\'' +
  602 + ", babyWeight='" + babyWeight + '\'' +
  603 + ", babyHeight='" + babyHeight + '\'' +
  604 + ", deformity=" + deformity +
  605 + ", apgarScore=" + apgarScore +
  606 + ", asphyxiaM='" + asphyxiaM + '\'' +
  607 + ", pregnancyOut='" + pregnancyOut + '\'' +
  608 + ", babyHealthy='" + babyHealthy + '\'' +
  609 + ", contactStartM='" + contactStartM + '\'' +
  610 + ", contactM='" + contactM + '\'' +
  611 + ", earlySuck='" + earlySuck + '\'' +
  612 + ", dueTime='" + dueTime + '\'' +
  613 + '}';
  614 + }
596 615 }
597 616 /* public static void main(String[] args){
598 617 MatDeliverAddRequest matDeliverAddRequest = new MatDeliverAddRequest();
... ... @@ -601,5 +620,43 @@
601 620 matDeliverAddRequest.setBabies(babies);
602 621 System.out.print(JsonUtil.obj2JsonString(matDeliverAddRequest));
603 622 }*/
  623 +
  624 + @Override
  625 + public String toString() {
  626 + return "MatDeliverAddRequest{" +
  627 + "id='" + id + '\'' +
  628 + ", pid='" + pid + '\'' +
  629 + ", parentId='" + parentId + '\'' +
  630 + ", dueDate='" + dueDate + '\'' +
  631 + ", dueWeek='" + dueWeek + '\'' +
  632 + ", tireNumber=" + tireNumber +
  633 + ", placenta='" + placenta + '\'' +
  634 + ", placentas=" + placentas +
  635 + ", extPlacentas=" + extPlacentas +
  636 + ", deliveryMode=" + deliveryMode +
  637 + ", operationCause='" + operationCause + '\'' +
  638 + ", prodprocess=" + prodprocess +
  639 + ", totalprocess=" + totalprocess +
  640 + ", perinealCondition='" + perinealCondition + '\'' +
  641 + ", siLielevel=" + siLielevel +
  642 + ", needleNum=" + needleNum +
  643 + ", maternalInfo='" + maternalInfo + '\'' +
  644 + ", deathCause='" + deathCause + '\'' +
  645 + ", deathCauseText='" + deathCauseText + '\'' +
  646 + ", chBp=" + chBp +
  647 + ", ch2Bp=" + ch2Bp +
  648 + ", breath='" + breath + '\'' +
  649 + ", pulse='" + pulse + '\'' +
  650 + ", oHloseBloodL=" + oHloseBloodL +
  651 + ", tHloseBloodL=" + tHloseBloodL +
  652 + ", rHloseBloodL=" + rHloseBloodL +
  653 + ", sHloseBloodL=" + sHloseBloodL +
  654 + ", loseBloodCause=" + loseBloodCause +
  655 + ", ocs=" + ocs +
  656 + ", babies=" + babies.toString() +
  657 + ", fmHospital='" + fmHospital + '\'' +
  658 + ", deliverDoctor='" + deliverDoctor + '\'' +
  659 + '}';
  660 + }
604 661 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/FunvCommonUtil.java View file @ f4386f7
1 1 package com.lyms.platform.operate.web.utils;
2 2  
3 3 import com.lyms.platform.biz.service.BasicConfigService;
  4 +import com.lyms.platform.common.enums.RiskDefaultTypeEnum;
4 5 import com.lyms.platform.common.enums.YnEnums;
5 6 import com.lyms.platform.common.utils.JsonUtil;
  7 +import com.lyms.platform.operate.web.result.HighScoreResult;
6 8 import com.lyms.platform.pojo.BasicConfig;
  9 +import com.lyms.platform.query.BasicConfigQuery;
  10 +import org.apache.commons.collections.CollectionUtils;
7 11 import org.apache.commons.lang.StringUtils;
  12 +import org.apache.commons.lang.math.NumberUtils;
8 13  
9 14 import java.util.*;
  15 +import java.util.regex.Matcher;
  16 +import java.util.regex.Pattern;
10 17  
11 18 /**
12 19 * 妇女模块公共方法
... ... @@ -108,6 +115,21 @@
108 115 }
109 116  
110 117 /**
  118 + * 判断是否为数字
  119 + * @param str
  120 + * @return
  121 + */
  122 + public static boolean isNumeric(String str){
  123 + Pattern pattern = Pattern.compile("[0-9]*");
  124 + Matcher isNum = pattern.matcher(str);
  125 + if( !isNum.matches() ){
  126 + return false;
  127 + }
  128 + return true;
  129 + }
  130 +
  131 +
  132 + /**
111 133 * 获取生日(****年**月**日)
112 134 * @param b
113 135 * @return
... ... @@ -353,6 +375,41 @@
353 375 return "";
354 376 }
355 377  
  378 + /**
  379 + * 验证是否接种
  380 + * @param isInoculation
  381 + * @return
  382 + */
  383 + public static String checkIsInoculation(Integer isInoculation){
  384 + if (isInoculation==null){
  385 + return "";
  386 + }
  387 +
  388 + if (isInoculation==1){
  389 + return "已接种";
  390 + }else if (isInoculation==0){
  391 + return "未接种";
  392 + }
  393 + return "";
  394 + }
  395 +
  396 + /**
  397 + * 验证是否筛查
  398 + * @param isScreening
  399 + * @return
  400 + */
  401 + public static String checkIsScreening(Integer isScreening){
  402 + if (isScreening==null){
  403 + return "";
  404 + }
  405 +
  406 + if (isScreening==1){
  407 + return "已筛查";
  408 + }else if (isScreening==0){
  409 + return "未筛查";
  410 + }
  411 + return "";
  412 + }
356 413  
357 414  
358 415 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/ResolveUtils.java View file @ f4386f7
1 1 package com.lyms.platform.operate.web.utils;
2 2  
3 3 import com.lyms.platform.biz.service.BasicConfigService;
  4 +import com.lyms.platform.common.enums.RiskDefaultTypeEnum;
4 5 import com.lyms.platform.common.utils.JsonUtil;
  6 +import com.lyms.platform.operate.web.result.HighScoreResult;
  7 +import com.lyms.platform.pojo.BasicConfig;
  8 +import com.lyms.platform.query.BasicConfigQuery;
  9 +import org.apache.commons.collections.CollectionUtils;
  10 +import org.apache.commons.lang.StringUtils;
  11 +import org.apache.commons.lang.math.NumberUtils;
  12 +import org.springframework.beans.factory.annotation.Autowired;
5 13  
6   -import java.util.HashMap;
7   -import java.util.Iterator;
8   -import java.util.Map;
9   -import java.util.Set;
  14 +import java.util.*;
10 15  
11 16 /**
12 17 * Created by Administrator on 2017/1/9 0009.
13 18  
... ... @@ -144,7 +149,134 @@
144 149 return "";
145 150 }
146 151  
  152 + /**
  153 + * 解析高危
  154 + * @param id
  155 + * @param n
  156 + * @param basicConfigService
  157 + * @return
  158 + */
  159 + public static HighScoreResult queryRisk(List<String> id, boolean n,BasicConfigService basicConfigService) {
  160 + HighScoreResult highScoreResult = new HighScoreResult();
  161 + BasicConfigQuery
  162 + basicConfigQuery = new BasicConfigQuery();
  163 + List data = new ArrayList();
  164 + List dat1a = new ArrayList();
  165 + Integer score = null;
  166 + if (CollectionUtils.isNotEmpty(id)) {
  167 + score = 0;
  168 + for (String i : id) {
  169 + basicConfigQuery.setId(i);
  170 + List<BasicConfig> basicConfigs = basicConfigService.queryBasicConfig(basicConfigQuery);
  171 + if (CollectionUtils.isNotEmpty(basicConfigs)) {
  172 + for (BasicConfig basicConfig : basicConfigs) {
  173 + Map<String, Object> map = new HashMap<>();
  174 + map.put("id", basicConfig.getId());
  175 + map.put("name", basicConfig.getName());
  176 + map.put("code", basicConfig.getCode());
  177 + basicConfigQuery.setId(basicConfig.getParentId());
  178 + List<BasicConfig> basicConfigs2 = basicConfigService.queryBasicConfig(basicConfigQuery);
  179 + if (CollectionUtils.isNotEmpty(basicConfigs2)) {
  180 + for (BasicConfig bc : basicConfigs2) {
  181 + String name = bc.getName();
  182 + if (name.indexOf("预警") > -1) {
  183 + name = name.replace("预警", "");
  184 + }
  185 + map.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name));
  186 + }
  187 + }
  188 + if (StringUtils.isNotEmpty(basicConfig.getCode())) {
  189 + score += NumberUtils.toInt(basicConfig.getCode(), 0);
  190 + }
  191 + if (n) {
  192 + BasicConfig basicConfig1 = basicConfigService.getOneBasicConfigById(basicConfig.getParentId());
  193 + if (null != basicConfig1) {
  194 + Map<String, Object> map1 = new HashMap<>();
  195 + map1.put("id", basicConfig1.getId());
  196 + String name = basicConfig1.getName();
  197 + if (name.indexOf("预警") > -1) {
  198 + name = name.replace("预警", "");
  199 + }
  200 + map1.put("name", name);
  201 + map1.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name));
  202 + dat1a.add(map1);
  203 + }
  204 + }
  205 + data.add(map);
  206 + }
  207 + }
  208 + }
  209 + }
  210 + highScoreResult.setHighRisk(data);
  211 + highScoreResult.setScore(score);
  212 + highScoreResult.setLevel(dat1a);
  213 + return highScoreResult;
  214 + }
147 215  
  216 + public static Map queryOtherRisk(String otherHighRisk,Map<String,Object>map,BasicConfigService basicConfigService){
  217 + if (StringUtils.isEmpty(otherHighRisk)){
  218 + return map;
  219 + }
  220 +
  221 + String color = "";
  222 + String pingfen = "";
  223 + String yinsu = "";
  224 +
  225 + Map otherMap = JsonUtil.jkstr2Obj(otherHighRisk, Map.class);
  226 + if (otherMap!=null){
  227 + if (otherMap.get("fyyse")!=null){
  228 + String id = otherMap.get("fyyse").toString();
  229 + color = FunvCommonUtil.getBaseicConfigByid(id,basicConfigService);
  230 + if (color.indexOf("预警") > -1) {
  231 + color = color.replace("预警", "");
  232 + }
  233 + }
  234 + if (otherMap.get("fxpf")!=null){
  235 + String id = otherMap.get("fxpf").toString();
  236 + pingfen = FunvCommonUtil.getBaseicConfigByid(id,basicConfigService);
  237 + }
  238 + if (otherMap.get("fxysu")!=null){
  239 + yinsu = otherMap.get("fxysu").toString();
  240 + }
  241 + }
  242 + map.put("color", "risk_" + RiskDefaultTypeEnum.getColor(color));
  243 + map.put("score",pingfen);
  244 + map.put("name",yinsu);
  245 + return map;
  246 + }
  247 +
  248 + public static List<Map<String,Object>> queryHighRisk(HighScoreResult result){
  249 +
  250 + if (result==null){
  251 + return null;
  252 + }
  253 +
  254 + List<Map<String,Object>> mapList = new ArrayList<>();
  255 +
  256 + if (CollectionUtils.isNotEmpty(result.getHighRisk())){
  257 + List<Map> list = (List<Map>)result.getHighRisk();
  258 + if (CollectionUtils.isNotEmpty(list)){
  259 + for (Map m : list){
  260 +
  261 + Map<String,Object> map = new HashMap<>();
  262 +
  263 + if (m.get("name")!=null){
  264 + map.put("name",m.get("name"));
  265 + }
  266 + if (m.get("color")!=null){
  267 + map.put("color",m.get("color"));
  268 + }
  269 +
  270 + mapList.add(map);
  271 + }
  272 + }
  273 + }
  274 + return mapList;
  275 + }
  276 +
  277 +
  278 +
  279 +
148 280 public static void main(String[] str) {
149 281 // String ssss = "{\"qztp\":true,\"yesOrNo\":\"no\",\"tpzb\":true,\"zxqqz\":true,\"zxqqq\":true,\"tpzl\":true," +
150 282 // "\"zxmxgxybfzxqq\":true,\"chcx\":true,\"rshbmxgxy\":true,\"tmzp\":true,\"rsqgxy\":true,\"qt\":false,\"qtText\":\"11\"}";
151 283  
... ... @@ -154,12 +286,10 @@
154 286 // String a = replace(m);
155 287 // System.out.print("哈哈.................... " + a);
156 288  
157   - String s = "{\"qt\":true,\"jsjmj\":true,\"ydqjd\":\"5769ef930cf2d37f03479390\",\"qtText\":\"其他\",\"yesOrNO\":\"yes\",\"dc\":true}";
158   - Map m = JsonUtil.str2Obj(s,Map.class);
  289 +// String s = "{\"qt\":true,\"jsjmj\":true,\"ydqjd\":\"5769ef930cf2d37f03479390\",\"qtText\":\"其他\",\"yesOrNO\":\"yes\",\"dc\":true}";
  290 +// Map m = JsonUtil.str2Obj(s,Map.class);
  291 +// String a = replaceYDFMW(m,1);
159 292  
160   - String a = replaceYDFMW(m,1);
161   -
162   - System.out.print("......................... "+ a);
163 293 }
164 294  
165 295 }